1 |
- import{O as H,Q as m,U as u,V as K,W as N,X as R}from"./vendor.372dc65e.js";function W(e){return H()?(K(e),!0):!1}const h=typeof window!="undefined",Q=e=>typeof e=="string",b=()=>{};function U(e,t){function r(...n){e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})}return r}const x=e=>e();function q(e=x){const t=u(!0);function r(){t.value=!1}function n(){t.value=!0}return{isActive:t,pause:r,resume:n,eventFilter:(...a)=>{t.value&&e(...a)}}}function B(e,t=!1,r="Timeout"){return new Promise((n,o)=>{setTimeout(t?()=>o(r):n,e)})}var A=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,k=(e,t)=>{var r={};for(var n in e)G.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&A)for(var n of A(e))t.indexOf(n)<0&&Z.call(e,n)&&(r[n]=e[n]);return r};function ee(e,t,r={}){const n=r,{eventFilter:o=x}=n,a=k(n,["eventFilter"]);return m(e,U(o,t),a)}var te=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,J=(e,t,r)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oe=(e,t)=>{for(var r in t||(t={}))D.call(t,r)&&J(e,r,t[r]);if(S)for(var r of S(t))T.call(t,r)&&J(e,r,t[r]);return e},ae=(e,t)=>re(e,ne(t)),ie=(e,t)=>{var r={};for(var n in e)D.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&S)for(var n of S(e))t.indexOf(n)<0&&T.call(e,n)&&(r[n]=e[n]);return r};function se(e,t,r={}){const n=r,{eventFilter:o}=n,a=ie(n,["eventFilter"]),{eventFilter:l,pause:f,resume:s,isActive:p}=q(o);return{stop:ee(e,t,ae(oe({},a),{eventFilter:l})),pause:f,resume:s,isActive:p}}function $(e){var t;const r=R(e);return(t=r==null?void 0:r.$el)!=null?t:r}const _=h?window:void 0;h&&window.document;h&&window.navigator;h&&window.location;function z(...e){let t,r,n,o;if(Q(e[0])?([r,n,o]=e,t=_):[t,r,n,o]=e,!t)return b;let a=b;const l=m(()=>$(t),s=>{a(),!!s&&(s.addEventListener(r,n,o),a=()=>{s.removeEventListener(r,n,o),a=b})},{immediate:!0,flush:"post"}),f=()=>{l(),a()};return W(f),f}function Oe(e,t,r){const{immediate:n=!0,delay:o=0,onError:a=b,resetOnExecute:l=!0,shallow:f=!0}=r!=null?r:{},s=f?N(t):u(t),p=u(!1),c=u(!1),d=u(void 0);async function g(v=0,...O){l&&(s.value=t),d.value=void 0,p.value=!1,c.value=!0,v>0&&await B(v);const P=typeof e=="function"?e(...O):e;try{const w=await P;s.value=w,p.value=!0}catch(w){d.value=w,a(w)}finally{c.value=!1}return s.value}return n&&g(o),{state:s,isReady:p,isLoading:c,error:d,execute:g}}const j=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},E="__vueuse_ssr_handlers__";j[E]=j[E]||{};const le=j[E];function ue(e,t){return le[e]||t}function fe(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"||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}const ce={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()}};function pe(e,t,r,n={}){var o;const{flush:a="pre",deep:l=!0,listenToStorageChanges:f=!0,writeDefaults:s=!0,shallow:p,window:c=_,eventFilter:d,onError:g=i=>{console.error(i)}}=n,v=(p?N:u)(t);if(!r)try{r=ue("getDefaultStorage",()=>{var i;return(i=_)==null?void 0:i.localStorage})()}catch(i){g(i)}if(!r)return v;const O=R(t),P=fe(O),w=(o=n.serializer)!=null?o:ce[P],{pause:V,resume:X}=se(v,()=>M(v.value),{flush:a,deep:l,eventFilter:d});return c&&f&&z(c,"storage",F),F(),v;function M(i){try{i==null?r.removeItem(e):r.setItem(e,w.write(i))}catch(y){g(y)}}function Y(i){if(!(i&&i.key!==e)){V();try{const y=i?i.newValue:r.getItem(e);return y==null?(s&&O!==null&&r.setItem(e,w.write(O)),O):typeof y!="string"?y:w.read(y)}catch(y){g(y)}finally{X()}}}function F(i){i&&i.key!==e||(v.value=Y(i))}}var L=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,we=(e,t)=>{var r={};for(var n in e)de.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&L)for(var n of L(e))t.indexOf(n)<0&&ve.call(e,n)&&(r[n]=e[n]);return r};function ye(e,t,r={}){const n=r,{window:o=_}=n,a=we(n,["window"]);let l;const f=o&&"ResizeObserver"in o,s=()=>{l&&(l.disconnect(),l=void 0)},p=m(()=>$(e),d=>{s(),f&&o&&d&&(l=new ResizeObserver(t),l.observe(d,a))},{immediate:!0,flush:"post"}),c=()=>{s(),p()};return W(c),{isSupported:f,stop:c}}function _e(e,t={width:0,height:0},r={}){const n=u(t.width),o=u(t.height);return ye(e,([a])=>{n.value=a.contentRect.width,o.value=a.contentRect.height},r),m(()=>$(e),a=>{n.value=a?t.width:0,o.value=a?t.height:0}),{width:n,height:o}}function he(e,t,r={}){const{window:n=_}=r;return pe(e,t,n==null?void 0:n.localStorage,r)}var I,C;h&&(window==null?void 0:window.navigator)&&((I=window==null?void 0:window.navigator)==null?void 0:I.platform)&&/iP(ad|hone|od)/.test((C=window==null?void 0:window.navigator)==null?void 0:C.platform);function me({window:e=_}={}){if(!e)return{x:u(0),y:u(0)};const t=u(e.pageXOffset),r=u(e.pageYOffset);return z("scroll",()=>{t.value=e.pageXOffset,r.value=e.pageYOffset},{capture:!1,passive:!0}),{x:t,y:r}}export{z as a,me as b,Oe as c,he as d,_e as u};
|