Files
prod/frontend/dist/assets/Follower-iSO8rl8v.js
T
2026-10-11 02:38:28 +07:00

1 line
11 KiB
JavaScript

import{At as e,J as t,Mt as n,Pt as r,Rt as i,Ut as a,Vt as o,Y as s,_n as c,an as l,hn as u,kt as d,nn as f,qt as p,ut as m}from"./client-Cr-cm5gA.js";import{d as h,u as g}from"./Card-BKTR7RSt.js";import{C as _,_ as v,f as y,g as b,h as x,p as S,v as C,x as w}from"./Suffix-CvlR_XVb.js";import{Q as T,Z as E}from"./index-DvRZPtUt.js";var D=[],O=new WeakMap;function k(){D.forEach(e=>e(...O.get(e))),D=[]}function A(e,...t){O.set(e,t),!D.includes(e)&&D.push(e)===1&&requestAnimationFrame(k)}var j=_?document?.fonts?.ready:void 0,M=!1;j===void 0?M=!0:j.then(()=>{M=!0});function N(e){if(M)return;let t=!1;a(()=>{M||j?.then(()=>{t||e()})}),o(()=>{t=!0})}var P=s(`n-internal-select-menu`),F=s(`n-internal-select-menu-body`),I=`__disabled__`;function L(e){let t=r(C,null),n=r(w,null),i=r(v,null),s=r(F,null),c=u();if(typeof document<`u`){c.value=document.fullscreenElement;let e=()=>{c.value=document.fullscreenElement};a(()=>{h(`fullscreenchange`,document,e)}),o(()=>{g(`fullscreenchange`,document,e)})}return T(()=>{let{to:r}=e;return r===void 0?t?.value?t.value.$el??t.value:n?.value?n.value:i?.value?i.value:s?.value?s.value:r??(c.value||`body`):r===!1?I:r===!0?c.value||`body`:r})}L.tdkey=I,L.propTo={type:[String,Object,Boolean],default:void 0};var R=null;function z(){if(R===null&&(R=document.getElementById(`v-binder-view-measurer`),R===null)){R=document.createElement(`div`),R.id=`v-binder-view-measurer`;let{style:e}=R;e.position=`fixed`,e.left=`0`,e.right=`0`,e.top=`0`,e.bottom=`0`,e.pointerEvents=`none`,e.visibility=`hidden`,document.body.appendChild(R)}return R.getBoundingClientRect()}function B(e,t){let n=z();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function V(e){let t=e.getBoundingClientRect(),n=z();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function H(e){return e.nodeType===9?null:e.parentNode}function U(e){if(e===null)return null;let t=H(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){let{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return U(t)}var W=d({name:`Binder`,props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){p(`VBinder`,e()?.proxy);let n=r(`VBinder`,null),i=u(null),a=e=>{i.value=e,n&&t.syncTargetWithParent&&n.setTargetRef(e)},s=[],c=()=>{let e=i.value;for(;e=U(e),e!==null;)s.push(e);for(let e of s)h(`scroll`,e,_,!0)},l=()=>{for(let e of s)g(`scroll`,e,_,!0);s=[]},d=new Set,f=e=>{d.size===0&&c(),d.has(e)||d.add(e)},m=e=>{d.has(e)&&d.delete(e),d.size===0&&l()},_=()=>{A(v)},v=()=>{d.forEach(e=>e())},y=new Set,b=e=>{y.size===0&&h(`resize`,window,S),y.has(e)||y.add(e)},x=e=>{y.has(e)&&y.delete(e),y.size===0&&g(`resize`,window,S)},S=()=>{y.forEach(e=>e())};return o(()=>{g(`resize`,window,S),l()}),{targetRef:i,setTargetRef:a,addScrollListener:f,removeScrollListener:m,addResizeListener:b,removeResizeListener:x}},render(){return b(`binder`,this.$slots)}}),G=d({name:`Target`,setup(){let{setTargetRef:e,syncTarget:t}=r(`VBinder`);return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){let{syncTarget:e,setTargetDirective:t}=this;return e?l(x(`follower`,this.$slots),[[t]]):x(`follower`,this.$slots)}}),{c:K}=m(),q=`vueuc-style`,J={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Y={start:`end`,center:`center`,end:`start`},X={top:`height`,bottom:`height`,left:`width`,right:`width`},Z={"bottom-start":`top left`,bottom:`top center`,"bottom-end":`top right`,"top-start":`bottom left`,top:`bottom center`,"top-end":`bottom right`,"right-start":`top left`,right:`center left`,"right-end":`bottom left`,"left-start":`top right`,left:`center right`,"left-end":`bottom right`},ee={"bottom-start":`bottom left`,bottom:`bottom center`,"bottom-end":`bottom right`,"top-start":`top left`,top:`top center`,"top-end":`top right`,"right-start":`top right`,right:`center right`,"right-end":`bottom right`,"left-start":`top left`,left:`center left`,"left-end":`bottom left`},te={"bottom-start":`right`,"bottom-end":`left`,"top-start":`right`,"top-end":`left`,"right-start":`bottom`,"right-end":`top`,"left-start":`bottom`,"left-end":`top`},Q={top:!0,bottom:!1,left:!0,right:!1},$={top:`end`,bottom:`start`,left:`end`,right:`start`};function ne(e,t,n,r,i,a){if(!i||a)return{placement:e,top:0,left:0};let[o,s]=e.split(`-`),c=s??`center`,l={top:0,left:0},u=(e,i,a)=>{let o=0,s=0,c=n[e]-t[i]-t[e];return c>0&&r&&(a?s=Q[i]?c:-c:o=Q[i]?c:-c),{left:o,top:s}},d=o===`left`||o===`right`;if(c!==`center`){let r=te[e],i=J[r],a=X[r];if(n[a]>t[a]){if(t[r]+t[a]<n[a]){let e=(n[a]-t[a])/2;t[r]<e||t[i]<e?t[r]<t[i]?(c=Y[s],l=u(a,i,d)):l=u(a,r,d):c=`center`}}else n[a]<t[a]&&t[i]<0&&t[r]>t[i]&&(c=Y[s])}else{let e=o===`bottom`||o===`top`?`left`:`top`,r=J[e],i=X[e],a=(n[i]-t[i])/2;(t[e]<a||t[r]<a)&&(t[e]>t[r]?(c=$[e],l=u(i,e,d)):(c=$[r],l=u(i,r,d)))}let f=o;return t[o]<n[X[o]]&&t[o]<t[J[o]]&&(f=J[o]),{placement:c===`center`?f:`${f}-${c}`,left:l.left,top:l.top}}function re(e,t){return t?ee[e]:Z[e]}function ie(e,t,n,r,i,a){if(a)switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`top-end`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-50%)`};default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%) translateY(-100%)`}}switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:``};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-100%)`};case`top-end`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:``};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%)`};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateY(-100%) translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-50%) translateX(-100%)`};default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateX(-50%)`}}}var ae=K([K(`.v-binder-follower-container`,{position:`absolute`,left:`0`,right:`0`,top:`0`,height:`0`,pointerEvents:`none`,zIndex:`auto`}),K(`.v-binder-follower-content`,{position:`absolute`,zIndex:`auto`},[K(`> *`,{pointerEvents:`all`})])]),oe=d({name:`Follower`,inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:`bottom`},syncTrigger:{type:Array,default:[`resize`,`scroll`]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){let n=r(`VBinder`),s=T(()=>e.enabled===void 0?e.show:e.enabled),l=u(null),d=u(null),p=()=>{let{syncTrigger:t}=e;t.includes(`scroll`)&&n.addScrollListener(g),t.includes(`resize`)&&n.addResizeListener(g)},m=()=>{n.removeScrollListener(g),n.removeResizeListener(g)};a(()=>{s.value&&(g(),p())});let h=t();ae.mount({id:`vueuc/binder`,head:!0,anchorMetaName:q,ssr:h}),o(()=>{m()}),N(()=>{s.value&&g()});let g=()=>{if(!s.value)return;let t=l.value;if(t===null)return;let r=n.targetRef,{x:i,y:a,overlap:o}=e,c=i!==void 0&&a!==void 0?B(i,a):V(r);t.style.setProperty(`--v-target-width`,`${Math.round(c.width)}px`),t.style.setProperty(`--v-target-height`,`${Math.round(c.height)}px`);let{width:u,minWidth:f,placement:p,internalShift:m,flip:h}=e;t.setAttribute(`v-placement`,p),o?t.setAttribute(`v-overlap`,``):t.removeAttribute(`v-overlap`);let{style:g}=t;u===`target`?g.width=`${c.width}px`:u===void 0?g.width=``:g.width=u,f===`target`?g.minWidth=`${c.width}px`:f===void 0?g.minWidth=``:g.minWidth=f;let _=V(t),v=V(d.value),{left:y,top:b,placement:x}=ne(p,c,_,m,h,o),S=re(x,o),{left:C,top:w,transform:T}=ie(x,v,c,b,y,o);t.setAttribute(`v-placement`,x),t.style.setProperty(`--v-offset-left`,`${Math.round(y)}px`),t.style.setProperty(`--v-offset-top`,`${Math.round(b)}px`),t.style.transform=`translateX(${C}) translateY(${w}) ${T}`,t.style.setProperty(`--v-transform-origin`,S),t.style.transformOrigin=S};f(s,e=>{e?(p(),_()):m()});let _=()=>{i().then(g).catch(e=>console.error(e))};[`placement`,`x`,`y`,`internalShift`,`flip`,`width`,`overlap`,`minWidth`].forEach(t=>{f(c(e,t),g)}),[`teleportDisabled`].forEach(t=>{f(c(e,t),_)}),f(c(e,`syncTrigger`),e=>{e.includes(`resize`)?n.addResizeListener(g):n.removeResizeListener(g),e.includes(`scroll`)?n.addScrollListener(g):n.removeScrollListener(g)});let v=E();return{VBinder:n,mergedEnabled:s,offsetContainerRef:d,followerRef:l,mergedTo:T(()=>{let{to:t}=e;if(t!==void 0)return t;v.value}),syncPosition:g}},render(){return n(y,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e;let t=n(`div`,{class:[`v-binder-follower-container`,this.containerClass],ref:`offsetContainerRef`},[n(`div`,{class:`v-binder-follower-content`,ref:`followerRef`},(e=this.$slots).default?.call(e))]);return this.zindexable?l(t,[[S,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}});export{W as a,P as c,G as i,N as l,K as n,L as o,q as r,F as s,oe as t,A as u};