@momentum-design/components 0.130.7 → 0.130.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2700,7 +2700,7 @@
2700
2700
  border-top-right-radius: var(--mdc-popover-arrow-border-radius);
2701
2701
  border-bottom-left-radius: 100%;
2702
2702
  }
2703
- `,wv=[Lx];var id=V.constructTagName("popoverportal"),rd=class extends X{connectedCallback(){super.connectedCallback(),this.ariaHidden="true",this.style.display="none"}disconnectedCallback(){var o;super.disconnectedCallback(),(o=this.onDisconnect)==null||o.call(this)}};var od=class{constructor(o){this.portalElement=null;this.disconnectAfterAppendTo=!1;this.arrowPixelChange=!1;this.popover=o}setupDelay(){try{let[o,t]=this.popover.delay.split(",").map(r=>{let s=parseInt(r,10);if(Number.isNaN(s)||s<0)throw new Error(`Invalid delay value: ${r}`);return s});return[o,t]}catch{return this.popover.delay="0,0",[0,0]}}setupHoverBridge(o){let t=this.popover.renderRoot.querySelector('div[part="popover-hover-bridge"]');Object.assign(t.style,{top:"",left:"",right:"",bottom:""});let r=`calc(${this.popover.showArrow?"0.75rem + ":""}${this.popover.offset+1}px)`,s=this.popover.offsetHeight||0,d=this.popover.offsetWidth||0;if(t)switch(o.split("-")[0]){case"top":t.style.height=r,t.style.bottom=`calc(-1 * (${r}))`,t.style.left="50%",t.style.width=`${d}px`;break;case"left":t.style.height=`${s}px`,t.style.width=r,t.style.right=`calc(-1.5 * (${r}))`;break;case"right":t.style.height=`${s}px`,t.style.width=r,t.style.left=`calc(-0.5 * (${r}))`;break;case"bottom":default:t.style.height=r,t.style.top=`calc(-1 * (${r}))`,t.style.left="50%",t.style.width=`${d}px`;break}}setupAppendTo(){var o,t;if(this.popover.appendTo){let r=document.getElementById(this.popover.appendTo);r&&!Array.from(r.children).includes(this.popover)&&(this.disconnectAfterAppendTo=!0,this.portalElement=document.createElement(id),this.portalElement.onDisconnect=()=>{this.popover.remove(),this.portalElement=null},(t=(o=this.popover.parentElement)==null?void 0:o.appendChild)==null||t.call(o,this.portalElement),r.appendChild(this.popover))}}cleanupAppendTo(){!this.disconnectAfterAppendTo&&this.portalElement&&this.portalElement.remove(),this.disconnectAfterAppendTo=!1}updateAriaLabels(){var o,t,r;this.popover.interactive&&this.popover.role&&(this.popover.ariaLabel||(this.popover.ariaLabel=((o=this.popover.triggerElement)==null?void 0:o.ariaLabel)||((t=this.popover.triggerElement)==null?void 0:t.textContent)||""),!this.popover.ariaLabelledby&&!this.popover.ariaLabel&&(this.popover.ariaLabelledby=((r=this.popover.triggerElement)==null?void 0:r.id)||""))}updateAriaModal(){this.popover.role===J.DIALOG||this.popover.role===J.ALERTDIALOG?this.popover.setAttribute("aria-modal","true"):this.popover.removeAttribute("aria-modal")}updateAriaExpandedAttribute(){var o,t,r;this.popover.disableAriaExpanded||((o=this.popover.triggerElement)==null||o.setAttribute("aria-expanded",`${this.popover.visible}`),(r=this.popover.triggerElement)==null||r.setAttribute("aria-haspopup",((t=this.popover.triggerElement)==null?void 0:t.getAttribute("aria-haspopup"))||this.popover.role||"dialog"))}updateArrowStyle(o,t){var $;if(!this.popover.arrowElement)return;let r=t.split("-")[0],s={top:"bottom",right:"left",bottom:"top",left:"right"}[r],{x:d,y:c}=o,f=this.popover.arrowElement.getBoundingClientRect(),y=($=this.popover.arrowElement.offsetParent)==null?void 0:$.getBoundingClientRect();if(!this.arrowPixelChange){let Y=y!=null&&y[s]?12-Math.abs(f[s]-y[s]):0;Math.round(Y)===1?this.arrowPixelChange=!0:this.arrowPixelChange=!1}let I=this.arrowPixelChange?.5:0;this.popover.arrowElement.setAttribute("data-side",r),Object.assign(this.popover.arrowElement.style,{left:d!=null?`${d}px`:"",top:c!=null?`${c}px`:"",[s]:`${-this.popover.arrowElement.offsetHeight/2-I}px`})}updatePopoverStyle(o,t){Object.assign(this.popover.style,{left:`${o}px`,top:`${t}px`})}};var _t=class extends Lt(Ct(kl(Il(Sl(X))))){constructor(){super();this.depthManager=new Yi(this);this.id="";this.triggerID="";this.trigger=St.TRIGGER;this.placement=St.PLACEMENT;this.color=St.COLOR;this.visible=St.VISIBLE;this.offset=St.OFFSET;this.boundary=St.BOUNDARY;this.boundaryRoot=St.BOUNDARY_ROOT;this.focusTrap=St.FOCUS_TRAP;this.preventScroll=St.PREVENT_SCROLL;this.showArrow=St.ARROW;this.closeButton=St.CLOSE_BUTTON;this.interactive=St.INTERACTIVE;this.delay=St.DELAY;this.hideOnEscape=St.HIDE_ON_ESCAPE;this.propagateEventOnEscape=St.PROPAGATE_EVENT_ON_ESCAPE;this.hideOnBlur=St.HIDE_ON_BLUR;this.hideOnOutsideClick=St.HIDE_ON_CLICK_OUTSIDE;this.focusBackToTrigger=St.FOCUS_BACK;this.backdrop=St.BACKDROP;this.isBackdropInvisible=St.IS_BACKDROP_INVISIBLE;this.disableFlip=St.DISABLE_FLIP;this.size=St.SIZE;this.closeButtonAriaLabel=null;this.strategy=St.STRATEGY;this.role=St.ROLE;this.ariaLabelledby=null;this.ariaDescribedby=null;this.disableAriaExpanded=St.DISABLE_ARIA_EXPANDED;this.keepConnectedTooltipOpen=St.KEEP_CONNECTED_TOOLTIP_OPEN;this.animationFrame=St.ANIMATION_FRAME;this.arrowElement=null;this.isHovered=!1;this.openDelay=0;this.closeDelay=0;this.floatingUICleanupFunction=null;this.shouldSuppressOpening=!1;this.timers=new ed(this);this.parseTrigger=()=>{var d;let s=(((d=this.trigger)==null?void 0:d.split(" "))||[]).filter(c=>Object.values(Ke).includes(c)).length>0?this.trigger:St.TRIGGER;s==="mouseenter"&&(this.interactive?s="mouseenter click":s="mouseenter focusin"),this.trigger=s};this.setupTriggerListeners=()=>{if(this.trigger.includes("click")&&(document.addEventListener("click",this.togglePopoverVisible,{capture:!0}),this.hideOnBlur&&document.addEventListener("focusout",this.handleFocusOut,{capture:!0})),this.trigger.includes("mouseenter")){let t=this.renderRoot.querySelector('div[part="popover-hover-bridge"]');t==null||t.addEventListener("mouseenter",this.show),document.addEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.addEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.addEventListener("mouseenter",this.cancelCloseDelay),this.addEventListener("mouseleave",this.startCloseDelay)}this.trigger.includes("focusin")&&(document.addEventListener("focusin",this.handleFocusIn,{capture:!0}),this.interactive||document.addEventListener("focusout",this.handleFocusOut,{capture:!0}))};this.removeTriggerListeners=()=>{document.removeEventListener("click",this.togglePopoverVisible,{capture:!0});let t=this.renderRoot.querySelector('div[part="popover-hover-bridge"]');t==null||t.removeEventListener("mouseenter",this.show),document.removeEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.removeEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.removeEventListener("mouseenter",this.cancelCloseDelay),this.removeEventListener("mouseleave",this.startCloseDelay),document.removeEventListener("focusin",this.handleFocusIn,{capture:!0}),document.removeEventListener("focusout",this.handleFocusOut,{capture:!0})};this.removeAllListeners=()=>{this.removeTriggerListeners(),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown)),this.hideOnBlur&&this.removeEventListener("focusout",this.onPopoverFocusOut)};this.onOutsidePopoverClick=t=>{if(!this.depthManager.isHostOnTop())return;let r=t.composedPath(),s=this.contains(t.target)||r.includes(this.triggerElement)||r.includes(this),d=this.backdropElement?r.includes(this.backdropElement):!1;(!s||d)&&(this.hide(),Ti.onClickOutside(this))};this.onEscapeKeydown=t=>{!this.visible||this.getActionForKeyEvent(t)!==q.ESCAPE||!this.depthManager.isHostOnTop()||(this.propagateEventOnEscape||t.stopPropagation(),t.preventDefault(),this.hide(),Ti.onEscapeKeyPressed(this),this.keyDownEventHandled())};this.onPopoverFocusOut=t=>{this.contains(t.relatedTarget)||this.hide()};this.handleMouseEnter=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!0,this.show())};this.handleMouseLeave=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!1,this.startCloseDelay())};this.handleFocusOut=t=>{if(this.isEventFromTrigger(t)){if(this.hideOnBlur){let{relatedTarget:r}=t;this.contains(r)||this.hide();return}this.isHovered||this.hide()}};this.handleFocusIn=t=>{var r,s,d,c;this.isEventFromTrigger(t)&&((r=this.triggerElement)!=null&&r.matches(":focus-visible")||(c=(d=(s=this.triggerElement)==null?void 0:s.shadowRoot)==null?void 0:d.querySelector(".mdc-focus-ring"))!=null&&c.matches(":focus-visible")||this.isHovered)&&this.show()};this.cancelOpenDelay=()=>{this.timers.clearTimeout(bi.OPEN)};this.startCloseDelay=()=>{this.cancelOpenDelay(),this.interactive?this.timers.setTimeout(bi.HOVER,()=>{this.visible=!1},this.closeDelay):this.hide()};this.cancelCloseDelay=()=>{this.timers.clearTimeout(bi.HOVER),this.timers.clearTimeout(bi.CLOSE)};this.hide=()=>{this.cancelOpenDelay();let t=()=>{this.visible=!1};this.closeDelay>0?this.timers.setTimeout(bi.CLOSE,t,this.closeDelay):(this.timers.clearTimeout(bi.CLOSE),t())};this.togglePopoverVisible=t=>{this.isEventFromTrigger(t)&&(this.visible?this.hide():this.show())};this.positionPopover=()=>{let{triggerElement:t}=this;if(!t)return;let r=!this.boundary||this.boundary==="clippingAncestors"?"clippingAncestors":Array.from(document.querySelectorAll(this.boundary)),s=this.boundaryRoot,d=[Av({boundary:r,rootBoundary:s,padding:this.boundaryPadding})],c=this.offset;if(this.disableFlip||d.push(Sv({boundary:r,rootBoundary:s})),this.size){let f=I=>{this.style.setProperty("--mdc-popover-internal-available-height",`${I}px`)},y=this.renderRoot.querySelector('[part="popover-content"]');d.push(Iv({boundary:r,rootBoundary:s,apply({availableHeight:I}){y&&(Object.assign(y.style,{maxHeight:`${I}px`,overflowY:"auto"}),f(I))},padding:50}))}if(this.showArrow&&(this.arrowElement=this.renderRoot.querySelector('div[part="popover-arrow"]'),this.arrowElement)){let f=this.arrowElement.offsetHeight,y=Math.sqrt(2*f**2)/2;c+=y,d.push(_v({element:this.arrowElement,padding:12}))}d.push(xv(c)),this.floatingUICleanupFunction=Tv(t,this,async()=>{let{triggerElement:f}=this;if(!f)return;let y=this.adjustPlacementForRtl(this.placement),{x:I,y:$,middlewareData:Y,placement:Q}=await Cv(f,this,{placement:y,middleware:d,strategy:this.strategy});this.utils.updatePopoverStyle(I,$),Y.arrow&&this.arrowElement&&this.utils.updateArrowStyle(Y.arrow,Q),this.trigger.includes("mouseenter")&&this.utils.setupHoverBridge(Q)},{animationFrame:this.animationFrame})};this.show=this.show.bind(this),this.utils=new od(this),this.parseTrigger(),[this.openDelay,this.closeDelay]=this.utils.setupDelay()}get zIndex(){return Number.isInteger(this.internalZIndex)?this.internalZIndex:this.depthManager.getHostZIndex()}set zIndex(t){this.internalZIndex=t}get connectedTooltip(){let t=this.getRootNode().querySelectorAll(`mdc-tooltip[triggerID="${this.triggerID}"]`);return Array.from(t).find(r=>r!==this)}get triggerElement(){return this.getRootNode().querySelector(`[id="${this.triggerID}"]`)}async firstUpdated(t){super.firstUpdated(t),Ti.onCreatedPopover(this)}connectedCallback(){super.connectedCallback(),this.utils.setupAppendTo(),this.setupTriggerListeners()}async disconnectedCallback(){var t,r;super.disconnectedCallback(),this.removeAllListeners(),(t=this.deactivateFocusTrap)==null||t.call(this),this.deactivatePreventScroll(),this.moveElementBackAfterBackdropRemoval(this.triggerElement),this.removeBackdrop(),(r=this.floatingUICleanupFunction)==null||r.call(this),this.keepConnectedTooltipOpen||this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),this.utils.cleanupAppendTo(),Ti.onDestroyedPopover(this)}async updated(t){if(super.updated(t),t.has("visible")){let r=t.get("visible")||!1;await this.isOpenUpdated(r,this.visible),this.utils.updateAriaExpandedAttribute()}t.has("trigger")&&(this.parseTrigger(),this.removeTriggerListeners(),this.setupTriggerListeners()),t.has("placement")&&this.setAttribute("placement",Object.values(Nt).includes(this.placement)?this.placement:St.PLACEMENT),t.has("delay")&&([this.openDelay,this.closeDelay]=this.utils.setupDelay()),t.has("color")&&this.setAttribute("color",Object.values(Po).includes(this.color)?this.color:St.COLOR),t.has("appendTo")&&(this.appendTo?this.utils.setupAppendTo():this.utils.cleanupAppendTo()),(t.has("interactive")||t.has("aria-label")||t.has("aria-labelledby"))&&this.utils.updateAriaLabels(),t.has("role")&&(this.role===""&&(this.role=null),this.utils.updateAriaModal()),t.has("disableAriaExpanded")&&this.utils.updateAriaExpandedAttribute(),t.has("focusTrap")&&!this.focusTrap&&this.visible&&this.deactivateFocusTrap(),t.has("preventScroll")&&(!this.preventScroll&&this.visible?this.deactivatePreventScroll():this.preventScroll&&this.visible&&this.activatePreventScroll())}onComponentStackChanged(t){t==="removed"?this.hide():t==="moved"&&this.requestUpdate("zIndex")}async isOpenUpdated(t,r){var d,c;let{triggerElement:s}=this;t===r||!s||(r&&!this.shouldSuppressOpening?(this.depthManager.pushHost()&&this.requestUpdate("zIndex"),this.keepConnectedTooltipOpen||this.connectedTooltip&&(this.connectedTooltip.visible=!1,this.connectedTooltip.shouldSuppressOpening=!0),this.backdrop&&!this.backdropElement&&(this.createBackdrop("popover"),this.keepElementAboveBackdrop(s)),this.positionPopover(),this.hideOnBlur&&(this.addEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(s.style.pointerEvents="none")),this.hideOnEscape&&(this.addEventListener("keydown",this.onEscapeKeydown),document.addEventListener("keydown",this.onEscapeKeydown)),this.activatePreventScroll(),this.hideOnOutsideClick&&document.addEventListener("click",this.onOutsidePopoverClick,{capture:!0}),setTimeout(()=>{var f,y;this.interactive&&this.focusTrap&&((f=this.activateFocusTrap)==null||f.call(this),(y=this.setInitialFocus)==null||y.call(this))},0),Ti.onShowPopover(this)):(this.depthManager.popHost(),(d=this.floatingUICleanupFunction)==null||d.call(this),this.backdrop&&(this.moveElementBackAfterBackdropRemoval(s),this.removeBackdrop()),this.hideOnBlur&&(this.removeEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(s.style.pointerEvents="")),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown)),this.deactivatePreventScroll(),(c=this.deactivateFocusTrap)==null||c.call(this),this.focusBackToTrigger&&(s==null||s.focus()),this.keepConnectedTooltipOpen||this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),Ti.onHidePopover(this)))}show(){if(this.shouldSuppressOpening||(this.cancelCloseDelay(),this.visible))return;let t=()=>{this.visible=!0};this.openDelay>0?this.timers.setTimeout(bi.OPEN,t,this.openDelay):(this.timers.clearTimeout(bi.OPEN),t())}isEventFromTrigger(t){var r;return this.triggerID?t.composed?t.composedPath().some(s=>(s==null?void 0:s.id)===this.triggerID):((r=t.target)==null?void 0:r.id)===this.triggerID:!1}isRtl(){return window.getComputedStyle(this).direction==="rtl"}adjustPlacementForRtl(t){if(!this.isRtl())return t;switch(t){case Nt.LEFT:return Nt.RIGHT;case Nt.LEFT_START:return Nt.RIGHT_START;case Nt.LEFT_END:return Nt.RIGHT_END;case Nt.RIGHT:return Nt.LEFT;case Nt.RIGHT_START:return Nt.LEFT_START;case Nt.RIGHT_END:return Nt.LEFT_END;default:return t}}render(){return this.style.zIndex=`${this.zIndex}`,C`
2703
+ `,wv=[Lx];var id=V.constructTagName("popoverportal"),rd=class extends X{connectedCallback(){super.connectedCallback(),this.ariaHidden="true",this.style.display="none"}disconnectedCallback(){var o;super.disconnectedCallback(),(o=this.onDisconnect)==null||o.call(this)}};var od=class{constructor(o){this.portalElement=null;this.disconnectAfterAppendTo=!1;this.arrowPixelChange=!1;this.popover=o}setupDelay(){try{let[o,t]=this.popover.delay.split(",").map(r=>{let s=parseInt(r,10);if(Number.isNaN(s)||s<0)throw new Error(`Invalid delay value: ${r}`);return s});return[o,t]}catch{return this.popover.delay="0,0",[0,0]}}setupHoverBridge(o){let t=this.popover.renderRoot.querySelector('div[part="popover-hover-bridge"]');Object.assign(t.style,{top:"",left:"",right:"",bottom:""});let r=`calc(${this.popover.showArrow?"0.75rem + ":""}${this.popover.offset+1}px)`,s=this.popover.offsetHeight||0,d=this.popover.offsetWidth||0;if(t)switch(o.split("-")[0]){case"top":t.style.height=r,t.style.bottom=`calc(-1 * (${r}))`,t.style.left="50%",t.style.width=`${d}px`;break;case"left":t.style.height=`${s}px`,t.style.width=r,t.style.right=`calc(-1.5 * (${r}))`;break;case"right":t.style.height=`${s}px`,t.style.width=r,t.style.left=`calc(-0.5 * (${r}))`;break;case"bottom":default:t.style.height=r,t.style.top=`calc(-1 * (${r}))`,t.style.left="50%",t.style.width=`${d}px`;break}}setupAppendTo(){var o,t;if(this.popover.appendTo){let r=document.getElementById(this.popover.appendTo);r&&!Array.from(r.children).includes(this.popover)&&(this.disconnectAfterAppendTo=!0,this.portalElement=document.createElement(id),this.portalElement.onDisconnect=()=>{this.popover.remove(),this.portalElement=null},(t=(o=this.popover.parentElement)==null?void 0:o.appendChild)==null||t.call(o,this.portalElement),r.appendChild(this.popover))}}cleanupAppendTo(){!this.disconnectAfterAppendTo&&this.portalElement&&this.portalElement.remove(),this.disconnectAfterAppendTo=!1}updateAriaLabels(){var o,t,r;this.popover.interactive&&this.popover.role&&(this.popover.ariaLabel||(this.popover.ariaLabel=((o=this.popover.triggerElement)==null?void 0:o.ariaLabel)||((t=this.popover.triggerElement)==null?void 0:t.textContent)||""),!this.popover.ariaLabelledby&&!this.popover.ariaLabel&&(this.popover.ariaLabelledby=((r=this.popover.triggerElement)==null?void 0:r.id)||""))}updateAriaModal(){this.popover.role===J.DIALOG||this.popover.role===J.ALERTDIALOG?this.popover.setAttribute("aria-modal","true"):this.popover.removeAttribute("aria-modal")}updateAriaExpandedAttribute(){var o,t,r;this.popover.disableAriaExpanded||((o=this.popover.triggerElement)==null||o.setAttribute("aria-expanded",`${this.popover.visible}`),(r=this.popover.triggerElement)==null||r.setAttribute("aria-haspopup",((t=this.popover.triggerElement)==null?void 0:t.getAttribute("aria-haspopup"))||this.popover.role||"dialog"))}updateArrowStyle(o,t){var $;if(!this.popover.arrowElement)return;let r=t.split("-")[0],s={top:"bottom",right:"left",bottom:"top",left:"right"}[r],{x:d,y:c}=o,f=this.popover.arrowElement.getBoundingClientRect(),y=($=this.popover.arrowElement.offsetParent)==null?void 0:$.getBoundingClientRect();if(!this.arrowPixelChange){let Y=y!=null&&y[s]?12-Math.abs(f[s]-y[s]):0;Math.round(Y)===1?this.arrowPixelChange=!0:this.arrowPixelChange=!1}let I=this.arrowPixelChange?.5:0;this.popover.arrowElement.setAttribute("data-side",r),Object.assign(this.popover.arrowElement.style,{left:d!=null?`${d}px`:"",top:c!=null?`${c}px`:"",[s]:`${-this.popover.arrowElement.offsetHeight/2-I}px`})}updatePopoverStyle(o,t){Object.assign(this.popover.style,{left:`${o}px`,top:`${t}px`})}};var _t=class extends Lt(Ct(kl(Il(Sl(X))))){constructor(){super();this.depthManager=new Yi(this);this.id="";this.triggerID="";this.trigger=St.TRIGGER;this.placement=St.PLACEMENT;this.color=St.COLOR;this.visible=St.VISIBLE;this.offset=St.OFFSET;this.boundary=St.BOUNDARY;this.boundaryRoot=St.BOUNDARY_ROOT;this.focusTrap=St.FOCUS_TRAP;this.preventScroll=St.PREVENT_SCROLL;this.showArrow=St.ARROW;this.closeButton=St.CLOSE_BUTTON;this.interactive=St.INTERACTIVE;this.delay=St.DELAY;this.hideOnEscape=St.HIDE_ON_ESCAPE;this.propagateEventOnEscape=St.PROPAGATE_EVENT_ON_ESCAPE;this.hideOnBlur=St.HIDE_ON_BLUR;this.hideOnOutsideClick=St.HIDE_ON_CLICK_OUTSIDE;this.focusBackToTrigger=St.FOCUS_BACK;this.backdrop=St.BACKDROP;this.isBackdropInvisible=St.IS_BACKDROP_INVISIBLE;this.disableFlip=St.DISABLE_FLIP;this.size=St.SIZE;this.closeButtonAriaLabel=null;this.strategy=St.STRATEGY;this.role=St.ROLE;this.ariaLabelledby=null;this.ariaDescribedby=null;this.disableAriaExpanded=St.DISABLE_ARIA_EXPANDED;this.keepConnectedTooltipOpen=St.KEEP_CONNECTED_TOOLTIP_OPEN;this.animationFrame=St.ANIMATION_FRAME;this.elementIndexToReceiveFocus=null;this.arrowElement=null;this.isHovered=!1;this.openDelay=0;this.closeDelay=0;this.floatingUICleanupFunction=null;this.shouldSuppressOpening=!1;this.timers=new ed(this);this.parseTrigger=()=>{var d;let s=(((d=this.trigger)==null?void 0:d.split(" "))||[]).filter(c=>Object.values(Ke).includes(c)).length>0?this.trigger:St.TRIGGER;s==="mouseenter"&&(this.interactive?s="mouseenter click":s="mouseenter focusin"),this.trigger=s};this.setupTriggerListeners=()=>{if(this.trigger.includes("click")&&(document.addEventListener("click",this.togglePopoverVisible,{capture:!0}),this.hideOnBlur&&document.addEventListener("focusout",this.handleFocusOut,{capture:!0})),this.trigger.includes("mouseenter")){let t=this.renderRoot.querySelector('div[part="popover-hover-bridge"]');t==null||t.addEventListener("mouseenter",this.show),document.addEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.addEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.addEventListener("mouseenter",this.cancelCloseDelay),this.addEventListener("mouseleave",this.startCloseDelay)}this.trigger.includes("focusin")&&(document.addEventListener("focusin",this.handleFocusIn,{capture:!0}),this.interactive||document.addEventListener("focusout",this.handleFocusOut,{capture:!0}))};this.removeTriggerListeners=()=>{document.removeEventListener("click",this.togglePopoverVisible,{capture:!0});let t=this.renderRoot.querySelector('div[part="popover-hover-bridge"]');t==null||t.removeEventListener("mouseenter",this.show),document.removeEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.removeEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.removeEventListener("mouseenter",this.cancelCloseDelay),this.removeEventListener("mouseleave",this.startCloseDelay),document.removeEventListener("focusin",this.handleFocusIn,{capture:!0}),document.removeEventListener("focusout",this.handleFocusOut,{capture:!0})};this.removeAllListeners=()=>{this.removeTriggerListeners(),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown)),this.hideOnBlur&&this.removeEventListener("focusout",this.onPopoverFocusOut)};this.onOutsidePopoverClick=t=>{if(!this.depthManager.isHostOnTop())return;let r=t.composedPath(),s=this.contains(t.target)||r.includes(this.triggerElement)||r.includes(this),d=this.backdropElement?r.includes(this.backdropElement):!1;(!s||d)&&(this.hide(),Ti.onClickOutside(this))};this.onEscapeKeydown=t=>{!this.visible||this.getActionForKeyEvent(t)!==q.ESCAPE||!this.depthManager.isHostOnTop()||(this.propagateEventOnEscape||t.stopPropagation(),t.preventDefault(),this.hide(),Ti.onEscapeKeyPressed(this),this.keyDownEventHandled())};this.onPopoverFocusOut=t=>{this.contains(t.relatedTarget)||this.hide()};this.handleMouseEnter=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!0,this.show())};this.handleMouseLeave=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!1,this.startCloseDelay())};this.handleFocusOut=t=>{if(this.isEventFromTrigger(t)){if(this.hideOnBlur){let{relatedTarget:r}=t;this.contains(r)||this.hide();return}this.isHovered||this.hide()}};this.handleFocusIn=t=>{var r,s,d,c;this.isEventFromTrigger(t)&&((r=this.triggerElement)!=null&&r.matches(":focus-visible")||(c=(d=(s=this.triggerElement)==null?void 0:s.shadowRoot)==null?void 0:d.querySelector(".mdc-focus-ring"))!=null&&c.matches(":focus-visible")||this.isHovered)&&this.show()};this.cancelOpenDelay=()=>{this.timers.clearTimeout(bi.OPEN)};this.startCloseDelay=()=>{this.cancelOpenDelay(),this.interactive?this.timers.setTimeout(bi.HOVER,()=>{this.visible=!1},this.closeDelay):this.hide()};this.cancelCloseDelay=()=>{this.timers.clearTimeout(bi.HOVER),this.timers.clearTimeout(bi.CLOSE)};this.hide=()=>{this.cancelOpenDelay();let t=()=>{this.visible=!1};this.closeDelay>0?this.timers.setTimeout(bi.CLOSE,t,this.closeDelay):(this.timers.clearTimeout(bi.CLOSE),t())};this.togglePopoverVisible=t=>{this.isEventFromTrigger(t)&&(this.visible?this.hide():this.show())};this.positionPopover=()=>{let{triggerElement:t}=this;if(!t)return;let r=!this.boundary||this.boundary==="clippingAncestors"?"clippingAncestors":Array.from(document.querySelectorAll(this.boundary)),s=this.boundaryRoot,d=[Av({boundary:r,rootBoundary:s,padding:this.boundaryPadding})],c=this.offset;if(this.disableFlip||d.push(Sv({boundary:r,rootBoundary:s})),this.size){let f=I=>{this.style.setProperty("--mdc-popover-internal-available-height",`${I}px`)},y=this.renderRoot.querySelector('[part="popover-content"]');d.push(Iv({boundary:r,rootBoundary:s,apply({availableHeight:I}){y&&(Object.assign(y.style,{maxHeight:`${I}px`,overflowY:"auto"}),f(I))},padding:50}))}if(this.showArrow&&(this.arrowElement=this.renderRoot.querySelector('div[part="popover-arrow"]'),this.arrowElement)){let f=this.arrowElement.offsetHeight,y=Math.sqrt(2*f**2)/2;c+=y,d.push(_v({element:this.arrowElement,padding:12}))}d.push(xv(c)),this.floatingUICleanupFunction=Tv(t,this,async()=>{let{triggerElement:f}=this;if(!f)return;let y=this.adjustPlacementForRtl(this.placement),{x:I,y:$,middlewareData:Y,placement:Q}=await Cv(f,this,{placement:y,middleware:d,strategy:this.strategy});this.utils.updatePopoverStyle(I,$),Y.arrow&&this.arrowElement&&this.utils.updateArrowStyle(Y.arrow,Q),this.trigger.includes("mouseenter")&&this.utils.setupHoverBridge(Q)},{animationFrame:this.animationFrame})};this.show=this.show.bind(this),this.utils=new od(this),this.parseTrigger(),[this.openDelay,this.closeDelay]=this.utils.setupDelay()}get zIndex(){return Number.isInteger(this.internalZIndex)?this.internalZIndex:this.depthManager.getHostZIndex()}set zIndex(t){this.internalZIndex=t}get connectedTooltip(){let t=this.getRootNode().querySelectorAll(`mdc-tooltip[triggerID="${this.triggerID}"]`);return Array.from(t).find(r=>r!==this)}get triggerElement(){return this.getRootNode().querySelector(`[id="${this.triggerID}"]`)}async firstUpdated(t){super.firstUpdated(t),Ti.onCreatedPopover(this)}connectedCallback(){super.connectedCallback(),this.utils.setupAppendTo(),this.setupTriggerListeners()}async disconnectedCallback(){var t,r;super.disconnectedCallback(),this.removeAllListeners(),(t=this.deactivateFocusTrap)==null||t.call(this),this.deactivatePreventScroll(),this.moveElementBackAfterBackdropRemoval(this.triggerElement),this.removeBackdrop(),(r=this.floatingUICleanupFunction)==null||r.call(this),this.keepConnectedTooltipOpen||this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),this.utils.cleanupAppendTo(),Ti.onDestroyedPopover(this)}async updated(t){if(super.updated(t),t.has("visible")){let r=t.get("visible")||!1;await this.isOpenUpdated(r,this.visible),this.utils.updateAriaExpandedAttribute()}t.has("trigger")&&(this.parseTrigger(),this.removeTriggerListeners(),this.setupTriggerListeners()),t.has("placement")&&this.setAttribute("placement",Object.values(Nt).includes(this.placement)?this.placement:St.PLACEMENT),t.has("delay")&&([this.openDelay,this.closeDelay]=this.utils.setupDelay()),t.has("color")&&this.setAttribute("color",Object.values(Po).includes(this.color)?this.color:St.COLOR),t.has("appendTo")&&(this.appendTo?this.utils.setupAppendTo():this.utils.cleanupAppendTo()),(t.has("interactive")||t.has("aria-label")||t.has("aria-labelledby"))&&this.utils.updateAriaLabels(),t.has("role")&&(this.role===""&&(this.role=null),this.utils.updateAriaModal()),t.has("disableAriaExpanded")&&this.utils.updateAriaExpandedAttribute(),t.has("focusTrap")&&!this.focusTrap&&this.visible&&this.deactivateFocusTrap(),t.has("preventScroll")&&(!this.preventScroll&&this.visible?this.deactivatePreventScroll():this.preventScroll&&this.visible&&this.activatePreventScroll())}onComponentStackChanged(t){t==="removed"?this.hide():t==="moved"&&this.requestUpdate("zIndex")}async isOpenUpdated(t,r){var d,c;let{triggerElement:s}=this;t===r||!s||(r&&!this.shouldSuppressOpening?(this.depthManager.pushHost()&&this.requestUpdate("zIndex"),this.keepConnectedTooltipOpen||this.connectedTooltip&&(this.connectedTooltip.visible=!1,this.connectedTooltip.shouldSuppressOpening=!0),this.backdrop&&!this.backdropElement&&(this.createBackdrop("popover"),this.keepElementAboveBackdrop(s)),this.positionPopover(),this.hideOnBlur&&(this.addEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(s.style.pointerEvents="none")),this.hideOnEscape&&(this.addEventListener("keydown",this.onEscapeKeydown),document.addEventListener("keydown",this.onEscapeKeydown)),this.activatePreventScroll(),this.hideOnOutsideClick&&document.addEventListener("click",this.onOutsidePopoverClick,{capture:!0}),setTimeout(()=>{var f,y,I;this.interactive&&this.focusTrap&&((f=this.activateFocusTrap)==null||f.call(this),(I=this.setInitialFocus)==null||I.call(this,(y=this.elementIndexToReceiveFocus)!=null?y:0))},0),Ti.onShowPopover(this)):(this.depthManager.popHost(),(d=this.floatingUICleanupFunction)==null||d.call(this),this.backdrop&&(this.moveElementBackAfterBackdropRemoval(s),this.removeBackdrop()),this.hideOnBlur&&(this.removeEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(s.style.pointerEvents="")),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown)),this.deactivatePreventScroll(),(c=this.deactivateFocusTrap)==null||c.call(this),this.focusBackToTrigger&&(s==null||s.focus()),this.keepConnectedTooltipOpen||this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),Ti.onHidePopover(this)))}show(){if(this.shouldSuppressOpening||(this.cancelCloseDelay(),this.visible))return;let t=()=>{this.visible=!0};this.openDelay>0?this.timers.setTimeout(bi.OPEN,t,this.openDelay):(this.timers.clearTimeout(bi.OPEN),t())}isEventFromTrigger(t){var r;return this.triggerID?t.composed?t.composedPath().some(s=>(s==null?void 0:s.id)===this.triggerID):((r=t.target)==null?void 0:r.id)===this.triggerID:!1}isRtl(){return window.getComputedStyle(this).direction==="rtl"}adjustPlacementForRtl(t){if(!this.isRtl())return t;switch(t){case Nt.LEFT:return Nt.RIGHT;case Nt.LEFT_START:return Nt.RIGHT_START;case Nt.LEFT_END:return Nt.RIGHT_END;case Nt.RIGHT:return Nt.LEFT;case Nt.RIGHT_START:return Nt.LEFT_START;case Nt.RIGHT_END:return Nt.LEFT_END;default:return t}}render(){return this.style.zIndex=`${this.zIndex}`,C`
2704
2704
  <div part="popover-hover-bridge"></div>
2705
2705
  ${this.closeButton?C` <mdc-button
2706
2706
  part="popover-close"
@@ -2714,7 +2714,7 @@
2714
2714
  <div part="popover-content">
2715
2715
  <slot></slot>
2716
2716
  </div>
2717
- `}};_t.styles=[...X.styles,...wv],m([u({type:String,reflect:!0})],_t.prototype,"id",2),m([u({type:String,reflect:!0})],_t.prototype,"triggerID",2),m([u({type:String,reflect:!0})],_t.prototype,"trigger",2),m([u({type:String,reflect:!0})],_t.prototype,"placement",2),m([u({type:String,reflect:!0})],_t.prototype,"color",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"visible",2),m([u({type:Number,reflect:!0})],_t.prototype,"offset",2),m([u({type:String,reflect:!0,attribute:"boundary"})],_t.prototype,"boundary",2),m([u({type:String,reflect:!0,attribute:"boundary-root"})],_t.prototype,"boundaryRoot",2),m([u({type:Number,reflect:!0,attribute:"boundary-padding"})],_t.prototype,"boundaryPadding",2),m([u({type:Boolean,reflect:!0,attribute:"focus-trap"})],_t.prototype,"focusTrap",2),m([u({type:Boolean,reflect:!0,attribute:"prevent-scroll"})],_t.prototype,"preventScroll",2),m([u({type:Boolean,reflect:!0,attribute:"show-arrow"})],_t.prototype,"showArrow",2),m([u({type:Boolean,reflect:!0,attribute:"close-button"})],_t.prototype,"closeButton",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"interactive",2),m([u({type:String,reflect:!0})],_t.prototype,"delay",2),m([u({type:Boolean,reflect:!0,attribute:"hide-on-escape"})],_t.prototype,"hideOnEscape",2),m([u({type:Boolean,reflect:!0,attribute:"propagate-event-on-escape"})],_t.prototype,"propagateEventOnEscape",2),m([u({type:Boolean,reflect:!0,attribute:"hide-on-blur"})],_t.prototype,"hideOnBlur",2),m([u({type:Boolean,reflect:!0,attribute:"hide-on-outside-click"})],_t.prototype,"hideOnOutsideClick",2),m([u({type:Boolean,reflect:!0,attribute:"focus-back-to-trigger"})],_t.prototype,"focusBackToTrigger",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"backdrop",2),m([u({type:String,reflect:!0,attribute:"backdrop-append-to"})],_t.prototype,"backdropAppendTo",2),m([u({type:Boolean,reflect:!0,attribute:"is-backdrop-invisible"})],_t.prototype,"isBackdropInvisible",2),m([u({type:Boolean,reflect:!0,attribute:"disable-flip"})],_t.prototype,"disableFlip",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"size",2),m([u({type:Number,reflect:!0,attribute:"z-index"})],_t.prototype,"zIndex",1),m([u({type:String,reflect:!0,attribute:"append-to"})],_t.prototype,"appendTo",2),m([u({type:String,attribute:"close-button-aria-label",reflect:!0})],_t.prototype,"closeButtonAriaLabel",2),m([u({type:String,reflect:!0})],_t.prototype,"strategy",2),m([u({type:String,reflect:!0})],_t.prototype,"role",2),m([u({type:String,reflect:!0,attribute:"aria-labelledby"})],_t.prototype,"ariaLabelledby",2),m([u({type:String,reflect:!0,attribute:"aria-describedby"})],_t.prototype,"ariaDescribedby",2),m([u({type:Boolean,reflect:!0,attribute:"disable-aria-expanded"})],_t.prototype,"disableAriaExpanded",2),m([u({type:Boolean,reflect:!0,attribute:"keep-connected-tooltip-open"})],_t.prototype,"keepConnectedTooltipOpen",2),m([u({type:Boolean,reflect:!0,attribute:"animation-frame"})],_t.prototype,"animationFrame",2);var Ye=_t;var kv=V.constructTagName("toggletip"),Ho={CLOSE_BUTTON:!0,CLOSE_BUTTON_ARIA_LABEL:"Close",OFFSET:4,PLACEMENT:Nt.TOP,CLICK:Ke.CLICK,SHOW_ARROW:!0};var Mx=U`
2717
+ `}};_t.styles=[...X.styles,...wv],m([u({type:String,reflect:!0})],_t.prototype,"id",2),m([u({type:String,reflect:!0})],_t.prototype,"triggerID",2),m([u({type:String,reflect:!0})],_t.prototype,"trigger",2),m([u({type:String,reflect:!0})],_t.prototype,"placement",2),m([u({type:String,reflect:!0})],_t.prototype,"color",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"visible",2),m([u({type:Number,reflect:!0})],_t.prototype,"offset",2),m([u({type:String,reflect:!0,attribute:"boundary"})],_t.prototype,"boundary",2),m([u({type:String,reflect:!0,attribute:"boundary-root"})],_t.prototype,"boundaryRoot",2),m([u({type:Number,reflect:!0,attribute:"boundary-padding"})],_t.prototype,"boundaryPadding",2),m([u({type:Boolean,reflect:!0,attribute:"focus-trap"})],_t.prototype,"focusTrap",2),m([u({type:Boolean,reflect:!0,attribute:"prevent-scroll"})],_t.prototype,"preventScroll",2),m([u({type:Boolean,reflect:!0,attribute:"show-arrow"})],_t.prototype,"showArrow",2),m([u({type:Boolean,reflect:!0,attribute:"close-button"})],_t.prototype,"closeButton",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"interactive",2),m([u({type:String,reflect:!0})],_t.prototype,"delay",2),m([u({type:Boolean,reflect:!0,attribute:"hide-on-escape"})],_t.prototype,"hideOnEscape",2),m([u({type:Boolean,reflect:!0,attribute:"propagate-event-on-escape"})],_t.prototype,"propagateEventOnEscape",2),m([u({type:Boolean,reflect:!0,attribute:"hide-on-blur"})],_t.prototype,"hideOnBlur",2),m([u({type:Boolean,reflect:!0,attribute:"hide-on-outside-click"})],_t.prototype,"hideOnOutsideClick",2),m([u({type:Boolean,reflect:!0,attribute:"focus-back-to-trigger"})],_t.prototype,"focusBackToTrigger",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"backdrop",2),m([u({type:String,reflect:!0,attribute:"backdrop-append-to"})],_t.prototype,"backdropAppendTo",2),m([u({type:Boolean,reflect:!0,attribute:"is-backdrop-invisible"})],_t.prototype,"isBackdropInvisible",2),m([u({type:Boolean,reflect:!0,attribute:"disable-flip"})],_t.prototype,"disableFlip",2),m([u({type:Boolean,reflect:!0})],_t.prototype,"size",2),m([u({type:Number,reflect:!0,attribute:"z-index"})],_t.prototype,"zIndex",1),m([u({type:String,reflect:!0,attribute:"append-to"})],_t.prototype,"appendTo",2),m([u({type:String,attribute:"close-button-aria-label",reflect:!0})],_t.prototype,"closeButtonAriaLabel",2),m([u({type:String,reflect:!0})],_t.prototype,"strategy",2),m([u({type:String,reflect:!0})],_t.prototype,"role",2),m([u({type:String,reflect:!0,attribute:"aria-labelledby"})],_t.prototype,"ariaLabelledby",2),m([u({type:String,reflect:!0,attribute:"aria-describedby"})],_t.prototype,"ariaDescribedby",2),m([u({type:Boolean,reflect:!0,attribute:"disable-aria-expanded"})],_t.prototype,"disableAriaExpanded",2),m([u({type:Boolean,reflect:!0,attribute:"keep-connected-tooltip-open"})],_t.prototype,"keepConnectedTooltipOpen",2),m([u({type:Boolean,reflect:!0,attribute:"animation-frame"})],_t.prototype,"animationFrame",2),m([u({type:Number,attribute:"element-index-to-receive-focus",reflect:!0})],_t.prototype,"elementIndexToReceiveFocus",2);var Ye=_t;var kv=V.constructTagName("toggletip"),Ho={CLOSE_BUTTON:!0,CLOSE_BUTTON_ARIA_LABEL:"Close",OFFSET:4,PLACEMENT:Nt.TOP,CLICK:Ke.CLICK,SHOW_ARROW:!0};var Mx=U`
2718
2718
  :host {
2719
2719
  --mdc-toggletip-max-width: 400px;
2720
2720
  --mdc-toggletip-text-color: var(--mds-color-theme-text-primary-normal);