import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(r={getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store},c={},t.d(c,r),c),{actions:n}=(0,o.store)("woocommerce/customer-account/private",{actions:{handleDocumentClick:e=>{const t=(0,o.getContext)();if(!t.isDropdownOpen)return;const{ref:n}=(0,o.getElement)();n&&!n.contains(e.target)&&(t.isDropdownOpen=!1)},handleKeydown:e=>{if("Escape"!==e.key)return;const t=(0,o.getContext)();t.isDropdownOpen&&(t.isDropdownOpen=!1,(()=>{const{ref:e}=(0,o.getElement)(),t=e?.querySelector(".wc-block-customer-account__toggle");t?.focus()})())},handleFocusOut:e=>{const t=(0,o.getContext)();if(!t.isDropdownOpen)return;const{ref:n}=(0,o.getElement)(),r=e.relatedTarget;!n||r&&n.contains(r)||(t.isDropdownOpen=!1)},toggleDropdown:e=>{e.preventDefault(),e.stopPropagation();const t=(0,o.getContext)();if(t.isDropdownOpen)return void(t.isDropdownOpen=!1);const n=(()=>{const{ref:e}=(0,o.getElement)();return e?.closest(".wc-block-customer-account--has-dropdown")})();n&&(((e,t)=>{const o=t.getBoundingClientRect(),n=window.innerHeight,r=document.documentElement.clientWidth;e.showAbove=o.bottom>.6*n;const c=(e=>e.querySelector(".wc-block-customer-account__dropdown"))(t);if(!c)return;c.hidden=!1;const s=c.offsetWidth;c.hidden=!0;const d=r-(o.left+s);e.alignRight=d<16})(t,n),n.style.setProperty("--wc-customer-account-dropdown-surface",(()=>{const e=getComputedStyle(document.body).backgroundColor;return e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e?e:"#fff"})())),t.isDropdownOpen=!0}}});var r,c;(0,o.store)("woocommerce/customer-account",{state:{get isDropdownOpen(){return(0,o.getContext)().isDropdownOpen}},actions:{toggleDropdown:e=>{n.toggleDropdown(e)}}});