UNPKG

bootstrap-vue-next

Version:

BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.

3 lines (2 loc) 33.4 kB
"use strict";const e=require("vue"),t=require("./index-DiURjA3G.js"),n=require("./useDefaults-q0yyNSBk.js"),o=require("./index-BjjsoN-a.js"),l=require("./useId-CVpYZavN.js"),i=require("./getElement-BPs-1fVW.js"),r=require("./ConditionalTeleport.vue_vue_type_script_lang-DOGq8bM-.js"),a=require("./useShowHide-DS_Hoj66.js"),s=require("./_plugin-vue_export-helper-CC_fc8JW.js"),u=["top","right","bottom","left"],c=["start","end"],d=u.reduce(((e,t)=>e.concat(t,t+"-"+c[0],t+"-"+c[1])),[]),f=Math.min,p=Math.max,m=Math.round,v=Math.floor,h=e=>({x:e,y:e}),g={left:"right",right:"left",bottom:"top",top:"bottom"},y={start:"end",end:"start"};function w(e,t,n){return p(e,f(t,n))}function x(e,t){return"function"==typeof e?e(t):e}function b(e){return e.split("-")[0]}function R(e){return e.split("-")[1]}function B(e){return"x"===e?"y":"x"}function T(e){return"y"===e?"height":"width"}function E(e){return["top","bottom"].includes(b(e))?"y":"x"}function A(e){return B(E(e))}function C(e,t,n){void 0===n&&(n=!1);const o=R(e),l=A(e),i=T(l);let r="x"===l?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=P(r)),[r,P(r)]}function L(e){return e.replace(/start|end/g,(e=>y[e]))}function P(e){return e.replace(/left|right|bottom|top/g,(e=>g[e]))}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 k(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function D(e,t,n){let{reference:o,floating:l}=e;const i=E(t),r=A(t),a=T(r),s=b(t),u="y"===i,c=o.x+o.width/2-l.width/2,d=o.y+o.height/2-l.height/2,f=o[a]/2-l[a]/2;let p;switch(s){case"top":p={x:c,y:o.y-l.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-l.width,y:d};break;default:p={x:o.x,y:o.y}}switch(R(t)){case"start":p[r]-=f*(n&&u?-1:1);break;case"end":p[r]+=f*(n&&u?-1:1)}return p}async function _(e,t){var n;void 0===t&&(t={});const{x:o,y:l,platform:i,rects:r,elements:a,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=x(t,e),m=S(p),v=a[f?"floating"===d?"reference":"floating":d],h=k(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:s})),g="floating"===d?{x:o,y:l,width:r.floating.width,height:r.floating.height}:r.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=k(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:s}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function H(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O(e){return u.some((t=>e[t]>=0))}function V(e){const t=f(...e.map((e=>e.left))),n=f(...e.map((e=>e.top)));return{x:t,y:n,width:p(...e.map((e=>e.right)))-t,height:p(...e.map((e=>e.bottom)))-n}}function F(){return"undefined"!=typeof window}function M(e){return $(e)?(e.nodeName||"").toLowerCase():"#document"}function z(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function N(e){var t;return null==(t=($(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $(e){return!!F()&&(e instanceof Node||e instanceof z(e).Node)}function W(e){return!!F()&&(e instanceof Element||e instanceof z(e).Element)}function j(e){return!!F()&&(e instanceof HTMLElement||e instanceof z(e).HTMLElement)}function q(e){return!(!F()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof z(e).ShadowRoot)}function I(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(l)}function X(e){return["table","td","th"].includes(M(e))}function U(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function Y(e){const t=Z(),n=W(e)?J(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Z(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function G(e){return["html","body","#document"].includes(M(e))}function J(e){return z(e).getComputedStyle(e)}function K(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if("html"===M(e))return e;const t=e.assignedSlot||e.parentNode||q(e)&&e.host||N(e);return q(t)?t.host:t}function ee(e){const t=Q(e);return G(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&I(t)?t:ee(t)}function te(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const l=ee(e),i=l===(null==(o=e.ownerDocument)?void 0:o.body),r=z(l);if(i){const e=ne(r);return t.concat(r,r.visualViewport||[],I(l)?l:[],e&&n?te(e):[])}return t.concat(l,te(l,[],n))}function ne(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oe(e){const t=J(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=j(e),i=l?e.offsetWidth:n,r=l?e.offsetHeight:o,a=m(n)!==i||m(o)!==r;return a&&(n=i,o=r),{width:n,height:o,$:a}}function le(e){return W(e)?e:e.contextElement}function ie(e){const t=le(e);if(!j(t))return h(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:i}=oe(t);let r=(i?m(n.width):n.width)/o,a=(i?m(n.height):n.height)/l;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const re=h(0);function ae(e){const t=z(e);return Z()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:re}function se(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),i=le(e);let r=h(1);t&&(o?W(o)&&(r=ie(o)):r=ie(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==z(e))&&t}(i,n,o)?ae(i):h(0);let s=(l.left+a.x)/r.x,u=(l.top+a.y)/r.y,c=l.width/r.x,d=l.height/r.y;if(i){const e=z(i),t=o&&W(o)?z(o):o;let n=e,l=ne(n);for(;l&&o&&t!==n;){const e=ie(l),t=l.getBoundingClientRect(),o=J(l),i=t.left+(l.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(l.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,u*=e.y,c*=e.x,d*=e.y,s+=i,u+=r,n=z(l),l=ne(n)}}return k({width:c,height:d,x:s,y:u})}function ue(e,t){const n=K(e).scrollLeft;return t?t.left+n:se(N(e)).left+n}function ce(e,t,n){void 0===n&&(n=!1);const o=e.getBoundingClientRect();return{x:o.left+t.scrollLeft-(n?0:ue(e,o)),y:o.top+t.scrollTop}}function de(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=z(e),o=N(e),l=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,s=0;if(l){i=l.width,r=l.height;const e=Z();(!e||e&&"fixed"===t)&&(a=l.offsetLeft,s=l.offsetTop)}return{width:i,height:r,x:a,y:s}}(e,n);else if("document"===t)o=function(e){const t=N(e),n=K(e),o=e.ownerDocument.body,l=p(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=p(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ue(e);const a=-n.scrollTop;return"rtl"===J(o).direction&&(r+=p(t.clientWidth,o.clientWidth)-l),{width:l,height:i,x:r,y:a}}(N(e));else if(W(t))o=function(e,t){const n=se(e,!0,"fixed"===t),o=n.top+e.clientTop,l=n.left+e.clientLeft,i=j(e)?ie(e):h(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:l*i.x,y:o*i.y}}(t,n);else{const n=ae(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return k(o)}function fe(e,t){const n=Q(e);return!(n===t||!W(n)||G(n))&&("fixed"===J(n).position||fe(n,t))}function pe(e,t,n){const o=j(t),l=N(t),i="fixed"===n,r=se(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=h(0);if(o||!o&&!i)if(("body"!==M(t)||I(l))&&(a=K(t)),o){const e=se(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else l&&(s.x=ue(l));const u=!l||o||i?h(0):ce(l,a);return{x:r.left+a.scrollLeft-s.x-u.x,y:r.top+a.scrollTop-s.y-u.y,width:r.width,height:r.height}}function me(e){return"static"===J(e).position}function ve(e,t){if(!j(e)||"fixed"===J(e).position)return null;if(t)return t(e);let n=e.offsetParent;return N(e)===n&&(n=n.ownerDocument.body),n}function he(e,t){const n=z(e);if(U(e))return n;if(!j(e)){let t=Q(e);for(;t&&!G(t);){if(W(t)&&!me(t))return t;t=Q(t)}return n}let o=ve(e,t);for(;o&&X(o)&&me(o);)o=ve(o,t);return o&&G(o)&&me(o)&&!Y(o)?n:o||function(e){let t=Q(e);for(;j(t)&&!G(t);){if(Y(t))return t;if(U(t))return null;t=Q(t)}return null}(e)||n}const ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const i="fixed"===l,r=N(o),a=!!t&&U(t.floating);if(o===r||a&&i)return n;let s={scrollLeft:0,scrollTop:0},u=h(1);const c=h(0),d=j(o);if((d||!d&&!i)&&(("body"!==M(o)||I(r))&&(s=K(o)),j(o))){const e=se(o);u=ie(o),c.x=e.x+o.clientLeft,c.y=e.y+o.clientTop}const f=!r||d||i?h(0):ce(r,s,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-s.scrollTop*u.y+c.y+f.y}},getDocumentElement:N,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const i=[..."clippingAncestors"===n?U(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=te(e,[],!1).filter((e=>W(e)&&"body"!==M(e))),l=null;const i="fixed"===J(e).position;let r=i?Q(e):e;for(;W(r)&&!G(r);){const t=J(r),n=Y(r);n||"fixed"!==t.position||(l=null),(i?!n&&!l:!n&&"static"===t.position&&l&&["absolute","fixed"].includes(l.position)||I(r)&&!n&&fe(e,r))?o=o.filter((e=>e!==r)):l=t,r=Q(r)}return t.set(e,o),o}(t,this._c):[].concat(n),o],r=i[0],a=i.reduce(((e,n)=>{const o=de(t,n,l);return e.top=p(o.top,e.top),e.right=f(o.right,e.right),e.bottom=f(o.bottom,e.bottom),e.left=p(o.left,e.left),e}),de(t,r,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:he,getElementRects:async function(e){const t=this.getOffsetParent||he,n=this.getDimensions,o=await n(e.floating);return{reference:pe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=oe(e);return{width:t,height:n}},getScale:ie,isElement:W,isRTL:function(e){return"rtl"===J(e).direction}};function ye(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:i=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,u=le(e),c=l||i?[...u?te(u):[],...te(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=u&&a?function(e,t){let n,o=null;const l=N(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const{left:u,top:c,width:d,height:m}=e.getBoundingClientRect();if(a||t(),!d||!m)return;const h={rootMargin:-v(c)+"px "+-v(l.clientWidth-(u+d))+"px "+-v(l.clientHeight-(c+m))+"px "+-v(u)+"px",threshold:p(0,f(1,s))||1};let g=!0;function y(e){const t=e[0].intersectionRatio;if(t!==s){if(!g)return r();t?r(!1,t):n=setTimeout((()=>{r(!1,1e-7)}),1e3)}g=!1}try{o=new IntersectionObserver(y,{...h,root:l.ownerDocument})}catch(w){o=new IntersectionObserver(y,h)}o.observe(e)}(!0),i}(u,n):null;let m,h=-1,g=null;r&&(g=new ResizeObserver((e=>{let[o]=e;o&&o.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),u&&!s&&g.observe(u),g.observe(t));let y=s?se(e):null;return s&&function t(){const o=se(e);!y||o.x===y.x&&o.y===y.y&&o.width===y.width&&o.height===y.height||n();y=o,m=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=g)||e.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const we=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:l,y:i,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:n,platform:o,elements:l}=e,i=await(null==o.isRTL?void 0:o.isRTL(l.floating)),r=b(n),a=R(n),s="y"===E(n),u=["left","top"].includes(r)?-1:1,c=i&&s?-1:1,d=x(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*c,y:f*u}:{x:f*u,y:p*c}}(t,e);return r===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:l+s.x,y:i+s.y,data:{...s,placement:r}}}}},xe=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,l;const{rects:i,middlewareData:r,placement:a,platform:s,elements:u}=t,{crossAxis:c=!1,alignment:f,allowedPlacements:p=d,autoAlignment:m=!0,...v}=x(e,t),h=void 0!==f||p===d?function(e,t,n){return(e?[...n.filter((t=>R(t)===e)),...n.filter((t=>R(t)!==e))]:n.filter((e=>b(e)===e))).filter((n=>!e||R(n)===e||!!t&&L(n)!==n))}(f||null,m,p):p,g=await _(t,v),y=(null==(n=r.autoPlacement)?void 0:n.index)||0,w=h[y];if(null==w)return{};const B=C(w,i,await(null==s.isRTL?void 0:s.isRTL(u.floating)));if(a!==w)return{reset:{placement:h[0]}};const T=[g[b(w)],g[B[0]],g[B[1]]],E=[...(null==(o=r.autoPlacement)?void 0:o.overflows)||[],{placement:w,overflows:T}],A=h[y+1];if(A)return{data:{index:y+1,overflows:E},reset:{placement:A}};const P=E.map((e=>{const t=R(e.placement);return[e.placement,t&&c?e.overflows.slice(0,2).reduce(((e,t)=>e+t),0):e.overflows[0],e.overflows]})).sort(((e,t)=>e[1]-t[1])),S=(null==(l=P.filter((e=>e[2].slice(0,R(e[0])?2:3).every((e=>e<=0))))[0])?void 0:l[0])||P[0][0];return S!==a?{data:{index:y+1,overflows:E},reset:{placement:S}}:{}}}},be=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=x(e,t),u={x:n,y:o},c=await _(t,s),d=E(b(l)),f=B(d);let p=u[f],m=u[d];if(i){const e="y"===f?"bottom":"right";p=w(p+c["y"===f?"top":"left"],p,p-c[e])}if(r){const e="y"===d?"bottom":"right";m=w(m+c["y"===d?"top":"left"],m,m-c[e])}const v=a.fn({...t,[f]:p,[d]:m});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[f]:i,[d]:r}}}}}},Re=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:l,middlewareData:i,rects:r,initialPlacement:a,platform:s,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=x(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=b(l),y=E(a),w=b(a)===a,B=await(null==s.isRTL?void 0:s.isRTL(u.floating)),T=f||(w||!v?[P(a)]:function(e){const t=P(e);return[L(e),t,L(t)]}(a)),A="none"!==m;!f&&A&&T.push(...function(e,t,n,o){const l=R(e);let i=function(e,t,n){const o=["left","right"],l=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?l:o:t?o:l;case"left":case"right":return t?i:r;default:return[]}}(b(e),"start"===n,o);return l&&(i=i.map((e=>e+"-"+l)),t&&(i=i.concat(i.map(L)))),i}(a,v,m,B));const S=[a,...T],k=await _(t,h),D=[];let H=(null==(o=i.flip)?void 0:o.overflows)||[];if(c&&D.push(k[g]),d){const e=C(l,r,B);D.push(k[e[0]],k[e[1]])}if(H=[...H,{placement:l,overflows:D}],!D.every((e=>e<=0))){var O,V;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:H},reset:{placement:t}};let n=null==(V=H.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:V.placement;if(!n)switch(p){case"bestFit":{var F;const e=null==(F=H.filter((e=>{if(A){const t=E(e.placement);return t===y||"y"===t}return!0})).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:F[0];e&&(n=e);break}case"initialPlacement":n=a}if(l!==n)return{reset:{placement:n}}}return{}}}},Be=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:l,rects:i,platform:r,elements:a}=t,{apply:s=()=>{},...u}=x(e,t),c=await _(t,u),d=b(l),m=R(l),v="y"===E(l),{width:h,height:g}=i.floating;let y,w;"top"===d||"bottom"===d?(y=d,w=m===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,y="end"===m?"top":"bottom");const B=g-c.top-c.bottom,T=h-c.left-c.right,A=f(g-c[y],B),C=f(h-c[w],T),L=!t.middlewareData.shift;let P=A,S=C;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=T),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(P=B),L&&!m){const e=p(c.left,0),t=p(c.right,0),n=p(c.top,0),o=p(c.bottom,0);v?S=h-2*(0!==e||0!==t?e+t:p(c.left,c.right)):P=g-2*(0!==n||0!==o?n+o:p(c.top,c.bottom))}await s({...t,availableWidth:S,availableHeight:P});const k=await r.getDimensions(a.floating);return h!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}},Te=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...l}=x(e,t);switch(o){case"referenceHidden":{const e=H(await _(t,{...l,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:O(e)}}}case"escaped":{const e=H(await _(t,{...l,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:O(e)}}}default:return{}}}}},Ee=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:l,rects:i,platform:r,elements:a,middlewareData:s}=t,{element:u,padding:c=0}=x(e,t)||{};if(null==u)return{};const d=S(c),p={x:n,y:o},m=A(l),v=T(m),h=await r.getDimensions(u),g="y"===m,y=g?"top":"left",b=g?"bottom":"right",B=g?"clientHeight":"clientWidth",E=i.reference[v]+i.reference[m]-p[m]-i.floating[v],C=p[m]-i.reference[m],L=await(null==r.getOffsetParent?void 0:r.getOffsetParent(u));let P=L?L[B]:0;P&&await(null==r.isElement?void 0:r.isElement(L))||(P=a.floating[B]||i.floating[v]);const k=E/2-C/2,D=P/2-h[v]/2-1,_=f(d[y],D),H=f(d[b],D),O=_,V=P-h[v]-H,F=P/2-h[v]/2+k,M=w(O,F,V),z=!s.arrow&&null!=R(l)&&F!==M&&i.reference[v]/2-(F<O?_:H)-h[v]/2<0,N=z?F<O?F-O:F-V:0;return{[m]:p[m]+N,data:{[m]:M,centerOffset:F-M-N,...z&&{alignmentOffset:N}},reset:z}}}),Ae=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:l,platform:i,strategy:r}=t,{padding:a=2,x:s,y:u}=x(e,t),c=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),d=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let o=null;for(let l=0;l<t.length;l++){const e=t[l];!o||e.y-o.y>o.height/2?n.push([e]):n[n.length-1].push(e),o=e}return n.map((e=>k(V(e))))}(c),m=k(V(c)),v=S(a);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=s&&null!=u)return d.find((e=>s>e.left-v.left&&s<e.right+v.right&&u>e.top-v.top&&u<e.bottom+v.bottom))||m;if(d.length>=2){if("y"===E(n)){const e=d[0],t=d[d.length-1],o="top"===b(n),l=e.top,i=t.bottom,r=o?e.left:t.left,a=o?e.right:t.right;return{top:l,bottom:i,left:r,right:a,width:a-r,height:i-l,x:r,y:l}}const e="left"===b(n),t=p(...d.map((e=>e.right))),o=f(...d.map((e=>e.left))),l=d.filter((n=>e?n.left===o:n.right===t)),i=l[0].top,r=l[l.length-1].bottom;return{top:i,bottom:r,left:o,right:t,width:t-o,height:r-i,x:o,y:i}}return m}},floating:o.floating,strategy:r});return l.reference.x!==h.reference.x||l.reference.y!==h.reference.y||l.reference.width!==h.reference.width||l.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Ce=(e,t,n)=>{const o=new Map,l={platform:ge,...n},i={...l.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:l="absolute",middleware:i=[],platform:r}=n,a=i.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:l}),{x:c,y:d}=D(u,o,s),f=o,p={},m=0;for(let v=0;v<a.length;v++){const{name:n,fn:i}=a[v],{x:h,y:g,data:y,reset:w}=await i({x:c,y:d,initialPlacement:o,placement:f,strategy:l,middlewareData:p,rects:u,platform:r,elements:{reference:e,floating:t}});c=null!=h?h:c,d=null!=g?g:d,p={...p,[n]:{...p[n],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(u=!0===w.rects?await r.getElementRects({reference:e,floating:t,strategy:l}):w.rects),({x:c,y:d}=D(u,f,s))),v=-1)}return{x:c,y:d,placement:f,strategy:l,middlewareData:p}})(e,t,{...l,platform:i})};function Le(e){if(function(e){return null!=e&&"object"==typeof e&&"$el"in e}(e)){const t=e.$el;return $(t)&&"#comment"===M(t)?null:t}return e}function Pe(t){return"function"==typeof t?t():e.unref(t)}function Se(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ke(e,t){const n=Se(e);return Math.round(t*n)/n}function De(t,n,o){void 0===o&&(o={});const l=o.whileElementsMounted,i=e.computed((()=>{var e;return null==(e=Pe(o.open))||e})),r=e.computed((()=>Pe(o.middleware))),a=e.computed((()=>{var e;return null!=(e=Pe(o.placement))?e:"bottom"})),s=e.computed((()=>{var e;return null!=(e=Pe(o.strategy))?e:"absolute"})),u=e.computed((()=>{var e;return null==(e=Pe(o.transform))||e})),c=e.computed((()=>Le(t.value))),d=e.computed((()=>Le(n.value))),f=e.ref(0),p=e.ref(0),m=e.ref(s.value),v=e.ref(a.value),h=e.shallowRef({}),g=e.ref(!1),y=e.computed((()=>{const e={position:m.value,left:"0",top:"0"};if(!d.value)return e;const t=ke(d.value,f.value),n=ke(d.value,p.value);return u.value?{...e,transform:"translate("+t+"px, "+n+"px)",...Se(d.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:t+"px",top:n+"px"}}));let w;function x(){if(null==c.value||null==d.value)return;const e=i.value;Ce(c.value,d.value,{middleware:r.value,placement:a.value,strategy:s.value}).then((t=>{f.value=t.x,p.value=t.y,m.value=t.strategy,v.value=t.placement,h.value=t.middlewareData,g.value=!1!==e}))}function b(){"function"==typeof w&&(w(),w=void 0)}return e.watch([r,a,s,i],x,{flush:"sync"}),e.watch([c,d],(function(){b(),void 0!==l?null==c.value||null==d.value||(w=l(c.value,d.value,x)):x()}),{flush:"sync"}),e.watch(i,(function(){i.value||(g.value=!1)}),{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(b),{x:e.shallowReadonly(f),y:e.shallowReadonly(p),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(v),middlewareData:e.shallowReadonly(h),isPositioned:e.shallowReadonly(g),floatingStyles:y,update:x}}const _e=o.createSharedComposable(t.useMouse),He=["id"],Oe=["id"],Ve=e.defineComponent({inheritAttrs:!1,__name:"BPopover",props:e.mergeModels({boundary:{default:"clippingAncestors"},boundaryPadding:{default:void 0},click:{type:Boolean,default:!1},closeOnHide:{type:Boolean,default:!1},body:{default:void 0},customClass:{default:""},delay:{default:()=>({show:100,hide:300})},floatingMiddleware:{default:void 0},hideMargin:{default:2},id:{default:void 0},inline:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},noAutoClose:{type:Boolean,default:!1},noFlip:{type:Boolean,default:!1},noHide:{type:Boolean,default:!1},noShift:{type:Boolean,default:!1},noSize:{type:Boolean,default:!1},noninteractive:{type:Boolean,default:!1},offset:{default:null},placement:{default:"top"},realtime:{type:Boolean,default:!1},reference:{default:null},strategy:{default:"absolute"},target:{default:null},title:{default:void 0},tooltip:{type:Boolean,default:!1},variant:{default:null},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:e.mergeModels(["pointerleave","blur","click-outside","close-on-hide","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(s,{expose:u,emit:c}){const d=e.useAttrs();d.content&&console.warn("BPopover/BTooltip: `content` prop is deprecated. Use prop body or default slot instead.");const f=s,p=n.useDefaults(f,"BPopover"),m=c,v=e.useSlots(),h=e.useModel(s,"modelValue"),g=l.useId((()=>p.id),"popover"),y=e.ref(!1),w=e.useTemplateRef("_element"),x=e.useTemplateRef("_content"),b=e.useTemplateRef("_arrow"),R=e.useTemplateRef("_placeholder"),B=e.ref(null),T=e.ref(null),E=e.computed((()=>p.placement.startsWith("auto"))),A=o.useToNumber((()=>p.offset??NaN)),C=e.computed((()=>Ne(p.boundary)?p.boundary:void 0)),L=e.computed((()=>$e(p.boundary)?p.boundary:void 0)),P=e.ref({}),S=e.computed((()=>{if(void 0!==p.floatingMiddleware)return p.floatingMiddleware;const e=null!==p.offset?A.value:p.tooltip?6:8,t=[we(e)];var n;return!1!==p.noFlip||E.value||t.push(Re({boundary:C.value,rootBoundary:L.value,padding:p.boundaryPadding})),E.value&&t.push(xe({alignment:p.placement.split("-")[1]||void 0,boundary:C.value,rootBoundary:L.value,padding:p.boundaryPadding})),!1===p.noShift&&t.push(be({boundary:C.value,rootBoundary:L.value,padding:p.boundaryPadding})),!1===p.noHide&&t.push(Te({boundary:C.value,rootBoundary:L.value,padding:p.boundaryPadding})),!0===p.inline&&t.push(Ae()),t.push({name:"arrow",options:n={element:b,padding:10},fn(e){const t=Le(Pe(n.element));return null==t?{}:Ee({element:t,padding:n.padding}).fn(e)}}),!1===p.noSize&&t.push(Be({boundary:C.value,rootBoundary:L.value,padding:p.boundaryPadding,apply({availableWidth:e,availableHeight:t}){var n,o;P.value={maxHeight:t>=((null==(n=x.value)?void 0:n.scrollHeight)??0)?void 0:t?`${Math.max(0,t)}px`:void 0,maxWidth:e>=((null==(o=x.value)?void 0:o.scrollWidth)??0)?void 0:e?`${Math.max(0,e)}px`:void 0}}})),t})),k=e.computed((()=>E.value?void 0:p.placement)),{floatingStyles:D,middlewareData:_,placement:H,update:O}=De(B,w,{placement:k,middleware:S,strategy:e.toRef((()=>p.strategy))}),V=e.ref({position:"absolute"});let F;e.watch(_,(e=>{var t,n;if(!1===p.noHide&&((null==(t=e.hide)?void 0:t.referenceHidden)&&!y.value&&M.value?!p.closeOnHide||p.noAutoClose||p.manual?(Z.value=!0,y.value=!0):W("close-on-hide"):Z.value&&!(null==(n=e.hide)?void 0:n.referenceHidden)&&(Z.value=!1,y.value=!1)),e.arrow){const{x:t,y:n}=e.arrow;V.value={position:"absolute",top:n?`${n}px`:"",left:t?`${t}px`:""}}}));const{showRef:M,hide:z,show:N,toggle:$,throttleHide:W,computedNoAnimation:j,transitionProps:q,contentShowing:I,isVisible:X,isActive:U,renderRef:Y,localTemporaryHide:Z}=a.useShowHide(h,p,m,w,g,{showFn:()=>{O(),e.nextTick((()=>{F=ye(B.value,w.value,O,{animationFrame:p.realtime})}))},hideFn:()=>{F&&(F(),F=void 0)}}),G=e.computed((()=>{const e=p.tooltip?"tooltip":"popover";return[e,`b-${e}`,{[`b-${e}-${p.variant}`]:null!==p.variant,show:X.value&&!y.value,fade:!j.value,[`${p.customClass}`]:void 0!==p.customClass,[`bs-${e}-${Me(H.value)}`]:void 0!==H.value}]})),{x:J,y:K}=_e();let Q;const ee=e=>{var t,n;const{triggerIsOutside:o,isOutside:l}=(()=>{var e,t;const n=null==(e=T.value)?void 0:e.getBoundingClientRect(),o=null==(t=w.value)?void 0:t.getBoundingClientRect(),l=parseInt(p.hideMargin,10)||0,i=(null==window?void 0:window.scrollX)||0,r=(null==window?void 0:window.scrollY)||0;return{triggerIsOutside:!n||J.value<n.left+i-l||J.value>n.right+i+l||K.value<n.top+r-l||K.value>n.bottom+r+l,isOutside:!o||J.value<o.left+i-l||J.value>o.right+i+l||K.value<o.top+r-l||K.value>o.bottom+r+l}})();!p.noninteractive&&l&&o&&!(null==(t=w.value)?void 0:t.contains(null==document?void 0:document.activeElement))&&!(null==(n=T.value)?void 0:n.contains(null==document?void 0:document.activeElement))||p.noninteractive&&o?z(null==e?void 0:e.type):(Q&&clearTimeout(Q),Q=setTimeout((()=>{ee(e)}),50))};e.watch(X,(()=>{O()})),u({hide:z,show:N,toggle:$});const te=e=>{M.value?z("click"===e.type?"click":"toggle"):N()},ne=()=>{N()},oe=()=>{var t;if(p.target){const t=i.getElement(e.toValue(p.target));t?T.value=t:console.warn("Target element not found",p.target)}else T.value=null==(t=R.value)?void 0:t.nextElementSibling;if(p.reference){const t=i.getElement(e.toValue(p.reference));t?B.value=t:console.warn("Reference element not found",p.reference)}else B.value=T.value;T.value&&!p.manual&&(p.click?T.value.addEventListener("click",te):(T.value.addEventListener("pointerenter",ne),T.value.addEventListener("pointerleave",ee),T.value.addEventListener("focus",ne),T.value.addEventListener("blur",ee)))},le=()=>{T.value&&(T.value.removeEventListener("click",te),T.value.removeEventListener("pointerenter",ne),T.value.removeEventListener("pointerleave",ee),T.value.removeEventListener("focus",ne),T.value.removeEventListener("blur",ee))};t.onClickOutside(w,(()=>{M.value&&p.click&&!p.noAutoClose&&!p.manual&&z("click-outside")}),{ignore:[T]}),e.watch([()=>p.click,()=>p.manual,()=>p.target,()=>p.reference],(()=>{le(),oe()}));const ie=e.computed((()=>({toggle:$,show:N,hide:z,id:g.value,visible:X.value,active:U.value})));return e.onMounted((()=>{oe(),e.nextTick((()=>{O()}))})),e.onBeforeUnmount(le),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",{id:e.unref(g)+"_placeholder",ref:"_placeholder",style:{display:"none"}},null,8,He),e.renderSlot(t.$slots,"target",e.normalizeProps(e.guardReactiveProps(ie.value)),void 0,!0),e.createVNode(r._sfc_main,{to:e.unref(p).teleportTo,disabled:!e.unref(p).teleportTo||e.unref(p).teleportDisabled},{default:e.withCtx((()=>[e.unref(Y)||e.unref(I)?(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({key:0},e.unref(q),{appear:h.value||e.unref(p).visible}),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",e.mergeProps({id:e.unref(g)},e.unref(d),{ref:"_element",class:G.value,role:"tooltip",tabindex:"-1",style:e.unref(D)}),[e.createElementVNode("div",{ref:"_arrow",class:e.normalizeClass((e.unref(p).tooltip?"tooltip":"popover")+"-arrow"),style:e.normalizeStyle(V.value),"data-popper-arrow":""},null,6),e.createElementVNode("div",{ref:"_content",class:"overflow-auto",style:e.normalizeStyle(P.value)},[e.unref(p).title||v.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["position-sticky top-0",e.unref(p).tooltip?"tooltip-inner":"popover-header"])},[e.renderSlot(t.$slots,"title",e.normalizeProps(e.guardReactiveProps(ie.value)),(()=>[e.createTextVNode(e.toDisplayString(e.unref(p).title),1)]),!0)],2)):e.createCommentVNode("",!0),e.unref(p).tooltip&&!v.title&&!e.unref(p).title||!e.unref(p).tooltip?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(p).tooltip?"tooltip-inner":"popover-body")},[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(ie.value)),(()=>[e.createTextVNode(e.toDisplayString(e.unref(p).body)+e.toDisplayString(e.unref(d).content),1)]),!0)],2)):e.createCommentVNode("",!0)],4)],16,Oe),[[e.vShow,e.unref(M)&&!y.value]])])),_:3},16,["appear"])):e.createCommentVNode("",!0)])),_:3},8,["to","disabled"])],64))}}),Fe=s._export_sfc(Ve,[["__scopeId","data-v-2d32d03d"]]),Me=e=>{const[t]=e.split("-");switch(t){case"left":return"start";case"right":return"end";default:return t}},ze=e=>"object"!=typeof e||!1!==e.active,Ne=e=>"clippingAncestors"===e||e instanceof Element||Array.isArray(e),$e=e=>!Ne(e);exports.BPopover=Fe,exports.autoUpdate=ye,exports.bind=(t,n,o)=>{var l;const i=document.createElement("span");n.modifiers.body?document.body.appendChild(i):n.modifiers.child?t.appendChild(i):null==(l=t.parentNode)||l.insertBefore(i,t.nextSibling),e.render(e.h(Fe,o),i),t.$__element=i},exports.flip=Re,exports.isBoundary=Ne,exports.isRootBoundary=$e,exports.offset=we,exports.resolveActiveStatus=ze,exports.resolveBootstrapCaret=e=>{const[t]=e.split("-");switch(t){case"left":return"start";case"right":return"end";case"top":return"up";case"bottom":return"down";default:return t}},exports.resolveContent=(e,t)=>{if(!ze(e))return{};const n=void 0===e||"object"==typeof e&&!e.title&&!e.content&&!e.body,o=t.getAttribute("title")||t.getAttribute("data-original-title");return n?o?(t.removeAttribute("title"),t.setAttribute("data-original-title",o),{body:o}):{}:"string"==typeof e?{body:e}:((null==e?void 0:e.content)&&console.warn("v-b-popover/v-b-tooltip: `content` is deprecated, use `body` instead"),{title:(null==e?void 0:e.title)?null==e?void 0:e.title:void 0,body:(null==e?void 0:e.body)?null==e?void 0:e.body:(null==e?void 0:e.content)?null==e?void 0:e.content:void 0})},exports.resolveDirectiveProps=(e,t)=>({target:t,modelValue:e.modifiers.show,inline:e.modifiers.inline,click:e.modifiers.click,realtime:e.modifiers.realtime,lazy:e.modifiers.lazy,placement:e.modifiers.left?"left":e.modifiers.right?"right":e.modifiers.bottom?"bottom":e.modifiers.top?"top":void 0,..."object"==typeof e.value?e.value:void 0,...e.modifiers.interactive?{noninteractive:!1}:void 0,title:null,body:null}),exports.shift=be,exports.size=Be,exports.unbind=t=>{const n=t.$__element;n&&e.render(null,n),setTimeout((()=>{null==n||n.remove()}),0),delete t.$__element},exports.useFloating=De; //# sourceMappingURL=floatingUi-DtYxn9S5.js.map