@qratilabs/qrati-connect 2.27.2 → 2.28.1

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 (59) hide show
  1. package/element/1UqTmSK2.js +3 -0
  2. package/element/{B0sEsGHn.js → 2PuRbItp.js} +7 -7
  3. package/element/{B5RetLW0.js → 3uWxzKri.js} +51 -49
  4. package/element/{DyemeRjE2.js → 5z04gCoQ2.js} +1 -1
  5. package/element/77CTD63x.js +3 -0
  6. package/element/{B9ImRAum.js → 7zeKIiiL.js} +1 -1
  7. package/element/{MU5QuIq0.js → B01ceTPt.js} +1 -1
  8. package/element/{C8meSsHD.js → B7YFs6p5.js} +1 -1
  9. package/element/BB90a5r62.js +93 -0
  10. package/element/{DSx5wvUb2.js → BHmNrbtm2.js} +1 -1
  11. package/element/{DlAI3J0X.js → BMcQNiLL.js} +1 -1
  12. package/element/{DZGp2V2-.js → BMibcq6T.js} +1 -1
  13. package/element/BUDCYszs.js +1 -0
  14. package/element/{DdYePHxG.js → BcAwTWQC.js} +1 -1
  15. package/element/BdQrGBTf.js +4 -0
  16. package/element/Bgw9OUdR.js +4 -0
  17. package/element/{BdkTKcG52.js → BhOaopIk2.js} +5 -5
  18. package/element/C6et9sp52.js +3 -0
  19. package/element/{C4DSwLWc.js → C6ph3KPL.js} +1 -1
  20. package/element/{DOOdI-Oh.js → C8ixb9k4.js} +1 -1
  21. package/element/{Bspyv2wJ2.js → CKwlnGWW2.js} +2 -2
  22. package/element/{p0Q_2x6C.js → CLV9vt29.js} +4 -5
  23. package/element/CZK4LCzr2.js +3 -0
  24. package/element/CfTxXwtG2.js +36 -0
  25. package/element/{Vk429P022.js → Cr4OmKxk2.js} +1 -1
  26. package/element/{DvisvxzJ.js → CrF08YS6.js} +1 -1
  27. package/element/CtApMHPf.js +11 -0
  28. package/element/{BKENYwOQ.js → CxJgMv2R.js} +1 -1
  29. package/element/{DGZEznLT2.js → D34k0bDj2.js} +1 -1
  30. package/element/DBlhTxUx2.js +16 -0
  31. package/element/{CeHBrY_i.js → DUEaNsCB.js} +1 -1
  32. package/element/DUWOb-5c.js +1 -0
  33. package/element/{DmIYOIw1.js → DZwpw1jG.js} +1 -1
  34. package/element/{BspExsK7.js → Da7cHmvl.js} +2 -2
  35. package/element/{QDuBhueG.js → DlNQukHq.js} +1 -1
  36. package/element/DmVgPRH5.js +14 -0
  37. package/element/{CBM5QMn8.js → DtcmI8yd2.js} +1 -1
  38. package/element/{DVFC5Z2L2.js → DtqQWU6q2.js} +31 -31
  39. package/element/{DLF5ysgi.js → JFF45CMp.js} +1 -1
  40. package/element/{CUBxHQ8u.js → KdgQ7jUn.js} +1 -1
  41. package/element/{C6YE4WUG2.js → cePYhOkN2.js} +4 -4
  42. package/element/{D_FNRN5A2.js → hiapcVVA2.js} +1 -1
  43. package/element/{CKQOToSD.js → tJ2MS5HS.js} +3 -3
  44. package/element/{1eQ9Ef0M2.js → vA5CQmOb2.js} +2 -2
  45. package/element/web.es.js +39 -39
  46. package/package.json +1 -1
  47. package/element/BLeZg2Bz.js +0 -1
  48. package/element/BmsDSHUi.js +0 -4
  49. package/element/BqiJLitq2.js +0 -3
  50. package/element/C6MqLLDX.js +0 -3
  51. package/element/CfTdZB8y.js +0 -4
  52. package/element/CgxypkdG.js +0 -3
  53. package/element/Cl0CwL5p.js +0 -9
  54. package/element/DRPgs6nu2.js +0 -16
  55. package/element/DWqIpaZ02.js +0 -2
  56. package/element/SgRzjPnr.js +0 -14
  57. package/element/aXvUP7X72.js +0 -93
  58. package/element/qBKIp1ZW2.js +0 -36
  59. /package/element/{DPg_DKOi2.js → DPg_DKOi.js} +0 -0
@@ -1 +1 @@
1
- import{C as t,D as e,E as s,O as i,S as r,T as u,_ as n,b as a,f as o,j as h,v as c,w as l,x as f,y}from"./CKQOToSD.js";import{t as d}from"./CUBxHQ8u.js";var m=class extends a{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Map}#t;build(e,s,i){const r=s.queryKey,u=s.queryHash??t(r,s);let n=this.get(u);return n||(n=new o({client:e,queryKey:r,queryHash:u,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){c.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>u(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>u(t,e)):e}notify(t){c.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){c.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){c.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},p=class extends a{constructor(t={}){super(),this.config=t,this.#e=/* @__PURE__ */new Set,this.#s=/* @__PURE__ */new Map,this.#i=0}#e;#s;#i;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#i,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);const e=q(t);if("string"==typeof e){const s=this.#s.get(e);s?s.push(t):this.#s.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=q(t);if("string"==typeof e){const s=this.#s.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#s.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=q(t);if("string"==typeof e){const s=this.#s.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=q(t);return"string"==typeof e?(this.#s.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){c.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#s.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){c.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return c.batch(()=>Promise.all(t.map(t=>t.continue().catch(s))))}};function q(t){return t.options.scope?.id}var g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new m,this.#u=t.mutationCache||new p,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=n.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#r.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(i(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),r=this.#r.get(i.queryHash)?.state.data,u=f(e,r);if(void 0!==u)return this.#r.build(this,i).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return c.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const e=this.#r;c.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#r;return c.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const i={revert:!0,...e},r=c.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(s).catch(s)}invalidateQueries(t,e={}){return c.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},r=c.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(s)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(s)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#r.build(this,e);return s.isStaleByTime(i(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(s).catch(s)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(s).catch(s)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return n.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(r(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const s=[...this.#a.values()],i={};return s.forEach(s=>{e(t,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(t,e){this.#o.set(r(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const s=[...this.#o.values()],i={};return s.forEach(s=>{e(t,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===h&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
1
+ import{C as t,D as e,E as s,O as i,S as r,T as u,_ as n,b as a,f as o,j as h,v as c,w as l,x as f,y}from"./tJ2MS5HS.js";import{t as d}from"./KdgQ7jUn.js";var m=class extends a{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Map}#t;build(e,s,i){const r=s.queryKey,u=s.queryHash??t(r,s);let n=this.get(u);return n||(n=new o({client:e,queryKey:r,queryHash:u,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){c.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>u(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>u(t,e)):e}notify(t){c.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){c.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){c.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},p=class extends a{constructor(t={}){super(),this.config=t,this.#e=/* @__PURE__ */new Set,this.#s=/* @__PURE__ */new Map,this.#i=0}#e;#s;#i;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#i,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);const e=q(t);if("string"==typeof e){const s=this.#s.get(e);s?s.push(t):this.#s.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=q(t);if("string"==typeof e){const s=this.#s.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#s.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=q(t);if("string"==typeof e){const s=this.#s.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=q(t);return"string"==typeof e?(this.#s.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){c.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#s.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){c.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return c.batch(()=>Promise.all(t.map(t=>t.continue().catch(s))))}};function q(t){return t.options.scope?.id}var g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new m,this.#u=t.mutationCache||new p,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=n.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#r.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(i(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),r=this.#r.get(i.queryHash)?.state.data,u=f(e,r);if(void 0!==u)return this.#r.build(this,i).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return c.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const e=this.#r;c.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#r;return c.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const i={revert:!0,...e},r=c.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(s).catch(s)}invalidateQueries(t,e={}){return c.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},r=c.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(s)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(s)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#r.build(this,e);return s.isStaleByTime(i(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(s).catch(s)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(s).catch(s)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return n.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(r(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const s=[...this.#a.values()],i={};return s.forEach(s=>{e(t,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(t,e){this.#o.set(r(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const s=[...this.#o.values()],i={};return s.forEach(s=>{e(t,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===h&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
@@ -0,0 +1 @@
1
+ var E={PUBLIC_EVENTS:"/",FOLDER_EVENTS:E=>`/${E}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:E=>`/event/${E}`,UPLOAD:E=>`/event/${E}/upload`,CURATE:E=>`/event/${E}/curate`,LEADERBOARD:E=>`/event/${E}/leaderboard`,MY_UPLOADS:"/my-uploads"},e={ORGANIZATION_SETTINGS:E=>`https://qrati.com/org/${E}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:E=>`https://qrati.com/org/${E}/settings/integration`,ORGANIZATION_DASHBOARD:E=>`https://qrati.com/org/${E}/dashboard`,ORGANIZATION_ADMINS:E=>`https://qrati.com/org/${E}/admins`,EVENT_SETTINGS_BASIC_DETAILS:E=>`https://qrati.com/event/${E}/settings`,EVENT_REVIEW_CONTENTS:E=>`https://qrati.com/event/${E}/review-contents`,EVENT_DEEP_SEARCH:E=>`https://qrati.com/event/${E}/deep-search`,EVENT_GENERATE_ARTICLE:E=>`https://qrati.com/event/${E}/generate-article`,EVENT_ACCESS_REQUESTS:E=>`https://qrati.com/event/${E}/access-requests`,EVENT_SHOT_INSPECTOR:E=>`https://qrati.com/event/${E}/shot-inspector`,EVENT_CURATION_DETAILS:E=>`https://qrati.com/event/${E}/curation-details`},t={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},a="https://qrati.com/api/connect",T={INITIALIZE_SESSION:`${a}/session/initialize`,REGISTER:`${a}/auth/register`,LOGIN:`${a}/auth/login`,LOGOUT:`${a}/auth/logout`,UPDATE_SESSION:`${a}/session/update`,ACCEPT_TERMS:`${a}/auth/accept-terms`,PUBLIC_EVENTS:`${a}/event/public-events`,SEARCH_EVENTS:`${a}/event/search`,FOLDER_DETAILS:`${a}/folder/details`,NESTED_FOLDERS:`${a}/folder/nested-folders`,GET_EVENT_POINTS:`${a}/event/points`,ELIGIBLE_TO_CURATE:`${a}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${a}/content/for-curation`,CURATE_CONTENT:`${a}/content/curate`,GET_LEADERBOARD:`${a}/event/leaderboard`,GET_UPLOAD_COUNT:`${a}/event/upload-count`,UPLOAD_CREATE:`${a}/content/upload/create`,UPLOAD_COMPLETE:`${a}/content/upload/complete`,UPLOAD_FAIL:`${a}/content/upload/fail`,UPLOAD_ABORT:`${a}/content/upload/abort`,UPDATE_REACTION:`${a}/content/update-reaction`,EVENT_DATA:`${a}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${a}/event/update-layout`,GET_EVENT_STATISTICS:`${a}/event/statistics`,GET_CONTENTS:`${a}/content/for-gallery`,SEARCH_CONTENTS:`${a}/content/search`,GET_CONTENTS_COUNT:`${a}/content/count`,TRACK_EVENT:`${a}/event/track`,SEND_PASSWORD_RESET_CODE:`${a}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${a}/auth/verify-password-reset-code`,RESET_PASSWORD:`${a}/auth/reset-password`,REPORT_ERROR:`${a}/log-error`,GET_POST_PROCESSING_SETTINGS:`${a}/event/post-processing-settings`,MY_UPLOADS:`${a}/content/my-uploads`,DELETE_CONTENT:`${a}/content/delete`},s={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},A={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},O={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},o={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},S={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},N=26214400,n=262144e3,_={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},r={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},I={CONTEST:"CONTEST",REACTION:"REACTION"},R={GRID:"grid",SINGLE:"single"},i={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},c={[i.POPULAR]:{label:"Popular",sortField:"score"},[i.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[i.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},C="map-view-state",D=i.UPLOAD_TIME,l={ASC:"asc",DESC:"desc"},P={[l.ASC]:{label:"Ascending",sortOrder:""},[l.DESC]:{label:"Descending",sortOrder:"-"}},d=l.DESC,L={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},$={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},p={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},u={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:E=>`in-review-count-${E}`,CONTENTS_BY_EVENT:E=>`contents-by-event-${E}`,USER_UPLOADS:"user-uploads"};export{L as C,P as E,u as S,l as T,O as _,i as a,n as b,A as c,d,I as f,o as g,e as h,T as i,R as l,t as m,p as n,c as o,_ as p,$ as r,S as s,s as t,D as u,C as v,r as w,E as x,N as y};
@@ -1 +1 @@
1
- import{t}from"./DrrpB4Om.js";import{i as e,o as r}from"./CKQOToSD.js";var l=t=>"boolean"==typeof t?`${t}`:0===t?"0":t,o=r,a=(t,e)=>r=>{var a;if(null==(null==e?void 0:e.variants))return o(t,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:i}=e,s=Object.keys(n).map(t=>{const e=null==r?void 0:r[t],o=null==i?void 0:i[t];if(null===e)return null;const a=l(e)||l(o);return n[t][a]}),d=r&&Object.entries(r).reduce((t,e)=>{let[r,l]=e;return void 0===l||(t[r]=l),t},{});return o(t,s,null==e||null===(a=e.compoundVariants)||void 0===a?void 0:a.reduce((t,e)=>{let{class:r,className:l,...o}=e;return Object.entries(o).every(t=>{let[e,r]=t;return Array.isArray(r)?r.includes({...i,...d}[e]):{...i,...d}[e]===r})?[...t,r,l]:t},[]),null==r?void 0:r.class,null==r?void 0:r.className)},n={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",p:"p",blockquote:"blockquote",body1:"p",body2:"p",body3:"p",caption:"span",overline:"span",lead:"p"},i=a("antialiased",{variants:{variant:{h1:"scroll-m-20 text-4xl font-bold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-bold tracking-tight lg:text-4xl",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold",h5:"scroll-m-20 text-lg font-semibold",h6:"scroll-m-20 text-base font-semibold",body1:"text-base leading-relaxed font-medium",body2:"text-sm leading-relaxed",body3:"text-sm leading-relaxed sm:text-base",p:"text-base leading-7",lead:"text-muted-foreground text-xl leading-relaxed",blockquote:"border-primary/30 text-muted-foreground border-l-4 pl-4 text-base italic",caption:"text-muted-foreground text-xs",overline:"text-muted-foreground text-xs font-medium tracking-widest uppercase"},color:{foreground:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",info:"text-info",warning:"text-warning",success:"text-success",error:"text-destructive",inherit:"text-inherit",secondary:"text-muted-foreground",white:"text-white",black:"text-black",a11y:"text-primary-foreground",light:"text-text-primary-light"},align:{left:"text-left",right:"text-right",center:"text-center",justify:"text-justify"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"body1",color:"foreground",align:"left"}}),s=({variant:r="body1",color:l,align:o,weight:a,transform:s,lines:d,shadow:u,noWrap:x,className:c,immutable:m,...g})=>/* @__PURE__ */t(n[r],{className:e(i({variant:r,color:l,align:o,weight:a}),s,d&&d>0?`line-clamp-${d}`:void 0,u&&"drop-shadow-[0_1px_2px_rgba(0,0,0,0.5)]",x&&"truncate",c),...g,children:g.children});export{i as n,a as r,s as t};
1
+ import{t}from"./DrrpB4Om.js";import{i as e,o as r}from"./tJ2MS5HS.js";var l=t=>"boolean"==typeof t?`${t}`:0===t?"0":t,o=r,a=(t,e)=>r=>{var a;if(null==(null==e?void 0:e.variants))return o(t,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:i}=e,s=Object.keys(n).map(t=>{const e=null==r?void 0:r[t],o=null==i?void 0:i[t];if(null===e)return null;const a=l(e)||l(o);return n[t][a]}),d=r&&Object.entries(r).reduce((t,e)=>{let[r,l]=e;return void 0===l||(t[r]=l),t},{});return o(t,s,null==e||null===(a=e.compoundVariants)||void 0===a?void 0:a.reduce((t,e)=>{let{class:r,className:l,...o}=e;return Object.entries(o).every(t=>{let[e,r]=t;return Array.isArray(r)?r.includes({...i,...d}[e]):{...i,...d}[e]===r})?[...t,r,l]:t},[]),null==r?void 0:r.class,null==r?void 0:r.className)},n={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",p:"p",blockquote:"blockquote",body1:"p",body2:"p",body3:"p",caption:"span",overline:"span",lead:"p"},i=a("antialiased",{variants:{variant:{h1:"scroll-m-20 text-4xl font-bold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-bold tracking-tight lg:text-4xl",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold",h5:"scroll-m-20 text-lg font-semibold",h6:"scroll-m-20 text-base font-semibold",body1:"text-base leading-relaxed font-medium",body2:"text-sm leading-relaxed",body3:"text-sm leading-relaxed sm:text-base",p:"text-base leading-7",lead:"text-muted-foreground text-xl leading-relaxed",blockquote:"border-primary/30 text-muted-foreground border-l-4 pl-4 text-base italic",caption:"text-muted-foreground text-xs",overline:"text-muted-foreground text-xs font-medium tracking-widest uppercase"},color:{foreground:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",info:"text-info",warning:"text-warning",success:"text-success",error:"text-destructive",inherit:"text-inherit",secondary:"text-muted-foreground",white:"text-white",black:"text-black",a11y:"text-primary-foreground",light:"text-text-primary-light"},align:{left:"text-left",right:"text-right",center:"text-center",justify:"text-justify"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"body1",color:"foreground",align:"left"}}),s=({variant:r="body1",color:l,align:o,weight:a,transform:s,lines:d,shadow:u,noWrap:x,className:c,immutable:m,...g})=>/* @__PURE__ */t(n[r],{className:e(i({variant:r,color:l,align:o,weight:a}),s,d&&d>0?`line-clamp-${d}`:void 0,u&&"drop-shadow-[0_1px_2px_rgba(0,0,0,0.5)]",x&&"truncate",c),...g,children:g.children});export{i as n,a as r,s as t};
@@ -1,8 +1,8 @@
1
- import{_ as r,t as e}from"./DrrpB4Om.js";import{i as a,n as s}from"./CKQOToSD.js";import{x as t}from"./BLeZg2Bz.js";import{c as i,i as o,l as m,n as d}from"./DdYePHxG.js";import{t as l}from"./BKENYwOQ.js";import{t as n}from"./D35mTuTT.js";import{t as c}from"./QDuBhueG.js";var p=()=>{const p=i(),b=m(),{initializing:h,organization:f,user:x}=s(),u=p.pathname.endsWith("/login")||p.pathname.endsWith("/register");return r(()=>{if(x){const r=p.state?.referrer;b(r||"/",{replace:!0})}},[x]),h?/* @__PURE__ */e("div",{className:"mx-auto max-w-lg space-y-8 py-8",children:[
1
+ import{_ as r,t as e}from"./DrrpB4Om.js";import{i as a,n as s}from"./tJ2MS5HS.js";import{x as t}from"./DUWOb-5c.js";import{c as i,i as o,l as m,n as d}from"./BcAwTWQC.js";import{t as l}from"./CxJgMv2R.js";import{t as n}from"./D35mTuTT.js";import{t as c}from"./DlNQukHq.js";var p=()=>{const p=i(),b=m(),{initializing:f,organization:h,user:x}=s(),u=p.pathname.endsWith("/login")||p.pathname.endsWith("/register");return r(()=>{if(x){const r=p.state?.referrer;b(r||"/",{replace:!0})}},[x]),f?/* @__PURE__ */e("div",{className:"mx-auto max-w-lg space-y-8 py-8",children:[
2
2
  /* @__PURE__ */e(l,{className:"h-8"}),
3
3
  /* @__PURE__ */e(l,{className:"h-8"}),
4
4
  /* @__PURE__ */e(l,{className:"h-8"}),
5
- /* @__PURE__ */e(l,{className:"h-8"})]}):!f||f?.customAuth?null:/* @__PURE__ */e("div",{className:"bg-background relative mx-auto min-h-[80vh] max-w-md py-24",children:[u&&/* @__PURE__ */e(c,{}),/* @__PURE__ */e("div",{children:[
5
+ /* @__PURE__ */e(l,{className:"h-8"})]}):!h||h?.customAuth?null:/* @__PURE__ */e("div",{className:"bg-background relative mx-auto min-h-[80vh] max-w-md py-24",children:[u&&/* @__PURE__ */e(c,{}),/* @__PURE__ */e("div",{children:[
6
6
  /* @__PURE__ */e("div",{className:"my-8 flex w-full justify-around",children:[/* @__PURE__ */e(d,{to:t.LOGIN,state:p.state||void 0,className:({isActive:r})=>a(r?"border-primary text-primary font-semibold":"border-border","flex-1 border-2 border-x-0 border-t-0 pb-2 text-center"),children:"Login"}),/* @__PURE__ */e(d,{to:t.REGISTER,state:p.state||void 0,className:({isActive:r})=>a(r?"border-primary text-primary font-semibold":"border-border","flex-1 border-2 border-x-0 border-t-0 pb-2 text-center"),children:"Register"})]}),
7
7
  /* @__PURE__ */e(o,{}),
8
8
  /* @__PURE__ */e("div",{className:"mt-12",children:/* @__PURE__ */e(n,{})})]})]})};export{p as default};
@@ -1,3 +1,3 @@
1
- import{t}from"./DrrpB4Om.js";import{x as e}from"./BLeZg2Bz.js";import{l as s}from"./DdYePHxG.js";function o({className:e}){/* @__PURE__ */
1
+ import{t}from"./DrrpB4Om.js";import{x as e}from"./DUWOb-5c.js";import{l as s}from"./BcAwTWQC.js";function o({className:e}){/* @__PURE__ */
2
2
  return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m7.825 13l4.9 4.9q.3.3.288.7t-.313.7q-.3.275-.7.288t-.7-.288l-6.6-6.6q-.15-.15-.213-.325T4.426 12t.063-.375t.212-.325l6.6-6.6q.275-.275.688-.275t.712.275q.3.3.3.713t-.3.712L7.825 11H19q.425 0 .713.288T20 12t-.288.713T19 13z"})})}var r=()=>{const r=s();/* @__PURE__ */
3
3
  return t("button",{type:"button",onClick:()=>{window.history.length>1?r(-1):r(e.PUBLIC_EVENTS,{state:{internalNavigation:!0}})},className:"text-foreground absolute top-0 left-0",children:/* @__PURE__ */t(o,{className:"size-6"})})};export{r as t};
@@ -0,0 +1,14 @@
1
+ import{_ as e,f as t,h as a,o as n,p as r,t as o,v as s,w as i}from"./DrrpB4Om.js";import{i as l,n as c,u as d}from"./tJ2MS5HS.js";import{n as m,r as u,t as p}from"./B7YFs6p5.js";import{t as h}from"./JFF45CMp.js";import{t as g}from"./DmpmrPE5.js";import{S as f,i as v,s as x}from"./DUWOb-5c.js";import{c as y,l as w}from"./BcAwTWQC.js";import{t as N}from"./DZwpw1jG.js";import{t as b}from"./DPg_DKOi.js";import{t as T}from"./B01ceTPt.js";import{t as D}from"./CxJgMv2R.js";import{t as P}from"./CrF08YS6.js";import{t as j}from"./DlNQukHq.js";import{t as C}from"./5z04gCoQ2.js";import{n as I,o as S,r as E,t as A}from"./Cr4OmKxk2.js";import{t as z}from"./N4HKgEC52.js";import{i as U,n as q,r as O,t as _}from"./hiapcVVA2.js";var k=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=d(),{user:t,props:a}=c(),n=a?.organizationId,r=t?.token;return h({mutationKey:["delete-upload",r??null],mutationFn:async({contentId:e})=>{const t=await g.post(v.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:[f.USER_UPLOADS],exact:!1});const a=e.getQueriesData({queryKey:[f.USER_UPLOADS],exact:!1});return e.setQueriesData({queryKey:[f.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)})}})}(),r=e?.rateCount??0,s=r<=0,i=s?null:`This photo has ${r} rating${r>1?"s":""}. Photos with at least 1 rating cannot be deleted.`;/* @__PURE__ */
2
+ return o(O,{open:Boolean(e),onOpenChange:e=>{e||a()},title:"Delete content?",description:i??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:s?"Delete":"Got it",confirmColor:s?"error":"primary",onCancel:a,onConfirm:s?()=>{if(!e||!s)return;const a=e.eventId,r=e._id;t(),n.mutate({contentId:r,eventId:a})}:a})};function M({className:e}){/* @__PURE__ */
3
+ return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */o("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var R={[x.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */o(_,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[x.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */o(U,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[x.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */o(z,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},$=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`},L=n(({content:e,onDelete:t,onStatusClick:a})=>{const n=e.status,r=R[n];/* @__PURE__ */
4
+ return o("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */o("div",{className:"relative size-full",children:[
5
+ /* @__PURE__ */o(P,{url:e.url||"",alt:e.caption||"",thumbnailUrl:e.thumbnailUrl||void 0,blurhash:e.blurhash||void 0,pswpData:{id:e._id,type:e.type,hash:e._id,width:e.dimension?.width,height:e.dimension?.height,thumbnailUrl:e.thumbnailUrl||void 0,caption:e.caption||""}}),
6
+ /* @__PURE__ */o("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-between bg-gradient-to-t from-black/50 to-transparent pl-3",children:[/* @__PURE__ */o(N,{variant:"caption",className:"text-xs text-white opacity-90 sm:text-sm",children:$(e.createdAt)}),/* @__PURE__ */o(q,{icon:/* @__PURE__ */o(M,{className:"size-5"}),color:"error",size:"sm",className:"pointer-events-auto","aria-label":"Delete upload",tooltip:"Delete",onClick:a=>{a.stopPropagation(),a.preventDefault(),t(e._id)}})]}),
7
+ /* @__PURE__ */o("button",{type:"button","aria-label":`Status: ${r?.title||"Unknown"}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(n)},className:l("pointer-events-auto absolute top-1 right-1 cursor-pointer rounded-full p-1 transition-opacity hover:opacity-80",r?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */o("span",{className:l("block size-5",r?.color||"text-gray-500"),children:r?.icon||null})})]})})}),F=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),V=e=>{if(0===e.length)return"";if(1===e.length)return F(e[0].createdAt);const{minTime:t,maxTime:a}=e.reduce((e,t)=>{const a=new Date(t.createdAt).getTime();return{minTime:Math.min(e.minTime,a),maxTime:Math.max(e.maxTime,a)}},{minTime:1/0,maxTime:-1/0}),n=F(new Date(t).toISOString()),r=F(new Date(a).toISOString());return n===r?n:`${n} - ${r}`},B=()=>{const n=w(),d=y(),{user:h,loadingUser:x,portalContainer:P}=c(),z=t(null),U=t(!1),q=t(null),O=t(null),[_,M]=a(null),[$,F]=a(null),{contents:B,loading:K,hasNextPage:Y,fetchNextPage:Q,isFetchingNextPage:G}=function({sort:e="-createdAt",limit:t=20}={}){const{user:a,loadingUser:n,props:o}=c(),s=o?.organizationId,i=a?.token,l=a?._id??a?.uid??null,{data:d,isLoading:h,isError:x,error:y,isFetchingNextPage:w,hasNextPage:N,fetchNextPage:b,refetch:T}=u({queryKey:[f.USER_UPLOADS,s??"",l,t,e],queryFn:async({pageParam:a=1})=>await g.get(v.MY_UPLOADS,{searchParams:{page:a,limit:t,sort:e},headers:{"x-org-id":s,...i?{Authorization:`Bearer ${i}`}:{}}}).json(),initialPageParam:1,getPreviousPageParam:m,getNextPageParam:p,maxPages:25,staleTime:12e4,gcTime:3e5,enabled:!n&&!!a});return{contents:r(()=>d?.pages?.flatMap(e=>e?.data??[])??[],[d]),loading:h,isError:x,error:y,isFetchingNextPage:w,hasNextPage:!!N,fetchNextPage:b,refetch:T,totalCount:d?.pages?.[0]?.meta?.totalCount??0}}({sort:"-createdAt",limit:20});e(()=>{x||h||n("/auth/login",{state:{referrer:d.pathname},replace:!0})},[x,h]);const Z=B.length>0,H=!K&&!Z,J=r(()=>{if(!B.length)return[];const e={};return B.forEach(t=>{const a=t.eventId||"unknown";e[a]||(e[a]={eventId:a,eventName:t.event?.name||"Event",uploads:[]}),e[a].uploads.push(t)}),Object.values(e).sort((e,t)=>{const a=new Date(e.uploads[0]?.createdAt||0).getTime();return new Date(t.uploads[0]?.createdAt||0).getTime()-a})},[B]);e(()=>()=>{z.current?.destroy?.(),z.current=null},[P]);const W=s(async e=>{if(z.current||U.current)return;const t=q.current,a=e.target.closest("a");if(!t||!a||!t.contains(a))return;e.preventDefault(),U.current=!0;const n=Array.from(t.querySelectorAll("a")).indexOf(a);try{const[{default:e},{default:a},{default:r},{loadPhotoSwipe:o}]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./BHmNrbtm2.js"),import("./web.es.js").then(e=>e.t)]),s=new e({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:o,appendToEl:P??document.body});z.current=s,new a(s),new r(s),s.init(),n>=0&&z.current?.loadAndOpen?.(n)}finally{U.current=!1}},[P]);e(()=>{const e=O.current;if(!e||!Y)return;const t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&Y&&!G&&Q()},{rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[Y,G,Q]);const X=r(()=>B.find(e=>e._id===_)??null,[_,B]),ee=$?R[$]:null;/* @__PURE__ */
8
+ return o("div",{className:"bg-background mx-auto min-h-screen max-w-5xl px-3 pt-16 pb-12 lg:px-0",children:[
9
+ /* @__PURE__ */o("div",{className:"relative mb-6 flex items-center justify-center",children:[/* @__PURE__ */o(j,{}),/* @__PURE__ */o(N,{variant:"h4",align:"center",children:"My Uploads"})]}),
10
+ /* @__PURE__ */o("section",{className:"space-y-3",children:K?/* @__PURE__ */o("div",{className:"space-y-8 py-4",children:Array.from({length:2}).map((e,t)=>/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */o(D,{className:"h-6 w-48"}),/* @__PURE__ */o(D,{className:"h-5 w-24"})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */o(D,{className:"h-52 w-full lg:h-64"},t))})]},t))}):H?/* @__PURE__ */o(T,{className:"py-12",title:"No uploads yet",description:"Photos and videos you upload to events will appear here."}):/* @__PURE__ */o(i,{children:[
11
+ /* @__PURE__ */o("div",{ref:q,onClickCapture:W,className:"space-y-8 py-4",children:J.map(e=>/* @__PURE__ */o("div",{className:"space-y-4",children:[/* @__PURE__ */o("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */o(N,{variant:"h5",color:"muted",children:e.eventName}),/* @__PURE__ */o("span",{className:"text-muted-foreground text-sm font-light uppercase sm:text-base",children:V(e.uploads)})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-1 sm:grid-cols-3 sm:gap-3 lg:grid-cols-4",children:e.uploads.map(e=>/* @__PURE__ */o("div",{className:"h-52 lg:h-64",children:/* @__PURE__ */o(L,{content:e,onDelete:M,onStatusClick:F})},e._id))})]},e.eventId))}),
12
+ /* @__PURE__ */o("div",{ref:O,className:"h-px w-full"}),G&&/* @__PURE__ */o("div",{className:"my-6 w-full",children:/* @__PURE__ */o(b,{})})]})}),
13
+ /* @__PURE__ */o(k,{content:X,onClose:()=>M(null),onDeleted:()=>M(null)}),
14
+ /* @__PURE__ */o(A,{open:Boolean($),onOpenChange:e=>!e&&F(null),children:/* @__PURE__ */o(I,{className:"w-full max-w-lg",children:[/* @__PURE__ */o("div",{className:"flex flex-col gap-4 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */o("div",{className:l("mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",ee?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */o("span",{className:l("size-6",ee?.color||"text-gray-500"),children:ee?.icon||null})}),/* @__PURE__ */o("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[/* @__PURE__ */o(S,{children:ee?.title||"Unknown Status"}),/* @__PURE__ */o(E,{children:ee?.description||"Status information unavailable."})]})]}),/* @__PURE__ */o("div",{className:"flex justify-end p-4",children:/* @__PURE__ */o(C,{variant:"outlined",color:"foreground",onClick:()=>F(null),children:"Got it"})})]})})]})};export{B as default};
@@ -1 +1 @@
1
- import{n as r,s as e}from"./CKQOToSD.js";import{t as a}from"./DmpmrPE5.js";import{i as t}from"./BLeZg2Bz.js";var o=({eventSlug:o})=>{const{props:s}=r(),n=s?.organizationId,{isLoading:i,data:d,isError:g,error:m}=e({queryKey:[`event-data-${n??""}-${o??""}`],queryFn:async()=>{try{const r=await a.get(t.EVENT_DATA,{searchParams:o?{eventSlug:o}:void 0,headers:{"x-org-id":n}}).json();if(r.error)throw new Error(r.error);return r.data}catch(r){throw new Error(r instanceof Error?r.message:String(r)||"Failed to fetch event data")}},enabled:!!n&&!!o,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:"always"});return{loading:i,event:d?.event,ads:d?.ads,gamConfig:d?.gamConfig,parameters:d?.parameters,isError:g,error:m}};export{o as t};
1
+ import{n as r,s as e}from"./tJ2MS5HS.js";import{t as a}from"./DmpmrPE5.js";import{i as t}from"./DUWOb-5c.js";var o=({eventSlug:o})=>{const{props:s}=r(),n=s?.organizationId,{isLoading:i,data:d,isError:g,error:m}=e({queryKey:[`event-data-${n??""}-${o??""}`],queryFn:async()=>{try{const r=await a.get(t.EVENT_DATA,{searchParams:o?{eventSlug:o}:void 0,headers:{"x-org-id":n}}).json();if(r.error)throw new Error(r.error);return r.data}catch(r){throw new Error(r instanceof Error?r.message:String(r)||"Failed to fetch event data")}},enabled:!!n&&!!o,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:"always"});return{loading:i,event:d?.event,ads:d?.ads,gamConfig:d?.gamConfig,parameters:d?.parameters,isError:g,error:m}};export{o as t};
@@ -1,39 +1,39 @@
1
- import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./DrrpB4Om.js";import{i as c,n as d,s as u,u as m}from"./CKQOToSD.js";import{n as g,r as h,t as f}from"./C8meSsHD.js";import{t as p}from"./DmpmrPE5.js";import{E as w,S as v,T,_ as y,a as N,c as q,d as x,f as b,g as E,h as C,i as S,l as I,m as z,o as L,p as k,s as M,u as A,x as _}from"./BLeZg2Bz.js";import{t as P,u as R}from"./DdYePHxG.js";import{n as O,t as V}from"./DmIYOIw1.js";import{a as F,c as j,i as B,l as H,n as U,o as G,r as $,s as W,t as D}from"./Cl0CwL5p.js";import{t as K}from"./MU5QuIq0.js";import{t as Q}from"./BKENYwOQ.js";import{t as Z}from"./CAETItHr.js";import{r as Y}from"./DGGc10Cy.js";import{t as J}from"./CBM5QMn8.js";import{n as X,t as ee}from"./DyemeRjE2.js";import{t as te}from"./DPg_DKOi2.js";import{t as ne}from"./CZ9iaxjO2.js";import{a as re,i as ae,n as ie,o as se,r as oe,s as le,t as ce}from"./BqiJLitq2.js";import{c as de,i as ue,n as me,t as ge}from"./CBLQRRGX2.js";import{n as he,t as fe}from"./DWqIpaZ02.js";function pe(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function we({className:e}){/* @__PURE__ */
2
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function ve({className:e}){/* @__PURE__ */
3
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Te=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[d,u]=r(!1),m=n(null),g=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!m.current||!t)return void u(!1);const e=m.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(g.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),u(c>o*a+1)},r=()=>{null!==g.current&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==g.current&&window.cancelAnimationFrame(g.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:c("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:m,className:c(O({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,d&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),d&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},ye=()=>{const{t:e}=Y(),{eventSlug:t}=R(),{event:n}=J({eventSlug:t}),{props:r,organization:a}=d(),{curateLabel:i,leaderboardLabel:o}=r??{},{eventViews:l,contentCount:c,curationCount:m}=(({event:e})=>{const{props:t,organization:n}=d(),r=t?.organizationId,{isLoading:a,data:i}=u({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await p.get(S.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n});/* @__PURE__ */
4
- return s("div",{className:"w-full space-y-3",children:[
5
- /* @__PURE__ */s("div",{className:"space-y-2 md:-mt-8",children:[/* @__PURE__ */s(V,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(Te,{description:n?.description})]}),a?.integrationSettings?.showEventStats&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s("div",{className:"flex items-center gap-6",children:[
6
- /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(ve,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:pe(l??0)})]}),
7
- /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(we,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:pe(c??0)})]}),n?.engagementStyle===b.CONTEST&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(le,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:m})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&n?.engagementStyle===b.CONTEST||n?.engagementStyle===b.REACTION&&n?.showLeaderboard||n?.engagementStyle===b.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(P,{to:_.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(ee,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&n?.engagementStyle===b.CONTEST&&/* @__PURE__ */s(P,{to:_.CURATE(n?.slug??""),children:/* @__PURE__ */s(ee,{icon:/* @__PURE__ */s(le,{className:"size-5"}),children:i||e("content.curate","Curate")})}),n?.showLeaderboard&&/* @__PURE__ */s(P,{to:_.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(ee,{icon:/* @__PURE__ */s(ne,{className:"size-5"}),children:o||e("content.leaderboard","Leaderboard")})})]})]})},Ne=(e,t)=>["in-review-count",e??"",t??""];function qe({className:e}){/* @__PURE__ */
8
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function xe({className:e}){/* @__PURE__ */
9
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function be({className:e}){/* @__PURE__ */
10
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function Ee({className:e}){/* @__PURE__ */
11
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function Ce({className:e}){/* @__PURE__ */
12
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M9 20v-4q-1.275-.1-2.5-.275t-2.45-.45q-.425-.1-.675-.475T3.25 14t.513-.625t.812-.1q1.825.425 3.688.575T12 14t3.738-.15t3.687-.575q.45-.1.825.1t.5.625t-.137.8t-.688.475q-1.225.275-2.45.45T15 16v4q0 .425-.287.713T14 21h-4q-.425 0-.712-.288T9 20m3-7q-.85 0-1.425-.575T10 11q0-.825.575-1.412T12 9q.825 0 1.413.588T14 11q0 .85-.587 1.425T12 13m-7.5-3q-.65 0-1.075-.425T3 8.5q0-.625.425-1.062T4.5 7q.625 0 1.063.438T6 8.5q0 .65-.437 1.075T4.5 10m15 0q-.65 0-1.075-.425T18 8.5q0-.625.425-1.062T19.5 7q.625 0 1.063.438T21 8.5q0 .65-.437 1.075T19.5 10M7.25 6.25q-.65 0-1.075-.425T5.75 4.75q0-.625.425-1.062T7.25 3.25q.625 0 1.063.438T8.75 4.75q0 .65-.437 1.075T7.25 6.25m9.5 0q-.65 0-1.075-.425T15.25 4.75q0-.625.425-1.062t1.075-.438q.625 0 1.063.438t.437 1.062q0 .65-.437 1.075t-1.063.425M12 5q-.65 0-1.075-.425T10.5 3.5q0-.625.425-1.062T12 2q.625 0 1.063.438T13.5 3.5q0 .65-.437 1.075T12 5"})})}function Se({className:e}){/* @__PURE__ */
13
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function Ie({className:e}){/* @__PURE__ */
14
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function ze({className:e}){/* @__PURE__ */
15
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var Le=({event:e})=>{const t=m(),{user:n,props:a}=d(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
16
- return s(U,{children:[/* @__PURE__ */s(F,{children:/* @__PURE__ */s(o?ze:Ie,{className:"size-6"})}),/* @__PURE__ */s($,{align:"end",side:"bottom",className:"w-44",children:Object.values(E).map(r=>/* @__PURE__ */s(B,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await p.post(S.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:he(r)},r))})]})},ke=({event:e,onAutoscrollClick:t})=>{const{t:n}=Y(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=j(),{inReviewCount:c}=(e=>{const t=m(),{props:n}=d(),r=n?.organizationId,{role:a,isSuper:i}=j(),{isLoading:s,data:o,isError:l,error:c}=u({queryKey:Ne(r,e?.slug),queryFn:async()=>{try{const t=await p.get(S.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${M.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?c:null,increment:()=>{t.setQueryData(Ne(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(Ne(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),g=r||i||o||l,h=r||i||o,f=a(()=>{const t=[];return h&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:qe,href:C.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===z.PRIVATE&&g&&t.push({title:n("event.access_requests","Access Requests"),icon:Se,href:C.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===b.CONTEST&&h&&t.push({title:n("event.curation_details","Curation Details"),icon:Ce,href:C.EVENT_CURATION_DETAILS(e?.slug??"")}),h&&t.push({title:n("event.edit_event","Edit Event"),icon:G,href:C.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,h,g]);/* @__PURE__ */
17
- return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(W,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(be,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&h&&/* @__PURE__ */s(Le,{event:e}),g&&/* @__PURE__ */s(W,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:C.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(xe,{className:"size-6"}),Number(c)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:c})]})}),f.length>0&&/* @__PURE__ */s(U,{children:[/* @__PURE__ */s(F,{children:/* @__PURE__ */s(Ee,{className:"size-6"})}),/* @__PURE__ */s($,{align:"end",side:"bottom",className:"w-48",children:f.map(e=>/* @__PURE__ */s(B,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function Me({className:e}){/* @__PURE__ */
18
- return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Ae=({engagementStyle:e,sort:t=A,order:n=x,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=Y(),l=a(()=>{const t=Object.keys(L).map(e=>({text:o(`content.sortby_${L[e].label.toLowerCase()}`,L[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===b.CONTEST?t:t.filter(e=>e.value!==N.POPULAR)},[e,o]);/* @__PURE__ */
19
- return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:c("text-foreground w-7 -scale-x-100 transition-transform",n===T.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(H,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},_e=["jpg","jpeg","png","webp","heic","tiff","bmp"],Pe=({value:t,onChange:i})=>{const[o,l]=r(!1),c=n(null),d=a(()=>t?URL.createObjectURL(t):null,[t]);return e(()=>()=>{d&&URL.revokeObjectURL(d)},[d]),e(()=>{!t&&c.current&&(c.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button",onClick:()=>c.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(o?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(o?X:se,{})})}),t&&d&&/* @__PURE__ */s("img",{src:d,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
- /* @__PURE__ */s("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!_e.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{const n=await ue(e);t=n.size/1024/1024>1?await me(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},Re={[I.GRID]:{icon:/* @__PURE__ */s(Ie,{className:"size-full text-inherit"})},[I.SINGLE]:{icon:/* @__PURE__ */s(Me,{className:"size-full text-inherit"})}},Oe=Object.keys(Re).map(e=>({icon:Re[e].icon,value:e})),Ve=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:u,sortOrder:m,onSortOrderChange:g,handleChange:h,face:f,onFaceImageChange:p})=>{const{t:w}=Y(),{organization:v}=d(),[T,y]=r(""),[N,q]=r(null),x=n(null),b=o(()=>{x.current&&(URL.revokeObjectURL(x.current),x.current=null)},[]),E=o(e=>{if(q(e),b(),e){const t=URL.createObjectURL(e);x.current=t,p?.(t)}else p?.(void 0)},[p,b]),C=o(e=>{y(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?h&&h(T.length>0?T:""):"Escape"===t&&(y(""),h&&h(""))},[T,h]),I=o(()=>{y(""),h&&h("")},[h]),z=o(()=>{h&&h(T)},[T,h]);return e(()=>{f||q(null)},[f]),e(()=>()=>{b()},[b]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
21
- /* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(H,{buttons:Oe,selected:i,onChange:l}),v?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
22
- /* @__PURE__ */s(fe,{placeholder:w("content.search_placeholder","Search using text"),value:T,className:"py-2",onChange:C,onKeyUp:S}),T?.length>0&&/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */s(Z,{className:"text-foreground w-5"})}),
23
- /* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:z,children:/* @__PURE__ */s(D,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Pe,{value:N,onChange:E})]}),
1
+ import{_ as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./DrrpB4Om.js";import{i as c,n as d,s as u,u as m}from"./tJ2MS5HS.js";import{n as g,r as h,t as f}from"./B7YFs6p5.js";import{t as p}from"./DmpmrPE5.js";import{E as w,S as v,T,_ as y,a as N,c as x,d as q,f as E,g as b,h as C,i as S,l as I,m as L,o as z,p as k,s as M,u as _,x as A}from"./DUWOb-5c.js";import{t as P,u as R}from"./BcAwTWQC.js";import{n as V,t as F}from"./DZwpw1jG.js";import{a as O,c as j,d as B,i as U,l as H,n as G,o as $,r as W,s as D,t as K,u as Q}from"./CtApMHPf.js";import{t as Z}from"./DPg_DKOi.js";import{t as Y}from"./B01ceTPt.js";import{t as J}from"./CxJgMv2R.js";import{t as X}from"./CAETItHr.js";import{r as ee}from"./DGGc10Cy.js";import{t as te}from"./DtcmI8yd2.js";import{n as ne,t as re}from"./5z04gCoQ2.js";import{t as ae}from"./CZ9iaxjO2.js";import{a as ie,i as se,n as oe,o as le,r as ce,s as de,t as ue}from"./CZK4LCzr2.js";import{c as me,i as ge,n as he,t as fe}from"./CBLQRRGX2.js";import{n as pe,t as we}from"./C6et9sp52.js";function ve(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function Te({className:e}){/* @__PURE__ */
2
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function ye({className:e}){/* @__PURE__ */
3
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Ne=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[d,u]=r(!1),m=n(null),g=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!m.current||!t)return void u(!1);const e=m.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(g.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),u(c>o*a+1)},r=()=>{null!==g.current&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==g.current&&window.cancelAnimationFrame(g.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:c("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:m,className:c(V({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,d&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),d&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},xe=()=>{const{t:e}=ee(),{eventSlug:t}=R(),{event:n}=te({eventSlug:t}),{props:r,organization:a,folders:i}=d(),{curateLabel:o,leaderboardLabel:l}=r??{},{eventViews:c,contentCount:m,curationCount:g}=(({event:e})=>{const{props:t,organization:n}=d(),r=t?.organizationId,{isLoading:a,data:i}=u({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await p.get(S.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n}),h=a?.integrationSettings?.showFolderBreadcrumb&&n?.folderId?H(i??[],n.folderId):[];/* @__PURE__ */
4
+ return s("div",{className:"w-full space-y-3 md:-mt-6",children:[h.length>0&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s(Q,{homeLink:A.PUBLIC_EVENTS,data:h})}),
5
+ /* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:n?.name}),/* @__PURE__ */s(Ne,{description:n?.description})]}),a?.integrationSettings?.showEventStats&&/* @__PURE__ */s("div",{className:"flex justify-center",children:/* @__PURE__ */s("div",{className:"flex items-center gap-6",children:[
6
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(ye,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:ve(c??0)})]}),
7
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(Te,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:ve(m??0)})]}),n?.engagementStyle===E.CONTEST&&/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s(de,{className:"text-primary"}),/* @__PURE__ */s("span",{className:"font-medium",children:g})]})]})}),(n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0||n?.status===k.OPEN&&n?.engagementStyle===E.CONTEST||n?.engagementStyle===E.REACTION&&n?.showLeaderboard||n?.engagementStyle===E.CONTEST)&&/* @__PURE__ */s("div",{className:"flex w-full flex-wrap justify-center gap-3",children:[n?.status===k.OPEN&&n?.uploadLimit&&n.uploadLimit>0&&/* @__PURE__ */s(P,{to:A.UPLOAD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(me,{className:"size-5"}),children:e("content.upload","Upload")})}),n?.status===k.OPEN&&n?.engagementStyle===E.CONTEST&&/* @__PURE__ */s(P,{to:A.CURATE(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(de,{className:"size-5"}),children:o||e("content.curate","Curate")})}),n?.showLeaderboard&&/* @__PURE__ */s(P,{to:A.LEADERBOARD(n?.slug??""),children:/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(ae,{className:"size-5"}),children:l||e("content.leaderboard","Leaderboard")})})]})]})},qe=(e,t)=>["in-review-count",e??"",t??""];function Ee({className:e}){/* @__PURE__ */
8
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12.275 9H19.4q-.675-1.725-2.062-2.963T14.15 4.3l-2.3 3.95q-.15.25 0 .5t.425.25m-3.6 1.25q.15.25.425.25t.425-.25L13.1 4.1q-.275-.05-.55-.075T12 4q-1.65 0-3.075.625T6.4 6.3zM4.25 14h4.575q.275 0 .438-.25t.012-.5L5.7 7.1q-.8 1.025-1.25 2.263T4 12q0 .525.063 1.013T4.25 14m5.6 5.7l2.275-3.95q.15-.25-.012-.5t-.438-.25H4.6q.675 1.725 2.063 2.963T9.85 19.7M12 20q1.65 0 3.075-.625T17.6 17.7l-2.275-3.95q-.15-.25-.425-.25t-.425.25L10.9 19.9q.275.05.538.075T12 20m6.3-3.1q.8-1.025 1.25-2.262T20 12q0-.525-.062-1.012T19.75 10h-4.575q-.275 0-.437.25t-.013.5zM12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"})})}function be({className:e}){/* @__PURE__ */
9
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11.25 16L9.6 13.8q-.225-.3-.6-.3t-.6.3l-1.8 2.4q-.2.25-.05.525T7 17h10q.3 0 .45-.275t-.05-.525l-2.475-3.3q-.275-.05-.563-.125T13.8 12.6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4q.425 0 .713.288T10 4t-.288.713T9 5H5v14h14v-3.325q0-.425.288-.712t.712-.288t.713.288t.287.712V19q0 .825-.587 1.413T19 21zm11.05-10q-1.85 0-3.15-1.312T11.6 6.5t1.313-3.187T16.1 2t3.188 1.313T20.6 6.5q0 .675-.2 1.3t-.5 1.15l2.35 2.35q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.4-2.4q-.525.35-1.125.525T16.05 11m.05-2q1.05 0 1.775-.725T18.6 6.5t-.725-1.775T16.1 4t-1.775.725T13.6 6.5t.725 1.775T16.1 9"})})}function Ce({className:e}){/* @__PURE__ */
10
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M7 21q-.425 0-.712-.288T6 20t.288-.712T7 19h4v-3H4q-.825 0-1.412-.587T2 14V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-7v3h4q.425 0 .713.288T18 20t-.288.713T17 21zm-3-7h16V5H4zm0 0V5z"})})}function Se({className:e}){/* @__PURE__ */
11
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8"})})}function Ie({className:e}){/* @__PURE__ */
12
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M9 20v-4q-1.275-.1-2.5-.275t-2.45-.45q-.425-.1-.675-.475T3.25 14t.513-.625t.812-.1q1.825.425 3.688.575T12 14t3.738-.15t3.687-.575q.45-.1.825.1t.5.625t-.137.8t-.688.475q-1.225.275-2.45.45T15 16v4q0 .425-.287.713T14 21h-4q-.425 0-.712-.288T9 20m3-7q-.85 0-1.425-.575T10 11q0-.825.575-1.412T12 9q.825 0 1.413.588T14 11q0 .85-.587 1.425T12 13m-7.5-3q-.65 0-1.075-.425T3 8.5q0-.625.425-1.062T4.5 7q.625 0 1.063.438T6 8.5q0 .65-.437 1.075T4.5 10m15 0q-.65 0-1.075-.425T18 8.5q0-.625.425-1.062T19.5 7q.625 0 1.063.438T21 8.5q0 .65-.437 1.075T19.5 10M7.25 6.25q-.65 0-1.075-.425T5.75 4.75q0-.625.425-1.062T7.25 3.25q.625 0 1.063.438T8.75 4.75q0 .65-.437 1.075T7.25 6.25m9.5 0q-.65 0-1.075-.425T15.25 4.75q0-.625.425-1.062t1.075-.438q.625 0 1.063.438t.437 1.062q0 .65-.437 1.075t-1.063.425M12 5q-.65 0-1.075-.425T10.5 3.5q0-.625.425-1.062T12 2q.625 0 1.063.438T13.5 3.5q0 .65-.437 1.075T12 5"})})}function Le({className:e}){/* @__PURE__ */
13
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function ze({className:e}){/* @__PURE__ */
14
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function ke({className:e}){/* @__PURE__ */
15
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */s("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var Me=({event:e})=>{const t=m(),{user:n,props:a}=d(),i=a?.organizationId,[o,l]=r(!1);/* @__PURE__ */
16
+ return s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(o?ke:ze,{className:"size-6"})}),/* @__PURE__ */s(W,{align:"end",side:"bottom",className:"w-44",children:Object.values(b).map(r=>/* @__PURE__ */s(U,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await p.post(S.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:pe(r)},r))})]})},_e=({event:e,onAutoscrollClick:t})=>{const{t:n}=ee(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=j(),{inReviewCount:c}=(e=>{const t=m(),{props:n}=d(),r=n?.organizationId,{role:a,isSuper:i}=j(),{isLoading:s,data:o,isError:l,error:c}=u({queryKey:qe(r,e?.slug),queryFn:async()=>{try{const t=await p.get(S.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${M.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?c:null,increment:()=>{t.setQueryData(qe(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(qe(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),g=r||i||o||l,h=r||i||o,f=a(()=>{const t=[];return h&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:Ee,href:C.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===L.PRIVATE&&g&&t.push({title:n("event.access_requests","Access Requests"),icon:Le,href:C.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===E.CONTEST&&h&&t.push({title:n("event.curation_details","Curation Details"),icon:Ie,href:C.EVENT_CURATION_DETAILS(e?.slug??"")}),h&&t.push({title:n("event.edit_event","Edit Event"),icon:$,href:C.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,h,g]);/* @__PURE__ */
17
+ return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(D,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(Ce,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&h&&/* @__PURE__ */s(Me,{event:e}),g&&/* @__PURE__ */s(D,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:C.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(be,{className:"size-6"}),Number(c)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:c})]})}),f.length>0&&/* @__PURE__ */s(G,{children:[/* @__PURE__ */s(O,{children:/* @__PURE__ */s(Se,{className:"size-6"})}),/* @__PURE__ */s(W,{align:"end",side:"bottom",className:"w-48",children:f.map(e=>/* @__PURE__ */s(U,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function Ae({className:e}){/* @__PURE__ */
18
+ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Pe=({engagementStyle:e,sort:t=_,order:n=q,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=ee(),l=a(()=>{const t=Object.keys(z).map(e=>({text:o(`content.sortby_${z[e].label.toLowerCase()}`,z[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===E.CONTEST?t:t.filter(e=>e.value!==N.POPULAR)},[e,o]);/* @__PURE__ */
19
+ return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:c("text-foreground w-7 -scale-x-100 transition-transform",n===T.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(B,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Re=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ve=({value:t,onChange:i})=>{const[o,l]=r(!1),c=n(null),d=a(()=>t?URL.createObjectURL(t):null,[t]);return e(()=>()=>{d&&URL.revokeObjectURL(d)},[d]),e(()=>{!t&&c.current&&(c.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button",onClick:()=>c.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(o?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(o?ne:le,{})})}),t&&d&&/* @__PURE__ */s("img",{src:d,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
+ /* @__PURE__ */s("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Re.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{const n=await ge(e);t=n.size/1024/1024>1?await he(n,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):n}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},Fe={[I.GRID]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})},[I.SINGLE]:{icon:/* @__PURE__ */s(Ae,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),je=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:u,sortOrder:m,onSortOrderChange:g,handleChange:h,face:f,onFaceImageChange:p})=>{const{t:w}=ee(),{organization:v}=d(),[T,y]=r(""),[N,x]=r(null),q=n(null),E=o(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=o(e=>{if(x(e),E(),e){const t=URL.createObjectURL(e);q.current=t,p?.(t)}else p?.(void 0)},[p,E]),C=o(e=>{y(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?h&&h(T.length>0?T:""):"Escape"===t&&(y(""),h&&h(""))},[T,h]),I=o(()=>{y(""),h&&h("")},[h]),L=o(()=>{h&&h(T)},[T,h]);return e(()=>{f||x(null)},[f]),e(()=>()=>{E()},[E]),/* @__PURE__ */s("fieldset",{disabled:a,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(a?"opacity-50":""),children:[
21
+ /* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(B,{buttons:Oe,selected:i,onChange:l}),v?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
22
+ /* @__PURE__ */s(we,{placeholder:w("content.search_placeholder","Search using text"),value:T,className:"py-2",onChange:C,onKeyUp:S}),T?.length>0&&/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */s(X,{className:"text-foreground w-5"})}),
23
+ /* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(K,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Ve,{value:N,onChange:b})]}),
24
24
  /* @__PURE__ */s("div",{className:"col-span-3 md:col-span-1"}),
25
- /* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(Ae,{engagementStyle:t,sort:c,order:m,onSortChange:u,onSortOrderChange:g})})]})},Fe=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
25
+ /* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(Pe,{engagementStyle:t,sort:c,order:m,onSortChange:u,onSortOrderChange:g})})]})},Be=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
26
26
  /* @__PURE__ */s("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
27
27
  /* @__PURE__ */s("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
28
28
  /* @__PURE__ */s("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
29
29
  /* @__PURE__ */s("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
30
30
  /* @__PURE__ */s("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
31
31
  /* @__PURE__ */s("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
32
- /* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),je=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=ie(),l=n(null),c=`gam-${t}-banner-${a??"ev"}`,d=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,u=null,m=null,g=null;const h=d?[d]:[],f=document.createElement("div");f.id=c,document.body.appendChild(f);const p=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(c);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],c)?.addService(window.googletag.pubads());l&&(t=l,u=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&l.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),s=ce({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:y.GAM_CLICK})}}),ae(),window.googletag.display(c),n=window.setTimeout(()=>{e||(p(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==n&&window.clearTimeout(n),s?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,d,t,c]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},Be=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=ie(),o=n(null),l=`gam-right-${r??"ev"}`,c=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,d=null,u=null,m=null,g=null;const h=c?[c]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const p=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,u=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&o.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),d=ce({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:y.GAM_CLICK})}}),ae(),window.googletag.display(l),s=window.setTimeout(()=>{e||(p(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==s&&window.clearTimeout(s),d?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,c,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},He=t(()=>import("./qBKIp1ZW2.js")),Ue=()=>{const t=R().eventSlug,{loadingUser:u,organization:T}=d(),y=m(),[E,C]=r(""),[z,M]=r(void 0),[P,O]=r(A),[F,j]=r(x),[B,H]=r("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),U=n(null),{event:G,ads:$,gamConfig:W}=J({eventSlug:t}),{loading:D,isError:Y,error:X,refetch:ne,contentsWithAds:re,hasNextPage:ae,fetchNextPage:se,isFetchingNextPage:oe}=(({event:e,ads:t=[],gamConfig:n,sort:r=A,order:i=x,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:u,user:m}=d(),T=c?.organizationId,{isLoading:y,isError:N,error:b,data:E,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:z,refetch:k}=h({queryKey:[v.CONTENTS_BY_EVENT(e?._id??""),T??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await p.get(S.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${w[i].sortOrder}${L[r].sortField}`,limit:l},headers:{"x-org-id":T,...m?{Authorization:`Bearer ${m.token}`}:{}}}).json()}catch(b){throw new Error(b instanceof Error?b.message:String(b)||"Failed to fetch contents")}},enabled:!u&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>g(e),getNextPageParam:f}),M=a(()=>E?.pages?.flatMap(e=>e?.data??[])??[],[E]);return{contents:M,contentsWithAds:a(()=>{const r=Boolean(n?.inGalleryEnabled);return((e=[],{ads:t,gamConfig:n,position:r,gamShare:a})=>{if(r<=0)return e;const i=Boolean(n?.inGalleryEnabled),s=t.length>0;if(!i&&!s)return e;const o=i?s?Math.min(1,Math.max(0,a)):1:0,l=e=>{const n=t.length>1?t.filter(t=>t._id!==e):t,r=n.reduce((e,t)=>e+Math.max(1,t.frequency??1),0);let a=Math.random()*r;for(const t of n)if(a-=Math.max(1,t.frequency??1),a<=0)return t;return n[n.length-1]};let c=null,d=0;const u=[];for(let m=0;m<e.length;m++)if(u.push(e[m]),(m+1)%r===0){if(i&&(!s||Math.floor((d+1)*o)>Math.floor(d*o))&&n){const e=s?l(c):null;u.push({_id:`gam-ad-slot-${d}`,type:q.GAM_AD,slotIndex:d,gamConfig:n,fallbackAd:e,width:n.sizes[0]?.[0]??300,height:n.sizes[0]?.[1]??250})}else{const e=l(c);c=e._id??null,u.push({...e,type:q.AD,adType:e.type})}d++}return u})(M,{ads:"gam"!==e?.adMode||r?t:[],gamConfig:r?n:null,position:e?.adPosition??0,gamShare:(n?.inGalleryBlend??50)/100})},[M,t,e,n]),loading:y,isError:N,error:b,refetch:k,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:z}})({event:G,ads:$,gamConfig:W,sort:P,order:F,keywords:E,face:z}),{incrementEventView:le}=ie(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),f=n(null),p=n(0),w=n(!1),v=n(null),T=n(null),y=n(!1),N=n(),q=n(),x=n(i),b=n(o),E=n(s),C=n(a);x.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(w.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===f.current&&(f.current=e);const r=Math.min((e-f.current)/1e3,.05);f.current=e,p.current+=60*m.current*r;const a=Math.floor(p.current);a>0&&(n.scrollTop+=a,p.current-=a),x.current&&!b.current&&!w.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(w.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),w.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),p.current=0,f.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},z=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==v.current&&v.current.release().catch(()=>{}).finally(()=>{v.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),q.current&&document.removeEventListener("fullscreenchange",q.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},L=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||z()});return k.current=()=>{document.fullscreenElement||z()},e(()=>()=>{z()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;v.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(v.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>L.current(e),q.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",q.current),y.current=!0),p.current=0,f.current=null,w.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:ae,fetchNextPage:se,isFetchingNextPage:oe,onBottomReached:()=>G?._id&&y.refetchQueries({queryKey:[v.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&le(G.slug)},[G?.slug,le]);const me=a(()=>B===I.SINGLE,[B]),he=a(()=>/* @__PURE__ */s(ke,{event:G,onAutoscrollClick:ce}),[G,ce]),fe=n(null),pe=n({hasNextPage:ae,isFetchingNextPage:oe,loading:D,running:ue,fetchNextPage:se});pe.current={hasNextPage:ae,isFetchingNextPage:oe,loading:D,running:ue,fetchNextPage:se},e(()=>(fe.current=new IntersectionObserver(e=>{const t=pe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{fe.current?.disconnect(),fe.current=null}),[]);const we=o(e=>{const t=fe.current;t&&(t.disconnect(),e&&t.observe(e))},[]),ve=W?.bannerPositions??[],Te=T?._id,Ne=W&&ve.includes("right"),qe=Boolean(T?.integrationSettings?.showQuickSearch);/* @__PURE__ */
32
+ /* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Ue=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=oe(),l=n(null),c=`gam-${t}-banner-${a??"ev"}`,d=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,u=null,m=null,g=null;const h=d?[d]:[],f=document.createElement("div");f.id=c,document.body.appendChild(f);const p=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(c);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],c)?.addService(window.googletag.pubads());l&&(t=l,u=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&l.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),s=ue({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:y.GAM_CLICK})}}),se(),window.googletag.display(c),n=window.setTimeout(()=>{e||(p(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==n&&window.clearTimeout(n),s?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,d,t,c]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},He=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=oe(),o=n(null),l=`gam-right-${r??"ev"}`,c=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,d=null,u=null,m=null,g=null;const h=c?[c]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const p=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),(async()=>{await ie(),e||window.googletag.cmd.push(()=>{if(e)return;ce(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,u=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...h.length>0?{qrati_category:h}:{}}}):h.length>0&&o.setConfig({targeting:{qrati_category:h}}),m=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",m),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:y.GAM_VIEWABLE})},u.addEventListener("impressionViewable",g),d=ue({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:y.GAM_CLICK})}}),se(),window.googletag.display(l),s=window.setTimeout(()=>{e||(p(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",p),window.removeEventListener("resize",p),null!==s&&window.clearTimeout(s),d?.(),u&&"function"==typeof u.removeEventListener&&(m&&u.removeEventListener("slotRenderEnded",m),g&&u.removeEventListener("impressionViewable",g));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,c,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Ge=t(()=>import("./CfTxXwtG2.js")),$e=()=>{const t=R().eventSlug,{loadingUser:u,organization:T}=d(),y=m(),[b,C]=r(""),[L,M]=r(void 0),[P,V]=r(_),[O,j]=r(q),[B,U]=r("undefined"!=typeof window&&window.innerWidth<768?I.SINGLE:I.GRID),H=n(null),{event:G,ads:$,gamConfig:W}=te({eventSlug:t}),{loading:D,isError:K,error:Q,refetch:ee,contentsWithAds:ne,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=_,order:i=q,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:u,user:m}=d(),T=c?.organizationId,{isLoading:y,isError:N,error:E,data:b,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L,refetch:k}=h({queryKey:[v.CONTENTS_BY_EVENT(e?._id??""),T??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await p.get(S.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${w[i].sortOrder}${z[r].sortField}`,limit:l},headers:{"x-org-id":T,...m?{Authorization:`Bearer ${m.token}`}:{}}}).json()}catch(E){throw new Error(E instanceof Error?E.message:String(E)||"Failed to fetch contents")}},enabled:!u&&!!e,staleTime:6e4,gcTime:3e5,refetchOnWindowFocus:"always",initialPageParam:1,getPreviousPageParam:e=>g(e),getNextPageParam:f,maxPages:30}),M=a(()=>b?.pages?.flatMap(e=>e?.data??[])??[],[b]);return{contents:M,contentsWithAds:a(()=>{const r=Boolean(n?.inGalleryEnabled);return((e=[],{ads:t,gamConfig:n,position:r,gamShare:a})=>{if(r<=0)return e;const i=Boolean(n?.inGalleryEnabled),s=t.length>0;if(!i&&!s)return e;const o=i?s?Math.min(1,Math.max(0,a)):1:0,l=e=>{const n=t.length>1?t.filter(t=>t._id!==e):t,r=n.reduce((e,t)=>e+Math.max(1,t.frequency??1),0);let a=Math.random()*r;for(const t of n)if(a-=Math.max(1,t.frequency??1),a<=0)return t;return n[n.length-1]};let c=null,d=0;const u=[];for(let m=0;m<e.length;m++)if(u.push(e[m]),(m+1)%r===0){if(i&&(!s||Math.floor((d+1)*o)>Math.floor(d*o))&&n){const e=s?l(c):null;u.push({_id:`gam-ad-slot-${d}`,type:x.GAM_AD,slotIndex:d,gamConfig:n,fallbackAd:e,width:n.sizes[0]?.[0]??300,height:n.sizes[0]?.[1]??250})}else{const e=l(c);c=e._id??null,u.push({...e,type:x.AD,adType:e.type})}d++}return u})(M,{ads:"gam"!==e?.adMode||r?t:[],gamConfig:r?n:null,position:e?.adPosition??0,gamShare:(n?.inGalleryBlend??50)/100})},[M,t,e,n]),loading:y,isError:N,error:E,refetch:k,hasNextPage:C,fetchNextPage:I,isFetchingNextPage:L}})({event:G,ads:$,gamConfig:W,sort:P,order:O,keywords:b,face:L}),{incrementEventView:le}=oe(),{start:ce,initializing:de,running:ue}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),f=n(null),p=n(0),w=n(!1),v=n(null),T=n(null),y=n(!1),N=n(),x=n(),q=n(i),E=n(o),b=n(s),C=n(a);q.current=i,E.current=o,b.current=s,C.current=a,e(()=>{o||(w.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===f.current&&(f.current=e);const r=Math.min((e-f.current)/1e3,.05);f.current=e,p.current+=60*m.current*r;const a=Math.floor(p.current);a>0&&(n.scrollTop+=a,p.current-=a),q.current&&!E.current&&!w.current&&"function"==typeof b.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(w.current=!0,b.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),w.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),p.current=0,f.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==v.current&&v.current.release().catch(()=>{}).finally(()=>{v.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),x.current&&document.removeEventListener("fullscreenchange",x.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;v.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(v.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),x.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",x.current),y.current=!0),p.current=0,f.current=null,w.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:H,hasNextPage:ae,fetchNextPage:ie,isFetchingNextPage:se,onBottomReached:()=>G?._id&&y.refetchQueries({queryKey:[v.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&le(G.slug)},[G?.slug,le]);const me=a(()=>B===I.SINGLE,[B]),ge=a(()=>/* @__PURE__ */s(_e,{event:G,onAutoscrollClick:ce}),[G,ce]),he=n(null),pe=n({hasNextPage:ae,isFetchingNextPage:se,loading:D,running:ue,fetchNextPage:ie});pe.current={hasNextPage:ae,isFetchingNextPage:se,loading:D,running:ue,fetchNextPage:ie},e(()=>(he.current=new IntersectionObserver(e=>{const t=pe.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{he.current?.disconnect(),he.current=null}),[]);const we=o(e=>{const t=he.current;t&&(t.disconnect(),e&&t.observe(e))},[]),ve=W?.bannerPositions??[],Te=T?._id,ye=W&&ve.includes("right"),Ne=Boolean(T?.integrationSettings?.showQuickSearch);/* @__PURE__ */
33
33
  return s("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
34
- /* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:he}),
35
- /* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(ye,{})}),W&&ve.includes("top")&&/* @__PURE__ */s(je,{position:"top",gamConfig:W,eventId:G?._id,organizationId:Te}),
36
- /* @__PURE__ */s(Ve,{engagementStyle:G?.engagementStyle,disabled:u||D,mode:B,onModeChange:e=>H(e),sort:P,sortOrder:F,onSortChange:e=>O(e),onSortOrderChange:()=>j("asc"===F?"desc":"asc"),handleChange:C,face:z,onFaceImageChange:e=>M(e)}),z&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(V,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:z,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(ee,{color:"error",icon:/* @__PURE__ */s(Z,{className:"size-5"}),onClick:()=>M(void 0),children:"Clear search"})})]}),
37
- /* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[u||D?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(Q,{className:"h-72"},t))}):Y?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(K,{title:X?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(V,{variant:"body2",color:"muted",align:"center",children:X?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(ee,{icon:/* @__PURE__ */s(ge,{className:"size-5"}),onClick:()=>{ne()},children:"Retry"})]})})}):re?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(K,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Fe,{})})}):/* @__PURE__ */s(l,{children:[
38
- /* @__PURE__ */s("div",{ref:U,className:c(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(Q,{className:"h-72"},t))}),children:/* @__PURE__ */s(He,{event:G,contents:re,gamConfig:W,singleColumnMode:me,kioskMode:ue,timestampField:P===N.CAPTURE_TIME?"capturedAt":void 0,curateLink:G?.engagementStyle===b.CONTEST&&G.status===k.OPEN&&G.slug?_.CURATE(G.slug):void 0,onChangeFaceUrl:e=>M(e),showQuickSearch:qe})})}),
39
- /* @__PURE__ */s("div",{ref:we,className:"h-4 w-full","aria-hidden":"true"}),oe&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(te,{className:"size-8"})})]}),W&&ve.includes("bottom")&&/* @__PURE__ */s(je,{position:"bottom",gamConfig:W,eventId:G?._id,organizationId:Te})]}),Ne&&/* @__PURE__ */s(Be,{gamConfig:W,eventId:G?._id,organizationId:Te})]})]})};export{Ue as default};
34
+ /* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:ge}),
35
+ /* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(xe,{})}),W&&ve.includes("top")&&/* @__PURE__ */s(Ue,{position:"top",gamConfig:W,eventId:G?._id,organizationId:Te}),
36
+ /* @__PURE__ */s(je,{engagementStyle:G?.engagementStyle,disabled:u||D,mode:B,onModeChange:e=>U(e),sort:P,sortOrder:O,onSortChange:e=>V(e),onSortOrderChange:()=>j("asc"===O?"desc":"asc"),handleChange:C,face:L,onFaceImageChange:e=>M(e)}),L&&/* @__PURE__ */s("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */s("div",{className:"space-y-2",children:[/* @__PURE__ */s(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */s("img",{src:L,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */s("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */s(re,{color:"error",icon:/* @__PURE__ */s(X,{className:"size-5"}),onClick:()=>M(void 0),children:"Clear search"})})]}),
37
+ /* @__PURE__ */s("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */s("div",{className:"min-w-0 flex-1",children:[u||D?/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}):K?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:Q?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */s("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */s(F,{variant:"body2",color:"muted",align:"center",children:Q?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */s(re,{icon:/* @__PURE__ */s(fe,{className:"size-5"}),onClick:()=>{ee()},children:"Retry"})]})})}):ne?.length<=0?/* @__PURE__ */s("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */s(Y,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */s(Be,{})})}):/* @__PURE__ */s(l,{children:[
38
+ /* @__PURE__ */s("div",{ref:H,className:c(me?"flex w-full justify-center":"",de?"opacity-0":"opacity-100",ue?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */s(i,{fallback:/* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */s(J,{className:"h-72"},t))}),children:/* @__PURE__ */s(Ge,{event:G,contents:ne,gamConfig:W,singleColumnMode:me,kioskMode:ue,timestampField:P===N.CAPTURE_TIME?"capturedAt":void 0,curateLink:G?.engagementStyle===E.CONTEST&&G.status===k.OPEN&&G.slug?A.CURATE(G.slug):void 0,onChangeFaceUrl:e=>M(e),showQuickSearch:Ne})})}),
39
+ /* @__PURE__ */s("div",{ref:we,className:"h-4 w-full","aria-hidden":"true"}),se&&/* @__PURE__ */s("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */s(Z,{className:"size-8"})})]}),W&&ve.includes("bottom")&&/* @__PURE__ */s(Ue,{position:"bottom",gamConfig:W,eventId:G?._id,organizationId:Te})]}),ye&&/* @__PURE__ */s(He,{gamConfig:W,eventId:G?._id,organizationId:Te})]})]})};export{$e as default};
@@ -1 +1 @@
1
- import{_ as t,h as s,r as e,v as i}from"./DrrpB4Om.js";import{A as r,E as n,S as o,b as u,k as a,u as h,v as c}from"./CKQOToSD.js";import{n as p}from"./CUBxHQ8u.js";var m=class extends u{#t;#s=void 0;#e;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),a(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),s?.mutationKey&&this.options.mutationKey&&o(s.mutationKey)!==o(this.options.mutationKey)?this.reset():"pending"===this.#e?.state.status&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#n(t)}getCurrentResult(){return this.#s}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#r(),this.#n()}mutate(t,s){return this.#i=s,this.#e?.removeObserver(this),this.#e=this.#t.getMutationCache().build(this.#t,this.options),this.#e.addObserver(this),this.#e.execute(t)}#r(){const t=this.#e?.state??p();this.#s={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#n(t){c.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#s.variables,i=this.#s.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,e,i,r)}catch(s){Promise.reject(s)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,e,i,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(t=>{t(this.#s)})})}};function l(o,u){const a=h(u),[p]=s(()=>new m(a,o));t(()=>{p.setOptions(o)},[p,o]);const l=e(i(t=>p.subscribe(c.batchCalls(t)),[p]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),d=i((t,s)=>{p.mutate(t,s).catch(n)},[p]);if(l.error&&r(p.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}export{l as t};
1
+ import{_ as t,h as s,r as e,v as i}from"./DrrpB4Om.js";import{A as r,E as n,S as o,b as u,k as a,u as h,v as c}from"./tJ2MS5HS.js";import{n as p}from"./KdgQ7jUn.js";var m=class extends u{#t;#s=void 0;#e;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),a(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),s?.mutationKey&&this.options.mutationKey&&o(s.mutationKey)!==o(this.options.mutationKey)?this.reset():"pending"===this.#e?.state.status&&this.#e.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#n(t)}getCurrentResult(){return this.#s}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#r(),this.#n()}mutate(t,s){return this.#i=s,this.#e?.removeObserver(this),this.#e=this.#t.getMutationCache().build(this.#t,this.options),this.#e.addObserver(this),this.#e.execute(t)}#r(){const t=this.#e?.state??p();this.#s={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#n(t){c.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#s.variables,i=this.#s.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,e,i,r)}catch(s){Promise.reject(s)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,e,i,r)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,e,i,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(t=>{t(this.#s)})})}};function l(o,u){const a=h(u),[p]=s(()=>new m(a,o));t(()=>{p.setOptions(o)},[p,o]);const l=e(i(t=>p.subscribe(c.batchCalls(t)),[p]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),d=i((t,s)=>{p.mutate(t,s).catch(n)},[p]);if(l.error&&r(p.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}export{l as t};
@@ -1 +1 @@
1
- import{g as t,h as e,v as s}from"./CKQOToSD.js";var i=class extends e{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=t({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)s();else{this.#a({type:"pending",variables:e,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,i);const t=await(this.options.onMutate?.(e,i));t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:o})}const t=await this.#i.start();return await(this.#s.config.onSuccess?.(t,e,this.state.context,this,i)),await(this.options.onSuccess?.(t,e,this.state.context,i)),await(this.#s.config.onSettled?.(t,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(t,null,e,this.state.context,i)),this.#a({type:"success",data:t}),t}catch(r){try{await(this.#s.config.onError?.(r,e,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,e,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,e,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),s.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
1
+ import{g as t,h as e,v as s}from"./tJ2MS5HS.js";var i=class extends e{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=t({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)s();else{this.#a({type:"pending",variables:e,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,i);const t=await(this.options.onMutate?.(e,i));t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:o})}const t=await this.#i.start();return await(this.#s.config.onSuccess?.(t,e,this.state.context,this,i)),await(this.options.onSuccess?.(t,e,this.state.context,i)),await(this.#s.config.onSettled?.(t,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(t,null,e,this.state.context,i)),this.#a({type:"success",data:t}),t}catch(r){try{await(this.#s.config.onError?.(r,e,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,e,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,e,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),s.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
@@ -1,5 +1,5 @@
1
- import{h as a,t as o}from"./DrrpB4Om.js";import{n as e}from"./CKQOToSD.js";import{x as s}from"./BLeZg2Bz.js";import{c as r,t as l}from"./DdYePHxG.js";import{t as i}from"./DmIYOIw1.js";import{n as t}from"./DGGc10Cy.js";import{t as n}from"./DyemeRjE2.js";import{i as d,s as m,t as p}from"./DWqIpaZ02.js";import{n as c,r as g,t as u}from"./DlRUi0u42.js";var f=()=>{const{t:f}=t(),h=r(),[w,v]=a(""),[b,y]=a(""),[j,C]=a(!1),[N,A]=a(null),[P,k]=a(!1),[x,S]=a({}),{loginUsingEmail:E,loginWithGoogle:F,loginWithApple:L}=e(),[O,W]=a({google:!1,apple:!1}),D=a=>{S(o=>o[a]?{...o,[a]:void 0}:o)},G=async(a,o)=>{W(o=>({...o,[a]:!0})),A(null);try{await(o?.())}catch(e){e instanceof Error?A(e.message):A(`Failed to login with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{W(o=>({...o,[a]:!1}))}};/* @__PURE__ */
2
- return o("div",{className:"bg-background w-full space-y-6",children:[/* @__PURE__ */o("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const o=d(w),e=m(b);if(o||e)return void S({email:o,password:e});S({}),C(!0),A(null);const s=await(E?.(w.toLowerCase(),b));s?.error&&A(s.error),C(!1)},className:"space-y-6",children:[
3
- /* @__PURE__ */o("div",{className:"space-y-9",children:[/* @__PURE__ */o(p,{label:f("auth.email","Email address"),name:"email",disabled:j,type:"email",value:w,onChange:a=>{v(a.target.value),D("email")},autoComplete:"email",error:x.email}),/* @__PURE__ */o(p,{label:f("auth.password","Password"),name:"password",disabled:j,type:P?"text":"password",value:b,onChange:a=>{y(a.target.value),D("password")},autoComplete:"current-password",error:x.password,actionLabel:P?"Hide password":"Show password",actionIcon:/* @__PURE__ */o(P?u:c,{className:"size-5"}),onActionClick:()=>k(!P)})]}),N&&/* @__PURE__ */o(i,{align:"center",color:"error",className:"font-medium",children:N}),
1
+ import{h as a,t as o}from"./DrrpB4Om.js";import{n as e}from"./tJ2MS5HS.js";import{x as s}from"./DUWOb-5c.js";import{c as r,t as l}from"./BcAwTWQC.js";import{t as i}from"./DZwpw1jG.js";import{n as t}from"./DGGc10Cy.js";import{t as n}from"./5z04gCoQ2.js";import{i as d,s as m,t as p}from"./C6et9sp52.js";import{n as c,r as g,t as u}from"./DlRUi0u42.js";var f=()=>{const{t:f}=t(),h=r(),[w,v]=a(""),[b,y]=a(""),[j,C]=a(!1),[N,P]=a(null),[k,x]=a(!1),[A,S]=a({}),{loginUsingEmail:E,loginWithGoogle:F,loginWithApple:L}=e(),[O,W]=a({google:!1,apple:!1}),z=a=>{S(o=>o[a]?{...o,[a]:void 0}:o)},D=async(a,o)=>{W(o=>({...o,[a]:!0})),P(null);try{await(o?.())}catch(e){e instanceof Error?P(e.message):P(`Failed to login with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{W(o=>({...o,[a]:!1}))}};/* @__PURE__ */
2
+ return o("div",{className:"bg-background w-full space-y-6",children:[/* @__PURE__ */o("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const o=d(w),e=m(b);if(o||e)return void S({email:o,password:e});S({}),C(!0),P(null);const s=await(E?.(w.toLowerCase(),b));s?.error&&P(s.error),C(!1)},className:"space-y-6",children:[
3
+ /* @__PURE__ */o("div",{className:"space-y-9",children:[/* @__PURE__ */o(p,{label:f("auth.email","Email address"),name:"email",disabled:j,type:"email",value:w,onChange:a=>{v(a.target.value),z("email")},autoComplete:"email",error:A.email}),/* @__PURE__ */o(p,{label:f("auth.password","Password"),name:"password",disabled:j,type:k?"text":"password",value:b,onChange:a=>{y(a.target.value),z("password")},autoComplete:"current-password",error:A.password,actionLabel:k?"Hide password":"Show password",actionIcon:/* @__PURE__ */o(k?u:c,{className:"size-5"}),onActionClick:()=>x(!k)})]}),N&&/* @__PURE__ */o(i,{align:"center",color:"error",className:"font-medium",children:N}),
4
4
  /* @__PURE__ */o("div",{className:"flex justify-end",children:/* @__PURE__ */o(l,{to:s.FORGOT_PASSWORD,state:{from:h.pathname},children:/* @__PURE__ */o(i,{variant:"h6",className:"w-fit",children:f("button.forgotPassword","Forgot Password?")})})}),
5
- /* @__PURE__ */o(n,{type:"submit",color:"primary",className:"w-full",loading:j,disabled:j,children:f("button.login","Login")})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */o(g,{disabled:j||O.google||O.apple,loading:O.google,onClick:()=>G("google",F),provider:"google"}),/* @__PURE__ */o(g,{disabled:j||O.google||O.apple,loading:O.apple,onClick:()=>G("apple",L),provider:"apple"})]})]})};export{f as default};
5
+ /* @__PURE__ */o(n,{type:"submit",color:"primary",className:"w-full",loading:j,disabled:j,children:f("button.login","Login")})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */o(g,{disabled:j||O.google||O.apple,loading:O.google,onClick:()=>D("google",F),provider:"google"}),/* @__PURE__ */o(g,{disabled:j||O.google||O.apple,loading:O.apple,onClick:()=>D("apple",L),provider:"apple"})]})]})};export{f as default};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./DrrpB4Om.js";import{i as r}from"./CKQOToSD.js";import{t}from"./DyemeRjE2.js";import{n as o,o as s,r as i,t as n}from"./Vk429P022.js";function d({className:r}){/* @__PURE__ */
1
+ import{t as e}from"./DrrpB4Om.js";import{i as r}from"./tJ2MS5HS.js";import{t}from"./5z04gCoQ2.js";import{n as o,o as s,r as i,t as n}from"./Cr4OmKxk2.js";function d({className:r}){/* @__PURE__ */
2
2
  return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M2.725 21q-.275 0-.5-.137t-.35-.363t-.137-.488t.137-.512l9.25-16q.15-.25.388-.375T12 3t.488.125t.387.375l9.25 16q.15.25.138.513t-.138.487t-.35.363t-.5.137zm1.725-2h15.1L12 6zm8.263-1.287Q13 17.425 13 17t-.288-.712T12 16t-.712.288T11 17t.288.713T12 18t.713-.288m0-3Q13 14.425 13 14v-3q0-.425-.288-.712T12 10t-.712.288T11 11v3q0 .425.288.713T12 15t.713-.288M12 12.5"})})}function a({open:a,onOpenChange:l,title:c,description:u,cancelText:g="Cancel",confirmText:m="Confirm",confirmColor:f="error",loading:h,onCancel:b,onConfirm:v}){/* @__PURE__ */
3
3
  return e(n,{open:a,onOpenChange:l,children:/* @__PURE__ */e(o,{className:"w-full max-w-lg",children:[/* @__PURE__ */e("div",{className:"flex flex-col gap-6 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */e("div",{className:"bg-destructive/10 mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0",children:/* @__PURE__ */e(d,{className:"text-destructive size-6"})}),/* @__PURE__ */e("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[c&&/* @__PURE__ */e(s,{children:c}),u&&/* @__PURE__ */e(i,{children:u})]})]}),/* @__PURE__ */e("div",{className:"flex flex-col-reverse gap-3 p-4 sm:flex-row sm:justify-end",children:[/* @__PURE__ */e(t,{variant:"outlined",color:"foreground",disabled:h,className:"w-full sm:w-auto",onClick:b,children:g}),/* @__PURE__ */e(t,{color:f,loading:h,disabled:h,className:r("w-full sm:w-auto","error"===f&&"text-white"),onClick:v,children:m})]})]})})}var l={xs:"size-6 [&>*]:size-4",sm:"size-8 [&>*]:size-5",md:"size-10 [&>*]:size-6",lg:"size-12 [&>*]:size-7"},c={ghost:{primary:"text-primary hover:bg-primary/10",foreground:"text-foreground hover:bg-foreground/10",muted:"text-muted-foreground hover:bg-muted/20",error:"text-destructive hover:bg-destructive/10",success:"text-success hover:bg-success/10",warning:"text-warning hover:bg-warning/10",info:"text-info hover:bg-info/10"},filled:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",foreground:"bg-foreground text-background hover:bg-foreground/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80",error:"bg-destructive text-white hover:bg-destructive/90",success:"bg-success text-white hover:bg-success/90",warning:"bg-warning text-white hover:bg-warning/90",info:"bg-info text-white hover:bg-info/90"},outlined:{primary:"border border-primary text-primary hover:bg-primary/10",foreground:"border border-foreground text-foreground hover:bg-foreground/10",muted:"border border-border text-muted-foreground hover:bg-muted/20",error:"border border-destructive text-destructive hover:bg-destructive/10",success:"border border-success text-success hover:bg-success/10",warning:"border border-warning text-warning hover:bg-warning/10",info:"border border-info text-info hover:bg-info/10"}};function u({icon:t,size:o="md",variant:s="ghost",color:i="foreground",loading:n,disabled:d,tooltip:a,className:u,...g}){const m="default"===s?"filled":s,f=r("inline-flex cursor-pointer items-center justify-center rounded-full transition-colors disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",l[o],c[m]?.[i]||c[m]?.foreground,u);/* @__PURE__ */
4
4
  return e("button",{type:"button",disabled:d||n,className:f,title:a,...g,children:n?/* @__PURE__ */e("svg",{className:"animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */e("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):t})}function g({className:r}){/* @__PURE__ */