1(()=>{const globalKey="PurityHeaderAccountPopup",existingApi=window[globalKey];if(existingApi?.bindAccountPopups&&existingApi?.syncHeaderHeight){existingApi.syncHeaderHeight(),existingApi.bindAccountPopups(document);return}const root=document.documentElement,accountSelector=".header-account-popup shopify-account",accountShadowStyleId="purity-account-sheet-style",accountLoginShadowStyleId="purity-account-login-style",accountOverlayClass="purity-account-dialog-overlay",accountMobileSheetLayout="mobile-sheet",accountMobileSheetDialogClass="dialog-mobile-sheet",accountDialogActiveClass="dialog-active",accountDialogClosingClass="dialog-closing",accountDialogOpenDurationMs=200,accountDialogCloseDurationMs=300,accountDialogCloseEasing="cubic-bezier(0.5, -0.03, 0.34, 0.83)",accountInitialFocusGuardDurationMs=320,accountSheetCloseAnimationName="accountSheetClose",accountSheetCloseOffsetProperty="--account-sheet-close-offset",sheetDragThreshold=100,sheetDragResistance=.4,accountObservers=new WeakMap,accountDialogListeners=new WeakSet,accountCloseTimers=new WeakMap,accountOpenFrames=new WeakMap,accountNativeCloseBypass=new WeakSet,closingAccounts=new WeakSet,accountSheetDragStates=new WeakMap,accountInitialFocusGuardTimers=new WeakMap,accountInitialFocusSuppressUntil=new WeakMap,accountInitialFocusGuardRoots=new WeakSet,accountCloseCanvasSubscriptions=new WeakMap,systemPopupOpenClass="open-popup",systemTingleEnabledClass="tingle-enabled",accountShadowStyles=` 2 .dialog { 3 --dialog-drawer-opening-animation: none; 4 --dialog-drawer-closing-animation: none; 5 box-sizing: border-box; 6 position: fixed !important; 7 inset: 0 !important; 8 display: flex !important; 9 align-items: center !important; 10 justify-content: center !important; 11 width: 100vw !important; 12 max-width: none !important; 13 height: 100dvh !important; 14 max-height: none !important; 15 margin: 0 !important; 16 padding: 1.5rem !important; 17 background: transparent !important; 18 background-color: transparent !important; 19 border: 0 !important; 20 border-radius: 0 !important; 21 box-shadow: none !important; 22 clip-path: none !important; 23 overflow: visible !important; 24 pointer-events: none; 25 } 26 27 .dialog[open] { 28 animation: none !important; 29 } 30 31 .account, 32 .account__header, 33 .account__header-content, 34 .account__content, 35 .account__login-form-container, 36 shopify-login-form, 37 nav.stack-inline { 38 box-sizing: border-box; 39 min-width: 0; 40 } 41 42 .account__header, 43 .account__header-content, 44 .account__content, 45 .account__login-form-container, 46 shopify-login-form, 47 nav.stack-inline { 48 width: 100%; 49 } 50 51 .${accountOverlayClass} { 52 background-color: #1d1d1f80; 53 min-height: 100lvh; 54 position: fixed; 55 top: 0; 56 right: 0; 57 bottom: 0; 58 left: 0; 59 z-index: 1; 60 opacity: 0; 61 visibility: hidden; 62 pointer-events: none; 63 cursor: 64 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" fill="none"><rect width="60" height="60" fill="%23fff" rx="30"/><path fill="%231D1D1F" d="M22.348 23.93a1.02 1.02 0 0 1-.348-.778c0-.321.116-.598.348-.83.214-.215.481-.322.803-.322.32 0 .588.107.802.322L30 28.379l6.047-6.057c.214-.215.481-.322.803-.322.32 0 .588.107.802.322.232.232.348.509.348.83 0 .304-.116.563-.348.778l-6.047 6.057 6.047 6.057c.232.232.348.509.348.83 0 .304-.116.563-.348.778a1.046 1.046 0 0 1-.803.348c-.32 0-.588-.116-.802-.348L30 31.622l-6.047 6.03a1.046 1.046 0 0 1-.802.348c-.322 0-.59-.116-.803-.348a1.02 1.02 0 0 1-.348-.778c0-.321.116-.598.348-.83l6.047-6.057-6.047-6.057Z"/></svg>') 65 30 30, 66 pointer; transition: 67 opacity var(--dur-in, 0.5s) var(--ease-in, ease), 68 visibility 0s linear var(--dur-in, 0.5s), 69 background-color var(--dur-in, 0.5s) var(--ease-in, ease); 70 transition-property: opacity, visibility, background-color; 71 } 72 73 .account { 74 position: relative; 75 z-index: 2; 76 display: flex; 77 flex-direction: column; 78 align-items: stretch; 79 align-self: center; 80 flex: 0 0 auto; 81 width: min(var(--drawer-width, 48rem), calc(100vw - 3rem), 90vw); 82 max-width: 100%; 83 height: auto !important; 84 min-height: 0 !important; 85 max-height: min(80vh, calc(100dvh - 3rem)); 86 background: var(--shopify-account-color-background, #fff); 87 border: 1px solid var(--shopify-account-color-border, rgba(29, 29, 31, 0.08)); 88 box-shadow: 0 0 24px 0 var(--shopify-account-color-shadow, rgba(0, 0, 0, 0.08)); 89 overflow: hidden; 90 opacity: 0; 91 visibility: hidden; 92 pointer-events: none; 93 will-change: transform, opacity; 94 transform: scale(0.85); 95 transform-origin: center center; 96 transition: 97 opacity ${accountDialogOpenDurationMs}ms ease, 98 transform ${accountDialogOpenDurationMs}ms ease, 99 visibility 0s linear ${accountDialogOpenDurationMs}ms; 100 border-radius: var(--shopify-account-radius-dialog, 10px); 101 clip-path: inset(0 0 0 0 round var(--shopify-account-radius-dialog, 10px)); 102 } 103 104 .account__content, 105 .account__login-form-container, 106 shopify-login-form { 107 display: block; 108 height: auto !important; 109 min-height: 0 !important; 110 flex: 0 1 auto; 111 } 112 113 :is(#close-button, .account__close, button[aria-label="Close menu"]) svg { 114 transition: transform 0.3s; 115 } 116 117 :is(#close-button, .account__close, button[aria-label="Close menu"]):hover svg { 118 transform: rotate(180deg); 119 } 120 121 nav.stack-inline { 122 align-self: stretch; 123 } 124 125 .dialog::backdrop { 126 background: transparent !important; 127 background-color: transparent !important; 128 opacity: 0 !important; 129 visibility: hidden !important; 130 transition: none !important; 131 animation: none !important; 132 } 133 134 .dialog[open].${accountDialogActiveClass} { 135 pointer-events: auto; 136 } 137 138 .dialog[open].${accountDialogActiveClass} .${accountOverlayClass} { 139 opacity: 1; 140 visibility: visible; 141 pointer-events: auto; 142 transition-delay: 0s; 143 } 144 145 .dialog[open].${accountDialogActiveClass} .account { 146 opacity: 1; 147 visibility: visible; 148 pointer-events: auto; 149 transform: scale(1); 150 transition-delay: 0s; 151 } 152 153 .dialog[open].${accountDialogClosingClass} { 154 pointer-events: none; 155 } 156 157 .dialog[open].${accountDialogClosingClass} .${accountOverlayClass} { 158 opacity: 0; 159 visibility: hidden; 160 transition: 161 opacity var(--dur-out, 0.48s) var(--ease-in, ease), 162 visibility 0s linear var(--dur-out, 0.48s), 163 background-color var(--dur-out, 0.48s) var(--ease-in, ease); 164 transition-property: opacity, visibility, background-color; 165 } 166 167 .dialog[open].${accountDialogClosingClass} .account { 168 visibility: visible; 169 pointer-events: none; 170 transition: none; 171 animation: zoomOut ${accountDialogCloseDurationMs}ms ${accountDialogCloseEasing} forwards; 172 } 173
174 @keyframes zoomOut { 175 0% { 176 transform: scale(1); 177 opacity: 1; 178 visibility: visible; 179 } 180 181 100% { 182 transform: scale(0.8); 183 opacity: 0; 184 visibility: hidden; 185 } 186 } 187 188 @keyframes ${accountSheetCloseAnimationName} { 189 0% { 190 transform: translateY(var(${accountSheetCloseOffsetProperty}, 0px)); 191 } 192 193 100% { 194 transform: translateY(calc(100% + 1rem)); 195 } 196 } 197 198 @media (min-width: 1025px) { 199 .account { 200 width: min(var(--drawer-width, 48rem), calc(100vw - 3rem), 90vw); 201 max-height: 80vh; 202 } 203 } 204 205 @media (max-width: 1024.98px) { 206 .dialog { 207 padding: 1.5rem !important; 208 } 209 210 .account { 211 width: min(100%, calc(100vw - 3rem)); 212 max-height: calc(100dvh - 3rem); 213 } 214 215 .dialog.${accountMobileSheetDialogClass} { 216 align-items: flex-end !important; 217 justify-content: center !important; 218 padding: 0 !important; 219 } 220 221 .dialog.${accountMobileSheetDialogClass} .account { 222 align-self: flex-end; 223 width: 100%; 224 max-width: 100%; 225 max-height: min(calc(100dvh - 0.75rem), 92dvh); 226 border-width: 1px 0 0; 227 border-radius: 20px 20px 0 0; 228 clip-path: none; 229 opacity: 1; 230 transform: translateY(calc(100% + 1rem)); 231 transform-origin: center bottom; 232 transition: 233 transform ${accountDialogOpenDurationMs}ms ease, 234 visibility 0s linear ${accountDialogOpenDurationMs}ms; 235 } 236 237 .dialog.${accountMobileSheetDialogClass} .account__header { 238 position: relative; 239 cursor: grab; 240 padding-top: 1.2rem; 241 } 242 243 .dialog[open].${accountDialogActiveClass}.${accountMobileSheetDialogClass} .account { 244 visibility: visible; 245 pointer-events: auto; 246 transform: translateY(0); 247 } 248 249 .dialog[open].${accountDialogClosingClass}.${accountMobileSheetDialogClass} .account { 250 opacity: 1; 251 visibility: visible; 252 pointer-events: none; 253 transition: none; 254 animation: ${accountSheetCloseAnimationName} ${accountDialogCloseDurationMs}ms ${accountDialogCloseEasing} forwards; 255 } 256 257 .dialog.${accountMobileSheetDialogClass}.is-dragging .account { 258 transition: none !important; 259 } 260 } 261 `,accountLoginShadowStyles=` 262 :host { 263 display: block; 264 width: 100%; 265 min-width: 0; 266 } 267 268 #shopify-element-wrapper, 269 .account__login-form, 270 .account__email-form, 271 .account__email-input-wrapper { 272 box-sizing: border-box; 273 width: 100%; 274 min-width: 0; 275 } 276 `,syncHeaderHeight=()=>{const header=document.querySelector(".header-site");header&&requestAnimationFrame(()=>{const height=header.getBoundingClientRect().height||0;document.body.style.setProperty("--header-height",`${Math.ceil(height)}px`)})},getSystemScrollbarWidth=()=>{if(typeof window.getScrollBarWidth?.init=="function")return window.getScrollBarWidth.init()||0;const viewportWidth=window.innerWidth||0,documentWidth=document.documentElement?.clientWidth||0,width=viewportWidth-documentWidth;return width>0?width:0},hasVisibleSystemTingleModal=()=>document.querySelector(".tingle-modal--visible")!=null,closeSystemCanvasBeforeOpenAccount=()=>{if(typeof window.CloseAllPopup=="function"){window.CloseAllPopup({source:"account-popup"});return}typeof window.publish=="function"&&window.publish("closeCanvas",{source:"account-popup"})},shouldPreserveNonAccountScrollLock=()=>!!(root.classList.contains("open-modal")||root.classList.contains("open-modal-shopable-video")||root.classList.contains("open-modal-offer-popup")||root.classList.contains("open-search")||root.classList.contains("open-minicart")||root.classList.contains("nav-open")||root.classList.contains("open-sidebar")||root.classList.contains("open-byl")||hasVisibleSystemTingleModal()||document.querySelector(".active-modal-js.active")),ensureSystemPopupLock=()=>{root.classList.contains(systemPopupOpenClass)||(root.classList.add(systemPopupOpenClass),document.body.classList.add(systemTingleEnabledClass),document.dispatchEvent(new CustomEvent("modal:opened")),!(window.innerWidth<767.95)&&document.body.style.setProperty("padding-right",`${getSystemScrollbarWidth()}px`))},syncAccountScrollLockState=hasOpenAccountSheet=>{hasOpenAccountSheet&&(ensureSystemPopupLock(),!shouldPreserveNonAccountScrollLock()&&(removeInlineLockStyle(root,"overflow",["hidden"]),removeInlineLockStyle(root,"touch-action",["none"]),removeInlineLockStyle(root,"scrollbar-gutter",["stable"]),removeInlineLockStyle(document.body,"touch-action",["none"])))},getAccountDialog=account=>{const shadowRoot=account?.shadowRoot;return shadowRoot?shadowRoot.querySelector("dialog"):null},getAccountPanel=account=>{const shadowRoot=account?.shadowRoot;return shadowRoot?shadowRoot.querySelector(".account"):null},getAccountCloseTrigger=account=>{const shadowRoot=account?.shadowRoot;return shadowRoot?shadowRoot.querySelector('#close-button, .account__close, button[aria-label="Close menu"]'):null},getAccountAuthState=account=>{const shadowRoot=account?.shadowRoot;if(!shadowRoot)return"unknown";const avatarTrigger=shadowRoot.querySelector(".account-button[part]");if(!(avatarTrigger instanceof HTMLElement))return"unknown";const partValue=(avatarTrigger.getAttribute("part")||"").trim();return partValue?partValue.includes("signed-in-avatar")?"signed-in":partValue.includes("signed-out-avatar")?"signed-out":"unknown":"unknown"},syncAccountAuthState=account=>{account&&(account.dataset.accountAuthState=getAccountAuthState(account))},isMobileSheetAccount=account=>account?.dataset?.accountPopupLayout===accountMobileSheetLayout,shouldUseMobileSheet=account=>isMobileSheetAccount(account)&&window.innerWidth<=1024,clearAccountSheetOffset=accountPanel=>{accountPanel instanceof HTMLElement&&(accountPanel.style.removeProperty(accountSheetCloseOffsetProperty),accountPanel.style.removeProperty("transform"),accountPanel.style.removeProperty("transition"),accountPanel.style.removeProperty("will-change"))},syncAccountDialogLayout=account=>{const dialog=getAccountDialog(account);if(!(dialog instanceof HTMLDialogElement))return;const useMobileSheet=shouldUseMobileSheet(account);dialog.classList.toggle(accountMobileSheetDialogClass,useMobileSheet),useMobileSheet||(dialog.classList.remove("is-dragging"),clearAccountSheetOffset(getAccountPanel(account)))},getDeepActiveElement=rootNode=>{let activeElement=rootNode?.activeElement||null;for(;activeElement?.shadowRoot?.activeElement;)activeElement=activeElement.shadowRoot.activeElement;return activeElement},shouldSuppressInitialAccountFieldFocus=account=>(accountInitialFocusSuppressUntil.get(account)||0)>Date.now(),toggleAccountInitialFocusSuppression=(account,suppressed)=>{const dialog=getAccountDialog(account);if(!(dialog instanceof HTMLDialogElement))return;dialog.querySelectorAll(".account__content, .account__login-form-container, shopify-login-form").forEach(target=>{target instanceof HTMLElement&&(target.inert=suppressed,suppressed?target.setAttribute("data-initial-focus-suppressed","true"):target.removeAttribute("data-initial-focus-suppressed"))})},clearInitialAccountFieldFocusGuard=account=>{const timerId=accountInitialFocusGuardTimers.get(account);timerId!=null&&(window.clearTimeout(timerId),accountInitialFocusGuardTimers.delete(account)),accountInitialFocusSuppressUntil.delete(account),toggleAccountInitialFocusSuppression(account,!1)},preventInitialAccountFieldFocus=account=>{const shadowRoot=account?.shadowRoot;if(!shadowRoot)return;const dialog=getAccountDialog(account);if(!(dialog instanceof HTMLDialogElement)||!dialog.hasAttribute("open"))return;const activeElement=getDeepActiveElement(shadowRoot);if(!(activeElement instanceof HTMLElement)||!activeElement.matches('input, textarea, select, [contenteditable="true"]'))return;activeElement.blur();const fallbackFocusTarget=getAccountCloseTrigger(account)||getAccountPanel(account)||dialog;fallbackFocusTarget instanceof HTMLElement&&(fallbackFocusTarget.hasAttribute("tabindex")||fallbackFocusTarget.setAttribute("tabindex","-1"),fallbackFocusTarget.focu
276s({preventScroll:!0}))},handleInitialAccountFieldFocus=account=>{shouldSuppressInitialAccountFieldFocus(account)&&window.setTimeout(()=>{preventInitialAccountFieldFocus(account)},0)},armInitialAccountFieldFocusGuard=account=>{clearInitialAccountFieldFocusGuard(account),accountInitialFocusSuppressUntil.set(account,Date.now()+accountInitialFocusGuardDurationMs),toggleAccountInitialFocusSuppression(account,!0),window.setTimeout(()=>{preventInitialAccountFieldFocus(account)},0),accountInitialFocusGuardTimers.set(account,window.setTimeout(()=>{clearInitialAccountFieldFocusGuard(account)},accountInitialFocusGuardDurationMs))},shouldPreserveDocumentScrollLock=()=>root.classList.contains("open-modal-account")||root.classList.contains("open-modal")||root.classList.contains("open-modal-shopable-video")||root.classList.contains("open-modal-offer-popup")||root.classList.contains("open-search")||root.classList.contains("open-minicart")||root.classList.contains("nav-open")||root.classList.contains("open-sidebar")||root.classList.contains("open-byl")||hasVisibleSystemTingleModal()||document.querySelector(".active-modal-js.active")?!0:[...document.querySelectorAll(accountSelector)].some(account=>account?.dataset?.accountSheetClosing==="true"||isAccountSheetOpen(account)),removeInlineLockStyle=(element,property,expectedValues=[])=>{if(!element?.style)return;const value=element.style.getPropertyValue(property).trim();value&&(expectedValues.length>0&&!expectedValues.includes(value)||element.style.removeProperty(property))},releaseAccountScrollLock=()=>{shouldPreserveDocumentScrollLock()||(root.classList.remove(systemPopupOpenClass),document.body.classList.remove(systemTingleEnabledClass),document.dispatchEvent(new CustomEvent("modal:closed")),document.body.style.removeProperty("padding-right"),removeInlineLockStyle(root,"overflow",["hidden"]),removeInlineLockStyle(root,"touch-action",["none"]),removeInlineLockStyle(root,"scrollbar-gutter",["stable"]),removeInlineLockStyle(document.body,"overflow",["hidden"]),removeInlineLockStyle(document.body,"touch-action",["none"]))},scheduleAccountScrollLockCleanup=()=>{window.requestAnimationFrame(()=>{releaseAccountScrollLock(),window.setTimeout(releaseAccountScrollLock,0)})},requestNativeAccountClose=account=>{const dialog=getAccountDialog(account);if(!(dialog instanceof HTMLDialogElement))return!1;const closeTrigger=getAccountCloseTrigger(account);return closeTrigger instanceof HTMLElement?(accountNativeCloseBypass.add(account),closeTrigger.click(),window.requestAnimationFrame(()=>{accountNativeCloseBypass.delete(account)}),!0):typeof dialog.requestClose=="function"?(dialog.requestClose(),!0):(dialog.close(),!0)},ensureAccountDialogStructure=account=>{const dialog=getAccountDialog(account);if(!(dialog instanceof HTMLDialogElement)||dialog.querySelector(`.${accountOverlayClass}`))return;const overlay=document.createElement("div");overlay.className=accountOverlayClass,overlay.setAttribute("aria-hidden","true"),dialog.prepend(overlay)},getDialogAnimationDuration=()=>accountDialogCloseDurationMs,getAccountCloseAnimationName=account=>{const dialog=getAccountDialog(account);return dialog instanceof HTMLDialogElement&&dialog.classList.contains(accountMobileSheetDialogClass)?accountSheetCloseAnimationName:"zoomOut"},ensureAccountSheetDrag=account=>{const shadowRoot=account?.shadowRoot;if(!shadowRoot||accountSheetDragStates.has(account))return;const state={isDragging:!1,startY:0,currentY:0},startDrag=event=>{if(!shouldUseMobileSheet(account))return;const dialog=getAccountDialog(account),accountPanel=getAccountPanel(account);if(!(dialog instanceof HTMLDialogElement)||!(accountPanel instanceof HTMLElement)||!dialog.hasAttribute("open"))return;const target=event.target;target instanceof Element&&target.closest(".account__header")&&(target.closest('#close-button, .account__close, button[aria-label="Close menu"]')||(state.isDragging=!0,state.startY=event.type.includes("mouse")?event.clientY:event.touches[0].clientY,state.currentY=state.startY,dialog.classList.add("is-dragging"),accountPanel.style.transition="none",accountPanel.style.willChange="transform"))},onDrag=event=>{if(!state.isDragging||!shouldUseMobileSheet(account))return;const accountPanel=getAccountPanel(account);if(!(accountPanel instanceof HTMLElement))return;event.cancelable&&event.preventDefault(),state.currentY=event.type.includes("mouse")?event.clientY:event.touches[0].clientY;const offset=Math.max(0,state.currentY-state.startY)*sheetDragResistance;accountPanel.style.setProperty(accountSheetCloseOffsetProperty,`${offset}px`),accountPanel.style.transform=`translateY(${offset}px)`},endDrag=()=>{if(!state.isDragging)return;state.isDragging=!1;const dialog=getAccountDialog(account),accountPanel=getAccountPanel(account);if(!(dialog instanceof HTMLDialogElement)||!(accountPanel instanceof HTMLElement))return;if(dialog.classList.remove("is-dragging"),Math.max(0,state.currentY-state.startY)>sheetDragThreshold){closeAccountPopup(account);return}accountPanel.style.transition="transform 0.1s ease-in-out",accountPanel.style.transform="",accountPanel.style.removeProperty(accountSheetCloseOffsetProperty),window.setTimeout(()=>{accountPanel.style.removeProperty("transition"),accountPanel.style.removeProperty("will-change")},120)};shadowRoot.addEventListener("touchstart",startDrag,{passive:!0}),shadowRoot.addEventListener("mousedown",startDrag),document.addEventListener("touchmove",onDrag,{passive:!1}),document.addEventListener("mousemove",onDrag),document.addEventListener("touchend",endDrag),document.addEventListener("mouseup",endDrag),accountSheetDragStates.set(account,state)},clearScheduledAccountOpen=account=>{const frameId=accountOpenFrames.get(account);frameId!=null&&(window.cancelAnimationFrame(frameId),accountOpenFrames.delete(account))},clearAccountCloseTimer=account=>{const closeState=accountCloseTimers.get(account);
276closeState&&(window.clearTimeout(closeState.timeoutId),closeState.animationTarget&&closeState.handleAnimationEnd&&closeState.animationTarget.removeEventListener("animationend",closeState.handleAnimationEnd),accountCloseTimers.delete(account))},queueAccountDialogOpen=account=>{const dialog=getAccountDialog(account);if(!(dialog instanceof HTMLDialogElement)||!dialog.hasAttribute("open")||dialog.classList.contains(accountDialogClosingClass))return;syncAccountDialogLayout(account),clearScheduledAccountOpen(account),clearAccountCloseTimer(account),dialog.classList.remove(accountDialogActiveClass),dialog.classList.remove(accountDialogClosingClass);const frameId=window.requestAnimationFrame(()=>{const activeDialog=getAccountDialog(account);accountOpenFrames.delete(account),!(!(activeDialog instanceof HTMLDialogElement)||!activeDialog.hasAttribute("open"))&&(syncAccountDialogLayout(account),activeDialog.classList.add(accountDialogActiveClass),armInitialAccountFieldFocusGuard(account))});accountOpenFrames.set(account,frameId)},ensureAccountDialogActive=account=>{const dialog=getAccountDialog(account);!(dialog instanceof HTMLDialogElement)||!dialog.hasAttribute("open")||accountOpenFrames.has(account)||dialog.classList.contains(accountDialogActiveClass)||dialog.classList.contains(accountDialogClosingClass)||queueAccountDialogOpen(account)},resetAccountDialogState=account=>{const dialog=getAccountDialog(account);dialog instanceof HTMLDialogElement&&(clearInitialAccountFieldFocusGuard(account),clearScheduledAccountOpen(account),dialog.classList.remove(accountDialogActiveClass),dialog.classList.remove(accountDialogClosingClass),dialog.classList.remove("is-dragging"),clearAccountSheetOffset(getAccountPanel(account)),syncAccountDialogLayout(account))},ensureAccountDialogInteractions=account=>{const shadowRoot=account?.shadowRoot;shadowRoot&&shadowRoot.querySelectorAll("dialog").forEach(dialog=>{accountDialogListeners.has(dialog)||(dialog.addEventListener("cancel",event=>{event.preventDefault(),closeAccountPopup(account)}),dialog.addEventListener("close",()=>{finishAccountPopupState(account,!1)}),accountDialogListeners.add(dialog))})},isAccountSheetOpen=account=>{const shadowRoot=account?.shadowRoot;return shadowRoot?shadowRoot.querySelector("dialog[open], [popover]:popover-open")!=null:account?.dataset.accountSheetOpen==="true"},syncAccountSheetState=()=>{const hasOpenAccountSheet=[...document.querySelectorAll(accountSelector)].some(account=>{const isOpen=isAccountSheetOpen(account);return account.dataset.accountSheetOpen=isOpen?"true":"false",syncAccountAuthState(account),isOpen});root.classList.toggle("open-modal-account",hasOpenAccountSheet),syncAccountScrollLockState(hasOpenAccountSheet)},startClosingAccountPopup=account=>{account&&(clearScheduledAccountOpen(account),closingAccounts.add(account),account.dataset.accountSheetClosing="true",syncAccountSheetState())},finishAccountPopupState=(account,isOpen)=>{account&&(clearScheduledAccountOpen(account),clearAccountCloseTimer(account),isOpen?(closingAccounts.delete(account),account.dataset.accountSheetClosing="false",account.dataset.accountSheetOpen="true",clearAccountSheetOffset(getAccountPanel(account)),syncAccountDialogLayout(account),queueAccountDialogOpen(account)):(closingAccounts.delete(account),account.dataset.accountSheetClosing="false",account.dataset.accountSheetOpen="false",resetAccountDialogState(account)),syncAccountSheetState(),isOpen||scheduleAccountScrollLockCleanup())},ensureAccountDialogStyles=account=>{const shadowRoot=account?.shadowRoot;if(!shadowRoot||shadowRoot.getElementById(accountShadowStyleId))return;const style=document.createElement("style");style.id=accountShadowStyleId,style.textContent=accountShadowStyles,shadowRoot.append(style)},ensureAccountLoginFormStyles=account=>{const shadowRoot=account?.shadowRoot;shadowRoot&&shadowRoot.querySelectorAll("shopify-login-form").forEach(loginForm=>{const loginShadowRoot=loginForm.shadowRoot;if(!loginShadowRoot||(accountInitialFocusGuardRoots.has(loginShadowRoot)||(loginShadowRoot.addEventListener("focusin",()=>{handleInitialAccountFieldFocus(account)}),accountInitialFocusGuardRoots.add(loginShadowRoot)),loginShadowRoot.getElementById(accountLoginShadowStyleId)))return;const style=document.createElement("style");style.id=accountLoginShadowStyleId,style.textContent=accountLoginShadowStyles,loginShadowRoot.append(style)})},observeAccountPopup=account=>{const shadowRoot=account?.shadowRoot;if(!shadowRoot||accountObservers.has(account))return;const observer=new MutationObserver(()=>{const dialogIsOpen=shadowRoot.querySelector("dialog[open], [popover]:popover-open")!=null,previousDialogState=account.dataset.accountSheetOpen==="true";if(ensureAccountDialogStructure(account),ensureAccountDialogInteractions(account),ensureAccountLoginFormStyles(account),ensureAccountSheetDrag(account),syncAccountDialogLayout(account),syncAccountAuthState(account),closingAccounts.has(account)){if(!dialogIsOpen){finishAccountPopupState(account,!1);return}syncAccountSheetState();return}if(dialogIsOpen!==previousDialogState){finishAccountPopupState(account,dialogIsOpen);return}dialogIsOpen&&ensureAccountDialogActive(account),syncAccountSheetState()});observer.observe(shadowRoot,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]}),accountObservers.set(account,observer)},closeAccountPopup=account=>{const dialog=getAccountDialog(account),accountPanel=getAccountPanel(account);if(!(dialog instanceof HTMLDialogElement))return;if(!dialog.hasAttribute("open")){finishAccountPopupState(account,!1);return}if(!(accountPanel instanceof HTMLElement)){dialog.close();return}if(dialog.classList.contains(accountDialogClosingClass))return;startClosingAccountPopup(account),clearAccountCloseTimer(account),syncAccountDialogLayout(account),dialog.classList.remove(accountDialogActiveClass),dialog.classList.add(accountDialogClosingClass);const finishClose=()=>{if(clearAccountCloseTimer(account),dialog.hasAttribute("open")){requestNativeAccountClose(account),window.setTimeout(()=>{dialog.hasAttribute("open")&&dialog.close()},32);return}finishAccountPopupState(account,!1)},handleAnimationEnd=event=>{event.target!==accountPanel||event.animationName!==getAccountCloseAnimationName(account)||finishClose()};accountPanel.addEventListener("animationend",handleAnimationEnd),accountCloseTimers.set(account,{timeoutId:window.setTimeout(finishClose,getDialogAnimationDuration(dialog)+32),animationTarget:accountPanel,handleAnimationEnd})},handleAccountShadowClick=(account,event)=>{const target=event.target;if(!(target instanceof Element))return;const dialog=getAccountDialog(account);if(target.closest(".account-button")&&dialog instanceof HTMLDialogElement&&!dialog.hasAttribute("open")){closeSystemCanvasBeforeOpenAccount(),ensureSystemPopupLock(),armInitialAccountFieldFocusGuard(account);return}if(target.closest('#close-button, .account__close, button[aria-label="Close menu"]')){if(accountNativeCloseBypass.has(account))return;event.preventDefault(),event.stopImmediatePropagation(),closeAccountPopup(account);return}if(target.closest(`.${accountOverlayClass}`)){event.preventDefault(),event.stopImmediatePropagation(),closeAccountPopup(account);return}target instanceof HTMLDialogElement&&target.hasAttribute("open")&&(event.preventDefault(),event.stopImmediatePropagation(),closeAccountPopup(account))},bindAccountPopup=account=>{!account||account.dataset.accountPopupBound==="true"||account.dataset.accountPopupBinding!=="true"&&(account.dataset.accountPopupBinding="true",customElements.whenDefined("shopify-account").then(()=>{const bindWhenShadowReady=(attempt=0)=>{if(!account?.isConnected){account.dataset.accountPopupBinding="false";return}const shadowRoot=account.shadowRoot;if(!shadowRoot){if(attempt<180){window.requestAnimationFrame(()=>bindWhenShadowReady(attempt+1));return}account.dataset.accountPopupBinding="false";return}if(account.dataset.accountPopupBound==="true"){account.dataset.accountPopupBinding="false";return}if(ensureAccountDialogStyles(account),ensureAccountDialogStructure(account),ensureAccountLoginFormStyles(account),ensureAccountDialogInteractions(account),ensureAccountSheetDrag(account),syncAccountDialogLayout(account),observeAccountPopup(account),syncAccountAuthState(account),syncAccountSheetState(),accountInitialFocusGuardRoots.has(shadowRoot)||(shadowRoot.addEventListener("focusin",()=>{handleInitialAccountFieldFocus(account)}),accountInitialFocusGuardRoots.add(shadowRoot)),shadowRoot.addEventListener("click",event=>{handleAccountShadowClick(account,event)},!0),shadowRoot.addEventListener("keydown",event=>{if(event.key!=="Escape")return;const dialog=getAccountDialog(account);!(dialog instanceof HTMLDialogElement)||!dialog.hasAttribute("open")||(event.preventDefault(),event.stopImmediatePropagation(),closeAccountPopup(account))}),typeof window.subscribe=="function"&&!accountCloseCanvasSubscriptions.has(account)){const unsubscribe=window.subscribe("closeCanvas",data=>{if(data?.source==="account-popup")return;const dialog=getAccountDialog(account);!(dialog instanceof HTMLDialogElement)||!dialog.hasAttribute("open")||closeAccountPopup(account)});accountCloseCanvasSubscriptions.set(account,unsubscribe)}account.dataset.accountPopupBound="true",account.dataset.accountPopupBinding="false"};bindWhenShadowReady()}))},bindAccountPopups=(scope=document)=>{scope.querySelectorAll(accountSelector).forEach(account=>{bindAccountPopup(account),syncAccountDialogLayout(account)}),syncAccountSheetState()},handleSectionLoad=event=>{syncHeaderHeight(),bindAccountPopups(event.target||document)},api={bindAccountPopups,syncHeaderHeight};window[globalKey]=api,syncHeaderHeight(),bindAccountPopups(),window.addEventListener("resize",()=>{syncHeaderHeight(),bindAccountPopups()}),document.addEventListener("shopify:section:load",handleSectionLoad)})(); 277//# sourceMappingURL=/cdn/shop/t/8/assets/header-account-popup.js.map?v=70616059796741680501790236615
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.