coupdoeil 1.0.0.pre.alpha.1
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +1 -0
- data/MIT-LICENSE +20 -0
- data/README.md +6 -0
- data/Rakefile +8 -0
- data/app/assets/config/coupdoeil_manifest.js +1 -0
- data/app/assets/javascripts/coupdoeil.js +2289 -0
- data/app/assets/javascripts/coupdoeil.min.js +2 -0
- data/app/assets/javascripts/coupdoeil.min.js.map +1 -0
- data/app/assets/stylesheets/coupdoeil/application.css +15 -0
- data/app/assets/stylesheets/coupdoeil/hovercard-animation.css +44 -0
- data/app/assets/stylesheets/coupdoeil/hovercard-arrow.css +39 -0
- data/app/assets/stylesheets/coupdoeil/hovercard.css +84 -0
- data/app/controllers/coupdoeil/hovercards_controller.rb +46 -0
- data/app/helpers/coupdoeil/application_helper.rb +16 -0
- data/app/javascript/coupdoeil/elements/coupdoeil_element.js +33 -0
- data/app/javascript/coupdoeil/events/onclick.js +68 -0
- data/app/javascript/coupdoeil/events/onmouseover.js +86 -0
- data/app/javascript/coupdoeil/events.js +19 -0
- data/app/javascript/coupdoeil/hovercard/actions.js +60 -0
- data/app/javascript/coupdoeil/hovercard/attributes.js +33 -0
- data/app/javascript/coupdoeil/hovercard/cache.js +18 -0
- data/app/javascript/coupdoeil/hovercard/closing.js +81 -0
- data/app/javascript/coupdoeil/hovercard/config.js +15 -0
- data/app/javascript/coupdoeil/hovercard/controller.js +22 -0
- data/app/javascript/coupdoeil/hovercard/opening.js +139 -0
- data/app/javascript/coupdoeil/hovercard/optionsParser.js +117 -0
- data/app/javascript/coupdoeil/hovercard/positioning.js +74 -0
- data/app/javascript/coupdoeil/hovercard/state_check.js +11 -0
- data/app/javascript/coupdoeil/hovercard.js +6 -0
- data/app/javascript/coupdoeil/index.js +1 -0
- data/app/models/coupdoeil/hovercard/option/animation.rb +20 -0
- data/app/models/coupdoeil/hovercard/option/cache.rb +19 -0
- data/app/models/coupdoeil/hovercard/option/loading.rb +19 -0
- data/app/models/coupdoeil/hovercard/option/offset.rb +35 -0
- data/app/models/coupdoeil/hovercard/option/placement.rb +44 -0
- data/app/models/coupdoeil/hovercard/option/trigger.rb +19 -0
- data/app/models/coupdoeil/hovercard/option.rb +45 -0
- data/app/models/coupdoeil/hovercard/options_set.rb +57 -0
- data/app/models/coupdoeil/hovercard/registry.rb +25 -0
- data/app/models/coupdoeil/hovercard/setup.rb +44 -0
- data/app/models/coupdoeil/hovercard/view_context_delegation.rb +18 -0
- data/app/models/coupdoeil/hovercard.rb +115 -0
- data/app/models/coupdoeil/params.rb +83 -0
- data/app/models/coupdoeil/tag.rb +45 -0
- data/app/style/hovercard-animation.scss +44 -0
- data/app/style/hovercard-arrow.scss +40 -0
- data/app/style/hovercard.scss +2 -0
- data/app/views/layouts/coupdoeil/application.html.erb +15 -0
- data/config/routes.rb +3 -0
- data/lib/coupdoeil/engine.rb +62 -0
- data/lib/coupdoeil/version.rb +3 -0
- data/lib/coupdoeil.rb +6 -0
- data/lib/generators/coupdoeil/hovercard/USAGE +15 -0
- data/lib/generators/coupdoeil/hovercard/hovercard_generator.rb +22 -0
- data/lib/generators/coupdoeil/hovercard/templates/hovercard.rb.tt +8 -0
- data/lib/generators/coupdoeil/install/install_generator.rb +71 -0
- data/lib/generators/coupdoeil/install/templates/layout.html.erb.tt +14 -0
- data/lib/tasks/coupdoeil_tasks.rake +4 -0
- metadata +129 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
class t{constructor(t){this.coupdoeilElement=t,this.card=null,this.children=new Set,this.parent=null,this.closingRequest=null,this.openingDelay=null,this.fetchDelay=null}get isOpen(){return!!this.coupdoeilElement.dataset.hovercardOpen}get isClosed(){return!this.isOpen}}const e="coupdoeil--hovercard",n=`.${e}`,o=150,r=100,i=200,c={animation:{getter:function(t){return s[(56&t)>>4]}},cache:{getter:function(t){return!(8&~t)}},offset:{getter:function(t){const e=Number(BigInt(t)>>BigInt(23));if(0===e)return 0;return function(t){if("number"==typeof t)return t;if(/^(-?\d+\.?\d+)px$/.test(t))return parseFloat(t);if(/^(-?\d*\.?\d+)rem$/.test(t))return parseFloat(t)*parseFloat(getComputedStyle(document.documentElement).fontSize);return 0}(`${1&~e?"":"-"}${e>>13}.${e>>2&2047}${2&~e?"px":"rem"}`)}},placement:{getter:function(t){const e=t>>7&65535;let n=0,o=null;const r=[];for(;"auto"!==o&&n<16;)o=u[e>>n&15],r.push(o),n+=4;return r}},loading:{getter:function(t){return f[1&t]}},trigger:{getter:function(t){return a[1&t]}}},l=["trigger","loading","cache","animation","placement","offset"],a=["hover","click"],s=[!1,"slide-in","fade-in","slide-out","custom"],u=["auto","top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],f=["asyn","preload","lazy"];const d={animation:void 0,cache:void 0,offset:void 0,placement:void 0,loading:void 0,trigger:void 0};function p(t){const e=t.getAttribute("hc");return parseInt(e,36)}function h(t){return t.coupdoeilElement.getAttribute("hc-type")}function m(t){return t.coupdoeilElement.getAttribute("hc-params")}function g(t){return function(t,e){const n=t.hovercardController.optionsInt||=p(t);return c[e].getter(n)}(t.coupdoeilElement,"trigger")}function y(t){return"click"!==g(t)}function w(t){return"hover"===g(t)}function v(t){return"hover"!==g(t)}function x(t){return t.coupdoeilElement.querySelector(".hovercard-content")}const b=new Map;function E(t){return x(t)?t.coupdoeilElement.uniqueId:h(t)+m(t)}function T(t){return b.get(E(t))}async function C(t,e,n){const o=e.dataset,r=n?`${n}-${t}`:t;let i=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`;const c=o[i]?o[i].split(" "):[r],l=o[`${i}Start`]?o[`${i}Start`].split(" "):[`${r}-start`],a=o[`${i}End`]?o[`${i}End`].split(" "):[`${r}-end`];L(e,c),L(e,l),await new Promise((t=>{requestAnimationFrame((()=>{requestAnimationFrame(t)}))})),R(e,l),L(e,a),await function(t){return new Promise((e=>{const n=getComputedStyle(t).transitionDuration.split(",")[0],o=1e3*Number(n.replace("s",""));setTimeout((()=>{e()}),o)}))}(e),R(e,a),R(e,c)}function L(t,e){t.classList.add(...e)}function R(t,e){t.classList.remove(...e)}function O(t){clearTimeout(t.closingRequest),t.closingRequest=null}function D(t,e=!0){t.closing||t.isClosed||(t.closing=!0,M(t),t.children.forEach((t=>{D(t)})),function(t){t.parent&&(t.parent.children.delete(t),t.parent=null)}(t),e&&t.card.dataset.animation?async function(t){await async function(t,e=null){await C("leave",t,e),t.classList.add("hidden")}(t.card,"hovercard"),A(t)}(t):A(t))}function A(t){t.card.remove(),t.card=null,delete t.closing,delete t.coupdoeilElement.dataset.hovercardOpen}function P(t){M(t),t.closingRequest=setTimeout((()=>{D(t)}),o)}function S(t){t.children.forEach((t=>{D(t)}))}const $=new Map;function H(){b.clear()}function q(t){$.set(t.uniqueId,t)}function F(){for(const t of $.values())D(t.hovercardController),W(t)}function k(){for(const t of $.values())D(t.hovercardController,!1),W(t)}function W(t){$.delete(t.uniqueId)}function M(t){!function(t){clearTimeout(t.openingDelay),t.openingDelay=null,clearTimeout(t.fetchDelay),t.fetchDelay=null,delete t.coupdoeilElement.openingHovercard}(t),O(t)}window.hovercads=$;const B=["top","right","bottom","left"],V=["start","end"],I=B.reduce(((t,e)=>t.concat(e,e+"-"+V[0],e+"-"+V[1])),[]),N=Math.min,j=Math.max,z=Math.round,_=t=>({x:t,y:t}),U={left:"right",right:"left",bottom:"top",top:"bottom"},X={start:"end",end:"start"};function Y(t,e,n){return j(t,N(e,n))}function J(t,e){return"function"==typeof t?t(e):t}function G(t){return t.split("-")[0]}function K(t){return t.split("-")[1]}function Q(t){return"x"===t?"y":"x"}function Z(t){return"y"===t?"height":"width"}function tt(t){return["top","bottom"].includes(G(t))?"y":"x"}function et(t){return Q(tt(t))}function nt(t,e,n){void 0===n&&(n=!1);const o=K(t),r=et(t),i=Z(r);let c="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(c=rt(c)),[c,rt(c)]}function ot(t){return t.replace(/start|end/g,(t=>X[t]))}function rt(t){return t.replace(/left|right|bottom|top/g,(t=>U[t]))}function it(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function lt(t,e,n){let{reference:o,floating:r}=t;const i=tt(e),c=et(e),l=Z(c),a=G(e),s="y"===i,u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[l]/2-r[l]/2;let p;switch(a){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(K(e)){case"start":p[c]-=d*(n&&s?-1:1);break;case"end":p[c]+=d*(n&&s?-1:1)}return p}async function at(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:c,elements:l,strategy:a}=t,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=J(e,t),h=it(p),m=l[d?"floating"===f?"reference":"floating":f],g=ct(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:u,strategy:a})),y="floating"===f?{x:o,y:r,width:c.floating.width,height:c.floating.height}:c.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),v=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},x=ct(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-x.top+h.top)/v.y,bottom:(x.bottom-g.bottom+h.bottom)/v.y,left:(g.left-x.left+h.left)/v.x,right:(x.right-g.right+h.right)/v.x}}function st(){return"undefined"!=typeof window}function ut(t){return pt(t)?(t.nodeName||"").toLowerCase():"#document"}function ft(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function dt(t){var e;return null==(e=(pt(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function pt(t){return!!st()&&(t instanceof Node||t instanceof ft(t).Node)}function ht(t){return!!st()&&(t instanceof Element||t instanceof ft(t).Element)}function mt(t){return!!st()&&(t instanceof HTMLElement||t instanceof ft(t).HTMLElement)}function gt(t){return!(!st()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof ft(t).ShadowRoot)}function yt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Tt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function wt(t){return["table","td","th"].includes(ut(t))}function vt(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function xt(t){const e=bt(),n=ht(t)?Tt(t):t;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function bt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Et(t){return["html","body","#document"].includes(ut(t))}function Tt(t){return ft(t).getComputedStyle(t)}function Ct(t){return ht(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Lt(t){if("html"===ut(t))return t;const e=t.assignedSlot||t.parentNode||gt(t)&&t.host||dt(t);return gt(e)?e.host:e}function Rt(t){const e=Lt(t);return Et(e)?t.ownerDocument?t.ownerDocument.body:t.body:mt(e)&&yt(e)?e:Rt(e)}function Ot(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=Rt(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),c=ft(r);if(i){const t=Dt(c);return e.concat(c,c.visualViewport||[],yt(r)?r:[],t&&n?Ot(t):[])}return e.concat(r,Ot(r,[],n))}function Dt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function At(t){const e=Tt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=mt(t),i=r?t.offsetWidth:n,c=r?t.offsetHeight:o,l=z(n)!==i||z(o)!==c;return l&&(n=i,o=c),{width:n,height:o,$:l}}function Pt(t){return ht(t)?t:t.contextElement}function St(t){const e=Pt(t);if(!mt(e))return _(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=At(e);let c=(i?z(n.width):n.width)/o,l=(i?z(n.height):n.height)/r;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const $t=_(0);function Ht(t){const e=ft(t);return bt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:$t}function qt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=Pt(t);let c=_(1);e&&(o?ht(o)&&(c=St(o)):c=St(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==ft(t))&&e}(i,n,o)?Ht(i):_(0);let a=(r.left+l.x)/c.x,s=(r.top+l.y)/c.y,u=r.width/c.x,f=r.height/c.y;if(i){const t=ft(i),e=o&&ht(o)?ft(o):o;let n=t,r=Dt(n);for(;r&&o&&e!==n;){const t=St(r),e=r.getBoundingClientRect(),o=Tt(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,c=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,s*=t.y,u*=t.x,f*=t.y,a+=i,s+=c,n=ft(r),r=Dt(n)}}return ct({width:u,height:f,x:a,y:s})}function Ft(t,e){const n=Ct(t).scrollLeft;return e?e.left+n:qt(dt(t)).left+n}function kt(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:Ft(t,o)),y:o.top+e.scrollTop}}function Wt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=ft(t),o=dt(t),r=n.visualViewport;let i=o.clientWidth,c=o.clientHeight,l=0,a=0;if(r){i=r.width,c=r.height;const t=bt();(!t||t&&"fixed"===e)&&(l=r.offsetLeft,a=r.offsetTop)}return{width:i,height:c,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=dt(t),n=Ct(t),o=t.ownerDocument.body,r=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+Ft(t);const l=-n.scrollTop;return"rtl"===Tt(o).direction&&(c+=j(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:c,y:l}}(dt(t));else if(ht(e))o=function(t,e){const n=qt(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=mt(t)?St(t):_(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=Ht(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return ct(o)}function Mt(t,e){const n=Lt(t);return!(n===e||!ht(n)||Et(n))&&("fixed"===Tt(n).position||Mt(n,e))}function Bt(t,e,n){const o=mt(e),r=dt(e),i="fixed"===n,c=qt(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const a=_(0);if(o||!o&&!i)if(("body"!==ut(e)||yt(r))&&(l=Ct(e)),o){const t=qt(e,!0,i,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else r&&(a.x=Ft(r));const s=!r||o||i?_(0):kt(r,l);return{x:c.left+l.scrollLeft-a.x-s.x,y:c.top+l.scrollTop-a.y-s.y,width:c.width,height:c.height}}function Vt(t){return"static"===Tt(t).position}function It(t,e){if(!mt(t)||"fixed"===Tt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return dt(t)===n&&(n=n.ownerDocument.body),n}function Nt(t,e){const n=ft(t);if(vt(t))return n;if(!mt(t)){let e=Lt(t);for(;e&&!Et(e);){if(ht(e)&&!Vt(e))return e;e=Lt(e)}return n}let o=It(t,e);for(;o&&wt(o)&&Vt(o);)o=It(o,e);return o&&Et(o)&&Vt(o)&&!xt(o)?n:o||function(t){let e=Lt(t);for(;mt(e)&&!Et(e);){if(xt(e))return e;if(vt(e))return null;e=Lt(e)}return null}(t)||n}const jt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,c=dt(o),l=!!e&&vt(e.floating);if(o===c||l&&i)return n;let a={scrollLeft:0,scrollTop:0},s=_(1);const u=_(0),f=mt(o);if((f||!f&&!i)&&(("body"!==ut(o)||yt(c))&&(a=Ct(o)),mt(o))){const t=qt(o);s=St(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!c||f||i?_(0):kt(c,a,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-a.scrollLeft*s.x+u.x+d.x,y:n.y*s.y-a.scrollTop*s.y+u.y+d.y}},getDocumentElement:dt,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?vt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=Ot(t,[],!1).filter((t=>ht(t)&&"body"!==ut(t))),r=null;const i="fixed"===Tt(t).position;let c=i?Lt(t):t;for(;ht(c)&&!Et(c);){const e=Tt(c),n=xt(c);n||"fixed"!==e.position||(r=null),(i?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||yt(c)&&!n&&Mt(t,c))?o=o.filter((t=>t!==c)):r=e,c=Lt(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=i[0],l=i.reduce(((t,n)=>{const o=Wt(e,n,r);return t.top=j(o.top,t.top),t.right=N(o.right,t.right),t.bottom=N(o.bottom,t.bottom),t.left=j(o.left,t.left),t}),Wt(e,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Nt,getElementRects:async function(t){const e=this.getOffsetParent||Nt,n=this.getDimensions,o=await n(t.floating);return{reference:Bt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=At(t);return{width:e,height:n}},getScale:St,isElement:ht,isRTL:function(t){return"rtl"===Tt(t).direction}},zt=at,_t=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:c,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),c=G(n),l=K(n),a="y"===tt(n),s=["left","top"].includes(c)?-1:1,u=i&&a?-1:1,f=J(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),a?{x:p*u,y:d*s}:{x:d*s,y:p*u}}(e,t);return c===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:c}}}}},Ut=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,r;const{rects:i,middlewareData:c,placement:l,platform:a,elements:s}=e,{crossAxis:u=!1,alignment:f,allowedPlacements:d=I,autoAlignment:p=!0,...h}=J(t,e),m=void 0!==f||d===I?function(t,e,n){return(t?[...n.filter((e=>K(e)===t)),...n.filter((e=>K(e)!==t))]:n.filter((t=>G(t)===t))).filter((n=>!t||K(n)===t||!!e&&ot(n)!==n))}(f||null,p,d):d,g=await at(e,h),y=(null==(n=c.autoPlacement)?void 0:n.index)||0,w=m[y];if(null==w)return{};const v=nt(w,i,await(null==a.isRTL?void 0:a.isRTL(s.floating)));if(l!==w)return{reset:{placement:m[0]}};const x=[g[G(w)],g[v[0]],g[v[1]]],b=[...(null==(o=c.autoPlacement)?void 0:o.overflows)||[],{placement:w,overflows:x}],E=m[y+1];if(E)return{data:{index:y+1,overflows:b},reset:{placement:E}};const T=b.map((t=>{const e=K(t.placement);return[t.placement,e&&u?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),C=(null==(r=T.filter((t=>t[2].slice(0,K(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||T[0][0];return C!==l?{data:{index:y+1,overflows:b},reset:{placement:C}}:{}}}},Xt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:c,elements:l,middlewareData:a}=e,{element:s,padding:u=0}=J(t,e)||{};if(null==s)return{};const f=it(u),d={x:n,y:o},p=et(r),h=Z(p),m=await c.getDimensions(s),g="y"===p,y=g?"top":"left",w=g?"bottom":"right",v=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-d[p]-i.floating[h],b=d[p]-i.reference[p],E=await(null==c.getOffsetParent?void 0:c.getOffsetParent(s));let T=E?E[v]:0;T&&await(null==c.isElement?void 0:c.isElement(E))||(T=l.floating[v]||i.floating[h]);const C=x/2-b/2,L=T/2-m[h]/2-1,R=N(f[y],L),O=N(f[w],L),D=R,A=T-m[h]-O,P=T/2-m[h]/2+C,S=Y(D,P,A),$=!a.arrow&&null!=K(r)&&P!==S&&i.reference[h]/2-(P<D?R:O)-m[h]/2<0,H=$?P<D?P-D:P-A:0;return{[p]:d[p]+H,data:{[p]:S,centerOffset:P-S-H,...$&&{alignmentOffset:H}},reset:$}}}),Yt=(t,e,n)=>{const o=new Map,r={platform:jt,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:c}=n,l=i.filter(Boolean),a=await(null==c.isRTL?void 0:c.isRTL(e));let s=await c.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=lt(s,o,a),d=o,p={},h=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:g,y:y,data:w,reset:v}=await m({x:u,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:s,platform:c,elements:{reference:t,floating:e}});u=null!=g?g:u,f=null!=y?y:f,p={...p,[i]:{...p[i],...w}},v&&h<=50&&(h++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(s=!0===v.rects?await c.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:u,y:f}=lt(s,d,a))),n=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:p}})(t,e,{...r,platform:i})};async function Jt(t,e){let{placement:n,offset:o}=e;const r=n[0],i=t.card.querySelector("[data-hovercard-arrow]"),c=[Gt(n)];if(i){o+=i.clientWidth,c.push(Xt({element:i}))}c.push(_t(o));const l=await Yt(t.coupdoeilElement,t.card,{placement:r,middleware:c}),{x:a,y:s,placement:u}=l;i&&function(t,e){const n=t.clientWidth,{placement:o,middlewareData:{arrow:r}}=e,i=o.split("-")[0],c=Kt[i],{x:l,y:a}=r,{borderWidth:s}=getComputedStyle(t.parentElement);Object.assign(t.style,{left:null!=l?`${l}px`:"",top:null!=a?`${a}px`:"",[c]:`calc(${-n}px + ${s})`})}(i,l),t.card.dataset.placement=u,Object.assign(t.card.style,{left:`${a}px`,top:`${s}px`})}const Gt=t=>{let e=0;return{name:"autoPlacement",async fn(n){if("auto"===n.placement)return Ut().fn(n);const{top:o,bottom:r,left:i,right:c}=await zt(n),l=o>0||r>0||i>0||c>0;return"auto"!==t[e]&&l?(e++,{reset:{placement:t[e]||"auto"}}):l?Ut().fn(n):{}}}},Kt={right:"left",left:"right",top:"bottom",bottom:"top"};async function Qt(t,{parent:n}){if(t.isOpen)return O(t),q(t.coupdoeilElement);n&&(t.parent=n,n.children.add(t));const o=function(t){if(function(t){return"click"===g(t)}(t))return{reOpening:0,actualOpening:0,fetch:0};return{fetch:r,reOpening:r+i,actualOpening:i-r}}(t),a=function(t){const e=t.hovercardController.optionsInt||=p(t),n=Object.create(d);for(const t of l)n[t]=c[t].getter(e);return n}(t.coupdoeilElement),{cache:s}=a;if(t.openingDelay=new Promise((e=>{T(t)&&s?setTimeout(e,o.reOpening):setTimeout(e,o.actualOpening)})),!T(t)||!s){if(t.fetchDelay=new Promise((t=>{setTimeout(t,o.fetch)})),await t.fetchDelay,!t.fetchDelay)return;t.fetchDelay=null;const e=x(t)?.innerHTML||await function(t){const e=h(t),n=m(t),o=document.querySelector("meta[name=csrf-token]").content;let r="/coupdoeil/hovercard";const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:n,action_name:e,authenticity_token:o})};return fetch(r,i).then((t=>{if(t.status>=400)throw"error while fetching hovercard content";return t.text()}))}(t);!function(t,e){b.set(E(t),e)}(t,e)}await t.openingDelay;const u=t.parent&&(t.parent.isClosed||t.parent.closingRequest);t.openingDelay&&!u&&(t.openingDelay=null,await async function(t,n){if(t.isOpen)return;O(t),t.card=function(t,n){const o=document.createElement("div");return o.setAttribute("role","dialog"),o.classList.add(e,"hidden"),o.style.cssText="position: absolute; left: 0; top: 0;",o.innerHTML=T(t),o.controller=t,o.dataset.placement=n.placement,o}(t,n),document.body.appendChild(t.card),n.animation&&(t.card.dataset.animation=n.animation);requestAnimationFrame((async()=>{t.card.style.opacity="0",t.card.classList.remove("hidden"),requestAnimationFrame((async()=>{await Jt(t,n),t.card.classList.add("hidden"),t.card.style.removeProperty("opacity"),requestAnimationFrame((async()=>{q(t.coupdoeilElement),delete t.coupdoeilElement.openingHovercard,t.coupdoeilElement.dataset.hovercardOpen=!0,await async function(t,e=null){t.classList.remove("hidden"),await C("enter",t,e)}(t.card,"hovercard")}))}))}))}(t,a))}class Zt extends HTMLElement{constructor(){super(),this.uniqueId=function(){const t=new Uint32Array(1);return window.crypto.getRandomValues(t),t[0]}(),this.hovercardController=new t(this)}openHovercard(){if(this.openingHovercard||this.hovercardController.isOpen)return;this.openingHovercard=!0;const t=this.closest(n)?.controller;return q(this),Qt(this.hovercardController,{parent:t})}closeHovercard(){D(this.hovercardController)}}function te(){return $.size>0}const ee=({target:t})=>{const e=t.closest("coup-doeil"),o=t.closest(n);e&&o?function(t){const e=t.hovercardController;if(y(e))return;e.isOpen?D(e):t.openHovercard()}(e):e?function(t){const e=t.hovercardController;if(y(e))return;e.isOpen?D(e):(F(),t.openHovercard())}(e):o?function(t,e){const n=t.controller;o=e,o.closest("[data-hovercard-close]")||o.dataset.hasOwnProperty("hovercardClose")?D(n):n.children.size>0&&S(n);var o}(o,t):F()};const ne=({target:t})=>{const e=t.closest("coup-doeil"),o=t.closest(n);e&&o?function(t,e){const n=t.hovercardController,o=e.controller;if(v(n))return;n.isOpen?S(n):(S(o),t.openHovercard())}(e,o):e?function(t){const e=t.hovercardController;if(v(e))return;e.isClosed?(!function(){for(const t of $.values())w(t.hovercardController)&&(D(t.hovercardController),W(t))}(),t.openHovercard()):e.closingRequest&&(O(e),q(t))}(e):o?function(t){const e=t.controller;e.closingRequest?(O(e),q(e.coupdoeilElement)):e.children.size>0&&e.children.forEach((t=>{w(t)&&P(t)}))}(o):te()&&function(){for(const t of $.values())w(t.hovercardController)&&(P(t.hovercardController),W(t))}()};document.addEventListener("DOMContentLoaded",(()=>{H(),document.addEventListener("click",ee),document.documentElement.addEventListener("mouseover",ne,{passive:!0}),window.Turbo&&(document.addEventListener("turbo:before-cache",(t=>{k()})),document.addEventListener("turbo:load",(t=>{k(),H()})))})),void 0===customElements.get("coup-doeil")&&customElements.define("coup-doeil",Zt);
|
2
|
+
//# sourceMappingURL=coupdoeil.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"coupdoeil.min.js","sources":["../../javascript/coupdoeil/hovercard/controller.js","../../javascript/coupdoeil/hovercard/config.js","../../javascript/coupdoeil/hovercard/optionsParser.js","../../javascript/coupdoeil/hovercard/attributes.js","../../javascript/coupdoeil/hovercard/cache.js","../../../node_modules/el-transition/index.js","../../javascript/coupdoeil/hovercard/closing.js","../../javascript/coupdoeil/hovercard/actions.js","../../javascript/coupdoeil/hovercard/opening.js","../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../javascript/coupdoeil/hovercard/positioning.js","../../javascript/coupdoeil/elements/coupdoeil_element.js","../../javascript/coupdoeil/hovercard/state_check.js","../../javascript/coupdoeil/events/onclick.js","../../javascript/coupdoeil/events/onmouseover.js","../../javascript/coupdoeil/events.js","../../javascript/coupdoeil/hovercard.js"],"sourcesContent":["export class HovercardController {\n constructor(coupdoeilElement) {\n this.coupdoeilElement = coupdoeilElement\n\n this.card = null // can go on coupdoeil element, renamed 'hovercardElement'\n\n this.children = new Set() // can go on hovercardElement\n this.parent = null // can go on hovercardElement\n\n this.closingRequest = null // can go on coupdoeil element\n this.openingDelay = null // can go on coupdoeil element\n this.fetchDelay = null // can go on coupdoeil element\n }\n\n get isOpen() {\n return !!this.coupdoeilElement.dataset.hovercardOpen\n }\n\n get isClosed() {\n return !this.isOpen\n }\n}\n","export const HOVERCARD_CLASS_NAME = 'coupdoeil--hovercard'\nexport const HOVERCARD_SELECTOR = `.${HOVERCARD_CLASS_NAME}`\nexport const HOVERCARD_CLOSE_BTN_SELECTOR = '[data-hovercard-close]'\n\nexport const defaultConfig = {\n // the time (ms) to wait before closing the hovercard,\n // to avoid flickering if the user hovers out and in quickly,\n // or if the user moves the mouse from the target to the hovercard\n closingDelay: 150,\n // the time (ms) to wait before starting to fetch the content,\n // to avoid fetching too soon if the user hovers in and out the target quickly\n fetchDelay: 100,\n // the minimum time (ms) the user should wait before seeing the hovercard\n openingDelay: 200,\n}\n","const OPTIONS = {\n animation: { getter: getAnimation },\n cache: { getter: getCache },\n offset: { getter: getOffset },\n placement: { getter: getPlacement },\n loading: { getter: getLoading },\n trigger: { getter: getTrigger }\n}\n\nconst ORDERED_OPTIONS = [\n \"trigger\", // bit size: 1 shift: 0\n \"loading\", // bit size: 2 shift: 1\n \"cache\", // bit size: 1 shift: 3\n \"animation\", // bit size: 3 shift: 4\n \"placement\", // bit size: 16 shift: 7\n \"offset\" // bit size: 21 shift: 23\n]\n\nconst TRIGGERS = [\"hover\", \"click\"]\nconst ANIMATIONS = [false, \"slide-in\", \"fade-in\", \"slide-out\", \"custom\"]\nconst PLACEMENTS = [\n 'auto',\n 'top', 'top-start', 'top-end',\n 'right', 'right-start', 'right-end',\n 'bottom', 'bottom-start', 'bottom-end',\n 'left', 'left-start', 'left-end'\n]\nconst LOADINGS = [\"asyn\", \"preload\", \"lazy\"]\n\nfunction parseCSSSize(value) {\n if (typeof value === 'number') {\n return value\n } else if ((/^(-?\\d+\\.?\\d+)px$/).test(value)) {\n return parseFloat(value)\n } else if ((/^(-?\\d*\\.?\\d+)rem$/).test(value)) {\n return parseFloat(value) * parseFloat(getComputedStyle(document.documentElement).fontSize)\n }\n return 0\n}\n\nfunction getOffset(optionsInt) {\n // shift is BigInt(16 + 3 + 1 + 2 + 1)\n const offsetBits = Number(BigInt(optionsInt) >> BigInt(23))\n if (offsetBits === 0)\n return 0\n\n const isNegative = (offsetBits & 1) === 1\n const isREM = (offsetBits & 2) === 2\n // decimals mask is 2 ** 11 - 1\n const decimals = (offsetBits >> 2) & 2047\n const integer = (offsetBits >> (2 + 11))\n\n const CSSSize = `${isNegative ? '-' : ''}${integer}.${decimals}${isREM ? 'rem' : 'px'}`\n return parseCSSSize(CSSSize)\n}\n\nfunction getPlacement(optionsInt) {\n // shift is 3 + 1 + 2 + 1, mask is 2 ** 16 - 1\n const placementBits = (optionsInt >> 7) & 65535\n let shift = 0\n let lastPlacement = null\n const placements = []\n while (lastPlacement !== \"auto\" && shift < 16) {\n // mask is 2 ** 4 - 1\n lastPlacement = PLACEMENTS[(placementBits >> shift) & 15]\n placements.push(lastPlacement)\n shift += 4\n }\n return placements\n}\n\nfunction getAnimation(optionsInt) {\n return ANIMATIONS[(optionsInt & 56) >> 4]\n}\n\nfunction getCache(optionsInt) {\n return (optionsInt & 8) === 8\n}\n\nfunction getLoading(optionsInt) {\n return LOADINGS[optionsInt & 3 >> 1]\n}\n\nfunction getTrigger(optionsInt) {\n return TRIGGERS[optionsInt & 1]\n}\n\nconst HovercardOptions = {\n animation: undefined,\n cache: undefined,\n offset: undefined,\n placement: undefined,\n loading: undefined,\n trigger: undefined,\n}\n\nexport function extractOptionsFromElement(coupdoeilElement) {\n const optionsInt = coupdoeilElement.hovercardController.optionsInt ||= parseOtionsInt((coupdoeilElement))\n const options = Object.create(HovercardOptions)\n\n for (const option of ORDERED_OPTIONS) {\n options[option] = OPTIONS[option].getter(optionsInt)\n }\n\n return options\n}\n\nfunction parseOtionsInt(coupdoeilElement) {\n const optionsString = coupdoeilElement.getAttribute(\"hc\")\n return parseInt(optionsString, 36)\n}\n\nexport function extractOptionFromElement(coupdoeilElement, optionName) {\n const optionsInt = coupdoeilElement.hovercardController.optionsInt ||= parseOtionsInt((coupdoeilElement))\n\n return OPTIONS[optionName].getter(optionsInt)\n}\n","import {extractOptionFromElement} from \"./optionsParser\";\n\nexport function getType(controller) {\n return controller.coupdoeilElement.getAttribute('hc-type')\n}\n\nexport function getParams(controller) {\n return controller.coupdoeilElement.getAttribute('hc-params')\n}\n\nexport function getTrigger(controller) {\n return extractOptionFromElement(controller.coupdoeilElement, 'trigger')\n}\n\nexport function triggeredOnClick(controller) {\n return getTrigger(controller) === 'click'\n}\n\nexport function noTriggeredOnClick(controller) {\n return getTrigger(controller) !== 'click'\n}\n\nexport function triggeredOnHover(controller) {\n return getTrigger(controller) === 'hover'\n}\n\nexport function notTriggeredOnHover(controller) {\n return getTrigger(controller) !== 'hover'\n}\n\nexport function preloadedContentElement(controller) {\n return controller.coupdoeilElement.querySelector('.hovercard-content')\n}\n","import {getType, getParams, preloadedContentElement} from './attributes'\n\nexport const hovercardContentHTMLMap = new Map()\n\nfunction cacheMapKey(controller) {\n if (preloadedContentElement(controller)) {\n return controller.coupdoeilElement.uniqueId\n }\n return getType(controller) + getParams(controller)\n}\n\nexport function getHovercardContentHTML(controller) {\n return hovercardContentHTMLMap.get(cacheMapKey(controller))\n}\n\nexport function setHovercardContentHTML(controller, value) {\n hovercardContentHTMLMap.set(cacheMapKey(controller), value)\n}\n","export async function enter(element, transitionName = null) {\n element.classList.remove('hidden')\n await transition('enter', element, transitionName)\n}\n\nexport async function leave(element, transitionName = null) {\n await transition('leave', element, transitionName)\n element.classList.add('hidden')\n}\n\nexport async function toggle(element, transitionName = null) {\n if (element.classList.contains('hidden')) {\n await enter(element, transitionName)\n } else {\n await leave(element, transitionName)\n }\n}\n\nasync function transition(direction, element, animation) {\n const dataset = element.dataset\n const animationClass = animation ? `${animation}-${direction}` : direction\n let transition = `transition${direction.charAt(0).toUpperCase() + direction.slice(1)}`\n const genesis = dataset[transition] ? dataset[transition].split(\" \") : [animationClass]\n const start = dataset[`${transition}Start`] ? dataset[`${transition}Start`].split(\" \") : [`${animationClass}-start`]\n const end = dataset[`${transition}End`] ? dataset[`${transition}End`].split(\" \") : [`${animationClass}-end`]\n\n addClasses(element, genesis)\n addClasses(element, start)\n await nextFrame()\n removeClasses(element, start)\n addClasses(element, end);\n await afterTransition(element)\n removeClasses(element, end)\n removeClasses(element, genesis)\n}\n\nfunction addClasses(element, classes) {\n element.classList.add(...classes)\n}\n\nfunction removeClasses(element, classes) {\n element.classList.remove(...classes)\n}\n\nfunction nextFrame() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve)\n });\n });\n}\n\nfunction afterTransition(element) {\n return new Promise(resolve => {\n // safari return string with comma separate values\n const computedDuration = getComputedStyle(element).transitionDuration.split(\",\")[0]\n const duration = Number(computedDuration.replace('s', '')) * 1000;\n setTimeout(() => {\n resolve()\n }, duration)\n });\n}","import {triggeredOnHover} from \"./attributes\";\nimport {defaultConfig} from \"./config\";\nimport {leave} from \"el-transition\";\nimport {cancelOpenCloseActions} from \"./actions\";\n\nfunction detachFromParent(controller) {\n if (controller.parent) {\n controller.parent.children.delete(controller)\n controller.parent = null\n }\n}\n\nexport function cancelCloseRequest(controller) {\n clearTimeout(controller.closingRequest)\n controller.closingRequest = null\n}\n\nexport function closeNow(controller, allowAnimation = true) {\n if (controller.closing || controller.isClosed) return;\n\n controller.closing = true\n\n cancelOpenCloseActions(controller)\n\n controller.children.forEach((childController) => {\n closeNow(childController)\n })\n\n detachFromParent(controller)\n\n if (allowAnimation && controller.card.dataset.animation) {\n closeWithAnimation(controller)\n } else {\n closeWithoutAnimation(controller)\n }\n}\n\nasync function closeWithAnimation(controller) {\n await leave(controller.card, 'hovercard')\n\n closeWithoutAnimation(controller)\n}\n\nfunction closeWithoutAnimation(controller) {\n controller.card.remove()\n controller.card = null\n delete controller.closing\n delete controller.coupdoeilElement.dataset.hovercardOpen\n}\n\nexport function clear(controller) {\n closeNow(controller, false)\n}\n\nexport function closeLater(controller) {\n cancelOpenCloseActions(controller)\n controller.closingRequest = setTimeout(() => {\n closeNow(controller)\n }, defaultConfig.closingDelay)\n}\n\nexport function closeChildrenNow(controller) {\n controller.children.forEach((childController) => {\n closeNow(childController)\n })\n}\n\nexport function closeChildrenLater(controller) {\n controller.children.forEach((childController) => {\n closeLater(childController)\n })\n}\n\n\nexport function closeOnHoverChildrenLater(controller) {\n controller.children.forEach((childController) => {\n if (triggeredOnHover(childController)) {\n closeLater(childController)\n }\n })\n}\n","import {hovercardContentHTMLMap} from \"./cache\";\nimport {triggeredOnHover} from \"./attributes\";\nimport {clear as clearHovercard, closeLater, closeNow, cancelCloseRequest} from \"./closing\";\nimport {cancelOpening} from \"./opening\";\n\nconst CURRENT_HOVERCARDS_BY_ID = new Map()\nwindow.hovercads = CURRENT_HOVERCARDS_BY_ID\n\nexport function clearHovercardContentCache() {\n hovercardContentHTMLMap.clear()\n}\n\nexport function currentHovercardsById() {\n return CURRENT_HOVERCARDS_BY_ID\n}\n\nexport function addToCurrents(coupdoeilElement) {\n CURRENT_HOVERCARDS_BY_ID.set(coupdoeilElement.uniqueId, coupdoeilElement)\n}\n\nexport function closeAllNow() {\n for (const coupdoeilElement of CURRENT_HOVERCARDS_BY_ID.values()) {\n closeNow(coupdoeilElement.hovercardController)\n removeFromCurrents(coupdoeilElement)\n }\n}\n\nexport function clearAll() {\n for (const coupdoeilElement of CURRENT_HOVERCARDS_BY_ID.values()) {\n clearHovercard(coupdoeilElement.hovercardController)\n removeFromCurrents(coupdoeilElement)\n }\n}\n\nexport function closeTriggeredOnHoverNow() {\n for (const coupdoeilElement of CURRENT_HOVERCARDS_BY_ID.values()) {\n if (triggeredOnHover(coupdoeilElement.hovercardController)) {\n closeNow(coupdoeilElement.hovercardController)\n removeFromCurrents(coupdoeilElement)\n }\n }\n}\n\nexport function closeTriggeredOnHoverLater() {\n for (const coupdoeilElement of CURRENT_HOVERCARDS_BY_ID.values()) {\n if (triggeredOnHover(coupdoeilElement.hovercardController)) {\n closeLater(coupdoeilElement.hovercardController)\n removeFromCurrents(coupdoeilElement)\n }\n }\n}\n\nexport function removeFromCurrents(coupdoeilElement) {\n CURRENT_HOVERCARDS_BY_ID.delete(coupdoeilElement.uniqueId)\n}\n\nexport function cancelOpenCloseActions(controller) {\n cancelOpening(controller)\n cancelCloseRequest(controller)\n}\n","import {defaultConfig, HOVERCARD_CLASS_NAME} from \"./config\";\nimport {getParams, getType, preloadedContentElement, triggeredOnClick} from \"./attributes\";\nimport {getHovercardContentHTML, setHovercardContentHTML} from \"./cache\";\nimport {addToCurrents} from \"./actions\";\nimport {extractOptionsFromElement} from \"./optionsParser\";\nimport {cancelCloseRequest} from \"./closing\";\nimport {positionHovercard} from \"./positioning\";\nimport {enter} from \"el-transition\";\n\nexport function cancelOpening(controller) {\n clearTimeout(controller.openingDelay)\n controller.openingDelay = null\n clearTimeout(controller.fetchDelay)\n controller.fetchDelay = null\n delete controller.coupdoeilElement.openingHovercard\n}\n\nexport async function openHovercard(controller, { parent }) {\n if (controller.isOpen) {\n cancelCloseRequest(controller)\n return addToCurrents(controller.coupdoeilElement)\n }\n if (parent) {\n controller.parent = parent\n parent.children.add(controller)\n }\n\n const delayOptions = getDelayOptionsForController(controller)\n const options = extractOptionsFromElement(controller.coupdoeilElement)\n const { cache } = options\n\n controller.openingDelay = new Promise((resolve) => {\n if (getHovercardContentHTML(controller) && cache) {\n setTimeout(resolve, delayOptions.reOpening)\n } else {\n setTimeout(resolve, delayOptions.actualOpening)\n }\n })\n if (!getHovercardContentHTML(controller) || !cache) {\n // prevent fetching if the user hovers in and out quickly\n controller.fetchDelay = new Promise((resolve) => {\n setTimeout(resolve, delayOptions.fetch)\n })\n await controller.fetchDelay\n if (!controller.fetchDelay) {\n return\n }\n controller.fetchDelay = null\n const html = preloadedContentElement(controller)?.innerHTML || await fetchHovercardContent(controller)\n setHovercardContentHTML(controller, html)\n }\n // still await the delay even if content is already fetched\n await controller.openingDelay\n const parentIsClosedOrClosing = controller.parent && (controller.parent.isClosed || controller.parent.closingRequest)\n // but if opening has been cancelled (nullified), the wait still happens, so we need to check again\n if (controller.openingDelay && !parentIsClosedOrClosing) {\n controller.openingDelay = null\n await display(controller, options)\n }\n}\n\nasync function display(controller, options) {\n if (controller.isOpen) return;\n\n cancelCloseRequest(controller)\n\n controller.card = buildHovercardElement(controller, options)\n document.body.appendChild(controller.card)\n\n if (options.animation) {\n controller.card.dataset.animation = options.animation\n }\n\n requestAnimationFrame(async () => {\n controller.card.style.opacity = '0'\n controller.card.classList.remove('hidden')\n\n requestAnimationFrame(async () => {\n await positionHovercard(controller, options)\n\n controller.card.classList.add('hidden')\n controller.card.style.removeProperty('opacity')\n\n requestAnimationFrame(async () => {\n // adding again the card to make sure it is in the map, could be better\n addToCurrents(controller.coupdoeilElement)\n delete controller.coupdoeilElement.openingHovercard\n controller.coupdoeilElement.dataset.hovercardOpen = true\n\n await enter(controller.card, 'hovercard')\n })\n })\n })\n}\n\nfunction getDelayOptionsForController(controller) {\n if (triggeredOnClick(controller)) {\n return { reOpening: 0, actualOpening: 0, fetch: 0 }\n }\n return {\n fetch: defaultConfig.fetchDelay,\n // the time (ms) to wait if we already have fetched the content\n reOpening: defaultConfig.fetchDelay + defaultConfig.openingDelay,\n // the time (ms) to wait if we already have waited to fetch the content\n actualOpening: defaultConfig.openingDelay - defaultConfig.fetchDelay\n }\n}\n\nfunction fetchHovercardContent(controller) {\n const type = getType(controller)\n const params = getParams(controller)\n const authenticityToken = document.querySelector('meta[name=csrf-token]').content\n let url = `/coupdoeil/hovercard`\n const opts = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ params, action_name: type, authenticity_token: authenticityToken })\n }\n return fetch(url, opts)\n .then((response) => {\n if (response.status >= 400) {\n throw 'error while fetching hovercard content'\n }\n return response.text()\n })\n}\n\nfunction buildHovercardElement(controller, options) {\n const el = document.createElement('div')\n el.setAttribute('role', 'dialog')\n el.classList.add(HOVERCARD_CLASS_NAME, 'hidden')\n el.style.cssText = 'position: absolute; left: 0; top: 0;'\n el.innerHTML = getHovercardContentHTML(controller)\n el.controller = controller\n el.dataset.placement = options.placement\n return el\n}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL <body> scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import {\n autoPlacement,\n computePosition,\n detectOverflow,\n offset,\n arrow\n} from \"@floating-ui/dom\"\n\nexport async function positionHovercard(controller, options) {\n let { placement: placements, offset: offsetValue } = options\n const placement = placements[0]\n const arrowElement = controller.card.querySelector('[data-hovercard-arrow]')\n const middleware = [AutoPositioningWithFallbacks(placements)]\n\n if (arrowElement) {\n const arrowSize = arrowElement.clientWidth\n offsetValue += arrowSize\n middleware.push(arrow({ element: arrowElement }))\n }\n\n middleware.push(offset(offsetValue))\n\n const computedPosition = await computePosition(\n controller.coupdoeilElement, controller.card, { placement, middleware }\n )\n const { x, y, placement: actualPlacement} = computedPosition\n\n if (arrowElement) {\n positionArrow(arrowElement, computedPosition)\n }\n\n controller.card.dataset.placement = actualPlacement\n Object.assign(controller.card.style, { left: `${x}px`, top: `${y}px` })\n}\n\nconst AutoPositioningWithFallbacks = (placements) => {\n let placementIndex = 0\n return {\n name: 'autoPlacement',\n async fn(state) {\n if (state.placement === 'auto') {\n return autoPlacement().fn(state)\n }\n\n const { top, bottom, left, right } = await detectOverflow(state)\n const isOverflowing = (top > 0 || bottom > 0 || left > 0 || right > 0)\n\n if (placements[placementIndex] !== 'auto' && isOverflowing) {\n placementIndex++\n return { reset: { placement: placements[placementIndex] || 'auto' } }\n } else if (isOverflowing) {\n return autoPlacement().fn(state)\n }\n return {}\n }\n }\n}\n\nconst OPPOSITE_SIDES = { right: 'left', left: 'right', top: 'bottom', bottom: 'top' }\n\nfunction positionArrow(arrowElement, computedData) {\n const arrowSize = arrowElement.clientWidth\n const { placement, middlewareData: { arrow: arrowData } } = computedData\n const side = placement.split(\"-\")[0]\n const oppositeSide = OPPOSITE_SIDES[side]\n const { x, y } = arrowData\n const { borderWidth: parentBorderWidht } = getComputedStyle(arrowElement.parentElement)\n\n Object.assign(arrowElement.style, {\n left: x != null ? `${x}px` : '',\n top: y != null ? `${y}px` : '',\n [oppositeSide]: `calc(${-arrowSize}px + ${parentBorderWidht})`\n })\n}\n","import {HovercardController} from '../hovercard/controller'\nimport {openHovercard} from '../hovercard/opening'\nimport {addToCurrents} from \"../hovercard/actions\";\nimport {HOVERCARD_SELECTOR} from \"../hovercard/config\";\nimport {closeNow} from \"../hovercard/closing\";\n\nfunction generateUniqueId() {\n const array = new Uint32Array(1)\n window.crypto.getRandomValues(array)\n return array[0]\n}\n\nexport default class extends HTMLElement {\n constructor() {\n super()\n this.uniqueId = generateUniqueId()\n this.hovercardController = new HovercardController(this)\n }\n\n openHovercard() {\n if (this.openingHovercard || this.hovercardController.isOpen) return;\n\n this.openingHovercard = true\n\n const parent = this.closest(HOVERCARD_SELECTOR)?.controller\n addToCurrents(this)\n return openHovercard(this.hovercardController, { parent })\n }\n\n closeHovercard() {\n closeNow(this.hovercardController)\n }\n}\n","import {HOVERCARD_CLOSE_BTN_SELECTOR} from \"./config\";\nimport {currentHovercardsById} from \"./actions\";\n\nexport function isElementCloseHovercardButton(element) {\n return element.closest(HOVERCARD_CLOSE_BTN_SELECTOR) ||\n element.dataset.hasOwnProperty(\"hovercardClose\")\n}\n\nexport function isAnyHovercardOpened() {\n return currentHovercardsById().size > 0\n}\n","import {HOVERCARD_SELECTOR} from \"../hovercard/config\";\nimport {isElementCloseHovercardButton} from \"../hovercard/state_check\";\nimport {closeAllNow} from \"../hovercard/actions\";\nimport {noTriggeredOnClick} from \"../hovercard/attributes\";\nimport {closeChildrenNow, closeNow} from \"../hovercard/closing\";\n\nexport const coupdoeilOnClickEvent = ({ target: clickedElement }) => {\n const coupdoeilElement = clickedElement.closest('coup-doeil')\n const hovercardElement = clickedElement.closest(HOVERCARD_SELECTOR)\n\n if (coupdoeilElement && hovercardElement) {\n handleClickedCoupdoeilWithinHovercard(coupdoeilElement, hovercardElement)\n }\n else if (coupdoeilElement) {\n handleClickedCoupdoeilOutsideHovercard(coupdoeilElement)\n }\n else if (hovercardElement) {\n handleClickOutsideCoupdoeilButWithinHovercard(hovercardElement, clickedElement)\n }\n else {\n handleClickOutsideCoupdoeilAndHovercard()\n }\n}\n\nfunction handleClickedCoupdoeilWithinHovercard(coupdoeilElement, _hovercardElement) {\n const hovercard = coupdoeilElement.hovercardController\n if(noTriggeredOnClick(hovercard))\n return;\n\n if (hovercard.isOpen) {\n // second click on an open hovercard trigger closes it\n closeNow(hovercard)\n } else {\n // first click on a closed hovercard trigger opens it\n // If any other hovercard is open, it is the parent hovercard, hence it should not be closed.\n coupdoeilElement.openHovercard()\n }\n}\n\nfunction handleClickedCoupdoeilOutsideHovercard(coupdoeilElement) {\n const hovercard = coupdoeilElement.hovercardController\n if(noTriggeredOnClick(hovercard))\n return;\n\n if (hovercard.isOpen) {\n // second click on an open hovercard trigger closes it\n closeNow(hovercard)\n } else {\n // close any other open hovercard\n closeAllNow()\n // first click on a closed hovercard trigger opens it\n coupdoeilElement.openHovercard()\n }\n}\n\nfunction handleClickOutsideCoupdoeilButWithinHovercard(hovercardElement, clickedElement) {\n const hovercard = hovercardElement.controller;\n\n if (isElementCloseHovercardButton(clickedElement)) {\n closeNow(hovercard)\n } else if (hovercard.children.size > 0) {\n closeChildrenNow(hovercard)\n }\n}\n\nfunction handleClickOutsideCoupdoeilAndHovercard() {\n closeAllNow()\n}\n","import {HOVERCARD_SELECTOR} from \"../hovercard/config\";\nimport {isAnyHovercardOpened} from \"../hovercard/state_check\";\nimport {\n addToCurrents as addToCurrentHovercards,\n closeTriggeredOnHoverLater, closeTriggeredOnHoverNow\n} from \"../hovercard/actions\";\nimport {notTriggeredOnHover} from \"../hovercard/attributes\";\nimport {cancelCloseRequest, closeChildrenNow, closeOnHoverChildrenLater} from \"../hovercard/closing\";\n\nexport const onMouseOver = ({ target: hoveredElement }) => {\n const coupdoeilElement = hoveredElement.closest('coup-doeil')\n const hovercardElement = hoveredElement.closest(HOVERCARD_SELECTOR)\n\n if (coupdoeilElement && hovercardElement) {\n handleMouseOverCoupdoeilWithinHovercard(coupdoeilElement, hovercardElement)\n }\n else if (coupdoeilElement) {\n handleMouseOverCoupdoeilOutsideHovercard(coupdoeilElement)\n }\n else if (hovercardElement) {\n handleOverOutsideCoupdoeilButWithinHovercard(hovercardElement)\n }\n else {\n handleOverOutsideCoupdoeilAndHovercard()\n }\n}\n\nfunction handleMouseOverCoupdoeilWithinHovercard(coupdoeilElement, hovercardElement) {\n const childHovercard = coupdoeilElement.hovercardController\n const parentHovercard = hovercardElement.controller\n if(notTriggeredOnHover(childHovercard))\n return;\n\n if (childHovercard.isOpen) {\n // when mouse goes back from child hovercard to its coupdoeil element within parent hovercard\n // it means that this child hovercard was already open\n closeChildrenNow(childHovercard)\n } else {\n // ensures to close other children hovercards before opening the one that current one\n closeChildrenNow(parentHovercard)\n coupdoeilElement.openHovercard()\n }\n}\n\nfunction handleMouseOverCoupdoeilOutsideHovercard(coupdoeilElement) {\n const hovercard = coupdoeilElement.hovercardController\n if(notTriggeredOnHover(hovercard))\n return;\n\n if (hovercard.isClosed) {\n // Close any other open hovercard before opening this one\n closeTriggeredOnHoverNow()\n coupdoeilElement.openHovercard()\n } else if (hovercard.closingRequest) {\n // hovercard is still open but was requested to close, then it clear this closing request\n // and ensures the hovercards stays in current hovercards register\n cancelCloseRequest(hovercard)\n addToCurrentHovercards(coupdoeilElement)\n }\n}\n\nfunction handleOverOutsideCoupdoeilAndHovercard() {\n // mouse is not within any hovercard and not over any coupdoeil element\n // Therefore all hovercards that trigger on hover should be closed if any is open.\n if (isAnyHovercardOpened()) {\n closeTriggeredOnHoverLater()\n }\n}\n\nfunction handleOverOutsideCoupdoeilButWithinHovercard(hovercardElement) {\n const hovercard = hovercardElement.controller\n\n if (hovercard.closingRequest) {\n // hovercard is still open but was requested to close, then it clears this closing request\n // and ensures the hovercards stays in current hovercards register\n // This typically happens when mouse was on coupdoeil element, then it moves toward the hovercard\n // but because of a small gap, it triggers the closing request, but when the mouse finally enters the hovercard\n // this closing request must be aborted.\n cancelCloseRequest(hovercard)\n addToCurrentHovercards(hovercard.coupdoeilElement)\n } else if (hovercard.children.size > 0) {\n // Happens when a child hovercard was open but mouse moved outside of it or its coupdoeil element,\n // but stays within the parent hovercard\n closeOnHoverChildrenLater(hovercard)\n }\n}\n","import {coupdoeilOnClickEvent} from \"./events/onclick\";\nimport {onMouseOver} from \"./events/onmouseover\";\nimport {clearHovercardContentCache, clearAll} from \"./hovercard/actions\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n clearHovercardContentCache()\n document.addEventListener(\"click\", coupdoeilOnClickEvent)\n document.documentElement.addEventListener(\"mouseover\", onMouseOver, { passive: true })\n\n if (window.Turbo) {\n document.addEventListener('turbo:before-cache', (_event) => {\n clearAll()\n })\n document.addEventListener('turbo:load', (_event) => {\n clearAll()\n clearHovercardContentCache()\n })\n }\n})\n","import CoupdoeilElement from \"./elements/coupdoeil_element\"\nimport './events'\n\nif (customElements.get(\"coup-doeil\") === undefined) {\n customElements.define(\"coup-doeil\", CoupdoeilElement)\n}\n"],"names":["HovercardController","constructor","coupdoeilElement","this","card","children","Set","parent","closingRequest","openingDelay","fetchDelay","isOpen","dataset","hovercardOpen","isClosed","HOVERCARD_CLASS_NAME","HOVERCARD_SELECTOR","defaultConfig","OPTIONS","animation","getter","optionsInt","ANIMATIONS","cache","offset","offsetBits","Number","BigInt","value","test","parseFloat","getComputedStyle","document","documentElement","fontSize","parseCSSSize","placement","placementBits","shift","lastPlacement","placements","PLACEMENTS","push","loading","LOADINGS","trigger","TRIGGERS","ORDERED_OPTIONS","HovercardOptions","undefined","parseOtionsInt","optionsString","getAttribute","parseInt","getType","controller","getParams","getTrigger","optionName","hovercardController","extractOptionFromElement","noTriggeredOnClick","triggeredOnHover","notTriggeredOnHover","preloadedContentElement","querySelector","hovercardContentHTMLMap","Map","cacheMapKey","uniqueId","getHovercardContentHTML","get","async","transition","direction","element","animationClass","charAt","toUpperCase","slice","genesis","split","start","end","addClasses","Promise","resolve","requestAnimationFrame","removeClasses","computedDuration","transitionDuration","duration","replace","setTimeout","afterTransition","classes","classList","add","remove","cancelCloseRequest","clearTimeout","closeNow","allowAnimation","closing","cancelOpenCloseActions","forEach","childController","delete","detachFromParent","transitionName","leave","closeWithoutAnimation","closeWithAnimation","closeLater","closeChildrenNow","CURRENT_HOVERCARDS_BY_ID","clearHovercardContentCache","clear","addToCurrents","set","closeAllNow","values","removeFromCurrents","clearAll","openingHovercard","cancelOpening","window","hovercads","sides","alignments","reduce","acc","side","concat","min","Math","max","round","createCoords","v","x","y","oppositeSideMap","left","right","bottom","top","oppositeAlignmentMap","clamp","evaluate","param","getSide","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","includes","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","reference","floating","getOppositePlacement","getOppositeAlignmentPlacement","getPaddingObject","padding","expandPaddingObject","rectToClientRect","rect","width","height","computeCoordsFromPlacement","_ref","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","detectOverflow","state","options","_await$platform$isEle","platform","elements","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","getClippingRect","isElement","contextElement","getDocumentElement","offsetParent","getOffsetParent","offsetScale","getScale","elementClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","hasWindow","getNodeName","node","isNode","nodeName","toLowerCase","getWindow","_node$ownerDocument","ownerDocument","defaultView","Node","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","isOverflowElement","overflow","overflowX","overflowY","display","isTableElement","isTopLayer","some","selector","matches","e","isContainingBlock","elementOrCss","webkit","isWebKit","css","transform","perspective","containerType","backdropFilter","filter","willChange","contain","CSS","supports","isLastTraversableNode","getNodeScroll","scrollLeft","scrollTop","scrollX","scrollY","getParentNode","result","assignedSlot","parentNode","host","getNearestOverflowAncestor","body","getOverflowAncestors","list","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","visualViewport","Object","getPrototypeOf","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","$","unwrapElement","domElement","getBoundingClientRect","isFinite","noOffsets","getVisualOffsets","offsetLeft","offsetTop","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","isFixed","floatingOffsetParent","shouldAddVisualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","clientLeft","paddingLeft","clientTop","paddingTop","getWindowScrollBarX","leftScroll","getHTMLOffset","scroll","ignoreScrollbarX","htmlRect","getClientRectFromClippingAncestor","clippingAncestor","html","clientWidth","clientHeight","visualViewportBased","getViewportRect","scrollWidth","scrollHeight","getDocumentRect","getInnerBoundingClientRect","hasFixedPositionAncestor","stopNode","position","getRectRelativeToOffsetParent","isOffsetParentAnElement","offsets","offsetRect","htmlOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","svgOffsetParent","currentNode","getContainingBlock","topLayer","clippingAncestors","cachedResult","el","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingElementAncestors","_c","firstClippingAncestor","clippingRect","accRect","getElementRects","data","getOffsetParentFn","getDimensionsFn","getDimensions","floatingDimensions","getClientRects","Array","from","isRTL","detectOverflow$1","name","fn","_middlewareData$offse","_middlewareData$arrow","middlewareData","diffCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","convertValueToCoords","arrow","alignmentOffset","autoPlacement","_middlewareData$autoP","_middlewareData$autoP2","_placementsThatFitOnE","allowedPlacements","autoAlignment","detectOverflowOptions","placements$1","getPlacementList","currentIndex","index","currentPlacement","alignmentSides","reset","currentOverflows","allOverflows","overflows","nextPlacement","placementsSortedByMostSpace","map","d","sort","a","b","resetPlacement","every","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","min$1","center","shouldAddOffset","centerOffset","computePosition","mergedOptions","platformWithCache","config","middleware","validMiddleware","Boolean","statefulPlacement","resetCount","i","nextX","nextY","initialPlacement","computePosition$1","positionHovercard","offsetValue","arrowElement","AutoPositioningWithFallbacks","computedPosition","actualPlacement","computedData","arrowSize","arrowData","oppositeSide","OPPOSITE_SIDES","borderWidth","parentBorderWidht","parentElement","assign","style","positionArrow","placementIndex","isOverflowing","openHovercard","delayOptions","triggeredOnClick","reOpening","actualOpening","fetch","getDelayOptionsForController","create","option","extractOptionsFromElement","innerHTML","type","params","authenticityToken","content","url","opts","method","headers","JSON","stringify","action_name","authenticity_token","then","response","status","text","fetchHovercardContent","setHovercardContentHTML","parentIsClosedOrClosing","createElement","setAttribute","cssText","buildHovercardElement","appendChild","opacity","removeProperty","enter","CoupdoeilElement","super","array","Uint32Array","crypto","getRandomValues","generateUniqueId","closest","closeHovercard","isAnyHovercardOpened","size","coupdoeilOnClickEvent","target","clickedElement","hovercardElement","hovercard","handleClickedCoupdoeilWithinHovercard","handleClickedCoupdoeilOutsideHovercard","hasOwnProperty","handleClickOutsideCoupdoeilButWithinHovercard","onMouseOver","hoveredElement","childHovercard","parentHovercard","handleMouseOverCoupdoeilWithinHovercard","closeTriggeredOnHoverNow","addToCurrentHovercards","handleMouseOverCoupdoeilOutsideHovercard","handleOverOutsideCoupdoeilButWithinHovercard","closeTriggeredOnHoverLater","addEventListener","passive","Turbo","_event","customElements","define"],"mappings":"AAAO,MAAMA,EACX,WAAAC,CAAYC,GACVC,KAAKD,iBAAmBA,EAExBC,KAAKC,KAAO,KAEZD,KAAKE,SAAW,IAAIC,IACpBH,KAAKI,OAAS,KAEdJ,KAAKK,eAAiB,KACtBL,KAAKM,aAAe,KACpBN,KAAKO,WAAa,IACnB,CAED,UAAIC,GACF,QAASR,KAAKD,iBAAiBU,QAAQC,aACxC,CAED,YAAIC,GACF,OAAQX,KAAKQ,MACd,ECpBI,MAAMI,EAAuB,uBACvBC,EAAqB,IAAID,IAGzBE,EAIG,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ByD,uBACpC0C,EAASnG,EAAiByD,qBAC1B+D,EAAmBxH,GAGzB,CUUIkgB,GACAlgB,EAAiBmc,iBACRqD,EAAUlf,iBAGnB2F,EAAmBuZ,GACnBW,EAAuBngB,GAE3B,CA1CIogB,CAAyCpgB,GAElCuf,EAkDX,SAAsDA,GACpD,MAAMC,EAAYD,EAAiBlc,WAE/Bmc,EAAUlf,gBAMZ2F,EAAmBuZ,GACnBW,EAAuBX,EAAUxf,mBACxBwf,EAAUrf,SAASgf,KAAO,GAGTK,EXRjBrf,SAASoG,SAASC,IACvB5C,EAAiB4C,IACnBO,EAAWP,EACZ,GWOL,CAjEI6Z,CAA6Cd,GA4C3CL,MVrBC,WACL,IAAK,MAAMlf,KAAoBiH,EAAyBM,SAClD3D,EAAiB5D,EAAiByD,uBACpCsD,EAAW/G,EAAiByD,qBAC5B+D,EAAmBxH,GAGzB,CUeIsgB,EAzCD,ECpBHxe,SAASye,iBAAiB,oBAAoB,KAC5CrZ,IACApF,SAASye,iBAAiB,QAASnB,IACnCtd,SAASC,gBAAgBwe,iBAAiB,YAAaV,GAAa,CAAEW,SAAS,IAE3E5Y,OAAO6Y,QACT3e,SAASye,iBAAiB,sBAAuBG,IAC/CjZ,GAAU,IAEZ3F,SAASye,iBAAiB,cAAeG,IACvCjZ,IACAP,GAA4B,IAE/B,SCdsCnE,IAArC4d,eAAetc,IAAI,eACrBsc,eAAeC,OAAO,aAAcnC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,44 @@
|
|
1
|
+
.coupdoeil--hovercard.hidden {
|
2
|
+
display: none;
|
3
|
+
}
|
4
|
+
|
5
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter {
|
6
|
+
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
7
|
+
}
|
8
|
+
.coupdoeil--hovercard[data-animation].hovercard-leave {
|
9
|
+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
10
|
+
}
|
11
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter, .coupdoeil--hovercard[data-animation].hovercard-leave {
|
12
|
+
transition-property: opacity, transform;
|
13
|
+
transition-duration: 150ms;
|
14
|
+
}
|
15
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-out] {
|
16
|
+
opacity: 1;
|
17
|
+
}
|
18
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-out] {
|
19
|
+
opacity: 0;
|
20
|
+
}
|
21
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-in] {
|
22
|
+
transform: translateX(1rem);
|
23
|
+
}
|
24
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-out] {
|
25
|
+
transform: translateX(-1rem);
|
26
|
+
}
|
27
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-in] {
|
28
|
+
transform: translateX(-1rem);
|
29
|
+
}
|
30
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-out] {
|
31
|
+
transform: translateX(1rem);
|
32
|
+
}
|
33
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-in] {
|
34
|
+
transform: translateY(-1rem);
|
35
|
+
}
|
36
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-out] {
|
37
|
+
transform: translateY(1rem);
|
38
|
+
}
|
39
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-in] {
|
40
|
+
transform: translateY(1rem);
|
41
|
+
}
|
42
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-out] {
|
43
|
+
transform: translateY(-1rem);
|
44
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
.coupdoeil--hovercard [data-hovercard-arrow] {
|
2
|
+
--co-hovercard--color: white;
|
3
|
+
--co-hovercard--border-color: rgb(209 213 219);
|
4
|
+
--co-hovercard-border-size: 1px;
|
5
|
+
--co-hovercard-border-style: solid;
|
6
|
+
--co-hovercard--size-ratio: 1;
|
7
|
+
--co-hovercard--height: 0.75rem;
|
8
|
+
--co-hovercard--width: calc(var(--co-hovercard--height) / var(--co-hovercard--size-ratio));
|
9
|
+
position: absolute;
|
10
|
+
height: var(--co-hovercard--height);
|
11
|
+
width: var(--co-hovercard--height);
|
12
|
+
}
|
13
|
+
.coupdoeil--hovercard [data-hovercard-arrow]::after, .coupdoeil--hovercard [data-hovercard-arrow]::before {
|
14
|
+
content: "";
|
15
|
+
width: 0;
|
16
|
+
height: 0;
|
17
|
+
position: absolute;
|
18
|
+
bottom: 0;
|
19
|
+
border: var(--co-hovercard--base-border-width) var(--co-hovercard-border-style) transparent;
|
20
|
+
}
|
21
|
+
.coupdoeil--hovercard [data-hovercard-arrow]::after {
|
22
|
+
--co-hovercard--base-border-width: var(--co-hovercard--width);
|
23
|
+
border-bottom-color: var(--co-hovercard--color);
|
24
|
+
left: calc(50% - var(--co-hovercard--width));
|
25
|
+
}
|
26
|
+
.coupdoeil--hovercard [data-hovercard-arrow]::before {
|
27
|
+
--co-hovercard--base-border-width: calc(var(--co-hovercard--height) + var(--co-hovercard-border-size));
|
28
|
+
border-bottom-color: var(--co-hovercard--border-color);
|
29
|
+
left: calc(50% - var(--co-hovercard--width) - var(--co-hovercard-border-size));
|
30
|
+
}
|
31
|
+
.coupdoeil--hovercard[data-placement|=top] [data-hovercard-arrow] {
|
32
|
+
transform: rotate(180deg);
|
33
|
+
}
|
34
|
+
.coupdoeil--hovercard[data-placement|=right] [data-hovercard-arrow] {
|
35
|
+
transform: rotate(-90deg);
|
36
|
+
}
|
37
|
+
.coupdoeil--hovercard[data-placement|=left] [data-hovercard-arrow] {
|
38
|
+
transform: rotate(90deg);
|
39
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
.coupdoeil--hovercard.hidden {
|
2
|
+
display: none;
|
3
|
+
}
|
4
|
+
|
5
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter {
|
6
|
+
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
7
|
+
}
|
8
|
+
.coupdoeil--hovercard[data-animation].hovercard-leave {
|
9
|
+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
10
|
+
}
|
11
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter, .coupdoeil--hovercard[data-animation].hovercard-leave {
|
12
|
+
transition-property: opacity, transform;
|
13
|
+
transition-duration: 150ms;
|
14
|
+
}
|
15
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-end[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-start[data-animation=slide-out] {
|
16
|
+
opacity: 1;
|
17
|
+
}
|
18
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-enter-start[data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=fade-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-animation=slide-out] {
|
19
|
+
opacity: 0;
|
20
|
+
}
|
21
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-in] {
|
22
|
+
transform: translateX(1rem);
|
23
|
+
}
|
24
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=right][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=right][data-animation=slide-out] {
|
25
|
+
transform: translateX(-1rem);
|
26
|
+
}
|
27
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-in] {
|
28
|
+
transform: translateX(-1rem);
|
29
|
+
}
|
30
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=left][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=left][data-animation=slide-out] {
|
31
|
+
transform: translateX(1rem);
|
32
|
+
}
|
33
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-in] {
|
34
|
+
transform: translateY(-1rem);
|
35
|
+
}
|
36
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=top][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=top][data-animation=slide-out] {
|
37
|
+
transform: translateY(1rem);
|
38
|
+
}
|
39
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-in], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-in] {
|
40
|
+
transform: translateY(1rem);
|
41
|
+
}
|
42
|
+
.coupdoeil--hovercard[data-animation].hovercard-enter-start[data-placement|=bottom][data-animation=slide-out], .coupdoeil--hovercard[data-animation].hovercard-leave-end[data-placement|=bottom][data-animation=slide-out] {
|
43
|
+
transform: translateY(-1rem);
|
44
|
+
}
|
45
|
+
|
46
|
+
.coupdoeil--hovercard [data-hovercard-arrow] {
|
47
|
+
--co-hovercard--color: white;
|
48
|
+
--co-hovercard--border-color: rgb(209 213 219);
|
49
|
+
--co-hovercard-border-size: 1px;
|
50
|
+
--co-hovercard-border-style: solid;
|
51
|
+
--co-hovercard--size-ratio: 1;
|
52
|
+
--co-hovercard--height: 0.75rem;
|
53
|
+
--co-hovercard--width: calc(var(--co-hovercard--height) / var(--co-hovercard--size-ratio));
|
54
|
+
position: absolute;
|
55
|
+
height: var(--co-hovercard--height);
|
56
|
+
width: var(--co-hovercard--height);
|
57
|
+
}
|
58
|
+
.coupdoeil--hovercard [data-hovercard-arrow]::after, .coupdoeil--hovercard [data-hovercard-arrow]::before {
|
59
|
+
content: "";
|
60
|
+
width: 0;
|
61
|
+
height: 0;
|
62
|
+
position: absolute;
|
63
|
+
bottom: 0;
|
64
|
+
border: var(--co-hovercard--base-border-width) var(--co-hovercard-border-style) transparent;
|
65
|
+
}
|
66
|
+
.coupdoeil--hovercard [data-hovercard-arrow]::after {
|
67
|
+
--co-hovercard--base-border-width: var(--co-hovercard--width);
|
68
|
+
border-bottom-color: var(--co-hovercard--color);
|
69
|
+
left: calc(50% - var(--co-hovercard--width));
|
70
|
+
}
|
71
|
+
.coupdoeil--hovercard [data-hovercard-arrow]::before {
|
72
|
+
--co-hovercard--base-border-width: calc(var(--co-hovercard--height) + var(--co-hovercard-border-size));
|
73
|
+
border-bottom-color: var(--co-hovercard--border-color);
|
74
|
+
left: calc(50% - var(--co-hovercard--width) - var(--co-hovercard-border-size));
|
75
|
+
}
|
76
|
+
.coupdoeil--hovercard[data-placement|=top] [data-hovercard-arrow] {
|
77
|
+
transform: rotate(180deg);
|
78
|
+
}
|
79
|
+
.coupdoeil--hovercard[data-placement|=right] [data-hovercard-arrow] {
|
80
|
+
transform: rotate(-90deg);
|
81
|
+
}
|
82
|
+
.coupdoeil--hovercard[data-placement|=left] [data-hovercard-arrow] {
|
83
|
+
transform: rotate(90deg);
|
84
|
+
}
|