UNPKG

@vueuse/core

Version:

Collection of essential Vue Composition Utilities

1 lines 114 kB
(function(R,b,n){"use strict";function Ae(e,t,o){var l;let r;n.isRef(o)?r={evaluating:o}:r=o||{};const{lazy:i=!1,flush:s="pre",evaluating:a=void 0,shallow:u=!0,onError:f=(l=globalThis.reportError)!=null?l:b.noop}=r,c=n.shallowRef(!i),d=u?n.shallowRef(t):n.ref(t);let h=0;return n.watchEffect(async m=>{if(!c.value)return;h++;const v=h;let S=!1;a&&Promise.resolve().then(()=>{a.value=!0});try{const p=await e(w=>{m(()=>{a&&(a.value=!1),S||w()})});v===h&&(d.value=p)}catch(p){f(p)}finally{a&&v===h&&(a.value=!1),S=!0}},{flush:s}),i?n.computed(()=>(c.value=!0,d.value)):d}function Vt(e,t,o,l){let r=n.inject(e);return o&&(r=n.inject(e,o)),l&&(r=n.inject(e,o,l)),typeof t=="function"?n.computed(i=>t(r,i)):n.computed({get:i=>t.get(r,i),set:t.set})}function Ft(e={}){const{inheritAttrs:t=!0}=e,o=n.shallowRef(),l=n.defineComponent({setup(i,{slots:s}){return()=>{o.value=s.default}}}),r=n.defineComponent({inheritAttrs:t,props:e.props,setup(i,{attrs:s,slots:a}){return()=>{var u;if(!o.value&&process.env.NODE_ENV!=="production")throw new Error("[VueUse] Failed to find the definition of reusable template");const f=(u=o.value)==null?void 0:u.call(o,{...e.props==null?Pt(s):i,$slots:a});return t&&f?.length===1?f[0]:f}}});return b.makeDestructurable({define:l,reuse:r},[l,r])}function Pt(e){const t={};for(const o in e)t[b.camelize(o)]=e[o];return t}function Dt(e={}){let t=0;const o=n.ref([]);function l(...s){const a=n.shallowReactive({key:t++,args:s,promise:void 0,resolve:()=>{},reject:()=>{},isResolving:!1,options:e});return o.value.push(a),a.promise=new Promise((u,f)=>{a.resolve=c=>(a.isResolving=!0,u(c)),a.reject=f}).finally(()=>{a.promise=void 0;const u=o.value.indexOf(a);u!==-1&&o.value.splice(u,1)}),a.promise}function r(...s){return e.singleton&&o.value.length>0?o.value[0].promise:l(...s)}const i=n.defineComponent((s,{slots:a})=>{const u=()=>o.value.map(f=>{var c;return n.h(n.Fragment,{key:f.key},(c=a.default)==null?void 0:c.call(a,f))});return e.transition?()=>n.h(n.TransitionGroup,e.transition,u):u});return i.start=r,i}function Ct(e){return function(...t){return e.apply(this,t.map(o=>n.toValue(o)))}}const L=b.isClient?window:void 0,q=b.isClient?window.document:void 0,G=b.isClient?window.navigator:void 0,At=b.isClient?window.location:void 0;function W(e){var t;const o=n.toValue(e);return(t=o?.$el)!=null?t:o}function k(...e){const t=[],o=()=>{t.forEach(a=>a()),t.length=0},l=(a,u,f,c)=>(a.addEventListener(u,f,c),()=>a.removeEventListener(u,f,c)),r=n.computed(()=>{const a=b.toArray(n.toValue(e[0])).filter(u=>u!=null);return a.every(u=>typeof u!="string")?a:void 0}),i=b.watchImmediate(()=>{var a,u;return[(u=(a=r.value)==null?void 0:a.map(f=>W(f)))!=null?u:[L].filter(f=>f!=null),b.toArray(n.toValue(r.value?e[1]:e[0])),b.toArray(n.unref(r.value?e[2]:e[1])),n.toValue(r.value?e[3]:e[2])]},([a,u,f,c])=>{if(o(),!a?.length||!u?.length||!f?.length)return;const d=b.isObject(c)?{...c}:c;t.push(...a.flatMap(h=>u.flatMap(m=>f.map(v=>l(h,m,v,d)))))},{flush:"post"}),s=()=>{i(),o()};return b.tryOnScopeDispose(o),s}let Me=!1;function Mt(e,t,o={}){const{window:l=L,ignore:r=[],capture:i=!0,detectIframe:s=!1,controls:a=!1}=o;if(!l)return a?{stop:b.noop,cancel:b.noop,trigger:b.noop}:b.noop;if(b.isIOS&&!Me){Me=!0;const p={passive:!0};Array.from(l.document.body.children).forEach(w=>w.addEventListener("click",b.noop,p)),l.document.documentElement.addEventListener("click",b.noop,p)}let u=!0;const f=p=>n.toValue(r).some(w=>{if(typeof w=="string")return Array.from(l.document.querySelectorAll(w)).some(y=>y===p.target||p.composedPath().includes(y));{const y=W(w);return y&&(p.target===y||p.composedPath().includes(y))}});function c(p){const w=n.toValue(p);return w&&w.$.subTree.shapeFlag===16}function d(p,w){const y=n.toValue(p),g=y.$.subTree&&y.$.subTree.children;return g==null||!Array.isArray(g)?!1:g.some(O=>O.el===w.target||w.composedPath().includes(O.el))}const h=p=>{const w=W(e);if(p.target!=null&&!(!(w instanceof Element)&&c(e)&&d(e,p))&&!(!w||w===p.target||p.composedPath().includes(w))){if("detail"in p&&p.detail===0&&(u=!f(p)),!u){u=!0;return}t(p)}};let m=!1;const v=[k(l,"click",p=>{m||(m=!0,setTimeout(()=>{m=!1},0),h(p))},{passive:!0,capture:i}),k(l,"pointerdown",p=>{const w=W(e);u=!f(p)&&!!(w&&!p.composedPath().includes(w))},{passive:!0}),s&&k(l,"blur",p=>{setTimeout(()=>{var w;const y=W(e);((w=l.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!y?.contains(l.document.activeElement)&&t(p)},0)},{passive:!0})].filter(Boolean),S=()=>v.forEach(p=>p());return a?{stop:S,cancel:()=>{u=!1},trigger:p=>{u=!0,h(p),u=!1}}:S}function Ie(){const e=n.shallowRef(!1),t=n.getCurrentInstance();return t&&n.onMounted(()=>{e.value=!0},t),e}function H(e){const t=Ie();return n.computed(()=>(t.value,!!e()))}function X(e,t,o={}){const{window:l=L,...r}=o;let i;const s=H(()=>l&&"MutationObserver"in l),a=()=>{i&&(i.disconnect(),i=void 0)},u=n.computed(()=>{const h=n.toValue(e),m=b.toArray(h).map(W).filter(b.notNullish);return new Set(m)}),f=n.watch(u,h=>{a(),s.value&&h.size&&(i=new MutationObserver(t),h.forEach(m=>i.observe(m,r)))},{immediate:!0,flush:"post"}),c=()=>i?.takeRecords(),d=()=>{f(),a()};return b.tryOnScopeDispose(d),{isSupported:s,stop:d,takeRecords:c}}function we(e,t,o={}){const{window:l=L,document:r=l?.document,flush:i="sync"}=o;if(!l||!r)return b.noop;let s;const a=c=>{s?.(),s=c},u=n.watchEffect(()=>{const c=W(e);if(c){const{stop:d}=X(r,h=>{h.map(v=>[...v.removedNodes]).flat().some(v=>v===c||v.contains(c))&&t(h)},{window:l,childList:!0,subtree:!0});a(d)}},{flush:i}),f=()=>{u(),a()};return b.tryOnScopeDispose(f),f}function It(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function se(...e){let t,o,l={};e.length===3?(t=e[0],o=e[1],l=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,o=e[0],l=e[1]):(t=e[0],o=e[1]):(t=!0,o=e[0]);const{target:r=L,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=l,u=It(t);return k(r,i,c=>{c.repeat&&n.toValue(a)||u(c)&&o(c)},s)}function Lt(e,t,o={}){return se(e,t,{...o,eventName:"keydown"})}function Nt(e,t,o={}){return se(e,t,{...o,eventName:"keypress"})}function xt(e,t,o={}){return se(e,t,{...o,eventName:"keyup"})}const Wt=500,Ht=10;function Ut(e,t,o){var l,r;const i=n.computed(()=>W(e));let s,a,u,f=!1;function c(){s&&(clearTimeout(s),s=void 0),a=void 0,u=void 0,f=!1}function d(y){const g=o?.delay;return typeof g=="function"?g(y):g??Wt}function h(y){var g,O,T;const[F,E,_]=[u,a,f];if(c(),!o?.onMouseUp||!E||!F||(g=o?.modifiers)!=null&&g.self&&y.target!==i.value)return;(O=o?.modifiers)!=null&&O.prevent&&y.preventDefault(),(T=o?.modifiers)!=null&&T.stop&&y.stopPropagation();const V=y.x-E.x,C=y.y-E.y,M=Math.sqrt(V*V+C*C);o.onMouseUp(y.timeStamp-F,M,_)}function m(y){var g,O,T;(g=o?.modifiers)!=null&&g.self&&y.target!==i.value||(c(),(O=o?.modifiers)!=null&&O.prevent&&y.preventDefault(),(T=o?.modifiers)!=null&&T.stop&&y.stopPropagation(),a={x:y.x,y:y.y},u=y.timeStamp,s=setTimeout(()=>{f=!0,t(y)},d(y)))}function v(y){var g,O,T,F;if((g=o?.modifiers)!=null&&g.self&&y.target!==i.value||!a||o?.distanceThreshold===!1)return;(O=o?.modifiers)!=null&&O.prevent&&y.preventDefault(),(T=o?.modifiers)!=null&&T.stop&&y.stopPropagation();const E=y.x-a.x,_=y.y-a.y;Math.sqrt(E*E+_*_)>=((F=o?.distanceThreshold)!=null?F:Ht)&&c()}const S={capture:(l=o?.modifiers)==null?void 0:l.capture,once:(r=o?.modifiers)==null?void 0:r.once},p=[k(i,"pointerdown",m,S),k(i,"pointermove",v,S),k(i,["pointerup","pointerleave"],h,S)];return()=>p.forEach(y=>y())}function $t(){const{activeElement:e,body:t}=document;if(!e||e===t)return!1;switch(e.tagName){case"INPUT":case"TEXTAREA":return!0}return e.hasAttribute("contenteditable")}function Bt({keyCode:e,metaKey:t,ctrlKey:o,altKey:l}){return t||o||l?!1:e>=48&&e<=57||e>=96&&e<=105||e>=65&&e<=90}function jt(e,t={}){const{document:o=q}=t;o&&k(o,"keydown",r=>{!$t()&&Bt(r)&&e(r)},{passive:!0})}function zt(e,t=null){const o=n.getCurrentInstance();let l=()=>{};const r=n.customRef((i,s)=>(l=s,{get(){var a,u;return i(),(u=(a=o?.proxy)==null?void 0:a.$refs[e])!=null?u:t},set(){}}));return b.tryOnMounted(l),n.onUpdated(l),r}function Le(e={}){var t;const{window:o=L,deep:l=!0,triggerOnRemoval:r=!1}=e,i=(t=e.document)!=null?t:o?.document,s=()=>{var f;let c=i?.activeElement;if(l)for(;c?.shadowRoot;)c=(f=c?.shadowRoot)==null?void 0:f.activeElement;return c},a=n.shallowRef(),u=()=>{a.value=s()};if(o){const f={capture:!0,passive:!0};k(o,"blur",c=>{c.relatedTarget===null&&u()},f),k(o,"focus",u,f)}return r&&we(a,u,{document:i}),u(),a}function K(e,t={}){const{immediate:o=!0,fpsLimit:l=void 0,window:r=L,once:i=!1}=t,s=n.shallowRef(!1),a=n.computed(()=>l?1e3/n.toValue(l):null);let u=0,f=null;function c(m){if(!s.value||!r)return;u||(u=m);const v=m-u;if(a.value&&v<a.value){f=r.requestAnimationFrame(c);return}if(u=m,e({delta:v,timestamp:m}),i){s.value=!1,f=null;return}f=r.requestAnimationFrame(c)}function d(){!s.value&&r&&(s.value=!0,u=0,f=r.requestAnimationFrame(c))}function h(){s.value=!1,f!=null&&r&&(r.cancelAnimationFrame(f),f=null)}return o&&d(),b.tryOnScopeDispose(h),{isActive:n.readonly(s),pause:h,resume:d}}function qt(e,t,o){let l,r;b.isObject(o)?(l=o,r=b.objectOmit(o,["window","immediate","commitStyles","persist","onReady","onError"])):(l={duration:o},r=o);const{window:i=L,immediate:s=!0,commitStyles:a,persist:u,playbackRate:f=1,onReady:c,onError:d=I=>{console.error(I)}}=l,h=H(()=>i&&HTMLElement&&"animate"in HTMLElement.prototype),m=n.shallowRef(void 0),v=n.shallowReactive({startTime:null,currentTime:null,timeline:null,playbackRate:f,pending:!1,playState:s?"idle":"paused",replaceState:"active"}),S=n.computed(()=>v.pending),p=n.computed(()=>v.playState),w=n.computed(()=>v.replaceState),y=n.computed({get(){return v.startTime},set(I){v.startTime=I,m.value&&(m.value.startTime=I)}}),g=n.computed({get(){return v.currentTime},set(I){v.currentTime=I,m.value&&(m.value.currentTime=I,N())}}),O=n.computed({get(){return v.timeline},set(I){v.timeline=I,m.value&&(m.value.timeline=I)}}),T=n.computed({get(){return v.playbackRate},set(I){v.playbackRate=I,m.value&&(m.value.playbackRate=I)}}),F=()=>{if(m.value)try{m.value.play(),N()}catch(I){x(),d(I)}else M()},E=()=>{var I;try{(I=m.value)==null||I.pause(),x()}catch(U){d(U)}},_=()=>{var I;m.value||M();try{(I=m.value)==null||I.reverse(),N()}catch(U){x(),d(U)}},V=()=>{var I;try{(I=m.value)==null||I.finish(),x()}catch(U){d(U)}},C=()=>{var I;try{(I=m.value)==null||I.cancel(),x()}catch(U){d(U)}};n.watch(()=>W(e),I=>{I?M(!0):m.value=void 0}),n.watch(()=>t,I=>{if(m.value){M();const U=W(e);U&&(m.value.effect=new KeyframeEffect(U,n.toValue(I),r))}},{deep:!0}),b.tryOnMounted(()=>M(!0),!1),b.tryOnScopeDispose(C);function M(I){const U=W(e);!h.value||!U||(m.value||(m.value=U.animate(n.toValue(t),r)),u&&m.value.persist(),f!==1&&(m.value.playbackRate=f),I&&!s?m.value.pause():N(),c?.(m.value))}const P={passive:!0};k(m,["cancel","finish","remove"],x,P),k(m,"finish",()=>{var I;a&&((I=m.value)==null||I.commitStyles())},P);const{resume:A,pause:D}=K(()=>{m.value&&(v.pending=m.value.pending,v.playState=m.value.playState,v.replaceState=m.value.replaceState,v.startTime=m.value.startTime,v.currentTime=m.value.currentTime,v.timeline=m.value.timeline,v.playbackRate=m.value.playbackRate)},{immediate:!1});function N(){h.value&&A()}function x(){h.value&&i&&i.requestAnimationFrame(D)}return{isSupported:h,animate:m,play:F,pause:E,reverse:_,finish:V,cancel:C,pending:S,playState:p,replaceState:w,startTime:y,currentTime:g,timeline:O,playbackRate:T}}function Gt(e,t){const{interrupt:o=!0,onError:l=b.noop,onFinished:r=b.noop,signal:i}=t||{},s={aborted:"aborted",fulfilled:"fulfilled",pending:"pending",rejected:"rejected"},a=Array.from(Array.from({length:e.length}),()=>({state:s.pending,data:null})),u=n.reactive(a),f=n.shallowRef(-1);if(!e||e.length===0)return r(),{activeIndex:f,result:u};function c(d,h){f.value++,u[f.value].data=h,u[f.value].state=d}return e.reduce((d,h)=>d.then(m=>{var v;if(i?.aborted){c(s.aborted,new Error("aborted"));return}if(((v=u[f.value])==null?void 0:v.state)===s.rejected&&o){r();return}const S=h(m).then(p=>(c(s.fulfilled,p),f.value===e.length-1&&r(),p));return i?Promise.race([S,Yt(i)]):S}).catch(m=>i?.aborted?(c(s.aborted,m),m):(c(s.rejected,m),l(),m)),Promise.resolve()),{activeIndex:f,result:u}}function Yt(e){return new Promise((t,o)=>{const l=new Error("aborted");e.aborted?o(l):e.addEventListener("abort",()=>o(l),{once:!0})})}function Ne(e,t,o){var l;const{immediate:r=!0,delay:i=0,onError:s=(l=globalThis.reportError)!=null?l:b.noop,onSuccess:a=b.noop,resetOnExecute:u=!0,shallow:f=!0,throwError:c}=o??{},d=f?n.shallowRef(t):n.ref(t),h=n.shallowRef(!1),m=n.shallowRef(!1),v=n.shallowRef(void 0);async function S(y=0,...g){u&&(d.value=n.toValue(t)),v.value=void 0,h.value=!1,m.value=!0,y>0&&await b.promiseTimeout(y);const O=typeof e=="function"?e(...g):e;try{const T=await O;d.value=T,h.value=!0,a(T)}catch(T){if(v.value=T,s(T),c)throw T}finally{m.value=!1}return d.value}r&&S(i);const p={state:d,isReady:h,isLoading:m,error:v,execute:S,executeImmediate:(...y)=>S(0,...y)};function w(){return new Promise((y,g)=>{b.until(m).toBe(!1).then(()=>y(p)).catch(g)})}return{...p,then(y,g){return w().then(y,g)}}}const te={array:e=>JSON.stringify(e),object:e=>JSON.stringify(e),set:e=>JSON.stringify(Array.from(e)),map:e=>JSON.stringify(Object.fromEntries(e)),null:()=>""};function Xt(e){return e?e instanceof Map?te.map:e instanceof Set?te.set:Array.isArray(e)?te.array:te.object:te.null}function Kt(e,t){const o=n.shallowRef(""),l=n.shallowRef();function r(){if(b.isClient)return l.value=new Promise((i,s)=>{try{const a=n.toValue(e);if(a==null)i("");else if(typeof a=="string")i(ge(new Blob([a],{type:"text/plain"})));else if(a instanceof Blob)i(ge(a));else if(a instanceof ArrayBuffer)i(window.btoa(String.fromCharCode(...new Uint8Array(a))));else if(a instanceof HTMLCanvasElement)i(a.toDataURL(t?.type,t?.quality));else if(a instanceof HTMLImageElement){const u=a.cloneNode(!1);u.crossOrigin="Anonymous",Jt(u).then(()=>{const f=document.createElement("canvas"),c=f.getContext("2d");f.width=u.width,f.height=u.height,c.drawImage(u,0,0,f.width,f.height),i(f.toDataURL(t?.type,t?.quality))}).catch(s)}else if(typeof a=="object"){const f=(t?.serializer||Xt(a))(a);return i(ge(new Blob([f],{type:"application/json"})))}else s(new Error("target is unsupported types"))}catch(a){s(a)}}),l.value.then(i=>{o.value=t?.dataUrl===!1?i.replace(/^data:.*?;base64,/,""):i}),l.value}return n.isRef(e)||typeof e=="function"?n.watch(e,r,{immediate:!0}):r(),{base64:o,promise:l,execute:r}}function Jt(e){return new Promise((t,o)=>{e.complete?t():(e.onload=()=>{t()},e.onerror=o)})}function ge(e){return new Promise((t,o)=>{const l=new FileReader;l.onload=r=>{t(r.target.result)},l.onerror=o,l.readAsDataURL(e)})}function Qt(e={}){const{navigator:t=G}=e,o=["chargingchange","chargingtimechange","dischargingtimechange","levelchange"],l=H(()=>t&&"getBattery"in t&&typeof t.getBattery=="function"),r=n.shallowRef(!1),i=n.shallowRef(0),s=n.shallowRef(0),a=n.shallowRef(1);let u;function f(){r.value=this.charging,i.value=this.chargingTime||0,s.value=this.dischargingTime||0,a.value=this.level}return l.value&&t.getBattery().then(c=>{u=c,f.call(u),k(u,o,f,{passive:!0})}),{isSupported:l,charging:r,chargingTime:i,dischargingTime:s,level:a}}function Zt(e){let{acceptAllDevices:t=!1}=e||{};const{filters:o=void 0,optionalServices:l=void 0,navigator:r=G}=e||{},i=H(()=>r&&"bluetooth"in r),s=n.shallowRef(),a=n.shallowRef(null);n.watch(s,()=>{h()});async function u(){if(i.value){a.value=null,o&&o.length>0&&(t=!1);try{s.value=await r?.bluetooth.requestDevice({acceptAllDevices:t,filters:o,optionalServices:l})}catch(m){a.value=m}}}const f=n.shallowRef(),c=n.shallowRef(!1);function d(){c.value=!1,s.value=void 0,f.value=void 0}async function h(){if(a.value=null,s.value&&s.value.gatt){k(s,"gattserverdisconnected",d,{passive:!0});try{f.value=await s.value.gatt.connect(),c.value=f.value.connected}catch(m){a.value=m}}}return b.tryOnMounted(()=>{var m;s.value&&((m=s.value.gatt)==null||m.connect())}),b.tryOnScopeDispose(()=>{var m;s.value&&((m=s.value.gatt)==null||m.disconnect())}),{isSupported:i,isConnected:n.readonly(c),device:s,requestDevice:u,server:f,error:a}}const be=Symbol("vueuse-ssr-width");function Se(){const e=n.hasInjectionContext()?b.injectLocal(be,null):null;return typeof e=="number"?e:void 0}function en(e,t){t!==void 0?t.provide(be,e):b.provideLocal(be,e)}function $(e,t={}){const{window:o=L,ssrWidth:l=Se()}=t,r=H(()=>o&&"matchMedia"in o&&typeof o.matchMedia=="function"),i=n.shallowRef(typeof l=="number"),s=n.shallowRef(),a=n.shallowRef(!1),u=f=>{a.value=f.matches};return n.watchEffect(()=>{if(i.value){i.value=!r.value;const f=n.toValue(e).split(",");a.value=f.some(c=>{const d=c.includes("not all"),h=c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),m=c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let v=!!(h||m);return h&&v&&(v=l>=b.pxValue(h[1])),m&&v&&(v=l<=b.pxValue(m[1])),d?!v:v});return}r.value&&(s.value=o.matchMedia(n.toValue(e)),a.value=s.value.matches)}),k(s,"change",u,{passive:!0}),n.computed(()=>a.value)}const tn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},nn={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},xe={xs:0,sm:600,md:960,lg:1264,xl:1904},on={xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560},ln=xe,an={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},rn={xs:0,sm:600,md:1024,lg:1440,xl:1920},sn={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560},un={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},cn={sm:576,md:768,lg:992,xl:1200},fn={xs:0,sm:768,md:992,lg:1200,xl:1920};function dn(e,t={}){function o(m,v){let S=n.toValue(e[n.toValue(m)]);return v!=null&&(S=b.increaseWithUnit(S,v)),typeof S=="number"&&(S=`${S}px`),S}const{window:l=L,strategy:r="min-width",ssrWidth:i=Se()}=t,s=typeof i=="number",a=s?n.shallowRef(!1):{value:!0};s&&b.tryOnMounted(()=>a.value=!!l);function u(m,v){return!a.value&&s?m==="min"?i>=b.pxValue(v):i<=b.pxValue(v):l?l.matchMedia(`(${m}-width: ${v})`).matches:!1}const f=m=>$(()=>`(min-width: ${o(m)})`,t),c=m=>$(()=>`(max-width: ${o(m)})`,t),d=Object.keys(e).reduce((m,v)=>(Object.defineProperty(m,v,{get:()=>r==="min-width"?f(v):c(v),enumerable:!0,configurable:!0}),m),{});function h(){const m=Object.keys(e).map(v=>[v,d[v],b.pxValue(o(v))]).sort((v,S)=>v[2]-S[2]);return n.computed(()=>m.filter(([,v])=>v.value).map(([v])=>v))}return Object.assign(d,{greaterOrEqual:f,smallerOrEqual:c,greater(m){return $(()=>`(min-width: ${o(m,.1)})`,t)},smaller(m){return $(()=>`(max-width: ${o(m,-.1)})`,t)},between(m,v){return $(()=>`(min-width: ${o(m)}) and (max-width: ${o(v,-.1)})`,t)},isGreater(m){return u("min",o(m,.1))},isGreaterOrEqual(m){return u("min",o(m))},isSmaller(m){return u("max",o(m,-.1))},isSmallerOrEqual(m){return u("max",o(m))},isInBetween(m,v){return u("min",o(m))&&u("max",o(v,-.1))},current:h,active(){const m=h();return n.computed(()=>m.value.length===0?"":m.value.at(r==="min-width"?-1:0))}})}function mn(e){const{name:t,window:o=L}=e,l=H(()=>o&&"BroadcastChannel"in o),r=n.shallowRef(!1),i=n.ref(),s=n.ref(),a=n.shallowRef(null),u=c=>{i.value&&i.value.postMessage(c)},f=()=>{i.value&&i.value.close(),r.value=!0};return l.value&&b.tryOnMounted(()=>{a.value=null,i.value=new BroadcastChannel(t);const c={passive:!0};k(i,"message",d=>{s.value=d.data},c),k(i,"messageerror",d=>{a.value=d},c),k(i,"close",()=>{r.value=!0},c)}),b.tryOnScopeDispose(()=>{f()}),{isSupported:l,channel:i,data:s,post:u,close:f,error:a,isClosed:r}}const We=["hash","host","hostname","href","pathname","port","protocol","search"];function vn(e={}){const{window:t=L}=e,o=Object.fromEntries(We.map(i=>[i,n.ref()]));for(const[i,s]of b.objectEntries(o))n.watch(s,a=>{!t?.location||t.location[i]===a||(t.location[i]=a)});const l=i=>{var s;const{state:a,length:u}=t?.history||{},{origin:f}=t?.location||{};for(const c of We)o[c].value=(s=t?.location)==null?void 0:s[c];return n.reactive({trigger:i,state:a,length:u,origin:f,...o})},r=n.ref(l("load"));if(t){const i={passive:!0};k(t,"popstate",()=>r.value=l("popstate"),i),k(t,"hashchange",()=>r.value=l("hashchange"),i)}return r}function pn(e,t=(l,r)=>l===r,o){const{deepRefs:l=!0,...r}=o||{},i=b.createRef(e.value,l);return n.watch(()=>e.value,s=>{t(s,i.value)||(i.value=s)},r),i}function ue(e,t={}){const{controls:o=!1,navigator:l=G}=t,r=H(()=>l&&"permissions"in l),i=n.shallowRef(),s=typeof e=="string"?{name:e}:e,a=n.shallowRef(),u=()=>{var c,d;a.value=(d=(c=i.value)==null?void 0:c.state)!=null?d:"prompt"};k(i,"change",u,{passive:!0});const f=b.createSingletonPromise(async()=>{if(r.value){if(!i.value)try{i.value=await l.permissions.query(s)}catch{i.value=void 0}finally{u()}if(o)return n.toRaw(i.value)}});return f(),o?{state:a,isSupported:r,query:f}:a}function hn(e={}){const{navigator:t=G,read:o=!1,source:l,copiedDuring:r=1500,legacy:i=!1}=e,s=H(()=>t&&"clipboard"in t),a=ue("clipboard-read"),u=ue("clipboard-write"),f=n.computed(()=>s.value||i),c=n.shallowRef(""),d=n.shallowRef(!1),h=b.useTimeoutFn(()=>d.value=!1,r,{immediate:!1});async function m(){let y=!(s.value&&w(a.value));if(!y)try{c.value=await t.clipboard.readText()}catch{y=!0}y&&(c.value=p())}f.value&&o&&k(["copy","cut"],m,{passive:!0});async function v(y=n.toValue(l)){if(f.value&&y!=null){let g=!(s.value&&w(u.value));if(!g)try{await t.clipboard.writeText(y)}catch{g=!0}g&&S(y),c.value=y,d.value=!0,h.start()}}function S(y){const g=document.createElement("textarea");g.value=y??"",g.style.position="absolute",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove()}function p(){var y,g,O;return(O=(g=(y=document?.getSelection)==null?void 0:y.call(document))==null?void 0:g.toString())!=null?O:""}function w(y){return y==="granted"||y==="prompt"}return{isSupported:f,text:c,copied:d,copy:v}}function yn(e={}){const{navigator:t=G,read:o=!1,source:l,copiedDuring:r=1500}=e,i=H(()=>t&&"clipboard"in t),s=n.ref([]),a=n.shallowRef(!1),u=b.useTimeoutFn(()=>a.value=!1,r,{immediate:!1});function f(){i.value&&t.clipboard.read().then(d=>{s.value=d})}i.value&&o&&k(["copy","cut"],f,{passive:!0});async function c(d=n.toValue(l)){i.value&&d!=null&&(await t.clipboard.write(d),s.value=d,a.value=!0,u.start())}return{isSupported:i,content:n.shallowReadonly(s),copied:n.readonly(a),copy:c,read:f}}function ne(e){return JSON.parse(JSON.stringify(e))}function wn(e,t={}){const o=n.ref({}),l=n.shallowRef(!1);let r=!1;const{manual:i,clone:s=ne,deep:a=!0,immediate:u=!0}=t;n.watch(o,()=>{if(r){r=!1;return}l.value=!0},{deep:!0,flush:"sync"});function f(){r=!0,l.value=!1,o.value=s(n.toValue(e))}return!i&&(n.isRef(e)||typeof e=="function")?n.watch(e,f,{...t,deep:a,immediate:u}):f(),{cloned:o,isModified:l,sync:f}}const ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fe="__vueuse_ssr_handlers__",He=gn();function gn(){return fe in ce||(ce[fe]=ce[fe]||{}),ce[fe]}function de(e,t){return He[e]||t}function bn(e,t){He[e]=t}function Ue(e){return $("(prefers-color-scheme: dark)",e)}function $e(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Re={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Ee="vueuse-storage";function me(e,t,o,l={}){var r;const{flush:i="pre",deep:s=!0,listenToStorageChanges:a=!0,writeDefaults:u=!0,mergeDefaults:f=!1,shallow:c,window:d=L,eventFilter:h,onError:m=D=>{console.error(D)},initOnMounted:v}=l,S=(c?n.shallowRef:n.ref)(typeof t=="function"?t():t),p=n.computed(()=>n.toValue(e));if(!o)try{o=de("getDefaultStorage",()=>{var D;return(D=L)==null?void 0:D.localStorage})()}catch(D){m(D)}if(!o)return S;const w=n.toValue(t),y=$e(w),g=(r=l.serializer)!=null?r:Re[y],{pause:O,resume:T}=b.pausableWatch(S,D=>C(D),{flush:i,deep:s,eventFilter:h});n.watch(p,()=>P(),{flush:i});let F=!1;const E=D=>{v&&!F||P(D)},_=D=>{v&&!F||A(D)};d&&a&&(o instanceof Storage?k(d,"storage",E,{passive:!0}):k(d,Ee,_)),v?b.tryOnMounted(()=>{F=!0,P()}):P();function V(D,N){if(d){const x={key:p.value,oldValue:D,newValue:N,storageArea:o};d.dispatchEvent(o instanceof Storage?new StorageEvent("storage",x):new CustomEvent(Ee,{detail:x}))}}function C(D){try{const N=o.getItem(p.value);if(D==null)V(N,null),o.removeItem(p.value);else{const x=g.write(D);N!==x&&(o.setItem(p.value,x),V(N,x))}}catch(N){m(N)}}function M(D){const N=D?D.newValue:o.getItem(p.value);if(N==null)return u&&w!=null&&o.setItem(p.value,g.write(w)),w;if(!D&&f){const x=g.read(N);return typeof f=="function"?f(x,w):y==="object"&&!Array.isArray(x)?{...w,...x}:x}else return typeof N!="string"?N:g.read(N)}function P(D){if(!(D&&D.storageArea!==o)){if(D&&D.key==null){S.value=w;return}if(!(D&&D.key!==p.value)){O();try{const N=g.write(S.value);(D===void 0||D?.newValue!==N)&&(S.value=M(D))}catch(N){m(N)}finally{D?n.nextTick(T):T()}}}}function A(D){P(D.detail)}return S}const Sn="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Be(e={}){const{selector:t="html",attribute:o="class",initialValue:l="auto",window:r=L,storage:i,storageKey:s="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:u,emitAuto:f,disableTransition:c=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},h=Ue({window:r}),m=n.computed(()=>h.value?"dark":"light"),v=u||(s==null?b.toRef(l):me(s,l,i,{window:r,listenToStorageChanges:a})),S=n.computed(()=>v.value==="auto"?m.value:v.value),p=de("updateHTMLAttrs",(O,T,F)=>{const E=typeof O=="string"?r?.document.querySelector(O):W(O);if(!E)return;const _=new Set,V=new Set;let C=null;if(T==="class"){const P=F.split(/\s/g);Object.values(d).flatMap(A=>(A||"").split(/\s/g)).filter(Boolean).forEach(A=>{P.includes(A)?_.add(A):V.add(A)})}else C={key:T,value:F};if(_.size===0&&V.size===0&&C===null)return;let M;c&&(M=r.document.createElement("style"),M.appendChild(document.createTextNode(Sn)),r.document.head.appendChild(M));for(const P of _)E.classList.add(P);for(const P of V)E.classList.remove(P);C&&E.setAttribute(C.key,C.value),c&&(r.getComputedStyle(M).opacity,document.head.removeChild(M))});function w(O){var T;p(t,o,(T=d[O])!=null?T:O)}function y(O){e.onChanged?e.onChanged(O,w):w(O)}n.watch(S,y,{flush:"post",immediate:!0}),b.tryOnMounted(()=>y(S.value));const g=n.computed({get(){return f?v.value:S.value},set(O){v.value=O}});return Object.assign(g,{store:v,system:m,state:S})}function Rn(e=n.shallowRef(!1)){const t=b.createEventHook(),o=b.createEventHook(),l=b.createEventHook();let r=b.noop;const i=u=>(l.trigger(u),e.value=!0,new Promise(f=>{r=f})),s=u=>{e.value=!1,t.trigger(u),r({data:u,isCanceled:!1})},a=u=>{e.value=!1,o.trigger(u),r({data:u,isCanceled:!0})};return{isRevealed:n.computed(()=>e.value),reveal:i,confirm:s,cancel:a,onReveal:l.on,onConfirm:t.on,onCancel:o.on}}function En(e,t){var o,l;const r=n.shallowRef(n.toValue(e)),i=b.useIntervalFn(()=>{var c,d;const h=r.value-1;r.value=h<0?0:h,(c=t?.onTick)==null||c.call(t),r.value<=0&&(i.pause(),(d=t?.onComplete)==null||d.call(t))},(o=t?.interval)!=null?o:1e3,{immediate:(l=t?.immediate)!=null?l:!1}),s=c=>{var d;r.value=(d=n.toValue(c))!=null?d:n.toValue(e)},a=()=>{i.pause(),s()},u=()=>{i.isActive.value||r.value>0&&i.resume()};return{remaining:r,reset:s,stop:a,start:c=>{s(c),i.resume()},pause:i.pause,resume:u,isActive:i.isActive}}function oe(e,t,o={}){const{window:l=L,initialValue:r,observe:i=!1}=o,s=n.shallowRef(r),a=n.computed(()=>{var f;return W(t)||((f=l?.document)==null?void 0:f.documentElement)});function u(){var f;const c=n.toValue(e),d=n.toValue(a);if(d&&l&&c){const h=(f=l.getComputedStyle(d).getPropertyValue(c))==null?void 0:f.trim();s.value=h||s.value||r}}return i&&X(a,u,{attributeFilter:["style","class"],window:l}),n.watch([a,()=>n.toValue(e)],(f,c)=>{c[0]&&c[1]&&c[0].style.removeProperty(c[1]),u()},{immediate:!0}),n.watch([s,a],([f,c])=>{const d=n.toValue(e);c?.style&&d&&(f==null?c.style.removeProperty(d):c.style.setProperty(d,f))},{immediate:!0}),s}function je(e){const t=n.getCurrentInstance(),o=b.computedWithControl(()=>null,()=>e?W(e):t.proxy.$el);return n.onUpdated(o.trigger),n.onMounted(o.trigger),o}function Tn(e,t){const o=n.shallowRef(f()),l=b.toRef(e),r=n.computed({get(){var c;const d=l.value;let h=t?.getIndexOf?t.getIndexOf(o.value,d):d.indexOf(o.value);return h<0&&(h=(c=t?.fallbackIndex)!=null?c:0),h},set(c){i(c)}});function i(c){const d=l.value,h=d.length,m=(c%h+h)%h,v=d[m];return o.value=v,v}function s(c=1){return i(r.value+c)}function a(c=1){return s(c)}function u(c=1){return s(-c)}function f(){var c,d;return(d=n.toValue((c=t?.initialValue)!=null?c:n.toValue(e)[0]))!=null?d:void 0}return n.watch(l,()=>i(r.value)),{state:o,index:r,next:a,prev:u,go:i}}function On(e={}){const{valueDark:t="dark",valueLight:o=""}=e,l=Be({...e,onChanged:(s,a)=>{var u;e.onChanged?(u=e.onChanged)==null||u.call(e,s==="dark",a,s):a(s)},modes:{dark:t,light:o}}),r=n.computed(()=>l.system.value);return n.computed({get(){return l.value==="dark"},set(s){const a=s?"dark":"light";r.value===a?l.value="auto":l.value=a}})}function ze(e){return e}function kn(e,t){return e.value=t}function _n(e){return e?typeof e=="function"?e:ne:ze}function Vn(e){return e?typeof e=="function"?e:ne:ze}function qe(e,t={}){const{clone:o=!1,dump:l=_n(o),parse:r=Vn(o),setSource:i=kn}=t;function s(){return n.markRaw({snapshot:l(e.value),timestamp:b.timestamp()})}const a=n.ref(s()),u=n.ref([]),f=n.ref([]),c=g=>{i(e,r(g.snapshot)),a.value=g},d=()=>{u.value.unshift(a.value),a.value=s(),t.capacity&&u.value.length>t.capacity&&u.value.splice(t.capacity,Number.POSITIVE_INFINITY),f.value.length&&f.value.splice(0,f.value.length)},h=()=>{u.value.splice(0,u.value.length),f.value.splice(0,f.value.length)},m=()=>{const g=u.value.shift();g&&(f.value.unshift(a.value),c(g))},v=()=>{const g=f.value.shift();g&&(u.value.unshift(a.value),c(g))},S=()=>{c(a.value)},p=n.computed(()=>[a.value,...u.value]),w=n.computed(()=>u.value.length>0),y=n.computed(()=>f.value.length>0);return{source:e,undoStack:u,redoStack:f,last:a,history:p,canUndo:w,canRedo:y,clear:h,commit:d,reset:S,undo:m,redo:v}}function Te(e,t={}){const{deep:o=!1,flush:l="pre",eventFilter:r,shouldCommit:i=()=>!0}=t,{eventFilter:s,pause:a,resume:u,isActive:f}=b.pausableFilter(r);let c=e.value;const{ignoreUpdates:d,ignorePrevAsyncUpdates:h,stop:m}=b.watchIgnorable(e,y,{deep:o,flush:l,eventFilter:s});function v(F,E){h(),d(()=>{F.value=E,c=E})}const S=qe(e,{...t,clone:t.clone||o,setSource:v}),{clear:p,commit:w}=S;function y(){h(),i(c,e.value)&&(c=e.value,w())}function g(F){u(),F&&y()}function O(F){let E=!1;const _=()=>E=!0;d(()=>{F(_)}),E||y()}function T(){m(),p()}return{...S,isTracking:f,pause:a,resume:g,commit:y,batch:O,dispose:T}}function Fn(e,t={}){const o=t.debounce?b.debounceFilter(t.debounce):void 0;return{...Te(e,{...t,eventFilter:o})}}function Pn(e={}){const{window:t=L,requestPermissions:o=!1,eventFilter:l=b.bypassFilter}=e,r=H(()=>typeof DeviceMotionEvent<"u"),i=H(()=>r.value&&"requestPermission"in DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"),s=n.shallowRef(!1),a=n.ref({x:null,y:null,z:null}),u=n.ref({alpha:null,beta:null,gamma:null}),f=n.shallowRef(0),c=n.ref({x:null,y:null,z:null});function d(){if(t){const m=b.createFilterWrapper(l,v=>{var S,p,w,y,g,O,T,F,E;a.value={x:((S=v.acceleration)==null?void 0:S.x)||null,y:((p=v.acceleration)==null?void 0:p.y)||null,z:((w=v.acceleration)==null?void 0:w.z)||null},c.value={x:((y=v.accelerationIncludingGravity)==null?void 0:y.x)||null,y:((g=v.accelerationIncludingGravity)==null?void 0:g.y)||null,z:((O=v.accelerationIncludingGravity)==null?void 0:O.z)||null},u.value={alpha:((T=v.rotationRate)==null?void 0:T.alpha)||null,beta:((F=v.rotationRate)==null?void 0:F.beta)||null,gamma:((E=v.rotationRate)==null?void 0:E.gamma)||null},f.value=v.interval});k(t,"devicemotion",m,{passive:!0})}}const h=async()=>{if(i.value||(s.value=!0),!s.value&&i.value){const m=DeviceMotionEvent.requestPermission;try{await m()==="granted"&&(s.value=!0,d())}catch(v){console.error(v)}}};return r.value&&(o&&i.value?h().then(()=>d()):d()),{acceleration:a,accelerationIncludingGravity:c,rotationRate:u,interval:f,isSupported:r,requirePermissions:i,ensurePermissions:h,permissionGranted:s}}function Ge(e={}){const{window:t=L}=e,o=H(()=>t&&"DeviceOrientationEvent"in t),l=n.shallowRef(!1),r=n.shallowRef(null),i=n.shallowRef(null),s=n.shallowRef(null);return t&&o.value&&k(t,"deviceorientation",a=>{l.value=a.absolute,r.value=a.alpha,i.value=a.beta,s.value=a.gamma},{passive:!0}),{isSupported:o,isAbsolute:l,alpha:r,beta:i,gamma:s}}function Dn(e={}){const{window:t=L}=e,o=n.shallowRef(1),l=$(()=>`(resolution: ${o.value}dppx)`,e);let r=b.noop;return t&&(r=b.watchImmediate(l,()=>o.value=t.devicePixelRatio)),{pixelRatio:n.readonly(o),stop:r}}function Cn(e={}){const{navigator:t=G,requestPermissions:o=!1,constraints:l={audio:!0,video:!0},onUpdated:r}=e,i=n.ref([]),s=n.computed(()=>i.value.filter(v=>v.kind==="videoinput")),a=n.computed(()=>i.value.filter(v=>v.kind==="audioinput")),u=n.computed(()=>i.value.filter(v=>v.kind==="audiooutput")),f=H(()=>t&&t.mediaDevices&&t.mediaDevices.enumerateDevices),c=n.shallowRef(!1);let d;async function h(){f.value&&(i.value=await t.mediaDevices.enumerateDevices(),r?.(i.value),d&&(d.getTracks().forEach(v=>v.stop()),d=null))}async function m(){const v=l.video?"camera":"microphone";if(!f.value)return!1;if(c.value)return!0;const{state:S,query:p}=ue(v,{controls:!0});if(await p(),S.value!=="granted"){let w=!0;try{const y=await t.mediaDevices.enumerateDevices(),g=y.some(T=>T.kind==="videoinput"),O=y.some(T=>T.kind==="audioinput"||T.kind==="audiooutput");l.video=g?l.video:!1,l.audio=O?l.audio:!1,d=await t.mediaDevices.getUserMedia(l)}catch{d=null,w=!1}h(),c.value=w}else c.value=!0;return c.value}return f.value&&(o&&m(),k(t.mediaDevices,"devicechange",h,{passive:!0}),h()),{devices:i,ensurePermissions:m,permissionGranted:c,videoInputs:s,audioInputs:a,audioOutputs:u,isSupported:f}}function An(e={}){var t;const o=n.shallowRef((t=e.enabled)!=null?t:!1),l=e.video,r=e.audio,{navigator:i=G}=e,s=H(()=>{var m;return(m=i?.mediaDevices)==null?void 0:m.getDisplayMedia}),a={audio:r,video:l},u=n.shallowRef();async function f(){var m;if(!(!s.value||u.value))return u.value=await i.mediaDevices.getDisplayMedia(a),(m=u.value)==null||m.getTracks().forEach(v=>k(v,"ended",d,{passive:!0})),u.value}async function c(){var m;(m=u.value)==null||m.getTracks().forEach(v=>v.stop()),u.value=void 0}function d(){c(),o.value=!1}async function h(){return await f(),u.value&&(o.value=!0),u.value}return n.watch(o,m=>{m?f():c()},{immediate:!0}),{isSupported:s,stream:u,start:h,stop:d,enabled:o}}function Ye(e={}){const{document:t=q}=e;if(!t)return n.shallowRef("visible");const o=n.shallowRef(t.visibilityState);return k(t,"visibilitychange",()=>{o.value=t.visibilityState},{passive:!0}),o}function Mn(e,t={}){var o;const{pointerTypes:l,preventDefault:r,stopPropagation:i,exact:s,onMove:a,onEnd:u,onStart:f,initialValue:c,axis:d="both",draggingElement:h=L,containerElement:m,handle:v=e,buttons:S=[0]}=t,p=n.ref((o=n.toValue(c))!=null?o:{x:0,y:0}),w=n.ref(),y=E=>l?l.includes(E.pointerType):!0,g=E=>{n.toValue(r)&&E.preventDefault(),n.toValue(i)&&E.stopPropagation()},O=E=>{var _;if(!n.toValue(S).includes(E.button)||n.toValue(t.disabled)||!y(E)||n.toValue(s)&&E.target!==n.toValue(e))return;const V=n.toValue(m),C=(_=V?.getBoundingClientRect)==null?void 0:_.call(V),M=n.toValue(e).getBoundingClientRect(),P={x:E.clientX-(V?M.left-C.left+V.scrollLeft:M.left),y:E.clientY-(V?M.top-C.top+V.scrollTop:M.top)};f?.(P,E)!==!1&&(w.value=P,g(E))},T=E=>{if(n.toValue(t.disabled)||!y(E)||!w.value)return;const _=n.toValue(m),V=n.toValue(e).getBoundingClientRect();let{x:C,y:M}=p.value;(d==="x"||d==="both")&&(C=E.clientX-w.value.x,_&&(C=Math.min(Math.max(0,C),_.scrollWidth-V.width))),(d==="y"||d==="both")&&(M=E.clientY-w.value.y,_&&(M=Math.min(Math.max(0,M),_.scrollHeight-V.height))),p.value={x:C,y:M},a?.(p.value,E),g(E)},F=E=>{n.toValue(t.disabled)||!y(E)||w.value&&(w.value=void 0,u?.(p.value,E),g(E))};if(b.isClient){const E=()=>{var _;return{capture:(_=t.capture)!=null?_:!0,passive:!n.toValue(r)}};k(v,"pointerdown",O,E),k(h,"pointermove",T,E),k(h,"pointerup",F,E)}return{...b.toRefs(p),position:p,isDragging:n.computed(()=>!!w.value),style:n.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function In(e,t={}){var o,l;const r=n.shallowRef(!1),i=n.shallowRef(null);let s=0,a=!0;if(b.isClient){const u=typeof t=="function"?{onDrop:t}:t,f=(o=u.multiple)!=null?o:!0,c=(l=u.preventDefaultForUnhandled)!=null?l:!1,d=p=>{var w,y;const g=Array.from((y=(w=p.dataTransfer)==null?void 0:w.files)!=null?y:[]);return g.length===0?null:f?g:[g[0]]},h=p=>{const w=n.unref(u.dataTypes);return typeof w=="function"?w(p):w?.length?p.length===0?!1:p.every(y=>w.some(g=>y.includes(g))):!0},m=p=>{const w=Array.from(p??[]).map(O=>O.type),y=h(w),g=f||p.length<=1;return y&&g},v=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!("chrome"in window),S=(p,w)=>{var y,g,O,T,F,E;const _=(y=p.dataTransfer)==null?void 0:y.items;if(a=(g=_&&m(_))!=null?g:!1,c&&p.preventDefault(),!v()&&!a){p.dataTransfer&&(p.dataTransfer.dropEffect="none");return}p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="copy");const V=d(p);switch(w){case"enter":s+=1,r.value=!0,(O=u.onEnter)==null||O.call(u,null,p);break;case"over":(T=u.onOver)==null||T.call(u,null,p);break;case"leave":s-=1,s===0&&(r.value=!1),(F=u.onLeave)==null||F.call(u,null,p);break;case"drop":s=0,r.value=!1,a&&(i.value=V,(E=u.onDrop)==null||E.call(u,V,p));break}};k(e,"dragenter",p=>S(p,"enter")),k(e,"dragover",p=>S(p,"over")),k(e,"dragleave",p=>S(p,"leave")),k(e,"drop",p=>S(p,"drop"))}return{files:i,isOverDropZone:r}}function le(e,t,o={}){const{window:l=L,...r}=o;let i;const s=H(()=>l&&"ResizeObserver"in l),a=()=>{i&&(i.disconnect(),i=void 0)},u=n.computed(()=>{const d=n.toValue(e);return Array.isArray(d)?d.map(h=>W(h)):[W(d)]}),f=n.watch(u,d=>{if(a(),s.value&&l){i=new ResizeObserver(t);for(const h of d)h&&i.observe(h,r)}},{immediate:!0,flush:"post"}),c=()=>{a(),f()};return b.tryOnScopeDispose(c),{isSupported:s,stop:c}}function Ln(e,t={}){const{reset:o=!0,windowResize:l=!0,windowScroll:r=!0,immediate:i=!0,updateTiming:s="sync"}=t,a=n.shallowRef(0),u=n.shallowRef(0),f=n.shallowRef(0),c=n.shallowRef(0),d=n.shallowRef(0),h=n.shallowRef(0),m=n.shallowRef(0),v=n.shallowRef(0);function S(){const w=W(e);if(!w){o&&(a.value=0,u.value=0,f.value=0,c.value=0,d.value=0,h.value=0,m.value=0,v.value=0);return}const y=w.getBoundingClientRect();a.value=y.height,u.value=y.bottom,f.value=y.left,c.value=y.right,d.value=y.top,h.value=y.width,m.value=y.x,v.value=y.y}function p(){s==="sync"?S():s==="next-frame"&&requestAnimationFrame(()=>S())}return le(e,p),n.watch(()=>W(e),w=>!w&&p()),X(e,p,{attributeFilter:["style","class"]}),r&&k("scroll",p,{capture:!0,passive:!0}),l&&k("resize",p,{passive:!0}),b.tryOnMounted(()=>{i&&p()}),{height:a,bottom:u,left:f,right:c,top:d,width:h,x:m,y:v,update:p}}function Nn(e){const{x:t,y:o,document:l=q,multiple:r,interval:i="requestAnimationFrame",immediate:s=!0}=e,a=H(()=>n.toValue(r)?l&&"elementsFromPoint"in l:l&&"elementFromPoint"in l),u=n.shallowRef(null),f=()=>{var d,h;u.value=n.toValue(r)?(d=l?.elementsFromPoint(n.toValue(t),n.toValue(o)))!=null?d:[]:(h=l?.elementFromPoint(n.toValue(t),n.toValue(o)))!=null?h:null},c=i==="requestAnimationFrame"?K(f,{immediate:s}):b.useIntervalFn(f,i,{immediate:s});return{isSupported:a,element:u,...c}}function xn(e,t={}){const{delayEnter:o=0,delayLeave:l=0,triggerOnRemoval:r=!1,window:i=L}=t,s=n.shallowRef(!1);let a;const u=f=>{const c=f?o:l;a&&(clearTimeout(a),a=void 0),c?a=setTimeout(()=>s.value=f,c):s.value=f};return i&&(k(e,"mouseenter",()=>u(!0),{passive:!0}),k(e,"mouseleave",()=>u(!1),{passive:!0}),r&&we(n.computed(()=>W(e)),()=>u(!1))),s}function Xe(e,t={width:0,height:0},o={}){const{window:l=L,box:r="content-box"}=o,i=n.computed(()=>{var d,h;return(h=(d=W(e))==null?void 0:d.namespaceURI)==null?void 0:h.includes("svg")}),s=n.shallowRef(t.width),a=n.shallowRef(t.height),{stop:u}=le(e,([d])=>{const h=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(l&&i.value){const m=W(e);if(m){const v=m.getBoundingClientRect();s.value=v.width,a.value=v.height}}else if(h){const m=b.toArray(h);s.value=m.reduce((v,{inlineSize:S})=>v+S,0),a.value=m.reduce((v,{blockSize:S})=>v+S,0)}else s.value=d.contentRect.width,a.value=d.contentRect.height},o);b.tryOnMounted(()=>{const d=W(e);d&&(s.value="offsetWidth"in d?d.offsetWidth:t.width,a.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=n.watch(()=>W(e),d=>{s.value=d?t.width:0,a.value=d?t.height:0});function c(){u(),f()}return{width:s,height:a,stop:c}}function Ke(e,t,o={}){const{root:l,rootMargin:r="0px",threshold:i=0,window:s=L,immediate:a=!0}=o,u=H(()=>s&&"IntersectionObserver"in s),f=n.computed(()=>{const v=n.toValue(e);return b.toArray(v).map(W).filter(b.notNullish)});let c=b.noop;const d=n.shallowRef(a),h=u.value?n.watch(()=>[f.value,W(l),d.value],([v,S])=>{if(c(),!d.value||!v.length)return;const p=new IntersectionObserver(t,{root:W(S),rootMargin:r,threshold:i});v.forEach(w=>w&&p.observe(w)),c=()=>{p.disconnect(),c=b.noop}},{immediate:a,flush:"post"}):b.noop,m=()=>{c(),h(),d.value=!1};return b.tryOnScopeDispose(m),{isSupported:u,isActive:d,pause(){c(),d.value=!1},resume(){d.value=!0},stop:m}}function Je(e,t={}){const{window:o=L,scrollTarget:l,threshold:r=0,rootMargin:i,once:s=!1}=t,a=n.shallowRef(!1),{stop:u}=Ke(e,f=>{let c=a.value,d=0;for(const h of f)h.time>=d&&(d=h.time,c=h.isIntersecting);a.value=c,s&&b.watchOnce(a,()=>{u()})},{root:l,window:o,threshold:r,rootMargin:n.toValue(i)});return a}const ae=new Map;function Wn(e){const t=n.getCurrentScope();function o(a){var u;const f=ae.get(e)||new Set;f.add(a),ae.set(e,f);const c=()=>r(a);return(u=t?.cleanups)==null||u.push(c),c}function l(a){function u(...f){r(u),a(...f)}return o(u)}function r(a){const u=ae.get(e);u&&(u.delete(a),u.size||i())}function i(){ae.delete(e)}function s(a,u){var f;(f=ae.get(e))==null||f.forEach(c=>c(a,u))}return{on:o,once:l,off:r,emit:s,reset:i}}function Hn(e){return e===!0?{}:e}function Un(e,t=[],o={}){const l=n.shallowRef(null),r=n.shallowRef(null),i=n.shallowRef("CONNECTING"),s=n.ref(null),a=n.shallowRef(null),u=b.toRef(e),f=n.shallowRef(null);let c=!1,d=0;const{withCredentials:h=!1,immediate:m=!0,autoConnect:v=!0,autoReconnect:S,serializer:p={read:O=>O}}=o,w=()=>{b.isClient&&s.value&&(s.value.close(),s.value=null,i.value="CLOSED",c=!0)},y=()=>{if(c||typeof u.value>"u")return;const O=new EventSource(u.value,{withCredentials:h});i.value="CONNECTING",s.value=O,O.onopen=()=>{i.value="OPEN",a.value=null},O.onerror=T=>{if(i.value="CLOSED",a.value=T,O.readyState===2&&!c&&S){O.close();const{retries:F=-1,delay:E=1e3,onFailed:_}=Hn(S);d+=1,typeof F=="number"&&(F<0||d<F)||typeof F=="function"&&F()?setTimeout(y,E):_?.()}},O.onmessage=T=>{var F;l.value=null,r.value=(F=p.read(T.data))!=null?F:null,f.value=T.lastEventId};for(const T of t)k(O,T,F=>{var E,_;l.value=T,r.value=(E=p.read(F.data))!=null?E:null,f.value=(_=F.lastEventId)!=null?_:null},{passive:!0})},g=()=>{b.isClient&&(w(),c=!1,d=0,y())};return m&&g(),v&&n.watch(u,g),b.tryOnScopeDispose(w),{eventSource:s,event:l,data:r,status:i,error:a,open:g,close:w,lastEventId:f}}function $n(e={}){const{initialValue:t=""}=e,o=H(()=>typeof window<"u"&&"EyeDropper"in window),l=n.shallowRef(t);async function r(i){if(!o.value)return;const a=await new window.EyeDropper().open(i);return l.value=a.sRGBHex,a}return{isSupported:o,sRGBHex:l,open:r}}function Bn(e=null,t={}){const{baseUrl:o="",rel:l="icon",document:r=q}=t,i=b.toRef(e),s=a=>{const u=r?.head.querySelectorAll(`link[rel*="${l}"]`);if(!u||u.length===0){const f=r?.createElement("link");f&&(f.rel=l,f.href=`${o}${a}`,f.type=`image/${a.split(".").pop()}`,r?.head.append(f));return}u?.forEach(f=>f.href=`${o}${a}`)};return n.watch(i,(a,u)=>{typeof a=="string"&&a!==u&&s(a)},{immediate:!0}),i}const jn={json:"application/json",text:"text/plain"};function ve(e){return e&&b.containsProp(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const zn=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function qn(e){return zn.test(e)}function re(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries(e.entries()):e}function Z(e,...t){return e==="overwrite"?async o=>{let l;for(let r=t.length-1;r>=0;r--)if(t[r]!=null){l=t[r];break}return l?{...o,...await l(o)}:o}:async o=>{for(const l of t)l&&(o={...o,...await l(o)});return o}}function Gn(e={}){const t=e.combination||"chain",o=e.options||{},l=e.fetchOptions||{};function r(i,...s){const a=n.computed(()=>{const c=n.toValue(e.baseUrl),d=n.toValue(i);return c&&!qn(d)?Yn(c,d):d});let u=o,f=l;return s.length>0&&(ve(s[0])?u={...u,...s[0],beforeFetch:Z(t,o.beforeFetch,s[0].beforeFetch),afterFetch:Z(t,o.afterFetch,s[0].afterFetch),onFetchError:Z(t,o.onFetchError,s[0].onFetchError)}:f={...f,...s[0],headers:{...re(f.headers)||{},...re(s[0].headers)||{}}}),s.length>1&&ve(s[1])&&(u={...u,...s[1],beforeFetch:Z(t,o.beforeFetch,s[1].beforeFetch),afterFetch:Z(t,o.afterFetch,s[1].afterFetch),onFetchError:Z(t,o.onFetchError,s[1].onFetchError)}),Qe(a,f,u)}return r}function Qe(e,...t){var o,l;const r=typeof AbortController=="function";let i={},s={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const a={method:"GET",type:"text",payload:void 0};t.length>0&&(ve(t[0])?s={...s,...t[0]}:i=t[0]),t.length>1&&ve(t[1])&&(s={...s,...t[1]});const{fetch:u=(l=(o=L)==null?void 0:o.fetch)!=null?l:globalThis?.fetch,initialData:f,timeout:c}=s,d=b.createEventHook(),h=b.createEventHook(),m=b.createEventHook(),v=n.shallowRef(!1),S=n.shallowRef(!1),p=n.shallowRef(!1),w=n.shallowRef(null),y=n.shallowRef(null),g=n.shallowRef(null),O=n.shallowRef(f||null),T=n.computed(()=>r&&S.value);let F,E;const _=I=>{r&&(F?.abort(I),F=new AbortController,F.signal.onabort=()=>p.value=!0,i={...i,signal:F.signal})},V=I=>{S.value=I,v.value=!I};c&&(E=b.useTimeoutFn(_,c,{immediate:!1}));let C=0;const M=async(I=!1)=>{var U,B;_(),V(!0),g.value=null,w.value=null,p.value=!1,C+=1;const j=C,Y={method:a.method,headers:{}},ee=n.toValue(a.payload);if(ee){const z=re(Y.headers),ie=Object.getPrototypeOf(ee);!a.payloadType&&ee&&(ie===Object.prototype||Array.isArray(ie))&&!(ee instanceof FormData)&&(a.payloadType="json"),a.payloadType&&(z["Content-Type"]=(U=jn[a.payloadType])!=null?U:a.payloadType),Y.body=a.payloadType==="json"?JSON.stringify(ee):ee}let _t=!1;const J={url:n.toValue(e),options:{...Y,...i},cancel:()=>{_t=!0}};if(s.beforeFetch&&Object.assign(J,await s.beforeFetch(J)),_t||!u)return V(!1),Promise.resolve(null);let Q=null;return E&&E.start(),u(J.url,{...Y,...J.options,headers:{...re(Y.headers),...re((B=J.options)==null?void 0:B.headers)}}).then(async z=>{if(y.value=z,w.value=z.status,Q=await z.clone()[a.type](),!z.ok)throw O.value=f||null,new Error(z.statusText);return s.afterFetch&&({data:Q}=await s.afterFetch({data:Q,response:z,context:J,execute:M})),O.value=Q,d.trigger(z),z}).catch(async z=>{let ie=z.message||z.name;if(s.onFetchError&&({error:ie,data:Q}=await s.onFetchError({data:Q,error:z,response:y.value,context:J,execute:M})),g.value=ie,s.updateDataOnError&&(O.value=Q),h.trigger(z),I)throw z;return null}).finally(()=>{j===C&&V(!1),E&&E.stop(),m.trigger(null)})},P=b.toRef(s.refetch);n.watch([P,b.toRef(e)],([I])=>I&&M(),{deep:!0});const A={isFinished:n.readonly(v),isFetching:n.readonly(S),statusCode:w,response:y,error:g,data:O,canAbort:T,aborted:p,abort:_,execute:M,onFetchResponse:d.on,onFetchError:h.on,onFetchFinally:m.on,get:D("GET"),put:D("PUT"),post:D("POST"),delete:D("DELETE"),patch:D("PATCH"),head:D("HEAD"),options:D("OPTIONS"),json:x("json"),text:x("text"),blob:x("blob"),arrayBuffer:x("arrayBuffer"),formData:x("formData")};function D(I){return(U,B)=>{if(!S.value)return a.method=I,a.payload=U,a.payloadType=B,n.isRef(a.payload)&&n.watch([P,b.toRef(a.payload)],([j])=>j&&M(),{deep:!0}),{...A,then(j,Y){return N().then(j,Y)}}}}function N(){return new Promise((I,U)=>{b.until(v).toBe(!0).then(()=>I(A)).catch(U)})}function x(I){return()=>{if(!S.value)return a.type=I,{...A,then(U,B){return N().then(U,B)}}}}return s.immediate&&Promise.resolve().then(()=>M()),{...A,then(I,U){return N().then(I,U)}}}function Yn(e,t){return!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:e.endsWith("/")&&t.startsWith("/")?`${e.slice(0,-1)}${t}`:`${e}${t}`}const Xn={multiple:!0,accept:"*",reset:!1,directory:!1};function Kn(e){if(!e)return null;if(e instanceof FileList)return e;const t=new DataTransfer;for(const o of e)t.items.add(o);return t.files}function Jn(e={}){const{document:t=q}=e,o=n.ref(Kn(e.initialFiles)),{on:l,trigger:r}=b.createEventHook(),{on:i,trigger:s}=b.createEventHook(),a=n.computed(()=>{var d;const h=(d=W(e.input))!=null?d:t?t.createElement("input"):void 0;return h&&(h.type="file",h.onchange=m=>{const v=m.target;o.value=v.files,r(o.value)},h.oncancel=()=>{s()}),h}),u=()=>{o.value=null,a.value&&a.value.value&&(a.value.value="",r(null))},f=d=>{const h=a.value;h&&(h.multiple=n.toValue(d.multiple),h.accept=n.toValue(d.accept),h.webkitdirectory=n.toValue(d.directory),b.hasOwn(d,"capture")&&(h.capture=n.toValue(d.capture)))},c=d=>{const h=a.value;if(!h)return;const m={...Xn,...e,...d};f(m),n.toValue(m.reset)&&u(),h.click()};return n.watchEffect(()