@qratilabs/qrati-connect 2.23.0-beta.6 → 2.23.0-beta.8
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/{umd/CJpmOICA.js → element/B14kCOq8.js} +1 -1
- package/element/B4x4NgZo2.js +39 -0
- package/element/{BmCwXyo_2.js → B6PU8eoK2.js} +3 -3
- package/element/{DPmrTFJt.js → B8Ttd5mR.js} +2 -2
- package/{umd/B2KTsK_w.js → element/B8iE0_hM.js} +1 -1
- package/{umd/CgE_bYp32.js → element/BKYyNCOh2.js} +10 -10
- package/{umd/htkJ94ea2.js → element/BMXdJ0nE2.js} +14 -14
- package/element/{fwDYCLiL.js → BN5szMnq.js} +1 -1
- package/element/BhRXQLUC.js +9 -0
- package/element/{wuONdFBI2.js → Bj9UR6Yz2.js} +1 -1
- package/element/{CU_-C7Pt2.js → Bjo_3uGZ2.js} +1 -1
- package/{umd/WX3mhhd9.js → element/BkvtmX4K.js} +1 -1
- package/element/{BekfKWcG.js → Bnib0POY.js} +1 -1
- package/element/{CKk0UYyd.js → Byk0pccK.js} +1 -1
- package/element/C3uDEVBt.js +1 -0
- package/element/{8nf23RYF2.js → CCcBybqT2.js} +1 -1
- package/element/{Cw2Z2oTA2.js → CJeVf0D82.js} +1 -1
- package/{umd/we0Hcb5C.js → element/CM4ZH83j.js} +1 -1
- package/element/{CEy6R9aL2.js → CVn-rSGC2.js} +1 -1
- package/{umd/9VAO1NmP.js → element/CWO6blVi.js} +1 -1
- package/element/{CdHR1K3m2.js → Cl0iruY72.js} +85 -86
- package/element/{CYQ06kUR.js → Cv9xb_-W.js} +1 -1
- package/element/{Be-K0dao.js → D0jvjVwV.js} +1 -1
- package/element/{CAGYFwGT2.js → D4fyuPrh2.js} +4 -4
- package/element/{lVJD5cJY.js → D6qTsmXL.js} +5 -5
- package/{umd/j7EIoFjZ.js → element/D9FVUgcz.js} +1 -1
- package/element/{2SYk3iBo.js → DA91NKGO.js} +1 -1
- package/{umd/C9HFLidt.js → element/DIYUC8M3.js} +1 -1
- package/element/{CMQUiMWC2.js → DN1lg1Z82.js} +2 -2
- package/{umd/BCu0TrNB2.js → element/DNG5BSHx2.js} +1 -1
- package/element/{CH-5Dn6J2.js → DOPIUBGQ2.js} +1 -1
- package/{umd/qJYsRQFB.js → element/D_4OXo87.js} +1 -1
- package/element/{DtICYV5L2.js → DaewbIBn2.js} +1 -1
- package/element/{C0vZ8zxT.js → DdMTbL2G.js} +1 -1
- package/element/{hJxQiXVJ2.js → DkMzhenk2.js} +4 -4
- package/element/{x2Vs8ihf.js → DmFpR6Ob.js} +1 -1
- package/{umd/DVO71jbn2.js → element/DpKHDt4F2.js} +3 -3
- package/element/{DWbLshVZ.js → DvTRhlvs.js} +1 -1
- package/{umd/Wun_Og5n2.js → element/Dx7bGj8V2.js} +1 -1
- package/element/HO1cwKhZ2.js +9 -0
- package/element/{B5BVTFlf.js → LpcU8wdf.js} +1 -1
- package/{umd/WtQ5axEj.js → element/TOp1kwsu.js} +3 -3
- package/{umd/u7SUQ9Kb2.js → element/VakK6fPh2.js} +1 -1
- package/{umd/DQ4anWD-.js → element/YcabH-1h.js} +10 -10
- package/element/{DXrH_HhZ.js → _ty2jtjs.js} +1 -1
- package/{umd/D8Se70tP2.js → element/gjXXuILV2.js} +1 -1
- package/element/{O530RtWA.js → iWy6455b.js} +1 -1
- package/element/{DibuO0dP.js → tpr-W9BP.js} +1 -1
- package/element/web.es.js +42 -42
- package/package.json +1 -1
- package/react/index.d.mts +6 -117
- package/react/index.d.ts +6 -117
- package/{element/CJpmOICA.js → umd/B14kCOq8.js} +1 -1
- package/umd/B4x4NgZo2.js +39 -0
- package/umd/{BmCwXyo_2.js → B6PU8eoK2.js} +3 -3
- package/umd/{DPmrTFJt.js → B8Ttd5mR.js} +2 -2
- package/{element/B2KTsK_w.js → umd/B8iE0_hM.js} +1 -1
- package/{element/CgE_bYp32.js → umd/BKYyNCOh2.js} +10 -10
- package/{element/htkJ94ea2.js → umd/BMXdJ0nE2.js} +14 -14
- package/umd/{fwDYCLiL.js → BN5szMnq.js} +1 -1
- package/umd/BhRXQLUC.js +9 -0
- package/umd/{wuONdFBI2.js → Bj9UR6Yz2.js} +1 -1
- package/umd/{CU_-C7Pt2.js → Bjo_3uGZ2.js} +1 -1
- package/{element/WX3mhhd9.js → umd/BkvtmX4K.js} +1 -1
- package/umd/{BekfKWcG.js → Bnib0POY.js} +1 -1
- package/umd/{CKk0UYyd.js → Byk0pccK.js} +1 -1
- package/umd/C3uDEVBt.js +1 -0
- package/umd/{8nf23RYF2.js → CCcBybqT2.js} +1 -1
- package/umd/{Cw2Z2oTA2.js → CJeVf0D82.js} +1 -1
- package/{element/we0Hcb5C.js → umd/CM4ZH83j.js} +1 -1
- package/umd/{CEy6R9aL2.js → CVn-rSGC2.js} +1 -1
- package/{element/9VAO1NmP.js → umd/CWO6blVi.js} +1 -1
- package/umd/{CdHR1K3m2.js → Cl0iruY72.js} +85 -86
- package/umd/{CYQ06kUR.js → Cv9xb_-W.js} +1 -1
- package/umd/{Be-K0dao.js → D0jvjVwV.js} +1 -1
- package/umd/{CAGYFwGT2.js → D4fyuPrh2.js} +4 -4
- package/umd/{lVJD5cJY.js → D6qTsmXL.js} +5 -5
- package/{element/j7EIoFjZ.js → umd/D9FVUgcz.js} +1 -1
- package/umd/{2SYk3iBo.js → DA91NKGO.js} +1 -1
- package/{element/C9HFLidt.js → umd/DIYUC8M3.js} +1 -1
- package/umd/{CMQUiMWC2.js → DN1lg1Z82.js} +2 -2
- package/{element/BCu0TrNB2.js → umd/DNG5BSHx2.js} +1 -1
- package/umd/{CH-5Dn6J2.js → DOPIUBGQ2.js} +1 -1
- package/{element/qJYsRQFB.js → umd/D_4OXo87.js} +1 -1
- package/umd/{DtICYV5L2.js → DaewbIBn2.js} +1 -1
- package/umd/{C0vZ8zxT.js → DdMTbL2G.js} +1 -1
- package/umd/{hJxQiXVJ2.js → DkMzhenk2.js} +4 -4
- package/umd/{x2Vs8ihf.js → DmFpR6Ob.js} +1 -1
- package/{element/DVO71jbn2.js → umd/DpKHDt4F2.js} +3 -3
- package/umd/{DWbLshVZ.js → DvTRhlvs.js} +1 -1
- package/{element/Wun_Og5n2.js → umd/Dx7bGj8V2.js} +1 -1
- package/umd/HO1cwKhZ2.js +9 -0
- package/umd/{B5BVTFlf.js → LpcU8wdf.js} +1 -1
- package/{element/WtQ5axEj.js → umd/TOp1kwsu.js} +3 -3
- package/{element/u7SUQ9Kb2.js → umd/VakK6fPh2.js} +1 -1
- package/{element/DQ4anWD-.js → umd/YcabH-1h.js} +10 -10
- package/umd/{DXrH_HhZ.js → _ty2jtjs.js} +1 -1
- package/{element/D8Se70tP2.js → umd/gjXXuILV2.js} +1 -1
- package/umd/{O530RtWA.js → iWy6455b.js} +1 -1
- package/umd/{DibuO0dP.js → tpr-W9BP.js} +1 -1
- package/umd/web.es.js +42 -42
- package/element/CbpHG7X52.js +0 -9
- package/element/DYUfJm8F.js +0 -9
- package/element/e4d1xMdD2.js +0 -39
- package/element/qbHuxVSe.js +0 -1
- package/umd/CbpHG7X52.js +0 -9
- package/umd/DYUfJm8F.js +0 -9
- package/umd/e4d1xMdD2.js +0 -39
- package/umd/qbHuxVSe.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as h}from"./
|
|
1
|
+
import{t as h}from"./C3uDEVBt.js";function e({className:e}){/* @__PURE__ */
|
|
2
2
|
return h("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__ */h("path",{fill:"currentColor",d:"M4 19h4v-8H4zm6 0h4V5h-4zm6 0h4v-6h-4zM2 19v-8q0-.825.588-1.412T4 9h4V5q0-.825.588-1.412T10 3h4q.825 0 1.413.588T16 5v6h4q.825 0 1.413.588T22 13v6q0 .825-.587 1.413T20 21H4q-.825 0-1.412-.587T2 19"})})}export{e as t};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{b 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"./C3uDEVBt.js";import{C as c,D as d,L as u,M as m,N as g,O as h,P as p,S as f,_ as v,b as w,d as T,f as y,g as N,h as q,i as x,j as b,m as E,n as C,p as S,u as I,v as L,x as z,y as k}from"./TOp1kwsu.js";import{n as M,r as A,t as _}from"./CWO6blVi.js";import{t as P,u as R}from"./D6qTsmXL.js";import{t as V}from"./BN5szMnq.js";import{n as O,t as j}from"./Bnib0POY.js";import{a as F,c as B,i as H,l as U,n as G,o as $,r as D,s as W,t as Q,u as K}from"./YcabH-1h.js";import{t as Z}from"./B8iE0_hM.js";import{r as Y}from"./DvTRhlvs.js";import{n as J,t as X}from"./DA91NKGO.js";import{t as ee}from"./DIYUC8M3.js";import{t as te}from"./DdMTbL2G.js";import{t as ne}from"./B14kCOq8.js";import{a as re,i as ae,n as ie,o as se,r as oe,s as le,t as ce}from"./CM4ZH83j.js";import{n as de,r as ue,t as me}from"./gjXXuILV2.js";import{n as ge,t as he}from"./DaewbIBn2.js";function pe({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 fe({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 ve=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,d]=r(!1),u=n(null),m=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!u.current||!t)return void d(!1);const e=u.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(m.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),d(c>o*a+1)},r=()=>{null!==m.current&&window.cancelAnimationFrame(m.current),m.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!==m.current&&window.cancelAnimationFrame(m.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:x("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:u,className:x(O({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},we=()=>{const{t:e}=Y(),{eventSlug:t}=R(),{event:n}=te({eventSlug:t}),{props:r,organization:a}=C(),{curateLabel:i,leaderboardLabel:o}=r??{},{eventViews:l,contentCount:c,curationCount:u}=(({event:e})=>{const{props:t,organization:n}=C(),r=t?.organizationId,{isLoading:a,data:i}=p({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await g.get(I.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});/* @__PURE__ */
|
|
4
|
+
return s("div",{className:"w-full space-y-3",children:[
|
|
5
|
+
/* @__PURE__ */s("div",{className:"space-y-2 md:-mt-8",children:[/* @__PURE__ */s(j,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(ve,{description:n?.description})]}),a?.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(fe,{className:"text-primary"}),/* @__PURE__ */s(j,{variant:"body1",className:"font-medium",children:l??0})]}),
|
|
7
|
+
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(pe,{className:"text-primary"}),/* @__PURE__ */s(j,{variant:"body1",className:"font-medium",children:c})]}),n?.engagementStyle===L.CONTEST&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(le,{className:"text-primary"}),/* @__PURE__ */s(j,{variant:"body1",className:"font-medium",children:u})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&n?.engagementStyle===L.CONTEST||n?.engagementStyle===L.REACTION&&n?.showLeaderboard||n?.engagementStyle===L.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(P,{to:d.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(ue,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&n?.engagementStyle===L.CONTEST&&/* @__PURE__ */s(P,{to:d.CURATE(n?.slug??""),children:/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(le,{className:"size-5"}),children:i||e("content.curate","Curate")})}),n?.showLeaderboard&&/* @__PURE__ */s(P,{to:d.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(ne,{className:"size-5"}),children:o||e("content.leaderboard","Leaderboard")})})]})]})},Te=(e,t)=>["in-review-count",e??"",t??""];function ye({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 Ne({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 qe({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 xe({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 be({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 Ee({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 Ce({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 Se({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 Ie=({event:e})=>{const t=u(),{user:n,props:a}=C(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
|
|
16
|
+
return s(D,{children:[/* @__PURE__ */s($,{children:/* @__PURE__ */s(o?Se:Ce,{className:"size-6"})}),/* @__PURE__ */s(H,{align:"end",side:"bottom",className:"w-44",children:Object.values(f).map(r=>/* @__PURE__ */s(F,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await g.post(I.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:ge(r)},r))})]})},Le=({event:e,onAutoscrollClick:t})=>{const{t:n}=Y(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=U(),{inReviewCount:c}=(e=>{const t=u(),{props:n}=C(),r=n?.organizationId,{role:a,isSuper:i}=U(),{isLoading:s,data:o,isError:l,error:c}=p({queryKey:Te(r,e?.slug),queryFn:async()=>{try{const t=await g.get(I.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${S.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?c:null,increment:()=>{t.setQueryData(Te(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(Te(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),d=r||i||o||l,m=r||i||o,h=a(()=>{const t=[];return m&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:ye,href:z.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===w.PRIVATE&&d&&t.push({title:n("event.access_requests","Access Requests"),icon:Ee,href:z.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===L.CONTEST&&m&&t.push({title:n("event.curation_details","Curation Details"),icon:be,href:z.EVENT_CURATION_DETAILS(e?.slug??"")}),m&&t.push({title:n("event.edit_event","Edit Event"),icon:W,href:z.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,m,d]);/* @__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(B,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(qe,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&m&&/* @__PURE__ */s(Ie,{event:e}),d&&/* @__PURE__ */s(B,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:z.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(Ne,{className:"size-6"}),Number(c)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:c})]})}),h.length>0&&/* @__PURE__ */s(D,{children:[/* @__PURE__ */s($,{children:/* @__PURE__ */s(xe,{className:"size-6"})}),/* @__PURE__ */s(H,{align:"end",side:"bottom",className:"w-48",children:h.map(e=>/* @__PURE__ */s(F,{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 ze({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 ke=({engagementStyle:e,sort:t=N,order:n=v,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=Y(),l=a(()=>{const t=Object.keys(y).map(e=>({text:o(`content.sortby_${y[e].label.toLowerCase()}`,y[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===L.CONTEST?t:t.filter(e=>e.value!==T.POPULAR)},[e,o]);/* @__PURE__ */
|
|
19
|
+
return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:x("text-foreground w-7 -scale-x-100 transition-transform",n===b.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(K,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Me=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ae=({value:t,onChange:i})=>{const[o,l]=r(!1),c=n(null),d=a(()=>t?URL.createObjectURL(t):null,[t]);return e(()=>()=>{d&&URL.revokeObjectURL(d)},[d]),e(()=>{!t&&c.current&&(c.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",onClick:()=>c.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(o?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(o?J:se,{})})}),t&&d&&/* @__PURE__ */s("img",{src:d,alt:"Facial Search",className:"size-10 rounded object-cover"}),
|
|
20
|
+
/* @__PURE__ */s("input",{ref:c,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(!Me.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{e.size/1024/1024>1&&(t=await de(e,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}))}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},_e={[q.GRID]:{icon:/* @__PURE__ */s(Ce,{className:"size-full text-inherit"})},[q.SINGLE]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})}},Pe=Object.keys(_e).map(e=>({icon:_e[e].icon,value:e})),Re=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:m,handleChange:g,face:h,onFaceImageChange:p})=>{const{t:f}=Y(),{organization:v}=C(),[w,T]=r(""),[y,N]=r(null),q=n(null),x=o(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=o(e=>{if(N(e),x(),e){const t=URL.createObjectURL(e);q.current=t,p?.(t)}else p?.(void 0)},[p,x]),E=o(e=>{T(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?g&&g(w.length>0?w:""):"Escape"===t&&(T(""),g&&g(""))},[w,g]),I=o(()=>{T(""),g&&g("")},[g]),L=o(()=>{g&&g(w)},[w,g]);return e(()=>{h||N(null)},[h]),e(()=>()=>{x()},[x]),/* @__PURE__ */s("div",{className:"mb-3 grid grid-cols-3 md:space-y-0 md:space-x-4",children:[
|
|
21
|
+
/* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(K,{buttons:Pe,selected:i,onChange:l}),v?.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(he,{placeholder:f("content.search_placeholder","Search using text"),value:w,className:"py-2",onChange:E,onKeyUp:S}),w?.length>0&&/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */s(ee,{className:"text-foreground w-5"})}),
|
|
23
|
+
/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(G,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Ae,{value:y,onChange:b})]}),
|
|
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(ke,{engagementStyle:t,sort:c,order:u,onSortChange:d,onSortOrderChange:m})})]})},Ve=()=>/* @__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"})]})}),Oe=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=ie(),l=n(null),d=`gam-${t}-banner-${a??"ev"}`,u=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,m=null,g=null,h=null;const p=u?[u]:[],f=document.createElement("div");f.id=d,document.body.appendChild(f);const v=()=>{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 v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(d);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],d)?.addService(window.googletag.pubads());l&&(t=l,m=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&l.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),s=ce({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:c.GAM_CLICK})}}),ae(),window.googletag.display(d),n=window.setTimeout(()=>{e||(v(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==n&&window.clearTimeout(n),s?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,u,t,d]),/* @__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}})})},je=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=ie(),o=n(null),l=`gam-right-${r??"ev"}`,d=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,u=null,m=null,g=null,h=null;const p=d?[d]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const v=()=>{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 v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,m=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&o.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=ce({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:c.GAM_CLICK})}}),ae(),window.googletag.display(l),s=window.setTimeout(()=>{e||(v(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==s&&window.clearTimeout(s),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,d,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Fe=t(()=>import("./BKYyNCOh2.js")),Be=()=>{const t=R().eventSlug,{loadingUser:o,organization:c}=C(),p=u(),[f,w]=r(""),[b,S]=r(void 0),[z,P]=r(N),[O,F]=r(v),[B,H]=r("undefined"!=typeof window&&window.innerWidth<768?q.SINGLE:q.GRID),U=n(null),{event:G,ads:$,gamConfig:D}=te({eventSlug:t}),{loading:W,isError:K,error:Y,refetch:J,contentsWithAds:ne,hasNextPage:re,fetchNextPage:ae,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=N,order:i=v,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=C(),p=c?.organizationId,{isLoading:f,isError:w,error:T,data:q,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S,refetch:L}=A({queryKey:[h.CONTENTS_BY_EVENT(e?._id??""),p??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await g.get(I.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${m[i].sortOrder}${y[r].sortField}`,limit:l},headers:{"x-org-id":p,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(T){throw new Error(T instanceof Error?T.message:String(T)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,initialPageParam:1,getPreviousPageParam:e=>M(e),getNextPageParam:_}),z=a(()=>q?.pages?.flatMap(e=>e?.data??[])??[],[q]);return{contents:z,contentsWithAds:a(()=>"gam"===e?.adMode?n?.inGalleryEnabled?((e=[],t,n)=>{if(!n||n<=0)return e;const[r,a]=t.sizes[0]??[300,250];let i=0;const s=[];for(let o=0;o<e.length;o++)s.push(e[o]),n>0&&(o+1)%n===0&&(s.push({_id:`gam-ad-slot-${i}`,type:E.GAM_AD,slotIndex:i,width:r,height:a}),i++);return s})(z,n,e?.adPosition??5):z:((e=[],t=[],n)=>{if(!n||n<=0)return e;let r=0;const a=[];for(let i=0;i<(e?.length||0);i++)a.push(e[i]),t.length>0&&n>0&&(i+1)%n===0&&(a.push({...t[r],type:E.AD,adType:t[r].type}),r=(r+1)%t.length);return a})(z,t,e?.adPosition),[t,z,e?.adMode,e?.adPosition,n]),loading:f,isError:w,error:T,refetch:L,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S}})({event:G,ads:$,gamConfig:D,sort:z,order:O,keywords:f,face:b}),{incrementEventView:oe}=ie(),{start:le,initializing:ce,running:de}=(({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),p=n(null),f=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),q=n(),x=n(i),b=n(o),E=n(s),C=n(a);x.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===p.current&&(p.current=e);const r=Math.min((e-p.current)/1e3,.05);p.current=e,f.current+=60*m.current*r;const a=Math.floor(f.current);a>0&&(n.scrollTop+=a,f.current-=a),x.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),f.current=0,p.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),q.current&&document.removeEventListener("fullscreenchange",q.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),q.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",q.current),y.current=!0),f.current=0,p.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:re,fetchNextPage:ae,isFetchingNextPage:se,onBottomReached:()=>G?._id&&p.refetchQueries({queryKey:[h.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&oe(G.slug)},[G?.slug,oe]);const ue=a(()=>B===q.SINGLE,[B]),ge=a(()=>/* @__PURE__ */s(Le,{event:G,onAutoscrollClick:le}),[G,le]),he=n(null),pe=n(null);e(()=>(he.current&&he.current.disconnect(),he.current=new IntersectionObserver(e=>{e[0].isIntersecting&&re&&!se&&!W&&ae()},{rootMargin:"200px"}),pe.current&&he.current.observe(pe.current),()=>{he.current&&(he.current.disconnect(),he.current=null)}),[re,se,W,ae]);const fe=D?.bannerPositions??[],ve=c?._id,Te=D&&fe.includes("right"),ye=Boolean(c?.integrationSettings?.showQuickSearch);/* @__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(we,{})}),D&&fe.includes("top")&&/* @__PURE__ */s(Oe,{position:"top",gamConfig:D,eventId:G?._id,organizationId:ve}),
|
|
36
|
+
/* @__PURE__ */s(Re,{engagementStyle:G?.engagementStyle,disabled:o||W,mode:B,onModeChange:e=>H(e),sort:z,sortOrder:O,onSortChange:e=>P(e),onSortOrderChange:()=>F("asc"===O?"desc":"asc"),handleChange:w,face:b,onFaceImageChange:e=>S(e)}),b&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(j,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:b,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(X,{color:"error",icon:/* @__PURE__ */s(ee,{className:"size-5"}),onClick:()=>S(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:[o||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(V,{className:"h-72"},t))}):K?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Z,{title:Y?.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(j,{variant:"body2",color:"muted",align:"center",children:Y?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(X,{icon:/* @__PURE__ */s(me,{className:"size-5"}),onClick:()=>{J()},children:"Retry"})]})})}):ne?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Z,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Ve,{})})}):/* @__PURE__ */s(l,{children:[
|
|
38
|
+
/* @__PURE__ */s("div",{ref:U,className:x(ue?"flex w-full justify-center":"",ce?"opacity-0":"opacity-100",de?"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(V,{className:"h-72"},t))}),children:/* @__PURE__ */s(Fe,{event:G,contents:ne,gamConfig:D,singleColumnMode:ue,kioskMode:de,timestampField:z===T.CAPTURE_TIME?"capturedAt":void 0,curateLink:G?.engagementStyle===L.CONTEST&&G.status===k.OPEN&&G.slug?d.CURATE(G.slug):void 0,onChangeFaceUrl:e=>S(e),showQuickSearch:ye})})}),
|
|
39
|
+
/* @__PURE__ */s("div",{ref:pe,className:"h-4 w-full","aria-hidden":"true"}),se&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(Q,{className:"text-2xl"})})]}),D&&fe.includes("bottom")&&/* @__PURE__ */s(Oe,{position:"bottom",gamConfig:D,eventId:G?._id,organizationId:ve})]}),Te&&/* @__PURE__ */s(je,{gamConfig:D,eventId:G?._id,organizationId:ve})]})]})};export{Be as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as t,f as e,h as r,p as n,t as s,w as o}from"./qbHuxVSe.js";import{I as i,a,n as c,w as l}from"./WtQ5axEj.js";import{t as u}from"./O530RtWA.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./CbpHG7X52.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(t,e,r)=>{o(/* @__PURE__ */s(i,{client:Mt,children:/* @__PURE__ */s(h,{event:t,onExplore:r})}),e)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:o,onExplore:i,logoUrl:u})=>{const h=e(null),d=e(null),m=e(null),y=e(null),b=e([]),w=e([]),x=e(null),k=e(null),E=e(!1),v=e(!1),M=n(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=r(!1),[_,L]=r(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return t(()=>{if(!h.current||d.current)return;let t=!1;return(async()=>{try{const{setOptions:e,importLibrary:r}=await import("./BsT0vqml.js");if(t)return;if(e({key:o,v:"weekly"}),await Promise.all([r("maps"),r("marker"),r("visualization")]),t||!h.current)return;const n=window.google.maps;m.current=n;const s=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new n.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:s,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new n.InfoWindow({maxWidth:280}),k.current=new n.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{t||L(!1)}})(),()=>{t=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[o]),t(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),t(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */s("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
/* @__PURE__ */
|
|
1
|
+
import{C as t,b as e,f as r,h as n,p as s,t as o}from"./C3uDEVBt.js";import{I as i,a,n as c,w as l}from"./TOp1kwsu.js";import{t as u}from"./iWy6455b.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./HO1cwKhZ2.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(e,r,n)=>{t(/* @__PURE__ */o(i,{client:Mt,children:/* @__PURE__ */o(h,{event:e,onExplore:n})}),r)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:t,onExplore:i,logoUrl:u})=>{const h=r(null),d=r(null),m=r(null),y=r(null),b=r([]),w=r([]),x=r(null),k=r(null),E=r(!1),v=r(!1),M=s(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=n(!1),[_,L]=n(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return e(()=>{if(!h.current||d.current)return;let e=!1;return(async()=>{try{const{setOptions:r,importLibrary:n}=await import("./BsT0vqml.js");if(e)return;if(r({key:t,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),e||!h.current)return;const s=window.google.maps;m.current=s;const o=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:o,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new s.InfoWindow({maxWidth:280}),k.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{e||L(!1)}})(),()=>{e=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[t]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */o("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
|
|
2
|
+
/* @__PURE__ */o(g,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:j,activeFolderId:I,setActiveFolderId:T}),P&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),_&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */o("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */o("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
|
+
/* @__PURE__ */o("div",{ref:h,class:"size-full"})]})};export{Lt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return s(l,{as:"div",className:i(P,"relative overflow-hidden"),threshold:a,rootMargin:h,onChange:e=>k(e),children:[N&&!y&&/* @__PURE__ */s(j,{className:"size-full blur-2xl",hash:v}),
|
|
1
|
+
import{D as e,a as t,b as r,f as o,h as n,t as s}from"./C3uDEVBt.js";import{i}from"./TOp1kwsu.js";import{n as a}from"./BkIDQGIs.js";var l=({as:t="div",className:n,threshold:s=.5,rootMargin:i="0px",triggerOnce:a,onChange:l,onClick:h,children:c})=>{const u=o(null),d=o(!1),p=o(l);return p.current=l,r(()=>{const e=u.current;if(!e)return;d.current=!1;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&d.current||(e.isIntersecting&&(d.current=!0),p.current?.(e.isIntersecting))})},{threshold:s,rootMargin:i});return t.observe(e),()=>t.disconnect()},[s,i,a]),e(t,{ref:u,className:n,onClick:h},c)},h=Object.defineProperty,c=Object.defineProperties,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&g(e,r,t[r]);if(d)for(var r of d(t))f.call(t,r)&&g(e,r,t[r]);return e},b=(e,t)=>c(e,u(t)),w=(e,t)=>{var r={};for(var o in e)p.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&d)for(var o of d(e))t.indexOf(o)<0&&f.call(e,o)&&(r[o]=e[o]);return r},v=class extends t{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:o}=this.props;if(this.canvas){let n=a(e,o,t,r),s=this.canvas.getContext("2d"),i=s.createImageData(o,t);i.data.set(n),s.putImageData(i,0,0)}}}componentDidUpdate(){this.draw()}render(){let t=this.props,{hash:r,height:o,width:n}=t,s=w(t,["hash","height","width"]);return e("canvas",b(m({},s),{height:o,width:n,ref:this.handleRef}))}};v.defaultProps={height:128,width:128};var y={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"};(class extends t{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let t=this.props,{hash:r,height:o,width:n,punch:s,resolutionX:i,resolutionY:a,style:l}=t,h=w(t,["hash","height","width","punch","resolutionX","resolutionY","style"]);return e("div",b(m({},h),{style:b(m({display:"inline-block",height:o,width:n},l),{position:"relative"})}),e(v,{hash:r,height:a,width:i,punch:s,style:y}))}}).defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var j=v,O=({src:e,alt:t,threshold:a=.1,rootMargin:h="600px 0px",blurhash:c,containerClassName:u="size-full",wrapperClassName:d,imgClassName:p="",sizeMode:f="cover",position:g="center",delayMs:m=100,delayTime:b,onClick:w})=>{const v=c&&c.length>=6?c:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[y,O]=n(!1),[C,x]=n(!1),[N,k]=n(!1),z=o(null);r(()=>{O(!1),x(!1)},[e]);const M="number"==typeof b?b:m,P=d??u;r(()=>{if(!y)return N?z.current=window.setTimeout(()=>{x(!0)},M):z.current&&(clearTimeout(z.current),z.current=null),()=>{z.current&&clearTimeout(z.current)}},[N,y,M]);const D=C&&N||y;/* @__PURE__ */
|
|
2
|
+
return s(l,{as:"div",className:i(P,"relative overflow-hidden"),threshold:a,rootMargin:h,onChange:e=>k(e),children:[N&&!y&&/* @__PURE__ */s(j,{className:"size-full blur-2xl",hash:v}),D&&e&&/* @__PURE__ */s("img",{alt:t,src:e,loading:"lazy",decoding:"async",onLoad:()=>O(!0),className:i("absolute top-0 left-0 size-full object-center transition-all duration-300",y?"scale-100 opacity-100":"scale-95 opacity-0","contain"===f?"object-contain":"object-cover","top"===g?"object-top":"bottom"===g?"object-bottom":"object-center",p),onClick:e=>w?.(e)})]})};export{l as n,O as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t}from"./
|
|
1
|
+
import{t}from"./C3uDEVBt.js";import{i as a,n as e}from"./TOp1kwsu.js";import{t as i}from"./Bnib0POY.js";var r=({title:r,description:s,iconSvg:o,className:l})=>{const{props:n,organization:c}=e(),m=n?.emptyStateImage;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:a("mx-auto flex w-full max-w-md flex-col items-center justify-center gap-8",l),children:[c?.integrationSettings?.showLogo?/* @__PURE__ */t("img",{className:"h-44 w-auto",src:c?.logoUrl||"/images/qrati-logo.svg",alt:r}):m?/* @__PURE__ */t("img",{className:"h-44 w-auto",src:m,alt:r}):o?/* @__PURE__ */t("div",{className:"text-primary h-44 w-auto",children:o}):null,/* @__PURE__ */t("div",{className:"space-y-2",children:[
|
|
3
3
|
/* @__PURE__ */t(i,{variant:"h4",align:"center",children:r}),"string"==typeof s&&/* @__PURE__ */t(i,{variant:"body2",color:"muted",align:"center",children:s}),"string"!=typeof s&&s]})]})};export{r as t};
|