@qratilabs/qrati-connect 2.30.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/element/{CrmNzHcR.js → 2RASYw2m.js} +3 -3
  2. package/element/{BMqLaOlf.js → 9E5bMl4h.js} +1 -1
  3. package/element/{bhQvNZ6X.js → B1PRJBoi.js} +2 -2
  4. package/element/B2ryYFFr.js +4 -0
  5. package/element/{R0EfjB8a.js → B4_a0yK9.js} +2 -2
  6. package/element/B5UCbssB2.js +36 -0
  7. package/element/{4cGOeNKJ.js → B6VNWZAH.js} +1 -1
  8. package/element/{rPRWiyD72.js → BHZLezAf2.js} +2 -2
  9. package/element/{4oHgfxjP.js → BHa93rAe.js} +1 -1
  10. package/element/{D29TjIxe2.js → BJPxuSLA2.js} +1 -1
  11. package/element/{Bo2w_JaR.js → BVxovwox.js} +1 -1
  12. package/element/{BwwxqSTC2.js → BYM2GyVF2.js} +1 -1
  13. package/element/Be3fjihP2.js +3 -0
  14. package/element/{CHZkFcYR.js → BhSnOrEj.js} +1 -1
  15. package/element/{CirXBSjF2.js → Bon1RRdW2.js} +21 -21
  16. package/element/{5bOrOtEp.js → BxQf2Aj9.js} +1 -1
  17. package/element/{DaRDxhWU.js → CHOgSp57.js} +3 -3
  18. package/element/CLnFGdWV.js +2 -0
  19. package/element/{BOx0cQps2.js → CQMPBmQq2.js} +1 -1
  20. package/element/{DFN3BTNf.js → CS8uERGc.js} +1 -1
  21. package/element/{HZ-pN9la.js → CXRH3zmy.js} +1 -1
  22. package/element/CdivXyOP.js +41 -0
  23. package/element/{D6aS4JIi.js → CuX3CHnz.js} +85 -85
  24. package/element/D6q-D1kv.js +5 -0
  25. package/element/{DKNkaohw.js → DIWjXG_0.js} +1 -1
  26. package/element/{BK-Qpeej2.js → DKxH7j1t2.js} +1 -1
  27. package/element/{CsXYImrD2.js → DLHvSz1a2.js} +1 -1
  28. package/element/{V_AyEifr2.js → DLlq90qS2.js} +1 -1
  29. package/element/DMTh6mDu.js +4 -0
  30. package/element/{DtE36mUY.js → DT0jsFeS.js} +1 -1
  31. package/element/D_uU1Yt72.js +16 -0
  32. package/element/DgRZv6hc2.js +14 -0
  33. package/element/{BrPNl7T5.js → Dng1_dLU.js} +1 -1
  34. package/element/{sqfBNWKt.js → DqAzUQcH.js} +1 -1
  35. package/element/{DDcMOfts.js → QxKjlE-j.js} +1 -1
  36. package/element/WYFR_OYu.js +4 -0
  37. package/element/{-yT__8Qm.js → cBUXG_uS.js} +1 -1
  38. package/element/{DkC6kDkj.js → fb68GFFw.js} +8 -8
  39. package/element/{CUXN8AXD2.js → mZxLLxIK2.js} +1 -1
  40. package/element/oZRYetXV.js +3 -0
  41. package/element/web.es.js +8 -8
  42. package/element/{BJc3_IFY.js → ydzHqf5r.js} +1 -1
  43. package/package.json +1 -1
  44. package/element/2UMuxiHx.js +0 -2
  45. package/element/Bm8666WE.js +0 -4
  46. package/element/BxAzHKo-2.js +0 -3
  47. package/element/C2ksbxMB2.js +0 -36
  48. package/element/C_Ur_JpP.js +0 -5
  49. package/element/CeXZmrQu.js +0 -4
  50. package/element/CgDpKQkL2.js +0 -16
  51. package/element/D1FCdk40.js +0 -3
  52. package/element/DYkEsdph.js +0 -4
  53. package/element/DuD5AV1D2.js +0 -13
  54. package/element/xvMv72y9.js +0 -41
@@ -1,4 +1,4 @@
1
- import{h as a,t as s}from"./BXMw4kNf.js";import{n as o}from"./xvMv72y9.js";import{x as e}from"./Bb9ydqSB.js";import{l as r,t as l}from"./C_Ur_JpP.js";import{t as i}from"./-yT__8Qm.js";import{n as t}from"./JY9kGm742.js";import{t as n}from"./BK-Qpeej2.js";import{a as d,i as m,o as p,r as w,s as c,t as g}from"./BOx0cQps2.js";import{n as h,r as f,t as u}from"./D2-DJv4T2.js";var C=()=>{const{t:C}=t(),[b,v]=a(""),[P,y]=a(""),[N,j]=a(""),[x,A]=a(""),[k,S]=a(""),[z,F]=a(null),[L,E]=a({}),[O,R]=a(!1),[W,D]=a({google:!1,apple:!1}),[G,H]=a({showPassword:!1,showConfirmPassword:!1}),I=r(),{registerUsingEmail:U,loginWithGoogle:Q,loginWithApple:T}=o(),V=a=>{E(s=>s[a]?{...s,[a]:void 0}:s)},Y=async(a,s)=>{D(s=>({...s,[a]:!0})),F(null);try{await(s?.())}catch(o){o instanceof Error?F(o.message):F(`Failed to sign up with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{D(s=>({...s,[a]:!1}))}};/* @__PURE__ */
1
+ import{h as a,t as s}from"./BXMw4kNf.js";import{n as o}from"./CdivXyOP.js";import{x as e}from"./Bb9ydqSB.js";import{l as r,t as l}from"./D6q-D1kv.js";import{t as i}from"./cBUXG_uS.js";import{n as t}from"./JY9kGm742.js";import{t as n}from"./DKxH7j1t2.js";import{a as d,i as m,o as p,r as w,s as c,t as g}from"./CQMPBmQq2.js";import{n as h,r as f,t as u}from"./D2-DJv4T2.js";var C=()=>{const{t:C}=t(),[b,v]=a(""),[P,y]=a(""),[N,j]=a(""),[x,A]=a(""),[k,S]=a(""),[z,F]=a(null),[L,E]=a({}),[O,R]=a(!1),[W,D]=a({google:!1,apple:!1}),[G,H]=a({showPassword:!1,showConfirmPassword:!1}),I=r(),{registerUsingEmail:U,loginWithGoogle:Q,loginWithApple:T}=o(),V=a=>{E(s=>s[a]?{...s,[a]:void 0}:s)},Y=async(a,s)=>{D(s=>({...s,[a]:!0})),F(null);try{await(s?.())}catch(o){o instanceof Error?F(o.message):F(`Failed to sign up with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{D(s=>({...s,[a]:!1}))}};/* @__PURE__ */
2
2
  return s("div",{className:"bg-background w-full space-y-8",children:[/* @__PURE__ */s("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const s=d(b),o=p(P),e=m(N),r=c(x),l=w(k,x);if(s||o||e||r||l)return void E({fname:s,lname:o,email:e,password:r,confirmPassword:l});E({}),R(!0),F(null);const i=await(U?.(N.toLowerCase(),x,b,P));i?.error&&F(i.error),R(!1)},className:"space-y-4",children:[
3
3
  /* @__PURE__ */s("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */s(g,{label:C("auth.firstName","First name"),name:"fname",disabled:O,type:"text",value:b,onChange:a=>{v(a.target.value),V("fname")},error:L.fname}),/* @__PURE__ */s(g,{label:C("auth.lastName","Last name"),name:"lname",disabled:O,type:"text",value:P,onChange:a=>{y(a.target.value),V("lname")},error:L.lname})]}),
4
4
  /* @__PURE__ */s(g,{label:C("auth.email","Email address"),name:"email",disabled:O,type:"email",value:N,onChange:a=>{j(a.target.value),V("email")},autoComplete:"email",error:L.email}),
@@ -1,4 +1,4 @@
1
- import{t}from"./BXMw4kNf.js";import{n as s}from"./xvMv72y9.js";import{x as o}from"./Bb9ydqSB.js";import{d as a,i as r,n as e}from"./C_Ur_JpP.js";import{t as i}from"./BJc3_IFY.js";import{t as n}from"./5bOrOtEp.js";import{t as l}from"./4cGOeNKJ.js";import{t as m}from"./2UMuxiHx.js";import{t as d}from"./JY9kGm742.js";import{t as c}from"./CsXYImrD2.js";import{t as g}from"./BK-Qpeej2.js";var f=()=>{const f=a(),{props:p,folders:v}=s(),h=p?.organizationId,{loading:u,event:N}=c({eventSlug:f.eventSlug});if(u)/* @__PURE__ */return t("div",{children:[
1
+ import{t}from"./BXMw4kNf.js";import{n as s}from"./CdivXyOP.js";import{x as o}from"./Bb9ydqSB.js";import{d as a,i as r,n as e}from"./D6q-D1kv.js";import{t as i}from"./ydzHqf5r.js";import{t as n}from"./BxQf2Aj9.js";import{t as l}from"./B6VNWZAH.js";import{t as m}from"./CLnFGdWV.js";import{t as d}from"./JY9kGm742.js";import{t as c}from"./DLHvSz1a2.js";import{t as g}from"./DKxH7j1t2.js";var f=()=>{const f=a(),{props:p,folders:v}=s(),h=p?.organizationId,{loading:u,event:N}=c({eventSlug:f.eventSlug});if(u)/* @__PURE__ */return t("div",{children:[
2
2
  /* @__PURE__ */t(n,{className:"mx-auto mt-4 h-8 w-64"}),
3
3
  /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-6 w-72"}),
4
4
  /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-8 w-72"}),
@@ -1 +1 @@
1
- import{_ as e,h as n,p as t,v as o}from"./BXMw4kNf.js";import{l as r,n as i}from"./xvMv72y9.js";import{t as a}from"./DmpmrPE5.js";import{i as l}from"./Bb9ydqSB.js";var s=(e,n)=>e.filter(e=>(e.parentFolderId??null)===n).map(n=>{return{folder:n,children:s(e,n._id),eventCount:n.boundary?.length??0,centroid:(t=n.boundary,t?.length?[t.reduce((e,n)=>e+n.x,0)/t.length,t.reduce((e,n)=>e+n.y,0)/t.length]:null),color:n.color||"#fb8500"};var t}).filter(e=>e.eventCount>0||e.children.length>0),d=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),c=()=>{const{folders:c,organization:m}=i(),[u,g]=n(null),f=Boolean(m?.integrationSettings?.enableFolderView),h=t(()=>f?s(c??[],null):[],[c,f]),y=r({queryKey:["map-all-events",m?._id],queryFn:async()=>{const e=await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json();return d(e.data??[])},enabled:Boolean(m?._id)&&(!f||0===h.length),staleTime:3e5,gcTime:6e5,retry:!1}),v=r({queryKey:["map-folder-events",m?._id,u],queryFn:async()=>{const e=await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{folderId:u,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json();return d(e.data??[])},enabled:Boolean(m?._id)&&f&&Boolean(u),staleTime:3e5,gcTime:6e5,retry:!1}),p=t(()=>(c??[]).find(e=>e._id===u)??null,[c,u]);e(()=>{f||g(null)},[f]);const _=o(e=>{g(e)},[]),F=f&&h.length>0;return{folderTree:h,activeFolderId:u,activeFolder:p,visibleEvents:F?v.data??[]:y.data??[],setActiveFolderId:_,isLoadingEvents:F?Boolean(u)&&(v.isLoading||v.isFetching):y.isLoading||y.isFetching}};export{c as t};
1
+ import{_ as e,h as n,p as t,v as o}from"./BXMw4kNf.js";import{l as r,n as i}from"./CdivXyOP.js";import{t as a}from"./DmpmrPE5.js";import{i as l}from"./Bb9ydqSB.js";var s=(e,n)=>e.filter(e=>(e.parentFolderId??null)===n).map(n=>{return{folder:n,children:s(e,n._id),eventCount:n.boundary?.length??0,centroid:(t=n.boundary,t?.length?[t.reduce((e,n)=>e+n.x,0)/t.length,t.reduce((e,n)=>e+n.y,0)/t.length]:null),color:n.color||"#fb8500"};var t}).filter(e=>e.eventCount>0||e.children.length>0),d=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),c=()=>{const{folders:c,organization:m}=i(),[u,g]=n(null),f=Boolean(m?.integrationSettings?.enableFolderView),h=t(()=>f?s(c??[],null):[],[c,f]),y=r({queryKey:["map-all-events",m?._id],queryFn:async()=>{const e=await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json();return d(e.data??[])},enabled:Boolean(m?._id)&&(!f||0===h.length),staleTime:3e5,gcTime:6e5,retry:!1}),v=r({queryKey:["map-folder-events",m?._id,u],queryFn:async()=>{const e=await a.get(l.PUBLIC_EVENTS,{headers:{"x-org-id":m?._id??""},searchParams:{folderId:u,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json();return d(e.data??[])},enabled:Boolean(m?._id)&&f&&Boolean(u),staleTime:3e5,gcTime:6e5,retry:!1}),p=t(()=>(c??[]).find(e=>e._id===u)??null,[c,u]);e(()=>{f||g(null)},[f]);const _=o(e=>{g(e)},[]),F=f&&h.length>0;return{folderTree:h,activeFolderId:u,activeFolder:p,visibleEvents:F?v.data??[]:y.data??[],setActiveFolderId:_,isLoadingEvents:F?Boolean(u)&&(v.isLoading||v.isFetching):y.isLoading||y.isFetching}};export{c as t};
@@ -1 +1 @@
1
- var t=class{constructor(t,i={}){this.lightbox=t,this.options={filmstripButtonOrder:i.filmstripButtonOrder||7,height:i.height||112,thumbnailHeight:i.thumbnailHeight||64,thumbnailWidth:i.thumbnailWidth||96,itemMargin:i.itemMargin??4,buffer:i.buffer??5,backgroundColor:i.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:i.activeBorderColor||"#ff4800",...i},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const i=this.getRootNode();return"function"==typeof i.getElementById?i.getElementById(t):i.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",i=this.getRootNode(),n=i.head??i;if(n.querySelector?.(`#${t}`))return;const e=document.createElement("style");e.id=t,e.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,n.appendChild(e)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const i=this.getElementById("pswp-caption-container");i&&(i.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const i=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,i),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const n=this.querySelector(".pswp");n&&n.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),i=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),i&&(i.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,i){if(!this.filmstripContainer)return;const n=document.createElement("div");n.className="pswp-filmstrip",n.id="pswp-filmstrip-content";const e=document.createElement("div");e.className="pswp-filmstrip__track",e.style.width=t.length*this.itemWidth+"px",n.appendChild(e),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(n),this.filmstripContent=n,this.filmstripTrack=e,n.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(i,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,i){if(!this.filmstripContent||!this.filmstripTrack)return;const n=this.filmstripContent,e=this.filmstripTrack,s=this.contents,r=s.length;if(0===r)return;const l=n.clientWidth,o=n.scrollLeft,p=this.options.buffer;let a=Math.floor(o/this.itemWidth)-p,h=Math.ceil((o+l)/this.itemWidth)+p;a=Math.max(0,a),h=Math.min(r-1,h);for(const[m,d]of this.thumbnailPool)(m<a||m>h)&&(d.parentNode&&d.parentNode.removeChild(d),this.thumbnailPool.delete(m));for(let m=a;m<=h;m++){const i=s[m];if(!i||!i.thumbnailUrl)continue;let n=this.thumbnailPool.get(m);const r=m===t;n?this.updateThumbnailState(n,m,r):(n=this.createThumbnailButton(i,m,r),n.style.left=m*this.itemWidth+"px",e.appendChild(n),this.thumbnailPool.set(m,n))}i&&requestAnimationFrame(()=>this.scrollToThumbnail(t))}createThumbnailButton(t,i,n){const e=document.createElement("button");e.className="pswp-filmstrip__item",e.setAttribute("data-index",i),e.setAttribute("type","button"),e.setAttribute("aria-label",`Go to slide ${i+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(i===n?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",i);const r=document.createElement("img");if(r.className="pswp-filmstrip__img",r.alt=t.caption||`Slide ${i+1}`,r.loading="lazy",r.decoding="async",r.onload=()=>r.classList.add("pswp-filmstrip__img--loaded"),r.src=t.thumbnailUrl,s.appendChild(r),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/>\n </svg>\n ',s.appendChild(t)}return e.appendChild(s),e.addEventListener("click",this.handleThumbnailClick),e}updateThumbnailState(t,i,n){const e=t.querySelector(".pswp-filmstrip__thumb");e&&(n?(e.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(e.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const i=t.currentTarget,n=parseInt(i.getAttribute("data-index"),10);this.pswp&&!isNaN(n)&&this.pswp.goTo(n)}updateActiveSlide(t){if(this.filmstripContent){for(const[i,n]of this.thumbnailPool)this.updateThumbnailState(n,i,i===t);this.scrollToThumbnail(t)}}scrollToThumbnail(t){if(!this.filmstripContent)return;const i=this.contents;if(t<0||t>=i.length)return;const n=this.filmstripContent,e=n.clientWidth/2,s=t*this.itemWidth+this.itemWidth/2;n.scrollTo({left:s-e,behavior:"smooth"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const i="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!i)return[];const n=[];for(let e=0;e<i;e++){let t=null;this.pswp.slides?.[e]?.data?t=this.pswp.slides[e].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(e)),n.push(t||{})}return n.map((t,i)=>this.normalizeItem(t,i))}getContentsFromDOM(t){if(!t)return[];const i=t.querySelectorAll("a[href]");return Array.from(i).map((t,i)=>{const n=t.dataset,e=n.pswpThumbnailUrl||n.pswpMsrc||"",s=(n.pswpType||"").toString().toUpperCase(),r=n.pswpCaption||t.getAttribute("title")||"";return{id:n.pswpId||`item-${i}`,type:s,thumbnailUrl:e||n.pswpSrc||t.getAttribute("href")||"",caption:r}})}normalizeItem(t,i){try{const n=t||{},e=n.data||n,s=(e.type||e.pswpType||n.type||"").toString().toUpperCase(),r=e.thumbnailUrl||e.thumbnail||e.msrc||e.src||"";return{id:e.id||e._id||n.id||n._id||`item-${i}`,type:s,thumbnailUrl:r,caption:e.caption||e.alt||e.title||""}}catch{return{id:`item-${i}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}};export{t as default};
1
+ var t=class{constructor(t,i={}){this.lightbox=t,this.options={filmstripButtonOrder:i.filmstripButtonOrder||7,height:i.height||112,thumbnailHeight:i.thumbnailHeight||64,thumbnailWidth:i.thumbnailWidth||96,itemMargin:i.itemMargin??4,buffer:i.buffer??5,backgroundColor:i.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:i.activeBorderColor||"#ff4800",...i},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const i=this.getRootNode();return"function"==typeof i.getElementById?i.getElementById(t):i.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",i=this.getRootNode(),n=i.head??i;if(n.querySelector?.(`#${t}`))return;const e=document.createElement("style");e.id=t,e.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,n.appendChild(e)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const i=this.getElementById("pswp-caption-container");i&&(i.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const i=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,i),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const n=this.querySelector(".pswp");n&&n.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),i=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),i&&(i.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,i){if(!this.filmstripContainer)return;const n=document.createElement("div");n.className="pswp-filmstrip",n.id="pswp-filmstrip-content";const e=document.createElement("div");e.className="pswp-filmstrip__track",e.style.width=t.length*this.itemWidth+"px",n.appendChild(e),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(n),this.filmstripContent=n,this.filmstripTrack=e,n.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(i,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,i){if(!this.filmstripContent||!this.filmstripTrack)return;const n=this.filmstripContent,e=this.filmstripTrack,s=this.contents,r=s.length;if(0===r)return;const o=n.clientWidth,l=n.scrollLeft,p=this.options.buffer;let a=Math.floor(l/this.itemWidth)-p,h=Math.ceil((l+o)/this.itemWidth)+p;a=Math.max(0,a),h=Math.min(r-1,h);for(const[m,d]of this.thumbnailPool)(m<a||m>h)&&(d.parentNode&&d.parentNode.removeChild(d),this.thumbnailPool.delete(m));for(let m=a;m<=h;m++){const i=s[m];if(!i||!i.thumbnailUrl)continue;let n=this.thumbnailPool.get(m);const r=m===t;n?this.updateThumbnailState(n,m,r):(n=this.createThumbnailButton(i,m,r),n.style.left=m*this.itemWidth+"px",e.appendChild(n),this.thumbnailPool.set(m,n))}i&&requestAnimationFrame(()=>this.scrollToThumbnail(t,!1))}createThumbnailButton(t,i,n){const e=document.createElement("button");e.className="pswp-filmstrip__item",e.setAttribute("data-index",i),e.setAttribute("type","button"),e.setAttribute("aria-label",`Go to slide ${i+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(i===n?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",i);const r=document.createElement("img");if(r.className="pswp-filmstrip__img",r.alt=t.caption||`Slide ${i+1}`,r.loading="lazy",r.decoding="async",r.onload=()=>r.classList.add("pswp-filmstrip__img--loaded"),r.src=t.thumbnailUrl,s.appendChild(r),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/>\n </svg>\n ',s.appendChild(t)}return e.appendChild(s),e.addEventListener("click",this.handleThumbnailClick),e}updateThumbnailState(t,i,n){const e=t.querySelector(".pswp-filmstrip__thumb");e&&(n?(e.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(e.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const i=t.currentTarget,n=parseInt(i.getAttribute("data-index"),10);this.pswp&&!isNaN(n)&&this.pswp.goTo(n)}updateActiveSlide(t){if(this.filmstripContent){for(const[i,n]of this.thumbnailPool)this.updateThumbnailState(n,i,i===t);this.scrollToThumbnail(t,!0)}}scrollToThumbnail(t,i=!0){if(!this.filmstripContent)return;const n=this.contents;if(t<0||t>=n.length)return;const e=this.filmstripContent,s=e.clientWidth/2,r=t*this.itemWidth+this.itemWidth/2;e.scrollTo({left:r-s,behavior:i?"smooth":"auto"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const i="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!i)return[];const n=[];for(let e=0;e<i;e++){let t=null;this.pswp.slides?.[e]?.data?t=this.pswp.slides[e].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(e)),n.push(t||{})}return n.map((t,i)=>this.normalizeItem(t,i))}getContentsFromDOM(t){if(!t)return[];const i=t.querySelectorAll("a[href]");return Array.from(i).map((t,i)=>{const n=t.dataset,e=n.pswpThumbnailUrl||n.pswpMsrc||"",s=(n.pswpType||"").toString().toUpperCase(),r=n.pswpCaption||t.getAttribute("title")||"";return{id:n.pswpId||`item-${i}`,type:s,thumbnailUrl:e||n.pswpSrc||t.getAttribute("href")||"",caption:r}})}normalizeItem(t,i){try{const n=t||{},e=n.data||n,s=(e.type||e.pswpType||n.type||"").toString().toUpperCase(),r=e.thumbnailUrl||e.thumbnail||e.msrc||e.src||"";return{id:e.id||e._id||n.id||n._id||`item-${i}`,type:s,thumbnailUrl:r,caption:e.caption||e.alt||e.title||""}}catch{return{id:`item-${i}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}};export{t as default};
@@ -0,0 +1,3 @@
1
+ import{f as e,t,v as n}from"./BXMw4kNf.js";import{n as r,r as o}from"./CdivXyOP.js";import{t as a}from"./DmpmrPE5.js";import{i,n as s,r as c}from"./Bb9ydqSB.js";import{n as l,t as d}from"./Bki5T_lb.js";function w({className:e}){/* @__PURE__ */
2
+ return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"M12 7.125v7.8l3.15 1.925l-.825-3.6l2.775-2.4l-3.65-.325zm0 10.15l-4.15 2.5q-.275.175-.575.15t-.525-.2t-.35-.437t-.05-.588l1.1-4.725L3.775 10.8q-.25-.225-.312-.513t.037-.562t.3-.45t.55-.225l4.85-.425l1.875-4.45q.125-.3.388-.45t.537-.15t.537.15t.388.45l1.875 4.45l4.85.425q.35.05.55.225t.3.45t.038.563t-.313.512l-3.675 3.175l1.1 4.725q.075.325-.05.588t-.35.437t-.525.2t-.575-.15z"})})}function u({className:e}){/* @__PURE__ */
3
+ return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"M12 20q-3.35 0-5.675-2.325T4 12t2.325-5.675T12 4t5.675 2.325T20 12t-2.325 5.675T12 20m0-2q2.5 0 4.25-1.75T18 12q0-.425-.062-.837t-.188-.813q-.375.075-.75.113t-.75.037q-1.575 0-3-.6T10.7 8.15q-.7 1.425-1.925 2.475T6 12.15q.075 2.45 1.812 4.15T12 18M6.4 9.85q1.1-.575 1.675-1.337T9.2 6.7q-.95.5-1.675 1.313T6.4 9.85m2.388 3.863Q8.5 13.425 8.5 13t.288-.712T9.5 12t.713.288t.287.712t-.288.713T9.5 14t-.712-.288M16.25 8.5h.3q.15 0 .3-.025q-.825-1.125-2.087-1.8T12 6h-.3q-.15 0-.275.025q.975 1.125 2.062 1.8t2.763.675m-2.463 5.213Q13.5 13.425 13.5 13t.288-.712T14.5 12t.713.288t.287.712t-.288.713T14.5 14t-.712-.288M1 5V3q0-.825.588-1.412T3 1h2q.425 0 .713.288T6 2t-.288.713T5 3H3v2q0 .425-.288.713T2 6t-.712-.288T1 5m4 18H3q-.825 0-1.412-.587T1 21v-2q0-.425.288-.712T2 18t.713.288T3 19v2h2q.425 0 .713.288T6 22t-.288.713T5 23m16 0h-2q-.425 0-.712-.288T18 22t.288-.712T19 21h2v-3h2v3q0 .825-.587 1.413T21 23m0-18V3h-2q-.425 0-.712-.288T18 2t.288-.712T19 1h2q.825 0 1.413.588T23 3v2q0 .425-.288.713T22 6t-.712-.288T21 5M9.2 6.7"})})}var m=null,p=!1,g=()=>m||(m=new Promise(e=>{if("undefined"==typeof window)return void e();if(window.googletag=window.googletag||{cmd:[]},document.querySelector('script[src*="gpt.js"]'))return void e();const t=document.createElement("script");t.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",t.async=!0,t.crossOrigin="anonymous",t.onload=()=>e(),t.onerror=()=>e(),document.head.appendChild(t)})),h=()=>{p||(p=!0,window.googletag.enableServices())},T=e=>{try{const t=(window.googletag.pubads().getSlots?.()??[]).find(t=>t.getSlotElementId?.()===e);t&&window.googletag.destroySlots([t])}catch{}},v=async()=>{try{return await(async()=>{const e=await o();return"string"==typeof e?e:e?.fingerprint})()}catch(e){return console.error("[Qrati Connect] Browser fingerprint unavailable:",e),null}},f=()=>{const t=e(null),{props:o,sessionId:w,user:u}=r(),m=o?.organizationId,p=e(null),g=e(null),h=n(async e=>{if(e&&(t.current||(t.current=await v()),t.current))try{await a.post(i.TRACK_EVENT,{json:{kind:"view",eventSlug:e,browserFingerprint:t.current},headers:{"x-org-id":m,...u?{Authorization:`Bearer ${u.token}`}:{}}})}catch(n){console.error(n)}},[m,u]),T=n(async(e,n)=>{if(e&&n&&(t.current||(t.current=await v()),t.current))try{await a.post(i.TRACK_EVENT,{json:{kind:"ad",adId:e,type:n,browserFingerprint:t.current},headers:{"x-org-id":m}})}catch(r){console.error(r)}},[m]),f=n(async e=>T(e,s.AD_IMPRESSION),[T]),E=n(async e=>T(e,s.AD_ENGAGEMENT),[T]),q=n((e,t,n)=>{if(T(e,s.AD_CLICK),!n)return;const r=String(n);switch(t){case c.LINK:d(r,["http:","https:"])&&window.open(r,"_blank","noopener,noreferrer");break;case c.EMAIL:{const e=l(r);e&&(window.location.href=`mailto:${e}`);break}case c.PHONE:{const e=l(r);e&&(window.location.href=`tel:${e}`);break}case c.SMS:{const e=l(r);e&&(window.location.href=`sms:${e}`);break}case c.WHATSAPP:{const e=l(r);e&&(window.location.href=`https://wa.me/${encodeURIComponent(e)}`);break}case c.MESSENGER:{const e=l(r);e&&(window.location.href=`https://m.me/${encodeURIComponent(e)}`);break}default:d(r,["http:","https:"])&&window.open(r,"_blank","noopener,noreferrer")}},[T]),y=n(e=>{if(p.current&&g.current){const e={page:p.current,entryTime:g.current,exitTime:Date.now()};I([e])}p.current=e??null,g.current=Date.now()},[]),I=n(async e=>{if(w)try{await a.post(i.UPDATE_SESSION,{headers:{"x-org-id":m},json:{sessionId:w,pageViews:e}})}catch(t){console.error(t)}},[m,w]);return{incrementEventView:h,captureAdImpression:f,captureAdEngagement:E,captureAdClick:q,trackPageView:y,exportPageViewsData:I,trackGamAnalytics:n(async({eventId:e,organizationId:n,type:r,creativeId:o,lineItemId:s,advertiserId:c,isEmpty:l})=>{if(!e||!r)return;if(t.current||(t.current=await v()),!t.current)return;const d=n||m;if(d)try{await a.post(i.TRACK_EVENT,{json:{kind:"gam",eventId:e,organizationId:d,type:r,browserFingerprint:t.current,...o?{creativeId:o}:{},...s?{lineItemId:s}:{},...c?{advertiserId:c}:{},...void 0!==l?{isEmpty:l}:{}},headers:{"x-org-id":d}})}catch(w){console.error(w)}},[m])}},E=({container:e,onClick:t})=>{let n=!1,r=!1,o=0,a=null;const i=()=>{n=!0,o=Date.now()},s=()=>{n=!1},c=()=>{null!==a&&(window.clearTimeout(a),a=null)},l=()=>{a=window.setTimeout(()=>{const a=document.activeElement,i=a instanceof HTMLIFrameElement&&e.contains(a),s=Date.now()-o<=1500;!r&&(i||n&&s)&&(r=!0,t())},0)};return e.addEventListener("pointerenter",i),e.addEventListener("pointerleave",s),window.addEventListener("blur",l),window.addEventListener("focus",c),()=>{e.removeEventListener("pointerenter",i),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",l),window.removeEventListener("focus",c),null!==a&&window.clearTimeout(a)}};export{g as a,h as i,f as n,u as o,T as r,w as s,E as t};
@@ -1,4 +1,4 @@
1
- import{_ as r,t as e}from"./BXMw4kNf.js";import{i as a,n as s}from"./xvMv72y9.js";import{x as t}from"./Bb9ydqSB.js";import{i,l as o,n as m,u as d}from"./C_Ur_JpP.js";import{t as l}from"./5bOrOtEp.js";import{t as n}from"./BxZobjC-.js";import{t as c}from"./2UMuxiHx.js";var p=()=>{const p=o(),b=d(),{initializing:f,organization:h,user:x}=s(),u=p.pathname.endsWith("/login")||p.pathname.endsWith("/register");return r(()=>{if(x){const r=p.state?.referrer;b(r||"/",{replace:!0})}},[x]),f?/* @__PURE__ */e("div",{className:"mx-auto max-w-lg space-y-8 py-8",children:[
1
+ import{_ as r,t as e}from"./BXMw4kNf.js";import{i as a,n as s}from"./CdivXyOP.js";import{x as t}from"./Bb9ydqSB.js";import{i,l as o,n as m,u as d}from"./D6q-D1kv.js";import{t as l}from"./BxQf2Aj9.js";import{t as n}from"./BxZobjC-.js";import{t as c}from"./CLnFGdWV.js";var p=()=>{const p=o(),b=d(),{initializing:f,organization:h,user:x}=s(),u=p.pathname.endsWith("/login")||p.pathname.endsWith("/register");return r(()=>{if(x){const r=p.state?.referrer;b(r||"/",{replace:!0})}},[x]),f?/* @__PURE__ */e("div",{className:"mx-auto max-w-lg space-y-8 py-8",children:[
2
2
  /* @__PURE__ */e(l,{className:"h-8"}),
3
3
  /* @__PURE__ */e(l,{className:"h-8"}),
4
4
  /* @__PURE__ */e(l,{className:"h-8"}),
@@ -1,11 +1,11 @@
1
- import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./BXMw4kNf.js";import{f as c,i as d,l as u,n as m}from"./xvMv72y9.js";import{n as g,r as h,t as f}from"./sqfBNWKt.js";import{t as p}from"./DmpmrPE5.js";import{E as w,S as v,T,_ as y,a as N,c as x,d as q,f as E,g as b,h as C,i as S,l as I,m as L,o as z,p as k,s as M,u as _,x as A}from"./Bb9ydqSB.js";import{d as P,t as R}from"./C_Ur_JpP.js";import{n as V,t as F}from"./-yT__8Qm.js";import{a as O,c as j,d as B,i as U,l as H,n as G,o as $,r as W,s as D,t as Q,u as K}from"./DkC6kDkj.js";import{t as Z}from"./Dl6jcv9I.js";import{t as Y}from"./BJc3_IFY.js";import{t as J}from"./5bOrOtEp.js";import{t as X}from"./C0eP2utz.js";import{r as ee}from"./JY9kGm742.js";import{t as te}from"./CsXYImrD2.js";import{n as ne,t as re}from"./BK-Qpeej2.js";import{t as ae}from"./fQmLbYcp2.js";import{a as ie,i as se,n as oe,o as le,r as ce,s as de,t as ue}from"./BxAzHKo-2.js";import{c as me,i as ge,n as he,t as fe}from"./C2WFktw12.js";import{n as pe,t as we}from"./BOx0cQps2.js";function ve(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function Te({className:e}){/* @__PURE__ */
1
+ import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./BXMw4kNf.js";import{f as c,i as d,l as u,n as m}from"./CdivXyOP.js";import{n as g,r as h,t as f}from"./DqAzUQcH.js";import{t as p}from"./DmpmrPE5.js";import{E as v,S as w,T,_ as y,a as N,c as x,d as q,f as b,g as E,h as C,i as S,l as I,m as L,o as z,p as k,s as M,u as A,x as _}from"./Bb9ydqSB.js";import{d as P,t as R}from"./D6q-D1kv.js";import{n as V,t as F}from"./cBUXG_uS.js";import{a as O,c as j,d as B,i as U,l as H,n as G,o as $,r as D,s as W,t as K,u as Q}from"./fb68GFFw.js";import{t as Z}from"./Dl6jcv9I.js";import{t as Y}from"./ydzHqf5r.js";import{t as J}from"./BxQf2Aj9.js";import{t as X}from"./C0eP2utz.js";import{r as ee}from"./JY9kGm742.js";import{t as te}from"./DLHvSz1a2.js";import{n as ne,t as re}from"./DKxH7j1t2.js";import{t as ae}from"./fQmLbYcp2.js";import{a as ie,i as se,n as oe,o as le,r as ce,s as de,t as ue}from"./Be3fjihP2.js";import{c as me,i as ge,n as he,t as fe}from"./C2WFktw12.js";import{n as pe,t as ve}from"./CQMPBmQq2.js";function we(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function Te({className:e}){/* @__PURE__ */
2
2
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function ye({className:e}){/* @__PURE__ */
3
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Ne=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,u]=r(!1),m=n(null),g=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!m.current||!t)return void u(!1);const e=m.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(g.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),u(c>o*a+1)},r=()=>{null!==g.current&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==g.current&&window.cancelAnimationFrame(g.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:d("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:m,className:d(V({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,c&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),c&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},xe=()=>{const{t:e}=ee(),{eventSlug:t}=P(),{event:n}=te({eventSlug:t}),{props:r,organization:a,folders:i}=m(),{curateLabel:o,leaderboardLabel:l}=r??{},{eventViews:c,contentCount:d,curationCount:g}=(({event:e})=>{const{props:t,organization:n}=m(),r=t?.organizationId,{isLoading:a,data:i}=u({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await p.get(S.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n}),h=a?.integrationSettings?.showFolderBreadcrumb&&n?.folderId?H(i??[],n.folderId):[];/* @__PURE__ */
4
- return s("div",{className:"w-full space-y-3 md:-mt-6",children:[h.length>0&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s(K,{homeLink:A.PUBLIC_EVENTS,data:h})}),
5
- /* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(Ne,{description:n?.description})]}),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(ye,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:ve(c??0)})]}),
7
- /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(Te,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:ve(d??0)})]}),n?.engagementStyle===E.CONTEST&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(de,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:g})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&n?.engagementStyle===E.CONTEST||n?.engagementStyle===E.REACTION&&n?.showLeaderboard||n?.engagementStyle===E.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(R,{to:A.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(me,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&n?.engagementStyle===E.CONTEST&&/* @__PURE__ */s(R,{to:A.CURATE(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:o||e("content.curate","Curate")})}),n?.showLeaderboard&&/* @__PURE__ */s(R,{to:A.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(ae,{className:"size-5"}),children:l||e("content.leaderboard","Leaderboard")})})]})]})},qe=(e,t)=>["in-review-count",e??"",t??""];function Ee({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 be({className:e}){/* @__PURE__ */
3
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Ne=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,u]=r(!1),m=n(null),g=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!m.current||!t)return void u(!1);const e=m.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(g.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),u(c>o*a+1)},r=()=>{null!==g.current&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==g.current&&window.cancelAnimationFrame(g.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:d("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:m,className:d(V({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,c&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),c&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},xe=()=>{const{t:e}=ee(),{eventSlug:t}=P(),{event:n,parameters:r}=te({eventSlug:t}),{props:a,organization:i,folders:o}=m(),{curateLabel:l,leaderboardLabel:c}=a??{},{eventViews:d,contentCount:g,curationCount:h}=(({event:e})=>{const{props:t,organization:n}=m(),r=t?.organizationId,{isLoading:a,data:i}=u({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await p.get(S.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n}),f=Array.isArray(r)&&r.length>0,v=n?.engagementStyle===b.CONTEST||f,w=i?.integrationSettings?.showFolderBreadcrumb&&n?.folderId?H(o??[],n.folderId):[];/* @__PURE__ */
4
+ return s("div",{className:"w-full space-y-3 md:-mt-6",children:[w.length>0&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s(Q,{homeLink:_.PUBLIC_EVENTS,data:w})}),
5
+ /* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(Ne,{description:n?.description})]}),i?.integrationSettings?.showEventStats&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s("div",{className:"flex items-center gap-6",children:[
6
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(ye,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:we(d??0)})]}),
7
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(Te,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:we(g??0)})]}),v&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(de,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:h})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&v||n?.engagementStyle===b.REACTION&&n?.showLeaderboard||n?.engagementStyle===b.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(R,{to:_.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(me,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&v&&/* @__PURE__ */s(R,{to:_.CURATE(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:l||e("content.curate","Curate")})}),n?.showLeaderboard&&/* @__PURE__ */s(R,{to:_.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(ae,{className:"size-5"}),children:c||e("content.leaderboard","Leaderboard")})})]})]})},qe=(e,t)=>["in-review-count",e??"",t??""];function be({className:e}){/* @__PURE__ */
8
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function Ee({className:e}){/* @__PURE__ */
9
9
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function Ce({className:e}){/* @__PURE__ */
10
10
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function Se({className:e}){/* @__PURE__ */
11
11
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function Ie({className:e}){/* @__PURE__ */
@@ -13,14 +13,14 @@ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
13
13
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function ze({className:e}){/* @__PURE__ */
14
14
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function ke({className:e}){/* @__PURE__ */
15
15
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var Me=({event:e})=>{const t=c(),{user:n,props:a}=m(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
16
- return s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(o?ke:ze,{className:"size-6"})}),/* @__PURE__ */s(W,{align:"end",side:"bottom",className:"w-44",children:Object.values(b).map(r=>/* @__PURE__ */s(U,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await p.post(S.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:pe(r)},r))})]})},_e=({event:e,onAutoscrollClick:t})=>{const{t:n}=ee(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=j(),{inReviewCount:d}=(e=>{const t=c(),{props:n}=m(),r=n?.organizationId,{role:a,isSuper:i}=j(),{isLoading:s,data:o,isError:l,error:d}=u({queryKey:qe(r,e?.slug),queryFn:async()=>{try{const t=await p.get(S.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${M.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?d:null,increment:()=>{t.setQueryData(qe(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(qe(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),g=r||i||o||l,h=r||i||o,f=a(()=>{const t=[];return h&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:Ee,href:C.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===L.PRIVATE&&g&&t.push({title:n("event.access_requests","Access Requests"),icon:Le,href:C.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===E.CONTEST&&h&&t.push({title:n("event.curation_details","Curation Details"),icon:Ie,href:C.EVENT_CURATION_DETAILS(e?.slug??"")}),h&&t.push({title:n("event.edit_event","Edit Event"),icon:$,href:C.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,h,g]);/* @__PURE__ */
17
- return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(D,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(Ce,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&h&&/* @__PURE__ */s(Me,{event:e}),g&&/* @__PURE__ */s(D,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:C.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(be,{className:"size-6"}),Number(d)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:d})]})}),f.length>0&&/* @__PURE__ */s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(Se,{className:"size-6"})}),/* @__PURE__ */s(W,{align:"end",side:"bottom",className:"w-48",children:f.map(e=>/* @__PURE__ */s(U,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function Ae({className:e}){/* @__PURE__ */
18
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Pe=({engagementStyle:e,sort:t=_,order:n=q,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=ee(),l=a(()=>{const t=Object.keys(z).map(e=>({text:o(`content.sortby_${z[e].label.toLowerCase()}`,z[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===E.CONTEST?t:t.filter(e=>e.value!==N.POPULAR)},[e,o]);/* @__PURE__ */
19
- return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:d("text-foreground w-7 -scale-x-100 transition-transform",n===T.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(B,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Re=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ve=({value:t,onChange: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?ne:le,{})})}),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(!Re.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{const n=await ge(e);t=n.size/1024/1024>1?await he(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},Fe={[I.GRID]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})},[I.SINGLE]:{icon:/* @__PURE__ */s(Ae,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),je=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:g,handleChange:h,face:f,onFaceImageChange:p})=>{const{t:w}=ee(),{organization:v}=m(),[T,y]=r(""),[N,x]=r(null),q=n(null),E=o(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=o(e=>{if(x(e),E(),e){const t=URL.createObjectURL(e);q.current=t,p?.(t)}else p?.(void 0)},[p,E]),C=o(e=>{y(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?h&&h(T.length>0?T:""):"Escape"===t&&(y(""),h&&h(""))},[T,h]),I=o(()=>{y(""),h&&h("")},[h]),L=o(()=>{h&&h(T)},[T,h]);return e(()=>{f||x(null)},[f]),e(()=>()=>{E()},[E]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
21
- /* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(B,{buttons:Oe,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(we,{placeholder:w("content.search_placeholder","Search using text"),value:T,className:"py-2",onChange:C,onKeyUp:S}),T?.length>0&&/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */s(X,{className:"text-foreground w-5"})}),
23
- /* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(Q,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Ve,{value:N,onChange:b})]}),
16
+ return s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(o?ke:ze,{className:"size-6"})}),/* @__PURE__ */s(D,{align:"end",side:"bottom",className:"w-44",children:Object.values(E).map(r=>/* @__PURE__ */s(U,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await p.post(S.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:pe(r)},r))})]})},Ae=({event:e,onAutoscrollClick:t})=>{const{t:n}=ee(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=j(),{inReviewCount:d}=(e=>{const t=c(),{props:n}=m(),r=n?.organizationId,{role:a,isSuper:i}=j(),{isLoading:s,data:o,isError:l,error:d}=u({queryKey:qe(r,e?.slug),queryFn:async()=>{try{const t=await p.get(S.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${M.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?d:null,increment:()=>{t.setQueryData(qe(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(qe(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),g=r||i||o||l,h=r||i||o,f=a(()=>{const t=[];return h&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:be,href:C.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===L.PRIVATE&&g&&t.push({title:n("event.access_requests","Access Requests"),icon:Le,href:C.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===b.CONTEST&&h&&t.push({title:n("event.curation_details","Curation Details"),icon:Ie,href:C.EVENT_CURATION_DETAILS(e?.slug??"")}),h&&t.push({title:n("event.edit_event","Edit Event"),icon:$,href:C.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,h,g]);/* @__PURE__ */
17
+ return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(W,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{"aria-label":n("event.kiosk_mode","Kiosk Mode"),onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(Ce,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&h&&/* @__PURE__ */s(Me,{event:e}),g&&/* @__PURE__ */s(W,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:C.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(Ee,{className:"size-6"}),Number(d)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:d})]})}),f.length>0&&/* @__PURE__ */s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(Se,{className:"size-6"})}),/* @__PURE__ */s(D,{align:"end",side:"bottom",className:"w-48",children:f.map(e=>/* @__PURE__ */s(U,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function _e({className:e}){/* @__PURE__ */
18
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Pe=({engagementStyle:e,sort:t=A,order:n=q,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=ee(),l=a(()=>{const t=Object.keys(z).map(e=>({text:o(`content.sortby_${z[e].label.toLowerCase()}`,z[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===b.CONTEST?t:t.filter(e=>e.value!==N.POPULAR)},[e,o]);/* @__PURE__ */
19
+ return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button","aria-label":"Sort "+(n===T.ASC?"descending":"ascending"),className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:d("text-foreground w-7 -scale-x-100 transition-transform",n===T.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(B,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Re=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ve=({value:t,onChange:a})=>{const[i,o]=r(!1),l=n(null),[c,d]=r(null);return e(()=>{if(!t)return void d(null);const e=URL.createObjectURL(t);return d(e),()=>{URL.revokeObjectURL(e)}},[t]),e(()=>{!t&&l.current&&(l.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button","aria-label":"Choose image for facial search",onClick:()=>l.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(i?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(i?ne:le,{})})}),t&&c&&/* @__PURE__ */s("img",{src:c,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
+ /* @__PURE__ */s("input",{ref:l,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Re.includes(n))return a(null);(async e=>{if(!e)return;o(!0);let t=e;try{const n=await ge(e);t=n.size/1024/1024>1?await he(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}o(!1),a(t)})(t)}})]})},Fe={[I.GRID]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})},[I.SINGLE]:{icon:/* @__PURE__ */s(_e,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),je=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:g,handleChange:h,face:f,onFaceImageChange:p})=>{const{t:v}=ee(),{organization:w}=m(),T=Boolean(w?.advancedSettings?.aiSettings?.faceRecognitionEnabled),y=!0===w?.integrationSettings?.showFacialSearch&&T,[N,x]=r(""),[q,b]=r(null),E=n(null),C=o(()=>{E.current&&(URL.revokeObjectURL(E.current),E.current=null)},[]),S=o(e=>{if(b(e),C(),e){const t=URL.createObjectURL(e);E.current=t,p?.(t)}else p?.(void 0)},[p,C]),I=o(e=>{x(e.target.value)},[]),L=o(e=>{const t=e.key;"Enter"===t?h&&h(N.length>0?N:""):"Escape"===t&&(x(""),h&&h(""))},[N,h]),z=o(()=>{x(""),h&&h("")},[h]),k=o(()=>{h&&h(N)},[N,h]);return e(()=>{f||b(null)},[f]),e(()=>()=>{C()},[C]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
21
+ /* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[w?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(B,{buttons:Oe,selected:i,onChange:l}),w?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
22
+ /* @__PURE__ */s(ve,{placeholder:v("content.search_placeholder","Search using text"),value:N,className:"py-2",onChange:I,onKeyUp:L}),N?.length>0&&/* @__PURE__ */s("button",{type:"button","aria-label":"Clear search",className:"absolute inset-y-0 right-10 flex items-center",onClick:z,children:/* @__PURE__ */s(X,{className:"text-foreground w-5"})}),
23
+ /* @__PURE__ */s("button",{type:"button","aria-label":"Search",className:"absolute inset-y-0 right-3 flex items-center",onClick:k,children:/* @__PURE__ */s(K,{className:"text-foreground w-5"})})]})}),y&&/* @__PURE__ */s(Ve,{value:q,onChange:S})]}),
24
24
  /* @__PURE__ */s("div",{className:"col-span-3 md:col-span-1"}),
25
25
  /* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(Pe,{engagementStyle:t,sort:c,order:u,onSortChange:d,onSortOrderChange:g})})]})},Be=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
26
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"}),
@@ -29,11 +29,11 @@ return s("div",{className:"relative flex w-auto items-center gap-2",children:[/*
29
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
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
31
  /* @__PURE__ */s("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
32
- /* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Ue=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=oe(),l=n(null),c=`gam-${t}-banner-${a??"ev"}`,d=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,u=null,m=null,g=null;const h=d?[d]:[],f=document.createElement("div");f.id=c,document.body.appendChild(f);const p=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(c);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],c)?.addService(window.googletag.pubads());l&&(t=l,u=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&l.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),s=ue({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:y.GAM_CLICK})}}),se(),window.googletag.display(c),n=window.setTimeout(()=>{e||(p(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==n&&window.clearTimeout(n),s?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,d,t,c]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},He=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=oe(),o=n(null),l=`gam-right-${r??"ev"}`,c=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,d=null,u=null,m=null,g=null;const h=c?[c]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const p=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,u=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&o.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),d=ue({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:y.GAM_CLICK})}}),se(),window.googletag.display(l),s=window.setTimeout(()=>{e||(p(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==s&&window.clearTimeout(s),d?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,c,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Ge=t(()=>import("./C2ksbxMB2.js")),$e=()=>{const t=P().eventSlug,{loadingUser:u,organization:T}=m(),y=c(),[b,C]=r(""),[L,M]=r(void 0),[R,V]=r(_),[O,j]=r(q),[B,U]=r("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),H=n(null),{event:G,ads:$,gamConfig:W}=te({eventSlug:t}),{loading:D,isError:Q,error:K,refetch:ee,contentsWithAds:ne,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=_,order:i=q,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=m(),T=c?.organizationId,{isLoading:y,isError:N,error:E,data:b,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L,refetch:k}=h({queryKey:[v.CONTENTS_BY_EVENT(e?._id??""),T??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await p.get(S.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${w[i].sortOrder}${z[r].sortField}`,limit:l},headers:{"x-org-id":T,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(E){throw new Error(E instanceof Error?E.message:String(E)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>g(e),getNextPageParam:f,maxPages:30}),M=a(()=>b?.pages?.flatMap(e=>e?.data??[])??[],[b]);return{contents:M,contentsWithAds:a(()=>{const r=Boolean(n?.inGalleryEnabled);return((e=[],{ads:t,gamConfig:n,position:r,gamShare:a})=>{if(r<=0)return e;const i=Boolean(n?.inGalleryEnabled),s=t.length>0;if(!i&&!s)return e;const o=i?s?Math.min(1,Math.max(0,a)):1:0,l=e=>{const n=t.length>1?t.filter(t=>t._id!==e):t,r=n.reduce((e,t)=>e+Math.max(1,t.frequency??1),0);let a=Math.random()*r;for(const t of n)if(a-=Math.max(1,t.frequency??1),a<=0)return t;return n[n.length-1]};let c=null,d=0;const u=[];for(let m=0;m<e.length;m++)if(u.push(e[m]),(m+1)%r===0){if(i&&(!s||Math.floor((d+1)*o)>Math.floor(d*o))&&n){const e=s?l(c):null;u.push({_id:`gam-ad-slot-${d}`,type:x.GAM_AD,slotIndex:d,gamConfig:n,fallbackAd:e,width:n.sizes[0]?.[0]??300,height:n.sizes[0]?.[1]??250})}else{const e=l(c);c=e._id??null,u.push({...e,type:x.AD,adType:e.type})}d++}return u})(M,{ads:"gam"!==e?.adMode||r?t:[],gamConfig:r?n:null,position:e?.adPosition??0,gamShare:(n?.inGalleryBlend??50)/100})},[M,t,e,n]),loading:y,isError:N,error:E,refetch:k,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L}})({event:G,ads:$,gamConfig:W,sort:R,order:O,keywords:b,face:L}),{incrementEventView:le}=oe(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),f=n(null),p=n(0),w=n(!1),v=n(null),T=n(null),y=n(!1),N=n(),x=n(),q=n(i),E=n(o),b=n(s),C=n(a);q.current=i,E.current=o,b.current=s,C.current=a,e(()=>{o||(w.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===f.current&&(f.current=e);const r=Math.min((e-f.current)/1e3,.05);f.current=e,p.current+=60*m.current*r;const a=Math.floor(p.current);a>0&&(n.scrollTop+=a,p.current-=a),q.current&&!E.current&&!w.current&&"function"==typeof b.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(w.current=!0,b.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),w.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),p.current=0,f.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==v.current&&v.current.release().catch(()=>{}).finally(()=>{v.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),x.current&&document.removeEventListener("fullscreenchange",x.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;v.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(v.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),x.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",x.current),y.current=!0),p.current=0,f.current=null,w.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:H,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se,onBottomReached:()=>G?._id&&y.refetchQueries({queryKey:[v.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&le(G.slug)},[G?.slug,le]);const me=a(()=>B===I.SINGLE,[B]),ge=a(()=>/* @__PURE__ */s(_e,{event:G,onAutoscrollClick:ce}),[G,ce]),he=n(null),pe=n({hasNextPage:ae,isFetchingNextPage:se,loading:D,running:ue,fetchNextPage:ie});pe.current={hasNextPage:ae,isFetchingNextPage:se,loading:D,running:ue,fetchNextPage:ie},e(()=>(he.current=new IntersectionObserver(e=>{const t=pe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{he.current?.disconnect(),he.current=null}),[]);const we=o(e=>{const t=he.current;t&&(t.disconnect(),e&&t.observe(e))},[]),ve=W?.bannerPositions??[],Te=T?._id,ye=W&&ve.includes("right"),Ne=Boolean(T?.integrationSettings?.showQuickSearch);/* @__PURE__ */
32
+ /* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Ue=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=oe(),l=n(null),c=`gam-${t}-banner-${a??"ev"}`,d=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,u=null,m=null,g=null;const h=d?[d]:[],f=document.createElement("div");f.id=c,document.body.appendChild(f);const p=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(c);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],c)?.addService(window.googletag.pubads());l&&(t=l,u=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&l.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),s=ue({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:y.GAM_CLICK})}}),se(),window.googletag.display(c),n=window.setTimeout(()=>{e||(p(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==n&&window.clearTimeout(n),s?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,d,t,c]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},He=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=oe(),o=n(null),l=`gam-right-${r??"ev"}`,c=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,d=null,u=null,m=null,g=null;const h=c?[c]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const p=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,u=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&o.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),d=ue({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:y.GAM_CLICK})}}),se(),window.googletag.display(l),s=window.setTimeout(()=>{e||(p(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==s&&window.clearTimeout(s),d?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,c,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Ge=t(()=>import("./B5UCbssB2.js")),$e=e=>e?.status===k.OPEN||Boolean(e?.isUnlimitedDuration&&!e?.endDate),De=e=>Array.isArray(e)&&e.length>0,We=()=>{const t=P().eventSlug,{loadingUser:u,organization:T}=m(),y=c(),[E,C]=r(""),[L,k]=r(void 0),[M,R]=r(A),[V,O]=r(q),[j,B]=r("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),U=n(null),{event:H,ads:G,gamConfig:$,parameters:D}=te({eventSlug:t}),{loading:W,isError:K,error:Q,refetch:ee,contentsWithAds:ne,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=A,order:i=q,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=m(),T=c?.organizationId,{isLoading:y,isError:N,error:b,data:E,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L,refetch:k}=h({queryKey:[w.CONTENTS_BY_EVENT(e?._id??""),T??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await p.get(S.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${v[i].sortOrder}${z[r].sortField}`,limit:l},headers:{"x-org-id":T,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(b){throw new Error(b instanceof Error?b.message:String(b)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>g(e),getNextPageParam:f,maxPages:30}),M=a(()=>E?.pages?.flatMap(e=>e?.data??[])??[],[E]);return{contents:M,contentsWithAds:a(()=>{const r=Boolean(n?.inGalleryEnabled);return((e=[],{ads:t,gamConfig:n,position:r,gamShare:a})=>{if(r<=0)return e;const i=Boolean(n?.inGalleryEnabled),s=t.length>0;if(!i&&!s)return e;const o=i?s?Math.min(1,Math.max(0,a)):1:0,l=e=>{const n=t.length>1?t.filter(t=>t._id!==e):t,r=n.reduce((e,t)=>e+Math.max(1,t.frequency??1),0);let a=Math.random()*r;for(const t of n)if(a-=Math.max(1,t.frequency??1),a<=0)return t;return n[n.length-1]};let c=null,d=0;const u=[];for(let m=0;m<e.length;m++)if(u.push(e[m]),(m+1)%r===0){if(i&&(!s||Math.floor((d+1)*o)>Math.floor(d*o))&&n){const e=s?l(c):null;u.push({_id:`gam-ad-slot-${d}`,type:x.GAM_AD,slotIndex:d,gamConfig:n,fallbackAd:e,width:n.sizes[0]?.[0]??300,height:n.sizes[0]?.[1]??250})}else{const e=l(c);c=e._id??null,u.push({...e,type:x.AD,adType:e.type})}d++}return u})(M,{ads:"gam"!==e?.adMode||r?t:[],gamConfig:r?n:null,position:e?.adPosition??0,gamShare:(n?.inGalleryBlend??50)/100})},[M,t,e,n]),loading:y,isError:N,error:b,refetch:k,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L}})({event:H,ads:G,gamConfig:$,sort:M,order:V,keywords:E,face:L}),{incrementEventView:le}=oe(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),f=n(null),p=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),x=n(),q=n(i),b=n(o),E=n(s),C=n(a);q.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(v.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===f.current&&(f.current=e);const r=Math.min((e-f.current)/1e3,.05);f.current=e,p.current+=60*m.current*r;const a=Math.floor(p.current);a>0&&(n.scrollTop+=a,p.current-=a),q.current&&!b.current&&!v.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(v.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),v.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),p.current=0,f.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==w.current&&w.current.release().catch(()=>{}).finally(()=>{w.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),x.current&&document.removeEventListener("fullscreenchange",x.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;w.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(w.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),x.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",x.current),y.current=!0),p.current=0,f.current=null,v.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se,onBottomReached:()=>H?._id&&y.refetchQueries({queryKey:[w.CONTENTS_BY_EVENT(H._id)]})});e(()=>{H?.slug&&le(H.slug)},[H?.slug,le]);const me=a(()=>j===I.SINGLE,[j]),ge=a(()=>/* @__PURE__ */s(Ae,{event:H,onAutoscrollClick:ce}),[H,ce]),he=n(null),pe=n({hasNextPage:ae,isFetchingNextPage:se,loading:W,running:ue,fetchNextPage:ie});pe.current={hasNextPage:ae,isFetchingNextPage:se,loading:W,running:ue,fetchNextPage:ie},e(()=>(he.current=new IntersectionObserver(e=>{const t=pe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{he.current?.disconnect(),he.current=null}),[]);const ve=o(e=>{const t=he.current;t&&(t.disconnect(),e&&t.observe(e))},[]),we=$?.bannerPositions??[],Te=T?._id,ye=$&&we.includes("right"),Ne=Boolean(T?.advancedSettings?.aiSettings?.faceRecognitionEnabled),qe=Boolean(T?.integrationSettings?.showQuickSearch)&&Ne;/* @__PURE__ */
33
33
  return s("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
34
34
  /* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:ge}),
35
- /* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(xe,{})}),W&&ve.includes("top")&&/* @__PURE__ */s(Ue,{position:"top",gamConfig:W,eventId:G?._id,organizationId:Te}),
36
- /* @__PURE__ */s(je,{engagementStyle:G?.engagementStyle,disabled:u||D,mode:B,onModeChange:e=>U(e),sort:R,sortOrder:O,onSortChange:e=>V(e),onSortOrderChange:()=>j("asc"===O?"desc":"asc"),handleChange:C,face:L,onFaceImageChange:e=>M(e)}),L&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:L,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(re,{color:"error",icon:/* @__PURE__ */s(X,{className:"size-5"}),onClick:()=>M(void 0),children:"Clear search"})})]}),
37
- /* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[u||D?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}):Q?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:K?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(F,{variant:"body2",color:"muted",align:"center",children:K?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(fe,{className:"size-5"}),onClick:()=>{ee()},children:"Retry"})]})})}):ne?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Be,{})})}):/* @__PURE__ */s(l,{children:[
38
- /* @__PURE__ */s("div",{ref:H,className:d(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}),children:/* @__PURE__ */s(Ge,{event:G,contents:ne,gamConfig:W,singleColumnMode:me,kioskMode:ue,timestampField:R===N.CAPTURE_TIME?"capturedAt":void 0,curateLink:G?.engagementStyle===E.CONTEST&&G.status===k.OPEN&&G.slug?A.CURATE(G.slug):void 0,onChangeFaceUrl:e=>M(e),showQuickSearch:Ne})})}),
39
- /* @__PURE__ */s("div",{ref:we,className:"h-4 w-full","aria-hidden":"true"}),se&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(Z,{className:"size-8"})})]}),W&&ve.includes("bottom")&&/* @__PURE__ */s(Ue,{position:"bottom",gamConfig:W,eventId:G?._id,organizationId:Te})]}),ye&&/* @__PURE__ */s(He,{gamConfig:W,eventId:G?._id,organizationId:Te})]})]})};export{$e as default};
35
+ /* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(xe,{})}),$&&we.includes("top")&&/* @__PURE__ */s(Ue,{position:"top",gamConfig:$,eventId:H?._id,organizationId:Te}),
36
+ /* @__PURE__ */s(je,{engagementStyle:H?.engagementStyle,disabled:u||W,mode:j,onModeChange:e=>B(e),sort:M,sortOrder:V,onSortChange:e=>R(e),onSortOrderChange:()=>O("asc"===V?"desc":"asc"),handleChange:C,face:L,onFaceImageChange:e=>k(e)}),L&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:L,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(re,{color:"error",icon:/* @__PURE__ */s(X,{className:"size-5"}),onClick:()=>k(void 0),children:"Clear search"})})]}),
37
+ /* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[u||W?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}):K?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:Q?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(F,{variant:"body2",color:"muted",align:"center",children:Q?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(fe,{className:"size-5"}),onClick:()=>{ee()},children:"Retry"})]})})}):ne?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Be,{})})}):/* @__PURE__ */s(l,{children:[
38
+ /* @__PURE__ */s("div",{ref:U,className:d(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}),children:/* @__PURE__ */s(Ge,{event:H,contents:ne,gamConfig:$,singleColumnMode:me,kioskMode:ue,timestampField:M===N.CAPTURE_TIME?"capturedAt":void 0,curateLink:(H?.engagementStyle===b.CONTEST||De(D))&&$e(H)&&H?.slug?_.CURATE(H.slug):void 0,onChangeFaceUrl:e=>k(e),showQuickSearch:qe})})}),
39
+ /* @__PURE__ */s("div",{ref:ve,className:"h-4 w-full","aria-hidden":"true"}),se&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(Z,{className:"size-8"})})]}),$&&we.includes("bottom")&&/* @__PURE__ */s(Ue,{position:"bottom",gamConfig:$,eventId:H?._id,organizationId:Te})]}),ye&&/* @__PURE__ */s(He,{gamConfig:$,eventId:H?._id,organizationId:Te})]})]})};export{We as default};
@@ -1 +1 @@
1
- import{t as r}from"./BXMw4kNf.js";import{i as a}from"./xvMv72y9.js";var s=({className:s,rounded:e=!1,...o})=>/* @__PURE__ */r("div",{className:a("bg-border animate-pulse",e?"rounded-full":"rounded",s),...o});export{s as t};
1
+ import{t as r}from"./BXMw4kNf.js";import{i as a}from"./CdivXyOP.js";var s=({className:s,rounded:e=!1,...o})=>/* @__PURE__ */r("div",{className:a("bg-border animate-pulse",e?"rounded-full":"rounded",s),...o});export{s as t};
@@ -1,8 +1,8 @@
1
- import{_ as e,h as t,t as l,w as n}from"./BXMw4kNf.js";import{i as r}from"./xvMv72y9.js";import{t as s}from"./DDcMOfts.js";var a=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m15 18-6-6 6-6"})}),o=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m9 18 6-6-6-6"})});function i({items:s,autoplayInterval:i=3e3,showControls:d=!1,className:c}){const[u,h]=t(0);return e(()=>{if(s.length<=1)return;const e=setInterval(()=>h(e=>(e+1)%s.length),i);return()=>clearInterval(e)},[s.length,i]),0===s.length?null:/* @__PURE__ */l("div",{className:r("relative size-full overflow-hidden",c),children:[s.map((e,t)=>/* @__PURE__ */l("div",{className:r("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),s.length>1&&/* @__PURE__ */l("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:s.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>h(t),className:r("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),d&&s.length>1&&/* @__PURE__ */l(n,{children:[/* @__PURE__ */l("button",{onClick:()=>h(e=>0===e?s.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */l(a,{})}),/* @__PURE__ */l("button",{onClick:()=>h(e=>(e+1)%s.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */l(o,{})})]})]})}var d=({event:e,onExplore:t})=>{const n=(e.contents||[]).map(t=>/* @__PURE__ */l(s,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
2
- return l("div",{className:"w-40 overflow-hidden rounded-lg bg-white shadow-lg",children:[/* @__PURE__ */l("div",{className:"relative h-32 w-full overflow-hidden",children:[/* @__PURE__ */l(i,{items:n,autoplayInterval:3e3}),"OPEN"===r&&/* @__PURE__ */l("span",{className:"absolute top-2 left-2 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-medium text-white",children:[/* @__PURE__ */l("span",{className:"size-1.5 animate-pulse rounded-full bg-white"}),"Open"]})]}),/* @__PURE__ */l("div",{className:"p-2",children:[
1
+ import{_ as e,h as t,t as l,w as n}from"./BXMw4kNf.js";import{i as r}from"./CdivXyOP.js";import{t as s}from"./QxKjlE-j.js";var a=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m15 18-6-6 6-6"})}),o=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m9 18 6-6-6-6"})});function i({items:s,autoplayInterval:i=3e3,showControls:d=!1,className:c}){const[u,h]=t(0);return e(()=>{if(s.length<=1)return;const e=setInterval(()=>h(e=>(e+1)%s.length),i);return()=>clearInterval(e)},[s.length,i]),0===s.length?null:/* @__PURE__ */l("div",{className:r("relative size-full overflow-hidden",c),children:[s.map((e,t)=>/* @__PURE__ */l("div",{className:r("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),s.length>1&&/* @__PURE__ */l("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:s.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>h(t),className:r("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),d&&s.length>1&&/* @__PURE__ */l(n,{children:[/* @__PURE__ */l("button",{onClick:()=>h(e=>0===e?s.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */l(a,{})}),/* @__PURE__ */l("button",{onClick:()=>h(e=>(e+1)%s.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */l(o,{})})]})]})}var d=({event:e,onExplore:t})=>{const n=(e.contents||[]).map(t=>/* @__PURE__ */l(s,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
2
+ return l("div",{className:"w-56 max-w-full overflow-hidden rounded-lg bg-white",children:[/* @__PURE__ */l("div",{className:"relative h-32 w-full overflow-hidden",children:[/* @__PURE__ */l(i,{items:n,autoplayInterval:3e3}),"OPEN"===r&&/* @__PURE__ */l("span",{className:"absolute top-2 left-2 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-medium text-white",children:[/* @__PURE__ */l("span",{className:"size-1.5 animate-pulse rounded-full bg-white"}),"Open"]})]}),/* @__PURE__ */l("div",{className:"p-2",children:[
3
3
  /* @__PURE__ */l("div",{className:"line-clamp-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
4
4
  /* @__PURE__ */l("div",{className:"pb-2 text-xs text-gray-600",children:e.location?.label}),
5
5
  /* @__PURE__ */l("button",{type:"button",onClick:()=>t?.(e.slug||""),className:"bg-primary text-primary-foreground flex w-full items-center justify-center rounded py-1",children:"Explore"})]})]})},c=(e,t)=>e&&(/^#[0-9a-fA-F]{3,8}$/.test(e)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(e))?e:t,u=e=>{if(e)try{const{protocol:t}=new URL(e);return"https:"===t||"http:"===t?e:void 0}catch{return}},h=({node:e,depth:n,activeFolderId:r,onSelect:s})=>{const[a,o]=t(!1),i=e.folder._id===r,d=e.children.length>0,c=e.eventCount>0;/* @__PURE__ */
6
- return l("li",{children:[/* @__PURE__ */l("div",{class:"flex items-center gap-1 py-1.5 pr-2 rounded-lg "+(i?"bg-foreground/20":"hover:bg-foreground/20"),style:{paddingLeft:8+14*n+"px"},children:[/* @__PURE__ */l("button",{type:"button",class:"flex w-4 shrink-0 items-center justify-center text-slate-400 text-xs",onClick:e=>{e.stopPropagation(),d&&o(e=>!e)},children:d?a?"▾":"▸":/* @__PURE__ */l("span",{class:"size-1.5 rounded-full bg-slate-300 inline-block"})}),/* @__PURE__ */l("button",{type:"button",class:"flex flex-1 min-w-0 items-center gap-2 cursor-pointer",onClick:()=>{c?s(i?null:e.folder._id):o(e=>!e)},children:[
6
+ return l("li",{children:[/* @__PURE__ */l("div",{class:"flex items-center gap-1 py-1.5 pr-2 rounded-lg "+(i?"bg-foreground/20":"hover:bg-foreground/20"),style:{paddingLeft:8+14*n+"px"},children:[/* @__PURE__ */l("button",{type:"button","aria-label":d?`${a?"Collapse":"Expand"} ${e.folder.name}`:`${e.folder.name} has no subfolders`,class:"flex w-4 shrink-0 items-center justify-center text-slate-400 text-xs",onClick:e=>{e.stopPropagation(),d&&o(e=>!e)},children:d?a?"▾":"▸":/* @__PURE__ */l("span",{class:"size-1.5 rounded-full bg-slate-300 inline-block"})}),/* @__PURE__ */l("button",{type:"button","aria-label":`Open ${e.folder.name}`,class:"flex flex-1 min-w-0 items-center gap-2 cursor-pointer",onClick:()=>{c?s(i?null:e.folder._id):o(e=>!e)},children:[
7
7
  /* @__PURE__ */l("span",{class:"size-2 shrink-0 rounded-full",style:{background:e.color}}),
8
8
  /* @__PURE__ */l("span",{class:"flex-1 truncate text-left text-sm",children:e.folder.name}),c&&/* @__PURE__ */l("span",{class:"text-xs tabular-nums text-slate-400",children:e.eventCount})]})]}),d&&a&&/* @__PURE__ */l("ul",{children:e.children.map(e=>/* @__PURE__ */l(h,{node:e,depth:n+1,activeFolderId:r,onSelect:s},e.folder._id))})]})},p=(e,t)=>{for(const l of e){if(l.folder._id===t)return l;const e=p(l.children,t);if(e)return e}return null},f=({folderTree:e,activeFolderId:t,setActiveFolderId:n,positionClass:r})=>0===e.length?null:/* @__PURE__ */l("div",{class:`${r??""} w-[min(92%,260px)] overflow-hidden rounded-xl bg-background shadow-lg backdrop-blur-sm`,children:[/* @__PURE__ */l("div",{class:"flex items-center justify-between border-b border-slate-100 px-3 py-2.5",children:[/* @__PURE__ */l("p",{class:"text-xs font-semibold uppercase tracking-wide",children:"Destinations"}),t&&/* @__PURE__ */l("button",{type:"button",onClick:()=>n(null),class:"text-xs text-foreground",children:"Show all"})]}),/* @__PURE__ */l("ul",{class:"max-h-[60vh] overflow-y-auto py-1",children:e.map(e=>/* @__PURE__ */l(h,{node:e,depth:0,activeFolderId:t,onSelect:n},e.folder._id))})]});export{d as a,u as i,p as n,c as r,f as t};
@@ -0,0 +1,2 @@
1
+ import{t}from"./BXMw4kNf.js";import{x as a}from"./Bb9ydqSB.js";import{c as o,u as s}from"./D6q-D1kv.js";import{t as r}from"./Dstt_bTH.js";var e=({to:e})=>{const i=s(),n=o();/* @__PURE__ */
2
+ return t("button",{type:"button","aria-label":"Go back",onClick:()=>{e?i(e,{state:{internalNavigation:!0}}):n?i(-1):i(a.PUBLIC_EVENTS,{state:{internalNavigation:!0}})},className:"text-foreground absolute top-0 left-0",children:/* @__PURE__ */t(r,{className:"size-6"})})};export{e as t};
@@ -1,3 +1,3 @@
1
- import{t as e}from"./BXMw4kNf.js";import{i as r}from"./xvMv72y9.js";import{t}from"./-yT__8Qm.js";var a=e=>e&&e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",s=e=>e.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?void 0:"Enter a valid email":"Please enter your email",o=e=>e?e.length<8?"Min password length is 8":void 0:"Please enter your password",i=e=>{if(!e.trim())return"First name is required"},n=e=>{if(!e.trim())return"Last name is required"},d=(e,r)=>e?e!==r?"Passwords do not match":void 0:"Please confirm your password",l=({label:a,type:s="text",disabled:o,error:i,iconSVG:n,actionIcon:d,onActionClick:l,actionLabel:u,className:c="",step:m,...p})=>/* @__PURE__ */e("div",{className:"relative",children:[a&&/* @__PURE__ */e(t,{variant:"body1",className:"sm:mb-1",children:a}),
1
+ import{t as e}from"./BXMw4kNf.js";import{i as r}from"./CdivXyOP.js";import{t}from"./cBUXG_uS.js";var a=e=>e&&e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",s=e=>e.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?void 0:"Enter a valid email":"Please enter your email",o=e=>e?e.length<8?"Min password length is 8":void 0:"Please enter your password",i=e=>{if(!e.trim())return"First name is required"},n=e=>{if(!e.trim())return"Last name is required"},d=(e,r)=>e?e!==r?"Passwords do not match":void 0:"Please confirm your password",l=({label:a,type:s="text",disabled:o,error:i,iconSVG:n,actionIcon:d,onActionClick:l,actionLabel:u,className:c="",step:m,...p})=>/* @__PURE__ */e("div",{className:"relative",children:[a&&/* @__PURE__ */e(t,{variant:"body1",className:"sm:mb-1",children:a}),
2
2
  /* @__PURE__ */e("div",{className:"relative",children:[n&&/* @__PURE__ */e("div",{className:r("pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",o?"text-muted-foreground":" "),children:n}),
3
3
  /* @__PURE__ */e("input",{type:s,disabled:o,step:"number"===s?m:void 0,"aria-invalid":!!i,className:r("border-border shadow-outer focus:border-primary peer w-full rounded border px-4 py-2 focus:border focus:ring-0 focus:outline-none",o?"text-muted-foreground bg-transparent":"bg-input",i?"border-destructive animate-pulse":"border-border animate-none",n?"pl-9":"",d?"pr-10":"",c),...p,value:p.value??""}),d&&/* @__PURE__ */e("button",{type:"button","aria-label":u,onClick:l,disabled:o,className:"text-muted-foreground hover:text-foreground absolute inset-y-0 right-0 flex items-center pr-3 disabled:cursor-not-allowed",children:d})]}),i&&/* @__PURE__ */e(t,{variant:"caption",color:"error","data-testid":"input-error",children:i})]});export{i as a,s as i,a as n,n as o,d as r,o as s,l as t};
@@ -1 +1 @@
1
- import{_ as t,h as s,r as e,v as i}from"./BXMw4kNf.js";import{A as r,E as n,N as o,S as u,b as a,f as h,k as c}from"./xvMv72y9.js";import{n as p}from"./DKNkaohw.js";var m=class extends o{#t;#s=void 0;#e;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),c(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),s?.mutationKey&&this.options.mutationKey&&u(s.mutationKey)!==u(this.options.mutationKey)?this.reset():"pending"===this.#e?.state.status&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#n(t)}getCurrentResult(){return this.#s}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#r(),this.#n()}mutate(t,s){return this.#i=s,this.#e?.removeObserver(this),this.#e=this.#t.getMutationCache().build(this.#t,this.options),this.#e.addObserver(this),this.#e.execute(t)}#r(){const t=this.#e?.state??p();this.#s={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#n(t){a.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#s.variables,i=this.#s.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,e,i,r)}catch(s){Promise.reject(s)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,e,i,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(t=>{t(this.#s)})})}};function l(o,u){const c=h(u),[p]=s(()=>new m(c,o));t(()=>{p.setOptions(o)},[p,o]);const l=e(i(t=>p.subscribe(a.batchCalls(t)),[p]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),d=i((t,s)=>{p.mutate(t,s).catch(n)},[p]);if(l.error&&r(p.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}export{l as t};
1
+ import{_ as t,h as s,r as e,v as i}from"./BXMw4kNf.js";import{A as r,E as n,N as o,S as u,b as a,f as h,k as c}from"./CdivXyOP.js";import{n as p}from"./DIWjXG_0.js";var m=class extends o{#t;#s=void 0;#e;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),c(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),s?.mutationKey&&this.options.mutationKey&&u(s.mutationKey)!==u(this.options.mutationKey)?this.reset():"pending"===this.#e?.state.status&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#n(t)}getCurrentResult(){return this.#s}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#r(),this.#n()}mutate(t,s){return this.#i=s,this.#e?.removeObserver(this),this.#e=this.#t.getMutationCache().build(this.#t,this.options),this.#e.addObserver(this),this.#e.execute(t)}#r(){const t=this.#e?.state??p();this.#s={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#n(t){a.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#s.variables,i=this.#s.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,e,i,r)}catch(s){Promise.reject(s)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,e,i,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(t=>{t(this.#s)})})}};function l(o,u){const c=h(u),[p]=s(()=>new m(c,o));t(()=>{p.setOptions(o)},[p,o]);const l=e(i(t=>p.subscribe(a.batchCalls(t)),[p]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),d=i((t,s)=>{p.mutate(t,s).catch(n)},[p]);if(l.error&&r(p.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}export{l as t};