/*! For license information please see sdk.min.js.LICENSE.txt */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(()=>(()=>{var t={710:function(t){var e;e=()=>(()=>{"use strict";var t={330:t=>{t.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>Y});var i={};r.r(i),r.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>S,BaseRequest:()=>O});var o={};r.r(o),r.d(o,{Channel:()=>A,CoreApplication:()=>L,Device:()=>R,DeviceStatus:()=>T,ErrorDictionary:()=>_,ErrorModel:()=>I,EventType:()=>w,TopicSubscribeType:()=>N});var s={};r.r(s),r.d(s,{CommonUtils:()=>C,CorePermissions:()=>D,CryptoUtils:()=>B,ErrorUtils:()=>b,JsonUtils:()=>U,Log:()=>m,LogLevel:()=>y,TopicUtils:()=>j,Validations:()=>V});var a={platform:"webpush",version:"0.0.1"};const u=r(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==l.length}return!1}setItem(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}getItem(t){return null!=this.storage?this.storage.getItem(t):null}deleteItem(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}clear(){this.storage&&this.storage.clear()}},h=l,f=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise(((t,e)=>{const r=this.IDB;if(r){const n=r.open("indigitall.indexedDB",1);n.onupgradeneeded=function(){n.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},n.onsuccess=function(){const e=n.result,r=e.transaction("indigitallStore","readwrite"),i=r.objectStore("indigitallStore"),o=i.index("storeIndex");t({db:e,tx:r,store:i,index:o})},n.onerror=function(t){e(t)}}else e(!1)}))}async get(t,e){return new Promise(((r,n)=>{t||n(!1),t.index.get(e).onsuccess=e=>{e.target.result&&(this.close(t),r(e.target.result.store.value)),n(!1)}}))}async put(t,e,r){return new Promise(((n,i)=>{t||i(!1),t.store.put({store:{key:e,value:r}},e).onsuccess=e=>{this.close(t),n(r)}}))}close(t){if(t.tx)try{t.tx.oncomplete=()=>{t.db.close()}}catch(t){console.error(this.TAG,t)}}async setItem(t,e){try{const r=await this.getDB();return this.put(r,t,e)}catch(t){return t}}async getItem(t){try{const e=await this.getDB();return this.get(e,t)}catch(t){return t}}},d=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==d.length}return!1}getItem(t){return null!=this.session?this.session.getItem(t):null}setItem(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=d,E=class{constructor(){this.storage=h,this.db=f,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(t,e){p.setItem(t,e)}getItemSessionStorage(t){return p.getItem(t)}clearSessionStorage(){p.clearMessages()}setStorage(t,e){h.setItem(t,e)}getStorage(t){return h.getItem(t)}clearStorage(){h.clear()}setBrowserPublicKey(t){h.setItem(this.BROWSER_PUBLIC_KEY,t)}getBrowserPublicKey(){return h.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(t){h.setItem(this.BROWSER_PRIVATE_KEY,t)}getBrowserPrivateKey(){return h.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(t){h.setItem(this.APP_KEY,t),f&&f.IDB&&await f.setItem(this.APP_KEY,t)}getAppKey(){return h.getItem(this.APP_KEY)}async setDeviceId(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(f&&f.IDB)return await f.getItem(this.APP_KEY)}setVAPID(t){h.setItem(this.VAPID_PUBLIC,t)}getVAPID(){return h.getItem(this.VAPID_PUBLIC)}setEnabled(t){h.setItem(this.ENABLED,t)}getEnabled(){return h.getItem(this.ENABLED)}setServiceSyncTime(t){h.setItem(this.SERVICE_SYNC_TIME,t*this.BASE_TIME)}getServiceSyncTime(){return h.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(t){h.setItem(this.LOCATION_ENABLED,t)}getLocationEnabled(){return h.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(t){h.setItem(this.LOCATION_UPDATE_MINUTES,t)}getLocationUpdateMinutes(){return h.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(t){h.setItem(this.REQUEST_LOCATION,t)}getRequestLocation(){return!!h&&h.getItem(this.REQUEST_LOCATION)}async setPlatform(t){h.setItem(this.PLATFORM,t)}getPlatform(){return h&&h.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(t){h.setItem(this.BROWSER_NAME,t)}getBrowserName(){return h.getItem(this.BROWSER_NAME)}setBrowserVersion(t){h.setItem(this.BROWSER_VERSION,t)}getBrowserVersion(){return h.getItem(this.BROWSER_VERSION)}async setOsName(t){h.setItem(this.OS_NAME,t)}getOsName(){return h.getItem(this.OS_NAME)}setOsVersion(t){h.setItem(this.OS_VERSION,t)}getOsVersion(){return h.getItem(this.OS_VERSION)}setDeviceType(t){h.setItem(this.DEVICE_TYPE,t)}getDeviceType(){return h.getItem(this.DEVICE_TYPE)}setSupported(t){h.setItem(this.SUPPORTED,t)}getSupported(){return h.getItem(this.SUPPORTED)}setServiceTimestamp(t){h.setItem(this.SERVICE_TIMESTAMP,t)}getServiceTimestamp(){return h.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(t){h.setItem(this.LOCATION_TIMESTAMP,t)}getLocationTimestamp(){return h.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(t){h.setItem(this.PERMISSION_LOCATION,t)}getPermissionLocation(){return h.getItem(this.PERMISSION_LOCATION)}setDebugLog(t){h.setItem(this.SET_LOG_DEBUG,t)}getDebugLog(){return"false"!==h.getItem(this.SET_LOG_DEBUG)}setLogLevel(t){h.setItem(this.LOG_LEVEL,t)}getLogLevel(){return h.getItem(this.LOG_LEVEL)}setNewUserTimestamp(t){h.setItem(this.NEW_USER_TIMESTAMP,t)}getNewUserTimestamp(){return h.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(t){h&&h.isLocalStorageAvailable()&&h.setItem(this.EXTERNAL_ID,t),f&&f.IDB&&await f.setItem(this.EXTERNAL_ID,t)}async getExternalIdRequest(){let t;try{h&&h.isLocalStorageAvailable()?t=h.getItem(this.EXTERNAL_ID):f&&f.IDB&&(t=await f.getItem(this.EXTERNAL_ID))}catch(t){}return t}setExternalId(t){h.setItem(this.EXTERNAL_ID,t)}getExternalId(){return h.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return h.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(t){h.setItem(this.REGISTERED_BY_COOKIE,t)}setLatitude(t){h.setItem(this.LATITUDE,t)}getLatitude(){return h.getItem(this.LATITUDE)}setLongitude(t){h.setItem(this.LONGITUDE,t)}getLongitude(){return h.getItem(this.LONGITUDE)}async setInAppTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,t)}async getInAppTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS))}catch(t){}return t}async setTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,t)}async getTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_LIST))}catch(t){}return t}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(t){this.setStorage(this.URL_INAPP_API,t)}setInAppEnabled(t){this.setStorage(this.INAPP_ENABLED,t)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(t){this.setStorage(this.AVOID_CYPHER,t)}isAvoidCypher(){return this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}async setUrlDeviceApi(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,t)}setPushDisabled(t){this.setStorage(this.PUSH_DISABLED,t)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(t){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,t)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(t){this.setStorage(this.CONFIG_V2,t)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,t)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,t)}},y=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),v=y;class g{constructor(t){this.tag="[IND]",t&&(this.tag=t),this.level=v.INFO,this.setLogLevel((new E).getLogLevel()),this.log=[]}setLogLevel(t){t&&t>=v.DEBUG&&t<=v.ERROR&&(this.level=t)}static addedAsString(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}d(){if(this.level<=v.DEBUG)for(let t=0;t0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const m=g,I=class{constructor(t,e,r){this.errorCode=t,this.errorMessage=e,null!=r&&(this.exceptionMessage=r)}},_={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(t,e,r){if(null!=t){const n=Object.values(t.ErrorCode).indexOf(e);if(n>=0){const e=Object.keys(t.ErrorCode)[n],i=Object.values(t.ErrorCode)[n];return new I({code:e,errorId:i},Object.values(t.ErrorMessage)[n],r)}return new I(_.ErrorCode.GENERAL_ERROR,"general error",r)}}},S=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(t,e,r,n){const i=new m("[IND]BaseClient: ");r.isServiceWorkerRequest()&&i.setLogLevel(v.DEBUG);let o=await this.getURL()+r.getPath(e)+r.getParams();r.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:t,headers:r.addHeaders()};t!==this.GET&&(s.body=JSON.stringify(r.getBody())),n&&(s.credentials=n);try{const e=await fetch(o,s);if(304!=e.status){const n=await e.json();return e.ok?(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\nResponse Body:",JSON.stringify(n.data,null,"\t")).writeLog(),n):(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\n").writeLog(),new I(n.statusCode,n.message))}return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+e.status+"\n").writeLog(),e}catch(e){return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Error: "+e).writeLog(),b.showError(_,_.ErrorCode.GENERAL_ERROR,e)}}async get(t,e){return await this.call(this.GET,t,e)}async post(t,e,r){return await this.call(this.POST,t,e,r)}async put(t,e,r){return await this.call(this.PUT,t,e,r)}async delete(t,e){return await this.call(this.DELETE,t,e)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new E).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(t){let e=t;return Object.keys(this.pathParams).forEach((t=>{e=e.replace(t,this.pathParams[t])})),e}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(t){this.serviceWorkerRequest=t}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(t){this.journeyRequest=t}},P=class extends O{constructor(t=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=t}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let t="";if(this.channels&&this.channels.length>0)for(let e=0;e{new m("[IND]CorePermissions: ").d(t+" permission state has changed from "+n+" to "+r.state).writeLog(),n=r.state,e&&e({name:t,state:r.state})})}}},M=new m("[IND]Crypto"),k=new TextEncoder("utf-8"),x="HMAC",B=class{static async createHmac(t,e){try{let r="";if(!0===(new E).isAvoidCypher())r=e;else{const n=window?.crypto?.subtle;if(!n)return;const i=await n.importKey("raw",k.encode(t),{name:x,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await n.sign(x,i,k.encode(e)),s=new Uint8Array(o);r=Array.prototype.map.call(s,(t=>("00"+t.toString(16)).slice(-2))).join(""),M.d("hmac: ",r).writeLog()}return r}catch(t){return void M.e("error:",t).writeLog()}}},U=class{static compareJSON(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(t[n]!==e[n]){if("object"!=typeof t[n]||"object"!=typeof e[n])return!1;if(!isEqual(t[n],e[n]))return!1}return!0}},V=class{static isValidFormat(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}},j=class{static setTopicChannel(t,e){const r=[];for(let n=0;n{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(e,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=u(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}(r(710));Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var s,a=(s=r(610))&&s.__esModule?s:{default:s};function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(u=function(t){return t?r:e})(t)}},468:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=u(r(254)),i=u(r(234)),o=u(r(457)),s=u(r(735)),a=u(r(630));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var u=d(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==c(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){h(o,n,i,s,a,"next",t)}function a(t){h(o,n,i,s,a,"throw",t)}s(void 0)}))}}function d(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BaseClient",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var n=s(r(468)),i=s(r(237)),o=s(r(773));function s(t){return t&&t.__esModule?t:{default:t}}},773:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=a(this,e)).PARAM_APPLICATION_CHANNEL="channel",t.channels=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(e,t),function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var t="";if(this.channels&&this.channels.length>0)for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={platform:"webpush",version:"0.0.1"},i=r(904);n.version=i.version,n=Object.assign(n,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}});e.default=n},610:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=h(r(122)),o=h(r(291)),s=l(r(545)),a=l(r(225)),u=l(r(628));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function h(t){return t&&t.__esModule?t:{default:t}}e.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Channel=void 0;var r=e.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});e.default=r},174:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(r(291)),o=s(r(254));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=new i.default;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);var s=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,s=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):s=new Date(Date.now()+36e5),!r){var a=s.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+a).writeLog(),n.setConfigV2ServiceSyncTime(a)}}}));e.default=l},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):r?(e.enabled&&(this.enabled=e.enabled,(new i.default).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}),[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(t){this.deviceId=t}},{key:"setExternalCode",value:function(t){this.externalCode=t}},{key:"toJSON",value:function(){var t={};return this.platform&&(t.platform=this.platform),this.version&&(t.version=this.version),this.productName&&(t.productName=this.productName),this.productVersion&&(t.productVersion=this.productVersion),this.browserName&&(t.browserName=this.browserName),this.browserVersion&&(t.browserVersion=this.browserVersion),this.osName&&(t.osName=this.osName),this.osVersion&&(t.osVersion=this.osVersion),this.deviceType&&(t.deviceType=this.deviceType),this.locale&&(t.locale=this.locale),this.timeZone&&(t.timeZome=this.timeZone),this.timeOffset&&(t.timeOffset=this.timeOffset),this.deviceId&&(t.deviceId=this.deviceId),this.enabled&&(t.enabled=this.enabled),this.browserPublicKey&&(t.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(t.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(t.externalCode=this.externalCode),t}}])}();e.default=u},89:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});e.default=r},735:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410};var n={ErrorCode:r,ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};e.default=n},234:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});e.default=r},72:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});e.default=r},225:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.Channel}}),Object.defineProperty(e,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var n=r(902),i=h(r(395)),o=h(r(89)),s=h(r(735)),a=h(r(234)),u=h(r(953)),c=h(r(72)),l=h(r(174));function h(t){return t&&t.__esModule?t:{default:t}}},672:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:T(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==i&&o.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(122)),i=a(r(87)),o=a(r(672)),s=a(r(238));function a(t){return t&&t.__esModule?t:{default:t}}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==u(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)}))}}function f(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(254))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))}}function c(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CryptoUtils=void 0;var n=i(r(291));function i(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(735)),i=o(r(234));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=0){var s={code:Object.keys(t.ErrorCode)[o],errorId:Object.values(t.ErrorCode)[o]};return new i.default(s,Object.values(t.ErrorMessage)[o],r)}return new i.default(n.default.ErrorCode.GENERAL_ERROR,"general error",r)}}}])&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();e.default=new c},325:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(630));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=i.default.DEBUG&&t<=i.default.ERROR&&(this.level=t)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var e=0;e0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();e.default=c},630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LogLevel=void 0;var r=e.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});e.default=r},662:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r8}}],(e=null)&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();e.default=o},628:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"CommonUtils",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(e,"TopicUtils",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"Validations",{enumerable:!0,get:function(){return l.default}});var n=f(r(622)),i=f(r(429)),o=f(r(170)),s=f(r(457)),a=f(r(325)),u=f(r(254)),c=r(630),l=f(r(332)),h=f(r(662));function f(t){return t&&t.__esModule?t:{default:t}}},740:function(t){var e;e=()=>(()=>{var t={710:function(t){var e;e=()=>(()=>{"use strict";var t={330:t=>{t.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>Y});var i={};r.r(i),r.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>S,BaseRequest:()=>O});var o={};r.r(o),r.d(o,{Channel:()=>A,CoreApplication:()=>L,Device:()=>R,DeviceStatus:()=>T,ErrorDictionary:()=>_,ErrorModel:()=>I,EventType:()=>w,TopicSubscribeType:()=>N});var s={};r.r(s),r.d(s,{CommonUtils:()=>C,CorePermissions:()=>D,CryptoUtils:()=>B,ErrorUtils:()=>b,JsonUtils:()=>U,Log:()=>m,LogLevel:()=>y,TopicUtils:()=>j,Validations:()=>V});var a={platform:"webpush",version:"0.0.1"};const u=r(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==l.length}return!1}setItem(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}getItem(t){return null!=this.storage?this.storage.getItem(t):null}deleteItem(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}clear(){this.storage&&this.storage.clear()}},h=l,f=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise(((t,e)=>{const r=this.IDB;if(r){const n=r.open("indigitall.indexedDB",1);n.onupgradeneeded=function(){n.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},n.onsuccess=function(){const e=n.result,r=e.transaction("indigitallStore","readwrite"),i=r.objectStore("indigitallStore"),o=i.index("storeIndex");t({db:e,tx:r,store:i,index:o})},n.onerror=function(t){e(t)}}else e(!1)}))}async get(t,e){return new Promise(((r,n)=>{t||n(!1),t.index.get(e).onsuccess=e=>{e.target.result&&(this.close(t),r(e.target.result.store.value)),n(!1)}}))}async put(t,e,r){return new Promise(((n,i)=>{t||i(!1),t.store.put({store:{key:e,value:r}},e).onsuccess=e=>{this.close(t),n(r)}}))}close(t){if(t.tx)try{t.tx.oncomplete=()=>{t.db.close()}}catch(t){console.error(this.TAG,t)}}async setItem(t,e){try{const r=await this.getDB();return this.put(r,t,e)}catch(t){return t}}async getItem(t){try{const e=await this.getDB();return this.get(e,t)}catch(t){return t}}},d=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==d.length}return!1}getItem(t){return null!=this.session?this.session.getItem(t):null}setItem(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=d,E=class{constructor(){this.storage=h,this.db=f,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(t,e){p.setItem(t,e)}getItemSessionStorage(t){return p.getItem(t)}clearSessionStorage(){p.clearMessages()}setStorage(t,e){h.setItem(t,e)}getStorage(t){return h.getItem(t)}clearStorage(){h.clear()}setBrowserPublicKey(t){h.setItem(this.BROWSER_PUBLIC_KEY,t)}getBrowserPublicKey(){return h.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(t){h.setItem(this.BROWSER_PRIVATE_KEY,t)}getBrowserPrivateKey(){return h.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(t){h.setItem(this.APP_KEY,t),f&&f.IDB&&await f.setItem(this.APP_KEY,t)}getAppKey(){return h.getItem(this.APP_KEY)}async setDeviceId(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(f&&f.IDB)return await f.getItem(this.APP_KEY)}setVAPID(t){h.setItem(this.VAPID_PUBLIC,t)}getVAPID(){return h.getItem(this.VAPID_PUBLIC)}setEnabled(t){h.setItem(this.ENABLED,t)}getEnabled(){return h.getItem(this.ENABLED)}setServiceSyncTime(t){h.setItem(this.SERVICE_SYNC_TIME,t*this.BASE_TIME)}getServiceSyncTime(){return h.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(t){h.setItem(this.LOCATION_ENABLED,t)}getLocationEnabled(){return h.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(t){h.setItem(this.LOCATION_UPDATE_MINUTES,t)}getLocationUpdateMinutes(){return h.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(t){h.setItem(this.REQUEST_LOCATION,t)}getRequestLocation(){return!!h&&h.getItem(this.REQUEST_LOCATION)}async setPlatform(t){h.setItem(this.PLATFORM,t)}getPlatform(){return h&&h.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(t){h.setItem(this.BROWSER_NAME,t)}getBrowserName(){return h.getItem(this.BROWSER_NAME)}setBrowserVersion(t){h.setItem(this.BROWSER_VERSION,t)}getBrowserVersion(){return h.getItem(this.BROWSER_VERSION)}async setOsName(t){h.setItem(this.OS_NAME,t)}getOsName(){return h.getItem(this.OS_NAME)}setOsVersion(t){h.setItem(this.OS_VERSION,t)}getOsVersion(){return h.getItem(this.OS_VERSION)}setDeviceType(t){h.setItem(this.DEVICE_TYPE,t)}getDeviceType(){return h.getItem(this.DEVICE_TYPE)}setSupported(t){h.setItem(this.SUPPORTED,t)}getSupported(){return h.getItem(this.SUPPORTED)}setServiceTimestamp(t){h.setItem(this.SERVICE_TIMESTAMP,t)}getServiceTimestamp(){return h.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(t){h.setItem(this.LOCATION_TIMESTAMP,t)}getLocationTimestamp(){return h.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(t){h.setItem(this.PERMISSION_LOCATION,t)}getPermissionLocation(){return h.getItem(this.PERMISSION_LOCATION)}setDebugLog(t){h.setItem(this.SET_LOG_DEBUG,t)}getDebugLog(){return"false"!==h.getItem(this.SET_LOG_DEBUG)}setLogLevel(t){h.setItem(this.LOG_LEVEL,t)}getLogLevel(){return h.getItem(this.LOG_LEVEL)}setNewUserTimestamp(t){h.setItem(this.NEW_USER_TIMESTAMP,t)}getNewUserTimestamp(){return h.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(t){h&&h.isLocalStorageAvailable()&&h.setItem(this.EXTERNAL_ID,t),f&&f.IDB&&await f.setItem(this.EXTERNAL_ID,t)}async getExternalIdRequest(){let t;try{h&&h.isLocalStorageAvailable()?t=h.getItem(this.EXTERNAL_ID):f&&f.IDB&&(t=await f.getItem(this.EXTERNAL_ID))}catch(t){}return t}setExternalId(t){h.setItem(this.EXTERNAL_ID,t)}getExternalId(){return h.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return h.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(t){h.setItem(this.REGISTERED_BY_COOKIE,t)}setLatitude(t){h.setItem(this.LATITUDE,t)}getLatitude(){return h.getItem(this.LATITUDE)}setLongitude(t){h.setItem(this.LONGITUDE,t)}getLongitude(){return h.getItem(this.LONGITUDE)}async setInAppTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,t)}async getInAppTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS))}catch(t){}return t}async setTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,t)}async getTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_LIST))}catch(t){}return t}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(t){this.setStorage(this.URL_INAPP_API,t)}setInAppEnabled(t){this.setStorage(this.INAPP_ENABLED,t)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(t){this.setStorage(this.AVOID_CYPHER,t)}isAvoidCypher(){return this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}async setUrlDeviceApi(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,t)}setPushDisabled(t){this.setStorage(this.PUSH_DISABLED,t)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(t){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,t)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(t){this.setStorage(this.CONFIG_V2,t)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,t)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,t)}},y=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),v=y;class g{constructor(t){this.tag="[IND]",t&&(this.tag=t),this.level=v.INFO,this.setLogLevel((new E).getLogLevel()),this.log=[]}setLogLevel(t){t&&t>=v.DEBUG&&t<=v.ERROR&&(this.level=t)}static addedAsString(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}d(){if(this.level<=v.DEBUG)for(let t=0;t0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const m=g,I=class{constructor(t,e,r){this.errorCode=t,this.errorMessage=e,null!=r&&(this.exceptionMessage=r)}},_={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(t,e,r){if(null!=t){const n=Object.values(t.ErrorCode).indexOf(e);if(n>=0){const e=Object.keys(t.ErrorCode)[n],i=Object.values(t.ErrorCode)[n];return new I({code:e,errorId:i},Object.values(t.ErrorMessage)[n],r)}return new I(_.ErrorCode.GENERAL_ERROR,"general error",r)}}},S=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(t,e,r,n){const i=new m("[IND]BaseClient: ");r.isServiceWorkerRequest()&&i.setLogLevel(v.DEBUG);let o=await this.getURL()+r.getPath(e)+r.getParams();r.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:t,headers:r.addHeaders()};t!==this.GET&&(s.body=JSON.stringify(r.getBody())),n&&(s.credentials=n);try{const e=await fetch(o,s);if(304!=e.status){const n=await e.json();return e.ok?(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\nResponse Body:",JSON.stringify(n.data,null,"\t")).writeLog(),n):(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\n").writeLog(),new I(n.statusCode,n.message))}return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+e.status+"\n").writeLog(),e}catch(e){return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Error: "+e).writeLog(),b.showError(_,_.ErrorCode.GENERAL_ERROR,e)}}async get(t,e){return await this.call(this.GET,t,e)}async post(t,e,r){return await this.call(this.POST,t,e,r)}async put(t,e,r){return await this.call(this.PUT,t,e,r)}async delete(t,e){return await this.call(this.DELETE,t,e)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new E).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(t){let e=t;return Object.keys(this.pathParams).forEach((t=>{e=e.replace(t,this.pathParams[t])})),e}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(t){this.serviceWorkerRequest=t}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(t){this.journeyRequest=t}},P=class extends O{constructor(t=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=t}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let t="";if(this.channels&&this.channels.length>0)for(let e=0;e{new m("[IND]CorePermissions: ").d(t+" permission state has changed from "+n+" to "+r.state).writeLog(),n=r.state,e&&e({name:t,state:r.state})})}}},M=new m("[IND]Crypto"),k=new TextEncoder("utf-8"),x="HMAC",B=class{static async createHmac(t,e){try{let r="";if(!0===(new E).isAvoidCypher())r=e;else{const n=window?.crypto?.subtle;if(!n)return;const i=await n.importKey("raw",k.encode(t),{name:x,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await n.sign(x,i,k.encode(e)),s=new Uint8Array(o);r=Array.prototype.map.call(s,(t=>("00"+t.toString(16)).slice(-2))).join(""),M.d("hmac: ",r).writeLog()}return r}catch(t){return void M.e("error:",t).writeLog()}}},U=class{static compareJSON(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(t[n]!==e[n]){if("object"!=typeof t[n]||"object"!=typeof e[n])return!1;if(!isEqual(t[n],e[n]))return!1}return!0}},V=class{static isValidFormat(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}},j=class{static setTopicChannel(t,e){const r=[];for(let n=0;n{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(e,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=u(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}(r(710));Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var s,a=(s=r(610))&&s.__esModule?s:{default:s};function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(u=function(t){return t?r:e})(t)}},468:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=u(r(254)),i=u(r(234)),o=u(r(457)),s=u(r(735)),a=u(r(630));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var u=d(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==c(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){h(o,n,i,s,a,"next",t)}function a(t){h(o,n,i,s,a,"throw",t)}s(void 0)}))}}function d(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BaseClient",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var n=s(r(468)),i=s(r(237)),o=s(r(773));function s(t){return t&&t.__esModule?t:{default:t}}},773:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,r){return e=u(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,a()?Reflect.construct(e,r||[],u(t).constructor):e.apply(t,r))}(this,e)).PARAM_APPLICATION_CHANNEL="channel",t.channels=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),function(t,e){return e&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var t="";if(this.channels&&this.channels.length>0)for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={platform:"webpush",version:"0.0.1"},i=r(904);n.version=i.version,n=Object.assign(n,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),e.default=n},610:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=h(r(122)),o=h(r(291)),s=l(r(545)),a=l(r(225)),u=l(r(628));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function h(t){return t&&t.__esModule?t:{default:t}}e.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Channel=void 0;var r=e.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});e.default=r},174:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(r(291)),o=s(r(254));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=new i.default;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);var s=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,s=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):s=new Date(Date.now()+36e5),!r){var a=s.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+a).writeLog(),n.setConfigV2ServiceSyncTime(a)}}}));e.default=c},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):r?(e.enabled&&(this.enabled=e.enabled,(new i.default).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}),[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(t){this.deviceId=t}},{key:"setExternalCode",value:function(t){this.externalCode=t}},{key:"toJSON",value:function(){var t={};return this.platform&&(t.platform=this.platform),this.version&&(t.version=this.version),this.productName&&(t.productName=this.productName),this.productVersion&&(t.productVersion=this.productVersion),this.browserName&&(t.browserName=this.browserName),this.browserVersion&&(t.browserVersion=this.browserVersion),this.osName&&(t.osName=this.osName),this.osVersion&&(t.osVersion=this.osVersion),this.deviceType&&(t.deviceType=this.deviceType),this.locale&&(t.locale=this.locale),this.timeZone&&(t.timeZome=this.timeZone),this.timeOffset&&(t.timeOffset=this.timeOffset),this.deviceId&&(t.deviceId=this.deviceId),this.enabled&&(t.enabled=this.enabled),this.browserPublicKey&&(t.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(t.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(t.externalCode=this.externalCode),t}}]);e.default=u},89:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});e.default=r},735:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};e.default=r},234:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});e.default=r},72:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});e.default=r},225:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.Channel}}),Object.defineProperty(e,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var n=r(902),i=h(r(395)),o=h(r(89)),s=h(r(735)),a=h(r(234)),u=h(r(953)),c=h(r(72)),l=h(r(174));function h(t){return t&&t.__esModule?t:{default:t}}},672:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:T(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==i&&o.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(122)),i=a(r(87)),o=a(r(672)),s=a(r(238));function a(t){return t&&t.__esModule?t:{default:t}}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==u(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)}))}}function f(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(254))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))}}function c(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CryptoUtils=void 0;var n=i(r(291));function i(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(735)),i=o(r(234));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=0){var s={code:Object.keys(t.ErrorCode)[o],errorId:Object.values(t.ErrorCode)[o]};return new i.default(s,Object.values(t.ErrorMessage)[o],r)}return new i.default(n.default.ErrorCode.GENERAL_ERROR,"general error",r)}}}])&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=new c},325:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(630));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=i.default.DEBUG&&t<=i.default.ERROR&&(this.level=t)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var e=0;e0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();e.default=c},630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LogLevel=void 0;var r=e.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});e.default=r},662:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r8}}],e&&n(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=o},628:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"CommonUtils",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(e,"TopicUtils",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"Validations",{enumerable:!0,get:function(){return l.default}});var n=f(r(622)),i=f(r(429)),o=f(r(170)),s=f(r(457)),a=f(r(325)),u=f(r(254)),c=r(630),l=f(r(332)),h=f(r(662));function f(t){return t&&t.__esModule?t:{default:t}}},904:t=>{"use strict";t.exports=JSON.parse('{"_from":"indigitall-web-core@4.9.2","_id":"indigitall-web-core@4.9.2","_inBundle":false,"_integrity":"sha512-aGTfAnLDU6FrokX4B7XvAWEX2Obl/hlcz9OTPFOI/yQIwIKpjfZJ1BEVeCWvDiSEAYhLek73ppnFdV66cUxcGA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.9.2","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.9.2","saveSpec":null,"fetchSpec":"4.9.2"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.9.2.tgz","_shasum":"710cb6aaf9858cce437e850a450c7fc81cf71a03","_spec":"indigitall-web-core@4.9.2","_where":"/home/circleci/webpush/customer","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.9.2"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>O});const{Repository:t}=r(315).Core,e=new class extends t{constructor(){super(),this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID"}async setDeviceId(t){this.setStorage(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}},{Validations:i,Log:o}=r(315).Core.Utils,s=class extends i{static isAppKeyFormat(){const t=e.getAppKey();return null!=t&&""!=t&&"null"!=t&&t.length>3}static isValidFormatRequest(){const t=new o("[IND]CustomerValidations: "),r=e.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,t.w("appKey is null or empty").writeLog()),e.isPushDisabled()||this.isValidFormat(r)||(n=!1,t.w("deviceId is null or empty").writeLog()),n}},a=class{constructor(t){t.id&&(this.id=t.id),t.customerId&&(this.customerId=t.customerId),t.applicationId&&(this.applicationId=t.applicationId),t.createdAt&&(this.createdAt=t.createdAt),t.updatedAt&&(this.updatedAt=t.updatedAt)}getCustomerId(){return this.customerId}getApplicationId(){return this.applicationId}getId(){return this.id}getCreatedAt(){return this.createdAt}getUpdatedAt(){return this.updatedAt}toJSON(){return{id:this.id,customerId:this.customerId,applicationId:this.applicationId,createdAt:this.createdAt,updatedAt:this.updatedAt}}},u=class{constructor(t,e){this.customerFieldKey=t,this.customerFieldValue=e}getCustomerFieldKey(){return this.customerFieldKey}getCustomerFieldValue(){return this.customerFieldValue}toJSON(){return JSON.parse(`"${this.customerFieldKey}":"${this.customerFieldValue}"`)}},{ErrorDictionary:c}=r(315).Core.Models,l=c.ErrorCode;Object.assign(l,{CUSTOMER_GET_ERROR:4001,CUSTOMER_PARAMS_ERROR:4011,CUSTOMER_GENERAL_ERROR:4600,CUSTOMER_NO_EXTERNAL_CODE:4601,DISABLED_CHANNEL:4404});const h=c.ErrorMessage;Object.assign(h,{CUSTOMER_GET_ERROR:"customer get error",CUSTOMER_PARAMS_ERROR:"Params are not correct",CUSTOMER_GENERAL_ERROR:"general error",CUSTOMER_NO_EXTERNAL_CODE:"no external code registered",DISABLED_CHANNEL:"disabled channel"});const f={ErrorCode:l,ErrorMessage:h},{Config:d}=r(315).Core,{BaseClient:p}=r(315).Core.Api,{ErrorModel:E}=r(315).Core.Models,{CommonUtils:y,ErrorUtils:v}=r(315).Core.Utils,g=new class extends p{constructor(){super(),this.URL_BASE=d.client.CUSTOMER_URL_BASE,this.ENDPOINT_CUSTOMER="/customer",this.ENDPOINT_CUSTOMER_FIELD=this.ENDPOINT_CUSTOMER+"/field",this.ENDPOINT_CUSTOMER_LINK=this.ENDPOINT_CUSTOMER+"/link",this.ENDPOINT_EVENT="/event",this.ENDPOINT_CUSTOMER_EVENT_JOURNEY=this.ENDPOINT_CUSTOMER+this.ENDPOINT_EVENT+"/custom"}async getURL(){let t=await e.getUrlDeviceApi();return t?t=t.replaceAll("v1","v2"):d.client.CUSTOMER_URL_BASE}async getCustomer(t,r,n){if(s.isAppKeyFormat()&&s.isValidFormat(e.getExternalId())){const e=await this.get(this.ENDPOINT_CUSTOMER,t.getCustomerRequest());e&&!(e instanceof E)&&e.statusCode>=200&&e.statusCode<300?y.isFunction(r)&&r(new a(e.data)):e?y.isFunction(n)&&n(e):y.isFunction(n)&&n()}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async getCustomerField(t,r,n){if(s.isAppKeyFormat()&&s.isValidFormat(e.getExternalId())){const e=await this.get(this.ENDPOINT_CUSTOMER_FIELD,t.getCustomerFieldRequest()),i=[];for(const t in e.data)e.data.hasOwnProperty(t)&&i.push(new u(t,e.data[t]));e&&i.length>0&&!(e instanceof E)&&e.statusCode>=200&&e.statusCode<300?y.isFunction(r)&&r(i):e?y.isFunction(n)&&n(e):y.isFunction(n)&&n()}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async putCustomerField(t,r,n){if(s.isAppKeyFormat()&&s.isValidFormat(e.getExternalId())){const e=await this.put(this.ENDPOINT_CUSTOMER_FIELD,t.putCustomerFieldRequest());this.getCustomerResponse(e,r,n)}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async deleteCustomerField(t,r,n){if(s.isAppKeyFormat()&&s.isValidFormat(e.getExternalId())){const e=await this.delete(this.ENDPOINT_CUSTOMER_FIELD,t.deleteCustomerFieldRequest());this.getCustomerResponse(e,r,n)}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async postCustomerLink(t,r,n){if(s.isValidFormatRequest()&&s.isValidFormat(e.getExternalId())){const e=await this.post(this.ENDPOINT_CUSTOMER_LINK,t.postAndDeleteCustomerLinkRequest());this.getCustomerResponse(e,r,n)}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async deleteCustomerLink(t,r,n){if(s.isValidFormatRequest()&&s.isValidFormat(e.getExternalId())){const e=await this.delete(this.ENDPOINT_CUSTOMER_LINK,t.postAndDeleteCustomerLinkRequest());this.getCustomerResponse(e,r,n)}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}async getCustomerResponse(t,e,r){t&&!(t instanceof E)&&t.statusCode>=200&&t.statusCode<300?y.isFunction(e)&&(""!=t.data?e(t.data):e()):t?y.isFunction(r)&&r(t):y.isFunction(r)&&r()}async postCustomJourneyEvent(t,r,n){if(s.isValidFormatRequest()&&s.isValidFormat(e.getExternalId())){const e=await this.post(this.ENDPOINT_CUSTOMER_EVENT_JOURNEY,t.postCustomEventRequest());this.getCustomerResponse(e,r,n)}else y.isFunction(n)&&n(v.showError(f,f.ErrorCode.BAD_REQUEST_SERVER_ERROR))}},{BaseRequest:m}=r(315).Core.Api,{Device:I}=r(315).Core.Models,_=class extends m{constructor(){super(),this.device=new I,null!=e.getExternalId()&&(this.customerId=e.getExternalId()),this.fieldNames,this.link,this.fields,this.eventType,this.customData}getCustomerRequest(){return this.params=this.createQueryStringCustomerId(),this}getCustomerFieldRequest(){return this.params=this.createQueryString(),this}putCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createBodyJson(),this}deleteCustomerFieldRequest(){return this.params=this.createQueryStringCustomerId(),this.body=this.createDeleteBodyJson(),this}postAndDeleteCustomerLinkRequest(){return this.params="",this.body=this.createBodyJson(),this}postCustomEventRequest(){return this.params="",this.body=this.createCustomEventBodyJson(),this}createQueryString(){let t="";return t+=this.createQueryStringCustomerId(),this.fieldNames&&(t+=`&${this.PARAM_CUSTOMER_FIELD_NAMES}=${this.fieldNames}`),this.fields&&(t+=`&${this.PARAM_CUSTOMER_FIELDS}=${this.fields}`),this.link&&(t+=`&${this.PARAM_CUSTOMER_LINK}=${this.link}`),t}createQueryStringCustomerId(){return this.PARAM_CUSTOMER_ID+"="+this.customerId}createBodyJson(){let t={};try{this.channel&&"none"!=this.channel&&(t.channel=this.channel,this.device&&this.device.deviceId&&(t.deviceId=this.device.deviceId),this.customerId&&(t.customerId=this.customerId)),this.link&&(t.link=this.link),this.fields&&(t=this.fields)}catch(t){console.log("Error fieldNames request :"+t)}return t}createDeleteBodyJson(){const t={},e=[];try{if(this.fieldNames){for(let t=0;t{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={};Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=s(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(r(740));function s(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(s=function(t){return t?r:e})(t)}Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}))},126:function(t){var e;e=()=>(()=>{var t={710:function(t){var e;e=()=>(()=>{"use strict";var t={330:t=>{t.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>Y});var i={};r.r(i),r.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>S,BaseRequest:()=>O});var o={};r.r(o),r.d(o,{Channel:()=>A,CoreApplication:()=>L,Device:()=>R,DeviceStatus:()=>T,ErrorDictionary:()=>_,ErrorModel:()=>I,EventType:()=>w,TopicSubscribeType:()=>N});var s={};r.r(s),r.d(s,{CommonUtils:()=>C,CorePermissions:()=>D,CryptoUtils:()=>B,ErrorUtils:()=>b,JsonUtils:()=>U,Log:()=>m,LogLevel:()=>y,TopicUtils:()=>j,Validations:()=>V});var a={platform:"webpush",version:"0.0.1"};const u=r(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==l.length}return!1}setItem(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}getItem(t){return null!=this.storage?this.storage.getItem(t):null}deleteItem(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}clear(){this.storage&&this.storage.clear()}},h=l,f=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise(((t,e)=>{const r=this.IDB;if(r){const n=r.open("indigitall.indexedDB",1);n.onupgradeneeded=function(){n.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},n.onsuccess=function(){const e=n.result,r=e.transaction("indigitallStore","readwrite"),i=r.objectStore("indigitallStore"),o=i.index("storeIndex");t({db:e,tx:r,store:i,index:o})},n.onerror=function(t){e(t)}}else e(!1)}))}async get(t,e){return new Promise(((r,n)=>{t||n(!1),t.index.get(e).onsuccess=e=>{e.target.result&&(this.close(t),r(e.target.result.store.value)),n(!1)}}))}async put(t,e,r){return new Promise(((n,i)=>{t||i(!1),t.store.put({store:{key:e,value:r}},e).onsuccess=e=>{this.close(t),n(r)}}))}close(t){if(t.tx)try{t.tx.oncomplete=()=>{t.db.close()}}catch(t){console.error(this.TAG,t)}}async setItem(t,e){try{const r=await this.getDB();return this.put(r,t,e)}catch(t){return t}}async getItem(t){try{const e=await this.getDB();return this.get(e,t)}catch(t){return t}}},d=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==d.length}return!1}getItem(t){return null!=this.session?this.session.getItem(t):null}setItem(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=d,E=class{constructor(){this.storage=h,this.db=f,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(t,e){p.setItem(t,e)}getItemSessionStorage(t){return p.getItem(t)}clearSessionStorage(){p.clearMessages()}setStorage(t,e){h.setItem(t,e)}getStorage(t){return h.getItem(t)}clearStorage(){h.clear()}setBrowserPublicKey(t){h.setItem(this.BROWSER_PUBLIC_KEY,t)}getBrowserPublicKey(){return h.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(t){h.setItem(this.BROWSER_PRIVATE_KEY,t)}getBrowserPrivateKey(){return h.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(t){h.setItem(this.APP_KEY,t),f&&f.IDB&&await f.setItem(this.APP_KEY,t)}getAppKey(){return h.getItem(this.APP_KEY)}async setDeviceId(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(f&&f.IDB)return await f.getItem(this.APP_KEY)}setVAPID(t){h.setItem(this.VAPID_PUBLIC,t)}getVAPID(){return h.getItem(this.VAPID_PUBLIC)}setEnabled(t){h.setItem(this.ENABLED,t)}getEnabled(){return h.getItem(this.ENABLED)}setServiceSyncTime(t){h.setItem(this.SERVICE_SYNC_TIME,t*this.BASE_TIME)}getServiceSyncTime(){return h.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(t){h.setItem(this.LOCATION_ENABLED,t)}getLocationEnabled(){return h.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(t){h.setItem(this.LOCATION_UPDATE_MINUTES,t)}getLocationUpdateMinutes(){return h.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(t){h.setItem(this.REQUEST_LOCATION,t)}getRequestLocation(){return!!h&&h.getItem(this.REQUEST_LOCATION)}async setPlatform(t){h.setItem(this.PLATFORM,t)}getPlatform(){return h&&h.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(t){h.setItem(this.BROWSER_NAME,t)}getBrowserName(){return h.getItem(this.BROWSER_NAME)}setBrowserVersion(t){h.setItem(this.BROWSER_VERSION,t)}getBrowserVersion(){return h.getItem(this.BROWSER_VERSION)}async setOsName(t){h.setItem(this.OS_NAME,t)}getOsName(){return h.getItem(this.OS_NAME)}setOsVersion(t){h.setItem(this.OS_VERSION,t)}getOsVersion(){return h.getItem(this.OS_VERSION)}setDeviceType(t){h.setItem(this.DEVICE_TYPE,t)}getDeviceType(){return h.getItem(this.DEVICE_TYPE)}setSupported(t){h.setItem(this.SUPPORTED,t)}getSupported(){return h.getItem(this.SUPPORTED)}setServiceTimestamp(t){h.setItem(this.SERVICE_TIMESTAMP,t)}getServiceTimestamp(){return h.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(t){h.setItem(this.LOCATION_TIMESTAMP,t)}getLocationTimestamp(){return h.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(t){h.setItem(this.PERMISSION_LOCATION,t)}getPermissionLocation(){return h.getItem(this.PERMISSION_LOCATION)}setDebugLog(t){h.setItem(this.SET_LOG_DEBUG,t)}getDebugLog(){return"false"!==h.getItem(this.SET_LOG_DEBUG)}setLogLevel(t){h.setItem(this.LOG_LEVEL,t)}getLogLevel(){return h.getItem(this.LOG_LEVEL)}setNewUserTimestamp(t){h.setItem(this.NEW_USER_TIMESTAMP,t)}getNewUserTimestamp(){return h.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(t){h&&h.isLocalStorageAvailable()&&h.setItem(this.EXTERNAL_ID,t),f&&f.IDB&&await f.setItem(this.EXTERNAL_ID,t)}async getExternalIdRequest(){let t;try{h&&h.isLocalStorageAvailable()?t=h.getItem(this.EXTERNAL_ID):f&&f.IDB&&(t=await f.getItem(this.EXTERNAL_ID))}catch(t){}return t}setExternalId(t){h.setItem(this.EXTERNAL_ID,t)}getExternalId(){return h.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return h.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(t){h.setItem(this.REGISTERED_BY_COOKIE,t)}setLatitude(t){h.setItem(this.LATITUDE,t)}getLatitude(){return h.getItem(this.LATITUDE)}setLongitude(t){h.setItem(this.LONGITUDE,t)}getLongitude(){return h.getItem(this.LONGITUDE)}async setInAppTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,t)}async getInAppTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS))}catch(t){}return t}async setTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,t)}async getTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_LIST))}catch(t){}return t}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(t){this.setStorage(this.URL_INAPP_API,t)}setInAppEnabled(t){this.setStorage(this.INAPP_ENABLED,t)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(t){this.setStorage(this.AVOID_CYPHER,t)}isAvoidCypher(){return this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}async setUrlDeviceApi(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,t)}setPushDisabled(t){this.setStorage(this.PUSH_DISABLED,t)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(t){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,t)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(t){this.setStorage(this.CONFIG_V2,t)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,t)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,t)}},y=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),v=y;class g{constructor(t){this.tag="[IND]",t&&(this.tag=t),this.level=v.INFO,this.setLogLevel((new E).getLogLevel()),this.log=[]}setLogLevel(t){t&&t>=v.DEBUG&&t<=v.ERROR&&(this.level=t)}static addedAsString(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}d(){if(this.level<=v.DEBUG)for(let t=0;t0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const m=g,I=class{constructor(t,e,r){this.errorCode=t,this.errorMessage=e,null!=r&&(this.exceptionMessage=r)}},_={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(t,e,r){if(null!=t){const n=Object.values(t.ErrorCode).indexOf(e);if(n>=0){const e=Object.keys(t.ErrorCode)[n],i=Object.values(t.ErrorCode)[n];return new I({code:e,errorId:i},Object.values(t.ErrorMessage)[n],r)}return new I(_.ErrorCode.GENERAL_ERROR,"general error",r)}}},S=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(t,e,r,n){const i=new m("[IND]BaseClient: ");r.isServiceWorkerRequest()&&i.setLogLevel(v.DEBUG);let o=await this.getURL()+r.getPath(e)+r.getParams();r.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:t,headers:r.addHeaders()};t!==this.GET&&(s.body=JSON.stringify(r.getBody())),n&&(s.credentials=n);try{const e=await fetch(o,s);if(304!=e.status){const n=await e.json();return e.ok?(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\nResponse Body:",JSON.stringify(n.data,null,"\t")).writeLog(),n):(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\n").writeLog(),new I(n.statusCode,n.message))}return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+e.status+"\n").writeLog(),e}catch(e){return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Error: "+e).writeLog(),b.showError(_,_.ErrorCode.GENERAL_ERROR,e)}}async get(t,e){return await this.call(this.GET,t,e)}async post(t,e,r){return await this.call(this.POST,t,e,r)}async put(t,e,r){return await this.call(this.PUT,t,e,r)}async delete(t,e){return await this.call(this.DELETE,t,e)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new E).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(t){let e=t;return Object.keys(this.pathParams).forEach((t=>{e=e.replace(t,this.pathParams[t])})),e}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(t){this.serviceWorkerRequest=t}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(t){this.journeyRequest=t}},P=class extends O{constructor(t=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=t}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let t="";if(this.channels&&this.channels.length>0)for(let e=0;e{new m("[IND]CorePermissions: ").d(t+" permission state has changed from "+n+" to "+r.state).writeLog(),n=r.state,e&&e({name:t,state:r.state})})}}},M=new m("[IND]Crypto"),k=new TextEncoder("utf-8"),x="HMAC",B=class{static async createHmac(t,e){try{let r="";if(!0===(new E).isAvoidCypher())r=e;else{const n=window?.crypto?.subtle;if(!n)return;const i=await n.importKey("raw",k.encode(t),{name:x,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await n.sign(x,i,k.encode(e)),s=new Uint8Array(o);r=Array.prototype.map.call(s,(t=>("00"+t.toString(16)).slice(-2))).join(""),M.d("hmac: ",r).writeLog()}return r}catch(t){return void M.e("error:",t).writeLog()}}},U=class{static compareJSON(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(t[n]!==e[n]){if("object"!=typeof t[n]||"object"!=typeof e[n])return!1;if(!isEqual(t[n],e[n]))return!1}return!0}},V=class{static isValidFormat(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}},j=class{static setTopicChannel(t,e){const r=[];for(let n=0;n{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(e,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=u(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}(r(710));Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var s,a=(s=r(610))&&s.__esModule?s:{default:s};function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(u=function(t){return t?r:e})(t)}},468:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=u(r(254)),i=u(r(234)),o=u(r(457)),s=u(r(735)),a=u(r(630));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var u=d(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==c(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){h(o,n,i,s,a,"next",t)}function a(t){h(o,n,i,s,a,"throw",t)}s(void 0)}))}}function d(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BaseClient",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var n=s(r(468)),i=s(r(237)),o=s(r(773));function s(t){return t&&t.__esModule?t:{default:t}}},773:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,r){return e=u(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,a()?Reflect.construct(e,r||[],u(t).constructor):e.apply(t,r))}(this,e)).PARAM_APPLICATION_CHANNEL="channel",t.channels=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),function(t,e){return e&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var t="";if(this.channels&&this.channels.length>0)for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={platform:"webpush",version:"0.0.1"},i=r(904);n.version=i.version,n=Object.assign(n,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),e.default=n},610:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=h(r(122)),o=h(r(291)),s=l(r(545)),a=l(r(225)),u=l(r(628));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function h(t){return t&&t.__esModule?t:{default:t}}e.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Channel=void 0;var r=e.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});e.default=r},174:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(r(291)),o=s(r(254));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=new i.default;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);var s=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,s=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):s=new Date(Date.now()+36e5),!r){var a=s.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+a).writeLog(),n.setConfigV2ServiceSyncTime(a)}}}));e.default=c},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):r?(e.enabled&&(this.enabled=e.enabled,(new i.default).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}),[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(t){this.deviceId=t}},{key:"setExternalCode",value:function(t){this.externalCode=t}},{key:"toJSON",value:function(){var t={};return this.platform&&(t.platform=this.platform),this.version&&(t.version=this.version),this.productName&&(t.productName=this.productName),this.productVersion&&(t.productVersion=this.productVersion),this.browserName&&(t.browserName=this.browserName),this.browserVersion&&(t.browserVersion=this.browserVersion),this.osName&&(t.osName=this.osName),this.osVersion&&(t.osVersion=this.osVersion),this.deviceType&&(t.deviceType=this.deviceType),this.locale&&(t.locale=this.locale),this.timeZone&&(t.timeZome=this.timeZone),this.timeOffset&&(t.timeOffset=this.timeOffset),this.deviceId&&(t.deviceId=this.deviceId),this.enabled&&(t.enabled=this.enabled),this.browserPublicKey&&(t.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(t.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(t.externalCode=this.externalCode),t}}]);e.default=u},89:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});e.default=r},735:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};e.default=r},234:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});e.default=r},72:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});e.default=r},225:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.Channel}}),Object.defineProperty(e,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var n=r(902),i=h(r(395)),o=h(r(89)),s=h(r(735)),a=h(r(234)),u=h(r(953)),c=h(r(72)),l=h(r(174));function h(t){return t&&t.__esModule?t:{default:t}}},672:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:T(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==i&&o.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(122)),i=a(r(87)),o=a(r(672)),s=a(r(238));function a(t){return t&&t.__esModule?t:{default:t}}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==u(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)}))}}function f(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(254))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))}}function c(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CryptoUtils=void 0;var n=i(r(291));function i(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(735)),i=o(r(234));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=0){var s={code:Object.keys(t.ErrorCode)[o],errorId:Object.values(t.ErrorCode)[o]};return new i.default(s,Object.values(t.ErrorMessage)[o],r)}return new i.default(n.default.ErrorCode.GENERAL_ERROR,"general error",r)}}}])&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=new c},325:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(630));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=i.default.DEBUG&&t<=i.default.ERROR&&(this.level=t)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var e=0;e0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();e.default=c},630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LogLevel=void 0;var r=e.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});e.default=r},662:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r8}}],e&&n(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=o},628:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"CommonUtils",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(e,"TopicUtils",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"Validations",{enumerable:!0,get:function(){return l.default}});var n=f(r(622)),i=f(r(429)),o=f(r(170)),s=f(r(457)),a=f(r(325)),u=f(r(254)),c=r(630),l=f(r(332)),h=f(r(662));function f(t){return t&&t.__esModule?t:{default:t}}},904:t=>{"use strict";t.exports=JSON.parse('{"_from":"indigitall-web-core@4.9.2","_id":"indigitall-web-core@4.9.2","_inBundle":false,"_integrity":"sha512-aGTfAnLDU6FrokX4B7XvAWEX2Obl/hlcz9OTPFOI/yQIwIKpjfZJ1BEVeCWvDiSEAYhLek73ppnFdV66cUxcGA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.9.2","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.9.2","saveSpec":null,"fetchSpec":"4.9.2"},"_requiredBy":["#USER","/","/indigitall-web-customer"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.9.2.tgz","_shasum":"710cb6aaf9858cce437e850a450c7fc81cf71a03","_spec":"indigitall-web-core@4.9.2","_where":"/home/circleci/webpush/inapp","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.9.2"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>At});const{Repository:t}=r(315).Core,e=new class extends t{constructor(){super(),this.INAPP_SHOW_ONCE=this.REPOSITORY+".INAPP_SHOW_ONCE",this.INAPP_TIMES_CLICKED=this.REPOSITORY+".INAPP_TIMES_CLICKED",this.INAPP_DISMISS_FOREVER=this.REPOSITORY+".INAPP_DISMISS_FOREVER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.INAPP_TOPICS_SYNC=this.REPOSITORY+".INAPP_TOPICS_SYNC",this.AVOID_ACTION=this.REPOSITORY+".AVOID_ACTION",this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_INAPP_V2_SERVICE_SYNC_TIME",this.AUDIENCE_DATE_CACHE_TTL=this.REPOSITORY+".AUDIENCE_DATE_CACHE_TTL",this.INAPP_AUDIENCES=this.REPOSITORY+".INAPP_AUDIENCES",this.INAPP_AUDIENCES_CACHE=this.REPOSITORY+".INAPP_AUDIENCES_CACHE",this.INAPP_AUDIENCES_LAST_UPDATE=this.REPOSITORY+".INAPP_AUDIENCES_LAST_UPDATE"}setItemStorage(t){this.setItemSessionStorage(this.REPOSITORY,t)}getItemStorage(){return this.getItemSessionStorage(this.REPOSITORY)}setDeviceId(t){this.setStorage(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}getInAppShowOnce(){return this.getStorage(this.INAPP_SHOW_ONCE)}setInAppShowOnce(t){this.setStorage(this.INAPP_SHOW_ONCE,t)}getInAppTimesClicked(){return this.getStorage(this.INAPP_TIMES_CLICKED)}setInAppTimesClicked(t){this.setStorage(this.INAPP_TIMES_CLICKED,t)}getInAppDismissForever(){return this.getStorage(this.INAPP_DISMISS_FOREVER)}setInAppDismissForever(t){this.setStorage(this.INAPP_DISMISS_FOREVER,t)}getInAppTopics(){return this.getStorage(this.INAPP_TOPICS)?this.getStorage(this.INAPP_TOPICS).split(","):null}setInAppTopics(t){this.setStorage(this.INAPP_TOPICS,t)}async getInAppTopicsSync(){let t=null;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS_SYNC))}catch(t){}return t}async setInAppTopicsSync(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS_SYNC,t)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}isAvoidAction(){return this.getStorage(this.AVOID_ACTION)}setAvoidAction(t){this.setStorage(this.AVOID_ACTION,t)}getConfigInAppV2ServiceSyncTime(){return this.getStorage(this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME)}setConfigInAppV2ServiceSyncTime(t){this.setStorage(this.CONFIG_INAPP_V2_SERVICE_SYNC_TIME,t)}getInAppAudienceDateCacheTtl(){return this.getStorage(this.AUDIENCE_DATE_CACHE_TTL)}setInAppAudienceDateCacheTtl(t){this.setStorage(this.AUDIENCE_DATE_CACHE_TTL,t)}getAudienceModel(){return this.getStorage(this.INAPP_AUDIENCES)}setAudienceModel(t){this.setStorage(this.INAPP_AUDIENCES,t)}getAudienceCache(){return this.getStorage(this.INAPP_AUDIENCES_CACHE)}setAudienceCache(t){this.setStorage(this.INAPP_AUDIENCES_CACHE,t)}getAudienceLastUpdate(){return this.getStorage(this.INAPP_AUDIENCES_LAST_UPDATE)}setAudienceLastUpdate(t){this.setStorage(this.INAPP_AUDIENCES_LAST_UPDATE,t)}},{Validations:i,Log:o}=r(315).Core.Utils,s=class extends i{static isAppKeyFormat(){const t=e.getAppKey();return null!=t&&""!=t&&"null"!=t&&t.length>3}static isValidFieldFormat(t){return null!=t&&""!=t&&"null"!=t}static isValidFormatRequest(){const t=new o("[IND]InAppValidations: "),r=e.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,t.w("appKey is null or empty").writeLog()),this.isValidFormat(r)||(n=!1,t.w("deviceId is null or empty").writeLog()),n}static isInAppRegisterFormat(){return!(!this.isValidFormatRequest()||!e.getExternalId()||"null"===e.getExternalId())}},{ErrorDictionary:a}=r(315).Core.Models,u=a.ErrorCode;Object.assign(u,{INAPP_ERROR:2e3,INAPP_SHOW_INAPP_ERROR:2100,INAPP_WAS_EXPIRED:2101,INAPP_WAS_SHOWN_MANY_TIMES:2102,INAPP_WAS_CLICKED_MANY_TIMES:2103,INAPP_TOPIC_EMPTY:2104,INAPP_FORM_TYPE_NOT_CORRECT:2120,INAPP_FORM_FIELD_IS_EMPTY:2121,INAPP_POPUP_ERROR:2300,INAPP_WAS_DISMISSED_FOREVER:2304,INAPP_ERROR_CONTENT_MESSAGE:2305,INAPP_INSTANCE_TOPICS_ERROR:2306,INAPP_GENERAL_ERROR:2600});const c=a.ErrorMessage;Object.assign(c,{INAPP_ERROR:"inApp error",INAPP_SHOW_INAPP_ERROR:"error on show inApp",INAPP_WAS_EXPIRED:"InApp was expired",INAPP_WAS_SHOWN_MANY_TIMES:"InApp was shown more than $x times",INAPP_TOPIC_EMPTY:"There is no inApp Topics subscription",INAPP_WAS_CLICKED_MANY_TIMES:"InApp was clicked more than $x times",NAPP_FORM_TYPE_NOT_CORRECT:"Input type is not correct",INAPP_FORM_FIELD_IS_EMPTY:"Field is empty",INAPP_POPUP_ERROR:"error on popup",INAPP_WAS_DISMISSED_FOREVER:"InApp was dismissed forever",INAPP_ERROR_CONTENT_MESSAGE:"InApp error with content",INAPP_INSTANCE_TOPICS_ERROR:"topics instance is not correct, only string[] is valid types",INAPP_GENERAL_ERROR:"inApp general error"});const l={ErrorCode:u,ErrorMessage:c},h=class{constructor(t){this.URL="url",t.actionId&&(this.actionId=t.actionId),t.destroy&&(this.destroy=t.destroy),t.topics&&(this.topics=t.topics),t.type&&(this.type=t.type),t.url&&(this.url=t.url),t.app&&(this.app=t.app),t.no_action&&(this.no_action=t.no_action)}},f=class{constructor(t){t.borderRadius&&(this.borderRadius=t.borderRadius)}},d=class{constructor(t){t.contentUrl&&(this.contentUrl=t.contentUrl),t.showTime&&(this.showTime=t.showTime),t.numberOfShows&&(this.numberOfShows=t.numberOfShows),t.numberOfClicks&&(this.numberOfClicks=t.numberOfClicks),t.dismissForever&&(this.dismissForever=t.dismissForever),t.layout&&(this.layout=new f(t.layout)),t.action&&(this.action=new h(t.action))}setAction(t){this.action=t}},p=class{constructor(t){this.timesShowed=0,this.timesClicked=0,this.wasDismissed=!1,t&&(t.timesShowed&&(this.timesShowed=t.timesShowed),t.timesClicked&&(this.timesClicked=t.timesClicked),t.wasDismissed&&(this.wasDismissed=t.wasDismissed))}},E=class{static searchInApp(t){const e=this.getListInApp();return null==e?null:this.findInAppFromInAppList(e,t)}static searchInAppWithInAppId(t){const e=this.getListInApp();return null==e?null:this.findInAppFromInAppListWithInAppId(e,t)}static addInApp(t){let r=this.getListInApp();null!=r?r.push(t):r=[t],e.setItemStorage(JSON.stringify(r))}static getListInApp(){let t=null;try{e.getItemStorage()&&(t=JSON.parse(e.getItemStorage()))}catch(t){console.error(t.message)}return t}static addInAppNewClick(t){this.updateInAppField(t.inAppId,!0,null,null)}static addInAppNewShow(t){this.updateInAppField(t.inAppId,null,!0,null)}static addInAppDismissForever(t){this.updateInAppField(t.inAppId,null,null,!0)}static updateInAppField(t,r,n,i){const o=this.getListInApp(),s=[];if(null!=o)for(let e=0;e0&&E.addInAppNewClick(t),A.sendEventClick(t)}static addNewInApptoDismissForever(t){E.addInAppDismissForever(t)}static isInAppDismissForever(t){const e=E.searchInAppWithInAppId(t.inAppId);return!(null==e||!new v(e).inAppShow.wasDismissed)}static async registerLocation(){const t=new L("[IND]InAppUtils: ");try{navigator.geolocation&&"prompt"===(await D.getPermissions()).location&&navigator.geolocation.getCurrentPosition((t=>{e.setLatitude(t.coords.latitude),e.setLongitude(t.coords.longitude)}),(r=>{t.e("error "+r).writeLog(),e.getPermissionLocation()||e.getPermissionLocation()==M.EVENT_TYPE_REJECT||e.setPermissionLocation(M.EVENT_TYPE_REJECT)}))}catch(e){t.e(e).writeLog()}}static generateDeviceId(){et.postDevice(new N,(t=>t),(t=>(console.log(t),null)))}static async setExternalCode(t){let r=t;if(t){const n=e.getAppKey();r=await C.createHmac(n,t)}return e.setExternalId(r),r}static async setExternalCodeWithoutCypher(t){await e.setExternalId(t)}static async convertToJSONArray(t){if(t&&""!=t)return await Promise.resolve(t).then((t=>JSON.parse(t)))}static getDate(t){const e=new Date(t);let r=""+(e.getMonth()+1),n=""+e.getDate();const i=e.getFullYear();let o=e.getHours(),s=e.getMinutes(),a=e.getSeconds();return r.length<2&&(r="0"+r),n.length<2&&(n="0"+n),o.length<2&&(o="0"+o),s.length<2&&(s="0"+s),a.length<2&&(a="0"+a),`${i}-${r}-${n} ${o}:${s}:${a}`}},{CommonUtils:x,ErrorUtils:B}=r(315).Core.Utils,{Channel:U}=r(315).Core.Models,V=class{static async listTopics(t,r){const n=[],i=await e.getInAppTopics();if(null!=i&&""!=i){for(let t=0;t!n.includes(t)));0!==e.length&&n.push(e)}else for(let e=0;e!t.includes(e))),e.setInAppTopics(i),await e.setInAppTopicsSync(i));const s=[];if(i.length>0)for(let t=0;t0)if(n&&n.length>0)for(let e=0;e0)for(let e=0;e0){if(Q.isFunction(e)){const r=new v(n.data);r.properties.numberOfShows>0&&(r.inAppShow.timesShowed=1),r.properties.dismissForever&&(r.inAppShow.wasDismissed=!0),t.isUpdateInApp()||k.addNewInApp(r),e(r)}}else n?Q.isFunction(r)&&r(n):Q.isFunction(r)&&r(z.showError(l,l.ErrorCode.INAPP_ERROR_CONTENT_MESSAGE));return null}async getInAppTopics(t,r,n){if(s.isAppKeyFormat()){const i=await this.get(this.ENDPOINT_DEVICE_TOPICS,t.getDeviceTopicsRequest());if(!i||i instanceof J)i?Q.isFunction(n)&&n(i):Q.isFunction(n)&&n();else{const t=$.setTopicChannel(i.data,X.INAPP),n=V.isSubscribe(t);await e.setInAppTopicList(n),Q.isFunction(r)&&r(n)}}else Q.isFunction(n)&&n(z.showError(l,l.ErrorCode.INAPP_GENERAL_ERROR));return!0}postEventClick(t){s.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_CLICK,t.postEventClickRequest())}postEventPrint(t){s.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_PRINT,t.postEventClickRequest())}postEventForm(t){s.isAppKeyFormat()&&this.post(this.ENDPOINT_EVENT_INAPP_FORM,t.postForm())}putCustomerField(t){s.isAppKeyFormat()&&(this.isCustomerRequest=!0,this.put(this.ENDPOINT_CUSTOMER_FIELD,t.putCustomerFieldRequest()))}async postDevice(t,r,n){if(s.isAppKeyFormat()){this.isDeviceRequest=!0;const i=await this.post(this.ENDPOINT_DEVICE,t.postDeviceRequest(),"include");!i||i instanceof J?i?Q.isFunction(n)&&n(i):Q.isFunction(n)&&n():(i.data.deviceId&&e.setDeviceId(i.data.deviceId),Q.isFunction(r)&&r(i.data.deviceId))}else Q.isFunction(n)&&n(z.showError(l,l.ErrorCode.INAPP_ERROR));return!0}async getApplicationWithInAppChannel(t,r,n){if(s.isAppKeyFormat()){const i=e.getConfigV2ServiceSyncTime(),o=new Z(tt);if(null!=i&&Date.now()0){if(Q.isFunction(r)){const t=new Y(e.data,!1);if(t.enabled){const e=t.updateCache();e>0&&o.d(`Deleted ${e} inapp cache from database`).writeLog()}r(t)}}else e?Q.isFunction(n)&&n(e):Q.isFunction(n)&&n()}}else Q.isFunction(n)&&n(z.showError(l,l.ErrorCode.INAPP_ERROR));return!0}async getAudiences(t,r,n){const i=new Z(`${tt}.getAudiences`);if(s.isInAppRegisterFormat()){const o=await this.get(this.ENDPOINT_INAPP_AUDIENCE,t.getAudiences());if(!o||o instanceof J)o?Q.isFunction(n)&&n(o):Q.isFunction(n)&&n();else{let t;o.data?(t=new F(o.data),t.lastUpdate&&e.setAudienceLastUpdate(t.lastUpdate),t.audiences&&W.saveAudiences(t)):o.status&&304==o.status&&i.d("No audiences modified. No need to sync changes to the device").writeLog(),Q.isFunction(r)&&r(t)}}else Q.isFunction(n)&&n(z.showError(l,l.ErrorCode.INAPP_ERROR,"Bad request, deviceId and externalCode not found"))}},{BaseRequest:rt}=r(315).Core.Api,nt=class extends rt{constructor(){super(),this.update=!1,this.PARAM_DEVICE_TYPE="deviceType",this.PARAM_BROWSER_NAME="browserName",this.PARAM_AUDIENCES="audiences",this.PARAM_AUDIENCES_VERSION="audiencesVersion"}setTag(t){this.tag=t}setUpdateInApp(t){this.update=t}isUpdateInApp(){return this.update}getCampaignTagRequest(){return this.params=this.createQueryString(),this.pathParams["{tag}"]=this.tag,this}createQueryString(){let t="";if(null!=e.getDeviceId()?t+=`${this.PARAM_DEVICE_ID}=${e.getDeviceId()}&`:k.generateDeviceId(),s.isValidFieldFormat(e.getExternalId())&&(t+=`${this.PARAM_EXTERNAL_CODE}=${e.getExternalId()}&`),null!=e.getDeviceType()&&(t+=`${this.PARAM_DEVICE_TYPE}=${e.getDeviceType()}&`),null!=e.getBrowserName()&&(t+=`${this.PARAM_BROWSER_NAME}=${e.getBrowserName()}&`),null!=e.getLatitude()&&(t+=`${this.PARAM_LATITUDE}=${e.getLatitude()}&`),null!=e.getLongitude()&&(t+=`${this.PARAM_LONGITUDE}=${e.getLongitude()}&`),null!=e.getInAppTopics()&&0!==e.getInAppTopics().length){const r=e.getInAppTopics();t+=`${this.PARAM_TOPICS}=${encodeURIComponent(r)}&`}const r=W.loadAudiences();return null!=r&&0!==r.audiences.length&&(t+=`${this.PARAM_AUDIENCES}=${encodeURIComponent(r.audiences)}&`),t+=`${this.PARAM_AUDIENCES_VERSION}=v2&`,t+=`${this.PARAM_PLATFORM}=webpush`,t}},it=class{constructor(t,e){this.script=` \n\n let objectFit_${e} = "contain" ;\n const containers_${e} = document.getElementById("${t}").getElementsByClassName("ind_slideshow-container");\n if (containers_${e} && containers_${e}.length > 0 && containers_${e}[0] && containers_${e}[0].getAttribute("data-carousel-adjust-type")) {\n objectFit_${e} = containers_${e}[0].getAttribute("data-carousel-adjust-type"); \n }\n\n var isPartial_${e} = document.getElementById("${t}").getElementsByClassName("ind_slideshow-item-partial").length > 0;\n \n var slideIndex_${e} = isPartial_${e} ? 1 : 0;\n var delta_${e} = 6;\n \n var diffX_${e};\n var diffY_${e};\n var timeSlide_${e} = 10000;\n\n\n var ind_carouselOverlap_${e} = document.getElementById("ind_carouselOverlapContainer_${e}");\n var ind_carouselOverlapLMainView_${e} = document.getElementById("ind_carouselOverlapLMainView_${e}")\n \n const indNext_${e} = document.getElementById("${t}").getElementsByClassName("ind_next");\n const indPrev_${e} = document.getElementById("${t}").getElementsByClassName("ind_prev");\n indNext_${e}.onclick = () => plusSlides_${e}(1);\n indPrev_${e}.onclick = () => plusSlides_${e}(-1);\n\n var slides_${e} = document.getElementById("${t}").getElementsByClassName("ind_slideshow-item") ? document.getElementById("${t}").getElementsByClassName("ind_slideshow-item") : document.getElementById("${t}").getElementsByClassName("ind_slideshow-carousel-item");\n var slider_${e} = document.getElementById("${t}").querySelector('.ind_slider-container-actions');\n var sliderTotal_${e} = document.getElementById("${t}").getElementsByClassName("ind_slideshow-item").length ? document.getElementById("${t}").getElementsByClassName("ind_slideshow-item").length : document.getElementById("${t}").getElementsByClassName("ind_slideshow-carousel-item").length;\n \n var interval_${e} = setInterval(() => {\n newSlide_${e}();\n }, timeSlide_${e});\n\n var imageList_${e} = document.getElementById("${t}").getElementsByClassName("indCOImages_${e}");\n \n if (imageList_${e}) {\n setImagesCarouselOverLap_${e}();\n let docIframeHeight_${e} = document.getElementById("${t}").clientHeight;\n let docIframeWidth_${e} = document.getElementById("${t}").clientWidth;\n \n if (document.getElementById("ind_carouselOverlapLeftView_${e}")) document.getElementById("ind_carouselOverlapLeftView_${e}").style.height = (docIframeHeight_${e}-20)+"px";\n if (document.getElementById("ind_carouselOverlapLRightView_${e}")) document.getElementById("ind_carouselOverlapLRightView_${e}").style.height = (docIframeHeight_${e}-20)+"px";\n if (document.getElementById("ind_carouselOverlapLMainView_${e}")) document.getElementById("ind_carouselOverlapLMainView_${e}").style.height = docIframeHeight_${e} + "px";\n if (document.getElementById("ind_carouselOverlapLMainView_${e}")) document.getElementById("ind_carouselOverlapLMainView_${e}").style.width = docIframeWidth_${e} + "px";\n \n }\n if (document.getElementById("ind_carousel-overlap-container_${e}")) document.getElementById("ind_carousel-overlap-container_${e}").style.width = docIframeWidth_${e} + "px";\n\n function setImagesCarouselOverLap_${e}() { \n var slides_${e} = document.getElementById("${t}").getElementsByClassName("ind_slideshow-carousel-item");\n for (let i = 0; i < slides_${e}.length; i++) {\n if (imageList_${e}[i]) {\n slides_${e}[i].style.backgroundImage = "url('"+imageList_${e}[i].src+"')";\n if (slides_${e}[i].style) {\n \n slides_${e}[i].style.backgroundSize = "cover";\n }\n slides_${e}[i].style.backgroundPosition = "center";\n } \n }\n const mainView = document.getElementById("ind_carouselOverlapLMainView_${e}");\n if (mainView) {\n mainView.style.backgroundSize = objectFit_${e};\n if (slides_${e}[1]) slides_${e}[1].onclick = imageList_${e}[1].onclick; \n }\n }\n\n function shiftRight_${e}() {\n let newArr = new Array(imageList_${e}.length);\n for (var i = 0; i < imageList_${e}.length; i++) {\n if (i == 0) {\n newArr[i] = imageList_${e}[imageList_${e}.length-1];\n } else {\n newArr[i] = imageList_${e}[i-1];\n }\n }\n imageList_${e} = newArr;\n }\n\n function shiftLeft_${e}() {\n let newArr = new Array(imageList_${e}.length);\n for (var i = 0; i < imageList_${e}.length; i++) {\n if (i+1 == imageList_${e}.length) {\n newArr[i] = imageList_${e}[0]; \n } else {\n newArr[i] = imageList_${e}[i+1];\n }\n }\n imageList_${e} = newArr;\n }\n\n \n showSlides_${e}(slideIndex_${e});\n \n let startMove_${e} = null;\n let startMoveY_${e} = null;\n \n \n if (slider_${e} && !ind_carouselOverlap_${e}) {\n slider_${e}.addEventListener('touchstart', handleStart_${e}, false);\n slider_${e}.addEventListener('touchend', handleEnd_${e}, false);\n slider_${e}.addEventListener('mousedown', mouseStart_${e});\n slider_${e}.addEventListener('mouseup', mouseEnd_${e}); \n } else if (ind_carouselOverlap_${e} && ind_carouselOverlapLMainView_${e}) {\n ind_carouselOverlapLMainView_${e}.addEventListener('touchstart', handleStart_${e}, false);\n ind_carouselOverlapLMainView_${e}.addEventListener('touchend', handleEnd_${e}, false);\n ind_carouselOverlapLMainView_${e}.addEventListener('mousedown', mouseStart_${e});\n ind_carouselOverlapLMainView_${e}.addEventListener('mouseup', mouseEnd_${e});\n }\n\n function mouseStart_${e}(evt) {\n evt.preventDefault();\n startMove_${e} = evt.clientX;\n startMoveY_${e} = evt.clientY;\n }\n\n function mouseEnd_${e}(evt) {\n evt.preventDefault();\n var endMove = evt.clientX;\n var endMoveY = evt.clientY;\n setEndMove_${e}(endMove, endMoveY);\n }\n\n function handleStart_${e}(evt) {\n evt.preventDefault();\n startMove_${e} = evt.touches[0].clientX;\n startMoveY_${e} = evt.touches[0].clientY;\n }\n function handleEnd_${e}(evt) {\n evt.preventDefault();\n const endMove = evt.changedTouches[0].pageX;\n const endMoveY = evt.changedTouches[0].pageY;\n setEndMove_${e}(endMove, endMoveY);\n }\n\n function setEndMove_${e}(endMove, endMoveY) {\n diffX_${e} = Math.abs(endMove - startMove_${e});\n diffY_${e} = Math.abs(endMoveY - startMoveY_${e});\n \n if (startMove_${e} != null) {\n if (startMove_${e} > endMove) {\n if (ind_carouselOverlap_${e}) {\n slideIndex_${e} = -1;\n } else {\n slideIndex_${e}++;\n if (slideIndex_${e} > sliderTotal_${e}) {\n slideIndex_${e} = 1;\n }\n }\n } else {\n if (ind_carouselOverlap_${e}) {\n if (startMove_${e} == endMove) {\n slideIndex_${e} = 0;\n } else {\n slideIndex_${e} = 1;\n }\n } else {\n if (slideIndex_${e} == 0) {\n slideIndex_${e} = sliderTotal_${e};\n } else {\n slideIndex_${e}--;\n }\n }\n }\n showSlides_${e}(slideIndex_${e});\n setNewInterval_${e}();\n }\n \n }\n\n function plusSlides_${e}(n) {\n if (ind_carouselOverlap_${e}) {\n showSlides_${e}(n == 1 ? -1: 1);\n } else {\n showSlides_${e}(slideIndex_${e} += n);\n }\n setNewInterval_${e}();\n }\n\n function currentSlide_${e}(n) {\n showSlides_${e}(slideIndex_${e} = n);\n }\n\n function setNewInterval_${e}() {\n clearInterval(interval_${e});\n interval_${e} = setInterval(() => {\n newSlide_${e}();\n }, timeSlide_${e});\n }\n\n function newSlide_${e}(){\n slideIndex_${e}++;\n if (slideIndex_${e} > sliderTotal_${e}) {\n slideIndex_${e} = 1;\n }\n showSlides_${e}(slideIndex_${e});\n }\n\n function showSlides_${e}(n) {\n let view = document.getElementById("${t}") ? document.getElementById("${t}") : document;\n if (view) {\n if (ind_carouselOverlap_${e}) { \n if (n < 0) {\n shiftLeft_${e}();\n } else if (n > 0) {\n shiftRight_${e}();\n }\n setImagesCarouselOverLap_${e}();\n } else {\n let i;\n const dots = view.getElementsByClassName("ind_dot");\n if (n > slides_${e}.length) {slideIndex_${e} = 1;}\n if (n < 1) {slideIndex_${e} = slides_${e}.length;}\n for (i = 0; i < slides_${e}.length; i++) {\n slides_${e}[i].style.display = "none";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(" active", "");\n }\n if (slides_${e}[slideIndex_${e}-1]) {\n slides_${e}[slideIndex_${e}-1].style.display = "block";\n }\n if (dots[slideIndex_${e}-1]) dots[slideIndex_${e}-1].className += " active";\n }\n }\n }\n\n\n function inAppIndigitallOnClick_${e}(action) {\n if (diffX_${e} && diffY_${e}) {\n if (diffX_${e} < delta_${e} && diffY_${e} < delta_${e}) {\n indigitall.InApp.inAppOnClick(action);\n }\n } else {\n indigitall.InApp.inAppOnClick(action);\n }\n }\n\n function inAppIndigitallSubmit_${e}(formOptions) {\n const jsonForm = {}\n const jsonCustomer = {}\n const form = document.querySelector('[id="'+formOptions.formId+'"]');\n if (form) {\n formOptions.inputs.forEach((el) => {\n if (el.id !== 'undefined') {\n let value;\n if (el.type === 'text' || el.type === 'number') {\n if (form && form.querySelector('input[id^="'+el.id+'"]') && form.querySelector('input[id^="'+el.id+'"]').value !== 'undefined') {\n value = form.querySelector('input[id^="'+el.id+'"]').value;\n }\n }\n if (el.type === 'checkbox') {\n if (form && form.querySelectorAll('input[id^="'+el.id +'"]')) {\n let values = form.querySelectorAll('input[id^="'+el.id +'"]');\n var valuesChecked = [];\n for (var i = 0; i < values.length; i++) {\n if (values[i].checked && values[i].value !== 'undefined') {\n valuesChecked.push(values[i].value);\n }\n }\n value = valuesChecked;\n }\n }\n if (el.type === 'radio') {\n if (form && form.querySelectorAll('input[id^="'+el.id +'"]')) {\n let values = form.querySelectorAll('input[id^="'+el.id +'"]');\n var valuesChecked;\n for (var i = 0; i < values.length; i++) {\n if (values[i].checked && values[i].value !== 'undefined') {\n valuesChecked = values[i].value;\n }\n }\n value = valuesChecked;\n }\n }\n if (el.type === 'select') {\n if (form && form.querySelector('select[id^="'+el.id+'"]') && form.querySelector('select[id^="'+el.id+'"]').value !== 'undefined') {\n value = form.querySelector('select[id^="'+el.id+'"]').value;\n }\n }\n if (value) jsonForm[el.id] = value;\n if (el.sendToCustomer) jsonCustomer[el.id] = value;\n }\n });\n }\n indigitall.InApp.inAppSubmit(JSON.stringify(formOptions), JSON.stringify(jsonForm), JSON.stringify(jsonCustomer));\n }\n `,this.html=" "}},ot=Object.freeze({TEXT:"text",NUMBER:"number",RADIO:"radio",CHECKBOX:"checkbox",SELECT:"select"}),st=class{constructor(t){if(t.id&&(this.id=t.id),t.name&&(this.name=t.name),t.type)switch(t.type){case"text":this.type=ot.TEXT;break;case"checkbox":this.type=ot.CHECKBOX;break;case"number":this.type=ot.NUMBER;break;case"radio":this.type=ot.RADIO;break;case"select":this.type=ot.SELECT}t.required&&(this.required=t.required),t.sendToCustomer&&(this.sendToCustomer=t.sendToCustomer)}},at=class{constructor(t){if(t.inAppId&&(this.inAppId=t.inAppId),t.formId&&(this.formId=t.formId),t.inappVersion&&(this.inappVersion=t.inappVersion),t.inputs&&Array.isArray(t.inputs)){this.inputs=[];for(let e=0;e0)for(let r=0;r0)return n;e&&0!==Object.keys(e).length&&A.sendEventForm(t.inAppId,t.inappVersion,e),r&&0!==Object.keys(r).length&&A.sendEventFormToCustomer(r)}static checkInputType(t,e){if(null!=t.id)switch(t.type){case ot.TEXT:if(t.required){if(!e[t.id])return ut.showError(l,2121,t.id);if(!e[t.id]instanceof String)return ut.showError(l,2120,`The field ${t.id} is not text`)}break;case ot.NUMBER:if(t.required){if(!e[t.id])return ut.showError(l,2121,t.id);if(!e[t.id]instanceof String){if(!parseInt(e[t.id]))return ut.showError(l,2120,`The field ${t.id} is not number`)}else if(!e[t.id]instanceof int)return ut.showError(l,2120,`The field ${t.id} is not number`)}break;default:if(t.required&&e[t.id]&&""==e[t.id])return ut.showError(l,2121,t.id)}return null}static editingFormHtml(t,e){return t.replaceAll("InAppIndigitall.onClick",`inAppIndigitallOnClick_${e}`).replaceAll("InAppIndigitall.submit",`inAppIndigitallSubmit_${e}`).replaceAll("plusSlides",`plusSlides_${e}`).replaceAll("indCOImages",`indCOImages_${e}`).replaceAll("ind_carouselOverlapLeftView",`ind_carouselOverlapLeftView_${e}`).replaceAll("ind_carouselOverlapLRightView",`ind_carouselOverlapLRightView_${e}`).replaceAll("ind_carouselOverlapLMainView",`ind_carouselOverlapLMainView_${e}`).replaceAll("ind_carouselOverlapContainer",`ind_carouselOverlapContainer_${e}`).replaceAll("setImagesCarouselOverLap",`setImagesCarouselOverLap_${e}`).replaceAll("shiftRight",`shiftRight_${e}`).replaceAll("shiftLeft",`shiftLeft_${e}`).replaceAll("currentSlide",`currentSlide_${e}`).replaceAll("setNewInterval",`setNewInterval_${e}`).replaceAll("newSlide",`newSlide_${e}`).replaceAll("showSlides",`showSlides_${e}`)}},lt=class{static onClick(t){if(t){const e=JSON.parse(t);let r;e.inAppId&&(r=e.inAppId),e.inappId&&(r=e.inappId);const n=E.searchInAppWithInAppId(r);if(n&&e.action){const t=new v(n),r=new h(e.action);if(t.properties.setAction(r),k.onClickAction(r),t){k.addNewInAppClick(t);const e=new CustomEvent("didClicked",{detail:{action:r},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(e)}}else console.log(`InApp ${e.schema} not found`)}else console.log("InApp action is empty")}static submit(t,e,r){if(t){const n=new at(JSON.parse(t));if(e){const t=ct.checkFieldsForm(n,JSON.parse(e),JSON.parse(r));if(t&&t.length>0){const e=new CustomEvent("didFormError",{detail:{errorList:t},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(e)}else{const t=new CustomEvent("didFormSubmit",{detail:{},bubbles:!0,cancelable:!0,composed:!1});self.dispatchEvent(t)}}}}},{Log:ht,ErrorUtils:ft,CommonUtils:dt}=r(315).Core.Utils,pt="[IND]ShowInAppUtils: ";class Et{static async inAppWasShown(t,e,r,n,i){const o=new ht(pt);t.schema.code&&this.inAppWasGot(t.schema.code,null,e,(t=>{dt.isFunction(i)&&i(t)}),(()=>{dt.isFunction(i)&&i(t)}),((t,e)=>{o.d("inAppWasShown: "+t.inAppId+" with error: "+e.errorMessage).writeLog()}),r,n)}static inAppWasGot(t,e,r,n,i,o,s,a){const u=E.searchInApp(t),c=(new Date).getTime();if(null!=u){const t=new v(u);if(c{dt.isFunction(n)&&n(t,e)}),(t=>{new ht(pt).e(t).writeLog()}))}else dt.isFunction(i)&&i(t,e)}static wasInAppPassedFilterProperties(t){if(t.properties.dismissForever&&t.inAppShow.wasDismissed)return l.ErrorCode.INAPP_WAS_DISMISSED_FOREVER;{t.properties.dismissForever&&k.addNewInApptoDismissForever(t);const e=t.properties.numberOfShows,r=t.inAppShow?t.inAppShow.timesShowed:null,n=t.properties.numberOfClicks,i=t.inAppShow?t.inAppShow.timesClicked:null;if(e>0){if(!(null!=r&&r0&&null!=i&&i>=n)return l.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES}return null}static updateInAppGet(t,e,r,n,i,o){At.getInAppWithUpdate(t,!0,(t=>{const o=E.updateInApp(t),s=this.wasInAppPassedFilterProperties(o);if(null!=s)return s==l.ErrorCode.INAPP_WAS_DISMISSED_FOREVER&&dt.isFunction(e)&&e(t,ft.showError(l,l.ErrorCode.INAPP_WAS_DISMISSED_FOREVER)),s==l.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES&&dt.isFunction(r)&&r(t,ft.showError(l,l.ErrorCode.INAPP_WAS_SHOWN_MANY_TIMES)),void(s==l.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES&&dt.isFunction(n)&&n(t,ft.showError(l,l.ErrorCode.INAPP_WAS_CLICKED_MANY_TIMES)));dt.isFunction(i)&&i(o)}),(t=>{dt.isFunction(o)&&o(t)}))}}const yt=Et,{BaseApplicationRequest:vt}=r(315).Core.Api,gt=class extends vt{constructor(){super(["inApp"])}},{BaseApplicationRequest:mt}=r(315).Core.Api,It=class extends mt{constructor(){super(),this.PARAM_LAST_SYNC="lastSync"}getAudiences(){return this.params=this.createQueryString(),this}createQueryString(){let t="";return e.getDeviceId()&&(t+=`${this.PARAM_DEVICE_ID}=${e.getDeviceId()}&`),e.getAudienceLastUpdate()&&(t+=`${this.PARAM_LAST_SYNC}=${encodeURIComponent(e.getAudienceLastUpdate())}&`),e.getExternalId()&&(t+=`${this.PARAM_EXTERNAL_CODE}=${e.getExternalId()}`),t}},{ErrorUtils:_t,CommonUtils:bt,LogLevel:St,Log:Ot}=r(315).Core.Utils;class Pt{constructor(){this.LogLevel=St,this.inAppIndigitallInterface=lt}static async init(t,r,n){null!=t.appKey&&await e.setAppKey(t.appKey),t.urlInAppApi&&e.setUrlInappApi(t.urlInAppApi),e.setAvoidCypher(!!t.avoidCypher),e.setAvoidAction(!!t.avoidAction),t.logLevel&&e.setLogLevel(t.logLevel),!0===t.requestLocation&&k.registerLocation(),et.getApplicationWithInAppChannel(new gt,(t=>{W.isAudienceCacheFinish()?et.getAudiences(new It,(e=>{W.saveAudienceCache(t.audienceCacheDeviceTtl),bt.isFunction(r)&&r(t)}),(e=>{const n=new Ot("[IND]InAppIndigitall: .init");e&&e.errorMessage&&n.e(e.errorMessage).writeLog(),bt.isFunction(r)&&r(t)})):bt.isFunction(r)&&r(t)}),n)}static async showInApp(t,r,n,i){const o={appKey:e.getAppKey(),urlInAppApi:"https://device-api.indigitall.com/v2",requestLocation:!0,logLevel:St.DEBUG,inAppCode:t,viewId:r};this.showInAppWithConfig(o,null,null,null,null,null,null,n,i,null,null)}static async showInAppWithConfig(t,e,r,n,i,o,a,u,c,h,f){await this.init(t,(d=>{s.isAppKeyFormat()?yt.inAppWasGot(t.inAppCode,t.viewId,r,(async(t,r)=>{t&&t.properties&&this.createInApp(t,r,a,u,c,e,h,f)}),((t,r)=>{this.drawInApp(t,r,e,a,u,c,h,f)}),o,n,i):bt.isFunction(c)&&c(_t.showError(l,l.ErrorCode.BAD_REQUEST_SERVER_ERROR))}),c)}static showMultipleInApp(t,r,n,i){const o={appKey:e.getAppKey(),urlInAppApi:"https://device-api.indigitall.com/v2",requestLocation:!0,logLevel:St.DEBUG,inAppCodeList:t,divList:r};this.showMultipleInAppWithConfig(o,null,null,null,null,null,null,n,i,null,null)}static async showMultipleInAppWithConfig(t,e,r,n,i,o,a,u,c,h,f){await this.init(t,(d=>{if(s.isAppKeyFormat()){if(t.inAppCodeList.length==t.divList.length&&t.inAppCodeList.length>0)for(var p=0;p{t&&t.properties&&this.createInApp(t,r,a,u,c,e,h,f)}),((t,r)=>{Pt.drawInApp(t,r,e,a,u,c,h,f)}),o,n,i)}else bt.isFunction(c)&&c(_t.showError(l,l.ErrorCode.BAD_REQUEST_SERVER_ERROR))}),c)}static async drawInApp(t,e,r,n,i,o,s,a){this.getInApp(t,(async t=>{t&&t.properties&&this.createInApp(t,e,n,i,o,r,s,a)}),o)}static async createInApp(t,e,r,n,i,o,s,a){if(t&&t.properties&&t.properties.contentUrl)try{const i=document.getElementById(e);if(i){i.style.position="relative",i.style.overflow="hidden";const u=await fetch(t.properties.contentUrl);let c=await u.text();null!=t.customData&&Object.keys(t.customData).forEach((function(e){c=c.replaceAll(`{{${e}}}`,t.customData[e])})),t.version&&(c=c.replaceAll("'inappVersion':'{{version}}'","'inappVersion':"+t.version));const l=e.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,""),h=ct.editingFormHtml(c,l);if(i.innerHTML=h,"undefined"===document.getElementById(`script_${l}`)||null===document.getElementById(`script_${l}`)){const t=document.createElement("script");t.id=`script_${l}`,t.type="text/javascript",t.innerHTML=new it(e,l).script,i.appendChild(t)}if(self.addEventListener("didClicked",(function e(n){r&&r(t,n.detail.action),self.removeEventListener("didClicked",e)})),self.addEventListener("didFormError",(function e(r){s&&s(t,r.detail.errorList),self.removeEventListener("didFormError",e)})),self.addEventListener("didFormSubmit",(function e(r){a&&a(t),self.removeEventListener("didFormSubmit",e)})),t.properties.showTime){let e=0;const r=setInterval((function(){e++,e==parseInt(t.properties.showTime)&&(i.style.display="none",clearInterval(r),bt.isFunction(o)&&o(t,i,1e3*t.properties.showTime))}),1e3)}if(t.properties.layout&&t.properties.layout.borderRadius){const e=`${parseInt(t.properties.layout.borderRadius)}px`;i.style.borderRadius=e}bt.isFunction(n)&&n(t,i),A.sendEventPrint(t)}}catch(r){let n=null;t&&t.schema&&t.schema.code&&(n=t.schema.code),bt.isFunction(i)&&i(r,e,n)}}static topicsList(t,e){return V.listTopics(t,e),!0}static topicsSubscribe(t,e,r){V.saveTopics(t,e,r)}static topicsUnsubscribe(t,e,r){V.deleteTopics(t,e,r)}static inAppGet(t,e,r){this.getInApp(t,e,r)}static getInApp(t,e,r){this.getInAppWithUpdate(t,!1,e,r)}static getInAppWithUpdate(t,e,r,n){if(s.isAppKeyFormat()){const i=new nt;i.setTag(t),i.setUpdateInApp(e),et.getCampaignTag(i,r,n)}else bt.isFunction(n)&&n(_t.showError(l,l.ErrorCode.BAD_REQUEST_SERVER_ERROR))}static addNewInAppToDismissForever(t){k.addNewInApptoDismissForever(t)}static async isInAppDismissForever(t){k.isInAppDismissForever(t)}static async inAppOnClick(t){lt.onClick(t)}static async inAppSubmit(t,e,r){lt.submit(t,e,r)}static async inAppWasShown(t,e,r,n,i){yt.inAppWasShown(t,e,r,n,i)}static async downloadHTML(t){const e=await fetch(t,{method:"GET"});console.log(e)}static async setExternalCode(t,e,r){try{const r=await k.setExternalCode(t);e&&e(r)}catch(t){r&&r(t)}}static async logIn(t,e,r){await this.setExternalCode(t,e,r)}static async logOut(t,e){await this.setExternalCode(null,t,e)}}const At=Pt;window.indigitall||(window.indigitall={}),window.indigitall.InApp=Pt,window.indigitall.InApp.version=e.getVersion(),window.indigitall.InApp.Utils=k,window.indigitall.LogLevel=St})(),n})(),t.exports=e()},326:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={};Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=s(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(r(126));function s(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(s=function(t){return t?r:e})(t)}Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}))},114:function(t){var e;e=()=>(()=>{var t={710:function(t){var e;e=()=>(()=>{"use strict";var t={330:t=>{t.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>Y});var i={};r.r(i),r.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>S,BaseRequest:()=>O});var o={};r.r(o),r.d(o,{Channel:()=>A,CoreApplication:()=>L,Device:()=>R,DeviceStatus:()=>T,ErrorDictionary:()=>_,ErrorModel:()=>I,EventType:()=>w,TopicSubscribeType:()=>N});var s={};r.r(s),r.d(s,{CommonUtils:()=>C,CorePermissions:()=>D,CryptoUtils:()=>B,ErrorUtils:()=>b,JsonUtils:()=>U,Log:()=>m,LogLevel:()=>y,TopicUtils:()=>j,Validations:()=>V});var a={platform:"webpush",version:"0.0.1"};const u=r(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==l.length}return!1}setItem(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}getItem(t){return null!=this.storage?this.storage.getItem(t):null}deleteItem(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}clear(){this.storage&&this.storage.clear()}},h=l,f=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise(((t,e)=>{const r=this.IDB;if(r){const n=r.open("indigitall.indexedDB",1);n.onupgradeneeded=function(){n.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},n.onsuccess=function(){const e=n.result,r=e.transaction("indigitallStore","readwrite"),i=r.objectStore("indigitallStore"),o=i.index("storeIndex");t({db:e,tx:r,store:i,index:o})},n.onerror=function(t){e(t)}}else e(!1)}))}async get(t,e){return new Promise(((r,n)=>{t||n(!1),t.index.get(e).onsuccess=e=>{e.target.result&&(this.close(t),r(e.target.result.store.value)),n(!1)}}))}async put(t,e,r){return new Promise(((n,i)=>{t||i(!1),t.store.put({store:{key:e,value:r}},e).onsuccess=e=>{this.close(t),n(r)}}))}close(t){if(t.tx)try{t.tx.oncomplete=()=>{t.db.close()}}catch(t){console.error(this.TAG,t)}}async setItem(t,e){try{const r=await this.getDB();return this.put(r,t,e)}catch(t){return t}}async getItem(t){try{const e=await this.getDB();return this.get(e,t)}catch(t){return t}}},d=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==d.length}return!1}getItem(t){return null!=this.session?this.session.getItem(t):null}setItem(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=d,E=class{constructor(){this.storage=h,this.db=f,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(t,e){p.setItem(t,e)}getItemSessionStorage(t){return p.getItem(t)}clearSessionStorage(){p.clearMessages()}setStorage(t,e){h.setItem(t,e)}getStorage(t){return h.getItem(t)}clearStorage(){h.clear()}setBrowserPublicKey(t){h.setItem(this.BROWSER_PUBLIC_KEY,t)}getBrowserPublicKey(){return h.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(t){h.setItem(this.BROWSER_PRIVATE_KEY,t)}getBrowserPrivateKey(){return h.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(t){h.setItem(this.APP_KEY,t),f&&f.IDB&&await f.setItem(this.APP_KEY,t)}getAppKey(){return h.getItem(this.APP_KEY)}async setDeviceId(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(f&&f.IDB)return await f.getItem(this.APP_KEY)}setVAPID(t){h.setItem(this.VAPID_PUBLIC,t)}getVAPID(){return h.getItem(this.VAPID_PUBLIC)}setEnabled(t){h.setItem(this.ENABLED,t)}getEnabled(){return h.getItem(this.ENABLED)}setServiceSyncTime(t){h.setItem(this.SERVICE_SYNC_TIME,t*this.BASE_TIME)}getServiceSyncTime(){return h.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(t){h.setItem(this.LOCATION_ENABLED,t)}getLocationEnabled(){return h.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(t){h.setItem(this.LOCATION_UPDATE_MINUTES,t)}getLocationUpdateMinutes(){return h.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(t){h.setItem(this.REQUEST_LOCATION,t)}getRequestLocation(){return!!h&&h.getItem(this.REQUEST_LOCATION)}async setPlatform(t){h.setItem(this.PLATFORM,t)}getPlatform(){return h&&h.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(t){h.setItem(this.BROWSER_NAME,t)}getBrowserName(){return h.getItem(this.BROWSER_NAME)}setBrowserVersion(t){h.setItem(this.BROWSER_VERSION,t)}getBrowserVersion(){return h.getItem(this.BROWSER_VERSION)}async setOsName(t){h.setItem(this.OS_NAME,t)}getOsName(){return h.getItem(this.OS_NAME)}setOsVersion(t){h.setItem(this.OS_VERSION,t)}getOsVersion(){return h.getItem(this.OS_VERSION)}setDeviceType(t){h.setItem(this.DEVICE_TYPE,t)}getDeviceType(){return h.getItem(this.DEVICE_TYPE)}setSupported(t){h.setItem(this.SUPPORTED,t)}getSupported(){return h.getItem(this.SUPPORTED)}setServiceTimestamp(t){h.setItem(this.SERVICE_TIMESTAMP,t)}getServiceTimestamp(){return h.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(t){h.setItem(this.LOCATION_TIMESTAMP,t)}getLocationTimestamp(){return h.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(t){h.setItem(this.PERMISSION_LOCATION,t)}getPermissionLocation(){return h.getItem(this.PERMISSION_LOCATION)}setDebugLog(t){h.setItem(this.SET_LOG_DEBUG,t)}getDebugLog(){return"false"!==h.getItem(this.SET_LOG_DEBUG)}setLogLevel(t){h.setItem(this.LOG_LEVEL,t)}getLogLevel(){return h.getItem(this.LOG_LEVEL)}setNewUserTimestamp(t){h.setItem(this.NEW_USER_TIMESTAMP,t)}getNewUserTimestamp(){return h.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(t){h&&h.isLocalStorageAvailable()&&h.setItem(this.EXTERNAL_ID,t),f&&f.IDB&&await f.setItem(this.EXTERNAL_ID,t)}async getExternalIdRequest(){let t;try{h&&h.isLocalStorageAvailable()?t=h.getItem(this.EXTERNAL_ID):f&&f.IDB&&(t=await f.getItem(this.EXTERNAL_ID))}catch(t){}return t}setExternalId(t){h.setItem(this.EXTERNAL_ID,t)}getExternalId(){return h.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return h.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(t){h.setItem(this.REGISTERED_BY_COOKIE,t)}setLatitude(t){h.setItem(this.LATITUDE,t)}getLatitude(){return h.getItem(this.LATITUDE)}setLongitude(t){h.setItem(this.LONGITUDE,t)}getLongitude(){return h.getItem(this.LONGITUDE)}async setInAppTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,t)}async getInAppTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS))}catch(t){}return t}async setTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,t)}async getTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_LIST))}catch(t){}return t}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(t){this.setStorage(this.URL_INAPP_API,t)}setInAppEnabled(t){this.setStorage(this.INAPP_ENABLED,t)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(t){this.setStorage(this.AVOID_CYPHER,t)}isAvoidCypher(){return this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}async setUrlDeviceApi(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,t)}setPushDisabled(t){this.setStorage(this.PUSH_DISABLED,t)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(t){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,t)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(t){this.setStorage(this.CONFIG_V2,t)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,t)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,t)}},y=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),v=y;class g{constructor(t){this.tag="[IND]",t&&(this.tag=t),this.level=v.INFO,this.setLogLevel((new E).getLogLevel()),this.log=[]}setLogLevel(t){t&&t>=v.DEBUG&&t<=v.ERROR&&(this.level=t)}static addedAsString(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}d(){if(this.level<=v.DEBUG)for(let t=0;t0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const m=g,I=class{constructor(t,e,r){this.errorCode=t,this.errorMessage=e,null!=r&&(this.exceptionMessage=r)}},_={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(t,e,r){if(null!=t){const n=Object.values(t.ErrorCode).indexOf(e);if(n>=0){const e=Object.keys(t.ErrorCode)[n],i=Object.values(t.ErrorCode)[n];return new I({code:e,errorId:i},Object.values(t.ErrorMessage)[n],r)}return new I(_.ErrorCode.GENERAL_ERROR,"general error",r)}}},S=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(t,e,r,n){const i=new m("[IND]BaseClient: ");r.isServiceWorkerRequest()&&i.setLogLevel(v.DEBUG);let o=await this.getURL()+r.getPath(e)+r.getParams();r.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:t,headers:r.addHeaders()};t!==this.GET&&(s.body=JSON.stringify(r.getBody())),n&&(s.credentials=n);try{const e=await fetch(o,s);if(304!=e.status){const n=await e.json();return e.ok?(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\nResponse Body:",JSON.stringify(n.data,null,"\t")).writeLog(),n):(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\n").writeLog(),new I(n.statusCode,n.message))}return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+e.status+"\n").writeLog(),e}catch(e){return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Error: "+e).writeLog(),b.showError(_,_.ErrorCode.GENERAL_ERROR,e)}}async get(t,e){return await this.call(this.GET,t,e)}async post(t,e,r){return await this.call(this.POST,t,e,r)}async put(t,e,r){return await this.call(this.PUT,t,e,r)}async delete(t,e){return await this.call(this.DELETE,t,e)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new E).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(t){let e=t;return Object.keys(this.pathParams).forEach((t=>{e=e.replace(t,this.pathParams[t])})),e}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(t){this.serviceWorkerRequest=t}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(t){this.journeyRequest=t}},P=class extends O{constructor(t=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=t}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let t="";if(this.channels&&this.channels.length>0)for(let e=0;e{new m("[IND]CorePermissions: ").d(t+" permission state has changed from "+n+" to "+r.state).writeLog(),n=r.state,e&&e({name:t,state:r.state})})}}},M=new m("[IND]Crypto"),k=new TextEncoder("utf-8"),x="HMAC",B=class{static async createHmac(t,e){try{let r="";if(!0===(new E).isAvoidCypher())r=e;else{const n=window?.crypto?.subtle;if(!n)return;const i=await n.importKey("raw",k.encode(t),{name:x,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await n.sign(x,i,k.encode(e)),s=new Uint8Array(o);r=Array.prototype.map.call(s,(t=>("00"+t.toString(16)).slice(-2))).join(""),M.d("hmac: ",r).writeLog()}return r}catch(t){return void M.e("error:",t).writeLog()}}},U=class{static compareJSON(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(t[n]!==e[n]){if("object"!=typeof t[n]||"object"!=typeof e[n])return!1;if(!isEqual(t[n],e[n]))return!1}return!0}},V=class{static isValidFormat(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}},j=class{static setTopicChannel(t,e){const r=[];for(let n=0;n{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(e,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=u(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}(r(710));Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var s,a=(s=r(610))&&s.__esModule?s:{default:s};function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(u=function(t){return t?r:e})(t)}},468:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=u(r(254)),i=u(r(234)),o=u(r(457)),s=u(r(735)),a=u(r(630));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var u=d(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==c(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){h(o,n,i,s,a,"next",t)}function a(t){h(o,n,i,s,a,"throw",t)}s(void 0)}))}}function d(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BaseClient",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var n=s(r(468)),i=s(r(237)),o=s(r(773));function s(t){return t&&t.__esModule?t:{default:t}}},773:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,r){return e=u(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,a()?Reflect.construct(e,r||[],u(t).constructor):e.apply(t,r))}(this,e)).PARAM_APPLICATION_CHANNEL="channel",t.channels=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),function(t,e){return e&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var t="";if(this.channels&&this.channels.length>0)for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={platform:"webpush",version:"0.0.1"},i=r(904);n.version=i.version,n=Object.assign(n,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),e.default=n},610:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=h(r(122)),o=h(r(291)),s=l(r(545)),a=l(r(225)),u=l(r(628));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function h(t){return t&&t.__esModule?t:{default:t}}e.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Channel=void 0;var r=e.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});e.default=r},174:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(r(291)),o=s(r(254));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=new i.default;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);var s=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,s=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):s=new Date(Date.now()+36e5),!r){var a=s.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+a).writeLog(),n.setConfigV2ServiceSyncTime(a)}}}));e.default=c},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):r?(e.enabled&&(this.enabled=e.enabled,(new i.default).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}),[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(t){this.deviceId=t}},{key:"setExternalCode",value:function(t){this.externalCode=t}},{key:"toJSON",value:function(){var t={};return this.platform&&(t.platform=this.platform),this.version&&(t.version=this.version),this.productName&&(t.productName=this.productName),this.productVersion&&(t.productVersion=this.productVersion),this.browserName&&(t.browserName=this.browserName),this.browserVersion&&(t.browserVersion=this.browserVersion),this.osName&&(t.osName=this.osName),this.osVersion&&(t.osVersion=this.osVersion),this.deviceType&&(t.deviceType=this.deviceType),this.locale&&(t.locale=this.locale),this.timeZone&&(t.timeZome=this.timeZone),this.timeOffset&&(t.timeOffset=this.timeOffset),this.deviceId&&(t.deviceId=this.deviceId),this.enabled&&(t.enabled=this.enabled),this.browserPublicKey&&(t.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(t.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(t.externalCode=this.externalCode),t}}]);e.default=u},89:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});e.default=r},735:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};e.default=r},234:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});e.default=r},72:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});e.default=r},225:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.Channel}}),Object.defineProperty(e,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var n=r(902),i=h(r(395)),o=h(r(89)),s=h(r(735)),a=h(r(234)),u=h(r(953)),c=h(r(72)),l=h(r(174));function h(t){return t&&t.__esModule?t:{default:t}}},672:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:T(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==i&&o.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(122)),i=a(r(87)),o=a(r(672)),s=a(r(238));function a(t){return t&&t.__esModule?t:{default:t}}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==u(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)}))}}function f(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(254))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))}}function c(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CryptoUtils=void 0;var n=i(r(291));function i(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(735)),i=o(r(234));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=0){var s={code:Object.keys(t.ErrorCode)[o],errorId:Object.values(t.ErrorCode)[o]};return new i.default(s,Object.values(t.ErrorMessage)[o],r)}return new i.default(n.default.ErrorCode.GENERAL_ERROR,"general error",r)}}}])&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=new c},325:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(630));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=i.default.DEBUG&&t<=i.default.ERROR&&(this.level=t)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var e=0;e0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();e.default=c},630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LogLevel=void 0;var r=e.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});e.default=r},662:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r8}}],e&&n(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=o},628:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"CommonUtils",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(e,"TopicUtils",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"Validations",{enumerable:!0,get:function(){return l.default}});var n=f(r(622)),i=f(r(429)),o=f(r(170)),s=f(r(457)),a=f(r(325)),u=f(r(254)),c=r(630),l=f(r(332)),h=f(r(662));function f(t){return t&&t.__esModule?t:{default:t}}},904:t=>{"use strict";t.exports=JSON.parse('{"_from":"indigitall-web-core@4.9.2","_id":"indigitall-web-core@4.9.2","_inBundle":false,"_integrity":"sha512-aGTfAnLDU6FrokX4B7XvAWEX2Obl/hlcz9OTPFOI/yQIwIKpjfZJ1BEVeCWvDiSEAYhLek73ppnFdV66cUxcGA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.9.2","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.9.2","saveSpec":null,"fetchSpec":"4.9.2"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.9.2.tgz","_shasum":"710cb6aaf9858cce437e850a450c7fc81cf71a03","_spec":"indigitall-web-core@4.9.2","_where":"/home/circleci/webpush/inbox","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.9.2"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>C});const{Repository:t}=r(315).Core,e=new class extends t{constructor(){super(),this.AUTH_TOKEN=this.REPOSITORY+".AUTH_TOKEN",this.INBOX_AUTH_MODE=this.REPOSITORY+".INBOX_AUTH_MODE",this.URL_INBOX_API=this.REPOSITORY+".URL_INBOX_API"}async setDeviceId(t){this.setStorage(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}setAuthToken(t){this.setStorage(this.AUTH_TOKEN,t)}getAuthToken(){return this.getStorage(this.AUTH_TOKEN)}setInboxAuthMode(t){this.setStorage(this.INBOX_AUTH_MODE,t)}getInboxAuthMode(){return this.getStorage(this.INBOX_AUTH_MODE)}async getUrlInboxApi(){return this.getStorage(this.URL_INBOX_API)}async setUrlInboxApi(t){this.setStorage(this.URL_INBOX_API,t)}},{BaseClient:o}=r(315).Core.Api,{Config:s}=r(315).Core,{ErrorModel:a}=r(315).Core.Models,{CommonUtils:u}=r(315).Core.Utils,c=new class extends o{constructor(){super(),this.URL_BASE=s.client.INBOX_URL_BASE,this.ENDPOINT_INBOX_NOTIFICATIONS="/notification",this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID=this.ENDPOINT_INBOX_NOTIFICATIONS+"/{sendingId}",this.ENDPOINT_INBOX_COUNTER="/counters",this.ENDPOINT_INBOX_AUTH="/auth/webhook"}async getURL(){return await e.getUrlInboxApi()||this.URL_BASE}async postInboxAuth(t,r,n){const i=await this.post(this.ENDPOINT_INBOX_AUTH,t.postInboxAuth());if(!i||i instanceof a||!i.data)i?u.isFunction(n)&&n(i):u.isFunction(n)&&n();else{const t=i.data.token;e.setAuthToken(t),u.isFunction(r)&&r(i)}return!0}async getInbox(t,e,r){const n=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS,t.getInboxPushRequest());return this.getInboxResponseStatus(n,e,r),!0}async putInboxPush(t,e,r){const n=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS,t.putInboxPushRequest());return this.getInboxResponseEdit(n,e,r),!0}async getInboxPushWithSendingId(t,e,r,n){const i=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,t.getInboxPushRequestWithSendingId());return this.getNotificationResponseStatus(i,e,r,n),!0}async putInboxPushWithSendingId(t,e,r,n){const i=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,t.putInboxWithSendingId());return this.getNotificationResponseStatus(i,e,r,n),!0}async getInboxCounter(t,e,r){const n=await this.get(this.ENDPOINT_INBOX_COUNTER,t.getCounter());this.getCounterStatus(n,e,r)}async getInboxResponseStatus(t,e,r){if(t&&!(t instanceof a)&&t.statusCode>=200&&t.statusCode<300){const r=new C(t.data);u.isFunction(e)&&e(r)}else t?u.isFunction(r)&&r(t):u.isFunction(r)&&r()}async getInboxResponseEdit(t,e,r){t&&!(t instanceof a)&&t.statusCode>=200&&t.statusCode<300?u.isFunction(e)&&e():t?u.isFunction(r)&&r(t):u.isFunction(r)&&r()}getNotifications(t,e){const r=[];for(let n=0;n=200&&t.statusCode<300){const t=new InboxNotification(notifications[i],e);u.isFunction(r)&&r(t)}else t?u.isFunction(n)&&n(t):u.isFunction(n)&&n()}async getCounterStatus(t,e,r){if(t&&!(t instanceof a)&&t.statusCode>=200&&t.statusCode<300){const r={click:t.data.click,sent:t.data.sent,deleted:t.data.deleted,unread:this.getUnreadCounters(t.data.unread)};u.isFunction(e)&&e(r)}else t?u.isFunction(r)&&r(t):u.isFunction(r)&&r()}getUnreadCounters(t){return{count:t.count,lastAccess:t.lastAccess}}},{BaseRequest:l}=r(315).Core.Api,h=class extends l{constructor(){super()}postInboxAuth(){return this.body=this.json,this}setJson(t){this.json=t}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}},f=Object.freeze({SENT:"sent",CLICK:"click",DELETED:"deleted"});window.inboxStatus=f;const d=f,p=Object.freeze({NONE:"none",DEFAULT:"default",WEBHOOK:"webhook"}),{BaseRequest:E}=r(315).Core.Api,y=class extends E{constructor(){super(),null!=e.getExternalId()&&(this.externalId=e.getExternalId()),null!=e.getAuthToken()&&e.getInboxAuthMode()==p.WEBHOOK&&(this.headers.Authorization="Bearer "+e.getAuthToken()),this.sendingId="",this.sendingIds=null,this.page=0,this.pageSize=0,this.dateFrom="",this.dateTo="",this.status=d.INBOXSTATUS_SENT,this.initialStatus=d.INBOXSTATUS_SENT,this.statusList=null}getInboxPushRequest(){return this.params=this.createQueryString(),this}putInboxPushRequest(){return this.params=this.createQueryStringExternalId(),this.body=this.createBodyJson(),this}getInboxPushRequestWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this}putInboxWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this.body=this.createBodyStatusJson(),this}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}createQueryString(){let t="";if(this.page&&(t+=this.PARAM_INBOX_PAGE+"="+this.page+"&"),this.pageSize&&(t+=this.PARAM_INBOX_PAGE_SIZE+"="+this.pageSize+"&"),this.dateFrom&&(t+=this.PARAM_INBOX_DATE_FROM+"="+this.dateFrom+"&"),this.dateTo&&(t+=this.PARAM_INBOX_DATE_TO+"="+this.dateTo+"&"),this.statusList){let e="";for(let t=0;t{t.append(e,this.headers[e])})),t}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}};class m{constructor(t,e){t&&(t.id&&(this.id=t.id),t.externalId&&(this.externalId=t.externalId),t.sentAt&&(this.sentAt=t.sentAt),t.status&&(this.status=t.status),t.sendingId&&(this.sendingId=t.sendingId),t.message&&(this.message=t.message),t.campaignId&&(this.campaignId=t.campaignId),this.read=!1,this.sentAt&&e&&this.sentAt3}static isValidFormatRequest(){const t=new A("[IND]InboxValidations: "),r=e.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,t.w("appKey is null or empty").writeLog()),this.isValidFormat(r)||(n=!1,t.w("deviceId is null or empty").writeLog()),n}},{CommonUtils:T,ErrorUtils:w,Log:N}=r(315).Core.Utils;class L{constructor(t){if(t){if(t.lastAccess&&(this.lastAccess=t.lastAccess),t.numPage?this.page=t.numPage:this.page=0,t.pageSize&&(this.pageSize=t.pageSize),this.count=0,t.count&&(this.count=t.count),t.notifications){this.notifications=[];const e=t.notifications;for(let t=0;t{401===r.errorCode?this.generateAuthToken((()=>{c.getInboxCounter(e,t,r)}),r):T.isFunction(r)&&r(r)}))}else T.isFunction(r)&&r(w.showError(O,O.ErrorCode.INBOX_GET_ERROR));else T.isFunction(r)&&r(w.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}static getInboxWithAuth(t,e,r){T.isFunction(t.getAuthConfig)&&(navigator.indigitallGetAuthConfig=getAuthConfig),L.getInbox(e,r)}static getInbox(t,e){L.getInboxWithPage(null,null,null,null,null,t,e)}static getInboxWithPageAuth(t,e,r,n,i,o,s,a){T.isFunction(t.getAuthConfig)&&(navigator.indigitallGetAuthConfig=getAuthConfig),L.getInboxWithPage(e,r,n,i,o,s,a)}static getInboxWithPage(t,r,n,i,o,s,a){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){const e=new y;t&&e.setPage(t),r&&e.setPageSize(r),n&&(e.setDateFrom(n),this.dateFrom=n),i&&(e.setDateTo(i),this.dateTo=i),o&&(e.setStatusList(o),this.statusList=o),c.getInbox(e,(t=>{this.totalPages=t.totalPages,0!==t.count?T.isFunction(s)&&s(t):T.isFunction(a)&&a(w.showError(O,O.ErrorCode.INBOX_GET_PAGE_ERROR))}),(t=>{401==t.errorCode?this.generateAuthToken((()=>{c.getInbox(e,(t=>{this.totalPages=t.totalPages,T.isFunction(s)&&s(t)}),t)}),t):T.isFunction(t)&&t(t)}))}else T.isFunction(a)&&a(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(a)&&a(w.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}getNextPage(t,r){const n=new N("[IND]Inbox: ");if(this.isRequestingPage)n.w(O.ErrorMessage.INBOX_IS_REQUESTING_PAGE).writeLog();else if(this.isRequestingPage=!0,this.page+1{this.notifications=this.notifications.concat(e.notifications),this.newNotifications=e.notifications,this.lastAccess=e.lastAccess,this.count=e.count,this.page=e.page,this.pageSize=e.pageSize,this.totalPages=e.totalPages,this.isRequestingPage=!1,T.isFunction(t)&&t(this,this.newNotifications)}),(r=>{401===r.errorCode?this.generateAuthToken((()=>{c.getInbox(e,(e=>{this.notifications=this.notifications.concat(e.notifications),this.newNotifications=e.notifications,this.lastAccess=e.lastAccess,this.count=e.count,this.page=e.page,this.pageSize=e.pageSize,this.totalPages=e.totalPages,this.isRequestingPage=!1,T.isFunction(t)&&t(this,this.newNotifications)}),r)}),r):(this.isRequestingPage=!1,T.isFunction(r)&&r())}))}else this.isRequestingPage=!1,T.isFunction(r)&&r(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(r)&&r(w.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else this.isRequestingPage=!1,T.isFunction(r)&&r(w.showError(O,O.ErrorCode.INBOX_NO_MESSAGES))}massiveEditNotifications(t,e,r,n){let i=d.SENT;e==d.CLICK&&(i=d.SENT),e==d.DELETED&&(i=d.CLICK),this.massiveEditNotifications(t,i,e,r,n)}massiveEditNotificationsWithInitialStatus(t,r,n,i,o){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){if(n){const e=new y;null!=t&&e.setSendingIds(t),e.setStatus(n),e.setInitialStatus(r),c.putInboxPush(e,i,(t=>{401===t.errorCode?this.generateAuthToken((()=>{c.putInboxPush(e,i,t)}),t):T.isFunction(t)&&t(t)}))}}else T.isFunction(o)&&o(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(o)&&o(w.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}getInfoFromNotification(t,r,n){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){if(t){const e=new y;e.setSendingId(t),c.getInboxPushWithSendingId(e,this.lastAccess,r,(t=>{401===t.errorCode?this.generateAuthToken((()=>{c.getInboxPushWithSendingId(e,this.lastAccess,r,t)}),t):T.isFunction(t)&&t(t)}))}}else T.isFunction(n)&&n(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(n)&&n(w.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}modifyStatusFromNotification(t,r,n,i){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){if(t&&r){const e=new y;e.setSendingId(t),e.setStatus(r),c.putInboxPushWithSendingId(e,this.lastAccess,n,(t=>{401===t.errorCode?this.generateAuthToken((()=>{c.putInboxPushWithSendingId(e,this.lastAccess,n,t)}),t):T.isFunction(t)&&t(t)}))}}else T.isFunction(i)&&i(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(i)&&i(w.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}}const C=L})(),n})(),t.exports=e()},824:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={};Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=s(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(r(114));function s(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(s=function(t){return t?r:e})(t)}Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}))},603:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={};Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=s(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(r(93));function s(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(s=function(t){return t?r:e})(t)}Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}))},93:function(t){var e;e=()=>(()=>{var t={710:function(t){var e;e=()=>(()=>{"use strict";var t={330:t=>{t.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>Y});var i={};r.r(i),r.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>S,BaseRequest:()=>O});var o={};r.r(o),r.d(o,{Channel:()=>A,CoreApplication:()=>L,Device:()=>R,DeviceStatus:()=>T,ErrorDictionary:()=>_,ErrorModel:()=>I,EventType:()=>w,TopicSubscribeType:()=>N});var s={};r.r(s),r.d(s,{CommonUtils:()=>C,CorePermissions:()=>D,CryptoUtils:()=>B,ErrorUtils:()=>b,JsonUtils:()=>U,Log:()=>m,LogLevel:()=>y,TopicUtils:()=>j,Validations:()=>V});var a={platform:"webpush",version:"0.0.1"};const u=r(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==l.length}return!1}setItem(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}getItem(t){return null!=this.storage?this.storage.getItem(t):null}deleteItem(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}clear(){this.storage&&this.storage.clear()}},h=l,f=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise(((t,e)=>{const r=this.IDB;if(r){const n=r.open("indigitall.indexedDB",1);n.onupgradeneeded=function(){n.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},n.onsuccess=function(){const e=n.result,r=e.transaction("indigitallStore","readwrite"),i=r.objectStore("indigitallStore"),o=i.index("storeIndex");t({db:e,tx:r,store:i,index:o})},n.onerror=function(t){e(t)}}else e(!1)}))}async get(t,e){return new Promise(((r,n)=>{t||n(!1),t.index.get(e).onsuccess=e=>{e.target.result&&(this.close(t),r(e.target.result.store.value)),n(!1)}}))}async put(t,e,r){return new Promise(((n,i)=>{t||i(!1),t.store.put({store:{key:e,value:r}},e).onsuccess=e=>{this.close(t),n(r)}}))}close(t){if(t.tx)try{t.tx.oncomplete=()=>{t.db.close()}}catch(t){console.error(this.TAG,t)}}async setItem(t,e){try{const r=await this.getDB();return this.put(r,t,e)}catch(t){return t}}async getItem(t){try{const e=await this.getDB();return this.get(e,t)}catch(t){return t}}},d=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==d.length}return!1}getItem(t){return null!=this.session?this.session.getItem(t):null}setItem(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=d,E=class{constructor(){this.storage=h,this.db=f,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(t,e){p.setItem(t,e)}getItemSessionStorage(t){return p.getItem(t)}clearSessionStorage(){p.clearMessages()}setStorage(t,e){h.setItem(t,e)}getStorage(t){return h.getItem(t)}clearStorage(){h.clear()}setBrowserPublicKey(t){h.setItem(this.BROWSER_PUBLIC_KEY,t)}getBrowserPublicKey(){return h.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(t){h.setItem(this.BROWSER_PRIVATE_KEY,t)}getBrowserPrivateKey(){return h.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(t){h.setItem(this.APP_KEY,t),f&&f.IDB&&await f.setItem(this.APP_KEY,t)}getAppKey(){return h.getItem(this.APP_KEY)}async setDeviceId(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(f&&f.IDB)return await f.getItem(this.APP_KEY)}setVAPID(t){h.setItem(this.VAPID_PUBLIC,t)}getVAPID(){return h.getItem(this.VAPID_PUBLIC)}setEnabled(t){h.setItem(this.ENABLED,t)}getEnabled(){return h.getItem(this.ENABLED)}setServiceSyncTime(t){h.setItem(this.SERVICE_SYNC_TIME,t*this.BASE_TIME)}getServiceSyncTime(){return h.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(t){h.setItem(this.LOCATION_ENABLED,t)}getLocationEnabled(){return h.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(t){h.setItem(this.LOCATION_UPDATE_MINUTES,t)}getLocationUpdateMinutes(){return h.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(t){h.setItem(this.REQUEST_LOCATION,t)}getRequestLocation(){return!!h&&h.getItem(this.REQUEST_LOCATION)}async setPlatform(t){h.setItem(this.PLATFORM,t)}getPlatform(){return h&&h.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(t){h.setItem(this.BROWSER_NAME,t)}getBrowserName(){return h.getItem(this.BROWSER_NAME)}setBrowserVersion(t){h.setItem(this.BROWSER_VERSION,t)}getBrowserVersion(){return h.getItem(this.BROWSER_VERSION)}async setOsName(t){h.setItem(this.OS_NAME,t)}getOsName(){return h.getItem(this.OS_NAME)}setOsVersion(t){h.setItem(this.OS_VERSION,t)}getOsVersion(){return h.getItem(this.OS_VERSION)}setDeviceType(t){h.setItem(this.DEVICE_TYPE,t)}getDeviceType(){return h.getItem(this.DEVICE_TYPE)}setSupported(t){h.setItem(this.SUPPORTED,t)}getSupported(){return h.getItem(this.SUPPORTED)}setServiceTimestamp(t){h.setItem(this.SERVICE_TIMESTAMP,t)}getServiceTimestamp(){return h.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(t){h.setItem(this.LOCATION_TIMESTAMP,t)}getLocationTimestamp(){return h.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(t){h.setItem(this.PERMISSION_LOCATION,t)}getPermissionLocation(){return h.getItem(this.PERMISSION_LOCATION)}setDebugLog(t){h.setItem(this.SET_LOG_DEBUG,t)}getDebugLog(){return"false"!==h.getItem(this.SET_LOG_DEBUG)}setLogLevel(t){h.setItem(this.LOG_LEVEL,t)}getLogLevel(){return h.getItem(this.LOG_LEVEL)}setNewUserTimestamp(t){h.setItem(this.NEW_USER_TIMESTAMP,t)}getNewUserTimestamp(){return h.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(t){h&&h.isLocalStorageAvailable()&&h.setItem(this.EXTERNAL_ID,t),f&&f.IDB&&await f.setItem(this.EXTERNAL_ID,t)}async getExternalIdRequest(){let t;try{h&&h.isLocalStorageAvailable()?t=h.getItem(this.EXTERNAL_ID):f&&f.IDB&&(t=await f.getItem(this.EXTERNAL_ID))}catch(t){}return t}setExternalId(t){h.setItem(this.EXTERNAL_ID,t)}getExternalId(){return h.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return h.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(t){h.setItem(this.REGISTERED_BY_COOKIE,t)}setLatitude(t){h.setItem(this.LATITUDE,t)}getLatitude(){return h.getItem(this.LATITUDE)}setLongitude(t){h.setItem(this.LONGITUDE,t)}getLongitude(){return h.getItem(this.LONGITUDE)}async setInAppTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,t)}async getInAppTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS))}catch(t){}return t}async setTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,t)}async getTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_LIST))}catch(t){}return t}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(t){this.setStorage(this.URL_INAPP_API,t)}setInAppEnabled(t){this.setStorage(this.INAPP_ENABLED,t)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(t){this.setStorage(this.AVOID_CYPHER,t)}isAvoidCypher(){return this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}async setUrlDeviceApi(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,t)}setPushDisabled(t){this.setStorage(this.PUSH_DISABLED,t)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(t){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,t)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(t){this.setStorage(this.CONFIG_V2,t)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,t)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,t)}},y=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),v=y;class g{constructor(t){this.tag="[IND]",t&&(this.tag=t),this.level=v.INFO,this.setLogLevel((new E).getLogLevel()),this.log=[]}setLogLevel(t){t&&t>=v.DEBUG&&t<=v.ERROR&&(this.level=t)}static addedAsString(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}d(){if(this.level<=v.DEBUG)for(let t=0;t0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const m=g,I=class{constructor(t,e,r){this.errorCode=t,this.errorMessage=e,null!=r&&(this.exceptionMessage=r)}},_={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(t,e,r){if(null!=t){const n=Object.values(t.ErrorCode).indexOf(e);if(n>=0){const e=Object.keys(t.ErrorCode)[n],i=Object.values(t.ErrorCode)[n];return new I({code:e,errorId:i},Object.values(t.ErrorMessage)[n],r)}return new I(_.ErrorCode.GENERAL_ERROR,"general error",r)}}},S=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(t,e,r,n){const i=new m("[IND]BaseClient: ");r.isServiceWorkerRequest()&&i.setLogLevel(v.DEBUG);let o=await this.getURL()+r.getPath(e)+r.getParams();r.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:t,headers:r.addHeaders()};t!==this.GET&&(s.body=JSON.stringify(r.getBody())),n&&(s.credentials=n);try{const e=await fetch(o,s);if(304!=e.status){const n=await e.json();return e.ok?(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\nResponse Body:",JSON.stringify(n.data,null,"\t")).writeLog(),n):(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\n").writeLog(),new I(n.statusCode,n.message))}return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+e.status+"\n").writeLog(),e}catch(e){return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Error: "+e).writeLog(),b.showError(_,_.ErrorCode.GENERAL_ERROR,e)}}async get(t,e){return await this.call(this.GET,t,e)}async post(t,e,r){return await this.call(this.POST,t,e,r)}async put(t,e,r){return await this.call(this.PUT,t,e,r)}async delete(t,e){return await this.call(this.DELETE,t,e)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new E).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(t){let e=t;return Object.keys(this.pathParams).forEach((t=>{e=e.replace(t,this.pathParams[t])})),e}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(t){this.serviceWorkerRequest=t}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(t){this.journeyRequest=t}},P=class extends O{constructor(t=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=t}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let t="";if(this.channels&&this.channels.length>0)for(let e=0;e{new m("[IND]CorePermissions: ").d(t+" permission state has changed from "+n+" to "+r.state).writeLog(),n=r.state,e&&e({name:t,state:r.state})})}}},M=new m("[IND]Crypto"),k=new TextEncoder("utf-8"),x="HMAC",B=class{static async createHmac(t,e){try{let r="";if(!0===(new E).isAvoidCypher())r=e;else{const n=window?.crypto?.subtle;if(!n)return;const i=await n.importKey("raw",k.encode(t),{name:x,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await n.sign(x,i,k.encode(e)),s=new Uint8Array(o);r=Array.prototype.map.call(s,(t=>("00"+t.toString(16)).slice(-2))).join(""),M.d("hmac: ",r).writeLog()}return r}catch(t){return void M.e("error:",t).writeLog()}}},U=class{static compareJSON(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(t[n]!==e[n]){if("object"!=typeof t[n]||"object"!=typeof e[n])return!1;if(!isEqual(t[n],e[n]))return!1}return!0}},V=class{static isValidFormat(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}},j=class{static setTopicChannel(t,e){const r=[];for(let n=0;n{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(e,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=u(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}(r(710));Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var s,a=(s=r(610))&&s.__esModule?s:{default:s};function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(u=function(t){return t?r:e})(t)}},468:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=u(r(254)),i=u(r(234)),o=u(r(457)),s=u(r(735)),a=u(r(630));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var u=d(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==c(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){h(o,n,i,s,a,"next",t)}function a(t){h(o,n,i,s,a,"throw",t)}s(void 0)}))}}function d(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BaseClient",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var n=s(r(468)),i=s(r(237)),o=s(r(773));function s(t){return t&&t.__esModule?t:{default:t}}},773:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,r){return e=u(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,a()?Reflect.construct(e,r||[],u(t).constructor):e.apply(t,r))}(this,e)).PARAM_APPLICATION_CHANNEL="channel",t.channels=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),function(t,e){return e&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"getApplicationRequest",value:function(){return this.params=this.createQueryString(),this}},{key:"createQueryString",value:function(){var t="";if(this.channels&&this.channels.length>0)for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={platform:"webpush",version:"0.0.1"},i=r(904);n.version=i.version,n=Object.assign(n,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),e.default=n},610:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=h(r(122)),o=h(r(291)),s=l(r(545)),a=l(r(225)),u=l(r(628));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function h(t){return t&&t.__esModule?t:{default:t}}e.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Channel=void 0;var r=e.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});e.default=r},174:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(r(291)),o=s(r(254));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=new i.default;if(null!=e){n.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,n.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,n.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);var s=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,s=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):s=new Date(Date.now()+36e5),!r){var a=s.toString();new o.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+a).writeLog(),n.setConfigV2ServiceSyncTime(a)}}}));e.default=c},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):r?(e.enabled&&(this.enabled=e.enabled,(new i.default).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}),[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(t){this.deviceId=t}},{key:"setExternalCode",value:function(t){this.externalCode=t}},{key:"toJSON",value:function(){var t={};return this.platform&&(t.platform=this.platform),this.version&&(t.version=this.version),this.productName&&(t.productName=this.productName),this.productVersion&&(t.productVersion=this.productVersion),this.browserName&&(t.browserName=this.browserName),this.browserVersion&&(t.browserVersion=this.browserVersion),this.osName&&(t.osName=this.osName),this.osVersion&&(t.osVersion=this.osVersion),this.deviceType&&(t.deviceType=this.deviceType),this.locale&&(t.locale=this.locale),this.timeZone&&(t.timeZome=this.timeZone),this.timeOffset&&(t.timeOffset=this.timeOffset),this.deviceId&&(t.deviceId=this.deviceId),this.enabled&&(t.enabled=this.enabled),this.browserPublicKey&&(t.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(t.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(t.externalCode=this.externalCode),t}}]);e.default=u},89:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});e.default=r},735:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}};e.default=r},234:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});e.default=r},72:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});e.default=r},225:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.Channel}}),Object.defineProperty(e,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var n=r(902),i=h(r(395)),o=h(r(89)),s=h(r(735)),a=h(r(234)),u=h(r(953)),c=h(r(72)),l=h(r(174));function h(t){return t&&t.__esModule?t:{default:t}}},672:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:T(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==i&&o.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(122)),i=a(r(87)),o=a(r(672)),s=a(r(238));function a(t){return t&&t.__esModule?t:{default:t}}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==u(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)}))}}function f(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(254))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))}}function c(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CryptoUtils=void 0;var n=i(r(291));function i(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(735)),i=o(r(234));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=0){var s={code:Object.keys(t.ErrorCode)[o],errorId:Object.values(t.ErrorCode)[o]};return new i.default(s,Object.values(t.ErrorMessage)[o],r)}return new i.default(n.default.ErrorCode.GENERAL_ERROR,"general error",r)}}}])&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=new c},325:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(630));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=i.default.DEBUG&&t<=i.default.ERROR&&(this.level=t)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var e=0;e0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();e.default=c},630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LogLevel=void 0;var r=e.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});e.default=r},662:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var r=0;r8}}],e&&n(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();e.default=o},628:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"CommonUtils",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(e,"TopicUtils",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"Validations",{enumerable:!0,get:function(){return l.default}});var n=f(r(622)),i=f(r(429)),o=f(r(170)),s=f(r(457)),a=f(r(325)),u=f(r(254)),c=r(630),l=f(r(332)),h=f(r(662));function f(t){return t&&t.__esModule?t:{default:t}}},114:function(t){var e;e=()=>(()=>{var t={710:function(t){var e;e=()=>(()=>{"use strict";var t={330:t=>{t.exports=JSON.parse('{"name":"indigitall-web-core","description":"indigitall web core","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>Y});var i={};r.r(i),r.d(i,{BaseApplicationRequest:()=>P,BaseClient:()=>S,BaseRequest:()=>O});var o={};r.r(o),r.d(o,{Channel:()=>A,CoreApplication:()=>L,Device:()=>R,DeviceStatus:()=>T,ErrorDictionary:()=>_,ErrorModel:()=>I,EventType:()=>w,TopicSubscribeType:()=>N});var s={};r.r(s),r.d(s,{CommonUtils:()=>C,CorePermissions:()=>D,CryptoUtils:()=>B,ErrorUtils:()=>b,JsonUtils:()=>U,Log:()=>m,LogLevel:()=>y,TopicUtils:()=>j,Validations:()=>V});var a={platform:"webpush",version:"0.0.1"};const u=r(330);a.version=u.version;const c=a=Object.assign(a,{client:{URL_BASE:"https://device-api.indigitall.com/v1",URL_DEVICE_V2:"https://device-api.indigitall.com/v2",INAPP_URL_BASE:"https://inapp-api.indigitall.com/v1",INBOX_URL_BASE:"https://inbox-api.indigitall.com/v1",CUSTOMER_URL_BASE:"https://device-api.indigitall.com/v2"}}),l=new class{constructor(){this.storage=this.isLocalStorageAvailable()?window.localStorage:null}isLocalStorageAvailable(){try{const t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==l.length}return!1}setItem(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}getItem(t){return null!=this.storage?this.storage.getItem(t):null}deleteItem(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}clear(){this.storage&&this.storage.clear()}},h=l,f=new class{constructor(){this.TAG="[IND]IndexedDB: ",this.DB_NAME="indigitall.indexedDB",this.DB_VERSION=1,this.DB_STORE_NAME="indigitallStore",this.DB_STORE_MODE="readwrite",this.DB_KEY_PATH="id",this.DB_STORE_INDEX="storeIndex",this.IDB=indexedDB||mozzIndexedDB||webkitIndexedDB||msIndexedDB}async getDB(){return new Promise(((t,e)=>{const r=this.IDB;if(r){const n=r.open("indigitall.indexedDB",1);n.onupgradeneeded=function(){n.result.createObjectStore("indigitallStore").createIndex("storeIndex","store.key")},n.onsuccess=function(){const e=n.result,r=e.transaction("indigitallStore","readwrite"),i=r.objectStore("indigitallStore"),o=i.index("storeIndex");t({db:e,tx:r,store:i,index:o})},n.onerror=function(t){e(t)}}else e(!1)}))}async get(t,e){return new Promise(((r,n)=>{t||n(!1),t.index.get(e).onsuccess=e=>{e.target.result&&(this.close(t),r(e.target.result.store.value)),n(!1)}}))}async put(t,e,r){return new Promise(((n,i)=>{t||i(!1),t.store.put({store:{key:e,value:r}},e).onsuccess=e=>{this.close(t),n(r)}}))}close(t){if(t.tx)try{t.tx.oncomplete=()=>{t.db.close()}}catch(t){console.error(this.TAG,t)}}async setItem(t,e){try{const r=await this.getDB();return this.put(r,t,e)}catch(t){return t}}async getItem(t){try{const e=await this.getDB();return this.get(e,t)}catch(t){return t}}},d=new class{constructor(){this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null}isSessionStorageAvailable(){try{const t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==d.length}return!1}getItem(t){return null!=this.session?this.session.getItem(t):null}setItem(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}clearMessages(){this.session&&this.session.removeItem("messages")}},p=d,E=class{constructor(){this.storage=h,this.db=f,this.BASE_TIME=60,this.REPOSITORY="indigitall.repository",this.APP_KEY=this.REPOSITORY+".APP_KEY",this.VAPID_PUBLIC=this.REPOSITORY+".VAPID_PUBLIC",this.ENABLED=this.REPOSITORY+".ENABLED",this.DEVICE_ID=this.REPOSITORY+".DEVICE_ID",this.SERVICE_SYNC_TIME=this.REPOSITORY+".SERVICE_SYNC_TIME",this.LOCATION_ENABLED=this.REPOSITORY+".LOCATION_ENABLED",this.LOCATION_UPDATE_MINUTES=this.REPOSITORY+".LOCATION_UPDATE_MINUTES",this.REQUEST_LOCATION=this.REPOSITORY+".REQUEST_LOCATION",this.BROWSER_PUBLIC_KEY=this.REPOSITORY+".BROWSER_PUBLIC_KEY",this.BROWSER_PRIVATE_KEY=this.REPOSITORY+".BROWSER_PRIVATE_KEY",this.PLATFORM=this.REPOSITORY+".PLATFORM",this.BROWSER_NAME=this.REPOSITORY+".BROWSER_NAME",this.BROWSER_VERSION=this.REPOSITORY+".BROWSER_VERSION",this.OS_NAME=this.REPOSITORY+".OS_NAME",this.OS_VERSION=this.REPOSITORY+".OS_VERSION",this.DEVICE_TYPE=this.REPOSITORY+".DEVICE_TYPE",this.SUPPORTED=this.REPOSITORY+".SUPPORTED",this.SERVICE_TIMESTAMP=this.REPOSITORY+".SERVICE_TIMESTAMP",this.LOCATION_TIMESTAMP=this.REPOSITORY+".LOCATION_TIMESTAMP",this.PERMISSION_LOCATION=this.REPOSITORY+".PERMISSION_LOCATION",this.SET_LOG_DEBUG=this.REPOSITORY+".SET_LOG_DEBUG",this.NEW_USER_TIMESTAMP=this.REPOSITORY+".NEW_USER_TIMESTAMP",this.EXTERNAL_ID=this.REPOSITORY+".EXTERNAL_ID",this.REGISTERED_BY_COOKIE=this.REPOSITORY+".REGISTERED_BY_COOKIE",this.LOG_LEVEL=this.REPOSITORY+".LOG_LEVEL",this.LATITUDE=this.REPOSITORY+".LATITUDE",this.LONGITUDE=this.REPOSITORY+".LONGITUDE",this.TOPIC_LIST=this.REPOSITORY+".TOPIC_LIST",this.INAPP_ENABLED=this.REPOSITORY+".INAPP_ENABLED",this.URL_INAPP_API=this.REPOSITORY+".URL_INAPP_API",this.INAPP_TOPICS=this.REPOSITORY+".INAPP_TOPICS",this.AVOID_CYPHER=this.REPOSITORY+".AVOID_CYPHER",this.URL_DEVICE_API=this.REPOSITORY+".URL_DEVICE_API",this.PUSH_DISABLED=this.REPOSITORY+".PUSH_DISABLED",this.CONFIG_V2_SERVICE_SYNC_TIME=this.REPOSITORY+".CONFIG_V2_SERVICE_SYNC_TIME",this.CONFIG_V2=this.REPOSITORY+".CONFIG_V2",this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_START_KEY",this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY=this.REPOSITORY+".CONFIG_V2_MAINTENANCE_WINDOW_END_KEY"}setItemSessionStorage(t,e){p.setItem(t,e)}getItemSessionStorage(t){return p.getItem(t)}clearSessionStorage(){p.clearMessages()}setStorage(t,e){h.setItem(t,e)}getStorage(t){return h.getItem(t)}clearStorage(){h.clear()}setBrowserPublicKey(t){h.setItem(this.BROWSER_PUBLIC_KEY,t)}getBrowserPublicKey(){return h.getItem(this.BROWSER_PUBLIC_KEY)}setBrowserPrivateKey(t){h.setItem(this.BROWSER_PRIVATE_KEY,t)}getBrowserPrivateKey(){return h.getItem(this.BROWSER_PRIVATE_KEY)}async setAppKey(t){h.setItem(this.APP_KEY,t),f&&f.IDB&&await f.setItem(this.APP_KEY,t)}getAppKey(){return h.getItem(this.APP_KEY)}async setDeviceId(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.DEVICE_ID,t),this.db&&this.db.IDB&&await this.db.setItem(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}async getAppKeySync(){if(f&&f.IDB)return await f.getItem(this.APP_KEY)}setVAPID(t){h.setItem(this.VAPID_PUBLIC,t)}getVAPID(){return h.getItem(this.VAPID_PUBLIC)}setEnabled(t){h.setItem(this.ENABLED,t)}getEnabled(){return h.getItem(this.ENABLED)}setServiceSyncTime(t){h.setItem(this.SERVICE_SYNC_TIME,t*this.BASE_TIME)}getServiceSyncTime(){return h.getItem(this.SERVICE_SYNC_TIME)||1*this.BASE_TIME}setLocationEnabled(t){h.setItem(this.LOCATION_ENABLED,t)}getLocationEnabled(){return h.getItem(this.LOCATION_ENABLED)}setLocationUpdateMinutes(t){h.setItem(this.LOCATION_UPDATE_MINUTES,t)}getLocationUpdateMinutes(){return h.getItem(this.LOCATION_UPDATE_MINUTES)||30}async setRequestLocation(t){h.setItem(this.REQUEST_LOCATION,t)}getRequestLocation(){return!!h&&h.getItem(this.REQUEST_LOCATION)}async setPlatform(t){h.setItem(this.PLATFORM,t)}getPlatform(){return h&&h.getItem(this.PLATFORM)||c.platform}getVersion(){return c.version}async setBrowserName(t){h.setItem(this.BROWSER_NAME,t)}getBrowserName(){return h.getItem(this.BROWSER_NAME)}setBrowserVersion(t){h.setItem(this.BROWSER_VERSION,t)}getBrowserVersion(){return h.getItem(this.BROWSER_VERSION)}async setOsName(t){h.setItem(this.OS_NAME,t)}getOsName(){return h.getItem(this.OS_NAME)}setOsVersion(t){h.setItem(this.OS_VERSION,t)}getOsVersion(){return h.getItem(this.OS_VERSION)}setDeviceType(t){h.setItem(this.DEVICE_TYPE,t)}getDeviceType(){return h.getItem(this.DEVICE_TYPE)}setSupported(t){h.setItem(this.SUPPORTED,t)}getSupported(){return h.getItem(this.SUPPORTED)}setServiceTimestamp(t){h.setItem(this.SERVICE_TIMESTAMP,t)}getServiceTimestamp(){return h.getItem(this.SERVICE_TIMESTAMP)}setLocationTimestamp(t){h.setItem(this.LOCATION_TIMESTAMP,t)}getLocationTimestamp(){return h.getItem(this.LOCATION_TIMESTAMP)}setPermissionLocation(t){h.setItem(this.PERMISSION_LOCATION,t)}getPermissionLocation(){return h.getItem(this.PERMISSION_LOCATION)}setDebugLog(t){h.setItem(this.SET_LOG_DEBUG,t)}getDebugLog(){return"false"!==h.getItem(this.SET_LOG_DEBUG)}setLogLevel(t){h.setItem(this.LOG_LEVEL,t)}getLogLevel(){return h.getItem(this.LOG_LEVEL)}setNewUserTimestamp(t){h.setItem(this.NEW_USER_TIMESTAMP,t)}getNewUserTimestamp(){return h.getItem(this.NEW_USER_TIMESTAMP)}async setExternalIdRequest(t){h&&h.isLocalStorageAvailable()&&h.setItem(this.EXTERNAL_ID,t),f&&f.IDB&&await f.setItem(this.EXTERNAL_ID,t)}async getExternalIdRequest(){let t;try{h&&h.isLocalStorageAvailable()?t=h.getItem(this.EXTERNAL_ID):f&&f.IDB&&(t=await f.getItem(this.EXTERNAL_ID))}catch(t){}return t}setExternalId(t){h.setItem(this.EXTERNAL_ID,t)}getExternalId(){return h.getItem(this.EXTERNAL_ID)}async getRegisteredByCookie(){return h.getItem(this.REGISTERED_BY_COOKIE)}async setRegisteredByCookie(t){h.setItem(this.REGISTERED_BY_COOKIE,t)}setLatitude(t){h.setItem(this.LATITUDE,t)}getLatitude(){return h.getItem(this.LATITUDE)}setLongitude(t){h.setItem(this.LONGITUDE,t)}getLongitude(){return h.getItem(this.LONGITUDE)}async setInAppTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.INAPP_TOPICS,t)}async getInAppTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.INAPP_TOPICS))}catch(t){}return t}async setTopicList(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_LIST,t)}async getTopicList(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_LIST))}catch(t){}return t}getUrlInappApi(){return this.getStorage(this.URL_INAPP_API)}setUrlInappApi(t){this.setStorage(this.URL_INAPP_API,t)}setInAppEnabled(t){this.setStorage(this.INAPP_ENABLED,t)}isInAppEnabled(){return this.getStorage(this.INAPP_ENABLED)}setAvoidCypher(t){this.setStorage(this.AVOID_CYPHER,t)}isAvoidCypher(){return this.getStorage(this.AVOID_CYPHER)}async getUrlDeviceApi(){let t;try{this.storage&&this.storage.isLocalStorageAvailable()?t=this.getStorage(this.URL_DEVICE_API):this.db&&this.db.IDB&&(t=await this.db.getItem(this.URL_DEVICE_API))}catch(t){}return t}async setUrlDeviceApi(t){this.storage&&this.storage.isLocalStorageAvailable()&&this.setStorage(this.URL_DEVICE_API,t),this.db&&this.db.IDB&&await this.db.setItem(this.URL_DEVICE_API,t)}setPushDisabled(t){this.setStorage(this.PUSH_DISABLED,t)}isPushDisabled(){return this.getStorage(this.PUSH_DISABLED)}getConfigV2ServiceSyncTime(){return this.getStorage(this.CONFIG_V2_SERVICE_SYNC_TIME)}setConfigV2ServiceSyncTime(t){this.setStorage(this.CONFIG_V2_SERVICE_SYNC_TIME,t)}getConfigV2(){return this.getStorage(this.CONFIG_V2)}setConfigV2(t){this.setStorage(this.CONFIG_V2,t)}getMaintenanceEnd(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY)}setMaintenanceEnd(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_END_KEY,t)}getMaintenanceStart(){return this.getStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY)}setMaintenanceStart(t){this.setStorage(this.CONFIG_V2_MAINTENANCE_WINDOW_START_KEY,t)}},y=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4}),v=y;class g{constructor(t){this.tag="[IND]",t&&(this.tag=t),this.level=v.INFO,this.setLogLevel((new E).getLogLevel()),this.log=[]}setLogLevel(t){t&&t>=v.DEBUG&&t<=v.ERROR&&(this.level=t)}static addedAsString(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}d(){if(this.level<=v.DEBUG)for(let t=0;t0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}const m=g,I=class{constructor(t,e,r){this.errorCode=t,this.errorMessage=e,null!=r&&(this.exceptionMessage=r)}},_={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}},b=new class{constructor(){}showError(t,e,r){if(null!=t){const n=Object.values(t.ErrorCode).indexOf(e);if(n>=0){const e=Object.keys(t.ErrorCode)[n],i=Object.values(t.ErrorCode)[n];return new I({code:e,errorId:i},Object.values(t.ErrorMessage)[n],r)}return new I(_.ErrorCode.GENERAL_ERROR,"general error",r)}}},S=class{constructor(){this.URL_BASE="",this.GET="GET",this.POST="POST",this.PUT="PUT",this.DELETE="DELETE"}async getURL(){return this.URL_BASE}async call(t,e,r,n){const i=new m("[IND]BaseClient: ");r.isServiceWorkerRequest()&&i.setLogLevel(v.DEBUG);let o=await this.getURL()+r.getPath(e)+r.getParams();r.isJourneyRequest()&&(o=o.replace("v1","v2"));const s={method:t,headers:r.addHeaders()};t!==this.GET&&(s.body=JSON.stringify(r.getBody())),n&&(s.credentials=n);try{const e=await fetch(o,s);if(304!=e.status){const n=await e.json();return e.ok?(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\nResponse Body:",JSON.stringify(n.data,null,"\t")).writeLog(),n):(i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+n.statusCode+"\nResponse Message: "+n.message+"\n").writeLog(),new I(n.statusCode,n.message))}return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Response Code: "+e.status+"\n").writeLog(),e}catch(e){return i.d("Method: "+t+"\nURL: "+o+"\n"+(t!==this.GET?"Request Body: "+JSON.stringify(r.getBody(),null,"\t")+"\n":"")+"Error: "+e).writeLog(),b.showError(_,_.ErrorCode.GENERAL_ERROR,e)}}async get(t,e){return await this.call(this.GET,t,e)}async post(t,e,r){return await this.call(this.POST,t,e,r)}async put(t,e,r){return await this.call(this.PUT,t,e,r)}async delete(t,e){return await this.call(this.DELETE,t,e)}},O=class{constructor(){this.PARAM_APP_KEY="appKey",this.PARAM_DEVICE_ID="deviceId",this.PARAM_PUSH_TOKEN="pushToken",this.PARAM_ENABLED="enabled",this.PARAM_PLATFORM="platform",this.PARAM_VERSION="version",this.PARAM_TOPICS="topics",this.PARAM_EVENT_TYPE="eventType",this.PARAM_PUSH_ID="pushId",this.PARAM_CLICKED_BUTTON="clickedButton",this.PARAM_PERMISSION_TYPE="permissionType",this.PARAM_LATITUDE="latitude",this.PARAM_LONGITUDE="longitude",this.PARAM_INAPP_ID="inAppId",this.PARAM_INAPP_EVENT_TYPE="eventType",this.PARAM_INAPP_CLICKED_BUTTON="clickedButton",this.PARAM_INAPP_LAST_VERSION_ID="lastVersionId",this.PARAM_EXTERNAL_ID="externalId",this.PARAM_EXTERNAL_CODE="externalCode",this.PARAM_INBOX_PAGE="page",this.PARAM_INBOX_PAGE_SIZE="pageSize",this.PARAM_INBOX_DATE_FROM="dateFrom",this.PARAM_INBOX_DATE_TO="dateTo",this.PARAM_INBOX_STATUS="status",this.PARAM_INBOX_INITIAL_STATUS="initialStatus",this.PARAM_INBOX_SENDER_IDS="sendingIds",this.PARAM_CUSTOMER_ID="customerId",this.PARAM_CUSTOMER_FIELD_NAMES="fieldNames",this.PARAM_CUSTOMER_FIELDS="fields",this.PARAM_CUSTOMER_LINK="link",this.PARAM_CUSTOMER_CHANNEL="channel",this.appKey=(new E).getAppKey(),this.params=null,this.pathParams={},this.headers={}}getParams(){return"?"+this.PARAM_APP_KEY+"="+this.appKey+(this.params?"&"+this.params:"")}getBody(){return this.body?this.body:""}getPath(t){let e=t;return Object.keys(this.pathParams).forEach((t=>{e=e.replace(t,this.pathParams[t])})),e}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}isServiceWorkerRequest(){return this.serviceWorkerRequest}setServiceWorkerRequest(t){this.serviceWorkerRequest=t}isJourneyRequest(){return this.journeyRequest}setJourneyRequest(t){this.journeyRequest=t}},P=class extends O{constructor(t=null){super(),this.PARAM_APPLICATION_CHANNEL="channel",this.channels=t}getApplicationRequest(){return this.params=this.createQueryString(),this}createQueryString(){let t="";if(this.channels&&this.channels.length>0)for(let e=0;e{new m("[IND]CorePermissions: ").d(t+" permission state has changed from "+n+" to "+r.state).writeLog(),n=r.state,e&&e({name:t,state:r.state})})}}},M=new m("[IND]Crypto"),k=new TextEncoder("utf-8"),x="HMAC",B=class{static async createHmac(t,e){try{let r="";if(!0===(new E).isAvoidCypher())r=e;else{const n=window?.crypto?.subtle;if(!n)return;const i=await n.importKey("raw",k.encode(t),{name:x,hash:{name:"SHA-256"}},!1,["sign","verify"]),o=await n.sign(x,i,k.encode(e)),s=new Uint8Array(o);r=Array.prototype.map.call(s,(t=>("00"+t.toString(16)).slice(-2))).join(""),M.d("hmac: ",r).writeLog()}return r}catch(t){return void M.e("error:",t).writeLog()}}},U=class{static compareJSON(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(t[n]!==e[n]){if("object"!=typeof t[n]||"object"!=typeof e[n])return!1;if(!isEqual(t[n],e[n]))return!1}return!0}},V=class{static isValidFormat(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}},j=class{static setTopicChannel(t,e){const r=[];for(let n=0;n{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={Core:!0};Object.defineProperty(e,"Core",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var e=u(void 0);if(e&&e.has(t))return e.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}(r(710));Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var s,a=(s=r(610))&&s.__esModule?s:{default:s};function u(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(u=function(t){return t?r:e})(t)}},468:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=u(r(254)),i=u(r(234)),o=u(r(457)),s=u(r(735)),a=u(r(630));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var u=d(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==c(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){h(o,n,i,s,a,"next",t)}function a(t){h(o,n,i,s,a,"throw",t)}s(void 0)}))}}function d(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseApplicationRequest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BaseClient",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"BaseRequest",{enumerable:!0,get:function(){return i.default}});var n=s(r(468)),i=s(r(237)),o=s(r(773));function s(t){return t&&t.__esModule?t:{default:t}}},773:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,r){return e=a(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,[],a(t).constructor):e.apply(t,r))}(this,e)).PARAM_APPLICATION_CHANNEL="channel",t.channels=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(e,t),function(t,e){return e&&function(t,e){for(var r=0;r0)for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}var a=function(t,e){return e&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={platform:"webpush",version:"0.0.1"},i=r(904);n.version=i.version,n=Object.assign(n,{client:{URL_BASE:"https://".concat("","device-api.indigitall.com/v1"),URL_DEVICE_V2:"https://".concat("","device-api.indigitall.com/v2"),INAPP_URL_BASE:"https://".concat("","inapp-api.indigitall.com/v1"),INBOX_URL_BASE:"https://".concat("","inbox-api.indigitall.com/v1"),CUSTOMER_URL_BASE:"https://".concat("","device-api.indigitall.com/v2")}}),e.default=n},610:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=h(r(122)),o=h(r(291)),s=l(r(545)),a=l(r(225)),u=l(r(628));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function l(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&{}.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function h(t){return t&&t.__esModule?t:{default:t}}e.default={Repository:o.default,Config:i.default,Api:s,Models:a,Utils:u}},902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Channel=void 0;var r=e.Channel=Object.freeze({PUSH:"push",INAPP:"inapp",CHAT:"chat",NONE:"none"});e.default=r},174:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(254));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var o=new n.default;if(null!=e){o.setConfigV2(JSON.stringify(e)),e.contentAvailable&&(this.contentAvailable=e.contentAvailable),e.locationAccuracy&&(this.locationAccuracy=e.locationAccuracy),e.locationDistance&&(this.locationDistance=e.locationDistance),e.locationEnabled&&(this.locationEnabled=e.locationEnabled),e.locationUpdateMinutes&&(this.locationUpdateMinutes=e.locationUpdateMinutes),e.maintenanceWindow&&(this.maintenanceWindow=e.maintenanceWindow,this.maintenanceWindow.start&&(this.maintenanceWindowStart=this.maintenanceWindow.start,o.setMaintenanceStart(this.maintenanceWindow.start)),this.maintenanceWindow.end&&(this.maintenanceWindowEnd=this.maintenanceWindow.end,o.setMaintenanceEnd(this.maintenanceWindow.end))),e.networkEventsEnabled&&(this.networkEventsEnabled=e.networkEventsEnabled),e.networkUpdateMinutes&&(this.networkUpdateMinutes=e.networkUpdateMinutes);var s=Date.now();if(e.serviceSyncTime?(this.serviceSyncTime=e.serviceSyncTime,s=new Date(Date.now()+60*this.serviceSyncTime*60*1e3)):s=new Date(Date.now()+36e5),!r){var a=s.toString();new i.default("[IND]CoreApplication").d("ServiceSyncTime defined on: "+a).writeLog(),o.setConfigV2ServiceSyncTime(a)}}}));e.default=s},395:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}var a=function(t,e){return e&&function(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null==e?(this.browserPublicKey=(new i.default).getBrowserPublicKey(),this.browserPrivateKey=(new i.default).getBrowserPrivateKey(),this.platform=(new i.default).getPlatform(),this.version=(new i.default).getVersion(),this.browserName=(new i.default).getBrowserName(),this.browserVersion=(new i.default).getBrowserVersion(),this.osName=(new i.default).getOsName(),this.osVersion=(new i.default).getOsVersion(),this.deviceId=(new i.default).getDeviceId(),this.deviceType=(new i.default).getDeviceType(),(new i.default).getEnabled()&&(this.enabled="true"===(new i.default).getEnabled()),(new i.default).getExternalId()&&(this.externalCode=(new i.default).getExternalId())):r?(e.enabled&&(this.enabled=e.enabled,(new i.default).setEnabled(this.enabled)),e.registeredByCookie&&(this.registeredByCookie=e.registeredByCookie,(new i.default).setRegisteredByCookie(this.registeredByCookie))):(e.browserPublicKey&&(this.browserPublicKey=e.browserPublicKey),e.browserPrivateKey&&(this.browserPrivateKey=e.browserPrivateKey),e.platform&&(this.platform=e.platform),e.version&&(this.version=e.version),e.osVersion&&(this.osVersion=e.osVersion),e.browserName&&(this.browserName=e.browserName),e.browserVersion&&(this.browserVersion=e.browserVersion),e.osName&&(this.osName=e.osName),e.deviceType&&(this.deviceType=e.deviceType),e.enabled&&(this.enabled=e.enabled),e.externalCode&&(this.externalCode=e.externalCode)),this.platform&&(this.productName=this.platform),this.version&&(this.productVersion=this.version),navigator&&"language"in navigator&&(this.locale=navigator.language),Intl&&"DateTimeFormat"in Intl&&(this.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),this.timeOffset=-(new Date).getTimezoneOffset()}),[{key:"getDeviceId",value:function(){return this.deviceId}},{key:"setDeviceId",value:function(t){this.deviceId=t}},{key:"setExternalCode",value:function(t){this.externalCode=t}},{key:"toJSON",value:function(){var t={};return this.platform&&(t.platform=this.platform),this.version&&(t.version=this.version),this.productName&&(t.productName=this.productName),this.productVersion&&(t.productVersion=this.productVersion),this.browserName&&(t.browserName=this.browserName),this.browserVersion&&(t.browserVersion=this.browserVersion),this.osName&&(t.osName=this.osName),this.osVersion&&(t.osVersion=this.osVersion),this.deviceType&&(t.deviceType=this.deviceType),this.locale&&(t.locale=this.locale),this.timeZone&&(t.timeZome=this.timeZone),this.timeOffset&&(t.timeOffset=this.timeOffset),this.deviceId&&(t.deviceId=this.deviceId),this.enabled&&(t.enabled=this.enabled),this.browserPublicKey&&(t.browserPublicKey=this.browserPublicKey),this.browserPrivateKey&&(t.browserPrivateKey=this.browserPrivateKey),this.externalCode&&(t.externalCode=this.externalCode),t}}]);e.default=a},89:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({DEFAULT:-1,ENABLE:1,DISABLE:0});e.default=r},735:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={ErrorCode:{GENERAL_ERROR:600,API_SERVER_ERROR:500,API_PARAMETER_MISSING:400,API_APPKEY_NOT_VALID:401,API_FORBIDDEN_REQUEST:403,API_DEVICE_NOT_FOUND:404,API_TOPICS_ARE_INSERTED:409,BAD_REQUEST_SERVER_ERROR:410},ErrorMessage:{GENERAL_ERROR:"General Error",API_SERVER_ERROR:"Error server response",API_PARAMETER_MISSING:"Api parameter missing",API_APPKEY_NOT_VALID:"appKey is not valid",API_FORBIDDEN_REQUEST:"forbidden request",API_DEVICE_NOT_FOUND:"device not found",API_TOPICS_ARE_INSERTED:"topics are inserted",BAD_REQUEST_SERVER_ERROR:"bad request"}}},234:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.errorCode=e,this.errorMessage=r,null!=n&&(this.exceptionMessage=n)}));e.default=r},953:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({EVENT_TYPE_CLICK:"click",EVENT_TYPE_RECEIVE:"receive",EVENT_TYPE_UPDATE:"update",EVENT_TYPE_ACCEPT:"accept",EVENT_TYPE_REJECT:"reject",EVENT_TYPE_ASK:"ask"});e.default=r},72:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=Object.freeze({SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"});e.default=r},225:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.Channel}}),Object.defineProperty(e,"CoreApplication",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DeviceStatus",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorDictionary",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ErrorModel",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"EventType",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"TopicSubscribeType",{enumerable:!0,get:function(){return c.default}});var n=r(902),i=h(r(395)),o=h(r(89)),s=h(r(735)),a=h(r(234)),u=h(r(953)),c=h(r(72)),l=h(r(174));function h(t){return t&&t.__esModule?t:{default:t}}},672:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:T(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==i&&o.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var s=t.apply(e,r);function a(t){i(s,n,o,a,u,"next",t)}function u(t){i(s,n,o,a,u,"throw",t)}a(void 0)}))}}function s(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.storage=this.isLocalStorageAvailable()?window.localStorage:null},e=[{key:"isLocalStorageAvailable",value:function(){try{var t=window.localStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==i.length}return!1}},{key:"setItem",value:function(t,e){return null!=this.storage&&(this.storage.setItem(t,e),!0)}},{key:"getItem",value:function(t){return null!=this.storage?this.storage.getItem(t):null}},{key:"deleteItem",value:function(t){return!!this.storage&&(this.storage.setItem(t,value),!0)}},{key:"clear",value:function(){this.storage&&this.storage.clear()}}],e&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(122)),i=a(r(87)),o=a(r(672)),s=a(r(238));function a(t){return t&&t.__esModule?t:{default:t}}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,s)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,o,s,a){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==u(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){l(o,n,i,s,a,"next",t)}function a(t){l(o,n,i,s,a,"throw",t)}s(void 0)}))}}function f(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.SESSION="indigitall.session.storage",this.session=this.isSessionStorageAvailable()?window.sessionStorage:null},e=[{key:"isSessionStorageAvailable",value:function(){try{var t=window.sessionStorage,e="__storage_test__";if(t)return t.setItem(e,e),t.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==i.length}return!1}},{key:"getItem",value:function(t){return null!=this.session?this.session.getItem(t):null}},{key:"setItem",value:function(t,e){return null!=this.session&&(this.session.setItem(t,e),!0)}},{key:"clearMessages",value:function(){this.session&&this.session.removeItem("messages")}}],e&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(291))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}var a=function(t,e,r){return r&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(254))&&n.__esModule?n:{default:n};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))}}function c(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}var l=function(){return function(t,e,r){return r&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CryptoUtils=void 0;var n=i(r(291));function i(t){return t&&t.__esModule?t:{default:t}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new C(n||[]);return i(s,"_invoke",{value:T(t,r,a)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",E="suspendedYield",y="executing",v="completed",g={};function m(){}function I(){}function _(){}var b={};h(b,u,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(D([])));O&&O!==r&&n.call(O,u)&&(b=O);var P=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(i,s,a,u){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==o(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=p;return function(o,s){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=w(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:E,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function w(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,w(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function a(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function u(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}var c=new(i(r(254)).default)("[IND]Crypto"),l=new TextEncoder("utf-8"),h="HMAC",f=e.CryptoUtils=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"createHmac",value:(r=s().mark((function t(e,r){var i,o,a,u,f,d;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,i="",!0!==(new n.default).isAvoidCypher()){t.next=6;break}i=r,t.next=18;break;case 6:if(a=null===(o=window)||void 0===o||null===(o=o.crypto)||void 0===o?void 0:o.subtle){t.next=9;break}return t.abrupt("return");case 9:return t.next=11,a.importKey("raw",l.encode(e),{name:h,hash:{name:"SHA-256"}},!1,["sign","verify"]);case 11:return u=t.sent,t.next=14,a.sign(h,u,l.encode(r));case 14:f=t.sent,d=new Uint8Array(f),i=Array.prototype.map.call(d,(function(t){return("00"+t.toString(16)).slice(-2)})).join(""),c.d("hmac: ",i).writeLog();case 18:return t.abrupt("return",i);case 21:return t.prev=21,t.t0=t.catch(0),c.e("error:",t.t0).writeLog(),t.abrupt("return");case 25:case"end":return t.stop()}}),t,null,[[0,21]])})),i=function(){var t=this,e=arguments;return new Promise((function(n,i){var o=r.apply(t,e);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)}))},function(t,e){return i.apply(this,arguments)})}],e&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(735)),i=o(r(234));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}var u=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"showError",value:function(t,e,r){if(null!=t){var o=Object.values(t.ErrorCode).indexOf(e);if(o>=0){var s={code:Object.keys(t.ErrorCode)[o],errorId:Object.values(t.ErrorCode)[o]};return new i.default(s,Object.values(t.ErrorMessage)[o],r)}return new i.default(n.default.ErrorCode.GENERAL_ERROR,"general error",r)}}}])&&function(t,e){for(var r=0;r{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"compareJSON",value:function(t,e){var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(var o=0,s=n;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(291)),i=o(r(630));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t,e){for(var r=0;r=i.default.DEBUG&&t<=i.default.ERROR&&(this.level=t)}},{key:"d",value:function(){if(this.level<=i.default.DEBUG)for(var e=0;e0&&this.tag&&this.log&&console.log(this.tag,this.log),this.log=[]}}],o=[{key:"addedAsString",value:function(t){return"string"==typeof t?t:JSON.stringify(t,null,2)}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();e.default=c},630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LogLevel=void 0;var r=e.LogLevel=Object.freeze({DEBUG:1,INFO:2,WARNING:3,ERROR:4});e.default=r},662:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"setTopicChannel",value:function(t,e){for(var r=[],n=0;n{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"isValidFormat",value:function(t){return null!=t&&""!=t&&"null"!=t&&t.length>8}}],e&&function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"CommonUtils",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"CorePermissions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"CryptoUtils",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ErrorUtils",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"JsonUtils",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return c.LogLevel}}),Object.defineProperty(e,"TopicUtils",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"Validations",{enumerable:!0,get:function(){return l.default}});var n=f(r(622)),i=f(r(429)),o=f(r(170)),s=f(r(457)),a=f(r(325)),u=f(r(254)),c=r(630),l=f(r(332)),h=f(r(662));function f(t){return t&&t.__esModule?t:{default:t}}},904:t=>{"use strict";t.exports=JSON.parse('{"_from":"indigitall-web-core@4.9.2","_id":"indigitall-web-core@4.9.2","_inBundle":false,"_integrity":"sha512-aGTfAnLDU6FrokX4B7XvAWEX2Obl/hlcz9OTPFOI/yQIwIKpjfZJ1BEVeCWvDiSEAYhLek73ppnFdV66cUxcGA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.9.2","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.9.2","saveSpec":null,"fetchSpec":"4.9.2"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.9.2.tgz","_shasum":"710cb6aaf9858cce437e850a450c7fc81cf71a03","_spec":"indigitall-web-core@4.9.2","_where":"/home/circleci/webpush/inbox","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.9.2"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>C});const{Repository:t}=r(315).Core,e=new class extends t{constructor(){super(),this.AUTH_TOKEN=this.REPOSITORY+".AUTH_TOKEN",this.INBOX_AUTH_MODE=this.REPOSITORY+".INBOX_AUTH_MODE",this.URL_INBOX_API=this.REPOSITORY+".URL_INBOX_API"}async setDeviceId(t){this.setStorage(this.DEVICE_ID,t)}getDeviceId(){return this.getStorage(this.DEVICE_ID)}setAuthToken(t){this.setStorage(this.AUTH_TOKEN,t)}getAuthToken(){return this.getStorage(this.AUTH_TOKEN)}setInboxAuthMode(t){this.setStorage(this.INBOX_AUTH_MODE,t)}getInboxAuthMode(){return this.getStorage(this.INBOX_AUTH_MODE)}async getUrlInboxApi(){return this.getStorage(this.URL_INBOX_API)}async setUrlInboxApi(t){this.setStorage(this.URL_INBOX_API,t)}},{BaseClient:o}=r(315).Core.Api,{Config:s}=r(315).Core,{ErrorModel:a}=r(315).Core.Models,{CommonUtils:u}=r(315).Core.Utils,c=new class extends o{constructor(){super(),this.URL_BASE=s.client.INBOX_URL_BASE,this.ENDPOINT_INBOX_NOTIFICATIONS="/notification",this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID=this.ENDPOINT_INBOX_NOTIFICATIONS+"/{sendingId}",this.ENDPOINT_INBOX_COUNTER="/counters",this.ENDPOINT_INBOX_AUTH="/auth/webhook"}async getURL(){return await e.getUrlInboxApi()||this.URL_BASE}async postInboxAuth(t,r,n){const i=await this.post(this.ENDPOINT_INBOX_AUTH,t.postInboxAuth());if(!i||i instanceof a||!i.data)i?u.isFunction(n)&&n(i):u.isFunction(n)&&n();else{const t=i.data.token;e.setAuthToken(t),u.isFunction(r)&&r(i)}return!0}async getInbox(t,e,r){const n=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS,t.getInboxPushRequest());return this.getInboxResponseStatus(n,e,r),!0}async putInboxPush(t,e,r){const n=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS,t.putInboxPushRequest());return this.getInboxResponseEdit(n,e,r),!0}async getInboxPushWithSendingId(t,e,r,n){const i=await this.get(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,t.getInboxPushRequestWithSendingId());return this.getNotificationResponseStatus(i,e,r,n),!0}async putInboxPushWithSendingId(t,e,r,n){const i=await this.put(this.ENDPOINT_INBOX_NOTIFICATIONS_WITH_SENDINGID,t.putInboxWithSendingId());return this.getNotificationResponseStatus(i,e,r,n),!0}async getInboxCounter(t,e,r){const n=await this.get(this.ENDPOINT_INBOX_COUNTER,t.getCounter());this.getCounterStatus(n,e,r)}async getInboxResponseStatus(t,e,r){if(t&&!(t instanceof a)&&t.statusCode>=200&&t.statusCode<300){const r=new C(t.data);u.isFunction(e)&&e(r)}else t?u.isFunction(r)&&r(t):u.isFunction(r)&&r()}async getInboxResponseEdit(t,e,r){t&&!(t instanceof a)&&t.statusCode>=200&&t.statusCode<300?u.isFunction(e)&&e():t?u.isFunction(r)&&r(t):u.isFunction(r)&&r()}getNotifications(t,e){const r=[];for(let n=0;n=200&&t.statusCode<300){const t=new InboxNotification(notifications[i],e);u.isFunction(r)&&r(t)}else t?u.isFunction(n)&&n(t):u.isFunction(n)&&n()}async getCounterStatus(t,e,r){if(t&&!(t instanceof a)&&t.statusCode>=200&&t.statusCode<300){const r={click:t.data.click,sent:t.data.sent,deleted:t.data.deleted,unread:this.getUnreadCounters(t.data.unread)};u.isFunction(e)&&e(r)}else t?u.isFunction(r)&&r(t):u.isFunction(r)&&r()}getUnreadCounters(t){return{count:t.count,lastAccess:t.lastAccess}}},{BaseRequest:l}=r(315).Core.Api,h=class extends l{constructor(){super()}postInboxAuth(){return this.body=this.json,this}setJson(t){this.json=t}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}},f=Object.freeze({SENT:"sent",CLICK:"click",DELETED:"deleted"});window.inboxStatus=f;const d=f,p=Object.freeze({NONE:"none",DEFAULT:"default",WEBHOOK:"webhook"}),{BaseRequest:E}=r(315).Core.Api,y=class extends E{constructor(){super(),null!=e.getExternalId()&&(this.externalId=e.getExternalId()),null!=e.getAuthToken()&&e.getInboxAuthMode()==p.WEBHOOK&&(this.headers.Authorization="Bearer "+e.getAuthToken()),this.sendingId="",this.sendingIds=null,this.page=0,this.pageSize=0,this.dateFrom="",this.dateTo="",this.status=d.INBOXSTATUS_SENT,this.initialStatus=d.INBOXSTATUS_SENT,this.statusList=null}getInboxPushRequest(){return this.params=this.createQueryString(),this}putInboxPushRequest(){return this.params=this.createQueryStringExternalId(),this.body=this.createBodyJson(),this}getInboxPushRequestWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this}putInboxWithSendingId(){return this.pathParams["{sendingId}"]=this.sendingId,this.params=this.createQueryStringExternalId(),this.body=this.createBodyStatusJson(),this}addHeaders(){const t=new Headers({"Content-Type":"application/json"});return Object.keys(this.headers).forEach((e=>{t.append(e,this.headers[e])})),t}createQueryString(){let t="";if(this.page&&(t+=this.PARAM_INBOX_PAGE+"="+this.page+"&"),this.pageSize&&(t+=this.PARAM_INBOX_PAGE_SIZE+"="+this.pageSize+"&"),this.dateFrom&&(t+=this.PARAM_INBOX_DATE_FROM+"="+this.dateFrom+"&"),this.dateTo&&(t+=this.PARAM_INBOX_DATE_TO+"="+this.dateTo+"&"),this.statusList){let e="";for(let t=0;t{t.append(e,this.headers[e])})),t}createQueryStringExternalId(){return this.PARAM_EXTERNAL_ID+"="+this.externalId}};class m{constructor(t,e){t&&(t.id&&(this.id=t.id),t.externalId&&(this.externalId=t.externalId),t.sentAt&&(this.sentAt=t.sentAt),t.status&&(this.status=t.status),t.sendingId&&(this.sendingId=t.sendingId),t.message&&(this.message=t.message),t.campaignId&&(this.campaignId=t.campaignId),this.read=!1,this.sentAt&&e&&this.sentAt3}static isValidFormatRequest(){const t=new A("[IND]InboxValidations: "),r=e.getDeviceId();let n=!0;return this.isAppKeyFormat()||(n=!1,t.w("appKey is null or empty").writeLog()),this.isValidFormat(r)||(n=!1,t.w("deviceId is null or empty").writeLog()),n}},{CommonUtils:T,ErrorUtils:w,Log:N}=r(315).Core.Utils;class L{constructor(t){if(t){if(t.lastAccess&&(this.lastAccess=t.lastAccess),t.numPage?this.page=t.numPage:this.page=0,t.pageSize&&(this.pageSize=t.pageSize),this.count=0,t.count&&(this.count=t.count),t.notifications){this.notifications=[];const e=t.notifications;for(let t=0;t{401===r.errorCode?this.generateAuthToken((()=>{c.getInboxCounter(e,t,r)}),r):T.isFunction(r)&&r(r)}))}else T.isFunction(r)&&r(w.showError(O,O.ErrorCode.INBOX_GET_ERROR));else T.isFunction(r)&&r(w.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}static getInboxWithAuth(t,e,r){T.isFunction(t.getAuthConfig)&&(navigator.indigitallGetAuthConfig=getAuthConfig),L.getInbox(e,r)}static getInbox(t,e){L.getInboxWithPage(null,null,null,null,null,t,e)}static getInboxWithPageAuth(t,e,r,n,i,o,s,a){T.isFunction(t.getAuthConfig)&&(navigator.indigitallGetAuthConfig=getAuthConfig),L.getInboxWithPage(e,r,n,i,o,s,a)}static getInboxWithPage(t,r,n,i,o,s,a){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){const e=new y;t&&e.setPage(t),r&&e.setPageSize(r),n&&(e.setDateFrom(n),this.dateFrom=n),i&&(e.setDateTo(i),this.dateTo=i),o&&(e.setStatusList(o),this.statusList=o),c.getInbox(e,(t=>{this.totalPages=t.totalPages,0!==t.count?T.isFunction(s)&&s(t):T.isFunction(a)&&a(w.showError(O,O.ErrorCode.INBOX_GET_PAGE_ERROR))}),(t=>{401==t.errorCode?this.generateAuthToken((()=>{c.getInbox(e,(t=>{this.totalPages=t.totalPages,T.isFunction(s)&&s(t)}),t)}),t):T.isFunction(t)&&t(t)}))}else T.isFunction(a)&&a(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(a)&&a(w.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST))}getNextPage(t,r){const n=new N("[IND]Inbox: ");if(this.isRequestingPage)n.w(O.ErrorMessage.INBOX_IS_REQUESTING_PAGE).writeLog();else if(this.isRequestingPage=!0,this.page+1{this.notifications=this.notifications.concat(e.notifications),this.newNotifications=e.notifications,this.lastAccess=e.lastAccess,this.count=e.count,this.page=e.page,this.pageSize=e.pageSize,this.totalPages=e.totalPages,this.isRequestingPage=!1,T.isFunction(t)&&t(this,this.newNotifications)}),(r=>{401===r.errorCode?this.generateAuthToken((()=>{c.getInbox(e,(e=>{this.notifications=this.notifications.concat(e.notifications),this.newNotifications=e.notifications,this.lastAccess=e.lastAccess,this.count=e.count,this.page=e.page,this.pageSize=e.pageSize,this.totalPages=e.totalPages,this.isRequestingPage=!1,T.isFunction(t)&&t(this,this.newNotifications)}),r)}),r):(this.isRequestingPage=!1,T.isFunction(r)&&r())}))}else this.isRequestingPage=!1,T.isFunction(r)&&r(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(r)&&r(w.showError(O,O.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else this.isRequestingPage=!1,T.isFunction(r)&&r(w.showError(O,O.ErrorCode.INBOX_NO_MESSAGES))}massiveEditNotifications(t,e,r,n){let i=d.SENT;e==d.CLICK&&(i=d.SENT),e==d.DELETED&&(i=d.CLICK),this.massiveEditNotifications(t,i,e,r,n)}massiveEditNotificationsWithInitialStatus(t,r,n,i,o){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){if(n){const e=new y;null!=t&&e.setSendingIds(t),e.setStatus(n),e.setInitialStatus(r),c.putInboxPush(e,i,(t=>{401===t.errorCode?this.generateAuthToken((()=>{c.putInboxPush(e,i,t)}),t):T.isFunction(t)&&t(t)}))}}else T.isFunction(o)&&o(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(o)&&o(w.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}getInfoFromNotification(t,r,n){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){if(t){const e=new y;e.setSendingId(t),c.getInboxPushWithSendingId(e,this.lastAccess,r,(t=>{401===t.errorCode?this.generateAuthToken((()=>{c.getInboxPushWithSendingId(e,this.lastAccess,r,t)}),t):T.isFunction(t)&&t(t)}))}}else T.isFunction(n)&&n(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(n)&&n(w.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}modifyStatusFromNotification(t,r,n,i){if(R.isValidFormatRequest())if(R.isValidFormat(e.getExternalId())){if(t&&r){const e=new y;e.setSendingId(t),e.setStatus(r),c.putInboxPushWithSendingId(e,this.lastAccess,n,(t=>{401===t.errorCode?this.generateAuthToken((()=>{c.putInboxPushWithSendingId(e,this.lastAccess,n,t)}),t):T.isFunction(t)&&t(t)}))}}else T.isFunction(i)&&i(w.showError(O,O.ErrorCode.INBOX_EXTERNAL_ID_NO_REGISTERED));else T.isFunction(i)&&i(w.showError(O,O.ErrorCode.BAD_REQUEST_SERVER_ERROR))}}const C=L})(),n})(),t.exports=e()},824:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0});var i={};Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o.default}});var o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!=n(t)&&"function"!=typeof t)return{default:t};var r=s(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=t[a]}return i.default=t,r&&r.set(t,i),i}(r(114));function s(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(s=function(t){return t?r:e})(t)}Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}))},904:t=>{"use strict";t.exports=JSON.parse('{"_from":"indigitall-web-core@4.9.2","_id":"indigitall-web-core@4.9.2","_inBundle":false,"_integrity":"sha512-aGTfAnLDU6FrokX4B7XvAWEX2Obl/hlcz9OTPFOI/yQIwIKpjfZJ1BEVeCWvDiSEAYhLek73ppnFdV66cUxcGA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.9.2","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.9.2","saveSpec":null,"fetchSpec":"4.9.2"},"_requiredBy":["#USER","/","/indigitall-web-inbox"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.9.2.tgz","_shasum":"710cb6aaf9858cce437e850a450c7fc81cf71a03","_spec":"indigitall-web-core@4.9.2","_where":"/home/circleci/webpush/push","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.9.2"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>vt});var t=r(824),e=r.n(t);const{Repository:i}=r(315).Core,o=new class extends i{constructor(){super(),this.SAFARI_WEBSITE_PUSH_ID=this.REPOSITORY+".SAFARI_WEBSITE_PUSH_ID",this.PUSH_TOKEN=this.REPOSITORY+".PUSH_TOKEN",this.PERMISSION_PUSH=this.REPOSITORY+".PERMISSION_PUSH",this.DEVICE_JSON=this.REPOSITORY+".DEVICE_JSON",this.PUT_REQUEST_TIMESTAMP=this.REPOSITORY+".PUT_REQUEST_TIMESTAMP",this.WORKER_PATH=this.REPOSITORY+".WORKER_PATH",this.TEST=this.REPOSITORY+".TEST",this.SAFARI_GESTURE_REQUEST_PERMISSION=this.REPOSITORY+".SAFARI_GESTURE_REQUEST_PERMISSION",this.UPDATE_TOPIC_SUBSCRIBE=this.REPOSITORY+".UPDATE_TOPIC_SUBSCRIBE",this.TOPIC_SYNC_TIMESTAMP=this.REPOSITORY+".TOPIC_SYNC_TIMESTAMP",this.TOPIC_SEMAPHORE=this.REPOSITORY+".TOPIC_SEMAPHORE",this.TOPIC_SYNC_IS_PROCESSING=this.REPOSITORY+".TOPIC_SYNC_IS_PROCESSING"}async getDeviceIdSync(){if(this.db&&this.db.IDB)return await this.db.getItem(this.DEVICE_ID)}setPushToken(t){this.setStorage(this.PUSH_TOKEN,t)}getPushToken(){return this.getStorage(this.PUSH_TOKEN)}setSafariWebsitePushId(t){this.setStorage(this.SAFARI_WEBSITE_PUSH_ID,t)}getSafariWebsitePushId(){return this.getStorage(this.SAFARI_WEBSITE_PUSH_ID)}setPermissionPush(t){this.setStorage(this.PERMISSION_PUSH,t)}getPermissionPush(){return this.getStorage(this.PERMISSION_PUSH)}async getDeviceJson(){return this.getStorage(this.DEVICE_JSON)}async setDeviceJson(t){this.setStorage(this.DEVICE_JSON,t)}async getPutRequestTimestamp(){return this.getStorage(this.PUT_REQUEST_TIMESTAMP)}async setPutRequestTimestamp(t){this.setStorage(this.PUT_REQUEST_TIMESTAMP,t)}setWorkerPath(t){this.setStorage(this.WORKER_PATH,t)}getWorkerPath(){return this.getStorage(this.WORKER_PATH)}setTestValue(t){this.setStorage(this.TEST,t)}getTestValue(){return this.getStorage(this.TEST)}setSafariGestureRequestPermission(t){this.setStorage(this.SAFARI_GESTURE_REQUEST_PERMISSION,t)}getSafariGestureRequestPermission(){return this.getStorage(this.SAFARI_GESTURE_REQUEST_PERMISSION)}async setUpdateTopicSubscribe(t){this.db&&this.db.IDB&&await this.db.setItem(this.UPDATE_TOPIC_SUBSCRIBE,t)}async getUpdateTopicSubscribe(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.UPDATE_TOPIC_SUBSCRIBE))}catch(t){}return t}async setTopicSyncTimestamp(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SYNC_TIMESTAMP,t)}async getTopicSyncTimestamp(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_SYNC_TIMESTAMP))}catch(t){}return t}async setTopicSemaphore(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SEMAPHORE,t)}async getTopicSemaphore(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_SEMAPHORE))}catch(t){}return t}async setTopicSyncIsProcessing(t){this.db&&this.db.IDB&&await this.db.setItem(this.TOPIC_SYNC_IS_PROCESSING,t)}async getTopicSyncIsProcessing(){let t;try{this.db&&this.db.IDB&&(t=await this.db.getItem(this.TOPIC_SYNC_IS_PROCESSING))}catch(t){}return t}},{ErrorDictionary:s}=r(315).Core.Models,a=s.ErrorCode;Object.assign(a,{GENERAL_ERROR_BAD_REQUEST:601,GENERAL_ERROR_APPKEY_BAD_REQUEST:602,PUSH_INITIALIZATION_ERROR:1e3,PUSH_RECEPTION_ERROR:1200,PUSH_TOPICS_ERROR:1400,PUSH_DEVICE_ERROR:1500,PUSH_EVENT_ERROR:1600,API_APPKEY_NOT_VALID:1601,DISABLED_CHANNEL:4404});const u=s.ErrorMessage;Object.assign(u,{GENERAL_ERROR_BAD_REQUEST:"AppKey or DeviceId are null or empty",GENERAL_ERROR_APPKEY_BAD_REQUEST:"AppKey is null or empty",PUSH_INITIALIZATION_ERROR:"initialization error",PUSH_RECEPTION_ERROR:"push reception error",PUSH_TOPICS_ERROR:"push topics error",PUSH_DEVICE_ERROR:"device error",PUSH_EVENT_ERROR:"event error",API_APPKEY_NOT_VALID:"appKey is missing'",DISABLED_CHANNEL:"disabled channel"});const c={ErrorCode:a,ErrorMessage:u},{Device:l}=r(315).Core.Models,h=class extends l{constructor(t=null,e){super(t,e),null==t?(null!=o.getDeviceId()&&(this.deviceId=o.getDeviceId()),null!=o.getPushToken()&&(this.pushToken=o.getPushToken())):e?t.deviceId&&(this.deviceId=t.deviceId,o.setDeviceId(this.deviceId)):(t.deviceId&&(this.deviceId=t.deviceId),t.pushToken&&(this.pushToken=t.pushToken))}static setDeviceJson(t){o.setDeviceJson(JSON.stringify(t.toJSON()))}getDeviceId(){return this.deviceId}getPushToken(){return this.pushToken}toJSON(){const t=super.toJSON();return this.deviceId&&(t.deviceId=this.deviceId),this.pushToken&&(t.pushToken=this.pushToken),t}},{DeviceStatus:f}=r(315).Core.Models,{BaseRequest:d}=r(315).Core.Api,p=class extends d{constructor(t=f.DEFAULT){super(),this.device=new h,this.status=t,this.notToUpdate=!1,this.deviceUpdate=!1}isDeviceUpdated(t){this.deviceUpdate=t}setDeviceId(t){this.device&&(this.device.deviceId=t)}setAppKey(t){this.appKey=t}getDeviceRequest(){return this.params=this.createQueryString(),this}postDeviceRequest(){return this.body=this.createDeviceJson(),this.status!==f.DEFAULT&&(this.body.enabled=1===this.status),this}putDeviceRequest(t){return this.params=this.createQueryString(),this.body=this.createPUTDeviceJson(t),this.status!==f.DEFAULT&&(this.body.enabled=1===this.status),this}getDeviceTopicsRequest(){return this.params=this.createQueryString(),this}postDeviceTopicsRequest(){return this.params=this.createQueryString(),this.body=this.createTopicsJson(),this}deleteDeviceTopicsRequest(){return this.params=this.createQueryString(),this.body=this.createTopicsJson(),this}createQueryString(){return this.device.deviceId?this.PARAM_DEVICE_ID+"="+this.device.deviceId:""}createDeviceJson(){let t={};try{t=this.device.toJSON()}catch(t){}return t}createPUTDeviceJson(t){let e={};try{h.setDeviceJson(t),e=t.toJSON()}catch(t){}return e}createTopicsJson(){const t={};return this.topics&&(t.topics=this.topics),t}getDeviceId(){return this.device.getDeviceId()}setTopics(t){this.topics=t}setExternalCode(t){this.device.setExternalCode(t)}},{EventType:E}=r(315).Core.Models,{Config:y}=r(315).Core,v=class{static async requestBackgroundSync(){const t=await navigator.serviceWorker.getRegistration(o.getWorkerPath());return null!=t?t:null}static findIndigitallSW(t){for(let e=0;e3}static isValidFormatRequest(){const t=new S("[IND]PushValidations: "),e=o.getDeviceId();let r=!0;return this.isAppKeyFormat()||(r=!1,t.w("appKey is null or empty").writeLog()),o.isPushDisabled()||this.isValidFormat(e)||(r=!1,t.w("deviceId is null or empty").writeLog()),r}static async isPutRequestExceed(){return await _.getPutRequestTimestamp()<=Date.now()}static isSafariBrowserDevice(){const t=window.navigator.userAgent,e=!!t.match(/iPad/i)||!!t.match(/iPhone/i),r=!!t.match(/WebKit/i);return e&&r&&!t.match(/CriOS/i)&&!t.match(/OPiOS/i)}},{Config:P}=r(315).Core,{BaseClient:A}=r(315).Core.Api,{ErrorModel:R,Channel:T}=r(315).Core.Models,{TopicUtils:w,Log:N,CommonUtils:L,ErrorUtils:C}=r(315).Core.Utils,D=new class extends A{constructor(){super(),this.URL_BASE=P.client.URL_BASE,this.ENDPOINT_APPLICATION="/application",this.ENDPOINT_APPLICATION_ALL=this.ENDPOINT_APPLICATION+"/all",this.ENDPOINT_DEVICE="/device",this.ENDPOINT_DEVICE_TOPICS=this.ENDPOINT_DEVICE+"/topics",this.ENDPOINT_PUSH="/push",this.ENDPOINT_EVENT="/event",this.ENDPOINT_EVENT_PUSH=this.ENDPOINT_EVENT+"/push",this.ENDPOINT_EVENT_VISIT=this.ENDPOINT_EVENT+"/visit",this.ENDPOINT_EVENT_PERMISSION=this.ENDPOINT_EVENT+"/permission",this.ENDPOINT_EVENT_LOCATION=this.ENDPOINT_EVENT+"/location",this.ENDPOINT_EVENT_CUSTOM=this.ENDPOINT_EVENT+"/custom",this.ENDPOINT_EVENT_CUSTOM_BEACON=this.ENDPOINT_EVENT_CUSTOM+"/beacon",this.ENDPOINT_BROWSER="/browser",this.log=new N("[IND]Client: ")}async getURL(){return await o.getUrlDeviceApi()||this.URL_BASE}async getApplicationAll(t,e,r){if(O.isAppKeyFormat()){const n=await this.get(this.ENDPOINT_APPLICATION_ALL,t.getApplicationRequest());!n||n instanceof R?n?L.isFunction(r)&&r(n):L.isFunction(r)&&r():L.isFunction(e)&&e(n)}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.BAD_REQUEST_SERVER_ERROR));return!0}async postDevice(t,e,r){if(O.isAppKeyFormat()){const n=await this.post(this.ENDPOINT_DEVICE,t.postDeviceRequest(),"include");if(!n||n instanceof R)n?L.isFunction(r)&&r(n):L.isFunction(r)&&r();else{const t={enabled:n.data.enabled,deviceId:n.data.deviceId,registeredByCookie:n.data.registeredByCookie};await o.setDeviceId(t.deviceId),L.isFunction(e)&&e(new h(t,!0))}}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_APPKEY_BAD_REQUEST));return!0}async putDevice(t,e,r){const n=new h,i=await O.isPutRequestExceed();if(t.deviceUpdate||null==await o.getPutRequestTimestamp()||i)if(O.isValidFormatRequest()){o.setPutRequestTimestamp(await _.getPutRequestTimestamp());const i=await this.put(this.ENDPOINT_DEVICE,t.putDeviceRequest(n),"include");if(!i||i instanceof R)i?L.isFunction(r)&&r(i):L.isFunction(r)&&r();else{const t={enabled:i.data.enabled,deviceId:i.data.deviceId,registeredByCookie:i.data.registeredByCookie};L.isFunction(e)&&e(new h(t,!0))}}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));else L.isFunction(e)&&e(n)}async getDevice(t,e,r){if(O.isValidFormatRequest()){const n=await this.get(this.ENDPOINT_DEVICE,t.getDeviceRequest());if(!n||n instanceof R)n?L.isFunction(r)&&r(n):L.isFunction(r)&&r();else{const t={enabled:n.data.enabled,deviceId:n.data.deviceId};L.isFunction(e)&&e(new h(t,!0))}}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async getDeviceTopics(t,e,r){if(O.isValidFormatRequest()){const n=await this.get(this.ENDPOINT_DEVICE_TOPICS,t.getDeviceTopicsRequest());!n||n instanceof R?n?L.isFunction(r)&&r(n):L.isFunction(r)&&r():L.isFunction(e)&&e(w.setTopicChannel(n.data.topics,T.PUSH))}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postDeviceTopics(t,e,r){return O.isValidFormatRequest()?await this.postDeviceTopicsRequest(t,e,r):L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST)),!0}async postDeviceTopicsRequest(t,e,r){const n=await this.post(this.ENDPOINT_DEVICE_TOPICS,t.postDeviceTopicsRequest());if(!n||n instanceof R)n?L.isFunction(r)&&r(n):L.isFunction(r)&&r();else{const t=n.data.topics;L.isFunction(e)&&e(t)}}async deleteDeviceTopics(t,e,r){return O.isValidFormatRequest()?this.deleteDeviceTopicsRequest(t,e,r):L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST)),!0}async deleteDeviceTopicsRequest(t,e,r){const n=await this.delete(this.ENDPOINT_DEVICE_TOPICS,t.deleteDeviceTopicsRequest());if(!n||n instanceof R)n?L.isFunction(r)&&r(n):L.isFunction(r)&&r();else{const t=n.data.topics;L.isFunction(e)&&e(t)}}async postEventPush(t){O.isValidFormatRequest()&&await this.post(this.ENDPOINT_EVENT_PUSH,t.postEventPushRequest())}postEventVisit(t){O.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_VISIT,t.postEventVisitRequest())}postEventPermission(t){O.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_PERMISSION,t.postEventPermissionRequest())}postEventLocation(t){O.isValidFormatRequest()&&this.post(this.ENDPOINT_EVENT_LOCATION,t.postEventLocationRequest())}async getBrowser(t,e,r){if(O.isAppKeyFormat()){const n=await this.get(this.ENDPOINT_BROWSER,t);if(!n||n instanceof R)n?L.isFunction(r)&&r(n):L.isFunction(r)&&r();else{const t={browserName:n.data.browserName,browserVersion:n.data.browserVersion,deviceType:n.data.deviceType,osName:n.data.osName,osVersion:n.data.osVersion,supported:n.data.supported,platform:n.data.platform};await o.setBrowserName(t.browserName),o.setBrowserVersion(t.browserVersion),await o.setOsName(t.osName),o.setOsVersion(t.osVersion),o.setDeviceType(t.deviceType),o.setSupported(t.supported),await o.setPlatform("webpush"),L.isFunction(e)&&e(t)}}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventCustom(t,e,r){if(O.isValidFormatRequest()){const n=await this.post(this.ENDPOINT_EVENT_CUSTOM,t.postEventCustomRequest());!n||n instanceof R?n?L.isFunction(r)&&r(n):L.isFunction(r)&&r():L.isFunction(e)&&e(n)}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventCustomSync(t,e,r){if(O.isValidFormatRequest()){t=t.postEventCustomRequest();try{if(navigator&&"sendBeacon"in navigator){const r=await this.getURL()+this.ENDPOINT_EVENT_CUSTOM_BEACON+t.getParams();navigator.sendBeacon(r,JSON.stringify(t.getBody())),L.isFunction(e)&&e()}else{const n=await this.getURL()+this.ENDPOINT_EVENT_CUSTOM+t.getParams(),i=new XMLHttpRequest;i.open("POST",n,!1),i.setRequestHeader("Content-Type","application/json"),i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(i.status>=200||i.status<300)?L.isFunction(e)&&e():L.isFunction(r)&&r()},i.send(JSON.stringify(t.getBody()))}}catch(t){L.isFunction(r)&&r(C.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,t))}}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventJourney(t,e,r){if(O.isValidFormatRequest()){const n=await this.post(this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM,t.postEventCustomRequest());!n||n instanceof R?n?L.isFunction(r)&&r(n):L.isFunction(r)&&r():L.isFunction(e)&&e(n)}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventJourneySync(t,e,r){if(O.isValidFormatRequest()){t=t.postEventCustomRequest();try{let n=await this.getURL();if(n=n.replace("v1","v2"),navigator&&"sendBeacon"in navigator){const r=n+this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM+t.getParams();navigator.sendBeacon(r,JSON.stringify(t.getBody())),L.isFunction(e)&&e()}else{const n=await this.getURL().replace("v1","v2")+this.ENDPOINT_PUSH+this.ENDPOINT_EVENT_CUSTOM+t.getParams(),i=new XMLHttpRequest;i.open("POST",n,!1),i.setRequestHeader("Content-Type","application/json"),i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(i.status>=200||i.status<300)?L.isFunction(e)&&e():L.isFunction(r)&&r()},i.send(JSON.stringify(t.getBody()))}}catch(t){L.isFunction(r)&&r(C.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,t))}}else L.isFunction(r)&&r(C.showError(c,c.ErrorCode.GENERAL_ERROR_BAD_REQUEST));return!0}async postEventPushClick(t){let e="/event/push";t.journeyStateId&&(t.setJourneyRequest(!0),e="/push/event/click"),t.setServiceWorkerRequest(!0),await this.post(e,t.postEventPushRequest())}async postTopicsSubscribeFromServiceWorker(t){t.setServiceWorkerRequest(!0),await this.post("/device/topics",t.postDeviceTopicsRequest())}},{Config:M}=r(315).Core,{BaseRequest:k}=r(315).Core.Api,x=class extends k{getApplicationRequest(){return this.params=this.PARAM_PLATFORM+"="+M.platform,this}},B=Object.freeze({PERMISSION_TYPE_PUSH:"push",PERMISSION_TYPE_LOCATION:"location"}),{CorePermissions:U}=r(315).Core.Utils,V=class{static async getPermissions(){const t=await U.getPermissions(),e=await U.getPermission("push");return e&&(t.push=e.state),null===e&&window.Notification&&window.Notification.permission&&(t.push=window.Notification.permission),t}static async setPermissionsCallback(){U.setPermissionsCallback(),await U.setCallback("push",navigator.indigitallRequestPushPermission)}},{Log:j,CommonUtils:Y,ErrorUtils:F}=r(315).Core.Utils,{EventType:G}=r(315).Core.Models,K="[IND]IndigitallSafari: ",W=class{static isSafariPushNotificationSupported(){return!!O.isSafariBrowserDevice()||!!window?.safari?.pushNotification}static async launchNotificationPermissionForSafari(){const t=new j(K);if(o.getSafariGestureRequestPermission()===G.EVENT_TYPE_ASK)if(o.getSafariWebsitePushId()&&o.getDeviceId())if(O.isSafariBrowserDevice()&&o.getWorkerPath()){const t=await navigator.serviceWorker.register(o.getWorkerPath());"granted"===await window.Notification.requestPermission()&&(o.setPermissionPush(G.EVENT_TYPE_ACCEPT),vt.subscribeForPushNotification(t))}else{const t=window.safari.pushNotification.permission(o.getSafariWebsitePushId());this.checkRemotePermission(t)}else o.getSafariWebsitePushId()?t.w("error Device Id is not found").writeLog():t.w("error Safari Website Push Id is not found").writeLog();else t.w("there was not user gesture to request safari permissions").writeLog()}static async checkRemotePermission(t){const e=new j(K);try{if("default"===t.permission){const t={deviceCode:o.getDeviceId()};e.d("permission default: ",t).writeLog(),o.getPermissionPush()||_.callEventPermission(B.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_ASK),window.safari.pushNotification.requestPermission(await D.getURL()+"/safari",o.getSafariWebsitePushId(),t,window.indigitall.Push.checkRemotePermission)}else"denied"===t.permission?(e.w("permission denied: ",t).writeLog(),o.getPermissionPush()&&o.getPermissionPush()!=G.EVENT_TYPE_REJECT&&(_.callEventPermission(B.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_REJECT),o.setPermissionPush(G.EVENT_TYPE_REJECT))):"granted"===t.permission&&(e.d("permission granted: ",t).writeLog(),o.getPermissionPush()&&o.getPermissionPush()!=G.EVENT_TYPE_ACCEPT&&(_.callEventPermission(B.PERMISSION_TYPE_PUSH,G.EVENT_TYPE_ACCEPT),o.setPermissionPush(G.EVENT_TYPE_ACCEPT)),t.deviceToken&&t.deviceToken!==o.getPushToken()&&(o.setPushToken(t.deviceToken),D.putDevice(new p,(t=>{if(Y.isFunction(navigator.indigitallOnInitialized)){const t={};t.push=o.getPermissionPush(),t.location=o.getPermissionLocation(),navigator.indigitallOnInitialized(t,new h)}Y.isFunction(navigator.indigitallOnNewUserRegistered)&&!o.getNewUserTimestamp()&&(o.setNewUserTimestamp(Date.now()),navigator.indigitallOnNewUserRegistered(t)),vt.registerLocation()}),navigator.indigitallOnError),o.setServiceTimestamp(Date.now())))}catch(t){Y.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(F.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,t))}}},q=new class{constructor(){this.TOPIC_SYNC_TIMESTAMP=3e4,this.TOPIC_SYNC_TAG="syncTopics",this.TOPIC_SYNC_SUBSCRIBE_CALLBACK="indigitallSyncTopicSubscribeOnSuccess",this.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK="indigitallSyncTopicSubscribeOnError",this.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK="indigitallSyncTopicUnsubscribeOnSuccess",this.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK="indigitallSyncTopicUnsubscribeOnError"}},H=Object.freeze({GREEN:"green",RED:"red"}),{CommonUtils:X}=r(315).Core.Utils,J=class{static async setTopicRequest(t){const e=new p;return e.setAppKey(await o.getAppKeySync()),e.setDeviceId(await o.getDeviceIdSync()),e.setServiceWorkerRequest(!0),e.setTopics(t),e}static async getTopicsList(t,e){try{const r=await o.getTopicList();r&&r.length>0?await st.isTopicTimestampExceed()?this.getDeviceTopicClient(t,e):(await o.setTopicSemaphore(H.GREEN),X.isFunction(t)&&t(r)):this.getDeviceTopicClient(t,e)}catch(t){await o.setTopicSemaphore(H.GREEN)}}static async getDeviceTopicClient(t,e){try{D.getDeviceTopics(new p,(async e=>{await st.setTopicTimestamp(),await o.setTopicList(e),await o.setTopicSemaphore(H.GREEN),X.isFunction(t)&&t(e)}),(async t=>{await st.setTopicTimestamp(),await o.setTopicSemaphore(H.GREEN),X.isFunction(e)&&e(t)}))}catch(t){await o.setTopicSemaphore(H.GREEN),X.isFunction(e)&&e(t)}}},$=class{constructor(t,e){this.code=t,this.type=e}static getAllCodes(t){const e=[];for(let r=0;r0)D.postDeviceTopicsRequest(await J.setTopicRequest(e),(async t=>{await st.setTopicTimestamp(),t.channel=Q.PUSH,await o.setTopicList(t),st.indigitallSyncTopicEvent(q.TOPIC_SYNC_SUBSCRIBE_CALLBACK,t)}),(async t=>{st.indigitallSyncTopicEvent(q.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK,t)}));else if(r&&r.length>0)D.deleteDeviceTopicsRequest(await J.setTopicRequest(r),(async t=>{await st.setTopicTimestamp(),await o.setTopicList(t),st.indigitallSyncTopicEvent(q.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK,t)}),(async t=>{st.indigitallSyncTopicEvent(q.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK,t)}));else{const t=Z.showError(c,c.ErrorCode.PUSH_TOPICS_ERROR,"there is no topic with one of the codes in the push topic list");st.indigitallSyncTopicEvent(q.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK,t),st.indigitallSyncTopicEvent(q.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK,t)}await o.setUpdateTopicSubscribe([])}static async updateTopicAction(t,e){const r=await o.getUpdateTopicSubscribe();if(r&&r.length>0){const n=new tt("[IND]TopicSyncUtils: ");try{const n=[],i=r.filter((e=>t.includes(e.code))),s=t.filter((t=>!$.getAllCodes(r).includes(t)));if(s&&s.length>0)for(let t=0;t0)for(let t=0;te.code===i[t].code)),o=new $(i[t].code,e);r[n]=o.toJSON()}n.length>0&&await o.setUpdateTopicSubscribe(n.concat(r))}catch(t){n.e("updateTopicAction: "+t).writeLog()}}else{const r=[];for(let n=0;n{await o.setTopicSemaphore(H.RED),await J.getTopicsList((async i=>{await this.setTopicCallbacks(t,r,n),await this.requestTopicBackground(q.TOPIC_SYNC_TAG),await rt.updateTopicAction(e,t)}),n)}))}static async checkTopicSemaphore(){if(await o.getTopicSemaphore()!=H.RED)return!0;this.topicSemaphoreWaitTime((()=>!0))}static async topicSemaphoreWaitTime(t){const e=setInterval((async function(){await o.getTopicSemaphore()==H.GREEN&&(clearInterval(e),t())}),1e3)}static async setTopicCallbacks(t,e,r){let n=q.TOPIC_SYNC_SUBSCRIBE_CALLBACK,i=q.TOPIC_SYNC_SUBSCRIBE_ERROR_CALLBACK;t===nt.UNSUBSCRIBE&&(n=q.TOPIC_SYNC_UNSUBSCRIBE_CALLBACK,i=q.TOPIC_SYNC_UNSUBSCRIBE_ERROR_CALLBACK);const o=new BroadcastChannel(n);o.onmessage=t=>{it.isFunction(e)&&e(t.data),o.close()};const s=new BroadcastChannel(i);s.onmessage=t=>{it.isFunction(r)&&r(t.data),s.close()}}static async requestTopicBackground(t){const e=await v.requestBackgroundSync();null!=e&&await e.sync.register(t)}static async isTopicTimestampExceed(){const t=await o.getTopicSyncTimestamp();return!(t&&t>Date.now())&&void 0!==t}static async setTopicTimestamp(){const t=Date.now()+q.TOPIC_SYNC_TIMESTAMP;await o.setTopicSyncTimestamp(t)}static indigitallSyncTopicEvent(t,e){new BroadcastChannel(t).postMessage(e)}static topicFilter(t,e){const r=[];if(t)for(let n=0;n{ht.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(t,new h)})),r.d("Device enabled").writeLog(),!0;{let t="",n=null;if(!this.config||!this.config.appKey)return r.w("config.appKey is not defined").writeLog(),!1;if(t=this.config.appKey,this.config.requestLocation&&await o.setRequestLocation(this.config.requestLocation),this.config.workerPath&&(n=this.config.workerPath,o.setWorkerPath(n)),t){if(await o.setAppKey(t),yt.isServiceWorkerSupported()){const t=new x;return D.getBrowser(t,(t=>{if(t.supported||this.isSafariBrowserDevice()){r.d("browser supported for webpush").writeLog();const i=new x;D.getApplicationAll(i,(async i=>{if(r.d("application ",i).writeLog(),i&&i.data&&i.data.configuration){const t=i.data.configuration;r.d("configuration ",t).writeLog(),t.vapidPublic&&o.setVAPID(t.vapidPublic),t.safariWebsitePushId&&o.setSafariWebsitePushId(t.safariWebsitePushId),t.enabled&&o.setEnabled(t.enabled),t.serviceSyncTime&&o.setServiceSyncTime(t.serviceSyncTime),t.locationEnabled&&o.setLocationEnabled(t.locationEnabled),t.locationUpdateMinutes&&o.setLocationUpdateMinutes(t.locationUpdateMinutes),t.inboxAuthMode&&e()&&e().setInboxAuthMode(t.inboxAuthMode),t.inAppEnabled&&(o.setInAppEnabled(t.inAppEnabled),await o.setUrlInappApi(s))}const a=new p;o.getDeviceId()&&o.getPushToken()?D.putDevice(a,(e=>{try{if(ht.isServiceTimestampExceed()){const t=new I;t.setAppKey(o.getAppKey()),t.setDeviceId(o.getDeviceId()),D.postEventVisit(t)}e.registeredByCookie?(o.setServiceTimestamp(Date.now()),V.getPermissions().then((t=>{const e=new h;e.deviceId&&r.i("deviceId:",e.deviceId).writeLog(),e.pushToken&&r.i("pushToken:",e.pushToken).writeLog(),this.config&&ht.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(t,e)}))):"Safari"!==t.browserName&&yt.registerForPush(n)}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,t))}}),navigator.indigitallOnError):D.postDevice(a,(e=>{try{const r=new I;r.setAppKey(o.getAppKey()),r.setDeviceId(o.getDeviceId()),D.postEventVisit(r),e.registeredByCookie?o.setServiceTimestamp(Date.now()):"Safari"!==t.browserName&&yt.registerForPush(n)}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,t))}}),(t=>{404===t.errorCode&&o.clearStorage(),ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(t)}))}),navigator.indigitallOnError)}else r.w("Browser not Supported").writeLog()}),navigator.indigitallOnError),!0}r.w("ServiceWorker and SafariPushNotification not supported").writeLog()}else r.w("appKey is not found").writeLog()}}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,t))}return!1}static deviceGet(t,e){return D.getDevice(new p,t,e),!0}static deviceEnable(t,e){const r=new p(ut.ENABLE);return r.isDeviceUpdated(!0),D.putDevice(r,t,e),!0}static deviceDisable(t,e){const r=new p(ut.DISABLE);return r.isDeviceUpdated(!0),D.putDevice(r,t,e),!0}static topicsList(t,e){return D.getDeviceTopics(new p,(async e=>{ht.isFunction(t)&&t(e)}),(t=>{ht.isFunction(e)&&e(t)})),!0}static topicsSubscribe(t,e,r){const n=new p;return n.setTopics(t),D.postDeviceTopics(n,(t=>{ht.isFunction(e)&&e(t)}),(t=>{ht.isFunction(r)&&r(t)})),!0}static topicsUnsubscribe(t,e,r){const n=new p;return n.setTopics(t),D.deleteDeviceTopics(n,(t=>{ht.isFunction(e)&&e(t)}),(t=>{ht.isFunction(r)&&r(t)})),!0}static async topicsSubscribeUpdate(t,e,r,n){st.updateTopic(t,e,r,n)}static registerForPush(t){o.setWorkerPath(t),yt.isServiceWorkerSupported()&&yt.launchNotificationPermission(t)}static isSafariPushNotificationSupported(){return W.isSafariPushNotificationSupported()}static isServiceWorkerSupported(){return"serviceWorker"in navigator}static registerServiceWorker(t){const e=new lt(Et);let r="/service-worker.js";return t&&(r=t),navigator.serviceWorker.register(r).then((t=>(e.d("ServiceWorker registration successful with scope: "+t.scope).writeLog(),t))).catch((t=>(e.e("ServiceWorker registration failed: ",t).writeLog(),t)))}static launchNotificationPermissionForSafari(){this.registerForPush(o.getWorkerPath())}static isSafariBrowserDevice(){return O.isSafariBrowserDevice()}static launchNotificationPermission(t){const e=new lt(Et);this.registerServiceWorker(t).then((t=>{try{let r;t.installing?r=t.installing:t.waiting?r=t.waiting:t.active&&(r=t.active),r&&(e.d("sw current state "+r.state).writeLog(),"activated"==r.state?yt.subscribeForPushNotification(t):("installed"==r.state&&o.getPushToken()&&t.update(),r.addEventListener("statechange",(function(r){e.d("sw statechange : "+r.target.state).writeLog(),"activated"==r.target.state&&yt.subscribeForPushNotification(t)}))))}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_INITIALIZATION_ERROR,t))}}))}static async subscribeForPushNotification(t){const e=new lt(Et);try{const r={userVisibleOnly:!0,applicationServerKey:_.urlBase64ToUint8Array(o.getVAPID())};e.d("Registration: ",t).writeLog(),o.getPermissionPush()||_.callEventPermission(B.PERMISSION_TYPE_PUSH,at.EVENT_TYPE_ASK);const n=await t.pushManager.subscribe(r);e.d("Received PushSubscription: "+n).writeLog(),o.getPermissionPush()&&o.getPermissionPush()===at.EVENT_TYPE_ACCEPT||(_.callEventPermission(B.PERMISSION_TYPE_PUSH,at.EVENT_TYPE_ACCEPT),o.setPermissionPush(at.EVENT_TYPE_ACCEPT));const i=n.toJSON();o.setBrowserPublicKey(i.keys.p256dh),o.setBrowserPrivateKey(i.keys.auth),o.setPushToken(i.endpoint),D.putDevice(new p,(t=>{V.getPermissions().then((t=>{ht.isFunction(navigator.indigitallOnInitialized)&&navigator.indigitallOnInitialized(t,new h)})),ht.isFunction(navigator.indigitallOnNewUserRegistered)&&!o.getNewUserTimestamp()&&(o.setNewUserTimestamp(Date.now()),navigator.indigitallOnNewUserRegistered(t)),yt.registerLocation()}),navigator.indigitallOnError),o.setServiceTimestamp(Date.now())}catch(t){e.e("No Registration: "+t).writeLog(),o.getPermissionPush()&&o.getPermissionPush()===at.EVENT_TYPE_REJECT||(_.callEventPermission(B.PERMISSION_TYPE_PUSH,at.EVENT_TYPE_REJECT),o.setPermissionPush(at.EVENT_TYPE_REJECT)),ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(t)}}static registerLocation(){const t=new lt(Et);try{navigator.geolocation&&o.getRequestLocation()&&o.getLocationEnabled()&&(!o.getLocationTimestamp()||o.getLocationUpdateMinutes()<=(Date.now()-o.getLocationTimestamp())/6e4)&&(o.getPermissionLocation()||_.callEventPermission(B.PERMISSION_TYPE_LOCATION,at.EVENT_TYPE_ASK),navigator.geolocation.getCurrentPosition((t=>{o.getPermissionLocation()||o.getPermissionLocation()==at.EVENT_TYPE_ACCEPT||(_.callEventPermission(B.PERMISSION_TYPE_LOCATION,at.EVENT_TYPE_ACCEPT),o.setPermissionLocation(at.EVENT_TYPE_ACCEPT));const e=new I;e.setLocation(t.coords.latitude,t.coords.longitude),D.postEventLocation(e),ht.isFunction(navigator.indigitallOnLocationUpdated)&&navigator.indigitallOnLocationUpdated(t),o.setLocationTimestamp(Date.now())}),(e=>{t.e("error "+e).writeLog(),o.getPermissionLocation()||o.getPermissionLocation()==at.EVENT_TYPE_REJECT||(_.callEventPermission(B.PERMISSION_TYPE_LOCATION,at.EVENT_TYPE_REJECT),o.setPermissionLocation(at.EVENT_TYPE_REJECT))})))}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,t))}}static requestPushPermission(t){V.getPushPermission().then((e=>{ht.isFunction(t)&&t(e)}))}static onPermissionChange(){V.setPermissionCallback()}static requestLocationPermission(t){V.getLocationPermission().then((e=>{ht.isFunction(t)&&t(e)}))}static logIn(t,e,r){yt.setExternalId(t,e,r)}static logout(t,e){yt.setExternalId(null,t,e)}static setExternalCode(t,e,r){yt.setExternalId(t,e,r)}static async setExternalId(t,e,r){try{const n=o.getAppKey();if(!n)return void(ht.isFunction(r)&&r(ft.showError(c,c.ErrorCode.API_APPKEY_NOT_VALID)));if(null!=t){const i=await dt.createHmac(n,t);i&&this.setExternalIdRequest(i,e,r)}else this.setExternalIdRequest(null,e,r)}catch(t){ht.isFunction(r)&&r(ft.showError(c,c.ErrorCode.PUSH_DEVICE_ERROR,t))}}static async setExternalIdRequest(t,e,r){if(o.setExternalId(t),o.isPushDisabled())ht.isFunction(r)&&r(ft.showError(c,c.ErrorCode.DISABLED_CHANNEL));else{const n=new p;await o.setExternalIdRequest(t),n.setExternalCode(t),n.isDeviceUpdated(!0),D.putDevice(n,(t=>{ht.isFunction(e)&&e(new h(t))}),r)}}static sendCustomEvent(t,e,r){try{let n="",i={},s=!0;"string"==typeof t?n=t:"object"==typeof t&&(n=t.eventType,t.customData&&(i=t.customData),!1===t.async&&(s=t.async));const a=new I;a.setDeviceId(o.getDeviceId()),a.setEventType(n),a.setCustomData(i),null!=o.getExternalId()&&"null"!=o.getExternalId()?(a.setExternalCode(o.getExternalId()),a.setJourneyRequest(!0),!1===s?D.postEventJourneySync(a,e,r):D.postEventJourney(a,e,r)):!1===s?D.postEventCustomSync(a,e,r):D.postEventCustom(a,e,r)}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,t))}}static sendJourneyEvent(t,e,r){try{let n="",i={},s=!0;"string"==typeof t?n=t:"object"==typeof t&&(n=t.eventType,t.customData&&(i=t.customData),!1===t.async&&(s=t.async));const a=new I;a.setDeviceId(o.getDeviceId()),a.setExternalCodeRequest(),a.setEventType(n),a.setCustomData(i),a.setJourneyRequest(!0),!1===s?D.postEventJourneySync(a,e,r):D.postEventJourney(a,e,r)}catch(t){ht.isFunction(navigator.indigitallOnError)&&navigator.indigitallOnError(ft.showError(c,c.ErrorCode.PUSH_EVENT_ERROR,t))}}}const vt=yt;window.indigitall||(window.indigitall={}),window.indigitall.Push=yt,window.indigitall.LogLevel=ct,window.indigitall.version=o.getVersion()})(),n})(),t.exports=e()},904:t=>{"use strict";t.exports=JSON.parse('{"_from":"indigitall-web-core@4.9.2","_id":"indigitall-web-core@4.9.2","_inBundle":false,"_integrity":"sha512-aGTfAnLDU6FrokX4B7XvAWEX2Obl/hlcz9OTPFOI/yQIwIKpjfZJ1BEVeCWvDiSEAYhLek73ppnFdV66cUxcGA==","_location":"/indigitall-web-core","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"indigitall-web-core@4.9.2","name":"indigitall-web-core","escapedName":"indigitall-web-core","rawSpec":"4.9.2","saveSpec":null,"fetchSpec":"4.9.2"},"_requiredBy":["#USER","/","/indigitall-web-notification"],"_resolved":"https://registry.npmjs.org/indigitall-web-core/-/indigitall-web-core-4.9.2.tgz","_shasum":"710cb6aaf9858cce437e850a450c7fc81cf71a03","_spec":"indigitall-web-core@4.9.2","_where":"/home/circleci/webpush/sdk","author":{"name":"Smart2me S.L."},"bundleDependencies":false,"deprecated":false,"description":"indigitall web core","devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","script-loader":"^0.7.2","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"homepage":"https://indigitall.com","main":"index.js","name":"indigitall-web-core","scripts":{"build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json","install-core":"npm install && npm run build","public":"ws --directory ./public --port 80 --log.format dev","test":"echo \'There are not tests\'"},"version":"4.9.2"}')},330:t=>{"use strict";t.exports=JSON.parse('{"name":"indigitall-web-sdk","description":"indigitall webpush SDK","version":"4.9.2","main":"index.js","author":"Smart2me S.L.","homepage":"https://indigitall.com","dependencies":{"indigitall-web-core":"^4.9.2","indigitall-web-customer":"^4.9.2","indigitall-web-inapp":"^4.9.2","indigitall-web-inbox":"^4.9.2","indigitall-web-notification":"^4.9.2"},"devDependencies":{"@babel/preset-env":"^7.18.10","babel-loader":"^8.2.5","filemanager-webpack-plugin":"^7.0.0","idempotent-babel-polyfill":"^7.4.4","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"scripts":{"test":"echo \'There are not tests\'","public":"ws --directory ./public --port 80 --log.format dev","build":"webpack --config webpack.config.js --mode=production","build-dev":"webpack --config webpack.config.js --watch --mode=development","build-sdk":"npm run build-install-core && npm run build-install-inapp && npm run build","build-install-core":"npm uninstall indigitall-web-core && npm install ../core","build-install-inapp":"npm uninstall indigitall-web-inapp && npm install ../inapp","build-install-customer":"npm uninstall indigitall-web-customer && npm install ../customer","build-install-inbox":"npm uninstall indigitall-web-inbox && npm install ../inbox","build-install-push":"npm uninstall indigitall-web-notification && npm install ../push","install-sdk":"npm install && npm run build","release-install-core":"npm uninstall indigitall-web-core && npm install indigitall-web-core@$npm_package_version","release-install-inapp":"npm uninstall indigitall-web-inapp && npm install indigitall-web-inapp@$npm_package_version ","release-install-customer":"npm uninstall indigitall-web-customer && npm install indigitall-web-customer@$npm_package_version ","release-install-inbox":"npm uninstall indigitall-web-inbox && npm install indigitall-web-inbox@$npm_package_version ","release-install-push":"npm uninstall indigitall-web-notification && npm install indigitall-web-notification@$npm_package_version && npm run release-install-core && npm run release-install-inapp && npm run release-install-inbox && npm run release-install-customer && npm run install-sdk && npm run delete-node-modules","simulate-release-install-sdk":"npm run install-sdk && npm run delete-node-modules","delete-node-modules":"rm -rf node_modules/ && rm -f package-lock.json"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n);var t=r(326),e=r.n(t),i=r(824),o=r.n(i),s=r(960),a=r.n(s),u=r(603),c=r.n(u);const{Log:l,LogLevel:h,CommonUtils:f,ErrorUtils:d}=r(315).Core.Utils,{Repository:p}=r(315).Core,E=r(330),{Channel:y}=r(315).Core.Models,v="[IND]Indigitall: ";class g{constructor(){this.config=null}static async init(t){return c().init(t)}static deviceGet(t,e){return c().deviceGet(t,e)}static deviceEnable(t,e){return c().deviceEnable(t,e)}static deviceDisable(t,e){return c().deviceDisable(t,e)}static topicsList(t,e){return c().topicsList((e=>{this.inAppTopicList(e,t,(r=>{new l(v).w(r.message).writeLog(),f.isFunction(t)&&t(e)}))}),(r=>{new l(v).w(r).writeLog(),this.inAppTopicList(null,t,e),f.isFunction(e)&&e(r)}))}static async inAppTopicList(t,r,n){"true"===(new p).isInAppEnabled()?e().topicsList((async e=>{null!=t?(await(new p).setTopicList(t),await(new p).setInAppTopicList(e),f.isFunction(r)&&r(e.concat(t))):(await(new p).setInAppTopicList(e),f.isFunction(r)&&r(e))}),(async e=>{null!=t?(await(new p).setTopicList(t),f.isFunction(r)&&r(t)):f.isFunction(n)&&n(e)})):null!=t?(await(new p).setTopicList(t),f.isFunction(r)&&r(t)):f.isFunction(n)&&n(d.showError(null,null,"Internal error bad topic list"))}static topicsSubscribe(t,r,n){"true"===(new p).isInAppEnabled()?e().topicsSubscribe(t,(e=>{this.pushTopicsSubscribe(t,e,r,n)}),(async e=>{new l(v).w(e).writeLog(),this.pushTopicsSubscribe(t,null,r,n)})):this.pushTopicsSubscribe(t,null,r,n)}static pushTopicsSubscribe(t,e,r,n){c().topicsSubscribe(t,(async t=>{this.topicActionOnSuccess(e,t,r)}),(async t=>{this.topicActionOnError(e,t,r,n)}))}static async topicsUnsubscribe(t,r,n){"true"===(new p).isInAppEnabled()?e().topicsUnsubscribe(t,(e=>{this.pushTopicsUnsubscribe(t,e,r,n)}),(async e=>{new l(v).w(e).writeLog(),this.pushTopicsUnsubscribe(t,null,r,n)})):this.pushTopicsUnsubscribe(t,null,r,n)}static pushTopicsUnsubscribe(t,e,r,n){c().topicsUnsubscribe(t,(async t=>{this.topicActionOnSuccess(e,t,r)}),(async t=>{this.topicActionOnError(e,t,r,n)}))}static async topicActionOnSuccess(t,e,r){let n=[];null!=t&&(n=t,await(new p).setInAppTopicList(t)),null!=e&&await(new p).setTopicList(e),f.isFunction(r)&&r(n.concat(e))}static async topicActionOnError(t,e,r,n){new l(v).w(`${e.errorCode}: ${e.exceptionMessage}`).writeLog(),null!=t?(await(new p).setInAppTopicList(t),f.isFunction(r)&&r(t)):f.isFunction(n)&&n(e)}static async setExternalId(t,e,r){c().setExternalId(t,e,r)}static logIn(t,e,r){g.setExternalId(t,e,r)}static logout(t,e){g.setExternalId(null,t,e)}static sendCustomEvent(t,e,r){c().sendCustomEvent(t,e,r)}static sendJourneyEvent(t,e,r){c().sendJourneyEvent(t,e,r)}static isServiceWorkerSupported(){return c().isServiceWorkerSupported()}static isSafariPushNotificationSupported(){return c().isSafariPushNotificationSupported()}static isSafariPermissionAsked(){return c().isSafariPermissionAsked()}static isSafariBrowserDevice(){return c().isSafariBrowserDevice()}static launchNotificationPermissionForSafari(){c().launchNotificationPermissionForSafari()}static async showInApp(t,r,n,i){e().showInApp(t,r,n,i)}static async showInAppWithConfig(t,r,n,i,o,s,a,u,c,l,h){e().showInAppWithConfig(t,r,n,i,o,s,a,u,c,l,h)}static showMultipleInApp(t,r,n,i){e().showMultipleInApp(t,r,n,i)}static async showMultipleInAppWithConfig(t,r,n,i,o,s,a,u,c,l,h){e().showMultipleInAppWithConfig(t,r,n,i,o,s,a,u,c,l,h)}static getInboxMessagesCount(t,e,r){o().getMessagesCountWithAuth(t,e,r)}static getInbox(t,e,r){o().getInboxWithAuth(t,e,r)}static getInboxWithPage(t,e,r,n,i,s,a,u){o().getInboxWithPage(t,e,r,n,i,s,a,u)}static getCustomer(t,e){a().getCustomer(t,e)}static getCustomerInformation(t,e){this.getCustomerInformationWithFields(null,t,e)}static getCustomerInformationWithFields(t,e,r){a().getCustomerInformation(t,e,r)}static assignOrUpdateValueToCustomerFields(t,e,r){a().assignOrUpdateValueToCustomerFields(t,e,r)}static deleteValuesFromCustomerFields(t,e,r){a().deleteValuesFromCustomerFields(t,e,r)}static link(t,e,r,n){g.logIn(t,(t=>{a().link(e,r,n)}),(t=>{f.isFunction(n)&&n(t)}))}static unlink(t,e,r){g.logout((n=>{a().unlink(t,e,r)}),(t=>{f.isFunction(r)&&r(t)}))}static sendCustomerCustomEvent(t,e,r,n){a().sendCustomerCustomEvent(t,e,r,n)}}window.indigitall=g,window.indigitall.InApp=e(),window.indigitall.Inbox=o(),window.indigitall.Customer=a(),window.indigitall.Push=c(),window.indigitall.InApp.Utils=e().Utils,window.indigitall.Channel=y,window.indigitall.LogLevel=h,window.indigitall.version=E.version})(),n})()));