@qratilabs/qrati-connect 2.7.3 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/element/{B8jogRzT.js → 5CiAlCjU.js} +4 -4
  3. package/element/BPMOttLj.js +1 -0
  4. package/element/BYUKR-E7.js +1 -0
  5. package/element/Bf4EqlE2.js +1 -0
  6. package/element/CS_11SIt.js +1 -0
  7. package/element/CcQBfXBZ.js +5 -0
  8. package/element/CpQsvHTX.js +1 -0
  9. package/element/Dqtdp5CD.js +2 -0
  10. package/element/DsQr_vB4.js +17 -0
  11. package/element/EgsEX4Mk.js +5 -0
  12. package/element/Iz_T2O-5.js +8 -0
  13. package/element/NLCtVOsK.js +1 -0
  14. package/element/ZsvY3_BP.js +32 -0
  15. package/element/web.es.js +419 -419
  16. package/package.json +1 -1
  17. package/react/2j0Uva3f.js +2 -0
  18. package/react/5Kn_YMsi.js +5 -0
  19. package/react/8wZBDRWe.js +1 -0
  20. package/react/B6z3ifcO.js +1 -0
  21. package/react/BK-Th6NY.js +1 -0
  22. package/react/BMpF19BV.js +1 -0
  23. package/react/BOcElY6J.js +1 -0
  24. package/react/BW8JB9yA.js +1 -0
  25. package/react/B_X6sOg3.js +1 -0
  26. package/react/Bb2iDZ1p.js +1 -0
  27. package/react/BnGBrZlU.js +1 -0
  28. package/react/C-ZaLJv-.js +1 -0
  29. package/react/COOPnhZa.js +1 -0
  30. package/react/CYLiwpjD.js +32 -0
  31. package/react/{DSAOtDOg.js → CYZuQpl9.js} +4 -4
  32. package/react/CeR0kSft.js +1 -0
  33. package/react/{CDAGXOJa.js → CrKuU6G6.js} +1 -1
  34. package/react/Cu4v-rqS.js +1 -0
  35. package/{element/BjbDXTeP.js → react/D-1o-2C0.js} +4 -4
  36. package/react/DEk8rfah.js +1 -0
  37. package/react/DKx9EV67.js +1 -0
  38. package/react/Dr4BZwRl.js +17 -0
  39. package/react/DvaUOLqe.js +1 -0
  40. package/react/F4EaFenB.js +5 -0
  41. package/react/MHmBPkBq.js +1 -0
  42. package/react/{B57jvRJw.js → T39bw9GN.js} +1 -1
  43. package/react/index.cjs +1 -1
  44. package/react/index.mjs +381 -381
  45. package/umd/web.umd.js +1 -1
  46. package/element/BiQECCnr.js +0 -1
  47. package/element/COUnPxHl.js +0 -6
  48. package/element/CkfXzc1_.js +0 -1
  49. package/element/DGeYAYfl.js +0 -3
  50. package/element/DXPR6JWg.js +0 -1
  51. package/element/DqOnDVHH.js +0 -1
  52. package/element/KwvjdBxj.js +0 -17
  53. package/element/ThtSVXLE.js +0 -32
  54. package/element/gajcOMzQ.js +0 -1
  55. package/element/ojjN3KY4.js +0 -1
  56. package/react/B0pbGxj0.js +0 -1
  57. package/react/BBaYBpSS.js +0 -1
  58. package/react/BUm8-ZtV.js +0 -1
  59. package/react/Bran9aUe.js +0 -32
  60. package/react/BzMDry65.js +0 -1
  61. package/react/CMUYyO6F.js +0 -1
  62. package/react/CPs8NoX7.js +0 -1
  63. package/react/CdZcv5CJ.js +0 -1
  64. package/react/Ce4GGag_.js +0 -1
  65. package/react/CzNVO0Zz.js +0 -1
  66. package/react/D6h9tRAZ.js +0 -1
  67. package/react/DCjmEjZr.js +0 -1
  68. package/react/DJ-3Sziz.js +0 -1
  69. package/react/DKvJBrWM.js +0 -8
  70. package/react/DaQR1Bft.js +0 -1
  71. package/react/Dbq_PyC6.js +0 -3
  72. package/react/DdmNkEML.js +0 -1
  73. package/react/buiUjKpV.js +0 -6
  74. package/react/dLaHt9rf.js +0 -1
  75. package/react/mNvBH-um.js +0 -17
  76. package/react/zrUJi_8F.js +0 -1
  77. /package/element/{C2ydm0ZD.js → CqWvjfKA.js} +0 -0
  78. /package/element/{DUlbZyIi.js → DD-DUfz5.js} +0 -0
  79. /package/element/{BppxGns9.js → DHsBzJ-x.js} +0 -0
  80. /package/element/{CjmNvKgB.js → DSjmSa7l.js} +0 -0
  81. /package/element/{CziefUVo.js → ZShDCNL_.js} +0 -0
  82. /package/react/{LDusNFdQ.js → BXOAVvhC.js} +0 -0
  83. /package/react/{D5puLxf7.js → BeV2ILRt.js} +0 -0
  84. /package/react/{DtvJNH06.js → BqRDSbh4.js} +0 -0
  85. /package/react/{CO70kETi.js → Bqe_56Ho.js} +0 -0
  86. /package/react/{BT55gXKs.js → CCCbXwws.js} +0 -0
  87. /package/react/{Bxitmzur.js → CEEUMvOM.js} +0 -0
  88. /package/react/{CvLw8owR.js → COCwvQDi.js} +0 -0
  89. /package/react/{CR2MwRBM.js → CssqM9iA.js} +0 -0
  90. /package/react/{CtCRzhKd.js → DV8H8PH6.js} +0 -0
  91. /package/react/{zyOknCLQ.js → fLndMErv.js} +0 -0
@@ -0,0 +1 @@
1
+ import*as t from"react";import{jsx as e}from"react/jsx-runtime";var s=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i=new class extends s{#t;#e;#s;constructor(){super(),this.#s=t=>{if("undefined"!=typeof window&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:"hidden"!==globalThis.document?.visibilityState}},r={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},n=new class{#i=r;#r=!1;setTimeoutProvider(t){"production"!==process.env.NODE_ENV&&this.#r&&t!==this.#i&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#i,provider:t}),this.#i=t,"production"!==process.env.NODE_ENV&&(this.#r=!1)}setTimeout(t,e){return"production"!==process.env.NODE_ENV&&(this.#r=!0),this.#i.setTimeout(t,e)}clearTimeout(t){this.#i.clearTimeout(t)}setInterval(t,e){return"production"!==process.env.NODE_ENV&&(this.#r=!0),this.#i.setInterval(t,e)}clearInterval(t){this.#i.clearInterval(t)}},o="undefined"==typeof window||"Deno"in globalThis;function a(){}function u(t,e){return"function"==typeof t?t(e):t}function c(t){return"number"==typeof t&&t>=0&&t!==1/0}function h(t,e){return Math.max(t+(e||0)-Date.now(),0)}function l(t,e){return"function"==typeof t?t(e):t}function d(t,e){return"function"==typeof t?t(e):t}function f(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:o,stale:a}=t;if(o)if(i){if(e.queryHash!==y(o,e.options))return!1}else if(!b(e.queryKey,o))return!1;if("all"!==s){const t=e.isActive();if("active"===s&&!t)return!1;if("inactive"===s&&t)return!1}return!("boolean"==typeof a&&e.isStale()!==a||r&&r!==e.state.fetchStatus||n&&!n(e))}function p(t,e){const{exact:s,status:i,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(v(e.options.mutationKey)!==v(n))return!1}else if(!b(e.options.mutationKey,n))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function y(t,e){return(e?.queryKeyHashFn||v)(t)}function v(t){return JSON.stringify(t,(t,e)=>O(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function b(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&Object.keys(e).every(s=>b(t[s],e[s]))}var m=Object.prototype.hasOwnProperty;function g(t,e,s=0){if(t===e)return t;if(s>500)return e;const i=w(t)&&w(e);if(!(i||O(t)&&O(e)))return e;const r=(i?t:Object.keys(t)).length,n=i?e:Object.keys(e),o=n.length,a=i?new Array(o):{};let u=0;for(let c=0;c<o;c++){const o=i?c:n[c],h=t[o],l=e[o];if(h===l){a[o]=h,(i?c<r:m.call(t,o))&&u++;continue}if(null===h||null===l||"object"!=typeof h||"object"!=typeof l){a[o]=l;continue}const d=g(h,l,s+1);a[o]=d,d===h&&u++}return r===o&&u===r?t:a}function S(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function w(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function O(t){if(!F(t))return!1;const e=t.constructor;if(void 0===e)return!0;const s=e.prototype;return!!F(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function F(t){return"[object Object]"===Object.prototype.toString.call(t)}function C(t,e,s){if("function"==typeof s.structuralSharing)return s.structuralSharing(t,e);if(!1!==s.structuralSharing){if("production"!==process.env.NODE_ENV)try{return g(t,e)}catch(i){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${i}`),i}return g(t,e)}return e}function E(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function T(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var q=/* @__PURE__ */Symbol();function j(t,e){return"production"!==process.env.NODE_ENV&&t.queryFn===q&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`),!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==q?t.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${t.queryHash}'`))}function A(t,e){return"function"==typeof t?t(...e):!!t}function D(t,e,s){let i,r=!1;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??=e(),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),t}var P=/* @__PURE__ */(()=>{let t=()=>o;return{isServer:()=>t(),setIsServer(e){t=e}}})();function U(){let t,e;const s=new Promise((s,i)=>{t=s,e=i});function i(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},s.reject=t=>{i({status:"rejected",reason:t}),e(t)},s}var N=function(t){setTimeout(t,0)},k=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()},r=N;const n=i=>{e?t.push(i):r(()=>{s(i)})};return{batch:n=>{let o;e++;try{o=n()}finally{e--,e||(()=>{const e=t;t=[],e.length&&r(()=>{i(()=>{e.forEach(t=>{s(t)})})})})()}return o},batchCalls:t=>(...e)=>{n(()=>{t(...e)})},schedule:n,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{r=t}}}(),R=new class extends s{#n=!0;#e;#s;constructor(){super(),this.#s=t=>{if("undefined"!=typeof window&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#n!==t&&(this.#n=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#n}};function I(t){return Math.min(1e3*2**t,3e4)}function L(t){return"online"!==(t??"online")||R.isOnline()}var x=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function K(t){let e,s=!1,r=0;const o=U(),a=()=>"pending"!==o.status,u=()=>i.isFocused()&&("always"===t.networkMode||R.isOnline())&&t.canRun(),c=()=>L(t.networkMode)&&t.canRun(),h=t=>{a()||(e?.(),o.resolve(t))},l=t=>{a()||(e?.(),o.reject(t))},d=()=>new Promise(s=>{e=t=>{(a()||u())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,a()||t.onContinue?.()}),f=()=>{if(a())return;let e;const i=0===r?t.initialPromise:void 0;try{e=i??t.fn()}catch(o){e=Promise.reject(o)}Promise.resolve(e).then(h).catch(e=>{if(a())return;const i=t.retry??(P.isServer()?0:3),o=t.retryDelay??I,c="function"==typeof o?o(r,e):o,h=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,e);var p;!s&&h?(r++,t.onFail?.(r,e),(p=c,new Promise(t=>{n.setTimeout(t,p)})).then(()=>u()?void 0:d()).then(()=>{s?l(e):f()})):l(e)})};return{promise:o,status:()=>o.status,cancel:e=>{if(!a()){const s=new x(e);l(s),t.onCancel?.(s)}},continue:()=>(e?.(),o),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:c,start:()=>(c()?f():d().then(f),o)}}var M=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c(this.gcTime)&&(this.#o=n.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(P.isServer()?1/0:3e5))}clearGcTimeout(){this.#o&&(n.clearTimeout(this.#o),this.#o=void 0)}},G=class extends M{#a;#u;#c;#h;#l;#d;#f;constructor(t){super(),this.#f=!1,this.#d=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#h=t.client,this.#c=this.#h.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#a=V(this.options),this.state=t.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(t){if(this.options={...this.#d,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const t=V(this.options);void 0!==t.data&&(this.setState(_(t.data,t.dataUpdatedAt)),this.#a=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(t,e){const s=C(this.state.data,t,this.options);return this.#p({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#p({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#l?.promise;return this.#l?.cancel(t),e?e.then(a).catch(a):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>!1!==d(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===q||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===l(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!h(this.state.dataUpdatedAt,t))}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#l&&(this.#f||this.#y()?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(t,e){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}"production"!==process.env.NODE_ENV&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const s=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#f=!0,s.signal)})},r=()=>{const t=j(this.options,e),s=(()=>{const t={client:this.#h,queryKey:this.queryKey,meta:this.meta};return i(t),t})();return this.#f=!1,this.options.persister?this.options.persister(t,s,this):t(s)},n=(()=>{const t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:r};return i(t),t})();this.options.behavior?.onFetch(n,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===n.fetchOptions?.meta||this.#p({type:"fetch",meta:n.fetchOptions?.meta}),this.#l=K({initialPromise:e?.initialPromise,fn:n.fetchFn,onCancel:t=>{t instanceof x&&t.revert&&this.setState({...this.#u,fetchStatus:"idle"}),s.abort()},onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:n.options.retry,retryDelay:n.options.retryDelay,networkMode:n.options.networkMode,canRun:()=>!0});try{const t=await this.#l.start();if(void 0===t)throw"production"!==process.env.NODE_ENV&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#c.config.onSuccess?.(t,this),this.#c.config.onSettled?.(t,this.state.error,this),t}catch(o){if(o instanceof x){if(o.silent)return this.#l.promise;if(o.revert){if(void 0===this.state.data)throw o;return this.state.data}}throw this.#p({type:"error",error:o}),this.#c.config.onError?.(o,this),this.#c.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#p(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...H(e.data,this.options),fetchMeta:t.meta??null};case"success":const s={...e,..._(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=t.manual?s:void 0,s;case"error":const i=t.error;return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),k.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:t})})}};function H(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function _(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function V(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Q=t.createContext(void 0),$=e=>{const s=t.useContext(Q);if(e)return e;if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},z=({client:s,children:i})=>(t.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),/* @__PURE__ */e(Q.Provider,{value:s,children:i}));export{n as A,C,A as D,S as E,s as M,q as O,b as S,l as T,y as _,M as a,f as b,k as c,D as d,E as f,v as g,u as h,H as i,i as j,h as k,U as l,j as m,$ as n,K as o,T as p,G as r,R as s,z as t,P as u,c as v,d as w,a as x,p as y};
@@ -0,0 +1 @@
1
+ const e=require("./D4geS7mP.js");let t=require("react");t=e.__toESM(t);let r=require("react/jsx-runtime");var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i=new class extends n{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#n=s;#i=!1;setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&this.#i&&e!==this.#n&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#n,provider:e}),this.#n=e,"production"!==process.env.NODE_ENV&&(this.#i=!1)}setTimeout(e,t){return"production"!==process.env.NODE_ENV&&(this.#i=!0),this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return"production"!==process.env.NODE_ENV&&(this.#i=!0),this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},a="undefined"==typeof window||"Deno"in globalThis;function u(){}function c(e,t){return"function"==typeof e?e(t):e}function h(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function d(e,t){return"function"==typeof e?e(t):e}function f(e,t){return"function"==typeof e?e(t):e}function p(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o)if(n){if(t.queryHash!==b(o,t.options))return!1}else if(!m(t.queryKey,o))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function y(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(v(t.options.mutationKey)!==v(s))return!1}else if(!m(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>m(e[r],t[r]))}var g=Object.prototype.hasOwnProperty;function O(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=j(e)&&j(t);if(!(n||w(e)&&w(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,a=n?new Array(o):{};let u=0;for(let c=0;c<o;c++){const o=n?c:s[c],h=e[o],l=t[o];if(h===l){a[o]=h,(n?c<i:g.call(e,o))&&u++;continue}if(null===h||null===l||"object"!=typeof h||"object"!=typeof l){a[o]=l;continue}const d=O(h,l,r+1);a[o]=d,d===h&&u++}return i===o&&u===i?e:a}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function j(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!P(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!P(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function P(e){return"[object Object]"===Object.prototype.toString.call(e)}function F(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return O(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return O(e,t)}return t}function x(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function C(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var E=Symbol();function T(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn===E&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==E?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function q(e,t){return"function"==typeof e?e(...t):!!e}function A(e,t,r){let n,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),i||(i=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var D=(()=>{let e=()=>a;return{isServer:()=>e(),setIsServer(t){e=t}}})();function U(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}var N=function(e){setTimeout(e,0)},R=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=N;const s=n=>{t?e.push(n):i(()=>{r(n)})};return{batch:s=>{let o;t++;try{o=s()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}(),k=new class extends n{#s=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#s}};function M(e){return Math.min(1e3*2**e,3e4)}function I(e){return"online"!==(e??"online")||k.isOnline()}var K=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function L(e){let t,r=!1,n=0;const s=U(),a=()=>"pending"!==s.status,u=()=>i.isFocused()&&("always"===e.networkMode||k.isOnline())&&e.canRun(),c=()=>I(e.networkMode)&&e.canRun(),h=e=>{a()||(t?.(),s.resolve(e))},l=e=>{a()||(t?.(),s.reject(e))},d=()=>new Promise(r=>{t=e=>{(a()||u())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,a()||e.onContinue?.()}),f=()=>{if(a())return;let t;const i=0===n?e.initialPromise:void 0;try{t=i??e.fn()}catch(s){t=Promise.reject(s)}Promise.resolve(t).then(h).catch(t=>{if(a())return;const i=e.retry??(D.isServer()?0:3),s=e.retryDelay??M,c="function"==typeof s?s(n,t):s,h=!0===i||"number"==typeof i&&n<i||"function"==typeof i&&i(n,t);var p;!r&&h?(n++,e.onFail?.(n,t),(p=c,new Promise(e=>{o.setTimeout(e,p)})).then(()=>u()?void 0:d()).then(()=>{r?l(t):f()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!a()){const r=new K(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),s),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:c,start:()=>(c()?f():d().then(f),s)}}var Q=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),h(this.gcTime)&&(this.#o=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(D.isServer()?1/0:3e5))}clearGcTimeout(){this.#o&&(o.clearTimeout(this.#o),this.#o=void 0)}},G=class extends Q{#a;#u;#c;#h;#l;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#c=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=V(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=V(this.options);void 0!==e.data&&(this.setState(H(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){const r=F(this.state.data,e,this.options);return this.#p({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(u).catch(u):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==f(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===E||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===d(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!l(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#f||this.#y()?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,r.signal)})},i=()=>{const e=T(this.options,t),r=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#f=!1,this.options.persister?this.options.persister(e,r,this):e(r)},s=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:i};return n(e),e})();this.options.behavior?.onFetch(s,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===s.fetchOptions?.meta||this.#p({type:"fetch",meta:s.fetchOptions?.meta}),this.#l=L({initialPromise:t?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof K&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const e=await this.#l.start();if(void 0===e)throw"production"!==process.env.NODE_ENV&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(o){if(o instanceof K){if(o.silent)return this.#l.promise;if(o.revert){if(void 0===this.state.data)throw o;return this.state.data}}throw this.#p({type:"error",error:o}),this.#c.config.onError?.(o,this),this.#c.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#p(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,..._(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...H(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),R.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function _(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function H(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function V(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var $=t.createContext(void 0),z=e=>{const r=t.useContext($);if(e)return e;if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},B=({client:e,children:n})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)($.Provider,{value:e,children:n}));Object.defineProperty(exports,"Query",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"QueryClientProvider",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"Removable",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"Subscribable",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"addConsumeAwareSignal",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"addToEnd",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"addToStart",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"createRetryer",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"ensureQueryFn",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"environmentManager",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"fetchState",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"focusManager",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"functionalUpdate",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"hashKey",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"hashQueryKeyByOptions",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"isValidTimeout",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"matchMutation",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"matchQuery",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"noop",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"notifyManager",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"onlineManager",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"partialMatchKey",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"pendingThenable",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"replaceData",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"resolveEnabled",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"resolveStaleTime",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"shallowEqualObjects",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"shouldThrowError",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"skipToken",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"timeUntilStale",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"timeoutManager",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"useQueryClient",{enumerable:!0,get:function(){return z}});
@@ -0,0 +1 @@
1
+ import{M as t,O as e,S as s,T as i,_ as a,a as r,b as n,c as o,d as u,f as h,g as c,h as l,j as d,m as f,o as y,p,r as m,s as g,x as b,y as v}from"./BOcElY6J.js";function q(t){return{onFetch:(e,s)=>{const i=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,r=e.state.data?.pages||[],n=e.state.data?.pageParams||[];let o={pages:[],pageParams:[]},c=0;const l=async()=>{let s=!1;const l=f(e.options,e.fetchOptions),d=async(t,i,a)=>{if(s)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);const r=await l((()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:i,direction:a?"backward":"forward",meta:e.options.meta};return u(t,()=>e.signal,()=>s=!0),t})()),{maxPages:n}=e.options,o=a?p:h;return{pages:o(t.pages,r,n),pageParams:o(t.pageParams,i,n)}};if(a&&r.length){const t="backward"===a,e=t?P:C,s={pages:r,pageParams:n};o=await d(s,e(i,s),t)}else{const e=t??r.length;do{const t=0===c?n[0]??i.initialPageParam:C(i,o);if(c>0&&null==t)break;o=await d(o,t),c++}while(c<e)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=l}}}function C(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function P(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function O(t,e){return!!e&&null!=C(t,e)}function w(t,e){return!(!e||!t.getPreviousPageParam)&&null!=P(t,e)}var Q=class extends r{#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(t){const e=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=y({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):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:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i="pending"===this.state.status,a=!this.#i.canStart();try{if(i)e();else{this.#a({type:"pending",variables:t,isPaused:a}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);const e=await(this.options.onMutate?.(t,s));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:a})}const r=await this.#i.start();return await(this.#s.config.onSuccess?.(r,t,this.state.context,this,s)),await(this.options.onSuccess?.(r,t,this.state.context,s)),await(this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s)),await(this.options.onSettled?.(r,null,t,this.state.context,s)),this.#a({type:"success",data:r}),r}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,s))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,s))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,s))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,s))}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),o.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}},D=class extends t{constructor(t={}){super(),this.config=t,this.#r=/* @__PURE__ */new Set,this.#n=/* @__PURE__ */new Map,this.#o=0}#r;#n;#o;build(t,e,s){const i=new Q({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#r.add(t);const e=x(t);if("string"==typeof e){const s=this.#n.get(e);s?s.push(t):this.#n.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#r.delete(t)){const e=x(t);if("string"==typeof e){const s=this.#n.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#n.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=x(t);if("string"==typeof e){const s=this.#n.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=x(t);return"string"==typeof e?(this.#n.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){o.batch(()=>{this.#r.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#r.clear(),this.#n.clear()})}getAll(){return Array.from(this.#r)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>v(e,t))}findAll(t={}){return this.getAll().filter(e=>v(t,e))}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return o.batch(()=>Promise.all(t.map(t=>t.continue().catch(b))))}};function x(t){return t.options.scope?.id}var M=class extends t{constructor(t={}){super(),this.config=t,this.#u=/* @__PURE__ */new Map}#u;build(t,e,s){const i=e.queryKey,r=e.queryHash??a(i,e);let n=this.get(r);return n||(n=new m({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(n)),n}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){o.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>n(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>n(t,e)):e}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){o.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},A=class{#h;#s;#c;#l;#d;#f;#y;#p;constructor(t={}){this.#h=t.queryCache||new M,this.#s=t.mutationCache||new D,this.#c=t.defaultOptions||{},this.#l=/* @__PURE__ */new Map,this.#d=/* @__PURE__ */new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#y=d.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=g.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#y?.(),this.#y=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#h.build(this,e),a=s.state.data;return void 0===a?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(i(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#h.get(i.queryHash)?.state.data,r=l(e,a);if(void 0!==r)return this.#h.build(this,i).setData(r,{...s,manual:!0})}setQueriesData(t,e,s){return o.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){const e=this.#h;o.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#h;return o.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=o.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(b).catch(b)}invalidateQueries(t,e={}){return o.batch(()=>(this.#h.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 s={...e,cancelRefetch:e.cancelRefetch??!0},i=o.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(b)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(b)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#h.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(b).catch(b)}fetchInfiniteQuery(t){return t.behavior=q(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(b).catch(b)}ensureInfiniteQueryData(t){return t.behavior=q(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return g.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#l.set(c(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#l.values()],i={};return e.forEach(e=>{s(t,e.queryKey)&&Object.assign(i,e.defaultOptions)}),i}setMutationDefaults(t,e){this.#d.set(c(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#d.values()],i={};return e.forEach(e=>{s(t,e.mutationKey)&&Object.assign(i,e.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const s={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return s.queryHash||(s.queryHash=a(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===e&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};export{q as i,O as n,w as r,A as t};
@@ -0,0 +1 @@
1
+ const e=require("./D4geS7mP.js"),t=require("./BMpF19BV.js");require("./COOPnhZa.js");const r=require("./DvaUOLqe.js");var n=(e,n,o)=>{t.J(t.u(t.MemoryRouter,{children:t.u(r.EventPreviewCard,{event:e,onExplore:o})}),n)};exports.default=({events:r,apiKey:o,is3D:i,onExplore:s,logoUrl:a})=>{const l=t.A(null),c=t.A(null),u=t.A(i);return t.y(()=>{if(!l.current||c.current)return;let t;return(async()=>{const i=(await Promise.resolve().then(()=>e.__toESM(require("./BeV2ILRt.js").default,1))).default;if(!document.querySelector("link[data-qrati-maplibre-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css",e.setAttribute("data-qrati-maplibre-css",""),document.head.appendChild(e)}if(!l.current)return;const d=new i.Map({container:l.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${o}`,center:[0,20],zoom:4,minZoom:2,pitch:0,bearing:0,projection:u.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});c.current=d,d.on("load",()=>{const e=d.getStyle()?.layers??[];let t,o;for(const r of e){const e=r;"symbol"===e.type&&e.layout?.["text-field"]&&!t&&(t=r.id),"building"!==e["source-layer"]||o||(o=e.source)}o&&!d.getLayer("3d-buildings")&&d.addLayer({id:"3d-buildings",source:o,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},t);const l=r.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===l.length)return;const c=new i.LngLatBounds;for(const r of l){const e=r.location.x,t=r.location.y;c.extend([e,t]);const o=document.createElement("div");if(o.className="qrati-map-marker",o.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",a){const e=document.createElement("img");e.src=a,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",o.appendChild(e)}const l=document.createElement("div");n(r,l,s);const u=new i.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-34]}).setDOMContent(l);new i.Marker({element:o}).setLngLat([e,t]).setPopup(u).addTo(d)}c.isEmpty()||d.fitBounds(c,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,animate:!0,duration:1200})}),t=()=>{d.remove(),c.current=null}})(),()=>{t?.()}},[o]),t.y(()=>{c.current&&(u.current=i,c.current.setProjection(i?{type:"globe"}:{type:"mercator"}),c.current.easeTo({pitch:0,bearing:0,duration:600}))},[i]),t.u("div",{ref:l,class:"size-full"})};
@@ -0,0 +1 @@
1
+ const e=require("./D4geS7mP.js"),t=require("./BMpF19BV.js"),r=require("./BW8JB9yA.js"),n=require("./CrKuU6G6.js");require("./COOPnhZa.js");const o=require("./DvaUOLqe.js");var i=new n.QueryClient,s=(e,n,s)=>{t.J(t.u(r.QueryClientProvider,{client:i,children:t.u(t.MemoryRouter,{children:t.u(o.EventPreviewCard,{event:e,onExplore:s})})}),n)};exports.default=({events:r,onExplore:n,apiKey:o,is3D:i,logoUrl:a})=>{const l=t.A(null),c=t.A(null),u=t.A(i);return t.y(()=>{if(!l.current||c.current)return;let t;return(async()=>{const i=(await Promise.resolve().then(()=>e.__toESM(require("./COCwvQDi.js").default,1))).default;if(!document.querySelector("link[data-qrati-mapbox-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/mapbox-gl@3.20.0/dist/mapbox-gl.css",e.setAttribute("data-qrati-mapbox-css",""),document.head.appendChild(e)}if(!l.current)return;i.accessToken=o;const d=new i.Map({container:l.current,style:"mapbox://styles/mapbox/streets-v12",center:[0,20],zoom:4,minZoom:2,pitch:u.current?60:0,bearing:u.current?-20:0,antialias:!0});c.current=d,d.on("style.load",()=>{d.getLayer("3d-buildings")||d.addLayer({id:"3d-buildings",source:"composite","source-layer":"building",filter:["==","extrude","true"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":"#aaa","fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,14.05,["get","height"]],"fill-extrusion-base":["interpolate",["linear"],["zoom"],14,0,14.05,["get","min_height"]],"fill-extrusion-opacity":.6}})}),d.on("load",()=>{const e=r.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===e.length)return;const t=new i.LngLatBounds;for(const r of e){const e=r.location.x,o=r.location.y;t.extend([e,o]);const l=document.createElement("div");if(l.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",a){const e=document.createElement("img");e.src=a,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",l.appendChild(e)}const c=document.createElement("div");s(r,c,n);const u=new i.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-20]}).setDOMContent(c);new i.Marker({element:l}).setLngLat([e,o]).setPopup(u).addTo(d)}t.isEmpty()||d.fitBounds(t,{padding:60,maxZoom:14,duration:1200})}),t=()=>{d.remove(),c.current=null}})(),()=>{t?.()}},[o]),t.y(()=>{c.current&&(u.current=i,c.current.easeTo({pitch:i?60:0,bearing:i?-20:0,duration:800}))},[i]),t.u("div",{ref:l,class:"size-full"})};
@@ -0,0 +1 @@
1
+ require("./D4geS7mP.js");const t=require("./T39bw9GN.js"),e=require("./BMpF19BV.js"),n=require("./BW8JB9yA.js"),i=require("./DEk8rfah.js"),s=require("./COOPnhZa.js");let o=require("react"),r=require("react/jsx-runtime");function a(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function l(t,e,n){const[[i],s]=(0,o.useReducer)(a,[n]),r=function(t){const[e,n]=(0,o.useState)(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),l=(0,o.useRef)(void 0);return{containerRef:(0,o.useCallback)(e=>{l.current?.disconnect(),l.current=void 0;const n=()=>s(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,r));n(),e&&"undefined"!=typeof ResizeObserver&&(l.current=new ResizeObserver(n),l.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,r]),containerWidth:i}}function c(t){return["react-photo-album",t].filter(Boolean).join("--")}function d({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var u=Object.freeze([1200,600,300,0]);function h(t,e){return"function"==typeof t?t(e):t}function p(t,e){return void 0!==e?h(t,e):void 0}function m(t,e,n,i=0){if(void 0===e)return;const s=p(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=u.findIndex(t=>t<=e);return h(t[Math.max(n,0)],e)}(n,e):s,i))}function g(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:m(e,t,[20,15,10,5]),padding:m(n,t,[0,0,0,0]),componentsProps:h(i,t)||{},render:h(s,t)}}function f(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function T(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${f((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var w=(0,o.forwardRef)(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:a,children:l,...d},u){const h=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(c),a),p={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${c(n)}`),"number"==typeof e?f(e,5):e];var n})),...o},className:h,children:l,...d};if(e){const t=e({ref:u,...p},n);if(t)return t}return(0,r.jsx)(t||"div",{ref:u,...p})}),y=(0,o.forwardRef)(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:a,button:l,image:c,extras:d}={},componentsProps:{link:u,button:h,wrapper:p,image:m}={}},g){const{href:T}=t,y={photo:t,index:e,width:f(n,3),height:f(i,3)};let v;return v=T?{...u,as:"a",render:a,classes:["photo","link"],href:T,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...p,render:o,classes:"photo"},(0,r.jsxs)(w,{ref:g,variables:{photoWidth:y.width,photoHeight:y.height},context:y,...v,children:[(0,r.jsx)(w,{as:"img",classes:"image",render:c,context:y,...m}),d?.({},y)]})}),v=(0,o.forwardRef)(function({layout:t,sizes:e,model:n,skeleton:i,onClick:s,render:{container:a,track:l,photo:c,...d}={},componentsProps:{container:u,track:p,link:m,button:g,wrapper:f,image:v}={}},b){const{spacing:_,padding:x,containerWidth:k,tracks:q,variables:E,horizontal:S}=n||{};return(0,r.jsxs)(w,{role:"group","aria-label":"Photo album",...u,variables:{spacing:_,padding:x,containerWidth:k,...E},classes:["",t],render:a,ref:b,children:[void 0!==_&&void 0!==x&&void 0!==k&&q?.map(({photos:t,variables:n},i)=>{const a=t.length,u=S?a:q.length;return(0,o.createElement)(w,{...p,key:i,render:l,classes:"track",variables:{trackSize:a,...n}},t.map(t=>{const{photo:n,index:i,width:o}=t,{key:a,src:l,alt:p="",title:w,label:b}=n,q=s?t=>{s({event:t,photo:n,index:i})}:void 0;if(c){const e=c({onClick:q},t);if(e)return e}const E=t=>b?{"aria-label":b,...t}:t;return(0,r.jsx)(y,{onClick:q,render:d,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:p,title:w,...T(n,e,o,k,u,_,x),...h(v,t)},link:E(h(m,t)),button:E(h(g,t)),wrapper:h(f,t)},...t},a??i)}))}),void 0===k&&i]})});function b(t,e,n){return function(t,e){if(!t)return;const n=[];for(let i=e;void 0!==i;i=t.get(i))n.push(i);return n.reverse()}(function(t,e,n){const i=new Map,s=new Set,o=new Map;o.set(e,0);const r=function(t){let e=0;const n=[],i=(e,i)=>t(n[e],n[i])<0,s=(t,e)=>{const i=n[t];n[t]=n[e],n[e]=i};return{push:t=>{e+=1,n[e]=t,(t=>{let e=t,n=Math.floor(e/2);for(;e>1&&i(n,e);)s(n,e),e=n,n=Math.floor(e/2)})(e)},pop:()=>{if(0===e)return;s(1,e),e-=1;const t=n.pop();return(()=>{let t=1,n=2*t;for(;n<=e&&(n<e&&i(n,n+1)&&(n+=1),i(t,n));)s(t,n),t=n,n=2*t})(),t},size:()=>e}}((a=t=>t[1],(t,e)=>a(e)-a(t)));var a;for(r.push([e,0]);r.size()>0;){const[e,n]=r.pop();if(!s.has(e)){const a=t(e);s.add(e),a.forEach((t,s)=>{const a=n+t,l=i.get(s),c=o.get(s);(void 0===c||c>a&&(c/a>1.005||void 0!==l&&l<e))&&(o.set(s,a),r.push([s,a]),i.set(s,e))})}}return o.has(n)?i:void 0}(t,e,n),n)}function _(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+d(e),0)}function x(t,e,n,i,s,o,r){const a=t.slice(e,n),l=_(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}var k=(0,o.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:a,containerWidth:c}=l(s,e,n),{spacing:u,padding:h,targetRowHeight:T,minPhotos:w,maxPhotos:y,...k}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=g(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=p(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:m(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:d,maxPhotos:u,componentsProps:a}}(c,{photos:t,...i});return(0,r.jsx)(v,{layout:"rows",ref:a,model:(0,o.useMemo)(()=>void 0!==c&&void 0!==u&&void 0!==h&&void 0!==T?function(t,e,n,i,s,o,r){const a=b(function(t,e,n,i,s,o,r,a){return l=>{const c=new Map;c.set(l,0);const d=r||1,u=Math.min(o,a||1/0);for(let o=l+d;o<t.length+1&&!(o-l>u);o+=1){const r=x(t,l,o,i,e,n,s);if(void 0===r)break;c.set(o,r)}return c}}(t,e,n,i,s,function(t,e,n,i){return f(e/n/Math.min(...t.map(t=>d(t))))+(i||0)+2}(t,i,s,o),o,r),0,t.length);if(!a)return;const l=[];for(let c=1;c<a.length;c+=1){const s=t.slice(a[c-1],a[c]).map((t,e)=>({photo:t,index:a[c-1]+e})),o=_(s.map(({photo:t})=>t),i,e,n);l.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*d(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:l,horizontal:!0}}(t,u,h,c,T,w,y):void 0,[t,u,h,c,T,w,y]),...k})});function q(t,e,n,i,s,o,r){const a=[],l=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const u=e.slice(t[c],t[c+1]).map((e,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),p=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/l;a.push({photos:u.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/d(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:a,variables:{totalRatio:l}}}function E(t,e,n,i,s,o){const r=[],a=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+d(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,a[e]=e<t.length?d(t[e]):s;return q(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,a)}const l=(c=function(t,e,n,i,s){return o=>{const r=[],a=1.5*s;let l=i/d(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-l)**2]),!(l>a||c===t.length));c+=1)l+=i/d(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/d(e),0)+e*(t.length-o)+2*n*t.length)/o),u=o,h=0,p=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=new Map,o=new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,u=c[r+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,u,h,p),u,p));var c,u,h,p;for(let m=0;m<l.length-1;m+=1){const i=t.slice(l[m],l[m+1]);r[m]=e*(i.length-1)+2*n*i.length,a[m]=1/i.reduce((t,e)=>t+1/d(e),0)}return q(l,t,e,n,i,r,a)}function S(t,e,n,i,s){const{tracks:o,variables:r}=E(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?S(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var A=(0,o.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:a,containerWidth:c}=l(s,e,n),{spacing:d,padding:u,columns:h,...p}=function(t,{columns:e,...n}){return{...n,...g(t,n),columns:m(e,t,[5,4,3,2],1)}}(c,{photos:t,...i});return(0,r.jsx)(v,{layout:"columns",ref:a,model:(0,o.useMemo)(()=>void 0!==c&&void 0!==d&&void 0!==u&&void 0!==h?S(t,d,u,c,h):void 0,[t,d,u,c,h]),...p})});function C(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?C(t,e,n,i,s-1):void 0;const r=[];for(let l=0;l<s;l+=1)r[l]=0;const a=t.reduce((t,i,s)=>{const a=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[a]=r[a]+o/d(i)+e+2*n,t[a].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:a.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/d(t)}))}))}}var I=(0,o.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:a,containerWidth:c}=l(s,e,n),{spacing:d,padding:u,columns:h,...p}=function(t,{columns:e,...n}){return{...n,...g(t,n),columns:m(e,t,[5,4,3,2],1)}}(c,{photos:t,...i});return(0,r.jsx)(v,{layout:"masonry",ref:a,model:(0,o.useMemo)(()=>void 0!==c&&void 0!==d&&void 0!==u&&void 0!==h?C(t,d,u,c,h):void 0,[t,d,u,c,h]),...p})});function L(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var N=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${L(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${L(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${L(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${L(t.description)}</div>\n </div>\n `),e+="</div>",e}},M='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',R=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=M,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=M,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0),document.querySelector("#pswp__icn-hide-backdrop").style.display=this.backdropOn?"none":"inline",document.querySelector("#pswp__icn-show-backdrop").style.display=this.backdropOn?"inline":"none"}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=e.data.blurhash||"LEHV6nWB2yk8pyo0adR*.7kCMdnj";if(t){const e=this.createBlurhashCanvas(t,200,200);e.startsWith("data:")?this.backgroundElement.style.backgroundImage=`url('${e}')`:(this.backgroundElement.style.backgroundImage="none",this.backgroundElement.style.backgroundColor=e)}else this.backgroundElement.style.backgroundImage=`url('${e.data.thumbnailUrl}')`;this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}createBlurhashCanvas(t,e=100,n=100){const i=document.createElement("canvas");i.width=e,i.height=n;try{const o=i.getContext("2d"),r=s.j(t,e,n);if(r&&r.length>0){const t=o.createImageData(e,n);return t.data.set(r),o.putImageData(t,0,0),i.toDataURL()}throw new Error("Empty pixels array")}catch(o){return console.warn("Failed to decode blurhash for backdrop:",o),this.blurhashToColor(t)}}blurhashToColor(t){const e=["#8B9DC3","#DFB2A3","#C4B5A0","#A8B8C8","#B8A898"];return e[t.charCodeAt(0)%e.length]}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}};function P(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var O={[i.AD_TARGET_TYPES.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[i.AD_TARGET_TYPES.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[i.AD_TARGET_TYPES.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[i.AD_TARGET_TYPES.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[i.AD_TARGET_TYPES.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[i.AD_TARGET_TYPES.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},B=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn,document.querySelector("#pswp__icn-show-caption").style.display=this.captionOn?"inline":"none",document.querySelector("#pswp__icn-hide-caption").style.display=this.captionOn?"none":"inline"}createCaptionHTML(t){const{id:e,type:n,caption:s,title:o,description:r,targetType:a,targetText:l,targetUrl:c}=t||{};switch("ad"===n&&this.captureAdImpression&&this.captureAdImpression(e),n){case"image":case"video":return s?.length>0?`\n <div class=" w-full bg-black bg-opacity-50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${P(s)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${P(o)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${P(r)}</h4>\n <button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${P(e)}"\n data-target-type="${P(a||i.AD_TARGET_TYPES.LINK)}"\n data-target-url="${P(c)}">\n ${O[a||i.AD_TARGET_TYPES.LINK]}\n ${P(l)}\n </button>\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=document.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(".caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=document.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},D=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0),document.querySelector("#pswp__icn-exit-fullscreen").style.display=this.fullscreen?"inline":"none",document.querySelector("#pswp__icn-fullscreen").style.display=this.fullscreen?"none":"inline"}},V=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),document.head.insertAdjacentHTML("beforeend",`<style>.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}</style>`),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}init(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer()),document.querySelector("#pswp__icn-stop").style.display=this.slideshowIsRunning?"inline":"none",document.querySelector("#pswp__icn-play").style.display=this.slideshowIsRunning?"none":"inline",document.querySelector(".pswp__progress-bar").style.opacity=this.options.autoHideProgressBar?null:1,this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=document.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=document.querySelector(".pswp__progress-bar");t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running")}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},z={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function $(t){return t&&t.data&&"video"===t.data.type}var H=class{constructor(t,e){this.options=e,this.initLightboxEvents(t),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initLightboxEvents(t){t.on("contentLoad",this.onContentLoad.bind(this)),t.on("contentDestroy",this.onContentDestroy.bind(this)),t.on("contentActivate",this.onContentActivate.bind(this)),t.on("contentDeactivate",this.onContentDeactivate.bind(this)),t.on("contentAppend",this.onContentAppend.bind(this)),t.on("contentResize",this.onContentResize.bind(this)),t.addFilter("isKeepingPlaceholder",this.isKeepingPlaceholder.bind(this)),t.addFilter("isContentZoomable",this.isContentZoomable.bind(this)),t.addFilter("useContentPlaceholder",this.useContentPlaceholder.bind(this)),t.addFilter("domItemData",(t,e,n)=>("video"===t.type&&n&&(n.dataset.pswpVideoSources?t.videoSources=JSON.parse(n.dataset.pswpVideoSources):n.dataset.pswpVideoSrc?t.videoSrc=n.dataset.pswpVideoSrc:t.videoSrc=n.href),t))}initPswpEvents(t){t.on("pointerDown",e=>{const n=t.currSlide;if($(n)&&this.options.preventDragOffset){const i=e.originalEvent;if("pointerdown"===i.type){const s=Math.ceil(n.height*n.currZoomLevel)+n.bounds.center.y,o=i.pageY-t.offset.y;o>s-this.options.preventDragOffset&&o<s&&e.preventDefault()}}}),t.on("appendHeavy",t=>{$(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{$(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){$(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if($(t.content)){t.preventDefault();const e=t.width,n=t.height,i=t.content;if(i.element&&(i.element.style.width=`${e}px`,i.element.style.height=`${n}px`),i.slide&&i.slide.placeholder){const t=i.slide.placeholder.element.style;t.transform="none",t.width=`${e}px`,t.height=`${n}px`}}}isKeepingPlaceholder(t,e){return!$(e)&&t}isContentZoomable(t,e){return!$(e)&&t}onContentActivate({content:t}){$(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){$(t)&&this.pauseVideo(t)}onContentAppend(t){$(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if($(t.content)&&(t.preventDefault(),!e.element)){if(e.state="loading",e.type="video",e.element=document.createElement("video"),this.options.videoAttributes)for(let t in this.options.videoAttributes)e.element.setAttribute(t,this.options.videoAttributes[t]||"");e.element.setAttribute("poster",e.data.msrc),this.preloadVideoPoster(e,e.data.msrc),e.element.style.position="relative",e.element.style.left=0,e.element.style.top=0,e.data.videoSources?e.data.videoSources.forEach(t=>{let n=document.createElement("source");n.src=t.src,n.type=t.type,e.element.appendChild(n)}):e.data.videoSrc&&(e.element.src=e.data.videoSrc)}}preloadVideoPoster(t,e){!t._videoPosterImg&&e&&(t._videoPosterImg=new Image,t._videoPosterImg.src=e,t._videoPosterImg.complete?t.onLoaded():t._videoPosterImg.onload=t._videoPosterImg.onerror=()=>{t.onLoaded()})}playVideo(t){t.element&&t.element.play()}pauseVideo(t){t.element&&t.element.pause()}useContentPlaceholder(t,e){return!!$(e)||t}},U=class{constructor(t,e={}){new H(t,{...z,...e})}},j=({open:n,ad:s,onClose:o,captureAdClick:r})=>e.u(t.Dialog,{open:Boolean(n&&s),onOpenChange:t=>!t&&o?.(),children:e.u(t.DialogContent,{children:[e.u(t.DialogHeader,{className:"hidden",children:[e.u(t.DialogTitle,{children:s?.title}),e.u(t.DialogDescription,{children:s?.description})]}),e.u("div",{className:"flex max-w-lg flex-col overflow-hidden",children:[e.u("img",{className:"h-auto max-h-96 w-full object-contain",src:s?.imageUrl,alt:"Image not found"}),e.u("div",{className:"flex flex-col gap-2 p-3",children:[e.u(t.Typography,{variant:"h4",align:"center",lines:2,children:s?.title}),e.u(t.Typography,{variant:"body3",color:"secondary",align:"center",lines:6,children:s?.description})]}),e.u(t.Button,{fullWidth:!0,className:"rounded-t-none",onClick:()=>r?.(s?._id,s?.targetType??i.AD_TARGET_TYPES.LINK,s?.targetUrl),icon:i.AD_TARGET_TYPE_ICONS[s?.targetType]??i.AD_TARGET_TYPE_ICONS[i.AD_TARGET_TYPES.LINK],children:s?.targetText})]})]})}),F=({url:t,alt:n="",thumbnailUrl:o,blurhash:r,pswpData:a={},curateLink:l,onClick:c})=>{const d=e.u(e.k,{children:[e.u(s.LazyLoadImage,{threshold:.1,src:o||t,blurhash:r,alt:n}),a.type===i.CONTENT_TYPES.VIDEO&&e.u("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:e.u("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:e.u("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});return c?e.u("button",{className:"h-full w-full",onClick:c,children:d}):l?e.u(e.Link,{to:l,className:"h-full w-full",children:d}):e.u("a",{href:t,className:"pswp-item block h-full w-full",...Object.keys(a).reduce((t,e)=>{var n;return t[`data-pswp-${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=String(a[e]),t},{}),target:"_blank",rel:"noreferrer",children:d})},Y=({style:n,content:o,curateLink:r,onAdClick:a})=>{const{captureAdImpression:l,captureAdEngagement:c,captureAdClick:d}=t.useAnalytics();return e.u("div",{style:n,className:"group relative mb-1 overflow-hidden rounded",children:[e.u(s.InView,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&l(o._id)},onClick:()=>c(o._id),children:e.u(F,{url:o.src,thumbnailUrl:o.src,blurhash:o.blurhash,alt:o.caption,onClick:r?a:void 0,pswpData:{id:o._id,type:i.CONTENT_TYPES.AD,hash:o._id,width:o.width,height:o.height,title:o.title,description:o.description,targetType:o.targetType,targetText:o.targetText,targetUrl:o.targetUrl,thumbnailUrl:o.imageUrl,blurhash:o.blurhash}})}),e.u("div",{className:"transition-opacity duration-500 group-hover:opacity-100 sm:opacity-0",children:e.u("div",{className:"text-foreground bg-background bg-opacity-75 absolute bottom-0 w-full flex-col items-center justify-between sm:flex sm:flex-row",children:[e.u("h3",{className:"text-foreground line-clamp-2 p-2 text-sm font-medium sm:ml-3 sm:line-clamp-1 sm:p-0",children:o.title}),o?.targetType!==i.AD_TARGET_TYPES.NONE&&e.u(t.Button,{immutable:!0,className:"w-full rounded-t-none py-1 text-nowrap sm:w-auto sm:rounded-t-none sm:rounded-bl-none sm:py-2",onClick:()=>d(o._id,o.targetType,o.targetUrl),iconName:i.AD_TARGET_TYPE_ICONS[o?.targetType??i.AD_TARGET_TYPES.LINK],children:o?.targetText})]})})]})},G=e.R(null),W=()=>{const t=e.x(G);if(!t)throw new Error("Popover components must be used within a Popover");return t},K=({children:t,className:n,open:i,onOpenChange:s})=>{const[o,r]=e.d(!1),a="boolean"==typeof i,l=a?i:o,c=e.g(),d=`popover-trigger-${c}`,u=`popover-content-${c}`,h=e.A(null);return e.u(G.Provider,{value:{isOpen:l,setIsOpen:t=>{a||r(t),s?.(t)},triggerId:d,contentId:u,triggerRef:h},children:e.u("div",{"data-slot":"popover",className:e.cn("relative inline-block",n),children:t})})},Q=({children:t,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:r,setIsOpen:a,triggerId:l,contentId:c,triggerRef:d}=W();if(e.y(()=>{if(!n)return;const t=document.getElementById(l);return d.current=t,()=>{d.current===t&&(d.current=null)}},[n,l,d]),n){const n=Array.isArray(t)?t[0]:t;if(n&&n.type){const t=n.props?.className;return e.Q(n,{id:l,className:i?t?`${t} ${i}`:i:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{a(!r),n.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}return e.u("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:i,onClick:t=>{a(!r),s?.(t)},...o,children:t})},Z=({children:t,className:n,align:s="center",side:o="top",sideOffset:r=4,...a})=>{const{isOpen:l,setIsOpen:c,contentId:d,triggerRef:u}=W(),{organization:h}=i.useSession(),p=e.A(null),[m,g]=e.d(null);if(e._(()=>{if(!l)return;const t=()=>{if(!u.current||!p.current)return;const t=u.current.getBoundingClientRect(),e=p.current.getBoundingClientRect();let n=t.left,i=t.bottom+r;"center"===s&&(n=t.left+t.width/2-e.width/2),"end"===s&&(n=t.right-e.width),"top"===o&&(i=t.top-e.height-r),"left"===o&&(n=t.left-e.width-r,i=t.top+t.height/2-e.height/2),"right"===o&&(n=t.right+r,i=t.top+t.height/2-e.height/2),"bottom"===o&&(i=t.bottom+r),g({top:i,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[s,l,o,r,u]),e.y(()=>{if(!l)return;const t=t=>{const e=t.target;p.current&&!p.current.contains(e)&&u.current&&!u.current.contains(e)&&c(!1)},e=t=>{"Escape"===t.key&&(c(!1),u.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[l,c,u]),!l)return null;const f=e.u("div",{ref:p,id:d,role:"dialog","aria-modal":"false","data-state":l?"open":"closed",className:e.cn("bg-background text-foreground border-border shadow-outer rounded outline-none",n),style:{position:"fixed",top:m?.top??0,left:m?.left??0,zIndex:2010,...e.getStyleObject(h)},...a,children:t});return"undefined"!=typeof document?i.$(f,document.body):f},J=({eventId:s,contentId:o,emojis:r=[],counts:a={},userReaction:l})=>{const{user:c,props:d,organization:u}=i.useSession(),h=d?.loginUrl,{handleReactionClick:p}=(()=>{const e=n.useQueryClient(),{props:s,user:o}=i.useSession(),r=s?.organizationId;return{handleReactionClick:async(n,s,a)=>{if(!n||!s||!a)return!1;if(!o)return t.y.error("Please login to react"),!1;const l=[i.QUERY_KEYS.CONTENTS_BY_EVENT(n)],c=e.getQueriesData({queryKey:l});e.setQueriesData({queryKey:l},t=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id===s){const e={...t.reactionCounts};return t.userReaction&&t.userReaction!==a&&(e[t.userReaction]=Math.max(0,(e[t.userReaction]??1)-1)),t.userReaction===a?(e[a]=Math.max(0,(e[a]??1)-1),{...t,reactionCounts:e,userReaction:void 0}):(e[a]=(e[a]??0)+1,{...t,reactionCounts:e,userReaction:a})}return t})}:t)}:t);try{return await i.ky.post(i.API_ROUTES.UPDATE_REACTION,{json:{eventId:n,contentId:s,reaction:a},headers:{"x-org-id":r,Authorization:`Bearer ${o.token}`}}),!0}catch(d){return c.forEach(([t,n])=>{e.setQueryData(t,n)}),t.y.error("Failed to add reaction"),console.error("Error handling reaction click:",d),!1}}}})(),[m,g]=e.d(!1),[f,T]=e.d(!1),w=Object.values(a).reduce((t,e)=>t+e,0);return e.u(K,{open:m,onOpenChange:g,children:[e.u(Q,{children:e.u("div",{className:e.cn("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform active:scale-90 sm:gap-2 sm:py-0",l&&"ring-primary ring-1"),children:[(r||[]).slice().sort((t,e)=>(a[e]||0)-(a[t]||0)).slice(0,1).map(t=>e.u("span",{className:"text-sm sm:text-lg",children:l||t},`${o}-${t}-1`)),w>0&&e.u("span",{className:"text-xs font-bold sm:text-sm",children:w||0})]})}),e.u(Z,{side:"top",align:"end",children:[c?null:u?.customAuth?e.u("div",{className:"p-2 font-semibold",children:["Please"," ",e.u("a",{className:"text-info underline",href:h,children:"Login"})," ","to react"]}):e.u("div",{className:"p-2 font-semibold",children:["Please"," ",e.u(e.Link,{className:"text-info underline",to:i.PAGE_ROUTES.LOGIN,children:"Login"})," ","to react"]}),c&&e.u("div",{className:"flex gap-1 p-2",children:r.map(t=>{const n=l===t;return e.u("div",{className:"flex flex-col items-center",children:[e.u("span",{className:"text-xs font-medium",children:a[t]||0}),e.u("button",{type:"button",disabled:f,className:e.cn("text-3xl transition-transform disabled:opacity-50",n?"scale-125":"hover:scale-110",f&&"cursor-not-allowed"),onClick:()=>(async t=>{!f&&p&&(T(!0),await p(s,o,t)&&g(!1),T(!1))})(t),children:t})]},`${o}-${t}-2`)})})]})]})},X=({event:n={},content:s,curateLink:o})=>n.engagementStyle===i.ENGAGEMENT_STYLES.CONTEST?e.u("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[e.u(t.Iconify,{name:"material-symbols:star-half-rounded",className:"size-4"}),e.u("span",{className:"text-xs font-semibold",children:parseFloat(String(s.score||0)).toFixed(1)})]}):n.engagementStyle===i.ENGAGEMENT_STYLES.REACTION&&n.reactionEmojis?.length?e.u(J,{eventId:n?._id,contentId:s._id,emojis:n?.reactionEmojis,engagementStyle:n?.engagementStyle,counts:s.reactionCounts||{},userReaction:s.userReaction}):null,tt=({content:t})=>e.u("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&e.u("span",{className:"hidden w-full py-1 text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block","data-tooltip-target":"tooltip-default",children:e.u("div",{className:"hover:text-foreground lg:text-md line-clamp-2 text-xs text-white lg:font-medium",title:t?.caption,role:"note",children:t?.caption})}),e.u("div",{className:"flex items-center justify-between",children:e.u("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:t?.user?.name})})]}),et=({event:n,content:s,style:o,timestampField:r,curateLink:a,onChangeFaceUrl:l,hideControls:c})=>{const{organization:d}=i.useSession(),u=`content-${s._id}`,h=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(r,s);return e.u("div",{id:u,style:o,className:"group relative mb-1 overflow-hidden rounded",children:[e.u(F,{url:s.src,alt:s.caption,blurhash:s.blurhash,thumbnailUrl:s.thumbnailUrl,curateLink:a,pswpData:{id:s._id,type:i.CONTENT_TYPES.IMAGE,hash:s._id,width:s.width,height:s.height,thumbnailUrl:s.thumbnailUrl,blurhash:s.blurhash,caption:s.caption,contentSummary:JSON.stringify(s.contentSummary)}}),!c&&e.u(e.k,{children:[h&&e.u("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:h}),d?.integrationSettings?.showQuickSearch&&(s.faces?.length??0)>0&&e.u("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:()=>{l?.(s?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:e.u(t.Iconify,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),e.u("div",{className:"",children:[e.u("div",{className:"absolute bottom-0 w-full rounded-b",children:e.u(tt,{content:s})}),e.u("div",{className:"absolute right-2 bottom-2",children:e.u(X,{event:n,content:s,curateLink:a})})]})]})]})},nt=({content:t,style:n,event:s,timestampField:o,curateLink:r,hideControls:a})=>{const l=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(o,t);return e.u("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded",style:n,children:[e.u(F,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:r,pswpData:{id:t._id,type:i.CONTENT_TYPES.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!a&&e.u("div",{className:"transition-opacity duration-500",children:[l&&e.u("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:l}),e.u("div",{className:"absolute bottom-0 w-full rounded-b",children:e.u(tt,{content:t})}),e.u("div",{className:"absolute right-2 bottom-2",children:e.u(X,{event:s,content:t,curateLink:r})})]})]})};exports.default=({event:n,contents:s=[],singleColumnMode:o,kioskMode:r,timestampField:a,curateLink:l,onChangeFaceUrl:c})=>{const d=e.A(null),u=e.A(null),h=e.T(()=>`gallery-${n?._id??""}`,[n]),{captureAdImpression:p,captureAdClick:m}=t.useAnalytics(),{organization:g}=i.useSession(),[f,T]=e.d(null);e.y(()=>{const e=u.current;if(!l&&e){const n=new t.lightbox_default({gallery:e,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:t.loadPhotoSwipe});d.current=n,new U(n),new R(n),new B(n,p,m),new D(n),new V(n),g?.navigationSettings?.showAIDescription&&new N(n,{width:"400px",height:"40%"}),n.init()}return()=>{d.current?.destroy?.(),d.current=null}},[n?.galleryLayout,l,m,p,h,g]);const w=e.T(()=>{switch(n?.galleryLayout){case i.GALLERY_LAYOUTS.ROW:return k;case i.GALLERY_LAYOUTS.COLUMN:return A;case i.GALLERY_LAYOUTS.MASONRY:return I;default:return k}},[o,n?.galleryLayout]);return e.u(e.k,{children:[e.u("div",{id:h,ref:u,className:e.cn(o?"w-full lg:w-1/3":"w-full"),children:e.u(w,{spacing:4,targetRowHeight:o?500:360,columns:t=>o?1:t<400?2:t<800?3:4,photos:s.map(t=>({src:t.type===i.CONTENT_TYPES.IMAGE||t.type===i.CONTENT_TYPES.VIDEO?t.url:t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:t,className:n,children:i})=>e.u("div",{ref:t,className:n??"",children:i}),photo:(t,{photo:s,width:o,height:d,index:u})=>{const h=s;let p=null;switch(h.type){case i.CONTENT_TYPES.IMAGE:p=et;break;case i.CONTENT_TYPES.VIDEO:p=nt;break;case i.CONTENT_TYPES.AD:p=Y;break;default:p=null}return p&&e.u(p,{style:{width:o,height:d},event:n,content:h,timestampField:a,onAdClick:()=>{T(h)},hideControls:r,curateLink:l?`${l}/${h._id}`:null,onChangeFaceUrl:c},`${h._id??u}-${u}`)}}})}),e.u(j,{ad:f,onClose:()=>T(null),captureAdClick:m})]})};
@@ -0,0 +1 @@
1
+ const e=require("./D4geS7mP.js"),t=require("./BMpF19BV.js");let r=require("react");r=e.__toESM(r);var n=({as:e="div",className:r,threshold:n=.5,rootMargin:o="0px",triggerOnce:a,onChange:s,onClick:i,children:l})=>{const h=t.A(null),c=t.A(!1);return t.y(()=>{const e=h.current;if(!e)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&c.current||(e.isIntersecting&&(c.current=!0),s?.(e.isIntersecting))})},{threshold:n,rootMargin:o});return t.observe(e),()=>t.disconnect()},[n,o,s,a]),t.u(e,{ref:h,className:r,onClick:i,children:l})},o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],a=e=>{let t=0;for(let r=0;r<e.length;r++){let n=e[r];t=83*t+o.indexOf(n)}return t},s=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},i=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},l=(e,t)=>(e=>e<0?-1:1)(e)*Math.pow(Math.abs(e),t),h=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},c=e=>{let t=e>>8&255,r=255&e;return[s(e>>16),s(t),s(r)]},u=(e,t)=>{let r=Math.floor(e/361),n=Math.floor(e/19)%19,o=e%19;return[l((r-9)/9,2)*t,l((n-9)/9,2)*t,l((o-9)/9,2)*t]},d=(e,t,r,n)=>{(e=>{if(!e||e.length<6)throw new h("The blurhash string must be at least 6 characters");let t=a(e[0]),r=Math.floor(t/9)+1,n=t%9+1;if(e.length!==4+2*n*r)throw new h(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*n*r}`)})(e),n|=1;let o=a(e[0]),s=Math.floor(o/9)+1,l=o%9+1,d=(a(e[1])+1)/166,p=new Array(l*s);for(let i=0;i<p.length;i++)p[i]=0===i?c(a(e.substring(2,6))):u(a(e.substring(4+2*i,6+2*i)),d*n);let f=4*t,g=new Uint8ClampedArray(f*r);for(let a=0;a<r;a++)for(let e=0;e<t;e++){let n=0,o=0,h=0;for(let i=0;i<s;i++)for(let s=0;s<l;s++){let c=Math.cos(Math.PI*e*s/t)*Math.cos(Math.PI*a*i/r),u=p[s+i*l];n+=u[0]*c,o+=u[1]*c,h+=u[2]*c}let c=i(n),u=i(o),d=i(h);g[4*e+0+a*f]=c,g[4*e+1+a*f]=u,g[4*e+2+a*f]=d,g[4*e+3+a*f]=255}return g},p=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,y=(e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))m.call(t,r)&&y(e,r,t[r]);if(b)for(var r of b(t))w.call(t,r)&&y(e,r,t[r]);return e},M=(e,t)=>f(e,g(t)),j=(e,t)=>{var r={};for(var n in e)m.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&b)for(var n of b(e))t.indexOf(n)<0&&w.call(e,n)&&(r[n]=e[n]);return r},O=class extends r.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:n}=this.props;if(this.canvas){let o=d(e,n,t,r),a=this.canvas.getContext("2d"),s=a.createImageData(n,t);s.data.set(o),a.putImageData(s,0,0)}}}componentDidUpdate(){this.draw()}render(){let e=this.props,{hash:t,height:n,width:o}=e,a=j(e,["hash","height","width"]);return r.createElement("canvas",M(v({},a),{height:n,width:o,ref:this.handleRef}))}};O.defaultProps={height:128,width:128};var x={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},C=class extends r.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let e=this.props,{hash:t,height:n,width:o,punch:a,resolutionX:s,resolutionY:i,style:l}=e,h=j(e,["hash","height","width","punch","resolutionX","resolutionY","style"]);return r.createElement("div",M(v({},h),{style:M(v({display:"inline-block",height:n,width:o},l),{position:"relative"})}),r.createElement(O,{hash:t,height:i,width:s,punch:a,style:x}))}};C.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var P=O,E=({src:e,alt:r,threshold:o=.1,rootMargin:a="200px 0px",blurhash:s,containerClassName:i="size-full",wrapperClassName:l,imgClassName:h="",sizeMode:c="cover",position:u="center",delayMs:d=100,delayTime:p,onClick:f})=>{const g=s&&s.length>=6?s:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[b,m]=t.d(!1),[w,y]=t.d(!1),[v,M]=t.d(!1),j=t.A(null),O="number"==typeof p?p:d,x=l??i;t.y(()=>{if(!b)return v?j.current=window.setTimeout(()=>{y(!0)},O):j.current&&(clearTimeout(j.current),j.current=null),()=>{j.current&&clearTimeout(j.current)}},[v,b,O]);const C=w&&v||b;return t.u(n,{as:"div",className:t.cn(x,"relative overflow-hidden"),threshold:o,rootMargin:a,onChange:e=>M(e),children:[!b&&t.u(P,{className:"size-full blur-2xl",hash:g}),C&&e&&t.u("img",{alt:r,src:e,onLoad:()=>m(!0),className:t.cn("absolute top-0 left-0 size-full object-center transition-all duration-300",b?"scale-100 opacity-100":"scale-95 opacity-0","contain"===c?"object-contain":"object-cover","top"===u?"object-top":"bottom"===u?"object-bottom":"object-center",h),onClick:e=>f?.(e)})]})};Object.defineProperty(exports,"InView",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"LazyLoadImage",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return d}});
@@ -0,0 +1,32 @@
1
+ import{A as e,D as t,E as r,M as o,N as n,O as s,P as i,S as a,T as l,_ as c,b as u,f as h,g as d,h as p,j as f,p as m,v as y}from"./5Kn_YMsi.js";import{A as g,C as _,D as w,E,M as R,T as b,c as v,i as T,j as S,k as A,l as O,n as I,u as N,v as C,w as P,x}from"./BOcElY6J.js";import*as D from"react";import{jsx as q}from"react/jsx-runtime";var L=class extends R{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#r=O(),this.bindMethods(),this.setOptions(t)}#e;#o=void 0;#n=void 0;#s=void 0;#i;#a;#r;#t;#l;#c;#u;#h;#d;#p;#f=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#o.addObserver(this),k(this.#o,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return U(this.#o,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return U(this.#o,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#g(),this.#_(),this.#o.removeObserver(this)}setOptions(e){const t=this.options,r=this.#o;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof P(this.options.enabled,this.#o))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#o.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#o,observer:this});const o=this.hasListeners();o&&M(this.#o,r,this.options,t)&&this.#m(),this.updateResult(),!o||this.#o===r&&P(this.options.enabled,this.#o)===P(t.enabled,this.#o)&&b(this.options.staleTime,this.#o)===b(t.staleTime,this.#o)||this.#E();const n=this.#R();!o||this.#o===r&&P(this.options.enabled,this.#o)===P(t.enabled,this.#o)&&n===this.#p||this.#b(n)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);var o;return o=r,E(this.getCurrentResult(),o)||(this.#s=r,this.#a=this.options,this.#i=this.#o.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#r.status||this.#r.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#o}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#w();let t=this.#o.fetch(this.options,e);return e?.throwOnError||(t=t.catch(x)),t}#E(){this.#g();const e=b(this.options.staleTime,this.#o);if(N.isServer()||this.#s.isStale||!C(e))return;const t=A(this.#s.dataUpdatedAt,e)+1;this.#h=g.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#R(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#o):this.options.refetchInterval)??!1}#b(e){this.#_(),this.#p=e,!N.isServer()&&!1!==P(this.options.enabled,this.#o)&&C(this.#p)&&0!==this.#p&&(this.#d=g.setInterval(()=>{(this.options.refetchIntervalInBackground||S.isFocused())&&this.#m()},this.#p))}#y(){this.#E(),this.#b(this.#R())}#g(){this.#h&&(g.clearTimeout(this.#h),this.#h=void 0)}#_(){this.#d&&(g.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const r=this.#o,o=this.options,n=this.#s,s=this.#i,i=this.#a,a=e!==r?e.state:this.#n,{state:l}=e;let c,u={...l},h=!1;if(t._optimisticResults){const n=this.hasListeners(),s=!n&&k(e,t),i=n&&M(e,r,t,o);(s||i)&&(u={...u,...T(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=u;c=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===f){let e;n?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=n.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,void 0!==e&&(f="success",c=_(n?.data,e,t),h=!0)}if(t.select&&void 0!==c&&!m)if(n&&c===s?.data&&t.select===this.#l)c=this.#c;else try{this.#l=t.select,c=t.select(c),c=_(n?.data,c,t),this.#c=c,this.#t=null}catch(v){this.#t=v}this.#t&&(d=this.#t,c=this.#c,p=Date.now(),f="error");const y="fetching"===u.fetchStatus,g="pending"===f,w="error"===f,E=g&&y,R=void 0!==c,b={status:f,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===f,isError:w,isInitialLoading:E,isLoading:E,data:c,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:y,isRefetching:y&&!g,isLoadingError:w&&!R,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:w&&R,isStale:$(e,t),refetch:this.refetch,promise:this.#r,isEnabled:!1!==P(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==b.data,o="error"===b.status&&!t,n=e=>{o?e.reject(b.error):t&&e.resolve(b.data)},s=()=>{n(this.#r=b.promise=O())},i=this.#r;switch(i.status){case"pending":e.queryHash===r.queryHash&&n(i);break;case"fulfilled":(o||b.data!==i.value)&&s();break;case"rejected":o&&b.error===i.reason||s()}}return b}updateResult(){const e=this.#s,t=this.createResult(this.#o,this.options);this.#i=this.#o.state,this.#a=this.options,void 0!==this.#i.data&&(this.#u=this.#o),E(t,e)||(this.#s=t,this.#v({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#f.size)return!0;const o=new Set(r??this.#f);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(t=>{const r=t;return this.#s[r]!==e[r]&&o.has(r)})})()}))}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#o)return;const t=this.#o;this.#o=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#v(e){v.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#e.getQueryCache().notify({query:this.#o,type:"observerResultsUpdated"})})}};function k(e,t){return function(e,t){return!1!==P(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&U(e,t,t.refetchOnMount)}function U(e,t,r){if(!1!==P(t.enabled,e)&&"static"!==b(t.staleTime,e)){const o="function"==typeof r?r(e):r;return"always"===o||!1!==o&&$(e,t)}return!1}function M(e,t,r,o){return(e!==t||!1===P(o.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&$(e,r)}function $(e,t){return!1!==P(t.enabled,e)&&e.isStaleByTime(b(t.staleTime,e))}var F=D.createContext(!1);F.Provider;var j=D.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),V=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Q(e,t,r){if("production"!==process.env.NODE_ENV&&("object"!=typeof e||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=D.useContext(F),n=D.useContext(j),s=I(r),i=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=s.getQueryCache().get(i.queryHash);"production"!==process.env.NODE_ENV&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=o?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),o=e.staleTime;e.staleTime="function"==typeof o?(...e)=>r(o(...e)):r(o),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(i),((e,t,r)=>{const o=r?.state.error&&"function"==typeof e.throwOnError?w(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(t.isReset()||(e.retryOnMount=!1))})(i,n,a),(e=>{D.useEffect(()=>{e.clearReset()},[e])})(n);const l=!s.getQueryCache().get(i.queryHash),[c]=D.useState(()=>new t(s,i)),u=c.getOptimisticResult(i),h=!o&&!1!==e.subscribed;if(D.useSyncExternalStore(D.useCallback(e=>{const t=h?c.subscribe(v.batchCalls(e)):x;return c.updateResult(),t},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),D.useEffect(()=>{c.setOptions(i)},[i,c]),((e,t)=>e?.suspense&&t.isPending)(i,u))throw V(i,c,n);if((({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(n&&void 0===e.data||w(r,[e.error,o])))({result:u,errorResetBoundary:n,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!N.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(u,o)&&(l?V(i,c,n):a?.promise)?.catch(x).finally(()=>{c.updateResult()}),i.notifyOnChangeProps?u:c.trackResult(u)}function G(e,t){return Q(e,L,t)}function W(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function H(e,t){this.props=e,this.context=t}(H.prototype=new i).isPureReactComponent=!0,H.prototype.shouldComponentUpdate=function(e,t){return W(this.props,e)||W(this.state,t)};var z=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),z&&z(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var B=n.__e;n.__e=function(e,t,r,o){if(e.then)for(var n,s=t;s=s.__;)if((n=s.__c)&&n.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),n.__c(e,t);B(e,t,r,o)};var Z=n.unmount;function J(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J(e,t,r)})),e}function Y(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Y(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function K(){this.__u=0,this.o=null,this.__b=null}function X(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function ee(e){var t,r,o,n=null;function s(s){if(t||(t=e()).then(function(e){e&&(n=e.default||e),o=!0},function(e){r=e,o=!0}),r)throw r;if(!o)throw t;return n?f(n,s):null}return s.displayName="Lazy",s.__f=!0,s}function te(){this.i=null,this.l=null}n.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Z&&Z(e)},(K.prototype=new i).__c=function(e,t){var r=t.__c,o=this;o.o??=[],o.o.push(r);var n=X(o.__v),s=!1,i=function(){s||o.__z||(s=!0,r.__R=null,n?n(l):l())};r.__R=i;var a=r.__P;r.__P=null;var l=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=Y(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=a,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},K.prototype.componentWillUnmount=function(){this.o=[]},K.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=J(this.__b,r,n.__O=n.__P)}this.__b=null}var s=t.__a&&f(o,null,e.fallback);return s&&(s.__u&=-33),[f(o,null,t.__a?null:e.children),s]};var re=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ne(e){var r=this,o=e.h;if(r.componentWillUnmount=function(){t(null,r.v),r.v=null,r.h=null},r.h&&r.h!==o&&r.componentWillUnmount(),!r.v){for(var n=r.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;r.h=o,r.v={nodeType:1,parentNode:o,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},namespaceURI:o.namespaceURI,insertBefore:function(e,t){this.childNodes.push(e),r.h.insertBefore(e,t)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),r.h.removeChild(e)}}}t(f(oe,{context:r.context},e.__v),r.v)}function se(e,t){var r=f(ne,{__v:e,h:t});return r.containerInfo=t,r}(te.prototype=new i).__a=function(e){var t=this,r=X(t.__v),o=t.l.get(e);return o[0]++,function(n){var s=function(){t.props.revealOrder?(o.push(n),re(t,e,o)):n()};r?r(s):s()}},te.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=s(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},te.prototype.componentDidUpdate=te.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){re(e,r,t)})};var ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ae=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ce=/[A-Z0-9]/g,ue="undefined"!=typeof document,he=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};i.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(i.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var de=n.event;n.event=function(e){return de&&(e=de(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var pe={configurable:!0,get:function(){return this.class}},fe=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,o={},n=-1==r.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||ue&&"children"===i&&"noscript"===r||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==r&&"textarea"!==r||he(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":le.test(i)&&(i=l):l=i="oninput":n&&ae.test(i)?i=i.replace(ce,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&o[i=l]&&(i="oninputCapture"),o[i]=a}}"select"==r&&(o.multiple&&Array.isArray(o.value)&&(o.value=s(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=s(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",pe)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=ie,fe&&fe(e)};var me=n.__r;n.__r=function(e){me&&me(e),e.__c};var ye=n.diffed;n.diffed=function(e){ye&&ye(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var ge=class extends Error{response;request;options;constructor(e,t,r){const o=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${o?`status code ${o}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},_e=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},we=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new _e(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},Ee=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;if(r&&o)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&"unsupported BodyInit type"===n.message)return!1;throw n}return e&&!t})(),Re="function"==typeof globalThis.AbortController,be="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,ve="function"==typeof globalThis.ReadableStream,Te="function"==typeof globalThis.FormData,Se=["get","post","put","patch","head","delete"],Ae={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Oe=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ie=Symbol("stop"),Ne=class{options;constructor(e){this.options=e}},Ce=e=>new Ne(e),Pe={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},xe={next:!0},De={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},qe=(e,t,r)=>{let o,n=0;return e.pipeThrough(new TransformStream({transform(e,s){if(s.enqueue(e),o){n+=o.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},o)}o=e},flush(){o&&(n+=o.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},o))}}))},Le=e=>null!==e&&"object"==typeof e,ke=(...e)=>{for(const t of e)if((!Le(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return je({},...e)},Ue=(e={},t={})=>{const r=new globalThis.Headers(e),o=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[s,i]of n.entries())o&&"undefined"===i||void 0===i?r.delete(s):r.set(s,i);return r};function Me(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:je(e[r]??[],t[r]??[])}var $e=(e={},t={})=>({beforeRequest:Me(e,t,"beforeRequest"),beforeRetry:Me(e,t,"beforeRetry"),afterResponse:Me(e,t,"afterResponse"),beforeError:Me(e,t,"beforeError")}),Fe=(e,t)=>{const r=new URLSearchParams;for(const o of[e,t])if(void 0!==o)if(o instanceof URLSearchParams)for(const[e,t]of o.entries())r.append(e,t);else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(Le(o))for(const[e,t]of Object.entries(o))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(o);for(const[t,o]of e.entries())r.append(t,o)}return r},je=(...e)=>{let t,r={},o={},n={};const s=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(Le(i)){for(let[e,o]of Object.entries(i))if("signal"===e&&o instanceof globalThis.AbortSignal)s.push(o);else if("context"!==e)"searchParams"!==e?(Le(o)&&e in r&&(o=je(r[e],o)),r={...r,[e]:o}):t=null==o?void 0:void 0===t?o:Fe(t,o);else{if(null!=o&&(!Le(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:{...r.context,...o}}}Le(i.hooks)&&(n=$e(n,i.hooks),r.hooks=n),Le(i.headers)&&(o=Ue(o,i.headers),r.headers=o)}return void 0!==t&&(r.searchParams=t),s.length>0&&(1===s.length?r.signal=s[0]:r.signal=be?AbortSignal.any(s):s.at(-1)),r},Ve=e=>Se.includes(e)?e.toUpperCase():e,Qe={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Ge=(e={})=>{if("number"==typeof e)return{...Qe,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...Qe,...t}},We=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},He=class e{static create(t,r){const o=new e(t,r),n=o.#T(async()=>{if("number"==typeof o.#S.timeout&&o.#S.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await o.#A();for(const r of o.#S.hooks.afterResponse){const n=o.#O(e.clone());let s;try{s=await r(o.request,o.#I(),n,{retryCount:o.#N})}catch(t){throw o.#C(n),o.#C(e),t}if(s instanceof Ne)throw o.#C(n),o.#C(e),new we(s.options);const i=s instanceof globalThis.Response?s:e;n!==i&&o.#C(n),e!==i&&o.#C(e),e=i}if(o.#O(e),!e.ok&&("function"==typeof o.#S.throwHttpErrors?o.#S.throwHttpErrors(e.status):o.#S.throwHttpErrors)){let t=new ge(e,o.request,o.#I());for(const e of o.#S.hooks.beforeError)t=await e(t,{retryCount:o.#N});throw t}if(o.#S.onDownloadProgress){if("function"!=typeof o.#S.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!ve)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return o.#C(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(qe(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,o.#S.onDownloadProgress)}return e}).finally(()=>{const e=o.#P;o.#x(e?.body??void 0),o.#x(o.request.body??void 0)});for(const[e,s]of Object.entries(Ae))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||s);const t=await n;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return n}static#D(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#q;#N=0;#L;#S;#P;#k;#U;constructor(t,r={}){if(this.#L=t,this.#S={...r,headers:Ue(this.#L.headers,r.headers),hooks:$e({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Ve(r.method??this.#L.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Ge(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#L&&!(this.#L instanceof URL||this.#L instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#S.prefixUrl&&"string"==typeof this.#L){if(this.#L.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#S.prefixUrl.endsWith("/")||(this.#S.prefixUrl+="/"),this.#L=this.#S.prefixUrl+this.#L}Re&&be&&(this.#k=this.#S.signal??this.#L.signal,this.#q=new globalThis.AbortController,this.#S.signal=this.#k?AbortSignal.any([this.#k,this.#q.signal]):this.#q.signal),Ee&&(this.#S.duplex="half"),void 0!==this.#S.json&&(this.#S.body=this.#S.stringifyJson?.(this.#S.json)??JSON.stringify(this.#S.json),this.#S.headers.set("content-type",this.#S.headers.get("content-type")??"application/json"));const o=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#L instanceof globalThis.Request&&(Te&&this.#S.body instanceof globalThis.FormData||this.#S.body instanceof URLSearchParams)&&!o&&this.#S.headers.delete("content-type"),this.request=new globalThis.Request(this.#L,this.#S),void 0!==(n=this.#S.searchParams)&&(Array.isArray(n)?n.length>0:n instanceof URLSearchParams?n.size>0:"object"==typeof n?Object.keys(n).length>0:"string"==typeof n?n.trim().length>0:Boolean(n))){const t="?"+("string"==typeof this.#S.searchParams?this.#S.searchParams.replace(/^\?/,""):new URLSearchParams(e.#D(this.#S.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#S)}var n;if(this.#S.onUploadProgress){if("function"!=typeof this.#S.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!Ee)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#M(this.request,this.#S.body??void 0)}}#$(){const e=this.#S.retry.delay(this.#N);let t=e;!0===this.#S.retry.jitter?t=Math.random()*e:"function"==typeof this.#S.retry.jitter&&(t=this.#S.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#S.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#F(e){if(this.#N++,this.#N>this.#S.retry.limit)throw e;const t=e instanceof Error?e:new _e(e);if(t instanceof we)return t.customDelay??this.#$();if(!this.#S.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#S.retry.shouldRetry){const r=await this.#S.retry.shouldRetry({error:t,retryCount:this.#N});if(!1===r)throw e;if(!0===r)return this.#$()}if(function(e){return e instanceof We||e?.name===We.name}(e)&&!this.#S.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ge||e?.name===ge.name}(e)){if(!this.#S.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#S.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#S.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#$()}#O(e){return this.#S.parseJson&&(e.json=async()=>this.#S.parseJson(await e.text())),e}#x(e){e&&e.cancel().catch(()=>{})}#C(e){this.#x(e.body??void 0)}async#T(e){try{return await e()}catch(t){const r=Math.min(await this.#F(t),2147483647);if(this.#N<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,o)=>{function n(){clearTimeout(s),o(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const s=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#k?{signal:this.#k}:{}),t instanceof we&&t.customRequest){const e=this.#S.signal?new globalThis.Request(t.customRequest,{signal:this.#S.signal}):new globalThis.Request(t.customRequest);this.#j(e)}for(const e of this.#S.hooks.beforeRetry){const r=await e({request:this.request,options:this.#I(),error:t,retryCount:this.#N});if(r instanceof globalThis.Request){this.#j(r);break}if(r instanceof globalThis.Response)return r;if(r===Ie)return}return this.#T(e)}}async#A(){this.#q?.signal.aborted&&(this.#q=new globalThis.AbortController,this.#S.signal=this.#k?AbortSignal.any([this.#k,this.#q.signal]):this.#q.signal,this.request=new globalThis.Request(this.request,{signal:this.#S.signal}));for(const t of this.#S.hooks.beforeRequest){const e=await t(this.request,this.#I(),{retryCount:this.#N});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#j(e);break}}const e=((e,t)=>{const r={};for(const o in t)Object.hasOwn(t,o)&&(o in De||o in Pe||o in e&&!(o in xe)||(r[o]=t[o]));return r})(this.request,this.#S);return this.#P=this.request,this.request=this.#P.clone(),!1===this.#S.timeout?this.#S.fetch(this.#P,e):async function(e,t,r,o){return new Promise((n,s)=>{const i=setTimeout(()=>{r&&r.abort(),s(new We(e))},o.timeout);o.fetch(e,t).then(n).catch(s).then(()=>{clearTimeout(i)})})}(this.#P,e,this.#q,this.#S)}#I(){if(!this.#U){const{hooks:e,...t}=this.#S;this.#U=Object.freeze(t)}return this.#U}#j(e){this.#U=void 0,this.request=this.#M(e)}#M(e,t){return this.#S.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const o=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,o]of e)t+=Oe,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof o?(new TextEncoder).encode(o).length:o.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:qe(e.body,o,t)})})(e,this.#S.onUploadProgress,t??this.#S.body??void 0):e}},ze=e=>{const t=(t,r)=>He.create(t,ke(e,r));for(const r of Se)t[r]=(t,o)=>He.create(t,ke(e,o,{method:r}));return t.create=e=>ze(ke(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ze(ke(e,t))),t.stop=Ie,t.retry=Ce,t},Be=ze(),Ze={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`},Je={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`},Ye={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ke="https://qrati.com/api/connect",Xe={INITIALIZE_SESSION:`${Ke}/session/initialize`,REGISTER:`${Ke}/auth/register`,LOGIN:`${Ke}/auth/login`,LOGOUT:`${Ke}/auth/logout`,UPDATE_SESSION:`${Ke}/session/update`,ACCEPT_TERMS:`${Ke}/auth/accept-terms`,EXTERNAL_LOGIN:`${Ke}/auth/external-login`,PUBLIC_EVENTS:`${Ke}/event/public-events`,SEARCH_EVENTS:`${Ke}/event/search`,FOLDER_DETAILS:`${Ke}/folder/details`,NESTED_FOLDERS:`${Ke}/folder/nested-folders`,GET_EVENT_POINTS:`${Ke}/event/points`,ELIGIBLE_TO_CURATE:`${Ke}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Ke}/content/for-curation`,CURATE_CONTENT:`${Ke}/content/curate`,GET_LEADERBOARD:`${Ke}/event/leaderboard`,GET_UPLOAD_COUNT:`${Ke}/event/upload-count`,SINGLE_UPLOAD:`${Ke}/content/single-upload`,UPDATE_REACTION:`${Ke}/content/update-reaction`,EVENT_DATA:`${Ke}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Ke}/event/update-layout`,GET_EVENT_STATISTICS:`${Ke}/event/statistics`,GET_CONTENTS:`${Ke}/content/for-gallery`,SEARCH_CONTENTS:`${Ke}/content/search`,GET_CONTENTS_COUNT:`${Ke}/content/count`,UPDATE_AD_ANALYTICS:`${Ke}/event/update-ad-analytics`,INCREMENT_EVENT_VIEW:`${Ke}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Ke}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Ke}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Ke}/auth/reset-password`,REPORT_ERROR:`${Ke}/session/report-error`},et={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},tt={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD"},rt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},ot={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},nt={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},st=1048576,it={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},at={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},lt={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},ct={CONTEST:"CONTEST",REACTION:"REACTION"},ut={GRID:"grid",SINGLE:"single"},ht={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},dt={[ht.POPULAR]:{label:"Popular",sortField:"score"},[ht.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[ht.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},pt=ht.UPLOAD_TIME,ft={ASC:"asc",DESC:"desc"},mt={[ft.ASC]:{label:"Ascending",sortOrder:""},[ft.DESC]:{label:"Descending",sortOrder:"-"}},yt=ft.DESC,gt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},_t={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},wt={[_t.LINK]:"material-symbols:open-in-new-rounded",[_t.EMAIL]:"material-symbols:alternate-email-rounded",[_t.PHONE]:"material-symbols:call-outline",[_t.SMS]:"material-symbols:sms-outline-rounded",[_t.WHATSAPP]:"logos:whatsapp-icon",[_t.MESSENGER]:"logos:messenger"},Et={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},Rt={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`};function bt({title:e,children:t}){/* @__PURE__ */
2
+ return y("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */y("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */y("g",{transform:"translate(-443.142 -257.876)",children:[
3
+ /* @__PURE__ */y("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"}),
4
+ /* @__PURE__ */y("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"}),
5
+ /* @__PURE__ */y("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"}),
6
+ /* @__PURE__ */y("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"}),
7
+ /* @__PURE__ */y("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"}),
8
+ /* @__PURE__ */y("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"}),
9
+ /* @__PURE__ */y("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(318.982 21.923)",fill:"#3f3d56"}),
10
+ /* @__PURE__ */y("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
11
+ /* @__PURE__ */y("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
12
+ /* @__PURE__ */y("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
13
+ /* @__PURE__ */y("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
14
+ /* @__PURE__ */y("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
15
+ /* @__PURE__ */y("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
16
+ /* @__PURE__ */y("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
17
+ /* @__PURE__ */y("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
18
+ /* @__PURE__ */y("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
19
+ /* @__PURE__ */y("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
20
+ /* @__PURE__ */y("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
21
+ /* @__PURE__ */y("g",{transform:"translate(696.754 297.373)",children:[
22
+ /* @__PURE__ */y("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
23
+ /* @__PURE__ */y("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
24
+ /* @__PURE__ */y("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
25
+ /* @__PURE__ */y("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
26
+ /* @__PURE__ */y("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
27
+ /* @__PURE__ */y("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
28
+ /* @__PURE__ */y("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
29
+ /* @__PURE__ */y("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */y("div",{className:"space-y-4",children:[/* @__PURE__ */y("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */y("p",{className:"text-muted-foreground text-center",children:t})]})]})}function vt({organizationId:e,errorType:t}){/* @__PURE__ */
30
+ return y(bt,"custom-auth-invalid"===t?{title:"Invalid input",children:"Custom auth mode requires uid, fname, lname. For more details please contact Qrati support."}:{title:"page-not-registered"===t?"Page not registered":"Something went wrong",children:["If you are an admin of this organization, please add the current page URL in Allowed URLs under"," ",
31
+ /* @__PURE__ */y("a",{className:"font-medium text-blue-500",href:Je.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨"," ",
32
+ /* @__PURE__ */y("a",{className:"font-medium text-blue-500",href:Je.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var Tt=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),St=(e,t=0)=>{let r=t^e.length,o=0;const n=e.length;for(;o+3<n;){let t=255&e.charCodeAt(o)|(255&e.charCodeAt(o+1))<<8|(255&e.charCodeAt(o+2))<<16|(255&e.charCodeAt(o+3))<<24;t=Math.imul(t,3432918353),t=t<<15|t>>>17,t=Math.imul(t,461845907),r^=t,r=r<<13|r>>>19,r=Math.imul(r,5)+3864292196,o+=4}let s=0;switch(n-o){case 3:s^=(255&e.charCodeAt(o+2))<<16;case 2:s^=(255&e.charCodeAt(o+1))<<8;case 1:s^=255&e.charCodeAt(o),s=Math.imul(s,3432918353),s=s<<15|s>>>17,s=Math.imul(s,461845907),r^=s}return r^=r>>>16,r=Math.imul(r,2246822507),r^=r>>>13,r=Math.imul(r,3266489909),r^=r>>>16,r>>>=0,r.toString(16).padStart(8,"0")},At=async e=>{try{return await e()}catch{return null}},Ot=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Ot).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const o of t){const t=e[o];void 0!==t&&r.push(`${Ot(o)}:${Ot(t)}`)}return`{${r.join(",")}}`},It=async({debug:e=!1}={})=>{const t=await At(()=>Dt()),r=await At(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),o=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,n=Intl.DateTimeFormat().resolvedOptions().timeZone,s=/* @__PURE__ */(new Date).getTimezoneOffset(),i=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",l=window.matchMedia("(forced-colors: active)").matches?"active":null,{pixelDepth:c,colorDepth:u}=window.screen,h="ontouchstart"in window||window.navigator.maxTouchPoints>0,d=await At(()=>Nt(e)),p=await At(()=>Ct()),f=await At(()=>Pt(e)),m=await At(()=>xt(e)),y=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,g={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,fonts:t,numberingSystem:r,languages:o,timezone:n,timezoneOffset:s,reducedMotion:i,colorScheme:a,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:l,pixelDepth:c,colorDepth:u,touchSupport:h,canvasID:d,webglID:p,webgpuID:f,audioID:m},_={aspectRatio:y,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};return(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(g,_),{fingerprint:St(Ot(g)),...g}},Nt=async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),o=r.createLinearGradient(0,0,280,100);return o.addColorStop(0,"#f60"),o.addColorStop(.4,"#09f"),o.addColorStop(.7,"#f09"),o.addColorStop(1,"#0f9"),r.fillStyle=o,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),St(t.toDataURL("image/png"))},Ct=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return St(Ot({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))},Pt=async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return St(Ot(r))},xt=async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const o=t.createDynamicsCompressor();o.threshold.value=-48,o.knee.value=30,o.ratio.value=14,o.attack.value=0,o.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(o),o.connect(n),n.connect(t.destination),r.start(0);const s=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let c=3e3;c<5800;c+=2){const e=s[c];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const l=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(s.slice(4500,5e3)),o=e.width/r.length;for(let n=0;n<r.length;n++){const s=n*o,i=(r[n]+1)/2*e.height;0===n?t.moveTo(s,i):t.lineTo(s,i)}t.stroke(),document.body.appendChild(e)}return St(l.toString(16))},Dt=()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const o={};for(const s of e)r.style.fontFamily=s,o[s]=r.offsetWidth;const n=[];for(const s of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${s}", ${i}`,r.offsetWidth!==o[i]){n.push(s),t=!0;break}t||(r.style.fontFamily=`"${s}"`,r.offsetWidth!==o.monospace&&r.offsetWidth!==o.serif&&n.push(s))}return document.body.removeChild(r),n.length?n.sort().join(","):null};"undefined"!=typeof window&&(window.getBrowserFingerprint=It);var qt=async(e,t)=>{if(e instanceof ge){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},Lt=e(void 0),kt=({props:e={},children:t})=>{const{organizationId:o,uid:n,fname:s,lname:i,theme:l="light"}=e,[f,g]=a(()=>{if("undefined"==typeof window)return null;if(n||s||i)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:_,data:w,error:E}=G({queryKey:[Rt.QRATI_CONNECT_SESSION,o,n??null,s??null,i??null],queryFn:async()=>{const e=await(async()=>{const e=await It();return"string"==typeof e?e:e?.fingerprint})();return(await Be.post(Xe.INITIALIZE_SESSION,{json:{uid:n,fname:s,lname:i,browserFingerprint:e},headers:{"x-org-id":o,Authorization:n||s||i||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!o});r(()=>{const e=w?.authSession?.session?.token,t=w?.authSession?.user;t&&e?(g({...t,token:e}),w?.organization?.customAuth||localStorage.setItem("qrati_token",e)):w?.organization?.customAuth&&n&&s&&i&&g(e=>e??{uid:n,name:`${s} ${i}`,fname:s,lname:i})},[w]);const R=u(()=>{const e=w?.organization?.integrationSettings?.fontFamily,t=d("https://qrati.com",e),r=p("https://qrati.com",o);return c(w?.organization?.integrationSettings,w?.organization?.customFontUrl?r||w.organization.customFontUrl:void 0,t||void 0)},[w?.organization?.integrationSettings,w?.organization?.customFontUrl,o]),b=async e=>{try{const t=await((e,t,r)=>new Promise((o,n)=>{if(!e)return void n(/* @__PURE__ */new Error("Provider is required"));if(!t)return void n(/* @__PURE__ */new Error("Organization ID is required"));const s=new URL(`${r}/qc-social-auth`);s.searchParams.set("provider",e),s.searchParams.set("organizationId",t),s.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,l=window.open(s.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!l)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const c=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:s,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(s){case"QRATI_SOCIAL_AUTH_SUCCESS":c(),l.close(),o({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),c(),l.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":c(),l.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{l.closed&&(c(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{c(),l.closed||l.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,o??"","https://qrati.com");return t?.user&&t?.token&&(g({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(E){throw console.error("Social login error:",E),E}};return E?/* @__PURE__ */y(K,{fallback:null,children:/* @__PURE__ */y(vt,{organizationId:o??"",errorType:401===E?.response?.status?"page-not-registered":"generic-error"})}):!w?.organization?.customAuth||n&&s&&i?/* @__PURE__ */y(Lt.Provider,{value:{props:e,initializing:_,sessionId:w?.sessionId,organization:w?.organization,folders:w?.folders,loadingUser:_,user:f,updateUser:async e=>{g(t=>{const r={...t,...e};return r?.token&&localStorage.setItem("qrati_token",r.token),r})},registerUsingEmail:async(e,t,r,n)=>{try{const s=await Be.post(Xe.REGISTER,{json:{email:e,password:t,fname:r,lname:n},headers:{"x-org-id":o}}).json();return s.error?{error:s.error}:(g({...s.user,token:s.token}),localStorage.setItem("qrati_token",s.token),s)}catch(E){return{error:await qt(E,"Registration failed")}}},loginWithGoogle:async()=>{try{return await b("google")}catch(E){throw console.error("Google login error:",E),E}},loginWithApple:async()=>{try{return await b("apple")}catch(E){throw console.error("Apple login error:",E),E}},loginUsingEmail:async(e,t)=>{try{const r=await Be.post(Xe.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":o}}).json();return r.error?{error:r.error}:(g({...r.user,token:r.token}),localStorage.setItem("qrati_token",r.token),r)}catch(E){return{error:await qt(E,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await Be.post(Xe.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":o}}).json();return t.error?{error:t.error}:t}catch(E){return{error:await qt(E,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const r=await Be.post(Xe.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":o}}).json();return r.error?{error:r.error}:r}catch(E){return{error:await qt(E,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const r=await Be.post(Xe.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":o}}).json();return r.error?{error:r.error}:r}catch(E){return{error:E?.message}}},signout:async()=>{try{const e=await Be.post(Xe.LOGOUT,{headers:{"x-org-id":o,Authorization:`Bearer ${f?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),g(null),e)}catch(E){return console.error(E),{error:E?.message}}},error:E},children:/* @__PURE__ */y("div",{id:"qrati-connect-container",style:{...m(w?.organization,l),fontFamily:"var(--font-family)"},className:h("bg-background text-foreground relative min-h-[80vh]"),children:[R?/* @__PURE__ */y("style",{children:R}):null,t]})}):/* @__PURE__ */y(K,{fallback:null,children:/* @__PURE__ */y(vt,{organizationId:o??"",errorType:"custom-auth-invalid"})})},Ut=()=>{const e=l(Lt);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{mt as A,st as C,gt as D,Rt as E,G as F,Q as I,L,se as M,K as N,lt as O,ee as P,Je as S,Ze as T,pt as _,et as a,it as b,wt as c,ht as d,dt as f,ut as g,nt as h,Tt as i,Be as j,ft as k,Xe as l,tt as m,Ut as n,Et as o,ot as p,It as r,_t as s,kt as t,at as u,yt as v,rt as w,Ye as x,ct as y};