@volverjs/ui-vue 0.0.13-beta.2 → 0.0.13-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{unref as e,computed as t,defineComponent as r,ref as a,watch as l,nextTick as o,createBlock as n,openBlock as i,resolveDynamicComponent as s,withCtx as u,createCommentVNode as c,createElementBlock as p,mergeProps as m,Fragment as f,renderList as d,renderSlot as v}from"vue";import{useVirtualizer as g}from"@tanstack/vue-virtual";function y(e){if(void 0!==e)return"number"==typeof e?e:Number.parseInt(e.replace("px",""),10)}function z(e){return{width:`${e}px`}}function S(e){return{height:`${e}px`}}const h=/* @__PURE__ */r({__name:"VvVirtualScroll",props:{items:{},estimateSize:{},wrapperTag:{default:"ul"},itemTag:{default:"li"},itemProps:{},startSpacerProps:{},endSpacerProps:{},startSpacerTag:{},endSpacerTag:{},overscan:{default:10},getItemKey:{type:Function,default:e=>e},horizontal:{type:Boolean,default:!1},focusable:{type:Boolean,default:!0}},setup(r,{expose:h}){const T=r,I=a(null),x=t(()=>"string"==typeof T.wrapperTag&&["ul","ol","menu"].includes(T.wrapperTag)?void 0:"list"),w=t(()=>"string"==typeof T.itemTag&&"li"===T.itemTag?void 0:"listitem"),{virtualizer:P,virtualItems:_,startSpacer:b,endSpacer:k}=function(r){const a=g({get count(){return e(r.count)},getScrollElement:()=>e(r.scrollEl),getItemKey:r.getItemKey,estimateSize:t=>{const a=e(r.estimateSize);return"function"==typeof a?a(t):y(a)},overscan:y(e(r.overscan)),horizontal:e(r.horizontal)}),l=t(()=>a.value.getVirtualItems()),o=t(()=>l.value.length),n=t(()=>l.value[0]),i=t(()=>l.value[o.value-1]),s=t(()=>a.value.getTotalSize()??0),u=t(()=>{const t=n.value?.start??0;return{show:t>0,size:t,style:e(r.horizontal)?z(t):S(t)}}),c=t(()=>{const t=i.value?.end??0,a=s.value-t;return{show:a>0,size:a,style:e(r.horizontal)?z(a):S(a)}});return{virtualizer:a,virtualItems:l,virtualItemsLength:o,firstVirtualItem:n,lastVirtualItem:i,totalSize:s,startSpacer:u,endSpacer:c}}({scrollEl:I,count:t(()=>T.items.length),estimateSize:t(()=>T.estimateSize),getItemKey:T.getItemKey,overscan:t(()=>T.overscan),horizontal:t(()=>T.horizontal)});function E(e){return T.items[e]}function K(e,t){P.value?.scrollToIndex(e,t)}function V(e,t){P.value?.scrollToOffset(e,t)}return l([()=>T.items.length,()=>T.estimateSize,()=>T.horizontal,()=>T.overscan],()=>{o(()=>P.value?.measure())}),h({virtualizer:P,getElementAtIndex:E,scrollToIndex:K,scrollToOffset:V,measure:()=>P.value?.measure()}),(t,a)=>(i(),n(s(r.wrapperTag),{ref_key:"scrollEl",ref:I,tabindex:r.focusable?0:void 0,role:e(x)},{default:u(()=>[e(b).show?(i(),n(s(r.startSpacerTag||r.itemTag),m({key:0},r.startSpacerProps,{style:e(b).style,"aria-hidden":"true",role:"presentation"}),null,16,["style"])):c("v-if",!0),(i(!0),p(f,null,d(e(_),({index:a,start:l,end:o,key:c},p)=>(i(),n(s(r.itemTag),m({key:c},{ref_for:!0},"function"==typeof r.itemProps?r.itemProps(a):r.itemProps,{role:e(w)}),{default:u(()=>[v(t.$slots,"default",m({ref_for:!0},{item:E(a),start:l,end:o,index:a,virtualIndex:p,scrollToIndex:K,scrollToOffset:V,virtualizer:e(P)}))]),_:2},1040,["role"]))),128)),e(k).show?(i(),n(s(r.endSpacerTag||r.itemTag),m({key:1},r.endSpacerProps,{style:e(k).style,"aria-hidden":"true",role:"presentation"}),null,16,["style"])):c("v-if",!0)]),_:3},8,["tabindex","role"]))}});export{h as default};
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@tanstack/vue-virtual")):"function"==typeof define&&define.amd?define(["vue","@tanstack/vue-virtual"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvVirtualScroll=t(e.vue,e.vueVirtual)}(this,function(e,t){"use strict";function r(e){if(void 0!==e)return"number"==typeof e?e:Number.parseInt(e.replace("px",""),10)}function o(e){return{width:`${e}px`}}function n(e){return{height:`${e}px`}}return e.defineComponent({__name:"VvVirtualScroll",props:{items:{},estimateSize:{},wrapperTag:{default:"ul"},itemTag:{default:"li"},itemProps:{},startSpacerProps:{},endSpacerProps:{},startSpacerTag:{},endSpacerTag:{},overscan:{default:10},getItemKey:{type:Function,default:e=>e},horizontal:{type:Boolean,default:!1},focusable:{type:Boolean,default:!0}},setup(l,{expose:a}){const u=l,i=e.ref(null),s=e.computed(()=>"string"==typeof u.wrapperTag&&["ul","ol","menu"].includes(u.wrapperTag)?void 0:"list"),c=e.computed(()=>"string"==typeof u.itemTag&&"li"===u.itemTag?void 0:"listitem"),{virtualizer:p,virtualItems:m,startSpacer:f,endSpacer:d}=function(l){const a=t.useVirtualizer({get count(){return e.unref(l.count)},getScrollElement:()=>e.unref(l.scrollEl),getItemKey:l.getItemKey,estimateSize:t=>{const o=e.unref(l.estimateSize);return"function"==typeof o?o(t):r(o)},overscan:r(e.unref(l.overscan)),horizontal:e.unref(l.horizontal)}),u=e.computed(()=>a.value.getVirtualItems()),i=e.computed(()=>u.value.length),s=e.computed(()=>u.value[0]),c=e.computed(()=>u.value[i.value-1]),p=e.computed(()=>a.value.getTotalSize()??0),m=e.computed(()=>{const t=s.value?.start??0;return{show:t>0,size:t,style:e.unref(l.horizontal)?o(t):n(t)}}),f=e.computed(()=>{const t=c.value?.end??0,r=p.value-t;return{show:r>0,size:r,style:e.unref(l.horizontal)?o(r):n(r)}});return{virtualizer:a,virtualItems:u,virtualItemsLength:i,firstVirtualItem:s,lastVirtualItem:c,totalSize:p,startSpacer:m,endSpacer:f}}({scrollEl:i,count:e.computed(()=>u.items.length),estimateSize:e.computed(()=>u.estimateSize),getItemKey:u.getItemKey,overscan:e.computed(()=>u.overscan),horizontal:e.computed(()=>u.horizontal)});function v(e){return u.items[e]}function g(e,t){p.value?.scrollToIndex(e,t)}function y(e,t){p.value?.scrollToOffset(e,t)}return e.watch([()=>u.items.length,()=>u.estimateSize,()=>u.horizontal,()=>u.overscan],()=>{e.nextTick(()=>p.value?.measure())}),a({virtualizer:p,getElementAtIndex:v,scrollToIndex:g,scrollToOffset:y,measure:()=>p.value?.measure()}),(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.wrapperTag),{ref_key:"scrollEl",ref:i,tabindex:l.focusable?0:void 0,role:e.unref(s)},{default:e.withCtx(()=>[e.unref(f).show?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.startSpacerTag||l.itemTag),e.mergeProps({key:0},l.startSpacerProps,{style:e.unref(f).style,"aria-hidden":"true",role:"presentation"}),null,16,["style"])):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),({index:r,start:o,end:n,key:a},u)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.itemTag),e.mergeProps({key:a},{ref_for:!0},"function"==typeof l.itemProps?l.itemProps(r):l.itemProps,{role:e.unref(c)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",e.mergeProps({ref_for:!0},{item:v(r),start:o,end:n,index:r,virtualIndex:u,scrollToIndex:g,scrollToOffset:y,virtualizer:e.unref(p)}))]),_:2},1040,["role"]))),128)),e.unref(d).show?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.endSpacerTag||l.itemTag),e.mergeProps({key:1},l.endSpacerProps,{style:e.unref(d).style,"aria-hidden":"true",role:"presentation"}),null,16,["style"])):e.createCommentVNode("v-if",!0)]),_:3},8,["tabindex","role"]))}})});
@@ -0,0 +1,51 @@
1
+ import type { Component } from 'vue';
2
+ import type { ScrollToOptions } from '@/composables/useVirtualScroll';
3
+ declare const __VLS_export: <ListItem extends (Record<string | number | symbol, any> | string | number | symbol)>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
5
+ items: ListItem[];
6
+ estimateSize: string | number | ((index: number) => number);
7
+ wrapperTag?: string | Component;
8
+ itemTag?: string | Component;
9
+ itemProps?: Record<string, unknown> | ((index: number) => Record<string, unknown>);
10
+ startSpacerProps?: Record<string, unknown>;
11
+ endSpacerProps?: Record<string, unknown>;
12
+ startSpacerTag?: string | Component;
13
+ endSpacerTag?: string | Component;
14
+ overscan?: string | number;
15
+ getItemKey?: (index: number) => number | string;
16
+ horizontal?: boolean;
17
+ focusable?: boolean;
18
+ }> & (typeof globalThis extends {
19
+ __VLS_PROPS_FALLBACK: infer P;
20
+ } ? P : {});
21
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
22
+ virtualizer: globalThis.Ref<import("@tanstack/virtual-core").Virtualizer<HTMLElement, Element>, import("@tanstack/virtual-core").Virtualizer<HTMLElement, Element>>;
23
+ getElementAtIndex: (index: number) => ListItem;
24
+ scrollToIndex: (index: number, options?: ScrollToOptions) => void;
25
+ scrollToOffset: (offset: number, options?: ScrollToOptions) => void;
26
+ measure: () => void;
27
+ }>) => void;
28
+ attrs: any;
29
+ slots: {
30
+ default?: (props: {
31
+ item: ListItem;
32
+ start: number;
33
+ end: number;
34
+ index: number;
35
+ virtualIndex: number;
36
+ scrollToIndex: (index: number, options?: ScrollToOptions) => void;
37
+ scrollToOffset: (offset: number, options?: ScrollToOptions) => void;
38
+ virtualizer: import("@tanstack/virtual-core").Virtualizer<HTMLElement, Element>;
39
+ }) => any;
40
+ };
41
+ emit: {};
42
+ }>) => import("vue").VNode & {
43
+ __ctx?: Awaited<typeof __VLS_setup>;
44
+ };
45
+ declare const _default: typeof __VLS_export;
46
+ export default _default;
47
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
48
+ [K in keyof T]: T[K];
49
+ } : {
50
+ [K in keyof T as K]: T[K];
51
+ }) & {};
@@ -2,3 +2,4 @@ export { useAlert } from './alert/useAlert';
2
2
  export { useDropdownContextmenu } from './dropdown/useDropdownContextmenu';
3
3
  export { useDropdownVirtualElement } from './dropdown/useDropdownVirtualElement';
4
4
  export { useBlurhash } from './useBlurhash';
5
+ export { useVirtualScroll } from './useVirtualScroll';
@@ -1,2 +1,2 @@
1
- import{reactive as t,computed as e,unref as n,getCurrentInstance as r,onMounted as a,onUnmounted as o,ref as s}from"vue";import{wrap as i}from"comlink";import l from"pica";const c="default",u="information",h=/* @__PURE__ */new Map([["success","check-circle"],["info",u],["warning","warning"],["danger","error"]]),f=t(
2
- /* @__PURE__ */new Map([[c,/* @__PURE__ */new Map]]));function m(){const t=(t=c)=>e(()=>{const e=f.get(t);return e&&e instanceof Map?Array.from(e?.values()).sort((t,e)=>t.timestamp-e.timestamp):[]});return{groups:f,alerts:t(),addAlert:({id:t=crypto.randomUUID(),group:e=c,title:n,icon:r=u,content:a,footer:o,modifiers:s="info",dismissable:i=true,autoClose:l=1e4,timestamp:m=Date.now()}={})=>{f.has(e)||f.set(e,/* @__PURE__ */new Map);const p=f.get(e),g="string"==typeof s?s.split(" "):s;if(!r){const t=g.find(t=>h.has(t));t&&(r=h.get(t))}p?.set(t.toString(),{id:t,group:e,title:n,icon:r,content:a,footer:o,modifiers:s,dismissable:i,autoClose:l,timestamp:m})},removeAlert:(t,e=c)=>{const n=f.get(e);n?.delete(t.toString())},getAlerts:t}}function p(t,s){const{x:i,y:l,getBoundingClientRect:c,onScroll:u}=g(t),h=e=>{i.value=e.clientX,l.value=e.clientY,e.preventDefault(),t.value.show()},f=e(()=>n(s));return f&&r()&&(a(()=>{f.value?.addEventListener("contextmenu",h,!1)}),o(()=>{f.value?.removeEventListener("contextmenu",h)})),{x:i,y:l,getBoundingClientRect:c,onContextmenu:h,onScroll:u}}function g(t){const e=s(0),n=s(0),i=s();let l=0,c=0,u=0,h=0;const f=t=>{const r=t.target;l=r.scrollLeft-h,c=r.scrollTop-u,n.value=n.value-c,e.value=e.value-l,h=r.scrollLeft,u=r.scrollTop},m=()=>({width:0,height:0,x:e.value,y:n.value,top:n.value,left:e.value,right:e.value,bottom:n.value});return r()&&(a(()=>{t.value&&(t.value.init({getBoundingClientRect:m}),i.value=function(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}(t.value.$el),i.value&&i.value.addEventListener("scroll",f))}),o(()=>{i.value&&i.value.removeEventListener("scroll",f)})),{x:e,y:n,getBoundingClientRect:m,onScroll:f}}const d='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',v="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",d],{type:"text/javascript;charset=utf-8"});const w=i(new function(t){let e;try{if(e=v&&(self.URL||self.webkitURL).createObjectURL(v),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(d),{name:t?.name})}});function M(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=(...t)=>n(t),r.src=t})}function y(){return{encode:async function(t){const e=URL.createObjectURL(t),n=await M(e);if("width"in n&&"height"in n){const{width:t,height:e}=(r=n.width,a=n.height,o=32,r>a?{width:o,height:Math.round(o*(a/r))}:{width:Math.round(o*(r/a)),height:o}),s=await async function(t,e,n){const r=new l,a=document.createElement("canvas");a.width=e,a.height=n;const o=await r.resize(t,a);return o.getContext("2d")?.getImageData(0,0,e,n).data}(n,t,e);if(s)return w.encode(s,t,e,4,4)}var r,a,o},decode:w.decode,loadImage:M}}export{m as useAlert,y as useBlurhash,p as useDropdownContextmenu,g as useDropdownVirtualElement};
1
+ import{reactive as t,computed as e,unref as n,getCurrentInstance as r,onMounted as a,onUnmounted as o,ref as i}from"vue";import{wrap as s}from"comlink";import l from"pica";import{useVirtualizer as c}from"@tanstack/vue-virtual";const u="default",h="information",f=/* @__PURE__ */new Map([["success","check-circle"],["info",h],["warning","warning"],["danger","error"]]),m=t(
2
+ /* @__PURE__ */new Map([[u,/* @__PURE__ */new Map]]));function p(){const t=(t=u)=>e(()=>{const e=m.get(t);return e&&e instanceof Map?Array.from(e?.values()).sort((t,e)=>t.timestamp-e.timestamp):[]});return{groups:m,alerts:t(),addAlert:({id:t=crypto.randomUUID(),group:e=u,title:n,icon:r=h,content:a,footer:o,modifiers:i="info",dismissable:s=true,autoClose:l=1e4,timestamp:c=Date.now()}={})=>{m.has(e)||m.set(e,/* @__PURE__ */new Map);const p=m.get(e),g="string"==typeof i?i.split(" "):i;if(!r){const t=g.find(t=>f.has(t));t&&(r=f.get(t))}p?.set(t.toString(),{id:t,group:e,title:n,icon:r,content:a,footer:o,modifiers:i,dismissable:s,autoClose:l,timestamp:c})},removeAlert:(t,e=u)=>{const n=m.get(e);n?.delete(t.toString())},getAlerts:t}}function g(t,i){const{x:s,y:l,getBoundingClientRect:c,onScroll:u}=d(t),h=e=>{s.value=e.clientX,l.value=e.clientY,e.preventDefault(),t.value.show()},f=e(()=>n(i));return f&&r()&&(a(()=>{f.value?.addEventListener("contextmenu",h,!1)}),o(()=>{f.value?.removeEventListener("contextmenu",h)})),{x:s,y:l,getBoundingClientRect:c,onContextmenu:h,onScroll:u}}function d(t){const e=i(0),n=i(0),s=i();let l=0,c=0,u=0,h=0;const f=t=>{const r=t.target;l=r.scrollLeft-h,c=r.scrollTop-u,n.value=n.value-c,e.value=e.value-l,h=r.scrollLeft,u=r.scrollTop},m=()=>({width:0,height:0,x:e.value,y:n.value,top:n.value,left:e.value,right:e.value,bottom:n.value});return r()&&(a(()=>{t.value&&(t.value.init({getBoundingClientRect:m}),s.value=function(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}(t.value.$el),s.value&&s.value.addEventListener("scroll",f))}),o(()=>{s.value&&s.value.removeEventListener("scroll",f)})),{x:e,y:n,getBoundingClientRect:m,onScroll:f}}const v='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',w="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",v],{type:"text/javascript;charset=utf-8"});const M=s(new function(t){let e;try{if(e=w&&(self.URL||self.webkitURL).createObjectURL(w),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(v),{name:t?.name})}});function y(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=(...t)=>n(t),r.src=t})}function b(){return{encode:async function(t){const e=URL.createObjectURL(t),n=await y(e);if("width"in n&&"height"in n){const{width:t,height:e}=(r=n.width,a=n.height,o=32,r>a?{width:o,height:Math.round(o*(a/r))}:{width:Math.round(o*(r/a)),height:o}),i=await async function(t,e,n){const r=new l,a=document.createElement("canvas");a.width=e,a.height=n;const o=await r.resize(t,a);return o.getContext("2d")?.getImageData(0,0,e,n).data}(n,t,e);if(i)return M.encode(i,t,e,4,4)}var r,a,o},decode:M.decode,loadImage:y}}function E(t){if(void 0!==t)return"number"==typeof t?t:Number.parseInt(t.replace("px",""),10)}function L(t){return{width:`${t}px`}}function x(t){return{height:`${t}px`}}function R(t){const r=c({get count(){return n(t.count)},getScrollElement:()=>n(t.scrollEl),getItemKey:t.getItemKey,estimateSize:e=>{const r=n(t.estimateSize);return"function"==typeof r?r(e):E(r)},overscan:E(n(t.overscan)),horizontal:n(t.horizontal)}),a=e(()=>r.value.getVirtualItems()),o=e(()=>a.value.length),i=e(()=>a.value[0]),s=e(()=>a.value[o.value-1]),l=e(()=>r.value.getTotalSize()??0),u=e(()=>{const e=i.value?.start??0;return{show:e>0,size:e,style:n(t.horizontal)?L(e):x(e)}}),h=e(()=>{const e=s.value?.end??0,r=l.value-e;return{show:r>0,size:r,style:n(t.horizontal)?L(r):x(r)}});return{virtualizer:r,virtualItems:a,virtualItemsLength:o,firstVirtualItem:i,lastVirtualItem:s,totalSize:l,startSpacer:u,endSpacer:h}}export{p as useAlert,b as useBlurhash,g as useDropdownContextmenu,d as useDropdownVirtualElement,R as useVirtualScroll};
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("comlink"),require("pica")):"function"==typeof define&&define.amd?define(["exports","vue","comlink","pica"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).composables={},t.vue,t.comlink,t.Pica)}(this,function(t,e,n,r){"use strict";const a="default",o="information",s=new Map([["success","check-circle"],["info",o],["warning","warning"],["danger","error"]]),i=e.reactive(new Map([[a,new Map]]));function l(t){const n=e.ref(0),r=e.ref(0),a=e.ref();let o=0,s=0,i=0,l=0;const c=t=>{const e=t.target;o=e.scrollLeft-l,s=e.scrollTop-i,r.value=r.value-s,n.value=n.value-o,l=e.scrollLeft,i=e.scrollTop},u=()=>({width:0,height:0,x:n.value,y:r.value,top:r.value,left:n.value,right:n.value,bottom:r.value});return e.getCurrentInstance()&&(e.onMounted(()=>{t.value&&(t.value.init({getBoundingClientRect:u}),a.value=function(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}(t.value.$el),a.value&&a.value.addEventListener("scroll",c))}),e.onUnmounted(()=>{a.value&&a.value.removeEventListener("scroll",c)})),{x:n,y:r,getBoundingClientRect:u,onScroll:c}}const c='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',u="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",c],{type:"text/javascript;charset=utf-8"});const h=n.wrap(new function(t){let e;try{if(e=u&&(self.URL||self.webkitURL).createObjectURL(u),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(c),{name:t?.name})}});function f(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=(...t)=>n(t),r.src=t})}t.useAlert=function(){const t=(t=a)=>e.computed(()=>{const e=i.get(t);return e&&e instanceof Map?Array.from(e?.values()).sort((t,e)=>t.timestamp-e.timestamp):[]});return{groups:i,alerts:t(),addAlert:({id:t=crypto.randomUUID(),group:e=a,title:n,icon:r=o,content:l,footer:c,modifiers:u="info",dismissable:h=true,autoClose:f=1e4,timestamp:m=Date.now()}={})=>{i.has(e)||i.set(e,new Map);const d=i.get(e),p="string"==typeof u?u.split(" "):u;if(!r){const t=p.find(t=>s.has(t));t&&(r=s.get(t))}d?.set(t.toString(),{id:t,group:e,title:n,icon:r,content:l,footer:c,modifiers:u,dismissable:h,autoClose:f,timestamp:m})},removeAlert:(t,e=a)=>{const n=i.get(e);n?.delete(t.toString())},getAlerts:t}},t.useBlurhash=function(){return{encode:async function(t){const e=URL.createObjectURL(t),n=await f(e);if("width"in n&&"height"in n){const{width:t,height:e}=(a=n.width,o=n.height,s=32,a>o?{width:s,height:Math.round(s*(o/a))}:{width:Math.round(s*(a/o)),height:s}),i=await async function(t,e,n){const a=new r,o=document.createElement("canvas");o.width=e,o.height=n;const s=await a.resize(t,o);return s.getContext("2d")?.getImageData(0,0,e,n).data}(n,t,e);if(i)return h.encode(i,t,e,4,4)}var a,o,s},decode:h.decode,loadImage:f}},t.useDropdownContextmenu=function(t,n){const{x:r,y:a,getBoundingClientRect:o,onScroll:s}=l(t),i=e=>{r.value=e.clientX,a.value=e.clientY,e.preventDefault(),t.value.show()},c=e.computed(()=>e.unref(n));return c&&e.getCurrentInstance()&&(e.onMounted(()=>{c.value?.addEventListener("contextmenu",i,!1)}),e.onUnmounted(()=>{c.value?.removeEventListener("contextmenu",i)})),{x:r,y:a,getBoundingClientRect:o,onContextmenu:i,onScroll:s}},t.useDropdownVirtualElement=l,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("comlink"),require("pica"),require("@tanstack/vue-virtual")):"function"==typeof define&&define.amd?define(["exports","vue","comlink","pica","@tanstack/vue-virtual"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).composables={},t.vue,t.comlink,t.Pica,t.vueVirtual)}(this,function(t,e,n,r,a){"use strict";const o="default",i="information",s=new Map([["success","check-circle"],["info",i],["warning","warning"],["danger","error"]]),l=e.reactive(new Map([[o,new Map]]));function u(t){const n=e.ref(0),r=e.ref(0),a=e.ref();let o=0,i=0,s=0,l=0;const u=t=>{const e=t.target;o=e.scrollLeft-l,i=e.scrollTop-s,r.value=r.value-i,n.value=n.value-o,l=e.scrollLeft,s=e.scrollTop},c=()=>({width:0,height:0,x:n.value,y:r.value,top:r.value,left:n.value,right:n.value,bottom:r.value});return e.getCurrentInstance()&&(e.onMounted(()=>{t.value&&(t.value.init({getBoundingClientRect:c}),a.value=function(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}(t.value.$el),a.value&&a.value.addEventListener("scroll",u))}),e.onUnmounted(()=>{a.value&&a.value.removeEventListener("scroll",u)})),{x:n,y:r,getBoundingClientRect:c,onScroll:u}}const c='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',h="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",c],{type:"text/javascript;charset=utf-8"});const f=n.wrap(new function(t){let e;try{if(e=h&&(self.URL||self.webkitURL).createObjectURL(h),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(c),{name:t?.name})}});function m(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=(...t)=>n(t),r.src=t})}function p(t){if(void 0!==t)return"number"==typeof t?t:Number.parseInt(t.replace("px",""),10)}function d(t){return{width:`${t}px`}}function g(t){return{height:`${t}px`}}t.useAlert=function(){const t=(t=o)=>e.computed(()=>{const e=l.get(t);return e&&e instanceof Map?Array.from(e?.values()).sort((t,e)=>t.timestamp-e.timestamp):[]});return{groups:l,alerts:t(),addAlert:({id:t=crypto.randomUUID(),group:e=o,title:n,icon:r=i,content:a,footer:u,modifiers:c="info",dismissable:h=true,autoClose:f=1e4,timestamp:m=Date.now()}={})=>{l.has(e)||l.set(e,new Map);const p=l.get(e),d="string"==typeof c?c.split(" "):c;if(!r){const t=d.find(t=>s.has(t));t&&(r=s.get(t))}p?.set(t.toString(),{id:t,group:e,title:n,icon:r,content:a,footer:u,modifiers:c,dismissable:h,autoClose:f,timestamp:m})},removeAlert:(t,e=o)=>{const n=l.get(e);n?.delete(t.toString())},getAlerts:t}},t.useBlurhash=function(){return{encode:async function(t){const e=URL.createObjectURL(t),n=await m(e);if("width"in n&&"height"in n){const{width:t,height:e}=(a=n.width,o=n.height,i=32,a>o?{width:i,height:Math.round(i*(o/a))}:{width:Math.round(i*(a/o)),height:i}),s=await async function(t,e,n){const a=new r,o=document.createElement("canvas");o.width=e,o.height=n;const i=await a.resize(t,o);return i.getContext("2d")?.getImageData(0,0,e,n).data}(n,t,e);if(s)return f.encode(s,t,e,4,4)}var a,o,i},decode:f.decode,loadImage:m}},t.useDropdownContextmenu=function(t,n){const{x:r,y:a,getBoundingClientRect:o,onScroll:i}=u(t),s=e=>{r.value=e.clientX,a.value=e.clientY,e.preventDefault(),t.value.show()},l=e.computed(()=>e.unref(n));return l&&e.getCurrentInstance()&&(e.onMounted(()=>{l.value?.addEventListener("contextmenu",s,!1)}),e.onUnmounted(()=>{l.value?.removeEventListener("contextmenu",s)})),{x:r,y:a,getBoundingClientRect:o,onContextmenu:s,onScroll:i}},t.useDropdownVirtualElement=u,t.useVirtualScroll=function(t){const n=a.useVirtualizer({get count(){return e.unref(t.count)},getScrollElement:()=>e.unref(t.scrollEl),getItemKey:t.getItemKey,estimateSize:n=>{const r=e.unref(t.estimateSize);return"function"==typeof r?r(n):p(r)},overscan:p(e.unref(t.overscan)),horizontal:e.unref(t.horizontal)}),r=e.computed(()=>n.value.getVirtualItems()),o=e.computed(()=>r.value.length),i=e.computed(()=>r.value[0]),s=e.computed(()=>r.value[o.value-1]),l=e.computed(()=>n.value.getTotalSize()??0),u=e.computed(()=>{const n=i.value?.start??0;return{show:n>0,size:n,style:e.unref(t.horizontal)?d(n):g(n)}}),c=e.computed(()=>{const n=s.value?.end??0,r=l.value-n;return{show:r>0,size:r,style:e.unref(t.horizontal)?d(r):g(r)}});return{virtualizer:n,virtualItems:r,virtualItemsLength:o,firstVirtualItem:i,lastVirtualItem:s,totalSize:l,startSpacer:u,endSpacer:c}},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,35 @@
1
+ import type { Ref } from 'vue';
2
+ export type { ScrollToOptions } from '@tanstack/vue-virtual';
3
+ export declare function useVirtualScroll(settings: {
4
+ scrollEl: HTMLElement | null | Ref<HTMLElement | null>;
5
+ count: number | Ref<number>;
6
+ estimateSize: string | number | ((index: number) => number) | Ref<string | number | ((index: number) => number)>;
7
+ getItemKey?: (index: number) => number | string | bigint;
8
+ overscan?: string | number | Ref<string | number>;
9
+ horizontal?: boolean | Ref<boolean>;
10
+ }): {
11
+ virtualizer: Ref<import("@tanstack/virtual-core").Virtualizer<HTMLElement, Element>, import("@tanstack/virtual-core").Virtualizer<HTMLElement, Element>>;
12
+ virtualItems: globalThis.ComputedRef<import("@tanstack/virtual-core").VirtualItem[]>;
13
+ virtualItemsLength: globalThis.ComputedRef<number>;
14
+ firstVirtualItem: globalThis.ComputedRef<import("@tanstack/virtual-core").VirtualItem>;
15
+ lastVirtualItem: globalThis.ComputedRef<import("@tanstack/virtual-core").VirtualItem>;
16
+ totalSize: globalThis.ComputedRef<number>;
17
+ startSpacer: globalThis.ComputedRef<{
18
+ show: boolean;
19
+ size: number;
20
+ style: {
21
+ width: string;
22
+ } | {
23
+ height: string;
24
+ };
25
+ }>;
26
+ endSpacer: globalThis.ComputedRef<{
27
+ show: boolean;
28
+ size: number;
29
+ style: {
30
+ width: string;
31
+ } | {
32
+ height: string;
33
+ };
34
+ }>;
35
+ };
@@ -1,2 +1,2 @@
1
- import{reactive as t,computed as e,unref as n,getCurrentInstance as r,onMounted as a,onUnmounted as o,ref as l,defineComponent as i,toRefs as s,createElementBlock as c,openBlock as u,normalizeClass as h,renderSlot as f,createTextVNode as m,toDisplayString as p,h as d,render as v}from"vue";import{wrap as g}from"comlink";import"pica";var b=/* @__PURE__ */(t=>(t.local="local",t.session="session",t))(b||{}),M=/* @__PURE__ */(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(M||{}),y=/* @__PURE__ */(t=>(t.before="before",t.after="after",t))(y||{}),w=/* @__PURE__ */(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(w||{}),E=/* @__PURE__ */(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(E||{});function L(t,i){const{x:s,y:c,getBoundingClientRect:u,onScroll:h}=function(t){const e=l(0),n=l(0),i=l();let s=0,c=0,u=0,h=0;const f=t=>{const r=t.target;s=r.scrollLeft-h,c=r.scrollTop-u,n.value=n.value-c,e.value=e.value-s,h=r.scrollLeft,u=r.scrollTop},m=()=>({width:0,height:0,x:e.value,y:n.value,top:n.value,left:e.value,right:e.value,bottom:n.value});r()&&(a(()=>{t.value&&(t.value.init({getBoundingClientRect:m}),i.value=x(t.value.$el),i.value&&i.value.addEventListener("scroll",f))}),o(()=>{i.value&&i.value.removeEventListener("scroll",f)}));return{x:e,y:n,getBoundingClientRect:m,onScroll:f}}(t),f=e=>{s.value=e.clientX,c.value=e.clientY,e.preventDefault(),t.value.show()},m=e(()=>n(i));return m&&r()&&(a(()=>{m.value?.addEventListener("contextmenu",f,!1)}),o(()=>{m.value?.removeEventListener("contextmenu",f)})),{x:s,y:c,getBoundingClientRect:u,onContextmenu:f,onScroll:h}}function x(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t(
2
- /* @__PURE__ */new Map([["default",/* @__PURE__ */new Map]]));const R='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',k="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",R],{type:"text/javascript;charset=utf-8"});g(new function(t){let e;try{if(e=k&&(self.URL||self.webkitURL).createObjectURL(k),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(R),{name:t?.name})}});const S={beforeUpdate(t,e){const{onContextmenu:n,onScroll:r,getBoundingClientRect:a}=L(e);e.value.init({getBoundingClientRect:a}),t.addEventListener("contextmenu",n,!1);const o=x(e.value.$el);o&&o.addEventListener("scroll",r),t.additionalData={onContextmenu:n,onScroll:r,scrollContainerEl:o}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}},C={modifiers:{type:[String,Array],default:void 0}};y.before,M.bottom,w.button,E.button,b.local;const O=/* @__PURE__ */i({name:"VvTooltip",props:{...C,position:{type:String,default:M.bottom},value:{type:String}},setup(t){const r=t,{modifiers:a}=s(r),o=function(t,r,a){return e(()=>{const e={[t]:!0},o="string"==typeof r?.value?r.value.split(" "):r?.value;return o&&Array.isArray(o)&&o.forEach(n=>{n&&(e[`${t}--${n}`]=!0)}),a&&Object.keys(a.value).forEach(r=>{e[`${t}--${r}`]=n(a.value[r])}),e})}("vv-tooltip",a,e(()=>({[r.position]:!0})));return(t,e)=>(u(),c("span",{class:h(n(o)),role:"tooltip",inert:""},[f(t.$slots,"default",{},()=>[m(p(t.value),1)])],2))}}),T=/* @__PURE__ */(()=>({beforeMount(t,e){const n=d(O,{value:e.value,position:e.arg});v(n,t)},updated(t,e){const n=d(O,{value:e.value,position:e.arg});v(n,t)}}))();export{S as vContextmenu,T as vTooltip};
1
+ import{reactive as t,computed as e,unref as n,getCurrentInstance as r,onMounted as a,onUnmounted as o,ref as l,defineComponent as i,toRefs as s,createElementBlock as c,openBlock as u,normalizeClass as h,renderSlot as f,createTextVNode as m,toDisplayString as p,h as d,render as v}from"vue";import{wrap as g}from"comlink";import"pica";import"@tanstack/vue-virtual";var b=/* @__PURE__ */(t=>(t.local="local",t.session="session",t))(b||{}),M=/* @__PURE__ */(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(M||{}),y=/* @__PURE__ */(t=>(t.before="before",t.after="after",t))(y||{}),w=/* @__PURE__ */(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(w||{}),E=/* @__PURE__ */(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(E||{});function L(t,i){const{x:s,y:c,getBoundingClientRect:u,onScroll:h}=function(t){const e=l(0),n=l(0),i=l();let s=0,c=0,u=0,h=0;const f=t=>{const r=t.target;s=r.scrollLeft-h,c=r.scrollTop-u,n.value=n.value-c,e.value=e.value-s,h=r.scrollLeft,u=r.scrollTop},m=()=>({width:0,height:0,x:e.value,y:n.value,top:n.value,left:e.value,right:e.value,bottom:n.value});r()&&(a(()=>{t.value&&(t.value.init({getBoundingClientRect:m}),i.value=x(t.value.$el),i.value&&i.value.addEventListener("scroll",f))}),o(()=>{i.value&&i.value.removeEventListener("scroll",f)}));return{x:e,y:n,getBoundingClientRect:m,onScroll:f}}(t),f=e=>{s.value=e.clientX,c.value=e.clientY,e.preventDefault(),t.value.show()},m=e(()=>n(i));return m&&r()&&(a(()=>{m.value?.addEventListener("contextmenu",f,!1)}),o(()=>{m.value?.removeEventListener("contextmenu",f)})),{x:s,y:c,getBoundingClientRect:u,onContextmenu:f,onScroll:h}}function x(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t(
2
+ /* @__PURE__ */new Map([["default",/* @__PURE__ */new Map]]));const k='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',R="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",k],{type:"text/javascript;charset=utf-8"});g(new function(t){let e;try{if(e=R&&(self.URL||self.webkitURL).createObjectURL(R),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(k),{name:t?.name})}});const S={beforeUpdate(t,e){const{onContextmenu:n,onScroll:r,getBoundingClientRect:a}=L(e);e.value.init({getBoundingClientRect:a}),t.addEventListener("contextmenu",n,!1);const o=x(e.value.$el);o&&o.addEventListener("scroll",r),t.additionalData={onContextmenu:n,onScroll:r,scrollContainerEl:o}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}},C={modifiers:{type:[String,Array],default:void 0}};y.before,M.bottom,w.button,E.button,b.local;const O=/* @__PURE__ */i({name:"VvTooltip",props:{...C,position:{type:String,default:M.bottom},value:{type:String}},setup(t){const r=t,{modifiers:a}=s(r),o=function(t,r,a){return e(()=>{const e={[t]:!0},o="string"==typeof r?.value?r.value.split(" "):r?.value;return o&&Array.isArray(o)&&o.forEach(n=>{n&&(e[`${t}--${n}`]=!0)}),a&&Object.keys(a.value).forEach(r=>{e[`${t}--${r}`]=n(a.value[r])}),e})}("vv-tooltip",a,e(()=>({[r.position]:!0})));return(t,e)=>(u(),c("span",{class:h(n(o)),role:"tooltip",inert:""},[f(t.$slots,"default",{},()=>[m(p(t.value),1)])],2))}}),T=/* @__PURE__ */(()=>({beforeMount(t,e){const n=d(O,{value:e.value,position:e.arg});v(n,t)},updated(t,e){const n=d(O,{value:e.value,position:e.arg});v(n,t)}}))();export{S as vContextmenu,T as vTooltip};
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("comlink"),require("pica")):"function"==typeof define&&define.amd?define(["exports","vue","comlink","pica"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).directives={},t.vue,t.comlink)}(this,function(t,e,n){"use strict";var r=(t=>(t.local="local",t.session="session",t))(r||{}),o=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(o||{}),a=(t=>(t.before="before",t.after="after",t))(a||{}),l=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(l||{}),i=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(i||{});function s(t,n){const{x:r,y:o,getBoundingClientRect:a,onScroll:l}=function(t){const n=e.ref(0),r=e.ref(0),o=e.ref();let a=0,l=0,i=0,s=0;const c=t=>{const e=t.target;a=e.scrollLeft-s,l=e.scrollTop-i,r.value=r.value-l,n.value=n.value-a,s=e.scrollLeft,i=e.scrollTop},f=()=>({width:0,height:0,x:n.value,y:r.value,top:r.value,left:n.value,right:n.value,bottom:r.value});e.getCurrentInstance()&&(e.onMounted(()=>{t.value&&(t.value.init({getBoundingClientRect:f}),o.value=u(t.value.$el),o.value&&o.value.addEventListener("scroll",c))}),e.onUnmounted(()=>{o.value&&o.value.removeEventListener("scroll",c)}));return{x:n,y:r,getBoundingClientRect:f,onScroll:c}}(t),i=e=>{r.value=e.clientX,o.value=e.clientY,e.preventDefault(),t.value.show()},s=e.computed(()=>e.unref(n));return s&&e.getCurrentInstance()&&(e.onMounted(()=>{s.value?.addEventListener("contextmenu",i,!1)}),e.onUnmounted(()=>{s.value?.removeEventListener("contextmenu",i)})),{x:r,y:o,getBoundingClientRect:a,onContextmenu:i,onScroll:l}}function u(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}e.reactive(new Map([["default",new Map]]));const c='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',f="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",c],{type:"text/javascript;charset=utf-8"});n.wrap(new function(t){let e;try{if(e=f&&(self.URL||self.webkitURL).createObjectURL(f),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(c),{name:t?.name})}});const h={beforeUpdate(t,e){const{onContextmenu:n,onScroll:r,getBoundingClientRect:o}=s(e);e.value.init({getBoundingClientRect:o}),t.addEventListener("contextmenu",n,!1);const a=u(e.value.$el);a&&a.addEventListener("scroll",r),t.additionalData={onContextmenu:n,onScroll:r,scrollContainerEl:a}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}},p={modifiers:{type:[String,Array],default:void 0}};a.before,o.bottom,l.button,i.button,r.local;const m={...p,position:{type:String,default:o.bottom},value:{type:String}};const d=e.defineComponent({name:"VvTooltip",props:m,setup(t){const n=t,{modifiers:r}=e.toRefs(n),o=function(t,n,r){return e.computed(()=>{const o={[t]:!0},a="string"==typeof n?.value?n.value.split(" "):n?.value;return a&&Array.isArray(a)&&a.forEach(e=>{e&&(o[`${t}--${e}`]=!0)}),r&&Object.keys(r.value).forEach(n=>{o[`${t}--${n}`]=e.unref(r.value[n])}),o})}("vv-tooltip",r,e.computed(()=>({[n.position]:!0})));return(t,n)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(o)),role:"tooltip",inert:""},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)])],2))}}),v=(()=>({beforeMount(t,n){const r=e.h(d,{value:n.value,position:n.arg});e.render(r,t)},updated(t,n){const r=e.h(d,{value:n.value,position:n.arg});e.render(r,t)}}))();t.vContextmenu=h,t.vTooltip=v,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("comlink"),require("pica"),require("@tanstack/vue-virtual")):"function"==typeof define&&define.amd?define(["exports","vue","comlink","pica","@tanstack/vue-virtual"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).directives={},t.vue,t.comlink)}(this,function(t,e,n){"use strict";var r=(t=>(t.local="local",t.session="session",t))(r||{}),o=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(o||{}),a=(t=>(t.before="before",t.after="after",t))(a||{}),l=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(l||{}),i=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(i||{});function s(t,n){const{x:r,y:o,getBoundingClientRect:a,onScroll:l}=function(t){const n=e.ref(0),r=e.ref(0),o=e.ref();let a=0,l=0,i=0,s=0;const c=t=>{const e=t.target;a=e.scrollLeft-s,l=e.scrollTop-i,r.value=r.value-l,n.value=n.value-a,s=e.scrollLeft,i=e.scrollTop},f=()=>({width:0,height:0,x:n.value,y:r.value,top:r.value,left:n.value,right:n.value,bottom:r.value});e.getCurrentInstance()&&(e.onMounted(()=>{t.value&&(t.value.init({getBoundingClientRect:f}),o.value=u(t.value.$el),o.value&&o.value.addEventListener("scroll",c))}),e.onUnmounted(()=>{o.value&&o.value.removeEventListener("scroll",c)}));return{x:n,y:r,getBoundingClientRect:f,onScroll:c}}(t),i=e=>{r.value=e.clientX,o.value=e.clientY,e.preventDefault(),t.value.show()},s=e.computed(()=>e.unref(n));return s&&e.getCurrentInstance()&&(e.onMounted(()=>{s.value?.addEventListener("contextmenu",i,!1)}),e.onUnmounted(()=>{s.value?.removeEventListener("contextmenu",i)})),{x:r,y:o,getBoundingClientRect:a,onContextmenu:i,onScroll:l}}function u(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}e.reactive(new Map([["default",new Map]]));const c='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',f="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",c],{type:"text/javascript;charset=utf-8"});n.wrap(new function(t){let e;try{if(e=f&&(self.URL||self.webkitURL).createObjectURL(f),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(c),{name:t?.name})}});const h={beforeUpdate(t,e){const{onContextmenu:n,onScroll:r,getBoundingClientRect:o}=s(e);e.value.init({getBoundingClientRect:o}),t.addEventListener("contextmenu",n,!1);const a=u(e.value.$el);a&&a.addEventListener("scroll",r),t.additionalData={onContextmenu:n,onScroll:r,scrollContainerEl:a}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}},p={modifiers:{type:[String,Array],default:void 0}};a.before,o.bottom,l.button,i.button,r.local;const m={...p,position:{type:String,default:o.bottom},value:{type:String}};const d=e.defineComponent({name:"VvTooltip",props:m,setup(t){const n=t,{modifiers:r}=e.toRefs(n),o=function(t,n,r){return e.computed(()=>{const o={[t]:!0},a="string"==typeof n?.value?n.value.split(" "):n?.value;return a&&Array.isArray(a)&&a.forEach(e=>{e&&(o[`${t}--${e}`]=!0)}),r&&Object.keys(r.value).forEach(n=>{o[`${t}--${n}`]=e.unref(r.value[n])}),o})}("vv-tooltip",r,e.computed(()=>({[n.position]:!0})));return(t,n)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(o)),role:"tooltip",inert:""},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)])],2))}}),v=(()=>({beforeMount(t,n){const r=e.h(d,{value:n.value,position:n.arg});e.render(r,t)},updated(t,n){const r=e.h(d,{value:n.value,position:n.arg});e.render(r,t)}}))();t.vContextmenu=h,t.vTooltip=v,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
@@ -1,2 +1,2 @@
1
- import{reactive as t,computed as e,unref as n,getCurrentInstance as r,onMounted as a,onUnmounted as o,ref as l}from"vue";import{wrap as i}from"comlink";import"pica";function s(t,i){const{x:s,y:u,getBoundingClientRect:h,onScroll:f}=function(t){const e=l(0),n=l(0),i=l();let s=0,u=0,h=0,f=0;const m=t=>{const r=t.target;s=r.scrollLeft-f,u=r.scrollTop-h,n.value=n.value-u,e.value=e.value-s,f=r.scrollLeft,h=r.scrollTop},p=()=>({width:0,height:0,x:e.value,y:n.value,top:n.value,left:e.value,right:e.value,bottom:n.value});r()&&(a(()=>{t.value&&(t.value.init({getBoundingClientRect:p}),i.value=c(t.value.$el),i.value&&i.value.addEventListener("scroll",m))}),o(()=>{i.value&&i.value.removeEventListener("scroll",m)}));return{x:e,y:n,getBoundingClientRect:p,onScroll:m}}(t),m=e=>{s.value=e.clientX,u.value=e.clientY,e.preventDefault(),t.value.show()},p=e(()=>n(i));return p&&r()&&(a(()=>{p.value?.addEventListener("contextmenu",m,!1)}),o(()=>{p.value?.removeEventListener("contextmenu",m)})),{x:s,y:u,getBoundingClientRect:h,onContextmenu:m,onScroll:f}}function c(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t(
1
+ import{reactive as t,computed as e,unref as n,getCurrentInstance as r,onMounted as a,onUnmounted as o,ref as l}from"vue";import{wrap as i}from"comlink";import"pica";import"@tanstack/vue-virtual";function s(t,i){const{x:s,y:u,getBoundingClientRect:h,onScroll:f}=function(t){const e=l(0),n=l(0),i=l();let s=0,u=0,h=0,f=0;const m=t=>{const r=t.target;s=r.scrollLeft-f,u=r.scrollTop-h,n.value=n.value-u,e.value=e.value-s,f=r.scrollLeft,h=r.scrollTop},p=()=>({width:0,height:0,x:e.value,y:n.value,top:n.value,left:e.value,right:e.value,bottom:n.value});r()&&(a(()=>{t.value&&(t.value.init({getBoundingClientRect:p}),i.value=c(t.value.$el),i.value&&i.value.addEventListener("scroll",m))}),o(()=>{i.value&&i.value.removeEventListener("scroll",m)}));return{x:e,y:n,getBoundingClientRect:p,onScroll:m}}(t),m=e=>{s.value=e.clientX,u.value=e.clientY,e.preventDefault(),t.value.show()},p=e(()=>n(i));return p&&r()&&(a(()=>{p.value?.addEventListener("contextmenu",m,!1)}),o(()=>{p.value?.removeEventListener("contextmenu",m)})),{x:s,y:u,getBoundingClientRect:h,onContextmenu:m,onScroll:f}}function c(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t(
2
2
  /* @__PURE__ */new Map([["default",/* @__PURE__ */new Map]]));const u='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',h="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",u],{type:"text/javascript;charset=utf-8"});i(new function(t){let e;try{if(e=h&&(self.URL||self.webkitURL).createObjectURL(h),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(u),{name:t?.name})}});const f={beforeUpdate(t,e){const{onContextmenu:n,onScroll:r,getBoundingClientRect:a}=s(e);e.value.init({getBoundingClientRect:a}),t.addEventListener("contextmenu",n,!1);const o=c(e.value.$el);o&&o.addEventListener("scroll",r),t.additionalData={onContextmenu:n,onScroll:r,scrollContainerEl:o}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}};export{f as default};
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue"),require("comlink"),require("pica")):"function"==typeof define&&define.amd?define(["vue","comlink","pica"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["v-contextmenu"]=e(t.vue,t.comlink)}(this,function(t,e){"use strict";function n(e,n){const{x:a,y:o,getBoundingClientRect:l,onScroll:i}=function(e){const n=t.ref(0),a=t.ref(0),o=t.ref();let l=0,i=0,s=0,c=0;const u=t=>{const e=t.target;l=e.scrollLeft-c,i=e.scrollTop-s,a.value=a.value-i,n.value=n.value-l,c=e.scrollLeft,s=e.scrollTop},h=()=>({width:0,height:0,x:n.value,y:a.value,top:a.value,left:n.value,right:n.value,bottom:a.value});t.getCurrentInstance()&&(t.onMounted(()=>{e.value&&(e.value.init({getBoundingClientRect:h}),o.value=r(e.value.$el),o.value&&o.value.addEventListener("scroll",u))}),t.onUnmounted(()=>{o.value&&o.value.removeEventListener("scroll",u)}));return{x:n,y:a,getBoundingClientRect:h,onScroll:u}}(e),s=t=>{a.value=t.clientX,o.value=t.clientY,t.preventDefault(),e.value.show()},c=t.computed(()=>t.unref(n));return c&&t.getCurrentInstance()&&(t.onMounted(()=>{c.value?.addEventListener("contextmenu",s,!1)}),t.onUnmounted(()=>{c.value?.removeEventListener("contextmenu",s)})),{x:a,y:o,getBoundingClientRect:l,onContextmenu:s,onScroll:i}}function r(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t.reactive(new Map([["default",new Map]]));const a='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',o="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",a],{type:"text/javascript;charset=utf-8"});e.wrap(new function(t){let e;try{if(e=o&&(self.URL||self.webkitURL).createObjectURL(o),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(a),{name:t?.name})}});return{beforeUpdate(t,e){const{onContextmenu:a,onScroll:o,getBoundingClientRect:l}=n(e);e.value.init({getBoundingClientRect:l}),t.addEventListener("contextmenu",a,!1);const i=r(e.value.$el);i&&i.addEventListener("scroll",o),t.additionalData={onContextmenu:a,onScroll:o,scrollContainerEl:i}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue"),require("comlink"),require("pica"),require("@tanstack/vue-virtual")):"function"==typeof define&&define.amd?define(["vue","comlink","pica","@tanstack/vue-virtual"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["v-contextmenu"]=e(t.vue,t.comlink)}(this,function(t,e){"use strict";function n(e,n){const{x:a,y:o,getBoundingClientRect:l,onScroll:i}=function(e){const n=t.ref(0),a=t.ref(0),o=t.ref();let l=0,i=0,s=0,c=0;const u=t=>{const e=t.target;l=e.scrollLeft-c,i=e.scrollTop-s,a.value=a.value-i,n.value=n.value-l,c=e.scrollLeft,s=e.scrollTop},h=()=>({width:0,height:0,x:n.value,y:a.value,top:a.value,left:n.value,right:n.value,bottom:a.value});t.getCurrentInstance()&&(t.onMounted(()=>{e.value&&(e.value.init({getBoundingClientRect:h}),o.value=r(e.value.$el),o.value&&o.value.addEventListener("scroll",u))}),t.onUnmounted(()=>{o.value&&o.value.removeEventListener("scroll",u)}));return{x:n,y:a,getBoundingClientRect:h,onScroll:u}}(e),s=t=>{a.value=t.clientX,o.value=t.clientY,t.preventDefault(),e.value.show()},c=t.computed(()=>t.unref(n));return c&&t.getCurrentInstance()&&(t.onMounted(()=>{c.value?.addEventListener("contextmenu",s,!1)}),t.onUnmounted(()=>{c.value?.removeEventListener("contextmenu",s)})),{x:a,y:o,getBoundingClientRect:l,onContextmenu:s,onScroll:i}}function r(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t.reactive(new Map([["default",new Map]]));const a='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',o="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",a],{type:"text/javascript;charset=utf-8"});e.wrap(new function(t){let e;try{if(e=o&&(self.URL||self.webkitURL).createObjectURL(o),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(a),{name:t?.name})}});return{beforeUpdate(t,e){const{onContextmenu:a,onScroll:o,getBoundingClientRect:l}=n(e);e.value.init({getBoundingClientRect:l}),t.addEventListener("contextmenu",a,!1);const i=r(e.value.$el);i&&i.addEventListener("scroll",o),t.additionalData={onContextmenu:a,onScroll:o,scrollContainerEl:i}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}}});