@qratilabs/qrati-connect 2.32.2 → 2.33.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 (72) hide show
  1. package/element/B60TJHpn.js +1 -0
  2. package/element/{DiQrTagI2.js → BX09gwBu.js} +1 -1
  3. package/element/{BZSy_Rh42.js → BgmJHB_q.js} +18 -18
  4. package/element/{CDBzc1CZ.js → BhPQW37y.js} +1 -1
  5. package/element/BhUO8wHu.js +16 -0
  6. package/element/BhYfK52W.js +207 -0
  7. package/element/BjDK8Ljd.js +85 -0
  8. package/element/Bjbk1Zhj.js +1 -0
  9. package/element/BlsbPO0-.js +1 -0
  10. package/element/{DFRMtMLz.js → Bpjf4eY9.js} +1 -1
  11. package/element/{DUS9pix12.js → BtLTtkX8.js} +1 -1
  12. package/element/{CaTxtEbg.js → BuT9kfma.js} +1 -1
  13. package/element/Bx-BFs7B.js +4 -0
  14. package/element/{DtBnBN-i.js → BzXQkPAW.js} +1 -1
  15. package/element/{D-U23_J5.js → CGJtMtq6.js} +36 -36
  16. package/element/CVlMw3Vf.js +3 -0
  17. package/element/CYHy0vN3.js +1 -0
  18. package/element/CZJLtvF9.js +4 -0
  19. package/element/CfNXbM5H.js +2 -0
  20. package/element/ChW2P7vL.js +2 -0
  21. package/element/CrZvMeF8.js +8 -0
  22. package/element/{DdQWa3ny.js → Crg6P9Om.js} +1 -1
  23. package/element/{BOsbbHJ0.js → D9jzGMeN.js} +3 -3
  24. package/element/DExU6-v2.js +5 -0
  25. package/element/{CmcA5dp5.js → DMAkdDxr.js} +32 -32
  26. package/element/DMPvw0Jw.js +3 -0
  27. package/element/DjFlbVE4.js +8 -0
  28. package/element/{DO2-BnvU.js → DjKx2bl9.js} +3 -2
  29. package/element/{DRD9__VZ.js → DkrE1H9J.js} +1 -1
  30. package/element/DnrkqfsH.js +14 -0
  31. package/element/ILtcTVir.js +93 -0
  32. package/element/{BOweSM9Y.js → PxjP9VKW.js} +1 -1
  33. package/element/{DjOFnmwA.js → RLxieWpc.js} +1 -1
  34. package/element/{GwDdmgYd.js → SAPFe3AV.js} +1 -1
  35. package/element/ThvpIBOm.js +4 -0
  36. package/element/X8kQCV14.js +5 -0
  37. package/element/{CoARa5_i.js → ZWATOkpE.js} +1 -1
  38. package/element/{CE0UwtGX.js → k9JmIPl-.js} +7 -7
  39. package/element/{iDDlbtVI.js → pRu0r7dI.js} +1 -1
  40. package/element/plowVrDm.js +4 -0
  41. package/element/{XVFdeOm22.js → qTO-oPOF.js} +1 -1
  42. package/element/web.es.js +1 -1
  43. package/element/x3_URwMQ.js +3 -0
  44. package/element/{BeaTNG7m.js → xPFFaUda.js} +1 -1
  45. package/embed/embed.js +1 -1
  46. package/package.json +1 -1
  47. package/element/3CNVs83G2.js +0 -4
  48. package/element/B2ryYFFr.js +0 -4
  49. package/element/BNHdfdME.js +0 -1
  50. package/element/BP08t9Jp2.js +0 -8
  51. package/element/BRwZXuo82.js +0 -3
  52. package/element/BiCaKAmb.js +0 -4
  53. package/element/Bv4TkNQ42.js +0 -85
  54. package/element/BypLxR3J.js +0 -16
  55. package/element/C7zv6hcG.js +0 -1
  56. package/element/CD73UkPZ.js +0 -2
  57. package/element/CGlyix6P.js +0 -93
  58. package/element/Cr5o77zq.js +0 -199
  59. package/element/D3OYeY482.js +0 -8
  60. package/element/DVo8WBwP2.js +0 -4
  61. package/element/DXFmV-Ty2.js +0 -14
  62. package/element/Da6CorI52.js +0 -5
  63. package/element/DdACKOZr.js +0 -1
  64. package/element/DnnkdZ6w2.js +0 -3
  65. package/element/DsU4DxSM.js +0 -3
  66. package/element/OnH8Izqn.js +0 -1
  67. package/element/_d0Pbeg3.js +0 -5
  68. package/element/cjsXyqlO2.js +0 -1
  69. package/element/tvCSWnLG.js +0 -2
  70. /package/element/{BUDCYszs2.js → BUDCYszs.js} +0 -0
  71. /package/element/{CfMNBPpx2.js → CfMNBPpx.js} +0 -0
  72. /package/element/{DnIueBGr2.js → DnIueBGr.js} +0 -0
@@ -1,36 +1,36 @@
1
- import{A as e,An as t,Cn as n,Ct as r,En as o,Ht as i,J as a,Kt as s,Lt as l,M as c,Nt as d,On as u,Ot as h,Sn as p,Tn as m,Vt as g,Zt as f,_t as v,an as w,bn as y,bt as b,ft as x,i as N,j as k,jn as C,k as T,kn as I,kt as q,nn as E,nt as A,on as M,pt as L,qt as S,rn as z,tn as _,vn as P,vt as O,wn as j,wt as R,xn as U,xt as $,yn as F}from"./Cr5o77zq.js";import{t as G}from"./BNHdfdME.js";import{t as B}from"./CE0UwtGX.js";import{n as V,t as D}from"./BOweSM9Y.js";import{a as W,i as H,n as K,o as Q,r as Y,s as Z,t as J}from"./DRD9__VZ.js";import{a as X,n as ee,o as te,r as ne,t as re}from"./DO2-BnvU.js";function oe(e){return["react-photo-album",e].filter(Boolean).join("--")}function ie({width:e,height:t}){const n=e/t;return Number.isFinite(n)?n:1}var ae=Object.freeze([1200,600,300,0]);function se(e,t){return"function"==typeof e?e(t):e}function le(e,t){return void 0!==t?se(e,t):void 0}function ce(e,t,n,r=0){if(void 0===t)return;const o=le(e,t);return Math.round(Math.max(void 0===o?function(e,t){const n=ae.findIndex(e=>e<=t);return se(e[Math.max(n,0)],t)}(n,t):o,r))}function de(e,{spacing:t,padding:n,componentsProps:r,render:o}){return{spacing:ce(t,e,[20,15,10,5]),padding:ce(n,e,[0,0,0,0]),componentsProps:se(r,e)||{},render:se(o,e)}}function ue(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function he(e,t,n,r,o,i,a){let s,l;const c=e=>{const t=i*(o-1)+2*a*o;return`calc((${e.match(/^\s*calc\((.*)\)\s*$/)?.[1]??e} - ${t}px) / ${ue((r-t)/n,5)})`},d=e.srcSet;return d&&d.length>0&&(s=d.concat(d.some(({width:t})=>t===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", ")),l=t?.size?(t.sizes||[]).map(({viewport:e,size:t})=>`${e} ${c(t)}`).concat(c(t.size)).join(", "):`${Math.ceil(n/r*100)}vw`,{srcSet:s,sizes:l}}var pe=w(function({as:e,render:t,context:n,classes:r=[],variables:o={},style:i,className:a,children:s,...l},c){const d=function(...e){return e.filter(Boolean).join(" ")}(...(Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e).map(oe),a),u={style:{...Object.fromEntries(Object.entries(o).map(([e,t])=>{return[(n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${oe(n)}`),"number"==typeof t?ue(t,5):t];var n})),...i},className:d,children:s,...l};if(t){const e=t({ref:c,...u},n);if(e)return e}return E(e||"div",{ref:c,...u})}),me=w(function({photo:e,index:t,width:n,height:r,onClick:o,render:{wrapper:i,link:a,button:s,image:l,extras:c}={},componentsProps:{link:d,button:u,wrapper:h,image:p}={}},m){const{href:g}=e,f={photo:e,index:t,width:ue(n,3),height:ue(r,3)};let v;return v=g?{...d,as:"a",render:a,classes:["photo","link"],href:g,onClick:o}:o?{...u,as:"button",type:"button",render:s,classes:["photo","button"],onClick:o}:{...h,render:i,classes:"photo"},E(pe,{ref:m,variables:{photoWidth:f.width,photoHeight:f.height},context:f,...v,children:[E(pe,{as:"img",classes:"image",render:l,context:f,...p}),c?.({},f)]})}),ge=w(function({layout:e,sizes:t,model:n,skeleton:r,onClick:o,render:{container:i,track:a,photo:s,...l}={},componentsProps:{container:c,track:d,link:u,button:h,wrapper:p,image:m}={}},g){const{spacing:f,padding:v,containerWidth:w,tracks:y,variables:b,horizontal:x}=n||{};return E(pe,{role:"group","aria-label":"Photo album",...c,variables:{spacing:f,padding:v,containerWidth:w,...b},classes:["",e],render:i,ref:g,children:[void 0!==f&&void 0!==v&&void 0!==w&&y?.map(({photos:e,variables:n},r)=>{const i=e.length,c=x?i:y.length;return C(pe,{...d,key:r,render:a,classes:"track",variables:{trackSize:i,...n}},e.map(e=>{const{photo:n,index:r,width:i}=e,{key:a,src:d,alt:g="",title:y,label:b}=n,x=o?e=>{o({event:e,photo:n,index:r})}:void 0;if(s){const t=s({onClick:x},e);if(t)return t}const N=e=>b?{"aria-label":b,...e}:e;return E(me,{onClick:x,render:l,componentsProps:{image:{loading:"lazy",decoding:"async",src:d,alt:g,title:y,...he(n,t,i,w,c,f,v),...se(m,e)},link:N(se(u,e)),button:N(se(h,e)),wrapper:se(p,e)},...e},a??r)}))}),void 0===w&&r]})});function fe(e,t,n,r){return(t-(e.length-1)*n-2*r*e.length)/e.reduce((e,t)=>e+ie(t),0)}function ve(e,t,n,r,o,i,a){const s=e.slice(t,n),l=fe(s,r,o,i);return l>0?(l-a)**2*s.length:void 0}function we(e,t){const[n,r]=e;if(n===t)return e;if(void 0!==r&&void 0!==t&&void 0!==n&&t===r&&Math.abs(t-n)<=20){const o=Math.min(n,t),i=Math.max(n,t);return o===n&&i===r?e:[o,i]}return[t,n]}function ye(e,t,n){const[[r],i]=o(we,[n]),a=function(e){const[t,n]=U(e);return e===t||e&&t&&e.length===t.length&&!e.some((e,n)=>e!==t[n])?t:(n(e),e)}(t),s=P(void 0);return{containerRef:j(t=>{s.current?.disconnect(),s.current=void 0;const n=()=>i(function(e,t){let n=e?.clientWidth;if(void 0!==n&&t&&t.length>0){const e=[...t.filter(e=>e>0)].sort((e,t)=>t-e);e.push(Math.floor(e[e.length-1]/2)),n=e.find((t,r)=>t<=n||r===e.length-1)}return n}(t,a));n(),t&&"undefined"!=typeof ResizeObserver&&(s.current=new ResizeObserver(n),s.current.observe(t)),"function"==typeof e?e(t):e&&(e.current=t)},[e,a]),containerWidth:r}}var be=w(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:u,...h}=function(e,{photos:t,targetRowHeight:n,rowConstraints:r,...o}){const{spacing:i,padding:a,componentsProps:s,render:l}=de(e,o),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=le(r,e)||{};if(void 0!==c&&void 0!==i&&void 0!==a){const e=Math.floor(t.reduce((e,{width:t,height:n})=>e+t/n*c+2*a,i*(t.length-1)));e>0&&(s.container={...s.container},s.container.style={maxWidth:e,...s.container.style})}return{...o,targetRowHeight:ce(n,e,[e=>e/5,e=>e/4,e=>e/3,e=>e/2]),render:l,spacing:i,padding:a,minPhotos:d,maxPhotos:u,componentsProps:s}}(a,{photos:e,...r});return E(ge,{layout:"rows",ref:i,model:F(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?function(e,t,n,r,o,i,a){const s=Math.min(function(e,t,n,r){return ue(t/n/Math.min(...e.map(e=>ie(e))))+(r||0)+2}(e,r,o,i),a||1/0),l=i||1,c=e.length,d=new Array(c+1).fill(1/0),u=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let i=m-l;i>=Math.max(0,m-s);i-=1){if(d[i]===1/0)continue;const a=ve(e,i,m,r,t,n,o);if(void 0===a)break;const s=d[i]+a;(d[m]===1/0||d[m]>s&&(d[m]/s>1.005||-1!==u[m]&&u[m]<i))&&(d[m]=s,u[m]=i)}if(d[c]===1/0)return;const h=[];for(let m=c;0!==m;m=u[m])h.push(m);h.push(0),h.reverse();const p=[];for(let m=1;m<h.length;m+=1){const o=e.slice(h[m-1],h[m]).map((e,t)=>({photo:e,index:h[m-1]+t})),i=fe(o.map(({photo:e})=>e),r,t,n);p.push({photos:o.map(({photo:e,index:t})=>({photo:e,index:t,width:i*ie(e),height:i}))})}return{spacing:t,padding:n,containerWidth:r,tracks:p,horizontal:!0}}(e,s,l,a,c,d,u):void 0,[e,s,l,a,c,d,u]),...h})});function xe(e,t,n,r,o,i,a){const s=[],l=a.reduce((e,t)=>e+t,0);for(let c=0;c<e.length-1;c+=1){const d=t.slice(e[c],e[c+1]).map((t,n)=>({photo:t,index:e[c]+n})),u=a.reduce((e,t,n)=>e+(i[c]-i[n])*t,0),h=(o-(e.length-2)*n-2*(e.length-1)*r-u)*a[c]/l;s.push({photos:d.map(({photo:e,index:t})=>({photo:e,index:t,width:h,height:h/ie(e)})),variables:{adjustedGaps:u,columnRatio:a[c]}})}return{tracks:s,variables:{totalRatio:l}}}function Ne(e,t,n,r,o,i){const a=[],s=[];if(e.length<=i){const o=e.length>0?e.reduce((e,t)=>e+ie(t),0)/e.length:1;for(let t=0;t<i;t+=1)a[t]=2*n,s[t]=t<e.length?ie(e[t]):o;return xe(Array.from({length:i+1},(t,n)=>Math.min(n,e.length)),e,t,n,r,a,s)}const l=(c=function(e,t,n,r,o){return i=>{const a=[],s=1.5*o;let l=r/ie(e[i])+2*n;for(let c=i+1;c<e.length+1&&(a.push([c,(o-l)**2]),!(l>s||c===e.length));c+=1)l+=r/ie(e[c])+t+2*n;return a}}(e,t,n,o,(e.reduce((e,t)=>e+o/ie(t),0)+t*(e.length-i)+2*n*e.length)/i),d=i,u=0,h=e.length,function(e,t,n){const r=[n];for(let o=n,i=t;i>0;i-=1)[o]=e.get(o)[i],r.push(o);return r.reverse()}(function(e,t,n,r){const o=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;i.add(n);for(let a=0;a<t;a+=1){const n=[...i.keys()];i.clear(),n.forEach(n=>{const s=a>0?o.get(n)[a][1]:0;e(n).forEach(([e,l])=>{let c=o.get(e);c||(c=[],o.set(e,c));const d=s+l,u=c[a+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[a+1]=[n,d]),a<t-1&&e!==r&&i.add(e)})})}return o}(c,d,u,h),d,h));var c,d,u,h;for(let p=0;p<l.length-1;p+=1){const r=e.slice(l[p],l[p+1]);a[p]=t*(r.length-1)+2*n*r.length,s[p]=1/r.reduce((e,t)=>e+1/ie(t),0)}return xe(l,e,t,n,r,a,s)}function ke(e,t,n,r,o){const{tracks:i,variables:a}=Ne(e,t,n,r,(r-t*(o-1)-2*n*o)/o,o);return i.some(e=>e.photos.some(({width:e,height:t})=>e<=0||t<=0))?o>1?ke(e,t,n,r,o-1):void 0:{tracks:i,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...a}}}var Ce=w(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return E(ge,{layout:"columns",ref:i,model:F(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?ke(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})});function Te(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?Te(e,t,n,r,o-1):void 0;const a=[];for(let l=0;l<o;l+=1)a[l]=0;const s=e.reduce((e,r,o)=>{const s=a.reduce((e,t,n)=>t<a[e]-1?n:e,0);return a[s]=a[s]+i/ie(r)+t+2*n,e[s].push({photo:r,index:o}),e},Array.from({length:o},()=>[]));return{spacing:t,padding:n,containerWidth:r,variables:{columns:o},tracks:s.map(e=>({photos:e.map(({photo:e,index:t})=>({photo:e,index:t,width:i,height:i/ie(e)}))}))}}var Ie=w(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return E(ge,{layout:"masonry",ref:i,model:F(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?Te(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})}),qe={[String(h.NONE)]:function({className:e}){/* @__PURE__ */
2
- return E("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__ */E("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[h.LINK]:function({className:e}){/* @__PURE__ */
3
- return E("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__ */E("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[h.EMAIL]:function({className:e}){/* @__PURE__ */
4
- return E("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__ */E("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[h.PHONE]:function({className:e}){/* @__PURE__ */
5
- return E("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__ */E("path",{fill:"currentColor",d:"M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"})})},[h.SMS]:function({className:e}){/* @__PURE__ */
6
- return E("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__ */E("path",{fill:"currentColor",d:"m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4.713-5.288Q9 10.425 9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11t.713-.288m4 0Q13 10.426 13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11t.713-.288m4 0Q17 10.426 17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11t.713-.288"})})},[h.WHATSAPP]:function({className:e}){/* @__PURE__ */
7
- return E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 258",className:e,"aria-hidden":"true",focusable:"false",children:[
8
- /* @__PURE__ */E("defs",{children:[/* @__PURE__ */E("linearGradient",{id:"SVGK3KZq49U",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */E("stop",{offset:"0%","stop-color":"#1faf38"}),/* @__PURE__ */E("stop",{offset:"100%","stop-color":"#60d669"})]}),/* @__PURE__ */E("linearGradient",{id:"SVGefMkoEOd",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */E("stop",{offset:"0%","stop-color":"#f9f9f9"}),/* @__PURE__ */E("stop",{offset:"100%","stop-color":"#fff"})]})]}),
9
- /* @__PURE__ */E("path",{fill:"url(#SVGK3KZq49U)",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"}),
10
- /* @__PURE__ */E("path",{fill:"url(#SVGefMkoEOd)",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"}),
11
- /* @__PURE__ */E("path",{fill:"#fff",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"})]})},[h.MESSENGER]:function({className:e}){/* @__PURE__ */
12
- return E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:e,"aria-hidden":"true",focusable:"false",children:[
13
- /* @__PURE__ */E("defs",{children:/* @__PURE__ */E("radialGradient",{id:"SVGhphmYc3G",cx:"19.247%",cy:"99.465%",r:"108.96%",fx:"19.247%",fy:"99.465%",children:[
14
- /* @__PURE__ */E("stop",{offset:"0%","stop-color":"#09f"}),
15
- /* @__PURE__ */E("stop",{offset:"60.975%","stop-color":"#a033ff"}),
16
- /* @__PURE__ */E("stop",{offset:"93.482%","stop-color":"#ff5280"}),
17
- /* @__PURE__ */E("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
18
- /* @__PURE__ */E("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
19
- /* @__PURE__ */E("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Ee=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==h.NONE),i=qe[t?.targetType]??qe[h.LINK],a=t?.imageUrl&&c(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
20
- return E(re,{open:Boolean(e&&t),onOpenChange:e=>!e&&n?.(),children:/* @__PURE__ */E(ee,{className:"border-none p-0",children:[/* @__PURE__ */E(X,{className:"sr-only",children:[/* @__PURE__ */E(te,{children:t?.title}),/* @__PURE__ */E(ne,{children:t?.description})]}),/* @__PURE__ */E("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[a&&/* @__PURE__ */E("img",{className:"h-auto w-full object-contain sm:max-h-96",src:a,alt:t?.title||"Advertisement"}),
21
- /* @__PURE__ */E("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */E(A,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */E(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */E(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??h.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */E(i,{className:"size-5"}),children:t?.targetText})]})]})})};function Ae(e,t){if(e.content?._id!==t.content?._id)return!1;if(e.style?.width!==t.style?.width||e.style?.height!==t.style?.height)return!1;for(const n of Object.keys(e))if("content"!==n&&"style"!==n&&e[n]!==t[n])return!1;return!0}var Me=M(({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:s,captureAdClick:l}=K(),c=Boolean(n&&r),u=t.ctaBg||"#ff4800",p=t.ctaForeground||"#FFFFFF",m=qe[t?.targetType??h.LINK];/* @__PURE__ */
22
- return E("div",{style:e,className:"group relative mb-1 overflow-hidden rounded",children:[
23
- /* @__PURE__ */E(a,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>s(t._id),children:/* @__PURE__ */E(k,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:c?()=>r?.(t):void 0,pswpData:{id:t._id,type:d.AD,hash:t._id,width:t.width,height:t.height,title:t.title,description:t.description,targetType:t.targetType,targetText:t.targetText,targetUrl:t.targetUrl,thumbnailUrl:t.imageUrl,blurhash:t.blurhash}})}),
24
- /* @__PURE__ */E("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!o&&(t.title||t.targetType!==h.NONE)&&/* @__PURE__ */E("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[t.title&&/* @__PURE__ */E("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */E("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==h.NONE&&/* @__PURE__ */E("button",{type:"button",className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:u,color:p},onClick:()=>{c?r?.(t):l(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */E("span",{style:{color:p},children:/* @__PURE__ */E(m,{})}),t?.targetText]})]})]})},Ae),Le=M(({style:e,gamConfig:t,slotIndex:r,eventId:o,organizationId:s})=>{const l=P(null),c=P(null),{trackGamAnalytics:d}=K(),[u,h]=U(!1),p=`gam-slot-${o??"ev"}-${r}`,m=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),g=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),f=P({w:m,h:g});return n(()=>{if(!u)return;let e=!1,n=null,r=null,a=null,h=null;return(async()=>{await W(),!e&&l.current&&window.googletag.cmd.push(()=>{if(e)return;Y(p);const{w:u,h:m}=f.current,g=[[u,m],...t.sizes],v=window.googletag.defineSlot(t.adUnitPath,g,p)?.addService(window.googletag.pubads());if(!v)return;c.current=v,r=window.googletag.pubads(),o?v.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&v.setConfig({targeting:{qrati_category:t.categories}}),a=e=>{e.slot===v&&d({eventId:o,organizationId:s,type:i.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",a),h=e=>{e.slot===v&&d({eventId:o,organizationId:s,type:i.GAM_VIEWABLE})},r.addEventListener("impressionViewable",h);const w=l.current;w&&(n=J({container:w,onClick:()=>{d({eventId:o,organizationId:s,type:i.GAM_CLICK})}}),H(),window.googletag.display(p))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(a&&r.removeEventListener("slotRenderEnded",a),h&&r.removeEventListener("impressionViewable",h));const t=c.current;c.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[u,o,t.adUnitPath,t.categories,s,p]),/* @__PURE__ */E("div",{style:{width:m,height:g},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":r,children:/* @__PURE__ */E(a,{className:"size-full",threshold:.1,rootMargin:"200px",triggerOnce:!0,onChange:h,children:/* @__PURE__ */E("div",{id:p,ref:l,style:{width:m,height:g},className:"gam-ad-slot"})})})},Ae),Se=(e,t)=>{if(!e||!t)return null;const n=t[e];if(!n)return null;try{const e=new Date(String(n)),t=/* @__PURE__ */new Date,r=e.getFullYear()===t.getFullYear(),o={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return r||(o.year="numeric"),e.toLocaleString("en-US",o).replace(","," •")}catch{return null}},ze=t(null),_e=()=>{const e=m(ze);if(!e)throw new Error("Popover components must be used within a Popover");return e},Pe=({children:e,className:t,open:n,onOpenChange:o})=>{const[i,a]=U(!1),s="boolean"==typeof n,l=s?n:i,c=p(),d=`popover-trigger-${c}`,u=`popover-content-${c}`,h=P(null);/* @__PURE__ */
25
- return E(ze.Provider,{value:{isOpen:l,setIsOpen:e=>{s||a(e),o?.(e)},triggerId:d,contentId:u,triggerRef:h},children:/* @__PURE__ */E("div",{"data-slot":"popover",className:r("relative inline-block",t),children:e})})},Oe=({children:e,asChild:t,className:n,onClick:r,...o})=>{const{isOpen:i,setIsOpen:a,triggerId:s,contentId:l,triggerRef:c}=_e();if(t){const t=Array.isArray(e)?e[0]:e;if(t&&t.type){const e=t.props?.className;return I(t,{ref:e=>{c.current=e},id:s,className:n?e?`${e} ${n}`:n:e,"aria-haspopup":"dialog","aria-expanded":i,"aria-controls":i?l:void 0,onClick:e=>{a(!i),t.props?.onClick?.(e)},"data-state":i?"open":"closed"})}}/* @__PURE__ */
26
- return E("button",{ref:c,id:s,type:"button","aria-haspopup":"dialog","aria-expanded":i,"aria-controls":i?l:void 0,"data-slot":"popover-trigger","data-state":i?"open":"closed",className:n,onClick:e=>{a(!i),r?.(e)},...o,children:e})},je=({children:e,className:t,align:o="center",side:i="top",sideOffset:a=4,...s})=>{const{isOpen:l,setIsOpen:c,contentId:d,triggerRef:u}=_e(),{organization:h,portalContainer:p}=$(),m=P(null),[g,f]=U(null);if(y(()=>{if(!l)return;const e=()=>{if(!u.current||!m.current)return;const e=u.current.getBoundingClientRect(),t=m.current.getBoundingClientRect();let n=e.left,r=e.bottom+a;"center"===o&&(n=e.left+e.width/2-t.width/2),"end"===o&&(n=e.right-t.width),"top"===i&&(r=e.top-t.height-a),"left"===i&&(n=e.left-t.width-a,r=e.top+e.height/2-t.height/2),"right"===i&&(n=e.right+a,r=e.top+e.height/2-t.height/2),"bottom"===i&&(r=e.bottom+a),f({top:r,left:n})},t=requestAnimationFrame(e);return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[o,l,i,a,u]),n(()=>{if(!l)return;const e=e=>{const t="function"==typeof e.composedPath?e.composedPath():[],n=e.target,r=m.current&&(m.current.contains(n)||t.includes(m.current)),o=u.current&&(u.current.contains(n)||t.includes(u.current));r||o||c(!1)},t=e=>{"Escape"===e.key&&(c(!1),u.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",e)},0);return document.addEventListener("keydown",t),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[l,c,u]),!l)return null;const v=/* @__PURE__ */E("div",{ref:m,id:d,role:"dialog","aria-modal":"false","data-state":"open",className:r("bg-background text-foreground border-border shadow-outer rounded outline-none",t),style:{position:"fixed",top:g?.top??0,left:g?.left??0,zIndex:2010,...R(h)},...s,children:e});return"undefined"!=typeof document?z(v,p??document.body):v},Re=({eventId:e,contentId:t,emojis:o=[],counts:i={},userReaction:a})=>{const{user:l,props:c,organization:d}=$(),u=c?.loginUrl,{handleReactionClick:h,isPending:p}=(()=>{const e=_(),{props:t,user:n}=$(),r=t?.organizationId,o=G({mutationFn:async({eventId:e,contentId:t,emoji:o})=>f.post(q.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}}).json(),onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[S.CONTENTS_BY_EVENT(t)];await e.cancelQueries({queryKey:o});const i=e.getQueriesData({queryKey:o});return e.setQueriesData({queryKey:o},e=>((e,t,n)=>{if(!e?.pages||!Array.isArray(e.pages))return e;let r=!1;const o=e.pages.map(e=>{if(!e.data)return e;let o=!1;const i=e.data.map(e=>{if(e._id!==t||e.userReaction===n)return e;r=!0,o=!0;const i={...e.reactionCounts??{}};return e.userReaction&&(i[e.userReaction]=Math.max(0,(i[e.userReaction]??1)-1)),i[n]=(i[n]??0)+1,{...e,reactionCounts:i,userReaction:n}});return o?{...e,data:i}:e});return r?{...e,pages:o}:e})(e,n,r)),{previousData:i}},onError:(t,n,r)=>{r?.previousData?.forEach(([t,n])=>{e.setQueryData(t,n)}),N.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return N.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:e,contentId:t,emoji:r}),!0}catch(i){return!1}},isPending:o.isPending}})(),[m,g]=U(!1),[v,w]=U(null),y=P(null),b=o.reduce((e,t)=>e+(i[t]||0),0);return n(()=>()=>{y.current&&clearTimeout(y.current)},[]),/* @__PURE__ */E(Pe,{open:m,onOpenChange:g,children:[/* @__PURE__ */E(Oe,{asChild:!0,children:/* @__PURE__ */E("button",{type:"button",className:r("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(o||[]).slice().sort((e,t)=>(i[t]||0)-(i[e]||0)).slice(0,1).map(e=>/* @__PURE__ */E("span",{className:r("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),b>0&&/* @__PURE__ */E("span",{className:"text-xs font-bold sm:text-sm",children:b||0})]})}),/* @__PURE__ */E(je,{side:"top",align:"end",children:[l?null:/* @__PURE__ */E("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
27
- /* @__PURE__ */E("a",{className:"text-info underline",href:u,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
28
- /* @__PURE__ */E(x,{className:"text-info underline",to:s.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */E("div",{className:"flex gap-1 p-2",children:o.map(n=>{const o=a===n;/* @__PURE__ */
29
- return E("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */E("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */E("button",{type:"button",disabled:p,className:r("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",o?"scale-125":"hover:scale-110",v===n&&"scale-125",p&&"cursor-not-allowed"),onClick:()=>(async n=>{!p&&h&&(w(n),g(!1),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>w(null),180),h(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},Ue=({event:e={},content:t,curateLink:n})=>{if(e.engagementStyle===l.CONTEST||n){const e=/* @__PURE__ */E("span",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */E(Z,{className:"size-4"}),/* @__PURE__ */E("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]});return n?/* @__PURE__ */E(L,{to:n,children:e}):e}return e.engagementStyle===l.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */E(Re,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,counts:t.reactionCounts||{},userReaction:t.userReaction}):null},$e=({content:e})=>/* @__PURE__ */E("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */E("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */E("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */E("div",{className:"flex items-center justify-between",children:/* @__PURE__ */E("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),Fe=M(({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,imageSearchProviders:l=V,organizationId:c})=>{const h=`content-${t._id}`,p=F(()=>Se(r,t),[r,t]),m=j(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),g=F(()=>({id:t._id,type:d.IMAGE,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}),[t._id,t.width,t.height,t.thumbnailUrl,t.blurhash,t.caption]);/* @__PURE__ */
30
- return E("div",{id:h,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */E(k,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:g}),!a&&/* @__PURE__ */E(u,{children:[p&&/* @__PURE__ */E("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:p}),
31
- /* @__PURE__ */E("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */E("button",{type:"button","aria-label":"Search by face",className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-[opacity,transform] sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:m,children:/* @__PURE__ */E(Q,{className:"text-primary-foreground"})}),t.url&&/* @__PURE__ */E(D,{providers:l,imageUrl:t.url,surface:"gallery",organizationId:c,eventId:e?._id,contentId:t._id})]}),
32
- /* @__PURE__ */E("div",{className:"",children:[/* @__PURE__ */E("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */E($e,{content:t})}),/* @__PURE__ */E("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */E(Ue,{event:e,content:t,curateLink:o})})]})]})]})},Ae),Ge=M(({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=F(()=>Se(r,e),[r,e]);/* @__PURE__ */
33
- return E("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */E(k,{url:e.src??e.url,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,alt:e.caption,curateLink:o,pswpData:{id:e._id,type:d.VIDEO,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}}),!i&&/* @__PURE__ */E("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */E("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
34
- /* @__PURE__ */E("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */E($e,{content:e})}),
35
- /* @__PURE__ */E("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */E(Ue,{event:n,content:e,curateLink:o})})]})]})},Ae),Be=({event:t,contents:o=[],gamConfig:i,singleColumnMode:a,kioskMode:s,timestampField:l,curateLink:c,onChangeFaceUrl:h,showQuickSearch:p,onLoadMore:m})=>{const f=P(null),w=P(null),y=P(!1),x=P(m);x.current=m;const N=P(null),k=F(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:C,captureAdClick:I}=K(),q=O(),A=v(),M=b(),{portalContainer:L,organization:S}=$(),z=S?._id,_=S?.advancedSettings?.imageSearchProviders?.gallery??V,R=S?.advancedSettings?.imageSearchProviders?.lightbox??V,[G,B]=U(null);n(()=>()=>{w.current?.destroy(),w.current=null,f.current?.destroy?.(),f.current=null},[t?.galleryLayout,c,k,L]);const D=j(async e=>{if(c||f.current||y.current)return;const n=N.current,r=e.target.closest("a");if(!n||!r||!n.contains(r))return;e.preventDefault(),y.current=!0;const o=Array.from(n.querySelectorAll("a")).indexOf(r);try{const[{default:e},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c},{loadPhotoSwipe:d},u]=await Promise.all([import("./Cr5o77zq.js").then(e=>e.u),import("./Bo39kG4k.js"),import("./lFDEfCSm.js"),import("./CoARa5_i.js"),import("./CaTxtEbg.js"),import("./CtxIOzTC.js"),import("./1dmOpMwn.js"),import("./Cr5o77zq.js").then(e=>e.l),R.length>0?import("./CDBzc1CZ.js"):Promise.resolve(null)]),h=new e({gallery:n,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:d,appendToEl:L??document.body}),p=h;f.current=p;const m=new T(()=>window.pswp,"memory"===M?{location:A.pathname,state:A.state,push:(e,t)=>q(e,{state:t}),replace:(e,t)=>q(e,{state:t,replace:!0}),go:e=>q(e)}:void 0);w.current=m,h.on("beforeOpen",()=>m.open()),h.on("close",()=>m.close()),new r(h),new i(h),u&&new u.default(h,R,{organizationId:z,eventId:t?._id}),new a(h),new s(h,C,I),new l(h),new c(h),h.init();const g=()=>{const e=f.current?.pswp;e&&e.currIndex>=e.getNumItems()-5&&x.current?.()};h.on("change",g),h.on("afterInit",g),o>=0&&p.loadAndOpen?.(o)}finally{y.current=!1}},[c,L,C,I,R,z,t?._id,A.pathname,A.state,q,M]);n(()=>{const t=w.current;"memory"===M&&t?.isActive()&&!e(A.state)&&t.handleBack()},[A.state,M]),n(()=>{const e=f.current,t=N.current,n=e?.options?.dataSource;e?.pswp&&n&&t&&(n.items=Array.from(t.querySelectorAll("a")),e.pswp.refreshSlideContent(e.pswp.currIndex+1))},[o]);const W=F(()=>{switch(t?.galleryLayout){case g.ROW:return be;case g.COLUMN:return Ce;case g.MASONRY:return Ie;default:return be}},[t?.galleryLayout]),H=F(()=>o.map(e=>{const t=e.type===d.IMAGE||e.type===d.VIDEO?e.url:e.type===d.GAM_AD?"":e.imageUrl;return{...e,src:t??"",width:e.dimension?.width||e.width||4,height:e.dimension?.height||e.height||3}}),[o]),Q=F(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */E("div",{ref:e,className:t??"",children:n}),photo:(e,{photo:n,width:r,height:o,index:a})=>{const u=n;let m=null;switch(u.type){case d.IMAGE:m=Fe;break;case d.VIDEO:m=Ge;break;case d.AD:m=Me;break;case d.GAM_AD:return i?/* @__PURE__ */E(Le,{style:{width:r,height:o},gamConfig:i,slotIndex:u.slotIndex??a,eventId:t?._id,organizationId:z},`${u._id??a}-${a}`):null;default:m=null}return m?/* @__PURE__ */E(m,{style:{width:r,height:o},event:t,content:u,timestampField:l,onAdClick:c?B:void 0,hideControls:s,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:h,showQuickSearch:p,imageSearchProviders:_,organizationId:z},`${u._id??a}-${a}`):null}}),[t,i,z,l,c,s,h,p,_]);/* @__PURE__ */
36
- return E(u,{children:[/* @__PURE__ */E("div",{id:k,ref:N,onClickCapture:D,className:r(a?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */E(W,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return a?(t.minPhotos=1,t.maxPhotos=1):t.maxPhotos=e<400?2:e<800?3:4,t},columns:e=>a?1:e<400?2:e<800?3:4,photos:H,render:Q})}),/* @__PURE__ */E(Ee,{open:Boolean(G),ad:G,onClose:()=>B(null),captureAdClick:I})]})};export{Be as default};
1
+ import{A as e,An as t,Cn as n,Ct as r,En as o,Ht as i,J as a,Kt as s,Lt as l,M as c,Nt as d,On as u,Ot as h,Sn as p,Tn as m,Vt as g,Zt as f,_t as v,bn as w,bt as y,dn as b,ft as x,i as N,j as k,jn as C,k as T,kn as I,kt as A,ln as q,mn as E,nt as M,pn as L,pt as S,qt as z,un as _,vn as P,vt as O,wn as j,wt as R,xn as U,xt as $,yn as F}from"./BhYfK52W.js";import{t as G}from"./Bjbk1Zhj.js";import{t as B}from"./k9JmIPl-.js";import{n as V,t as D}from"./PxjP9VKW.js";import{a as W,i as H,n as K,o as Q,r as Y,s as Z,t as J}from"./DkrE1H9J.js";import{a as X,n as ee,o as te,r as ne,t as re}from"./DjKx2bl9.js";function oe(e){return["react-photo-album",e].filter(Boolean).join("--")}function ie({width:e,height:t}){const n=e/t;return Number.isFinite(n)?n:1}var ae=Object.freeze([1200,600,300,0]);function se(e,t){return"function"==typeof e?e(t):e}function le(e,t){return void 0!==t?se(e,t):void 0}function ce(e,t,n,r=0){if(void 0===t)return;const o=le(e,t);return Math.round(Math.max(void 0===o?function(e,t){const n=ae.findIndex(e=>e<=t);return se(e[Math.max(n,0)],t)}(n,t):o,r))}function de(e,{spacing:t,padding:n,componentsProps:r,render:o}){return{spacing:ce(t,e,[20,15,10,5]),padding:ce(n,e,[0,0,0,0]),componentsProps:se(r,e)||{},render:se(o,e)}}function ue(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function he(e,t,n,r,o,i,a){let s,l;const c=e=>{const t=i*(o-1)+2*a*o;return`calc((${e.match(/^\s*calc\((.*)\)\s*$/)?.[1]??e} - ${t}px) / ${ue((r-t)/n,5)})`},d=e.srcSet;return d&&d.length>0&&(s=d.concat(d.some(({width:t})=>t===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", ")),l=t?.size?(t.sizes||[]).map(({viewport:e,size:t})=>`${e} ${c(t)}`).concat(c(t.size)).join(", "):`${Math.ceil(ue(n/r*100,3))}vw`,{srcSet:s,sizes:l}}function pe(e,t,n,r,o,i,a){const s=[],l=a.reduce((e,t)=>e+t,0);for(let c=0;c<e.length-1;c+=1){const d=t.slice(e[c],e[c+1]).map((t,n)=>({photo:t,index:e[c]+n})),u=a.reduce((e,t,n)=>e+(i[c]-i[n])*t,0),h=(o-(e.length-2)*n-2*(e.length-1)*r-u)*a[c]/l;s.push({photos:d.map(({photo:e,index:t})=>({photo:e,index:t,width:h,height:h/ie(e)})),variables:{adjustedGaps:u,columnRatio:a[c]}})}return{tracks:s,variables:{totalRatio:l}}}function me(e,t,n,r,o,i){const a=[],s=[];if(e.length<=i){const o=e.length>0?e.reduce((e,t)=>e+ie(t),0)/e.length:1;for(let t=0;t<i;t+=1)a[t]=2*n,s[t]=t<e.length?ie(e[t]):o;return pe(Array.from({length:i+1},(t,n)=>Math.min(n,e.length)),e,t,n,r,a,s)}const l=(c=function(e,t,n,r,o){return i=>{const a=[],s=1.5*o;let l=r/ie(e[i])+2*n;for(let c=i+1;c<e.length+1&&(a.push([c,(o-l)**2]),!(l>s||c===e.length));c+=1)l+=r/ie(e[c])+t+2*n;return a}}(e,t,n,o,(e.reduce((e,t)=>e+o/ie(t),0)+t*(e.length-i)+2*n*e.length)/i),d=i,u=e.length,function(e,t,n){if(!e[n][t])return;const r=[n];for(let o=n,i=t;i>0;i-=1)[o]=e[o][i],r.push(o);return r.reverse()}(function(e,t,n){const r=Array.from({length:n+1},()=>[]);let o=new Array(n+1).fill(!1);o[0]=!0;for(let i=0;i<t;i+=1){const a=o;o=new Array(n+1).fill(!1);for(let s=0;s<=n;s+=1){if(!a[s])continue;const l=i>0?r[s][i][1]:0;e(s).forEach(([e,a])=>{const c=l+a,d=r[e][i+1];(!d||d[1]>c&&d[1]/c>1.0001)&&(r[e][i+1]=[s,c]),i<t-1&&e!==n&&(o[e]=!0)})}}return r}(c,d,u),d,u));var c,d,u;if(l){for(let r=0;r<l.length-1;r+=1){const o=e.slice(l[r],l[r+1]);a[r]=t*(o.length-1)+2*n*o.length,s[r]=1/o.reduce((e,t)=>e+1/ie(t),0)}return pe(l,e,t,n,r,a,s)}}function ge(e,t,n,r,o){const i=me(e,t,n,r,(r-t*(o-1)-2*n*o)/o,o);if(!i||i.tracks.some(e=>e.photos.some(({width:e,height:t})=>e<=0||t<=0)))return o>1?ge(e,t,n,r,o-1):void 0;const{tracks:a,variables:s}=i;return{tracks:a,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...s}}}var fe=L(function({as:e,render:t,context:n,classes:r=[],variables:o={},style:i,className:a,children:s,...l},c){const d=function(...e){return e.filter(Boolean).join(" ")}(...(Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e).map(oe),a),u={style:{...Object.fromEntries(Object.entries(o).map(([e,t])=>{return[(n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${oe(n)}`),"number"==typeof t?ue(t,5):t];var n})),...i},className:d,children:s,...l};if(t){const e=t({ref:c,...u},n);if(e)return e}return _(e||"div",{ref:c,...u})}),ve=L(function({photo:e,index:t,width:n,height:r,onClick:o,render:{wrapper:i,link:a,button:s,image:l,extras:c}={},componentsProps:{link:d,button:u,wrapper:h,image:p}={}},m){const{href:g}=e,f={photo:e,index:t,width:ue(n,3),height:ue(r,3)};let v;return v=g?{...d,as:"a",render:a,classes:["photo","link"],href:g,onClick:o}:o?{...u,as:"button",type:"button",render:s,classes:["photo","button"],onClick:o}:{...h,render:i,classes:"photo"},_(fe,{ref:m,variables:{photoWidth:f.width,photoHeight:f.height},context:f,...v,children:[_(fe,{as:"img",classes:"image",render:l,context:f,...p}),c?.({},f)]})}),we=L(function({layout:e,sizes:t,model:n,skeleton:r,onClick:o,render:{container:i,track:a,photo:s,...l}={},componentsProps:{container:c,track:d,link:h,button:p,wrapper:m,image:g}={}},f){const{spacing:v,padding:w,containerWidth:y,tracks:b,variables:x,horizontal:N}=n||{};return _(fe,{role:"group","aria-label":"Photo album",...c,variables:{spacing:v,padding:w,containerWidth:y,...x},classes:["",e],render:i,ref:f,children:[void 0!==v&&void 0!==w&&void 0!==y&&b?.map(({photos:e,variables:n},r)=>{const i=e.length,c=N?i:b.length;return C(fe,{...d,key:r,render:a,classes:"track",variables:{trackSize:i,...n}},e.map(e=>{const{photo:n,index:r,width:i}=e,{key:a,src:d,alt:f="",title:b,label:x}=n,N=o?e=>{o({event:e,photo:n,index:r})}:void 0;if(s){const t=s({onClick:N},e);if(t)return _(u,{children:t},a??r)}const k=e=>x?{"aria-label":x,...e}:e;return _(ve,{onClick:N,render:l,componentsProps:{image:{loading:"lazy",decoding:"async",src:d,alt:f,title:b,...he(n,t,i,y,c,v,w),...se(g,e)},link:k(se(h,e)),button:k(se(p,e)),wrapper:se(m,e)},...e},a??r)}))}),void 0===y&&r]})}),ye="undefined"!=typeof window?w:n;function be(e,t){const[n,r]=e;if(n===t)return e;if(void 0!==r&&void 0!==t&&void 0!==n&&t===r&&Math.abs(t-n)<=20){const o=Math.min(n,t),i=Math.max(n,t);return o===n&&i===r?e:[o,i]}return[t,n]}function xe(e,t,n){const[[r],i]=o(be,[n]),a=function(e){const[t,n]=U(e);return e===t||e&&t&&e.length===t.length&&!e.some((e,n)=>e!==t[n])?t:(n(e),e)}(t),s=P(void 0),l=function(e){const t=P(e);return ye(()=>{t.current=e}),j((...e)=>t.current?.(...e),[])}(t=>{"function"==typeof e?e(t):e&&(e.current=t)});return{containerRef:j(e=>{s.current?.disconnect(),s.current=void 0;const t=()=>i(function(e,t){let n=e?.clientWidth;if(void 0!==n&&t){const e=t.filter(e=>e>0).sort((e,t)=>t-e);e.length>0&&(e.push(Math.floor(e[e.length-1]/2)),n=e.find((t,r)=>t<=n||r===e.length-1))}return n}(e,a));t(),e&&"undefined"!=typeof ResizeObserver&&(s.current=new ResizeObserver(t),s.current.observe(e)),l(e)},[l,a]),containerWidth:r}}var Ne=L(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=xe(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r}),u=F(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?ge(e,s,l,a,c):void 0,[e,s,l,a,c]);return _(we,{layout:"columns",ref:i,model:u,...d})});function ke(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?ke(e,t,n,r,o-1):void 0;const a=[];for(let l=0;l<o;l+=1)a[l]=0;const s=e.reduce((e,r,o)=>{const s=a.reduce((e,t,n)=>t<a[e]-1?n:e,0);return a[s]=a[s]+i/ie(r)+t+2*n,e[s].push({photo:r,index:o}),e},Array.from({length:o},()=>[]));return{spacing:t,padding:n,containerWidth:r,variables:{columns:o},tracks:s.map(e=>({photos:e.map(({photo:e,index:t})=>({photo:e,index:t,width:i,height:i/ie(e)}))}))}}var Ce=L(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=xe(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r}),u=F(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?ke(e,s,l,a,c):void 0,[e,s,l,a,c]);return _(we,{layout:"masonry",ref:i,model:u,...d})});function Te(e,t,n,r){return(t-(e.length-1)*n-2*r*e.length)/e.reduce((e,t)=>e+ie(t),0)}function Ie(e,t,n,r,o,i,a){const s=function(e,t,n,r,o,i){const a=n-t;return(r-(a-1)*o-2*i*a)/(e[n]-e[t])}(e,t,n,r,o,i);return s>0?(s-a)**2*(n-t):void 0}var Ae=L(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=xe(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:u,...h}=function(e,{photos:t,targetRowHeight:n,rowConstraints:r,...o}){const{spacing:i,padding:a,componentsProps:s,render:l}=de(e,o),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=le(r,e)||{};if(void 0!==c&&void 0!==i&&void 0!==a){const e=Math.floor(t.reduce((e,{width:t,height:n})=>e+t/n*c+2*a,i*(t.length-1)));e>0&&(s.container={...s.container},s.container.style={maxWidth:e,...s.container.style})}return{...o,targetRowHeight:ce(n,e,[e=>e/5,e=>e/4,e=>e/3,e=>e/2]),render:l,spacing:i,padding:a,minPhotos:d,maxPhotos:u,componentsProps:s}}(a,{photos:e,...r}),p=F(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?function(e,t,n,r,o,i,a){const s=Math.min(function(e,t,n,r){return ue(t/n/e.reduce((e,t)=>Math.min(e,ie(t)),1/0))+(r||0)+2}(e,r,o,i),a||1/0),l=i||1,c=e.length,d=new Array(c+1);d[0]=0;for(let g=0;g<c;g+=1)d[g+1]=d[g]+ie(e[g]);const u=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);u[0]=0;for(let g=1;g<=c;g+=1)for(let e=g-l;e>=Math.max(0,g-s);e-=1){if(u[e]===1/0)continue;const i=Ie(d,e,g,r,t,n,o);if(void 0===i)break;const a=u[e]+i;(u[g]===1/0||u[g]>a&&u[g]/a>1.005)&&(u[g]=a,h[g]=e)}if(u[c]===1/0)return;const p=[];for(let g=c;0!==g;g=h[g])p.push(g);p.push(0),p.reverse();const m=[];for(let g=1;g<p.length;g+=1){const o=e.slice(p[g-1],p[g]),i=Te(o,r,t,n);m.push({photos:o.map((e,t)=>({photo:e,index:p[g-1]+t,width:i*ie(e),height:i}))})}return{spacing:t,padding:n,containerWidth:r,tracks:m,horizontal:!0}}(e,s,l,a,c,d,u):void 0,[e,s,l,a,c,d,u]);return _(we,{layout:"rows",ref:i,model:p,...h})}),qe={[String(h.NONE)]:function({className:e}){/* @__PURE__ */
2
+ return _("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__ */_("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[h.LINK]:function({className:e}){/* @__PURE__ */
3
+ return _("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__ */_("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[h.EMAIL]:function({className:e}){/* @__PURE__ */
4
+ return _("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__ */_("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[h.PHONE]:function({className:e}){/* @__PURE__ */
5
+ return _("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__ */_("path",{fill:"currentColor",d:"M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"})})},[h.SMS]:function({className:e}){/* @__PURE__ */
6
+ return _("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__ */_("path",{fill:"currentColor",d:"m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4.713-5.288Q9 10.425 9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11t.713-.288m4 0Q13 10.426 13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11t.713-.288m4 0Q17 10.426 17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11t.713-.288"})})},[h.WHATSAPP]:function({className:e}){/* @__PURE__ */
7
+ return _("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 258",className:e,"aria-hidden":"true",focusable:"false",children:[
8
+ /* @__PURE__ */_("defs",{children:[/* @__PURE__ */_("linearGradient",{id:"SVGK3KZq49U",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */_("stop",{offset:"0%","stop-color":"#1faf38"}),/* @__PURE__ */_("stop",{offset:"100%","stop-color":"#60d669"})]}),/* @__PURE__ */_("linearGradient",{id:"SVGefMkoEOd",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */_("stop",{offset:"0%","stop-color":"#f9f9f9"}),/* @__PURE__ */_("stop",{offset:"100%","stop-color":"#fff"})]})]}),
9
+ /* @__PURE__ */_("path",{fill:"url(#SVGK3KZq49U)",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"}),
10
+ /* @__PURE__ */_("path",{fill:"url(#SVGefMkoEOd)",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"}),
11
+ /* @__PURE__ */_("path",{fill:"#fff",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"})]})},[h.MESSENGER]:function({className:e}){/* @__PURE__ */
12
+ return _("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:e,"aria-hidden":"true",focusable:"false",children:[
13
+ /* @__PURE__ */_("defs",{children:/* @__PURE__ */_("radialGradient",{id:"SVGhphmYc3G",cx:"19.247%",cy:"99.465%",r:"108.96%",fx:"19.247%",fy:"99.465%",children:[
14
+ /* @__PURE__ */_("stop",{offset:"0%","stop-color":"#09f"}),
15
+ /* @__PURE__ */_("stop",{offset:"60.975%","stop-color":"#a033ff"}),
16
+ /* @__PURE__ */_("stop",{offset:"93.482%","stop-color":"#ff5280"}),
17
+ /* @__PURE__ */_("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
18
+ /* @__PURE__ */_("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
19
+ /* @__PURE__ */_("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Ee=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==h.NONE),i=qe[t?.targetType]??qe[h.LINK],a=t?.imageUrl&&c(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
20
+ return _(re,{open:Boolean(e&&t),onOpenChange:e=>!e&&n?.(),children:/* @__PURE__ */_(ee,{className:"border-none p-0",children:[/* @__PURE__ */_(X,{className:"sr-only",children:[/* @__PURE__ */_(te,{children:t?.title}),/* @__PURE__ */_(ne,{children:t?.description})]}),/* @__PURE__ */_("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[a&&/* @__PURE__ */_("img",{className:"h-auto w-full object-contain sm:max-h-96",src:a,alt:t?.title||"Advertisement"}),
21
+ /* @__PURE__ */_("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */_(M,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */_(M,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */_(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??h.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */_(i,{className:"size-5"}),children:t?.targetText})]})]})})};function Me(e,t){if(e.content?._id!==t.content?._id)return!1;if(e.style?.width!==t.style?.width||e.style?.height!==t.style?.height)return!1;for(const n of Object.keys(e))if("content"!==n&&"style"!==n&&e[n]!==t[n])return!1;return!0}var Le=E(({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:s,captureAdClick:l}=K(),c=Boolean(n&&r),u=t.ctaBg||"#ff4800",p=t.ctaForeground||"#FFFFFF",m=qe[t?.targetType??h.LINK];/* @__PURE__ */
22
+ return _("div",{style:e,className:"group relative mb-1 overflow-hidden rounded",children:[
23
+ /* @__PURE__ */_(a,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>s(t._id),children:/* @__PURE__ */_(k,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:c?()=>r?.(t):void 0,pswpData:{id:t._id,type:d.AD,hash:t._id,width:t.width,height:t.height,title:t.title,description:t.description,targetType:t.targetType,targetText:t.targetText,targetUrl:t.targetUrl,thumbnailUrl:t.imageUrl,blurhash:t.blurhash}})}),
24
+ /* @__PURE__ */_("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!o&&(t.title||t.targetType!==h.NONE)&&/* @__PURE__ */_("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[t.title&&/* @__PURE__ */_("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */_("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==h.NONE&&/* @__PURE__ */_("button",{type:"button",className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:u,color:p},onClick:()=>{c?r?.(t):l(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */_("span",{style:{color:p},children:/* @__PURE__ */_(m,{})}),t?.targetText]})]})]})},Me),Se=E(({style:e,gamConfig:t,slotIndex:r,eventId:o,organizationId:s})=>{const l=P(null),c=P(null),{trackGamAnalytics:d}=K(),[u,h]=U(!1),p=`gam-slot-${o??"ev"}-${r}`,m=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),g=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),f=P({w:m,h:g});return n(()=>{if(!u)return;let e=!1,n=null,r=null,a=null,h=null;return(async()=>{await W(),!e&&l.current&&window.googletag.cmd.push(()=>{if(e)return;Y(p);const{w:u,h:m}=f.current,g=[[u,m],...t.sizes],v=window.googletag.defineSlot(t.adUnitPath,g,p)?.addService(window.googletag.pubads());if(!v)return;c.current=v,r=window.googletag.pubads(),o?v.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&v.setConfig({targeting:{qrati_category:t.categories}}),a=e=>{e.slot===v&&d({eventId:o,organizationId:s,type:i.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",a),h=e=>{e.slot===v&&d({eventId:o,organizationId:s,type:i.GAM_VIEWABLE})},r.addEventListener("impressionViewable",h);const w=l.current;w&&(n=J({container:w,onClick:()=>{d({eventId:o,organizationId:s,type:i.GAM_CLICK})}}),H(),window.googletag.display(p))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(a&&r.removeEventListener("slotRenderEnded",a),h&&r.removeEventListener("impressionViewable",h));const t=c.current;c.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[u,o,t.adUnitPath,t.categories,s,p]),/* @__PURE__ */_("div",{style:{width:m,height:g},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":r,children:/* @__PURE__ */_(a,{className:"size-full",threshold:.1,rootMargin:"200px",triggerOnce:!0,onChange:h,children:/* @__PURE__ */_("div",{id:p,ref:l,style:{width:m,height:g},className:"gam-ad-slot"})})})},Me),ze=(e,t)=>{if(!e||!t)return null;const n=t[e];if(!n)return null;try{const e=new Date(String(n)),t=/* @__PURE__ */new Date,r=e.getFullYear()===t.getFullYear(),o={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return r||(o.year="numeric"),e.toLocaleString("en-US",o).replace(","," •")}catch{return null}},_e=t(null),Pe=()=>{const e=m(_e);if(!e)throw new Error("Popover components must be used within a Popover");return e},Oe=({children:e,className:t,open:n,onOpenChange:o})=>{const[i,a]=U(!1),s="boolean"==typeof n,l=s?n:i,c=p(),d=`popover-trigger-${c}`,u=`popover-content-${c}`,h=P(null);/* @__PURE__ */
25
+ return _(_e.Provider,{value:{isOpen:l,setIsOpen:e=>{s||a(e),o?.(e)},triggerId:d,contentId:u,triggerRef:h},children:/* @__PURE__ */_("div",{"data-slot":"popover",className:r("relative inline-block",t),children:e})})},je=({children:e,asChild:t,className:n,onClick:r,...o})=>{const{isOpen:i,setIsOpen:a,triggerId:s,contentId:l,triggerRef:c}=Pe();if(t){const t=Array.isArray(e)?e[0]:e;if(t&&t.type){const e=t.props?.className;return I(t,{ref:e=>{c.current=e},id:s,className:n?e?`${e} ${n}`:n:e,"aria-haspopup":"dialog","aria-expanded":i,"aria-controls":i?l:void 0,onClick:e=>{a(!i),t.props?.onClick?.(e)},"data-state":i?"open":"closed"})}}/* @__PURE__ */
26
+ return _("button",{ref:c,id:s,type:"button","aria-haspopup":"dialog","aria-expanded":i,"aria-controls":i?l:void 0,"data-slot":"popover-trigger","data-state":i?"open":"closed",className:n,onClick:e=>{a(!i),r?.(e)},...o,children:e})},Re=({children:e,className:t,align:o="center",side:i="top",sideOffset:a=4,...s})=>{const{isOpen:l,setIsOpen:c,contentId:d,triggerRef:u}=Pe(),{organization:h,portalContainer:p}=$(),m=P(null),[g,f]=U(null);if(w(()=>{if(!l)return;const e=()=>{if(!u.current||!m.current)return;const e=u.current.getBoundingClientRect(),t=m.current.getBoundingClientRect();let n=e.left,r=e.bottom+a;"center"===o&&(n=e.left+e.width/2-t.width/2),"end"===o&&(n=e.right-t.width),"top"===i&&(r=e.top-t.height-a),"left"===i&&(n=e.left-t.width-a,r=e.top+e.height/2-t.height/2),"right"===i&&(n=e.right+a,r=e.top+e.height/2-t.height/2),"bottom"===i&&(r=e.bottom+a),f({top:r,left:n})},t=requestAnimationFrame(e);return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[o,l,i,a,u]),n(()=>{if(!l)return;const e=e=>{const t="function"==typeof e.composedPath?e.composedPath():[],n=e.target,r=m.current&&(m.current.contains(n)||t.includes(m.current)),o=u.current&&(u.current.contains(n)||t.includes(u.current));r||o||c(!1)},t=e=>{"Escape"===e.key&&(c(!1),u.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",e)},0);return document.addEventListener("keydown",t),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[l,c,u]),!l)return null;const v=/* @__PURE__ */_("div",{ref:m,id:d,role:"dialog","aria-modal":"false","data-state":"open",className:r("bg-background text-foreground border-border shadow-outer rounded outline-none",t),style:{position:"fixed",top:g?.top??0,left:g?.left??0,zIndex:2010,...R(h)},...s,children:e});return"undefined"!=typeof document?b(v,p??document.body):v},Ue=({eventId:e,contentId:t,emojis:o=[],counts:i={},userReaction:a})=>{const{user:l,props:c,organization:d}=$(),u=c?.loginUrl,{handleReactionClick:h,isPending:p}=(()=>{const e=q(),{props:t,user:n}=$(),r=t?.organizationId,o=G({mutationFn:async({eventId:e,contentId:t,emoji:o})=>f.post(A.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}}).json(),onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[z.CONTENTS_BY_EVENT(t)];await e.cancelQueries({queryKey:o});const i=e.getQueriesData({queryKey:o});return e.setQueriesData({queryKey:o},e=>((e,t,n)=>{if(!e?.pages||!Array.isArray(e.pages))return e;let r=!1;const o=e.pages.map(e=>{if(!e.data)return e;let o=!1;const i=e.data.map(e=>{if(e._id!==t||e.userReaction===n)return e;r=!0,o=!0;const i={...e.reactionCounts??{}};return e.userReaction&&(i[e.userReaction]=Math.max(0,(i[e.userReaction]??1)-1)),i[n]=(i[n]??0)+1,{...e,reactionCounts:i,userReaction:n}});return o?{...e,data:i}:e});return r?{...e,pages:o}:e})(e,n,r)),{previousData:i}},onError:(t,n,r)=>{r?.previousData?.forEach(([t,n])=>{e.setQueryData(t,n)}),N.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return N.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:e,contentId:t,emoji:r}),!0}catch(i){return!1}},isPending:o.isPending}})(),[m,g]=U(!1),[v,w]=U(null),y=P(null),b=o.reduce((e,t)=>e+(i[t]||0),0);return n(()=>()=>{y.current&&clearTimeout(y.current)},[]),/* @__PURE__ */_(Oe,{open:m,onOpenChange:g,children:[/* @__PURE__ */_(je,{asChild:!0,children:/* @__PURE__ */_("button",{type:"button",className:r("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(o||[]).slice().sort((e,t)=>(i[t]||0)-(i[e]||0)).slice(0,1).map(e=>/* @__PURE__ */_("span",{className:r("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),b>0&&/* @__PURE__ */_("span",{className:"text-xs font-bold sm:text-sm",children:b||0})]})}),/* @__PURE__ */_(Re,{side:"top",align:"end",children:[l?null:/* @__PURE__ */_("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
27
+ /* @__PURE__ */_("a",{className:"text-info underline",href:u,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
28
+ /* @__PURE__ */_(x,{className:"text-info underline",to:s.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */_("div",{className:"flex gap-1 p-2",children:o.map(n=>{const o=a===n;/* @__PURE__ */
29
+ return _("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */_("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */_("button",{type:"button",disabled:p,className:r("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",o?"scale-125":"hover:scale-110",v===n&&"scale-125",p&&"cursor-not-allowed"),onClick:()=>(async n=>{!p&&h&&(w(n),g(!1),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>w(null),180),h(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},$e=({event:e={},content:t,curateLink:n})=>{if(e.engagementStyle===l.CONTEST||n){const e=/* @__PURE__ */_("span",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */_(Z,{className:"size-4"}),/* @__PURE__ */_("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]});return n?/* @__PURE__ */_(S,{to:n,children:e}):e}return e.engagementStyle===l.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */_(Ue,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,counts:t.reactionCounts||{},userReaction:t.userReaction}):null},Fe=({content:e})=>/* @__PURE__ */_("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */_("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */_("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */_("div",{className:"flex items-center justify-between",children:/* @__PURE__ */_("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),Ge=E(({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,imageSearchProviders:l=V,organizationId:c})=>{const h=`content-${t._id}`,p=F(()=>ze(r,t),[r,t]),m=j(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),g=F(()=>({id:t._id,type:d.IMAGE,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}),[t._id,t.width,t.height,t.thumbnailUrl,t.blurhash,t.caption]);/* @__PURE__ */
30
+ return _("div",{id:h,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */_(k,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:g}),!a&&/* @__PURE__ */_(u,{children:[p&&/* @__PURE__ */_("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:p}),
31
+ /* @__PURE__ */_("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */_("button",{type:"button","aria-label":"Search by face",className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-[opacity,transform] sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:m,children:/* @__PURE__ */_(Q,{className:"text-primary-foreground"})}),t.url&&/* @__PURE__ */_(D,{providers:l,imageUrl:t.url,surface:"gallery",organizationId:c,eventId:e?._id,contentId:t._id})]}),
32
+ /* @__PURE__ */_("div",{className:"",children:[/* @__PURE__ */_("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */_(Fe,{content:t})}),/* @__PURE__ */_("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */_($e,{event:e,content:t,curateLink:o})})]})]})]})},Me),Be=E(({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=F(()=>ze(r,e),[r,e]);/* @__PURE__ */
33
+ return _("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */_(k,{url:e.src??e.url,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,alt:e.caption,curateLink:o,pswpData:{id:e._id,type:d.VIDEO,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}}),!i&&/* @__PURE__ */_("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */_("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
34
+ /* @__PURE__ */_("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */_(Fe,{content:e})}),
35
+ /* @__PURE__ */_("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */_($e,{event:n,content:e,curateLink:o})})]})]})},Me),Ve=({event:t,contents:o=[],gamConfig:i,singleColumnMode:a,kioskMode:s,timestampField:l,curateLink:c,onChangeFaceUrl:h,showQuickSearch:p,onLoadMore:m})=>{const f=P(null),w=P(null),b=P(!1),x=P(m);x.current=m;const N=P(null),k=F(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:C,captureAdClick:I}=K(),A=O(),q=v(),E=y(),{portalContainer:M,organization:L}=$(),S=L?._id,z=L?.advancedSettings?.imageSearchProviders?.gallery??V,R=L?.advancedSettings?.imageSearchProviders?.lightbox??V,[G,B]=U(null);n(()=>()=>{w.current?.destroy(),w.current=null,f.current?.destroy?.(),f.current=null},[t?.galleryLayout,c,k,M]);const D=j(async e=>{if(c||f.current||b.current)return;const n=N.current,r=e.target.closest("a");if(!n||!r||!n.contains(r))return;e.preventDefault(),b.current=!0;const o=Array.from(n.querySelectorAll("a")).indexOf(r);try{const[{default:e},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c},{loadPhotoSwipe:d},u]=await Promise.all([import("./BhYfK52W.js").then(e=>e.u),import("./Bo39kG4k.js"),import("./lFDEfCSm.js"),import("./ZWATOkpE.js"),import("./BuT9kfma.js"),import("./CtxIOzTC.js"),import("./1dmOpMwn.js"),import("./BhYfK52W.js").then(e=>e.l),R.length>0?import("./BhPQW37y.js"):Promise.resolve(null)]),h=new e({gallery:n,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:d,appendToEl:M??document.body}),p=h;f.current=p;const m=new T(()=>window.pswp,"memory"===E?{location:q.pathname,state:q.state,push:(e,t)=>A(e,{state:t}),replace:(e,t)=>A(e,{state:t,replace:!0}),go:e=>A(e)}:void 0);w.current=m,h.on("beforeOpen",()=>m.open()),h.on("close",()=>m.close()),new r(h),new i(h),u&&new u.default(h,R,{organizationId:S,eventId:t?._id}),new a(h),new s(h,C,I),new l(h),new c(h),h.init();const g=()=>{const e=f.current?.pswp;e&&e.currIndex>=e.getNumItems()-5&&x.current?.()};h.on("change",g),h.on("afterInit",g),o>=0&&p.loadAndOpen?.(o)}finally{b.current=!1}},[c,M,C,I,R,S,t?._id,q.pathname,q.state,A,E]);n(()=>{const t=w.current;"memory"===E&&t?.isActive()&&!e(q.state)&&t.handleBack()},[q.state,E]),n(()=>{const e=f.current,t=N.current,n=e?.options?.dataSource;e?.pswp&&n&&t&&(n.items=Array.from(t.querySelectorAll("a")),e.pswp.refreshSlideContent(e.pswp.currIndex+1))},[o]);const W=F(()=>{switch(t?.galleryLayout){case g.ROW:return Ae;case g.COLUMN:return Ne;case g.MASONRY:return Ce;default:return Ae}},[t?.galleryLayout]),H=F(()=>o.map(e=>{const t=e.type===d.IMAGE||e.type===d.VIDEO?e.url:e.type===d.GAM_AD?"":e.imageUrl;return{...e,src:t??"",width:e.dimension?.width||e.width||4,height:e.dimension?.height||e.height||3}}),[o]),Q=F(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */_("div",{ref:e,className:t??"",children:n}),photo:(e,{photo:n,width:r,height:o,index:a})=>{const u=n;let m=null;switch(u.type){case d.IMAGE:m=Ge;break;case d.VIDEO:m=Be;break;case d.AD:m=Le;break;case d.GAM_AD:return i?/* @__PURE__ */_(Se,{style:{width:r,height:o},gamConfig:i,slotIndex:u.slotIndex??a,eventId:t?._id,organizationId:S},`${u._id??a}-${a}`):null;default:m=null}return m?/* @__PURE__ */_(m,{style:{width:r,height:o},event:t,content:u,timestampField:l,onAdClick:c?B:void 0,hideControls:s,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:h,showQuickSearch:p,imageSearchProviders:z,organizationId:S},`${u._id??a}-${a}`):null}}),[t,i,S,l,c,s,h,p,z]);/* @__PURE__ */
36
+ return _(u,{children:[/* @__PURE__ */_("div",{id:k,ref:N,onClickCapture:D,className:r(a?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */_(W,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return a?(t.minPhotos=1,t.maxPhotos=1):t.maxPhotos=e<400?2:e<800?3:4,t},columns:e=>a?1:e<400?2:e<800?3:4,photos:H,render:Q})}),/* @__PURE__ */_(Ee,{open:Boolean(G),ad:G,onClose:()=>B(null),captureAdClick:I})]})};export{Ve as default};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./BlsbPO0-.js";import{Cn as t,Dn as o,Ut as l,Y as r,cn as a,en as n,tt as i,un as c,vn as f,wt as s,xn as p,xt as d,yn as u}from"./BhYfK52W.js";import{a as m,i as g,n as b,r as h,t as x}from"./BX09gwBu.js";import{t as v}from"./CfMNBPpx.js";import{n as k}from"./DjFlbVE4.js";var y=[[90,-180],[-90,180]],w=[20,0],z={topLeft:[276,60],bottomRight:[60,60]},A=new n,L=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),E=({onExplore:n,logoUrl:E})=>{const C=f(null),R=f(null),T=f(null),M=f(null),O=f(null),I=f(null),W=f(null),S=f(!1),Z=f(!1),[j,D]=p(!0),[q,B]=p(!1),{folderTree:H,activeFolderId:N,activeFolder:U,visibleEvents:F,setActiveFolderId:P,isLoadingEvents:Y}=k(),{organization:J}=d(),G=s(J)["--primary"],Q=`${l}-${J?._id??"unknown"}`,K=f(Q);K.current=Q;const V=u(()=>(e=>{try{const t=sessionStorage.getItem(e);if(!t)return null;const o=JSON.parse(t);if("number"==typeof o?.center?.lat&&"number"==typeof o?.center?.lng&&"number"==typeof o?.zoom)return o}catch{}return null})(Q),[Q]),X=f(/* @__PURE__ */new Map),$=f(/* @__PURE__ */new Map),_=f(null),ee=f(null),te=f(n);return te.current=n,t(()=>{if(!C.current||R.current)return;v("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),v("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./CYHy0vN3.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./B60TJHpn.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!C.current)return;const a=l.map(C.current,{center:V?.center?[V.center.lat??w[0],V.center.lng??w[1]]:w,zoom:V?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(y),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const c="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();c.addTo(a);const f=()=>{W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{try{sessionStorage.setItem(K.current,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",f),a.on("moveend",f),R.current=a,T.current=r,M.current=n,I.current=i,O.current=c,"undefined"!=typeof ResizeObserver&&C.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(C.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),B(!0),D(!1),t=()=>{s?.disconnect(),W.current&&clearTimeout(W.current),a.off("zoomend",f),a.off("moveend",f),a.remove(),T.current=null,R.current=null,M.current=null,I.current=null,O.current=null}}finally{o||D(!1)}})(),()=>{o=!0,t?.()}},[]),t(()=>{if(!q)return;const e=T.current;if(!e)return;const t=R.current,l=null===N&&H.length>0,r=l?"folders":"events";if(_.current!==r&&(M.current?.clearLayers(),O.current?.clearLayers(),$.current.clear(),X.current.clear(),ee.current=null,_.current=r),l){t&&I.current&&(I.current.setLatLngs?.([]),t.hasLayer(I.current)&&t.removeLayer(I.current));const o=[],l=e=>{for(const t of e)t.centroid?o.push(t):t.children.length>0&&l(t.children)};l(H);const r=new Set(o.map(e=>e.folder._id));for(const[e,t]of $.current)r.has(e)||(M.current?.removeLayer(t),$.current.delete(e));for(const t of o){const[o,l]=t.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${h(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${L(t.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${t.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]}),a=$.current.get(t.folder._id);if(a){a.setIcon(r),a.setLatLng([l,o]);continue}const n=e.marker([l,o],{icon:r}).on("click",()=>P(t.folder._id)).addTo(M.current);$.current.set(t.folder._id,n)}}else{if(0===F.length){for(const e of X.current.values())O.current?.removeLayer(e);return void X.current.clear()}const l=0===H.length&&null===N,r=h(U?.color,G);t&&I.current&&(l&&!t.hasLayer(I.current)?I.current.addTo(t):l||(I.current.setLatLngs?.([]),t.hasLayer(I.current)&&t.removeLayer(I.current)));const n=g(E),i=new Set(F.map(e=>String(e._id)));for(const[e,t]of X.current)i.has(e)||(O.current?.removeLayer(t),X.current.delete(e));const f=`${r}|${n??""}`,s=ee.current!==f;ee.current=f;const p=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:42px;height:42px;cursor:pointer;background:${r};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${n?`<img src="${L(n)}" style="width:28px;height:28px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[42,42],iconAnchor:[21,42],popupAnchor:[0,-42]});if(F.forEach(t=>{const l=String(t._id),r=t.location.x,n=t.location.y,i=X.current.get(l);if(i)return s&&i.setIcon(p),void i.setLatLng([n,r]);const f=e.marker([n,r],{icon:p}),d=document.createElement("div");d.style.width="192px",f.on("popupopen",()=>{((e,t)=>{o(/* @__PURE__ */c(a,{client:A,children:/* @__PURE__ */c(m,{event:e,onExplore:e=>te.current(e)})}),t)})(t,d)}),f.on("popupclose",()=>{o(null,d)}),f.bindPopup(d,{closeButton:!0,minWidth:224,maxWidth:224}),O.current?.addLayer(f),X.current.set(l,f)}),l&&I.current){const e=F.reduce((e,t)=>Math.max(e,t.views??0),1),t=F.map(e=>[e.location.y,e.location.x,e.views??1]);I.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),I.current.setLatLngs?.(t)}if(l&&!Z.current&&t&&(Z.current=!0,!V)){const o=e.latLngBounds([]);F.forEach(e=>o.extend([e.location.y,e.location.x])),o.isValid()&&t.fitBounds(o,{paddingTopLeft:z.topLeft,paddingBottomRight:z.bottomRight,maxZoom:8})}}},[N,H,F,q,E,P,U,V]),t(()=>{if(!q)return;const e=R.current,t=T.current;if(!e||!t)return;if(!S.current&&V)return void(S.current=!0);S.current=!0;const o={paddingTopLeft:z.topLeft,paddingBottomRight:z.bottomRight,duration:3,easeLinearity:1};if(N){const l=b(H,N);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(H),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[N,H,q,V]),/* @__PURE__ */c("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:s(J),children:[
2
+ /* @__PURE__ */c(x,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:H,activeFolderId:N,setActiveFolderId:P}),Y&&/* @__PURE__ */c("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */c("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),j&&/* @__PURE__ */c("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */c("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */c("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */c("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),!Y&&0===F.length&&(0===H.length||null!==N)&&/* @__PURE__ */c("div",{class:"absolute inset-0 z-30 flex items-center justify-center bg-white/90",children:/* @__PURE__ */c(i,{title:"No Events",description:"Check back later for our awesome events!",iconSvg:/* @__PURE__ */c(r,{})})}),
3
+ /* @__PURE__ */c("div",{ref:C,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{E as default};