react-tooltip 5.8.2-beta.1 → 5.8.2-beta.3
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.
|
@@ -2694,23 +2694,6 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2694
2694
|
const hoveringTooltip = require$$0.useRef(false);
|
|
2695
2695
|
const [anchorsBySelect, setAnchorsBySelect] = require$$0.useState([]);
|
|
2696
2696
|
const mounted = require$$0.useRef(false);
|
|
2697
|
-
require$$0.useEffect(() => {
|
|
2698
|
-
let selector = anchorSelect;
|
|
2699
|
-
if (!selector && id) {
|
|
2700
|
-
selector = `[data-tooltip-id='${id}']`;
|
|
2701
|
-
}
|
|
2702
|
-
if (!selector) {
|
|
2703
|
-
return;
|
|
2704
|
-
}
|
|
2705
|
-
try {
|
|
2706
|
-
const anchors = Array.from(document.querySelectorAll(selector));
|
|
2707
|
-
setAnchorsBySelect(anchors);
|
|
2708
|
-
}
|
|
2709
|
-
catch (_a) {
|
|
2710
|
-
// warning was already issued in the controller
|
|
2711
|
-
setAnchorsBySelect([]);
|
|
2712
|
-
}
|
|
2713
|
-
}, [anchorSelect, activeAnchor]);
|
|
2714
2697
|
/**
|
|
2715
2698
|
* useLayoutEffect runs before useEffect,
|
|
2716
2699
|
* but should be used carefully because of caveats
|
|
@@ -2956,12 +2939,44 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2956
2939
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener(event, listener);
|
|
2957
2940
|
});
|
|
2958
2941
|
});
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
if (
|
|
2962
|
-
|
|
2942
|
+
return () => {
|
|
2943
|
+
var _a, _b;
|
|
2944
|
+
if (events.find((event) => event === 'click')) {
|
|
2945
|
+
window.removeEventListener('click', handleClickOutsideAnchors);
|
|
2963
2946
|
}
|
|
2947
|
+
if (closeOnEsc) {
|
|
2948
|
+
window.removeEventListener('keydown', handleEsc);
|
|
2949
|
+
}
|
|
2950
|
+
if (clickable) {
|
|
2951
|
+
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', handleMouseEnterTooltip);
|
|
2952
|
+
(_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', handleMouseLeaveTooltip);
|
|
2953
|
+
}
|
|
2954
|
+
enabledEvents.forEach(({ event, listener }) => {
|
|
2955
|
+
elementRefs.forEach((ref) => {
|
|
2956
|
+
var _a;
|
|
2957
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, listener);
|
|
2958
|
+
});
|
|
2959
|
+
});
|
|
2960
|
+
};
|
|
2961
|
+
/**
|
|
2962
|
+
* rendered is also a dependency to ensure anchor observers are re-registered
|
|
2963
|
+
* since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM
|
|
2964
|
+
*/
|
|
2965
|
+
}, [rendered, anchorRefs, anchorsBySelect, closeOnEsc, events]);
|
|
2966
|
+
require$$0.useEffect(() => {
|
|
2967
|
+
let selector = anchorSelect !== null && anchorSelect !== void 0 ? anchorSelect : '';
|
|
2968
|
+
if (!selector && id) {
|
|
2969
|
+
selector = `[data-tooltip-id='${id}']`;
|
|
2970
|
+
}
|
|
2971
|
+
const documentObserverCallback = (mutationList) => {
|
|
2972
|
+
const newAnchors = [];
|
|
2964
2973
|
mutationList.forEach((mutation) => {
|
|
2974
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {
|
|
2975
|
+
const newId = mutation.target.getAttribute('data-tooltip-id');
|
|
2976
|
+
if (newId === id) {
|
|
2977
|
+
newAnchors.push(mutation.target);
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2965
2980
|
if (mutation.type !== 'childList') {
|
|
2966
2981
|
return;
|
|
2967
2982
|
}
|
|
@@ -2981,15 +2996,12 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2981
2996
|
}
|
|
2982
2997
|
try {
|
|
2983
2998
|
const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1);
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
];
|
|
2990
|
-
if (newAnchors.length) {
|
|
2991
|
-
setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
|
|
2992
|
-
}
|
|
2999
|
+
newAnchors.push(
|
|
3000
|
+
// the element itself is an anchor
|
|
3001
|
+
...elements.filter((element) => element.matches(selector)));
|
|
3002
|
+
newAnchors.push(
|
|
3003
|
+
// the element has children which are anchors
|
|
3004
|
+
...elements.flatMap((element) => [...element.querySelectorAll(selector)]));
|
|
2993
3005
|
}
|
|
2994
3006
|
catch (_a) {
|
|
2995
3007
|
/**
|
|
@@ -2998,44 +3010,22 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2998
3010
|
*/
|
|
2999
3011
|
}
|
|
3000
3012
|
});
|
|
3013
|
+
if (newAnchors.length) {
|
|
3014
|
+
setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
|
|
3015
|
+
}
|
|
3001
3016
|
};
|
|
3002
|
-
const
|
|
3017
|
+
const documentObserver = new MutationObserver(documentObserverCallback);
|
|
3003
3018
|
// watch for anchor being removed from the DOM
|
|
3004
|
-
|
|
3019
|
+
documentObserver.observe(document.body, {
|
|
3020
|
+
childList: true,
|
|
3021
|
+
subtree: true,
|
|
3022
|
+
attributes: true,
|
|
3023
|
+
attributeFilter: ['data-tooltip-id'],
|
|
3024
|
+
});
|
|
3005
3025
|
return () => {
|
|
3006
|
-
|
|
3007
|
-
if (events.find((event) => event === 'click')) {
|
|
3008
|
-
window.removeEventListener('click', handleClickOutsideAnchors);
|
|
3009
|
-
}
|
|
3010
|
-
if (closeOnEsc) {
|
|
3011
|
-
window.removeEventListener('keydown', handleEsc);
|
|
3012
|
-
}
|
|
3013
|
-
if (clickable) {
|
|
3014
|
-
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', handleMouseEnterTooltip);
|
|
3015
|
-
(_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', handleMouseLeaveTooltip);
|
|
3016
|
-
}
|
|
3017
|
-
enabledEvents.forEach(({ event, listener }) => {
|
|
3018
|
-
elementRefs.forEach((ref) => {
|
|
3019
|
-
var _a;
|
|
3020
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, listener);
|
|
3021
|
-
});
|
|
3022
|
-
});
|
|
3023
|
-
parentObserver.disconnect();
|
|
3026
|
+
documentObserver.disconnect();
|
|
3024
3027
|
};
|
|
3025
|
-
|
|
3026
|
-
* rendered is also a dependency to ensure anchor observers are re-registered
|
|
3027
|
-
* since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM
|
|
3028
|
-
*/
|
|
3029
|
-
}, [
|
|
3030
|
-
rendered,
|
|
3031
|
-
anchorRefs,
|
|
3032
|
-
activeAnchor,
|
|
3033
|
-
anchorsBySelect,
|
|
3034
|
-
closeOnEsc,
|
|
3035
|
-
events,
|
|
3036
|
-
delayHide,
|
|
3037
|
-
delayShow,
|
|
3038
|
-
]);
|
|
3028
|
+
}, [id, anchorSelect, activeAnchor]);
|
|
3039
3029
|
require$$0.useEffect(() => {
|
|
3040
3030
|
if (position) {
|
|
3041
3031
|
// if `position` is set, override regular and `float` positioning
|
|
@@ -3100,6 +3090,23 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
3100
3090
|
}
|
|
3101
3091
|
};
|
|
3102
3092
|
}, []);
|
|
3093
|
+
require$$0.useEffect(() => {
|
|
3094
|
+
let selector = anchorSelect;
|
|
3095
|
+
if (!selector && id) {
|
|
3096
|
+
selector = `[data-tooltip-id='${id}']`;
|
|
3097
|
+
}
|
|
3098
|
+
if (!selector) {
|
|
3099
|
+
return;
|
|
3100
|
+
}
|
|
3101
|
+
try {
|
|
3102
|
+
const anchors = Array.from(document.querySelectorAll(selector));
|
|
3103
|
+
setAnchorsBySelect(anchors);
|
|
3104
|
+
}
|
|
3105
|
+
catch (_a) {
|
|
3106
|
+
// warning was already issued in the controller
|
|
3107
|
+
setAnchorsBySelect([]);
|
|
3108
|
+
}
|
|
3109
|
+
}, [id, anchorSelect]);
|
|
3103
3110
|
const hasContentOrChildren = Boolean(html || content || children);
|
|
3104
3111
|
const canShow = hasContentOrChildren && show && Object.keys(inlineStyles).length > 0;
|
|
3105
3112
|
return rendered ? (jsxRuntime.exports.jsxs(WrapperElement, { id: id, role: "tooltip", className: classNames('react-tooltip', styles['tooltip'], styles[variant], className, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e){return e.split("-")[1]}function o(e){return"y"===e?"height":"width"}function i(e){return e.split("-")[0]}function l(e){return["top","bottom"].includes(i(e))?"x":"y"}function a(e,t,n){let{reference:a,floating:s}=e;const c=a.x+a.width/2-s.width/2,u=a.y+a.height/2-s.height/2,f=l(t),p=o(f),d=a[p]/2-s[p]/2,y="x"===f;let m;switch(i(t)){case"top":m={x:c,y:a.y-s.height};break;case"bottom":m={x:c,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:u};break;case"left":m={x:a.x-s.width,y:u};break;default:m={x:a.x,y:a.y}}switch(r(t)){case"start":m[f]-=d*(n&&y?-1:1);break;case"end":m[f]+=d*(n&&y?-1:1)}return m}function s(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function c(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function u(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:y=!1,padding:m=0}=t,h=s(m),g=a[y?"floating"===d?"reference":"floating":d],v=c(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:p,strategy:u})),w="floating"===d?{...l.floating,x:r,y:o}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},R=c(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:u}):w);return{top:(v.top-R.top+h.top)/x.y,bottom:(R.bottom-v.bottom+h.bottom)/x.y,left:(v.left-R.left+h.left)/x.x,right:(R.right-v.right+h.right)/x.x}}const f=Math.min,p=Math.max;function d(e,t,n){return p(e,f(t,n))}const y=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),m={left:"right",right:"left",bottom:"top",top:"bottom"};function h(e){return e.replace(/left|right|bottom|top/g,(e=>m[e]))}function g(e,t,n){void 0===n&&(n=!1);const i=r(e),a=l(e),s=o(a);let c="x"===a?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=h(c)),{main:c,cross:h(c)}}const v={start:"end",end:"start"};function w(e){return e.replace(/start|end/g,(e=>v[e]))}const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:l,rects:a,initialPlacement:s,platform:c,elements:f}=t,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:y,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=e,R=i(o),S=i(s)===s,_=await(null==c.isRTL?void 0:c.isRTL(f.floating)),T=y||(S||!b?[h(s)]:function(e){const t=h(e);return[w(e),t,w(t)]}(s));y||"none"===v||T.push(...function(e,t,n,o){const l=r(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(i(e),"start"===n,o);return l&&(a=a.map((e=>e+"-"+l)),t&&(a=a.concat(a.map(w)))),a}(s,b,v,_));const E=[s,...T],O=await u(t,x),A=[];let k=(null==(n=l.flip)?void 0:n.overflows)||[];if(p&&A.push(O[R]),d){const{main:e,cross:t}=g(o,a,_);A.push(O[e],O[t])}if(k=[...k,{placement:o,overflows:A}],!A.every((e=>e<=0))){var j,P;const e=((null==(j=l.flip)?void 0:j.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n=null==(P=k.find((e=>e.overflows[0]<=0)))?void 0:P.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=k.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};const x=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:o}=t,a=await async function(e,t){const{placement:n,platform:o,elements:a}=e,s=await(null==o.isRTL?void 0:o.isRTL(a.floating)),c=i(n),u=r(n),f="x"===l(n),p=["left","top"].includes(c)?-1:1,d=s&&f?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return u&&"number"==typeof g&&(h="end"===u?-1*g:g),f?{x:h*d,y:m*p}:{x:m*p,y:h*d}}(t,e);return{x:n+a.x,y:o+a.y,data:a}}}};const R=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=e,p={x:n,y:r},y=await u(t,f),m=l(i(o)),h="x"===m?"y":"x";let g=p[m],v=p[h];if(a){const e="y"===m?"bottom":"right";g=d(g+y["y"===m?"top":"left"],g,g-y[e])}if(s){const e="y"===h?"bottom":"right";v=d(v+y["y"===h?"top":"left"],v,v-y[e])}const w=c.fn({...t,[m]:g,[h]:v});return{...w,data:{x:w.x-n,y:w.y-r}}}}};function S(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function _(e){return S(e).getComputedStyle(e)}const T=Math.min,E=Math.max,O=Math.round;function A(e){const t=_(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,l=O(n)!==o||O(r)!==i;return l&&(n=o,r=i),{width:n,height:r,fallback:l}}function k(e){return N(e)?(e.nodeName||"").toLowerCase():""}let j;function P(){if(j)return j;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(j=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),j):navigator.userAgent}function L(e){return e instanceof S(e).HTMLElement}function D(e){return e instanceof S(e).Element}function N(e){return e instanceof S(e).Node}function C(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof S(e).ShadowRoot||e instanceof ShadowRoot}function $(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function F(e){return["table","td","th"].includes(k(e))}function I(e){const t=/firefox/i.test(P()),n=_(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function W(){return!/^((?!chrome|android).)*safari/i.test(P())}function H(e){return["html","body","#document"].includes(k(e))}function U(e){return D(e)?e:e.contextElement}const B={x:1,y:1};function M(e){const t=U(e);if(!L(t))return B;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=A(t);let l=(i?O(n.width):n.width)/r,a=(i?O(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function q(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),a=U(e);let s=B;t&&(r?D(r)&&(s=M(r)):s=M(e));const c=a?S(a):window,u=!W()&&n;let f=(l.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,p=(l.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/s.y,d=l.width/s.x,y=l.height/s.y;if(a){const e=S(a),t=r&&D(r)?S(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=M(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,p*=e.y,d*=e.x,y*=e.y,f+=t.x,p+=t.y,n=S(n).frameElement}}return{width:d,height:y,top:p,right:f+d,bottom:p+y,left:f,x:f,y:p}}function V(e){return((N(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Y(e){return q(V(e)).left+z(e).scrollLeft}function X(e){if("html"===k(e))return e;const t=e.assignedSlot||e.parentNode||C(e)&&e.host||V(e);return C(t)?t.host:t}function K(e){const t=X(e);return H(t)?t.ownerDocument.body:L(t)&&$(t)?t:K(t)}function J(e,t){var n;void 0===t&&(t=[]);const r=K(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=S(r);return o?t.concat(i,i.visualViewport||[],$(r)?r:[]):t.concat(r,J(r))}function Z(e,t,n){return"viewport"===t?c(function(e,t){const n=S(e),r=V(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=W();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n)):D(t)?c(function(e,t){const n=q(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=L(e)?M(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):c(function(e){const t=V(e),n=z(e),r=e.ownerDocument.body,o=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Y(e);const a=-n.scrollTop;return"rtl"===_(r).direction&&(l+=E(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(V(e)))}function G(e){return L(e)&&"fixed"!==_(e).position?e.offsetParent:null}function Q(e){const t=S(e);let n=G(e);for(;n&&F(n)&&"static"===_(n).position;)n=G(n);return n&&("html"===k(n)||"body"===k(n)&&"static"===_(n).position&&!I(n))?t:n||function(e){let t=X(e);for(;L(t)&&!H(t);){if(I(t))return t;t=X(t)}return null}(e)||t}function ee(e,t,n){const r=L(t),o=V(t),i=q(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==k(t)||$(o))&&(l=z(t)),L(t)){const e=q(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=Y(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const te={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=J(e).filter((e=>D(e)&&"body"!==k(e))),o=null;const i="fixed"===_(e).position;let l=i?X(e):e;for(;D(l)&&!H(l);){const e=_(l),t=I(l);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=X(l)}return t.set(e,r),r}(t,this._c):[].concat(n),l=[...i,r],a=l[0],s=l.reduce(((e,n)=>{const r=Z(t,n,o);return e.top=E(r.top,e.top),e.right=T(r.right,e.right),e.bottom=T(r.bottom,e.bottom),e.left=E(r.left,e.left),e}),Z(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=L(n),i=V(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==k(n)||$(i))&&(l=z(n)),L(n))){const e=q(n);a=M(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}},isElement:D,getDimensions:function(e){return L(e)?A(e):e.getBoundingClientRect()},getOffsetParent:Q,getDocumentElement:V,getScale:M,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Q,i=this.getDimensions;return{reference:ee(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===_(e).direction},ne=(e,t,n)=>{const r=new Map,o={platform:te,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),s.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=a(u,r,c),d=r,y={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:g,y:v,data:w,reset:b}=await h({x:f,y:p,initialPlacement:r,placement:d,strategy:o,middlewareData:y,rects:u,platform:l,elements:{reference:e,floating:t}});f=null!=g?g:f,p=null!=v?v:p,y={...y,[i]:{...y[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:p}=a(u,d,c))),n=-1)}return{x:f,y:p,placement:d,strategy:o,middlewareData:y}})(e,t,{...o,platform:i})};var re={exports:{}},oe={};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e){return e.split("-")[1]}function o(e){return"y"===e?"height":"width"}function i(e){return e.split("-")[0]}function l(e){return["top","bottom"].includes(i(e))?"x":"y"}function a(e,t,n){let{reference:a,floating:s}=e;const c=a.x+a.width/2-s.width/2,u=a.y+a.height/2-s.height/2,f=l(t),p=o(f),d=a[p]/2-s[p]/2,y="x"===f;let m;switch(i(t)){case"top":m={x:c,y:a.y-s.height};break;case"bottom":m={x:c,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:u};break;case"left":m={x:a.x-s.width,y:u};break;default:m={x:a.x,y:a.y}}switch(r(t)){case"start":m[f]-=d*(n&&y?-1:1);break;case"end":m[f]+=d*(n&&y?-1:1)}return m}function s(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function c(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function u(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:y=!1,padding:m=0}=t,h=s(m),g=a[y?"floating"===d?"reference":"floating":d],v=c(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:p,strategy:u})),w="floating"===d?{...l.floating,x:r,y:o}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},R=c(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:u}):w);return{top:(v.top-R.top+h.top)/x.y,bottom:(R.bottom-v.bottom+h.bottom)/x.y,left:(v.left-R.left+h.left)/x.x,right:(R.right-v.right+h.right)/x.x}}const f=Math.min,p=Math.max;function d(e,t,n){return p(e,f(t,n))}const y=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),m={left:"right",right:"left",bottom:"top",top:"bottom"};function h(e){return e.replace(/left|right|bottom|top/g,(e=>m[e]))}function g(e,t,n){void 0===n&&(n=!1);const i=r(e),a=l(e),s=o(a);let c="x"===a?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=h(c)),{main:c,cross:h(c)}}const v={start:"end",end:"start"};function w(e){return e.replace(/start|end/g,(e=>v[e]))}const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:l,rects:a,initialPlacement:s,platform:c,elements:f}=t,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:y,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=e,R=i(o),S=i(s)===s,_=await(null==c.isRTL?void 0:c.isRTL(f.floating)),T=y||(S||!b?[h(s)]:function(e){const t=h(e);return[w(e),t,w(t)]}(s));y||"none"===v||T.push(...function(e,t,n,o){const l=r(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(i(e),"start"===n,o);return l&&(a=a.map((e=>e+"-"+l)),t&&(a=a.concat(a.map(w)))),a}(s,b,v,_));const E=[s,...T],O=await u(t,x),A=[];let k=(null==(n=l.flip)?void 0:n.overflows)||[];if(p&&A.push(O[R]),d){const{main:e,cross:t}=g(o,a,_);A.push(O[e],O[t])}if(k=[...k,{placement:o,overflows:A}],!A.every((e=>e<=0))){var j,P;const e=((null==(j=l.flip)?void 0:j.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n=null==(P=k.find((e=>e.overflows[0]<=0)))?void 0:P.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=k.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};const x=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:o}=t,a=await async function(e,t){const{placement:n,platform:o,elements:a}=e,s=await(null==o.isRTL?void 0:o.isRTL(a.floating)),c=i(n),u=r(n),f="x"===l(n),p=["left","top"].includes(c)?-1:1,d=s&&f?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return u&&"number"==typeof g&&(h="end"===u?-1*g:g),f?{x:h*d,y:m*p}:{x:m*p,y:h*d}}(t,e);return{x:n+a.x,y:o+a.y,data:a}}}};const R=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=e,p={x:n,y:r},y=await u(t,f),m=l(i(o)),h="x"===m?"y":"x";let g=p[m],v=p[h];if(a){const e="y"===m?"bottom":"right";g=d(g+y["y"===m?"top":"left"],g,g-y[e])}if(s){const e="y"===h?"bottom":"right";v=d(v+y["y"===h?"top":"left"],v,v-y[e])}const w=c.fn({...t,[m]:g,[h]:v});return{...w,data:{x:w.x-n,y:w.y-r}}}}};function S(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function _(e){return S(e).getComputedStyle(e)}const T=Math.min,E=Math.max,O=Math.round;function A(e){const t=_(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,l=O(n)!==o||O(r)!==i;return l&&(n=o,r=i),{width:n,height:r,fallback:l}}function k(e){return N(e)?(e.nodeName||"").toLowerCase():""}let j;function P(){if(j)return j;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(j=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),j):navigator.userAgent}function L(e){return e instanceof S(e).HTMLElement}function D(e){return e instanceof S(e).Element}function N(e){return e instanceof S(e).Node}function C(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof S(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function $(e){return["table","td","th"].includes(k(e))}function I(e){const t=/firefox/i.test(P()),n=_(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function W(){return!/^((?!chrome|android).)*safari/i.test(P())}function H(e){return["html","body","#document"].includes(k(e))}function U(e){return D(e)?e:e.contextElement}const B={x:1,y:1};function M(e){const t=U(e);if(!L(t))return B;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=A(t);let l=(i?O(n.width):n.width)/r,a=(i?O(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function q(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),a=U(e);let s=B;t&&(r?D(r)&&(s=M(r)):s=M(e));const c=a?S(a):window,u=!W()&&n;let f=(l.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,p=(l.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/s.y,d=l.width/s.x,y=l.height/s.y;if(a){const e=S(a),t=r&&D(r)?S(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=M(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,p*=e.y,d*=e.x,y*=e.y,f+=t.x,p+=t.y,n=S(n).frameElement}}return{width:d,height:y,top:p,right:f+d,bottom:p+y,left:f,x:f,y:p}}function V(e){return((N(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Y(e){return q(V(e)).left+z(e).scrollLeft}function X(e){if("html"===k(e))return e;const t=e.assignedSlot||e.parentNode||C(e)&&e.host||V(e);return C(t)?t.host:t}function K(e){const t=X(e);return H(t)?t.ownerDocument.body:L(t)&&F(t)?t:K(t)}function J(e,t){var n;void 0===t&&(t=[]);const r=K(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=S(r);return o?t.concat(i,i.visualViewport||[],F(r)?r:[]):t.concat(r,J(r))}function Z(e,t,n){return"viewport"===t?c(function(e,t){const n=S(e),r=V(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=W();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n)):D(t)?c(function(e,t){const n=q(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=L(e)?M(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):c(function(e){const t=V(e),n=z(e),r=e.ownerDocument.body,o=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Y(e);const a=-n.scrollTop;return"rtl"===_(r).direction&&(l+=E(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(V(e)))}function G(e){return L(e)&&"fixed"!==_(e).position?e.offsetParent:null}function Q(e){const t=S(e);let n=G(e);for(;n&&$(n)&&"static"===_(n).position;)n=G(n);return n&&("html"===k(n)||"body"===k(n)&&"static"===_(n).position&&!I(n))?t:n||function(e){let t=X(e);for(;L(t)&&!H(t);){if(I(t))return t;t=X(t)}return null}(e)||t}function ee(e,t,n){const r=L(t),o=V(t),i=q(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==k(t)||F(o))&&(l=z(t)),L(t)){const e=q(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=Y(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const te={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=J(e).filter((e=>D(e)&&"body"!==k(e))),o=null;const i="fixed"===_(e).position;let l=i?X(e):e;for(;D(l)&&!H(l);){const e=_(l),t=I(l);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=X(l)}return t.set(e,r),r}(t,this._c):[].concat(n),l=[...i,r],a=l[0],s=l.reduce(((e,n)=>{const r=Z(t,n,o);return e.top=E(r.top,e.top),e.right=T(r.right,e.right),e.bottom=T(r.bottom,e.bottom),e.left=E(r.left,e.left),e}),Z(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=L(n),i=V(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==k(n)||F(i))&&(l=z(n)),L(n))){const e=q(n);a=M(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}},isElement:D,getDimensions:function(e){return L(e)?A(e):e.getBoundingClientRect()},getOffsetParent:Q,getDocumentElement:V,getScale:M,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Q,i=this.getDimensions;return{reference:ee(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===_(e).direction},ne=(e,t,n)=>{const r=new Map,o={platform:te,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),s.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=a(u,r,c),d=r,y={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:g,y:v,data:w,reset:b}=await h({x:f,y:p,initialPlacement:r,placement:d,strategy:o,middlewareData:y,rects:u,platform:l,elements:{reference:e,floating:t}});f=null!=g?g:f,p=null!=v?v:p,y={...y,[i]:{...y[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:p}=a(u,d,c))),n=-1)}return{x:f,y:p,placement:d,strategy:o,middlewareData:y}})(e,t,{...o,platform:i})};var re={exports:{}},oe={};
|
|
2
2
|
/** @license React v16.14.0
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
!function(e){!function(){var t=n.default,r=60103,o=60106;e.Fragment=60107;var i=60108,l=60114,a=60109,s=60110,c=60112,u=60113,f=60120,p=60115,d=60116,y=60121,m=60122,h=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;r=w("react.element"),o=w("react.portal"),e.Fragment=w("react.fragment"),i=w("react.strict_mode"),l=w("react.profiler"),a=w("react.provider"),s=w("react.context"),c=w("react.forward_ref"),u=w("react.suspense"),f=w("react.suspense_list"),p=w("react.memo"),d=w("react.lazy"),y=w("react.block"),m=w("react.server.block"),h=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),g=w("react.debug_trace_mode"),w("react.offscreen"),v=w("react.legacy_hidden")}var b="function"==typeof Symbol&&Symbol.iterator;var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];S("error",e,n)}function S(e,t,n){var r=x.ReactDebugCurrentFrame,o="";if(O){var i=T(O.type),l=O._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(_,"");if(/^index\./.test(i)){var l=o.match(_);if(l){var a=l[1];if(a)i=a.replace(_,"")+"/"+i}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,O._source,l&&T(l.type))}""!==(o+=r.getStackAddendum())&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return""+e}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}var _=/^(.*)[\\\/]/;function T(t){if(null==t)return null;if("number"==typeof t.tag&&R("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case e.Fragment:return"Fragment";case o:return"Portal";case l:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case s:return"Context.Consumer";case a:return"Context.Provider";case c:return m=t,h=t.render,g="ForwardRef",v=h.displayName||h.name||"",m.displayName||(""!==v?g+"("+v+")":g);case p:return T(t.type);case y:return T(t.render);case d:var n=1===(r=t)._status?r._result:null;if(n)return T(n)}var r,m,h,g,v;return null}var E={};x.ReactDebugCurrentFrame;var O=null;function A(e){O=e}var k,j,P,L=x.ReactCurrentOwner,D=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};P={};function C(e,t,n,o,i){var l,a={},s=null,c=null;for(l in void 0!==n&&(s=""+n),function(e){if(D.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(s=""+t.key),function(e){if(D.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&L.current&&t&&L.current.stateNode!==t){var n=T(L.current.type);P[n]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(L.current.type),e.ref),P[n]=!0)}}(t,i)),t)D.call(t,l)&&!N.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var u=e.defaultProps;for(l in u)void 0===a[l]&&(a[l]=u[l])}if(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){k||(k=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,f),c&&function(e,t){var n=function(){j||(j=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,f)}return function(e,t,n,o,i,l,a){var s={$$typeof:r,type:e,key:t,ref:n,props:a,_owner:l,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,L.current,a)}var
|
|
10
|
+
!function(e){!function(){var t=n.default,r=60103,o=60106;e.Fragment=60107;var i=60108,l=60114,a=60109,s=60110,c=60112,u=60113,f=60120,p=60115,d=60116,y=60121,m=60122,h=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;r=w("react.element"),o=w("react.portal"),e.Fragment=w("react.fragment"),i=w("react.strict_mode"),l=w("react.profiler"),a=w("react.provider"),s=w("react.context"),c=w("react.forward_ref"),u=w("react.suspense"),f=w("react.suspense_list"),p=w("react.memo"),d=w("react.lazy"),y=w("react.block"),m=w("react.server.block"),h=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),g=w("react.debug_trace_mode"),w("react.offscreen"),v=w("react.legacy_hidden")}var b="function"==typeof Symbol&&Symbol.iterator;var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];S("error",e,n)}function S(e,t,n){var r=x.ReactDebugCurrentFrame,o="";if(O){var i=T(O.type),l=O._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(_,"");if(/^index\./.test(i)){var l=o.match(_);if(l){var a=l[1];if(a)i=a.replace(_,"")+"/"+i}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,O._source,l&&T(l.type))}""!==(o+=r.getStackAddendum())&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return""+e}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}var _=/^(.*)[\\\/]/;function T(t){if(null==t)return null;if("number"==typeof t.tag&&R("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case e.Fragment:return"Fragment";case o:return"Portal";case l:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case s:return"Context.Consumer";case a:return"Context.Provider";case c:return m=t,h=t.render,g="ForwardRef",v=h.displayName||h.name||"",m.displayName||(""!==v?g+"("+v+")":g);case p:return T(t.type);case y:return T(t.render);case d:var n=1===(r=t)._status?r._result:null;if(n)return T(n)}var r,m,h,g,v;return null}var E={};x.ReactDebugCurrentFrame;var O=null;function A(e){O=e}var k,j,P,L=x.ReactCurrentOwner,D=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};P={};function C(e,t,n,o,i){var l,a={},s=null,c=null;for(l in void 0!==n&&(s=""+n),function(e){if(D.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(s=""+t.key),function(e){if(D.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&L.current&&t&&L.current.stateNode!==t){var n=T(L.current.type);P[n]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(L.current.type),e.ref),P[n]=!0)}}(t,i)),t)D.call(t,l)&&!N.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var u=e.defaultProps;for(l in u)void 0===a[l]&&(a[l]=u[l])}if(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){k||(k=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,f),c&&function(e,t){var n=function(){j||(j=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,f)}return function(e,t,n,o,i,l,a){var s={$$typeof:r,type:e,key:t,ref:n,props:a,_owner:l,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,L.current,a)}var F,$=x.ReactCurrentOwner;function I(e){O=e}function W(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function H(){if($.current){var e=T($.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}x.ReactDebugCurrentFrame,F=!1;var U={};function B(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=H();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!U[n]){U[n]=!0;var r="";e&&e._owner&&e._owner!==$.current&&(r=" It was passed a child from "+T(e._owner.type)+"."),I(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),I(null)}}}function M(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];W(r)&&B(r,t)}else if(W(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=b&&e[b]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,l=o.call(e);!(i=l.next()).done;)W(i.value)&&B(i.value,t)}}function q(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==c&&n.$$typeof!==p)return;t=n.propTypes}if(t){var r=T(n);!function(e,t,n,r,o){var i=Function.call.bind(Object.prototype.hasOwnProperty);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var s=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}a=e[l](t,l,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(A(o),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,l,typeof a),A(null)),a instanceof Error&&!(a.message in E)&&(E[a.message]=!0,A(o),R("Failed %s type: %s",n,a.message),A(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!F){F=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function V(t,n,o,w,b,x){var S=function(t){return"string"==typeof t||"function"==typeof t||t===e.Fragment||t===l||t===g||t===i||t===u||t===f||t===v||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===h||t.$$typeof===y||t[0]===m)}(t);if(!S){var _="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var E,O=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(b);_+=O||H(),null===t?E="null":Array.isArray(t)?E="array":void 0!==t&&t.$$typeof===r?(E="<"+(T(t.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):E=typeof t,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,_)}var A=C(t,n,o,b,x);if(null==A)return A;if(S){var k=n.children;if(void 0!==k)if(w)if(Array.isArray(k)){for(var j=0;j<k.length;j++)M(k[j],t);Object.freeze&&Object.freeze(k)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(k,t)}return t===e.Fragment?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){I(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),I(null);break}}null!==e.ref&&(I(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}(A):q(A),A}var z=function(e,t,n){return V(e,t,n,!1)},Y=function(e,t,n){return V(e,t,n,!0)};e.jsx=z,e.jsxs=Y}()}(oe),re.exports=oe;var ie,le={exports:{}};
|
|
11
11
|
/*!
|
|
12
12
|
Copyright (c) 2018 Jed Watson.
|
|
13
13
|
Licensed under the MIT License (MIT), see
|
|
14
14
|
http://jedwatson.github.io/classnames
|
|
15
|
-
*/ie=le,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}}return n.join(" ")}ie.exports?(t.default=t,ie.exports=t):window.classNames=t}();var ae=le.exports;const se=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},ce=({content:e})=>re.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),ue={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},fe={getTooltipData:()=>ue},pe=e.createContext(fe);function de(t="DEFAULT_TOOLTIP_ID"){return e.useContext(pe).getTooltipData(t)}const ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:i="top",offset:a=10,strategy:c="absolute",middlewares:u=[x(Number(a)),b(),R({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const f=u;return n?(f.push({name:"arrow",options:p={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=p||{},{x:i,y:a,placement:c,rects:u,platform:f}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const y=s(n),m={x:i,y:a},h=l(c),g=o(h),v=await f.getDimensions(t),w="y"===h?"top":"left",b="y"===h?"bottom":"right",x=u.reference[g]+u.reference[h]-m[h]-u.floating[g],R=m[h]-u.reference[h],S=await(null==f.getOffsetParent?void 0:f.getOffsetParent(t));let _=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0;0===_&&(_=u.floating[g]);const T=x/2-R/2,E=y[w],O=_-v[g]-y[b],A=_/2-v[g]/2+T,k=d(E,A,O),j=null!=r(c)&&A!=k&&u.reference[g]/2-(A<E?y[w]:y[b])-v[g]/2<0;return{[h]:m[h]-(j?A<E?E-A:O-A:0),data:{[h]:k,centerOffset:A-k}}}}),ne(e,t,{placement:i,strategy:c,middleware:f}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):ne(e,t,{placement:"bottom",strategy:c,middleware:f}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var p};var me={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const he=({id:t,className:n,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:l,place:a="top",offset:s=10,events:c=["hover"],positionStrategy:u="absolute",middlewares:f,wrapper:p,children:d=null,delayShow:y=0,delayHide:m=0,float:h=!1,noArrow:g=!1,clickable:v=!1,closeOnEsc:w=!1,style:b,position:x,afterShow:R,afterHide:S,content:_,html:T,isOpen:E,setIsOpen:O,activeAnchor:A,setActiveAnchor:k})=>{const j=e.useRef(null),P=e.useRef(null),L=e.useRef(null),D=e.useRef(null),[N,C]=e.useState({}),[$,F]=e.useState({}),[I,W]=e.useState(!1),[H,U]=e.useState(!1),B=e.useRef(!1),M=e.useRef(null),{anchorRefs:q,setActiveAnchor:V}=de(t),z=e.useRef(!1),[Y,X]=e.useState([]),K=e.useRef(!1);e.useEffect((()=>{let e=l;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));X(t)}catch(e){X([])}}),[l,A]),e.useLayoutEffect((()=>(K.current=!0,()=>{K.current=!1})),[]),e.useEffect((()=>{if(!I){const e=setTimeout((()=>{U(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[I]);const J=e=>{K.current&&(e&&U(!0),setTimeout((()=>{K.current&&(null==O||O(e),void 0===E&&W(e))}),10))};e.useEffect((()=>{if(void 0===E)return()=>null;E&&U(!0);const e=setTimeout((()=>{W(E)}),10);return()=>{clearTimeout(e)}}),[E]),e.useEffect((()=>{I!==B.current&&(B.current=I,I?null==R||R():null==S||S())}),[I]);const Z=(e=m)=>{D.current&&clearTimeout(D.current),D.current=setTimeout((()=>{z.current||J(!1)}),e)},G=e=>{var t;if(!e)return;y?(L.current&&clearTimeout(L.current),L.current=setTimeout((()=>{J(!0)}),y)):J(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;k(n),V({current:n}),D.current&&clearTimeout(D.current)},Q=()=>{v?Z(m||100):m?Z():J(!1),L.current&&clearTimeout(L.current)},ee=({x:e,y:t})=>{ye({place:a,offset:s,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{Object.keys(e.tooltipStyles).length&&C(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&F(e.tooltipArrowStyles)}))},te=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ee(n),M.current=n},ne=e=>{G(e),m&&Z()},oe=e=>{const t=document.querySelector(`[id='${i}']`);(null==t?void 0:t.contains(e.target))||Y.some((t=>t.contains(e.target)))||J(!1)},ie=e=>{"Escape"===e.key&&J(!1)},le=se(G,50),ue=se(Q,50);e.useEffect((()=>{var e,n;const r=new Set(q);Y.forEach((e=>{r.add({current:e})}));const o=document.querySelector(`[id='${i}']`);o&&r.add({current:o}),w&&window.addEventListener("keydown",ie);const a=[];c.find((e=>"click"===e))&&(window.addEventListener("click",oe),a.push({event:"click",listener:ne})),c.find((e=>"hover"===e))&&(a.push({event:"mouseenter",listener:le},{event:"mouseleave",listener:ue},{event:"focus",listener:le},{event:"blur",listener:ue}),h&&a.push({event:"mousemove",listener:te}));const s=()=>{z.current=!0},u=()=>{z.current=!1,Q()};v&&(null===(e=j.current)||void 0===e||e.addEventListener("mouseenter",s),null===(n=j.current)||void 0===n||n.addEventListener("mouseleave",u)),a.forEach((({event:e,listener:t})=>{r.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))}));const f=new MutationObserver((e=>{let n=null!=l?l:"";!n&&t&&(n=`[data-tooltip-id='${t}']`),e.forEach((e=>{if("childList"===e.type&&(A&&[...e.removedNodes].some((e=>!!e.contains(A)&&(U(!1),J(!1),k(null),!0))),n))try{const t=[...e.addedNodes].filter((e=>1===e.nodeType)),r=[...t.filter((e=>e.matches(n))),...t.flatMap((e=>[...e.querySelectorAll(n)]))];r.length&&X((e=>[...e,...r]))}catch(e){}}))}));return f.observe(document.body,{attributes:!1,childList:!0,subtree:!0}),()=>{var e,t;c.find((e=>"click"===e))&&window.removeEventListener("click",oe),w&&window.removeEventListener("keydown",ie),v&&(null===(e=j.current)||void 0===e||e.removeEventListener("mouseenter",s),null===(t=j.current)||void 0===t||t.removeEventListener("mouseleave",u)),a.forEach((({event:e,listener:t})=>{r.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))})),f.disconnect()}}),[H,q,A,Y,w,c,m,y]),e.useEffect((()=>{x?ee(x):h?M.current&&ee(M.current):ye({place:a,offset:s,elementReference:A,tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{K.current&&(Object.keys(e.tooltipStyles).length&&C(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&F(e.tooltipArrowStyles))}))}),[I,A,_,T,a,s,u,x]),e.useEffect((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...Y,t];A&&n.includes(A)||k(null!==(e=Y[0])&&void 0!==e?e:t)}),[i,Y,A]),e.useEffect((()=>()=>{L.current&&clearTimeout(L.current),D.current&&clearTimeout(D.current)}),[]);const fe=Boolean(T||_||d)&&I&&Object.keys(N).length>0;return H?re.exports.jsxs(p,{id:t,role:"tooltip",className:ae("react-tooltip",me.tooltip,me[o],n,{[me.show]:fe,[me.fixed]:"fixed"===u,[me.clickable]:v}),style:{...b,...N},ref:j,children:[T&&re.exports.jsx(ce,{content:T})||_||d,re.exports.jsx(p,{className:ae("react-tooltip-arrow",me.arrow,r,{[me["no-arrow"]]:g}),style:$,ref:P})]}):null};exports.Tooltip=({id:t,anchorId:n,anchorSelect:r,content:o,html:i,className:l,classNameArrow:a,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:d=["hover"],positionStrategy:y="absolute",middlewares:m,delayShow:h=0,delayHide:g=0,float:v=!1,noArrow:w=!1,clickable:b=!1,closeOnEsc:x=!1,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:O})=>{const[A,k]=e.useState(o),[j,P]=e.useState(i),[L,D]=e.useState(c),[N,C]=e.useState(s),[$,F]=e.useState(u),[I,W]=e.useState(h),[H,U]=e.useState(g),[B,M]=e.useState(v),[q,V]=e.useState(f),[z,Y]=e.useState(d),[X,K]=e.useState(y),[J,Z]=e.useState(null),{anchorRefs:G,activeAnchor:Q}=de(t),ee=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),te=e=>{const t={place:e=>{var t;D(null!==(t=e)&&void 0!==t?t:c)},content:e=>{k(null!=e?e:o)},html:e=>{P(null!=e?e:i)},variant:e=>{var t;C(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{F(null===e?u:Number(e))},wrapper:e=>{var t;V(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");Y(null!=t?t:d)},"position-strategy":e=>{var t;K(null!==(t=e)&&void 0!==t?t:y)},"delay-show":e=>{W(null===e?h:Number(e))},"delay-hide":e=>{U(null===e?g:Number(e))},float:e=>{M(null===e?v:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};e.useEffect((()=>{k(o)}),[o]),e.useEffect((()=>{P(i)}),[i]),e.useEffect((()=>{D(c)}),[c]),e.useEffect((()=>{var e;const o=new Set(G);let i=r;if(!i&&t&&(i=`[data-tooltip-id='${t}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${n}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const a=null!==(e=null!=J?J:l)&&void 0!==e?e:Q.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=ee(a);te(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=ee(a);te(e),s.observe(a,c)}return()=>{s.disconnect()}}),[G,Q,J,n,r]);const ne={id:t,anchorId:n,anchorSelect:r,className:l,classNameArrow:a,content:A,html:j,place:L,variant:N,offset:$,wrapper:q,events:z,positionStrategy:X,middlewares:m,delayShow:I,delayHide:H,float:B,noArrow:w,clickable:b,closeOnEsc:x,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:O,activeAnchor:J,setActiveAnchor:e=>Z(e)};return p?re.exports.jsx(he,{...ne,children:p}):re.exports.jsx(he,{...ne})},exports.TooltipProvider=({children:t})=>{const[n,r]=e.useState({DEFAULT_TOOLTIP_ID:new Set}),[o,i]=e.useState({DEFAULT_TOOLTIP_ID:{current:null}}),l=(e,...t)=>{r((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},a=(e,...t)=>{r((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},s=e.useCallback(((e="DEFAULT_TOOLTIP_ID")=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=o[e])&&void 0!==r?r:{current:null},attach:(...t)=>l(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{i((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[n,o,l,a]),c=e.useMemo((()=>({getTooltipData:s})),[s]);return re.exports.jsx(pe.Provider,{value:c,children:t})},exports.TooltipWrapper=({tooltipId:t,children:n,className:r,place:o,content:i,html:l,variant:a,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:d})=>{const{attach:y,detach:m}=de(t),h=e.useRef(null);return e.useEffect((()=>(y(h),()=>{m(h)})),[]),re.exports.jsx("span",{ref:h,className:ae("react-tooltip-wrapper",r),"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":l,"data-tooltip-variant":a,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":d,children:n})},exports.autoPlacement=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,l;const{rects:a,middlewareData:s,placement:c,platform:f,elements:p}=t,{alignment:d,allowedPlacements:m=y,autoAlignment:h=!0,...v}=e,b=void 0!==d||m===y?function(e,t,n){return(e?[...n.filter((t=>r(t)===e)),...n.filter((t=>r(t)!==e))]:n.filter((e=>i(e)===e))).filter((n=>!e||r(n)===e||!!t&&w(n)!==n))}(d||null,h,m):m,x=await u(t,v),R=(null==(n=s.autoPlacement)?void 0:n.index)||0,S=b[R];if(null==S)return{};const{main:_,cross:T}=g(S,a,await(null==f.isRTL?void 0:f.isRTL(p.floating)));if(c!==S)return{reset:{placement:b[0]}};const E=[x[i(S)],x[_],x[T]],O=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:S,overflows:E}],A=b[R+1];if(A)return{data:{index:R+1,overflows:O},reset:{placement:A}};const k=O.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),j=null==(l=k.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:l.placement,P=j||k[0].placement;return P!==c?{data:{index:R+1,overflows:O},reset:{placement:P}}:{}}}},exports.flip=b,exports.inline=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:a,strategy:u}=t,{padding:d=2,x:y,y:m}=e,h=c(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:o.reference,offsetParent:await(null==a.getOffsetParent?void 0:a.getOffsetParent(r.floating)),strategy:u}):o.reference),g=await(null==a.getClientRects?void 0:a.getClientRects(r.reference))||[],v=s(d);const w=await a.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=y&&null!=m)return g.find((e=>y>e.left-v.left&&y<e.right+v.right&&m>e.top-v.top&&m<e.bottom+v.bottom))||h;if(g.length>=2){if("x"===l(n)){const e=g[0],t=g[g.length-1],r="top"===i(n),o=e.top,l=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:l,left:a,right:s,width:s-a,height:l-o,x:a,y:o}}const e="left"===i(n),t=p(...g.map((e=>e.right))),r=f(...g.map((e=>e.left))),o=g.filter((n=>e?n.left===r:n.right===t)),a=o[0].top,s=o[o.length-1].bottom;return{top:a,bottom:s,left:r,right:t,width:t-r,height:s-a,x:r,y:a}}return h}},floating:r.floating,strategy:u});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},exports.offset=x,exports.shift=R,exports.size=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:l,elements:a}=t,{apply:s=(()=>{}),...c}=e,f=await u(t,c),d=i(n),y=r(n);let m,h;"top"===d||"bottom"===d?(m=d,h=y===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,m="end"===y?"top":"bottom");const g=p(f.left,0),v=p(f.right,0),w=p(f.top,0),b=p(f.bottom,0),x={availableHeight:o.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:p(f.top,f.bottom)):f[m]),availableWidth:o.floating.width-(["top","bottom"].includes(n)?2*(0!==g||0!==v?g+v:p(f.left,f.right)):f[h])};await s({...t,...x});const R=await l.getDimensions(a.floating);return o.floating.width!==R.width||o.floating.height!==R.height?{reset:{rects:!0}}:{}}}};
|
|
15
|
+
*/ie=le,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}}return n.join(" ")}ie.exports?(t.default=t,ie.exports=t):window.classNames=t}();var ae=le.exports;const se=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},ce=({content:e})=>re.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),ue={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},fe={getTooltipData:()=>ue},pe=e.createContext(fe);function de(t="DEFAULT_TOOLTIP_ID"){return e.useContext(pe).getTooltipData(t)}const ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:i="top",offset:a=10,strategy:c="absolute",middlewares:u=[x(Number(a)),b(),R({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const f=u;return n?(f.push({name:"arrow",options:p={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=p||{},{x:i,y:a,placement:c,rects:u,platform:f}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const y=s(n),m={x:i,y:a},h=l(c),g=o(h),v=await f.getDimensions(t),w="y"===h?"top":"left",b="y"===h?"bottom":"right",x=u.reference[g]+u.reference[h]-m[h]-u.floating[g],R=m[h]-u.reference[h],S=await(null==f.getOffsetParent?void 0:f.getOffsetParent(t));let _=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0;0===_&&(_=u.floating[g]);const T=x/2-R/2,E=y[w],O=_-v[g]-y[b],A=_/2-v[g]/2+T,k=d(E,A,O),j=null!=r(c)&&A!=k&&u.reference[g]/2-(A<E?y[w]:y[b])-v[g]/2<0;return{[h]:m[h]-(j?A<E?E-A:O-A:0),data:{[h]:k,centerOffset:A-k}}}}),ne(e,t,{placement:i,strategy:c,middleware:f}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):ne(e,t,{placement:"bottom",strategy:c,middleware:f}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var p};var me={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const he=({id:t,className:n,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:l,place:a="top",offset:s=10,events:c=["hover"],positionStrategy:u="absolute",middlewares:f,wrapper:p,children:d=null,delayShow:y=0,delayHide:m=0,float:h=!1,noArrow:g=!1,clickable:v=!1,closeOnEsc:w=!1,style:b,position:x,afterShow:R,afterHide:S,content:_,html:T,isOpen:E,setIsOpen:O,activeAnchor:A,setActiveAnchor:k})=>{const j=e.useRef(null),P=e.useRef(null),L=e.useRef(null),D=e.useRef(null),[N,C]=e.useState({}),[F,$]=e.useState({}),[I,W]=e.useState(!1),[H,U]=e.useState(!1),B=e.useRef(!1),M=e.useRef(null),{anchorRefs:q,setActiveAnchor:V}=de(t),z=e.useRef(!1),[Y,X]=e.useState([]),K=e.useRef(!1);e.useLayoutEffect((()=>(K.current=!0,()=>{K.current=!1})),[]),e.useEffect((()=>{if(!I){const e=setTimeout((()=>{U(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[I]);const J=e=>{K.current&&(e&&U(!0),setTimeout((()=>{K.current&&(null==O||O(e),void 0===E&&W(e))}),10))};e.useEffect((()=>{if(void 0===E)return()=>null;E&&U(!0);const e=setTimeout((()=>{W(E)}),10);return()=>{clearTimeout(e)}}),[E]),e.useEffect((()=>{I!==B.current&&(B.current=I,I?null==R||R():null==S||S())}),[I]);const Z=(e=m)=>{D.current&&clearTimeout(D.current),D.current=setTimeout((()=>{z.current||J(!1)}),e)},G=e=>{var t;if(!e)return;y?(L.current&&clearTimeout(L.current),L.current=setTimeout((()=>{J(!0)}),y)):J(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;k(n),V({current:n}),D.current&&clearTimeout(D.current)},Q=()=>{v?Z(m||100):m?Z():J(!1),L.current&&clearTimeout(L.current)},ee=({x:e,y:t})=>{ye({place:a,offset:s,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{Object.keys(e.tooltipStyles).length&&C(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&$(e.tooltipArrowStyles)}))},te=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ee(n),M.current=n},ne=e=>{G(e),m&&Z()},oe=e=>{const t=document.querySelector(`[id='${i}']`);(null==t?void 0:t.contains(e.target))||Y.some((t=>t.contains(e.target)))||J(!1)},ie=e=>{"Escape"===e.key&&J(!1)},le=se(G,50),ue=se(Q,50);e.useEffect((()=>{var e,t;const n=new Set(q);Y.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${i}']`);r&&n.add({current:r}),w&&window.addEventListener("keydown",ie);const o=[];c.find((e=>"click"===e))&&(window.addEventListener("click",oe),o.push({event:"click",listener:ne})),c.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:le},{event:"mouseleave",listener:ue},{event:"focus",listener:le},{event:"blur",listener:ue}),h&&o.push({event:"mousemove",listener:te}));const l=()=>{z.current=!0},a=()=>{z.current=!1,Q()};return v&&(null===(e=j.current)||void 0===e||e.addEventListener("mouseenter",l),null===(t=j.current)||void 0===t||t.addEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;c.find((e=>"click"===e))&&window.removeEventListener("click",oe),w&&window.removeEventListener("keydown",ie),v&&(null===(e=j.current)||void 0===e||e.removeEventListener("mouseenter",l),null===(t=j.current)||void 0===t||t.removeEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[H,q,Y,w,c]),e.useEffect((()=>{let e=null!=l?l:"";!e&&t&&(e=`[data-tooltip-id='${t}']`);const n=new MutationObserver((n=>{const r=[];n.forEach((n=>{if("attributes"===n.type&&"data-tooltip-id"===n.attributeName){n.target.getAttribute("data-tooltip-id")===t&&r.push(n.target)}if("childList"===n.type&&(A&&[...n.removedNodes].some((e=>!!e.contains(A)&&(U(!1),J(!1),k(null),!0))),e))try{const t=[...n.addedNodes].filter((e=>1===e.nodeType));r.push(...t.filter((t=>t.matches(e)))),r.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch(e){}})),r.length&&X((e=>[...e,...r]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{n.disconnect()}}),[t,l,A]),e.useEffect((()=>{x?ee(x):h?M.current&&ee(M.current):ye({place:a,offset:s,elementReference:A,tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{K.current&&(Object.keys(e.tooltipStyles).length&&C(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&$(e.tooltipArrowStyles))}))}),[I,A,_,T,a,s,u,x]),e.useEffect((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...Y,t];A&&n.includes(A)||k(null!==(e=Y[0])&&void 0!==e?e:t)}),[i,Y,A]),e.useEffect((()=>()=>{L.current&&clearTimeout(L.current),D.current&&clearTimeout(D.current)}),[]),e.useEffect((()=>{let e=l;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));X(t)}catch(e){X([])}}),[t,l]);const fe=Boolean(T||_||d)&&I&&Object.keys(N).length>0;return H?re.exports.jsxs(p,{id:t,role:"tooltip",className:ae("react-tooltip",me.tooltip,me[o],n,{[me.show]:fe,[me.fixed]:"fixed"===u,[me.clickable]:v}),style:{...b,...N},ref:j,children:[T&&re.exports.jsx(ce,{content:T})||_||d,re.exports.jsx(p,{className:ae("react-tooltip-arrow",me.arrow,r,{[me["no-arrow"]]:g}),style:F,ref:P})]}):null};exports.Tooltip=({id:t,anchorId:n,anchorSelect:r,content:o,html:i,className:l,classNameArrow:a,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:d=["hover"],positionStrategy:y="absolute",middlewares:m,delayShow:h=0,delayHide:g=0,float:v=!1,noArrow:w=!1,clickable:b=!1,closeOnEsc:x=!1,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:O})=>{const[A,k]=e.useState(o),[j,P]=e.useState(i),[L,D]=e.useState(c),[N,C]=e.useState(s),[F,$]=e.useState(u),[I,W]=e.useState(h),[H,U]=e.useState(g),[B,M]=e.useState(v),[q,V]=e.useState(f),[z,Y]=e.useState(d),[X,K]=e.useState(y),[J,Z]=e.useState(null),{anchorRefs:G,activeAnchor:Q}=de(t),ee=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),te=e=>{const t={place:e=>{var t;D(null!==(t=e)&&void 0!==t?t:c)},content:e=>{k(null!=e?e:o)},html:e=>{P(null!=e?e:i)},variant:e=>{var t;C(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{$(null===e?u:Number(e))},wrapper:e=>{var t;V(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");Y(null!=t?t:d)},"position-strategy":e=>{var t;K(null!==(t=e)&&void 0!==t?t:y)},"delay-show":e=>{W(null===e?h:Number(e))},"delay-hide":e=>{U(null===e?g:Number(e))},float:e=>{M(null===e?v:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};e.useEffect((()=>{k(o)}),[o]),e.useEffect((()=>{P(i)}),[i]),e.useEffect((()=>{D(c)}),[c]),e.useEffect((()=>{var e;const o=new Set(G);let i=r;if(!i&&t&&(i=`[data-tooltip-id='${t}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${n}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const a=null!==(e=null!=J?J:l)&&void 0!==e?e:Q.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=ee(a);te(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=ee(a);te(e),s.observe(a,c)}return()=>{s.disconnect()}}),[G,Q,J,n,r]);const ne={id:t,anchorId:n,anchorSelect:r,className:l,classNameArrow:a,content:A,html:j,place:L,variant:N,offset:F,wrapper:q,events:z,positionStrategy:X,middlewares:m,delayShow:I,delayHide:H,float:B,noArrow:w,clickable:b,closeOnEsc:x,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:O,activeAnchor:J,setActiveAnchor:e=>Z(e)};return p?re.exports.jsx(he,{...ne,children:p}):re.exports.jsx(he,{...ne})},exports.TooltipProvider=({children:t})=>{const[n,r]=e.useState({DEFAULT_TOOLTIP_ID:new Set}),[o,i]=e.useState({DEFAULT_TOOLTIP_ID:{current:null}}),l=(e,...t)=>{r((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},a=(e,...t)=>{r((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},s=e.useCallback(((e="DEFAULT_TOOLTIP_ID")=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=o[e])&&void 0!==r?r:{current:null},attach:(...t)=>l(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{i((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[n,o,l,a]),c=e.useMemo((()=>({getTooltipData:s})),[s]);return re.exports.jsx(pe.Provider,{value:c,children:t})},exports.TooltipWrapper=({tooltipId:t,children:n,className:r,place:o,content:i,html:l,variant:a,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:d})=>{const{attach:y,detach:m}=de(t),h=e.useRef(null);return e.useEffect((()=>(y(h),()=>{m(h)})),[]),re.exports.jsx("span",{ref:h,className:ae("react-tooltip-wrapper",r),"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":l,"data-tooltip-variant":a,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":d,children:n})},exports.autoPlacement=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,l;const{rects:a,middlewareData:s,placement:c,platform:f,elements:p}=t,{alignment:d,allowedPlacements:m=y,autoAlignment:h=!0,...v}=e,b=void 0!==d||m===y?function(e,t,n){return(e?[...n.filter((t=>r(t)===e)),...n.filter((t=>r(t)!==e))]:n.filter((e=>i(e)===e))).filter((n=>!e||r(n)===e||!!t&&w(n)!==n))}(d||null,h,m):m,x=await u(t,v),R=(null==(n=s.autoPlacement)?void 0:n.index)||0,S=b[R];if(null==S)return{};const{main:_,cross:T}=g(S,a,await(null==f.isRTL?void 0:f.isRTL(p.floating)));if(c!==S)return{reset:{placement:b[0]}};const E=[x[i(S)],x[_],x[T]],O=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:S,overflows:E}],A=b[R+1];if(A)return{data:{index:R+1,overflows:O},reset:{placement:A}};const k=O.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),j=null==(l=k.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:l.placement,P=j||k[0].placement;return P!==c?{data:{index:R+1,overflows:O},reset:{placement:P}}:{}}}},exports.flip=b,exports.inline=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:a,strategy:u}=t,{padding:d=2,x:y,y:m}=e,h=c(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:o.reference,offsetParent:await(null==a.getOffsetParent?void 0:a.getOffsetParent(r.floating)),strategy:u}):o.reference),g=await(null==a.getClientRects?void 0:a.getClientRects(r.reference))||[],v=s(d);const w=await a.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=y&&null!=m)return g.find((e=>y>e.left-v.left&&y<e.right+v.right&&m>e.top-v.top&&m<e.bottom+v.bottom))||h;if(g.length>=2){if("x"===l(n)){const e=g[0],t=g[g.length-1],r="top"===i(n),o=e.top,l=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:l,left:a,right:s,width:s-a,height:l-o,x:a,y:o}}const e="left"===i(n),t=p(...g.map((e=>e.right))),r=f(...g.map((e=>e.left))),o=g.filter((n=>e?n.left===r:n.right===t)),a=o[0].top,s=o[o.length-1].bottom;return{top:a,bottom:s,left:r,right:t,width:t-r,height:s-a,x:r,y:a}}return h}},floating:r.floating,strategy:u});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},exports.offset=x,exports.shift=R,exports.size=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:l,elements:a}=t,{apply:s=(()=>{}),...c}=e,f=await u(t,c),d=i(n),y=r(n);let m,h;"top"===d||"bottom"===d?(m=d,h=y===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,m="end"===y?"top":"bottom");const g=p(f.left,0),v=p(f.right,0),w=p(f.top,0),b=p(f.bottom,0),x={availableHeight:o.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:p(f.top,f.bottom)):f[m]),availableWidth:o.floating.width-(["top","bottom"].includes(n)?2*(0!==g||0!==v?g+v:p(f.left,f.right)):f[h])};await s({...t,...x});const R=await l.getDimensions(a.floating);return o.floating.width!==R.width||o.floating.height!==R.height?{reset:{rects:!0}}:{}}}};
|
|
@@ -2686,23 +2686,6 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2686
2686
|
const hoveringTooltip = useRef(false);
|
|
2687
2687
|
const [anchorsBySelect, setAnchorsBySelect] = useState([]);
|
|
2688
2688
|
const mounted = useRef(false);
|
|
2689
|
-
useEffect(() => {
|
|
2690
|
-
let selector = anchorSelect;
|
|
2691
|
-
if (!selector && id) {
|
|
2692
|
-
selector = `[data-tooltip-id='${id}']`;
|
|
2693
|
-
}
|
|
2694
|
-
if (!selector) {
|
|
2695
|
-
return;
|
|
2696
|
-
}
|
|
2697
|
-
try {
|
|
2698
|
-
const anchors = Array.from(document.querySelectorAll(selector));
|
|
2699
|
-
setAnchorsBySelect(anchors);
|
|
2700
|
-
}
|
|
2701
|
-
catch (_a) {
|
|
2702
|
-
// warning was already issued in the controller
|
|
2703
|
-
setAnchorsBySelect([]);
|
|
2704
|
-
}
|
|
2705
|
-
}, [anchorSelect, activeAnchor]);
|
|
2706
2689
|
/**
|
|
2707
2690
|
* useLayoutEffect runs before useEffect,
|
|
2708
2691
|
* but should be used carefully because of caveats
|
|
@@ -2948,12 +2931,44 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2948
2931
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener(event, listener);
|
|
2949
2932
|
});
|
|
2950
2933
|
});
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
if (
|
|
2954
|
-
|
|
2934
|
+
return () => {
|
|
2935
|
+
var _a, _b;
|
|
2936
|
+
if (events.find((event) => event === 'click')) {
|
|
2937
|
+
window.removeEventListener('click', handleClickOutsideAnchors);
|
|
2955
2938
|
}
|
|
2939
|
+
if (closeOnEsc) {
|
|
2940
|
+
window.removeEventListener('keydown', handleEsc);
|
|
2941
|
+
}
|
|
2942
|
+
if (clickable) {
|
|
2943
|
+
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', handleMouseEnterTooltip);
|
|
2944
|
+
(_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', handleMouseLeaveTooltip);
|
|
2945
|
+
}
|
|
2946
|
+
enabledEvents.forEach(({ event, listener }) => {
|
|
2947
|
+
elementRefs.forEach((ref) => {
|
|
2948
|
+
var _a;
|
|
2949
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, listener);
|
|
2950
|
+
});
|
|
2951
|
+
});
|
|
2952
|
+
};
|
|
2953
|
+
/**
|
|
2954
|
+
* rendered is also a dependency to ensure anchor observers are re-registered
|
|
2955
|
+
* since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM
|
|
2956
|
+
*/
|
|
2957
|
+
}, [rendered, anchorRefs, anchorsBySelect, closeOnEsc, events]);
|
|
2958
|
+
useEffect(() => {
|
|
2959
|
+
let selector = anchorSelect !== null && anchorSelect !== void 0 ? anchorSelect : '';
|
|
2960
|
+
if (!selector && id) {
|
|
2961
|
+
selector = `[data-tooltip-id='${id}']`;
|
|
2962
|
+
}
|
|
2963
|
+
const documentObserverCallback = (mutationList) => {
|
|
2964
|
+
const newAnchors = [];
|
|
2956
2965
|
mutationList.forEach((mutation) => {
|
|
2966
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {
|
|
2967
|
+
const newId = mutation.target.getAttribute('data-tooltip-id');
|
|
2968
|
+
if (newId === id) {
|
|
2969
|
+
newAnchors.push(mutation.target);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2957
2972
|
if (mutation.type !== 'childList') {
|
|
2958
2973
|
return;
|
|
2959
2974
|
}
|
|
@@ -2973,15 +2988,12 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2973
2988
|
}
|
|
2974
2989
|
try {
|
|
2975
2990
|
const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1);
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
];
|
|
2982
|
-
if (newAnchors.length) {
|
|
2983
|
-
setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
|
|
2984
|
-
}
|
|
2991
|
+
newAnchors.push(
|
|
2992
|
+
// the element itself is an anchor
|
|
2993
|
+
...elements.filter((element) => element.matches(selector)));
|
|
2994
|
+
newAnchors.push(
|
|
2995
|
+
// the element has children which are anchors
|
|
2996
|
+
...elements.flatMap((element) => [...element.querySelectorAll(selector)]));
|
|
2985
2997
|
}
|
|
2986
2998
|
catch (_a) {
|
|
2987
2999
|
/**
|
|
@@ -2990,44 +3002,22 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
2990
3002
|
*/
|
|
2991
3003
|
}
|
|
2992
3004
|
});
|
|
3005
|
+
if (newAnchors.length) {
|
|
3006
|
+
setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
|
|
3007
|
+
}
|
|
2993
3008
|
};
|
|
2994
|
-
const
|
|
3009
|
+
const documentObserver = new MutationObserver(documentObserverCallback);
|
|
2995
3010
|
// watch for anchor being removed from the DOM
|
|
2996
|
-
|
|
3011
|
+
documentObserver.observe(document.body, {
|
|
3012
|
+
childList: true,
|
|
3013
|
+
subtree: true,
|
|
3014
|
+
attributes: true,
|
|
3015
|
+
attributeFilter: ['data-tooltip-id'],
|
|
3016
|
+
});
|
|
2997
3017
|
return () => {
|
|
2998
|
-
|
|
2999
|
-
if (events.find((event) => event === 'click')) {
|
|
3000
|
-
window.removeEventListener('click', handleClickOutsideAnchors);
|
|
3001
|
-
}
|
|
3002
|
-
if (closeOnEsc) {
|
|
3003
|
-
window.removeEventListener('keydown', handleEsc);
|
|
3004
|
-
}
|
|
3005
|
-
if (clickable) {
|
|
3006
|
-
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', handleMouseEnterTooltip);
|
|
3007
|
-
(_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', handleMouseLeaveTooltip);
|
|
3008
|
-
}
|
|
3009
|
-
enabledEvents.forEach(({ event, listener }) => {
|
|
3010
|
-
elementRefs.forEach((ref) => {
|
|
3011
|
-
var _a;
|
|
3012
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, listener);
|
|
3013
|
-
});
|
|
3014
|
-
});
|
|
3015
|
-
parentObserver.disconnect();
|
|
3018
|
+
documentObserver.disconnect();
|
|
3016
3019
|
};
|
|
3017
|
-
|
|
3018
|
-
* rendered is also a dependency to ensure anchor observers are re-registered
|
|
3019
|
-
* since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM
|
|
3020
|
-
*/
|
|
3021
|
-
}, [
|
|
3022
|
-
rendered,
|
|
3023
|
-
anchorRefs,
|
|
3024
|
-
activeAnchor,
|
|
3025
|
-
anchorsBySelect,
|
|
3026
|
-
closeOnEsc,
|
|
3027
|
-
events,
|
|
3028
|
-
delayHide,
|
|
3029
|
-
delayShow,
|
|
3030
|
-
]);
|
|
3020
|
+
}, [id, anchorSelect, activeAnchor]);
|
|
3031
3021
|
useEffect(() => {
|
|
3032
3022
|
if (position) {
|
|
3033
3023
|
// if `position` is set, override regular and `float` positioning
|
|
@@ -3092,6 +3082,23 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
|
|
|
3092
3082
|
}
|
|
3093
3083
|
};
|
|
3094
3084
|
}, []);
|
|
3085
|
+
useEffect(() => {
|
|
3086
|
+
let selector = anchorSelect;
|
|
3087
|
+
if (!selector && id) {
|
|
3088
|
+
selector = `[data-tooltip-id='${id}']`;
|
|
3089
|
+
}
|
|
3090
|
+
if (!selector) {
|
|
3091
|
+
return;
|
|
3092
|
+
}
|
|
3093
|
+
try {
|
|
3094
|
+
const anchors = Array.from(document.querySelectorAll(selector));
|
|
3095
|
+
setAnchorsBySelect(anchors);
|
|
3096
|
+
}
|
|
3097
|
+
catch (_a) {
|
|
3098
|
+
// warning was already issued in the controller
|
|
3099
|
+
setAnchorsBySelect([]);
|
|
3100
|
+
}
|
|
3101
|
+
}, [id, anchorSelect]);
|
|
3095
3102
|
const hasContentOrChildren = Boolean(html || content || children);
|
|
3096
3103
|
const canShow = hasContentOrChildren && show && Object.keys(inlineStyles).length > 0;
|
|
3097
3104
|
return rendered ? (jsxRuntime.exports.jsxs(WrapperElement, { id: id, role: "tooltip", className: classNames('react-tooltip', styles['tooltip'], styles[variant], className, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{createContext as t,useState as n,useCallback as r,useMemo as o,useContext as i,useRef as l,useEffect as a,useLayoutEffect as c}from"react";function s(e){return e.split("-")[1]}function u(e){return"y"===e?"height":"width"}function f(e){return e.split("-")[0]}function d(e){return["top","bottom"].includes(f(e))?"x":"y"}function p(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,a=d(t),c=u(a),p=r[c]/2-o[c]/2,y="x"===a;let m;switch(f(t)){case"top":m={x:i,y:r.y-o.height};break;case"bottom":m={x:i,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-o.width,y:l};break;default:m={x:r.x,y:r.y}}switch(s(t)){case"start":m[a]-=p*(n&&y?-1:1);break;case"end":m[a]+=p*(n&&y?-1:1)}return m}function y(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function m(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function h(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=y(p),g=a[d?"floating"===f?"reference":"floating":f],v=m(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:s,rootBoundary:u,strategy:c})),w="floating"===f?{...l.floating,x:r,y:o}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},R=m(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:c}):w);return{top:(v.top-R.top+h.top)/x.y,bottom:(R.bottom-v.bottom+h.bottom)/x.y,left:(v.left-R.left+h.left)/x.x,right:(R.right-v.right+h.right)/x.x}}const g=Math.min,v=Math.max;function w(e,t,n){return v(e,g(t,n))}const b=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),x={left:"right",right:"left",bottom:"top",top:"bottom"};function R(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}function _(e,t,n){void 0===n&&(n=!1);const r=s(e),o=d(e),i=u(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=R(l)),{main:l,cross:R(l)}}const T={start:"end",end:"start"};function S(e){return e.replace(/start|end/g,(e=>T[e]))}const O=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:l,placement:a,platform:c,elements:u}=t,{alignment:d,allowedPlacements:p=b,autoAlignment:y=!0,...m}=e,g=void 0!==d||p===b?function(e,t,n){return(e?[...n.filter((t=>s(t)===e)),...n.filter((t=>s(t)!==e))]:n.filter((e=>f(e)===e))).filter((n=>!e||s(n)===e||!!t&&S(n)!==n))}(d||null,y,p):p,v=await h(t,m),w=(null==(n=l.autoPlacement)?void 0:n.index)||0,x=g[w];if(null==x)return{};const{main:R,cross:T}=_(x,i,await(null==c.isRTL?void 0:c.isRTL(u.floating)));if(a!==x)return{reset:{placement:g[0]}};const O=[v[f(x)],v[R],v[T]],A=[...(null==(r=l.autoPlacement)?void 0:r.overflows)||[],{placement:x,overflows:O}],k=g[w+1];if(k)return{data:{index:w+1,overflows:A},reset:{placement:k}};const E=A.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),j=null==(o=E.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:o.placement,L=j||E[0].placement;return L!==a?{data:{index:w+1,overflows:A},reset:{placement:L}}:{}}}};const A=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=e,w=f(r),b=f(l)===l,x=await(null==a.isRTL?void 0:a.isRTL(c.floating)),T=p||(b||!g?[R(l)]:function(e){const t=R(e);return[S(e),t,S(t)]}(l));p||"none"===m||T.push(...function(e,t,n,r){const o=s(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(f(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(S)))),i}(l,g,m,x));const O=[l,...T],A=await h(t,v),k=[];let E=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&k.push(A[w]),d){const{main:e,cross:t}=_(r,i,x);k.push(A[e],A[t])}if(E=[...E,{placement:r,overflows:k}],!k.every((e=>e<=0))){var j,L;const e=((null==(j=o.flip)?void 0:j.index)||0)+1,t=O[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(L=E.find((e=>e.overflows[0]<=0)))?void 0:L.placement;if(!n)switch(y){case"bestFit":{var P;const e=null==(P=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}},k=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:l}=t,{padding:a=2,x:c,y:s}=e,u=m(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:o.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(r.floating)),strategy:l}):o.reference),p=await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[],h=y(a);const w=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=c&&null!=s)return p.find((e=>c>e.left-h.left&&c<e.right+h.right&&s>e.top-h.top&&s<e.bottom+h.bottom))||u;if(p.length>=2){if("x"===d(n)){const e=p[0],t=p[p.length-1],r="top"===f(n),o=e.top,i=t.bottom,l=r?e.left:t.left,a=r?e.right:t.right;return{top:o,bottom:i,left:l,right:a,width:a-l,height:i-o,x:l,y:o}}const e="left"===f(n),t=v(...p.map((e=>e.right))),r=g(...p.map((e=>e.left))),o=p.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,l=o[o.length-1].bottom;return{top:i,bottom:l,left:r,right:t,width:t-r,height:l-i,x:r,y:i}}return u}},floating:r.floating,strategy:l});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};const E=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=f(n),a=s(n),c="x"===d(n),u=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return a&&"number"==typeof g&&(h="end"===a?-1*g:g),c?{x:h*p,y:m*u}:{x:m*u,y:h*p}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const j=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,s={x:n,y:r},u=await h(t,c),p=d(f(o)),y="x"===p?"y":"x";let m=s[p],g=s[y];if(i){const e="y"===p?"bottom":"right";m=w(m+u["y"===p?"top":"left"],m,m-u[e])}if(l){const e="y"===y?"bottom":"right";g=w(g+u["y"===y?"top":"left"],g,g-u[e])}const v=a.fn({...t,[p]:m,[y]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},L=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:l=(()=>{}),...a}=e,c=await h(t,a),u=f(n),d=s(n);let p,y;"top"===u||"bottom"===u?(p=u,y=d===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,p="end"===d?"top":"bottom");const m=v(c.left,0),g=v(c.right,0),w=v(c.top,0),b=v(c.bottom,0),x={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:v(c.top,c.bottom)):c[p]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(0!==m||0!==g?m+g:v(c.left,c.right)):c[y])};await l({...t,...x});const R=await o.getDimensions(i.floating);return r.floating.width!==R.width||r.floating.height!==R.height?{reset:{rects:!0}}:{}}}};function P(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function D(e){return P(e).getComputedStyle(e)}const N=Math.min,$=Math.max,F=Math.round;function C(e){const t=D(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,l=F(n)!==o||F(r)!==i;return l&&(n=o,r=i),{width:n,height:r,fallback:l}}function I(e){return M(e)?(e.nodeName||"").toLowerCase():""}let W;function H(){if(W)return W;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(W=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),W):navigator.userAgent}function U(e){return e instanceof P(e).HTMLElement}function B(e){return e instanceof P(e).Element}function M(e){return e instanceof P(e).Node}function V(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof P(e).ShadowRoot||e instanceof ShadowRoot}function q(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=D(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function z(e){return["table","td","th"].includes(I(e))}function Y(e){const t=/firefox/i.test(H()),n=D(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function X(){return!/^((?!chrome|android).)*safari/i.test(H())}function K(e){return["html","body","#document"].includes(I(e))}function J(e){return B(e)?e:e.contextElement}const Z={x:1,y:1};function G(e){const t=J(e);if(!U(t))return Z;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=C(t);let l=(i?F(n.width):n.width)/r,a=(i?F(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function Q(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),a=J(e);let c=Z;t&&(r?B(r)&&(c=G(r)):c=G(e));const s=a?P(a):window,u=!X()&&n;let f=(l.left+(u&&(null==(o=s.visualViewport)?void 0:o.offsetLeft)||0))/c.x,d=(l.top+(u&&(null==(i=s.visualViewport)?void 0:i.offsetTop)||0))/c.y,p=l.width/c.x,y=l.height/c.y;if(a){const e=P(a),t=r&&B(r)?P(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=G(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,d*=e.y,p*=e.x,y*=e.y,f+=t.x,d+=t.y,n=P(n).frameElement}}return{width:p,height:y,top:d,right:f+p,bottom:d+y,left:f,x:f,y:d}}function ee(e){return((M(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return B(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(e){return Q(ee(e)).left+te(e).scrollLeft}function re(e){if("html"===I(e))return e;const t=e.assignedSlot||e.parentNode||V(e)&&e.host||ee(e);return V(t)?t.host:t}function oe(e){const t=re(e);return K(t)?t.ownerDocument.body:U(t)&&q(t)?t:oe(t)}function ie(e,t){var n;void 0===t&&(t=[]);const r=oe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=P(r);return o?t.concat(i,i.visualViewport||[],q(r)?r:[]):t.concat(r,ie(r))}function le(e,t,n){return"viewport"===t?m(function(e,t){const n=P(e),r=ee(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,c=0;if(o){i=o.width,l=o.height;const e=X();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:a,y:c}}(e,n)):B(t)?m(function(e,t){const n=Q(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=U(e)?G(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):m(function(e){const t=ee(e),n=te(e),r=e.ownerDocument.body,o=$(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=$(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ne(e);const a=-n.scrollTop;return"rtl"===D(r).direction&&(l+=$(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(ee(e)))}function ae(e){return U(e)&&"fixed"!==D(e).position?e.offsetParent:null}function ce(e){const t=P(e);let n=ae(e);for(;n&&z(n)&&"static"===D(n).position;)n=ae(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===D(n).position&&!Y(n))?t:n||function(e){let t=re(e);for(;U(t)&&!K(t);){if(Y(t))return t;t=re(t)}return null}(e)||t}function se(e,t,n){const r=U(t),o=ee(t),i=Q(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==I(t)||q(o))&&(l=te(t)),U(t)){const e=Q(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=ne(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const ue={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ie(e).filter((e=>B(e)&&"body"!==I(e))),o=null;const i="fixed"===D(e).position;let l=i?re(e):e;for(;B(l)&&!K(l);){const e=D(l),t=Y(l);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=re(l)}return t.set(e,r),r}(t,this._c):[].concat(n),l=[...i,r],a=l[0],c=l.reduce(((e,n)=>{const r=le(t,n,o);return e.top=$(r.top,e.top),e.right=N(r.right,e.right),e.bottom=N(r.bottom,e.bottom),e.left=$(r.left,e.left),e}),le(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=U(n),i=ee(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==I(n)||q(i))&&(l=te(n)),U(n))){const e=Q(n);a=G(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+c.x,y:t.y*a.y-l.scrollTop*a.y+c.y}},isElement:B,getDimensions:function(e){return U(e)?C(e):e.getBoundingClientRect()},getOffsetParent:ce,getDocumentElement:ee,getScale:G,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ce,i=this.getDimensions;return{reference:se(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===D(e).direction},fe=(e,t,n)=>{const r=new Map,o={platform:ue,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=p(s,r,c),d=r,y={},m=0;for(let n=0;n<a.length;n++){const{name:i,fn:h}=a[n],{x:g,y:v,data:w,reset:b}=await h({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:y,rects:s,platform:l,elements:{reference:e,floating:t}});u=null!=g?g:u,f=null!=v?v:f,y={...y,[i]:{...y[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:f}=p(s,d,c))),n=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:y}})(e,t,{...o,platform:i})};var de,pe={exports:{}},ye={};
|
|
1
|
+
import e,{createContext as t,useState as n,useCallback as r,useMemo as o,useContext as i,useRef as l,useEffect as a,useLayoutEffect as c}from"react";function s(e){return e.split("-")[1]}function u(e){return"y"===e?"height":"width"}function f(e){return e.split("-")[0]}function d(e){return["top","bottom"].includes(f(e))?"x":"y"}function p(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,a=d(t),c=u(a),p=r[c]/2-o[c]/2,y="x"===a;let m;switch(f(t)){case"top":m={x:i,y:r.y-o.height};break;case"bottom":m={x:i,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-o.width,y:l};break;default:m={x:r.x,y:r.y}}switch(s(t)){case"start":m[a]-=p*(n&&y?-1:1);break;case"end":m[a]+=p*(n&&y?-1:1)}return m}function y(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function m(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function h(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=y(p),g=a[d?"floating"===f?"reference":"floating":f],v=m(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:s,rootBoundary:u,strategy:c})),w="floating"===f?{...l.floating,x:r,y:o}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},R=m(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:c}):w);return{top:(v.top-R.top+h.top)/x.y,bottom:(R.bottom-v.bottom+h.bottom)/x.y,left:(v.left-R.left+h.left)/x.x,right:(R.right-v.right+h.right)/x.x}}const g=Math.min,v=Math.max;function w(e,t,n){return v(e,g(t,n))}const b=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),x={left:"right",right:"left",bottom:"top",top:"bottom"};function R(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}function _(e,t,n){void 0===n&&(n=!1);const r=s(e),o=d(e),i=u(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=R(l)),{main:l,cross:R(l)}}const T={start:"end",end:"start"};function S(e){return e.replace(/start|end/g,(e=>T[e]))}const A=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:l,placement:a,platform:c,elements:u}=t,{alignment:d,allowedPlacements:p=b,autoAlignment:y=!0,...m}=e,g=void 0!==d||p===b?function(e,t,n){return(e?[...n.filter((t=>s(t)===e)),...n.filter((t=>s(t)!==e))]:n.filter((e=>f(e)===e))).filter((n=>!e||s(n)===e||!!t&&S(n)!==n))}(d||null,y,p):p,v=await h(t,m),w=(null==(n=l.autoPlacement)?void 0:n.index)||0,x=g[w];if(null==x)return{};const{main:R,cross:T}=_(x,i,await(null==c.isRTL?void 0:c.isRTL(u.floating)));if(a!==x)return{reset:{placement:g[0]}};const A=[v[f(x)],v[R],v[T]],O=[...(null==(r=l.autoPlacement)?void 0:r.overflows)||[],{placement:x,overflows:A}],k=g[w+1];if(k)return{data:{index:w+1,overflows:O},reset:{placement:k}};const E=O.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),j=null==(o=E.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:o.placement,L=j||E[0].placement;return L!==a?{data:{index:w+1,overflows:O},reset:{placement:L}}:{}}}};const O=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=e,w=f(r),b=f(l)===l,x=await(null==a.isRTL?void 0:a.isRTL(c.floating)),T=p||(b||!g?[R(l)]:function(e){const t=R(e);return[S(e),t,S(t)]}(l));p||"none"===m||T.push(...function(e,t,n,r){const o=s(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(f(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(S)))),i}(l,g,m,x));const A=[l,...T],O=await h(t,v),k=[];let E=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&k.push(O[w]),d){const{main:e,cross:t}=_(r,i,x);k.push(O[e],O[t])}if(E=[...E,{placement:r,overflows:k}],!k.every((e=>e<=0))){var j,L;const e=((null==(j=o.flip)?void 0:j.index)||0)+1,t=A[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(L=E.find((e=>e.overflows[0]<=0)))?void 0:L.placement;if(!n)switch(y){case"bestFit":{var P;const e=null==(P=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}},k=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:l}=t,{padding:a=2,x:c,y:s}=e,u=m(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:o.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(r.floating)),strategy:l}):o.reference),p=await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[],h=y(a);const w=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=c&&null!=s)return p.find((e=>c>e.left-h.left&&c<e.right+h.right&&s>e.top-h.top&&s<e.bottom+h.bottom))||u;if(p.length>=2){if("x"===d(n)){const e=p[0],t=p[p.length-1],r="top"===f(n),o=e.top,i=t.bottom,l=r?e.left:t.left,a=r?e.right:t.right;return{top:o,bottom:i,left:l,right:a,width:a-l,height:i-o,x:l,y:o}}const e="left"===f(n),t=v(...p.map((e=>e.right))),r=g(...p.map((e=>e.left))),o=p.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,l=o[o.length-1].bottom;return{top:i,bottom:l,left:r,right:t,width:t-r,height:l-i,x:r,y:i}}return u}},floating:r.floating,strategy:l});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};const E=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=f(n),a=s(n),c="x"===d(n),u=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return a&&"number"==typeof g&&(h="end"===a?-1*g:g),c?{x:h*p,y:m*u}:{x:m*u,y:h*p}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const j=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,s={x:n,y:r},u=await h(t,c),p=d(f(o)),y="x"===p?"y":"x";let m=s[p],g=s[y];if(i){const e="y"===p?"bottom":"right";m=w(m+u["y"===p?"top":"left"],m,m-u[e])}if(l){const e="y"===y?"bottom":"right";g=w(g+u["y"===y?"top":"left"],g,g-u[e])}const v=a.fn({...t,[p]:m,[y]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},L=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:l=(()=>{}),...a}=e,c=await h(t,a),u=f(n),d=s(n);let p,y;"top"===u||"bottom"===u?(p=u,y=d===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,p="end"===d?"top":"bottom");const m=v(c.left,0),g=v(c.right,0),w=v(c.top,0),b=v(c.bottom,0),x={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:v(c.top,c.bottom)):c[p]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(0!==m||0!==g?m+g:v(c.left,c.right)):c[y])};await l({...t,...x});const R=await o.getDimensions(i.floating);return r.floating.width!==R.width||r.floating.height!==R.height?{reset:{rects:!0}}:{}}}};function P(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function D(e){return P(e).getComputedStyle(e)}const N=Math.min,F=Math.max,$=Math.round;function C(e){const t=D(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,l=$(n)!==o||$(r)!==i;return l&&(n=o,r=i),{width:n,height:r,fallback:l}}function I(e){return M(e)?(e.nodeName||"").toLowerCase():""}let W;function H(){if(W)return W;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(W=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),W):navigator.userAgent}function U(e){return e instanceof P(e).HTMLElement}function B(e){return e instanceof P(e).Element}function M(e){return e instanceof P(e).Node}function V(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof P(e).ShadowRoot||e instanceof ShadowRoot}function q(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=D(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function z(e){return["table","td","th"].includes(I(e))}function Y(e){const t=/firefox/i.test(H()),n=D(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function X(){return!/^((?!chrome|android).)*safari/i.test(H())}function K(e){return["html","body","#document"].includes(I(e))}function J(e){return B(e)?e:e.contextElement}const Z={x:1,y:1};function G(e){const t=J(e);if(!U(t))return Z;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=C(t);let l=(i?$(n.width):n.width)/r,a=(i?$(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function Q(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),a=J(e);let c=Z;t&&(r?B(r)&&(c=G(r)):c=G(e));const s=a?P(a):window,u=!X()&&n;let f=(l.left+(u&&(null==(o=s.visualViewport)?void 0:o.offsetLeft)||0))/c.x,d=(l.top+(u&&(null==(i=s.visualViewport)?void 0:i.offsetTop)||0))/c.y,p=l.width/c.x,y=l.height/c.y;if(a){const e=P(a),t=r&&B(r)?P(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=G(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,d*=e.y,p*=e.x,y*=e.y,f+=t.x,d+=t.y,n=P(n).frameElement}}return{width:p,height:y,top:d,right:f+p,bottom:d+y,left:f,x:f,y:d}}function ee(e){return((M(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return B(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(e){return Q(ee(e)).left+te(e).scrollLeft}function re(e){if("html"===I(e))return e;const t=e.assignedSlot||e.parentNode||V(e)&&e.host||ee(e);return V(t)?t.host:t}function oe(e){const t=re(e);return K(t)?t.ownerDocument.body:U(t)&&q(t)?t:oe(t)}function ie(e,t){var n;void 0===t&&(t=[]);const r=oe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=P(r);return o?t.concat(i,i.visualViewport||[],q(r)?r:[]):t.concat(r,ie(r))}function le(e,t,n){return"viewport"===t?m(function(e,t){const n=P(e),r=ee(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,c=0;if(o){i=o.width,l=o.height;const e=X();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:a,y:c}}(e,n)):B(t)?m(function(e,t){const n=Q(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=U(e)?G(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):m(function(e){const t=ee(e),n=te(e),r=e.ownerDocument.body,o=F(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=F(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ne(e);const a=-n.scrollTop;return"rtl"===D(r).direction&&(l+=F(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(ee(e)))}function ae(e){return U(e)&&"fixed"!==D(e).position?e.offsetParent:null}function ce(e){const t=P(e);let n=ae(e);for(;n&&z(n)&&"static"===D(n).position;)n=ae(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===D(n).position&&!Y(n))?t:n||function(e){let t=re(e);for(;U(t)&&!K(t);){if(Y(t))return t;t=re(t)}return null}(e)||t}function se(e,t,n){const r=U(t),o=ee(t),i=Q(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==I(t)||q(o))&&(l=te(t)),U(t)){const e=Q(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=ne(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const ue={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ie(e).filter((e=>B(e)&&"body"!==I(e))),o=null;const i="fixed"===D(e).position;let l=i?re(e):e;for(;B(l)&&!K(l);){const e=D(l),t=Y(l);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=re(l)}return t.set(e,r),r}(t,this._c):[].concat(n),l=[...i,r],a=l[0],c=l.reduce(((e,n)=>{const r=le(t,n,o);return e.top=F(r.top,e.top),e.right=N(r.right,e.right),e.bottom=N(r.bottom,e.bottom),e.left=F(r.left,e.left),e}),le(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=U(n),i=ee(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==I(n)||q(i))&&(l=te(n)),U(n))){const e=Q(n);a=G(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+c.x,y:t.y*a.y-l.scrollTop*a.y+c.y}},isElement:B,getDimensions:function(e){return U(e)?C(e):e.getBoundingClientRect()},getOffsetParent:ce,getDocumentElement:ee,getScale:G,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ce,i=this.getDimensions;return{reference:se(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===D(e).direction},fe=(e,t,n)=>{const r=new Map,o={platform:ue,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=p(s,r,c),d=r,y={},m=0;for(let n=0;n<a.length;n++){const{name:i,fn:h}=a[n],{x:g,y:v,data:w,reset:b}=await h({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:y,rects:s,platform:l,elements:{reference:e,floating:t}});u=null!=g?g:u,f=null!=v?v:f,y={...y,[i]:{...y[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:f}=p(s,d,c))),n=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:y}})(e,t,{...o,platform:i})};var de,pe={exports:{}},ye={};
|
|
2
2
|
/** @license React v16.14.0
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -7,9 +7,9 @@ import e,{createContext as t,useState as n,useCallback as r,useMemo as o,useCont
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
de=ye,function(){var t=e,n=60103,r=60106;de.Fragment=60107;var o=60108,i=60114,l=60109,a=60110,c=60112,s=60113,u=60120,f=60115,d=60116,p=60121,y=60122,m=60117,h=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var v=Symbol.for;n=v("react.element"),r=v("react.portal"),de.Fragment=v("react.fragment"),o=v("react.strict_mode"),i=v("react.profiler"),l=v("react.provider"),a=v("react.context"),c=v("react.forward_ref"),s=v("react.suspense"),u=v("react.suspense_list"),f=v("react.memo"),d=v("react.lazy"),p=v("react.block"),y=v("react.server.block"),m=v("react.fundamental"),v("react.scope"),v("react.opaque.id"),h=v("react.debug_trace_mode"),v("react.offscreen"),g=v("react.legacy_hidden")}var w="function"==typeof Symbol&&Symbol.iterator,b=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];R("error",e,n)}function R(e,t,n){var r=b.ReactDebugCurrentFrame,o="";if(
|
|
10
|
+
de=ye,function(){var t=e,n=60103,r=60106;de.Fragment=60107;var o=60108,i=60114,l=60109,a=60110,c=60112,s=60113,u=60120,f=60115,d=60116,p=60121,y=60122,m=60117,h=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var v=Symbol.for;n=v("react.element"),r=v("react.portal"),de.Fragment=v("react.fragment"),o=v("react.strict_mode"),i=v("react.profiler"),l=v("react.provider"),a=v("react.context"),c=v("react.forward_ref"),s=v("react.suspense"),u=v("react.suspense_list"),f=v("react.memo"),d=v("react.lazy"),p=v("react.block"),y=v("react.server.block"),m=v("react.fundamental"),v("react.scope"),v("react.opaque.id"),h=v("react.debug_trace_mode"),v("react.offscreen"),g=v("react.legacy_hidden")}var w="function"==typeof Symbol&&Symbol.iterator,b=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];R("error",e,n)}function R(e,t,n){var r=b.ReactDebugCurrentFrame,o="";if(A){var i=T(A.type),l=A._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(_,"");if(/^index\./.test(i)){var l=o.match(_);if(l){var a=l[1];a&&(i=a.replace(_,"")+"/"+i)}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,A._source,l&&T(l.type))}""!==(o+=r.getStackAddendum())&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return""+e}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}var _=/^(.*)[\\\/]/;function T(e){if(null==e)return null;if("number"==typeof e.tag&&x("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case de.Fragment:return"Fragment";case r:return"Portal";case i:return"Profiler";case o:return"StrictMode";case s:return"Suspense";case u:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case a:return"Context.Consumer";case l:return"Context.Provider";case c:return y=e,m=e.render,h="ForwardRef",g=m.displayName||m.name||"",y.displayName||(""!==g?h+"("+g+")":h);case f:return T(e.type);case p:return T(e.render);case d:var t=1===(n=e)._status?n._result:null;if(t)return T(t)}var n,y,m,h,g;return null}var S={};b.ReactDebugCurrentFrame;var A=null;function O(e){A=e}var k,E,j,L=b.ReactCurrentOwner,P=Object.prototype.hasOwnProperty,D={key:!0,ref:!0,__self:!0,__source:!0};function N(e,t,r,o,i){var l,a={},c=null,s=null;for(l in void 0!==r&&(c=""+r),function(e){if(P.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(c=""+t.key),function(e){if(P.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&L.current&&t&&L.current.stateNode!==t){var n=T(L.current.type);j[n]||(x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(L.current.type),e.ref),j[n]=!0)}}(t,i)),t)P.call(t,l)&&!D.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var u=e.defaultProps;for(l in u)void 0===a[l]&&(a[l]=u[l])}if(c||s){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){k||(k=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,f),s&&function(e,t){var n=function(){E||(E=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,f)}return function(e,t,r,o,i,l,a){var c={$$typeof:n,type:e,key:t,ref:r,props:a,_owner:l,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,s,i,o,L.current,a)}j={};var F,$=b.ReactCurrentOwner;function C(e){A=e}function I(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function W(){if($.current){var e=T($.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}b.ReactDebugCurrentFrame,F=!1;var H={};function U(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=W();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!H[n]){H[n]=!0;var r="";e&&e._owner&&e._owner!==$.current&&(r=" It was passed a child from "+T(e._owner.type)+"."),C(e),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),C(null)}}}function B(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];I(r)&&U(r,t)}else if(I(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=w&&e[w]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,l=o.call(e);!(i=l.next()).done;)I(i.value)&&U(i.value,t)}}function M(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==c&&n.$$typeof!==f)return;t=n.propTypes}if(t){var r=T(n);!function(e,t,n,r,o){var i=Function.call.bind(Object.prototype.hasOwnProperty);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var c=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}a=e[l](t,l,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(O(o),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,l,typeof a),O(null)),a instanceof Error&&!(a.message in S)&&(S[a.message]=!0,O(o),x("Failed %s type: %s",n,a.message),O(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||F||(F=!0,x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function V(e,t,r,v,w,b){var R=function(e){return"string"==typeof e||"function"==typeof e||e===de.Fragment||e===i||e===h||e===o||e===s||e===u||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===f||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===m||e.$$typeof===p||e[0]===y)}(e);if(!R){var _="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var S,A=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(w);_+=A||W(),null===e?S="null":Array.isArray(e)?S="array":void 0!==e&&e.$$typeof===n?(S="<"+(T(e.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):S=typeof e,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,_)}var O=N(e,t,r,w,b);if(null==O)return O;if(R){var k=t.children;if(void 0!==k)if(v)if(Array.isArray(k)){for(var E=0;E<k.length;E++)B(k[E],e);Object.freeze&&Object.freeze(k)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else B(k,e)}return e===de.Fragment?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){C(e),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),C(null);break}}null!==e.ref&&(C(e),x("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}(O):M(O),O}var q=function(e,t,n){return V(e,t,n,!1)},z=function(e,t,n){return V(e,t,n,!0)};de.jsx=q,de.jsxs=z}(),pe.exports=ye;var me,he={exports:{}};
|
|
11
11
|
/*!
|
|
12
12
|
Copyright (c) 2018 Jed Watson.
|
|
13
13
|
Licensed under the MIT License (MIT), see
|
|
14
14
|
http://jedwatson.github.io/classnames
|
|
15
|
-
*/me=he,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}}return n.join(" ")}me.exports?(t.default=t,me.exports=t):window.classNames=t}();var ge=he.exports;const ve=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},we=({content:e})=>pe.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),be={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},xe=t({getTooltipData:()=>be}),Re=({children:e})=>{const[t,i]=n({DEFAULT_TOOLTIP_ID:new Set}),[l,a]=n({DEFAULT_TOOLTIP_ID:{current:null}}),c=(e,...t)=>{i((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},s=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},u=r(((e="DEFAULT_TOOLTIP_ID")=>{var n,r;return{anchorRefs:null!==(n=t[e])&&void 0!==n?n:new Set,activeAnchor:null!==(r=l[e])&&void 0!==r?r:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>s(e,...t),setActiveAnchor:t=>((e,t)=>{a((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[t,l,c,s]),f=o((()=>({getTooltipData:u})),[u]);return pe.exports.jsx(xe.Provider,{value:f,children:e})};function _e(e="DEFAULT_TOOLTIP_ID"){return i(xe).getTooltipData(e)}const Te=({tooltipId:e,children:t,className:n,place:r,content:o,html:i,variant:c,offset:s,wrapper:u,events:f,positionStrategy:d,delayShow:p,delayHide:y})=>{const{attach:m,detach:h}=_e(e),g=l(null);return a((()=>(m(g),()=>{h(g)})),[]),pe.exports.jsx("span",{ref:g,className:ge("react-tooltip-wrapper",n),"data-tooltip-place":r,"data-tooltip-content":o,"data-tooltip-html":i,"data-tooltip-variant":c,"data-tooltip-offset":s,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":d,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":y,children:t})},Se=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute",middlewares:l=[E(Number(o)),A(),j({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=l;return n?(a.push({name:"arrow",options:c={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=c||{},{x:r,y:o,placement:i,rects:l,platform:a}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const f=y(n),p={x:r,y:o},m=d(i),h=u(m),g=await a.getDimensions(t),v="y"===m?"top":"left",b="y"===m?"bottom":"right",x=l.reference[h]+l.reference[m]-p[m]-l.floating[h],R=p[m]-l.reference[m],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(t));let T=_?"y"===m?_.clientHeight||0:_.clientWidth||0:0;0===T&&(T=l.floating[h]);const S=x/2-R/2,O=f[v],A=T-g[h]-f[b],k=T/2-g[h]/2+S,E=w(O,k,A),j=null!=s(i)&&k!=E&&l.reference[h]/2-(k<O?f[v]:f[b])-g[h]/2<0;return{[m]:p[m]-(j?k<O?O-k:A-k:0),data:{[m]:E,centerOffset:k-E}}}}),fe(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:c}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):fe(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var c};var Oe={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const Ae=({id:e,className:t,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:s,place:u="top",offset:f=10,events:d=["hover"],positionStrategy:p="absolute",middlewares:y,wrapper:m,children:h=null,delayShow:g=0,delayHide:v=0,float:w=!1,noArrow:b=!1,clickable:x=!1,closeOnEsc:R=!1,style:_,position:T,afterShow:S,afterHide:O,content:A,html:k,isOpen:E,setIsOpen:j,activeAnchor:L,setActiveAnchor:P})=>{const D=l(null),N=l(null),$=l(null),F=l(null),[C,I]=n({}),[W,H]=n({}),[U,B]=n(!1),[M,V]=n(!1),q=l(!1),z=l(null),{anchorRefs:Y,setActiveAnchor:X}=_e(e),K=l(!1),[J,Z]=n([]),G=l(!1);a((()=>{let t=s;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));Z(e)}catch(e){Z([])}}),[s,L]),c((()=>(G.current=!0,()=>{G.current=!1})),[]),a((()=>{if(!U){const e=setTimeout((()=>{V(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[U]);const Q=e=>{G.current&&(e&&V(!0),setTimeout((()=>{G.current&&(null==j||j(e),void 0===E&&B(e))}),10))};a((()=>{if(void 0===E)return()=>null;E&&V(!0);const e=setTimeout((()=>{B(E)}),10);return()=>{clearTimeout(e)}}),[E]),a((()=>{U!==q.current&&(q.current=U,U?null==S||S():null==O||O())}),[U]);const ee=(e=v)=>{F.current&&clearTimeout(F.current),F.current=setTimeout((()=>{K.current||Q(!1)}),e)},te=e=>{var t;if(!e)return;g?($.current&&clearTimeout($.current),$.current=setTimeout((()=>{Q(!0)}),g)):Q(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;P(n),X({current:n}),F.current&&clearTimeout(F.current)},ne=()=>{x?ee(v||100):v?ee():Q(!1),$.current&&clearTimeout($.current)},re=({x:e,y:t})=>{Se({place:u,offset:f,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:D.current,tooltipArrowReference:N.current,strategy:p,middlewares:y}).then((e=>{Object.keys(e.tooltipStyles).length&&I(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&H(e.tooltipArrowStyles)}))},oe=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};re(n),z.current=n},ie=e=>{te(e),v&&ee()},le=e=>{const t=document.querySelector(`[id='${i}']`);(null==t?void 0:t.contains(e.target))||J.some((t=>t.contains(e.target)))||Q(!1)},ae=e=>{"Escape"===e.key&&Q(!1)},ce=ve(te,50),se=ve(ne,50);a((()=>{var t,n;const r=new Set(Y);J.forEach((e=>{r.add({current:e})}));const o=document.querySelector(`[id='${i}']`);o&&r.add({current:o}),R&&window.addEventListener("keydown",ae);const l=[];d.find((e=>"click"===e))&&(window.addEventListener("click",le),l.push({event:"click",listener:ie})),d.find((e=>"hover"===e))&&(l.push({event:"mouseenter",listener:ce},{event:"mouseleave",listener:se},{event:"focus",listener:ce},{event:"blur",listener:se}),w&&l.push({event:"mousemove",listener:oe}));const a=()=>{K.current=!0},c=()=>{K.current=!1,ne()};x&&(null===(t=D.current)||void 0===t||t.addEventListener("mouseenter",a),null===(n=D.current)||void 0===n||n.addEventListener("mouseleave",c)),l.forEach((({event:e,listener:t})=>{r.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))}));const u=new MutationObserver((t=>{let n=null!=s?s:"";!n&&e&&(n=`[data-tooltip-id='${e}']`),t.forEach((e=>{if("childList"===e.type&&(L&&[...e.removedNodes].some((e=>!!e.contains(L)&&(V(!1),Q(!1),P(null),!0))),n))try{const t=[...e.addedNodes].filter((e=>1===e.nodeType)),r=[...t.filter((e=>e.matches(n))),...t.flatMap((e=>[...e.querySelectorAll(n)]))];r.length&&Z((e=>[...e,...r]))}catch(e){}}))}));return u.observe(document.body,{attributes:!1,childList:!0,subtree:!0}),()=>{var e,t;d.find((e=>"click"===e))&&window.removeEventListener("click",le),R&&window.removeEventListener("keydown",ae),x&&(null===(e=D.current)||void 0===e||e.removeEventListener("mouseenter",a),null===(t=D.current)||void 0===t||t.removeEventListener("mouseleave",c)),l.forEach((({event:e,listener:t})=>{r.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))})),u.disconnect()}}),[M,Y,L,J,R,d,v,g]),a((()=>{T?re(T):w?z.current&&re(z.current):Se({place:u,offset:f,elementReference:L,tooltipReference:D.current,tooltipArrowReference:N.current,strategy:p,middlewares:y}).then((e=>{G.current&&(Object.keys(e.tooltipStyles).length&&I(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&H(e.tooltipArrowStyles))}))}),[U,L,A,k,u,f,p,T]),a((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...J,t];L&&n.includes(L)||P(null!==(e=J[0])&&void 0!==e?e:t)}),[i,J,L]),a((()=>()=>{$.current&&clearTimeout($.current),F.current&&clearTimeout(F.current)}),[]);const ue=Boolean(k||A||h)&&U&&Object.keys(C).length>0;return M?pe.exports.jsxs(m,{id:e,role:"tooltip",className:ge("react-tooltip",Oe.tooltip,Oe[o],t,{[Oe.show]:ue,[Oe.fixed]:"fixed"===p,[Oe.clickable]:x}),style:{..._,...C},ref:D,children:[k&&pe.exports.jsx(we,{content:k})||A||h,pe.exports.jsx(m,{className:ge("react-tooltip-arrow",Oe.arrow,r,{[Oe["no-arrow"]]:b}),style:W,ref:N})]}):null},ke=({id:e,anchorId:t,anchorSelect:r,content:o,html:i,className:l,classNameArrow:c,variant:s="dark",place:u="top",offset:f=10,wrapper:d="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",middlewares:h,delayShow:g=0,delayHide:v=0,float:w=!1,noArrow:b=!1,clickable:x=!1,closeOnEsc:R=!1,style:_,position:T,isOpen:S,setIsOpen:O,afterShow:A,afterHide:k})=>{const[E,j]=n(o),[L,P]=n(i),[D,N]=n(u),[$,F]=n(s),[C,I]=n(f),[W,H]=n(g),[U,B]=n(v),[M,V]=n(w),[q,z]=n(d),[Y,X]=n(y),[K,J]=n(m),[Z,G]=n(null),{anchorRefs:Q,activeAnchor:ee}=_e(e),te=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),ne=e=>{const t={place:e=>{var t;N(null!==(t=e)&&void 0!==t?t:u)},content:e=>{j(null!=e?e:o)},html:e=>{P(null!=e?e:i)},variant:e=>{var t;F(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{I(null===e?f:Number(e))},wrapper:e=>{var t;z(null!==(t=e)&&void 0!==t?t:d)},events:e=>{const t=null==e?void 0:e.split(" ");X(null!=t?t:y)},"position-strategy":e=>{var t;J(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{H(null===e?g:Number(e))},"delay-hide":e=>{B(null===e?v:Number(e))},float:e=>{V(null===e?w:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};a((()=>{j(o)}),[o]),a((()=>{P(i)}),[i]),a((()=>{N(u)}),[u]),a((()=>{var n;const o=new Set(Q);let i=r;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${t}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const a=null!==(n=null!=Z?Z:l)&&void 0!==n?n:ee.current,c=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=te(a);ne(n)}))})),s={attributes:!0,childList:!1,subtree:!1};if(a){const e=te(a);ne(e),c.observe(a,s)}return()=>{c.disconnect()}}),[Q,ee,Z,t,r]);const re={id:e,anchorId:t,anchorSelect:r,className:l,classNameArrow:c,content:E,html:L,place:D,variant:$,offset:C,wrapper:q,events:Y,positionStrategy:K,middlewares:h,delayShow:W,delayHide:U,float:M,noArrow:b,clickable:x,closeOnEsc:R,style:_,position:T,isOpen:S,setIsOpen:O,afterShow:A,afterHide:k,activeAnchor:Z,setActiveAnchor:e=>G(e)};return p?pe.exports.jsx(Ae,{...re,children:p}):pe.exports.jsx(Ae,{...re})};export{ke as Tooltip,Re as TooltipProvider,Te as TooltipWrapper,O as autoPlacement,A as flip,k as inline,E as offset,j as shift,L as size};
|
|
15
|
+
*/me=he,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}}return n.join(" ")}me.exports?(t.default=t,me.exports=t):window.classNames=t}();var ge=he.exports;const ve=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},we=({content:e})=>pe.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),be={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},xe=t({getTooltipData:()=>be}),Re=({children:e})=>{const[t,i]=n({DEFAULT_TOOLTIP_ID:new Set}),[l,a]=n({DEFAULT_TOOLTIP_ID:{current:null}}),c=(e,...t)=>{i((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},s=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},u=r(((e="DEFAULT_TOOLTIP_ID")=>{var n,r;return{anchorRefs:null!==(n=t[e])&&void 0!==n?n:new Set,activeAnchor:null!==(r=l[e])&&void 0!==r?r:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>s(e,...t),setActiveAnchor:t=>((e,t)=>{a((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[t,l,c,s]),f=o((()=>({getTooltipData:u})),[u]);return pe.exports.jsx(xe.Provider,{value:f,children:e})};function _e(e="DEFAULT_TOOLTIP_ID"){return i(xe).getTooltipData(e)}const Te=({tooltipId:e,children:t,className:n,place:r,content:o,html:i,variant:c,offset:s,wrapper:u,events:f,positionStrategy:d,delayShow:p,delayHide:y})=>{const{attach:m,detach:h}=_e(e),g=l(null);return a((()=>(m(g),()=>{h(g)})),[]),pe.exports.jsx("span",{ref:g,className:ge("react-tooltip-wrapper",n),"data-tooltip-place":r,"data-tooltip-content":o,"data-tooltip-html":i,"data-tooltip-variant":c,"data-tooltip-offset":s,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":d,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":y,children:t})},Se=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute",middlewares:l=[E(Number(o)),O(),j({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=l;return n?(a.push({name:"arrow",options:c={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=c||{},{x:r,y:o,placement:i,rects:l,platform:a}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const f=y(n),p={x:r,y:o},m=d(i),h=u(m),g=await a.getDimensions(t),v="y"===m?"top":"left",b="y"===m?"bottom":"right",x=l.reference[h]+l.reference[m]-p[m]-l.floating[h],R=p[m]-l.reference[m],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(t));let T=_?"y"===m?_.clientHeight||0:_.clientWidth||0:0;0===T&&(T=l.floating[h]);const S=x/2-R/2,A=f[v],O=T-g[h]-f[b],k=T/2-g[h]/2+S,E=w(A,k,O),j=null!=s(i)&&k!=E&&l.reference[h]/2-(k<A?f[v]:f[b])-g[h]/2<0;return{[m]:p[m]-(j?k<A?A-k:O-k:0),data:{[m]:E,centerOffset:k-E}}}}),fe(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:c}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):fe(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var c};var Ae={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const Oe=({id:e,className:t,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:s,place:u="top",offset:f=10,events:d=["hover"],positionStrategy:p="absolute",middlewares:y,wrapper:m,children:h=null,delayShow:g=0,delayHide:v=0,float:w=!1,noArrow:b=!1,clickable:x=!1,closeOnEsc:R=!1,style:_,position:T,afterShow:S,afterHide:A,content:O,html:k,isOpen:E,setIsOpen:j,activeAnchor:L,setActiveAnchor:P})=>{const D=l(null),N=l(null),F=l(null),$=l(null),[C,I]=n({}),[W,H]=n({}),[U,B]=n(!1),[M,V]=n(!1),q=l(!1),z=l(null),{anchorRefs:Y,setActiveAnchor:X}=_e(e),K=l(!1),[J,Z]=n([]),G=l(!1);c((()=>(G.current=!0,()=>{G.current=!1})),[]),a((()=>{if(!U){const e=setTimeout((()=>{V(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[U]);const Q=e=>{G.current&&(e&&V(!0),setTimeout((()=>{G.current&&(null==j||j(e),void 0===E&&B(e))}),10))};a((()=>{if(void 0===E)return()=>null;E&&V(!0);const e=setTimeout((()=>{B(E)}),10);return()=>{clearTimeout(e)}}),[E]),a((()=>{U!==q.current&&(q.current=U,U?null==S||S():null==A||A())}),[U]);const ee=(e=v)=>{$.current&&clearTimeout($.current),$.current=setTimeout((()=>{K.current||Q(!1)}),e)},te=e=>{var t;if(!e)return;g?(F.current&&clearTimeout(F.current),F.current=setTimeout((()=>{Q(!0)}),g)):Q(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;P(n),X({current:n}),$.current&&clearTimeout($.current)},ne=()=>{x?ee(v||100):v?ee():Q(!1),F.current&&clearTimeout(F.current)},re=({x:e,y:t})=>{Se({place:u,offset:f,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:D.current,tooltipArrowReference:N.current,strategy:p,middlewares:y}).then((e=>{Object.keys(e.tooltipStyles).length&&I(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&H(e.tooltipArrowStyles)}))},oe=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};re(n),z.current=n},ie=e=>{te(e),v&&ee()},le=e=>{const t=document.querySelector(`[id='${i}']`);(null==t?void 0:t.contains(e.target))||J.some((t=>t.contains(e.target)))||Q(!1)},ae=e=>{"Escape"===e.key&&Q(!1)},ce=ve(te,50),se=ve(ne,50);a((()=>{var e,t;const n=new Set(Y);J.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${i}']`);r&&n.add({current:r}),R&&window.addEventListener("keydown",ae);const o=[];d.find((e=>"click"===e))&&(window.addEventListener("click",le),o.push({event:"click",listener:ie})),d.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:ce},{event:"mouseleave",listener:se},{event:"focus",listener:ce},{event:"blur",listener:se}),w&&o.push({event:"mousemove",listener:oe}));const l=()=>{K.current=!0},a=()=>{K.current=!1,ne()};return x&&(null===(e=D.current)||void 0===e||e.addEventListener("mouseenter",l),null===(t=D.current)||void 0===t||t.addEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;d.find((e=>"click"===e))&&window.removeEventListener("click",le),R&&window.removeEventListener("keydown",ae),x&&(null===(e=D.current)||void 0===e||e.removeEventListener("mouseenter",l),null===(t=D.current)||void 0===t||t.removeEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[M,Y,J,R,d]),a((()=>{let t=null!=s?s:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const n=new MutationObserver((n=>{const r=[];n.forEach((n=>{if("attributes"===n.type&&"data-tooltip-id"===n.attributeName){n.target.getAttribute("data-tooltip-id")===e&&r.push(n.target)}if("childList"===n.type&&(L&&[...n.removedNodes].some((e=>!!e.contains(L)&&(V(!1),Q(!1),P(null),!0))),t))try{const e=[...n.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&Z((e=>[...e,...r]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{n.disconnect()}}),[e,s,L]),a((()=>{T?re(T):w?z.current&&re(z.current):Se({place:u,offset:f,elementReference:L,tooltipReference:D.current,tooltipArrowReference:N.current,strategy:p,middlewares:y}).then((e=>{G.current&&(Object.keys(e.tooltipStyles).length&&I(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&H(e.tooltipArrowStyles))}))}),[U,L,O,k,u,f,p,T]),a((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...J,t];L&&n.includes(L)||P(null!==(e=J[0])&&void 0!==e?e:t)}),[i,J,L]),a((()=>()=>{F.current&&clearTimeout(F.current),$.current&&clearTimeout($.current)}),[]),a((()=>{let t=s;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));Z(e)}catch(e){Z([])}}),[e,s]);const ue=Boolean(k||O||h)&&U&&Object.keys(C).length>0;return M?pe.exports.jsxs(m,{id:e,role:"tooltip",className:ge("react-tooltip",Ae.tooltip,Ae[o],t,{[Ae.show]:ue,[Ae.fixed]:"fixed"===p,[Ae.clickable]:x}),style:{..._,...C},ref:D,children:[k&&pe.exports.jsx(we,{content:k})||O||h,pe.exports.jsx(m,{className:ge("react-tooltip-arrow",Ae.arrow,r,{[Ae["no-arrow"]]:b}),style:W,ref:N})]}):null},ke=({id:e,anchorId:t,anchorSelect:r,content:o,html:i,className:l,classNameArrow:c,variant:s="dark",place:u="top",offset:f=10,wrapper:d="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",middlewares:h,delayShow:g=0,delayHide:v=0,float:w=!1,noArrow:b=!1,clickable:x=!1,closeOnEsc:R=!1,style:_,position:T,isOpen:S,setIsOpen:A,afterShow:O,afterHide:k})=>{const[E,j]=n(o),[L,P]=n(i),[D,N]=n(u),[F,$]=n(s),[C,I]=n(f),[W,H]=n(g),[U,B]=n(v),[M,V]=n(w),[q,z]=n(d),[Y,X]=n(y),[K,J]=n(m),[Z,G]=n(null),{anchorRefs:Q,activeAnchor:ee}=_e(e),te=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),ne=e=>{const t={place:e=>{var t;N(null!==(t=e)&&void 0!==t?t:u)},content:e=>{j(null!=e?e:o)},html:e=>{P(null!=e?e:i)},variant:e=>{var t;$(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{I(null===e?f:Number(e))},wrapper:e=>{var t;z(null!==(t=e)&&void 0!==t?t:d)},events:e=>{const t=null==e?void 0:e.split(" ");X(null!=t?t:y)},"position-strategy":e=>{var t;J(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{H(null===e?g:Number(e))},"delay-hide":e=>{B(null===e?v:Number(e))},float:e=>{V(null===e?w:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};a((()=>{j(o)}),[o]),a((()=>{P(i)}),[i]),a((()=>{N(u)}),[u]),a((()=>{var n;const o=new Set(Q);let i=r;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${t}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const a=null!==(n=null!=Z?Z:l)&&void 0!==n?n:ee.current,c=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=te(a);ne(n)}))})),s={attributes:!0,childList:!1,subtree:!1};if(a){const e=te(a);ne(e),c.observe(a,s)}return()=>{c.disconnect()}}),[Q,ee,Z,t,r]);const re={id:e,anchorId:t,anchorSelect:r,className:l,classNameArrow:c,content:E,html:L,place:D,variant:F,offset:C,wrapper:q,events:Y,positionStrategy:K,middlewares:h,delayShow:W,delayHide:U,float:M,noArrow:b,clickable:x,closeOnEsc:R,style:_,position:T,isOpen:S,setIsOpen:A,afterShow:O,afterHide:k,activeAnchor:Z,setActiveAnchor:e=>G(e)};return p?pe.exports.jsx(Oe,{...re,children:p}):pe.exports.jsx(Oe,{...re})};export{ke as Tooltip,Re as TooltipProvider,Te as TooltipWrapper,A as autoPlacement,O as flip,k as inline,E as offset,j as shift,L as size};
|
|
@@ -2694,23 +2694,6 @@
|
|
|
2694
2694
|
const hoveringTooltip = require$$0.useRef(false);
|
|
2695
2695
|
const [anchorsBySelect, setAnchorsBySelect] = require$$0.useState([]);
|
|
2696
2696
|
const mounted = require$$0.useRef(false);
|
|
2697
|
-
require$$0.useEffect(() => {
|
|
2698
|
-
let selector = anchorSelect;
|
|
2699
|
-
if (!selector && id) {
|
|
2700
|
-
selector = `[data-tooltip-id='${id}']`;
|
|
2701
|
-
}
|
|
2702
|
-
if (!selector) {
|
|
2703
|
-
return;
|
|
2704
|
-
}
|
|
2705
|
-
try {
|
|
2706
|
-
const anchors = Array.from(document.querySelectorAll(selector));
|
|
2707
|
-
setAnchorsBySelect(anchors);
|
|
2708
|
-
}
|
|
2709
|
-
catch (_a) {
|
|
2710
|
-
// warning was already issued in the controller
|
|
2711
|
-
setAnchorsBySelect([]);
|
|
2712
|
-
}
|
|
2713
|
-
}, [anchorSelect, activeAnchor]);
|
|
2714
2697
|
/**
|
|
2715
2698
|
* useLayoutEffect runs before useEffect,
|
|
2716
2699
|
* but should be used carefully because of caveats
|
|
@@ -2956,12 +2939,44 @@
|
|
|
2956
2939
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener(event, listener);
|
|
2957
2940
|
});
|
|
2958
2941
|
});
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
if (
|
|
2962
|
-
|
|
2942
|
+
return () => {
|
|
2943
|
+
var _a, _b;
|
|
2944
|
+
if (events.find((event) => event === 'click')) {
|
|
2945
|
+
window.removeEventListener('click', handleClickOutsideAnchors);
|
|
2963
2946
|
}
|
|
2947
|
+
if (closeOnEsc) {
|
|
2948
|
+
window.removeEventListener('keydown', handleEsc);
|
|
2949
|
+
}
|
|
2950
|
+
if (clickable) {
|
|
2951
|
+
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', handleMouseEnterTooltip);
|
|
2952
|
+
(_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', handleMouseLeaveTooltip);
|
|
2953
|
+
}
|
|
2954
|
+
enabledEvents.forEach(({ event, listener }) => {
|
|
2955
|
+
elementRefs.forEach((ref) => {
|
|
2956
|
+
var _a;
|
|
2957
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, listener);
|
|
2958
|
+
});
|
|
2959
|
+
});
|
|
2960
|
+
};
|
|
2961
|
+
/**
|
|
2962
|
+
* rendered is also a dependency to ensure anchor observers are re-registered
|
|
2963
|
+
* since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM
|
|
2964
|
+
*/
|
|
2965
|
+
}, [rendered, anchorRefs, anchorsBySelect, closeOnEsc, events]);
|
|
2966
|
+
require$$0.useEffect(() => {
|
|
2967
|
+
let selector = anchorSelect !== null && anchorSelect !== void 0 ? anchorSelect : '';
|
|
2968
|
+
if (!selector && id) {
|
|
2969
|
+
selector = `[data-tooltip-id='${id}']`;
|
|
2970
|
+
}
|
|
2971
|
+
const documentObserverCallback = (mutationList) => {
|
|
2972
|
+
const newAnchors = [];
|
|
2964
2973
|
mutationList.forEach((mutation) => {
|
|
2974
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {
|
|
2975
|
+
const newId = mutation.target.getAttribute('data-tooltip-id');
|
|
2976
|
+
if (newId === id) {
|
|
2977
|
+
newAnchors.push(mutation.target);
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2965
2980
|
if (mutation.type !== 'childList') {
|
|
2966
2981
|
return;
|
|
2967
2982
|
}
|
|
@@ -2981,15 +2996,12 @@
|
|
|
2981
2996
|
}
|
|
2982
2997
|
try {
|
|
2983
2998
|
const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1);
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
];
|
|
2990
|
-
if (newAnchors.length) {
|
|
2991
|
-
setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
|
|
2992
|
-
}
|
|
2999
|
+
newAnchors.push(
|
|
3000
|
+
// the element itself is an anchor
|
|
3001
|
+
...elements.filter((element) => element.matches(selector)));
|
|
3002
|
+
newAnchors.push(
|
|
3003
|
+
// the element has children which are anchors
|
|
3004
|
+
...elements.flatMap((element) => [...element.querySelectorAll(selector)]));
|
|
2993
3005
|
}
|
|
2994
3006
|
catch (_a) {
|
|
2995
3007
|
/**
|
|
@@ -2998,44 +3010,22 @@
|
|
|
2998
3010
|
*/
|
|
2999
3011
|
}
|
|
3000
3012
|
});
|
|
3013
|
+
if (newAnchors.length) {
|
|
3014
|
+
setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
|
|
3015
|
+
}
|
|
3001
3016
|
};
|
|
3002
|
-
const
|
|
3017
|
+
const documentObserver = new MutationObserver(documentObserverCallback);
|
|
3003
3018
|
// watch for anchor being removed from the DOM
|
|
3004
|
-
|
|
3019
|
+
documentObserver.observe(document.body, {
|
|
3020
|
+
childList: true,
|
|
3021
|
+
subtree: true,
|
|
3022
|
+
attributes: true,
|
|
3023
|
+
attributeFilter: ['data-tooltip-id'],
|
|
3024
|
+
});
|
|
3005
3025
|
return () => {
|
|
3006
|
-
|
|
3007
|
-
if (events.find((event) => event === 'click')) {
|
|
3008
|
-
window.removeEventListener('click', handleClickOutsideAnchors);
|
|
3009
|
-
}
|
|
3010
|
-
if (closeOnEsc) {
|
|
3011
|
-
window.removeEventListener('keydown', handleEsc);
|
|
3012
|
-
}
|
|
3013
|
-
if (clickable) {
|
|
3014
|
-
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', handleMouseEnterTooltip);
|
|
3015
|
-
(_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', handleMouseLeaveTooltip);
|
|
3016
|
-
}
|
|
3017
|
-
enabledEvents.forEach(({ event, listener }) => {
|
|
3018
|
-
elementRefs.forEach((ref) => {
|
|
3019
|
-
var _a;
|
|
3020
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, listener);
|
|
3021
|
-
});
|
|
3022
|
-
});
|
|
3023
|
-
parentObserver.disconnect();
|
|
3026
|
+
documentObserver.disconnect();
|
|
3024
3027
|
};
|
|
3025
|
-
|
|
3026
|
-
* rendered is also a dependency to ensure anchor observers are re-registered
|
|
3027
|
-
* since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM
|
|
3028
|
-
*/
|
|
3029
|
-
}, [
|
|
3030
|
-
rendered,
|
|
3031
|
-
anchorRefs,
|
|
3032
|
-
activeAnchor,
|
|
3033
|
-
anchorsBySelect,
|
|
3034
|
-
closeOnEsc,
|
|
3035
|
-
events,
|
|
3036
|
-
delayHide,
|
|
3037
|
-
delayShow,
|
|
3038
|
-
]);
|
|
3028
|
+
}, [id, anchorSelect, activeAnchor]);
|
|
3039
3029
|
require$$0.useEffect(() => {
|
|
3040
3030
|
if (position) {
|
|
3041
3031
|
// if `position` is set, override regular and `float` positioning
|
|
@@ -3100,6 +3090,23 @@
|
|
|
3100
3090
|
}
|
|
3101
3091
|
};
|
|
3102
3092
|
}, []);
|
|
3093
|
+
require$$0.useEffect(() => {
|
|
3094
|
+
let selector = anchorSelect;
|
|
3095
|
+
if (!selector && id) {
|
|
3096
|
+
selector = `[data-tooltip-id='${id}']`;
|
|
3097
|
+
}
|
|
3098
|
+
if (!selector) {
|
|
3099
|
+
return;
|
|
3100
|
+
}
|
|
3101
|
+
try {
|
|
3102
|
+
const anchors = Array.from(document.querySelectorAll(selector));
|
|
3103
|
+
setAnchorsBySelect(anchors);
|
|
3104
|
+
}
|
|
3105
|
+
catch (_a) {
|
|
3106
|
+
// warning was already issued in the controller
|
|
3107
|
+
setAnchorsBySelect([]);
|
|
3108
|
+
}
|
|
3109
|
+
}, [id, anchorSelect]);
|
|
3103
3110
|
const hasContentOrChildren = Boolean(html || content || children);
|
|
3104
3111
|
const canShow = hasContentOrChildren && show && Object.keys(inlineStyles).length > 0;
|
|
3105
3112
|
return rendered ? (jsxRuntime.exports.jsxs(WrapperElement, { id: id, role: "tooltip", className: classNames('react-tooltip', styles['tooltip'], styles[variant], className, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);function o(e){return e.split("-")[1]}function i(e){return"y"===e?"height":"width"}function l(e){return e.split("-")[0]}function a(e){return["top","bottom"].includes(l(e))?"x":"y"}function s(e,t,n){let{reference:r,floating:s}=e;const c=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,f=a(t),d=i(f),p=r[d]/2-s[d]/2,y="x"===f;let m;switch(l(t)){case"top":m={x:c,y:r.y-s.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-s.width,y:u};break;default:m={x:r.x,y:r.y}}switch(o(t)){case"start":m[f]-=p*(n&&y?-1:1);break;case"end":m[f]+=p*(n&&y?-1:1)}return m}function c(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function u(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function f(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:y=!1,padding:m=0}=t,h=c(m),g=a[y?"floating"===p?"reference":"floating":p],v=u(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:d,strategy:s})),w="floating"===p?{...l.floating,x:r,y:o}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},R=u(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:s}):w);return{top:(v.top-R.top+h.top)/x.y,bottom:(R.bottom-v.bottom+h.bottom)/x.y,left:(v.left-R.left+h.left)/x.x,right:(R.right-v.right+h.right)/x.x}}const d=Math.min,p=Math.max;function y(e,t,n){return p(e,d(t,n))}const m=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),h={left:"right",right:"left",bottom:"top",top:"bottom"};function g(e){return e.replace(/left|right|bottom|top/g,(e=>h[e]))}function v(e,t,n){void 0===n&&(n=!1);const r=o(e),l=a(e),s=i(l);let c="x"===l?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=g(c)),{main:c,cross:g(c)}}const w={start:"end",end:"start"};function b(e){return e.replace(/start|end/g,(e=>w[e]))}const x=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:w=!0,...x}=e,R=l(r),S=l(s)===s,_=await(null==c.isRTL?void 0:c.isRTL(u.floating)),T=y||(S||!w?[g(s)]:function(e){const t=g(e);return[b(e),t,b(t)]}(s));y||"none"===h||T.push(...function(e,t,n,r){const i=o(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(l(e),"start"===n,r);return i&&(a=a.map((e=>e+"-"+i)),t&&(a=a.concat(a.map(b)))),a}(s,w,h,_));const E=[s,...T],k=await f(t,x),A=[];let O=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&A.push(k[R]),p){const{main:e,cross:t}=v(r,a,_);A.push(k[e],k[t])}if(O=[...O,{placement:r,overflows:A}],!A.every((e=>e<=0))){var j,P;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(P=O.find((e=>e.overflows[0]<=0)))?void 0:P.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}};const R=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,s=await(null==r.isRTL?void 0:r.isRTL(i.floating)),c=l(n),u=o(n),f="x"===a(n),d=["left","top"].includes(c)?-1:1,p=s&&f?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return u&&"number"==typeof g&&(h="end"===u?-1*g:g),f?{x:h*p,y:m*d}:{x:m*d,y:h*p}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};const S=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=e,d={x:n,y:r},p=await f(t,u),m=a(l(o)),h="x"===m?"y":"x";let g=d[m],v=d[h];if(i){const e="y"===m?"bottom":"right";g=y(g+p["y"===m?"top":"left"],g,g-p[e])}if(s){const e="y"===h?"bottom":"right";v=y(v+p["y"===h?"top":"left"],v,v-p[e])}const w=c.fn({...t,[m]:g,[h]:v});return{...w,data:{x:w.x-n,y:w.y-r}}}}};function _(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function T(e){return _(e).getComputedStyle(e)}const E=Math.min,k=Math.max,A=Math.round;function O(e){const t=T(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,l=A(n)!==o||A(r)!==i;return l&&(n=o,r=i),{width:n,height:r,fallback:l}}function j(e){return D(e)?(e.nodeName||"").toLowerCase():""}let P;function L(){if(P)return P;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(P=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),P):navigator.userAgent}function N(e){return e instanceof _(e).HTMLElement}function C(e){return e instanceof _(e).Element}function D(e){return e instanceof _(e).Node}function $(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof _(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=T(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function I(e){return["table","td","th"].includes(j(e))}function W(e){const t=/firefox/i.test(L()),n=T(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function H(){return!/^((?!chrome|android).)*safari/i.test(L())}function B(e){return["html","body","#document"].includes(j(e))}function U(e){return C(e)?e:e.contextElement}const M={x:1,y:1};function q(e){const t=U(e);if(!N(t))return M;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=O(t);let l=(i?A(n.width):n.width)/r,a=(i?A(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function V(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),a=U(e);let s=M;t&&(r?C(r)&&(s=q(r)):s=q(e));const c=a?_(a):window,u=!H()&&n;let f=(l.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,d=(l.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/s.y,p=l.width/s.x,y=l.height/s.y;if(a){const e=_(a),t=r&&C(r)?_(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=q(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,d*=e.y,p*=e.x,y*=e.y,f+=t.x,d+=t.y,n=_(n).frameElement}}return{width:p,height:y,top:d,right:f+p,bottom:d+y,left:f,x:f,y:d}}function z(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function X(e){return V(z(e)).left+Y(e).scrollLeft}function K(e){if("html"===j(e))return e;const t=e.assignedSlot||e.parentNode||$(e)&&e.host||z(e);return $(t)?t.host:t}function J(e){const t=K(e);return B(t)?t.ownerDocument.body:N(t)&&F(t)?t:J(t)}function Z(e,t){var n;void 0===t&&(t=[]);const r=J(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=_(r);return o?t.concat(i,i.visualViewport||[],F(r)?r:[]):t.concat(r,Z(r))}function G(e,t,n){return"viewport"===t?u(function(e,t){const n=_(e),r=z(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=H();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n)):C(t)?u(function(e,t){const n=V(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=N(e)?q(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):u(function(e){const t=z(e),n=Y(e),r=e.ownerDocument.body,o=k(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=k(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+X(e);const a=-n.scrollTop;return"rtl"===T(r).direction&&(l+=k(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(z(e)))}function Q(e){return N(e)&&"fixed"!==T(e).position?e.offsetParent:null}function ee(e){const t=_(e);let n=Q(e);for(;n&&I(n)&&"static"===T(n).position;)n=Q(n);return n&&("html"===j(n)||"body"===j(n)&&"static"===T(n).position&&!W(n))?t:n||function(e){let t=K(e);for(;N(t)&&!B(t);){if(W(t))return t;t=K(t)}return null}(e)||t}function te(e,t,n){const r=N(t),o=z(t),i=V(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==j(t)||F(o))&&(l=Y(t)),N(t)){const e=V(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=X(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const ne={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=Z(e).filter((e=>C(e)&&"body"!==j(e))),o=null;const i="fixed"===T(e).position;let l=i?K(e):e;for(;C(l)&&!B(l);){const e=T(l),t=W(l);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=K(l)}return t.set(e,r),r}(t,this._c):[].concat(n),l=[...i,r],a=l[0],s=l.reduce(((e,n)=>{const r=G(t,n,o);return e.top=k(r.top,e.top),e.right=E(r.right,e.right),e.bottom=E(r.bottom,e.bottom),e.left=k(r.left,e.left),e}),G(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=N(n),i=z(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==j(n)||F(i))&&(l=Y(n)),N(n))){const e=V(n);a=q(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}},isElement:C,getDimensions:function(e){return N(e)?O(e):e.getBoundingClientRect()},getOffsetParent:ee,getDocumentElement:z,getScale:q,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ee,i=this.getDimensions;return{reference:te(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===T(e).direction},re=(e,t,n)=>{const r=new Map,o={platform:ne,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=s(u,r,c),p=r,y={},m=0;for(let n=0;n<a.length;n++){const{name:i,fn:h}=a[n],{x:g,y:v,data:w,reset:b}=await h({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:y,rects:u,platform:l,elements:{reference:e,floating:t}});f=null!=g?g:f,d=null!=v?v:d,y={...y,[i]:{...y[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:d}=s(u,p,c))),n=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:y}})(e,t,{...o,platform:i})};var oe={exports:{}},ie={};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);function o(e){return e.split("-")[1]}function i(e){return"y"===e?"height":"width"}function l(e){return e.split("-")[0]}function a(e){return["top","bottom"].includes(l(e))?"x":"y"}function s(e,t,n){let{reference:r,floating:s}=e;const c=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,f=a(t),d=i(f),p=r[d]/2-s[d]/2,y="x"===f;let m;switch(l(t)){case"top":m={x:c,y:r.y-s.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-s.width,y:u};break;default:m={x:r.x,y:r.y}}switch(o(t)){case"start":m[f]-=p*(n&&y?-1:1);break;case"end":m[f]+=p*(n&&y?-1:1)}return m}function c(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function u(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function f(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:y=!1,padding:m=0}=t,h=c(m),g=a[y?"floating"===p?"reference":"floating":p],v=u(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:d,strategy:s})),w="floating"===p?{...l.floating,x:r,y:o}:l.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},R=u(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:s}):w);return{top:(v.top-R.top+h.top)/x.y,bottom:(R.bottom-v.bottom+h.bottom)/x.y,left:(v.left-R.left+h.left)/x.x,right:(R.right-v.right+h.right)/x.x}}const d=Math.min,p=Math.max;function y(e,t,n){return p(e,d(t,n))}const m=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),h={left:"right",right:"left",bottom:"top",top:"bottom"};function g(e){return e.replace(/left|right|bottom|top/g,(e=>h[e]))}function v(e,t,n){void 0===n&&(n=!1);const r=o(e),l=a(e),s=i(l);let c="x"===l?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=g(c)),{main:c,cross:g(c)}}const w={start:"end",end:"start"};function b(e){return e.replace(/start|end/g,(e=>w[e]))}const x=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:w=!0,...x}=e,R=l(r),S=l(s)===s,_=await(null==c.isRTL?void 0:c.isRTL(u.floating)),T=y||(S||!w?[g(s)]:function(e){const t=g(e);return[b(e),t,b(t)]}(s));y||"none"===h||T.push(...function(e,t,n,r){const i=o(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(l(e),"start"===n,r);return i&&(a=a.map((e=>e+"-"+i)),t&&(a=a.concat(a.map(b)))),a}(s,w,h,_));const E=[s,...T],A=await f(t,x),k=[];let O=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&k.push(A[R]),p){const{main:e,cross:t}=v(r,a,_);k.push(A[e],A[t])}if(O=[...O,{placement:r,overflows:k}],!k.every((e=>e<=0))){var j,P;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(P=O.find((e=>e.overflows[0]<=0)))?void 0:P.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}};const R=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,s=await(null==r.isRTL?void 0:r.isRTL(i.floating)),c=l(n),u=o(n),f="x"===a(n),d=["left","top"].includes(c)?-1:1,p=s&&f?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return u&&"number"==typeof g&&(h="end"===u?-1*g:g),f?{x:h*p,y:m*d}:{x:m*d,y:h*p}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};const S=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=e,d={x:n,y:r},p=await f(t,u),m=a(l(o)),h="x"===m?"y":"x";let g=d[m],v=d[h];if(i){const e="y"===m?"bottom":"right";g=y(g+p["y"===m?"top":"left"],g,g-p[e])}if(s){const e="y"===h?"bottom":"right";v=y(v+p["y"===h?"top":"left"],v,v-p[e])}const w=c.fn({...t,[m]:g,[h]:v});return{...w,data:{x:w.x-n,y:w.y-r}}}}};function _(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function T(e){return _(e).getComputedStyle(e)}const E=Math.min,A=Math.max,k=Math.round;function O(e){const t=T(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,l=k(n)!==o||k(r)!==i;return l&&(n=o,r=i),{width:n,height:r,fallback:l}}function j(e){return D(e)?(e.nodeName||"").toLowerCase():""}let P;function L(){if(P)return P;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(P=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),P):navigator.userAgent}function N(e){return e instanceof _(e).HTMLElement}function C(e){return e instanceof _(e).Element}function D(e){return e instanceof _(e).Node}function $(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof _(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=T(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function I(e){return["table","td","th"].includes(j(e))}function W(e){const t=/firefox/i.test(L()),n=T(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function H(){return!/^((?!chrome|android).)*safari/i.test(L())}function B(e){return["html","body","#document"].includes(j(e))}function U(e){return C(e)?e:e.contextElement}const M={x:1,y:1};function q(e){const t=U(e);if(!N(t))return M;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=O(t);let l=(i?k(n.width):n.width)/r,a=(i?k(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function V(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),a=U(e);let s=M;t&&(r?C(r)&&(s=q(r)):s=q(e));const c=a?_(a):window,u=!H()&&n;let f=(l.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,d=(l.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/s.y,p=l.width/s.x,y=l.height/s.y;if(a){const e=_(a),t=r&&C(r)?_(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=q(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,d*=e.y,p*=e.x,y*=e.y,f+=t.x,d+=t.y,n=_(n).frameElement}}return{width:p,height:y,top:d,right:f+p,bottom:d+y,left:f,x:f,y:d}}function z(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function X(e){return V(z(e)).left+Y(e).scrollLeft}function K(e){if("html"===j(e))return e;const t=e.assignedSlot||e.parentNode||$(e)&&e.host||z(e);return $(t)?t.host:t}function J(e){const t=K(e);return B(t)?t.ownerDocument.body:N(t)&&F(t)?t:J(t)}function Z(e,t){var n;void 0===t&&(t=[]);const r=J(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=_(r);return o?t.concat(i,i.visualViewport||[],F(r)?r:[]):t.concat(r,Z(r))}function G(e,t,n){return"viewport"===t?u(function(e,t){const n=_(e),r=z(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=H();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n)):C(t)?u(function(e,t){const n=V(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=N(e)?q(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):u(function(e){const t=z(e),n=Y(e),r=e.ownerDocument.body,o=A(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=A(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+X(e);const a=-n.scrollTop;return"rtl"===T(r).direction&&(l+=A(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(z(e)))}function Q(e){return N(e)&&"fixed"!==T(e).position?e.offsetParent:null}function ee(e){const t=_(e);let n=Q(e);for(;n&&I(n)&&"static"===T(n).position;)n=Q(n);return n&&("html"===j(n)||"body"===j(n)&&"static"===T(n).position&&!W(n))?t:n||function(e){let t=K(e);for(;N(t)&&!B(t);){if(W(t))return t;t=K(t)}return null}(e)||t}function te(e,t,n){const r=N(t),o=z(t),i=V(e,!0,"fixed"===n,t);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==j(t)||F(o))&&(l=Y(t)),N(t)){const e=V(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=X(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const ne={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=Z(e).filter((e=>C(e)&&"body"!==j(e))),o=null;const i="fixed"===T(e).position;let l=i?K(e):e;for(;C(l)&&!B(l);){const e=T(l),t=W(l);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==l)),l=K(l)}return t.set(e,r),r}(t,this._c):[].concat(n),l=[...i,r],a=l[0],s=l.reduce(((e,n)=>{const r=G(t,n,o);return e.top=A(r.top,e.top),e.right=E(r.right,e.right),e.bottom=E(r.bottom,e.bottom),e.left=A(r.left,e.left),e}),G(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=N(n),i=z(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==j(n)||F(i))&&(l=Y(n)),N(n))){const e=V(n);a=q(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}},isElement:C,getDimensions:function(e){return N(e)?O(e):e.getBoundingClientRect()},getOffsetParent:ee,getDocumentElement:z,getScale:q,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ee,i=this.getDimensions;return{reference:te(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===T(e).direction},re=(e,t,n)=>{const r=new Map,o={platform:ne,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=s(u,r,c),p=r,y={},m=0;for(let n=0;n<a.length;n++){const{name:i,fn:h}=a[n],{x:g,y:v,data:w,reset:b}=await h({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:y,rects:u,platform:l,elements:{reference:e,floating:t}});f=null!=g?g:f,d=null!=v?v:d,y={...y,[i]:{...y[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:d}=s(u,p,c))),n=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:y}})(e,t,{...o,platform:i})};var oe={exports:{}},ie={};
|
|
2
2
|
/** @license React v16.14.0
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
!function(e){!function(){var t=r.default,n=60103,o=60106;e.Fragment=60107;var i=60108,l=60114,a=60109,s=60110,c=60112,u=60113,f=60120,d=60115,p=60116,y=60121,m=60122,h=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element"),o=w("react.portal"),e.Fragment=w("react.fragment"),i=w("react.strict_mode"),l=w("react.profiler"),a=w("react.provider"),s=w("react.context"),c=w("react.forward_ref"),u=w("react.suspense"),f=w("react.suspense_list"),d=w("react.memo"),p=w("react.lazy"),y=w("react.block"),m=w("react.server.block"),h=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),g=w("react.debug_trace_mode"),w("react.offscreen"),v=w("react.legacy_hidden")}var b="function"==typeof Symbol&&Symbol.iterator;var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];S("error",e,n)}function S(e,t,n){var r=x.ReactDebugCurrentFrame,o="";if(
|
|
10
|
+
!function(e){!function(){var t=r.default,n=60103,o=60106;e.Fragment=60107;var i=60108,l=60114,a=60109,s=60110,c=60112,u=60113,f=60120,d=60115,p=60116,y=60121,m=60122,h=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element"),o=w("react.portal"),e.Fragment=w("react.fragment"),i=w("react.strict_mode"),l=w("react.profiler"),a=w("react.provider"),s=w("react.context"),c=w("react.forward_ref"),u=w("react.suspense"),f=w("react.suspense_list"),d=w("react.memo"),p=w("react.lazy"),y=w("react.block"),m=w("react.server.block"),h=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),g=w("react.debug_trace_mode"),w("react.offscreen"),v=w("react.legacy_hidden")}var b="function"==typeof Symbol&&Symbol.iterator;var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];S("error",e,n)}function S(e,t,n){var r=x.ReactDebugCurrentFrame,o="";if(A){var i=T(A.type),l=A._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(_,"");if(/^index\./.test(i)){var l=o.match(_);if(l){var a=l[1];if(a)i=a.replace(_,"")+"/"+i}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,A._source,l&&T(l.type))}""!==(o+=r.getStackAddendum())&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return""+e}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}var _=/^(.*)[\\\/]/;function T(t){if(null==t)return null;if("number"==typeof t.tag&&R("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case e.Fragment:return"Fragment";case o:return"Portal";case l:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case s:return"Context.Consumer";case a:return"Context.Provider";case c:return m=t,h=t.render,g="ForwardRef",v=h.displayName||h.name||"",m.displayName||(""!==v?g+"("+v+")":g);case d:return T(t.type);case y:return T(t.render);case p:var n=1===(r=t)._status?r._result:null;if(n)return T(n)}var r,m,h,g,v;return null}var E={};x.ReactDebugCurrentFrame;var A=null;function k(e){A=e}var O,j,P,L=x.ReactCurrentOwner,N=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};P={};function D(e,t,r,o,i){var l,a={},s=null,c=null;for(l in void 0!==r&&(s=""+r),function(e){if(N.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(s=""+t.key),function(e){if(N.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&L.current&&t&&L.current.stateNode!==t){var n=T(L.current.type);P[n]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(L.current.type),e.ref),P[n]=!0)}}(t,i)),t)N.call(t,l)&&!C.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var u=e.defaultProps;for(l in u)void 0===a[l]&&(a[l]=u[l])}if(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){O||(O=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,f),c&&function(e,t){var n=function(){j||(j=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,f)}return function(e,t,r,o,i,l,a){var s={$$typeof:n,type:e,key:t,ref:r,props:a,_owner:l,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,L.current,a)}var $,F=x.ReactCurrentOwner;function I(e){A=e}function W(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function H(){if(F.current){var e=T(F.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}x.ReactDebugCurrentFrame,$=!1;var B={};function U(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=H();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!B[n]){B[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+T(e._owner.type)+"."),I(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),I(null)}}}function M(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];W(r)&&U(r,t)}else if(W(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=b&&e[b]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,l=o.call(e);!(i=l.next()).done;)W(i.value)&&U(i.value,t)}}function q(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==c&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=T(n);!function(e,t,n,r,o){var i=Function.call.bind(Object.prototype.hasOwnProperty);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var s=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}a=e[l](t,l,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(k(o),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,l,typeof a),k(null)),a instanceof Error&&!(a.message in E)&&(E[a.message]=!0,k(o),R("Failed %s type: %s",n,a.message),k(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!$){$=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function V(t,r,o,w,b,x){var S=function(t){return"string"==typeof t||"function"==typeof t||t===e.Fragment||t===l||t===g||t===i||t===u||t===f||t===v||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===h||t.$$typeof===y||t[0]===m)}(t);if(!S){var _="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var E,A=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(b);_+=A||H(),null===t?E="null":Array.isArray(t)?E="array":void 0!==t&&t.$$typeof===n?(E="<"+(T(t.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):E=typeof t,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,_)}var k=D(t,r,o,b,x);if(null==k)return k;if(S){var O=r.children;if(void 0!==O)if(w)if(Array.isArray(O)){for(var j=0;j<O.length;j++)M(O[j],t);Object.freeze&&Object.freeze(O)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(O,t)}return t===e.Fragment?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){I(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),I(null);break}}null!==e.ref&&(I(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}(k):q(k),k}var z=function(e,t,n){return V(e,t,n,!1)},Y=function(e,t,n){return V(e,t,n,!0)};e.jsx=z,e.jsxs=Y}()}(ie),function(e){e.exports=ie}(oe);var le={exports:{}};
|
|
11
11
|
/*!
|
|
12
12
|
Copyright (c) 2018 Jed Watson.
|
|
13
13
|
Licensed under the MIT License (MIT), see
|
|
14
14
|
http://jedwatson.github.io/classnames
|
|
15
|
-
*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var l=n.apply(null,o);l&&e.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var a in o)t.call(o,a)&&o[a]&&e.push(a)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(le);var ae=le.exports;const se=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},ce=({content:e})=>oe.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),ue="DEFAULT_TOOLTIP_ID",fe={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},de={getTooltipData:()=>fe},pe=t.createContext(de);function ye(e=ue){return t.useContext(pe).getTooltipData(e)}const me=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:l=10,strategy:s="absolute",middlewares:u=[R(Number(l)),x(),S({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const f=u;return n?(f.push({name:"arrow",options:d={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=d||{},{x:r,y:l,placement:s,rects:u,platform:f}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const p=c(n),m={x:r,y:l},h=a(s),g=i(h),v=await f.getDimensions(t),w="y"===h?"top":"left",b="y"===h?"bottom":"right",x=u.reference[g]+u.reference[h]-m[h]-u.floating[g],R=m[h]-u.reference[h],S=await(null==f.getOffsetParent?void 0:f.getOffsetParent(t));let _=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0;0===_&&(_=u.floating[g]);const T=x/2-R/2,E=p[w],k=_-v[g]-p[b],A=_/2-v[g]/2+T,O=y(E,A,k),j=null!=o(s)&&A!=O&&u.reference[g]/2-(A<E?p[w]:p[b])-v[g]/2<0;return{[h]:m[h]-(j?A<E?E-A:k-A:0),data:{[h]:O,centerOffset:A-O}}}}),re(e,t,{placement:r,strategy:s,middleware:f}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):re(e,t,{placement:"bottom",strategy:s,middleware:f}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var d};var he={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ge=({id:e,className:n,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:l,place:a="top",offset:s=10,events:c=["hover"],positionStrategy:u="absolute",middlewares:f,wrapper:d,children:p=null,delayShow:y=0,delayHide:m=0,float:h=!1,noArrow:g=!1,clickable:v=!1,closeOnEsc:w=!1,style:b,position:x,afterShow:R,afterHide:S,content:_,html:T,isOpen:E,setIsOpen:k,activeAnchor:A,setActiveAnchor:O})=>{const j=t.useRef(null),P=t.useRef(null),L=t.useRef(null),N=t.useRef(null),[C,D]=t.useState({}),[$,F]=t.useState({}),[I,W]=t.useState(!1),[H,B]=t.useState(!1),U=t.useRef(!1),M=t.useRef(null),{anchorRefs:q,setActiveAnchor:V}=ye(e),z=t.useRef(!1),[Y,X]=t.useState([]),K=t.useRef(!1);t.useEffect((()=>{let t=l;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));X(e)}catch(e){X([])}}),[l,A]),t.useLayoutEffect((()=>(K.current=!0,()=>{K.current=!1})),[]),t.useEffect((()=>{if(!I){const e=setTimeout((()=>{B(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[I]);const J=e=>{K.current&&(e&&B(!0),setTimeout((()=>{K.current&&(null==k||k(e),void 0===E&&W(e))}),10))};t.useEffect((()=>{if(void 0===E)return()=>null;E&&B(!0);const e=setTimeout((()=>{W(E)}),10);return()=>{clearTimeout(e)}}),[E]),t.useEffect((()=>{I!==U.current&&(U.current=I,I?null==R||R():null==S||S())}),[I]);const Z=(e=m)=>{N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{z.current||J(!1)}),e)},G=e=>{var t;if(!e)return;y?(L.current&&clearTimeout(L.current),L.current=setTimeout((()=>{J(!0)}),y)):J(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;O(n),V({current:n}),N.current&&clearTimeout(N.current)},Q=()=>{v?Z(m||100):m?Z():J(!1),L.current&&clearTimeout(L.current)},ee=({x:e,y:t})=>{me({place:a,offset:s,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{Object.keys(e.tooltipStyles).length&&D(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&F(e.tooltipArrowStyles)}))},te=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ee(n),M.current=n},ne=e=>{G(e),m&&Z()},re=e=>{const t=document.querySelector(`[id='${i}']`);(null==t?void 0:t.contains(e.target))||Y.some((t=>t.contains(e.target)))||J(!1)},ie=e=>{"Escape"===e.key&&J(!1)},le=se(G,50),ue=se(Q,50);t.useEffect((()=>{var t,n;const r=new Set(q);Y.forEach((e=>{r.add({current:e})}));const o=document.querySelector(`[id='${i}']`);o&&r.add({current:o}),w&&window.addEventListener("keydown",ie);const a=[];c.find((e=>"click"===e))&&(window.addEventListener("click",re),a.push({event:"click",listener:ne})),c.find((e=>"hover"===e))&&(a.push({event:"mouseenter",listener:le},{event:"mouseleave",listener:ue},{event:"focus",listener:le},{event:"blur",listener:ue}),h&&a.push({event:"mousemove",listener:te}));const s=()=>{z.current=!0},u=()=>{z.current=!1,Q()};v&&(null===(t=j.current)||void 0===t||t.addEventListener("mouseenter",s),null===(n=j.current)||void 0===n||n.addEventListener("mouseleave",u)),a.forEach((({event:e,listener:t})=>{r.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))}));const f=new MutationObserver((t=>{let n=null!=l?l:"";!n&&e&&(n=`[data-tooltip-id='${e}']`),t.forEach((e=>{if("childList"===e.type&&(A&&[...e.removedNodes].some((e=>!!e.contains(A)&&(B(!1),J(!1),O(null),!0))),n))try{const t=[...e.addedNodes].filter((e=>1===e.nodeType)),r=[...t.filter((e=>e.matches(n))),...t.flatMap((e=>[...e.querySelectorAll(n)]))];r.length&&X((e=>[...e,...r]))}catch(e){}}))}));return f.observe(document.body,{attributes:!1,childList:!0,subtree:!0}),()=>{var e,t;c.find((e=>"click"===e))&&window.removeEventListener("click",re),w&&window.removeEventListener("keydown",ie),v&&(null===(e=j.current)||void 0===e||e.removeEventListener("mouseenter",s),null===(t=j.current)||void 0===t||t.removeEventListener("mouseleave",u)),a.forEach((({event:e,listener:t})=>{r.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))})),f.disconnect()}}),[H,q,A,Y,w,c,m,y]),t.useEffect((()=>{x?ee(x):h?M.current&&ee(M.current):me({place:a,offset:s,elementReference:A,tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{K.current&&(Object.keys(e.tooltipStyles).length&&D(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&F(e.tooltipArrowStyles))}))}),[I,A,_,T,a,s,u,x]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...Y,t];A&&n.includes(A)||O(null!==(e=Y[0])&&void 0!==e?e:t)}),[i,Y,A]),t.useEffect((()=>()=>{L.current&&clearTimeout(L.current),N.current&&clearTimeout(N.current)}),[]);const fe=Boolean(T||_||p)&&I&&Object.keys(C).length>0;return H?oe.exports.jsxs(d,{id:e,role:"tooltip",className:ae("react-tooltip",he.tooltip,he[o],n,{[he.show]:fe,[he.fixed]:"fixed"===u,[he.clickable]:v}),style:{...b,...C},ref:j,children:[T&&oe.exports.jsx(ce,{content:T})||_||p,oe.exports.jsx(d,{className:ae("react-tooltip-arrow",he.arrow,r,{[he["no-arrow"]]:g}),style:$,ref:P})]}):null};e.Tooltip=({id:e,anchorId:n,anchorSelect:r,content:o,html:i,className:l,classNameArrow:a,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:d=null,events:p=["hover"],positionStrategy:y="absolute",middlewares:m,delayShow:h=0,delayHide:g=0,float:v=!1,noArrow:w=!1,clickable:b=!1,closeOnEsc:x=!1,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:k})=>{const[A,O]=t.useState(o),[j,P]=t.useState(i),[L,N]=t.useState(c),[C,D]=t.useState(s),[$,F]=t.useState(u),[I,W]=t.useState(h),[H,B]=t.useState(g),[U,M]=t.useState(v),[q,V]=t.useState(f),[z,Y]=t.useState(p),[X,K]=t.useState(y),[J,Z]=t.useState(null),{anchorRefs:G,activeAnchor:Q}=ye(e),ee=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),te=e=>{const t={place:e=>{var t;N(null!==(t=e)&&void 0!==t?t:c)},content:e=>{O(null!=e?e:o)},html:e=>{P(null!=e?e:i)},variant:e=>{var t;D(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{F(null===e?u:Number(e))},wrapper:e=>{var t;V(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");Y(null!=t?t:p)},"position-strategy":e=>{var t;K(null!==(t=e)&&void 0!==t?t:y)},"delay-show":e=>{W(null===e?h:Number(e))},"delay-hide":e=>{B(null===e?g:Number(e))},float:e=>{M(null===e?v:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};t.useEffect((()=>{O(o)}),[o]),t.useEffect((()=>{P(i)}),[i]),t.useEffect((()=>{N(c)}),[c]),t.useEffect((()=>{var t;const o=new Set(G);let i=r;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${n}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const a=null!==(t=null!=J?J:l)&&void 0!==t?t:Q.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=ee(a);te(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=ee(a);te(e),s.observe(a,c)}return()=>{s.disconnect()}}),[G,Q,J,n,r]);const ne={id:e,anchorId:n,anchorSelect:r,className:l,classNameArrow:a,content:A,html:j,place:L,variant:C,offset:$,wrapper:q,events:z,positionStrategy:X,middlewares:m,delayShow:I,delayHide:H,float:U,noArrow:w,clickable:b,closeOnEsc:x,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:k,activeAnchor:J,setActiveAnchor:e=>Z(e)};return d?oe.exports.jsx(ge,{...ne,children:d}):oe.exports.jsx(ge,{...ne})},e.TooltipProvider=({children:e})=>{const[n,r]=t.useState({[ue]:new Set}),[o,i]=t.useState({[ue]:{current:null}}),l=(e,...t)=>{r((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},a=(e,...t)=>{r((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},s=t.useCallback(((e=ue)=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=o[e])&&void 0!==r?r:{current:null},attach:(...t)=>l(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{i((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[n,o,l,a]),c=t.useMemo((()=>({getTooltipData:s})),[s]);return oe.exports.jsx(pe.Provider,{value:c,children:e})},e.TooltipWrapper=({tooltipId:e,children:n,className:r,place:o,content:i,html:l,variant:a,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:d,delayHide:p})=>{const{attach:y,detach:m}=ye(e),h=t.useRef(null);return t.useEffect((()=>(y(h),()=>{m(h)})),[]),oe.exports.jsx("span",{ref:h,className:ae("react-tooltip-wrapper",r),"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":l,"data-tooltip-variant":a,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":d,"data-tooltip-delay-hide":p,children:n})},e.autoPlacement=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:s,placement:c,platform:u,elements:d}=t,{alignment:p,allowedPlacements:y=m,autoAlignment:h=!0,...g}=e,w=void 0!==p||y===m?function(e,t,n){return(e?[...n.filter((t=>o(t)===e)),...n.filter((t=>o(t)!==e))]:n.filter((e=>l(e)===e))).filter((n=>!e||o(n)===e||!!t&&b(n)!==n))}(p||null,h,y):y,x=await f(t,g),R=(null==(n=s.autoPlacement)?void 0:n.index)||0,S=w[R];if(null==S)return{};const{main:_,cross:T}=v(S,a,await(null==u.isRTL?void 0:u.isRTL(d.floating)));if(c!==S)return{reset:{placement:w[0]}};const E=[x[l(S)],x[_],x[T]],k=[...(null==(r=s.autoPlacement)?void 0:r.overflows)||[],{placement:S,overflows:E}],A=w[R+1];if(A)return{data:{index:R+1,overflows:k},reset:{placement:A}};const O=k.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),j=null==(i=O.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:i.placement,P=j||O[0].placement;return P!==c?{data:{index:R+1,overflows:k},reset:{placement:P}}:{}}}},e.flip=x,e.inline=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:f=2,x:y,y:m}=e,h=u(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:o.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(r.floating)),strategy:s}):o.reference),g=await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[],v=c(f);const w=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=y&&null!=m)return g.find((e=>y>e.left-v.left&&y<e.right+v.right&&m>e.top-v.top&&m<e.bottom+v.bottom))||h;if(g.length>=2){if("x"===a(n)){const e=g[0],t=g[g.length-1],r="top"===l(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===l(n),t=p(...g.map((e=>e.right))),r=d(...g.map((e=>e.left))),o=g.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,s=o[o.length-1].bottom;return{top:i,bottom:s,left:r,right:t,width:t-r,height:s-i,x:r,y:i}}return h}},floating:r.floating,strategy:s});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},e.offset=R,e.shift=S,e.size=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:a}=t,{apply:s=(()=>{}),...c}=e,u=await f(t,c),d=l(n),y=o(n);let m,h;"top"===d||"bottom"===d?(m=d,h=y===(await(null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,m="end"===y?"top":"bottom");const g=p(u.left,0),v=p(u.right,0),w=p(u.top,0),b=p(u.bottom,0),x={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:p(u.top,u.bottom)):u[m]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(0!==g||0!==v?g+v:p(u.left,u.right)):u[h])};await s({...t,...x});const R=await i.getDimensions(a.floating);return r.floating.width!==R.width||r.floating.height!==R.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var l=n.apply(null,o);l&&e.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var a in o)t.call(o,a)&&o[a]&&e.push(a)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(le);var ae=le.exports;const se=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},ce=({content:e})=>oe.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),ue="DEFAULT_TOOLTIP_ID",fe={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},de={getTooltipData:()=>fe},pe=t.createContext(de);function ye(e=ue){return t.useContext(pe).getTooltipData(e)}const me=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:l=10,strategy:s="absolute",middlewares:u=[R(Number(l)),x(),S({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const f=u;return n?(f.push({name:"arrow",options:d={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=d||{},{x:r,y:l,placement:s,rects:u,platform:f}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const p=c(n),m={x:r,y:l},h=a(s),g=i(h),v=await f.getDimensions(t),w="y"===h?"top":"left",b="y"===h?"bottom":"right",x=u.reference[g]+u.reference[h]-m[h]-u.floating[g],R=m[h]-u.reference[h],S=await(null==f.getOffsetParent?void 0:f.getOffsetParent(t));let _=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0;0===_&&(_=u.floating[g]);const T=x/2-R/2,E=p[w],A=_-v[g]-p[b],k=_/2-v[g]/2+T,O=y(E,k,A),j=null!=o(s)&&k!=O&&u.reference[g]/2-(k<E?p[w]:p[b])-v[g]/2<0;return{[h]:m[h]-(j?k<E?E-k:A-k:0),data:{[h]:O,centerOffset:k-O}}}}),re(e,t,{placement:r,strategy:s,middleware:f}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):re(e,t,{placement:"bottom",strategy:s,middleware:f}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var d};var he={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ge=({id:e,className:n,classNameArrow:r,variant:o="dark",anchorId:i,anchorSelect:l,place:a="top",offset:s=10,events:c=["hover"],positionStrategy:u="absolute",middlewares:f,wrapper:d,children:p=null,delayShow:y=0,delayHide:m=0,float:h=!1,noArrow:g=!1,clickable:v=!1,closeOnEsc:w=!1,style:b,position:x,afterShow:R,afterHide:S,content:_,html:T,isOpen:E,setIsOpen:A,activeAnchor:k,setActiveAnchor:O})=>{const j=t.useRef(null),P=t.useRef(null),L=t.useRef(null),N=t.useRef(null),[C,D]=t.useState({}),[$,F]=t.useState({}),[I,W]=t.useState(!1),[H,B]=t.useState(!1),U=t.useRef(!1),M=t.useRef(null),{anchorRefs:q,setActiveAnchor:V}=ye(e),z=t.useRef(!1),[Y,X]=t.useState([]),K=t.useRef(!1);t.useLayoutEffect((()=>(K.current=!0,()=>{K.current=!1})),[]),t.useEffect((()=>{if(!I){const e=setTimeout((()=>{B(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[I]);const J=e=>{K.current&&(e&&B(!0),setTimeout((()=>{K.current&&(null==A||A(e),void 0===E&&W(e))}),10))};t.useEffect((()=>{if(void 0===E)return()=>null;E&&B(!0);const e=setTimeout((()=>{W(E)}),10);return()=>{clearTimeout(e)}}),[E]),t.useEffect((()=>{I!==U.current&&(U.current=I,I?null==R||R():null==S||S())}),[I]);const Z=(e=m)=>{N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{z.current||J(!1)}),e)},G=e=>{var t;if(!e)return;y?(L.current&&clearTimeout(L.current),L.current=setTimeout((()=>{J(!0)}),y)):J(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;O(n),V({current:n}),N.current&&clearTimeout(N.current)},Q=()=>{v?Z(m||100):m?Z():J(!1),L.current&&clearTimeout(L.current)},ee=({x:e,y:t})=>{me({place:a,offset:s,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{Object.keys(e.tooltipStyles).length&&D(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&F(e.tooltipArrowStyles)}))},te=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ee(n),M.current=n},ne=e=>{G(e),m&&Z()},re=e=>{const t=document.querySelector(`[id='${i}']`);(null==t?void 0:t.contains(e.target))||Y.some((t=>t.contains(e.target)))||J(!1)},ie=e=>{"Escape"===e.key&&J(!1)},le=se(G,50),ue=se(Q,50);t.useEffect((()=>{var e,t;const n=new Set(q);Y.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${i}']`);r&&n.add({current:r}),w&&window.addEventListener("keydown",ie);const o=[];c.find((e=>"click"===e))&&(window.addEventListener("click",re),o.push({event:"click",listener:ne})),c.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:le},{event:"mouseleave",listener:ue},{event:"focus",listener:le},{event:"blur",listener:ue}),h&&o.push({event:"mousemove",listener:te}));const l=()=>{z.current=!0},a=()=>{z.current=!1,Q()};return v&&(null===(e=j.current)||void 0===e||e.addEventListener("mouseenter",l),null===(t=j.current)||void 0===t||t.addEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;c.find((e=>"click"===e))&&window.removeEventListener("click",re),w&&window.removeEventListener("keydown",ie),v&&(null===(e=j.current)||void 0===e||e.removeEventListener("mouseenter",l),null===(t=j.current)||void 0===t||t.removeEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[H,q,Y,w,c]),t.useEffect((()=>{let t=null!=l?l:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const n=new MutationObserver((n=>{const r=[];n.forEach((n=>{if("attributes"===n.type&&"data-tooltip-id"===n.attributeName){n.target.getAttribute("data-tooltip-id")===e&&r.push(n.target)}if("childList"===n.type&&(k&&[...n.removedNodes].some((e=>!!e.contains(k)&&(B(!1),J(!1),O(null),!0))),t))try{const e=[...n.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&X((e=>[...e,...r]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{n.disconnect()}}),[e,l,k]),t.useEffect((()=>{x?ee(x):h?M.current&&ee(M.current):me({place:a,offset:s,elementReference:k,tooltipReference:j.current,tooltipArrowReference:P.current,strategy:u,middlewares:f}).then((e=>{K.current&&(Object.keys(e.tooltipStyles).length&&D(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&F(e.tooltipArrowStyles))}))}),[I,k,_,T,a,s,u,x]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...Y,t];k&&n.includes(k)||O(null!==(e=Y[0])&&void 0!==e?e:t)}),[i,Y,k]),t.useEffect((()=>()=>{L.current&&clearTimeout(L.current),N.current&&clearTimeout(N.current)}),[]),t.useEffect((()=>{let t=l;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));X(e)}catch(e){X([])}}),[e,l]);const fe=Boolean(T||_||p)&&I&&Object.keys(C).length>0;return H?oe.exports.jsxs(d,{id:e,role:"tooltip",className:ae("react-tooltip",he.tooltip,he[o],n,{[he.show]:fe,[he.fixed]:"fixed"===u,[he.clickable]:v}),style:{...b,...C},ref:j,children:[T&&oe.exports.jsx(ce,{content:T})||_||p,oe.exports.jsx(d,{className:ae("react-tooltip-arrow",he.arrow,r,{[he["no-arrow"]]:g}),style:$,ref:P})]}):null};e.Tooltip=({id:e,anchorId:n,anchorSelect:r,content:o,html:i,className:l,classNameArrow:a,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:d=null,events:p=["hover"],positionStrategy:y="absolute",middlewares:m,delayShow:h=0,delayHide:g=0,float:v=!1,noArrow:w=!1,clickable:b=!1,closeOnEsc:x=!1,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:A})=>{const[k,O]=t.useState(o),[j,P]=t.useState(i),[L,N]=t.useState(c),[C,D]=t.useState(s),[$,F]=t.useState(u),[I,W]=t.useState(h),[H,B]=t.useState(g),[U,M]=t.useState(v),[q,V]=t.useState(f),[z,Y]=t.useState(p),[X,K]=t.useState(y),[J,Z]=t.useState(null),{anchorRefs:G,activeAnchor:Q}=ye(e),ee=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),te=e=>{const t={place:e=>{var t;N(null!==(t=e)&&void 0!==t?t:c)},content:e=>{O(null!=e?e:o)},html:e=>{P(null!=e?e:i)},variant:e=>{var t;D(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{F(null===e?u:Number(e))},wrapper:e=>{var t;V(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");Y(null!=t?t:p)},"position-strategy":e=>{var t;K(null!==(t=e)&&void 0!==t?t:y)},"delay-show":e=>{W(null===e?h:Number(e))},"delay-hide":e=>{B(null===e?g:Number(e))},float:e=>{M(null===e?v:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};t.useEffect((()=>{O(o)}),[o]),t.useEffect((()=>{P(i)}),[i]),t.useEffect((()=>{N(c)}),[c]),t.useEffect((()=>{var t;const o=new Set(G);let i=r;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${n}']`);if(l&&o.add({current:l}),!o.size)return()=>null;const a=null!==(t=null!=J?J:l)&&void 0!==t?t:Q.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=ee(a);te(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=ee(a);te(e),s.observe(a,c)}return()=>{s.disconnect()}}),[G,Q,J,n,r]);const ne={id:e,anchorId:n,anchorSelect:r,className:l,classNameArrow:a,content:k,html:j,place:L,variant:C,offset:$,wrapper:q,events:z,positionStrategy:X,middlewares:m,delayShow:I,delayHide:H,float:U,noArrow:w,clickable:b,closeOnEsc:x,style:R,position:S,isOpen:_,setIsOpen:T,afterShow:E,afterHide:A,activeAnchor:J,setActiveAnchor:e=>Z(e)};return d?oe.exports.jsx(ge,{...ne,children:d}):oe.exports.jsx(ge,{...ne})},e.TooltipProvider=({children:e})=>{const[n,r]=t.useState({[ue]:new Set}),[o,i]=t.useState({[ue]:{current:null}}),l=(e,...t)=>{r((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},a=(e,...t)=>{r((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},s=t.useCallback(((e=ue)=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=o[e])&&void 0!==r?r:{current:null},attach:(...t)=>l(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{i((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[n,o,l,a]),c=t.useMemo((()=>({getTooltipData:s})),[s]);return oe.exports.jsx(pe.Provider,{value:c,children:e})},e.TooltipWrapper=({tooltipId:e,children:n,className:r,place:o,content:i,html:l,variant:a,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:d,delayHide:p})=>{const{attach:y,detach:m}=ye(e),h=t.useRef(null);return t.useEffect((()=>(y(h),()=>{m(h)})),[]),oe.exports.jsx("span",{ref:h,className:ae("react-tooltip-wrapper",r),"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":l,"data-tooltip-variant":a,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":d,"data-tooltip-delay-hide":p,children:n})},e.autoPlacement=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:s,placement:c,platform:u,elements:d}=t,{alignment:p,allowedPlacements:y=m,autoAlignment:h=!0,...g}=e,w=void 0!==p||y===m?function(e,t,n){return(e?[...n.filter((t=>o(t)===e)),...n.filter((t=>o(t)!==e))]:n.filter((e=>l(e)===e))).filter((n=>!e||o(n)===e||!!t&&b(n)!==n))}(p||null,h,y):y,x=await f(t,g),R=(null==(n=s.autoPlacement)?void 0:n.index)||0,S=w[R];if(null==S)return{};const{main:_,cross:T}=v(S,a,await(null==u.isRTL?void 0:u.isRTL(d.floating)));if(c!==S)return{reset:{placement:w[0]}};const E=[x[l(S)],x[_],x[T]],A=[...(null==(r=s.autoPlacement)?void 0:r.overflows)||[],{placement:S,overflows:E}],k=w[R+1];if(k)return{data:{index:R+1,overflows:A},reset:{placement:k}};const O=A.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),j=null==(i=O.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:i.placement,P=j||O[0].placement;return P!==c?{data:{index:R+1,overflows:A},reset:{placement:P}}:{}}}},e.flip=x,e.inline=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:f=2,x:y,y:m}=e,h=u(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:o.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(r.floating)),strategy:s}):o.reference),g=await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[],v=c(f);const w=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=y&&null!=m)return g.find((e=>y>e.left-v.left&&y<e.right+v.right&&m>e.top-v.top&&m<e.bottom+v.bottom))||h;if(g.length>=2){if("x"===a(n)){const e=g[0],t=g[g.length-1],r="top"===l(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===l(n),t=p(...g.map((e=>e.right))),r=d(...g.map((e=>e.left))),o=g.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,s=o[o.length-1].bottom;return{top:i,bottom:s,left:r,right:t,width:t-r,height:s-i,x:r,y:i}}return h}},floating:r.floating,strategy:s});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},e.offset=R,e.shift=S,e.size=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:a}=t,{apply:s=(()=>{}),...c}=e,u=await f(t,c),d=l(n),y=o(n);let m,h;"top"===d||"bottom"===d?(m=d,h=y===(await(null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,m="end"===y?"top":"bottom");const g=p(u.left,0),v=p(u.right,0),w=p(u.top,0),b=p(u.bottom,0),x={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:p(u.top,u.bottom)):u[m]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(0!==g||0!==v?g+v:p(u.left,u.right)):u[h])};await s({...t,...x});const R=await i.getDimensions(a.floating);return r.floating.width!==R.width||r.floating.height!==R.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-tooltip",
|
|
3
|
-
"version": "5.8.2-beta.
|
|
3
|
+
"version": "5.8.2-beta.3",
|
|
4
4
|
"description": "react tooltip component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "node ./cli.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.js --watch",
|