!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("fedopsLogger",[],e):"object"==typeof exports?exports.fedopsLogger=e():t.fedopsLogger=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="https://static.parastorage.com/services/fedops-logger/5.9.0/",n.p="undefined"!=typeof window&&window.__STATICS_BASE_URL__||n.p,n(n.s=18)}([function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i}),n.d(e,"c",function(){return a});var r={},o=function(){return"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof WorkerGlobalScope?WorkerGlobalScope:r};function i(){return"undefined"!=typeof navigator&&navigator&&navigator.sendBeacon}function a(t){return navigator.sendBeacon(t)}}).call(this,n(19))},function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"c",function(){return a}),n.d(e,"a",function(){return s}),n.d(e,"d",function(){return u}),n.d(e,"e",function(){return d});var r=n(0);function o(t){return((Object(r.a)().fedops||{}).apps||{})[t]}function i(){Object(r.a)().fedops=Object(r.a)().fedops||{},Object(r.a)().fedops.apps=Object(r.a)().fedops.apps||{}}function a(t){i(),function(t){Object(r.a)().fedops.apps[t]=Object(r.a)().fedops.apps[t]||{}}(t)}function s(t){return(o(t)||{}).startLoadTime||0}function u(t,e){return(o(t)||{}).startLoadTime=e}function d(t){return(Object(r.a)().fedops||{}).sessionId=t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Host="frog.wix.com",e.LoggerVersion="2.0.270",function(t){t.Auto="auto",t.PostMessage="postMessage"}(e.PublishMethods||(e.PublishMethods={})),function(t){t[t.Unsupported=0]="Unsupported"}(e.Errors||(e.Errors={})),function(t){t.msid="_msid",t.clientId="_client_id",t.uuid="_uuid",t.visitorId="_visitorId",t.siteMemberId="_siteMemberId"}(e.EventContextMap||(e.EventContextMap={}))},function(t,e,n){"use strict";var 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};var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.name=n.constructor.name,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),e}();t.exports.defined=function(t,e){if(void 0===t)throw new o(e)},t.exports.object=function(t,e){if(void 0!==t&&("object"!==(void 0===t?"undefined":r(t))||Array.isArray(t)||null===t))throw new o(e)},t.exports.ok=function(t,e){if(!t)throw new o(e)},t.exports.func=function(t,e){if(void 0!==t&&"function"!=typeof t)throw new o(e)},t.exports.AssertionError=o},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e){var n=t.call(this,e)||this;return n.name=n.constructor.name,n}return r(e,t),e}(Error);e.AssertionError=o;var i=function(t){function e(e){var n=t.call(this,e)||this;return n.name=n.constructor.name,n}return r(e,t),e}(Error);e.APINotSupportedError=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.now=function(){return"undefined"!=typeof performance&&performance&&performance.now?performance.now():-1},e.getDesktopSize=function(t){return(t.screen&&t.screen.width||0)+"x"+(t.screen&&t.screen.height||0)},e.getWindowSize=function(t){var e=0,n=0;return t.innerWidth?(e=t.innerWidth,n=t.innerHeight):t.document&&(t.document.documentElement&&t.document.documentElement.clientWidth?(e=t.document.documentElement.clientWidth,n=t.document.documentElement.clientHeight):t.document.body&&t.document.body.clientWidth&&(e=t.document.body.clientWidth,n=t.document.body.clientHeight)),e+"x"+n},e.sendBeacon=function(t,e){return!("undefined"==typeof navigator||!navigator||!navigator.sendBeacon)&&navigator.sendBeacon(t,e)},e.readCookie=function(t){if("undefined"==typeof document)return null;for(var e=0,n=document.cookie.split(";");e1&&void 0!==arguments[1]?arguments[1]:{};return Promise.all(this._publishers.map(function(r){var o=Object.assign({},t);return Promise.resolve().then(function(){return r(o,Object.assign({},e._context,n))}).catch(function(t){return e._onPublisherFailHandler(t,{publisherName:r.name})})})).then(function(){})}},{key:"_extractEventAndContext",value:function(t,e,n){var r=void 0,i={};if("string"!=typeof t)r=t,i=e||i;else{if(!(r=this._events[t]))throw new o.AssertionError("Event with key '"+t+"' not found in event map.");e&&(r=Object.assign({},r,e),i=n||i)}return{event:r,context:i}}},{key:"_initBuffer",value:function(t){var e=this,n=!0===t?300:t;return this._buffer||(this._buffer=new c(n).onFlush(function(n){var r=s(e._defaults,function(t){return"function"!=typeof t});return n.g=r,e._send(n,{useBatch:t})}))}},{key:"_handleDefaultsError",value:function(t){return this._defaultContinueOnFail?(d.error(t),null):Promise.reject(t)}},{key:"_getDefaults",value:function(){var t=this;if(!this._defaults)return Promise.resolve({});var e=a(this._defaults,function(e,n){if("function"==typeof e)try{e=e()}catch(e){return t._handleDefaultsError(e)}return e&&"function"!=typeof e.then?e:u.timedPromise(e,{message:"Cannot get default value '"+n+" for BI Event'",timeout:t._defaultValueTimeout}).catch(function(e){return t._handleDefaultsError(e)})});return u.allAsObject(e)}}],[{key:"_defaultPublisherFailHandler",value:function(t,e){return e.publisherName}}]),t}();t.exports=p},function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=e.biLoggerFactory,r=e.baseUrl,o=e.endpoint,i=e.preset;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.preset=i,this.factory=n||b.factory({host:r}),this.persistentPublisher=this.factory.logger({endpoint:this.preset.persistentEndpoint}),this.nonPersistentPublisher=this.factory.logger({endpoint:o||this.preset.nonPersistentEndpoint})}return t.prototype.report=function(t,e){if(!t)return null;switch(e){case this.preset.persistentEndpoint:return this.persistentPublisher.log(t);default:return this.nonPersistentPublisher.log(t)}},t}(),I=void 0;function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.biLoggerFactory,n=t.baseUrl,r=t.endpoint,o=t.preset;return I?I({preset:o}):new _({biLoggerFactory:e,baseUrl:n,endpoint:r,preset:o})}var P=n(17),O=n.n(P),S={getNavigation:function(){return void 0!==Object(g.a)()&&Object(g.a)().performance?Object(g.a)().performance.navigation:{}},getResources:function(){var t=[];try{return Object(g.a)()&&Object(g.a)().performance&&Object(g.a)().performance.getEntriesByType&&Object(g.a)().performance.getEntriesByType("resource")||t}catch(e){return t}},getTiming:function(){return Object(g.a)()&&Object(g.a)().performance?Object(g.a)().performance.timing:{}},clearResourceTimings:function(){Object(g.a)()&&Object(g.a)().performance&&Object(g.a)().performance.clearResourceTimings&&Object(g.a)().performance.clearResourceTimings()},now:function(){return Object(g.a)()&&Object(g.a)().performance&&Object(g.a)().performance.now?Object(g.a)().performance.now():"undefined"!=typeof performance&&performance&&performance.now?performance.now():(new Date).getTime()},responseEndTime:function(){if("undefined"!=typeof performance&&performance&&performance.timing&&performance.timing.responseEnd&&performance.timing.fetchStart)return performance.timing.responseEnd-performance.timing.fetchStart},mark:function(t){Object(g.a)()&&Object(g.a)().performance&&Object(g.a)().performance.mark&&Object(g.a)().performance.mark(t)},measure:function(t,e,n){Object(g.a)()&&Object(g.a)().performance&&Object(g.a)().performance.measure&&Object(g.a)().performance.measure(t,e,n)}},x=n(1);var E=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.appName=e,this.apps={},this.apps[e]={}}return t.prototype._getKeyForApp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.appName,e=arguments[1];return e?t+"_"+e:t},t.prototype.setLoadStarted=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.appId,n=t.widgetId,r=this._getKeyForApp(e,n);this.apps[r]||(this.apps[r]={});var o=S.now();this.apps[r].startLoadTime=o,e||Object(x.d)(r,o)},t.prototype.getLoadStartTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.appId,n=t.widgetId,r=this._getKeyForApp(e,n);return Math.floor(this.apps[r]&&this.apps[r].startLoadTime||Object(x.a)(r)||0)},t.prototype.getAppLoadTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.appId,n=t.widgetId;return Math.floor(S.now()-this.getLoadStartTime({appId:e,widgetId:n}))},t.prototype.getFirstRequestDuration=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.appId,n=t.widgetId;return this.getLoadStartTime({appId:e,widgetId:n})},t}();var T=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e}return t.prototype.isActive=function(){return!0},t.prototype.export=function(){return this.data},t}();var j=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.items=[],n&&(void 0===n.length?[n]:n).forEach(function(t){return e.addItem(t)})}return t.prototype.clone=function(){return new t(this.items.slice())},t.prototype.addItem=function(t){return this.items.push(t instanceof T?t:new T(t)),this},t.prototype.mergeItems=function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:{}).appId;return Array.from(this.phases).filter(function(e){var n=e[0].split("_")[1];return t&&n===t||!t}).map(function(t){return function(t){var e;return(e={})[t.name]=t,e}(t[1])})},t.prototype.createCodeParsingPhaseIfNotExist=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.appId,r=e.widgetId,o=t._getIndexForPhase({name:"codeParsingPhase",appId:n,widgetId:r});this.phases.has(o)||(this.phases.set(o,{phaseStartTime:Object(x.a)(this.appName),index:0,name:"codeParsingPhase"}),this.indexToKey.set(0,o))},t}();var F=function(t){function e(n){var r=n.appId,o=n.widgetId,i=n.isServerSide,a=n.widgetArray;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return s.data=s._filterUndefined({appId:r,widgetId:o,isServerSide:i,widgetArray:a}),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._filterUndefined=function(t){var e={};return Object.keys(t).forEach(function(n){t[n]&&(e[n]=t[n])}),e},e}(T),C=function(){return void 0!==Object(g.a)()&&Object(g.a)().location},D={getHost:function(){return C()&&Object(g.a)().location.host},isFedopsDev:function(){return((C()||{}).search||"").indexOf("fedops=dev")>-1}};var M={xmlhttprequest:{count:"countXhr",unsupported:"unsprtXhr",duration:"timeXhr",total:"sizeXhr",longest:"longXhr",http2:"h2Xhr"},script:{count:"countJs",unsupported:"unsprtJs",duration:"timeJs",total:"sizeJs",cached:"cachedJs",http2:"h2Js"},link:{count:"countCss",unsupported:"unsprtCss",duration:"timeCss",total:"sizeCss",cached:"cachedCss",http2:"h2Css"},img:{count:"countImg",unsupported:"unsprtImg",duration:"timeImg",total:"sizeImg",cached:"cachedImages",http2:"h2Images"}},R={link:function(t){return/(.\.css$|.\.css?.)/g.test(t.name)}},H=function(t){return t.responseEnd-t.startTime};function B(t,e){var n=R[e];return t.filter(function(t){return e===t.initiatorType&&(!n||n(t))})}function U(t){return!t.name.match(/http(s)?:\/\/frog.wix.com\//)}function V(t){return function(t){var e=D.getHost();return e&&-1===t.indexOf(e)}(t.name)&&0===t.transferSize&&0===t.requestStart}function W(t){var e=t.filter(function(t){return!V(t)});return Object.keys(M).reduce(function(n,r){var o=B(t,r),i=B(e,r),a=M[r];return n[a.count]=i.length,n[a.duration]=function(t){if(0===t.length)return 0;var e={startTime:1/0,responseEnd:0};return t.forEach(function(t){e.startTime>t.startTime&&(e.startTime=t.startTime),e.responseEnd=H(t)?e:t});return H(e)}(i)),a.cached&&(n[a.cached]=function(t){if(0===t.length)return 0;var e=t.filter(function(t){return 0===t.transferSize});return Math.round(e.length/t.length*100)}(i)),n},{})}function z(t){return{url:t.name,downloadDuration:t.responseEnd-t.startTime,bytesTransferred:t.transferSize,isHTTP2:"h2"===t.nextHopProtocol}}var J=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.performNetworkAnalysis=function(t){if(0===t.length)return null;var e=S.now(),n=t.filter(U),r=W(n);r.overhead=S.now()-e;var o=function(t){return Object.keys(t).reduce(function(e,n){var r=parseInt(t[n]);return isNaN(r)||"number"!=typeof r||(e[n]=r),e},{})}(r);if(console.debug&&D.isFedopsDev()){var i=function(t){var e=t.reduce(function(t,e){return V(e)?t.unsupported.push(e):t.supported.push(e),t},{supported:[],unsupported:[]});return Object.keys(M).reduce(function(t,n){return t[n]={},t[n].supported=B(e.supported,n).map(function(t){return z(t)}),t[n].unsupported=B(e.unsupported,n).map(function(t){return z(t)}),t},{})}(n);console.debug("[fedops network analysis] [bytes analysis]\n"+JSON.stringify(o,null,4)),console.debug("[fedops network analysis] [resources breakdown]\n",i)}return o},e}(T);var G=function(t){function e(n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,{duration:n}))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.setFirstRequestDuration=function(t){return this.data.frd=t,this},e}(T);function X(t){delete t[Object.getOwnPropertyNames(t)[0]].index}var q=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._sessionId=e,this._preset=n}return t.prototype.biAppLoadStart=function(){return this._biDataItem(this._preset.appLoadStart.eventId)},t.prototype.biAppLoadFinish=function(){return this._biDataItem(this._preset.appLoadFinish.eventId)},t.prototype.biInteractionStart=function(){return this._biDataItem(this._preset.interactionStart.eventId)},t.prototype.biInteractionEnd=function(){return this._biDataItem(this._preset.interactionEnd.eventId)},t.prototype.biLoadPhaseStart=function(){return this._biDataItem(this._preset.loadPhaseStart.eventId)},t.prototype.biLoadPhaseFinish=function(){return this._biDataItem(this._preset.loadPhaseFinish.eventId)},t.prototype.biError=function(){return this._biDataItem(this._preset.error.eventId)},t.prototype.appName=function(t){var e=t.appName,n=t.isServerSide;return this.dataItem({appName:n?e+"_ssr":e})},t.prototype.artifact=function(t){var e=t.id,n=t.version,r=t.isRollout;return this.dataItem({artifactId:e,artifactVersion:n,isRollout:r})},t.prototype.appContext=function(t){return new F(t)},t.prototype.customParams=function(t){return this.dataItem({customParams:t})},t.prototype.duration=function(t){return new G(t)},t.prototype.loadingPhaseCollection=function(t){var e=JSON.stringify(function(t){var e={},n=t,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;X(a),e=Object.assign(e,a)}return e}(t));return this.dataItem({phases:e})},t.prototype.loadingPhaseStart=function(t){var e=t.name;return this.dataItem({name:e})},t.prototype.loadingPhaseFinish=function(t){var e=t.name,n=function(t){return Math.floor(S.now()-t)}(t.phaseStartTime);return this.dataItem({name:e,duration:n})},t.prototype.loadingPhaseFinishPrefixed=function(t){var e=t.name,n=t.index,r=t.phaseStartTime,o=function(t,e){return("0"+e).slice(-2)+"_"+t}(e,n);return this.loadingPhaseFinish({name:o,phaseStartTime:r})},t.prototype.resource=function(){var t=this._asBiEvent(this._preset.resource.eventId);return new J(t)},t.prototype.dataItem=function(t){return new T(t)},t.prototype._biDataItem=function(t){var e=this._asBiEvent(t);return this.dataItem(e)},t.prototype._asBiEvent=function(t){return{src:this._preset.src,evid:t,session_id:this._sessionId,_:(new Date).getTime()}},t}(),K={SEND_ON_START:"SEND_ON_START",SEND_ON_FINISH:"SEND_ON_FINISH",SEND_ON_APP_LOADED:"SEND_ON_APP_LOADED",SEND_START_AND_FINISH:"SEND_START_AND_FINISH"},$=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{}).appId;if(!(e&&this._appStartLoadCalled[e]||!e&&this._appStartLoadCalled[this.appName])){t._markAppLoadStarted(this.appName),this._appStartLoadCalled[e||this.appName]=!0,this.times.setLoadStarted({appId:e});var n=this.dataSource.addItem(this.dataItems.biAppLoadStart()).addItem(this.dataItems.appContext({appId:e||this.appId,widgetId:this.widgetId,isServerSide:this.isServerSide}));return e&&this._changeAppNameForEvent(n,e),this._report(n,this._getEndpoint())}},t.prototype._isCustomParamsAllowed=function(){return this._presetType===m.DEFAULT},t.prototype._isOverridingTimeAllowed=function(){return this._presetType===m.MOBILE},t.prototype.appLoaded=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.appId,r=e.customParams;if(!(n&&this._appLoadedCalled[n]||!n&&this._appLoadedCalled[this.appName])){t._clearLoadTimeout(),t._markAndMeasureAppLoad(this.appName),this._appLoadedCalled[n||this.appName]=!0,this._sendLastAppLoadPhaseIfNeeded(),this.reportNetworkAnalysis();var o=this.dataSource.addItem(this.dataItems.biAppLoadFinish()).addItem(this.dataItems.appContext({appId:n||this.appId,widgetId:this.widgetId,isServerSide:this.isServerSide})).addItem(this.dataItems.duration(this.times.getAppLoadTime({appId:n})).setFirstRequestDuration(this.times.getFirstRequestDuration()));if(n&&this._changeAppNameForEvent(o,n),this._isCustomParamsAllowed()){var i="string"==typeof r?JSON.parse(r):r;if(r=Object.assign({},this._customParams,i),Object.keys(r).length>0){var a=JSON.stringify(r);o.addItem(this.dataItems.customParams(a))}}if(this.phasesConfig===K.SEND_ON_APP_LOADED){var s=this.loadingPhases.getPhases({appId:n});s.length>0&&o.addItem(this.dataItems.loadingPhaseCollection(s))}return this._report(o,this._getEndpoint())}},t.prototype.appLoadingPhaseStart=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.appId,r=e.widgetId;if(this.phasesConfig===K.SEND_ON_START&&this.loadingPhases.createCodeParsingPhaseIfNotExist({appId:n,widgetId:r}),this.loadingPhases.saveLoadingPhase({name:t,appId:n,widgetId:r}),this._sendPreviousPhaseIfNeeded(t,{appId:n,widgetId:r}),S.mark("[fedops] "+t+" started"),this.phasesConfig===K.SEND_START_AND_FINISH){var o=this.dataSource.addItem(this.dataItems.biLoadPhaseStart()).addItem(this.dataItems.appContext({appId:n,widgetId:r})).addItem(this.dataItems.loadingPhaseStart({name:t}));n&&this._changeAppNameForEvent(o,n),this._report(o,this._getEndpoint())}},t.prototype._changeAppNameForEvent=function(t,e){t.addItem(this.dataItems.appName({appName:e,isServerSide:this.isServerSide}))},t.prototype._sendPreviousPhaseIfNeeded=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.appId,r=e.widgetId;if(this.phasesConfig===K.SEND_ON_START){var o=this.loadingPhases.getPhasePreviousTo({name:t,appId:n,widgetId:r});S.mark("[fedops] "+o.name+" finished");var i=this.dataItems.loadingPhaseFinishPrefixed(o),a=this.dataItems.biLoadPhaseFinish(),s=this.dataSource.addItem(i).addItem(a);this._report(s)}},t.prototype.appLoadingPhaseFinish=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.appId,r=e.widgetId,o=e.widgetArray;if(this.phasesConfig===K.SEND_ON_START)throw new Error('To use appLoadingPhaseFinish you must create the logger with the "phasesConfig: SEND_ON_FINISH or SEND_ON_APP_LOADED" param');if(S.mark("[fedops] "+t+" finished"),this.phasesConfig!==K.SEND_ON_APP_LOADED){var i=this.loadingPhases.getAppLoadingPhaseData({name:t,appId:n,widgetId:r});if(!i)throw new Error("Cannot report end of a phase that wasn't started. Phase "+t+" doesn't exist");var a=this.dataItems.loadingPhaseFinish(i),s=this.dataItems.biLoadPhaseFinish(),u=this.dataItems.appContext({appId:n,widgetId:r,widgetArray:o,isServerSide:this.isServerSide}),d=this.dataSource.addItem(a).addItem(s).addItem(u);return n&&this._changeAppNameForEvent(d,n),this._report(d,this._getEndpoint())}this.loadingPhases.endLoadingPhase({name:t,appId:n,widgetId:r,widgetArray:o})},t.prototype._getEndpoint=function(){return this.isPersistent?this._preset.persistentEndpoint:this._preset.nonPersistentEndpoint},t.prototype._sendLastAppLoadPhaseIfNeeded=function(){var t=this.loadingPhases.getNextPhaseToReport();this.phasesConfig===K.SEND_ON_START&&t&&"codeParsingPhase"!==t.name&&this._report(this.dataSource.addItem(this.dataItems.loadingPhaseFinishPrefixed(t)).addItem(this.dataItems.biLoadPhaseFinish()))},t._clearLoadTimeout=function(){Object(g.a)()&&Object(g.a)().fedops&&"function"==typeof Object(g.a)().fedops.clearLoadTimeout&&Object(g.a)().fedops.clearLoadTimeout()},t.prototype.clearResourceTimings=function(){S.clearResourceTimings()},t._markAppLoadStarted=function(t){S.mark("[fedops] "+t+" app-load-started")},t._markAndMeasureAppLoad=function(t){S.mark("[fedops] "+t+" app-loaded");try{S.measure("[fedops] "+t+" app-loaded","[fedops] "+t+" app-load-started","[fedops] "+t+" app-loaded")}catch(t){}},t._markInteractionStarted=function(t){S.mark("[fedops] "+t+" started")},t._markAndMeasureInteractionEnded=function(t,e){if(e){S.mark("[fedops] "+t+" ended");try{S.measure("[fedops] "+t+" duration","[fedops] "+t+" started","[fedops] "+t+" ended")}catch(t){}}},t.prototype.interactionStarted=function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.timeOverride,i=r.interactionTimeout,a=r.startHook,s=r.timeoutHook;if(o&&!this._isOverridingTimeAllowed())throw new Error("Overriding time parameter of interaction is not permitted");t._markInteractionStarted(e);var u=this.dataSource.addItem({name:e}).addItem(this.dataItems.biInteractionStart());return this._outgoingInteractions[e]={timestamp:o||S.now(),timeout:i||this.interactionTimeout},this._report(u),Q(a||this.startHook,{name:e}),{timeoutId:function(){if(i||n.interactionTimeout)return setTimeout(function(){var t=n.dataSource.addItem({interactionName:e}).addItem({errorType:"timeout"}).addItem(n.dataItems.biError());n._report(t),Q(s||n.timeoutHook,{name:e,timeout:i||n.interactionTimeout})},i||n.interactionTimeout)}()}},t.prototype.interactionEnded=function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.timeOverride,i=r.timeoutId,a=r.endHook;if(o&&!this._isOverridingTimeAllowed())throw new Error("Overriding time parameter of interaction is not permitted");var s=this._outgoingInteractions[e];t._markAndMeasureInteractionEnded(e,s),i&&clearTimeout(i);var u=this._outgoingInteractions[e]||function(t){return t.fedops&&t.fedops.apps&&t.fedops.apps[n.appName]&&t.fedops.apps[n.appName].interactions&&t.fedops.apps[n.appName].interactions[e]}(Object(g.a)()),d=o||S.now(),c=u?Math.floor(d-u.timestamp):"";Q(a||this.endHook,{name:e,duration:c,timeout:this._outgoingInteractions[e]&&this._outgoingInteractions[e].timeout});var p=this.dataSource.addItem({name:e}).addItem({duration:c}).addItem(this.dataItems.biInteractionEnd());delete this._outgoingInteractions[e],this._report(p)},t.prototype.getLoggerForWidget=function(e){var n=e.appName,r=e.appId,o=e.widgetId,i=e.version,a=e.timeoutHook,s=e.startHook,u=e.endHook,d=e.useGlobalLogger;return new t(n||r+"_"+o,i||this.getAppVersion(),d?this.reporter:w({biLoggerFactory:this.reporter.factory,preset:this._preset}),{isServerSide:this.isServerSide,appId:r,widgetId:o,sessionId:this.sessionId,phasesConfig:K.SEND_ON_START,isPersistent:this.isPersistent,timeoutHook:a,startHook:s,endHook:u,customParams:this._customParams})},$(t,[{key:"dataSource",get:function(){return this.dataSourceBase.clone()}},{key:"sessionId",get:function(){return this.getParam("sessionId")},set:function(t){this.params.sessionId=t}}]),t}();n.d(e,"create",function(){return tt}),n.d(e,"reportAppLoadStarted",function(){return et}),n.d(e,"phasesConfig",function(){return nt});var Z=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return null;var n=t.replace(/\./g,"-");Object(x.c)(n);var r=Z({},e,{preset:v(e.presetType)}),o=w(r);return new Y(n,Object(g.a)().__CI_APP_VERSION__||y,o,r)}function et(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).artifactData;Object(x.c)(t),Object(x.d)(t,S.responseEndTime()||S.now());var n=L.getSessionId();Object(x.e)(n);var r="//frog.wix.com/fed?appName="+t+"&src=72&evid=14&session_id="+n+"&_="+Math.random();e&&(r+="&artifactId="+e.id+"&artifactVersion="+e.version+"&isRollout="+e.isRollout),Object(g.b)()?Object(g.c)(r):(new Image).src=r}var nt=K},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(21),o=n(8),i=n(9);t.exports.BiLoggerFactory=r,t.exports.BiLogger=o,t.exports.BiLoggerManager=i.BiLoggerManager,t.exports.factory=function(){return new r},t.exports.manager=i.manager},function(t,e,n){"use strict";var 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},o=function(){function t(t,e){for(var n=0;n>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}}])}); //# sourceMappingURL=fedops-logger.bundle.min.js.map