@qratilabs/qrati-connect 2.25.0 → 2.27.0
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.
- package/element/1dmOpMwn2.js +1 -0
- package/element/1eQ9Ef0M2.js +9 -0
- package/element/B0sEsGHn.js +8 -0
- package/element/B9ImRAum.js +1 -0
- package/element/{DGbyGc8b.js → BKENYwOQ.js} +1 -1
- package/element/BLeZg2Bz.js +1 -0
- package/element/BNaRcekR2.js +1 -0
- package/element/{qQ9Xx6H32.js → BdkTKcG52.js} +8 -8
- package/element/BmsDSHUi.js +4 -0
- package/element/Bo39kG4k2.js +1 -0
- package/element/{CsfDBJh72.js → BqiJLitq2.js} +2 -2
- package/element/BspExsK7.js +8 -0
- package/element/Bspyv2wJ2.js +24 -0
- package/element/BwwxqSTC2.js +1 -0
- package/element/C4DSwLWc.js +5 -0
- package/element/C6MqLLDX.js +3 -0
- package/element/C6YE4WUG2.js +5 -0
- package/element/{CgUphJWo.js → C7zv6hcG.js} +1 -1
- package/element/{C12iSy3L.js → C8meSsHD.js} +1 -1
- package/element/CBLQRRGX2.js +3 -0
- package/element/CBM5QMn8.js +1 -0
- package/element/CKQOToSD.js +41 -0
- package/element/CUBxHQ8u.js +1 -0
- package/element/CeHBrY_i.js +1 -0
- package/element/CfTdZB8y.js +4 -0
- package/element/CgxypkdG.js +3 -0
- package/element/{iuooW4mt.js → Cl0CwL5p.js} +8 -8
- package/element/{mQzpzQ_t.js → CpYO5bBq.js} +1 -1
- package/element/CtxIOzTC2.js +1 -0
- package/element/DGZEznLT2.js +1 -0
- package/element/DLF5ysgi.js +1 -0
- package/element/{CVRTTCyF.js → DOOdI-Oh.js} +1 -1
- package/element/{Z0-Tddye2.js → DRPgs6nu2.js} +9 -9
- package/element/DSx5wvUb2.js +1 -0
- package/element/{iknPnbyg2.js → DVFC5Z2L2.js} +28 -28
- package/element/{DlqJDAie2.js → DWqIpaZ02.js} +1 -1
- package/element/{CJXPO3HP.js → DZGp2V2-.js} +1 -1
- package/element/{Ctl9NdWl2.js → D_FNRN5A2.js} +1 -1
- package/element/DdACKOZr.js +1 -0
- package/element/{ChJXhA9c.js → DdYePHxG.js} +1 -1
- package/element/{C9T-_wQ82.js → DlAI3J0X.js} +4 -4
- package/element/{CATr-3VW.js → DmIYOIw1.js} +1 -1
- package/element/DmpmrPE5.js +1 -0
- package/element/DvisvxzJ.js +1 -0
- package/element/{C3dOFk9A.js → DyemeRjE2.js} +1 -1
- package/element/L4hWU3Nc.js +1 -0
- package/element/MU5QuIq0.js +3 -0
- package/element/{BCTYvPrD.js → OnH8Izqn.js} +1 -1
- package/element/Ot24jlyb2.js +1 -0
- package/element/{DnQ6XaLR.js → QDuBhueG.js} +1 -1
- package/element/SgRzjPnr.js +14 -0
- package/element/{DZtaQWVG2.js → Vk429P022.js} +1 -1
- package/element/{2CMH9VMM.js → X0P7ujR0.js} +1 -1
- package/element/aXvUP7X72.js +93 -0
- package/element/{BccTn5v-2.js → p0Q_2x6C.js} +1 -1
- package/element/qBKIp1ZW2.js +36 -0
- package/element/web.es.js +42 -42
- package/element/{BV9JHI5n2.js → xJZs5Gan.js} +35 -35
- package/package.json +1 -1
- package/element/BFCgbC5I2.js +0 -14
- package/element/BZu3c37u.js +0 -1
- package/element/BxbojrJs.js +0 -8
- package/element/C6dzWeQk2.js +0 -93
- package/element/C7iuJ0h32.js +0 -35
- package/element/C9kBlCZx2.js +0 -3
- package/element/CM46vluW.js +0 -1
- package/element/CMnzxWwG.js +0 -9
- package/element/CZbEGemi2.js +0 -4
- package/element/CaX2xgrP.js +0 -41
- package/element/Cko4QHwX.js +0 -1
- package/element/CqBk9L5O.js +0 -1
- package/element/D5TKEdBd2.js +0 -3
- package/element/DCj_fMN5.js +0 -5
- package/element/DF0LxcV7.js +0 -3
- package/element/DRP9vxts2.js +0 -4
- package/element/DWjheKBP2.js +0 -3
- package/element/EjMoIoSK.js +0 -1
- package/element/ZYvo9BjF2.js +0 -8
- package/element/dT6WSX65.js +0 -1
- package/element/h4ZjZXfe2.js +0 -1
- package/element/rg8L51I62.js +0 -5
- /package/element/{CfMNBPpx2.js → CfMNBPpx.js} +0 -0
- /package/element/{DPg_DKOi.js → DPg_DKOi2.js} +0 -0
- /package/element/{DnIueBGr2.js → DnIueBGr.js} +0 -0
package/package.json
CHANGED
package/element/BFCgbC5I2.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,h as a,p as n,t as r,w as o}from"./DrrpB4Om.js";import{L as s,N as i,O as l,i as c,n as d,p as m,u}from"./CaX2xgrP.js";import{n as p,r as h,t as g}from"./C12iSy3L.js";import{n as f,r as v,t as x}from"./dT6WSX65.js";import{c as N,l as y}from"./ChJXhA9c.js";import{t as w}from"./CATr-3VW.js";import{t as b}from"./DF0LxcV7.js";import{t as T}from"./DGbyGc8b.js";import{n as D,r as P,t as C}from"./EjMoIoSK.js";import{t as j}from"./DnQ6XaLR.js";import{t as I}from"./C3dOFk9A.js";import{t as E}from"./DPg_DKOi.js";import{n as S,o as z,r as A,t as U}from"./DZtaQWVG2.js";import{t as q}from"./N4HKgEC52.js";import{i as _,n as k,r as O,t as M}from"./Ctl9NdWl2.js";var $=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=s(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token;return v({mutationKey:["delete-upload",r??null],mutationFn:async({contentId:e})=>{const t=await i.post(u.DELETE_CONTENT,{json:{contentId:e},headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(t?.error)throw new Error(t.error);return{contentId:e}},onMutate:async({contentId:t})=>{await e.cancelQueries({queryKey:[l.USER_UPLOADS],exact:!1});const a=e.getQueriesData({queryKey:[l.USER_UPLOADS],exact:!1});return e.setQueriesData({queryKey:[l.USER_UPLOADS],exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.filter(e=>e._id!==t),meta:{...e.meta,totalCount:Math.max(0,(e.meta.totalCount??0)-1)}}))}:e),{previousData:a}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}(),o=e?.rateCount??0,c=o<=0,m=c?null:`This photo has ${o} rating${o>1?"s":""}. Photos with at least 1 rating cannot be deleted.`;/* @__PURE__ */
|
|
2
|
-
return r(O,{open:Boolean(e),onOpenChange:e=>{e||a()},title:"Delete content?",description:m??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:c?"Delete":"Got it",confirmColor:c?"error":"primary",onCancel:a,onConfirm:c?()=>{if(!e||!c)return;const a=e.eventId,r=e._id;t(),n.mutate({contentId:r,eventId:a})}:a})};function L({className:e}){/* @__PURE__ */
|
|
3
|
-
return r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */r("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var R={[m.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */r(M,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[m.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */r(_,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[m.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */r(q,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},F=e=>{const t=new Date(e).getTime();if(Number.isNaN(t))return"";const a=Math.max(0,Math.floor((Date.now()-t)/1e3)),n=[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]];let r=a,o="second";for(const[s,i]of n){if(r<s){o=i;break}r=Math.floor(r/s),o=i}return"second"===o&&r<30?"just now":`${r} ${o}${1===r?"":"s"} ago`},V=({content:e,onDelete:t,onStatusClick:a})=>{const n=e.status,o=R[n];/* @__PURE__ */
|
|
4
|
-
return r("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */r("div",{className:"relative size-full",children:[
|
|
5
|
-
/* @__PURE__ */r(P,{url:e.url||"",alt:e.caption||"",thumbnailUrl:e.thumbnailUrl||void 0,blurhash:e.blurhash||void 0,pswpData:{id:e._id,type:e.type,hash:e._id,width:e.dimension?.width,height:e.dimension?.height,thumbnailUrl:e.thumbnailUrl||void 0,caption:e.caption||""}}),
|
|
6
|
-
/* @__PURE__ */r("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-between bg-gradient-to-t from-black/50 to-transparent pl-3",children:[/* @__PURE__ */r(w,{variant:"caption",className:"text-xs text-white opacity-90 sm:text-sm",children:F(e.createdAt)}),/* @__PURE__ */r(k,{icon:/* @__PURE__ */r(L,{className:"size-5"}),color:"error",size:"sm",className:"pointer-events-auto","aria-label":"Delete upload",tooltip:"Delete",onClick:e=>{e.stopPropagation(),e.preventDefault(),t()}})]}),
|
|
7
|
-
/* @__PURE__ */r("button",{type:"button","aria-label":`Status: ${o?.title||"Unknown"}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(n)},className:c("pointer-events-auto absolute top-1 right-1 cursor-pointer rounded-full p-1 transition-opacity hover:opacity-80",o?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */r("span",{className:c("block size-5",o?.color||"text-gray-500"),children:o?.icon||null})})]})})},B=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),K=e=>{if(0===e.length)return"";if(1===e.length)return B(e[0].createdAt);const{minTime:t,maxTime:a}=e.reduce((e,t)=>{const a=new Date(t.createdAt).getTime();return{minTime:Math.min(e.minTime,a),maxTime:Math.max(e.maxTime,a)}},{minTime:1/0,maxTime:-1/0}),n=B(new Date(t).toISOString()),r=B(new Date(a).toISOString());return n===r?n:`${n} - ${r}`},Y=()=>{const s=y(),m=N(),{user:v,loadingUser:P,portalContainer:q}=d(),_=t(null),k=t(null),O=t(null),[M,L]=a(null),[F,B]=a(null),{contents:Y,loading:Q,hasNextPage:G,fetchNextPage:J,isFetchingNextPage:H}=function({sort:e="-createdAt",limit:t=20}={}){const{user:a,loadingUser:r,props:o}=d(),s=o?.organizationId,c=a?.token,m=a?._id??a?.uid??null,{data:f,isLoading:v,isError:x,error:N,isFetchingNextPage:y,hasNextPage:w,fetchNextPage:b,refetch:T}=h({queryKey:[l.USER_UPLOADS,s??"",m,t,e],queryFn:async({pageParam:a=1})=>await i.get(u.MY_UPLOADS,{searchParams:{page:a,limit:t,sort:e},headers:{"x-org-id":s,...c?{Authorization:`Bearer ${c}`}:{}}}).json(),initialPageParam:1,getPreviousPageParam:p,getNextPageParam:g,staleTime:12e4,gcTime:3e5,enabled:!r&&!!a});return{contents:n(()=>f?.pages?.flatMap(e=>e?.data??[])??[],[f]),loading:v,isError:x,error:N,isFetchingNextPage:y,hasNextPage:!!w,fetchNextPage:b,refetch:T,totalCount:f?.pages?.[0]?.meta?.totalCount??0}}({sort:"-createdAt",limit:20});e(()=>{P||v||s("/auth/login",{state:{referrer:m.pathname},replace:!0})},[P,v]);const W=Y.length>0,Z=!Q&&!W,X=n(()=>{if(!Y.length)return[];const e={};return Y.forEach(t=>{const a=t.eventId||"unknown";e[a]||(e[a]={eventId:a,eventName:t.event?.name||"Event",uploads:[]}),e[a].uploads.push(t)}),Object.values(e).sort((e,t)=>{const a=new Date(e.uploads[0]?.createdAt||0).getTime();return new Date(t.uploads[0]?.createdAt||0).getTime()-a})},[Y]);e(()=>{const e=k.current;if(!e)return;const t=new D({gallery:e,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:C,appendToEl:q??document.body});return _.current=t,new x(t),new f(t),t.init(),()=>{t.destroy(),_.current=null}},[q,W]),e(()=>{const e=O.current;if(!e||!G)return;const t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&G&&!H&&J()},{rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[G,H,J]);const ee=n(()=>Y.find(e=>e._id===M)??null,[M,Y]),te=F?R[F]:null;/* @__PURE__ */
|
|
8
|
-
return r("div",{className:"bg-background mx-auto min-h-screen max-w-5xl px-3 pt-16 pb-12 lg:px-0",children:[
|
|
9
|
-
/* @__PURE__ */r("div",{className:"relative mb-6 flex items-center justify-center",children:[/* @__PURE__ */r(j,{}),/* @__PURE__ */r(w,{variant:"h4",align:"center",children:"My Uploads"})]}),
|
|
10
|
-
/* @__PURE__ */r("section",{className:"space-y-3",children:Q?/* @__PURE__ */r("div",{className:"space-y-8 py-4",children:Array.from({length:2}).map((e,t)=>/* @__PURE__ */r("div",{className:"space-y-4",children:[/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */r(T,{className:"h-6 w-48"}),/* @__PURE__ */r(T,{className:"h-5 w-24"})]}),/* @__PURE__ */r("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */r(T,{className:"h-52 w-full lg:h-64"},t))})]},t))}):Z?/* @__PURE__ */r(b,{className:"py-12",title:"No uploads yet",description:"Photos and videos you upload to events will appear here."}):/* @__PURE__ */r(o,{children:[
|
|
11
|
-
/* @__PURE__ */r("div",{ref:k,className:"space-y-8 py-4",children:X.map(e=>/* @__PURE__ */r("div",{className:"space-y-4",children:[/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */r(w,{variant:"h5",color:"muted",children:e.eventName}),/* @__PURE__ */r("span",{className:"text-muted-foreground text-sm font-light uppercase sm:text-base",children:K(e.uploads)})]}),/* @__PURE__ */r("div",{className:"grid grid-cols-2 gap-1 sm:grid-cols-3 sm:gap-3 lg:grid-cols-4",children:e.uploads.map(e=>/* @__PURE__ */r("div",{className:"h-52 lg:h-64",children:/* @__PURE__ */r(V,{content:e,onDelete:()=>L(e._id),onStatusClick:e=>B(e)})},e._id))})]},e.eventId))}),
|
|
12
|
-
/* @__PURE__ */r("div",{ref:O,className:"h-px w-full"}),H&&/* @__PURE__ */r("div",{className:"my-6 w-full",children:/* @__PURE__ */r(E,{})})]})}),
|
|
13
|
-
/* @__PURE__ */r($,{content:ee,onClose:()=>L(null),onDeleted:()=>L(null)}),
|
|
14
|
-
/* @__PURE__ */r(U,{open:Boolean(F),onOpenChange:e=>!e&&B(null),children:/* @__PURE__ */r(S,{className:"w-full max-w-lg",children:[/* @__PURE__ */r("div",{className:"flex flex-col gap-4 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */r("div",{className:c("mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",te?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */r("span",{className:c("size-6",te?.color||"text-gray-500"),children:te?.icon||null})}),/* @__PURE__ */r("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[/* @__PURE__ */r(z,{children:te?.title||"Unknown Status"}),/* @__PURE__ */r(A,{children:te?.description||"Status information unavailable."})]})]}),/* @__PURE__ */r("div",{className:"flex justify-end p-4",children:/* @__PURE__ */r(I,{variant:"outlined",color:"foreground",onClick:()=>B(null),children:"Got it"})})]})})]})};export{Y as default};
|
package/element/BZu3c37u.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as t,G as e,J as s,K as i,Q as r,W as u,X as n,Y as a,Z as o,et as h,it as c,q as l,tt as f,z as y}from"./CaX2xgrP.js";import{t as d}from"./CqBk9L5O.js";var m=class extends l{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Map}#t;build(t,e,s){const i=e.queryKey,r=e.queryHash??n(i,e);let u=this.get(r);return u||(u=new y({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(u)),u}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){e.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>r(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>r(t,e)):e}notify(t){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){e.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){e.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},p=class extends l{constructor(t={}){super(),this.config=t,this.#e=/* @__PURE__ */new Set,this.#s=/* @__PURE__ */new Map,this.#i=0}#e;#s;#i;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#i,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);const e=q(t);if("string"==typeof e){const s=this.#s.get(e);s?s.push(t):this.#s.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=q(t);if("string"==typeof e){const s=this.#s.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#s.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=q(t);if("string"==typeof e){const s=this.#s.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=q(t);return"string"==typeof e?(this.#s.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){e.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#s.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>o(e,t))}findAll(t={}){return this.getAll().filter(e=>o(t,e))}notify(t){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const s=this.getAll().filter(t=>t.state.isPaused);return e.batch(()=>Promise.all(s.map(e=>e.continue().catch(t))))}};function q(t){return t.options.scope?.id}var g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new m,this.#u=t.mutationCache||new p,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=i.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=u.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#r.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(f(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,i){const r=this.defaultQueryOptions({queryKey:t}),u=this.#r.get(r.queryHash)?.state.data,n=s(e,u);if(void 0!==n)return this.#r.build(this,r).setData(n,{...i,manual:!0})}setQueriesData(t,s,i){return e.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const s=this.#r;e.batch(()=>{s.findAll(t).forEach(t=>{s.remove(t)})})}resetQueries(t,s){const i=this.#r;return e.batch(()=>(i.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},s)))}cancelQueries(s,i={}){const r={revert:!0,...i},u=e.batch(()=>this.#r.findAll(s).map(t=>t.cancel(r)));return Promise.all(u).then(t).catch(t)}invalidateQueries(t,s={}){return e.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},s)))}refetchQueries(s,i={}){const r={...i,cancelRefetch:i.cancelRefetch??!0},u=e.batch(()=>this.#r.findAll(s).filter(t=>!t.isDisabled()&&!t.isStatic()).map(e=>{let s=e.fetch(void 0,r);return r.throwOnError||(s=s.catch(t)),"paused"===e.state.fetchStatus?Promise.resolve():s}));return Promise.all(u).then(t)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#r.build(this,e);return s.isStaleByTime(f(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t).catch(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t).catch(t)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return u.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(a(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#a.values()],s={};return e.forEach(e=>{h(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#o.set(a(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#o.values()],s={};return e.forEach(e=>{h(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=n(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===c&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
|
package/element/BxbojrJs.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{_ as r,t as e}from"./DrrpB4Om.js";import{D as a,i as t,n as s}from"./CaX2xgrP.js";import{c as i,i as o,l as m,n as d}from"./ChJXhA9c.js";import{t as l}from"./DGbyGc8b.js";import{t as n}from"./D35mTuTT.js";import{t as c}from"./DnQ6XaLR.js";var b=()=>{const b=i(),p=m(),{initializing:h,organization:f,user:x}=s(),u=b.pathname.endsWith("/login")||b.pathname.endsWith("/register");return r(()=>{if(x){const r=b.state?.referrer;p(r||"/",{replace:!0})}},[x]),h?/* @__PURE__ */e("div",{className:"mx-auto max-w-lg space-y-8 py-8",children:[
|
|
2
|
-
/* @__PURE__ */e(l,{className:"h-8"}),
|
|
3
|
-
/* @__PURE__ */e(l,{className:"h-8"}),
|
|
4
|
-
/* @__PURE__ */e(l,{className:"h-8"}),
|
|
5
|
-
/* @__PURE__ */e(l,{className:"h-8"})]}):!f||f?.customAuth?null:/* @__PURE__ */e("div",{className:"bg-background relative mx-auto min-h-[80vh] max-w-md py-24",children:[u&&/* @__PURE__ */e(c,{}),/* @__PURE__ */e("div",{children:[
|
|
6
|
-
/* @__PURE__ */e("div",{className:"my-8 flex w-full justify-around",children:[/* @__PURE__ */e(d,{to:a.LOGIN,state:b.state||void 0,className:({isActive:r})=>t(r?"border-primary text-primary font-semibold":"border-border","flex-1 border-2 border-x-0 border-t-0 pb-2 text-center"),children:"Login"}),/* @__PURE__ */e(d,{to:a.REGISTER,state:b.state||void 0,className:({isActive:r})=>t(r?"border-primary text-primary font-semibold":"border-border","flex-1 border-2 border-x-0 border-t-0 pb-2 text-center"),children:"Register"})]}),
|
|
7
|
-
/* @__PURE__ */e(o,{}),
|
|
8
|
-
/* @__PURE__ */e("div",{className:"mt-12",children:/* @__PURE__ */e(n,{})})]})]})};export{b as default};
|