vue-composable
Advanced tools
Comparing version 1.0.0-dev.36 to 1.0.0-dev.37
@@ -118,2 +118,12 @@ import { ComputedRef } from '@vue/composition-api'; | ||
export declare type DateTimeFormatLocales = RefTyped<string> | RefTyped<string[]> | undefined; | ||
export declare interface DateTimeFormatReturn { | ||
formatter: Ref<Readonly<Intl.DateTimeFormat>>; | ||
format: DateTimeFormatterFormat<Ref<Readonly<string>>>; | ||
formatString: DateTimeFormatterFormat<string>; | ||
} | ||
export declare type DateTimeFormatterFormat<T> = (value: Readonly<RefTyped<Readonly<number | Date | string>>>, overrideOpts?: RefTyped<Intl.DateTimeFormatOptions | IntlDateTimeFormatOptions>, overrideLocale?: RefTyped<DateTimeFormatLocales>) => T; | ||
export declare function debounce<F extends Procedure>(func: F, waitMilliseconds?: number, options?: Options): F; | ||
@@ -313,2 +323,26 @@ | ||
export declare type IntlDateTimeCalendarType = "buddhist" | "chinese" | "coptic" | "ethiopia" | "ethiopic" | "gregory" | "hebrew" | "indian" | "islamic" | "iso8601" | "japanese" | "persian" | "roc"; | ||
export declare type IntlDateTimeFormatOptions = Intl.DateTimeFormatOptions & { | ||
dateStyle: "full" | "long" | "medium" | "short"; | ||
timeStyle: "full" | "long" | "medium" | "short"; | ||
calendar: IntlDateTimeCalendarType; | ||
dayPeriod: "narrow" | "short" | "long"; | ||
numberingSystem: IntlDateTimeNumberingSystem; | ||
weekday: "narrow" | "short" | "long"; | ||
era: "narrow" | "short" | "long"; | ||
year: "numeric" | "2-digit"; | ||
month: "numeric" | "2-digit" | "narrow" | "short" | "long"; | ||
day: "numeric" | "2-digit"; | ||
hour: "numeric" | "2-digit"; | ||
minute: "numeric" | "2-digit"; | ||
second: "numeric" | "2-digit"; | ||
timeZoneName: "short" | "long"; | ||
hour12: true | false; | ||
hourCycle: "h11" | "h12" | "h23" | "h24"; | ||
formatMatcher: "basic" | "best fit"; | ||
}; | ||
export declare type IntlDateTimeNumberingSystem = "arab" | "arabext" | "bali" | "beng" | "deva" | "fullwide" | "gujr" | "guru" | "hanidec" | "khmr" | "knda" | "laoo" | "latn" | "limb" | "mlym" | "mong" | "mymr" | "orya" | "tamldec" | "telu" | "thai" | "tibt"; | ||
export declare type IntlNumberFormatLocales = RefTyped<string> | RefTyped<string[]> | undefined; | ||
@@ -912,3 +946,3 @@ | ||
export declare function useBreakpoint<T extends BreakpointObject>(breakpoints: Record<keyof T, number | string>): BreakpointReturn<T>; | ||
export declare function useBreakpoint<T extends BreakpointObject>(breakpoints: T): BreakpointReturn<T>; | ||
@@ -1099,2 +1133,14 @@ export declare function useBreakpointChrome(): BreakpointReturn<ChromeBreakpoint>; | ||
export declare function useIntlDateTimeFormat(): DateTimeFormatReturn; | ||
export declare function useIntlDateTimeFormat(locales: DateTimeFormatLocales): DateTimeFormatReturn; | ||
export declare function useIntlDateTimeFormat(options: RefTyped<IntlDateTimeFormatOptions>): DateTimeFormatReturn; | ||
export declare function useIntlDateTimeFormat(options: RefTyped<Intl.DateTimeFormatOptions>): DateTimeFormatReturn; | ||
export declare function useIntlDateTimeFormat(locales: DateTimeFormatLocales, options?: RefTyped<IntlDateTimeFormatOptions | undefined>): DateTimeFormatReturn; | ||
export declare function useIntlDateTimeFormat(locales: DateTimeFormatLocales, options: RefTyped<Intl.DateTimeFormatOptions | undefined>): DateTimeFormatReturn; | ||
export declare function useIntlNumberFormat(): NumberFormatReturn; | ||
@@ -1101,0 +1147,0 @@ |
@@ -1,1 +0,1 @@ | ||
var vueComposable=function(e,t,n){"use strict";n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;const r=t.set;function o(e){return t.isRef(e)?e.value:e}function a(e){return t.isRef(e)?e:t.ref(e)}const u=Array.isArray,l=e=>"function"==typeof e,s=e=>"string"==typeof e,i=e=>"boolean"==typeof e,c=e=>d(e)&&l(e.getTime),v=e=>"number"==typeof e,d=e=>null!==e&&"object"==typeof e,f=e=>d(e)&&!!e.tagName;function m(e){return d(e)&&l(e.then)&&l(e.catch)}const p=()=>{},h=()=>!1,g={passive:!0};function y(e){return new Promise(t=>{setTimeout(t,e)})}function w(e,t,n){return e<t?t:e>n?n:e}const b="undefined"!=typeof window;function E(e,...t){for(let n=0;n<t.length;n++){const r=t[n];if(void 0===r||!d(r))continue;const a=Object.keys(r);for(let t=0;t<a.length;t++){const n=a[t],u=o(r[n]),l=typeof u,s=typeof e[n];void 0!==e[n]&&l!==s||(e[n]=d(u)?E(e[n]||{},u):r[n])}}return e}function S(e,n,r,o){let u=p;if(e){const l=a(e),s=e=>e.removeEventListener(n,r),i=e=>e.addEventListener(n,r,o),c=t.watch(l,(e,t,n)=>{e&&(i(e),n(()=>s(e)))},{immediate:!0});u=()=>{s(l.value),c()}}return u}function M(e,t,n){return $(e,t,n)}function $(e,t=50,n={isImmediate:!1}){let r;return function(...o){const a=this,u=n.isImmediate&&void 0===r;void 0!==r&&clearTimeout(r),r=setTimeout((function(){r=void 0,n.isImmediate||e.apply(a,o)}),t),u&&e.apply(a,o)}}function k(e,n){if(!e)throw new Error(`[usePromise] argument can't be '${e}'`);if("function"!=typeof e)throw new Error("[usePromise] expects function, but received "+typeof e);const[r,o]=i(n)?[n,!1]:d(n)?[n.lazy,n.throwException]:[!1,!1],a=t.ref(!1),u=t.ref(null),l=t.ref(null),s=t.ref(),c=async(...t)=>{a.value=!0,u.value=null;const n=t&&e.length!==t.length&&t.length>0&&i(t[t.length-1])?t[t.length-1]:o,r=s.value=e(...t);try{const e=await r;return s.value===r&&(l.value=e),e}catch(e){return s.value===r&&(u.value=e,l.value=null),n?r:void 0}finally{s.value===r&&(a.value=!1)}};return r||c(),{exec:c,result:l,promise:s,loading:a,error:u}}function x(e,n){const r=t.ref(!1);let o=void 0;return{...k((...t)=>{return n=e(...t),new Promise((e,t)=>{o=e=>{r.value=!0,t(e)},n.then(e).catch(t)});var n},n),cancel:e=>{o&&o(e)},cancelled:r}}const I=Symbol(""),L=Symbol(""),R=async(e,t,n,r)=>{const o=t[I].value;let a=-1;const u=e.maxRetries||9001,l=e.retryDelay||O;t.retryErrors.value=[],t.isRetrying.value=!1,t.nextRetry.value=void 0;let s=void 0;do{let e=!1,i=null;try{if(++a,i=r?n(...r):n(),m(i)&&(i=await i),t[L].value)return null;e=!0}catch(e){i=null,t.retryErrors.value.push(e)}if(o!==t[I].value)return i;if(e)return t.isRetrying.value=!1,t.nextRetry.value=void 0,i;if(a>=u)return t.isRetrying.value=!1,t.nextRetry.value=void 0,Promise.reject(new Error("[useRetry] max retries reached "+u));t.isRetrying.value=!0;const d=Date.now(),f=l(a),p=m(f)?await f:f;if(!m(f)||p){if(v(p))s=p;else{if(!c(p))throw new Error(`[useRetry] invalid value received from options.retryDelay '${typeof p}'`);s=p.getTime()}s<d?t.nextRetry.value=d+s:(t.nextRetry.value=s,s-=d),s>0&&await y(s)}if(t[L].value)return null;if(o!==t[I].value)return i}while(a<9e3);return null};const O=()=>0;function P(e){return e&&(i(e.isJson)||i(e.parseImmediate))}let j=void 0;let T=void 0,C=void 0;let A=void 0,D=void 0;function F(e,n){const r=b&&"BroadcastChannel"in self,o=t.ref(null),a=t.ref(null),u=t.ref(null),l=t.ref(!1),s=t.ref(!1);let i=p,c=p,v=p;if(r){const r=new BroadcastChannel(e);r.addEventListener("messageerror",e=>{u.value=e,l.value=!0},g),r.addEventListener("message",e=>{a.value=e,o.value=e.data},g),i=e=>r.postMessage(e),c=()=>{r.close(),s.value=!0},v=(e,n)=>{r.addEventListener("message",e,n),t.onUnmounted(()=>r.removeEventListener("message",e))},t.onUnmounted(()=>{n&&n(),c()})}return{supported:r,data:o,messageEvent:a,errorEvent:u,errored:l,isClosed:s,send:i,close:c,addListener:v}}function V(e,t){const n=getComputedStyle(e).getPropertyValue(t);return n?n.trim():null}function U(e,t,n){e.style.setProperty(t,n)}const W={attributes:!0,childList:!0,subtree:!0},z=e=>e.length<=2||"-"!==e[0]||"-"!==e[1]?"--"+e:e;const N=e=>function(t){const n=t.data||[];return new Promise(t=>{try{Promise.resolve(e.apply(e,n)).then(e=>t(postMessage([!0,e]))).catch(e=>t(postMessage([!1,e])))}catch(e){t(postMessage([!1,e]))}})};function B(e){const n=!!b&&"matchMedia"in window;let r=void 0,o=void 0,a=p;if(n){r=t.ref(matchMedia(e)),o=t.ref(r.value.matches);const n=e=>{o.value=e.matches};r.value.addEventListener("change",n,g);const a=()=>r.value.removeEventListener("change",n);t.onUnmounted(a)}else r=t.ref({}),o=t.ref(!1);return{supported:n,mediaQueryList:r,matches:o,remove:a}}function H(e,n){const{addListener:r,send:o,close:a,supported:u}=F(e,()=>y()),l=Date.now(),s=t.ref(!1),i=t.ref(0),c=t.computed(()=>1!==i.value||s.value),v=t.ref([]),f=t.ref(n);let m=!1,p=void 0;o({type:0});const h=()=>o({type:5,id:l}),y=()=>{0!==v.value.length&&(s.value&&o({type:3,mind:1,id:Math.min(...v.value)}),o({type:4,id:l}))};return r(e=>{switch(e.data.type){case 0:o({type:2,value:f.value,mind:i.value});break;case 4:{const t=v.value.indexOf(e.data.id);t>=0&&v.value.splice(t,1),p===e.data.id&&v.value.length>0&&o({type:3,mind:1,id:Math.min(l,...v.value)});break}case 2:m=!0,f.value=e.data.value,i.value=e.data.mind;break;case 3:i.value=e.data.mind,p=1===e.data.mind&&e.data.id||void 0,s.value=p===l,s.value&&(v.value=[],h());break;case 5:v.value=[e.data.id],o({type:6,id:l});break;case 6:v.value.push(e.data.id)}},g),h(),t.watch(f,(e,t)=>{if(m)m=!1;else{if(1===i.value&&!1===s.value)return m=!0,void(f.value=t);o({type:2,mind:i.value,value:d(e)?{...e}:e}),m=!1}},{deep:!0,immediate:!1}),b&&window.addEventListener("unload",y,g),t.onUnmounted(()=>{y(),a()}),{supported:u,id:l,data:f,master:s,mind:i,editable:c,targets:v,ping:h,setMind:e=>{switch(e){case 1:s.value=!0;break;case 0:s.value=!1}i.value=e,o({type:3,id:l,mind:i.value})},addListener:r}}function _(e,n){const r=Symbol(),o=t.inject(e,r);return o===r?n():o}function K(e,n){const r=a(n),o=a(e);return d(r.value)||t.isRef(n)?[void 0!==o.value?o:void 0,r]:!d(o.value)||u(o.value)||s(o.value)?[o.value?o:void 0,void 0]:[void 0,o]}function q(e,n){const[r,a]=K(e,n),u=t.computed(()=>new Intl.NumberFormat(o(r),o(a))),l=(e,t,n)=>(t||n?new Intl.NumberFormat(o(n)||o(r),{...o(a),...o(t)}):u.value).format(o(e));return{format:(e,n,r)=>t.computed(()=>l(e,n,r)),formatString:l,formatter:u}}function J(e){if(e)return v(e)?e:Q(e)}const Q=e=>{const t=e.match(/^(\d+)px$/);if(t)return+t[1]};function X(e){const n={},r=new Map,o=t.ref();let a=[];const u=[];for(const o in e){const l=e[o],s=J(l);if(void 0!==s){const e=t.ref(!1);n[o]=e,r.set(s,{name:o,valid:e}),a.push(s)}else{const{matches:e,remove:t}=B(l);n[o]=e,u.push(t)}}a=a.sort((e,t)=>t-e);const l=b?()=>{const e=window.innerWidth;let t=void 0;for(let n=0;n<a.length;n++){const o=a[n],u=r.get(o);u.valid.value=e>=o,e>=o&&void 0===t&&(t=u.name)}o.value=t}:p,s=M(l,10),i=b?()=>window.removeEventListener("resize",s):p;return b&&(t.onMounted(()=>{l(),window.addEventListener("resize",s,g)}),t.onUnmounted(()=>{i(),u.forEach(e=>e())})),{...n,remove:i,current:o}}const Y=Symbol(""),G={sm:640,md:768,lg:1024,xl:1280};function Z(e){return d(e)&&d(e.theme)&&d(e.theme.screens)}function ee(e){return!!d(e)&&(s(e.min)||s(e.max)||v(e.min)||v(e.max))}function te(e){const t=[];if(u(e)){const n=e.map(te);for(let e=0;e<n.length;e++){const r=n[e];t.push(...r)}}else d(n=e)&&s(n.raw)?t.push(e.raw):ee(e)?t.push(function(e){return ee(e)?`(${[e.max&&"max-width: "+e.max,e.min&&"min-width: "+e.min].filter(Boolean).join(" and ")})`:""}(e)):(s(e)||v(e))&&t.push("min-width: "+e);var n;return t}function ne(e){const n=Z(e)?e.theme.screens:e;if(Z(e))for(const e in n)n.hasOwnProperty(e)&&(n[e]=te(n[e]).join(" or "));const r=X(n);return t.provide(Y,r),r}function re(e,t){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&(t&&0!==t.length||!1)}function oe(e){try{if(!e)return!1;const t=":$";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return re(t,e)}}function ae(e,t){try{return e.parse(t)}catch{return t}}let ue=void 0;function le(e,n=JSON,r=10){const o=b?window[e]:void 0,u=oe(o);ue||(ue=new Map,b&&window.addEventListener("storage",e=>{if(e.newValue===e.oldValue)return;let t=ue.get("localStorage");t=e.storageArea===window.localStorage?ue.get("localStorage"):ue.get("sessionStorage"),t&&Object.keys(t.$syncKeys).length>0&&(null===e.key?t.clear():t.$syncKeys[e.key]&&(null===e.newValue?t.removeItem(e.key):t.updateItem(e.key,e.newValue)))}));let l,i=ue.get(e);return u&&o?i?l=i.$quotaError:(l=t.ref(!1),i={$refMap:new Map,$watchHandlers:new Map,$syncKeys:{},$quotaError:l,key:o.key,length:o.length,setSync(e,t){t?this.$syncKeys[e]=!0:delete this.$syncKeys[e]},clear(){this.$refMap.forEach((e,t)=>this.removeItem(t))},removeItem(e){const t=this.$refMap.get(e);t&&(t.value=void 0);const n=this.$watchHandlers.get(e);n&&n(),delete this.$syncKeys[e],this.$refMap.delete(e),o.removeItem(e)},getItem(e){const t=o.getItem(e);return t?this.setItem(e,ae(n,t)):null},setItem(e,u){const i=a(u);this.$refMap.set(e,i);const c=(e,t)=>{try{const r=o.getItem(e),a=s(t)?t:n.stringify(t);o.setItem(e,a),r!==a&&b&&this.$syncKeys[e]&&window.dispatchEvent(new StorageEvent(e,{newValue:a,oldValue:r,storageArea:o}))}catch(e){l.value=re(e,o)}};c(e,u);const v=t.watch(i,$(t=>{c(e,t)},r),{immediate:!1,deep:!0});return this.$watchHandlers.set(e,v),i},updateItem(e,t){let r=this.$refMap.get(e);r&&(r.value=ae(n,t))}},ue.set(e,i)):(l=t.ref(!1),i={}),{supported:u,quotaError:l,store:i,remove:()=>ue.delete(e)}}function se(e,n,r){const{supported:o,store:a}=le("localStorage");let u=p,l=p,s=p,i=void 0;return o&&a?(s=t=>a.setSync(e,t),u=()=>a.removeItem(e),l=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n)),!1!==r&&s(!0)):i=t.ref(n),{supported:o,storage:i,clear:l,remove:u,setSync:s}}function ie(e,n,r){const{supported:o,store:a}=le("sessionStorage");let u=p,l=p,s=h,i=void 0;return o&&a?(u=()=>a.removeItem(e),l=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n))):i=t.ref(n),{supported:o,storage:i,clear:l,remove:u,setSync:s}}let ce=void 0;function ve(e){const n=a(e.currentPage),r=a(e.pageSize),o=t.ref(0),u=a(e.total),l=t.computed({get:()=>o.value,set(e){v(e)&&(o.value=Math.min(e,u.value))}}),s=t.computed({get:()=>n.value,set(e){v(e)&&(n.value=w(e,1,c.value),l.value=(n.value-1)*i.value)}}),i=t.computed({get:()=>r.value,set(e){v(e)&&(r.value=e)}}),c=t.computed(()=>Math.ceil(u.value/i.value));s.value=n.value;return t.watch([u,i],e=>{s.value>c.value&&(s.value=c.value)},{immediate:!1}),{pageSize:i,total:u,currentPage:s,offset:l,lastPage:c,next:()=>++s.value,prev:()=>--s.value,first:()=>s.value=1,last:()=>s.value=c.value}}function de(e){const n=e&&e.refreshMs||1e3,r=!e||!i(e.sync)||e.sync,o=e&&l(e.timeFn)&&e.timeFn||Date.now;let a=void 0,u=void 0;const s=t.ref(o()),c=()=>{clearInterval(a),clearTimeout(u)},v=b?()=>a=setInterval(()=>s.value=o(),n):p;if(r){const e=1e3-(s.value-1e3*Math.floor(s.value/1e3));u=setTimeout(v,e)}else v();return t.onUnmounted(c),{now:s,remove:c}}function fe(e,n){return t.computed(()=>{const r=o(e);if(!n)return r;const a=t.isRef(n)?t.reactive(n.value):t.reactive(n);return r.replace(/({?{[\w\s]*}?})/g,e=>{const t=e.replace("{","").replace("}","").trim();if(e[0]===e[1]&&"{"===e[0])return""+t;const n=u(a)?a[+t]:a[t];return void 0===n?e:""+o(n)})})}function me(e,n,r=".",a=p){return t.computed(()=>{const t=o(e),u=o(n);if(void 0===t)return a(u,t,u,t);if(!u)return t;const l=u.split(r);let s=t;for(let e=0;e<l.length;e++){let n=l[e];if("]"===n[n.length-1]){const t=/\[[`'"]?([^`'"\]]*)[`'"]?\]/g;let r=n,o=t.exec(r);if(o){let a=o[0].length,u=o.index-a,s=1;do{o.index,u=o.index,a=o[0].length,n=n.slice(0,-o[0].length),l.splice(e+s,0,o[1]),++s}while(o=t.exec(r));if(!n&&"["===r[0]&&r.length>2)continue}else n="",console.warn(`[usePath] invalid path provided "${r}"`)}if(!d(s))return a(l.slice(0,e+1).join(r),s,u,t);if(!n)return a(l.slice(0,e+1).join(r),s,u,t);if(s=s[n],!s)return a(l.slice(0,e+1).join(r),s,u,t)}return s})}function pe(e){return void 0!==e.$value}const he=(e,n,r)=>{const{$message:a,$validator:u,...l}=function(e){return d(e)}(n)?n:{$validator:n,$message:""},{$pending:s,$promise:i,$invalid:c,$error:v}=((e,n,r)=>{const a=t.ref(null),u=t.ref(!1),l=t.ref(),s=t.ref(!1);let i=void 0;const c=e=>{a.value=(async()=>{try{u.value=!0;const t=n(e,i);m(t)?s.value=!await t:s.value=!t}catch(e){throw s.value=!0,e}finally{u.value=!1}})().catch(e=>(l.value=o(e),s.value=!0,e))};return r.push(r=>{i=r,t.watch(()=>{try{n(e.value,i)}catch(e){}return e.value},c,{deep:!0,immediate:!0})}),{$promise:a,$pending:u,$invalid:s,$error:l}})(e,u,r);return{$pending:s,$error:v,$promise:i,$invalid:c,$message:a,...l}},ge=(e,n)=>{const r={},u=pe(e)?a(e.$value):void 0;for(const a of Object.keys(e))if("$"!==a[0])if(u){const t=he(u,e[a],n);r[a]={...t,$value:u}}else{const u=ge(e[a],n);let l,s,c=void 0;if(pe(u)){const e=Object.keys(u).filter(e=>"$"!==e[0]).map(e=>u[e]);l=t.computed(()=>e.map(e=>e.$error).filter(Boolean).map(e=>o(e))),s=t.computed(()=>e.some(e=>!!o(e.$invalid)))}else{const e=Object.keys(u).map(e=>u[e]);l=t.computed(()=>e.map(e=>o(e.$errors)).filter(Boolean).filter(e=>e.some(Boolean))),c=t.computed(()=>e.some(e=>e.$anyDirty||i(o(e.$dirty))&&o(e.$dirty))),s=t.computed(()=>e.some(e=>!!o(e.$anyInvalid)))}r[a]={...u,$errors:l,$anyInvalid:s},c&&(r[a].$anyDirty=c)}else{if("$value"===a){r[a]=u;const e=t.ref(!1),n=t.watch(u,()=>{e.value=!0,n()},{immediate:!1,deep:!0});r.$dirty=e;continue}r[a]=e[a]}return r};const ye=Symbol("");function we(e){const u=t.ref(Object.keys(e.messages)),s=t.ref(e.messages),c=t.ref(e.locale),v=t.ref({});let d=t.ref();const f={},p=(e,n)=>{if(f[e])return f[e];const r=n.value[e];if(!r)return t.ref({});let o=l(r)?r():r;return m(o)?o.then(t=>f[e]=a(t)):l(r)?a(o):f[e]=t.computed(()=>n.value[e])},h=!!e.fallback&&(!i(e.notFoundFallback)||e.notFoundFallback);let g=!1;if(h){const t=p(e.fallback,s);m(t)?(t.then(e=>{d.value=e.value}),g=!0):d.value=t.value}else d.value={};const y=t.ref(0);t.watch(s,()=>y.value++,{deep:!0,immediate:!1}),t.watch([c,d,y],([t,n,r])=>{if(t===e.fallback&&h)v.value=n;else{const e=e=>v.value=E({},n,o(e)),r=p(t,s);m(r)?r.then(e):e(r)}},{immediate:!g});const w=(t,n)=>e.resolve?a(e.resolve(v.value,t,n)):fe(me(v,t,".",(e,t,n,r)=>n),n);return{locale:c,locales:u,i18n:v,$t:w,$ts:(e,t)=>w(e,t).value,addLocale:(e,t)=>{u.value.indexOf(e)>=0||u.value.push(e),delete f[e],r(s.value,e,t)},removeLocale:t=>{const r=u.value.indexOf(t);if(r>=0){const n=[c.value,d.value&&e.fallback,...u.value].find(e=>e&&e!==t);n&&(t===e.fallback&&(d.value=void 0),t===c.value&&(c.value=n)),u.value.splice(r,1)}var o,a;o=s.value,a=t,n.delete(o,a),delete f[t]}}}function be(e){const n=we(e);return t.provide(ye,n),n}const Ee=Symbol("");const Se=Symbol(""),Me={install(e){const n=t.ref(!0);r=n,t.computed(()=>r);var r}};return e.COMMIT="9fbb9d3",e.FALSE_OP=h,e.MAX_ARRAY_SIZE=2**32-2,e.NO_OP=p,e.PASSIVE_EV=g,e.VERSION="1.0.0-dev.36",e.VUE_VERSION="2",e.buildI18n=we,e.debounce=$,e.deepClone=E,e.exponentialDelay=e=>{const t=100*Math.pow(2,e);return t+.2*t*Math.random()},e.exposeWorker=function(e){this.onmessage=async t=>{const n=e(t.data);if(void 0===n)this.postMessage(n);else if(null===n)this.postMessage(n);else if(u(n))this.postMessage(n);else if(n[Symbol.asyncIterator])for await(const e of n)this.postMessage(e);else if(n[Symbol.iterator])for(const e of n)this.postMessage(e);else this.postMessage(await n)}},e.getCssVariableFor=V,e.hydrationPlugin=Me,e.injectFactory=_,e.isArray=u,e.isBoolean=i,e.isClient=b,e.isDate=c,e.isElement=f,e.isFunction=l,e.isNumber=v,e.isObject=d,e.isPromise=m,e.isString=s,e.isSymbol=e=>"symbol"==typeof e,e.minMax=w,e.noDelay=O,e.promisedTimeout=y,e.provideSSRTitle=function(e,t){const n=a(void 0===t?"":t);return e.provide(Ee,n),n},e.refShared=function(e,n){const r=t.getCurrentInstance(),o=n||r.$vnode.tag;if(!o)return t.ref(e);const{data:a,supported:u}=H(o,e);return a},e.setBreakpointTailwindCSS=ne,e.setCssVariableFor=U,e.setI18n=be,e.storageAvailable=oe,e.unwrap=o,e.useArrayPagination=function(e,n){const r=a(e),o=ve({currentPage:1,pageSize:10,...n,total:t.computed(()=>r.value.length)}),u=t.computed(()=>{const e=r.value;return Array.isArray(e)?e.slice(o.offset.value,o.offset.value+o.pageSize.value):[]});return{...o,result:u}},e.useBreakpoint=X,e.useBreakpointChrome=function(){return X({mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560})},e.useBreakpointTailwindCSS=function(e){return _(Y,()=>ne(e||G))},e.useBroadcastChannel=F,e.useCancellablePromise=x,e.useCssVariables=function(e,n,r){const u=b&&"MutationObserver"in self,[l,i]=t.isRef(n)||f(n)?[n,r||W]:[u&&document.documentElement||{},n||W],c=t.ref(!0),v={},d=[],m=Object.entries(e).map(e=>{const[t,n]=s(e[1])?[e[1]]:[e[1].name,e[1].value];return n&&(d.push(()=>U(o(l),t,o(n))),v[e[0]]=a(n)),[e[0],z(t)]});for(let e=0;e<m.length;e++){const[n,r]=m[e];v[n]||(v[n]=t.ref(t.isRef(l)&&!l.value||!u?null:V(o(l),r))),u&&t.watch([v[n],a(l)],e=>{c&&e[1]&&e[0]!==V(e[1],r)&&U(e[1],r,e[0])},{immediate:!t.isRef(l)})}if(!u)return{...v,stop:p,resume:p,supported:u,observing:c};const h=()=>{for(let e=0;e<m.length;e++){const[t,n]=m[e];v[t].value=V(o(l),n)}},g=new MutationObserver(h),y=()=>{g.disconnect(),c.value=!1},w=()=>{c.value||h(),g.observe(o(l),i),c.value=!0};return t.onUnmounted(y),t.isRef(l)?t.onMounted(()=>{d.forEach(e=>e()),t.watch(l,(e,t)=>{t&&y(),e&&w()})}):(b||l)&&(d.forEach(e=>e()),w()),{...v,supported:u,resume:w,stop:y,observing:c}},e.useCurrencyFormat=function(e,n,r){const a=o(e),u=!d(a),l=u?e:t.computed(()=>o(e).currency),[s,i]=K(n,u?r:e),c=t.computed(()=>{const e=o(i)||{},t=o(l)||e.currency;return{style:"currency",...e,currency:t}}),v=q(s),f=(e,t,n,r,a)=>{const u={...c.value,...o(r)},l=o(t)||u.currency,s=o(n)||u.currencyDisplay;return v.formatString(e,{...u,currency:l,currencyDisplay:s},a)};return{format:(e,n,r,o,a)=>t.computed(()=>f(e,n,r,o,a)),formatString:f}},e.useDateNow=function(e){return de({refreshMs:e&&e.refreshMs||1e3,sync:!e||!i(e.sync)||e.sync,timeFn:Date.now})},e.useDebounce=M,e.useEvent=S,e.useFetch=function(e,n){const r=t.ref(null),o=t.ref(""),a=t.ref(),u=t.ref(null),[l,i]=P(e)?[!1!==e.isJson,!1!==e.parseImmediate]:P(n)?[!1!==n.isJson,!1!==n.parseImmediate]:[!0,!0],c=e?s(e)?n:P(e)?e:s(e.url)?n:e:void 0,v=t.ref(!1),d=t.ref();let f=void 0;const m=k(async(e,t)=>{f=new AbortController;const n=await fetch(e,{signal:f.signal,...c,...t});if(n){const e=[l?n.clone().json().then(e=>r.value=e).catch(e=>{r.value=null,u.value=e}):Promise.resolve(),n.clone().blob().then(e=>{a.value=e}),n.clone().text().then(e=>{o.value=e})];i&&await Promise.all(e)}return n},!0),p=t.computed(()=>m.result.value&&m.result.value.status||null),h=t.computed(()=>m.result.value&&m.result.value.statusText||null);return e&&(s(e)||s(e.url))&&m.exec(e,void 0,!1),{...m,cancel:e=>{f&&(f.abort(),v.value=!0,d.value=e)},isCancelled:v,cancelledMessage:d,text:o,blob:a,json:r,jsonError:u,status:p,statusText:h}},e.useFormat=fe,e.useGeolocation=function(e){const n=b&&!!navigator.geolocation,r=t.ref(e?!1===e.immediate:void 0),o=t.ref(null),a=t.ref(null),u=t.ref(null),l=t.ref(e&&e.enableHighAccuracy||null);let s=p;if(n){const n=e=>{a.value=e.timestamp,u.value=e.coords,o.value=null},c=e=>{a.value=Date.now(),u.value=null,o.value=e},v=()=>!0!==r.value&&f&&navigator.geolocation.clearWatch(f);let d=()=>navigator.geolocation.getCurrentPosition(n,c,e);s=r.value?()=>{r.value?r.value=!1:d()}:d;let f=0;t.onMounted(()=>t.watch([l,r],t=>{v();const r=i(t[0])?t[0]:e?e.enableHighAccuracy:void 0;f=navigator.geolocation.watchPosition(n,c,e?{...e,enableHighAccuracy:r}:{enableHighAccuracy:r})},{immediate:!r.value})),t.onUnmounted(v)}return{supported:n,refresh:s,error:o,timestamp:a,coords:u,highAccuracy:l}},e.useHydration=function(){return t.inject(Se,t.computed(()=>!1))},e.useI18n=function(e){return e?be(e):t.inject(ye)},e.useIntersectionObserver=function(e,n){const r=b&&"IntersectionObserver"in window,u=e?a(e):void 0,l=!u||!f(u.value)&&u.value?void 0:u,s=t.computed(()=>n?o(n):l?void 0:o(e)),i=t.ref([]),c=t.computed(()=>i.value.length>0&&i.value.every(e=>e.isIntersecting)),v=e=>{i.value=e};let d=t.ref();r&&t.watch(s,e=>{d.value&&d.value.disconnect();const t=e&&e&&{root:o(e.root),rootMargin:o(e.rootMargin),threshold:o(e.threshold)}||void 0;d.value=new IntersectionObserver(v,t);i.value.map(e=>e.target).forEach(d.value.observe)},{deep:!0,immediate:!0});const m=r?e=>{const t=o(e);d.value.observe(t)}:p,h=r?e=>{const t=o(e);d.value.unobserve(t)}:p,g=()=>d.value.disconnect();return l&&(t.onMounted(()=>{l.value&&m(l)}),t.onUnmounted(()=>{g()})),{supported:r,elements:i,observe:m,unobserve:h,disconnect:g,isIntersecting:c}},e.useIntlNumberFormat=q,e.useLanguage=function(){if(A||(A=b?t.ref(navigator.language):t.ref("")),!D)if(b){D=t.ref(navigator.languages);const e=()=>{A.value=navigator.language,D.value=navigator.languages};window.addEventListener("languagechange",e,g)}else D=t.ref([]);return{language:A,languages:D}},e.useLocalStorage=se,e.useMatchMedia=B,e.useNetworkInformation=function(){const e=!!b&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection),n=!!e,r=t.ref(0),o=t.ref(0),a=t.ref("none"),u=t.ref(0),l=t.ref(!1),s=t.ref("none");let i=p,c=p;return e&&(i=()=>{r.value=e.downlink,o.value=e.downlinkMax,a.value=e.effectiveType,u.value=e.rtt,l.value=e.saveData,s.value=e.type},c=S(e,"change",i,g),i()),{supported:n,downlink:r,downlinkMax:o,effectiveType:a,rtt:u,saveData:l,type:s,remove:c}},e.useNow=de,e.useOnMouseMove=function(e,n,r){const o=t.ref(0),a=t.ref(0);let u=e=>{o.value=e.x,a.value=e.y};const[l,s]=v(n)?[void 0,n]:[n,r];s&&(u=M(u,r));const i=S(e,"mousemove",u,l);return{mouseX:o,mouseY:a,remove:i}},e.useOnResize=function(e,n,r){const o=a(e),u=t.ref(o.value&&o.value.clientHeight),l=t.ref(o.value&&o.value.clientWidth);let s=()=>{u.value=o.value.clientHeight,l.value=o.value.clientWidth};const[i,c]=v(n)?[void 0,n]:[n,r];c&&(s=M(s,r));const d=b?S(window,"resize",s,i||g):p;return t.isRef(e)&&!e.value&&t.onMounted(s),{height:u,width:l,remove:d}},e.useOnScroll=function(e,n,r){const o=e=>!(v(e)||i(e)||!f(e)&&!t.isRef(e)||!e),u=o(e)?a(e):t.ref(b&&window||void 0),l=o(e)?u:t.ref(b&&window.document.scrollingElement||void 0),s=t.ref(l.value&&l.value.scrollTop||0),c=t.ref(l.value&&l.value.scrollLeft||0);let d=()=>{s.value=l.value.scrollTop,c.value=l.value.scrollLeft};const m=(...e)=>l.value&&l.value.scrollTo&&l.value.scrollTo.apply(l.value,e),p=e=>m({top:e}),h=e=>m({left:e}),[y,w]=v(e)||!e?[g,e]:v(n)?[g,n]:[n,r];w&&(d=M(d,r));const E=S(u,"scroll",d,y),$=t.watch(s,p,{immediate:!1}),k=t.watch(c,h,{immediate:!1});return{scrollTop:s,scrollLeft:c,scrollTo:m,remove:()=>{E(),k(),$()},scrollTopTo:p,scrollLeftTo:h}},e.useOnline=function(){const e=b&&"onLine"in navigator;return e||(j=t.ref(!1)),j||(j=t.ref(navigator.onLine),window.addEventListener("offline",()=>j.value=!1,g),window.addEventListener("online",()=>j.value=!0,g)),{supported:e,online:j}},e.usePageVisibility=function(){return C||(C=t.ref(b&&document.hidden)),T||(b?(T=t.ref(document.visibilityState),document.addEventListener("visibilitychange",()=>{T.value=document.visibilityState,C.value=document.hidden},g)):T=t.ref("visible")),{visibility:T,hidden:C}},e.usePagination=ve,e.usePath=me,e.usePerformanceNow=function(e){return de({refreshMs:e&&e.refreshMs||1e3,sync:!e||!i(e.sync)||e.sync,timeFn:()=>performance.now()})},e.usePromise=k,e.usePromiseLazy=function(e,t=!1){return k(e,{lazy:!0,throwException:t})},e.useRetry=function(e,n){const r=!e||l(e)?{}:e,o=l(e)?e:n;if(!l(e)&&!d(e))throw new Error("[useRetry] options needs to be 'object'");if(o&&!l(o))throw new Error("[useRetry] factory needs to be 'function'");const a=t.ref(!1),u=t.ref(),s=t.ref([]),i={value:!1},c={isRetrying:a,retryCount:t.computed(()=>s.value.length),nextRetry:u,retryErrors:s,[I]:{value:0},[L]:i},v=o?(...e)=>(++c[I].value,R(r,c,o,e)):e=>(++c[I].value,R(r,c,e,void 0));return{...c,cancel:()=>{c.isRetrying.value=!1,c.retryErrors.value.push(new Error("[useRetry] cancelled")),c.nextRetry.value=void 0,i.value=!0},exec:v}},e.useSSRTitle=function(e){const n=Symbol(),r=t.inject(Ee,n);return r===n||void 0===r?t.ref(s(e)?e:""):(s(e)&&(r.value=e),r)},e.useSessionStorage=ie,e.useShare=function(e){const n=b&&"share"in navigator;let r=()=>Promise.resolve(!1),o=h,a=t.ref(!1),u=t.ref(!1);return n&&(r=e=>(a.value=!1,u.value=!1,navigator.share(e).then(e=>(a.value=!0,e)).catch(e=>(a.value=!1,u.value=!0,!1))),o=e=>navigator.canShare(e),e&&o(e)&&r(e)),{supported:n,share:r,canShare:o,shared:a,cancelled:u}},e.useSharedRef=H,e.useStorage=function(e,t,n){return void 0===ce&&(ce=le("localStorage").supported),ce?se(e,t,n):ie(e,t)},e.useTitle=function(e=null){const n=t.ref(s(e)?e:document.title),r=new MutationObserver(e=>{n.value=e[0].target.textContent});t.watch(n,(e,t)=>{s(e)&&e!==t&&(document.title=e)},{immediate:!0,flush:"sync"});const o=document.querySelector("title");return r.observe(o,{childList:!0}),t.onUnmounted(()=>r.disconnect()),n},e.useUndo=function(e,n){const r=a(e),o=t.ref([]),u=t.ref(0),l=n&&n.maxLength||2**32-2,s=n&&n.clone||(e=>e);t.watch(r,e=>{if(o.value[u.value]!==e){if(u.value>0){const e=u.value;o.value.splice(0,e),u.value=0}o.value.length>l&&o.value.pop(),o.value.unshift(s(e))}},{...n,immediate:!0,flush:"sync"});const i=e=>{const t=Math.sign(e)<=0?Math.max(e,-v.value.length):Math.min(e,c.value.length);u.value+=t,r.value=o.value[u.value]},c=t.computed(()=>{const e=0===u.value?1:u.value;return o.value.slice(e)}),v=t.computed(()=>{const e=0===u.value?1:0;return o.value.slice(e,u.value)});return{value:r,undo:(e=1)=>i(e),redo:(e=1)=>i(-e),jump:i,prev:c,next:v}},e.useVModel=function(e,t){console.warn("[useVModel] is not supported on @vue/composition-api.")},e.useValidation=function(e){const n=[],r=ge({input:e},n),o=t.reactive(r.input);return n.forEach(e=>e(o)),o},e.useWebSocket=function(e,n){const r=b&&"WebSocket"in window;let o=null;const a=t.ref(null),u=t.ref(null),l=t.ref(null),s=t.ref(!1),i=t.ref(!1),c=t.ref(!1);let v=p,d=p;return r&&(o=new WebSocket(e,n),o.addEventListener("message",e=>{a.value=e,l.value=e.data}),o.addEventListener("error",e=>{u.value=e,c.value=!0}),o.addEventListener("close",()=>{s.value=!1,i.value=!0}),o.addEventListener("open",()=>{s.value=!0,i.value=!1}),v=e=>o.send(e),d=(e,t)=>{o.close(e,t)}),{supported:r,ws:o,send:v,close:d,messageEvent:a,errorEvent:u,data:l,isOpen:s,isClosed:i,errored:c}},e.useWebStorage=le,e.useWorker=function(e,n,r){const o=b&&"Worker"in self,a=t.ref(),u=t.ref(),l=t.ref(!o),s=t.ref(!o);if(!o)return l.value=!0,{worker:void 0,data:u,postMessage:p,terminate:p,errorEvent:a,errored:s,terminated:l};const i=new Worker(e,r),c=e=>i.postMessage(e);function v(){i.terminate(),l.value=!0}return i.addEventListener("message",e=>{u.value=e.data},g),i.addEventListener("error",e=>{a.value=e,s.value=!0},g),t.onUnmounted(v),n&&c(n),{worker:i,data:u,postMessage:c,terminate:v,errorEvent:a,errored:s,terminated:l}},e.useWorkerFunction=function(e,n){const r=b&&"Worker"in self,a=t.computed(()=>n&&o(n.dependencies)||[]),u=t.computed(()=>n&&o(n.timeout));if(!r)return x(e,{lazy:!0,throwException:!0});const l=x((...n)=>new Promise((r,o)=>{const s=function(e,t){const n=[t.length>0?`importScripts("${t.join('","')}");`:"","onmessage=",`(${N.toString()})(${e.toString()})`],r=new Blob(n,{type:"text/javascript"});return URL.createObjectURL(r)}(e,a.value),i=new Worker(s);let c=-1;const v=u.value,d=()=>{i.terminate(),URL.revokeObjectURL(s),clearTimeout(c),m()},f=n.length===e.length+1&&t.isRef(n[n.length-1])&&!1===n[n.length-1].value?t.computed(()=>l.cancelled.value||n[n.length-1].value):l.cancelled,m=f?t.watch(f,()=>{d(),r(void 0)},{immediate:!1}):p;i.addEventListener("message",e=>{e.data[0]?r(e.data[1]):o(e.data[1]),d()},g),i.addEventListener("error",e=>{d(),o(e)},g),i.postMessage([...n]),v&&(c=setTimeout(()=>{l.cancel(`[WebWorker] timeout after ${v}ms`)},v))}),{lazy:!0,throwException:!0});return l},e.wrap=a,e}({},vueCompositionApi,Vue); | ||
var vueComposable=function(e,t,n){"use strict";n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;const r=t.set;function o(e){return t.isRef(e)?e.value:e}function a(e){return t.isRef(e)?e:t.ref(e)}const u=Array.isArray,l=e=>"function"==typeof e,s=e=>"string"==typeof e,i=e=>"boolean"==typeof e,c=e=>d(e)&&l(e.getTime),v=e=>"number"==typeof e,d=e=>null!==e&&"object"==typeof e,f=e=>d(e)&&!!e.tagName;function m(e){return d(e)&&l(e.then)&&l(e.catch)}const p=()=>{},h=()=>!1,g={passive:!0};function y(e){return new Promise(t=>{setTimeout(t,e)})}function w(e,t,n){return e<t?t:e>n?n:e}const b="undefined"!=typeof window;function E(e,...t){for(let n=0;n<t.length;n++){const r=t[n];if(void 0===r||!d(r))continue;const a=Object.keys(r);for(let t=0;t<a.length;t++){const n=a[t],u=o(r[n]),l=typeof u,s=typeof e[n];void 0!==e[n]&&l!==s||(e[n]=d(u)?E(e[n]||{},u):r[n])}}return e}function S(e,n,r,o){let u=p;if(e){const l=a(e),s=e=>e.removeEventListener(n,r),i=e=>e.addEventListener(n,r,o),c=t.watch(l,(e,t,n)=>{e&&(i(e),n(()=>s(e)))},{immediate:!0});u=()=>{s(l.value),c()}}return u}function M(e,t,n){return $(e,t,n)}function $(e,t=50,n={isImmediate:!1}){let r;return function(...o){const a=this,u=n.isImmediate&&void 0===r;void 0!==r&&clearTimeout(r),r=setTimeout((function(){r=void 0,n.isImmediate||e.apply(a,o)}),t),u&&e.apply(a,o)}}function I(e,n){if(!e)throw new Error(`[usePromise] argument can't be '${e}'`);if("function"!=typeof e)throw new Error("[usePromise] expects function, but received "+typeof e);const[r,o]=i(n)?[n,!1]:d(n)?[n.lazy,n.throwException]:[!1,!1],a=t.ref(!1),u=t.ref(null),l=t.ref(null),s=t.ref(),c=async(...t)=>{a.value=!0,u.value=null;const n=t&&e.length!==t.length&&t.length>0&&i(t[t.length-1])?t[t.length-1]:o,r=s.value=e(...t);try{const e=await r;return s.value===r&&(l.value=e),e}catch(e){return s.value===r&&(u.value=e,l.value=null),n?r:void 0}finally{s.value===r&&(a.value=!1)}};return r||c(),{exec:c,result:l,promise:s,loading:a,error:u}}function x(e,n){const r=t.ref(!1);let o=void 0;return{...I((...t)=>{return n=e(...t),new Promise((e,t)=>{o=e=>{r.value=!0,t(e)},n.then(e).catch(t)});var n},n),cancel:e=>{o&&o(e)},cancelled:r}}const k=Symbol(""),L=Symbol(""),R=async(e,t,n,r)=>{const o=t[k].value;let a=-1;const u=e.maxRetries||9001,l=e.retryDelay||O;t.retryErrors.value=[],t.isRetrying.value=!1,t.nextRetry.value=void 0;let s=void 0;do{let e=!1,i=null;try{if(++a,i=r?n(...r):n(),m(i)&&(i=await i),t[L].value)return null;e=!0}catch(e){i=null,t.retryErrors.value.push(e)}if(o!==t[k].value)return i;if(e)return t.isRetrying.value=!1,t.nextRetry.value=void 0,i;if(a>=u)return t.isRetrying.value=!1,t.nextRetry.value=void 0,Promise.reject(new Error("[useRetry] max retries reached "+u));t.isRetrying.value=!0;const d=Date.now(),f=l(a),p=m(f)?await f:f;if(!m(f)||p){if(v(p))s=p;else{if(!c(p))throw new Error(`[useRetry] invalid value received from options.retryDelay '${typeof p}'`);s=p.getTime()}s<d?t.nextRetry.value=d+s:(t.nextRetry.value=s,s-=d),s>0&&await y(s)}if(t[L].value)return null;if(o!==t[k].value)return i}while(a<9e3);return null};const O=()=>0;function P(e){return e&&(i(e.isJson)||i(e.parseImmediate))}let T=void 0;let j=void 0,C=void 0;let D=void 0,A=void 0;function F(e,n){const r=b&&"BroadcastChannel"in self,o=t.ref(null),a=t.ref(null),u=t.ref(null),l=t.ref(!1),s=t.ref(!1);let i=p,c=p,v=p;if(r){const r=new BroadcastChannel(e);r.addEventListener("messageerror",e=>{u.value=e,l.value=!0},g),r.addEventListener("message",e=>{a.value=e,o.value=e.data},g),i=e=>r.postMessage(e),c=()=>{r.close(),s.value=!0},v=(e,n)=>{r.addEventListener("message",e,n),t.onUnmounted(()=>r.removeEventListener("message",e))},t.onUnmounted(()=>{n&&n(),c()})}return{supported:r,data:o,messageEvent:a,errorEvent:u,errored:l,isClosed:s,send:i,close:c,addListener:v}}function V(e,t){const n=getComputedStyle(e).getPropertyValue(t);return n?n.trim():null}function U(e,t,n){e.style.setProperty(t,n)}const W={attributes:!0,childList:!0,subtree:!0},z=e=>e.length<=2||"-"!==e[0]||"-"!==e[1]?"--"+e:e;const N=e=>function(t){const n=t.data||[];return new Promise(t=>{try{Promise.resolve(e.apply(e,n)).then(e=>t(postMessage([!0,e]))).catch(e=>t(postMessage([!1,e])))}catch(e){t(postMessage([!1,e]))}})};function B(e){const n=!!b&&"matchMedia"in window;let r=void 0,o=void 0,a=p;if(n){r=t.ref(matchMedia(e)),o=t.ref(r.value.matches);const n=e=>{o.value=e.matches};r.value.addEventListener("change",n,g);const a=()=>r.value.removeEventListener("change",n);t.onUnmounted(a)}else r=t.ref({}),o=t.ref(!1);return{supported:n,mediaQueryList:r,matches:o,remove:a}}function H(e,n){const{addListener:r,send:o,close:a,supported:u}=F(e,()=>y()),l=Date.now(),s=t.ref(!1),i=t.ref(0),c=t.computed(()=>1!==i.value||s.value),v=t.ref([]),f=t.ref(n);let m=!1,p=void 0;o({type:0});const h=()=>o({type:5,id:l}),y=()=>{0!==v.value.length&&(s.value&&o({type:3,mind:1,id:Math.min(...v.value)}),o({type:4,id:l}))};return r(e=>{switch(e.data.type){case 0:o({type:2,value:f.value,mind:i.value});break;case 4:{const t=v.value.indexOf(e.data.id);t>=0&&v.value.splice(t,1),p===e.data.id&&v.value.length>0&&o({type:3,mind:1,id:Math.min(l,...v.value)});break}case 2:m=!0,f.value=e.data.value,i.value=e.data.mind;break;case 3:i.value=e.data.mind,p=1===e.data.mind&&e.data.id||void 0,s.value=p===l,s.value&&(v.value=[],h());break;case 5:v.value=[e.data.id],o({type:6,id:l});break;case 6:v.value.push(e.data.id)}},g),h(),t.watch(f,(e,t)=>{if(m)m=!1;else{if(1===i.value&&!1===s.value)return m=!0,void(f.value=t);o({type:2,mind:i.value,value:d(e)?{...e}:e}),m=!1}},{deep:!0,immediate:!1}),b&&window.addEventListener("unload",y,g),t.onUnmounted(()=>{y(),a()}),{supported:u,id:l,data:f,master:s,mind:i,editable:c,targets:v,ping:h,setMind:e=>{switch(e){case 1:s.value=!0;break;case 0:s.value=!1}i.value=e,o({type:3,id:l,mind:i.value})},addListener:r}}function _(e,n){const r=Symbol(),o=t.inject(e,r);return o===r?n():o}function K(e,n){const r=a(n),o=a(e);return d(r.value)||t.isRef(n)?[void 0!==o.value?o:void 0,r]:!d(o.value)||u(o.value)||s(o.value)?[o.value?o:void 0,void 0]:[void 0,o]}function q(e,n){const[r,a]=K(e,n),u=t.computed(()=>new Intl.NumberFormat(o(r),o(a))),l=(e,t,n)=>(t||n?new Intl.NumberFormat(o(n)||o(r),{...o(a),...o(t)}):u.value).format(o(e));return{format:(e,n,r)=>t.computed(()=>l(e,n,r)),formatString:l,formatter:u}}function J(e){if(e)return v(e)?e:Q(e)}const Q=e=>{const t=e.match(/^(\d+)px$/);if(t)return+t[1]};function X(e){const n={},r=new Map,o=t.ref();let a=[];const u=[];for(const o in e){const l=e[o],s=J(l);if(void 0!==s){const e=t.ref(!1);n[o]=e,r.set(s,{name:o,valid:e}),a.push(s)}else{const{matches:e,remove:t}=B(l);n[o]=e,u.push(t)}}a=a.sort((e,t)=>t-e);const l=b?()=>{const e=window.innerWidth;let t=void 0;for(let n=0;n<a.length;n++){const o=a[n],u=r.get(o);u.valid.value=e>=o,e>=o&&void 0===t&&(t=u.name)}o.value=t}:p,s=M(l,10),i=b?()=>window.removeEventListener("resize",s):p;return b&&(t.onMounted(()=>{l(),window.addEventListener("resize",s,g)}),t.onUnmounted(()=>{i(),u.forEach(e=>e())})),{...n,remove:i,current:o}}const Y=Symbol(""),G={sm:640,md:768,lg:1024,xl:1280};function Z(e){return d(e)&&d(e.theme)&&d(e.theme.screens)}function ee(e){return!!d(e)&&(s(e.min)||s(e.max)||v(e.min)||v(e.max))}function te(e){return v(e)?e+"px":e}function ne(e){const t=[];if(u(e)){const n=e.map(ne);for(let e=0;e<n.length;e++){const r=n[e];t.push(...r)}}else d(n=e)&&s(n.raw)?t.push(e.raw):ee(e)?t.push(function(e){return ee(e)?`(${[e.max&&"max-width: "+te(e.max),e.min&&"min-width: "+te(e.min)].filter(Boolean).join(" and ")})`:""}(e)):(s(e)||v(e))&&t.push(`(min-width: ${te(e)})`);var n;return t}function re(e){const n=Z(e)?e.theme.screens:e;if(Z(e))for(const e in n)n.hasOwnProperty(e)&&(n[e]=ne(n[e]).join(" or "));const r=X(n);return t.provide(Y,r),r}function oe(e,t){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&(t&&0!==t.length||!1)}function ae(e){try{if(!e)return!1;const t=":$";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return oe(t,e)}}function ue(e,t){try{return e.parse(t)}catch{return t}}let le=void 0;function se(e,n=JSON,r=10){const o=b?window[e]:void 0,u=ae(o);le||(le=new Map,b&&window.addEventListener("storage",e=>{if(e.newValue===e.oldValue)return;let t=le.get("localStorage");t=e.storageArea===window.localStorage?le.get("localStorage"):le.get("sessionStorage"),t&&Object.keys(t.$syncKeys).length>0&&(null===e.key?t.clear():t.$syncKeys[e.key]&&(null===e.newValue?t.removeItem(e.key):t.updateItem(e.key,e.newValue)))}));let l,i=le.get(e);return u&&o?i?l=i.$quotaError:(l=t.ref(!1),i={$refMap:new Map,$watchHandlers:new Map,$syncKeys:{},$quotaError:l,key:o.key,length:o.length,setSync(e,t){t?this.$syncKeys[e]=!0:delete this.$syncKeys[e]},clear(){this.$refMap.forEach((e,t)=>this.removeItem(t))},removeItem(e){const t=this.$refMap.get(e);t&&(t.value=void 0);const n=this.$watchHandlers.get(e);n&&n(),delete this.$syncKeys[e],this.$refMap.delete(e),o.removeItem(e)},getItem(e){const t=o.getItem(e);return t?this.setItem(e,ue(n,t)):null},setItem(e,u){const i=a(u);this.$refMap.set(e,i);const c=(e,t)=>{try{const r=o.getItem(e),a=s(t)?t:n.stringify(t);o.setItem(e,a),r!==a&&b&&this.$syncKeys[e]&&window.dispatchEvent(new StorageEvent(e,{newValue:a,oldValue:r,storageArea:o}))}catch(e){l.value=oe(e,o)}};c(e,u);const v=t.watch(i,$(t=>{c(e,t)},r),{immediate:!1,deep:!0});return this.$watchHandlers.set(e,v),i},updateItem(e,t){let r=this.$refMap.get(e);r&&(r.value=ue(n,t))}},le.set(e,i)):(l=t.ref(!1),i={}),{supported:u,quotaError:l,store:i,remove:()=>le.delete(e)}}function ie(e,n,r){const{supported:o,store:a}=se("localStorage");let u=p,l=p,s=p,i=void 0;return o&&a?(s=t=>a.setSync(e,t),u=()=>a.removeItem(e),l=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n)),!1!==r&&s(!0)):i=t.ref(n),{supported:o,storage:i,clear:l,remove:u,setSync:s}}function ce(e,n,r){const{supported:o,store:a}=se("sessionStorage");let u=p,l=p,s=h,i=void 0;return o&&a?(u=()=>a.removeItem(e),l=()=>a.clear(),i=a.getItem(e),i||(i=a.setItem(e,n))):i=t.ref(n),{supported:o,storage:i,clear:l,remove:u,setSync:s}}let ve=void 0;function de(e){const n=a(e.currentPage),r=a(e.pageSize),o=t.ref(0),u=a(e.total),l=t.computed({get:()=>o.value,set(e){v(e)&&(o.value=Math.min(e,u.value))}}),s=t.computed({get:()=>n.value,set(e){v(e)&&(n.value=w(e,1,c.value),l.value=(n.value-1)*i.value)}}),i=t.computed({get:()=>r.value,set(e){v(e)&&(r.value=e)}}),c=t.computed(()=>Math.ceil(u.value/i.value));s.value=n.value;return t.watch([u,i],e=>{s.value>c.value&&(s.value=c.value)},{immediate:!1}),{pageSize:i,total:u,currentPage:s,offset:l,lastPage:c,next:()=>++s.value,prev:()=>--s.value,first:()=>s.value=1,last:()=>s.value=c.value}}function fe(e){const n=e&&e.refreshMs||1e3,r=!e||!i(e.sync)||e.sync,o=e&&l(e.timeFn)&&e.timeFn||Date.now;let a=void 0,u=void 0;const s=t.ref(o()),c=()=>{clearInterval(a),clearTimeout(u)},v=b?()=>a=setInterval(()=>s.value=o(),n):p;if(r){const e=1e3-(s.value-1e3*Math.floor(s.value/1e3));u=setTimeout(v,e)}else v();return t.onUnmounted(c),{now:s,remove:c}}function me(e,n){return t.computed(()=>{const r=o(e);if(!n)return r;const a=t.isRef(n)?t.reactive(n.value):t.reactive(n);return r.replace(/({?{[\w\s]*}?})/g,e=>{const t=e.replace("{","").replace("}","").trim();if(e[0]===e[1]&&"{"===e[0])return""+t;const n=u(a)?a[+t]:a[t];return void 0===n?e:""+o(n)})})}function pe(e,n,r=".",a=p){return t.computed(()=>{const t=o(e),u=o(n);if(void 0===t)return a(u,t,u,t);if(!u)return t;const l=u.split(r);let s=t;for(let e=0;e<l.length;e++){let n=l[e];if("]"===n[n.length-1]){const t=/\[[`'"]?([^`'"\]]*)[`'"]?\]/g;let r=n,o=t.exec(r);if(o){let a=o[0].length,u=o.index-a,s=1;do{o.index,u=o.index,a=o[0].length,n=n.slice(0,-o[0].length),l.splice(e+s,0,o[1]),++s}while(o=t.exec(r));if(!n&&"["===r[0]&&r.length>2)continue}else n="",console.warn(`[usePath] invalid path provided "${r}"`)}if(!d(s))return a(l.slice(0,e+1).join(r),s,u,t);if(!n)return a(l.slice(0,e+1).join(r),s,u,t);if(s=s[n],!s)return a(l.slice(0,e+1).join(r),s,u,t)}return s})}function he(e){return void 0!==e.$value}const ge=(e,n,r)=>{const{$message:a,$validator:u,...l}=function(e){return d(e)}(n)?n:{$validator:n,$message:""},{$pending:s,$promise:i,$invalid:c,$error:v}=((e,n,r)=>{const a=t.ref(null),u=t.ref(!1),l=t.ref(),s=t.ref(!1);let i=void 0;const c=e=>{a.value=(async()=>{try{u.value=!0;const t=n(e,i);m(t)?s.value=!await t:s.value=!t}catch(e){throw s.value=!0,e}finally{u.value=!1}})().catch(e=>(l.value=o(e),s.value=!0,e))};return r.push(r=>{i=r,t.watch(()=>{try{n(e.value,i)}catch(e){}return e.value},c,{deep:!0,immediate:!0})}),{$promise:a,$pending:u,$invalid:s,$error:l}})(e,u,r);return{$pending:s,$error:v,$promise:i,$invalid:c,$message:a,...l}},ye=(e,n)=>{const r={},u=he(e)?a(e.$value):void 0;for(const a of Object.keys(e))if("$"!==a[0])if(u){const t=ge(u,e[a],n);r[a]={...t,$value:u}}else{const u=ye(e[a],n);let l,s,c=void 0;if(he(u)){const e=Object.keys(u).filter(e=>"$"!==e[0]).map(e=>u[e]);l=t.computed(()=>e.map(e=>e.$error).filter(Boolean).map(e=>o(e))),s=t.computed(()=>e.some(e=>!!o(e.$invalid)))}else{const e=Object.keys(u).map(e=>u[e]);l=t.computed(()=>e.map(e=>o(e.$errors)).filter(Boolean).filter(e=>e.some(Boolean))),c=t.computed(()=>e.some(e=>e.$anyDirty||i(o(e.$dirty))&&o(e.$dirty))),s=t.computed(()=>e.some(e=>!!o(e.$anyInvalid)))}r[a]={...u,$errors:l,$anyInvalid:s},c&&(r[a].$anyDirty=c)}else{if("$value"===a){r[a]=u;const e=t.ref(!1),n=t.watch(u,()=>{e.value=!0,n()},{immediate:!1,deep:!0});r.$dirty=e;continue}r[a]=e[a]}return r};const we=Symbol("");function be(e){const u=t.ref(Object.keys(e.messages)),s=t.ref(e.messages),c=t.ref(e.locale),v=t.ref({});let d=t.ref();const f={},p=(e,n)=>{if(f[e])return f[e];const r=n.value[e];if(!r)return t.ref({});let o=l(r)?r():r;return m(o)?o.then(t=>f[e]=a(t)):l(r)?a(o):f[e]=t.computed(()=>n.value[e])},h=!!e.fallback&&(!i(e.notFoundFallback)||e.notFoundFallback);let g=!1;if(h){const t=p(e.fallback,s);m(t)?(t.then(e=>{d.value=e.value}),g=!0):d.value=t.value}else d.value={};const y=t.ref(0);t.watch(s,()=>y.value++,{deep:!0,immediate:!1}),t.watch([c,d,y],([t,n,r])=>{if(t===e.fallback&&h)v.value=n;else{const e=e=>v.value=E({},n,o(e)),r=p(t,s);m(r)?r.then(e):e(r)}},{immediate:!g});const w=(t,n)=>e.resolve?a(e.resolve(v.value,t,n)):me(pe(v,t,".",(e,t,n,r)=>n),n);return{locale:c,locales:u,i18n:v,$t:w,$ts:(e,t)=>w(e,t).value,addLocale:(e,t)=>{u.value.indexOf(e)>=0||u.value.push(e),delete f[e],r(s.value,e,t)},removeLocale:t=>{const r=u.value.indexOf(t);if(r>=0){const n=[c.value,d.value&&e.fallback,...u.value].find(e=>e&&e!==t);n&&(t===e.fallback&&(d.value=void 0),t===c.value&&(c.value=n)),u.value.splice(r,1)}var o,a;o=s.value,a=t,n.delete(o,a),delete f[t]}}}function Ee(e){const n=be(e);return t.provide(we,n),n}const Se=Symbol("");const Me=Symbol(""),$e={install(e){const n=t.ref(!0);r=n,t.computed(()=>r);var r}};return e.COMMIT="22f936d",e.FALSE_OP=h,e.MAX_ARRAY_SIZE=2**32-2,e.NO_OP=p,e.PASSIVE_EV=g,e.VERSION="1.0.0-dev.37",e.VUE_VERSION="2",e.buildI18n=be,e.debounce=$,e.deepClone=E,e.exponentialDelay=e=>{const t=100*Math.pow(2,e);return t+.2*t*Math.random()},e.exposeWorker=function(e){this.onmessage=async t=>{const n=e(t.data);if(void 0===n)this.postMessage(n);else if(null===n)this.postMessage(n);else if(u(n))this.postMessage(n);else if(n[Symbol.asyncIterator])for await(const e of n)this.postMessage(e);else if(n[Symbol.iterator])for(const e of n)this.postMessage(e);else this.postMessage(await n)}},e.getCssVariableFor=V,e.hydrationPlugin=$e,e.injectFactory=_,e.isArray=u,e.isBoolean=i,e.isClient=b,e.isDate=c,e.isElement=f,e.isFunction=l,e.isNumber=v,e.isObject=d,e.isPromise=m,e.isString=s,e.isSymbol=e=>"symbol"==typeof e,e.minMax=w,e.noDelay=O,e.promisedTimeout=y,e.provideSSRTitle=function(e,t){const n=a(void 0===t?"":t);return e.provide(Se,n),n},e.refShared=function(e,n){const r=t.getCurrentInstance(),o=n||r.$vnode.tag;if(!o)return t.ref(e);const{data:a,supported:u}=H(o,e);return a},e.setBreakpointTailwindCSS=re,e.setCssVariableFor=U,e.setI18n=Ee,e.storageAvailable=ae,e.unwrap=o,e.useArrayPagination=function(e,n){const r=a(e),o=de({currentPage:1,pageSize:10,...n,total:t.computed(()=>r.value.length)}),u=t.computed(()=>{const e=r.value;return Array.isArray(e)?e.slice(o.offset.value,o.offset.value+o.pageSize.value):[]});return{...o,result:u}},e.useBreakpoint=X,e.useBreakpointChrome=function(){return X({mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560})},e.useBreakpointTailwindCSS=function(e){return _(Y,()=>re(e||G))},e.useBroadcastChannel=F,e.useCancellablePromise=x,e.useCssVariables=function(e,n,r){const u=b&&"MutationObserver"in self,[l,i]=t.isRef(n)||f(n)?[n,r||W]:[u&&document.documentElement||{},n||W],c=t.ref(!0),v={},d=[],m=Object.entries(e).map(e=>{const[t,n]=s(e[1])?[e[1]]:[e[1].name,e[1].value];return n&&(d.push(()=>U(o(l),t,o(n))),v[e[0]]=a(n)),[e[0],z(t)]});for(let e=0;e<m.length;e++){const[n,r]=m[e];v[n]||(v[n]=t.ref(t.isRef(l)&&!l.value||!u?null:V(o(l),r))),u&&t.watch([v[n],a(l)],e=>{c&&e[1]&&e[0]!==V(e[1],r)&&U(e[1],r,e[0])},{immediate:!t.isRef(l)})}if(!u)return{...v,stop:p,resume:p,supported:u,observing:c};const h=()=>{for(let e=0;e<m.length;e++){const[t,n]=m[e];v[t].value=V(o(l),n)}},g=new MutationObserver(h),y=()=>{g.disconnect(),c.value=!1},w=()=>{c.value||h(),g.observe(o(l),i),c.value=!0};return t.onUnmounted(y),t.isRef(l)?t.onMounted(()=>{d.forEach(e=>e()),t.watch(l,(e,t)=>{t&&y(),e&&w()})}):(b||l)&&(d.forEach(e=>e()),w()),{...v,supported:u,resume:w,stop:y,observing:c}},e.useCurrencyFormat=function(e,n,r){const a=o(e),u=!d(a),l=u?e:t.computed(()=>o(e).currency),[s,i]=K(n,u?r:e),c=t.computed(()=>{const e=o(i)||{},t=o(l)||e.currency;return{style:"currency",...e,currency:t}}),v=q(s),f=(e,t,n,r,a)=>{const u={...c.value,...o(r)},l=o(t)||u.currency,s=o(n)||u.currencyDisplay;return v.formatString(e,{...u,currency:l,currencyDisplay:s},a)};return{format:(e,n,r,o,a)=>t.computed(()=>f(e,n,r,o,a)),formatString:f}},e.useDateNow=function(e){return fe({refreshMs:e&&e.refreshMs||1e3,sync:!e||!i(e.sync)||e.sync,timeFn:Date.now})},e.useDebounce=M,e.useEvent=S,e.useFetch=function(e,n){const r=t.ref(null),o=t.ref(""),a=t.ref(),u=t.ref(null),[l,i]=P(e)?[!1!==e.isJson,!1!==e.parseImmediate]:P(n)?[!1!==n.isJson,!1!==n.parseImmediate]:[!0,!0],c=e?s(e)?n:P(e)?e:s(e.url)?n:e:void 0,v=t.ref(!1),d=t.ref();let f=void 0;const m=I(async(e,t)=>{f=new AbortController;const n=await fetch(e,{signal:f.signal,...c,...t});if(n){const e=[l?n.clone().json().then(e=>r.value=e).catch(e=>{r.value=null,u.value=e}):Promise.resolve(),n.clone().blob().then(e=>{a.value=e}),n.clone().text().then(e=>{o.value=e})];i&&await Promise.all(e)}return n},!0),p=t.computed(()=>m.result.value&&m.result.value.status||null),h=t.computed(()=>m.result.value&&m.result.value.statusText||null);return e&&(s(e)||s(e.url))&&m.exec(e,void 0,!1),{...m,cancel:e=>{f&&(f.abort(),v.value=!0,d.value=e)},isCancelled:v,cancelledMessage:d,text:o,blob:a,json:r,jsonError:u,status:p,statusText:h}},e.useFormat=me,e.useGeolocation=function(e){const n=b&&!!navigator.geolocation,r=t.ref(e?!1===e.immediate:void 0),o=t.ref(null),a=t.ref(null),u=t.ref(null),l=t.ref(e&&e.enableHighAccuracy||null);let s=p;if(n){const n=e=>{a.value=e.timestamp,u.value=e.coords,o.value=null},c=e=>{a.value=Date.now(),u.value=null,o.value=e},v=()=>!0!==r.value&&f&&navigator.geolocation.clearWatch(f);let d=()=>navigator.geolocation.getCurrentPosition(n,c,e);s=r.value?()=>{r.value?r.value=!1:d()}:d;let f=0;t.onMounted(()=>t.watch([l,r],t=>{v();const r=i(t[0])?t[0]:e?e.enableHighAccuracy:void 0;f=navigator.geolocation.watchPosition(n,c,e?{...e,enableHighAccuracy:r}:{enableHighAccuracy:r})},{immediate:!r.value})),t.onUnmounted(v)}return{supported:n,refresh:s,error:o,timestamp:a,coords:u,highAccuracy:l}},e.useHydration=function(){return t.inject(Me,t.computed(()=>!1))},e.useI18n=function(e){return e?Ee(e):t.inject(we)},e.useIntersectionObserver=function(e,n){const r=b&&"IntersectionObserver"in window,u=e?a(e):void 0,l=!u||!f(u.value)&&u.value?void 0:u,s=t.computed(()=>n?o(n):l?void 0:o(e)),i=t.ref([]),c=t.computed(()=>i.value.length>0&&i.value.every(e=>e.isIntersecting)),v=e=>{i.value=e};let d=t.ref();r&&t.watch(s,e=>{d.value&&d.value.disconnect();const t=e&&e&&{root:o(e.root),rootMargin:o(e.rootMargin),threshold:o(e.threshold)}||void 0;d.value=new IntersectionObserver(v,t);i.value.map(e=>e.target).forEach(d.value.observe)},{deep:!0,immediate:!0});const m=r?e=>{const t=o(e);d.value.observe(t)}:p,h=r?e=>{const t=o(e);d.value.unobserve(t)}:p,g=()=>d.value.disconnect();return l&&(t.onMounted(()=>{l.value&&m(l)}),t.onUnmounted(()=>{g()})),{supported:r,elements:i,observe:m,unobserve:h,disconnect:g,isIntersecting:c}},e.useIntlDateTimeFormat=function(e,n){const[r,a]=K(e,n),u=t.computed(()=>new Intl.DateTimeFormat(o(r),o(a))),l=(e,t,n)=>{const l=t||n?new Intl.DateTimeFormat(o(n)||o(r),{...o(a),...o(t)}):u.value,i=o(e);return l.format(s(i)?new Date(i):i)};return{format:(e,n,r)=>t.computed(()=>l(e,n,r)),formatString:l,formatter:u}},e.useIntlNumberFormat=q,e.useLanguage=function(){if(D||(D=b?t.ref(navigator.language):t.ref("")),!A)if(b){A=t.ref(navigator.languages);const e=()=>{D.value=navigator.language,A.value=navigator.languages};window.addEventListener("languagechange",e,g)}else A=t.ref([]);return{language:D,languages:A}},e.useLocalStorage=ie,e.useMatchMedia=B,e.useNetworkInformation=function(){const e=!!b&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection),n=!!e,r=t.ref(0),o=t.ref(0),a=t.ref("none"),u=t.ref(0),l=t.ref(!1),s=t.ref("none");let i=p,c=p;return e&&(i=()=>{r.value=e.downlink,o.value=e.downlinkMax,a.value=e.effectiveType,u.value=e.rtt,l.value=e.saveData,s.value=e.type},c=S(e,"change",i,g),i()),{supported:n,downlink:r,downlinkMax:o,effectiveType:a,rtt:u,saveData:l,type:s,remove:c}},e.useNow=fe,e.useOnMouseMove=function(e,n,r){const o=t.ref(0),a=t.ref(0);let u=e=>{o.value=e.x,a.value=e.y};const[l,s]=v(n)?[void 0,n]:[n,r];s&&(u=M(u,r));const i=S(e,"mousemove",u,l);return{mouseX:o,mouseY:a,remove:i}},e.useOnResize=function(e,n,r){const o=a(e),u=t.ref(o.value&&o.value.clientHeight),l=t.ref(o.value&&o.value.clientWidth);let s=()=>{u.value=o.value.clientHeight,l.value=o.value.clientWidth};const[i,c]=v(n)?[void 0,n]:[n,r];c&&(s=M(s,r));const d=b?S(window,"resize",s,i||g):p;return t.isRef(e)&&!e.value&&t.onMounted(s),{height:u,width:l,remove:d}},e.useOnScroll=function(e,n,r){const o=e=>!(v(e)||i(e)||!f(e)&&!t.isRef(e)||!e),u=o(e)?a(e):t.ref(b&&window||void 0),l=o(e)?u:t.ref(b&&window.document.scrollingElement||void 0),s=t.ref(l.value&&l.value.scrollTop||0),c=t.ref(l.value&&l.value.scrollLeft||0);let d=()=>{s.value=l.value.scrollTop,c.value=l.value.scrollLeft};const m=(...e)=>l.value&&l.value.scrollTo&&l.value.scrollTo.apply(l.value,e),p=e=>m({top:e}),h=e=>m({left:e}),[y,w]=v(e)||!e?[g,e]:v(n)?[g,n]:[n,r];w&&(d=M(d,r));const E=S(u,"scroll",d,y),$=t.watch(s,p,{immediate:!1}),I=t.watch(c,h,{immediate:!1});return{scrollTop:s,scrollLeft:c,scrollTo:m,remove:()=>{E(),I(),$()},scrollTopTo:p,scrollLeftTo:h}},e.useOnline=function(){const e=b&&"onLine"in navigator;return e||(T=t.ref(!1)),T||(T=t.ref(navigator.onLine),window.addEventListener("offline",()=>T.value=!1,g),window.addEventListener("online",()=>T.value=!0,g)),{supported:e,online:T}},e.usePageVisibility=function(){return C||(C=t.ref(b&&document.hidden)),j||(b?(j=t.ref(document.visibilityState),document.addEventListener("visibilitychange",()=>{j.value=document.visibilityState,C.value=document.hidden},g)):j=t.ref("visible")),{visibility:j,hidden:C}},e.usePagination=de,e.usePath=pe,e.usePerformanceNow=function(e){return fe({refreshMs:e&&e.refreshMs||1e3,sync:!e||!i(e.sync)||e.sync,timeFn:()=>performance.now()})},e.usePromise=I,e.usePromiseLazy=function(e,t=!1){return I(e,{lazy:!0,throwException:t})},e.useRetry=function(e,n){const r=!e||l(e)?{}:e,o=l(e)?e:n;if(!l(e)&&!d(e))throw new Error("[useRetry] options needs to be 'object'");if(o&&!l(o))throw new Error("[useRetry] factory needs to be 'function'");const a=t.ref(!1),u=t.ref(),s=t.ref([]),i={value:!1},c={isRetrying:a,retryCount:t.computed(()=>s.value.length),nextRetry:u,retryErrors:s,[k]:{value:0},[L]:i},v=o?(...e)=>(++c[k].value,R(r,c,o,e)):e=>(++c[k].value,R(r,c,e,void 0));return{...c,cancel:()=>{c.isRetrying.value=!1,c.retryErrors.value.push(new Error("[useRetry] cancelled")),c.nextRetry.value=void 0,i.value=!0},exec:v}},e.useSSRTitle=function(e){const n=Symbol(),r=t.inject(Se,n);return r===n||void 0===r?t.ref(s(e)?e:""):(s(e)&&(r.value=e),r)},e.useSessionStorage=ce,e.useShare=function(e){const n=b&&"share"in navigator;let r=()=>Promise.resolve(!1),o=h,a=t.ref(!1),u=t.ref(!1);return n&&(r=e=>(a.value=!1,u.value=!1,navigator.share(e).then(e=>(a.value=!0,e)).catch(e=>(a.value=!1,u.value=!0,!1))),o=e=>navigator.canShare(e),e&&o(e)&&r(e)),{supported:n,share:r,canShare:o,shared:a,cancelled:u}},e.useSharedRef=H,e.useStorage=function(e,t,n){return void 0===ve&&(ve=se("localStorage").supported),ve?ie(e,t,n):ce(e,t)},e.useTitle=function(e=null){const n=t.ref(s(e)?e:document.title),r=new MutationObserver(e=>{n.value=e[0].target.textContent});t.watch(n,(e,t)=>{s(e)&&e!==t&&(document.title=e)},{immediate:!0,flush:"sync"});const o=document.querySelector("title");return r.observe(o,{childList:!0}),t.onUnmounted(()=>r.disconnect()),n},e.useUndo=function(e,n){const r=a(e),o=t.ref([]),u=t.ref(0),l=n&&n.maxLength||2**32-2,s=n&&n.clone||(e=>e);t.watch(r,e=>{if(o.value[u.value]!==e){if(u.value>0){const e=u.value;o.value.splice(0,e),u.value=0}o.value.length>l&&o.value.pop(),o.value.unshift(s(e))}},{...n,immediate:!0,flush:"sync"});const i=e=>{const t=Math.sign(e)<=0?Math.max(e,-v.value.length):Math.min(e,c.value.length);u.value+=t,r.value=o.value[u.value]},c=t.computed(()=>{const e=0===u.value?1:u.value;return o.value.slice(e)}),v=t.computed(()=>{const e=0===u.value?1:0;return o.value.slice(e,u.value)});return{value:r,undo:(e=1)=>i(e),redo:(e=1)=>i(-e),jump:i,prev:c,next:v}},e.useVModel=function(e,t){console.warn("[useVModel] is not supported on @vue/composition-api.")},e.useValidation=function(e){const n=[],r=ye({input:e},n),o=t.reactive(r.input);return n.forEach(e=>e(o)),o},e.useWebSocket=function(e,n){const r=b&&"WebSocket"in window;let o=null;const a=t.ref(null),u=t.ref(null),l=t.ref(null),s=t.ref(!1),i=t.ref(!1),c=t.ref(!1);let v=p,d=p;return r&&(o=new WebSocket(e,n),o.addEventListener("message",e=>{a.value=e,l.value=e.data}),o.addEventListener("error",e=>{u.value=e,c.value=!0}),o.addEventListener("close",()=>{s.value=!1,i.value=!0}),o.addEventListener("open",()=>{s.value=!0,i.value=!1}),v=e=>o.send(e),d=(e,t)=>{o.close(e,t)}),{supported:r,ws:o,send:v,close:d,messageEvent:a,errorEvent:u,data:l,isOpen:s,isClosed:i,errored:c}},e.useWebStorage=se,e.useWorker=function(e,n,r){const o=b&&"Worker"in self,a=t.ref(),u=t.ref(),l=t.ref(!o),s=t.ref(!o);if(!o)return l.value=!0,{worker:void 0,data:u,postMessage:p,terminate:p,errorEvent:a,errored:s,terminated:l};const i=new Worker(e,r),c=e=>i.postMessage(e);function v(){i.terminate(),l.value=!0}return i.addEventListener("message",e=>{u.value=e.data},g),i.addEventListener("error",e=>{a.value=e,s.value=!0},g),t.onUnmounted(v),n&&c(n),{worker:i,data:u,postMessage:c,terminate:v,errorEvent:a,errored:s,terminated:l}},e.useWorkerFunction=function(e,n){const r=b&&"Worker"in self,a=t.computed(()=>n&&o(n.dependencies)||[]),u=t.computed(()=>n&&o(n.timeout));if(!r)return x(e,{lazy:!0,throwException:!0});const l=x((...n)=>new Promise((r,o)=>{const s=function(e,t){const n=[t.length>0?`importScripts("${t.join('","')}");`:"","onmessage=",`(${N.toString()})(${e.toString()})`],r=new Blob(n,{type:"text/javascript"});return URL.createObjectURL(r)}(e,a.value),i=new Worker(s);let c=-1;const v=u.value,d=()=>{i.terminate(),URL.revokeObjectURL(s),clearTimeout(c),m()},f=n.length===e.length+1&&t.isRef(n[n.length-1])&&!1===n[n.length-1].value?t.computed(()=>l.cancelled.value||n[n.length-1].value):l.cancelled,m=f?t.watch(f,()=>{d(),r(void 0)},{immediate:!1}):p;i.addEventListener("message",e=>{e.data[0]?r(e.data[1]):o(e.data[1]),d()},g),i.addEventListener("error",e=>{d(),o(e)},g),i.postMessage([...n]),v&&(c=setTimeout(()=>{l.cancel(`[WebWorker] timeout after ${v}ms`)},v))}),{lazy:!0,throwException:!0});return l},e.wrap=a,e}({},vueCompositionApi,Vue); |
{ | ||
"name": "vue-composable", | ||
"version": "1.0.0-dev.36", | ||
"version": "1.0.0-dev.37", | ||
"description": "vue-composable", | ||
@@ -40,11 +40,12 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"@vue/runtime-core": "^3.0.0-beta.14" | ||
"@vue/composition-api": "^1.0.0-beta.2", | ||
"vue": "^2.6.10" | ||
}, | ||
"peerDependencies3": { | ||
"@vue/runtime-core": "^3.0.0-beta.14" | ||
"@vue/runtime-core": "^3.0.0-beta.24" | ||
}, | ||
"peerDependencies2": { | ||
"@vue/composition-api": "^0.6.2", | ||
"@vue/composition-api": "^1.0.0-beta.2", | ||
"vue": "^2.6.10" | ||
} | ||
} |
@@ -104,2 +104,3 @@ # vue-composable | ||
- [dateTimeFormat](https://pikax.me/vue-composable/composable/Intl/dateTimeFormat) - Intl.DateTimeFormat | ||
- [numberFormat](https://pikax.me/vue-composable/composable/Intl/numberFormat) - Intl.NumberFormat | ||
@@ -158,4 +159,2 @@ - [currencyFormat](https://pikax.me/vue-composable/composable/Intl/currencyFormat) - CurrencyFormat with Intl.NumberFormat | ||
> I really need an logo for this project, if you have a good idea for a logo, please enter in contact with me, you can find me on the `Vue discord : @pikax | ||
Twitter: [@pikax_dev](https://twitter.com/pikax_dev) | ||
@@ -162,0 +161,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
480041
12517
2
4175
196