@fluid-topics/ft-modal 2.2.51 → 2.2.53
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.
- package/build/ft-modal.light.js +1 -1
- package/build/ft-modal.min.js +139 -139
- package/package.json +8 -8
package/build/ft-modal.light.js
CHANGED
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
position: relative;
|
|
331
331
|
word-break: break-word;
|
|
332
332
|
}
|
|
333
|
-
`;var Ha=["top","right","bottom","left"],Ba=["start","end"],gi=Ha.reduce((e,t)=>e.concat(t,t+"-"+Ba[0],t+"-"+Ba[1]),[]),cr=Math.min,Be=Math.max,ur=Math.round;var Te=e=>({x:e,y:e}),qc={left:"right",right:"left",bottom:"top",top:"bottom"};function Fa(e,t,r){return Be(e,cr(t,r))}function hn(e,t){return typeof e=="function"?e(t):e}function dr(e){return e.split("-")[0]}function He(e){return e.split("-")[1]}function xi(e){return e==="x"?"y":"x"}function vi(e){return e==="y"?"height":"width"}function mn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function bi(e){return xi(mn(e))}function Va(e,t,r){r===void 0&&(r=!1);let n=He(e),i=bi(e),s=vi(i),o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=yi(o)),[o,yi(o)]}function ja(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function yi(e){let t=dr(e);return qc[t]+e.slice(t.length)}function Yc(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function za(e){return typeof e!="number"?Yc(e):{top:e,right:e,bottom:e,left:e}}function dt(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Wa(e,t,r){let{reference:n,floating:i}=e,s=mn(t),o=bi(t),a=vi(o),l=dr(t),c=s==="y",d=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2,y;switch(l){case"top":y={x:d,y:n.y-i.height};break;case"bottom":y={x:d,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:u};break;case"left":y={x:n.x-i.width,y:u};break;default:y={x:n.x,y:n.y}}let v=He(t);return v&&(y[o]+=p*(v==="end"?1:-1)*(r&&c?-1:1)),y}async function Ka(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:y=0}=hn(t,e),v=za(y),x=a[p?u==="floating"?"reference":"floating":u],w=dt(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),L=u==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(b))&&await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1},N=dt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:L,offsetParent:b,strategy:l}):L);return{top:(w.top-N.top+v.top)/S.y,bottom:(N.bottom-w.bottom+v.bottom)/S.y,left:(w.left-N.left+v.left)/S.x,right:(N.right-w.right+v.right)/S.x}}var Xc=50,Ga=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:Ka},l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=Wa(c,n,l),p=n,y=0,v={};for(let C=0;C<s.length;C++){let x=s[C];if(!x)continue;let{name:w,fn:L}=x,{x:b,y:S,data:N,reset:H}=await L({x:d,y:u,initialPlacement:n,placement:p,strategy:i,middlewareData:v,rects:c,platform:a,elements:{reference:e,floating:t}});d=b??d,u=S??u,v[w]={...v[w],...N},H&&y<Xc&&(y++,typeof H=="object"&&(H.placement&&(p=H.placement),H.rects&&(c=H.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):H.rects),{x:d,y:u}=Wa(c,p,l)),C=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:v}};function Zc(e,t,r){return(e?[...r.filter(i=>He(i)===e),...r.filter(i=>He(i)!==e)]:r.filter(i=>dr(i)===i)).filter(i=>e?He(i)===e||(t?ja(i)!==i:!1):!0)}var qa=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=t,{crossAxis:d=!1,alignment:u,allowedPlacements:p=gi,autoAlignment:y=!0,...v}=hn(e,t),C=u!==void 0||p===gi?Zc(u||null,y,p):p,x=((r=o.autoPlacement)==null?void 0:r.index)||0,w=C[x];if(w==null)return{};if(a!==w)return{reset:{placement:C[0]}};let L=await l.detectOverflow(t,v),b=Va(w,s,await(l.isRTL==null?void 0:l.isRTL(c.floating))),S=[L[dr(w)],L[b[0]],L[b[1]]],N=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:w,overflows:S}],H=C[x+1];if(H)return{data:{index:x+1,overflows:N},reset:{placement:H}};let te=N.map(oe=>{let Ut=He(oe.placement);return[oe.placement,Ut&&d?oe.overflows.slice(0,2).reduce((Il,Ul)=>Il+Ul,0):oe.overflows[0],oe.overflows]}).sort((oe,Ut)=>oe[1]-Ut[1]),xr=((i=te.filter(oe=>oe[2].slice(0,He(oe[0])?2:3).every(Ut=>Ut<=0))[0])==null?void 0:i[0])||te[0][0];return xr!==a?{data:{index:x+1,overflows:N},reset:{placement:xr}}:{}}}};var Ya=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:L=>{let{x:b,y:S}=L;return{x:b,y:S}}},...c}=hn(e,t),d={x:r,y:n},u=await s.detectOverflow(t,c),p=mn(i),y=xi(p),v=d[y],C=d[p],x=(L,b)=>Fa(b+u[L==="y"?"top":"left"],b,b-u[L==="y"?"bottom":"right"]);o&&(v=x(y,v)),a&&(C=x(p,C));let w=l.fn({...t,[y]:v,[p]:C});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[y]:o,[p]:a}}}}}};function gn(){return typeof window<"u"}function ft(e){return Za(e)?(e.nodeName||"").toLowerCase():"#document"}function ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pe(e){var t;return(t=(Za(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Za(e){return gn()?e instanceof Node||e instanceof ee(e).Node:!1}function ge(e){return gn()?e instanceof Element||e instanceof ee(e).Element:!1}function De(e){return gn()?e instanceof HTMLElement||e instanceof ee(e).HTMLElement:!1}function Xa(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ee(e).ShadowRoot}function pr(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function Ja(e){return/^(table|td|th)$/.test(ft(e))}function fr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Jc=/transform|translate|scale|rotate|perspective|filter/,Qc=/paint|layout|strict|content/,pt=e=>!!e&&e!=="none",Ei;function Dt(e){let t=ge(e)?xe(e):e;return pt(t.transform)||pt(t.translate)||pt(t.scale)||pt(t.rotate)||pt(t.perspective)||!xn()&&(pt(t.backdropFilter)||pt(t.filter))||Jc.test(t.willChange||"")||Qc.test(t.contain||"")}function Qa(e){let t=Fe(e);for(;De(t)&&!kt(t);){if(Dt(t))return t;if(fr(t))return null;t=Fe(t)}return null}function xn(){return Ei==null&&(Ei=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ei}function kt(e){return/^(html|body|#document)$/.test(ft(e))}function xe(e){return ee(e).getComputedStyle(e)}function hr(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fe(e){if(ft(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Xa(e)&&e.host||Pe(e);return Xa(t)?t.host:t}function el(e){let t=Fe(e);return kt(t)?(e.ownerDocument||e).body:De(t)&&pr(t)?t:el(t)}function yn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=el(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=ee(i);if(s){let a=vn(o);return t.concat(o,o.visualViewport||[],pr(i)?i:[],a&&r?yn(a):[])}else return t.concat(i,yn(i,[],r))}function vn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nl(e){let t=xe(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=De(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=ur(r)!==s||ur(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function il(e){return ge(e)?e:e.contextElement}function Mt(e){let t=il(e);if(!De(t))return Te(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:s}=nl(t),o=(s?ur(r.width):r.width)/n,a=(s?ur(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var eu=Te(0);function sl(e){let t=ee(e);return!xn()||!t.visualViewport?eu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tu(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===ee(e)}function mr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),s=il(e),o=Te(1);t&&(n?ge(n)&&(o=Mt(n)):o=Mt(e));let a=tu(s,r,n)?sl(s):Te(0),l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,u=i.height/o.y;if(s&&n){let p=ee(s),y=ge(n)?ee(n):n,v=p,C=vn(v);for(;C&&y!==v;){let x=Mt(C),w=C.getBoundingClientRect(),L=xe(C),b=w.left+(C.clientLeft+parseFloat(L.paddingLeft))*x.x,S=w.top+(C.clientTop+parseFloat(L.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,u*=x.y,l+=b,c+=S,v=ee(C),C=vn(v)}}return dt({width:d,height:u,x:l,y:c})}function bn(e,t){let r=hr(e).scrollLeft;return t?t.left+r:mr(Pe(e)).left+r}function ol(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-bn(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function ru(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,s=i==="fixed",o=Pe(n),a=t?fr(t.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=Te(1),d=Te(0),u=De(n);if((u||!s)&&((ft(n)!=="body"||pr(o))&&(l=hr(n)),u)){let y=mr(n);c=Mt(n),d.x=y.x+n.clientLeft,d.y=y.y+n.clientTop}let p=o&&!u&&!s?ol(o,l):Te(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}}function nu(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function iu(e){let t=hr(e),r=e.ownerDocument.body,n=Be(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Be(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-t.scrollLeft+bn(e),o=-t.scrollTop;return xe(r).direction==="rtl"&&(s+=Be(e.clientWidth,r.clientWidth)-n),{width:n,height:i,x:s,y:o}}var su=25;function ou(e,t,r){r===void 0&&(r="viewport");let n=r==="layoutViewport",i=ee(e),s=Pe(e),o=i.visualViewport,a=s.clientWidth,l=s.clientHeight,c=0,d=0;if(o){let p=!xn()||t==="fixed";n?p||(c=-o.offsetLeft,d=-o.offsetTop):(a=o.width,l=o.height,p&&(c=o.offsetLeft,d=o.offsetTop))}if(bn(s)<=0){let p=s.ownerDocument,y=p.body,v=getComputedStyle(y),C=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(s.clientWidth-y.clientWidth-C),w=getComputedStyle(s).scrollbarGutter==="stable both-edges"?x/2:x;w<=su&&(a-=w)}return{width:a,height:l,x:c,y:d}}function au(e,t){let r=mr(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=Mt(e),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function tl(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=ou(e,r,t);else if(t==="document")n=iu(Pe(e));else if(ge(t))n=au(t,r);else{let i=sl(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return dt(n)}function lu(e,t){let r=t.get(e);if(r)return r;let n=yn(e,[],!1).filter(a=>ge(a)&&ft(a)!=="body"),i=null,s=xe(e).position==="fixed",o=s?Fe(e):e;for(;ge(o)&&!kt(o);){let a=xe(o),l=Dt(o),c=i?i.position:s?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?n=n.filter(u=>u!==o):i=a,o=Fe(o)}return t.set(e,n),n}function cu(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[...r==="clippingAncestors"?fr(t)?[]:lu(t,this._c):[].concat(r),n],a=tl(t,o[0],i),l=a.top,c=a.right,d=a.bottom,u=a.left;for(let p=1;p<o.length;p++){let y=tl(t,o[p],i);l=Be(y.top,l),c=cr(y.right,c),d=cr(y.bottom,d),u=Be(y.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function uu(e){let{width:t,height:r}=nl(e);return{width:t,height:r}}function du(e,t,r){let n=De(t),i=Pe(t),s=r==="fixed",o=mr(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=Te(0);if((n||!s)&&((ft(t)!=="body"||pr(i))&&(a=hr(t)),n)){let p=mr(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!n&&i&&(l.x=bn(i));let c=i&&!n&&!s?ol(i,a):Te(0),d=o.left+a.scrollLeft-l.x-c.x,u=o.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:o.width,height:o.height}}function Ai(e){return xe(e).position==="static"}function rl(e,t){if(!De(e)||xe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Pe(e)===r&&(r=r.ownerDocument.body),r}function al(e,t){let r=ee(e);if(fr(e))return r;if(!De(e)){let i=Fe(e);for(;i&&!kt(i);){if(ge(i)&&!Ai(i))return i;i=Fe(i)}return r}let n=rl(e,t);for(;n&&Ja(n)&&Ai(n);)n=rl(n,t);return n&&kt(n)&&Ai(n)&&!Dt(n)?r:n||Qa(e)||r}var pu=async function(e){let t=this.getOffsetParent||al,r=this.getDimensions,n=await r(e.floating);return{reference:du(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function fu(e){return xe(e).direction==="rtl"}var En={convertOffsetParentRelativeRectToViewportRelativeRect:ru,getDocumentElement:Pe,getClippingRect:cu,getOffsetParent:al,getElementRects:pu,getClientRects:nu,getDimensions:uu,getScale:Mt,isElement:ge,isRTL:fu};var ll=qa,cl=Ya;var ul=(e,t,r)=>{let n=new Map,i=r??{},s={...En,...i.platform,_c:n};return Ga(e,t,{...i,platform:s})};function dl(e){return hu(e)}function Si(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function hu(e){for(let t=e;t;t=Si(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Si(e);t;t=Si(t)){if(!(t instanceof Element))continue;let r=getComputedStyle(t);if(r.display!=="contents"&&(r.position!=="static"||Dt(r)||t.tagName==="BODY"))return t}return null}async function pl(e,t,r){let n;return typeof r=="object"?n=r:n={placement:r},ul(e,t,{strategy:n.strategy,platform:{...En,getOffsetParent:i=>En.getOffsetParent(i,dl)},middleware:[cl({crossAxis:!0}),ll({allowedPlacements:[n.placement]})]})}var fl=m(_());var _i=class{fromAttribute(t){if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.map(n=>typeof n=="string"?Ot.fromAttribute(n):n):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},mu=new _i;var hl=(e,t)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:fl.hasChanged,converter:Ot,...t}),r[or]=(i=r[or])!==null&&i!==void 0?i:new Map,r[or].set(n,e??{})};var ve=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},V=class extends Rt{constructor(){super(...arguments),this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.ignoreMatchingElements=[],this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new de.Debouncer,this.revealDebouncer=new de.Debouncer,this.onTouch=t=>{this.isIgnored(t)||(this.show(),setTimeout(()=>window.addEventListener("touchstart",r=>{r.composedPath().includes(this.container)||this.onOut(r)},{once:!0}),100))},this.onHover=t=>{this.isIgnored(t)?this.matchesIgnored(t)&&this.hide():this.show()},this.onFocusIn=t=>{!this.isIgnored(t)&&window.FluidTopicsA11yHints.isKeyboardNavigation&&window.FluidTopicsA11yHints.lastPressedKey==="Tab"&&this.show()},this.onOut=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())},this.onClick=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())}}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){var t,r;return ml.html`
|
|
333
|
+
`;var Ha=["top","right","bottom","left"],Ba=["start","end"],gi=Ha.reduce((e,t)=>e.concat(t,t+"-"+Ba[0],t+"-"+Ba[1]),[]),cr=Math.min,Be=Math.max,ur=Math.round;var Te=e=>({x:e,y:e}),qc={left:"right",right:"left",bottom:"top",top:"bottom"};function Fa(e,t,r){return Be(e,cr(t,r))}function hn(e,t){return typeof e=="function"?e(t):e}function dr(e){return e.split("-")[0]}function He(e){return e.split("-")[1]}function xi(e){return e==="x"?"y":"x"}function vi(e){return e==="y"?"height":"width"}function mn(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function bi(e){return xi(mn(e))}function Va(e,t,r){r===void 0&&(r=!1);let n=He(e),i=bi(e),s=vi(i),o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=yi(o)),[o,yi(o)]}function ja(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function yi(e){let t=dr(e);return qc[t]+e.slice(t.length)}function Yc(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function za(e){return typeof e!="number"?Yc(e):{top:e,right:e,bottom:e,left:e}}function dt(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Wa(e,t,r){let{reference:n,floating:i}=e,s=mn(t),o=bi(t),a=vi(o),l=dr(t),c=s==="y",d=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2,y;switch(l){case"top":y={x:d,y:n.y-i.height};break;case"bottom":y={x:d,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:u};break;case"left":y={x:n.x-i.width,y:u};break;default:y={x:n.x,y:n.y}}let v=He(t);return v&&(y[o]+=p*(v==="end"?1:-1)*(r&&c?-1:1)),y}async function Ka(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:y=0}=hn(t,e),v=za(y),x=a[p?u==="floating"?"reference":"floating":u],w=dt(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),L=u==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(b))&&await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1},N=dt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:L,offsetParent:b,strategy:l}):L);return{top:(w.top-N.top+v.top)/S.y,bottom:(N.bottom-w.bottom+v.bottom)/S.y,left:(w.left-N.left+v.left)/S.x,right:(N.right-w.right+v.right)/S.x}}var Xc=50,Ga=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:Ka},l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=Wa(c,n,l),p=n,y=0,v={};for(let C=0;C<s.length;C++){let x=s[C];if(!x)continue;let{name:w,fn:L}=x,{x:b,y:S,data:N,reset:H}=await L({x:d,y:u,initialPlacement:n,placement:p,strategy:i,middlewareData:v,rects:c,platform:a,elements:{reference:e,floating:t}});d=b??d,u=S??u,v[w]={...v[w],...N},H&&y<Xc&&(y++,typeof H=="object"&&(H.placement&&(p=H.placement),H.rects&&(c=H.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):H.rects),{x:d,y:u}=Wa(c,p,l)),C=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:v}};function Zc(e,t,r){return(e?[...r.filter(i=>He(i)===e),...r.filter(i=>He(i)!==e)]:r.filter(i=>dr(i)===i)).filter(i=>e?He(i)===e||(t?ja(i)!==i:!1):!0)}var qa=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=t,{crossAxis:d=!1,alignment:u,allowedPlacements:p=gi,autoAlignment:y=!0,...v}=hn(e,t),C=u!==void 0||p===gi?Zc(u||null,y,p):p,x=((r=o.autoPlacement)==null?void 0:r.index)||0,w=C[x];if(w==null)return{};if(a!==w)return{reset:{placement:C[0]}};let L=await l.detectOverflow(t,v),b=Va(w,s,await(l.isRTL==null?void 0:l.isRTL(c.floating))),S=[L[dr(w)],L[b[0]],L[b[1]]],N=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:w,overflows:S}],H=C[x+1];if(H)return{data:{index:x+1,overflows:N},reset:{placement:H}};let te=N.map(oe=>{let Ut=He(oe.placement);return[oe.placement,Ut&&d?oe.overflows.slice(0,2).reduce((Il,Ul)=>Il+Ul,0):oe.overflows[0],oe.overflows]}).sort((oe,Ut)=>oe[1]-Ut[1]),xr=((i=te.filter(oe=>oe[2].slice(0,He(oe[0])?2:3).every(Ut=>Ut<=0))[0])==null?void 0:i[0])||te[0][0];return xr!==a?{data:{index:x+1,overflows:N},reset:{placement:xr}}:{}}}};var Ya=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:L=>{let{x:b,y:S}=L;return{x:b,y:S}}},...c}=hn(e,t),d={x:r,y:n},u=await s.detectOverflow(t,c),p=mn(i),y=xi(p),v=d[y],C=d[p],x=(L,b)=>Fa(b+u[L==="y"?"top":"left"],b,b-u[L==="y"?"bottom":"right"]);o&&(v=x(y,v)),a&&(C=x(p,C));let w=l.fn({...t,[y]:v,[p]:C});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[y]:o,[p]:a}}}}}};function gn(){return typeof window<"u"}function ft(e){return Za(e)?(e.nodeName||"").toLowerCase():"#document"}function ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pe(e){var t;return(t=(Za(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Za(e){return gn()?e instanceof Node||e instanceof ee(e).Node:!1}function ge(e){return gn()?e instanceof Element||e instanceof ee(e).Element:!1}function De(e){return gn()?e instanceof HTMLElement||e instanceof ee(e).HTMLElement:!1}function Xa(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ee(e).ShadowRoot}function pr(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function Ja(e){return/^(table|td|th)$/.test(ft(e))}function fr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Jc=/transform|translate|scale|rotate|perspective|filter/,Qc=/paint|layout|strict|content/,pt=e=>!!e&&e!=="none",Ei;function Dt(e){let t=ge(e)?xe(e):e;return pt(t.transform)||pt(t.translate)||pt(t.scale)||pt(t.rotate)||pt(t.perspective)||!xn()&&(pt(t.backdropFilter)||pt(t.filter))||Jc.test(t.willChange||"")||Qc.test(t.contain||"")}function Qa(e){let t=Fe(e);for(;De(t)&&!kt(t);){if(Dt(t))return t;if(fr(t))return null;t=Fe(t)}return null}function xn(){return Ei==null&&(Ei=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ei}function kt(e){return/^(html|body|#document)$/.test(ft(e))}function xe(e){return ee(e).getComputedStyle(e)}function hr(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fe(e){if(ft(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Xa(e)&&e.host||Pe(e);return Xa(t)?t.host:t}function el(e){let t=Fe(e);return kt(t)?(e.ownerDocument||e).body:De(t)&&pr(t)?t:el(t)}function yn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=el(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=ee(i);if(s){let a=vn(o);return t.concat(o,o.visualViewport||[],pr(i)?i:[],a&&r?yn(a):[])}else return t.concat(i,yn(i,[],r))}function vn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nl(e){let t=xe(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=De(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=ur(r)!==s||ur(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function il(e){return ge(e)?e:e.contextElement}function Mt(e){let t=il(e);if(!De(t))return Te(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:s}=nl(t),o=(s?ur(r.width):r.width)/n,a=(s?ur(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var eu=Te(0);function sl(e){let t=ee(e);return!xn()||!t.visualViewport?eu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tu(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===ee(e)}function mr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),s=il(e),o=Te(1);t&&(n?ge(n)&&(o=Mt(n)):o=Mt(e));let a=tu(s,r,n)?sl(s):Te(0),l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,u=i.height/o.y;if(s&&n){let p=ee(s),y=ge(n)?ee(n):n,v=p,C=vn(v);for(;C&&y!==v;){let x=Mt(C),w=C.getBoundingClientRect(),L=xe(C),b=w.left+(C.clientLeft+parseFloat(L.paddingLeft))*x.x,S=w.top+(C.clientTop+parseFloat(L.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,u*=x.y,l+=b,c+=S,v=ee(C),C=vn(v)}}return dt({width:d,height:u,x:l,y:c})}function bn(e,t){let r=hr(e).scrollLeft;return t?t.left+r:mr(Pe(e)).left+r}function ol(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-bn(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function ru(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,s=i==="fixed",o=Pe(n),a=t?fr(t.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=Te(1),d=Te(0),u=De(n);if((u||!s)&&((ft(n)!=="body"||pr(o))&&(l=hr(n)),u)){let y=mr(n);c=Mt(n),d.x=y.x+n.clientLeft,d.y=y.y+n.clientTop}let p=o&&!u&&!s?ol(o,l):Te(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}}function nu(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function iu(e){let t=hr(e),r=e.ownerDocument.body,n=Be(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Be(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-t.scrollLeft+bn(e),o=-t.scrollTop;return xe(r).direction==="rtl"&&(s+=Be(e.clientWidth,r.clientWidth)-n),{width:n,height:i,x:s,y:o}}var su=25;function ou(e,t,r){r===void 0&&(r="viewport");let n=r==="layoutViewport",i=ee(e),s=Pe(e),o=i.visualViewport,a=s.clientWidth,l=s.clientHeight,c=0,d=0;if(o){let p=!xn()||t==="fixed";n?p||(c=-o.offsetLeft,d=-o.offsetTop):(a=o.width,l=o.height,p&&(c=o.offsetLeft,d=o.offsetTop))}if(bn(s)<=0){let p=s.ownerDocument,y=p.body,v=getComputedStyle(y),C=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(s.clientWidth-y.clientWidth-C),w=getComputedStyle(s).scrollbarGutter==="stable both-edges"?x/2:x;w<=su&&(a-=w)}return{width:a,height:l,x:c,y:d}}function au(e,t){let r=mr(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=Mt(e),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function tl(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=ou(e,r,t);else if(t==="document")n=iu(Pe(e));else if(ge(t))n=au(t,r);else{let i=sl(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return dt(n)}function lu(e,t){let r=t.get(e);if(r)return r;let n=yn(e,[],!1).filter(a=>ge(a)&&ft(a)!=="body"),i=null,s=xe(e).position==="fixed",o=s?Fe(e):e;for(;ge(o)&&!kt(o);){let a=xe(o),l=Dt(o),c=i?i.position:s?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?n=n.filter(u=>u!==o):i=a,o=Fe(o)}return t.set(e,n),n}function cu(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[...r==="clippingAncestors"?fr(t)?[]:lu(t,this._c):[].concat(r),n],a=tl(t,o[0],i),l=a.top,c=a.right,d=a.bottom,u=a.left;for(let p=1;p<o.length;p++){let y=tl(t,o[p],i);l=Be(y.top,l),c=cr(y.right,c),d=cr(y.bottom,d),u=Be(y.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function uu(e){let{width:t,height:r}=nl(e);return{width:t,height:r}}function du(e,t,r){let n=De(t),i=Pe(t),s=r==="fixed",o=mr(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=Te(0);if((n||!s)&&((ft(t)!=="body"||pr(i))&&(a=hr(t)),n)){let p=mr(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!n&&i&&(l.x=bn(i));let c=i&&!n&&!s?ol(i,a):Te(0),d=o.left+a.scrollLeft-l.x-c.x,u=o.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:o.width,height:o.height}}function Ai(e){return xe(e).position==="static"}function rl(e,t){if(!De(e)||xe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Pe(e)===r&&(r=r.ownerDocument.body),r}function al(e,t){let r=ee(e);if(fr(e))return r;if(!De(e)){let i=Fe(e);for(;i&&!kt(i);){if(ge(i)&&!Ai(i))return i;i=Fe(i)}return r}let n=rl(e,t);for(;n&&Ja(n)&&Ai(n);)n=rl(n,t);return n&&kt(n)&&Ai(n)&&!Dt(n)?r:n||Qa(e)||r}var pu=async function(e){let t=this.getOffsetParent||al,r=this.getDimensions,n=await r(e.floating);return{reference:du(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function fu(e){return xe(e).direction==="rtl"}var En={convertOffsetParentRelativeRectToViewportRelativeRect:ru,getDocumentElement:Pe,getClippingRect:cu,getOffsetParent:al,getElementRects:pu,getClientRects:nu,getDimensions:uu,getScale:Mt,isElement:ge,isRTL:fu};var ll=qa,cl=Ya;var ul=(e,t,r)=>{let n=new Map,i=r??{},s={...En,...i.platform,_c:n};return Ga(e,t,{...i,platform:s})};function dl(e){return hu(e)}function Si(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function hu(e){for(let t=e;t;t=Si(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Si(e);t;t=Si(t)){if(!(t instanceof Element))continue;let r=getComputedStyle(t);if(r.display!=="contents"&&(r.position!=="static"||Dt(r)||t.tagName==="BODY"))return t}return null}async function pl(e,t,r){let n;return typeof r=="object"?n=r:n={placement:r},ul(e,t,{strategy:n.strategy,platform:{...En,getOffsetParent:i=>n.strategy==="fixed"?window:En.getOffsetParent(i,dl)},middleware:[cl({crossAxis:!0,boundary:n.strategy==="fixed"?[]:"clippingAncestors"}),ll({allowedPlacements:[n.placement]})]})}var fl=m(_());var _i=class{fromAttribute(t){if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.map(n=>typeof n=="string"?Ot.fromAttribute(n):n):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},mu=new _i;var hl=(e,t)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:fl.hasChanged,converter:Ot,...t}),r[or]=(i=r[or])!==null&&i!==void 0?i:new Map,r[or].set(n,e??{})};var ve=function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},V=class extends Rt{constructor(){super(...arguments),this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.ignoreMatchingElements=[],this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new de.Debouncer,this.revealDebouncer=new de.Debouncer,this.onTouch=t=>{this.isIgnored(t)||(this.show(),setTimeout(()=>window.addEventListener("touchstart",r=>{r.composedPath().includes(this.container)||this.onOut(r)},{once:!0}),100))},this.onHover=t=>{this.isIgnored(t)?this.matchesIgnored(t)&&this.hide():this.show()},this.onFocusIn=t=>{!this.isIgnored(t)&&window.FluidTopicsA11yHints.isKeyboardNavigation&&window.FluidTopicsA11yHints.lastPressedKey==="Tab"&&this.show()},this.onOut=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())},this.onClick=t=>{this.isIgnored(t)||(this.revealDebouncer.cancel(),this.hide())}}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){var t,r;return ml.html`
|
|
334
334
|
<div part="container"
|
|
335
335
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}">
|
|
336
336
|
<slot part="slot"></slot>
|