<!-- 2025-08-12T09:54:34.6136604Z -->
<style>.shoplift-hide { opacity: 0 !important; }</style>
<style id="sl-preview-bar-hide">#preview-bar-iframe, #PBarNextFrameWrapper { display: none !important; }</style>
<script type="text/javascript">(function(rootPath, template, themeRole, themeId, isThemePreview){ /* Generated on 2025-09-02T18:00:00.8717650Z */var G=Object.defineProperty;var j=(g,p,u)=>p in g?G(g,p,{enumerable:!0,configurable:!0,writable:!0,value:u}):g[p]=u;var c=(g,p,u)=>j(g,typeof p!="symbol"?p+"":p,u);(function(){"use strict";var g=" daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?: ya| yandex|^job|inapp;) ?)search|(?<!(?:lib))http|(?<![hg]m)score|@[a-z][\\w-]+\\.|\\(\\)|\\.com|\\b\\d{13}\\b|^<|^[\\w \\.\\-\\(?:\\):]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d \\(compatible;?\\)$|^mozilla/\\d\\.\\d \\w*$|^navermailapp|^netsurf|^offline|^owler|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^valid|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|admin|analyzer|archive|ask jeeves/teoma|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check|chrome-lighthouse|chromeframe|classifier|clean|cloud|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|feed|firephp|gomezagent|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|images|insight|inspect|iplabel|ips-agent|java(?!;)|library|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|reputation|resolver|retriever|rexx;|rigor|rss\\b|scan|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|synapse|synthetic|tools|torrent|trace|transcoder|url|virtuoso|wappalyzer|watch|webglance|webkit2png|whatcms/|zgrab",p=/bot|spider|crawl|http|lighthouse/i,u;function C(){if(u instanceof RegExp)return u;try{u=new RegExp(g,"i")}catch{u=p}return u}function P(r){return!!r&&C().test(r)}class v{constructor(){c(this,"timestamp");this.timestamp=new Date}}class E extends v{constructor(e,s,i){super();c(this,"type");c(this,"testId");c(this,"hypothesisId");this.type=3,this.testId=e,this.hypothesisId=s,this.timestamp=i}}class x extends v{constructor(e){super();c(this,"type");c(this,"path");this.type=4,this.path=e}}class H extends v{constructor(e){super();c(this,"type");c(this,"cart");this.type=5,this.cart=e}}class S extends Error{constructor(){super();c(this,"isBot");this.isBot=!0}}function R(r,t,e){for(const s of t.selectors){const i=r.querySelectorAll(s.cssSelector);for(let o=0;o<i.length;o++)e(t.testId,t.hypothesisId)}b(r,t,(s,i,o,n,a)=>a(i,o),e)}function V(r,t,e){for(const s of t.selectors)k(r,t.testId,t.hypothesisId,s,e??(()=>{}));b(r,t,k,e??(()=>{}))}function _(r){return r.urlPatterns.reduce((t,e)=>{switch(e.operator){case"contains":return t+`.*${e}.*`;case"endsWith":return t+`.*${e}`;case"startsWith":return t+`${e}.*`}},"")}function b(r,t,e,s){new MutationObserver(()=>{for(const o of t.selectors)e(r,t.testId,t.hypothesisId,o,s)}).observe(r.documentElement,{childList:!0,subtree:!0})}function k(r,t,e,s,i){const o=r.querySelectorAll(s.cssSelector);for(let n=0;n<o.length;n++){let a=o.item(n);if(a instanceof HTMLElement&&a.dataset.shoplift!==""){a.dataset.shoplift="";for(const l of s.actions.sort(N))a=q(r,s.cssSelector,a,l)}}return o.length>0&&i?(i(t,e),!0):!1}function q(r,t,e,s){switch(s.type){case"innerHtml":e.innerHTML=s.value;break;case"attribute":L(e,s.scope,s.value);break;case"css":F(r,t,s.value);break;case"js":M(r,e,s);break;case"copy":return O(e);case"remove":$(e);break;case"move":D(e,parseInt(s.value));break}return e}function L(r,t,e){r.setAttribute(t,e)}function F(r,t,e){var i;const s=r.createElement("style");s.innerHTML=`${t} { ${e} }`,(i=r.getElementsByTagName("head")[0])==null||i.appendChild(s)}function M(r,t,e){Function("document","element",`use strict; ${e.value}`)(r,t)}function O(r){const t=r.cloneNode(!0);if(!r.parentNode)throw"Can't copy node outside of DOM";return r.parentNode.insertBefore(t,r.nextSibling),t}function $(r){r.remove()}function D(r,t){if(t===0)return;const e=Array.prototype.slice.call(r.parentElement.children).indexOf(r),s=Math.min(Math.max(e+t,0),r.parentElement.children.length-1);r.parentElement.children.item(s).insertAdjacentElement(t>0?"afterend":"beforebegin",r)}function N(r,t){return T(r)-T(t)}function T(r){return r.type==="copy"||r.type==="remove"?0:1}function f(r,t){return typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+(?:Z|[+-]\d+)/.test(t)?new Date(t):t}function w(r,t){return t}class z{constructor(t,e,s,i,o,n,a,l,h,d,m){c(this,"temporarySessionKey","Shoplift_Session");c(this,"essentialSessionKey","Shoplift_Essential");c(this,"analyticsSessionKey","Shoplift_Analytics");c(this,"legacySessionKey");c(this,"cssHideClass");c(this,"testConfigs");c(this,"inactiveTestConfigs");c(this,"testsFilteredByAudience");c(this,"sendPageView");c(this,"shopliftDebug");c(this,"useGtag");c(this,"getCountryTimeout");c(this,"state");c(this,"shopifyAnalyticsId");c(this,"cookie",document.cookie);c(this,"isSyncing",!1);c(this,"isSyncingGA",!1);c(this,"fetch");c(this,"localStorageSet");c(this,"localStorageGet");c(this,"sessionStorageSet",window.sessionStorage.setItem.bind(window.sessionStorage));c(this,"sessionStorageGet",window.sessionStorage.getItem.bind(window.sessionStorage));c(this,"urlParams",new URLSearchParams(window.location.search));c(this,"device");c(this,"logHistory");this.shop=t,this.host=e,this.eventHost=s,this.disableReferrerOverride=l,this.logHistory=[],this.legacySessionKey=`SHOPLIFT_SESSION_${this.shop}`,this.cssHideClass=i?"shoplift-hide":"",this.testConfigs=d.map(y=>({...y,startAt:new Date(y.startAt),statusHistory:y.statusHistory.map(A=>({...A,createdAt:new Date(A.createdAt)}))})),this.inactiveTestConfigs=m,this.sendPageView=!!o,this.shopliftDebug=n===!0,this.useGtag=a===!0,this.fetch=window.fetch.bind(window),this.localStorageSet=window.localStorage.setItem.bind(window.localStorage),this.localStorageGet=window.localStorage.getItem.bind(window.localStorage);const I=this.getDeviceType();this.device=I!=="tablet"?I:"mobile",this.state=this.loadState(),this.shopifyAnalyticsId=this.getShopifyAnalyticsId(),this.testsFilteredByAudience=d.filter(y=>y.status=="active"),this.getCountryTimeout=h===1000?1e3:h,this.log("State Loaded",JSON.stringify(this.state))}async init(){var t;try{if(this.log("Shoplift script initializing"),window.Shopify&&window.Shopify.designMode){this.log("Skipping script for design mode");return}if(window.location.href.includes("slScreenshot=true")){this.log("Skipping script for screenshot");return}if(window.location.hostname.endsWith(".edgemesh.com")){this.log("Skipping script for preview");return}if(window.location.href.includes("isShopliftMerchant")){const s=this.urlParams.get("isShopliftMerchant")==="true";this.log("Setting merchant session to %s",s),this.state.temporary.isMerchant=s,this.persistTemporaryState()}if(this.state.temporary.isMerchant){this.log("Skipping script for merchant"),(t=document.querySelector("#sl-preview-bar-hide"))==null||t.remove();return}if(P(navigator.userAgent))return;if(navigator.userAgent.includes("Chrome/118")){this.log("Random: %o",[Math.random(),Math.random(),Math.random()]);const s=await this.makeRequest({url:`${this.eventHost}/api/v0/events/ip`,method:"get"}).then(i=>i==null?void 0:i.json());this.log(`IP: ${s}`),this.makeRequest({url:`${this.eventHost}/api/v0/logs`,method:"post",data:JSON.stringify(this.debugState(),w)}).catch()}if(this.shopifyAnalyticsId=this.getShopifyAnalyticsId(),this.monitorConsentChange(),this.checkForThemePreview())return;if(!this.disableReferrerOverride&&this.state.temporary.originalReferrer!=null){this.log(`Overriding referrer from '${document.referrer}' to '${this.state.temporary.originalReferrer}'`);const s=this.state.temporary.originalReferrer;delete this.state.temporary.originalReferrer,this.persistTemporaryState(),Object.defineProperty(document,"referrer",{get:()=>s,enumerable:!0,configurable:!0})}if(await this.refreshVisitor(this.shopifyAnalyticsId),await this.handleVisitorTest()){this.log("Redirecting for visitor test");return}this.setShoplift(),this.showPage(),await this.finalize(),console.log("SHOPLIFT SCRIPT INITIALIZED!")}catch(e){if(e instanceof S)return;throw e}finally{typeof window.shoplift!="object"&&this.setShopliftStub()}}async finalize(){const t=await this.getCartState();t!==null&&this.queueCartUpdate(t),this.pruneStateAndSave(),await this.syncAllEvents()}setShoplift(){this.log("Setting up public API");const e=this.urlParams.get("slVariant")==="true",s=e?null:this.urlParams.get("slVariant");window.shoplift={isHypothesisActive:async i=>{if(this.log("Script checking variant for hypothesis '%s'",i),e)return this.log("Forcing variant for hypothesis '%s'",i),!0;if(s!==null)return this.log("Forcing hypothesis '%s'",s),i===s;const o=this.testConfigs.find(a=>a.hypotheses.some(l=>l.id===i));if(!o)return this.log("No test found for hypothesis '%s'",i),!1;const n=this.state.essential.visitorTests.find(a=>a.testId===o.id);return n?(this.log("Active visitor test found",i),n.hypothesisId===i):(await this.manuallySplitVisitor(o),this.testConfigs.some(a=>a.hypotheses.some(l=>l.id===i&&this.state.essential.visitorTests.some(h=>h.hypothesisId===l.id))))},setAnalyticsConsent:async i=>{await this.onConsentChange(i,!0)},getVisitorData:()=>({visitor:this.state.analytics.visitor,visitorTests:this.state.essential.visitorTests.filter(i=>!i.isInvalid).map(i=>{const{shouldSendToGa:o,...n}=i;return n})})}}setShopliftStub(){this.log("Setting up stubbed public API");const e=this.urlParams.get("slVariant")==="true",s=e?null:this.urlParams.get("slVariant");window.shoplift={isHypothesisActive:i=>Promise.resolve(e||i===s),setAnalyticsConsent:()=>Promise.resolve(),getVisitorData:()=>({visitor:null,visitorTests:[]})}}async manuallySplitVisitor(t){this.log("Starting manual split for test '%s'",t.id),await this.handleVisitorTest([t]),this.saveState(),this.syncAllEvents()}async handleVisitorTest(t){await this.filterTestsByAudience(this.testConfigs,this.state.analytics.visitor??this.buildBaseVisitor(),this.state.essential.visitorTests);let e=t?t.filter(a=>this.testsFilteredByAudience.some(l=>l.id===a.id)):this.testsForUrl(this.testsFilteredByAudience);if(e.length===0)return this.log("No tests found"),!1;this.log("Checking for existing visitor test on page");const s=this.getCurrentVisitorHypothesis(e);if(s){this.log("Found current visitor test");const a=this.considerRedirect(s);return a&&(this.log("Redirecting for current visitor test"),this.redirect(s)),a}this.log("No active test relation for test page");const i=this.testsForUrl(this.inactiveTestConfigs.filter(a=>this.testIsPaused(a)&&a.hypotheses.some(l=>this.state.essential.visitorTests.some(h=>h.hypothesisId===l.id)))).map(a=>a.id);if(i.length>0)return this.log("Visitor has paused tests for test page, skipping test assignment: %o",i),!1;if(this.hasThemeAndOtherTestTypes(this.testsFilteredByAudience)){this.log("Store has both theme and non-theme tests");const a=this.visitorActiveTestType();this.log("Current visitor test type is '%s'",a);let l;switch(a){case"templateOrUrlRedirect":this.log("Filtering to non-theme tests"),l=d=>d!=="theme";break;case"theme":this.log("Filtering to theme tests"),l=d=>d==="theme";break;case null:l=Math.random()>.5?(this.log("Filtering to theme tests"),d=>d==="theme"):(this.log("Filtering to non-theme tests"),d=>d!=="theme");break}const h=e.filter(d=>d.hypotheses.every(m=>!m.isControl||!l(m.type)));this.log(`Blocking visitor from being assigned to filtered test IDs: ["${h.map(d=>d.id).join('", "')}"]`),this.state.essential.visitorTests.push(...h.map(d=>({createdAt:new Date,testId:d.id,hypothesisId:null,isThemeTest:d.hypotheses.some(m=>m.type==="theme"),shouldSendToGa:!1,isSaved:!0,isInvalid:!0,themeId:void 0}))),e=e.filter(d=>d.hypotheses.some(m=>m.isControl&&l(m.type)))}if(e.length===0)return this.log("No tests found"),!1;const o=e[Math.floor(Math.random()*e.length)],n=this.pickHypothesis(o);if(n){this.log("Adding local visitor to test '%s', hypothesis '%s'",o.id,n.id),this.queueAddVisitorToTest(o.id,n);const a=this.considerRedirect(n);return a&&(this.log("Redirecting for new test"),this.redirect(n)),a}return this.log("No hypothesis found"),this.includeInDomTests(),!1}includeInDomTests(){const t=this.getDomTestsForCurrentUrl(),e=this.getVisitorDomHypothesis(t);for(const s of t){this.log("Evaluating dom test '%s'",s.id);const o=e.find(n=>s.hypotheses.some(a=>n.id===a.id))??this.pickHypothesis(s);if(!o){this.log("Failed to pick hypothesis for test");continue}if(o.isControl){this.log("Test has no dom actions to take, detect selector for test inclusion");const n=s.hypotheses.filter(a=>a.id!==o.id).flatMap(a=>{var l;return((l=a.domSelectors)==null?void 0:l.map(h=>({...h,testId:s.id})))??[]});n.length>0&&R(document,{testId:s.id,hypothesisId:o.id,selectors:n},a=>{this.queueAddVisitorToTest(a,o),this.syncAllEvents()});continue}if(!o.domSelectors||o.domSelectors.length===0){this.log("No selectors found, skipping hypothesis");continue}this.log("Watching for selectors"),V(document,{testId:s.id,hypothesisId:o.id,selectors:o.domSelectors},n=>{this.queueAddVisitorToTest(n,o),this.syncAllEvents()})}}considerRedirect(t){if(this.log("Considering redirect for hypothesis '%s'",t.id),t.isControl)return this.log("Skipping redirect for control"),!1;if(t.type==="basicScript"||t.type==="manualScript")return this.log("Skipping redirect for script test"),!1;const e=this.state.essential.visitorTests.find(n=>n.hypothesisId===t.id),s=new URL(window.location.toString()),o=new URLSearchParams(window.location.search).get("view");if(t.type==="theme"){if(!(t.themeId===themeId)){if(this.log("Theme id '%s' is not hypothesis theme ID '%s'",t.themeId,themeId),e&&e.themeId!==t.themeId&&(e.themeId===themeId||!this.isThemePreview()))this.log("On old theme, redirecting and updating local visitor"),e.themeId=t.themeId;else if(this.isThemePreview())return this.log("On non-test theme, skipping redirect"),!1;return this.log("Hiding page to redirect for theme test"),this.hidePage(),!0}return!1}else if(t.type!=="dom"&&t.affix!==template.suffix&&t.affix!==o||t.redirectPath&&!s.pathname.endsWith(t.redirectPath))return this.log("Hiding page to redirect for template test"),this.hidePage(),!0;return this.log("Not redirecting"),!1}redirect(t){if(this.log("Redirecting to hypothesis '%s'",t.id),t.isControl)return;const e=new URL(window.location.toString());if(e.searchParams.delete("view"),t.redirectPath){const s=RegExp("^(/w{2}-w{2})/").exec(e.pathname);if(s&&s.length>1){const i=s[1];e.pathname=`${i}${t.redirectPath}`}else e.pathname=t.redirectPath}else t.type==="theme"?(e.searchParams.set("_ab","0"),e.searchParams.set("_fd","0"),e.searchParams.set("_sc","1"),e.searchParams.set("preview_theme_id",t.themeId.toString())):t.type!=="urlRedirect"&&e.searchParams.set("view",t.affix);this.queueRedirect(e)}async refreshVisitor(t){if(t===null||!this.state.essential.isFirstLoad||!this.testConfigs.some(s=>s.visitorOption!=="all"))return;this.log("Refreshing visitor"),this.hidePage();const e=await this.getVisitor(t);e&&e.id&&this.updateLocalVisitor(e)}buildBaseVisitor(){return{shopifyAnalyticsId:this.shopifyAnalyticsId,device:this.device,country:null,...this.state.essential.initialState}}getInitialState(){const t=this.getUTMValue("utm_source")??"",e=this.getUTMValue("utm_medium")??"",s=this.getUTMValue("utm_campaign")??"",i=this.getUTMValue("utm_content")??"",o=window.document.referrer,n=this.device;return{createdAt:new Date,utmSource:t,utmMedium:e,utmCampaign:s,utmContent:i,referrer:o,device:n}}checkForThemePreview(){var t,e;return this.log("Checking for theme preview"),window.location.hostname.endsWith(".shopifypreview.com")?(this.log("on shopify preview domain"),this.clearThemeBar(!0,!1,this.state),(t=document.querySelector("#sl-preview-bar-hide"))==null||t.remove(),!1):this.isThemePreview()?this.state.essential.visitorTests.some(s=>s.isThemeTest&&s.hypothesisId!=null&&this.getHypothesis(s.hypothesisId)&&s.themeId===themeId)?(this.log("On active theme test, removing theme bar"),this.clearThemeBar(!1,!0,this.state),!1):this.state.essential.visitorTests.some(s=>s.isThemeTest&&s.hypothesisId!=null&&!this.getHypothesis(s.hypothesisId)&&s.themeId===themeId)?(this.log("Visitor is on an inactive theme test, redirecting to main theme"),this.redirectToMainTheme(),!0):this.state.essential.isFirstLoad?(this.log("No visitor found on theme preview, redirecting to main theme"),this.redirectToMainTheme(),!0):this.inactiveTestConfigs.some(s=>s.hypotheses.some(i=>i.themeId===themeId))?(this.log("Current theme is an inactive theme test, redirecting to main theme"),this.redirectToMainTheme(),!0):this.testConfigs.some(s=>s.hypotheses.some(i=>i.themeId===themeId))?(this.log("Falling back to clearing theme bar"),this.clearThemeBar(!1,!0,this.state),!1):(this.log("No tests on current theme, skipping script"),this.clearThemeBar(!0,!1,this.state),(e=document.querySelector("#sl-preview-bar-hide"))==null||e.remove(),!0):(this.log("Not on theme preview"),this.clearThemeBar(!0,!1,this.state),!1)}redirectToMainTheme(){this.hidePage();const t=new URL(window.location.toString());t.searchParams.set("preview_theme_id",""),this.queueRedirect(t)}testsForUrl(t){const e=new URL(window.location.href),s=this.typeFromTemplate();return t.filter(i=>i.hypotheses.some(o=>o.type!=="dom"&&(o.isControl&&o.type===s&&o.affix===template.suffix||o.type==="theme"||o.isControl&&o.type==="urlRedirect"&&o.redirectPath&&e.pathname.endsWith(o.redirectPath)||o.type==="basicScript"))&&(i.ignoreTestViewParameterEnforcement||!e.searchParams.has("view")||i.hypotheses.map(o=>o.affix).includes(e.searchParams.get("view")??"")))}domTestsForUrl(t){const e=new URL(window.location.href);return t.filter(s=>s.hypotheses.some(i=>i.type==="dom"&&i.domSelectors&&i.domSelectors.some(o=>new RegExp(_(o)).test(e.toString()))))}async filterTestsByAudience(t,e,s){const i=[];let o=e.country;!o&&t.some(n=>n.requiresCountry&&!s.some(a=>a.testId===n.id))&&(this.log("Hiding page to check geoip"),this.hidePage(),o=await this.makeJsonRequest({method:"get",url:`${this.eventHost}/api/v0/visitors/get-country`,signal:AbortSignal.timeout(this.getCountryTimeout)}).catch(n=>(this.log("Error getting country",n),null)));for(const n of t){if(this.log("Checking audience for test '%s'",n.id),this.state.essential.visitorTests.some(h=>h.testId===n.id&&h.hypothesisId==null)){console.log(`Skipping blocked test '${n.id}'`);continue}const a=this.visitorCreatedDuringTestActive(n.statusHistory);(s.some(h=>h.testId===n.id&&(n.device==="all"||n.device===e.device&&n.device===this.device))||this.isTargetAudience(n,e,a,o))&&(this.log("Visitor is in audience for test '%s'",n.id),i.push(n))}this.testsFilteredByAudience=i}isTargetAudience(t,e,s,i){const o=this.getChannel(e);return(t.device==="all"||t.device===e.device&&t.device===this.device)&&(t.visitorOption==="all"||t.visitorOption==="new"&&s||t.visitorOption==="returning"&&!s)&&(t.targetAudiences.length===0||t.targetAudiences.reduce((n,a)=>n||a.reduce((l,h)=>l&&h(e,s,o,i),!0),!1))}visitorCreatedDuringTestActive(t){let e="";for(const s of t){if(this.state.analytics.visitor!==null&&this.state.analytics.visitor.createdAt<s.createdAt||this.state.essential.initialState.createdAt<s.createdAt)break;e=s.status}return e==="active"}getDomTestsForCurrentUrl(){return this.domTestsForUrl(this.testsFilteredByAudience)}getCurrentVisitorHypothesis(t){return t.flatMap(e=>e.hypotheses).find(e=>e.type!=="dom"&&this.state.essential.visitorTests.some(s=>s.hypothesisId===e.id))}getVisitorDomHypothesis(t){return t.flatMap(e=>e.hypotheses).filter(e=>e.type==="dom"&&this.state.essential.visitorTests.some(s=>s.hypothesisId===e.id))}getHypothesis(t){return this.testConfigs.filter(e=>e.hypotheses.some(s=>s.id===t)).map(e=>e.hypotheses.find(s=>s.id===t))[0]}hasThemeTest(t){return t.some(e=>e.hypotheses.some(s=>s.type==="theme"))}hasTestThatIsNotThemeTest(t){return t.some(e=>e.hypotheses.some(s=>s.type!=="theme"&&s.type!=="dom"))}hasThemeAndOtherTestTypes(t){return this.hasThemeTest(t)&&this.hasTestThatIsNotThemeTest(t)}testIsPaused(t){return t.status==="paused"||t.status==="incompatible"||t.status==="suspended"}visitorActiveTestType(){const t=this.state.essential.visitorTests.filter(e=>this.testConfigs.some(s=>s.hypotheses.some(i=>i.id==e.hypothesisId)));return t.length===0?null:t.some(e=>e.isThemeTest)?"theme":"templateOrUrlRedirect"}pickHypothesis(t){let e=Math.random();const s=t.hypotheses.reduce((o,n)=>o+n.visitorCount,0);return t.hypotheses.sort((o,n)=>o.isControl?n.isControl?0:-1:n.isControl?1:0).reduce((o,n)=>{if(o!==null)return o;const l=t.hypotheses.reduce((h,d)=>h&&d.visitorCount>20,!0)?n.visitorCount/s-n.trafficPercentage:0;return e<=n.trafficPercentage-l?n:(e-=n.trafficPercentage,null)},null)}typeFromTemplate(){switch(template.type){case"collection-list":return"collectionList";case"page":return"landing";case"article":case"blog":case"cart":case"collection":case"index":case"product":case"search":return template.type;default:return null}}queueRedirect(t){this.saveState(),this.disableReferrerOverride||(this.log(`Saving temporary referrer override '${document.referrer}'`),this.state.temporary.originalReferrer=document.referrer,this.persistTemporaryState()),window.setTimeout(()=>window.location.assign(t),0),window.setTimeout(()=>void this.syncAllEvents(),2e3)}async syncAllEvents(){const t=async()=>{if(this.isSyncing){window.setTimeout(()=>void(async()=>await t())(),500);return}try{this.isSyncing=!0,await this.syncEvents(),this.syncGAEvents()}finally{this.isSyncing=!1}};await t()}async syncEvents(){var s,i;if(!this.state.essential.consentApproved||!this.shopifyAnalyticsId||this.state.analytics.queue.length===0)return;const t=this.state.analytics.queue.length,e=this.state.analytics.queue.splice(0,t);this.log("Syncing %s events",t);try{const o={shop:this.shop,visitorDetails:{shopifyAnalyticsId:this.shopifyAnalyticsId,device:((s=this.state.analytics.visitor)==null?void 0:s.device)??this.device,country:((i=this.state.analytics.visitor)==null?void 0:i.country)??null,...this.state.essential.initialState},events:this.state.essential.visitorTests.filter(a=>!a.isInvalid&&!a.isSaved&&a.hypothesisId!=null).map(a=>new E(a.testId,a.hypothesisId,a.createdAt)).concat(e)};await this.sendEvents(o);const n=await this.getVisitor(this.shopifyAnalyticsId);n!==null&&this.updateLocalVisitor(n);for(const a of this.state.essential.visitorTests.filter(l=>!l.isInvalid&&!l.isSaved))a.isSaved=!0}catch{this.state.analytics.queue.splice(0,0,...e)}finally{this.saveState()}}syncGAEvents(){if(!this.useGtag){this.log("UseGtag is false — skipping GA Events");return}if(!this.state.essential.consentApproved){this.log("Consent not approved — skipping GA Events");return}if(this.isSyncingGA){this.log("Already syncing GA - skipping GA events");return}const t=this.state.essential.visitorTests.filter(e=>e.shouldSendToGa);if(t.length===0){this.log("No GA Events to sync");return}this.isSyncingGA=!0,this.log("Syncing %s GA Events",t.length),Promise.allSettled(t.map(e=>this.sendGtagEvent(e))).then(()=>this.log("All gtag events sent")).finally(()=>this.isSyncingGA=!1)}sendGtagEvent(t){return new Promise(e=>{this.log("Sending GA Event for test %s, hypothesis %s",t.testId,t.hypothesisId);const s=()=>{this.log("GA acknowledged event for hypothesis %s",t.hypothesisId),t.shouldSendToGa=!1,this.persistEssentialState(),e()},i={exp_variant_string:`SL-${t.testId}-${t.hypothesisId}`};this.shopliftDebug&&Object.assign(i,{debug_mode:!0});function o(n,a,l){window.dataLayer=window.dataLayer||[],window.dataLayer.push(arguments)}o("event","experience_impression",{...i,event_callback:s})})}updateLocalVisitor(t){let e;({visitorTests:e,...this.state.analytics.visitor}=t);for(const s of this.state.essential.visitorTests.filter(i=>!e.some(o=>o.testId===i.testId)))s.isSaved=!0,s.isInvalid=!0;for(const s of e)this.state.essential.visitorTests.some(o=>o.testId===s.testId)||this.state.essential.visitorTests.push(s);this.state.analytics.visitor.storedAt=new Date}async getVisitor(t){try{return await this.makeJsonRequest({method:"get",url:`${this.eventHost}/api/v0/visitors/by-key/${this.shop}/${t}`})}catch{return null}}async sendEvents(t){await this.makeRequest({method:"post",url:`${this.eventHost}/api/v0/events`,data:JSON.stringify(t)})}getUTMValue(t){const s=decodeURIComponent(window.location.search.substring(1)).split("&");for(let i=0;i<s.length;i++){const o=s[i].split("=");if(o[0]===t)return o[1]||null}return null}hidePage(){this.log("Hiding page"),this.cssHideClass&&!window.document.documentElement.classList.contains(this.cssHideClass)&&(window.document.documentElement.classList.add(this.cssHideClass),setTimeout(this.removeAsyncHide(this.cssHideClass),2e3))}showPage(){this.cssHideClass&&this.removeAsyncHide(this.cssHideClass)()}getDeviceType(){function t(){let s=!1;return function(i){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(s=!0)}(navigator.userAgent||navigator.vendor),s}function e(){let s=!1;return function(i){(/android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(s=!0)}(navigator.userAgent||navigator.vendor),s}return t()?"mobile":e()?"tablet":"desktop"}removeAsyncHide(t){return()=>{t&&window.document.documentElement.classList.remove(t)}}async getCartState(){try{let t=await this.makeJsonRequest({method:"get",url:`${window.location.origin}/cart.js`});return t===null||(t.note===null&&(t=await this.makeJsonRequest({method:"post",url:`${window.location.origin}/cart/update.js`,data:JSON.stringify({note:""})})),t==null)?null:{token:t.token,total_price:t.total_price,total_discount:t.total_discount,currency:t.currency,items_subtotal_price:t.items_subtotal_price,items:t.items.map(e=>({quantity:e.quantity,variant_id:e.variant_id,key:e.key,price:e.price,final_line_price:e.final_line_price,sku:e.sku,product_id:e.product_id}))}}catch(t){return this.log("Error sending cart info",t),null}}async makeJsonRequest(t){const e=await this.makeRequest(t);return e===null?null:JSON.parse(await e.text(),f)}async makeRequest(t){const{url:e,method:s,headers:i,data:o,signal:n}=t,a=new Headers;if(i)for(const h in i)a.append(h,i[h]);(!i||!i.Accept)&&a.append("Accept","application/json"),(!i||!i["Content-Type"])&&a.append("Content-Type","application/json"),(this.eventHost.includes("ngrok.io")||this.eventHost.includes("ngrok-free.app"))&&a.append("ngrok-skip-browser-warning","1234");const l=await this.fetch(e,{method:s,headers:a,body:o,signal:n});if(!l.ok){if(l.status===204)return null;if(l.status===422){const h=await l.json();if(typeof h<"u"&&h.isBot)throw new S}throw new Error(`Error sending shoplift request ${l.status}`)}return l}queueAddVisitorToTest(t,e){this.state.essential.visitorTests.some(s=>s.testId===t)||this.state.essential.visitorTests.push({createdAt:new Date,testId:t,hypothesisId:e.id,isThemeTest:e.type==="theme",themeId:e.themeId,isSaved:!1,isInvalid:!1,shouldSendToGa:!0})}queueCartUpdate(t){this.queueEvent(new H(t))}queuePageView(t){this.queueEvent(new x(t))}queueEvent(t){!this.state.essential.consentApproved&&this.state.essential.hasConsentInteraction||this.state.analytics.queue.length>10||this.state.analytics.queue.push(t)}legacyGetLocalStorageVisitor(){const t=this.localStorageGet(this.legacySessionKey);if(t)try{return JSON.parse(t,f)}catch{}return null}pruneStateAndSave(){this.state.essential.visitorTests=this.state.essential.visitorTests.filter(t=>this.testConfigs.some(e=>e.id==t.testId)||this.inactiveTestConfigs.filter(e=>this.testIsPaused(e)).some(e=>e.id===t.testId)),this.saveState()}saveState(){this.persistEssentialState(),this.persistAnalyticsState()}loadState(){const t=this.loadAnalyticsState(),e={analytics:t,essential:this.loadEssentialState(t),temporary:this.loadTemporaryState()},s=this.legacyGetLocalStorageVisitor(),i=this.legacyGetCookieVisitor(),o=[s,i].filter(n=>n!==null).sort((n,a)=>+a.storedAt-+n.storedAt)[0];return e.analytics.visitor===null&&o&&({visitorTests:e.essential.visitorTests,...e.analytics.visitor}=o,e.essential.isFirstLoad=!1,e.essential.initialState={createdAt:o.createdAt,referrer:o.referrer,utmCampaign:o.utmCampaign,utmContent:o.utmContent,utmMedium:o.utmMedium,utmSource:o.utmSource,device:o.device},this.deleteCookie("SHOPLIFT"),this.deleteLocalStorage(this.legacySessionKey)),!e.essential.consentApproved&&e.essential.hasConsentInteraction&&this.deleteLocalStorage(this.analyticsSessionKey),e}loadEssentialState(t){var a;const e=this.loadLocalStorage(this.essentialSessionKey),s=this.loadCookie(this.essentialSessionKey),i=this.getInitialState();(a=t.visitor)!=null&&a.device&&(i.device=t.visitor.device);const o={timestamp:new Date,consentApproved:!1,hasConsentInteraction:!1,debugMode:!1,initialState:i,visitorTests:[],isFirstLoad:!0},n=[e,s].filter(l=>l!==null).sort((l,h)=>+h.timestamp-+l.timestamp)[0]??o;return n.initialState||(t.visitor!==null?n.initialState=t.visitor:(n.initialState=i,n.initialState.createdAt=n.timestamp)),n}loadAnalyticsState(){const t=this.loadLocalStorage(this.analyticsSessionKey),e=this.loadCookie(this.analyticsSessionKey),s={timestamp:new Date,visitor:null,queue:[]},i=[t,e].filter(o=>o!==null).sort((o,n)=>+n.timestamp-+o.timestamp)[0]??s;return i.queue.length===0&&t&&t.queue.length>1&&(i.queue=t.queue),i}loadTemporaryState(){const t=this.sessionStorageGet(this.temporarySessionKey),e=t?JSON.parse(t,f):null,s=this.loadCookie(this.temporarySessionKey);return e??s??{isMerchant:!1,timestamp:new Date}}persistEssentialState(){this.log("Persisting essential state"),this.state.essential.isFirstLoad=!1,this.state.essential.timestamp=new Date,this.persistLocalStorageState(this.essentialSessionKey,this.state.essential),this.persistCookieState(this.essentialSessionKey,this.state.essential)}persistAnalyticsState(){this.log("Persisting analytics state"),this.state.essential.consentApproved&&(this.state.analytics.timestamp=new Date,this.persistLocalStorageState(this.analyticsSessionKey,this.state.analytics),this.persistCookieState(this.analyticsSessionKey,{...this.state.analytics,queue:[]}))}persistTemporaryState(){this.log("Setting temporary session state"),this.state.temporary.timestamp=new Date,this.sessionStorageSet(this.temporarySessionKey,JSON.stringify(this.state.temporary)),this.persistCookieState(this.temporarySessionKey,this.state.temporary,!0)}loadLocalStorage(t){const e=this.localStorageGet(t);if(e===null)return null;try{return JSON.parse(e,f)}catch{return null}}loadCookie(t){const e=this.getCookie(t);if(e===null)return null;try{return JSON.parse(e,f)}catch{return null}}persistLocalStorageState(t,e){this.localStorageSet(t,JSON.stringify(e))}persistCookieState(t,e,s=!1){const i=JSON.stringify(e),o=s?"":`expires=${new Date(new Date().getTime()+864e5*365).toUTCString()};`;document.cookie=`${t}=${i};domain=.${window.location.hostname};path=/;SameSite=Strict;${o}`}deleteCookie(t){const e=new Date(0).toUTCString();document.cookie=`${t}=;domain=.${window.location.hostname};path=/;expires=${e};`}deleteLocalStorage(t){window.localStorage.removeItem(t)}getChannel(t){var s;return((s=[{"name":"cross-network","test":(v) => new RegExp(".*cross-network.*", "i").test(v.utmCampaign)},{"name":"direct","test":(v) => v.utmSource === "" && v.utmMedium === ""},{"name":"paid-shopping","test":(v) => (new RegExp("^(?:Google|IGShopping|aax-us-east\.amazon-adsystem\.com|aax\.amazon-adsystem\.com|alibaba|alibaba\.com|amazon|amazon\.co\.uk|amazon\.com|apps\.shopify\.com|checkout\.shopify\.com|checkout\.stripe\.com|cr\.shopping\.naver\.com|cr2\.shopping\.naver\.com|ebay|ebay\.co\.uk|ebay\.com|ebay\.com\.au|ebay\.de|etsy|etsy\.com|m\.alibaba\.com|m\.shopping\.naver\.com|mercadolibre|mercadolibre\.com|mercadolibre\.com\.ar|mercadolibre\.com\.mx|message\.alibaba\.com|msearch\.shopping\.naver\.com|nl\.shopping\.net|no\.shopping\.net|offer\.alibaba\.com|one\.walmart\.com|order\.shopping\.yahoo\.co\.jp|partners\.shopify\.com|s3\.amazonaws\.com|se\.shopping\.net|shop\.app|shopify|shopify\.com|shopping\.naver\.com|shopping\.yahoo\.co\.jp|shopping\.yahoo\.com|shopzilla|shopzilla\.com|simplycodes\.com|store\.shopping\.yahoo\.co\.jp|stripe|stripe\.com|uk\.shopping\.net|walmart|walmart\.com)$", "i").test(v.utmSource) || new RegExp("^(.*(([^a-df-z]|^)shop|shopping).*)$", "i").test(v.utmCampaign)) && new RegExp("^(.*cp.*|ppc|retargeting|paid.*)$", "i").test(v.utmMedium)},{"name":"paid-search","test":(v) => new RegExp("^(?:360\.cn|alice|aol|ar\.search\.yahoo\.com|ask|at\.search\.yahoo\.com|au\.search\.yahoo\.com|auone|avg|babylon|baidu|biglobe|biglobe\.co\.jp|biglobe\.ne\.jp|bing|br\.search\.yahoo\.com|ca\.search\.yahoo\.com|centrum\.cz|ch\.search\.yahoo\.com|cl\.search\.yahoo\.com|cn\.bing\.com|cnn|co\.search\.yahoo\.com|comcast|conduit|daum|daum\.net|de\.search\.yahoo\.com|dk\.search\.yahoo\.com|dogpile|dogpile\.com|duckduckgo|ecosia\.org|email\.seznam\.cz|eniro|es\.search\.yahoo\.com|espanol\.search\.yahoo\.com|exalead\.com|excite\.com|fi\.search\.yahoo\.com|firmy\.cz|fr\.search\.yahoo\.com|globo|go\.mail\.ru|google|google-play|hk\.search\.yahoo\.com|id\.search\.yahoo\.com|in\.search\.yahoo\.com|incredimail|it\.search\.yahoo\.com|kvasir|lens\.google\.com|lite\.qwant\.com|lycos|m\.baidu\.com|m\.naver\.com|m\.search\.naver\.com|m\.sogou\.com|mail\.rambler\.ru|mail\.yandex\.ru|malaysia\.search\.yahoo\.com|msn|msn\.com|mx\.search\.yahoo\.com|najdi|naver|naver\.com|news\.google\.com|nl\.search\.yahoo\.com|no\.search\.yahoo\.com|ntp\.msn\.com|nz\.search\.yahoo\.com|onet|onet\.pl|pe\.search\.yahoo\.com|ph\.search\.yahoo\.com|pl\.search\.yahoo\.com|play\.google\.com|qwant|qwant\.com|rakuten|rakuten\.co\.jp|rambler|rambler\.ru|se\.search\.yahoo\.com|search-results|search\.aol\.co\.uk|search\.aol\.com|search\.google\.com|search\.smt\.docomo\.ne\.jp|search\.ukr\.net|secureurl\.ukr\.net|seznam|seznam\.cz|sg\.search\.yahoo\.com|so\.com|sogou|sogou\.com|sp-web\.search\.auone\.jp|startsiden|startsiden\.no|suche\.aol\.de|terra|th\.search\.yahoo\.com|tr\.search\.yahoo\.com|tut\.by|tw\.search\.yahoo\.com|uk\.search\.yahoo\.com|ukr|us\.search\.yahoo\.com|virgilio|vn\.search\.yahoo\.com|wap\.sogou\.com|webmaster\.yandex\.ru|websearch\.rakuten\.co\.jp|yahoo|yahoo\.co\.jp|yahoo\.com|yandex|yandex\.by|yandex\.com|yandex\.com\.tr|yandex\.fr|yandex\.kz|yandex\.ru|yandex\.ua|yandex\.uz|zen\.yandex\.ru)$", "i").test(v.utmSource) && new RegExp("^(.*cp.*|ppc|retargeting|paid.*)$", "i").test(v.utmMedium)},{"name":"paid-social","test":(v) => new RegExp("^(?:43things|43things\.com|51\.com|5ch\.net|Hatena|ImageShack|academia\.edu|activerain|activerain\.com|activeworlds|activeworlds\.com|addthis|addthis\.com|airg\.ca|allnurses\.com|allrecipes\.com|alumniclass|alumniclass\.com|ameba\.jp|ameblo\.jp|americantowns|americantowns\.com|amp\.reddit\.com|ancestry\.com|anobii|anobii\.com|answerbag|answerbag\.com|answers\.yahoo\.com|aolanswers|aolanswers\.com|apps\.facebook\.com|ar\.pinterest\.com|artstation\.com|askubuntu|askubuntu\.com|asmallworld\.com|athlinks|athlinks\.com|away\.vk\.com|awe\.sm|b\.hatena\.ne\.jp|baby-gaga|baby-gaga\.com|babyblog\.ru|badoo|badoo\.com|bebo|bebo\.com|beforeitsnews|beforeitsnews\.com|bharatstudent|bharatstudent\.com|biip\.no|biswap\.org|bit\.ly|blackcareernetwork\.com|blackplanet|blackplanet\.com|blip\.fm|blog\.com|blog\.feedspot\.com|blog\.goo\.ne\.jp|blog\.naver\.com|blog\.yahoo\.co\.jp|blogg\.no|bloggang\.com|blogger|blogger\.com|blogher|blogher\.com|bloglines|bloglines\.com|blogs\.com|blogsome|blogsome\.com|blogspot|blogspot\.com|blogster|blogster\.com|blurtit|blurtit\.com|bookmarks\.yahoo\.co\.jp|bookmarks\.yahoo\.com|br\.pinterest\.com|brightkite|brightkite\.com|brizzly|brizzly\.com|business\.facebook\.com|buzzfeed|buzzfeed\.com|buzznet|buzznet\.com|cafe\.naver\.com|cafemom|cafemom\.com|camospace|camospace\.com|canalblog\.com|care\.com|care2|care2\.com|caringbridge\.org|catster|catster\.com|cbnt\.io|cellufun|cellufun\.com|centerblog\.net|chat\.zalo\.me|chegg\.com|chicagonow|chicagonow\.com|chiebukuro\.yahoo\.co\.jp|classmates|classmates\.com|classquest|classquest\.com|co\.pinterest\.com|cocolog-nifty|cocolog-nifty\.com|copainsdavant\.linternaute\.com|couchsurfing\.org|cozycot|cozycot\.com|cross\.tv|crunchyroll|crunchyroll\.com|cyworld|cyworld\.com|cz\.pinterest\.com|d\.hatena\.ne\.jp|dailystrength\.org|deluxe\.com|deviantart|deviantart\.com|dianping|dianping\.com|digg|digg\.com|diigo|diigo\.com|discover\.hubpages\.com|disqus|disqus\.com|dogster|dogster\.com|dol2day|dol2day\.com|doostang|doostang\.com|dopplr|dopplr\.com|douban|douban\.com|draft\.blogger\.com|draugiem\.lv|drugs-forum|drugs-forum\.com|dzone|dzone\.com|edublogs\.org|elftown|elftown\.com|epicurious\.com|everforo\.com|exblog\.jp|extole|extole\.com|facebook|facebook\.com|faceparty|faceparty\.com|fandom\.com|fanpop|fanpop\.com|fark|fark\.com|fb|fb\.me|fc2|fc2\.com|feedspot|feministing|feministing\.com|filmaffinity|filmaffinity\.com|flickr|flickr\.com|flipboard|flipboard\.com|folkdirect|folkdirect\.com|foodservice|foodservice\.com|forums\.androidcentral\.com|forums\.crackberry\.com|forums\.imore\.com|forums\.nexopia\.com|forums\.webosnation\.com|forums\.wpcentral\.com|fotki|fotki\.com|fotolog|fotolog\.com|foursquare|foursquare\.com|free\.facebook\.com|friendfeed|friendfeed\.com|fruehstueckstreff\.org|fubar|fubar\.com|gaiaonline|gaiaonline\.com|gamerdna|gamerdna\.com|gather\.com|geni\.com|getpocket\.com|glassboard|glassboard\.com|glassdoor|glassdoor\.com|godtube|godtube\.com|goldenline\.pl|goldstar|goldstar\.com|goo\.gl|gooblog|goodreads|goodreads\.com|google\+|googlegroups\.com|googleplus|govloop|govloop\.com|gowalla|gowalla\.com|gree\.jp|groups\.google\.com|gulli\.com|gutefrage\.net|habbo|habbo\.com|hi5|hi5\.com|hootsuite|hootsuite\.com|houzz|houzz\.com|hoverspot|hoverspot\.com|hr\.com|hu\.pinterest\.com|hubculture|hubculture\.com|hubpages\.com|hyves\.net|hyves\.nl|ibibo|ibibo\.com|id\.pinterest\.com|identi\.ca|ig|imageshack\.com|imageshack\.us|imvu|imvu\.com|in\.pinterest\.com|insanejournal|insanejournal\.com|instagram|instagram\.com|instapaper|instapaper\.com|internations\.org|interpals\.net|intherooms|intherooms\.com|irc-galleria\.net|is\.gd|italki|italki\.com|jammerdirect|jammerdirect\.com|jappy\.com|jappy\.de|kaboodle\.com|kakao|kakao\.com|kakaocorp\.com|kaneva|kaneva\.com|kin\.naver\.com|l\.facebook\.com|l\.instagram\.com|l\.messenger\.com|last\.fm|librarything|librarything\.com|lifestream\.aol\.com|line|line\.me|linkedin|linkedin\.com|listal|listal\.com|listography|listography\.com|livedoor\.com|livedoorblog|livejournal|livejournal\.com|lm\.facebook\.com|lnkd\.in|m\.blog\.naver\.com|m\.cafe\.naver\.com|m\.facebook\.com|m\.kin\.naver\.com|m\.vk\.com|m\.yelp\.com|mbga\.jp|medium\.com|meetin\.org|meetup|meetup\.com|meinvz\.net|meneame\.net|menuism\.com|messages\.google\.com|messages\.yahoo\.co\.jp|messenger|messenger\.com|mix\.com|mixi\.jp|mobile\.facebook\.com|mocospace|mocospace\.com|mouthshut|mouthshut\.com|movabletype|movabletype\.com|mubi|mubi\.com|my\.opera\.com|myanimelist\.net|myheritage|myheritage\.com|mylife|mylife\.com|mymodernmet|mymodernmet\.com|myspace|myspace\.com|netvibes|netvibes\.com|news\.ycombinator\.com|newsshowcase|nexopia|ngopost\.org|niconico|nicovideo\.jp|nightlifelink|nightlifelink\.com|ning|ning\.com|nl\.pinterest\.com|odnoklassniki\.ru|odnoklassniki\.ua|okwave\.jp|old\.reddit\.com|oneworldgroup\.org|onstartups|onstartups\.com|opendiary|opendiary\.com|oshiete\.goo\.ne\.jp|out\.reddit\.com|over-blog\.com|overblog\.com|paper\.li|partyflock\.nl|photobucket|photobucket\.com|pinboard|pinboard\.in|pingsta|pingsta\.com|pinterest|pinterest\.at|pinterest\.ca|pinterest\.ch|pinterest\.cl|pinterest\.co\.kr|pinterest\.co\.uk|pinterest\.com|pinterest\.com\.au|pinterest\.com\.mx|pinterest\.de|pinterest\.es|pinterest\.fr|pinterest\.it|pinterest\.jp|pinterest\.nz|pinterest\.ph|pinterest\.pt|pinterest\.ru|pinterest\.se|pixiv\.net|pl\.pinterest\.com|playahead\.se|plurk|plurk\.com|plus\.google\.com|plus\.url\.google\.com|pocket\.co|posterous|posterous\.com|pro\.homeadvisor\.com|pulse\.yahoo\.com|qapacity|qapacity\.com|quechup|quechup\.com|quora|quora\.com|qzone\.qq\.com|ravelry|ravelry\.com|reddit|reddit\.com|redux|redux\.com|renren|renren\.com|researchgate\.net|reunion|reunion\.com|reverbnation|reverbnation\.com|rtl\.de|ryze|ryze\.com|salespider|salespider\.com|scoop\.it|screenrant|screenrant\.com|scribd|scribd\.com|scvngr|scvngr\.com|secondlife|secondlife\.com|serverfault|serverfault\.com|shareit|sharethis|sharethis\.com|shvoong\.com|sites\.google\.com|skype|skyrock|skyrock\.com|slashdot\.org|slideshare\.net|smartnews\.com|snapchat|snapchat\.com|social|sociallife\.com\.br|socialvibe|socialvibe\.com|spaces\.live\.com|spoke|spoke\.com|spruz|spruz\.com|ssense\.com|stackapps|stackapps\.com|stackexchange|stackexchange\.com|stackoverflow|stackoverflow\.com|stardoll\.com|stickam|stickam\.com|studivz\.net|suomi24\.fi|superuser|superuser\.com|sweeva|sweeva\.com|t\.co|t\.me|tagged|tagged\.com|taggedmail|taggedmail\.com|talkbiznow|talkbiznow\.com|taringa\.net|techmeme|techmeme\.com|tencent|tencent\.com|tiktok|tiktok\.com|tinyurl|tinyurl\.com|toolbox|toolbox\.com|touch\.facebook\.com|tr\.pinterest\.com|travellerspoint|travellerspoint\.com|tripadvisor|tripadvisor\.com|trombi|trombi\.com|trustpilot|tudou|tudou\.com|tuenti|tuenti\.com|tumblr|tumblr\.com|tweetdeck|tweetdeck\.com|twitter|twitter\.com|twoo\.com|typepad|typepad\.com|unblog\.fr|urbanspoon\.com|ushareit\.com|ushi\.cn|vampirefreaks|vampirefreaks\.com|vampirerave|vampirerave\.com|vg\.no|video\.ibm\.com|vk\.com|vkontakte\.ru|wakoopa|wakoopa\.com|wattpad|wattpad\.com|web\.facebook\.com|web\.skype\.com|webshots|webshots\.com|wechat|wechat\.com|weebly|weebly\.com|weibo|weibo\.com|wer-weiss-was\.de|weread|weread\.com|whatsapp|whatsapp\.com|wiki\.answers\.com|wikihow\.com|wikitravel\.org|woot\.com|wordpress|wordpress\.com|wordpress\.org|xanga|xanga\.com|xing|xing\.com|yahoo-mbga\.jp|yammer|yammer\.com|yelp|yelp\.co\.uk|yelp\.com|youroom\.in|za\.pinterest\.com|zalo|zoo\.gr|zooppa|zooppa\.com)$", "i").test(v.utmSource) && new RegExp("^(.*cp.*|ppc|retargeting|paid.*)$", "i").test(v.utmMedium)},{"name":"paid-video","test":(v) => new RegExp("^(?:blog\.twitch\.tv|crackle|crackle\.com|curiositystream|curiositystream\.com|d\.tube|dailymotion|dailymotion\.com|dashboard\.twitch\.tv|disneyplus|disneyplus\.com|fast\.wistia\.net|help\.hulu\.com|help\.netflix\.com|hulu|hulu\.com|id\.twitch\.tv|iq\.com|iqiyi|iqiyi\.com|jobs\.netflix\.com|justin\.tv|m\.twitch\.tv|m\.youtube\.com|music\.youtube\.com|netflix|netflix\.com|player\.twitch\.tv|player\.vimeo\.com|ted|ted\.com|twitch|twitch\.tv|utreon|utreon\.com|veoh|veoh\.com|viadeo\.journaldunet\.com|vimeo|vimeo\.com|wistia|wistia\.com|youku|youku\.com|youtube|youtube\.com)$", "i").test(v.utmSource) && new RegExp("^(.*cp.*|ppc|retargeting|paid.*)$", "i").test(v.utmMedium)},{"name":"display","test":(v) => new RegExp("^(?:display|banner|expandable|interstitial|cpm)$", "i").test(v.utmMedium)},{"name":"paid-other","test":(v) => new RegExp("^(.*cp.*|ppc|retargeting|paid.*)$", "i").test(v.utmMedium)},{"name":"organic-shopping","test":(v) => new RegExp("^(?:360\.cn|alice|aol|ar\.search\.yahoo\.com|ask|at\.search\.yahoo\.com|au\.search\.yahoo\.com|auone|avg|babylon|baidu|biglobe|biglobe\.co\.jp|biglobe\.ne\.jp|bing|br\.search\.yahoo\.com|ca\.search\.yahoo\.com|centrum\.cz|ch\.search\.yahoo\.com|cl\.search\.yahoo\.com|cn\.bing\.com|cnn|co\.search\.yahoo\.com|comcast|conduit|daum|daum\.net|de\.search\.yahoo\.com|dk\.search\.yahoo\.com|dogpile|dogpile\.com|duckduckgo|ecosia\.org|email\.seznam\.cz|eniro|es\.search\.yahoo\.com|espanol\.search\.yahoo\.com|exalead\.com|excite\.com|fi\.search\.yahoo\.com|firmy\.cz|fr\.search\.yahoo\.com|globo|go\.mail\.ru|google|google-play|hk\.search\.yahoo\.com|id\.search\.yahoo\.com|in\.search\.yahoo\.com|incredimail|it\.search\.yahoo\.com|kvasir|lens\.google\.com|lite\.qwant\.com|lycos|m\.baidu\.com|m\.naver\.com|m\.search\.naver\.com|m\.sogou\.com|mail\.rambler\.ru|mail\.yandex\.ru|malaysia\.search\.yahoo\.com|msn|msn\.com|mx\.search\.yahoo\.com|najdi|naver|naver\.com|news\.google\.com|nl\.search\.yahoo\.com|no\.search\.yahoo\.com|ntp\.msn\.com|nz\.search\.yahoo\.com|onet|onet\.pl|pe\.search\.yahoo\.com|ph\.search\.yahoo\.com|pl\.search\.yahoo\.com|play\.google\.com|qwant|qwant\.com|rakuten|rakuten\.co\.jp|rambler|rambler\.ru|se\.search\.yahoo\.com|search-results|search\.aol\.co\.uk|search\.aol\.com|search\.google\.com|search\.smt\.docomo\.ne\.jp|search\.ukr\.net|secureurl\.ukr\.net|seznam|seznam\.cz|sg\.search\.yahoo\.com|so\.com|sogou|sogou\.com|sp-web\.search\.auone\.jp|startsiden|startsiden\.no|suche\.aol\.de|terra|th\.search\.yahoo\.com|tr\.search\.yahoo\.com|tut\.by|tw\.search\.yahoo\.com|uk\.search\.yahoo\.com|ukr|us\.search\.yahoo\.com|virgilio|vn\.search\.yahoo\.com|wap\.sogou\.com|webmaster\.yandex\.ru|websearch\.rakuten\.co\.jp|yahoo|yahoo\.co\.jp|yahoo\.com|yandex|yandex\.by|yandex\.com|yandex\.com\.tr|yandex\.fr|yandex\.kz|yandex\.ru|yandex\.ua|yandex\.uz|zen\.yandex\.ru)$", "i").test(v.utmSource) || new RegExp("^(.*(([^a-df-z]|^)shop|shopping).*)$", "i").test(v.utmCampaign)},{"name":"organic-social","test":(v) => new RegExp("^(?:43things|43things\.com|51\.com|5ch\.net|Hatena|ImageShack|academia\.edu|activerain|activerain\.com|activeworlds|activeworlds\.com|addthis|addthis\.com|airg\.ca|allnurses\.com|allrecipes\.com|alumniclass|alumniclass\.com|ameba\.jp|ameblo\.jp|americantowns|americantowns\.com|amp\.reddit\.com|ancestry\.com|anobii|anobii\.com|answerbag|answerbag\.com|answers\.yahoo\.com|aolanswers|aolanswers\.com|apps\.facebook\.com|ar\.pinterest\.com|artstation\.com|askubuntu|askubuntu\.com|asmallworld\.com|athlinks|athlinks\.com|away\.vk\.com|awe\.sm|b\.hatena\.ne\.jp|baby-gaga|baby-gaga\.com|babyblog\.ru|badoo|badoo\.com|bebo|bebo\.com|beforeitsnews|beforeitsnews\.com|bharatstudent|bharatstudent\.com|biip\.no|biswap\.org|bit\.ly|blackcareernetwork\.com|blackplanet|blackplanet\.com|blip\.fm|blog\.com|blog\.feedspot\.com|blog\.goo\.ne\.jp|blog\.naver\.com|blog\.yahoo\.co\.jp|blogg\.no|bloggang\.com|blogger|blogger\.com|blogher|blogher\.com|bloglines|bloglines\.com|blogs\.com|blogsome|blogsome\.com|blogspot|blogspot\.com|blogster|blogster\.com|blurtit|blurtit\.com|bookmarks\.yahoo\.co\.jp|bookmarks\.yahoo\.com|br\.pinterest\.com|brightkite|brightkite\.com|brizzly|brizzly\.com|business\.facebook\.com|buzzfeed|buzzfeed\.com|buzznet|buzznet\.com|cafe\.naver\.com|cafemom|cafemom\.com|camospace|camospace\.com|canalblog\.com|care\.com|care2|care2\.com|caringbridge\.org|catster|catster\.com|cbnt\.io|cellufun|cellufun\.com|centerblog\.net|chat\.zalo\.me|chegg\.com|chicagonow|chicagonow\.com|chiebukuro\.yahoo\.co\.jp|classmates|classmates\.com|classquest|classquest\.com|co\.pinterest\.com|cocolog-nifty|cocolog-nifty\.com|copainsdavant\.linternaute\.com|couchsurfing\.org|cozycot|cozycot\.com|cross\.tv|crunchyroll|crunchyroll\.com|cyworld|cyworld\.com|cz\.pinterest\.com|d\.hatena\.ne\.jp|dailystrength\.org|deluxe\.com|deviantart|deviantart\.com|dianping|dianping\.com|digg|digg\.com|diigo|diigo\.com|discover\.hubpages\.com|disqus|disqus\.com|dogster|dogster\.com|dol2day|dol2day\.com|doostang|doostang\.com|dopplr|dopplr\.com|douban|douban\.com|draft\.blogger\.com|draugiem\.lv|drugs-forum|drugs-forum\.com|dzone|dzone\.com|edublogs\.org|elftown|elftown\.com|epicurious\.com|everforo\.com|exblog\.jp|extole|extole\.com|facebook|facebook\.com|faceparty|faceparty\.com|fandom\.com|fanpop|fanpop\.com|fark|fark\.com|fb|fb\.me|fc2|fc2\.com|feedspot|feministing|feministing\.com|filmaffinity|filmaffinity\.com|flickr|flickr\.com|flipboard|flipboard\.com|folkdirect|folkdirect\.com|foodservice|foodservice\.com|forums\.androidcentral\.com|forums\.crackberry\.com|forums\.imore\.com|forums\.nexopia\.com|forums\.webosnation\.com|forums\.wpcentral\.com|fotki|fotki\.com|fotolog|fotolog\.com|foursquare|foursquare\.com|free\.facebook\.com|friendfeed|friendfeed\.com|fruehstueckstreff\.org|fubar|fubar\.com|gaiaonline|gaiaonline\.com|gamerdna|gamerdna\.com|gather\.com|geni\.com|getpocket\.com|glassboard|glassboard\.com|glassdoor|glassdoor\.com|godtube|godtube\.com|goldenline\.pl|goldstar|goldstar\.com|goo\.gl|gooblog|goodreads|goodreads\.com|google\+|googlegroups\.com|googleplus|govloop|govloop\.com|gowalla|gowalla\.com|gree\.jp|groups\.google\.com|gulli\.com|gutefrage\.net|habbo|habbo\.com|hi5|hi5\.com|hootsuite|hootsuite\.com|houzz|houzz\.com|hoverspot|hoverspot\.com|hr\.com|hu\.pinterest\.com|hubculture|hubculture\.com|hubpages\.com|hyves\.net|hyves\.nl|ibibo|ibibo\.com|id\.pinterest\.com|identi\.ca|ig|imageshack\.com|imageshack\.us|imvu|imvu\.com|in\.pinterest\.com|insanejournal|insanejournal\.com|instagram|instagram\.com|instapaper|instapaper\.com|internations\.org|interpals\.net|intherooms|intherooms\.com|irc-galleria\.net|is\.gd|italki|italki\.com|jammerdirect|jammerdirect\.com|jappy\.com|jappy\.de|kaboodle\.com|kakao|kakao\.com|kakaocorp\.com|kaneva|kaneva\.com|kin\.naver\.com|l\.facebook\.com|l\.instagram\.com|l\.messenger\.com|last\.fm|librarything|librarything\.com|lifestream\.aol\.com|line|line\.me|linkedin|linkedin\.com|listal|listal\.com|listography|listography\.com|livedoor\.com|livedoorblog|livejournal|livejournal\.com|lm\.facebook\.com|lnkd\.in|m\.blog\.naver\.com|m\.cafe\.naver\.com|m\.facebook\.com|m\.kin\.naver\.com|m\.vk\.com|m\.yelp\.com|mbga\.jp|medium\.com|meetin\.org|meetup|meetup\.com|meinvz\.net|meneame\.net|menuism\.com|messages\.google\.com|messages\.yahoo\.co\.jp|messenger|messenger\.com|mix\.com|mixi\.jp|mobile\.facebook\.com|mocospace|mocospace\.com|mouthshut|mouthshut\.com|movabletype|movabletype\.com|mubi|mubi\.com|my\.opera\.com|myanimelist\.net|myheritage|myheritage\.com|mylife|mylife\.com|mymodernmet|mymodernmet\.com|myspace|myspace\.com|netvibes|netvibes\.com|news\.ycombinator\.com|newsshowcase|nexopia|ngopost\.org|niconico|nicovideo\.jp|nightlifelink|nightlifelink\.com|ning|ning\.com|nl\.pinterest\.com|odnoklassniki\.ru|odnoklassniki\.ua|okwave\.jp|old\.reddit\.com|oneworldgroup\.org|onstartups|onstartups\.com|opendiary|opendiary\.com|oshiete\.goo\.ne\.jp|out\.reddit\.com|over-blog\.com|overblog\.com|paper\.li|partyflock\.nl|photobucket|photobucket\.com|pinboard|pinboard\.in|pingsta|pingsta\.com|pinterest|pinterest\.at|pinterest\.ca|pinterest\.ch|pinterest\.cl|pinterest\.co\.kr|pinterest\.co\.uk|pinterest\.com|pinterest\.com\.au|pinterest\.com\.mx|pinterest\.de|pinterest\.es|pinterest\.fr|pinterest\.it|pinterest\.jp|pinterest\.nz|pinterest\.ph|pinterest\.pt|pinterest\.ru|pinterest\.se|pixiv\.net|pl\.pinterest\.com|playahead\.se|plurk|plurk\.com|plus\.google\.com|plus\.url\.google\.com|pocket\.co|posterous|posterous\.com|pro\.homeadvisor\.com|pulse\.yahoo\.com|qapacity|qapacity\.com|quechup|quechup\.com|quora|quora\.com|qzone\.qq\.com|ravelry|ravelry\.com|reddit|reddit\.com|redux|redux\.com|renren|renren\.com|researchgate\.net|reunion|reunion\.com|reverbnation|reverbnation\.com|rtl\.de|ryze|ryze\.com|salespider|salespider\.com|scoop\.it|screenrant|screenrant\.com|scribd|scribd\.com|scvngr|scvngr\.com|secondlife|secondlife\.com|serverfault|serverfault\.com|shareit|sharethis|sharethis\.com|shvoong\.com|sites\.google\.com|skype|skyrock|skyrock\.com|slashdot\.org|slideshare\.net|smartnews\.com|snapchat|snapchat\.com|social|sociallife\.com\.br|socialvibe|socialvibe\.com|spaces\.live\.com|spoke|spoke\.com|spruz|spruz\.com|ssense\.com|stackapps|stackapps\.com|stackexchange|stackexchange\.com|stackoverflow|stackoverflow\.com|stardoll\.com|stickam|stickam\.com|studivz\.net|suomi24\.fi|superuser|superuser\.com|sweeva|sweeva\.com|t\.co|t\.me|tagged|tagged\.com|taggedmail|taggedmail\.com|talkbiznow|talkbiznow\.com|taringa\.net|techmeme|techmeme\.com|tencent|tencent\.com|tiktok|tiktok\.com|tinyurl|tinyurl\.com|toolbox|toolbox\.com|touch\.facebook\.com|tr\.pinterest\.com|travellerspoint|travellerspoint\.com|tripadvisor|tripadvisor\.com|trombi|trombi\.com|trustpilot|tudou|tudou\.com|tuenti|tuenti\.com|tumblr|tumblr\.com|tweetdeck|tweetdeck\.com|twitter|twitter\.com|twoo\.com|typepad|typepad\.com|unblog\.fr|urbanspoon\.com|ushareit\.com|ushi\.cn|vampirefreaks|vampirefreaks\.com|vampirerave|vampirerave\.com|vg\.no|video\.ibm\.com|vk\.com|vkontakte\.ru|wakoopa|wakoopa\.com|wattpad|wattpad\.com|web\.facebook\.com|web\.skype\.com|webshots|webshots\.com|wechat|wechat\.com|weebly|weebly\.com|weibo|weibo\.com|wer-weiss-was\.de|weread|weread\.com|whatsapp|whatsapp\.com|wiki\.answers\.com|wikihow\.com|wikitravel\.org|woot\.com|wordpress|wordpress\.com|wordpress\.org|xanga|xanga\.com|xing|xing\.com|yahoo-mbga\.jp|yammer|yammer\.com|yelp|yelp\.co\.uk|yelp\.com|youroom\.in|za\.pinterest\.com|zalo|zoo\.gr|zooppa|zooppa\.com)$", "i").test(v.utmSource) || new RegExp("^(?:social|social-network|social-media|sm|social network|social media)$", "i").test(v.utmMedium)},{"name":"organic-video","test":(v) => new RegExp("^(?:blog\.twitch\.tv|crackle|crackle\.com|curiositystream|curiositystream\.com|d\.tube|dailymotion|dailymotion\.com|dashboard\.twitch\.tv|disneyplus|disneyplus\.com|fast\.wistia\.net|help\.hulu\.com|help\.netflix\.com|hulu|hulu\.com|id\.twitch\.tv|iq\.com|iqiyi|iqiyi\.com|jobs\.netflix\.com|justin\.tv|m\.twitch\.tv|m\.youtube\.com|music\.youtube\.com|netflix|netflix\.com|player\.twitch\.tv|player\.vimeo\.com|ted|ted\.com|twitch|twitch\.tv|utreon|utreon\.com|veoh|veoh\.com|viadeo\.journaldunet\.com|vimeo|vimeo\.com|wistia|wistia\.com|youku|youku\.com|youtube|youtube\.com)$", "i").test(v.utmSource) || new RegExp("^(.*video.*)$", "i").test(v.utmMedium)},{"name":"organic-search","test":(v) => new RegExp("^(?:360\.cn|alice|aol|ar\.search\.yahoo\.com|ask|at\.search\.yahoo\.com|au\.search\.yahoo\.com|auone|avg|babylon|baidu|biglobe|biglobe\.co\.jp|biglobe\.ne\.jp|bing|br\.search\.yahoo\.com|ca\.search\.yahoo\.com|centrum\.cz|ch\.search\.yahoo\.com|cl\.search\.yahoo\.com|cn\.bing\.com|cnn|co\.search\.yahoo\.com|comcast|conduit|daum|daum\.net|de\.search\.yahoo\.com|dk\.search\.yahoo\.com|dogpile|dogpile\.com|duckduckgo|ecosia\.org|email\.seznam\.cz|eniro|es\.search\.yahoo\.com|espanol\.search\.yahoo\.com|exalead\.com|excite\.com|fi\.search\.yahoo\.com|firmy\.cz|fr\.search\.yahoo\.com|globo|go\.mail\.ru|google|google-play|hk\.search\.yahoo\.com|id\.search\.yahoo\.com|in\.search\.yahoo\.com|incredimail|it\.search\.yahoo\.com|kvasir|lens\.google\.com|lite\.qwant\.com|lycos|m\.baidu\.com|m\.naver\.com|m\.search\.naver\.com|m\.sogou\.com|mail\.rambler\.ru|mail\.yandex\.ru|malaysia\.search\.yahoo\.com|msn|msn\.com|mx\.search\.yahoo\.com|najdi|naver|naver\.com|news\.google\.com|nl\.search\.yahoo\.com|no\.search\.yahoo\.com|ntp\.msn\.com|nz\.search\.yahoo\.com|onet|onet\.pl|pe\.search\.yahoo\.com|ph\.search\.yahoo\.com|pl\.search\.yahoo\.com|play\.google\.com|qwant|qwant\.com|rakuten|rakuten\.co\.jp|rambler|rambler\.ru|se\.search\.yahoo\.com|search-results|search\.aol\.co\.uk|search\.aol\.com|search\.google\.com|search\.smt\.docomo\.ne\.jp|search\.ukr\.net|secureurl\.ukr\.net|seznam|seznam\.cz|sg\.search\.yahoo\.com|so\.com|sogou|sogou\.com|sp-web\.search\.auone\.jp|startsiden|startsiden\.no|suche\.aol\.de|terra|th\.search\.yahoo\.com|tr\.search\.yahoo\.com|tut\.by|tw\.search\.yahoo\.com|uk\.search\.yahoo\.com|ukr|us\.search\.yahoo\.com|virgilio|vn\.search\.yahoo\.com|wap\.sogou\.com|webmaster\.yandex\.ru|websearch\.rakuten\.co\.jp|yahoo|yahoo\.co\.jp|yahoo\.com|yandex|yandex\.by|yandex\.com|yandex\.com\.tr|yandex\.fr|yandex\.kz|yandex\.ru|yandex\.ua|yandex\.uz|zen\.yandex\.ru)$", "i").test(v.utmSource) || v.utmMedium.toLowerCase() === "organic"},{"name":"referral","test":(v) => new RegExp("^(?:referral|app|link)$", "i").test(v.utmMedium)},{"name":"email","test":(v) => new RegExp("^(?:email|e-mail|e_mail|e mail)$", "i").test(v.utmMedium) || new RegExp("^(?:email|e-mail|e_mail|e mail)$", "i").test(v.utmSource)},{"name":"affiliate","test":(v) => v.utmMedium.toLowerCase() === "affiliate"},{"name":"audio","test":(v) => v.utmMedium.toLowerCase() === "audio"},{"name":"sms","test":(v) => v.utmSource.toLowerCase() === "sms" || v.utmMedium.toLowerCase() === "sms"},{"name":"mobile-push-notification","test":(v) => v.utmSource.toLowerCase() === "firebase" || new RegExp("(?:.*mobile.*|.*notification.*|push$)", "i").test(v.utmMedium)}].find(i=>i.test(t)))==null?void 0:s.name)??"other"}getShopifyAnalyticsId(){return this.getCookie("_shopify_y")}legacyGetCookieVisitor(){const t=this.getCookie("SHOPLIFT");return t===null?null:JSON.parse(t,f)}getCookie(t){const e=this.cookie.split("; ").filter(s=>s.split("=").at(0)===t).at(0);return e===void 0?null:e.split("=").slice(1).join("=")}monitorConsentChange(){document.addEventListener("visitorConsentCollected",t=>void(async()=>await this.onConsentChange(t.detail.analyticsAllowed,!0))()),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.loadShopifyConsentApiWithRetry()):this.loadShopifyConsentApiWithRetry()}loadShopifyConsentApiWithRetry(){let t=0;const e=()=>{this.loadShopifyConsentApi()||t++<10&&window.setTimeout(e,100)};e()}loadShopifyConsentApi(){if(window.Shopify){this.log("Loading Shopify features");const t=async()=>{if(!window.Shopify){this.log("Shopify object missing... suddenly?");return}if(window.Shopify.customerPrivacy===void 0){this.log("Shopify CustomerPrivacy api still missing, trying again in 1000ms"),e=window.setTimeout(()=>void(async()=>await t())(),1e3);return}const s=window.Shopify.customerPrivacy.getTrackingConsent();await this.onConsentChange(window.Shopify.customerPrivacy.analyticsProcessingAllowed(),s==="yes")};let e=window.setTimeout(()=>void(async()=>await t())(),5e3);return window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],s=>{(async()=>{if(window.clearTimeout(e),s){this.log("Error loading consent tracking",s);return}await t()})()}),!0}return!1}async onConsentChange(t,e){try{if(this.log("Consent change detected"),this.state.essential.consentApproved=t,this.state.essential.hasConsentInteraction=e,!this.state.essential.consentApproved){this.state.essential.hasConsentInteraction&&(this.state.analytics.queue.length=0),this.saveState();return}this.cookie=document.cookie,this.shopifyAnalyticsId=this.getShopifyAnalyticsId();for(const s of this.state.analytics.queue.filter(i=>i.type===1||i.type===2)){const i=s;i.shopifyAnalyticsId=this.shopifyAnalyticsId}this.saveState(),await this.syncAllEvents()}catch(s){this.log("Error syncing on consent change",s)}}isThemePreview(){return isThemePreview||themeRole!=="main"}clearThemeBar(t,e,s){const i=structuredClone(s);this.log("Looking for theme bar"),this.waitForElement(null,"body").then(o=>this.waitForElement(o,"#preview-bar-iframe, #PBarNextFrameWrapper").then(n=>(this.log("Found theme bar"),e&&(this.log("Removing theme bar"),n.remove()),t?this.makeRequest({url:`${this.eventHost}/api/v0/logs`,method:"post",data:JSON.stringify({...this.debugState(),stateAtEvaluation:i},w)}):Promise.resolve(null)))).catch(o=>console.error(o))}waitForElement(t,e){return new Promise(s=>{const i=document.querySelector(e);if(i){s(i);return}const o=new MutationObserver(n=>{const a=document.querySelector(e);if(a){o.disconnect(),s(a);return}});o.observe(t??document.documentElement,{childList:!0})})}setDebug(t){this.state.essential.debugMode=t,this.saveState()}log(t,...e){this.logHistory.push([`[SL] ${t}`,...e.map(s=>JSON.stringify(s))].join(" ")),!(!this.state.essential.debugMode&&!this.shopliftDebug)&&console.debug(`[SL] ${t}`,...e)}debugState(){return{state:this.state,storage:{essential:this.loadLocalStorage(this.essentialSessionKey),analytics:this.loadLocalStorage(this.analyticsSessionKey)},params:{shop:this.shop,host:this.host,eventHost:this.eventHost,cssHideClass:this.cssHideClass,testConfigs:this.testConfigs,inactiveTestConfigs:this.inactiveTestConfigs,sendPageView:this.sendPageView,isShopifyMerchantCookie:this.getCookie("is_shopify_merchant"),themeId,url:window.location.href,isThemePreview,themeRole},logHistory:this.logHistory}}debug(){const t=this.debugState();console.log(JSON.stringify(t,w,2))}}(async function(){window.shopliftInstance||(window.shopliftInstance=new z("contractor-training-center.myshopify.com","https://app.shoplift.ai","https://events.shoplift.ai",false,false,false,false,false,1000,[],[{"id":"d62fd5ff-8d97-4bc3-966c-6b375eb4b4e3","status":"paused","hypotheses":[{"id":"a07829a9-8cdb-49b1-bb5b-9d0e280710dc","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/tennessee-nascla"},{"id":"e7266e3f-8b6b-4b83-a3c5-3705462ad8b4","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/tennessee-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"32b871a1-74c5-454d-bbfa-cda5c76a18db","status":"paused","hypotheses":[{"id":"50bddbeb-5e51-4216-8718-7785dad51deb","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/alabama-nascla"},{"id":"0a96febd-f8f3-4ba6-8223-68755448a3f6","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/alabama-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"e2b17d40-8734-4b2e-9ea3-c3b43c2730ef","status":"paused","hypotheses":[{"id":"2b61976f-e98f-4a7b-a267-d40831319a41","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/blogs/news/how-to-become-a-general-contractor-in-florida"},{"id":"0446231e-5f9f-40f9-a947-1797aed3d376","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/blogs/news/how-to-become-a-general-contractor-in-florida-2"}],"ignoreTestViewParameterEnforcement":false},{"id":"a236d4df-032d-451d-b812-930a9cfdbde1","status":"paused","hypotheses":[{"id":"88c451bc-07e9-4ce6-983a-06bc0da3b993","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/national-nascla"},{"id":"3d13597d-fa1f-4b2c-ac75-d8c1ce2f12ba","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/national-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"83fd2840-50f0-4708-ab19-88c16f26e16f","status":"paused","hypotheses":[{"id":"88ad32a4-0b96-4baa-b2d2-ac86fcdfd2ed","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/north-carolina-nascla"},{"id":"e59d1630-be2c-4e7f-8a66-a25fc673d139","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/north-carolina-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"f5f70c72-fa17-40a1-a617-5948c6a12b72","status":"paused","hypotheses":[{"id":"112e32ad-9da0-4cd0-b437-2d5e8353ee2b","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/florida-nascla"},{"id":"3e21781a-734b-4f11-b199-de47c857052a","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/florida-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"b1f7d851-d996-4dbf-94a4-e38457d3d7e9","status":"paused","hypotheses":[{"id":"0843b1af-e47e-4ee7-abe1-64e43169e314","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/south-carolina-unlimited"},{"id":"fefad671-6f8b-43fc-81ea-dfde7d8d21ac","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/south-carolina-unlimited-builder-nascla-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"8d4ca658-f904-42a3-bcce-c1acce4b70ad","status":"paused","hypotheses":[{"id":"5fa2e4b9-8ca5-45b0-8bd5-1910c33b45e9","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/virginia-nascla"},{"id":"0144f64d-a6ae-4119-bba5-1e08d9c2e34b","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/virginia-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"6cdd87fb-6dd9-4539-be55-efb3c150cd7b","status":"paused","hypotheses":[{"id":"d20ec80d-336a-4cf7-b2e0-d6e9498322fc","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/national-nascla"},{"id":"c8f20010-bd9d-4b62-b138-e6e14ba074cc","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/national-nascla-2"}],"ignoreTestViewParameterEnforcement":false},{"id":"cf472a25-ce5a-4616-a960-c0a6d4586b63","status":"paused","hypotheses":[{"id":"d5ec812b-b1fc-43de-bb17-07a4bb8f276e","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/louisiana-nascla"},{"id":"7f4fe4ed-4479-448d-a38f-69531ebe8f18","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/louisiana-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"17d394b1-be8b-4451-9035-0b05e44e7cb7","status":"paused","hypotheses":[{"id":"55a72a3f-6f92-4f40-9e8f-5d63e220310c","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/arizona-nascla"},{"id":"a0c03de7-234b-4e3b-8bd6-76ac1680c2ab","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/arizona-nascla-commercial-builder-exam-a-b"}],"ignoreTestViewParameterEnforcement":false},{"id":"686d7f35-217c-42b7-9bad-4551e103e78b","status":"paused","hypotheses":[{"id":"f83e155d-f09f-45b5-809e-a06694622823","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":true,"redirectPath":"/collections/georgia-nascla"},{"id":"286fdf32-bc6a-4a3f-8c21-bb7c0833b068","type":"urlRedirect","themeId":139033575501,"affix":"","isControl":false,"redirectPath":"/collections/georgia-nascla-general-contractor-exam-a-b"}],"ignoreTestViewParameterEnforcement":false}]),await window.shopliftInstance.init())})()})(); })("/", { suffix: "state-update", type: "collection" }, "main", 139033575501, false)</script>
Skip to content
Home
›
California Contractor License Classes & Exam Prep
California Contractor License Classes & Exam Prep Join the thousands of professionals who’ve turned to Contractor Training Center for the tools and resources to pass their contractor licensing exams.
Choose Your California Licensing Path
Circle Arrow
Circle arrow icon
Overview
California Contractor's License: Everything You Need to Know
California offers three classes of contractor licenses, and you can add additional classifications to your license by accumulating experience hours in specialized trades.
Class A General Engineering Contractor LicenseÂ
Fixed works projects related to most structures, systems, roadways, and public areas—requires specialized knowledge in engineering.  Class B General Building ContractorÂ
Requires specialized knowledge specific to structures built for support or enclosure. Class C Specialty Contractor Â
Requires specialized knowledge and skills in a specific trade. This California Contractors State License Board (CSLB) enforces licensure laws, and noncompliance can lead to significant legal and financial penalties. By adhering to CSLB regulations, you not only ensure legal compliance but also position yourself for long-term success. Licensed contractors gain access to a range of benefits, including: Â
Enhanced credibility and trust with clients and partners  Eligibility to bid on larger and more lucrative projects  Legal protection and reduced liability  Access to industry resources and support  A competitive edge in the marketplace Contractor Training Center can help you achieve your goal of getting your CA contractor license--we put our decades of experience into our contractor exam prep and prove it with our 90% exam pass rate!
License Requirements
Steps to Earning Any California Contracting License
Contractor Training Center will help you navigate the twists and turns you may encounter on the way to obtaining your California Contractor License. Here’s what you need to know to get started:Â
Be at least 18 years old.  Possess a valid Social Security Number (SSN) or Individual Taxpayer Identification Number (ITIN).  Meet specific experience, bonding, and insurance requirements for your trade. Pass the California Trade Exam.  Pass the Law and Business Exam.  Submit application and fees.  Submit fingerprints for a mandatory criminal background check after your application is accepted. Plus additional requirements by profession. Holding a license ensures that those engaged in construction-related activities in California possess the necessary knowledge and understanding of building codes, construction practices, and business principles to operate safely and responsibly. To learn more about the process, check out this blog post about becoming a contractor in California .Â
Exam Preparation
How to Prepare for the California Contractor Exams
California contractor exams are administered by the California Contractors State License Board (CSLB). Their purpose is to evaluate aspiring contractors' knowledge of their specific field.
Effective preparation involves a thorough review of all study materials and reference books and relevant California state codes. Exam prep courses like the packages available through Contractor Training Center can explain exactly what you need to know to pass your exam the first time.Â
Frequently Asked Questions
Learn More About Contractor Licensing in California
What are the contractor licenses issued by the State of California?
California issues the Class A General Engineering Contractor License, the Class B General Building Contractor License, and the Class C Specialty Contractor License.
Did I read that right, there are three different California contractor license classes?
Yes! There are Class A, B, and C licenses, which allow the holder to contract different kinds of projects, and each come with their own requirements. Class B offers options for a B General Contractor license and a B2 Residential Remodeling Contractor. Class C is the Specialty Contractor license and has numerous specialty trades available from C2-C61. (View all license options .)If you’re not sure which license to pursue, Contractor Training Center can help! Schedule a call with one of our licensing experts today.
Does California accept the NASCLA Accredited Commercial Contractor License?
Yes—with conditions . Non-California residents who want to work in the state may qualify to waive the California General Contractor (B) trade exam if they: 1) are licensed in another state, 2) have held that license in good standing for at least 5 years, and 3) have passed the NASCLA exam. However, California residents are still required to take the California-specific trade exam , regardless of any NASCLA credentials.
Is continuing education required of licensed contractors in California?
Yes. As of 2025, the California Contractors State License Board requires active general contractors to complete 5 hours of continuing education, focused on business management, construction law, or Cal/OSHA standards, during each 2-year license renewal cycle.
How long before I will have to renew my California license?
Typically, after two years, on the last day of the month when you acquired it.
Need help navigating your exam prep path?
Speak with a CTC Advisor to get guidance on study materials that match your licensing goals and learning style. In just 20 minutes, with no obligation, you’ll be ready to get started!
Browse All Exam Prep Tools & Courses for California Contractors
Choosing a selection results in a full page refresh.
Opens in a new window.