=0){var i=t.split("pid");t=i[0].length?i[0]:null}return["login","register"].indexOf(e)>-1?(r(".sumome-badge-hint").remove(),B.emit("startApp",{app:"login",opts:{view:t,query:n?decodeURIComponent(n):null}})):!L&&"manage"===S&&B.emit("startApp",{app:"launcher",opts:{linkedApp:e,defaultView:(t?t+"/":"")+(n||"")}})}if(window.__smLoaded)return 0===r(".multiple-sumome-warning-toast").length&&function(){var e=r('');e.addClass("sumome-doctype-notice").append("More than one instance of Sumo is attempting to start on this page. ").append("Please check that you are only loading Sumo once per page."),r("").addClass("sumome-doctype-notice-close").click(function(){r(e).remove()}).appendTo(e),r("body").append(e)}(),!1;_=!0,window.__smLoaded=!0;try{f.processShopifyParams()}catch(e){}try{f.autoApplyDiscounts()}catch(e){}f.logExistingUserAsSubscriber({visitorId:C,siteId:b,sumoUrl:sumoUrl}),r.fn.area=function(){return this.innerWidth()*this.innerHeight()},r.fn.aspect=function(){var e=this.innerWidth(),t=this.innerHeight();return t>e?e/t:t/e},r.fn.largest=function(){var e=null,t=0;return r(this).each(function(){var n=r(this).aspect(),i=r(this).area()*n;i>t&&(t=i,e=r(this))}),e},r.Path.map("#/sumome/app/:app_id(/)").to(t),r.Path.map("#/sumome/app/:app_id/:path(/)").to(t),r.Path.map("#/sumome/app/:app_id/:path(/*query)").to(t),"manage"===S?(r.Path.map("#/:app_id(/)").to(t),r.Path.map("#/:app_id/:path(/)").to(t),r.Path.map("#/:app_id/:path(/*query)").to(t)):function(){var e=window.location.href,t=void 0;setInterval(function(){t=window.location.href,e!==t&&(B.emit("event",{event:"pageview",href:t,appId:"2d1fffc9-378f-4b61-ac79-2dc8a077b827"}),e=window.location.href)},1200)}(),r(window).on("resize",function(e){B.emit("resize")}),window.addEventListener&&window.addEventListener("sumome",function(e){e&&e.detail&&"launch"===e.detail.type&&(k?(I=!0,k.triggerHandler("click")):B.emit("startApp","launcher"))}),r("body").keydown(function(e){var t=[83,85,77,79,77,69,38],n=[83,85,77,79,38];e.which===t[j.length]?(j.push(e.which),j.length===t.length&&(j=[],k?(I=!0,k.triggerHandler("click")):B.emit("openManagePage"))):e.which===n[j.length]?(j.push(e.which),j.length===n.length&&(j=[],k?(I=!0,k.triggerHandler("click")):B.emit("openManagePage"))):j=[]}),r("#sumome-jquery-iframe").hide(),r("#sumome-jquery-iframe").on("show",function(){this.hide()}),"location"in window&&"search"in window.location&&window.location.search.indexOf("smdebug")>=0&&(window.__smDebug=!0,window.__sm$=r,window.__smArticles=s),r.support.cors=!0;var n={href:window.location.href||null,ref:document.referrer||null};C&&(n.visitor_id=C),b&&(n.site_id=b),S&&(n.mode=S),O&&(n.platform=O);var i=l.getQueryVariable("sumotoken");r.ajax(r.extend(g(r.cookie("__smToken"),i),{url:sumoUrl+"/api/load/",data:n,error:function e(t){B.emit("removeCookie","__smUser")},success:function e(t){for(var n=!1,i=["hint","siteId","siteRegistered","badgeLocation","unreadNotificationCount","hasSumoMePro","access","geoLocation","ipAddress","views","tours","clientSites","gravatarHash","promptedShopifyReview","activatedAt","platform","services","isShopifyBilling","siteName","siteHref"],o=0;o')),H.tierProductIds="tierProductIds"in t?t.tierProductIds:[],H.magicPassword=t&&t.magicPassword,t.success){t&&"token"in t&&t.token&&(H.sessionId=t.token,r.cookie("__smToken",t.token,{expires:365,path:"/"})),t&&"user"in t&&t.user?(H.user=t.user,H.role=t.role,r.cookie("__smUser",t.user,{expires:365,path:"/"}),"manage"===S||"login"in t&&t.login||t.unreadNotificationCount>0?(B.emit("beforeLogin","siteCreated"in t&&t.siteCreated),("manage"!==S||L)&&B.emit("startApp","control")):(D=!0,F()),B.emit("checkCompatibilityMode")):(B.emit("removeCookie","__smUser"),F()),t&&"apps"in t&&(H.apps=t.apps),t&&"publicApps"in t&&(H.publicApps=t.publicApps);for(var a=!1,o=0;o1&&(w=r([]));var x=[];w.each(function(){this.__url&&x.push(this.__url)}),m.shareService=!0,m.href=y,m.urls=x}-1!==t.services.indexOf(HIGHLIGHTER_APP_ID)&&(m.highlighterService=!0,m.pathname=location.pathname),-1!==t.services.indexOf(GOOGLE_ANALYTICS_APP_ID)&&(m.googleAnalyticsService=!0),-1!==t.services.indexOf(HEAT_MAPS_APP_ID)&&(m.heatMapsStatus=!0,m.user_id=H.user,m.path=window.location.pathname+window.location.search),-1!==t.services.indexOf(SCROLL_BOX_APP_ID)&&(m.scrollBoxService=!0,m.cookieKeysOnly=Object.keys(r.cookie()),m.width=Math.min(window.screen.availWidth||r(window).width(),r(window).width())),r.ajax({type:"POST",dataType:"json",beforeSend:function e(t){t.setRequestHeader("X-Sumo-Auth",r.cookie("__smToken"))},url:H.sumoUrl+"/services",data:m,xhrFields:{withCredentials:!1},crossDomain:!0}).done(function(e){H.serviceData=e;for(var n=0;n1?k[1]:null,M=A.length>2?k[2]:null;if(-1!==["content-analytics","heatmaps"].indexOf(P)&&M){if(M){var C=function e(){B.emit("2c40add5-3570-45d7-8212-8fc2942f7f74/campaign/view",M)},I=function e(){B.emit("a25489e9-848c-4356-97ff-161b0852c509/campaign/view",M)};switch(P){case"heatmaps":C(),B.on("heatmaps/widget/started",C);break;case"content-analytics":I(),B.on("content-analytics/widget/started",I)}}}else B.emit("openManagePage",{sumopath:A})}}else"manage"!==S||L||E&&!1!==/#\/.+/.test(E)||(R.unshift("launcher"),B.emit("startApp","control"));r.Path.listen()}}))},V=new Date,$=3e3;return r(document).ready(function(){_||G()}),v(),B}),sumo.require(["es6!sumo-core"],function(){}),sumo.define("sumome",function(){}),sumo.require.config({baseUrl:baseUrl+"js",skipDataMain:!0,waitSeconds:30,paths:{scaleApp:"sumome","control/app":"sumome-control","app_store/app":"sumome-appstore","login/app":"sumome-control"}}),sumo.requirejs.onError=function(e){if("timeout"!==e.requireType)throw e},sumo.require(["sumome"])}(void 0,void 0);