PageSourceSearch

https://themakeuplight.com/cdn/shop/t/231/assets/tml.js?v=59741067825943927801789716636

js themakeuplight.com collected 2026-09-28 12:34:37 UTC 7,578 bytes, 14 lines download raw bytes

1(()=>{"use strict";const COOKIE_NAME="tml_sidebar_form",COOKIE_VALUE="submitted",MEMBER_VALUE="Direct Access Member - show modal",RELOADED_VALUE="Direct Access Member - page reloaded",CLOSED_VALUE="Direct Access Member - modal closed",ACTIVE_VALUE="Direct Access Member - no modal needed",PENDING_VALUES=[COOKIE_VALUE,MEMBER_VALUE],POST_SUBMIT_VALUES=[COOKIE_VALUE,MEMBER_VALUE,RELOADED_VALUE,CLOSED_VALUE,ACTIVE_VALUE],MEMBER_CHECK_PATH="search?view=tml-member",MEMBER_CHECK_INTERVAL_MS=3e4,MEMBER_CHECK_TIMEOUT_MS=1e4,SIDEBAR_TAB_SELECTOR=".da-sidebar-tab-direct-access-sidebar",HIDDEN_CLASS="hidden",MODAL_ID="tml-member-modal",OVERLAY_ID="tml-member-overlay",OPEN_CLASS="is-open",BODY_MODAL_CLASS="tml-modal-active",REGISTRATION_NOTICE_ID="tml-registration-success-notice",VERIFYING_NOTICE_ID="tml-verifying-notice",VISIBLE_CLASS="is-visible",MEMBER_CHANNEL_NAME="tml-member-modal",MEMBER_CLOSED_MESSAGE="member-modal-closed",member_channel="BroadcastChannel"in window?new BroadcastChannel(MEMBER_CHANNEL_NAME):null,setCookie=(name,value,hours)=>{const expires_at=new Date(Date.now()+hours*60*60*1e3);document.cookie=`${name}=${value}; expires=${expires_at.toUTCString()}; path=/; SameSite=Lax`},getCookie=name=>{const prefix=`${name}=`,entry=document.cookie.split("; ").find(item=>item.startsWith(prefix));return entry?entry.slice(prefix.length):""},hasSubmittedCookie=()=>getCookie(COOKIE_NAME)===COOKIE_VALUE,hasPostSubmitCookie=()=>POST_SUBMIT_VALUES.includes(getCookie(COOKIE_NAME)),isLoggedIn=()=>document.body.classList.contains("customer-logged-in"),hasRenderedDirectAccess=()=>document.body.dataset.directAccess==="1",hideSidebarTab=()=>{const tabs=document.querySelectorAll(SIDEBAR_TAB_SELECTOR);
1tabs.length&&tabs.forEach(tab=>tab.classList.add(HIDDEN_CLASS))},hideSidebarTabIfSubmitted=()=>{hasPostSubmitCookie()&&hideSidebarTab()},showVerifyingNoticeIfWaiting=()=>{const notice=document.getElementById(VERIFYING_NOTICE_ID);!notice||notice.classList.contains(VISIBLE_CLASS)||!hasSubmittedCookie()||document.getElementById(REGISTRATION_NOTICE_ID)?.classList.contains(VISIBLE_CLASS)||notice.classList.add(VISIBLE_CLASS)},MODAL_FALLBACK={title:"Congratulations, you've got Direct Access!",text:"<p>Your TML Direct Access membership is now active. Refresh the page to see your member pricing and unlocked content.</p>",reload_label:"Refresh page",later_label:"I'll refresh later"},withModalFallbacks=copy=>({title:copy?.title||MODAL_FALLBACK.title,text:copy?.text||MODAL_FALLBACK.text,reload_label:copy?.reload_label||MODAL_FALLBACK.reload_label,later_label:copy?.later_label||MODAL_FALLBACK.later_label}),memberModalMarkup=copy=>`
2    <div class="tml-modal-overlay" id="${OVERLAY_ID}"></div>
3    <div class="tml-modal" id="${MODAL_ID}" role="dialog" aria-modal="true" aria-labelledby="tml-member-title">
4      <div class="tml-modal-box">
5        <h2 class="tml-modal-title" id="tml-member-title">${copy.title}</h2>
6        <div class="tml-modal-text">${copy.text}</div>
7        <div class="tml-modal-actions">
8          <button type="button" class="tml-modal-btn tml-modal-btn--primary" data-tml-member-action="reload">${copy.reload_label}</button>
9          <button type="button" class="tml-modal-btn tml-modal-btn--secondary" data-tml-member-action="later">${copy.later_label}</button>
10        </div>
11      </div>
12    </div>
13  `,closeMemberModal=()=>{const modal=document.getElementById(MODAL_ID),overlay=document.getElementById(OVERLAY_ID);modal&&modal.classList.remove(OPEN_CLASS),overlay&&overlay.classList.remove(OPEN_CLASS),document.body.style.overflow="",document.body.classList.remove(BODY_MODAL_CLASS)},handleMemberAction=action=>{setCookie(COOKIE_NAME,action==="reload"?RELOADED_VALUE:CLOSED_VALUE,1),closeMemberModal(),member_channel?.postMessage(MEMBER_CLOSED_MESSAGE),action==="reload"&&window.location.reload()},handleChannelMessage=event=>{event.data!==MEMBER_CLOSED_MESSAGE||!document.getElementById(MODAL_ID)?.classList.contains(OPEN_CLASS)||closeMemberModal()},buildMemberModal=copy=>{if(document.getElementById(MODAL_ID))return;document.body.insertAdjacentHTML("beforeend",memberModalMarkup(copy)),document.querySelectorAll(`#${MODAL_ID} [data-tml-member-action]`).forEach(button=>{button.addEventListener("click",()=>handleMemberAction(button.dataset.tmlMemberAction))})},openMemberModal=copy=>{if(hasRenderedDirectAccess()||document.visibilityState!=="visible")return;buildMemberModal(withModalFallbacks(copy));const modal=document.getElementById(MODAL_ID),overlay=document.getElementById(OVERLAY_ID);!modal||!overlay||(modal.classList.add(OPEN_CLASS),overlay.classList.add(OPEN_CLASS),document.body.style.overflow="hidden",document.body.classList.add(BODY_MODAL_CLASS))},openMemberModalIfPending=async()=>{if(getCookie(COOKIE_NAME)!==MEMBER_VALUE)return;const status=await fetchMemberStatus();!status||status.direct_access_member!==!0||openMemberModal(status.modal)},settleIfAlreadyMember=()=>!hasRenderedDirectAccess()||!PENDING_VALUES.includes(getCookie(COOKIE_NAME))?!1:(setCookie(COOKIE_NAME,ACTIVE_VALUE,1),!0),localeRoot=()=>{const root=window.theme?.routes?.root_url||window.Shopify?.routes?.root||"/";return root.endsWith("/")?root:`${root}/`},memberCheckUrl=()=>`${localeRoot()}${MEMBER_CHECK_PATH}&_=${Date.now()}`,fetchMemberStatus=async()=>{const controller=new AbortController,timeout_id=setTimeout(()=>controller.abort(),MEMBER_CHECK_TIMEOUT_MS);try{const response=await fetch(memberCheckUrl(),{cache:"no-store",credentials:"same-origin",signal:controller.signal});return response.ok?JSON.parse(await response.text()):null}catch{return null}finally{clearTimeout(timeout_id)}};let member_check_timer=null,member_check_in_flight=!1;const stopMemberPolling=()=>{member_check_timer&&(clearInterval(member_check_timer),member_check_timer=null)},checkMemberStatus=async()=>
13{if(!hasSubmittedCookie()){stopMemberPolling(),openMemberModalIfPending();return}if(!member_check_in_flight){member_check_in_flight=!0;try{const status=await fetchMemberStatus();if(!status||status.direct_access_member!==!0)return;stopMemberPolling(),setCookie(COOKIE_NAME,MEMBER_VALUE,1),openMemberModal(status.modal)}finally{member_check_in_flight=!1}}},handleVisibilityChange=()=>{document.visibilityState==="visible"&&(showVerifyingNoticeIfWaiting(),openMemberModalIfPending(),member_check_timer&&checkMemberStatus())},startMemberPollingIfSubmitted=()=>{!isLoggedIn()||!hasSubmittedCookie()||(checkMemberStatus(),member_check_timer=setInterval(checkMemberStatus,MEMBER_CHECK_INTERVAL_MS))},isModalRegisterForm=form=>!form||!form.classList||!form.classList.contains("tml-form")?!1:!!form.closest(".tml-signup-modal"),handleModalSubmit=event=>{const form=event.target;if(isModalRegisterForm(form)&&!hasSubmittedCookie()){if(setCookie(COOKIE_NAME,COOKIE_VALUE,1),!hasSubmittedCookie()){event.preventDefault(),event.stopImmediatePropagation();return}hideSidebarTab()}},init=()=>{hideSidebarTabIfSubmitted(),!settleIfAlreadyMember()&&(showVerifyingNoticeIfWaiting(),openMemberModalIfPending(),startMemberPollingIfSubmitted())};document.addEventListener("submit",handleModalSubmit,!0),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),document.addEventListener("visibilitychange",handleVisibilityChange),member_channel?.addEventListener("message",handleChannelMessage),document.addEventListener("shopify:section:load",hideSidebarTabIfSubmitted),window.TML=window.TML||{},window.TML.setCookie=setCookie,window.TML.getCookie=getCookie})();
14//# sourceMappingURL=/cdn/shop/t/231/assets/tml.js.map?v=59741067825943927801789716636

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.