/*! For license information please see 8202.js.LICENSE.txt */
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8202],{4080:(t,e,o)=>{o.d(e,{CI:()=>d,H8:()=>r,gm:()=>a,m0:()=>n,nr:()=>h,un:()=>_});const i=t=>t.test(navigator.userAgent),s=t=>t.test(navigator.platform),n=i(/Android/u),r=i(/Chrome/u)&&/Google Inc/u.test(navigator.vendor),a=i(/Firefox/u),l=s(/^iPad/u)||s(/^Mac/u)&&navigator.maxTouchPoints>1,_=s(/^iPhone/u)||l,h=i(/^((?!chrome|android).)*safari/iu),d=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}})()},17017:(t,e,o)=>{o(64511),o(3241),o(83315);var i=o(40211),s=o(87550);const n=s.AH`
  :host {
    --vaadin-tooltip-offset-top: var(--lumo-space-xs);
    --vaadin-tooltip-offset-bottom: var(--lumo-space-xs);
    --vaadin-tooltip-offset-start: var(--lumo-space-xs);
    --vaadin-tooltip-offset-end: var(--lumo-space-xs);
  }

  [part='overlay'] {
    background: var(--lumo-base-color) linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
    color: var(--lumo-body-text-color);
    font-size: var(--lumo-font-size-xs);
    line-height: var(--lumo-line-height-s);
  }

  [part='content'] {
    padding: var(--lumo-space-xs) var(--lumo-space-s);
  }
`;(0,s.SF)("vaadin-tooltip-overlay",[i.L,n],{moduleId:"lumo-tooltip-overlay"}),o(76720)},76720:(t,e,o)=>{var i=o(13256),s=o(82901),n=o(23927),r=o(5072),a=o(87550),l=o(58069),_=o(81481);const h=t=>class extends((0,_.t)((0,l.c)(t))){static get properties(){return{position:{type:String,reflectToAttribute:!0}}}requestContentUpdate(){if(super.requestContentUpdate(),this.toggleAttribute("hidden",""===this.textContent.trim()),this.positionTarget&&this.owner){const t=getComputedStyle(this.owner);["top","bottom","start","end"].forEach(e=>{this.style.setProperty(`--vaadin-tooltip-offset-${e}`,t.getPropertyValue(`--vaadin-tooltip-offset-${e}`))})}}_updatePosition(){if(super._updatePosition(),this.positionTarget){if("bottom"===this.position||"top"===this.position){const t=this.positionTarget.getBoundingClientRect(),e=this.$.overlay.getBoundingClientRect(),o=t.width/2-e.width/2;if(this.style.left){const t=e.left+o;t>0&&(this.style.left=`${t}px`)}if(this.style.right){const t=parseFloat(this.style.right)+o;t>0&&(this.style.right=`${t}px`)}}if("start"===this.position||"end"===this.position){const t=this.positionTarget.getBoundingClientRect(),e=this.$.overlay.getBoundingClientRect(),o=t.height/2-e.height/2;this.style.top=`${e.top+o}px`}}}},d=a.AH`
  :host {
    z-index: 1100;
  }

  [part='overlay'] {
    max-width: 40ch;
  }

  :host([position^='top'][top-aligned]) [part='overlay'],
  :host([position^='bottom'][top-aligned]) [part='overlay'] {
    margin-top: var(--vaadin-tooltip-offset-top, 0);
  }

  :host([position^='top'][bottom-aligned]) [part='overlay'],
  :host([position^='bottom'][bottom-aligned]) [part='overlay'] {
    margin-bottom: var(--vaadin-tooltip-offset-bottom, 0);
  }

  :host([position^='start'][start-aligned]) [part='overlay'],
  :host([position^='end'][start-aligned]) [part='overlay'] {
    margin-inline-start: var(--vaadin-tooltip-offset-start, 0);
  }

  :host([position^='start'][end-aligned]) [part='overlay'],
  :host([position^='end'][end-aligned]) [part='overlay'] {
    margin-inline-end: var(--vaadin-tooltip-offset-end, 0);
  }

  @media (forced-colors: active) {
    [part='overlay'] {
      outline: 1px dashed;
    }
  }
`;(0,a.SF)("vaadin-tooltip-overlay",[r.B,d],{moduleId:"vaadin-tooltip-overlay-styles"});class u extends(h((0,n.v)((0,a.cp)(i.Pu)))){static get is(){return"vaadin-tooltip-overlay"}static get template(){return i.qy`
      <div id="backdrop" part="backdrop" hidden></div>
      <div part="overlay" id="overlay">
        <div part="content" id="content"><slot></slot></div>
      </div>
    `}ready(){super.ready(),this.owner=this.__dataHost,this.owner._overlayElement=this}}(0,s.X)(u);var c=o(55774),p=o(72562),v=o(75365),g=o(30025),m=o(62804),y=o(76685),f=o(1508),b=o(55341),C=o(44099),w=o(11707);const T=500;let O=T,E=T,x=T;const L=new Set;let A=!1,D=null,S=null;class P{constructor(t){this.host=t}get openedProp(){return this.host.manual?"opened":"_autoOpened"}get focusDelay(){const t=this.host;return null!=t.focusDelay&&t.focusDelay>=0?t.focusDelay:O}get hoverDelay(){const t=this.host;return null!=t.hoverDelay&&t.hoverDelay>=0?t.hoverDelay:E}get hideDelay(){const t=this.host;return null!=t.hideDelay&&t.hideDelay>=0?t.hideDelay:x}get isClosing(){return L.has(this.host)}open(t={immediate:!1}){const{immediate:e,hover:o,focus:i}=t,s=o&&this.hoverDelay>0,n=i&&this.focusDelay>0;e||!s&&!n||this.__closeTimeout?this.__showTooltip():this.__warmupTooltip(n)}close(t){!t&&this.hideDelay>0?this.__scheduleClose():(this.__abortClose(),this._setOpened(!1)),this.__abortWarmUp(),A&&(this.__abortCooldown(),this.__scheduleCooldown())}_isOpened(){return this.host[this.openedProp]}_setOpened(t){this.host[this.openedProp]=t}__flushClosingTooltips(){L.forEach(t=>{t._stateController.close(!0),L.delete(t)})}__showTooltip(){this.__abortClose(),this.__flushClosingTooltips(),this._setOpened(!0),A=!0,this.__abortWarmUp(),this.__abortCooldown()}__warmupTooltip(t){this._isOpened()||(A?this.__showTooltip():this.__scheduleWarmUp(t))}__abortClose(){this.__closeTimeout&&(clearTimeout(this.__closeTimeout),this.__closeTimeout=null)}__abortCooldown(){S&&(clearTimeout(S),S=null)}__abortWarmUp(){D&&(clearTimeout(D),D=null)}__scheduleClose(){this._isOpened()&&(L.add(this.host),this.__closeTimeout=setTimeout(()=>{L.delete(this.host),this.__closeTimeout=null,this._setOpened(!1)},this.hideDelay))}__scheduleCooldown(){S=setTimeout(()=>{S=null,A=!1},this.hideDelay)}__scheduleWarmUp(t){const e=t?this.focusDelay:this.hoverDelay;D=setTimeout(()=>{D=null,A=!0,this.__showTooltip()},e)}}const H=t=>class extends((0,b.i)(t)){static get properties(){return{ariaTarget:{type:Object},context:{type:Object,value:()=>({})},focusDelay:{type:Number},for:{type:String,observer:"__forChanged"},generator:{type:Object},hideDelay:{type:Number},hoverDelay:{type:Number},manual:{type:Boolean,value:!1,sync:!0},opened:{type:Boolean,value:!1,sync:!0},position:{type:String},shouldShow:{type:Object,value:()=>(t,e)=>!0},target:{type:Object,observer:"__targetChanged"},text:{type:String,observer:"__textChanged"},_autoOpened:{type:Boolean,observer:"__autoOpenedChanged",sync:!0},_effectiveAriaTarget:{type:Object,computed:"__computeAriaTarget(ariaTarget, target)",observer:"__effectiveAriaTargetChanged"},__effectivePosition:{type:String,computed:"__computePosition(position, _position)"},__isTargetHidden:{type:Boolean,value:!1},_isConnected:{type:Boolean,sync:!0},_position:{type:String,value:"bottom"},_srLabel:{type:Object},_overlayContent:{type:String}}}static get observers(){return["__generatorChanged(_overlayElement, generator, context)","__updateSrLabelText(_srLabel, _overlayContent)"]}static setDefaultFocusDelay(t){O=null!=t&&t>=0?t:T}static setDefaultHideDelay(t){x=null!=t&&t>=0?t:T}static setDefaultHoverDelay(t){E=null!=t&&t>=0?t:T}constructor(){super(),this._uniqueId=`vaadin-tooltip-${(0,w.I)()}`,this._renderer=this.__tooltipRenderer.bind(this),this.__onFocusin=this.__onFocusin.bind(this),this.__onFocusout=this.__onFocusout.bind(this),this.__onMouseDown=this.__onMouseDown.bind(this),this.__onMouseEnter=this.__onMouseEnter.bind(this),this.__onMouseLeave=this.__onMouseLeave.bind(this),this.__onKeyDown=this.__onKeyDown.bind(this),this.__onOverlayOpen=this.__onOverlayOpen.bind(this),this.__targetVisibilityObserver=new IntersectionObserver(t=>{t.forEach(t=>this.__onTargetVisibilityChange(t.isIntersecting))},{threshold:0}),this._stateController=new P(this)}connectedCallback(){super.connectedCallback(),this._isConnected=!0,document.body.addEventListener("vaadin-overlay-open",this.__onOverlayOpen)}disconnectedCallback(){super.disconnectedCallback(),this._autoOpened&&this._stateController.close(!0),this._isConnected=!1,document.body.removeEventListener("vaadin-overlay-open",this.__onOverlayOpen)}ready(){super.ready(),this._srLabelController=new C.r(this,"sr-label","div",{initializer:t=>{t.id=this._uniqueId,t.setAttribute("role","tooltip"),this._srLabel=t}}),this.addController(this._srLabelController)}__computeHorizontalAlign(t){return["top-end","bottom-end","start-top","start","start-bottom"].includes(t)?"end":"start"}__computeNoHorizontalOverlap(t){return["start-top","start","start-bottom","end-top","end","end-bottom"].includes(t)}__computeNoVerticalOverlap(t){return["top-start","top-end","top","bottom-start","bottom","bottom-end"].includes(t)}__computeVerticalAlign(t){return["top-start","top-end","top","start-bottom","end-bottom"].includes(t)?"bottom":"top"}__computeOpened(t,e,o,i){return i&&(t?e:o)}__computePosition(t,e){return t||e}__autoOpenedChanged(t,e){t?document.addEventListener("keydown",this.__onKeyDown,!0):e&&document.removeEventListener("keydown",this.__onKeyDown,!0)}__forChanged(t){t&&(this.__setTargetByIdDebouncer=y.aq.debounce(this.__setTargetByIdDebouncer,m._3,()=>this.__setTargetById(t)))}__setTargetById(t){if(!this.isConnected)return;const e=this.getRootNode().getElementById(t);e?this.target=e:console.warn(`No element with id="${t}" found to show tooltip.`)}__targetChanged(t,e){e&&(e.removeEventListener("mouseenter",this.__onMouseEnter),e.removeEventListener("mouseleave",this.__onMouseLeave),e.removeEventListener("focusin",this.__onFocusin),e.removeEventListener("focusout",this.__onFocusout),e.removeEventListener("mousedown",this.__onMouseDown),this.__targetVisibilityObserver.unobserve(e)),t&&(t.addEventListener("mouseenter",this.__onMouseEnter),t.addEventListener("mouseleave",this.__onMouseLeave),t.addEventListener("focusin",this.__onFocusin),t.addEventListener("focusout",this.__onFocusout),t.addEventListener("mousedown",this.__onMouseDown),requestAnimationFrame(()=>{this.__targetVisibilityObserver.observe(t)}))}__onFocusin(t){this.manual||(0,g.aJ)()&&(this.target.contains(t.relatedTarget)||this.__isShouldShow()&&(this.__focusInside=!0,this.__isTargetHidden||this.__hoverInside&&this._autoOpened||this._stateController.open({focus:!0})))}__onFocusout(t){this.manual||this.target.contains(t.relatedTarget)||(this.__focusInside=!1,this.__hoverInside||this._stateController.close(!0))}__onKeyDown(t){"Escape"===t.key&&(t.stopPropagation(),this._stateController.close(!0))}__onMouseDown(){this.manual||this._stateController.close(!0)}__onMouseEnter(){this.manual||this.__isShouldShow()&&(this.__hoverInside||(this.__hoverInside=!0,this.__isTargetHidden||this.__focusInside&&this._autoOpened||this._stateController.open({hover:!0})))}__onMouseLeave(t){t.relatedTarget!==this._overlayElement&&this.__handleMouseLeave()}__onOverlayMouseEnter(){this._stateController.isClosing&&this._stateController.open({immediate:!0})}__onOverlayMouseLeave(t){t.relatedTarget!==this.target&&this.__handleMouseLeave()}__handleMouseLeave(){this.manual||(this.__hoverInside=!1,this.__focusInside||this._stateController.close())}__onOverlayOpen(){this.manual||this._overlayElement.opened&&!this._overlayElement._last&&this._stateController.close(!0)}__onTargetVisibilityChange(t){const e=this.__isTargetHidden;this.__isTargetHidden=!t,e&&t&&(this.__focusInside||this.__hoverInside)?this._stateController.open({immediate:!0}):!t&&this._autoOpened&&this._stateController.close(!0)}__isShouldShow(){return"function"!=typeof this.shouldShow||!0===this.shouldShow(this.target,this.context)}__textChanged(t,e){this._overlayElement&&(t||e)&&this._overlayElement.requestContentUpdate()}__tooltipRenderer(t){t.textContent="function"==typeof this.generator?this.generator(this.context):this.text,this._overlayContent=t.textContent}__computeAriaTarget(t,e){return(Array.isArray(t)?t.some(t=>t&&t.nodeType===Node.ELEMENT_NODE):t)?t:e}__effectiveAriaTargetChanged(t,e){e&&[e].flat().forEach(t=>{(0,f.Wr)(t,"aria-describedby",this._uniqueId)}),t&&[t].flat().forEach(t=>{(0,f.iA)(t,"aria-describedby",this._uniqueId)})}__generatorChanged(t,e,o){t&&(e===this.__oldTextGenerator&&o===this.__oldContext||t.requestContentUpdate(),this.__oldTextGenerator=e,this.__oldContext=o)}__updateSrLabelText(t,e){t&&(t.textContent=e)}};class I extends(H((0,v._)((0,p.q)((0,c.w)(i.Pu))))){static get is(){return"vaadin-tooltip"}static get template(){return i.qy`
      <style>
        :host {
          display: none;
        }
      </style>
      <vaadin-tooltip-overlay
        renderer="[[_renderer]]"
        theme$="[[_theme]]"
        opened="[[__computeOpened(manual, opened, _autoOpened, _isConnected)]]"
        position-target="[[target]]"
        position="[[__effectivePosition]]"
        no-horizontal-overlap$="[[__computeNoHorizontalOverlap(__effectivePosition)]]"
        no-vertical-overlap$="[[__computeNoVerticalOverlap(__effectivePosition)]]"
        horizontal-align="[[__computeHorizontalAlign(__effectivePosition)]]"
        vertical-align="[[__computeVerticalAlign(__effectivePosition)]]"
        on-mouseenter="__onOverlayMouseEnter"
        on-mouseleave="__onOverlayMouseLeave"
        modeless
      ></vaadin-tooltip-overlay>

      <slot name="sr-label"></slot>
    `}}(0,s.X)(I)},81481:(t,e,o)=>{o.d(e,{t:()=>a});var i=o(1508);const s={start:"top",end:"bottom"},n={start:"left",end:"right"},r=new ResizeObserver(t=>{setTimeout(()=>{t.forEach(t=>{t.target.__overlay&&t.target.__overlay._updatePosition()})})}),a=t=>class extends t{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.visualViewport.addEventListener("resize",this._updatePosition),window.visualViewport.addEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes=(0,i.Dy)(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach(t=>{t.addEventListener("scroll",this.__onScroll,!0)})}__removeUpdatePositionEventListeners(){window.visualViewport.removeEventListener("resize",this._updatePosition),window.visualViewport.removeEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach(t=>{t.removeEventListener("scroll",this.__onScroll,!0)}),this.__positionTargetAncestorRootNodes=null)}__overlayOpenedChanged(t,e){if(this.__removeUpdatePositionEventListeners(),e&&(e.__overlay=null,r.unobserve(e),t&&(this.__addUpdatePositionEventListeners(),e.__overlay=this,r.observe(e))),t){const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach(e=>{this.__margins[e]=parseInt(t[e],10)})),this.setAttribute("dir",t.direction),this._updatePosition(),requestAnimationFrame(()=>this._updatePosition())}}__positionSettingsChanged(){this._updatePosition()}__onScroll(t){t.target instanceof Node&&this.contains(t.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened)return;const t=this.positionTarget.getBoundingClientRect();if(0===t.width&&0===t.height&&this.opened)return void(this.opened=!1);const e=this.__shouldAlignStartVertically(t);this.style.justifyContent=e?"flex-start":"flex-end";const o=this.__isRTL,i=this.__shouldAlignStartHorizontally(t,o),r=!o&&i||o&&!i;this.style.alignItems=r?"flex-start":"flex-end";const a=this.getBoundingClientRect(),l=this.__calculatePositionInOneDimension(t,a,this.noVerticalOverlap,s,this,e),_=this.__calculatePositionInOneDimension(t,a,this.noHorizontalOverlap,n,this,i);Object.assign(this.style,l,_),this.toggleAttribute("bottom-aligned",!e),this.toggleAttribute("top-aligned",e),this.toggleAttribute("end-aligned",!r),this.toggleAttribute("start-aligned",r)}__shouldAlignStartHorizontally(t,e){const o=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const i=Math.min(window.innerWidth,document.documentElement.clientWidth),s=!e&&"start"===this.horizontalAlign||e&&"end"===this.horizontalAlign;return this.__shouldAlignStart(t,o,i,this.__margins,s,this.noHorizontalOverlap,n)}__shouldAlignStartVertically(t){const e=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const o=Math.min(window.innerHeight,document.documentElement.clientHeight),i="top"===this.verticalAlign;return this.__shouldAlignStart(t,e,o,this.__margins,i,this.noVerticalOverlap,s)}__shouldAlignStart(t,e,o,i,s,n,r){const a=o-t[n?r.end:r.start]-i[r.end],l=t[n?r.start:r.end]-i[r.start],_=s?a:l;return s===(_>(s?l:a)||_>e)}__adjustBottomProperty(t,e,o){let i;if(t===e.end){if(e.end===s.end){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);o>t&&this.__oldViewportHeight&&(i=o-(this.__oldViewportHeight-t)),this.__oldViewportHeight=t}if(e.end===n.end){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);o>t&&this.__oldViewportWidth&&(i=o-(this.__oldViewportWidth-t)),this.__oldViewportWidth=t}}return i}__calculatePositionInOneDimension(t,e,o,i,s,n){const r=n?i.start:i.end,a=n?i.end:i.start,l=parseFloat(s.style[r]||getComputedStyle(s)[r]),_=this.__adjustBottomProperty(r,i,l),h=e[n?i.start:i.end]-t[o===n?i.end:i.start],d=_?`${_}px`:`${l+h*(n?-1:1)}px`;return{[r]:d,[a]:""}}}}}]);
//# sourceMappingURL=8202.js.map