@qratilabs/qrati-connect 2.31.2 → 2.32.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/{BWjYmdOz2.js → 2MdYrk27.js} +7 -7
- package/element/2OzBYBrP.js +2 -0
- package/element/BIsp1V4q2.js +8 -0
- package/element/BJPVMd4a2.js +4 -0
- package/element/BKaxn8Ij2.js +5 -0
- package/element/BNAv4_JK.js +1 -0
- package/element/{BNaRcekR2.js → BVHdG-zf.js} +1 -1
- package/element/BiHVoIWk.js +2 -0
- package/element/BoLYE0I62.js +8 -0
- package/element/BpI67z3l.js +2 -0
- package/element/C84zcse72.js +1 -0
- package/element/CBL1xGp_.js +3 -0
- package/element/CF0gkb5T.js +4 -0
- package/element/CZvzyHMc2.js +3 -0
- package/element/Cf-ikOp2.js +2 -0
- package/element/{D1eaRhKY2.js → Cl4c-3Xk.js} +3 -3
- package/element/CnExGazE2.js +14 -0
- package/element/CopVS738.js +5 -0
- package/element/Cte8DkX6.js +199 -0
- package/element/{BXUp7Zp4.js → CvtQzVtn2.js} +7 -7
- package/element/Cyp_H6gp.js +8 -0
- package/element/D4ceMHZo2.js +8 -0
- package/element/D5ovViER2.js +3 -0
- package/element/{fQmLbYcp2.js → D92x_spc.js} +1 -1
- package/element/DDJfCP8g.js +16 -0
- package/element/DEzMsBix2.js +4 -0
- package/element/DGLG5AUs.js +36 -0
- package/element/Dav-zijp2.js +17 -0
- package/element/DtjeZIUE.js +32 -0
- package/element/DzMVgwWt.js +1 -0
- package/element/{7IEzYICH2.js → Xf-0nxUX.js} +24 -24
- package/element/YBIepScM.js +2 -0
- package/element/{Ot24jlyb2.js → Yvb3c4w2.js} +1 -1
- package/element/Za2nuDJ4.js +1 -0
- package/element/{DMnbtDXS2.js → dgI0MGWo.js} +1 -1
- package/element/khLYL0ji.js +1 -0
- package/element/{D2-DJv4T2.js → krvWvnLh2.js} +1 -1
- package/element/{BaYMN8qa2.js → sLC4EOUq.js} +93 -93
- package/element/web.es.js +1 -48
- package/element/{V_pvG6Pc.js → yhFHMaGN2.js} +85 -85
- package/embed/embed.js +1 -1
- package/package.json +2 -2
- package/element/5r_0x4aK.js +0 -3
- package/element/ASQv5Ahv.js +0 -4
- package/element/BCmdnJKF.js +0 -1
- package/element/BOs_rBYA.js +0 -2
- package/element/BWKUiudT.js +0 -2
- package/element/BXMw4kNf.js +0 -1
- package/element/B_SYJsyF2.js +0 -3
- package/element/Bb9ydqSB.js +0 -1
- package/element/Bc-phiG6.js +0 -4
- package/element/BkIDQGIs.js +0 -1
- package/element/Bki5T_lb.js +0 -1
- package/element/BpAijsfn.js +0 -3
- package/element/Bq48A0Iv.js +0 -1
- package/element/BszsxRY6.js +0 -1
- package/element/Bvc6t1Gu.js +0 -1
- package/element/BxZobjC-.js +0 -2
- package/element/C0eP2utz.js +0 -2
- package/element/C2WFktw12.js +0 -3
- package/element/CDSgxlAB.js +0 -1
- package/element/CFRIlHtK2.js +0 -5
- package/element/CHYm7f-K2.js +0 -2
- package/element/CIcQE2CN2.js +0 -1
- package/element/CJ_l5BYI.js +0 -1
- package/element/CNyy8GGA.js +0 -7
- package/element/CQJ3AK1w.js +0 -1
- package/element/CTikdrXC.js +0 -80
- package/element/CV7KmbT-.js +0 -17
- package/element/CYGIt75r2.js +0 -39
- package/element/Cj_TL6Ks2.js +0 -36
- package/element/CkBayeWW.js +0 -11
- package/element/D54cshAo.js +0 -8
- package/element/D5Ja4Yts.js +0 -1
- package/element/DJMlQk40.js +0 -8
- package/element/DTPNRhMK.js +0 -8
- package/element/DWwbkxCM2.js +0 -16
- package/element/DXjc6xIy.js +0 -2
- package/element/DeK1vU3V2.js +0 -1
- package/element/Dl6jcv9I.js +0 -5
- package/element/DmpmrPE5.js +0 -1
- package/element/Do4y0nPe.js +0 -1
- package/element/Dpwx5KMy.js +0 -41
- package/element/Dstt_bTH.js +0 -2
- package/element/JY9kGm742.js +0 -2
- package/element/L4hWU3Nc.js +0 -1
- package/element/Te9ieH1R2.js +0 -1
- package/element/Z3MoLpu5.js +0 -5
- package/element/a_rT1I0D.js +0 -8
- package/element/erXAfWWY.js +0 -3
- package/element/rlutojb0.js +0 -1
- package/element/tbcqJrU_2.js +0 -9
- package/element/xPoQq2aN2.js +0 -14
- /package/element/{1dmOpMwn2.js → 1dmOpMwn.js} +0 -0
- /package/element/{BUDCYszs.js → BUDCYszs2.js} +0 -0
- /package/element/{BYM2GyVF2.js → BYM2GyVF.js} +0 -0
- /package/element/{Bo39kG4k2.js → Bo39kG4k.js} +0 -0
- /package/element/{CfMNBPpx.js → CfMNBPpx2.js} +0 -0
- /package/element/{CtxIOzTC2.js → CtxIOzTC.js} +0 -0
- /package/element/{DnIueBGr.js → DnIueBGr2.js} +0 -0
package/element/CV7KmbT-.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,h as a,o as n,p as r,t as o,v as i,w as s}from"./BXMw4kNf.js";import{f as l,i as c,n as d}from"./Dpwx5KMy.js";import{n as u,r as m,t as p}from"./CJ_l5BYI.js";import{t as h}from"./BCmdnJKF.js";import{t as g}from"./DmpmrPE5.js";import{S as f,i as v,s as y}from"./Bb9ydqSB.js";import{f as w,l as x,u as N}from"./Z3MoLpu5.js";import{t as b}from"./BszsxRY6.js";import{t as T}from"./Dl6jcv9I.js";import{t as C}from"./5r_0x4aK.js";import{t as D}from"./Bvc6t1Gu.js";import{n as P,r as E,t as j}from"./D5Ja4Yts.js";import{t as I}from"./BOs_rBYA.js";import{t as A}from"./BWjYmdOz2.js";import{a as S,i as _,n as z,o as M,r as U,t as k}from"./CHYm7f-K2.js";import{t as q}from"./DMnbtDXS2.js";import{a as O,i as $,n as L,r as B,t as K}from"./BXUp7Zp4.js";var R=e=>e.meta.hasMore?e.meta.nextCursor??p(e):void 0,Q=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=l(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token,o=t?._id??t?.uid??null,i=[f.USER_UPLOADS,n??"",o];return h({mutationKey:["delete-upload",n??"",o],mutationFn:async({contentId:e})=>{const t=await g.post(v.DELETE_CONTENT,{json:{contentId:e},throwHttpErrors:!1,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:i,exact:!1});const a=e.getQueriesData({queryKey:i,exact:!1});return e.setQueriesData({queryKey:i,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)})}})}(),r=e?.rateCount??0,i=r<=0,s=i?null:`This upload has ${r} rating${r>1?"s":""}. Uploads with at least 1 rating cannot be deleted.`,c=n.error instanceof Error?n.error.message:null;/* @__PURE__ */
|
|
2
|
-
return o($,{open:Boolean(e),onOpenChange:e=>{e||n.isPending||a()},title:"Delete content?",description:c??s??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:i?"Delete":"Got it",confirmColor:i?"error":"primary",loading:n.isPending,onCancel:a,onConfirm:i?async()=>{if(e&&i)try{await n.mutateAsync({contentId:e._id,eventId:e.eventId}),t()}catch{}}:a})};function V({className:e}){/* @__PURE__ */
|
|
3
|
-
return o("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__ */o("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 F={[y.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */o(L,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[y.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */o(O,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[y.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */o(q,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},Y=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[i,s]of n){if(r<i){o=s;break}r=Math.floor(r/i),o=s}return"second"===o&&r<30?"just now":`${r} ${o}${1===r?"":"s"} ago`},G=n(({content:e,onDelete:t,onEditCaption:a,onStatusClick:n})=>{const r=e.status,i=F[r];/* @__PURE__ */
|
|
4
|
-
return o("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */o("div",{className:"relative size-full",children:[
|
|
5
|
-
/* @__PURE__ */o(E,{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__ */o("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__ */o(b,{variant:"caption",className:"text-xs text-white opacity-90 sm:text-sm",children:Y(e.createdAt)}),/* @__PURE__ */o("div",{className:"pointer-events-auto flex items-center",children:[/* @__PURE__ */o("button",{type:"button",className:"cursor-pointer p-2 text-white hover:opacity-80","aria-label":"Edit caption",onClick:t=>{t.stopPropagation(),t.preventDefault(),a(e._id)},children:/* @__PURE__ */o("svg",{viewBox:"0 0 24 24",className:"size-5","aria-hidden":"true",children:/* @__PURE__ */o("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25ZM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83Z"})})}),/* @__PURE__ */o(B,{icon:/* @__PURE__ */o(V,{className:"size-5"}),color:"error",size:"sm","aria-label":"Delete upload",tooltip:"Delete",onClick:a=>{a.stopPropagation(),a.preventDefault(),t(e._id)}})]})]}),
|
|
7
|
-
/* @__PURE__ */o("button",{type:"button","aria-label":`Status: ${i?.title||"Unknown"}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),n(r)},className:c("pointer-events-auto absolute top-1 right-1 cursor-pointer rounded-full p-1 transition-opacity hover:opacity-80",i?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */o("span",{className:c("block size-5",i?.color||"text-gray-500"),children:i?.icon||null})})]})})}),H=({content:t,onClose:n})=>{const[r,i]=a(""),s=function(){const e=l(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token,o=t?._id??t?.uid??null,i=[f.USER_UPLOADS,n??"",o];return h({mutationKey:["update-upload-caption",n??"",o],mutationFn:async({contentId:e,caption:t})=>{const a=await g.post(v.UPDATE_CONTENT_CAPTION,{json:{contentId:e,caption:t},throwHttpErrors:!1,headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(a.error)throw new Error(a.error);return{contentId:e,caption:t,content:a.data}},onMutate:async({contentId:t,caption:a})=>{await e.cancelQueries({queryKey:i,exact:!1});const n=e.getQueriesData({queryKey:i,exact:!1});return e.setQueriesData({queryKey:i,exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.map(e=>e._id===t?{...e,caption:a,status:y.IN_REVIEW}:e)}))}:e),{previousData:n}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}();return e(()=>{i(t?.caption??"")},[t]),/* @__PURE__ */o(k,{open:Boolean(t),onOpenChange:e=>!e&&n(),children:/* @__PURE__ */o(z,{className:"w-full max-w-lg",children:[
|
|
8
|
-
/* @__PURE__ */o(S,{children:/* @__PURE__ */o(M,{children:"Update caption"})}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"px-4",children:/* @__PURE__ */o(K,{label:"Caption",value:r,maxLength:1e3,rows:4,disabled:s.isPending,error:s.error instanceof Error?s.error.message:void 0,onInput:e=>i(e.currentTarget.value)})}),
|
|
10
|
-
/* @__PURE__ */o(_,{children:[/* @__PURE__ */o(A,{variant:"outlined",color:"foreground",disabled:s.isPending,onClick:n,children:"Cancel"}),/* @__PURE__ */o(A,{loading:s.isPending,onClick:async()=>{if(t)try{await s.mutateAsync({contentId:t._id,caption:r}),n()}catch{}},children:"Save"})]})]})})},W=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),Z=e=>{if(0===e.length)return"";if(1===e.length)return W(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=W(new Date(t).toISOString()),r=W(new Date(a).toISOString());return n===r?n:`${n} - ${r}`},J=()=>{const n=N(),l=x(),p=w(),{user:h,loadingUser:y,portalContainer:E,organization:S}=d(),_=t(null),q=t(null),O=t(!1),$=t(null),L=t(null),[B,K]=a(null),[V,Y]=a(null),[W,J]=a(null),{contents:X,loading:ee,hasNextPage:te,fetchNextPage:ae,isFetchingNextPage:ne}=function({sort:e="-createdAt",limit:t=20}={}){const{user:a,loadingUser:n,props:o,organization:i}=d(),s=o?.organizationId,l=a?.token,c=a?._id??a?.uid??null,{data:p,isLoading:h,isError:y,error:w,isFetchingNextPage:x,hasNextPage:N,fetchNextPage:b,refetch:T}=m({queryKey:[f.USER_UPLOADS,s??"",c,t,e],queryFn:async({pageParam:a=1})=>await g.get(v.MY_UPLOADS,{searchParams:"string"==typeof a?{after:a,limit:t,sort:e}:{page:a,limit:t,sort:e},headers:{"x-org-id":s,...l?{Authorization:`Bearer ${l}`}:{}}}).json(),initialPageParam:1,getPreviousPageParam:u,getNextPageParam:R,maxPages:25,staleTime:12e4,gcTime:3e5,enabled:!n&&!!a&&!0===i?.integrationSettings?.enableMyUploads});return{contents:r(()=>p?.pages?.flatMap(e=>e?.data??[])??[],[p]),loading:h,isError:y,error:w,isFetchingNextPage:x,hasNextPage:!!N,fetchNextPage:b,refetch:T,totalCount:p?.pages?.[0]?.meta?.totalCount??0}}({sort:"-createdAt",limit:20});e(()=>{y||h||n("/auth/login",{state:{referrer:l.pathname},replace:!0})},[y,h,n,l.pathname]),e(()=>{y||!S||S.integrationSettings?.enableMyUploads||n("/",{replace:!0})},[y,S,n]);const re=X.length>0,oe=!ee&&!re,ie=r(()=>{if(!X.length)return[];const e={};return X.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})},[X]);e(()=>()=>{q.current?.destroy(),q.current=null,_.current?.destroy?.(),_.current=null},[E]),e(()=>{const e=q.current;"memory"===p&&e?.isActive()&&!P(l.state)&&e.handleBack()},[l.state,p]);const se=i(async e=>{if(_.current||O.current)return;const t=$.current,a=e.target.closest("a");if(!t||!a||!t.contains(a))return;e.preventDefault(),O.current=!0;const r=Array.from(t.querySelectorAll("a")).indexOf(a);try{const[{default:e},{default:a},{default:o},{loadPhotoSwipe:i}]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./DeK1vU3V2.js"),import("./web.es.js").then(e=>e.t)]),s=new e({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:i,appendToEl:E??document.body});_.current=s;const c=new j(()=>window.pswp,"memory"===p?{location:l.pathname,state:l.state,push:(e,t)=>n(e,{state:t}),replace:(e,t)=>n(e,{state:t,replace:!0}),go:e=>n(e)}:void 0);q.current=c,s.on?.("beforeOpen",()=>c.open()),s.on?.("close",()=>{c.close(),q.current===c&&(q.current=null),_.current===s&&(_.current=null)}),new a(s),new o(s),s.init(),r>=0&&_.current?.loadAndOpen?.(r)}finally{O.current=!1}},[l.pathname,l.state,n,E,p]);e(()=>{const e=L.current;if(!e||!te)return;const t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&te&&!ne&&ae()},{rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[te,ne,ae]);const le=r(()=>X.find(e=>e._id===B)??null,[B,X]),ce=r(()=>X.find(e=>e._id===V)??null,[V,X]),de=W?F[W]:null;return S&&!S.integrationSettings?.enableMyUploads?null:/* @__PURE__ */o("div",{className:"bg-background min-h-screen w-full",children:[
|
|
11
|
-
/* @__PURE__ */o("div",{className:"relative flex items-center justify-center",children:[/* @__PURE__ */o(I,{}),/* @__PURE__ */o(b,{variant:"h4",align:"center",children:"My Uploads"})]}),
|
|
12
|
-
/* @__PURE__ */o("section",{className:"space-y-3",children:ee?/* @__PURE__ */o("div",{className:"space-y-8 py-4",children:Array.from({length:2}).map((e,t)=>/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */o(D,{className:"h-6 w-48"}),/* @__PURE__ */o(D,{className:"h-5 w-24"})]}),/* @__PURE__ */o("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__ */o(D,{className:"h-52 w-full lg:h-64"},t))})]},t))}):oe?/* @__PURE__ */o(C,{className:"py-12",title:"No uploads yet",description:"Photos and videos you upload to events will appear here."}):/* @__PURE__ */o(s,{children:[
|
|
13
|
-
/* @__PURE__ */o("div",{ref:$,onClickCapture:se,className:"space-y-8 py-4",children:ie.map(e=>/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */o(b,{variant:"h5",color:"muted",children:e.eventName}),/* @__PURE__ */o("span",{className:"text-muted-foreground text-sm font-light uppercase sm:text-base",children:Z(e.uploads)})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-1 sm:grid-cols-3 lg:grid-cols-4",children:e.uploads.map(e=>/* @__PURE__ */o("div",{className:"h-52 lg:h-64",children:/* @__PURE__ */o(G,{content:e,onDelete:K,onEditCaption:Y,onStatusClick:J})},e._id))})]},e.eventId))}),
|
|
14
|
-
/* @__PURE__ */o("div",{ref:L,className:"h-px w-full"}),ne&&/* @__PURE__ */o("div",{className:"my-6 w-full",children:/* @__PURE__ */o(T,{})})]})}),
|
|
15
|
-
/* @__PURE__ */o(Q,{content:le,onClose:()=>K(null),onDeleted:()=>K(null)}),
|
|
16
|
-
/* @__PURE__ */o(H,{content:ce,onClose:()=>Y(null)}),
|
|
17
|
-
/* @__PURE__ */o(k,{open:Boolean(W),onOpenChange:e=>!e&&J(null),children:/* @__PURE__ */o(z,{className:"w-full max-w-lg",children:[/* @__PURE__ */o("div",{className:"flex flex-col gap-4 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */o("div",{className:c("mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",de?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */o("span",{className:c("size-6",de?.color||"text-gray-500"),children:de?.icon||null})}),/* @__PURE__ */o("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[/* @__PURE__ */o(M,{children:de?.title||"Unknown Status"}),/* @__PURE__ */o(U,{children:de?.description||"Status information unavailable."})]})]}),/* @__PURE__ */o("div",{className:"flex justify-end p-4",children:/* @__PURE__ */o(A,{variant:"outlined",color:"foreground",onClick:()=>J(null),children:"Got it"})})]})})]})};export{J as default};
|
package/element/CYGIt75r2.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./BXMw4kNf.js";import{f as c,i as d,l as u,n as m}from"./Dpwx5KMy.js";import{n as g,r as h,t as f}from"./CJ_l5BYI.js";import{t as p}from"./DmpmrPE5.js";import{E as v,S as w,T,_ as y,a as N,c as x,d as q,f as b,g as E,h as C,i as S,l as I,m as L,o as z,p as k,s as M,u as A,x as _}from"./Bb9ydqSB.js";import{d as P,t as R}from"./Z3MoLpu5.js";import{n as V,t as F}from"./BszsxRY6.js";import{a as O,c as j,d as B,i as U,l as H,n as G,o as $,r as D,s as W,t as K,u as Q}from"./CkBayeWW.js";import{t as Z}from"./Dl6jcv9I.js";import{t as Y}from"./5r_0x4aK.js";import{t as J}from"./Bvc6t1Gu.js";import{t as X}from"./C0eP2utz.js";import{r as ee}from"./JY9kGm742.js";import{t as te}from"./Te9ieH1R2.js";import{n as ne,t as re}from"./BWjYmdOz2.js";import{t as ae}from"./fQmLbYcp2.js";import{a as ie,i as se,n as oe,o as le,r as ce,s as de,t as ue}from"./D1eaRhKY2.js";import{c as me,i as ge,n as he,t as fe}from"./C2WFktw12.js";import{n as pe,t as ve}from"./B_SYJsyF2.js";function we(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function Te({className:e}){/* @__PURE__ */
|
|
2
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function ye({className:e}){/* @__PURE__ */
|
|
3
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Ne=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,u]=r(!1),m=n(null),g=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!m.current||!t)return void u(!1);const e=m.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(g.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),u(c>o*a+1)},r=()=>{null!==g.current&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==g.current&&window.cancelAnimationFrame(g.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:d("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:m,className:d(V({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,c&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),c&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},xe=()=>{const{t:e}=ee(),{eventSlug:t}=P(),{event:n,parameters:r}=te({eventSlug:t}),{props:a,organization:i,folders:o}=m(),{curateLabel:l,leaderboardLabel:c}=a??{},{eventViews:d,contentCount:g,curationCount:h}=(({event:e})=>{const{props:t,organization:n}=m(),r=t?.organizationId,{isLoading:a,data:i}=u({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await p.get(S.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n}),f=Array.isArray(r)&&r.length>0,v=n?.engagementStyle===b.CONTEST||f,w=i?.integrationSettings?.showFolderBreadcrumb&&n?.folderId?H(o??[],n.folderId):[];/* @__PURE__ */
|
|
4
|
-
return s("div",{className:"w-full space-y-3 md:-mt-6",children:[w.length>0&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s(Q,{homeLink:_.PUBLIC_EVENTS,data:w})}),
|
|
5
|
-
/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(Ne,{description:n?.description})]}),i?.integrationSettings?.showEventStats&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s("div",{className:"flex items-center gap-6",children:[
|
|
6
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(ye,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:we(d??0)})]}),
|
|
7
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(Te,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:we(g??0)})]}),v&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(de,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:h})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&v||n?.engagementStyle===b.REACTION&&n?.showLeaderboard||n?.engagementStyle===b.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(R,{to:_.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(me,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&v&&/* @__PURE__ */s(R,{to:_.CURATE(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:l||e("content.curate","Rate")})}),n?.showLeaderboard&&/* @__PURE__ */s(R,{to:_.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(ae,{className:"size-5"}),children:c||e("content.leaderboard","Leaderboard")})})]})]})},qe=(e,t)=>["in-review-count",e??"",t??""];function be({className:e}){/* @__PURE__ */
|
|
8
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function Ee({className:e}){/* @__PURE__ */
|
|
9
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function Ce({className:e}){/* @__PURE__ */
|
|
10
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function Se({className:e}){/* @__PURE__ */
|
|
11
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function Ie({className:e}){/* @__PURE__ */
|
|
12
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M9 20v-4q-1.275-.1-2.5-.275t-2.45-.45q-.425-.1-.675-.475T3.25 14t.513-.625t.812-.1q1.825.425 3.688.575T12 14t3.738-.15t3.687-.575q.45-.1.825.1t.5.625t-.137.8t-.688.475q-1.225.275-2.45.45T15 16v4q0 .425-.287.713T14 21h-4q-.425 0-.712-.288T9 20m3-7q-.85 0-1.425-.575T10 11q0-.825.575-1.412T12 9q.825 0 1.413.588T14 11q0 .85-.587 1.425T12 13m-7.5-3q-.65 0-1.075-.425T3 8.5q0-.625.425-1.062T4.5 7q.625 0 1.063.438T6 8.5q0 .65-.437 1.075T4.5 10m15 0q-.65 0-1.075-.425T18 8.5q0-.625.425-1.062T19.5 7q.625 0 1.063.438T21 8.5q0 .65-.437 1.075T19.5 10M7.25 6.25q-.65 0-1.075-.425T5.75 4.75q0-.625.425-1.062T7.25 3.25q.625 0 1.063.438T8.75 4.75q0 .65-.437 1.075T7.25 6.25m9.5 0q-.65 0-1.075-.425T15.25 4.75q0-.625.425-1.062t1.075-.438q.625 0 1.063.438t.437 1.062q0 .65-.437 1.075t-1.063.425M12 5q-.65 0-1.075-.425T10.5 3.5q0-.625.425-1.062T12 2q.625 0 1.063.438T13.5 3.5q0 .65-.437 1.075T12 5"})})}function Le({className:e}){/* @__PURE__ */
|
|
13
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function ze({className:e}){/* @__PURE__ */
|
|
14
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function ke({className:e}){/* @__PURE__ */
|
|
15
|
-
return s("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__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var Me=({event:e})=>{const t=c(),{user:n,props:a}=m(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
|
|
16
|
-
return s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(o?ke:ze,{className:"size-6"})}),/* @__PURE__ */s(D,{align:"end",side:"bottom",className:"w-44",children:Object.values(E).map(r=>/* @__PURE__ */s(U,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await p.post(S.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:pe(r)},r))})]})},Ae=({event:e,onAutoscrollClick:t})=>{const{t:n}=ee(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=j(),{inReviewCount:d}=(e=>{const t=c(),{props:n}=m(),r=n?.organizationId,{role:a,isSuper:i}=j(),{isLoading:s,data:o,isError:l,error:d}=u({queryKey:qe(r,e?.slug),queryFn:async()=>{try{const t=await p.get(S.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${M.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?d:null,increment:()=>{t.setQueryData(qe(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(qe(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),g=r||i||o||l,h=r||i||o,f=a(()=>{const t=[];return h&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:be,href:C.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===L.PRIVATE&&g&&t.push({title:n("event.access_requests","Access Requests"),icon:Le,href:C.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===b.CONTEST&&h&&t.push({title:n("event.curation_details","Curation Details"),icon:Ie,href:C.EVENT_CURATION_DETAILS(e?.slug??"")}),h&&t.push({title:n("event.edit_event","Edit Event"),icon:$,href:C.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,h,g]);/* @__PURE__ */
|
|
17
|
-
return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(W,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{"aria-label":n("event.kiosk_mode","Kiosk Mode"),onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(Ce,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&h&&/* @__PURE__ */s(Me,{event:e}),g&&/* @__PURE__ */s(W,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:C.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(Ee,{className:"size-6"}),Number(d)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:d})]})}),f.length>0&&/* @__PURE__ */s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(Se,{className:"size-6"})}),/* @__PURE__ */s(D,{align:"end",side:"bottom",className:"w-48",children:f.map(e=>/* @__PURE__ */s(U,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function _e({className:e}){/* @__PURE__ */
|
|
18
|
-
return s("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__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Pe=({engagementStyle:e,sort:t=A,order:n=q,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=ee(),l=a(()=>{const t=Object.keys(z).map(e=>({text:o(`content.sortby_${z[e].label.toLowerCase()}`,z[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===b.CONTEST?t:t.filter(e=>e.value!==N.POPULAR)},[e,o]);/* @__PURE__ */
|
|
19
|
-
return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button","aria-label":"Sort "+(n===T.ASC?"descending":"ascending"),className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:d("text-foreground w-7 -scale-x-100 transition-transform",n===T.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(B,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Re=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ve=({value:t,onChange:a})=>{const[i,o]=r(!1),l=n(null),[c,d]=r(null);return e(()=>{if(!t)return void d(null);const e=URL.createObjectURL(t);return d(e),()=>{URL.revokeObjectURL(e)}},[t]),e(()=>{!t&&l.current&&(l.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button","aria-label":"Choose image for facial search",onClick:()=>l.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(i?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(i?ne:le,{})})}),t&&c&&/* @__PURE__ */s("img",{src:c,alt:"Facial Search",className:"size-10 rounded object-cover"}),
|
|
20
|
-
/* @__PURE__ */s("input",{ref:l,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Re.includes(n))return a(null);(async e=>{if(!e)return;o(!0);let t=e;try{const n=await ge(e);t=n.size/1024/1024>1?await he(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}o(!1),a(t)})(t)}})]})},Fe={[I.GRID]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})},[I.SINGLE]:{icon:/* @__PURE__ */s(_e,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),je=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:g,handleChange:h,face:f,onFaceImageChange:p})=>{const{t:v}=ee(),{organization:w}=m(),T=Boolean(w?.advancedSettings?.aiSettings?.faceRecognitionEnabled),y=!0===w?.integrationSettings?.showFacialSearch&&T,[N,x]=r(""),[q,b]=r(null),E=n(null),C=o(()=>{E.current&&(URL.revokeObjectURL(E.current),E.current=null)},[]),S=o(e=>{if(b(e),C(),e){const t=URL.createObjectURL(e);E.current=t,p?.(t)}else p?.(void 0)},[p,C]),I=o(e=>{x(e.target.value)},[]),L=o(e=>{const t=e.key;"Enter"===t?h&&h(N.length>0?N:""):"Escape"===t&&(x(""),h&&h(""))},[N,h]),z=o(()=>{x(""),h&&h("")},[h]),k=o(()=>{h&&h(N)},[N,h]);return e(()=>{f||b(null)},[f]),e(()=>()=>{C()},[C]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
|
|
21
|
-
/* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[w?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(B,{buttons:Oe,selected:i,onChange:l}),w?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
|
|
22
|
-
/* @__PURE__ */s(ve,{placeholder:v("content.search_placeholder","Search using text"),value:N,className:"py-2",onChange:I,onKeyUp:L}),N?.length>0&&/* @__PURE__ */s("button",{type:"button","aria-label":"Clear search",className:"absolute inset-y-0 right-10 flex items-center",onClick:z,children:/* @__PURE__ */s(X,{className:"text-foreground w-5"})}),
|
|
23
|
-
/* @__PURE__ */s("button",{type:"button","aria-label":"Search",className:"absolute inset-y-0 right-3 flex items-center",onClick:k,children:/* @__PURE__ */s(K,{className:"text-foreground w-5"})})]})}),y&&/* @__PURE__ */s(Ve,{value:q,onChange:S})]}),
|
|
24
|
-
/* @__PURE__ */s("div",{className:"col-span-3 md:col-span-1"}),
|
|
25
|
-
/* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(Pe,{engagementStyle:t,sort:c,order:u,onSortChange:d,onSortOrderChange:g})})]})},Be=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
26
|
-
/* @__PURE__ */s("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
27
|
-
/* @__PURE__ */s("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
28
|
-
/* @__PURE__ */s("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
29
|
-
/* @__PURE__ */s("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
30
|
-
/* @__PURE__ */s("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
31
|
-
/* @__PURE__ */s("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
32
|
-
/* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Ue=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=oe(),l=n(null),c=`gam-${t}-banner-${a??"ev"}`,d=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,u=null,m=null,g=null;const h=d?[d]:[],f=document.createElement("div");f.id=c,document.body.appendChild(f);const p=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(c);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],c)?.addService(window.googletag.pubads());l&&(t=l,u=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&l.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),s=ue({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:y.GAM_CLICK})}}),se(),window.googletag.display(c),n=window.setTimeout(()=>{e||(p(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==n&&window.clearTimeout(n),s?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,d,t,c]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},He=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=oe(),o=n(null),l=`gam-right-${r??"ev"}`,c=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,d=null,u=null,m=null,g=null;const h=c?[c]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const p=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,u=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&o.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),d=ue({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:y.GAM_CLICK})}}),se(),window.googletag.display(l),s=window.setTimeout(()=>{e||(p(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==s&&window.clearTimeout(s),d?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,c,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Ge=t(()=>import("./Cj_TL6Ks2.js")),$e=e=>e?.status===k.OPEN||Boolean(e?.isUnlimitedDuration&&!e?.endDate),De=e=>Array.isArray(e)&&e.length>0,We=()=>{const t=P().eventSlug,{loadingUser:u,organization:T}=m(),y=c(),[E,C]=r(""),[L,k]=r(void 0),[M,R]=r(A),[V,O]=r(q),[j,B]=r("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),U=n(null),{event:H,ads:G,gamConfig:$,parameters:D}=te({eventSlug:t}),{loading:W,isError:K,error:Q,refetch:ee,contentsWithAds:ne,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=A,order:i=q,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=m(),T=c?.organizationId,{isLoading:y,isError:N,error:b,data:E,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L,refetch:k}=h({queryKey:[w.CONTENTS_BY_EVENT(e?._id??""),T??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await p.get(S.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${v[i].sortOrder}${z[r].sortField}`,limit:l},headers:{"x-org-id":T,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(b){throw new Error(b instanceof Error?b.message:String(b)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>g(e),getNextPageParam:f,maxPages:30}),M=a(()=>E?.pages?.flatMap(e=>e?.data??[])??[],[E]);return{contents:M,contentsWithAds:a(()=>{const r=Boolean(n?.inGalleryEnabled);return((e=[],{ads:t,gamConfig:n,position:r,gamShare:a})=>{if(r<=0)return e;const i=Boolean(n?.inGalleryEnabled),s=t.length>0;if(!i&&!s)return e;const o=i?s?Math.min(1,Math.max(0,a)):1:0,l=e=>{const n=t.length>1?t.filter(t=>t._id!==e):t,r=n.reduce((e,t)=>e+Math.max(1,t.frequency??1),0);let a=Math.random()*r;for(const t of n)if(a-=Math.max(1,t.frequency??1),a<=0)return t;return n[n.length-1]};let c=null,d=0;const u=[];for(let m=0;m<e.length;m++)if(u.push(e[m]),(m+1)%r===0){if(i&&(!s||Math.floor((d+1)*o)>Math.floor(d*o))&&n){const e=s?l(c):null;u.push({_id:`gam-ad-slot-${d}`,type:x.GAM_AD,slotIndex:d,gamConfig:n,fallbackAd:e,width:n.sizes[0]?.[0]??300,height:n.sizes[0]?.[1]??250})}else{const e=l(c);c=e._id??null,u.push({...e,type:x.AD,adType:e.type})}d++}return u})(M,{ads:"gam"!==e?.adMode||r?t:[],gamConfig:r?n:null,position:e?.adPosition??0,gamShare:(n?.inGalleryBlend??50)/100})},[M,t,e,n]),loading:y,isError:N,error:b,refetch:k,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L}})({event:H,ads:G,gamConfig:$,sort:M,order:V,keywords:E,face:L}),{incrementEventView:le}=oe(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),f=n(null),p=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),x=n(),q=n(i),b=n(o),E=n(s),C=n(a);q.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(v.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===f.current&&(f.current=e);const r=Math.min((e-f.current)/1e3,.05);f.current=e,p.current+=60*m.current*r;const a=Math.floor(p.current);a>0&&(n.scrollTop+=a,p.current-=a),q.current&&!b.current&&!v.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(v.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),v.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),p.current=0,f.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==w.current&&w.current.release().catch(()=>{}).finally(()=>{w.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),x.current&&document.removeEventListener("fullscreenchange",x.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;w.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(w.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),x.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",x.current),y.current=!0),p.current=0,f.current=null,v.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se,onBottomReached:()=>H?._id&&y.refetchQueries({queryKey:[w.CONTENTS_BY_EVENT(H._id)]})});e(()=>{H?.slug&&le(H.slug)},[H?.slug,le]);const me=a(()=>j===I.SINGLE,[j]),ge=a(()=>/* @__PURE__ */s(Ae,{event:H,onAutoscrollClick:ce}),[H,ce]),he=n(null),pe=n({hasNextPage:ae,isFetchingNextPage:se,loading:W,running:ue,fetchNextPage:ie});pe.current={hasNextPage:ae,isFetchingNextPage:se,loading:W,running:ue,fetchNextPage:ie},e(()=>(he.current=new IntersectionObserver(e=>{const t=pe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{he.current?.disconnect(),he.current=null}),[]);const ve=o(e=>{const t=he.current;t&&(t.disconnect(),e&&t.observe(e))},[]),we=$?.bannerPositions??[],Te=T?._id,ye=$&&we.includes("right"),Ne=Boolean(T?.advancedSettings?.aiSettings?.faceRecognitionEnabled),qe=Boolean(T?.integrationSettings?.showQuickSearch)&&Ne;/* @__PURE__ */
|
|
33
|
-
return s("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
|
|
34
|
-
/* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:ge}),
|
|
35
|
-
/* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(xe,{})}),$&&we.includes("top")&&/* @__PURE__ */s(Ue,{position:"top",gamConfig:$,eventId:H?._id,organizationId:Te}),
|
|
36
|
-
/* @__PURE__ */s(je,{engagementStyle:H?.engagementStyle,disabled:u||W,mode:j,onModeChange:e=>B(e),sort:M,sortOrder:V,onSortChange:e=>R(e),onSortOrderChange:()=>O("asc"===V?"desc":"asc"),handleChange:C,face:L,onFaceImageChange:e=>k(e)}),L&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:L,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(re,{color:"error",icon:/* @__PURE__ */s(X,{className:"size-5"}),onClick:()=>k(void 0),children:"Clear search"})})]}),
|
|
37
|
-
/* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[u||W?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}):K?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:Q?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(F,{variant:"body2",color:"muted",align:"center",children:Q?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(fe,{className:"size-5"}),onClick:()=>{ee()},children:"Retry"})]})})}):ne?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Be,{})})}):/* @__PURE__ */s(l,{children:[
|
|
38
|
-
/* @__PURE__ */s("div",{ref:U,className:d(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}),children:/* @__PURE__ */s(Ge,{event:H,contents:ne,gamConfig:$,singleColumnMode:me,kioskMode:ue,timestampField:M===N.CAPTURE_TIME?"capturedAt":void 0,curateLink:(H?.engagementStyle===b.CONTEST||De(D))&&$e(H)&&H?.slug?_.CURATE(H.slug):void 0,onChangeFaceUrl:e=>k(e),showQuickSearch:qe})})}),
|
|
39
|
-
/* @__PURE__ */s("div",{ref:ve,className:"h-4 w-full","aria-hidden":"true"}),se&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(Z,{className:"size-8"})})]}),$&&we.includes("bottom")&&/* @__PURE__ */s(Ue,{position:"bottom",gamConfig:$,eventId:H?._id,organizationId:Te})]}),ye&&/* @__PURE__ */s(He,{gamConfig:$,eventId:H?._id,organizationId:Te})]})]})};export{We as default};
|
package/element/Cj_TL6Ks2.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{D as e,E as t,T as n,_ as r,b as o,f as i,g as a,h as s,i as l,m as c,n as d,o as u,p as h,t as p,v as m,w as g,y as f}from"./BXMw4kNf.js";import{a as v,f as w,i as y,n as b}from"./Dpwx5KMy.js";import{t as x}from"./BCmdnJKF.js";import{t as N}from"./DmpmrPE5.js";import{S as k,_ as T,c as C,f as I,g as E,i as q,r as M,x as A}from"./Bb9ydqSB.js";import{f as L,l as S,n as _,t as z,u as j}from"./Z3MoLpu5.js";import{t as P}from"./BszsxRY6.js";import{n as O}from"./BWKUiudT.js";import{t as R}from"./Bki5T_lb.js";import{n as U,r as $,t as F}from"./D5Ja4Yts.js";import{n as G}from"./Bq48A0Iv.js";import{t as B}from"./BWjYmdOz2.js";import{n as D,t as V}from"./7IEzYICH2.js";import{a as W,i as H,n as K,o as Q,r as Y,s as Z,t as J}from"./D1eaRhKY2.js";import{a as X,n as ee,o as te,r as ne,t as re}from"./CHYm7f-K2.js";function oe(e){return["react-photo-album",e].filter(Boolean).join("--")}function ie({width:e,height:t}){const n=e/t;return Number.isFinite(n)?n:1}var ae=Object.freeze([1200,600,300,0]);function se(e,t){return"function"==typeof e?e(t):e}function le(e,t){return void 0!==t?se(e,t):void 0}function ce(e,t,n,r=0){if(void 0===t)return;const o=le(e,t);return Math.round(Math.max(void 0===o?function(e,t){const n=ae.findIndex(e=>e<=t);return se(e[Math.max(n,0)],t)}(n,t):o,r))}function de(e,{spacing:t,padding:n,componentsProps:r,render:o}){return{spacing:ce(t,e,[20,15,10,5]),padding:ce(n,e,[0,0,0,0]),componentsProps:se(r,e)||{},render:se(o,e)}}function ue(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function he(e,t,n,r,o,i,a){let s,l;const c=e=>{const t=i*(o-1)+2*a*o;return`calc((${e.match(/^\s*calc\((.*)\)\s*$/)?.[1]??e} - ${t}px) / ${ue((r-t)/n,5)})`},d=e.srcSet;return d&&d.length>0&&(s=d.concat(d.some(({width:t})=>t===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", ")),l=t?.size?(t.sizes||[]).map(({viewport:e,size:t})=>`${e} ${c(t)}`).concat(c(t.size)).join(", "):`${Math.ceil(n/r*100)}vw`,{srcSet:s,sizes:l}}var pe=l(function({as:e,render:t,context:n,classes:r=[],variables:o={},style:i,className:a,children:s,...l},c){const d=function(...e){return e.filter(Boolean).join(" ")}(...(Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e).map(oe),a),u={style:{...Object.fromEntries(Object.entries(o).map(([e,t])=>{return[(n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${oe(n)}`),"number"==typeof t?ue(t,5):t];var n})),...i},className:d,children:s,...l};if(t){const e=t({ref:c,...u},n);if(e)return e}return p(e||"div",{ref:c,...u})}),me=l(function({photo:e,index:t,width:n,height:r,onClick:o,render:{wrapper:i,link:a,button:s,image:l,extras:c}={},componentsProps:{link:d,button:u,wrapper:h,image:m}={}},g){const{href:f}=e,v={photo:e,index:t,width:ue(n,3),height:ue(r,3)};let w;return w=f?{...d,as:"a",render:a,classes:["photo","link"],href:f,onClick:o}:o?{...u,as:"button",type:"button",render:s,classes:["photo","button"],onClick:o}:{...h,render:i,classes:"photo"},p(pe,{ref:g,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...w,children:[p(pe,{as:"img",classes:"image",render:l,context:v,...m}),c?.({},v)]})}),ge=l(function({layout:t,sizes:n,model:r,skeleton:o,onClick:i,render:{container:a,track:s,photo:l,...c}={},componentsProps:{container:d,track:u,link:h,button:m,wrapper:g,image:f}={}},v){const{spacing:w,padding:y,containerWidth:b,tracks:x,variables:N,horizontal:k}=r||{};return p(pe,{role:"group","aria-label":"Photo album",...d,variables:{spacing:w,padding:y,containerWidth:b,...N},classes:["",t],render:a,ref:v,children:[void 0!==w&&void 0!==y&&void 0!==b&&x?.map(({photos:t,variables:r},o)=>{const a=t.length,d=k?a:x.length;return e(pe,{...u,key:o,render:s,classes:"track",variables:{trackSize:a,...r}},t.map(e=>{const{photo:t,index:r,width:o}=e,{key:a,src:s,alt:u="",title:v,label:x}=t,N=i?e=>{i({event:e,photo:t,index:r})}:void 0;if(l){const t=l({onClick:N},e);if(t)return t}const k=e=>x?{"aria-label":x,...e}:e;return p(me,{onClick:N,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:s,alt:u,title:v,...he(t,n,o,b,d,w,y),...se(f,e)},link:k(se(h,e)),button:k(se(m,e)),wrapper:se(g,e)},...e},a??r)}))}),void 0===b&&o]})});function fe(e,t,n,r){return(t-(e.length-1)*n-2*r*e.length)/e.reduce((e,t)=>e+ie(t),0)}function ve(e,t,n,r,o,i,a){const s=e.slice(t,n),l=fe(s,r,o,i);return l>0?(l-a)**2*s.length:void 0}function we(e,t){const[n,r]=e;if(n===t)return e;if(void 0!==r&&void 0!==t&&void 0!==n&&t===r&&Math.abs(t-n)<=20){const o=Math.min(n,t),i=Math.max(n,t);return o===n&&i===r?e:[o,i]}return[t,n]}function ye(e,t,n){const[[r],a]=o(we,[n]),l=function(e){const[t,n]=s(e);return e===t||e&&t&&e.length===t.length&&!e.some((e,n)=>e!==t[n])?t:(n(e),e)}(t),c=i(void 0);return{containerRef:m(t=>{c.current?.disconnect(),c.current=void 0;const n=()=>a(function(e,t){let n=e?.clientWidth;if(void 0!==n&&t&&t.length>0){const e=[...t.filter(e=>e>0)].sort((e,t)=>t-e);e.push(Math.floor(e[e.length-1]/2)),n=e.find((t,r)=>t<=n||r===e.length-1)}return n}(t,l));n(),t&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(t)),"function"==typeof e?e(t):e&&(e.current=t)},[e,l]),containerWidth:r}}var be=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(e,{photos:t,targetRowHeight:n,rowConstraints:r,...o}){const{spacing:i,padding:a,componentsProps:s,render:l}=de(e,o),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=le(r,e)||{};if(void 0!==c&&void 0!==i&&void 0!==a){const e=Math.floor(t.reduce((e,{width:t,height:n})=>e+t/n*c+2*a,i*(t.length-1)));e>0&&(s.container={...s.container},s.container.style={maxWidth:e,...s.container.style})}return{...o,targetRowHeight:ce(n,e,[e=>e/5,e=>e/4,e=>e/3,e=>e/2]),render:l,spacing:i,padding:a,minPhotos:d,maxPhotos:u,componentsProps:s}}(a,{photos:e,...r});return p(ge,{layout:"rows",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?function(e,t,n,r,o,i,a){const s=Math.min(function(e,t,n,r){return ue(t/n/Math.min(...e.map(e=>ie(e))))+(r||0)+2}(e,r,o,i),a||1/0),l=i||1,c=e.length,d=new Array(c+1).fill(1/0),u=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let i=m-l;i>=Math.max(0,m-s);i-=1){if(d[i]===1/0)continue;const a=ve(e,i,m,r,t,n,o);if(void 0===a)break;const s=d[i]+a;(d[m]===1/0||d[m]>s&&(d[m]/s>1.005||-1!==u[m]&&u[m]<i))&&(d[m]=s,u[m]=i)}if(d[c]===1/0)return;const h=[];for(let m=c;0!==m;m=u[m])h.push(m);h.push(0),h.reverse();const p=[];for(let m=1;m<h.length;m+=1){const o=e.slice(h[m-1],h[m]).map((e,t)=>({photo:e,index:h[m-1]+t})),i=fe(o.map(({photo:e})=>e),r,t,n);p.push({photos:o.map(({photo:e,index:t})=>({photo:e,index:t,width:i*ie(e),height:i}))})}return{spacing:t,padding:n,containerWidth:r,tracks:p,horizontal:!0}}(e,s,l,a,c,d,u):void 0,[e,s,l,a,c,d,u]),...m})});function xe(e,t,n,r,o,i,a){const s=[],l=a.reduce((e,t)=>e+t,0);for(let c=0;c<e.length-1;c+=1){const d=t.slice(e[c],e[c+1]).map((t,n)=>({photo:t,index:e[c]+n})),u=a.reduce((e,t,n)=>e+(i[c]-i[n])*t,0),h=(o-(e.length-2)*n-2*(e.length-1)*r-u)*a[c]/l;s.push({photos:d.map(({photo:e,index:t})=>({photo:e,index:t,width:h,height:h/ie(e)})),variables:{adjustedGaps:u,columnRatio:a[c]}})}return{tracks:s,variables:{totalRatio:l}}}function Ne(e,t,n,r,o,i){const a=[],s=[];if(e.length<=i){const o=e.length>0?e.reduce((e,t)=>e+ie(t),0)/e.length:1;for(let t=0;t<i;t+=1)a[t]=2*n,s[t]=t<e.length?ie(e[t]):o;return xe(Array.from({length:i+1},(t,n)=>Math.min(n,e.length)),e,t,n,r,a,s)}const l=(c=function(e,t,n,r,o){return i=>{const a=[],s=1.5*o;let l=r/ie(e[i])+2*n;for(let c=i+1;c<e.length+1&&(a.push([c,(o-l)**2]),!(l>s||c===e.length));c+=1)l+=r/ie(e[c])+t+2*n;return a}}(e,t,n,o,(e.reduce((e,t)=>e+o/ie(t),0)+t*(e.length-i)+2*n*e.length)/i),d=i,u=0,h=e.length,function(e,t,n){const r=[n];for(let o=n,i=t;i>0;i-=1)[o]=e.get(o)[i],r.push(o);return r.reverse()}(function(e,t,n,r){const o=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;i.add(n);for(let a=0;a<t;a+=1){const n=[...i.keys()];i.clear(),n.forEach(n=>{const s=a>0?o.get(n)[a][1]:0;e(n).forEach(([e,l])=>{let c=o.get(e);c||(c=[],o.set(e,c));const d=s+l,u=c[a+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[a+1]=[n,d]),a<t-1&&e!==r&&i.add(e)})})}return o}(c,d,u,h),d,h));var c,d,u,h;for(let p=0;p<l.length-1;p+=1){const r=e.slice(l[p],l[p+1]);a[p]=t*(r.length-1)+2*n*r.length,s[p]=1/r.reduce((e,t)=>e+1/ie(t),0)}return xe(l,e,t,n,r,a,s)}function ke(e,t,n,r,o){const{tracks:i,variables:a}=Ne(e,t,n,r,(r-t*(o-1)-2*n*o)/o,o);return i.some(e=>e.photos.some(({width:e,height:t})=>e<=0||t<=0))?o>1?ke(e,t,n,r,o-1):void 0:{tracks:i,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...a}}}var Te=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return p(ge,{layout:"columns",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?ke(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})});function Ce(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?Ce(e,t,n,r,o-1):void 0;const a=[];for(let l=0;l<o;l+=1)a[l]=0;const s=e.reduce((e,r,o)=>{const s=a.reduce((e,t,n)=>t<a[e]-1?n:e,0);return a[s]=a[s]+i/ie(r)+t+2*n,e[s].push({photo:r,index:o}),e},Array.from({length:o},()=>[]));return{spacing:t,padding:n,containerWidth:r,variables:{columns:o},tracks:s.map(e=>({photos:e.map(({photo:e,index:t})=>({photo:e,index:t,width:i,height:i/ie(e)}))}))}}var Ie=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return p(ge,{layout:"masonry",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?Ce(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})}),Ee={[String(M.NONE)]:function({className:e}){/* @__PURE__ */
|
|
2
|
-
return p("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__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[M.LINK]:function({className:e}){/* @__PURE__ */
|
|
3
|
-
return p("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__ */p("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[M.EMAIL]:function({className:e}){/* @__PURE__ */
|
|
4
|
-
return p("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__ */p("path",{fill:"currentColor",d:"M12 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 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[M.PHONE]:function({className:e}){/* @__PURE__ */
|
|
5
|
-
return p("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__ */p("path",{fill:"currentColor",d:"M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"})})},[M.SMS]:function({className:e}){/* @__PURE__ */
|
|
6
|
-
return p("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__ */p("path",{fill:"currentColor",d:"m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4.713-5.288Q9 10.425 9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11t.713-.288m4 0Q13 10.426 13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11t.713-.288m4 0Q17 10.426 17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11t.713-.288"})})},[M.WHATSAPP]:function({className:e}){/* @__PURE__ */
|
|
7
|
-
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 258",className:e,"aria-hidden":"true",focusable:"false",children:[
|
|
8
|
-
/* @__PURE__ */p("defs",{children:[/* @__PURE__ */p("linearGradient",{id:"SVGK3KZq49U",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#1faf38"}),/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#60d669"})]}),/* @__PURE__ */p("linearGradient",{id:"SVGefMkoEOd",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#f9f9f9"}),/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#fff"})]})]}),
|
|
9
|
-
/* @__PURE__ */p("path",{fill:"url(#SVGK3KZq49U)",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"}),
|
|
10
|
-
/* @__PURE__ */p("path",{fill:"url(#SVGefMkoEOd)",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"}),
|
|
11
|
-
/* @__PURE__ */p("path",{fill:"#fff",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"})]})},[M.MESSENGER]:function({className:e}){/* @__PURE__ */
|
|
12
|
-
return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:e,"aria-hidden":"true",focusable:"false",children:[
|
|
13
|
-
/* @__PURE__ */p("defs",{children:/* @__PURE__ */p("radialGradient",{id:"SVGhphmYc3G",cx:"19.247%",cy:"99.465%",r:"108.96%",fx:"19.247%",fy:"99.465%",children:[
|
|
14
|
-
/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#09f"}),
|
|
15
|
-
/* @__PURE__ */p("stop",{offset:"60.975%","stop-color":"#a033ff"}),
|
|
16
|
-
/* @__PURE__ */p("stop",{offset:"93.482%","stop-color":"#ff5280"}),
|
|
17
|
-
/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
|
|
18
|
-
/* @__PURE__ */p("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
|
|
19
|
-
/* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},qe=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==M.NONE),i=Ee[t?.targetType]??Ee[M.LINK],a=t?.imageUrl&&R(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
|
|
20
|
-
return p(re,{open:Boolean(e&&t),onOpenChange:e=>!e&&n?.(),children:/* @__PURE__ */p(ee,{className:"border-none p-0",children:[/* @__PURE__ */p(X,{className:"sr-only",children:[/* @__PURE__ */p(te,{children:t?.title}),/* @__PURE__ */p(ne,{children:t?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[a&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:a,alt:t?.title||"Advertisement"}),
|
|
21
|
-
/* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(P,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */p(P,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */p(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??M.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */p(i,{className:"size-5"}),children:t?.targetText})]})]})})};function Me(e,t){if(e.content?._id!==t.content?._id)return!1;if(e.style?.width!==t.style?.width||e.style?.height!==t.style?.height)return!1;for(const n of Object.keys(e))if("content"!==n&&"style"!==n&&e[n]!==t[n])return!1;return!0}var Ae=u(({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:a,captureAdClick:s}=K(),l=Boolean(n&&r),c=t.ctaBg||"#ff4800",d=t.ctaForeground||"#FFFFFF",u=Ee[t?.targetType??M.LINK];/* @__PURE__ */
|
|
22
|
-
return p("div",{style:e,className:"group relative mb-1 overflow-hidden rounded",children:[
|
|
23
|
-
/* @__PURE__ */p(O,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>a(t._id),children:/* @__PURE__ */p($,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:l?()=>r?.(t):void 0,pswpData:{id:t._id,type:C.AD,hash:t._id,width:t.width,height:t.height,title:t.title,description:t.description,targetType:t.targetType,targetText:t.targetText,targetUrl:t.targetUrl,thumbnailUrl:t.imageUrl,blurhash:t.blurhash}})}),
|
|
24
|
-
/* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!o&&(t.title||t.targetType!==M.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[t.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==M.NONE&&/* @__PURE__ */p("button",{type:"button",className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{l?r?.(t):s(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(u,{})}),t?.targetText]})]})]})},Me),Le=u(({style:e,gamConfig:t,slotIndex:n,eventId:o,organizationId:a})=>{const l=i(null),c=i(null),{trackGamAnalytics:d}=K(),[u,h]=s(!1),m=`gam-slot-${o??"ev"}-${n}`,g=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),f=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),v=i({w:g,h:f});return r(()=>{if(!u)return;let e=!1,n=null,r=null,i=null,s=null;return(async()=>{await W(),!e&&l.current&&window.googletag.cmd.push(()=>{if(e)return;Y(m);const{w:u,h:h}=v.current,p=[[u,h],...t.sizes],g=window.googletag.defineSlot(t.adUnitPath,p,m)?.addService(window.googletag.pubads());if(!g)return;c.current=g,r=window.googletag.pubads(),o?g.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&g.setConfig({targeting:{qrati_category:t.categories}}),i=e=>{e.slot===g&&d({eventId:o,organizationId:a,type:T.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",i),s=e=>{e.slot===g&&d({eventId:o,organizationId:a,type:T.GAM_VIEWABLE})},r.addEventListener("impressionViewable",s);const f=l.current;f&&(n=J({container:f,onClick:()=>{d({eventId:o,organizationId:a,type:T.GAM_CLICK})}}),H(),window.googletag.display(m))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(i&&r.removeEventListener("slotRenderEnded",i),s&&r.removeEventListener("impressionViewable",s));const t=c.current;c.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[u,o,t.adUnitPath,t.categories,a,m]),/* @__PURE__ */p("div",{style:{width:g,height:f},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p(O,{className:"size-full",threshold:.1,rootMargin:"200px",triggerOnce:!0,onChange:h,children:/* @__PURE__ */p("div",{id:m,ref:l,style:{width:g,height:f},className:"gam-ad-slot"})})})},Me),Se=(e,t)=>{if(!e||!t)return null;const n=t[e];if(!n)return null;try{const e=new Date(String(n)),t=/* @__PURE__ */new Date,r=e.getFullYear()===t.getFullYear(),o={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return r||(o.year="numeric"),e.toLocaleString("en-US",o).replace(","," •")}catch{return null}},_e=t(null),ze=()=>{const e=f(_e);if(!e)throw new Error("Popover components must be used within a Popover");return e},je=({children:e,className:t,open:n,onOpenChange:r})=>{const[o,l]=s(!1),c="boolean"==typeof n,d=c?n:o,u=a(),h=`popover-trigger-${u}`,m=`popover-content-${u}`,g=i(null);/* @__PURE__ */
|
|
25
|
-
return p(_e.Provider,{value:{isOpen:d,setIsOpen:e=>{c||l(e),r?.(e)},triggerId:h,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:y("relative inline-block",t),children:e})})},Pe=({children:e,asChild:t,className:r,onClick:o,...i})=>{const{isOpen:a,setIsOpen:s,triggerId:l,contentId:c,triggerRef:d}=ze();if(t){const t=Array.isArray(e)?e[0]:e;if(t&&t.type){const e=t.props?.className;return n(t,{ref:e=>{d.current=e},id:l,className:r?e?`${e} ${r}`:r:e,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?c:void 0,onClick:e=>{s(!a),t.props?.onClick?.(e)},"data-state":a?"open":"closed"})}}/* @__PURE__ */
|
|
26
|
-
return p("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?c:void 0,"data-slot":"popover-trigger","data-state":a?"open":"closed",className:r,onClick:e=>{s(!a),o?.(e)},...i,children:e})},Oe=({children:e,className:t,align:n="center",side:o="top",sideOffset:a=4,...l})=>{const{isOpen:u,setIsOpen:h,contentId:m,triggerRef:g}=ze(),{organization:f,portalContainer:w}=b(),x=i(null),[N,k]=s(null);if(c(()=>{if(!u)return;const e=()=>{if(!g.current||!x.current)return;const e=g.current.getBoundingClientRect(),t=x.current.getBoundingClientRect();let r=e.left,i=e.bottom+a;"center"===n&&(r=e.left+e.width/2-t.width/2),"end"===n&&(r=e.right-t.width),"top"===o&&(i=e.top-t.height-a),"left"===o&&(r=e.left-t.width-a,i=e.top+e.height/2-t.height/2),"right"===o&&(r=e.right+a,i=e.top+e.height/2-t.height/2),"bottom"===o&&(i=e.bottom+a),k({top:i,left:r})},t=requestAnimationFrame(e);return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[n,u,o,a,g]),r(()=>{if(!u)return;const e=e=>{const t="function"==typeof e.composedPath?e.composedPath():[],n=e.target,r=x.current&&(x.current.contains(n)||t.includes(x.current)),o=g.current&&(g.current.contains(n)||t.includes(g.current));r||o||h(!1)},t=e=>{"Escape"===e.key&&(h(!1),g.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",e)},0);return document.addEventListener("keydown",t),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u,h,g]),!u)return null;const T=/* @__PURE__ */p("div",{ref:x,id:m,role:"dialog","aria-modal":"false","data-state":u?"open":"closed",className:y("bg-background text-foreground border-border shadow-outer rounded outline-none",t),style:{position:"fixed",top:N?.top??0,left:N?.left??0,zIndex:2010,...v(f)},...l,children:e});return"undefined"!=typeof document?d(T,w??document.body):T},Re=({eventId:e,contentId:t,emojis:n=[],counts:o={},userReaction:a})=>{const{user:l,props:c,organization:d}=b(),u=c?.loginUrl,{handleReactionClick:h,isPending:m}=(()=>{const e=w(),{props:t,user:n}=b(),r=t?.organizationId,o=x({mutationFn:async({eventId:e,contentId:t,emoji:o})=>N.post(q.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}}).json(),onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[k.CONTENTS_BY_EVENT(t)];await e.cancelQueries({queryKey:o});const i=e.getQueriesData({queryKey:o});return e.setQueriesData({queryKey:o},e=>((e,t,n)=>{if(!e?.pages||!Array.isArray(e.pages))return e;let r=!1;const o=e.pages.map(e=>{if(!e.data)return e;let o=!1;const i=e.data.map(e=>{if(e._id!==t||e.userReaction===n)return e;r=!0,o=!0;const i={...e.reactionCounts??{}};return e.userReaction&&(i[e.userReaction]=Math.max(0,(i[e.userReaction]??1)-1)),i[n]=(i[n]??0)+1,{...e,reactionCounts:i,userReaction:n}});return o?{...e,data:i}:e});return r?{...e,pages:o}:e})(e,n,r)),{previousData:i}},onError:(t,n,r)=>{r?.previousData?.forEach(([t,n])=>{e.setQueryData(t,n)}),G.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return G.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:e,contentId:t,emoji:r}),!0}catch(i){return!1}},isPending:o.isPending}})(),[g,f]=s(!1),[v,T]=s(null),C=i(null),I=n.reduce((e,t)=>e+(o[t]||0),0);return r(()=>()=>{C.current&&clearTimeout(C.current)},[]),/* @__PURE__ */p(je,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Pe,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:y("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((e,t)=>(o[t]||0)-(o[e]||0)).slice(0,1).map(e=>/* @__PURE__ */p("span",{className:y("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),I>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */p(Oe,{side:"top",align:"end",children:[l?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
|
|
27
|
-
/* @__PURE__ */p("a",{className:"text-info underline",href:u,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
|
|
28
|
-
/* @__PURE__ */p(z,{className:"text-info underline",to:A.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:n.map(n=>{const r=a===n;/* @__PURE__ */
|
|
29
|
-
return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:o[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:y("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",r?"scale-125":"hover:scale-110",v===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&h&&(T(n),f(!1),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>T(null),180),h(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},Ue=({event:e={},content:t,curateLink:n})=>{if(e.engagementStyle===I.CONTEST||n){const e=/* @__PURE__ */p("span",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(Z,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]});return n?/* @__PURE__ */p(_,{to:n,children:e}):e}return e.engagementStyle===I.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */p(Re,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,counts:t.reactionCounts||{},userReaction:t.userReaction}):null},$e=({content:e})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */p("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */p("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */p("div",{className:"flex items-center justify-between",children:/* @__PURE__ */p("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),Fe=u(({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,imageSearchProviders:l=D,organizationId:c})=>{const d=`content-${t._id}`,u=h(()=>Se(r,t),[r,t]),f=m(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),v=h(()=>({id:t._id,type:C.IMAGE,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}),[t._id,t.width,t.height,t.thumbnailUrl,t.blurhash,t.caption]);/* @__PURE__ */
|
|
30
|
-
return p("div",{id:d,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p($,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:v}),!a&&/* @__PURE__ */p(g,{children:[u&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:u}),
|
|
31
|
-
/* @__PURE__ */p("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */p("button",{type:"button","aria-label":"Search by face",className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-[opacity,transform] sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:f,children:/* @__PURE__ */p(Q,{className:"text-primary-foreground"})}),t.url&&/* @__PURE__ */p(V,{providers:l,imageUrl:t.url,surface:"gallery",organizationId:c,eventId:e?._id,contentId:t._id})]}),
|
|
32
|
-
/* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p($e,{content:t})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ue,{event:e,content:t,curateLink:o})})]})]})]})},Me),Ge=u(({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=h(()=>Se(r,e),[r,e]);/* @__PURE__ */
|
|
33
|
-
return p("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */p($,{url:e.src??e.url,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,alt:e.caption,curateLink:o,pswpData:{id:e._id,type:C.VIDEO,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}}),!i&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
|
|
34
|
-
/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p($e,{content:e})}),
|
|
35
|
-
/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ue,{event:n,content:e,curateLink:o})})]})]})},Me),Be=({event:e,contents:t=[],gamConfig:n,singleColumnMode:o,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const f=i(null),v=i(null),w=i(!1),x=i(null),N=h(()=>`gallery-${e?._id??""}`,[e?._id]),{captureAdImpression:k,captureAdClick:T}=K(),I=j(),q=S(),M=L(),{portalContainer:A,organization:_}=b(),z=_?._id,P=_?.advancedSettings?.imageSearchProviders?.gallery??D,O=_?.advancedSettings?.imageSearchProviders?.lightbox??D,[R,$]=s(null);r(()=>()=>{v.current?.destroy(),v.current=null,f.current?.destroy?.(),f.current=null},[e?.galleryLayout,c,N,A]);const G=m(async t=>{if(c||f.current||w.current)return;const n=x.current,r=t.target.closest("a");if(!n||!r||!n.contains(r))return;t.preventDefault(),w.current=!0;const o=Array.from(n.querySelectorAll("a")).indexOf(r);try{const[{default:t},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c},{loadPhotoSwipe:d},u]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./BYM2GyVF2.js"),import("./BNaRcekR2.js"),import("./DeK1vU3V2.js"),import("./CtxIOzTC2.js"),import("./1dmOpMwn2.js"),import("./web.es.js").then(e=>e.t),O.length>0?import("./CIcQE2CN2.js"):Promise.resolve(null)]),h=new t({gallery:n,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:d,appendToEl:A??document.body});f.current=h;const p=new F(()=>window.pswp,"memory"===M?{location:q.pathname,state:q.state,push:(e,t)=>I(e,{state:t}),replace:(e,t)=>I(e,{state:t,replace:!0}),go:e=>I(e)}:void 0);v.current=p,h.on("beforeOpen",()=>p.open()),h.on("close",()=>{p.close(),v.current===p&&(v.current=null)}),new r(h),new i(h),u&&new u.default(h,O,{organizationId:z,eventId:e?._id}),new a(h),new s(h,k,T),new l(h),new c(h),h.init(),o>=0&&f.current?.loadAndOpen?.(o)}finally{w.current=!1}},[c,A,k,T,O,z,e?._id,q.pathname,q.state,I,M]);r(()=>{const e=v.current;"memory"===M&&e?.isActive()&&!U(q.state)&&e.handleBack()},[q.state,M]);const B=h(()=>{switch(e?.galleryLayout){case E.ROW:return be;case E.COLUMN:return Te;case E.MASONRY:return Ie;default:return be}},[e?.galleryLayout]),V=h(()=>t.map(e=>{const t=e.type===C.IMAGE||e.type===C.VIDEO?e.url:e.type===C.GAM_AD?"":e.imageUrl;return{...e,src:t??"",width:e.dimension?.width||e.width||4,height:e.dimension?.height||e.height||3}}),[t]),W=h(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */p("div",{ref:e,className:t??"",children:n}),photo:(t,{photo:r,width:o,height:i,index:s})=>{const h=r;let m=null;switch(h.type){case C.IMAGE:m=Fe;break;case C.VIDEO:m=Ge;break;case C.AD:m=Ae;break;case C.GAM_AD:return n?/* @__PURE__ */p(Le,{style:{width:o,height:i},gamConfig:n,slotIndex:h.slotIndex??s,eventId:e?._id,organizationId:z},`${h._id??s}-${s}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:o,height:i},event:e,content:h,timestampField:l,onAdClick:c?$:void 0,hideControls:a,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u,imageSearchProviders:P,organizationId:z},`${h._id??s}-${s}`):null}}),[e,n,z,l,c,a,d,u,P]);/* @__PURE__ */
|
|
36
|
-
return p(g,{children:[/* @__PURE__ */p("div",{id:N,ref:x,onClickCapture:G,className:y(o?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(B,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o?(t.minPhotos=1,t.maxPhotos=1):t.maxPhotos=e<400?2:e<800?3:4,t},columns:e=>o?1:e<400?2:e<800?3:4,photos:V,render:W})}),/* @__PURE__ */p(qe,{open:Boolean(R),ad:R,onClose:()=>$(null),captureAdClick:T})]})};export{Be as default};
|
package/element/CkBayeWW.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{E as e,S as t,T as r,_ as o,f as a,h as n,p as s,t as l,v as i,w as d,y as c}from"./BXMw4kNf.js";import{a as m,i as p,n as u}from"./Dpwx5KMy.js";import{t as h,x as f}from"./Bb9ydqSB.js";import{t as v}from"./Z3MoLpu5.js";import{r as b,t as g}from"./BszsxRY6.js";import{t as x}from"./DXjc6xIy.js";var q=b("inline-flex h-fit flex-auto cursor-pointer items-center justify-center border transition-all duration-200 focus:outline-none active:scale-95",{variants:{size:{sm:"gap-1.5 p-1.5 text-xs",md:"gap-3 px-3 py-2 text-sm",lg:"gap-3 px-4 py-3 text-base"}},defaultVariants:{size:"md"}}),w=({size:e,buttons:t=[],onChange:r,selected:o,className:a})=>/* @__PURE__ */l("div",{className:p("button-group-overlap shadow-outer z-0 flex h-fit rounded",a),children:t.map((a,n)=>{const s=0===n,i=n===t.length-1,d=a.value===o;/* @__PURE__ */
|
|
2
|
-
return l("button",{type:"button",onClick:()=>r?.(a.value),className:p(q({size:e}),d?a.activeClassName?a.activeClassName:"bg-primary border-primary text-primary-foreground hover:bg-primary/90 border":"hover:bg-muted/50 active:bg-muted border-border border",s&&"rounded-l",i&&"rounded-r"),children:[!a.icon&&/* @__PURE__ */l("span",{className:"font-medium sm:py-0.5",children:a.text}),a.icon&&/* @__PURE__ */l("div",{className:"size-6",children:a.icon})]},a.value)})});function N({className:e}){/* @__PURE__ */
|
|
3
|
-
return l("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__ */l("path",{fill:"currentColor",d:"M6 19h3v-5q0-.425.288-.712T10 13h4q.425 0 .713.288T15 14v5h3v-9l-6-4.5L6 10zm-2 0v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-4q-.425 0-.712-.288T13 20v-5h-2v5q0 .425-.288.713T10 21H6q-.825 0-1.412-.587T4 19m8-6.75"})})}function y({className:e}){/* @__PURE__ */
|
|
4
|
-
return l("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__ */l("path",{fill:"currentColor",d:"m14.475 12l-7.35-7.35q-.375-.375-.363-.888t.388-.887t.888-.375t.887.375l7.675 7.7q.3.3.45.675t.15.75t-.15.75t-.45.675l-7.7 7.7q-.375.375-.875.363T7.15 21.1t-.375-.888t.375-.887z"})})}var T=({folder:e})=>/* @__PURE__ */l("li",{className:"flex items-center",children:[/* @__PURE__ */l(y,{className:"size-4"}),/* @__PURE__ */l(v,{to:e.href??"#",className:"flex items-center gap-2 rounded px-4 py-1 transition-colors",onMouseEnter:t=>{const r=t.currentTarget;r&&e.color&&(r.style.backgroundColor=`${e.color}3A`)},onMouseLeave:e=>{const t=e.currentTarget;t&&(t.style.backgroundColor="")},children:[/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:e.color??void 0},children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),/* @__PURE__ */l(g,{variant:"h5",color:"secondary",className:"whitespace-nowrap",children:e.name})]})]},e.name),C=({homeLink:e="/",data:t=[]})=>/* @__PURE__ */l("ol",{role:"list",className:"scrollbar-hide flex max-w-full items-center space-x-3 overflow-y-scroll",children:[/* @__PURE__ */l("li",{children:/* @__PURE__ */l(v,{to:e,className:"text-foreground",children:[/* @__PURE__ */l(N,{className:"size-6"}),/* @__PURE__ */l("span",{className:"sr-only",children:"Home"})]})}),t?.map(e=>/* @__PURE__ */l(T,{folder:e},e._id??e.name??e.href??"folder"))]}),k=(e=[],t)=>{const r=/* @__PURE__ */new Map;e?.forEach(e=>{r.set(e._id,e)});const o=[];let a=r.get(t);for(;a;)o.unshift({_id:a._id,name:a.name,href:f.FOLDER_EVENTS(a?._id),color:a.color}),a=r.get(a.parentFolderId);return o},z=()=>{const{initializing:e,orgRole:t,user:r,loadingUser:o}=u(),a=r?t??void 0:void 0;return{role:a,isSuper:Boolean(r?.isSuper),loading:Boolean(o||e),isOwner:a===h.OWNER,isAdmin:a===h.ADMIN,isModerator:a===h.MODERATOR}};function E({content:e,children:t,position:r="top",className:o,contentClassName:a}){const[s,i]=n(!1),{organization:d}=u();/* @__PURE__ */
|
|
5
|
-
return l("div",{className:p("relative inline-block",o),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>i(!1),onBlur:()=>i(!1),children:[t,s&&/* @__PURE__ */l("div",{className:p("bg-popover text-popover-foreground border-border animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 pointer-events-auto absolute z-50 rounded border px-3 py-2 text-sm whitespace-nowrap shadow-md",{top:"bottom-full left-1/2 -translate-x-1/2 mb-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"}[r],a),"data-side":r,style:m(d),role:"tooltip",children:[e,/* @__PURE__ */l("div",{className:p("border-popover absolute h-0 w-0 border-4",{top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent"}[r])})]})]})}function L({className:e}){/* @__PURE__ */
|
|
6
|
-
return l("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__ */l("path",{fill:"currentColor",d:"M10.825 22q-.675 0-1.162-.45t-.588-1.1L8.85 18.8q-.325-.125-.612-.3t-.563-.375l-1.55.65q-.625.275-1.25.05t-.975-.8l-1.175-2.05q-.35-.575-.2-1.225t.675-1.075l1.325-1Q4.5 12.5 4.5 12.337v-.675q0-.162.025-.337l-1.325-1Q2.675 9.9 2.525 9.25t.2-1.225L3.9 5.975q.35-.575.975-.8t1.25.05l1.55.65q.275-.2.575-.375t.6-.3l.225-1.65q.1-.65.588-1.1T10.825 2h2.35q.675 0 1.163.45t.587 1.1l.225 1.65q.325.125.613.3t.562.375l1.55-.65q.625-.275 1.25-.05t.975.8l1.175 2.05q.35.575.2 1.225t-.675 1.075l-1.325 1q.025.175.025.338v.674q0 .163-.05.338l1.325 1q.525.425.675 1.075t-.2 1.225l-1.2 2.05q-.35.575-.975.8t-1.25-.05l-1.5-.65q-.275.2-.575.375t-.6.3l-.225 1.65q-.1.65-.587 1.1t-1.163.45zM11 20h1.975l.35-2.65q.775-.2 1.438-.587t1.212-.938l2.475 1.025l.975-1.7l-2.15-1.625q.125-.35.175-.737T17.5 12t-.05-.787t-.175-.738l2.15-1.625l-.975-1.7l-2.475 1.05q-.55-.575-1.212-.962t-1.438-.588L13 4h-1.975l-.35 2.65q-.775.2-1.437.588t-1.213.937L5.55 7.15l-.975 1.7l2.15 1.6q-.125.375-.175.75t-.05.8q0 .4.05.775t.175.75l-2.15 1.625l.975 1.7l2.475-1.05q.55.575 1.213.963t1.437.587zm1.05-4.5q1.45 0 2.475-1.025T15.55 12t-1.025-2.475T12.05 8.5q-1.475 0-2.487 1.025T8.55 12t1.013 2.475T12.05 15.5M12 12"})})}var M=e({open:!1,setOpen:()=>{}});function O({children:e,className:t,open:r,defaultOpen:o=!1,onOpenChange:a}){const[d,c]=n(o),m=void 0!==r?r:d,u=i(e=>{c(e),a?.(e)},[a]),h=s(()=>({open:m,setOpen:u}),[m,u]);/* @__PURE__ */
|
|
7
|
-
return l(M.Provider,{value:h,children:/* @__PURE__ */l("div",{className:p("relative",t),children:e})})}function B({children:e,className:o,asChild:a=!1}){const{open:n,setOpen:s}=c(M),d=i(e=>{e.stopPropagation(),s(!n)},[n,s]);if(a){const a=t(e)[0];return a?r(a,{onClick:e=>{d(e),a.props?.onClick?.(e)},className:p(a.props?.className,o,"cursor-pointer")}):null}/* @__PURE__ */
|
|
8
|
-
return l("span",{onClick:d,className:p("cursor-pointer",o),children:e})}function j({children:e,className:t,align:r="end",side:n="bottom",sideOffset:s=4}){const{open:i,setOpen:d}=c(M),h=a(null),{organization:f}=u();if(o(()=>{if(!i)return;const e=e=>{h.current&&!h.current.contains(e.target)&&d(!1)},t=e=>{"Escape"===e.key&&d(!1)};return document.addEventListener("click",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[i,d]),!i)return null;const v="start"===r?"left-0":"end"===r?"right-0":"left-1/2 -translate-x-1/2",b="bottom"===n?{top:`calc(100% + ${s}px)`}:{bottom:`calc(100% + ${s}px)`};/* @__PURE__ */
|
|
9
|
-
return l("div",{ref:h,style:{...m(f),...b},className:p("bg-popover text-popover-foreground border-border absolute z-50 min-w-32 rounded border p-1 shadow-md","animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",v,t),"data-side":n,children:e})}function _({children:e,className:o,href:a,onClick:n,onSelect:s,disabled:m,icon:u,title:h,variant:f="default",isChecked:b,isBeta:g,suffix:q,asChild:w}){const{setOpen:N}=c(M),y=p("hover:bg-primary/20 relative flex w-full cursor-pointer items-center gap-3 rounded px-3 py-2 text-left text-sm transition-colors outline-none select-none",m&&"pointer-events-none opacity-50","destructive"===f&&"text-destructive hover:bg-destructive/10 focus:bg-destructive/10",o),T=e??/* @__PURE__ */l(d,{children:[u,
|
|
10
|
-
/* @__PURE__ */l("span",{className:"flex-1 truncate font-medium",children:h}),b&&/* @__PURE__ */l(x,{className:"text-primary size-5"}),g&&/* @__PURE__ */l("span",{className:"bg-primary text-primary-foreground rounded px-1.5 py-0.5 text-[10px]",children:"BETA"}),q&&/* @__PURE__ */l("span",{children:q})]}),C=i(e=>{m||(s?.(e),n?.(),N(!1))},[m,s,n,N]);if(w&&e){const o=t(e)[0];return o?r(o,{onClick:e=>{C(e),o.props?.onClick?.(e)},className:p(o.props?.className,y)}):null}return a?/* @__PURE__ */l(v,{to:a,onClick:C,className:y,children:T}):/* @__PURE__ */l("button",{onClick:C,className:y,disabled:m,type:"button",children:T})}function A({className:e}){/* @__PURE__ */
|
|
11
|
-
return l("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__ */l("path",{fill:"currentColor",d:"M9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"})})}export{B as a,z as c,w as d,_ as i,k as l,O as n,L as o,j as r,E as s,A as t,C as u};
|
package/element/D54cshAo.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{_ as r,t as e}from"./BXMw4kNf.js";import{i as a,n as s}from"./Dpwx5KMy.js";import{x as t}from"./Bb9ydqSB.js";import{i,l as o,n as m,u as d}from"./Z3MoLpu5.js";import{t as l}from"./Bvc6t1Gu.js";import{t as n}from"./BxZobjC-.js";import{t as c}from"./BOs_rBYA.js";var p=()=>{const p=o(),b=d(),{initializing:f,organization:h,user:x}=s(),u=p.pathname.endsWith("/login")||p.pathname.endsWith("/register");return r(()=>{if(x){const r=p.state?.referrer;b(r||"/",{replace:!0})}},[x]),f?/* @__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"})]}):!h||h?.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(m,{to:t.LOGIN,state:p.state||void 0,className:({isActive:r})=>a(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(m,{to:t.REGISTER,state:p.state||void 0,className:({isActive:r})=>a(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(i,{}),
|
|
8
|
-
/* @__PURE__ */e("div",{className:"mt-12",children:/* @__PURE__ */e(n,{})})]})]})};export{p as default};
|
package/element/D5Ja4Yts.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,t as s,w as e}from"./BXMw4kNf.js";import{c as i}from"./Bb9ydqSB.js";import{t as r}from"./Z3MoLpu5.js";import{t as o}from"./BWKUiudT.js";import{t as a}from"./Bki5T_lb.js";var h=({url:h,alt:l="",thumbnailUrl:n,blurhash:u,pswpData:p={},curateLink:c,onClick:w})=>{const v=t(()=>(t=>Object.keys(t).reduce((s,e)=>{const i=t[e];return null==i||""===i||(s[`data-pswp-${r=e,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=i),s;var r},{}))(p),[p]),d=/* @__PURE__ */s(e,{children:[/* @__PURE__ */s(o,{threshold:.1,src:n||h,blurhash:u,alt:l}),p.type===i.VIDEO&&/* @__PURE__ */s("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */s("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(w)/* @__PURE__ */return s("button",{className:"h-full w-full",onClick:w,children:d});if(c)/* @__PURE__ */return s(r,{to:c,className:"h-full w-full",children:d});const y=h&&a(h,["http:","https:"])?h:void 0;return y?/* @__PURE__ */s("a",{href:y,className:"pswp-item block h-full w-full",...v,...n?{"data-pswp-thumbnail-url":n}:{},...u?{"data-pswp-blurhash":u}:{},target:"_blank",rel:"noreferrer",children:d}):/* @__PURE__ */s("span",{className:"pswp-item block h-full w-full",...v,...n?{"data-pswp-thumbnail-url":n}:{},...u?{"data-pswp-blurhash":u}:{},children:d})},l="__qrati_photoswipe",n=t=>Boolean(t&&"object"==typeof t&&t[l]),u=class{active=!1;closingByBackButton=!1;previousState;previousUrl="";previousBrowserState;previousBrowserUrl="";nativeHistoryActive=!1;getPhotoSwipe;routerHistory;constructor(t,s){this.getPhotoSwipe=t,this.routerHistory=s}open(){if(this.active)return;this.active=!0,this.previousState=this.routerHistory?this.routerHistory.state:window.history.state,this.previousUrl=this.routerHistory?this.routerHistory.location:window.location.href,this.previousBrowserState=window.history.state,this.previousBrowserUrl=window.location.href;const t=this.previousState&&"object"==typeof this.previousState?{...this.previousState,[l]:!0}:{[l]:!0};this.routerHistory?(this.routerHistory.push(this.previousUrl,t),window.history.pushState({...this.previousBrowserState??{},[l]:!0},document.title,this.previousBrowserUrl),this.nativeHistoryActive=!0,window.addEventListener("popstate",this.handlePopState)):(window.history.pushState(t,document.title,this.previousUrl),this.nativeHistoryActive=!0,window.addEventListener("popstate",this.handlePopState))}close(){if(!this.active)return;const t=this.closingByBackButton;this.cleanup(),t?this.routerHistory&&this.routerHistory.go(-1):this.routerHistory?(this.routerHistory.go(-1),this.nativeHistoryActive&&window.history.back()):window.history.back()}destroy(){this.active&&(this.routerHistory&&n(this.routerHistory.state)?this.routerHistory.replace(this.previousUrl,this.previousState):!this.routerHistory&&n(window.history.state)&&window.history.replaceState(this.previousState,document.title,this.previousUrl),this.nativeHistoryActive&&n(window.history.state)&&window.history.replaceState(this.previousBrowserState,document.title,this.previousBrowserUrl)),this.cleanup()}isActive(){return this.active}handleBack(){this.active&&(this.closingByBackButton=!0,this.getPhotoSwipe()?.close?.())}handlePopState=()=>{this.active&&this.handleBack()};cleanup(){this.active=!1,this.closingByBackButton=!1,this.previousState=void 0,this.previousUrl="",window.removeEventListener("popstate",this.handlePopState)}};export{n,h as r,u as t};
|
package/element/DJMlQk40.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d as e,s as r,t,v as o}from"./BXMw4kNf.js";import{n as s}from"./Dpwx5KMy.js";import{x as l}from"./Bb9ydqSB.js";import{u as i}from"./Z3MoLpu5.js";import"./CQJ3AK1w.js";var n=e(()=>import("./BpAijsfn.js")),a=e(()=>import("./Bc-phiG6.js")),c=e(()=>import("./erXAfWWY.js")),p=e(()=>import("./ASQv5Ahv.js")),d=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
|
|
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
|
-
/* @__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(),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
|
-
/* @__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
|
-
/* @__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"===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,mapId:"DEMO_MAP_ID",onExplore:v,logoUrl:x?.logoUrl})]})})};export{g as default};
|
package/element/DTPNRhMK.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{h as a,t as s}from"./BXMw4kNf.js";import{n as o}from"./Dpwx5KMy.js";import{x as e}from"./Bb9ydqSB.js";import{l as r,t as l}from"./Z3MoLpu5.js";import{t as i}from"./BszsxRY6.js";import{n as t}from"./JY9kGm742.js";import{t as n}from"./BWjYmdOz2.js";import{a as d,i as m,o as p,r as w,s as c,t as g}from"./B_SYJsyF2.js";import{n as h,r as f,t as u}from"./D2-DJv4T2.js";var C=()=>{const{t:C}=t(),[b,v]=a(""),[P,y]=a(""),[N,j]=a(""),[x,A]=a(""),[k,S]=a(""),[z,F]=a(null),[L,E]=a({}),[O,R]=a(!1),[W,D]=a({google:!1,apple:!1}),[G,H]=a({showPassword:!1,showConfirmPassword:!1}),I=r(),{registerUsingEmail:U,loginWithGoogle:Q,loginWithApple:T}=o(),V=a=>{E(s=>s[a]?{...s,[a]:void 0}:s)},Y=async(a,s)=>{D(s=>({...s,[a]:!0})),F(null);try{await(s?.())}catch(o){o instanceof Error?F(o.message):F(`Failed to sign up with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{D(s=>({...s,[a]:!1}))}};/* @__PURE__ */
|
|
2
|
-
return s("div",{className:"bg-background w-full space-y-8",children:[/* @__PURE__ */s("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const s=d(b),o=p(P),e=m(N),r=c(x),l=w(k,x);if(s||o||e||r||l)return void E({fname:s,lname:o,email:e,password:r,confirmPassword:l});E({}),R(!0),F(null);const i=await(U?.(N.toLowerCase(),x,b,P));i?.error&&F(i.error),R(!1)},className:"space-y-4",children:[
|
|
3
|
-
/* @__PURE__ */s("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */s(g,{label:C("auth.firstName","First name"),name:"fname",disabled:O,type:"text",value:b,onChange:a=>{v(a.target.value),V("fname")},error:L.fname}),/* @__PURE__ */s(g,{label:C("auth.lastName","Last name"),name:"lname",disabled:O,type:"text",value:P,onChange:a=>{y(a.target.value),V("lname")},error:L.lname})]}),
|
|
4
|
-
/* @__PURE__ */s(g,{label:C("auth.email","Email address"),name:"email",disabled:O,type:"email",value:N,onChange:a=>{j(a.target.value),V("email")},autoComplete:"email",error:L.email}),
|
|
5
|
-
/* @__PURE__ */s(g,{label:C("auth.password","Password"),name:"password",disabled:O,type:G.showPassword?"text":"password",value:x,onChange:a=>{A(a.target.value),V("password")},autoComplete:"new-password",error:L.password,actionLabel:G.showPassword?"Hide password":"Show password",actionIcon:G.showPassword?/* @__PURE__ */s(u,{className:"size-5"}):/* @__PURE__ */s(h,{className:"size-5"}),onActionClick:()=>H(a=>({...a,showPassword:!a.showPassword}))}),
|
|
6
|
-
/* @__PURE__ */s(g,{label:C("auth.confirmPassword","Confirm password"),name:"confirmPassword",disabled:O,type:G.showConfirmPassword?"text":"password",value:k,onChange:a=>{S(a.target.value),V("confirmPassword")},autoComplete:"new-password",error:L.confirmPassword,actionLabel:G.showConfirmPassword?"Hide password":"Show password",actionIcon:G.showConfirmPassword?/* @__PURE__ */s(u,{className:"size-5"}):/* @__PURE__ */s(h,{className:"size-5"}),onActionClick:()=>H(a=>({...a,showConfirmPassword:!a.showConfirmPassword}))}),z&&/* @__PURE__ */s(i,{align:"center",color:"error",className:"font-medium",children:z}),
|
|
7
|
-
/* @__PURE__ */s("div",{className:"flex justify-end",children:/* @__PURE__ */s(l,{to:e.FORGOT_PASSWORD,state:{from:I.pathname},children:/* @__PURE__ */s(i,{variant:"h6",className:"w-fit",children:C("button.forgotPassword","Forgot Password?")})})}),
|
|
8
|
-
/* @__PURE__ */s(n,{type:"submit",color:"primary",className:"w-full",disabled:O,loading:O,children:C("button.register","Register")})]}),/* @__PURE__ */s("div",{className:"grid grid-cols-2 gap-2",children:[/* @__PURE__ */s(f,{disabled:O||W.google||W.apple,loading:W.google,onClick:()=>Y("google",Q),provider:"google"}),/* @__PURE__ */s(f,{disabled:O||W.google||W.apple,loading:W.apple,onClick:()=>Y("apple",T),provider:"apple"})]})]})};export{C as default};
|
package/element/DWwbkxCM2.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{h as e,p as a,t as r}from"./BXMw4kNf.js";import{n as s}from"./Dpwx5KMy.js";import{x as i}from"./Bb9ydqSB.js";import{u as t}from"./Z3MoLpu5.js";import{t as o}from"./BszsxRY6.js";import{n as l}from"./JY9kGm742.js";import{t as n}from"./BWjYmdOz2.js";import{i as d,s as c,t as u}from"./B_SYJsyF2.js";var m=({count:e=1,currentStep:a=0,disabled:s,onStepClick:i})=>{const t=s||!i;/* @__PURE__ */
|
|
2
|
-
return r("ol",{className:"flex items-center space-x-6 pl-1.5",children:Array.from({length:e}).map((e,s)=>/* @__PURE__ */r("li",{children:/* @__PURE__ */r("button",s<a?{type:"button","aria-label":`Go to step ${s+1}`,className:"bg-primary block h-3 w-3 rounded-full",disabled:t,onClick:()=>i?.(s)}:s===a?{type:"button","aria-label":`Current step ${s+1}`,className:"relative flex items-center justify-center","aria-current":"step",disabled:t,onClick:()=>i?.(s),children:[/* @__PURE__ */r("span",{className:"absolute flex size-6 p-px","aria-hidden":"true",children:/* @__PURE__ */r("span",{className:"bg-primary/40 size-full rounded-full"})}),/* @__PURE__ */r("span",{className:"bg-primary relative block size-3 rounded-full","aria-hidden":"true"})]}:{type:"button","aria-label":`Go to step ${s+1}`,className:"bg-muted block size-3 rounded-full",disabled:t,onClick:()=>i?.(s)})},`progress-dot-${s}`))})},h=({onCodeSent:a})=>{const{t:i}=l(),{sendPasswordResetCode:t}=s(),[c,m]=e(""),[h,p]=e(!1),[f,y]=e(null),[w,v]=e(null);/* @__PURE__ */
|
|
3
|
-
return r("div",{className:"space-y-4",children:[
|
|
4
|
-
/* @__PURE__ */r(o,{variant:"h4",children:i("auth.forgotPassword","Forgot Password")}),
|
|
5
|
-
/* @__PURE__ */r(u,{type:"email",name:"email",value:c,onChange:e=>{m(e.target.value),f&&y(null),w&&v(null)},placeholder:i("auth.emailPlaceholder","Enter your email address"),error:f??void 0,disabled:h}),w&&/* @__PURE__ */r(o,{variant:"body2",color:"error",children:w}),
|
|
6
|
-
/* @__PURE__ */r("div",{children:/* @__PURE__ */r(n,{onClick:async()=>{y(null),v(null);const e=c.trim().toLowerCase(),r=d(e);if(r)y(r);else{p(!0);try{const r=await t(e);r?.error?v(r.error):a(e)}catch(s){v(s instanceof Error?s.message:String(s))}finally{p(!1)}}},fullWidth:!0,loading:h,disabled:h,children:i("auth.sendVerificationCode","Send verification code")})})]})},p=({email:a,onCodeVerified:i})=>{const{t:t}=l(),{verifyPasswordResetCode:d}=s(),[c,m]=e(""),[h,p]=e(!1),[f,y]=e(null);/* @__PURE__ */
|
|
7
|
-
return r("div",{className:"space-y-4 sm:space-y-6",children:[
|
|
8
|
-
/* @__PURE__ */r("div",{className:"space-y-2",children:[/* @__PURE__ */r(o,{variant:"h4",children:t("auth.verifyCode","Verify Code")}),/* @__PURE__ */r(o,{variant:"body1",children:[t("auth.enterCodeSentTo","Enter the 6-digit code sent to")," ",a]})]}),
|
|
9
|
-
/* @__PURE__ */r(u,{value:c,name:"code",onChange:e=>m(e.target.value),placeholder:t("auth.codePlaceholder","Enter verification code"),disabled:h}),f&&/* @__PURE__ */r(o,{variant:"body2",color:"error",children:f}),
|
|
10
|
-
/* @__PURE__ */r("div",{className:"flex gap-2",children:/* @__PURE__ */r(n,{onClick:async()=>{if(y(null),a)if(c.trim()){p(!0);try{const e=c.trim(),r=await d(a,e);r?.error?y(r.error):r?.data?i(r.data):y(t("auth.codeVerifyFailed","Failed to verify code"))}catch(e){y(e instanceof Error?e.message:String(e))}finally{p(!1)}}else y(t("auth.codeRequired","Please enter the verification code"));else y(t("auth.emailMissing","Email address is missing"))},fullWidth:!0,loading:h,disabled:h,children:t("auth.verify","Verify")})})]})},f=({email:i,passwordResetCodeId:t,onPasswordReset:d})=>{const{t:m}=l(),{resetPassword:h}=s(),[p,f]=e(""),[y,w]=e(""),[v,g]=e(null),[b,C]=e(!1),N=a(()=>c(p),[p]),P=p&&p===y&&!N;/* @__PURE__ */
|
|
11
|
-
return r("div",{className:"space-y-4",children:[
|
|
12
|
-
/* @__PURE__ */r(o,{variant:"h4",children:m("auth.resetPassword","Reset Password")}),
|
|
13
|
-
/* @__PURE__ */r(u,{type:"password",name:"password",autoComplete:"new-password",value:p,onChange:e=>{f(e.target.value),v&&g(null)},placeholder:m("auth.newPassword","New password"),disabled:b,error:N}),
|
|
14
|
-
/* @__PURE__ */r(u,{type:"password",name:"confirmPassword",autoComplete:"new-password",value:y,onChange:e=>{w(e.target.value),v&&g(null)},placeholder:m("auth.confirmNewPassword","Confirm new password"),disabled:b}),v&&/* @__PURE__ */r(o,{variant:"body2",color:"error",children:v}),
|
|
15
|
-
/* @__PURE__ */r("div",{children:/* @__PURE__ */r(n,{onClick:async()=>{if(g(null),i)if(t)if(P){C(!0);try{const e=await h(t,p);e?.error?g(e.error):d()}catch(e){g(e instanceof Error?e.message:String(e))}finally{C(!1)}}else g(m("auth.passwordsDoNotMatch","Passwords do not match"));else g(m("auth.codeIdMissing","Verification code ID is missing"));else g(m("auth.emailMissing","Email address is missing"))},disabled:!P||b,fullWidth:!0,loading:b,children:m("auth.resetPasswordButton","Reset Password")})})]})},y=()=>{const a=t(),[s,o]=e(null),[l,n]=e(null),[d,c]=e(0);/* @__PURE__ */
|
|
16
|
-
return r("div",{className:"bg-background min-h-[60vh]",children:[(({index:e})=>{switch(e){case 0:/* @__PURE__ */return r(h,{onCodeSent:e=>{o(e),c(1)}});case 1:/* @__PURE__ */return r(p,{email:s,onCodeVerified:e=>{n(e),c(2)}});case 2:/* @__PURE__ */return r(f,{email:s,passwordResetCodeId:l,onPasswordReset:()=>{a(i.LOGIN)}})}})({index:d}),/* @__PURE__ */r("div",{className:"mt-8 flex justify-center",children:/* @__PURE__ */r(m,{count:3,currentStep:d})})]})};export{y as default};
|
package/element/DXjc6xIy.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t}from"./BXMw4kNf.js";function e({className:e}){/* @__PURE__ */
|
|
2
|
-
return t("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__ */t("path",{fill:"currentColor",d:"m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z"})})}export{e as t};
|
package/element/DeK1vU3V2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t}from"./Bb9ydqSB.js";function e(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var o={[t.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[t.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 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 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[t.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[t.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[t.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[t.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},n=class{constructor(t,e,o){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=o,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),o=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),o&&(o.style.display=this.captionOn?"none":"inline")}createCaptionHTML(n){const{id:s,type:i,caption:c,title:a,description:r,targetType:l,targetText:p,targetUrl:h}=n||{},d=Boolean(l)&&String(l)!==String(t.NONE),g=d?l:t.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(s),i){case"image":case"video":return c?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${e(c)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${e(a)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${e(r)}</h4>\n ${d?`<button\n class=" flex w-full items-center justify-center gap-3 rounded bg-white py-1 text-lg text-black caption-action-button"\n data-id="${e(s)}"\n data-target-type="${e(g)}"\n data-target-url="${e(h)}">\n ${o[g]}\n ${e(p)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const o=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(o);const n=e.querySelector(".caption-action-button");n&&n.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,o=t.currentTarget.dataset.targetType,n=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,o,n)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}};export{n as default};
|
package/element/Dl6jcv9I.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{t as r}from"./BXMw4kNf.js";function e({color:e="var(--primary)",className:i="mx-auto size-9",...o}){/* @__PURE__ */
|
|
2
|
-
return r("svg",{className:i,viewBox:"0 0 20 20",role:"img","aria-hidden":"true",style:{color:e},...o,children:[
|
|
3
|
-
/* @__PURE__ */r("defs",{children:/* @__PURE__ */r("linearGradient",{id:"RadialGradient8932",children:[/* @__PURE__ */r("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"1"}),/* @__PURE__ */r("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.25"})]})}),
|
|
4
|
-
/* @__PURE__ */r("style",{children:"@keyframes spin8932 { to { transform: rotate(360deg); } }\n .circle8932 { transform-origin: 50% 50%; stroke: url(#RadialGradient8932); fill: none; animation: spin8932 .5s infinite linear; }"}),
|
|
5
|
-
/* @__PURE__ */r("circle",{cx:"10",cy:"10",r:"8",className:"circle8932",strokeWidth:2})]})}export{e as t};
|
package/element/DmpmrPE5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=class extends Error{name="KyError";get isKyError(){return!0}},t=class extends e{name="HTTPError";response;request;options;data;constructor(e,t,o){const r=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=o}},o=class extends e{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},r=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},s=class extends e{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new r(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},n=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},i=class extends e{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},a=(()=>{let e=!1,t=!1;const o="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(o&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&"unsupported BodyInit type"===s.message)return!1;throw s}return e&&!t})(),h="function"==typeof globalThis.AbortController,c="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,u="function"==typeof globalThis.ReadableStream,l="function"==typeof globalThis.FormData,p=["get","post","put","patch","head","delete"],f={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},d=Symbol("stop"),y=class{options;constructor(e){this.options=e}},m=e=>new y(e),g={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},b={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},w=new TextEncoder,R=(e,t,o)=>{let r,s=0;return e.pipeThrough(new TransformStream({transform(e,n){if(n.enqueue(e),r){s+=r.byteLength;let e=0===t?0:s/t;e>=1&&(e=1-Number.EPSILON),o?.({percent:e,totalBytes:Math.max(t,s),transferredBytes:s},r)}r=e},flush(){r&&(s+=r.byteLength,o?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},r))}}))},T=e=>null!==e&&"object"==typeof e,q=Symbol("replaceOption"),v=e=>T(e)&&!0===e[q]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},E=(...e)=>{for(const t of e)if((!T(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return L({},...e)},P=(e={},t={})=>{const o=new globalThis.Headers(e),r=t instanceof globalThis.Headers,s=new globalThis.Headers(t);for(const[n,i]of s.entries())r&&"undefined"===i||void 0===i?o.delete(n):o.set(n,i);return o},S=e=>{if(!T(e)||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},x=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),o=e[C];return o&&(t[C]=new Set(o)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:S(e)?{...e}:e},A=(e,t)=>{return S(e)&&S(t)?(o={...e,...t},Object.fromEntries(Object.entries(o).filter(e=>void 0!==e[1]))):P(e,t);var o};function j(e,t,o){return Object.hasOwn(t,o)&&void 0===t[o]?[]:L(e[o]??[],t[o]??[])}var k=(e={},t={})=>({init:j(e,t,"init"),beforeRequest:j(e,t,"beforeRequest"),beforeRetry:j(e,t,"beforeRetry"),beforeError:j(e,t,"beforeError"),afterResponse:j(e,t,"afterResponse")}),C=Symbol("deletedParameters"),O=(e,t)=>{const o=new URLSearchParams,r=/* @__PURE__ */new Set;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams){for(const[t,n]of s.entries())o.append(t,n),r.delete(t);const e=s[C];if(e)for(const t of e)o.delete(t),r.add(t)}else if(Array.isArray(s))for(const e of s){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");o.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(T(s))for(const[e,t]of Object.entries(s))void 0===t?(o.delete(e),r.add(e)):(o.append(e,String(t)),r.delete(e));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())o.append(t,s),r.delete(t)}return r.size>0&&(o[C]=r),o},L=(...e)=>{let t,o={},r={},s={};const n=[];for(const i of e)if(Array.isArray(i))Array.isArray(o)||(o=[]),o=[...o,...i];else if(T(i)){for(let[e,r]of Object.entries(i)){if("signal"===e&&r instanceof globalThis.AbortSignal){n.push(r);continue}const s=v(r),{isReplace:i}=s;if(r=s.value,"context"!==e)"searchParams"!==e?(T(r)&&!i&&e in o&&(r=L(o[e],r)),o={...o,[e]:r}):t=null==r?void 0:i||void 0===t?r:O(t,r);else{if(null!=r&&(!T(r)||Array.isArray(r)))throw new TypeError("The `context` option must be an object");o={...o,context:null==r?{}:i?{...r}:{...o.context,...r}}}}if(T(i.hooks)){const{value:e,isReplace:t}=v(i.hooks);s=k(t?{}:s,e),o.hooks=s}if(T(i.headers)){const{value:e,isReplace:t}=v(i.headers);r=t?x(e):A(r,e),o.headers=r}}return void 0!==t&&(o.searchParams=t),n.length>0&&(1===n.length?o.signal=n[0]:o.signal=c?AbortSignal.any(n):n.at(-1)),o},N=e=>p.includes(e)?e.toUpperCase():e,D={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},B=(e={})=>{if("number"==typeof e)return{...D,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>void 0!==e));return{...D,...t}};async function U(e,{signal:t}){return new Promise((o,r)=>{function s(){clearTimeout(n),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));const n=setTimeout(()=>{t?.removeEventListener("abort",s),o()},e)})}var H=Object.prototype.toString,F=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);var J=(e,t)=>e instanceof t||e?.name===t.name,z=Symbol("timedOutResponseData"),I="The `schema` argument must follow the Standard Schema specification",$=Object.prototype.toString,M=e=>e instanceof globalThis.Request||"[object Request]"===$.call(e),W=e=>e instanceof globalThis.Response||"[object Response]"===$.call(e),_=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(I);const o=t["~standard"];if("object"!=typeof o||null===o||"function"!=typeof o.validate)throw new TypeError(I);const r=await o.validate(e);if(r.issues)throw new n(r.issues);return r.value},V=class e{static create(o,r){const n=r.hooks?.init??[],i=n.length>0?function(e){const t={...e,json:x(e.json),context:x(e.context),headers:x(e.headers),searchParams:(o=e.searchParams,Array.isArray(o)?o.map(e=>[...e]):x(o))};var o;return void 0!==e.retry&&(t.retry=(e=>"object"!=typeof e?e:{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}})(e.retry)),t}(r):r;for(const e of n)e(i);const a=new e(o,i),h=(async()=>{try{return await(async()=>{if("number"==typeof a.#e.timeout&&a.#e.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof a.#e.totalTimeout&&a.#e.totalTimeout>2147483647)throw new RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();const e=await a.#t();let o=e??await a.#o(async()=>a.#r()),r=void 0!==e||a.#s();for(;;){if(void 0===o)return o;if(W(o))try{o=await a.#n(o)}catch(n){if(!(n instanceof s))throw n;const e=await a.#i(n,async()=>a.#r());if(void 0===e)return e;o=e,r=a.#s();continue}const e=o;if(!e.ok&&"opaque"!==e.type&&("function"==typeof a.#e.throwHttpErrors?a.#e.throwHttpErrors(e.status):a.#e.throwHttpErrors)){const s=new t(e,a.#a(e),a.#h()),n=s;if(s.data=await a.#c(e),r)throw n;const i=await a.#i(s,async()=>a.#r());if(void 0===i)return i;o=i,r=a.#s();continue}break}if(!W(o))return o;if(a.#u(o),a.#e.onDownloadProgress){if("function"!=typeof a.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!u)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=o.clone();return a.#l(o),((e,t)=>{if(!e.body)return e;const o={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,o);const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(R(e.body,r,t),o)})(e,a.#e.onDownloadProgress)}return o})()}catch(e){if(!(e instanceof Error))throw e;if(a.#p.has(e))throw e;let t=e;for(const o of a.#e.hooks.beforeError){const e=await o({request:a.request,options:a.#h(),error:t,retryCount:a.#f});e instanceof Error&&(t=e)}throw t}finally{const e=a.#d;a.#y(e?.body??void 0),a.request!==e&&a.#y(a.request.body??void 0)}})();for(const[e,t]of Object.entries(f))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(h[e]=async o=>{a.request.headers.set("accept",a.request.headers.get("accept")||t);const r=await h;if("json"!==e)return r[e]();const s=await r.text();if(""===s)return void 0!==o?_(void 0,o):JSON.parse(s);const n=i.parseJson?await i.parseJson(s,{request:a.#a(r),response:r}):JSON.parse(s);return void 0===o?n:_(n,o)});return h}static#m(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#g;#f=0;#b;#e;#d;#w;#p=/* @__PURE__ */new WeakSet;#R;#T;#q=!1;#v=/* @__PURE__ */new WeakMap;constructor(t,o={}){if(this.#b=t,Object.hasOwn(o,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");if(this.#e={...o,headers:P(this.#b.headers,o.headers),hooks:k({},o.hooks),method:N(o.method??this.#b.method??"GET"),prefix:String(o.prefix||""),retry:B(o.retry),throwHttpErrors:o.throwHttpErrors??!0,timeout:o.timeout??1e4,totalTimeout:o.totalTimeout??!1,fetch:o.fetch??globalThis.fetch.bind(globalThis),context:o.context??{}},"string"!=typeof this.#b&&!(this.#b instanceof URL||this.#b instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#b){if(this.#e.prefix){const e=this.#e.prefix.replace(/\/+$/,""),t=this.#b.replace(/^\/+/,"");this.#b=`${e}/${t}`}if(this.#e.baseUrl){let e;try{e=new URL(this.#b)}catch{}e||(this.#b=new URL(this.#b,new Request(this.#e.baseUrl).url))}}h&&c&&(this.#w=this.#e.signal??this.#b.signal,this.#g=new globalThis.AbortController,this.#e.signal=this.#E()),a&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=o.headers&&new globalThis.Headers(o.headers).has("content-type");if(this.#b instanceof globalThis.Request&&(l&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#b,this.#e),void 0!==(s=this.#e.searchParams)&&(Array.isArray(s)?s.length>0:s instanceof URLSearchParams?s.size>0||Boolean(s[C]?.size):"object"==typeof s?Object.keys(s).length>0:"string"==typeof s?s.trim().length>0:Boolean(s))){const t=new URL(this.request.url),o=this.#e.searchParams?.[C];if(o)for(const e of o)t.searchParams.delete(e);if("string"==typeof this.#e.searchParams){const e=this.#e.searchParams.replace(/^\?/,"");""!==e&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{const o=new URLSearchParams(e.#m(this.#e.searchParams));for(const[e,r]of o.entries())t.searchParams.append(e,r)}if(this.#e.searchParams&&"object"==typeof this.#e.searchParams&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(const[e,r]of Object.entries(this.#e.searchParams))void 0===r&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#e)}var s;if(this.#e.onUploadProgress&&"function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");this.#T="number"==typeof this.#e.totalTimeout?this.#P():void 0}#S(){const e=this.#e.retry.delay(this.#f+1);let t=e;return!0===this.#e.retry.jitter?t=Math.random()*e:"function"==typeof this.#e.retry.jitter&&(t=this.#e.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e)),Math.min(this.#e.retry.backoffLimit,t)}async#x(e){if(this.#f>=this.#e.retry.limit)throw e;const n=e instanceof Error?e:new r(e);if(n instanceof s)return n.customDelay??this.#S();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#e.retry.shouldRetry){const t=await this.#e.retry.shouldRetry({error:n,retryCount:this.#f+1});if(!1===t)throw e;if(!0===t)return this.#S()}if(function(e){return J(e,i)}(e)){if(!this.#e.retry.retryOnTimeout)throw e;return this.#S()}if(function(e){return J(e,t)}(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);return Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now()),Number.isFinite(e)?(e=Math.max(0,e),Math.min(this.#e.retry.maxRetryAfter,e)):Math.min(this.#e.retry.maxRetryAfter,this.#S())}if(413===e.response.status)throw e;return this.#S()}if(!function(e){return J(e,o)}(e))throw e;return this.#S()}#u(e){const t=this.#a(e);return this.#e.parseJson&&(e.json=async()=>{const o=await e.text();return""===o?JSON.parse(o):this.#e.parseJson(o,{request:t,response:e})}),e}async#c(e){const t=await this.#A(e,this.#j());if(t===z)return void this.#k();if(!t)return;if(!this.#C(e.headers.get("content-type")??""))return t;const o=await this.#O(t,e,this.#j(),this.#a(e));if(o!==z)return o;this.#k()}#j(){const e=!1===this.#e.timeout?1e4:this.#e.timeout,t=this.#L();if(void 0===t)return e;if(t<=0)throw new i(this.request);return Math.min(e,t)}#C(e){const t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#A(e,t){const{body:o}=e;if(!o)try{return await e.text()}catch{return}let r;try{r=o.getReader()}catch{return}const s=(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),o=t?.[1]??t?.[2];if(o)try{return new TextDecoder(o)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),n=[];let i=0;const a=(async()=>{try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(i+=t.byteLength,i>10485760)return void r.cancel().catch(()=>{});n.push(s.decode(t,{stream:!0}))}}catch{return}return n.push(s.decode()),n.join("")})(),h=new Promise(e=>{const o=setTimeout(()=>{e(z)},t);a.finally(()=>{clearTimeout(o)})}),c=await Promise.race([a,h]);return c===z&&r.cancel().catch(()=>{}),c}async#O(e,t,o,r){let s;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{s=setTimeout(()=>{e(z)},o)})])}catch{return}finally{clearTimeout(s)}}#y(e){e&&e.cancel().catch(()=>{})}#l(e){this.#y(e.body??void 0)}#E(){return this.#w?AbortSignal.any([this.#w,this.#g.signal]):this.#g.signal}#k(){const e=this.#L();if(void 0!==e&&e<=0)throw new i(this.request)}async#t(){for(const e of this.#e.hooks.beforeRequest){const t=await e({request:this.request,options:this.#h(),retryCount:0});if(M(t))this.#N(t);else if(W(t))return t}}async#n(e){const t=this.#a(e);for(const r of this.#e.hooks.afterResponse){const n=this.#D(e.clone(),t);let i;this.#u(n);try{i=await r({request:this.request,options:this.#h(),response:n,retryCount:this.#f})}catch(o){throw n!==e&&this.#l(n),this.#l(e),o}if(i instanceof y)throw n!==e&&this.#l(n),this.#l(e),new s(i.options);const a=W(i)?this.#D(i,t):e;n!==e&&n!==a&&n.body!==a.body&&this.#l(n),e!==a&&e.body!==a.body&&this.#l(e),e=a}return e}async#o(e){try{return await e()}catch(t){return this.#i(t,e)}}async#i(e,t){this.#q=!1;const o=Math.min(await this.#x(e),2147483647),r={signal:this.#w},n=this.#L();if(void 0!==n){if(n<=0)throw new i(this.request);if(o>=n)throw await U(n,r),new i(this.request)}if(await U(o,r),this.#k(),e instanceof s&&e.customRequest){const t=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#N(t)}for(const s of this.#e.hooks.beforeRetry){let t;try{t=await s({request:this.request,options:this.#h(),error:e,retryCount:this.#f+1})}catch(a){throw a instanceof Error&&a!==e&&this.#p.add(a),a}if(M(t)){this.#N(t);break}if(W(t))return this.#q=!0,this.#f++,t;if(t===d)return}return this.#k(),this.#f++,this.#o(t)}#s(){const e=this.#q;return this.#q=!1,e}async#r(){this.#g?.signal.aborted&&(this.#g=new globalThis.AbortController,this.#e.signal=this.#E(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));const e=(e=>{const t={};for(const o in e)Object.hasOwn(e,o)&&(o in b||o in g||(t[o]=e[o]));return t})(this.#e),t=this.#e.retry.limit>0?this.request.clone():void 0,r=this.#B(this.request,this.#e.body??void 0);this.#d=r,t&&(this.request=t);try{const t=this.#L();if(void 0!==t&&t<=0)throw new i(this.request);const o=!1===this.#e.timeout?t:void 0===t?this.#e.timeout:Math.min(this.#e.timeout,t),s=void 0===o?await this.#e.fetch(r,e):await async function(e,t,o,r){return new Promise((s,n)=>{const a=setTimeout(()=>{o&&o.abort(),n(new i(e))},r.timeout);r.fetch(e,t).then(s).catch(n).then(()=>{clearTimeout(a)})})}(r,e,this.#g,{timeout:o,fetch:this.#e.fetch});return this.#D(s,r)}catch(s){if(function(e){if(!e||(t=e,"[object Error]"!==H.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;var t;const{message:o,stack:r}=e;return"Load failed"===o?void 0===r||"__sentry_captured__"in e:!!o.startsWith("error sending request for url")||!!("Failed to fetch"===o||o.startsWith("Failed to fetch (")&&o.endsWith(")"))||F.has(o)}(s))throw new o(this.request,{cause:s});throw s}}#L(){if(void 0===this.#T)return;const e=this.#P()-this.#T;return Math.max(0,this.#e.totalTimeout-e)}#P(){return globalThis.performance?.now()??Date.now()}#h(){if(!this.#R){const{hooks:e,json:t,parseJson:o,stringifyJson:r,searchParams:s,timeout:n,totalTimeout:i,throwHttpErrors:a,fetch:h,...c}=this.#e;this.#R=Object.freeze(c)}return this.#R}#N(e){this.#R=void 0,this.request=e}#a(e){return this.#v.get(e)??this.request}#D(e,t){return this.#v.set(e,t),e}#B(e,t){return this.#e.onUploadProgress&&e.body&&a?((e,t,o)=>{if(!e.body)return e;const r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[o,r]of e)t+=40,t+=w.encode(`Content-Disposition: form-data; name="${o}"`).byteLength,t+="string"==typeof r?w.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?w.encode(e).byteLength:e instanceof URLSearchParams?w.encode(e.toString()).byteLength:0})(o??e.body);return new Request(e,{duplex:"half",body:R(e.body,r,t)})})(e,this.#e.onUploadProgress,t??this.#e.body??void 0):e}},X=e=>{const t=(t,o)=>V.create(t,E(e,o));for(const o of p)t[o]=(t,r)=>V.create(t,E(e,r,{method:o}));return t.create=e=>X(E(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),X(E(e,t))),t.stop=d,t.retry=m,t},K=X();export{t as n,K as t};
|
package/element/Do4y0nPe.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t,b as e,v as s}from"./Dpwx5KMy.js";var i=class extends t{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=s({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)e();else{this.#a({type:"pending",variables:t,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,i);const e=await(this.options.onMutate?.(t,i));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:o})}const s=await this.#i.start();return await(this.#s.config.onSuccess?.(s,t,this.state.context,this,i)),await(this.options.onSuccess?.(s,t,this.state.context,i)),await(this.#s.config.onSettled?.(s,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(s,null,t,this.state.context,i)),this.#a({type:"success",data:s}),s}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),e.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
|