(function(e,t){for(var n in t)e[n]=t[n]})(this,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=94)}({1:function(e,t){var n=["log","error","warn","info","debug"],r=["time","timeEnd","table","dir","group","groupEnd"],o=window.performance;e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"[LO]";if(!e)throw new Error("Debug namespace required.");var i=function(n){return"".concat(t,"[").concat(e,"] ").concat(n)},c={createBoilerplate:function(e){c[e]=function(){return c.run.apply(c,[e].concat(Array.prototype.slice.call(arguments)))}},shouldDebug:function(){if(window.localStorage){var t=window.localStorage.getItem("debug");if(t){var n=(t=t.replace(/\s/g,"")).split(",");if(n.indexOf("*")>-1)return!(n.indexOf("!"+e)>-1);if(n.indexOf(e)>-1)return!0}return!1}},run:function(){if(c.shouldDebug()){var t=Array.prototype.slice.call(arguments),r=t.shift();return n.includes(r)&&(t.unshift("color: ".concat("#ff9b38",";")),t.unshift("%c".concat("[LO]","[").concat(e,"]"))),console[r].apply&&console[r].apply(console,t),!0}return!1},mark:function(e){return e=i(e),c.shouldDebug()&&o&&o.mark(e)},measure:function(e,t,n){c.shouldDebug()&&o&&(e=i(e),t=i(t),n=i(n),o.measure(e,t,n),o.clearMarks(t),o.clearMarks(n))}};return n.forEach(c.createBoilerplate),r.forEach(c.createBoilerplate),c}},135:function(e,t,n){"use strict";n.r(t);var r=n(2),o=n(1),i=n.n(o),c=n(50),a=n(62);var u=function(e,t,n){if(!a(e)||"string"!=typeof t)return void 0===n?e:n;var r=function(e){for(var t=e.split("."),n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};e={contextWindow:window,endpoint:"https://settings.luckyorange.com",siteId:null};var t=new r.a,n=new Date,o={state:{},getSiteId:function(){var t=null;(t=e.siteId)||(t=Array.from(document.querySelectorAll('script[src*="lo.js"]')).map((function(e){return new URL(e.src).searchParams.get("site-id")})).find((function(e){return null!=e})));return t||(t=e.contextWindow.__lo_site_id||e.contextWindow.__wtw_lucky_site_id),!t&&e.contextWindow.Ecwid&&(t=e.contextWindow.Ecwid.getAppPublicConfig("lucky-orange")),l.log("Found site:",t),String(t)},getVisitorId:function(){var t=e.contextWindow.document.cookie.indexOf("lo-uid");if(t>-1){var n=e.contextWindow.document.cookie.substring(t+("lo-uid".length+1));return n=n.substring(0,n.indexOf(";"))}},get:function(e){return u(o.state,e)},getCurrentServerTime:function(){return new Date(o.get("serverTime")).getTime()+o.getElapsedTime()},getElapsedTime:function(){return(new Date).getTime()-n.getTime()},load:function(t){return l.log("Loading settings for site:",t),(e.contextWindow.fetch||c.a)(e.endpoint+"/"+t,{method:"GET",headers:{"x-lucky-uid":o.getVisitorId()}}).then((function(e){if(!e.ok)throw new Error("Unable to get settings: "+e.status);return e.json()})).then((function(e){return o.state=e,e}))}};return o.load(o.getSiteId()).then((function(){return t.$internal.expose("settings",o,{internal:!0}),o}))},d=n(22),f=new i.a("lo.js");!function(){f.log("Starting Lucky Orange..."),f.mark("start");var e=document.currentScript?document.currentScript.src:"";if(!d.a.isModern())return d.a.load("lo",{iframe:!1,currentScriptSrc:e});var t=new r.a({context:window,traverse:!1}),n={};(new s).then((function(e){return n.settings=e,t=0,new Promise((function(e,n){var r=window.localStorage&&window.localStorage.getItem("lo-debug-app-id"),o=null;window.parent!==window?o=window.parent:window.opener&&(o=window.opener),r?e(r):o?(window.addEventListener("message",(function(n){var r=n.origin||n.originalEvent.origin;if(r.includes("luckyorange.com")||r.includes("lucky-orange.vercel.")){var o=n.data;("LO::APPID"===o.type||"getAppId"===o.name&&o.payload)&&(clearTimeout(t),e(o.appid||o.payload.appId))}})),t=setTimeout((function(){return e("core")}),2500),o.postMessage({name:"getAppId",type:"LO::APPID"},"*")):e("core")}));var t})).then((function(r){return n.settings.get("error")&&"core"===r?(f.log("Unable to start:",n.settings.get()),t):(d.a.load(r,{iframe:"heatmap"!==r,currentScriptSrc:e}),f.mark("end"),f.measure("Starting","start","end"),t)})).catch(f.error)}()},2:function(e,t,n){"use strict";var r=function(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}},o=n(1);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=new(n.n(o).a)("Shared API"),a="API Exposed";function u(){for(var e=arguments[0],t=0;t0&&void 0!==arguments[0]?arguments[0]:{};e=u({context:null,contextKey:"LO",traverse:!0},e);var t={},n=r(),o={on:n.on,emit:n.emit};n.emit=function(e,n){return t[e]=n,o.emit(e,n)},n.on=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.immediate&&t[e]&&n(t[e]),o.on(e,n)};var s={$internal:{expose:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=u({internal:!0},n)).internal?s.$internal:s;if(r[e])throw new Error("Namespace [".concat(e,"] already exposed."));r[e]=t,s.$internal.bus.emit(a,{namespace:e,apiToAdd:t}),c.log("".concat(e," namespace exposed ").concat(n.internal?"internally":"publicly","."))},ready:function(e){return new Promise((function(t,n){var r=s[e]||s.$internal[e];if(r&&"object"===i(r))return t(r);s.$internal.bus.on(a,(function(n){if(n.namespace===e)return t(n.apiToAdd)}))}))},bus:n}};return null===e.context&&e.traverse&&(e.context=l(window,e.contextKey)),e.context[e.contextKey]?e.context[e.contextKey]&&"object"===i(e.context[e.contextKey])&&!e.context[e.contextKey].$internal?(e.context[e.contextKey]=u(s,e.context[e.contextKey]),e.context[e.contextKey]):e.context[e.contextKey]:(e.context[e.contextKey]=s,s)}},22:function(e,t,n){"use strict";var r=n(1),o=new(n.n(r).a)("External Scripts"),i=(Object({NODE_ENV:"production",LO_APP_ENV:"production"}).LO_CDN_PATH,Object({NODE_ENV:"production",LO_APP_ENV:"production"}).LO_CDN_PATH||"https://tools.luckyorange.com"),c={loaded:{},whitelist:{core:{legacy:"".concat(i,"/core/core.legacy.js"),modern:"".concat(i,"/core/core.js")},heatmap:{legacy:"".concat(i,"/heatmaps/bootstrap.js")},messenger:{legacy:"".concat(i,"/messenger/bootstrap.js")},selector:{legacy:"".concat(i,"/core/selector.js")},lo:{legacy:"".concat(i,"/core/lo.legacy.js")}},load:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!c.whitelist[e])throw new Error("Script [".concat(e,"] was not found in whitelist."));if(c.loaded[e])o.log("Script [".concat(e,"] has already been loaded."));else{var n=c.isModern()&&c.whitelist[e].modern?"modern":"legacy",r=null,i=window.localStorage&&window.localStorage.getItem("lo-debug-url:".concat(e)),a=window.localStorage&&window.localStorage.getItem("lo-debug-disable-script");if(a!==e){i?(o.log("Debug URL found for script [".concat(e,"] in localStorage.")),r=i):r=c.whitelist[e][n],!1!==t.cacheControl&&(r="".concat(r,"?v=").concat("401eef2"));var u=null;t.iframe&&(u=c.createFrame(e)),c.waitForFrameLoad(u,(function(){var n=document;u&&(n=u.contentDocument),t.root&&(n=window.parent.document);var i=c.createScript(r,{name:e,doc:n});n.head.appendChild(i),o.log("Loading script from ".concat(r," ").concat(u?"in iframe":"")),c.loaded[e]=!0}),10)}else o.warn("Script [".concat(e,"] has been disabled by 'lo-debug-disable-script' in localStorage."))}},loadIntegration:function(e){return c.whitelist[e]={legacy:"".concat(i,"/integrations/integration-").concat(e,"/core/main.js")},c.load(e,{iframe:!1,cacheControl:!1})},createScript:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.doc.createElement("script");return n.async=!0,n.charset="utf-8",n.type="text/javascript",n.src=e,n.crossOrigin="anonymous",t.name&&(n.id="lo-script-".concat(t.name)),n},createFrame:function(e){var t=document.createElement("iframe");return t.id="lo-frame-".concat(e),t.src="about:blank",t.setAttribute("aria-hidden","true"),t.setAttribute("title","Lucky Orange: ".concat(e)),t.style.cssText="display: none !important;",document.body.appendChild(t),t},waitForFrameLoad:function(e,t,n){if(!e)return t();n<1?o.error("Frame never loaded."):("about:blank"===document.location.href?window.parent:window).requestAnimationFrame((function(){var n=e.contentDocument.readyState;"complete"===n||"interactive"===n?t():e.contentWindow.addEventListener("load",(function(e){t()}))}))},isModern:function(){return"noModule"in document.createElement("script")}};t.a=c},50:function(e,t,n){"use strict";t.a=function(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest,i=[],c=[],a={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return c},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var l in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){i.push(t=t.toLowerCase()),c.push([t,n]),a[t]=a[t]?a[t]+","+n:n})),n(u())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(l,t.headers[l]);o.send(t.body||null)}))}},62:function(e,t,n){"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},94:function(e,t,n){e.exports=n(135)}}));