@qratilabs/qrati-connect 2.28.1 → 2.29.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/2ckymssm.js +17 -0
- package/element/{1UqTmSK2.js → 7Qigk19C.js} +1 -1
- package/element/{DtcmI8yd2.js → B6oxk_Qj2.js} +1 -1
- package/element/{77CTD63x.js → BDTXukZ_.js} +1 -1
- package/element/BGubuyYi.js +2 -0
- package/element/{BB90a5r62.js → BW-Phbmr2.js} +4 -4
- package/element/Bb9ydqSB.js +1 -0
- package/element/{B01ceTPt.js → Botz-oQY.js} +1 -1
- package/element/{7zeKIiiL.js → BqXNdaJq.js} +1 -1
- package/element/C-J1EE4W.js +7 -0
- package/element/{BMcQNiLL.js → C9l3wVoY.js} +4 -4
- package/element/{JFF45CMp.js → CJRbcuSg.js} +1 -1
- package/element/CWmyXqt5.js +7 -0
- package/element/{CrF08YS6.js → C_SEq15E.js} +1 -1
- package/element/C_ZPqbKe.js +1 -0
- package/element/{3uWxzKri.js → CaYxRUfL.js} +86 -87
- package/element/{BMibcq6T.js → Cens8AWt.js} +1 -1
- package/element/{5z04gCoQ2.js → CkExnaGY2.js} +2 -2
- package/element/{DtqQWU6q2.js → Cn3UbUp82.js} +15 -15
- package/element/{Da7cHmvl.js → Cq_SerdP.js} +3 -3
- package/element/Cqkksoxi2.js +2 -0
- package/element/CxXoXd5a2.js +9 -0
- package/element/{D34k0bDj2.js → D20MYAFc2.js} +1 -1
- package/element/{CZK4LCzr2.js → DAiDmr0n2.js} +1 -1
- package/element/{C8ixb9k4.js → DDLSkbWV.js} +1 -1
- package/element/{CfTxXwtG2.js → DDxUnIxq2.js} +10 -10
- package/element/DLGISV0I2.js +5 -0
- package/element/DLZ2_ufP.js +8 -0
- package/element/{BhOaopIk2.js → DNBsQPFm2.js} +3 -3
- package/element/{DZwpw1jG.js → DOGRuglQ.js} +1 -1
- package/element/{KdgQ7jUn.js → DS4kxd-M.js} +1 -1
- package/element/{CKwlnGWW2.js → DZy5yLMr2.js} +1 -1
- package/element/DdObkiX2.js +1 -0
- package/element/{BHmNrbtm2.js → DeK1vU3V2.js} +1 -1
- package/element/Dj_EJxLA.js +5 -0
- package/element/Dm8Fvxp7.js +2 -0
- package/element/{BdQrGBTf.js → DqjsH4hD.js} +1 -1
- package/element/{C6et9sp52.js → DuWwPOwC2.js} +1 -1
- package/element/{CxJgMv2R.js → DxyGHoKK.js} +1 -1
- package/element/{DBlhTxUx2.js → MiqVgN0c2.js} +4 -4
- package/element/{CLV9vt29.js → RMLGjMvY.js} +1 -1
- package/element/{CtApMHPf.js → RY2ymKgG.js} +1 -1
- package/element/{Bgw9OUdR.js → e3AdRaT8.js} +1 -1
- package/element/{tJ2MS5HS.js → f4E4mY0G.js} +41 -41
- package/element/web.es.js +41 -40
- package/package.json +1 -1
- package/element/2PuRbItp.js +0 -8
- package/element/B7YFs6p5.js +0 -1
- package/element/BcAwTWQC.js +0 -5
- package/element/C6ph3KPL.js +0 -5
- package/element/Cr4OmKxk2.js +0 -2
- package/element/DUEaNsCB.js +0 -1
- package/element/DUWOb-5c.js +0 -1
- package/element/DlNQukHq.js +0 -3
- package/element/DmVgPRH5.js +0 -14
- package/element/cePYhOkN2.js +0 -5
- package/element/hiapcVVA2.js +0 -5
- package/element/vA5CQmOb2.js +0 -9
- /package/element/{DGGc10Cy.js → DGGc10Cy2.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E={PUBLIC_EVENTS:"/",FOLDER_EVENTS:E=>`/${E}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:E=>`/event/${E}`,UPLOAD:E=>`/event/${E}/upload`,CURATE:E=>`/event/${E}/curate`,LEADERBOARD:E=>`/event/${E}/leaderboard`,MY_UPLOADS:"/my-uploads"},t={ORGANIZATION_SETTINGS:E=>`https://qrati.com/org/${E}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:E=>`https://qrati.com/org/${E}/settings/integration`,ORGANIZATION_DASHBOARD:E=>`https://qrati.com/org/${E}/dashboard`,ORGANIZATION_ADMINS:E=>`https://qrati.com/org/${E}/admins`,EVENT_SETTINGS_BASIC_DETAILS:E=>`https://qrati.com/event/${E}/settings`,EVENT_REVIEW_CONTENTS:E=>`https://qrati.com/event/${E}/review-contents`,EVENT_DEEP_SEARCH:E=>`https://qrati.com/event/${E}/deep-search`,EVENT_GENERATE_ARTICLE:E=>`https://qrati.com/event/${E}/generate-article`,EVENT_ACCESS_REQUESTS:E=>`https://qrati.com/event/${E}/access-requests`,EVENT_SHOT_INSPECTOR:E=>`https://qrati.com/event/${E}/shot-inspector`,EVENT_CURATION_DETAILS:E=>`https://qrati.com/event/${E}/curation-details`},e={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},T="https://qrati.com/api/connect",a={INITIALIZE_SESSION:`${T}/session/initialize`,REGISTER:`${T}/auth/register`,LOGIN:`${T}/auth/login`,LOGOUT:`${T}/auth/logout`,UPDATE_SESSION:`${T}/session/update`,ACCEPT_TERMS:`${T}/auth/accept-terms`,PUBLIC_EVENTS:`${T}/event/public-events`,SEARCH_EVENTS:`${T}/event/search`,FOLDER_DETAILS:`${T}/folder/details`,NESTED_FOLDERS:`${T}/folder/nested-folders`,GET_EVENT_POINTS:`${T}/event/points`,ELIGIBLE_TO_CURATE:`${T}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${T}/content/for-curation`,CURATE_CONTENT:`${T}/content/curate`,GET_LEADERBOARD:`${T}/event/leaderboard`,GET_UPLOAD_COUNT:`${T}/event/upload-count`,UPLOAD_CREATE:`${T}/content/upload/create`,UPLOAD_COMPLETE:`${T}/content/upload/complete`,UPLOAD_FAIL:`${T}/content/upload/fail`,UPLOAD_ABORT:`${T}/content/upload/abort`,UPDATE_REACTION:`${T}/content/update-reaction`,EVENT_DATA:`${T}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${T}/event/update-layout`,GET_EVENT_STATISTICS:`${T}/event/statistics`,GET_CONTENTS:`${T}/content/for-gallery`,SEARCH_CONTENTS:`${T}/content/search`,GET_CONTENTS_COUNT:`${T}/content/count`,TRACK_EVENT:`${T}/event/track`,SEND_PASSWORD_RESET_CODE:`${T}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${T}/auth/verify-password-reset-code`,RESET_PASSWORD:`${T}/auth/reset-password`,REPORT_ERROR:`${T}/log-error`,GET_POST_PROCESSING_SETTINGS:`${T}/event/post-processing-settings`,MY_UPLOADS:`${T}/content/my-uploads`,DELETE_CONTENT:`${T}/content/delete`,UPDATE_CONTENT_CAPTION:`${T}/content/caption`},s={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},A={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},O={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},o={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},N={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},n=26214400,S=262144e3,_={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},r={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},I={CONTEST:"CONTEST",REACTION:"REACTION"},R={GRID:"grid",SINGLE:"single"},i={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},c={[i.POPULAR]:{label:"Popular",sortField:"score"},[i.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[i.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},C="map-view-state",D=i.UPLOAD_TIME,l={ASC:"asc",DESC:"desc"},P={[l.ASC]:{label:"Ascending",sortOrder:""},[l.DESC]:{label:"Descending",sortOrder:"-"}},d=l.DESC,L={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},$={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},p={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},u={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:E=>`in-review-count-${E}`,CONTENTS_BY_EVENT:E=>`contents-by-event-${E}`,USER_UPLOADS:"user-uploads"};export{L as C,P as E,u as S,l as T,O as _,i as a,S as b,A as c,d,I as f,o as g,t as h,a as i,R as l,e as m,p as n,c as o,_ as p,$ as r,N as s,s as t,D as u,C as v,r as w,E as x,n as y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as a}from"./DrrpB4Om.js";import{i as t,n as e}from"./
|
|
1
|
+
import{t as a}from"./DrrpB4Om.js";import{i as t,n as e}from"./f4E4mY0G.js";import{t as i}from"./DOGRuglQ.js";var r=({title:r,description:s,iconSvg:o,className:l})=>{const{props:n,organization:c}=e(),m=n?.emptyStateImage;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:t("mx-auto flex w-full max-w-md flex-col items-center justify-center gap-8",l),children:[c?.integrationSettings?.showLogo?/* @__PURE__ */a("img",{className:"h-44 w-auto",src:c?.logoUrl||"/images/qrati-logo.svg",alt:r}):m?/* @__PURE__ */a("img",{className:"h-44 w-auto",src:m,alt:r}):o?/* @__PURE__ */a("div",{className:"text-primary h-44 w-auto",children:o}):null,/* @__PURE__ */a("div",{className:"space-y-2",children:[
|
|
3
3
|
/* @__PURE__ */a(i,{variant:"h4",align:"center",children:r}),"string"==typeof s&&/* @__PURE__ */a(i,{variant:"body2",color:"muted",align:"center",children:s}),"string"!=typeof s&&s]})]})};export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,h as n,p as t,v as o}from"./DrrpB4Om.js";import{
|
|
1
|
+
import{_ as e,h as n,p as t,v as o}from"./DrrpB4Om.js";import{l as i,n as r}from"./f4E4mY0G.js";import{t as a}from"./DmpmrPE5.js";import{i as l}from"./Bb9ydqSB.js";var d=(e,n)=>e.filter(e=>(e.parentFolderId??null)===n).map(n=>{return{folder:n,children:d(e,n._id),eventCount:n.boundary?.length??0,centroid:(t=n.boundary,t?.length?[t.reduce((e,n)=>e+n.x,0)/t.length,t.reduce((e,n)=>e+n.y,0)/t.length]:null),color:n.color||"#fb8500"};var t}).filter(e=>e.eventCount>0||e.children.length>0),s=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),c=()=>{const{folders:c,organization:m}=r(),[g,u]=n(null),f=Boolean(m?.integrationSettings?.enableFolderView),h=t(()=>f?d(c??[],null):[],[c,f]),y=i({queryKey:["map-all-events",m?._id],queryFn:async()=>s((await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(m?._id)&&(!f||0===h.length),staleTime:3e5,gcTime:6e5,retry:!1}),v=i({queryKey:["map-folder-events",m?._id,g],queryFn:async()=>s((await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{folderId:g,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(m?._id)&&f&&Boolean(g),staleTime:3e5,gcTime:6e5,retry:!1}),p=t(()=>(c??[]).find(e=>e._id===g)??null,[c,g]);e(()=>{f||u(null)},[f]);const _=o(e=>{u(e)},[]),F=f&&h.length>0;return{folderTree:h,activeFolderId:g,activeFolder:p,visibleEvents:F?v.data??[]:y.data??[],setActiveFolderId:_,isLoadingEvents:F?Boolean(g)&&(v.isLoading||v.isFetching):y.isLoading||y.isFetching}};export{c as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{t as e,w as r}from"./DrrpB4Om.js";import{n}from"./f4E4mY0G.js";import{x as t}from"./Bb9ydqSB.js";import{t as a,u as i}from"./Dj_EJxLA.js";import{t as s}from"./DOGRuglQ.js";import{t as o}from"./D35mTuTT.js";var l=()=>{const{user:l,organization:c,signout:d}=n(),m=i(),h=c?.integrationSettings?.hideQratiBranding,p=c?.integrationSettings?.enableMyUploads;/* @__PURE__ */
|
|
2
|
+
return e("div",{className:"pt-16 sm:pt-24",children:[c&&/* @__PURE__ */e("div",{className:"mx-auto py-2",children:c.customAuth?l&&/* @__PURE__ */e(s,{variant:"h6",align:"center",children:[l.name,p&&/* @__PURE__ */e(r,{children:[" ","•"," ",
|
|
3
|
+
/* @__PURE__ */e(a,{className:"hover:underline",to:t.MY_UPLOADS,children:"My Uploads"})]})]}):/* @__PURE__ */e(r,{children:[!l&&/* @__PURE__ */e(s,{variant:"h6",align:"center",children:[
|
|
4
|
+
/* @__PURE__ */e(a,{className:"text-primary hover:underline",to:t.LOGIN,children:"Login"})," ","•"," ",
|
|
5
|
+
/* @__PURE__ */e(a,{className:"text-primary hover:underline",to:t.REGISTER,children:"Register"})]}),l&&/* @__PURE__ */e(s,{variant:"h6",align:"center",children:[l.name,p&&/* @__PURE__ */e(r,{children:[" ","•"," ",
|
|
6
|
+
/* @__PURE__ */e(a,{className:"hover:underline",to:t.MY_UPLOADS,children:"My Uploads"})]})," ","•"," ",
|
|
7
|
+
/* @__PURE__ */e("button",{type:"button",className:"text-destructive cursor-pointer border-none bg-transparent p-0 hover:underline",onClick:async()=>{await d(),m(t.PUBLIC_EVENTS)},children:"Logout"})]})]})}),!h&&/* @__PURE__ */e(o,{})]})};export{l as t};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{d as e,s as r,t,v as o}from"./DrrpB4Om.js";import{n as s}from"./
|
|
1
|
+
import{d as e,s as r,t,v as o}from"./DrrpB4Om.js";import{n as s}from"./f4E4mY0G.js";import{x as l}from"./Bb9ydqSB.js";import{u as i}from"./Dj_EJxLA.js";import"./BqXNdaJq.js";var n=e(()=>import("./7Qigk19C.js")),a=e(()=>import("./e3AdRaT8.js")),c=e(()=>import("./BDTXukZ_.js")),p=e(()=>import("./DqjsH4hD.js")),d=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
|
|
2
2
|
/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
3
3
|
/* @__PURE__ */t("p",{class:"text-foreground",children:"No location data available."}),
|
|
4
|
-
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:e,isLoading:g=!1})=>{const{organization:x}=s(),f=i(),
|
|
5
|
-
return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:g?/* @__PURE__ */t(m,{}):"openstreetmap"===
|
|
4
|
+
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:e,isLoading:g=!1})=>{const{organization:x}=s(),f=i(),u=x?.integrationSettings??{},h=u.mapProvider??"openstreetmap",v=o(e=>{f(l.GALLERY(e))},[f]);if("openstreetmap_free"===h)/* @__PURE__ */return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:/* @__PURE__ */t(n,{onExplore:v,logoUrl:x?.logoUrl})})});const y=u.mapTilerApiKey??"",b=u.googleMapsApiKey??"",j=u.mapboxApiKey??"",w=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);/* @__PURE__ */
|
|
5
|
+
return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:g?/* @__PURE__ */t(m,{}):"openstreetmap"===h&&!y||"google"===h&&!b||"mapbox"===h&&!j?/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
|
|
6
6
|
/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
7
7
|
/* @__PURE__ */t("p",{class:"text-foreground",children:"API key is required to display the map."}),
|
|
8
|
-
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===w.length?/* @__PURE__ */t(d,{}):/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:["openstreetmap"===
|
|
8
|
+
/* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===w.length?/* @__PURE__ */t(d,{}):/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:["openstreetmap"===h&&/* @__PURE__ */t(a,{is3D:!1,apiKey:y,onExplore:v,logoUrl:x?.logoUrl}),"mapbox"===h&&/* @__PURE__ */t(p,{onExplore:v,apiKey:j,is3D:!1,logoUrl:x?.logoUrl}),"google"===h&&/* @__PURE__ */t(c,{apiKey:b,onExplore:v,logoUrl:x?.logoUrl})]})})};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,h as s,r as e,v as i}from"./DrrpB4Om.js";import{
|
|
1
|
+
import{_ as t,h as s,r as e,v as i}from"./DrrpB4Om.js";import{M as r,O as n,S as o,b as u,f as a,j as h,w as c}from"./f4E4mY0G.js";import{n as p}from"./DS4kxd-M.js";var m=class extends o{#t;#s=void 0;#e;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),h(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),s?.mutationKey&&this.options.mutationKey&&c(s.mutationKey)!==c(this.options.mutationKey)?this.reset():"pending"===this.#e?.state.status&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#n(t)}getCurrentResult(){return this.#s}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#r(),this.#n()}mutate(t,s){return this.#i=s,this.#e?.removeObserver(this),this.#e=this.#t.getMutationCache().build(this.#t,this.options),this.#e.addObserver(this),this.#e.execute(t)}#r(){const t=this.#e?.state??p();this.#s={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#n(t){u.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#s.variables,i=this.#s.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,e,i,r)}catch(s){Promise.reject(s)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,e,i,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(t=>{t(this.#s)})})}};function l(o,h){const c=a(h),[p]=s(()=>new m(c,o));t(()=>{p.setOptions(o)},[p,o]);const l=e(i(t=>p.subscribe(u.batchCalls(t)),[p]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),d=i((t,s)=>{p.mutate(t,s).catch(n)},[p]);if(l.error&&r(p.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}export{l as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{g as e,t as r}from"./DrrpB4Om.js";import{i as t}from"./f4E4mY0G.js";import{t as o}from"./CkExnaGY2.js";import{n as i,o as s,r as n,t as d}from"./Cqkksoxi2.js";function a({className:e}){/* @__PURE__ */
|
|
2
|
+
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:"M2.725 21q-.275 0-.5-.137t-.35-.363t-.137-.488t.137-.512l9.25-16q.15-.25.388-.375T12 3t.488.125t.387.375l9.25 16q.15.25.138.513t-.138.487t-.35.363t-.5.137zm1.725-2h15.1L12 6zm8.263-1.287Q13 17.425 13 17t-.288-.712T12 16t-.712.288T11 17t.288.713T12 18t.713-.288m0-3Q13 14.425 13 14v-3q0-.425-.288-.712T12 10t-.712.288T11 11v3q0 .425.288.713T12 15t.713-.288M12 12.5"})})}function l({open:e,onOpenChange:l,title:c,description:u,cancelText:m="Cancel",confirmText:g="Confirm",confirmColor:f="error",loading:b,onCancel:h,onConfirm:v}){/* @__PURE__ */
|
|
3
|
+
return r(d,{open:e,onOpenChange:l,children:/* @__PURE__ */r(i,{className:"w-full max-w-lg",children:[/* @__PURE__ */r("div",{className:"flex flex-col gap-6 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */r("div",{className:"bg-destructive/10 mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0",children:/* @__PURE__ */r(a,{className:"text-destructive size-6"})}),/* @__PURE__ */r("div",{className:"flex-1 space-y-2",children:[c&&/* @__PURE__ */r(s,{children:c}),u&&/* @__PURE__ */r(n,{children:u})]})]}),/* @__PURE__ */r("div",{className:"flex flex-col-reverse gap-3 p-4 sm:flex-row sm:justify-end",children:[/* @__PURE__ */r(o,{variant:"outlined",color:"foreground",disabled:b,className:"w-full sm:w-auto",onClick:h,children:m}),/* @__PURE__ */r(o,{color:f,loading:b,disabled:b,className:t("w-full sm:w-auto","error"===f&&"text-white"),onClick:v,children:g})]})]})})}var c={xs:"size-6 [&>*]:size-4",sm:"size-8 [&>*]:size-5",md:"size-10 [&>*]:size-6",lg:"size-12 [&>*]:size-7"},u={ghost:{primary:"text-primary hover:bg-primary/10",foreground:"text-foreground hover:bg-foreground/10",muted:"text-muted-foreground hover:bg-muted/20",error:"text-destructive hover:bg-destructive/10",success:"text-success hover:bg-success/10",warning:"text-warning hover:bg-warning/10",info:"text-info hover:bg-info/10"},filled:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",foreground:"bg-foreground text-background hover:bg-foreground/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80",error:"bg-destructive text-white hover:bg-destructive/90",success:"bg-success text-white hover:bg-success/90",warning:"bg-warning text-white hover:bg-warning/90",info:"bg-info text-white hover:bg-info/90"},outlined:{primary:"border border-primary text-primary hover:bg-primary/10",foreground:"border border-foreground text-foreground hover:bg-foreground/10",muted:"border border-border text-muted-foreground hover:bg-muted/20",error:"border border-destructive text-destructive hover:bg-destructive/10",success:"border border-success text-success hover:bg-success/10",warning:"border border-warning text-warning hover:bg-warning/10",info:"border border-info text-info hover:bg-info/10"}};function m({icon:e,size:o="md",variant:i="ghost",color:s="foreground",loading:n,disabled:d,tooltip:a,className:l,...m}){const g="default"===i?"filled":i,f=t("inline-flex cursor-pointer items-center justify-center rounded-full transition-colors disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",c[o],u[g]?.[s]||u[g]?.foreground,l);/* @__PURE__ */
|
|
4
|
+
return r("button",{type:"button",disabled:d||n,className:f,title:a,...m,children:n?/* @__PURE__ */r("svg",{className:"animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */r("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):e})}function g({className:e}){/* @__PURE__ */
|
|
5
|
+
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:"m10.6 13.8l-2.15-2.15q-.275-.275-.7-.275t-.7.275t-.275.7t.275.7L9.9 15.9q.3.3.7.3t.7-.3l5.65-5.65q.275-.275.275-.7t-.275-.7t-.7-.275t-.7.275zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22"})})}function f({label:o,info:i,className:s,error:n,disabled:d,id:a,...l}){const c=e(),u=a??c,m=[i?`${u}-info`:null,n?`${u}-error`:null].filter(Boolean);/* @__PURE__ */
|
|
6
|
+
return r("div",{className:"space-y-1.5",children:[o&&/* @__PURE__ */r("label",{htmlFor:u,className:"block text-base font-medium",children:o}),
|
|
7
|
+
/* @__PURE__ */r("textarea",{id:u,className:t("border-border shadow-card focus:border-primary ring-offset-background focus:ring-primary min-h-12 w-full rounded border px-3 py-2.5 focus:outline-none focus-visible:ring-2","field-sizing-content",d&&"text-muted-foreground bg-transparent",n&&"border-destructive focus-visible:ring-destructive/20",s),disabled:d,"aria-invalid":!!n,"aria-describedby":m.length>0?m.join(" "):void 0,...l}),i&&/* @__PURE__ */r("p",{id:`${u}-info`,className:"text-muted-foreground text-xs",children:i}),n&&/* @__PURE__ */r("p",{id:`${u}-error`,className:"text-destructive text-xs",children:n})]})}export{a,l as i,g as n,m as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,t as l,w as r}from"./DrrpB4Om.js";import{c as a}from"./
|
|
1
|
+
import{p as t,t as l,w as r}from"./DrrpB4Om.js";import{c as a}from"./Bb9ydqSB.js";import{t as s}from"./Dj_EJxLA.js";import{t as e}from"./Cens8AWt.js";import{t as i}from"./Bki5T_lb.js";var o=({url:o,alt:p="",thumbnailUrl:n,blurhash:c,pswpData:h={},curateLink:u,onClick:m})=>{const w=t(()=>(t=>Object.keys(t).reduce((l,r)=>{const a=t[r];return null==a||""===a||(l[`data-pswp-${s=r,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=a),l;var s},{}))(h),[h]),f=/* @__PURE__ */l(r,{children:[/* @__PURE__ */l(e,{threshold:.1,src:n||o,blurhash:c,alt:p}),h.type===a.VIDEO&&/* @__PURE__ */l("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});if(m)/* @__PURE__ */return l("button",{className:"h-full w-full",onClick:m,children:f});if(u)/* @__PURE__ */return l(s,{to:u,className:"h-full w-full",children:f});const d=o&&i(o,["http:","https:"])?o:void 0;return d?/* @__PURE__ */l("a",{href:d,className:"pswp-item block h-full w-full",...w,...n?{"data-pswp-thumbnail-url":n}:{},...c?{"data-pswp-blurhash":c}:{},target:"_blank",rel:"noreferrer",children:f}):/* @__PURE__ */l("span",{className:"pswp-item block h-full w-full",...w,...n?{"data-pswp-thumbnail-url":n}:{},...c?{"data-pswp-blurhash":c}:{},children:f})};export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as t,C as e,D as s,E as i,N as r,O as u,S as n,T as a,b as o,k as h,m as c,w as l,x as f,y}from"./f4E4mY0G.js";import{t as d}from"./DS4kxd-M.js";var m=class extends n{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Map}#t;build(t,e,s){const i=e.queryKey,r=e.queryHash??a(i,e);let u=this.get(r);return u||(u=new c({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(){o.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=>s(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>s(t,e)):e}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){o.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},p=class extends n{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(){o.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=>i(e,t))}findAll(t={}){return this.getAll().filter(e=>i(t,e))}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return o.batch(()=>Promise.all(t.map(t=>t.continue().catch(u))))}};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=f.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=y.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(e){const s=this.defaultQueryOptions(e),i=this.#r.build(this,s),r=i.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,s,i){const r=this.defaultQueryOptions({queryKey:t}),u=this.#r.get(r.queryHash)?.state.data,n=e(s,u);if(void 0!==n)return this.#r.build(this,r).setData(n,{...i,manual:!0})}setQueriesData(t,e,s){return o.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const e=this.#r;o.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#r;return o.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=o.batch(()=>this.#r.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(u).catch(u)}invalidateQueries(t,e={}){return o.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=o.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(u)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(u)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#r.build(this,s);return i.isStaleByTime(t(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(u).catch(u)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(u).catch(u)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return y.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(l(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(l(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=a(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===r&&(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};
|