UNPKG

@vueuse/core

Version:

Collection of essential Vue Composition Utilities

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