UNPKG

naive-ui

Version:

A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast

1 lines 1.7 MB
import{ref as e,readonly as t,watch as n,computed as r,getCurrentInstance as o,onMounted as a,onBeforeUnmount as i,onBeforeMount as l,reactive as s,inject as d,onActivated as c,onDeactivated as u,createTextVNode as h,Fragment as p,Comment as m,defineComponent as f,provide as g,withDirectives as v,h as b,Teleport as y,toRef as x,nextTick as w,renderSlot as C,mergeProps as k,vShow as S,isVNode as P,shallowRef as z,watchEffect as T,Transition as M,TransitionGroup as R,cloneVNode as $,Text as F,onUnmounted as D,onBeforeUpdate as I,onUpdated as B,normalizeStyle as A,isReactive as N,markRaw as E,normalizeClass as O,createApp as H,unref as L,isProxy as W,toRaw as _,toRefs as j,renderList as V}from"vue";const q=/\s*,(?![^(]*\))\s*/g,U=/\s+/g;function Y(e){let t=[""];return e.forEach(e=>{(e=e&&e.trim())&&(t=e.includes("&")?function(e,t){const n=[];return t.split(q).forEach(t=>{let r=function(e){let t=0;for(let n=0;n<e.length;++n)"&"===e[n]&&++t;return t}(t);if(!r)return void e.forEach(e=>{n.push((e&&e+" ")+t)});if(1===r)return void e.forEach(e=>{n.push(t.replace("&",e))});let o=[t];for(;r--;){const t=[];o.forEach(n=>{e.forEach(e=>{t.push(n.replace("&",e))})}),o=t}o.forEach(e=>n.push(e))}),n}(t,e):function(e,t){const n=[];return t.split(q).forEach(t=>{e.forEach(e=>{n.push((e&&e+" ")+t)})}),n}(t,e))}),t.join(", ").replace(U," ")}function K(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function X(e,t){return(null!=t?t:document.head).querySelector(`style[cssr-id="${e}"]`)}function G(e){return!!e&&/^\s*@(s|m)/.test(e)}const Z=/[A-Z]/g;function Q(e){return e.replace(Z,e=>"-"+e.toLowerCase())}function J(e,t,n,r){if(!t)return"";const o=function(e,t,n){return"function"==typeof e?e({context:t.context,props:n}):e}(t,n,r);if(!o)return"";if("string"==typeof o)return`${e} {\n${o}\n}`;const a=Object.keys(o);if(0===a.length)return n.config.keepEmptyBlock?e+" {\n}":"";const i=e?[e+" {"]:[];return a.forEach(e=>{const t=o[e];"raw"!==e?(e=Q(e),null!=t&&i.push(` ${e}${function(e,t=" "){return"object"==typeof e&&null!==e?" {\n"+Object.entries(e).map(e=>t+` ${Q(e[0])}: ${e[1]};`).join("\n")+"\n"+t+"}":`: ${e};`}(t)}`)):i.push("\n"+t+"\n")}),e&&i.push("}"),i.join("\n")}function ee(e,t,n){e&&e.forEach(e=>{if(Array.isArray(e))ee(e,t,n);else if("function"==typeof e){const r=e(t);Array.isArray(r)?ee(r,t,n):r&&n(r)}else e&&n(e)})}function te(e,t,n,r,o){const a=e.$;let i="";if(a&&"string"!=typeof a)if("function"==typeof a){const e=a({context:r.context,props:o});G(e)?i=e:t.push(e)}else if(a.before&&a.before(r.context),a.$&&"string"!=typeof a.$){if(a.$){const e=a.$({context:r.context,props:o});G(e)?i=e:t.push(e)}}else G(a.$)?i=a.$:t.push(a.$);else G(a)?i=a:t.push(a);const l=Y(t),s=J(l,e.props,r,o);i?n.push(`${i} {`):s.length&&n.push(s),e.children&&ee(e.children,{context:r.context,props:o},e=>{if("string"==typeof e){const t=J(l,{raw:e},r,o);n.push(t)}else te(e,t,n,r,o)}),t.pop(),i&&n.push("}"),a&&a.after&&a.after(r.context)}function ne(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}function re(e,t){e.push(t)}function oe(e,t,n,r,o,a,i,l,s){let d;if(void 0===n&&(d=t.render(r),n=ne(d)),s)return void s.adapter(n,null!=d?d:t.render(r));void 0===l&&(l=document.head);const c=X(n,l);if(null!==c&&!a)return c;const u=null!=c?c:function(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}(n);if(void 0===d&&(d=t.render(r)),u.textContent=d,null!==c)return c;if(i){const e=l.querySelector(`meta[name="${i}"]`);if(e)return l.insertBefore(u,e),re(t.els,u),u}return o?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),re(t.els,u),u}function ae(e){return function(e,t,n){const r=[];return te(e,[],r,t,n),r.join("\n\n")}(this,this.instance,e)}function ie(e={}){const{id:t,ssr:n,props:r,head:o=!1,force:a=!1,anchorMetaName:i,parent:l}=e;return oe(this.instance,this,t,r,o,a,i,l,n)}function le(e={}){const{id:t,parent:n}=e;!function(e,t,n,r){const{els:o}=t;if(void 0===n)o.forEach(K),t.els=[];else{const e=X(n,r);e&&o.includes(e)&&(K(e),t.els=o.filter(t=>t!==e))}}(this.instance,this,t,n)}"undefined"!=typeof window&&(window.__cssrContext={});const se=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:ae,mount:ie,unmount:le}};function de(e={}){const t={c:(...e)=>function(e,t,n,r){return Array.isArray(t)?se(e,{$:null},null,t):Array.isArray(n)?se(e,t,null,n):Array.isArray(r)?se(e,t,n,r):se(e,t,n,null)}(t,...e),use:(e,...n)=>e.install(t,...n),find:X,context:{},config:e};return t}const ce=".n-",ue=de(),he=function(e){let t,n=".",r="__",o="--";if(e){let t=e.blockPrefix;t&&(n=t),t=e.elementPrefix,t&&(r=t),t=e.modifierPrefix,t&&(o=t)}const a={install(e){t=e.c;const n=e.context;n.bem={},n.bem.b=null,n.bem.els=null}};return Object.assign(a,{cB:(...e)=>t(function(e){let t,r;return{before(e){t=e.bem.b,r=e.bem.els,e.bem.els=null},after(e){e.bem.b=t,e.bem.els=r},$:({context:t,props:r})=>(e="string"==typeof e?e:e({context:t,props:r}),t.bem.b=e,`${(null==r?void 0:r.bPrefix)||n}${t.bem.b}`)}}(e[0]),e[1],e[2]),cE:(...e)=>t(function(e){let t;return{before(e){t=e.bem.els},after(e){e.bem.els=t},$:({context:t,props:o})=>(e="string"==typeof e?e:e({context:t,props:o}),t.bem.els=e.split(",").map(e=>e.trim()),t.bem.els.map(e=>`${(null==o?void 0:o.bPrefix)||n}${t.bem.b}${r}${e}`).join(", "))}}(e[0]),e[1],e[2]),cM:(...e)=>{return t((a=e[0],{$({context:e,props:t}){const i=(a="string"==typeof a?a:a({context:e,props:t})).split(",").map(e=>e.trim());function l(a){return i.map(i=>`&${(null==t?void 0:t.bPrefix)||n}${e.bem.b}${void 0!==a?`${r}${a}`:""}${o}${i}`).join(", ")}const s=e.bem.els;return null!==s?l(s[0]):l()}}),e[1],e[2]);var a},cNotM:(...e)=>{return t((a=e[0],{$({context:e,props:t}){a="string"==typeof a?a:a({context:e,props:t});const i=e.bem.els;return`&:not(${(null==t?void 0:t.bPrefix)||n}${e.bem.b}${null!==i&&i.length>0?`${r}${i[0]}`:""}${o}${a})`}}),e[1],e[2]);var a}}),a}({blockPrefix:ce,elementPrefix:"__",modifierPrefix:"--"});ue.use(he);const{c:pe,find:me}=ue,{cB:fe,cE:ge,cM:ve,cNotM:be}=he;function ye(e){return pe(({props:{bPrefix:e}})=>`${e||ce}modal, ${e||ce}drawer`,[e])}function xe(e){return pe(({props:{bPrefix:e}})=>`${e||ce}popover`,[e])}function we(e){return pe(({props:{bPrefix:e}})=>`&${e||ce}modal`,e)}const Ce=(...e)=>pe(">",[fe(...e)]);function ke(e,t){return e+("default"===t?"":t.replace(/^[a-z]/,e=>e.toUpperCase()))}let Se=[];const Pe=new WeakMap;function ze(){Se.forEach(e=>e(...Pe.get(e))),Se=[]}function Te(e,...t){Pe.set(e,t),Se.includes(e)||1===Se.push(e)&&requestAnimationFrame(ze)}function Me(e){if(null===e)return null;const t=function(e){return 9===e.nodeType?null:e.parentNode}(e);if(null===t)return null;if(9===t.nodeType)return document.documentElement;if(1===t.nodeType){const{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return Me(t)}function Re(e){return"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e}function $e(e,t){let{target:n}=e;for(;n;){if(n.dataset&&void 0!==n.dataset[t])return!0;n=n.parentElement}return!1}function Fe(e){return e.composedPath()[0]||null}function De(e,t){var n;if(null==e)return;const r=function(e){if("number"==typeof e)return{"":e.toString()};const t={};return e.split(/ +/).forEach(e=>{if(""===e)return;const[n,r]=e.split(":");void 0===r?t[""]=n:t[n]=r}),t}(e);if(void 0===t)return r[""];if("string"==typeof t)return null!==(n=r[t])&&void 0!==n?n:r[""];if(Array.isArray(t)){for(let e=t.length-1;e>=0;--e){const n=t[e];if(n in r)return r[n]}return r[""]}{let e,n=-1;return Object.keys(r).forEach(o=>{const a=Number(o);!Number.isNaN(a)&&t>=a&&a>=n&&(n=a,e=r[o])}),e}}function Ie(e){return"string"==typeof e?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function Be(e){if(null!=e)return"number"==typeof e?`${e}px`:e.endsWith("px")?e:`${e}px`}function Ae(e,t){const n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return void 0===t?r:r[t]}function Ne(e,t){const[n,r]=e.split(" ");return{row:n,col:r||n}}var Ee={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function Oe(e,t,n){n/=100;const r=(t/=100)*Math.min(n,1-n)+n;return[e,r?100*(2-2*n/r):0,100*r]}function He(e,t,n){const r=(n/=100)-n*(t/=100)/2,o=Math.min(r,1-r);return[e,o?(n-r)/o*100:0,100*r]}function Le(e,t,n){t/=100,n/=100;let r=(r,o=(r+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[255*r(5),255*r(3),255*r(1)]}function We(e,t,n){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=r-Math.min(e,t,n),a=o&&(r==e?(t-n)/o:r==t?2+(n-e)/o:4+(e-t)/o);return[60*(a<0?a+6:a),r&&o/r*100,100*r]}function _e(e,t,n){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=r-Math.min(e,t,n),a=1-Math.abs(r+r-o-1),i=o&&(r==e?(t-n)/o:r==t?2+(n-e)/o:4+(e-t)/o);return[60*(i<0?i+6:i),a?o/a*100:0,50*(r+r-o)]}function je(e,t,n){n/=100;let r=(t/=100)*Math.min(n,1-n),o=(t,o=(t+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[255*o(0),255*o(8),255*o(4)]}const Ve="^\\s*",qe="\\s*$",Ue="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ye="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Ke="([0-9A-Fa-f])",Xe="([0-9A-Fa-f]{2})",Ge=new RegExp(`${Ve}hsl\\s*\\(${Ye},${Ue},${Ue}\\)${qe}`),Ze=new RegExp(`${Ve}hsv\\s*\\(${Ye},${Ue},${Ue}\\)${qe}`),Qe=new RegExp(`${Ve}hsla\\s*\\(${Ye},${Ue},${Ue},${Ye}\\)${qe}`),Je=new RegExp(`${Ve}hsva\\s*\\(${Ye},${Ue},${Ue},${Ye}\\)${qe}`),et=new RegExp(`${Ve}rgb\\s*\\(${Ye},${Ye},${Ye}\\)${qe}`),tt=new RegExp(`${Ve}rgba\\s*\\(${Ye},${Ye},${Ye},${Ye}\\)${qe}`),nt=new RegExp(`${Ve}#${Ke}${Ke}${Ke}${qe}`),rt=new RegExp(`${Ve}#${Xe}${Xe}${Xe}${qe}`),ot=new RegExp(`${Ve}#${Ke}${Ke}${Ke}${Ke}${qe}`),at=new RegExp(`${Ve}#${Xe}${Xe}${Xe}${Xe}${qe}`);function it(e){return parseInt(e,16)}function lt(e){try{let t;if(t=Qe.exec(e))return[gt(t[1]),bt(t[5]),bt(t[9]),ft(t[13])];if(t=Ge.exec(e))return[gt(t[1]),bt(t[5]),bt(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(e){throw e}}function st(e){try{let t;if(t=Je.exec(e))return[gt(t[1]),bt(t[5]),bt(t[9]),ft(t[13])];if(t=Ze.exec(e))return[gt(t[1]),bt(t[5]),bt(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(e){throw e}}function dt(e){try{let t;if(t=rt.exec(e))return[it(t[1]),it(t[2]),it(t[3]),1];if(t=et.exec(e))return[vt(t[1]),vt(t[5]),vt(t[9]),1];if(t=tt.exec(e))return[vt(t[1]),vt(t[5]),vt(t[9]),ft(t[13])];if(t=nt.exec(e))return[it(t[1]+t[1]),it(t[2]+t[2]),it(t[3]+t[3]),1];if(t=at.exec(e))return[it(t[1]),it(t[2]),it(t[3]),ft(it(t[4])/255)];if(t=ot.exec(e))return[it(t[1]+t[1]),it(t[2]+t[2]),it(t[3]+t[3]),ft(it(t[4]+t[4])/255)];if(e in Ee)return dt(Ee[e]);if(Ge.test(e)||Qe.test(e)){const[t,n,r,o]=lt(e);return[...je(t,n,r),o]}if(Ze.test(e)||Je.test(e)){const[t,n,r,o]=st(e);return[...Le(t,n,r),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(e){throw e}}function ct(e,t,n,r){return`rgba(${vt(e)}, ${vt(t)}, ${vt(n)}, ${o=r,o>1?1:o<0?0:o})`;var o}function ut(e,t,n,r,o){return vt((e*t*(1-r)+n*r)/o)}function ht(e,t){Array.isArray(e)||(e=dt(e)),Array.isArray(t)||(t=dt(t));const n=e[3],r=t[3],o=ft(n+r-n*r);return ct(ut(e[0],n,t[0],r,o),ut(e[1],n,t[1],r,o),ut(e[2],n,t[2],r,o),o)}function pt(e,t){const[n,r,o,a=1]=Array.isArray(e)?e:dt(e);return"number"==typeof t.alpha?ct(n,r,o,t.alpha):ct(n,r,o,a)}function mt(e,t){const[n,r,o,a=1]=Array.isArray(e)?e:dt(e),{lightness:i=1,alpha:l=1}=t;return xt([n*i,r*i,o*i,a*l])}function ft(e){const t=Math.round(100*Number(e))/100;return t>1?1:t<0?0:t}function gt(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function vt(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function bt(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function yt(e){const[t,n,r]=Array.isArray(e)?e:dt(e);return function(e,t,n){return`rgb(${vt(e)}, ${vt(t)}, ${vt(n)})`}(t,n,r)}function xt(e){const[t,n,r]=e;return 3 in e?`rgba(${vt(t)}, ${vt(n)}, ${vt(r)}, ${ft(e[3])})`:`rgba(${vt(t)}, ${vt(n)}, ${vt(r)}, 1)`}function wt(e){return`hsv(${gt(e[0])}, ${bt(e[1])}%, ${bt(e[2])}%)`}function Ct(e){const[t,n,r]=e;return 3 in e?`hsva(${gt(t)}, ${bt(n)}%, ${bt(r)}%, ${ft(e[3])})`:`hsva(${gt(t)}, ${bt(n)}%, ${bt(r)}%, 1)`}function kt(e){return`hsl(${gt(e[0])}, ${bt(e[1])}%, ${bt(e[2])}%)`}function St(e){const[t,n,r]=e;return 3 in e?`hsla(${gt(t)}, ${bt(n)}%, ${bt(r)}%, ${ft(e[3])})`:`hsla(${gt(t)}, ${bt(n)}%, ${bt(r)}%, 1)`}function Pt(e){if("string"==typeof e){let t;if(t=rt.exec(e))return`${t[0]}FF`;if(t=at.exec(e))return t[0];if(t=nt.exec(e))return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}FF`;if(t=ot.exec(e))return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}${t[4]}${t[4]}`;throw new Error(`[seemly/toHexString]: Invalid hex value ${e}.`)}return`#${e.slice(0,3).map(e=>vt(e).toString(16).toUpperCase().padStart(2,"0")).join("")}`+(3===e.length?"FF":vt(255*e[3]).toString(16).padStart(2,"0").toUpperCase())}function zt(e){if("string"==typeof e){let t;if(t=rt.exec(e))return t[0];if(t=at.exec(e))return t[0].slice(0,7);if(t=nt.exec(e)||ot.exec(e))return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`;throw new Error(`[seemly/toHexString]: Invalid hex value ${e}.`)}return`#${e.slice(0,3).map(e=>vt(e).toString(16).toUpperCase().padStart(2,"0")).join("")}`}function Tt(e=8){return Math.random().toString(16).slice(2,2+e)}function Mt(e,t){const n=[];for(let r=0;r<e;++r)n.push(t);return n}function Rt(e){return e.composedPath()[0]}const $t={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Ft(e,t,n){const r=$t[e];let o=r.get(t);void 0===o&&r.set(t,o=new WeakMap);let a=o.get(n);return void 0===a&&o.set(n,a=function(e,t,n){if("mousemoveoutside"===e){const e=e=>{t.contains(Rt(e))||n(e)};return{mousemove:e,touchstart:e}}if("clickoutside"===e){let e=!1;const r=n=>{e=!t.contains(Rt(n))},o=r=>{e&&(t.contains(Rt(r))||n(r))};return{mousedown:r,mouseup:o,touchstart:r,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}(e,t,n)),a}function Dt(e,t,n,r){if("mousemoveoutside"===e||"clickoutside"===e){const o=Ft(e,t,n);return Object.keys(o).forEach(e=>{Bt(e,document,o[e],r)}),!0}return!1}function It(e,t,n,r){if("mousemoveoutside"===e||"clickoutside"===e){const o=Ft(e,t,n);return Object.keys(o).forEach(e=>{At(e,document,o[e],r)}),!0}return!1}const{on:Bt,off:At}=function(){if("undefined"==typeof window)return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function o(e,t,n){const r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function a(e,t){e[t]=Event.prototype[t]}const i=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function s(){var e;return null!==(e=i.get(this))&&void 0!==e?e:null}function d(e,t){void 0!==l&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:null!=t?t:l.get})}const c={bubble:{},capture:{}},u={},h=function(){const l=function(l){const{type:u,eventPhase:h,bubbles:p}=l,m=Rt(l);if(2===h)return;const f=1===h?"capture":"bubble";let g=m;const v=[];for(;null===g&&(g=window),v.push(g),g!==window;)g=g.parentNode||null;const b=c.capture[u],y=c.bubble[u];if(o(l,"stopPropagation",n),o(l,"stopImmediatePropagation",r),d(l,s),"capture"===f){if(void 0===b)return;for(let n=v.length-1;n>=0&&!e.has(l);--n){const e=v[n],r=b.get(e);if(void 0!==r){i.set(l,e);for(const e of r){if(t.has(l))break;e(l)}}if(0===n&&!p&&void 0!==y){const n=y.get(e);if(void 0!==n)for(const e of n){if(t.has(l))break;e(l)}}}}else if("bubble"===f){if(void 0===y)return;for(let n=0;n<v.length&&!e.has(l);++n){const e=v[n],r=y.get(e);if(void 0!==r){i.set(l,e);for(const e of r){if(t.has(l))break;e(l)}}}}a(l,"stopPropagation"),a(l,"stopImmediatePropagation"),d(l)};return l.displayName="evtdUnifiedHandler",l}(),p=function(){const e=function(e){const{type:t,eventPhase:n}=e;if(2!==n)return;const r=u[t];void 0!==r&&r.forEach(t=>t(e))};return e.displayName="evtdUnifiedWindowEventHandler",e}();function m(e,t){const n=c[e];return void 0===n[t]&&(n[t]=new Map,window.addEventListener(t,h,"capture"===e)),n[t]}function f(e,t){let n=e.get(t);return void 0===n&&e.set(t,n=new Set),n}function g(e,t,n,r){if(It(e,t,n,r))return;const o=!0===r||"object"==typeof r&&!0===r.capture,a=o?"capture":"bubble",i=m(a,e),l=f(i,t);if(t===window){if(!function(e,t,n,r){const o=c[t][n];if(void 0!==o){const t=o.get(e);if(void 0!==t&&t.has(r))return!0}return!1}(t,o?"bubble":"capture",e,n)&&function(e,t){const n=u[e];return!(void 0===n||!n.has(t))}(e,n)){const t=u[e];t.delete(n),0===t.size&&(window.removeEventListener(e,p),u[e]=void 0)}}l.has(n)&&l.delete(n),0===l.size&&i.delete(t),0===i.size&&(window.removeEventListener(e,h,"capture"===a),c[a][e]=void 0)}return{on:function(e,t,n,r){let o;if(o="object"==typeof r&&!0===r.once?a=>{g(e,t,o,r),n(a)}:n,Dt(e,t,o,r))return;const a=f(m(!0===r||"object"==typeof r&&!0===r.capture?"capture":"bubble",e),t);if(a.has(o)||a.add(o),t===window){const t=function(e){return void 0===u[e]&&(u[e]=new Set,window.addEventListener(e,p)),u[e]}(e);t.has(o)||t.add(o)}},off:g}}();function Nt(r){const o=e(!!r.value);if(o.value)return t(o);const a=n(r,e=>{e&&(o.value=!0,a())});return t(o)}function Et(t){const o=r(t),a=e(o.value);return n(o,e=>{a.value=e}),"function"==typeof t?a:{__v_isRef:!0,get value(){return a.value},set value(e){t.set(e)}}}function Ot(){return null!==o()}const Ht="undefined"!=typeof window;let Lt,Wt;var _t,jt;function Vt(e){if(Wt)return;let t=!1;a(()=>{Wt||null==Lt||Lt.then(()=>{t||e()})}),i(()=>{t=!0})}Lt=Ht?null===(jt=null===(_t=document)||void 0===_t?void 0:_t.fonts)||void 0===jt?void 0:jt.ready:void 0,Wt=!1,void 0!==Lt?Lt.then(()=>{Wt=!0}):Wt=!0;const qt=e(null);function Ut(e){if(e.clientX>0||e.clientY>0)qt.value={x:e.clientX,y:e.clientY};else{const{target:t}=e;if(t instanceof Element){const{left:e,top:n,width:r,height:o}=t.getBoundingClientRect();qt.value=e>0||n>0?{x:e+r/2,y:n+o/2}:{x:0,y:0}}else qt.value=null}}let Yt=0,Kt=!0;function Xt(){if(!Ht)return t(e(null));0===Yt&&Bt("click",document,Ut,!0);const n=()=>{Yt+=1};return Kt&&(Kt=Ot())?(l(n),i(()=>{Yt-=1,0===Yt&&At("click",document,Ut,!0)})):n(),t(qt)}const Gt=e(void 0);let Zt=0;function Qt(){Gt.value=Date.now()}let Jt=!0;function en(n){if(!Ht)return t(e(!1));const r=e(!1);let o=null;function a(){null!==o&&window.clearTimeout(o)}function s(){a(),r.value=!0,o=window.setTimeout(()=>{r.value=!1},n)}0===Zt&&Bt("click",window,Qt,!0);const d=()=>{Zt+=1,Bt("click",window,s,!0)};return Jt&&(Jt=Ot())?(l(d),i(()=>{Zt-=1,0===Zt&&At("click",window,Qt,!0),At("click",window,s,!0),a()})):d(),t(r)}let tn=0;const nn="undefined"!=typeof window&&void 0!==window.matchMedia,rn=e(null);let on,an;function ln(e){e.matches&&(rn.value="dark")}function sn(e){e.matches&&(rn.value="light")}let dn=!0;function cn(){return nn?(0===tn&&(on=window.matchMedia("(prefers-color-scheme: dark)"),an=window.matchMedia("(prefers-color-scheme: light)"),on.matches?rn.value="dark":an.matches?rn.value="light":rn.value=null,on.addEventListener?(on.addEventListener("change",ln),an.addEventListener("change",sn)):on.addListener&&(on.addListener(ln),an.addListener(sn))),dn&&(dn=Ot())&&(l(()=>{tn+=1}),i(()=>{tn-=1,0===tn&&("removeEventListener"in on?(on.removeEventListener("change",ln),an.removeEventListener("change",sn)):"removeListener"in on&&(on.removeListener(ln),an.removeListener(sn)),on=void 0,an=void 0)})),t(rn)):t(rn)}function un(e,t){return n(e,e=>{void 0!==e&&(t.value=e)}),r(()=>void 0===e.value?t.value:e.value)}function hn(){const n=e(!1);return a(()=>{n.value=!0}),t(n)}function pn(e,t){return r(()=>{for(const n of t)if(void 0!==e[n])return e[n];return e[t[t.length-1]]})}const mn="undefined"!=typeof window&&(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream;function fn(){return mn}const gn={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};const vn={};function bn(e={},r){const o=s({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:a,keyup:d}=e,c=e=>{switch(e.key){case"Control":o.ctrl=!0;break;case"Meta":o.command=!0,o.win=!0;break;case"Shift":o.shift=!0;break;case"Tab":o.tab=!0}void 0!==a&&Object.keys(a).forEach(t=>{if(t!==e.key)return;const n=a[t];if("function"==typeof n)n(e);else{const{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},u=e=>{switch(e.key){case"Control":o.ctrl=!1;break;case"Meta":o.command=!1,o.win=!1;break;case"Shift":o.shift=!1;break;case"Tab":o.tab=!1}void 0!==d&&Object.keys(d).forEach(t=>{if(t!==e.key)return;const n=d[t];if("function"==typeof n)n(e);else{const{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},h=()=>{(void 0===r||r.value)&&(Bt("keydown",document,c),Bt("keyup",document,u)),void 0!==r&&n(r,e=>{e?(Bt("keydown",document,c),Bt("keyup",document,u)):(At("keydown",document,c),At("keyup",document,u))})};return Ot()?(l(h),i(()=>{(void 0===r||r.value)&&(At("keydown",document,c),At("keyup",document,u))})):h(),t(o)}const yn="n-internal-select-menu",xn="n-internal-select-menu-body",wn="n-drawer-body",Cn="n-drawer",kn="n-modal-body",Sn="n-modal",Pn="n-popover-body",zn="__disabled__";function Tn(t){const n=d(kn,null),r=d(wn,null),o=d(Pn,null),l=d(xn,null),s=e();if("undefined"!=typeof document){s.value=document.fullscreenElement;const e=()=>{s.value=document.fullscreenElement};a(()=>{Bt("fullscreenchange",document,e)}),i(()=>{At("fullscreenchange",document,e)})}return Et(()=>{const{to:e}=t;return void 0!==e?!1===e?zn:!0===e?s.value||"body":e:n?.value?n.value.$el??n.value:r?.value?r.value:o?.value?o.value:l?.value?l.value:e??(s.value||"body")})}function Mn(e,t,r){const a=d(e,null);if(null===a)return;const l=o()?.proxy;function s(e,n){if(!a)return;const r=a[t];void 0!==n&&function(e,t){e[t]||(e[t]=[]);e[t].splice(e[t].findIndex(e=>e===l),1)}(r,n),void 0!==e&&function(e,t){e[t]||(e[t]=[]);~e[t].findIndex(e=>e===l)||e[t].push(l)}(r,e)}n(r,s),s(r.value),i(()=>{s(void 0,r.value)})}Tn.tdkey=zn,Tn.propTo={type:[String,Object,Boolean],default:void 0};const Rn="undefined"!=typeof document&&"undefined"!=typeof window;let $n=!1;function Fn(){if(Rn&&window.CSS&&!$n&&($n=!0,"registerProperty"in window?.CSS))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}const Dn=e(!1);function In(){Dn.value=!0}function Bn(){Dn.value=!1}let An=0;function Nn(){return Rn&&(l(()=>{An||(window.addEventListener("compositionstart",In),window.addEventListener("compositionend",Bn)),An++}),i(()=>{An<=1?(window.removeEventListener("compositionstart",In),window.removeEventListener("compositionend",Bn),An=0):An--})),Dn}let En=0,On="",Hn="",Ln="",Wn="";const _n=e("0px");function jn(e){if("undefined"==typeof document)return;const t=document.documentElement;let r,o=!1;const l=()=>{t.style.marginRight=On,t.style.overflow=Hn,t.style.overflowX=Ln,t.style.overflowY=Wn,_n.value="0px"};a(()=>{r=n(e,e=>{if(e){if(!En){const e=window.innerWidth-t.offsetWidth;e>0&&(On=t.style.marginRight,t.style.marginRight=`${e}px`,_n.value=`${e}px`),Hn=t.style.overflow,Ln=t.style.overflowX,Wn=t.style.overflowY,t.style.overflow="hidden",t.style.overflowX="hidden",t.style.overflowY="hidden"}o=!0,En++}else En--,En||l(),o=!1},{immediate:!0})}),i(()=>{r?.(),o&&(En--,En||l(),o=!1)})}function Vn(e){const t={isDeactivated:!1};let n=!1;return c(()=>{t.isDeactivated=!1,n?e():n=!0}),u(()=>{t.isDeactivated=!0,n||(n=!0)}),t}function qn(e,t,n="default"){const r=t[n];if(void 0===r)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function Un(e,t=!0,n=[]){return e.forEach(e=>{if(null!==e)if("object"==typeof e)if(Array.isArray(e))Un(e,t,n);else if(e.type===p){if(null===e.children)return;Array.isArray(e.children)&&Un(e.children,t,n)}else e.type!==m&&n.push(e);else"string"!=typeof e&&"number"!=typeof e||n.push(h(String(e)))}),n}function Yn(e,t,n="default"){const r=t[n];if(void 0===r)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const o=Un(r());if(1===o.length)return o[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Kn=null;function Xn(){if(null===Kn&&(Kn=document.getElementById("v-binder-view-measurer"),null===Kn)){Kn=document.createElement("div"),Kn.id="v-binder-view-measurer";const{style:e}=Kn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Kn)}return Kn.getBoundingClientRect()}function Gn(e){const t=e.getBoundingClientRect(),n=Xn();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 Zn(e){if(null===e)return null;const t=function(e){return 9===e.nodeType?null:e.parentNode}(e);if(null===t)return null;if(9===t.nodeType)return document;if(1===t.nodeType){const{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return Zn(t)}const Qn=f({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var n;g("VBinder",null===(n=o())||void 0===n?void 0:n.proxy);const r=d("VBinder",null),a=e(null);let l=[];const s=()=>{for(const e of l)At("scroll",e,u,!0);l=[]},c=new Set,u=()=>{Te(h)},h=()=>{c.forEach(e=>e())},p=new Set,m=()=>{p.forEach(e=>e())};return i(()=>{At("resize",window,m),s()}),{targetRef:a,setTargetRef:e=>{a.value=e,r&&t.syncTargetWithParent&&r.setTargetRef(e)},addScrollListener:e=>{0===c.size&&(()=>{let e=a.value;for(;e=Zn(e),null!==e;)l.push(e);for(const e of l)Bt("scroll",e,u,!0)})(),c.has(e)||c.add(e)},removeScrollListener:e=>{c.has(e)&&c.delete(e),0===c.size&&s()},addResizeListener:e=>{0===p.size&&Bt("resize",window,m),p.has(e)||p.add(e)},removeResizeListener:e=>{p.has(e)&&p.delete(e),0===p.size&&At("resize",window,m)}}},render(){return qn("binder",this.$slots)}});var Jn=f({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=d("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?v(Yn("follower",this.$slots),[[t]]):Yn("follower",this.$slots)}});const er="@@mmoContext",tr={mounted(e,{value:t}){e[er]={handler:void 0},"function"==typeof t&&(e[er].handler=t,Bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[er];"function"==typeof t?n.handler?n.handler!==t&&(At("mousemoveoutside",e,n.handler),n.handler=t,Bt("mousemoveoutside",e,t)):(e[er].handler=t,Bt("mousemoveoutside",e,t)):n.handler&&(At("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[er];t&&At("mousemoveoutside",e,t),e[er].handler=void 0}},nr="@@coContext",rr={mounted(e,{value:t,modifiers:n}){e[nr]={handler:void 0},"function"==typeof t&&(e[nr].handler=t,Bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[nr];"function"==typeof t?r.handler?r.handler!==t&&(At("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,Bt("clickoutside",e,t,{capture:n.capture})):(e[nr].handler=t,Bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(At("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[nr];n&&At("clickoutside",e,n,{capture:t.capture}),e[nr].handler=void 0}};var or=new class{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,t){const{elementZIndex:n}=this;if(void 0!==t)return e.style.zIndex=`${t}`,void n.delete(e);const{nextZIndex:r}=this;if(n.has(e)){if(n.get(e)+1===this.nextZIndex)return}e.style.zIndex=`${r}`,n.set(e,r),this.nextZIndex=r+1,this.squashState()}unregister(e,t){const{elementZIndex:n}=this;n.has(e)?n.delete(e):void 0===t&&function(e,t){console.error(`[vdirs/${e}]: ${t}`)}("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((e,t)=>e[1]-t[1]),this.nextZIndex=2e3,e.forEach(e=>{const t=e[0],n=this.nextZIndex++;`${n}`!==t.style.zIndex&&(t.style.zIndex=`${n}`)})}};const ar="@@ziContext",ir={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:o}=n;e[ar]={enabled:!!o,initialized:!1},o&&(or.ensureZIndex(e,r),e[ar].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:o}=n,a=e[ar].enabled;o&&!a&&(or.ensureZIndex(e,r),e[ar].initialized=!0),e[ar].enabled=!!o},unmounted(e,t){if(!e[ar].initialized)return;const{value:n={}}=t,{zIndex:r}=n;or.unregister(e,r)}};const lr="undefined"!=typeof document;function sr(){if(lr)return;const e=d("@css-render/vue3-ssr",null);return null!==e?{adapter:(t,n)=>function(e,t,n){const{styles:r,ids:o}=n;o.has(e)||null!==r&&(o.add(e),r.push(function(e,t){return`<style cssr-id="${e}">\n${t}\n</style>`}(e,t)))}(t,n,e),context:e}:void 0}function dr(e,t){console.error(`[vueuc/${e}]: ${t}`)}const{c:cr}=de(),ur="vueuc-style";function hr(e){return e&-e}class pr{constructor(e,t){this.l=e,this.min=t;const n=new Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,t){if(0===t)return;const{l:n,ft:r}=this;for(e+=1;e<=n;)r[e]+=t,e+=hr(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(void 0===e&&(e=this.l),e<=0)return 0;const{ft:t,min:n,l:r}=this;if(e>r)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*n;for(;e>0;)o+=t[e],e-=hr(e);return o}getBound(e){let t=0,n=this.l;for(;n>t;){const r=Math.floor((t+n)/2),o=this.sum(r);if(o>e)n=r;else{if(!(o<e))return r;if(t===r)return this.sum(t+1)<=e?t+1:r;t=r}}return t}}function mr(e){return"string"==typeof e?document.querySelector(e):e()||null}var fr=f({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup:e=>({showTeleport:Nt(x(e,"show")),mergedTo:r(()=>{const{to:t}=e;return null!=t?t:"body"})}),render(){return this.showTeleport?this.disabled?qn("lazy-teleport",this.$slots):b(y,{disabled:this.disabled,to:this.mergedTo},qn("lazy-teleport",this.$slots)):null}});const gr={top:"bottom",bottom:"top",left:"right",right:"left"},vr={start:"end",center:"center",end:"start"},br={top:"height",bottom:"height",left:"width",right:"width"},yr={"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"},xr={"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"},wr={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Cr={top:!0,bottom:!1,left:!0,right:!1},kr={top:"end",bottom:"start",left:"end",right:"start"};const Sr=cr([cr(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),cr(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[cr("> *",{pointerEvents:"all"})])]);var Pr,zr=f({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(t){const r=d("VBinder"),o=Et(()=>void 0!==t.enabled?t.enabled:t.show),l=e(null),s=e(null),c=()=>{const{syncTrigger:e}=t;e.includes("scroll")&&r.addScrollListener(p),e.includes("resize")&&r.addResizeListener(p)},u=()=>{r.removeScrollListener(p),r.removeResizeListener(p)};a(()=>{o.value&&(p(),c())});const h=sr();Sr.mount({id:"vueuc/binder",head:!0,anchorMetaName:ur,ssr:h}),i(()=>{u()}),Vt(()=>{o.value&&p()});const p=()=>{if(!o.value)return;const e=l.value;if(null===e)return;const n=r.targetRef,{x:a,y:i,overlap:d}=t,c=void 0!==a&&void 0!==i?function(e,t){const n=Xn();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}(a,i):Gn(n);e.style.setProperty("--v-target-width",`${Math.round(c.width)}px`),e.style.setProperty("--v-target-height",`${Math.round(c.height)}px`);const{width:u,minWidth:h,placement:p,internalShift:m,flip:f}=t;e.setAttribute("v-placement",p),d?e.setAttribute("v-overlap",""):e.removeAttribute("v-overlap");const{style:g}=e;g.width="target"===u?`${c.width}px`:void 0!==u?u:"",g.minWidth="target"===h?`${c.width}px`:void 0!==h?h:"";const v=Gn(e),b=Gn(s.value),{left:y,top:x,placement:w}=function(e,t,n,r,o,a){if(!o||a)return{placement:e,top:0,left:0};const[i,l]=e.split("-");let s=null!=l?l:"center",d={top:0,left:0};const c=(e,o,a)=>{let i=0,l=0;const s=n[e]-t[o]-t[e];return s>0&&r&&(a?l=Cr[o]?s:-s:i=Cr[o]?s:-s),{left:i,top:l}},u="left"===i||"right"===i;if("center"!==s){const r=wr[e],o=gr[r],a=br[r];if(n[a]>t[a]){if(t[r]+t[a]<n[a]){const e=(n[a]-t[a])/2;t[r]<e||t[o]<e?t[r]<t[o]?(s=vr[l],d=c(a,o,u)):d=c(a,r,u):s="center"}}else n[a]<t[a]&&t[o]<0&&t[r]>t[o]&&(s=vr[l])}else{const e="bottom"===i||"top"===i?"left":"top",r=gr[e],o=br[e],a=(n[o]-t[o])/2;(t[e]<a||t[r]<a)&&(t[e]>t[r]?(s=kr[e],d=c(o,e,u)):(s=kr[r],d=c(o,r,u)))}let h=i;return t[i]<n[br[i]]&&t[i]<t[gr[i]]&&(h=gr[i]),{placement:"center"!==s?`${h}-${s}`:h,left:d.left,top:d.top}}(p,c,v,m,f,d),C=function(e,t){return t?xr[e]:yr[e]}(w,d),{left:k,top:S,transform:P}=function(e,t,n,r,o,a){if(a)switch(e){case"bottom-start":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"bottom-end":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"top-start":case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":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"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+o)}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+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+o)}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+o)}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+o)}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+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+o)}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+o)}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+o)}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+o)}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+o)}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+o)}px`,transform:"translateX(-50%)"}}}(w,b,c,x,y,d);e.setAttribute("v-placement",w),e.style.setProperty("--v-offset-left",`${Math.round(y)}px`),e.style.setProperty("--v-offset-top",`${Math.round(x)}px`),e.style.transform=`translateX(${k}) translateY(${S}) ${P}`,e.style.setProperty("--v-transform-origin",C),e.style.transformOrigin=C};n(o,e=>{e?(c(),m()):u()});const m=()=>{w().then(p).catch(e=>console.error(e))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(e=>{n(x(t,e),p)}),["teleportDisabled"].forEach(e=>{n(x(t,e),m)}),n(x(t,"syncTrigger"),e=>{e.includes("resize")?r.addResizeListener(p):r.removeResizeListener(p),e.includes("scroll")?r.addScrollListener(p):r.removeScrollListener(p)});const f=hn(),g=Et(()=>{const{to:e}=t;if(void 0!==e)return e;f.value});return{VBinder:r,mergedEnabled:o,offsetContainerRef:s,followerRef:l,mergedTo:g,syncPosition:p}},render(){return b(fr,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=b("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[b("div",{class:"v-binder-follower-content",ref:"followerRef"},null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))]);return this.zindexable?v(n,[[ir,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}}),Tr=[],Mr=function(){return Tr.some(function(e){return e.activeTargets.length>0})},Rr="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Pr||(Pr={}));var $r,Fr=function(e){return Object.freeze(e)},Dr=function(e,t){this.inlineSize=e,this.blockSize=t,Fr(this)},Ir=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Fr(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Br=function(e){return e instanceof SVGElement&&"getBBox"in e},Ar=function(e){if(Br(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,a=o.offsetWidth,i=o.offsetHeight;return!(a||i||e.getClientRects().length)},Nr=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Er="undefined"!=typeof window?window:{},Or=new WeakMap,Hr=/auto|scroll/,Lr=/^tb|vertical/,Wr=/msie|trident/i.test(Er.navigator&&Er.navigator.userAgent),_r=function(e){return parseFloat(e||"0")},jr=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Dr((n?t:e)||0,(n?e:t)||0)},Vr=Fr({devicePixelContentBoxSize:jr(),borderBoxSize:jr(),contentBoxSize:jr(),contentRect:new Ir(0,0,0,0)}),qr=function(e,t){if(void 0===t&&(t=!1),Or.has(e)&&!t)return Or.get(e);if(Ar(e))return Or.set(e,Vr),Vr;var n=getComputedStyle(e),r=Br(e)&&e.ownerSVGElement&&e.getBBox(),o=!Wr&&"border-box"===n.boxSizing,a=Lr.test(n.writingMode||""),i=!r&&Hr.test(n.overflowY||""),l=!r&&Hr.test(n.overflowX||""),s=r?0:_r(n.paddingTop),d=r?0:_r(n.paddingRight),c=r?0:_r(n.paddingBottom),u=r?0:_r(n.paddingLeft),h=r?0:_r(n.borderTopWidth),p=r?0:_r(n.borderRightWidth),m=r?0:_r(n.borderBottomWidth),f=u+d,g=s+c,v=(r?0:_r(n.borderLeftWidth))+p,b=h+m,y=l?e.offsetHeight-b-e.clientHeight:0,x=i?e.offsetWidth-v-e.clientWidth:0,w=o?f+v:0,C=o?g+b:0,k=r?r.width:_r(n.width)-w-x,S=r?r.height:_r(n.height)-C-y,P=k+f+x+v,z=S+g+y+b,T=Fr({devicePixelContentBoxSize:jr(Math.round(k*devicePixelRatio),Math.round(S*devicePixelRatio),a),borderBoxSize:jr(P,z,a),contentBoxSize:jr(k,S,a),contentRect:new Ir(u,s,k,S)});return Or.set(e,T),T},Ur=function(e,t,n){var r=qr(e,n),o=r.borderBoxSize,a=r.contentBoxSize,i=r.devicePixelContentBoxSize;switch(t){case Pr.DEVICE_PIXEL_CONTENT_BOX:return i;case Pr.BORDER_BOX:return o;default:return a}},Yr=function(e){var t=qr(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Fr([t.borderBoxSize]),this.contentBoxSize=Fr([t.contentBoxSize]),this.devicePixelContentBoxSize=Fr([t.devicePixelContentBoxSize])},Kr=function(e){if(Ar(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Xr=function(){var e=1/0,t=[];Tr.forEach(function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function(t){var n=new Yr(t.target),o=Kr(t.target);r.push(n),t.lastReportedSize=Ur(t.target,t.observedBox),o<e&&(e=o)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},Gr=function(e){Tr.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(Kr(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},Zr=function(){var e,t=0;for(Gr(t);Mr();)t=Xr(),Gr(t);return Tr.some(function(e){return e.skippedTargets.length>0})&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Rr}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Rr),window.dispatchEvent(e)),t>0},Qr=[],Jr=function(e){if(!$r){var t=0,n=document.createTextNode("");new MutationObserver(function(){return Qr.splice(0).forEach(function(e){return e()})}).observe(n,{characterData:!0}),$r=function(){n.textContent="".concat(t?t--:t++)}}Qr.push(e),$r()},eo=0,to={attributes:!0,characterData:!0,childList:!0,subtree:!0},no=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ro=function(e){return void 0===e&&(e=0),Date.now()+e},oo=!1,ao=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!oo){oo=!0;var n,r=ro(e);n=function(){var n=!1;try{n=Zr()}finally{if(oo=!1,e=r-ro(),!eo)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Jr(function(){requestAnimationFrame(n)})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,to)};document.body?t():Er.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),no.forEach(function(t){return Er.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),no.forEach(function(t){return Er.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),io=function(e){!eo&&e>0&&ao.start(),!(eo+=e)&&ao.stop()},lo=function(){function e(e,t){this.target=e,this.observedBox=t||Pr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Ur(this.target,this.observedBox,!0);return e=this.target,Br(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),so=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},co=new WeakMap,uo=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ho=function(){function e(){}return e.connect=function(e,t){var n=new so(e,t);co.set(e,n)},e.observe=function(e,t,n){var r=co.get(e),o=0===r.observationTargets.length;uo(r.observationTargets,t)<0&&(o&&Tr.push(r),r.observationTargets.push(new lo(t,n&&n.box)),io(1),ao.schedule())},e.unobserve=function(e,t){var n=co.get(e),r=uo(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&Tr.splice(Tr.indexOf(n),1),n.observationTargets.splice(r,1),io(-1))},e.disconnect=function(e){var t=this,n=co.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),po=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ho.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Nr(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ho.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Nr(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ho.unobserve(this,e)},e.prototype.disconnect=function(){ho.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var mo=new class{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new("undefined"!=typeof window&&window.ResizeObserver||po)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const t of e){const e=this.elHandlersMap.get(t.target);void 0!==e&&e(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unre