@qratilabs/qrati-connect 2.23.0-beta.7 → 2.23.0-beta.9

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 (44) hide show
  1. package/README.md +1 -1
  2. package/{umd/Be0CvNtB2.js → element/B6PU8eoK2.js} +1 -1
  3. package/element/{Bjk2Sh6j.js → B8Ttd5mR.js} +1 -1
  4. package/element/{BgZ0Z_2h2.js → BMXdJ0nE2.js} +1 -1
  5. package/element/BhRXQLUC.js +9 -0
  6. package/element/{B4lwZDUX2.js → Bj9UR6Yz2.js} +1 -1
  7. package/{umd/DULS4MvK2.js → element/C1LNODkE2.js} +4 -4
  8. package/element/{PRcgvwdj2.js → CCcBybqT2.js} +1 -1
  9. package/element/{Np8M1cfd2.js → Cl0iruY72.js} +1 -1
  10. package/element/{D6hHHpAR.js → D0jvjVwV.js} +1 -1
  11. package/element/{CATSC4-J2.js → D4fyuPrh2.js} +1 -1
  12. package/{umd/D3GF-wei2.js → element/DVXOEYek2.js} +17 -17
  13. package/element/{BDMmA1b5.js → D_4OXo87.js} +1 -1
  14. package/element/{Bf4wP8wC2.js → DkMzhenk2.js} +1 -1
  15. package/element/{DOPIUBGQ2.js → DmMRHXtM2.js} +1 -1
  16. package/{umd/DxE6Q_Na2.js → element/DpKHDt4F2.js} +1 -1
  17. package/element/{DTc2fWkf2.js → HO1cwKhZ2.js} +1 -1
  18. package/element/{CVn-rSGC2.js → afmuirs12.js} +1 -1
  19. package/element/{VakK6fPh2.js → gk4TX_a62.js} +1 -1
  20. package/element/web.es.js +5 -5
  21. package/package.json +6 -3
  22. package/react/index.cjs +1 -1
  23. package/react/index.mjs +1 -1
  24. package/{element/Be0CvNtB2.js → umd/B6PU8eoK2.js} +1 -1
  25. package/umd/{Bjk2Sh6j.js → B8Ttd5mR.js} +1 -1
  26. package/umd/{BgZ0Z_2h2.js → BMXdJ0nE2.js} +1 -1
  27. package/umd/BhRXQLUC.js +9 -0
  28. package/umd/{B4lwZDUX2.js → Bj9UR6Yz2.js} +1 -1
  29. package/{element/DULS4MvK2.js → umd/C1LNODkE2.js} +4 -4
  30. package/umd/{PRcgvwdj2.js → CCcBybqT2.js} +1 -1
  31. package/umd/{Np8M1cfd2.js → Cl0iruY72.js} +1 -1
  32. package/umd/{D6hHHpAR.js → D0jvjVwV.js} +1 -1
  33. package/umd/{CATSC4-J2.js → D4fyuPrh2.js} +1 -1
  34. package/{element/D3GF-wei2.js → umd/DVXOEYek2.js} +17 -17
  35. package/umd/{BDMmA1b5.js → D_4OXo87.js} +1 -1
  36. package/umd/{Bf4wP8wC2.js → DkMzhenk2.js} +1 -1
  37. package/umd/{DOPIUBGQ2.js → DmMRHXtM2.js} +1 -1
  38. package/{element/DxE6Q_Na2.js → umd/DpKHDt4F2.js} +1 -1
  39. package/umd/{DTc2fWkf2.js → HO1cwKhZ2.js} +1 -1
  40. package/umd/{CVn-rSGC2.js → afmuirs12.js} +1 -1
  41. package/umd/{VakK6fPh2.js → gk4TX_a62.js} +1 -1
  42. package/umd/web.es.js +5 -5
  43. package/element/B6TGzjaW.js +0 -8
  44. package/umd/B6TGzjaW.js +0 -8
package/README.md CHANGED
@@ -10,7 +10,7 @@ Qrati Connect is a React component library designed to seamlessly integrate Qrat
10
10
  - **Curation :** Want to host a photo contest? Our curation feature can be a one stop solution for that.
11
11
  - **Leaderboard :** Gamify your contest with a precise and fun leaderboard.
12
12
 
13
- # Installation (React Component)
13
+ **Qrati Connect** is a compact, production-grade SDK for embedding photo galleries, uploads, curation, and engagement into any website. Built with strict TypeScript, Preact compatibility, and careful bundling to deliver a fast, accessible, and themeable integration.
14
14
 
15
15
  Install `qrati-connect` using npm, yarn, pnpm or bun:
16
16
 
@@ -1,3 +1,3 @@
1
- import{C as t,b as e,f as r,h as n,p as s,t as o}from"./C3uDEVBt.js";import{I as i,a,n as c,w as l}from"./TOp1kwsu.js";import{t as u}from"./iWy6455b.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./DTc2fWkf2.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(e,r,n)=>{t(/* @__PURE__ */o(i,{client:Mt,children:/* @__PURE__ */o(h,{event:e,onExplore:n})}),r)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:t,onExplore:i,logoUrl:u})=>{const h=r(null),d=r(null),m=r(null),y=r(null),b=r([]),w=r([]),x=r(null),k=r(null),E=r(!1),v=r(!1),M=s(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=n(!1),[_,L]=n(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return e(()=>{if(!h.current||d.current)return;let e=!1;return(async()=>{try{const{setOptions:r,importLibrary:n}=await import("./BsT0vqml.js");if(e)return;if(r({key:t,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),e||!h.current)return;const s=window.google.maps;m.current=s;const o=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:o,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new s.InfoWindow({maxWidth:280}),k.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{e||L(!1)}})(),()=>{e=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[t]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */o("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
1
+ import{C as t,b as e,f as r,h as n,p as s,t as o}from"./C3uDEVBt.js";import{I as i,a,n as c,w as l}from"./TOp1kwsu.js";import{t as u}from"./iWy6455b.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./HO1cwKhZ2.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(e,r,n)=>{t(/* @__PURE__ */o(i,{client:Mt,children:/* @__PURE__ */o(h,{event:e,onExplore:n})}),r)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:t,onExplore:i,logoUrl:u})=>{const h=r(null),d=r(null),m=r(null),y=r(null),b=r([]),w=r([]),x=r(null),k=r(null),E=r(!1),v=r(!1),M=s(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=n(!1),[_,L]=n(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return e(()=>{if(!h.current||d.current)return;let e=!1;return(async()=>{try{const{setOptions:r,importLibrary:n}=await import("./BsT0vqml.js");if(e)return;if(r({key:t,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),e||!h.current)return;const s=window.google.maps;m.current=s;const o=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:o,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new s.InfoWindow({maxWidth:280}),k.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{e||L(!1)}})(),()=>{e=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[t]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */o("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
2
2
  /* @__PURE__ */o(g,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:j,activeFolderId:I,setActiveFolderId:T}),P&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),_&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */o("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */o("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
3
3
  /* @__PURE__ */o("div",{ref:h,class:"size-full"})]})};export{Lt as default};
@@ -1,2 +1,2 @@
1
- import{D as e,a as t,b as r,f as o,h as n,t as s}from"./C3uDEVBt.js";import{i}from"./TOp1kwsu.js";import{n as a}from"./BkIDQGIs.js";var l=({as:t="div",className:n,threshold:s=.5,rootMargin:i="0px",triggerOnce:a,onChange:l,onClick:h,children:c})=>{const u=o(null),d=o(!1),p=o(l);return p.current=l,r(()=>{const e=u.current;if(!e)return;d.current=!1;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&d.current||(e.isIntersecting&&(d.current=!0),p.current?.(e.isIntersecting))})},{threshold:s,rootMargin:i});return t.observe(e),()=>t.disconnect()},[s,i,a]),e(t,{ref:u,className:n,onClick:h},c)},h=Object.defineProperty,c=Object.defineProperties,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&g(e,r,t[r]);if(d)for(var r of d(t))f.call(t,r)&&g(e,r,t[r]);return e},b=(e,t)=>c(e,u(t)),w=(e,t)=>{var r={};for(var o in e)p.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&d)for(var o of d(e))t.indexOf(o)<0&&f.call(e,o)&&(r[o]=e[o]);return r},v=class extends t{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:o}=this.props;if(this.canvas){let n=a(e,o,t,r),s=this.canvas.getContext("2d"),i=s.createImageData(o,t);i.data.set(n),s.putImageData(i,0,0)}}}componentDidUpdate(){this.draw()}render(){let t=this.props,{hash:r,height:o,width:n}=t,s=w(t,["hash","height","width"]);return e("canvas",b(m({},s),{height:o,width:n,ref:this.handleRef}))}};v.defaultProps={height:128,width:128};var y={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"};(class extends t{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let t=this.props,{hash:r,height:o,width:n,punch:s,resolutionX:i,resolutionY:a,style:l}=t,h=w(t,["hash","height","width","punch","resolutionX","resolutionY","style"]);return e("div",b(m({},h),{style:b(m({display:"inline-block",height:o,width:n},l),{position:"relative"})}),e(v,{hash:r,height:a,width:i,punch:s,style:y}))}}).defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var j=v,O=({src:e,alt:t,threshold:a=.1,rootMargin:h="200px 0px",blurhash:c,containerClassName:u="size-full",wrapperClassName:d,imgClassName:p="",sizeMode:f="cover",position:g="center",delayMs:m=100,delayTime:b,onClick:w})=>{const v=c&&c.length>=6?c:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[y,O]=n(!1),[C,x]=n(!1),[N,k]=n(!1),z=o(null);r(()=>{O(!1),x(!1)},[e]);const M="number"==typeof b?b:m,P=d??u;r(()=>{if(!y)return N?z.current=window.setTimeout(()=>{x(!0)},M):z.current&&(clearTimeout(z.current),z.current=null),()=>{z.current&&clearTimeout(z.current)}},[N,y,M]);const D=C&&N||y;/* @__PURE__ */
1
+ import{D as e,a as t,b as r,f as o,h as n,t as s}from"./C3uDEVBt.js";import{i}from"./TOp1kwsu.js";import{n as a}from"./BkIDQGIs.js";var l=({as:t="div",className:n,threshold:s=.5,rootMargin:i="0px",triggerOnce:a,onChange:l,onClick:h,children:c})=>{const u=o(null),d=o(!1),p=o(l);return p.current=l,r(()=>{const e=u.current;if(!e)return;d.current=!1;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&d.current||(e.isIntersecting&&(d.current=!0),p.current?.(e.isIntersecting))})},{threshold:s,rootMargin:i});return t.observe(e),()=>t.disconnect()},[s,i,a]),e(t,{ref:u,className:n,onClick:h},c)},h=Object.defineProperty,c=Object.defineProperties,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&g(e,r,t[r]);if(d)for(var r of d(t))f.call(t,r)&&g(e,r,t[r]);return e},b=(e,t)=>c(e,u(t)),w=(e,t)=>{var r={};for(var o in e)p.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&d)for(var o of d(e))t.indexOf(o)<0&&f.call(e,o)&&(r[o]=e[o]);return r},v=class extends t{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:o}=this.props;if(this.canvas){let n=a(e,o,t,r),s=this.canvas.getContext("2d"),i=s.createImageData(o,t);i.data.set(n),s.putImageData(i,0,0)}}}componentDidUpdate(){this.draw()}render(){let t=this.props,{hash:r,height:o,width:n}=t,s=w(t,["hash","height","width"]);return e("canvas",b(m({},s),{height:o,width:n,ref:this.handleRef}))}};v.defaultProps={height:128,width:128};var y={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"};(class extends t{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let t=this.props,{hash:r,height:o,width:n,punch:s,resolutionX:i,resolutionY:a,style:l}=t,h=w(t,["hash","height","width","punch","resolutionX","resolutionY","style"]);return e("div",b(m({},h),{style:b(m({display:"inline-block",height:o,width:n},l),{position:"relative"})}),e(v,{hash:r,height:a,width:i,punch:s,style:y}))}}).defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var j=v,O=({src:e,alt:t,threshold:a=.1,rootMargin:h="600px 0px",blurhash:c,containerClassName:u="size-full",wrapperClassName:d,imgClassName:p="",sizeMode:f="cover",position:g="center",delayMs:m=100,delayTime:b,onClick:w})=>{const v=c&&c.length>=6?c:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[y,O]=n(!1),[C,x]=n(!1),[N,k]=n(!1),z=o(null);r(()=>{O(!1),x(!1)},[e]);const M="number"==typeof b?b:m,P=d??u;r(()=>{if(!y)return N?z.current=window.setTimeout(()=>{x(!0)},M):z.current&&(clearTimeout(z.current),z.current=null),()=>{z.current&&clearTimeout(z.current)}},[N,y,M]);const D=C&&N||y;/* @__PURE__ */
2
2
  return s(l,{as:"div",className:i(P,"relative overflow-hidden"),threshold:a,rootMargin:h,onChange:e=>k(e),children:[N&&!y&&/* @__PURE__ */s(j,{className:"size-full blur-2xl",hash:v}),D&&e&&/* @__PURE__ */s("img",{alt:t,src:e,loading:"lazy",decoding:"async",onLoad:()=>O(!0),className:i("absolute top-0 left-0 size-full object-center transition-all duration-300",y?"scale-100 opacity-100":"scale-95 opacity-0","contain"===f?"object-contain":"object-cover","top"===g?"object-top":"bottom"===g?"object-bottom":"object-center",p),onClick:e=>w?.(e)})]})};export{l as n,O as t};
@@ -1,4 +1,4 @@
1
- import{b as e,f as t,h as a,p as n,t as r,w as o}from"./C3uDEVBt.js";import{L as s,N as i,O as l,i as c,n as d,p as m,u}from"./TOp1kwsu.js";import{n as p,r as h,t as g}from"./CWO6blVi.js";import{n as f,r as v,t as x}from"./D9FVUgcz.js";import{c as N,l as w}from"./D6qTsmXL.js";import{t as y}from"./BN5szMnq.js";import{t as b}from"./Bnib0POY.js";import{t as T}from"./B8iE0_hM.js";import{t as D}from"./DA91NKGO.js";import{n as P,r as C,t as j}from"./BDMmA1b5.js";import{t as I}from"./LpcU8wdf.js";import{n as E,o as S,r as z,t as A}from"./DN1lg1Z82.js";import{t as U}from"./DNG5BSHx2.js";import{a as q,i as O,n as _,r as k,t as M}from"./Dx7bGj8V2.js";var L=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=s(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token;return v({mutationKey:["delete-upload",r??null],mutationFn:async({contentId:e})=>{const t=await i.post(u.DELETE_CONTENT,{json:{contentId:e},headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(t?.error)throw new Error(t.error);return{contentId:e}},onMutate:async({contentId:t})=>{await e.cancelQueries({queryKey:[l.USER_UPLOADS],exact:!1});const a=e.getQueriesData({queryKey:[l.USER_UPLOADS],exact:!1});return e.setQueriesData({queryKey:[l.USER_UPLOADS],exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.filter(e=>e._id!==t),meta:{...e.meta,totalCount:Math.max(0,(e.meta.totalCount??0)-1)}}))}:e),{previousData:a}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}(),o=e?.rateCount??0,c=o<=0,m=c?null:`This photo has ${o} rating${o>1?"s":""}. Photos with at least 1 rating cannot be deleted.`;/* @__PURE__ */
1
+ import{b as e,f as t,h as a,p as n,t as r,w as o}from"./C3uDEVBt.js";import{L as s,N as i,O as l,i as c,n as d,p as m,u}from"./TOp1kwsu.js";import{n as p,r as h,t as g}from"./CWO6blVi.js";import{n as f,r as v,t as x}from"./D9FVUgcz.js";import{c as N,l as w}from"./D6qTsmXL.js";import{t as y}from"./BN5szMnq.js";import{t as b}from"./Bnib0POY.js";import{t as T}from"./B8iE0_hM.js";import{t as D}from"./DA91NKGO.js";import{n as P,r as C,t as j}from"./D_4OXo87.js";import{t as I}from"./LpcU8wdf.js";import{n as E,o as S,r as z,t as A}from"./DN1lg1Z82.js";import{t as U}from"./DNG5BSHx2.js";import{a as q,i as O,n as _,r as k,t as M}from"./Dx7bGj8V2.js";var L=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=s(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token;return v({mutationKey:["delete-upload",r??null],mutationFn:async({contentId:e})=>{const t=await i.post(u.DELETE_CONTENT,{json:{contentId:e},headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(t?.error)throw new Error(t.error);return{contentId:e}},onMutate:async({contentId:t})=>{await e.cancelQueries({queryKey:[l.USER_UPLOADS],exact:!1});const a=e.getQueriesData({queryKey:[l.USER_UPLOADS],exact:!1});return e.setQueriesData({queryKey:[l.USER_UPLOADS],exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.filter(e=>e._id!==t),meta:{...e.meta,totalCount:Math.max(0,(e.meta.totalCount??0)-1)}}))}:e),{previousData:a}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}(),o=e?.rateCount??0,c=o<=0,m=c?null:`This photo has ${o} rating${o>1?"s":""}. Photos with at least 1 rating cannot be deleted.`;/* @__PURE__ */
2
2
  return r(k,{open:Boolean(e),onOpenChange:e=>{e||a()},title:"Delete content?",description:m??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:c?"Delete":"Got it",confirmColor:c?"error":"primary",onCancel:a,onConfirm:c?()=>{if(!e||!c)return;const a=e.eventId,r=e._id;t(),n.mutate({contentId:r,eventId:a})}:a})};function $({className:e}){/* @__PURE__ */
3
3
  return r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */r("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var R={[m.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */r(M,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[m.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */r(O,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[m.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */r(U,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},F=e=>{const t=new Date(e).getTime();if(Number.isNaN(t))return"";const a=Math.max(0,Math.floor((Date.now()-t)/1e3)),n=[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]];let r=a,o="second";for(const[s,i]of n){if(r<s){o=i;break}r=Math.floor(r/s),o=i}return"second"===o&&r<30?"just now":`${r} ${o}${1===r?"":"s"} ago`},V=({content:e,onDelete:t,onStatusClick:a})=>{const n=e.status,o=R[n];/* @__PURE__ */
4
4
  return r("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */r("div",{className:"relative size-full",children:[
@@ -0,0 +1,9 @@
1
+ import{t as e,w as t}from"./C3uDEVBt.js";import{D as n,n as a}from"./TOp1kwsu.js";import{c as r,l as i,t as s}from"./D6qTsmXL.js";import{t as o}from"./BN5szMnq.js";import{t as l}from"./Bnib0POY.js";import{n as c}from"./DvTRhlvs.js";import{t as m}from"./DA91NKGO.js";import{t as d}from"./_ty2jtjs.js";function h({className:t}){/* @__PURE__ */
2
+ return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19v-3q0-.425.288-.712T4 15t.713.288T5 16v3h14V5H5v3q0 .425-.288.713T4 9t-.712-.288T3 8V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm6.65-8H4q-.425 0-.712-.288T3 12t.288-.712T4 11h7.65L9.8 9.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L14.8 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-3.575 3.575q-.3.3-.712.288T9.8 16.25q-.275-.3-.288-.7t.288-.7z"})})}var u=()=>{const{t:t}=c(),d=r(),u=i(),{initializing:p,organization:g,loadingUser:v,user:f,signout:N}=a();/* @__PURE__ */
3
+ return e("div",p||v?{className:"my-2 flex justify-end",children:/* @__PURE__ */e(o,{className:"h-9 w-64"})}:{className:"mx-auto mb-4",children:[!f&&/* @__PURE__ */e("div",{className:"flex justify-end gap-4",children:/* @__PURE__ */e(s,{to:`${n.LOGIN}?ref=${encodeURIComponent(d.pathname)}`,children:/* @__PURE__ */e(m,{children:t("button.login","Login")})})}),f&&/* @__PURE__ */e("div",{className:"mt-2 flex items-center justify-end gap-4",children:[/* @__PURE__ */e(l,{variant:"h5",children:f.name}),!g?.customAuth&&/* @__PURE__ */e("button",{onClick:async()=>{await N(),u(n.PUBLIC_EVENTS)},children:/* @__PURE__ */e(h,{className:"text-destructive"})})]})]})},p=()=>{const{user:r,organization:o,signout:c}=a(),m=i(),h=o?.integrationSettings?.hideQratiBranding;/* @__PURE__ */
4
+ return e("div",{className:"pt-16 sm:pt-24",children:[o&&/* @__PURE__ */e("div",{className:"mx-auto py-2",children:o.customAuth?r&&/* @__PURE__ */e(l,{variant:"h6",align:"center",children:[r.name,"•"," ",
5
+ /* @__PURE__ */e(s,{className:"hover:underline",to:n.MY_UPLOADS,children:"My Uploads"})]}):/* @__PURE__ */e(t,{children:[!r&&/* @__PURE__ */e(l,{variant:"h6",align:"center",children:[
6
+ /* @__PURE__ */e(s,{className:"text-primary hover:underline",to:n.LOGIN,children:"Login"})," ","•"," ",
7
+ /* @__PURE__ */e(s,{className:"text-primary hover:underline",to:n.REGISTER,children:"Register"})]}),r&&/* @__PURE__ */e(l,{variant:"h6",align:"center",children:[r.name," •"," ",
8
+ /* @__PURE__ */e(s,{className:"hover:underline",to:n.MY_UPLOADS,children:"My Uploads"})," ","•"," ",
9
+ /* @__PURE__ */e("button",{type:"button",className:"text-destructive cursor-pointer border-none bg-transparent p-0 hover:underline",onClick:async()=>{await c(),m(n.PUBLIC_EVENTS)},children:"Logout"})]})]})}),!h&&/* @__PURE__ */e(d,{})]})};export{u as n,p as t};
@@ -1,4 +1,4 @@
1
- import{d as e,s as r,t,v as o}from"./C3uDEVBt.js";import{D as l,n as s}from"./TOp1kwsu.js";import{l as i}from"./D6qTsmXL.js";var n=e(()=>import("./DxE6Q_Na2.js")),a=e(()=>import("./CATSC4-J2.js")),c=e(()=>import("./Be0CvNtB2.js")),d=e(()=>import("./Bf4wP8wC2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
1
+ import{d as e,s as r,t,v as o}from"./C3uDEVBt.js";import{D as l,n as s}from"./TOp1kwsu.js";import{l as i}from"./D6qTsmXL.js";var n=e(()=>import("./DpKHDt4F2.js")),a=e(()=>import("./D4fyuPrh2.js")),c=e(()=>import("./B6PU8eoK2.js")),d=e(()=>import("./DkMzhenk2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
2
2
  /* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
3
3
  /* @__PURE__ */t("p",{class:"text-foreground",children:"No location data available."}),
4
4
  /* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:e,isLoading:g=!1})=>{const{organization:x}=s(),f=i(),h=x?.integrationSettings??{},u=h.mapProvider??"openstreetmap",v=o(e=>{f(l.GALLERY(e))},[f]);if("openstreetmap_free"===u)/* @__PURE__ */return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:/* @__PURE__ */t(n,{onExplore:v,logoUrl:x?.logoUrl})})});const y=h.mapTilerApiKey??"",b=h.googleMapsApiKey??"",w=h.mapboxApiKey??"",j=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{C as t,D as e,E as n,T as i,_ as s,b as o,f as r,g as l,h as a,i as c,m as d,n as h,p as u,t as p,v as m,w as g,y as f}from"./C3uDEVBt.js";import{C as w,D as T,L as y,N as b,O as v,S as k,a as q,i as x,l as E,m as N,n as _,u as S,v as I}from"./TOp1kwsu.js";import{n as C,r as L,t as M}from"./D9FVUgcz.js";import{t as R}from"./D6qTsmXL.js";import{t as B}from"./Bnib0POY.js";import{t as A}from"./DA91NKGO.js";import{n as V,t as z}from"./Bjk2Sh6j.js";import{n as O}from"./BkIDQGIs.js";import{t as F}from"./Bki5T_lb.js";import{n as P,r as D,t as U}from"./BDMmA1b5.js";import{n as H}from"./Cv9xb_-W.js";import{a as j,i as $,n as G,o as W,r as Q,s as K,t as Y}from"./CM4ZH83j.js";import{a as Z,n as J,o as X,r as tt,t as et}from"./DN1lg1Z82.js";function nt(t){return["react-photo-album",t].filter(Boolean).join("--")}function it({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,n,i=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=st.findIndex(t=>t<=e);return ot(t[Math.max(n,0)],e)}(n,e):s,i))}function at(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(n,t,[0,0,0,0]),componentsProps:ot(i,t)||{},render:ot(s,t)}}function ct(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function dt(t,e,n,i,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:l,sizes:a}}var ht=c(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(nt),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${nt(n)}`),"number"==typeof e?ct(e,5):e];var n})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},n);if(t)return t}return p(t||"div",{ref:c,...h})}),ut=c(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(n,3),height:ct(i,3)};let T;return T=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...T,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),pt=c(function({layout:t,sizes:n,model:i,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:T,padding:y,containerWidth:b,tracks:v,variables:k,horizontal:q}=i||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:T,padding:y,containerWidth:b,...k},classes:["",t],render:r,ref:w,children:[void 0!==T&&void 0!==y&&void 0!==b&&v?.map(({photos:t,variables:i},s)=>{const r=t.length,d=q?r:v.length;return e(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...i}},t.map(t=>{const{photo:e,index:i,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:i})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const q=t=>v?{"aria-label":v,...t}:t;return p(ut,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,n,s,b,d,T,y),...ot(f,t)},link:q(ot(u,t)),button:q(ot(m,t)),wrapper:ot(g,t)},...t},r??i)}))}),void 0===b&&s]})});function mt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+it(e),0)}function gt(t,e,n,i,s,o,r){const l=t.slice(e,n),a=mt(l,i,s,o);return a>0?(a-r)**2*l.length:void 0}function ft(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function wt(t,e,n){const[[i],o]=s(ft,[n]),l=function(t){const[e,n]=a(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),c=r(void 0);return{containerRef:m(e=>{c.current?.disconnect(),c.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,l));n(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,l]),containerWidth:i}}var Tt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:h,...m}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...i});return p(pt,{layout:"rows",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,n,i,s,o,r){const l=Math.min(function(t,e,n,i){return ct(e/n/Math.min(...t.map(t=>it(t))))+(i||0)+2}(t,i,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,i,e,n,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const u=[];for(let m=c;0!==m;m=h[m])u.push(m);u.push(0),u.reverse();const p=[];for(let m=1;m<u.length;m+=1){const s=t.slice(u[m-1],u[m]).map((t,e)=>({photo:t,index:u[m-1]+e})),o=mt(s.map(({photo:t})=>t),i,e,n);p.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*it(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:p,horizontal:!0}}(t,l,a,r,c,d,h):void 0,[t,l,a,r,c,d,h]),...m})});function yt(t,e,n,i,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/it(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,n,i,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+it(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,l[e]=e<t.length?it(t[e]):s;return yt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,l)}const a=(c=function(t,e,n,i,s){return o=>{const r=[],l=1.5*s;let a=i/it(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=i/it(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/it(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,h=0,u=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const l=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,h,u),d,u));var c,d,h,u;for(let p=0;p<a.length-1;p+=1){const i=t.slice(a[p],a[p+1]);r[p]=e*(i.length-1)+2*n*i.length,l[p]=1/i.reduce((t,e)=>t+1/it(e),0)}return yt(a,t,e,n,i,r,l)}function vt(t,e,n,i,s){const{tracks:o,variables:r}=bt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?vt(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var kt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"columns",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function qt(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?qt(t,e,n,i,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,i,s)=>{const l=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[l]=r[l]+o/it(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/it(t)}))}))}}var xt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"masonry",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?qt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),Et='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',Nt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=Et,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=Et,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),n=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),n&&(n.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=O(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:Et,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=r(null);o(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
1
+ import{C as t,D as e,E as n,T as i,_ as s,b as o,f as r,g as l,h as a,i as c,m as d,n as h,p as u,t as p,v as m,w as g,y as f}from"./C3uDEVBt.js";import{C as w,D as T,L as y,N as b,O as v,S as k,a as q,i as x,l as E,m as N,n as _,u as S,v as I}from"./TOp1kwsu.js";import{n as C,r as L,t as M}from"./D9FVUgcz.js";import{t as R}from"./D6qTsmXL.js";import{t as B}from"./Bnib0POY.js";import{t as A}from"./DA91NKGO.js";import{n as V,t as z}from"./B8Ttd5mR.js";import{n as O}from"./BkIDQGIs.js";import{t as F}from"./Bki5T_lb.js";import{n as P,r as D,t as U}from"./D_4OXo87.js";import{n as H}from"./Cv9xb_-W.js";import{a as j,i as $,n as G,o as W,r as Q,s as K,t as Y}from"./CM4ZH83j.js";import{a as Z,n as J,o as X,r as tt,t as et}from"./DN1lg1Z82.js";function nt(t){return["react-photo-album",t].filter(Boolean).join("--")}function it({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,n,i=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=st.findIndex(t=>t<=e);return ot(t[Math.max(n,0)],e)}(n,e):s,i))}function at(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(n,t,[0,0,0,0]),componentsProps:ot(i,t)||{},render:ot(s,t)}}function ct(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function dt(t,e,n,i,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:l,sizes:a}}var ht=c(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(nt),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${nt(n)}`),"number"==typeof e?ct(e,5):e];var n})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},n);if(t)return t}return p(t||"div",{ref:c,...h})}),ut=c(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(n,3),height:ct(i,3)};let T;return T=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...T,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),pt=c(function({layout:t,sizes:n,model:i,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:T,padding:y,containerWidth:b,tracks:v,variables:k,horizontal:q}=i||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:T,padding:y,containerWidth:b,...k},classes:["",t],render:r,ref:w,children:[void 0!==T&&void 0!==y&&void 0!==b&&v?.map(({photos:t,variables:i},s)=>{const r=t.length,d=q?r:v.length;return e(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...i}},t.map(t=>{const{photo:e,index:i,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:i})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const q=t=>v?{"aria-label":v,...t}:t;return p(ut,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,n,s,b,d,T,y),...ot(f,t)},link:q(ot(u,t)),button:q(ot(m,t)),wrapper:ot(g,t)},...t},r??i)}))}),void 0===b&&s]})});function mt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+it(e),0)}function gt(t,e,n,i,s,o,r){const l=t.slice(e,n),a=mt(l,i,s,o);return a>0?(a-r)**2*l.length:void 0}function ft(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function wt(t,e,n){const[[i],o]=s(ft,[n]),l=function(t){const[e,n]=a(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),c=r(void 0);return{containerRef:m(e=>{c.current?.disconnect(),c.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,l));n(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,l]),containerWidth:i}}var Tt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:h,...m}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...i});return p(pt,{layout:"rows",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,n,i,s,o,r){const l=Math.min(function(t,e,n,i){return ct(e/n/Math.min(...t.map(t=>it(t))))+(i||0)+2}(t,i,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,i,e,n,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const u=[];for(let m=c;0!==m;m=h[m])u.push(m);u.push(0),u.reverse();const p=[];for(let m=1;m<u.length;m+=1){const s=t.slice(u[m-1],u[m]).map((t,e)=>({photo:t,index:u[m-1]+e})),o=mt(s.map(({photo:t})=>t),i,e,n);p.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*it(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:p,horizontal:!0}}(t,l,a,r,c,d,h):void 0,[t,l,a,r,c,d,h]),...m})});function yt(t,e,n,i,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/it(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,n,i,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+it(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,l[e]=e<t.length?it(t[e]):s;return yt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,l)}const a=(c=function(t,e,n,i,s){return o=>{const r=[],l=1.5*s;let a=i/it(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=i/it(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/it(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,h=0,u=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const l=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,h,u),d,u));var c,d,h,u;for(let p=0;p<a.length-1;p+=1){const i=t.slice(a[p],a[p+1]);r[p]=e*(i.length-1)+2*n*i.length,l[p]=1/i.reduce((t,e)=>t+1/it(e),0)}return yt(a,t,e,n,i,r,l)}function vt(t,e,n,i,s){const{tracks:o,variables:r}=bt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?vt(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var kt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"columns",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function qt(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?qt(t,e,n,i,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,i,s)=>{const l=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[l]=r[l]+o/it(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/it(t)}))}))}}var xt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"masonry",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?qt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),Et='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',Nt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=Et,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=Et,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),n=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),n&&(n.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=O(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:Et,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=r(null);o(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
2
2
  return p("div",{ref:i,className:"scrollbar-hide flex h-28 w-auto items-center justify-center overflow-x-auto bg-black/50",style:{scrollBehavior:"smooth",userSelect:"none",whiteSpace:"nowrap"},children:t.map((t,i)=>/* @__PURE__ */p("button",{className:"relative mx-0.5 inline-block [contain-intrinsic-size:6rem_5rem] [content-visibility:auto] lg:mx-1.5",onClick:()=>((t,e)=>{n(e)})(0,i),children:[
3
3
  /* @__PURE__ */p(z,{wrapperClassName:x("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===e&&"border-2 border-[#ff4800]"),src:t.thumbnailUrl,placeholderSrc:t.blurImageUrl,alt:t.caption}),t.type===N.VIDEO&&/* @__PURE__ */p("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:/* @__PURE__ */p("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})}),t.type===N.AD&&/* @__PURE__ */p("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},St=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6"\n />\n <path\n\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}getFilmstripContents(t){const e=t?.options?.dataSource?.items,n=e?.length??0;return this.filmstripContents&&this.filmstripContents.length===n||(this.filmstripContents=(e??[]).map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")}))),this.filmstripContents}updateFilmstrip(e){const n=this.getElementById("filmstrip-container");if(!n)return;t(/* @__PURE__ */p(_t,{contents:this.getFilmstripContents(e),selectedIndex:e.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),n);const i=this.getElementById("pswp-caption-container");i&&"7rem"!==i.style.bottom&&(i.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const e=this.getElementById("filmstrip-container"),n=this.getElementById("pswp-caption-container");n&&(n.style.bottom="0"),e&&t(null,e),this.filmstripContents=null}},It=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const n=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");n&&(n.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const n=document.createElement("style");n.setAttribute("data-pswp-slideshow",""),n.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(n)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const n=this.querySelector(".pswp__progress-bar");n&&(n.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},Lt={[String(E.NONE)]:function({className:t}){/* @__PURE__ */
4
4
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[E.LINK]:function({className:t}){/* @__PURE__ */
@@ -20,10 +20,10 @@ return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
20
20
  /* @__PURE__ */p("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
21
21
  /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Mt=({open:t,ad:e,onClose:n,captureAdClick:i})=>{const s=Boolean(e?.targetType&&e.targetType!==E.NONE),o=Lt[e?.targetType]??Lt[E.LINK],r=e?.imageUrl&&F(e.imageUrl,["http:","https:"])?e.imageUrl:void 0;/* @__PURE__ */
22
22
  return p(et,{open:Boolean(t&&e),onOpenChange:t=>!t&&n?.(),children:/* @__PURE__ */p(J,{className:"border-none p-0",children:[/* @__PURE__ */p(Z,{className:"sr-only",children:[/* @__PURE__ */p(X,{children:e?.title}),/* @__PURE__ */p(tt,{children:e?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[r&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:r,alt:e?.title||"Advertisement"}),
23
- /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(B,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(B,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(A,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??E.LINK,e?.targetUrl),n?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},Rt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:r}=G(),l=Boolean(n&&i),a=e.ctaBg||"#ff4800",c=e.ctaForeground||"#FFFFFF",d=Lt[e?.targetType??E.LINK];/* @__PURE__ */
23
+ /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(B,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(B,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(A,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??E.LINK,e?.targetUrl),n?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},Rt=({style:t,content:e,curateLink:n,onAdClick:i,hideControls:s})=>{const{captureAdImpression:o,captureAdEngagement:r,captureAdClick:l}=G(),a=Boolean(n&&i),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF",h=Lt[e?.targetType??E.LINK];/* @__PURE__ */
24
24
  return p("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
25
- /* @__PURE__ */p(V,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */p(D,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:l?i:void 0,pswpData:{id:e._id,type:N.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
26
- /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==E.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:e.title})}),e?.targetType!==E.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:a,color:c},onClick:()=>{l?i?.():r(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:c},children:/* @__PURE__ */p(d,{})}),e?.targetText]})]})]})},Bt=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const l=r(null),a=r(null),{trackGamAnalytics:c}=G(),d=`gam-slot-${i??"ev"}-${n}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=r({w:h,h:u});return o(()=>{let t=!1,n=null,o=null,r=null,h=null;return(async()=>{await j(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;Q(d);const{w:u,h:p}=m.current,g=[[u,p],...e.sizes],f=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;a.current=f,o=window.googletag.pubads(),i?f.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&f.setConfig({targeting:{qrati_category:e.categories}}),r=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},o.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_VIEWABLE})},o.addEventListener("impressionViewable",h);const T=l.current;T&&(n=Y({container:T,onClick:()=>{c({eventId:i,organizationId:s,type:w.GAM_CLICK})}}),$(),window.googletag.display(d))})})(),()=>{t=!0,n?.(),o&&"function"==typeof o.removeEventListener&&(r&&o.removeEventListener("slotRenderEnded",r),h&&o.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[i,e.adUnitPath,e.categories,s,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},At=(t,e)=>{if(!t||!e)return null;const n=e[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},Vt=n(null),zt=()=>{const t=f(Vt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Ot=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=a(!1),c="boolean"==typeof n,d=c?n:s,h=l(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=r(null);/* @__PURE__ */
25
+ /* @__PURE__ */p(V,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&o(e._id)},onClick:()=>r(e._id),children:/* @__PURE__ */p(D,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?i:void 0,pswpData:{id:e._id,type:N.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
26
+ /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!s&&(e.title||e.targetType!==E.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:e.title})}),e?.targetType!==E.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{a?i?.():l(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(h,{})}),e?.targetText]})]})]})},Bt=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const l=r(null),a=r(null),{trackGamAnalytics:c}=G(),d=`gam-slot-${i??"ev"}-${n}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=r({w:h,h:u});return o(()=>{let t=!1,n=null,o=null,r=null,h=null;return(async()=>{await j(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;Q(d);const{w:u,h:p}=m.current,g=[[u,p],...e.sizes],f=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;a.current=f,o=window.googletag.pubads(),i?f.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&f.setConfig({targeting:{qrati_category:e.categories}}),r=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},o.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_VIEWABLE})},o.addEventListener("impressionViewable",h);const T=l.current;T&&(n=Y({container:T,onClick:()=>{c({eventId:i,organizationId:s,type:w.GAM_CLICK})}}),$(),window.googletag.display(d))})})(),()=>{t=!0,n?.(),o&&"function"==typeof o.removeEventListener&&(r&&o.removeEventListener("slotRenderEnded",r),h&&o.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[i,e.adUnitPath,e.categories,s,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},At=(t,e)=>{if(!t||!e)return null;const n=e[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},Vt=n(null),zt=()=>{const t=f(Vt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Ot=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=a(!1),c="boolean"==typeof n,d=c?n:s,h=l(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=r(null);/* @__PURE__ */
27
27
  return p(Vt.Provider,{value:{isOpen:d,setIsOpen:t=>{c||o(t),i?.(t)},triggerId:u,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:x("relative inline-block",e),children:t})})},Ft=({children:t,asChild:e,className:n,onClick:s,...o})=>{const{isOpen:r,setIsOpen:l,triggerId:a,contentId:c,triggerRef:d}=zt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return i(e,{ref:t=>{d.current=t},id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{l(!r),e.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}/* @__PURE__ */
28
28
  return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},Pt=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...l})=>{const{isOpen:c,setIsOpen:u,contentId:m,triggerRef:g}=zt(),{organization:f,portalContainer:w}=_(),T=r(null),[y,b]=a(null);if(d(()=>{if(!c)return;const t=()=>{if(!g.current||!T.current)return;const t=g.current.getBoundingClientRect(),e=T.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),b({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,c,i,s,g]),o(()=>{if(!c)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=T.current&&(T.current.contains(n)||e.includes(T.current)),s=g.current&&(g.current.contains(n)||e.includes(g.current));i||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[c,u,g]),!c)return null;const v=/* @__PURE__ */p("div",{ref:T,id:m,role:"dialog","aria-modal":"false","data-state":c?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:y?.top??0,left:y?.left??0,zIndex:2010,...q(f)},...l,children:t});return"undefined"!=typeof document?h(v,w??document.body):v},Dt=({eventId:t,contentId:e,emojis:n=[],counts:i={},userReaction:s})=>{const{user:l,props:c,organization:d}=_(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=y(),{props:e,user:n}=_(),i=e?.organizationId,s=L({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await b.post(S.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":i,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[v.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),H.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)}});return{handleReactionClick:async(t,e,i)=>{if(!t||!e||!i)return!1;if(!n)return H.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:i}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=a(!1),[w,k]=a(null),q=r(null),E=Object.values(i).reduce((t,e)=>t+e,0);return o(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Ot,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Ft,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("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",w&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((t,e)=>(i[e]||0)-(i[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",w===(s||t)&&"scale-125"),children:s||t},`${e}-${t}-1`)),E>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:E||0})]})}),/* @__PURE__ */p(Pt,{side:"top",align:"end",children:[l?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
29
29
  /* @__PURE__ */p("a",{className:"text-info underline",href:h,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",