graphdb-workbench
Version:
The web application for GraphDB APIs
1 lines • 27.8 kB
JavaScript
"use strict";var ontoTooltipPlacement=require("./onto-tooltip-placement-CTomd-7A.js");class OntoTooltipConfiguration{constructor(){this.hideOnClick=!1,this.interactive=!0,this.appendTo=()=>document.body,this.allowHTML=!0,this.theme="onto-tooltip",this.onShow=()=>document.querySelectorAll(".jfk-tooltip").forEach(t=>t.classList.add("hidden")),this.onHide=()=>document.querySelectorAll(".jfk-tooltip").forEach(t=>t.classList.remove("hidden"))}setHideOnClick(t){return this.hideOnClick=t,this}setContent(t){return this.content=t,this}setPlacement(t){return this.placement=t||ontoTooltipPlacement.OntoTooltipPlacement.RIGHT,this}setAllowHTML(t){return this.allowHTML=t,this}setTheme(t){return this.theme=t||"onto-tooltip",this}setAppendTo(t){return this.appendTo=this.getAppendToTarget(t),this}getAppendToTarget(t){return"parent"===t?t:()=>document.body}}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=t=>({x:t,y:t}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(t,e,n){return max(t,min(e,n))}function evaluate(t,e){return"function"==typeof t?t(e):t}function getSide(t){return t.split("-")[0]}function getAlignment(t){return t.split("-")[1]}function getOppositeAxis(t){return"x"===t?"y":"x"}function getAxisLength(t){return"y"===t?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(t){return yAxisSides.has(getSide(t))?"y":"x"}function getAlignmentAxis(t){return getOppositeAxis(getSideAxis(t))}function getAlignmentSides(t,e,n){void 0===n&&(n=!1);const o=getAlignment(t),i=getAlignmentAxis(t),l=getAxisLength(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[l]>e.floating[l]&&(s=getOppositePlacement(s)),[s,getOppositePlacement(s)]}function getExpandedPlacements(t){const e=getOppositePlacement(t);return[getOppositeAlignmentPlacement(t),e,getOppositeAlignmentPlacement(e)]}function getOppositeAlignmentPlacement(t){return t.replace(/start|end/g,t=>oppositeAlignmentMap[t])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(t,e,n){switch(t){case"top":case"bottom":return n?e?rlPlacement:lrPlacement:e?lrPlacement:rlPlacement;case"left":case"right":return e?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(t,e,n,o){const i=getAlignment(t);let l=getSideList(getSide(t),"start"===n,o);return i&&(l=l.map(t=>t+"-"+i),e&&(l=l.concat(l.map(getOppositeAlignmentPlacement)))),l}function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,t=>oppositeSideMap[t])}function expandPaddingObject(t){return{top:0,right:0,bottom:0,left:0,...t}}function getPaddingObject(t){return"number"!=typeof t?expandPaddingObject(t):{top:t,right:t,bottom:t,left:t}}function rectToClientRect(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function computeCoordsFromPlacement(t,e,n){let{reference:o,floating:i}=t;const l=getSideAxis(e),s=getAlignmentAxis(e),r=getAxisLength(s),a=getSide(e),c="y"===l,f=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,g=o[r]/2-i[r]/2;let m;switch(a){case"top":m={x:f,y:o.y-i.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-i.width,y:d};break;default:m={x:o.x,y:o.y}}switch(getAlignment(e)){case"start":m[s]-=g*(n&&c?-1:1);break;case"end":m[s]+=g*(n&&c?-1:1)}return m}const computePosition$1=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:s}=n,r=l.filter(Boolean),a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:d}=computeCoordsFromPlacement(c,o,a),g=o,m={},u=0;for(let n=0;n<r.length;n++){const{name:l,fn:p}=r[n],{x:h,y,data:w,reset:T}=await p({x:f,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});f=null!=h?h:f,d=null!=y?y:d,m={...m,[l]:{...m[l],...w}},T&&u<=50&&(u++,"object"==typeof T&&(T.placement&&(g=T.placement),T.rects&&(c=!0===T.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):T.rects),({x:f,y:d}=computeCoordsFromPlacement(c,g,a))),n=-1)}return{x:f,y:d,placement:g,strategy:i,middlewareData:m}};async function detectOverflow(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:l,rects:s,elements:r,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:m=0}=evaluate(e,t),u=getPaddingObject(m),p=r[g?"floating"===d?"reference":"floating":d],h=rectToClientRect(await l.getClippingRect({element:null==(n=await(null==l.isElement?void 0:l.isElement(p)))||n?p:p.contextElement||await(null==l.getDocumentElement?void 0:l.getDocumentElement(r.floating)),boundary:c,rootBoundary:f,strategy:a})),y="floating"===d?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==l.getOffsetParent?void 0:l.getOffsetParent(r.floating)),T=await(null==l.isElement?void 0:l.isElement(w))&&await(null==l.getScale?void 0:l.getScale(w))||{x:1,y:1},x=rectToClientRect(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:y,offsetParent:w,strategy:a}):y);return{top:(h.top-x.top+u.top)/T.y,bottom:(x.bottom-h.bottom+u.bottom)/T.y,left:(h.left-x.left+u.left)/T.x,right:(x.right-h.right+u.right)/T.x}}const arrow$1=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:s,elements:r,middlewareData:a}=e,{element:c,padding:f=0}=evaluate(t,e)||{};if(null==c)return{};const d=getPaddingObject(f),g={x:n,y:o},m=getAlignmentAxis(i),u=getAxisLength(m),p=await s.getDimensions(c),h="y"===m,y=h?"top":"left",w=h?"bottom":"right",T=h?"clientHeight":"clientWidth",x=l.reference[u]+l.reference[m]-g[m]-l.floating[u],v=g[m]-l.reference[m],E=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let b=E?E[T]:0;b&&await(null==s.isElement?void 0:s.isElement(E))||(b=r.floating[T]||l.floating[u]);const A=x/2-v/2,C=b/2-p[u]/2-1,S=min(d[y],C),O=min(d[w],C),R=S,P=b-p[u]-O,L=b/2-p[u]/2+A,N=clamp(R,L,P),D=!a.arrow&&null!=getAlignment(i)&&L!==N&&l.reference[u]/2-(L<R?S:O)-p[u]/2<0,H=D?L<R?L-R:L-P:0;return{[m]:g[m]+H,data:{[m]:N,centerOffset:L-N-H,...D&&{alignmentOffset:H}},reset:D}}}),flip$1=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:s,initialPlacement:r,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:p=!0,...h}=evaluate(t,e);if(null!=(n=l.arrow)&&n.alignmentOffset)return{};const y=getSide(i),w=getSideAxis(r),T=getSide(r)===r,x=await(null==a.isRTL?void 0:a.isRTL(c.floating)),v=g||(T||!p?[getOppositePlacement(r)]:getExpandedPlacements(r)),E="none"!==u;!g&&E&&v.push(...getOppositeAxisPlacements(r,p,u,x));const b=[r,...v],A=await detectOverflow(e,h),C=[];let S=(null==(o=l.flip)?void 0:o.overflows)||[];if(f&&C.push(A[y]),d){const t=getAlignmentSides(i,s,x);C.push(A[t[0]],A[t[1]])}if(S=[...S,{placement:i,overflows:C}],!C.every(t=>t<=0)){var O,R;const t=((null==(O=l.flip)?void 0:O.index)||0)+1,e=b[t];if(e&&("alignment"!==d||w===getSideAxis(e)||S.every(t=>getSideAxis(t.placement)!==w||t.overflows[0]>0)))return{data:{index:t,overflows:S},reset:{placement:e}};let n=null==(R=S.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:R.placement;if(!n)switch(m){case"bestFit":{var P;const t=null==(P=S.filter(t=>{if(E){const e=getSideAxis(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:P[0];t&&(n=t);break}case"initialPlacement":n=r}if(i!==n)return{reset:{placement:n}}}return{}}}};function getSideOffsets(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function isAnySideFullyClipped(t){return sides.some(e=>t[e]>=0)}const hide$1=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=evaluate(t,e);switch(o){case"referenceHidden":{const t=getSideOffsets(await detectOverflow(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:isAnySideFullyClipped(t)}}}case"escaped":{const t=getSideOffsets(await detectOverflow(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:isAnySideFullyClipped(t)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(t,e){const{placement:n,platform:o,elements:i}=t,l=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=getSide(n),r=getAlignment(n),a="y"===getSideAxis(n),c=originSides.has(s)?-1:1,f=l&&a?-1:1,d=evaluate(e,t);let{mainAxis:g,crossAxis:m,alignmentAxis:u}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return r&&"number"==typeof u&&(m="end"===r?-1*u:u),a?{x:m*f,y:g*c}:{x:g*c,y:m*f}}const offset$1=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:s,middlewareData:r}=e,a=await convertValueToCoords(e,t);return s===(null==(n=r.offset)?void 0:n.placement)&&null!=(o=r.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:l+a.y,data:{...a,placement:s}}}}},shift$1=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:s=!1,limiter:r={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...a}=evaluate(t,e),c={x:n,y:o},f=await detectOverflow(e,a),d=getSideAxis(getSide(i)),g=getOppositeAxis(d);let m=c[g],u=c[d];if(l){const t="y"===g?"bottom":"right";m=clamp(m+f["y"===g?"top":"left"],m,m-f[t])}if(s){const t="y"===d?"bottom":"right";u=clamp(u+f["y"===d?"top":"left"],u,u-f[t])}const p=r.fn({...e,[g]:m,[d]:u});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[g]:l,[d]:s}}}}}};function hasWindow(){return"undefined"!=typeof window}function getNodeName(t){return isNode(t)?(t.nodeName||"").toLowerCase():"#document"}function getWindow(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function getDocumentElement(t){var e;return null==(e=(isNode(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function isNode(t){return!!hasWindow()&&(t instanceof Node||t instanceof getWindow(t).Node)}function isElement(t){return!!hasWindow()&&(t instanceof Element||t instanceof getWindow(t).Element)}function isHTMLElement(t){return!!hasWindow()&&(t instanceof HTMLElement||t instanceof getWindow(t).HTMLElement)}function isShadowRoot(t){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof getWindow(t).ShadowRoot)}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=getComputedStyle$1(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!invalidOverflowDisplayValues.has(i)}const tableElements=new Set(["table","td","th"]);function isTableElement(t){return tableElements.has(getNodeName(t))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(t){return topLayerSelectors.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(t){const e=isWebKit(),n=isElement(t)?getComputedStyle$1(t):t;return transformProperties.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||willChangeValues.some(t=>(n.willChange||"").includes(t))||containValues.some(t=>(n.contain||"").includes(t))}function getContainingBlock(t){let e=getParentNode(t);for(;isHTMLElement(e)&&!isLastTraversableNode(e);){if(isContainingBlock(e))return e;if(isTopLayer(e))return null;e=getParentNode(e)}return null}function isWebKit(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(t){return lastTraversableNodeNames.has(getNodeName(t))}function getComputedStyle$1(t){return getWindow(t).getComputedStyle(t)}function getNodeScroll(t){return isElement(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function getParentNode(t){if("html"===getNodeName(t))return t;const e=t.assignedSlot||t.parentNode||isShadowRoot(t)&&t.host||getDocumentElement(t);return isShadowRoot(e)?e.host:e}function getNearestOverflowAncestor(t){const e=getParentNode(t);return isLastTraversableNode(e)?t.ownerDocument?t.ownerDocument.body:t.body:isHTMLElement(e)&&isOverflowElement(e)?e:getNearestOverflowAncestor(e)}function getOverflowAncestors(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=getNearestOverflowAncestor(t),l=i===(null==(o=t.ownerDocument)?void 0:o.body),s=getWindow(i);if(l){const t=getFrameElement(s);return e.concat(s,s.visualViewport||[],isOverflowElement(i)?i:[],t&&n?getOverflowAncestors(t):[])}return e.concat(i,getOverflowAncestors(i,[],n))}function getFrameElement(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function getCssDimensions(t){const e=getComputedStyle$1(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=isHTMLElement(t),l=i?t.offsetWidth:n,s=i?t.offsetHeight:o,r=round(n)!==l||round(o)!==s;return r&&(n=l,o=s),{width:n,height:o,$:r}}function unwrapElement(t){return isElement(t)?t:t.contextElement}function getScale(t){const e=unwrapElement(t);if(!isHTMLElement(e))return createCoords(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=getCssDimensions(e);let s=(l?round(n.width):n.width)/o,r=(l?round(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),r&&Number.isFinite(r)||(r=1),{x:s,y:r}}const noOffsets=createCoords(0);function getVisualOffsets(t){const e=getWindow(t);return isWebKit()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==getWindow(t))&&e}function getBoundingClientRect(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),l=unwrapElement(t);let s=createCoords(1);e&&(o?isElement(o)&&(s=getScale(o)):s=getScale(t));const r=shouldAddVisualOffsets(l,n,o)?getVisualOffsets(l):createCoords(0);let a=(i.left+r.x)/s.x,c=(i.top+r.y)/s.y,f=i.width/s.x,d=i.height/s.y;if(l){const t=getWindow(l),e=o&&isElement(o)?getWindow(o):o;let n=t,i=getFrameElement(n);for(;i&&o&&e!==n;){const t=getScale(i),e=i.getBoundingClientRect(),o=getComputedStyle$1(i),l=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,d*=t.y,a+=l,c+=s,n=getWindow(i),i=getFrameElement(n)}}return rectToClientRect({width:f,height:d,x:a,y:c})}function getWindowScrollBarX(t,e){const n=getNodeScroll(t).scrollLeft;return e?e.left+n:getBoundingClientRect(getDocumentElement(t)).left+n}function getHTMLOffset(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-getWindowScrollBarX(t,n),y:n.top+e.scrollTop}}function convertOffsetParentRelativeRectToViewportRelativeRect(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l="fixed"===i,s=getDocumentElement(o),r=!!e&&isTopLayer(e.floating);if(o===s||r&&l)return n;let a={scrollLeft:0,scrollTop:0},c=createCoords(1);const f=createCoords(0),d=isHTMLElement(o);if((d||!d&&!l)&&(("body"!==getNodeName(o)||isOverflowElement(s))&&(a=getNodeScroll(o)),isHTMLElement(o))){const t=getBoundingClientRect(o);c=getScale(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const g=!s||d||l?createCoords(0):getHTMLOffset(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+g.x,y:n.y*c.y-a.scrollTop*c.y+f.y+g.y}}function getClientRects(t){return Array.from(t.getClientRects())}function getDocumentRect(t){const e=getDocumentElement(t),n=getNodeScroll(t),o=t.ownerDocument.body,i=max(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=max(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+getWindowScrollBarX(t);const r=-n.scrollTop;return"rtl"===getComputedStyle$1(o).direction&&(s+=max(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:s,y:r}}const SCROLLBAR_MAX=25;function getViewportRect(t,e){const n=getWindow(t),o=getDocumentElement(t),i=n.visualViewport;let l=o.clientWidth,s=o.clientHeight,r=0,a=0;if(i){l=i.width,s=i.height;const t=isWebKit();(!t||t&&"fixed"===e)&&(r=i.offsetLeft,a=i.offsetTop)}const c=getWindowScrollBarX(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(l-=s)}else c<=25&&(l+=c);return{width:l,height:s,x:r,y:a}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(t,e){const n=getBoundingClientRect(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=isHTMLElement(t)?getScale(t):createCoords(1);return{width:t.clientWidth*l.x,height:t.clientHeight*l.y,x:i*l.x,y:o*l.y}}function getClientRectFromClippingAncestor(t,e,n){let o;if("viewport"===e)o=getViewportRect(t,n);else if("document"===e)o=getDocumentRect(getDocumentElement(t));else if(isElement(e))o=getInnerBoundingClientRect(e,n);else{const n=getVisualOffsets(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return rectToClientRect(o)}function hasFixedPositionAncestor(t,e){const n=getParentNode(t);return!(n===e||!isElement(n)||isLastTraversableNode(n))&&("fixed"===getComputedStyle$1(n).position||hasFixedPositionAncestor(n,e))}function getClippingElementAncestors(t,e){const n=e.get(t);if(n)return n;let o=getOverflowAncestors(t,[],!1).filter(t=>isElement(t)&&"body"!==getNodeName(t)),i=null;const l="fixed"===getComputedStyle$1(t).position;let s=l?getParentNode(t):t;for(;isElement(s)&&!isLastTraversableNode(s);){const e=getComputedStyle$1(s),n=isContainingBlock(s);n||"fixed"!==e.position||(i=null),(l?!n&&!i:!n&&"static"===e.position&&i&&absoluteOrFixed.has(i.position)||isOverflowElement(s)&&!n&&hasFixedPositionAncestor(t,s))?o=o.filter(t=>t!==s):i=e,s=getParentNode(s)}return e.set(t,o),o}function getClippingRect(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[..."clippingAncestors"===n?isTopLayer(e)?[]:getClippingElementAncestors(e,this._c):[].concat(n),o],s=l[0],r=l.reduce((t,n)=>{const o=getClientRectFromClippingAncestor(e,n,i);return t.top=max(o.top,t.top),t.right=min(o.right,t.right),t.bottom=min(o.bottom,t.bottom),t.left=max(o.left,t.left),t},getClientRectFromClippingAncestor(e,s,i));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}}function getDimensions(t){const{width:e,height:n}=getCssDimensions(t);return{width:e,height:n}}function getRectRelativeToOffsetParent(t,e,n){const o=isHTMLElement(e),i=getDocumentElement(e),l="fixed"===n,s=getBoundingClientRect(t,!0,l,e);let r={scrollLeft:0,scrollTop:0};const a=createCoords(0);function c(){a.x=getWindowScrollBarX(i)}if(o||!o&&!l)if(("body"!==getNodeName(e)||isOverflowElement(i))&&(r=getNodeScroll(e)),o){const t=getBoundingClientRect(e,!0,l,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();l&&!o&&i&&c();const f=!i||o||l?createCoords(0):getHTMLOffset(i,r);return{x:s.left+r.scrollLeft-a.x-f.x,y:s.top+r.scrollTop-a.y-f.y,width:s.width,height:s.height}}function isStaticPositioned(t){return"static"===getComputedStyle$1(t).position}function getTrueOffsetParent(t,e){if(!isHTMLElement(t)||"fixed"===getComputedStyle$1(t).position)return null;if(e)return e(t);let n=t.offsetParent;return getDocumentElement(t)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(t,e){const n=getWindow(t);if(isTopLayer(t))return n;if(!isHTMLElement(t)){let e=getParentNode(t);for(;e&&!isLastTraversableNode(e);){if(isElement(e)&&!isStaticPositioned(e))return e;e=getParentNode(e)}return n}let o=getTrueOffsetParent(t,e);for(;o&&isTableElement(o)&&isStaticPositioned(o);)o=getTrueOffsetParent(o,e);return o&&isLastTraversableNode(o)&&isStaticPositioned(o)&&!isContainingBlock(o)?n:o||getContainingBlock(t)||n}const getElementRects=async function(t){const e=this.getOffsetParent||getOffsetParent,n=this.getDimensions,o=await n(t.floating);return{reference:getRectRelativeToOffsetParent(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function isRTL(t){return"rtl"===getComputedStyle$1(t).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function observeMove(t,e){let n,o=null;const i=getDocumentElement(t);function l(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function s(r,a){void 0===r&&(r=!1),void 0===a&&(a=1),l();const c=t.getBoundingClientRect(),{left:f,top:d,width:g,height:m}=c;if(r||e(),!g||!m)return;const u={rootMargin:-floor(d)+"px "+-floor(i.clientWidth-(f+g))+"px "+-floor(i.clientHeight-(d+m))+"px "+-floor(f)+"px",threshold:max(0,min(1,a))||1};let p=!0;function h(e){const o=e[0].intersectionRatio;if(o!==a){if(!p)return s();o?s(!1,o):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==o||rectsAreEqual(c,t.getBoundingClientRect())||s(),p=!1}try{o=new IntersectionObserver(h,{...u,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(h,u)}o.observe(t)}(!0),l}function autoUpdate(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,c=unwrapElement(t),f=i||l?[...c?getOverflowAncestors(c):[],...getOverflowAncestors(e)]:[];f.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),l&&t.addEventListener("resize",n)});const d=c&&r?observeMove(c,n):null;let g,m=-1,u=null;s&&(u=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=u)||t.observe(e)})),n()}),c&&!a&&u.observe(c),u.observe(e));let p=a?getBoundingClientRect(t):null;return a&&function e(){const o=getBoundingClientRect(t);p&&!rectsAreEqual(p,o)&&n(),p=o,g=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{i&&t.removeEventListener("scroll",n),l&&t.removeEventListener("resize",n)}),null==d||d(),null==(t=u)||t.disconnect(),u=null,a&&cancelAnimationFrame(g)}}const offset=offset$1,shift=shift$1,flip=flip$1,hide=hide$1,arrow=arrow$1,computePosition=(t,e,n)=>{const o=new Map,i={platform,...n},l={...i.platform,_c:o};return computePosition$1(t,e,{...i,platform:l})};class TooltipInstance{constructor(t,e){this.referenceElement=t,this.config=e,this.cleanupAutoUpdate=null,this.isVisible=!1,this.isDestroyed=!1,this.pendingDestroy=!1,this.createFloatingElement(),this.createArrowElement()}show(){this.pendingDestroy=!1,this.isVisible||(this.config.onShow&&this.config.onShow(),this.isVisible=!0,this.appendToTarget(),this.cleanupAutoUpdate=autoUpdate(this.referenceElement,this.floatingElement,()=>this.updatePosition()),this.updatePosition(),this.floatingElement.style.visibility="visible",this.floatingElement.style.opacity="0.9")}hide(){this.isVisible&&(this.isVisible=!1,this.config.onHide&&this.config.onHide(),this.floatingElement.style.visibility="hidden",this.floatingElement.style.opacity="0",this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null))}setContent(t){const e=this.floatingElement.querySelector(".tooltip-content");e&&(this.config.allowHTML?e.innerHTML=t:e.textContent=t)}destroy(){this.isDestroyed||(this.pendingDestroy=!0,setTimeout(()=>{this.pendingDestroy&&(this.hide(),this.floatingElement&&this.floatingElement.remove(),this.isDestroyed=!0,delete this.floatingElement.tooltipTarget,delete this.referenceElement._tooltipInstance,delete this.referenceElement.hideTooltip)},TooltipInstance.DESTROY_DELAY_MS))}createFloatingElement(){var t,e;this.floatingElement=document.createElement("div"),this.floatingElement.className="tooltip-box",this.floatingElement.dataset.theme=this.config.theme,this.floatingElement.style.position="absolute",this.floatingElement.style.top="0",this.floatingElement.style.left="0",this.floatingElement.style.visibility="hidden",this.floatingElement.style.opacity="0",this.floatingElement.style.transition="opacity 0.2s ease-in-out",this.floatingElement.style.zIndex="9999";const n=document.createElement("div");n.className="tooltip-content",this.config.allowHTML?n.innerHTML=null!==(t=this.config.content)&&void 0!==t?t:"":n.textContent=null!==(e=this.config.content)&&void 0!==e?e:"",this.floatingElement.appendChild(n),this.floatingElement.tooltipTarget=this.referenceElement,this.referenceElement.hideTooltip=()=>{this.destroy()}}createArrowElement(){this.arrowElement=document.createElement("div"),this.arrowElement.className="tooltip-arrow",this.arrowElement.style.position="absolute",this.floatingElement.appendChild(this.arrowElement)}appendToTarget(){const t=this.config.appendTo;let e;e="function"==typeof t?t(this.referenceElement):"parent"===t?this.referenceElement.parentElement||document.body:t,e.appendChild(this.floatingElement)}async updatePosition(){const t=[hide(),flip(),offset(8),shift({padding:5}),arrow({element:this.arrowElement})],e=this.mapPlacement(this.config.placement),{x:n,y:o,placement:i,middlewareData:l}=await computePosition(this.referenceElement,this.floatingElement,{placement:e,middleware:t});if(l.hide&&Object.assign(this.floatingElement.style,{visibility:l.hide.referenceHidden?"hidden":"visible"}),Object.assign(this.floatingElement.style,{left:`${n}px`,top:`${o}px`}),this.floatingElement.dataset.placement=i,l.arrow){const{x:t,y:e}=l.arrow,n={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];this.arrowElement.dataset.placement=n,Object.assign(this.arrowElement.style,{left:null===t?"":`${t}px`,top:null===e?"":`${e}px`,[n]:"-5px"})}}mapPlacement(t){return t&&"auto"!==t?t:"right"}}TooltipInstance.DESTROY_DELAY_MS=100;class TooltipUtil{static getTooltipInstance(t){return t._tooltipInstance}static createTooltip(t){t.classList.add(TooltipUtil.TOOLTIP_CLASS);const e=new TooltipInstance(t,TooltipUtil.getConfig(t));return t._tooltipInstance=e,e}static getOrCreateTooltipInstance(t){return TooltipUtil.getTooltipInstance(t)||TooltipUtil.createTooltip(t)}static getConfig(t){return(new OntoTooltipConfiguration).setContent(t.getAttribute(TooltipUtil.ATTR_CONTENT)).setTheme(t.getAttribute(TooltipUtil.ATTR_THEME)).setPlacement(t.getAttribute(TooltipUtil.ATTR_PLACEMENT)).setAppendTo(t.getAttribute(TooltipUtil.ATTR_APPEND_TO))}static updateTooltipContent(t,e){const n=TooltipUtil.getTooltipInstance(t);n&&""!==e&&n.setContent(e)}static destroyTooltip(t){const e=TooltipUtil.getTooltipInstance(t);t.classList.contains(TooltipUtil.TOOLTIP_CLASS)&&e&&e.destroy()}static getTooltipTarget(t){for(;t&&!t.getAttribute(TooltipUtil.ATTR_CONTENT);)t=t.parentElement;return t}static getTooltip(t){for(;t&&!t.classList.contains("tooltip-box");)t=t.parentElement;return t}}TooltipUtil.ATTR_CONTENT="tooltip-content",TooltipUtil.ATTR_THEME="tooltip-theme",TooltipUtil.ATTR_PLACEMENT="tooltip-placement",TooltipUtil.ATTR_APPEND_TO="tooltip-append-to",TooltipUtil.TOOLTIP_CLASS="onto-tooltip",exports.TooltipUtil=TooltipUtil;