@qratilabs/qrati-connect 2.23.5 → 2.23.6

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 (105) hide show
  1. package/element/{DB68-h-C.js → 4VTPoA38.js} +1 -1
  2. package/element/{BmFX4pgV2.js → 7GXdePWm2.js} +10 -10
  3. package/element/{CJpmOICA.js → B14kCOq8.js} +1 -1
  4. package/{umd/CCm2-mcE2.js → element/B78xAjNG2.js} +4 -4
  5. package/element/{TV5seYRS.js → BItJQVdK.js} +3 -3
  6. package/element/{DcLlwdC6.js → BNEa3Uj4.js} +1 -1
  7. package/element/{Hfo3iOYG2.js → BQuhYd4G2.js} +2 -2
  8. package/element/{B7EvJYrt2.js → BdOzsWR32.js} +1 -1
  9. package/element/{DGHG5MsV.js → Be1e_ATJ.js} +1 -1
  10. package/{umd/CwE8D5S0.js → element/BglDIiFp.js} +1 -1
  11. package/{umd/WX3mhhd9.js → element/BkvtmX4K.js} +1 -1
  12. package/element/{BhWrOCDI2.js → Bm_xW_Mp2.js} +3 -3
  13. package/{umd/E5aJy_fH.js → element/BtN9y353.js} +1 -1
  14. package/element/{CKk0UYyd.js → Byk0pccK.js} +1 -1
  15. package/element/{CiryJz3K2.js → C3HKK1w_2.js} +85 -86
  16. package/element/C3uDEVBt.js +1 -0
  17. package/element/{DZ2f3-jO.js → C8_zGNAf.js} +1 -1
  18. package/element/{DcL9Mr2r.js → C9ak4yUT.js} +2 -3
  19. package/element/{YJHG0sOk.js → CCLXmMXp.js} +1 -1
  20. package/element/{CslFRHxJ2.js → CGc52QIP2.js} +14 -14
  21. package/{umd/DD6up6cl2.js → element/CXg838Gr2.js} +1 -1
  22. package/element/{CtYiLBXL.js → Cb1JRT_1.js} +1 -1
  23. package/element/{DYU4JC0C2.js → CebL6kYV2.js} +4 -4
  24. package/{umd/DBS5eoAD.js → element/CiiNqDJq.js} +1 -1
  25. package/element/{D9JpTB2O2.js → Cj4nJyT42.js} +1 -1
  26. package/{umd/D5TvVWUK.js → element/CnoPTYOO.js} +1 -1
  27. package/element/{BrWTIUcy2.js → CxgDoGDT2.js} +1 -1
  28. package/element/{DiBNGdQS.js → D0VKfxwE.js} +10 -10
  29. package/element/{DP5TIAjd2.js → D5MjLaap2.js} +1 -1
  30. package/{umd/CUJTm_YL2.js → element/D5YBxlTz2.js} +39 -39
  31. package/{umd/BCyTQnZ1.js → element/D9NypPiv.js} +1 -1
  32. package/element/{C9HFLidt.js → DIYUC8M3.js} +1 -1
  33. package/element/{Boh-45fW.js → DNAwNX6_.js} +2 -2
  34. package/{umd/BCu0TrNB2.js → element/DNG5BSHx2.js} +1 -1
  35. package/element/{DV3rTDj-2.js → DXx41__x2.js} +1 -1
  36. package/element/{DnW7WNo1.js → Dgs_iVn3.js} +1 -1
  37. package/element/{BNj7xAbL.js → DsvRTvCp.js} +1 -1
  38. package/element/{DWbLshVZ.js → DvTRhlvs.js} +1 -1
  39. package/element/{3djirt_r2.js → MpvHkxaz2.js} +1 -1
  40. package/element/R0dHh5Az2.js +9 -0
  41. package/element/{u7SUQ9Kb2.js → VakK6fPh2.js} +1 -1
  42. package/element/{CnAKuO192.js → _bFyk49H2.js} +3 -3
  43. package/element/{DXrH_HhZ.js → _ty2jtjs.js} +1 -1
  44. package/element/{Crix9_9X.js → b6CwQBFC.js} +5 -5
  45. package/element/{BbWh89xA2.js → d_bA36WR2.js} +1 -1
  46. package/element/{CuRZaTn5.js → ekog7y-V.js} +1 -1
  47. package/{umd/D8Se70tP2.js → element/gjXXuILV2.js} +1 -1
  48. package/element/{DmSY4t_i.js → qWp4ucdT.js} +1 -1
  49. package/element/web.es.js +42 -42
  50. package/package.json +1 -1
  51. package/react/index.d.mts +6 -117
  52. package/react/index.d.ts +6 -117
  53. package/umd/{DB68-h-C.js → 4VTPoA38.js} +1 -1
  54. package/umd/{BmFX4pgV2.js → 7GXdePWm2.js} +10 -10
  55. package/umd/{CJpmOICA.js → B14kCOq8.js} +1 -1
  56. package/{element/CCm2-mcE2.js → umd/B78xAjNG2.js} +4 -4
  57. package/umd/{TV5seYRS.js → BItJQVdK.js} +3 -3
  58. package/umd/{DcLlwdC6.js → BNEa3Uj4.js} +1 -1
  59. package/umd/{Hfo3iOYG2.js → BQuhYd4G2.js} +2 -2
  60. package/umd/{B7EvJYrt2.js → BdOzsWR32.js} +1 -1
  61. package/umd/{DGHG5MsV.js → Be1e_ATJ.js} +1 -1
  62. package/{element/CwE8D5S0.js → umd/BglDIiFp.js} +1 -1
  63. package/{element/WX3mhhd9.js → umd/BkvtmX4K.js} +1 -1
  64. package/umd/{BhWrOCDI2.js → Bm_xW_Mp2.js} +3 -3
  65. package/{element/E5aJy_fH.js → umd/BtN9y353.js} +1 -1
  66. package/umd/{CKk0UYyd.js → Byk0pccK.js} +1 -1
  67. package/umd/{CiryJz3K2.js → C3HKK1w_2.js} +85 -86
  68. package/umd/C3uDEVBt.js +1 -0
  69. package/umd/{DZ2f3-jO.js → C8_zGNAf.js} +1 -1
  70. package/umd/{DcL9Mr2r.js → C9ak4yUT.js} +2 -3
  71. package/umd/{YJHG0sOk.js → CCLXmMXp.js} +1 -1
  72. package/umd/{CslFRHxJ2.js → CGc52QIP2.js} +14 -14
  73. package/{element/DD6up6cl2.js → umd/CXg838Gr2.js} +1 -1
  74. package/umd/{CtYiLBXL.js → Cb1JRT_1.js} +1 -1
  75. package/umd/{DYU4JC0C2.js → CebL6kYV2.js} +4 -4
  76. package/{element/DBS5eoAD.js → umd/CiiNqDJq.js} +1 -1
  77. package/umd/{D9JpTB2O2.js → Cj4nJyT42.js} +1 -1
  78. package/{element/D5TvVWUK.js → umd/CnoPTYOO.js} +1 -1
  79. package/umd/{BrWTIUcy2.js → CxgDoGDT2.js} +1 -1
  80. package/umd/{DiBNGdQS.js → D0VKfxwE.js} +10 -10
  81. package/umd/{DP5TIAjd2.js → D5MjLaap2.js} +1 -1
  82. package/{element/CUJTm_YL2.js → umd/D5YBxlTz2.js} +39 -39
  83. package/{element/BCyTQnZ1.js → umd/D9NypPiv.js} +1 -1
  84. package/umd/{C9HFLidt.js → DIYUC8M3.js} +1 -1
  85. package/umd/{Boh-45fW.js → DNAwNX6_.js} +2 -2
  86. package/{element/BCu0TrNB2.js → umd/DNG5BSHx2.js} +1 -1
  87. package/umd/{DV3rTDj-2.js → DXx41__x2.js} +1 -1
  88. package/umd/{DnW7WNo1.js → Dgs_iVn3.js} +1 -1
  89. package/umd/{BNj7xAbL.js → DsvRTvCp.js} +1 -1
  90. package/umd/{DWbLshVZ.js → DvTRhlvs.js} +1 -1
  91. package/umd/{3djirt_r2.js → MpvHkxaz2.js} +1 -1
  92. package/umd/R0dHh5Az2.js +9 -0
  93. package/umd/{u7SUQ9Kb2.js → VakK6fPh2.js} +1 -1
  94. package/umd/{CnAKuO192.js → _bFyk49H2.js} +3 -3
  95. package/umd/{DXrH_HhZ.js → _ty2jtjs.js} +1 -1
  96. package/umd/{Crix9_9X.js → b6CwQBFC.js} +5 -5
  97. package/umd/{BbWh89xA2.js → d_bA36WR2.js} +1 -1
  98. package/umd/{CuRZaTn5.js → ekog7y-V.js} +1 -1
  99. package/{element/D8Se70tP2.js → umd/gjXXuILV2.js} +1 -1
  100. package/umd/{DmSY4t_i.js → qWp4ucdT.js} +1 -1
  101. package/umd/web.es.js +42 -42
  102. package/element/CkgIN-cn2.js +0 -9
  103. package/element/qbHuxVSe.js +0 -1
  104. package/umd/CkgIN-cn2.js +0 -9
  105. package/umd/qbHuxVSe.js +0 -1
@@ -1,4 +1,4 @@
1
- import{D as e,b as t,h as r,p as s,r as n,s as o,t as i,v as a,y as c}from"./qbHuxVSe.js";var l=class{constructor(){this.listeners=/* @__PURE__ */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(){}},u=new class extends l{#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}},h={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},d=new class{#s=h;#n=!1;setTimeoutProvider(e){this.#s=e}setTimeout(e,t){return this.#s.setTimeout(e,t)}clearTimeout(e){this.#s.clearTimeout(e)}setInterval(e,t){return this.#s.setInterval(e,t)}clearInterval(e){this.#s.clearInterval(e)}},f="undefined"==typeof window||"Deno"in globalThis;function p(){}function y(e,t){return"function"==typeof e?e(t):e}function m(e){return"number"==typeof e&&e>=0&&e!==1/0}function g(e,t){return Math.max(e+(t||0)-Date.now(),0)}function w(e,t){return"function"==typeof e?e(t):e}function b(e,t){return"function"==typeof e?e(t):e}function v(e,t){const{type:r="all",exact:s,fetchStatus:n,predicate:o,queryKey:i,stale:a}=e;if(i)if(s){if(t.queryHash!==R(i,t.options))return!1}else if(!T(t.queryKey,i))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||n&&n!==t.state.fetchStatus||o&&!o(t))}function E(e,t){const{exact:r,status:s,predicate:n,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(S(t.options.mutationKey)!==S(o))return!1}else if(!T(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||n&&!n(t))}function R(e,t){return(t?.queryKeyHashFn||S)(e)}function S(e){return JSON.stringify(e,(e,t)=>P(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function T(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>T(e[r],t[r]))}var O=Object.prototype.hasOwnProperty;function A(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=C(e)&&C(t);if(!(s||P(e)&&P(t)))return t;const n=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),i=o.length,a=s?new Array(i):{};let c=0;for(let l=0;l<i;l++){const i=s?l:o[l],u=e[i],h=t[i];if(u===h){a[i]=u,(s?l<n:O.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=A(u,h,r+1);a[i]=d,d===u&&c++}return n===i&&c===n?e:a}function I(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 C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P(e){if(!N(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!N(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function N(e){return"[object Object]"===Object.prototype.toString.call(e)}function D(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?A(e,t):t}function _(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function L(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var x=/* @__PURE__ */Symbol();function q(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==x?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function U(e,t){return"function"==typeof e?e(...t):!!e}var F=/* @__PURE__ */(()=>{let e=()=>f;return{isServer:()=>e(),setIsServer(t){e=t}}})();function M(){let e,t;const r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}var $=function(e){setTimeout(e,0)},k=function(){let e=[],t=0,r=e=>{e()},s=e=>{e()},n=$;const o=s=>{t?e.push(s):n(()=>{r(s)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&n(()=>{s(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}}}(),j=new class extends l{#o=!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.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function G(e){return Math.min(1e3*2**e,3e4)}function V(e){return"online"!==(e??"online")||j.isOnline()}var Q=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function H(e){let t,r=!1,s=0;const n=M(),o=()=>"pending"!==n.status,i=()=>u.isFocused()&&("always"===e.networkMode||j.isOnline())&&e.canRun(),a=()=>V(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),n.resolve(e))},l=e=>{o()||(t?.(),n.reject(e))},h=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),f=()=>{if(o())return;let t;const n=0===s?e.initialPromise:void 0;try{t=n??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const n=e.retry??(F.isServer()?0:3),a=e.retryDelay??G,c="function"==typeof a?a(s,t):a,u=!0===n||"number"==typeof n&&s<n||"function"==typeof n&&n(s,t);var p;!r&&u?(s++,e.onFail?.(s,t),(p=c,new Promise(e=>{d.setTimeout(e,p)})).then(()=>i()?void 0:h()).then(()=>{r?l(t):f()})):l(t)})};return{promise:n,status:()=>n.status,cancel:t=>{if(!o()){const r=new Q(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?f():h().then(f),n)}}var z=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#i=d.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(d.clearTimeout(this.#i),this.#i=void 0)}};function B(e){return{onFetch:(t,r)=>{const s=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,s){let n,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t.signal,o||(o=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)})}(e,0,()=>r=!0)},u=q(t.options,t.fetchOptions),h=async(e,s,n)=>{if(r)return Promise.reject(t.signal.reason);if(null==s&&e.pages.length)return Promise.resolve(e);const o=await u((()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:s,direction:n?"backward":"forward",meta:t.options.meta};return l(e),e})()),{maxPages:i}=t.options,a=n?L:_;return{pages:a(e.pages,o,i),pageParams:a(e.pageParams,s,i)}};if(n&&o.length){const e="backward"===n,t=e?Z:W,r={pages:o,pageParams:i};a=await h(r,t(s,r),e)}else{const t=e??o.length;do{const e=0===c?i[0]??s.initialPageParam:W(s,a);if(c>0&&null==e)break;a=await h(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function W(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function Z(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function K(e,t){return!!t&&null!=W(e,t)}function J(e,t){return!(!t||!e.getPreviousPageParam)&&null!=Z(e,t)}var Y=class extends z{#a;#c;#l;#u;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#u=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=te(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=te(this.options);void 0!==e.data&&(this.setState(ee(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const r=D(this.state.data,e,this.options);return this.#y({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#y({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==b(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===w(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||!g(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.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.#d&&(this.#p||this.#m()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#y({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},n=()=>{const e=q(this.options,t),r=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return s(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:n};return s(e),e})();("infinite"===this.#a?B(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#y({type:"fetch",meta:o.fetchOptions?.meta}),this.#d=H({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof Q&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:()=>{this.#y({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof Q){if(i.silent)return this.#d.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#y({type:"error",error:i}),this.#u.config.onError?.(i,this),this.#u.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#y(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,...X(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ee(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":const s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),k.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function X(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function te(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var re=class extends l{constructor(e,t){super(),this.options=t,this.#h=e,this.#g=null,this.#w=M(),this.bindMethods(),this.setOptions(t)}#h;#b=void 0;#v=void 0;#E=void 0;#R;#S;#w;#g;#T;#O;#A;#I;#C;#P;#N=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),se(this.#b,this.options)?this.#D():this.updateResult(),this.#_())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ne(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ne(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#L(),this.#x(),this.#b.removeObserver(this)}setOptions(e){const t=this.options,r=this.#b;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof b(this.options.enabled,this.#b))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#b.setOptions(this.options),t._defaulted&&!I(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});const s=this.hasListeners();s&&oe(this.#b,r,this.options,t)&&this.#D(),this.updateResult(),!s||this.#b===r&&b(this.options.enabled,this.#b)===b(t.enabled,this.#b)&&w(this.options.staleTime,this.#b)===w(t.staleTime,this.#b)||this.#U();const n=this.#F();!s||this.#b===r&&b(this.options.enabled,this.#b)===b(t.enabled,this.#b)&&n===this.#P||this.#M(n)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var s;return s=r,I(this.getCurrentResult(),s)||(this.#E=r,this.#S=this.options,this.#R=this.#b.state),r}getCurrentResult(){return this.#E}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.#w.status||this.#w.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#N.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#D({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#E))}#D(e){this.#q();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(p)),t}#U(){this.#L();const e=w(this.options.staleTime,this.#b);if(F.isServer()||this.#E.isStale||!m(e))return;const t=g(this.#E.dataUpdatedAt,e)+1;this.#I=d.setTimeout(()=>{this.#E.isStale||this.updateResult()},t)}#F(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#M(e){this.#x(),this.#P=e,!F.isServer()&&!1!==b(this.options.enabled,this.#b)&&m(this.#P)&&0!==this.#P&&(this.#C=d.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#D()},this.#P))}#_(){this.#U(),this.#M(this.#F())}#L(){void 0!==this.#I&&(d.clearTimeout(this.#I),this.#I=void 0)}#x(){void 0!==this.#C&&(d.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){const r=this.#b,s=this.options,n=this.#E,o=this.#R,i=this.#S,a=e!==r?e.state:this.#v,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&se(e,t),i=n&&oe(e,r,t,s);(o||i)&&(u={...u,...X(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;n?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=n.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#A?.state.data,this.#A):t.placeholderData,void 0!==e&&(p="success",l=D(n?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(n&&l===o?.data&&t.select===this.#T)l=this.#O;else try{this.#T=t.select,l=t.select(l),l=D(n?.data,l,t),this.#O=l,this.#g=null}catch(S){this.#g=S}this.#g&&(d=this.#g,l=this.#O,f=Date.now(),p="error");const m="fetching"===u.fetchStatus,g="pending"===p,w="error"===p,v=g&&m,E=void 0!==l,R={status:p,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===p,isError:w,isInitialLoading:v,isLoading:v,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:w&&!E,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:w&&E,isStale:ie(e,t),refetch:this.refetch,promise:this.#w,isEnabled:!1!==b(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==R.data,s="error"===R.status&&!t,n=e=>{s?e.reject(R.error):t&&e.resolve(R.data)},o=()=>{n(this.#w=R.promise=M())},i=this.#w;switch(i.status){case"pending":e.queryHash===r.queryHash&&n(i);break;case"fulfilled":(s||R.data!==i.value)&&o();break;case"rejected":s&&R.error===i.reason||o()}}return R}updateResult(){const e=this.#E,t=this.createResult(this.#b,this.options);this.#R=this.#b.state,this.#S=this.options,void 0!==this.#R.data&&(this.#A=this.#b),I(t,e)||(this.#E=t,this.#$({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#N.size)return!0;const s=new Set(r??this.#N);return this.options.throwOnError&&s.add("error"),Object.keys(this.#E).some(t=>{const r=t;return this.#E[r]!==e[r]&&s.has(r)})})()}))}#q(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#b)return;const t=this.#b;this.#b=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#_()}#$(e){k.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#E)}),this.#h.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function se(e,t){return function(e,t){return!1!==b(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===b(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&ne(e,t,t.refetchOnMount)}function ne(e,t,r){if(!1!==b(t.enabled,e)&&"static"!==w(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&ie(e,t)}return!1}function oe(e,t,r,s){return(e!==t||!1===b(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ie(e,r)}function ie(e,t){return!1!==b(t.enabled,e)&&e.isStaleByTime(w(t.staleTime,e))}var ae=e(void 0),ce=e=>{const t=c(ae);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},le=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */i(ae.Provider,{value:e,children:r})),ue=e(!1);ue.Provider;var he=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function fe(e,s,o){const i=c(ue),l=c(he),u=ce(o),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const d=u.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),s=e.staleTime;e.staleTime="function"==typeof s?(...e)=>r(s(...e)):r(s),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(h),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?U(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(h,l,d),(e=>{t(()=>{e.clearReset()},[e])})(l);const f=!u.getQueryCache().get(h.queryHash),[y]=r(()=>new s(u,h)),m=y.getOptimisticResult(h),g=!i&&!1!==e.subscribed;if(n(a(e=>{const t=g?y.subscribe(k.batchCalls(e)):p;return y.updateResult(),t},[y,g]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),t(()=>{y.setOptions(h)},[h,y]),((e,t)=>e?.suspense&&t.isPending)(h,m))throw de(h,y,l);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||U(r,[e.error,s])))({result:m,errorResetBoundary:l,throwOnError:h.throwOnError,query:d,suspense:h.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,m),h.experimental_prefetchInRender&&!F.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(m,i)&&(f?de(h,y,l):d?.promise)?.catch(p).finally(()=>{y.updateResult()}),h.notifyOnChangeProps?m:y.trackResult(m)}function pe(e,t){return fe(e,re,t)}var ye=class extends Error{response;request;options;constructor(e,t,r){const s=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${s?`status code ${s}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},me=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}},ge=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new me(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}},we=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,s="function"==typeof globalThis.Request;if(r&&s)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})(),be="function"==typeof globalThis.AbortController,ve="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Ee="function"==typeof globalThis.ReadableStream,Re="function"==typeof globalThis.FormData,Se=["get","post","put","patch","head","delete"],Te={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Oe=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ae=Symbol("stop"),Ie=class{options;constructor(e){this.options=e}},Ce=e=>new Ie(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},Ne={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},_e=(e,t,r)=>{let s,n=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),s){n+=s.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},s)}s=e},flush(){s&&(n+=s.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},s))}}))},Le=e=>null!==e&&"object"==typeof e,xe=(...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 $e({},...e)},qe=(e={},t={})=>{const r=new globalThis.Headers(e),s=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[o,i]of n.entries())s&&"undefined"===i||void 0===i?r.delete(o):r.set(o,i);return r};function Ue(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:$e(e[r]??[],t[r]??[])}var Fe=(e={},t={})=>({beforeRequest:Ue(e,t,"beforeRequest"),beforeRetry:Ue(e,t,"beforeRetry"),afterResponse:Ue(e,t,"afterResponse"),beforeError:Ue(e,t,"beforeError")}),Me=(e,t)=>{const r=new URLSearchParams;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams)for(const[e,t]of s.entries())r.append(e,t);else if(Array.isArray(s))for(const e of s){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(s))for(const[e,t]of Object.entries(s))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())r.append(t,s)}return r},$e=(...e)=>{let t,r={},s={},n={};const o=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(Le(i)){for(let[e,s]of Object.entries(i))if("signal"===e&&s instanceof globalThis.AbortSignal)o.push(s);else if("context"!==e)"searchParams"!==e?(Le(s)&&e in r&&(s=$e(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:void 0===t?s:Me(t,s);else{if(null!=s&&(!Le(s)||Array.isArray(s)))throw new TypeError("The `context` option must be an object");r={...r,context:null==s?{}:{...r.context,...s}}}Le(i.hooks)&&(n=Fe(n,i.hooks),r.hooks=n),Le(i.headers)&&(s=qe(s,i.headers),r.headers=s)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=ve?AbortSignal.any(o):o.at(-1)),r},ke=e=>Se.includes(e)?e.toUpperCase():e,je={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{...je,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{...je,...t}},Ve=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Qe=class e{static create(t,r){const s=new e(t,r),n=s.#k(async()=>{if("number"==typeof s.#j.timeout&&s.#j.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await s.#G();for(const r of s.#j.hooks.afterResponse){const n=s.#V(e.clone());let o;try{o=await r(s.request,s.#Q(),n,{retryCount:s.#H})}catch(t){throw s.#z(n),s.#z(e),t}if(o instanceof Ie)throw s.#z(n),s.#z(e),new ge(o.options);const i=o instanceof globalThis.Response?o:e;n!==i&&s.#z(n),e!==i&&s.#z(e),e=i}if(s.#V(e),!e.ok&&("function"==typeof s.#j.throwHttpErrors?s.#j.throwHttpErrors(e.status):s.#j.throwHttpErrors)){let t=new ye(e,s.request,s.#Q());for(const e of s.#j.hooks.beforeError)t=await e(t,{retryCount:s.#H});throw t}if(s.#j.onDownloadProgress){if("function"!=typeof s.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Ee)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return s.#z(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(_e(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,s.#j.onDownloadProgress)}return e}).finally(()=>{const e=s.#B;s.#W(e?.body??void 0),s.#W(s.request.body??void 0)});for(const[e,o]of Object.entries(Te))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||o);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#Z(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#K;#H=0;#J;#j;#B;#Y;#X;constructor(t,r={}){if(this.#J=t,this.#j={...r,headers:qe(this.#J.headers,r.headers),hooks:Fe({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:ke(r.method??this.#J.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.#J&&!(this.#J instanceof URL||this.#J instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#J){if(this.#J.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#J=this.#j.prefixUrl+this.#J}be&&ve&&(this.#Y=this.#j.signal??this.#J.signal,this.#K=new globalThis.AbortController,this.#j.signal=this.#Y?AbortSignal.any([this.#Y,this.#K.signal]):this.#K.signal),we&&(this.#j.duplex="half"),void 0!==this.#j.json&&(this.#j.body=this.#j.stringifyJson?.(this.#j.json)??JSON.stringify(this.#j.json),this.#j.headers.set("content-type",this.#j.headers.get("content-type")??"application/json"));const s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#J instanceof globalThis.Request&&(Re&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!s&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#J,this.#j),void 0!==(n=this.#j.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.#j.searchParams?this.#j.searchParams.replace(/^\?/,""):new URLSearchParams(e.#Z(this.#j.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#j)}var n;if(this.#j.onUploadProgress){if("function"!=typeof this.#j.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!we)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#ee(this.request,this.#j.body??void 0)}}#te(){const e=this.#j.retry.delay(this.#H);let t=e;!0===this.#j.retry.jitter?t=Math.random()*e:"function"==typeof this.#j.retry.jitter&&(t=this.#j.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#j.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#re(e){if(this.#H++,this.#H>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new me(e);if(t instanceof ge)return t.customDelay??this.#te();if(!this.#j.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#j.retry.shouldRetry){const r=await this.#j.retry.shouldRetry({error:t,retryCount:this.#H});if(!1===r)throw e;if(!0===r)return this.#te()}if(function(e){return e instanceof Ve||e?.name===Ve.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ye||e?.name===ye.name}(e)){if(!this.#j.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.#j.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.#j.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#te()}#V(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#W(e){e&&e.cancel().catch(()=>{})}#z(e){this.#W(e.body??void 0)}async#k(e){try{return await e()}catch(t){const r=Math.min(await this.#re(t),2147483647);if(this.#H<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,s)=>{function n(){clearTimeout(o),s(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#Y?{signal:this.#Y}:{}),t instanceof ge&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#se(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#Q(),error:t,retryCount:this.#H});if(r instanceof globalThis.Request){this.#se(r);break}if(r instanceof globalThis.Response)return r;if(r===Ae)return}return this.#k(e)}}async#G(){this.#K?.signal.aborted&&(this.#K=new globalThis.AbortController,this.#j.signal=this.#Y?AbortSignal.any([this.#Y,this.#K.signal]):this.#K.signal,this.request=new globalThis.Request(this.request,{signal:this.#j.signal}));for(const t of this.#j.hooks.beforeRequest){const e=await t(this.request,this.#Q(),{retryCount:this.#H});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#se(e);break}}const e=((e,t)=>{const r={};for(const s in t)Object.hasOwn(t,s)&&(s in De||s in Pe||s in e&&!(s in Ne)||(r[s]=t[s]));return r})(this.request,this.#j);return this.#B=this.request,this.request=this.#B.clone(),!1===this.#j.timeout?this.#j.fetch(this.#B,e):async function(e,t,r,s){return new Promise((n,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new Ve(e))},s.timeout);s.fetch(e,t).then(n).catch(o).then(()=>{clearTimeout(i)})})}(this.#B,e,this.#K,this.#j)}#Q(){if(!this.#X){const{hooks:e,...t}=this.#j;this.#X=Object.freeze(t)}return this.#X}#se(e){this.#X=void 0,this.request=this.#ee(e)}#ee(e,t){return this.#j.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const s=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,s]of e)t+=Oe,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof s?(new TextEncoder).encode(s).length:s.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:_e(e.body,s,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},He=e=>{const t=(t,r)=>Qe.create(t,xe(e,r));for(const r of Se)t[r]=(t,s)=>Qe.create(t,xe(e,s,{method:r}));return t.create=e=>He(xe(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),He(xe(e,t))),t.stop=Ae,t.retry=Ce,t},ze=He(),Be={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`,MY_UPLOADS:"/my-uploads"},We={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`},Ze={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ke="https://qrati.com/api/connect",Je={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`,UPLOAD_CREATE:`${Ke}/content/upload/create`,UPLOAD_COMPLETE:`${Ke}/content/upload/complete`,UPLOAD_FAIL:`${Ke}/content/upload/fail`,UPLOAD_ABORT:`${Ke}/content/upload/abort`,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`,UPDATE_GAM_ANALYTICS:`${Ke}/event/update-gam-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`,GET_POST_PROCESSING_SETTINGS:`${Ke}/event/post-processing-settings`,MY_UPLOADS:`${Ke}/content/my-uploads`,DELETE_CONTENT:`${Ke}/content/delete`},Ye={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Xe={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},et={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},tt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},rt={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},st=26214400,nt=262144e3,ot={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},it={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},at={CONTEST:"CONTEST",REACTION:"REACTION"},ct={GRID:"grid",SINGLE:"single"},lt={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},ut={[lt.POPULAR]:{label:"Popular",sortField:"score"},[lt.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[lt.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},ht="map-view-state",dt=lt.UPLOAD_TIME,ft={ASC:"asc",DESC:"desc"},pt={[ft.ASC]:{label:"Ascending",sortOrder:""},[ft.DESC]:{label:"Descending",sortOrder:"-"}},yt=ft.DESC,mt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},gt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},wt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},bt={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`,USER_UPLOADS:"user-uploads"};function vt({title:e,children:t}){/* @__PURE__ */
1
+ import{E as e,b as t,h as r,p as s,r as n,s as o,t as i,v as a,y as c}from"./C3uDEVBt.js";var l=class{constructor(){this.listeners=/* @__PURE__ */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(){}},u=new class extends l{#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}},h={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},d=new class{#s=h;#n=!1;setTimeoutProvider(e){this.#s=e}setTimeout(e,t){return this.#s.setTimeout(e,t)}clearTimeout(e){this.#s.clearTimeout(e)}setInterval(e,t){return this.#s.setInterval(e,t)}clearInterval(e){this.#s.clearInterval(e)}},f="undefined"==typeof window||"Deno"in globalThis;function p(){}function y(e,t){return"function"==typeof e?e(t):e}function m(e){return"number"==typeof e&&e>=0&&e!==1/0}function g(e,t){return Math.max(e+(t||0)-Date.now(),0)}function w(e,t){return"function"==typeof e?e(t):e}function b(e,t){return"function"==typeof e?e(t):e}function v(e,t){const{type:r="all",exact:s,fetchStatus:n,predicate:o,queryKey:i,stale:a}=e;if(i)if(s){if(t.queryHash!==R(i,t.options))return!1}else if(!T(t.queryKey,i))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||n&&n!==t.state.fetchStatus||o&&!o(t))}function E(e,t){const{exact:r,status:s,predicate:n,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(S(t.options.mutationKey)!==S(o))return!1}else if(!T(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||n&&!n(t))}function R(e,t){return(t?.queryKeyHashFn||S)(e)}function S(e){return JSON.stringify(e,(e,t)=>P(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function T(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>T(e[r],t[r]))}var O=Object.prototype.hasOwnProperty;function A(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=C(e)&&C(t);if(!(s||P(e)&&P(t)))return t;const n=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),i=o.length,a=s?new Array(i):{};let c=0;for(let l=0;l<i;l++){const i=s?l:o[l],u=e[i],h=t[i];if(u===h){a[i]=u,(s?l<n:O.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=A(u,h,r+1);a[i]=d,d===u&&c++}return n===i&&c===n?e:a}function I(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 C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P(e){if(!N(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!N(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function N(e){return"[object Object]"===Object.prototype.toString.call(e)}function D(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?A(e,t):t}function _(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function L(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var x=/* @__PURE__ */Symbol();function q(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==x?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function U(e,t){return"function"==typeof e?e(...t):!!e}var F=/* @__PURE__ */(()=>{let e=()=>f;return{isServer:()=>e(),setIsServer(t){e=t}}})();function M(){let e,t;const r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}var k=function(e){setTimeout(e,0)},$=function(){let e=[],t=0,r=e=>{e()},s=e=>{e()},n=k;const o=s=>{t?e.push(s):n(()=>{r(s)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&n(()=>{s(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}}}(),j=new class extends l{#o=!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.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function G(e){return Math.min(1e3*2**e,3e4)}function V(e){return"online"!==(e??"online")||j.isOnline()}var Q=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function H(e){let t,r=!1,s=0;const n=M(),o=()=>"pending"!==n.status,i=()=>u.isFocused()&&("always"===e.networkMode||j.isOnline())&&e.canRun(),a=()=>V(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),n.resolve(e))},l=e=>{o()||(t?.(),n.reject(e))},h=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),f=()=>{if(o())return;let t;const n=0===s?e.initialPromise:void 0;try{t=n??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const n=e.retry??(F.isServer()?0:3),a=e.retryDelay??G,c="function"==typeof a?a(s,t):a,u=!0===n||"number"==typeof n&&s<n||"function"==typeof n&&n(s,t);var p;!r&&u?(s++,e.onFail?.(s,t),(p=c,new Promise(e=>{d.setTimeout(e,p)})).then(()=>i()?void 0:h()).then(()=>{r?l(t):f()})):l(t)})};return{promise:n,status:()=>n.status,cancel:t=>{if(!o()){const r=new Q(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?f():h().then(f),n)}}var z=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#i=d.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(d.clearTimeout(this.#i),this.#i=void 0)}};function B(e){return{onFetch:(t,r)=>{const s=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,s){let n,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t.signal,o||(o=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)})}(e,0,()=>r=!0)},u=q(t.options,t.fetchOptions),h=async(e,s,n)=>{if(r)return Promise.reject(t.signal.reason);if(null==s&&e.pages.length)return Promise.resolve(e);const o=await u((()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:s,direction:n?"backward":"forward",meta:t.options.meta};return l(e),e})()),{maxPages:i}=t.options,a=n?L:_;return{pages:a(e.pages,o,i),pageParams:a(e.pageParams,s,i)}};if(n&&o.length){const e="backward"===n,t=e?Z:W,r={pages:o,pageParams:i};a=await h(r,t(s,r),e)}else{const t=e??o.length;do{const e=0===c?i[0]??s.initialPageParam:W(s,a);if(c>0&&null==e)break;a=await h(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function W(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function Z(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function K(e,t){return!!t&&null!=W(e,t)}function J(e,t){return!(!t||!e.getPreviousPageParam)&&null!=Z(e,t)}var Y=class extends z{#a;#c;#l;#u;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#u=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=te(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=te(this.options);void 0!==e.data&&(this.setState(ee(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const r=D(this.state.data,e,this.options);return this.#y({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#y({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==b(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===w(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||!g(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.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.#d&&(this.#p||this.#m()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#y({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},n=()=>{const e=q(this.options,t),r=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return s(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:n};return s(e),e})();("infinite"===this.#a?B(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#y({type:"fetch",meta:o.fetchOptions?.meta}),this.#d=H({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof Q&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:()=>{this.#y({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof Q){if(i.silent)return this.#d.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#y({type:"error",error:i}),this.#u.config.onError?.(i,this),this.#u.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#y(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,...X(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ee(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":const s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),$.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function X(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function te(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var re=class extends l{constructor(e,t){super(),this.options=t,this.#h=e,this.#g=null,this.#w=M(),this.bindMethods(),this.setOptions(t)}#h;#b=void 0;#v=void 0;#E=void 0;#R;#S;#w;#g;#T;#O;#A;#I;#C;#P;#N=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),se(this.#b,this.options)?this.#D():this.updateResult(),this.#_())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ne(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ne(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#L(),this.#x(),this.#b.removeObserver(this)}setOptions(e){const t=this.options,r=this.#b;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof b(this.options.enabled,this.#b))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#b.setOptions(this.options),t._defaulted&&!I(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});const s=this.hasListeners();s&&oe(this.#b,r,this.options,t)&&this.#D(),this.updateResult(),!s||this.#b===r&&b(this.options.enabled,this.#b)===b(t.enabled,this.#b)&&w(this.options.staleTime,this.#b)===w(t.staleTime,this.#b)||this.#U();const n=this.#F();!s||this.#b===r&&b(this.options.enabled,this.#b)===b(t.enabled,this.#b)&&n===this.#P||this.#M(n)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var s;return s=r,I(this.getCurrentResult(),s)||(this.#E=r,this.#S=this.options,this.#R=this.#b.state),r}getCurrentResult(){return this.#E}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.#w.status||this.#w.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#N.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#D({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#E))}#D(e){this.#q();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(p)),t}#U(){this.#L();const e=w(this.options.staleTime,this.#b);if(F.isServer()||this.#E.isStale||!m(e))return;const t=g(this.#E.dataUpdatedAt,e)+1;this.#I=d.setTimeout(()=>{this.#E.isStale||this.updateResult()},t)}#F(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#M(e){this.#x(),this.#P=e,!F.isServer()&&!1!==b(this.options.enabled,this.#b)&&m(this.#P)&&0!==this.#P&&(this.#C=d.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#D()},this.#P))}#_(){this.#U(),this.#M(this.#F())}#L(){void 0!==this.#I&&(d.clearTimeout(this.#I),this.#I=void 0)}#x(){void 0!==this.#C&&(d.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){const r=this.#b,s=this.options,n=this.#E,o=this.#R,i=this.#S,a=e!==r?e.state:this.#v,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&se(e,t),i=n&&oe(e,r,t,s);(o||i)&&(u={...u,...X(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;n?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=n.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#A?.state.data,this.#A):t.placeholderData,void 0!==e&&(p="success",l=D(n?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(n&&l===o?.data&&t.select===this.#T)l=this.#O;else try{this.#T=t.select,l=t.select(l),l=D(n?.data,l,t),this.#O=l,this.#g=null}catch(S){this.#g=S}this.#g&&(d=this.#g,l=this.#O,f=Date.now(),p="error");const m="fetching"===u.fetchStatus,g="pending"===p,w="error"===p,v=g&&m,E=void 0!==l,R={status:p,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===p,isError:w,isInitialLoading:v,isLoading:v,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:w&&!E,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:w&&E,isStale:ie(e,t),refetch:this.refetch,promise:this.#w,isEnabled:!1!==b(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==R.data,s="error"===R.status&&!t,n=e=>{s?e.reject(R.error):t&&e.resolve(R.data)},o=()=>{n(this.#w=R.promise=M())},i=this.#w;switch(i.status){case"pending":e.queryHash===r.queryHash&&n(i);break;case"fulfilled":(s||R.data!==i.value)&&o();break;case"rejected":s&&R.error===i.reason||o()}}return R}updateResult(){const e=this.#E,t=this.createResult(this.#b,this.options);this.#R=this.#b.state,this.#S=this.options,void 0!==this.#R.data&&(this.#A=this.#b),I(t,e)||(this.#E=t,this.#k({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#N.size)return!0;const s=new Set(r??this.#N);return this.options.throwOnError&&s.add("error"),Object.keys(this.#E).some(t=>{const r=t;return this.#E[r]!==e[r]&&s.has(r)})})()}))}#q(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#b)return;const t=this.#b;this.#b=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#_()}#k(e){$.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#E)}),this.#h.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function se(e,t){return function(e,t){return!1!==b(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===b(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&ne(e,t,t.refetchOnMount)}function ne(e,t,r){if(!1!==b(t.enabled,e)&&"static"!==w(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&ie(e,t)}return!1}function oe(e,t,r,s){return(e!==t||!1===b(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ie(e,r)}function ie(e,t){return!1!==b(t.enabled,e)&&e.isStaleByTime(w(t.staleTime,e))}var ae=e(void 0),ce=e=>{const t=c(ae);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},le=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */i(ae.Provider,{value:e,children:r})),ue=e(!1);ue.Provider;var he=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function fe(e,s,o){const i=c(ue),l=c(he),u=ce(o),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const d=u.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),s=e.staleTime;e.staleTime="function"==typeof s?(...e)=>r(s(...e)):r(s),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(h),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?U(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(h,l,d),(e=>{t(()=>{e.clearReset()},[e])})(l);const f=!u.getQueryCache().get(h.queryHash),[y]=r(()=>new s(u,h)),m=y.getOptimisticResult(h),g=!i&&!1!==e.subscribed;if(n(a(e=>{const t=g?y.subscribe($.batchCalls(e)):p;return y.updateResult(),t},[y,g]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),t(()=>{y.setOptions(h)},[h,y]),((e,t)=>e?.suspense&&t.isPending)(h,m))throw de(h,y,l);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||U(r,[e.error,s])))({result:m,errorResetBoundary:l,throwOnError:h.throwOnError,query:d,suspense:h.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,m),h.experimental_prefetchInRender&&!F.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(m,i)&&(f?de(h,y,l):d?.promise)?.catch(p).finally(()=>{y.updateResult()}),h.notifyOnChangeProps?m:y.trackResult(m)}function pe(e,t){return fe(e,re,t)}var ye=class extends Error{response;request;options;constructor(e,t,r){const s=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${s?`status code ${s}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},me=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}},ge=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new me(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}},we=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,s="function"==typeof globalThis.Request;if(r&&s)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})(),be="function"==typeof globalThis.AbortController,ve="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Ee="function"==typeof globalThis.ReadableStream,Re="function"==typeof globalThis.FormData,Se=["get","post","put","patch","head","delete"],Te={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Oe=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ae=Symbol("stop"),Ie=class{options;constructor(e){this.options=e}},Ce=e=>new Ie(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},Ne={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},_e=(e,t,r)=>{let s,n=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),s){n+=s.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},s)}s=e},flush(){s&&(n+=s.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},s))}}))},Le=e=>null!==e&&"object"==typeof e,xe=(...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 ke({},...e)},qe=(e={},t={})=>{const r=new globalThis.Headers(e),s=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[o,i]of n.entries())s&&"undefined"===i||void 0===i?r.delete(o):r.set(o,i);return r};function Ue(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:ke(e[r]??[],t[r]??[])}var Fe=(e={},t={})=>({beforeRequest:Ue(e,t,"beforeRequest"),beforeRetry:Ue(e,t,"beforeRetry"),afterResponse:Ue(e,t,"afterResponse"),beforeError:Ue(e,t,"beforeError")}),Me=(e,t)=>{const r=new URLSearchParams;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams)for(const[e,t]of s.entries())r.append(e,t);else if(Array.isArray(s))for(const e of s){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(s))for(const[e,t]of Object.entries(s))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())r.append(t,s)}return r},ke=(...e)=>{let t,r={},s={},n={};const o=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(Le(i)){for(let[e,s]of Object.entries(i))if("signal"===e&&s instanceof globalThis.AbortSignal)o.push(s);else if("context"!==e)"searchParams"!==e?(Le(s)&&e in r&&(s=ke(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:void 0===t?s:Me(t,s);else{if(null!=s&&(!Le(s)||Array.isArray(s)))throw new TypeError("The `context` option must be an object");r={...r,context:null==s?{}:{...r.context,...s}}}Le(i.hooks)&&(n=Fe(n,i.hooks),r.hooks=n),Le(i.headers)&&(s=qe(s,i.headers),r.headers=s)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=ve?AbortSignal.any(o):o.at(-1)),r},$e=e=>Se.includes(e)?e.toUpperCase():e,je={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{...je,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{...je,...t}},Ve=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Qe=class e{static create(t,r){const s=new e(t,r),n=s.#$(async()=>{if("number"==typeof s.#j.timeout&&s.#j.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await s.#G();for(const r of s.#j.hooks.afterResponse){const n=s.#V(e.clone());let o;try{o=await r(s.request,s.#Q(),n,{retryCount:s.#H})}catch(t){throw s.#z(n),s.#z(e),t}if(o instanceof Ie)throw s.#z(n),s.#z(e),new ge(o.options);const i=o instanceof globalThis.Response?o:e;n!==i&&s.#z(n),e!==i&&s.#z(e),e=i}if(s.#V(e),!e.ok&&("function"==typeof s.#j.throwHttpErrors?s.#j.throwHttpErrors(e.status):s.#j.throwHttpErrors)){let t=new ye(e,s.request,s.#Q());for(const e of s.#j.hooks.beforeError)t=await e(t,{retryCount:s.#H});throw t}if(s.#j.onDownloadProgress){if("function"!=typeof s.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Ee)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return s.#z(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(_e(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,s.#j.onDownloadProgress)}return e}).finally(()=>{const e=s.#B;s.#W(e?.body??void 0),s.#W(s.request.body??void 0)});for(const[e,o]of Object.entries(Te))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||o);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#Z(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#K;#H=0;#J;#j;#B;#Y;#X;constructor(t,r={}){if(this.#J=t,this.#j={...r,headers:qe(this.#J.headers,r.headers),hooks:Fe({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:$e(r.method??this.#J.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.#J&&!(this.#J instanceof URL||this.#J instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#J){if(this.#J.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#J=this.#j.prefixUrl+this.#J}be&&ve&&(this.#Y=this.#j.signal??this.#J.signal,this.#K=new globalThis.AbortController,this.#j.signal=this.#Y?AbortSignal.any([this.#Y,this.#K.signal]):this.#K.signal),we&&(this.#j.duplex="half"),void 0!==this.#j.json&&(this.#j.body=this.#j.stringifyJson?.(this.#j.json)??JSON.stringify(this.#j.json),this.#j.headers.set("content-type",this.#j.headers.get("content-type")??"application/json"));const s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#J instanceof globalThis.Request&&(Re&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!s&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#J,this.#j),void 0!==(n=this.#j.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.#j.searchParams?this.#j.searchParams.replace(/^\?/,""):new URLSearchParams(e.#Z(this.#j.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#j)}var n;if(this.#j.onUploadProgress){if("function"!=typeof this.#j.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!we)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#ee(this.request,this.#j.body??void 0)}}#te(){const e=this.#j.retry.delay(this.#H);let t=e;!0===this.#j.retry.jitter?t=Math.random()*e:"function"==typeof this.#j.retry.jitter&&(t=this.#j.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#j.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#re(e){if(this.#H++,this.#H>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new me(e);if(t instanceof ge)return t.customDelay??this.#te();if(!this.#j.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#j.retry.shouldRetry){const r=await this.#j.retry.shouldRetry({error:t,retryCount:this.#H});if(!1===r)throw e;if(!0===r)return this.#te()}if(function(e){return e instanceof Ve||e?.name===Ve.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ye||e?.name===ye.name}(e)){if(!this.#j.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.#j.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.#j.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#te()}#V(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#W(e){e&&e.cancel().catch(()=>{})}#z(e){this.#W(e.body??void 0)}async#$(e){try{return await e()}catch(t){const r=Math.min(await this.#re(t),2147483647);if(this.#H<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,s)=>{function n(){clearTimeout(o),s(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#Y?{signal:this.#Y}:{}),t instanceof ge&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#se(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#Q(),error:t,retryCount:this.#H});if(r instanceof globalThis.Request){this.#se(r);break}if(r instanceof globalThis.Response)return r;if(r===Ae)return}return this.#$(e)}}async#G(){this.#K?.signal.aborted&&(this.#K=new globalThis.AbortController,this.#j.signal=this.#Y?AbortSignal.any([this.#Y,this.#K.signal]):this.#K.signal,this.request=new globalThis.Request(this.request,{signal:this.#j.signal}));for(const t of this.#j.hooks.beforeRequest){const e=await t(this.request,this.#Q(),{retryCount:this.#H});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#se(e);break}}const e=((e,t)=>{const r={};for(const s in t)Object.hasOwn(t,s)&&(s in De||s in Pe||s in e&&!(s in Ne)||(r[s]=t[s]));return r})(this.request,this.#j);return this.#B=this.request,this.request=this.#B.clone(),!1===this.#j.timeout?this.#j.fetch(this.#B,e):async function(e,t,r,s){return new Promise((n,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new Ve(e))},s.timeout);s.fetch(e,t).then(n).catch(o).then(()=>{clearTimeout(i)})})}(this.#B,e,this.#K,this.#j)}#Q(){if(!this.#X){const{hooks:e,...t}=this.#j;this.#X=Object.freeze(t)}return this.#X}#se(e){this.#X=void 0,this.request=this.#ee(e)}#ee(e,t){return this.#j.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const s=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,s]of e)t+=Oe,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof s?(new TextEncoder).encode(s).length:s.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:_e(e.body,s,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},He=e=>{const t=(t,r)=>Qe.create(t,xe(e,r));for(const r of Se)t[r]=(t,s)=>Qe.create(t,xe(e,s,{method:r}));return t.create=e=>He(xe(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),He(xe(e,t))),t.stop=Ae,t.retry=Ce,t},ze=He(),Be={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`,MY_UPLOADS:"/my-uploads"},We={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`},Ze={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ke="https://qrati.com/api/connect",Je={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`,UPLOAD_CREATE:`${Ke}/content/upload/create`,UPLOAD_COMPLETE:`${Ke}/content/upload/complete`,UPLOAD_FAIL:`${Ke}/content/upload/fail`,UPLOAD_ABORT:`${Ke}/content/upload/abort`,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`,UPDATE_GAM_ANALYTICS:`${Ke}/event/update-gam-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`,GET_POST_PROCESSING_SETTINGS:`${Ke}/event/post-processing-settings`,MY_UPLOADS:`${Ke}/content/my-uploads`,DELETE_CONTENT:`${Ke}/content/delete`},Ye={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Xe={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},et={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},tt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},rt={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},st=26214400,nt=262144e3,ot={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},it={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},at={CONTEST:"CONTEST",REACTION:"REACTION"},ct={GRID:"grid",SINGLE:"single"},lt={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},ut={[lt.POPULAR]:{label:"Popular",sortField:"score"},[lt.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[lt.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},ht="map-view-state",dt=lt.UPLOAD_TIME,ft={ASC:"asc",DESC:"desc"},pt={[ft.ASC]:{label:"Ascending",sortOrder:""},[ft.DESC]:{label:"Descending",sortOrder:"-"}},yt=ft.DESC,mt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},gt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},wt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},bt={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`,USER_UPLOADS:"user-uploads"};function vt({title:e,children:t}){/* @__PURE__ */
2
2
  return i("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */i("g",{transform:"translate(-443.142 -257.876)",children:[
3
3
  /* @__PURE__ */i("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
4
  /* @__PURE__ */i("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"}),
@@ -36,6 +36,6 @@ return i(vt,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom au
36
36
  /* @__PURE__ */i(Et,{organizationId:e})," for details."]}:"page-not-registered"===t?{title:"Page not registered",children:["Add the current page URL in Allowed URLs under"," ",
37
37
  /* @__PURE__ */i("a",{className:"font-medium text-blue-500",href:We.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨ Integration Settings. See our ",
38
38
  /* @__PURE__ */i(Et,{organizationId:e})," for details."]}:{title:"Heads up",children:["Something needs attention. See our ",
39
- /* @__PURE__ */i(Et,{organizationId:e})," for details or contact Qrati support."]})}var St='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Tt=e=>e.trim().replace(/\s+/g," "),Ot=e=>e?.replace(/\/+$/,"")||"",At=e=>{if(!e)return St;const t=Tt("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${St}`:`"${t}", ${St}`:"inherit"};function It(e){var t,r,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=It(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Ct(){for(var e,t,r=0,s="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=It(e))&&(s&&(s+=" "),s+=t);return s}var Pt=(...e)=>Ct(e.filter(Boolean)),Nt=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},Dt="px",_t=(e,t="light")=>{const r=e?.themeSettings?.colors??{},s=e?.themeSettings?.border,n=e?.themeSettings?.shadow,o=e?.integrationSettings,i="dark"===t,a=(e,t,s,n)=>{const o=i?n:s;return r[i?t:e]||o},c=a("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":a("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":a("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":a("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":a("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":a("borderLight","borderDark","#dddddd","#353538"),"--input":a("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":Nt(c),"--popover":a("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":a("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":a("infoLight","infoDark","#2563eb","#5b8def"),"--warning":a("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":a("successLight","successDark","#10b981","#34d399"),"--destructive":a("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${s?.width??"1"}${s?.unit??"px"}`,"--radius":`${s?.radius??"10"}${s?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${n?.outerHorizontalOffset??"0"}${n?.unit??Dt}`,"--shadow-outer-vertical-offset":`${n?.outerVerticalOffset??"0"}${n?.unit??Dt}`,"--shadow-outer-blur":`${n?.outerBlur??"0"}${n?.unit??Dt}`,"--shadow-outer-spread":`${n?.outerSpread??"0"}${n?.unit??Dt}`,...o?.fontFamily&&"system"!==o.fontFamily?{"--font-family":At(o)}:{}}},Lt=async e=>{try{return await e()}catch{return null}},xt=(e,t=1)=>{const r=(new TextEncoder).encode(e),s=3432918353,n=461845907;let o=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,s),e=e<<15|e>>>17,e=Math.imul(e,n),o^=e,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196>>>0}let c=0;const l=4*i,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,s),c=c<<15|c>>>17,c=Math.imul(c,n),o^=c),o^=r.length,o^=o>>>16,o=Math.imul(o,2246822507)>>>0,o^=o>>>13,o=Math.imul(o,3266489909)>>>0,o^=o>>>16,o.toString(16).padStart(8,"0")},qt=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(qt).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${qt(s)}:${qt(t)}`)}return`{${r.join(",")}}`},Ut=async({debug:e=!1}={})=>{const t=performance.now(),r=await Lt(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?qt(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),s=await Lt(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const s of t){const t=e.canPlayType(s);r[s]=""===t?"no":t}return qt(r)})()),n=await Lt(()=>(()=>{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 s={};for(const o of e)r.style.fontFamily=o,s[o]=r.offsetWidth;const n=[];for(const o of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${o}", ${i}`,r.offsetWidth!==s[i]){n.push(o),t=!0;break}t||(r.style.fontFamily=`"${o}"`,r.offsetWidth!==s.monospace&&r.offsetWidth!==s.serif&&n.push(o))}return document.body.removeChild(r),n.length?n.sort().join(","):null})()),o=await Lt(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",y=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",m=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:w,colorDepth:b}=window.screen,v="ontouchstart"in window||window.navigator.maxTouchPoints>0,E=await Lt(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),s=r.createLinearGradient(0,0,280,100);return s.addColorStop(0,"#f60"),s.addColorStop(.4,"#09f"),s.addColorStop(.7,"#f09"),s.addColorStop(1,"#0f9"),r.fillStyle=s,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)),xt(t.toDataURL("image/png"))})(e)),R=await Lt(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return xt(qt({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),S=await Lt(()=>(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 xt(qt(r))})(e)),T=await Lt(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const s=t.createDynamicsCompressor();s.threshold.value=-48,s.knee.value=30,s.ratio.value=14,s.attack.value=0,s.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(s),s.connect(n),n.connect(t.destination),r.start(0);const o=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let l=3e3;l<5800;l+=2){const e=o[l];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=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(o.slice(4500,5e3)),s=e.width/r.length;for(let n=0;n<r.length;n++){const o=n*s,i=(r[n]+1)/2*e.height;0===n?t.moveTo(o,i):t.lineTo(o,i)}t.stroke(),document.body.appendChild(e)}return xt(c.toString(16))})(e)),O=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,A=await Lt(()=>window.screen.orientation?.type||null),I=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,C=I&&I.type||null,P=I?.effectiveType||null,N=!0===I?.saveData,D="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,_="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,L=await Lt(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),x=await Lt(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return qt(t)}),q={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:s||null,fonts:n,numberingSystem:o,languages:i,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:f,prefersContrast:p,prefersReducedTransparency:y,pdfViewerEnabled:D,webdriver:_,intlSupportedCalendars:L||null,permissionsState:x||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:m,devicePixelRatio:g,pixelDepth:w,colorDepth:b,touchSupport:v,screenOrientation:A||null,connectionType:C,effectiveType:P,saveData:N,canvasID:E,webglID:R,webgpuID:S,audioID:T},U={aspectRatio:O,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!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(q,U);const F=xt(qt(q)),M=Math.round(performance.now()-t);return{fingerprint:F,...q,elapsedMs:M}};"undefined"!=typeof window&&(window.getBrowserFingerprint=Ut);var Ft=async(e,t)=>{if(e instanceof ye){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)},Mt=e(void 0),$t=({props:e={},children:n})=>{const{organizationId:c,uid:l,fname:u,lname:h,theme:d="light"}=e,[f,p]=r(null),[y,m]=r(null),{isLoading:g,data:w,error:b}=pe({queryKey:[bt.QRATI_CONNECT_SESSION,c,l??null,u??null,h??null],queryFn:async()=>{const e=await(async()=>{const e=await Ut();return"string"==typeof e?e:e?.fingerprint})();try{return(await ze.post(Je.INITIALIZE_SESSION,{json:{uid:l,fname:u,lname:h,browserFingerprint:e},headers:{"x-org-id":c,...!y?.token||l||u||h?{}:{Authorization:`Bearer ${y.token}`}}}).json()).data}catch(t){if(t instanceof ye)try{const e=await t.response.json();t.apiMessage=e?.message||e?.error}catch{}throw t}},enabled:!!c});t(()=>{const e=w?.authSession?.session?.token??w?.authSession?.token,t=w?.authSession?.user;t&&e?m(r=>({...r,...t,token:e,tcAccepted:void 0===t.tcAccepted?r?.tcAccepted:t.tcAccepted})):w?.organization?.customAuth&&l&&u&&m(e=>e??{_id:l,uid:l,name:h?`${u} ${h}`:u,fname:u,lname:h})},[w]);const v=s(()=>{const e=w?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=Ot("https://qrati.com"),s=t?Tt(t):"";return r&&s?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(s)}`:null})(0,e),r=((e,t)=>{const r=Ot("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const s=Tt(e.fontFamily);if("custom"===s&&t){const r=e.customFontName||"QratiCustomFont",s=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${n=r,n.replace(/"/g,'\\"')}";src:url("${t}") format("${s}");font-weight:400 700;font-style:normal;font-display:swap;}`}var n;const o=r||(e=>{if(!e)return null;const t=Tt(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(s);return o?`@import url("${o}");`:""})(w?.organization?.integrationSettings,w?.organization?.customFontUrl?r||w.organization.customFontUrl:void 0,t||void 0)},[w?.organization?.integrationSettings,w?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),v){if(v.startsWith("@import")){const t=v.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=v,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[v,c]);const E=a(async e=>{m(t=>({...t,...e}))},[]),R=a(async(e,t,r,s)=>{try{const n=await ze.post(Je.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":c}}).json();return n.error?{error:n.error}:(m({...n.user,token:n.token}),n)}catch(b){return{error:await Ft(b,"Registration failed")}}},[c]),S=a(async(e,t)=>{try{const r=await ze.post(Je.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:(m({...r.user,token:r.token}),r)}catch(b){return{error:await Ft(b,"Invalid email or password")}}},[c]),T=a(async e=>{const t=await((e,t,r)=>new Promise((s,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 o=new URL(`${r}/qc-social-auth`);o.searchParams.set("provider",e),o.searchParams.set("organizationId",t),o.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(o.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{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:o,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(o){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),s({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,c??"","https://qrati.com");return t?.user&&t?.token&&m({...t.user,token:t.token}),t},[c]),O=a(async()=>T("google"),[T]),A=a(async()=>T("apple"),[T]),I=a(async e=>{try{const t=await ze.post(Je.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(b){return{error:await Ft(b,"Failed to send password reset code")}}},[c]),C=a(async(e,t)=>{try{const r=await ze.post(Je.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(b){return{error:await Ft(b,"Invalid code, please check your email")}}},[c]),P=a(async(e,t)=>{try{const r=await ze.post(Je.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(b){return{error:b?.message}}},[c]),N=a(async()=>{try{const e=await ze.post(Je.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${y?.token}`}}).json();return e.error?{error:e.error}:(m(null),e)}catch(b){return{error:b?.message}}},[c,y?.token]),D=s(()=>({props:e,initializing:g,sessionId:w?.sessionId,organization:w?.organization,folders:w?.folders,orgRole:w?.orgRole??null,loadingUser:g,user:y,updateUser:E,registerUsingEmail:R,loginWithGoogle:O,loginWithApple:A,loginUsingEmail:S,sendPasswordResetCode:I,verifyPasswordResetCode:C,resetPassword:P,signout:N,error:b,portalContainer:f}),[e,g,w,y,E,R,O,A,S,I,C,P,N,b,f]);if(b){const e=b,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
39
+ /* @__PURE__ */i(Et,{organizationId:e})," for details or contact Qrati support."]})}var St='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Tt=e=>e.trim().replace(/\s+/g," "),Ot=e=>e?.replace(/\/+$/,"")||"",At=e=>{if(!e)return St;const t=Tt("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${St}`:`"${t}", ${St}`:"inherit"};function It(e){var t,r,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=It(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Ct(){for(var e,t,r=0,s="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=It(e))&&(s&&(s+=" "),s+=t);return s}var Pt=(...e)=>Ct(e.filter(Boolean)),Nt=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},Dt="px",_t=(e,t="light")=>{const r=e?.themeSettings?.colors??{},s=e?.themeSettings?.border,n=e?.themeSettings?.shadow,o=e?.integrationSettings,i="dark"===t,a=(e,t,s,n)=>{const o=i?n:s;return r[i?t:e]||o},c=a("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":a("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":a("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":a("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":a("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":a("borderLight","borderDark","#dddddd","#353538"),"--input":a("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":Nt(c),"--popover":a("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":a("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":a("infoLight","infoDark","#2563eb","#5b8def"),"--warning":a("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":a("successLight","successDark","#10b981","#34d399"),"--destructive":a("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${s?.width??"1"}${s?.unit??"px"}`,"--radius":`${s?.radius??"10"}${s?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${n?.outerHorizontalOffset??"0"}${n?.unit??Dt}`,"--shadow-outer-vertical-offset":`${n?.outerVerticalOffset??"0"}${n?.unit??Dt}`,"--shadow-outer-blur":`${n?.outerBlur??"0"}${n?.unit??Dt}`,"--shadow-outer-spread":`${n?.outerSpread??"0"}${n?.unit??Dt}`,...o?.fontFamily&&"system"!==o.fontFamily?{"--font-family":At(o)}:{}}},Lt=async e=>{try{return await e()}catch{return null}},xt=(e,t=1)=>{const r=(new TextEncoder).encode(e),s=3432918353,n=461845907;let o=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,s),e=e<<15|e>>>17,e=Math.imul(e,n),o^=e,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196>>>0}let c=0;const l=4*i,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,s),c=c<<15|c>>>17,c=Math.imul(c,n),o^=c),o^=r.length,o^=o>>>16,o=Math.imul(o,2246822507)>>>0,o^=o>>>13,o=Math.imul(o,3266489909)>>>0,o^=o>>>16,o.toString(16).padStart(8,"0")},qt=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(qt).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${qt(s)}:${qt(t)}`)}return`{${r.join(",")}}`},Ut=async({debug:e=!1}={})=>{const t=performance.now(),r=await Lt(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?qt(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),s=await Lt(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const s of t){const t=e.canPlayType(s);r[s]=""===t?"no":t}return qt(r)})()),n=await Lt(()=>(()=>{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 s={};for(const o of e)r.style.fontFamily=o,s[o]=r.offsetWidth;const n=[];for(const o of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${o}", ${i}`,r.offsetWidth!==s[i]){n.push(o),t=!0;break}t||(r.style.fontFamily=`"${o}"`,r.offsetWidth!==s.monospace&&r.offsetWidth!==s.serif&&n.push(o))}return document.body.removeChild(r),n.length?n.sort().join(","):null})()),o=await Lt(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",y=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",m=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:w,colorDepth:b}=window.screen,v="ontouchstart"in window||window.navigator.maxTouchPoints>0,E=await Lt(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),s=r.createLinearGradient(0,0,280,100);return s.addColorStop(0,"#f60"),s.addColorStop(.4,"#09f"),s.addColorStop(.7,"#f09"),s.addColorStop(1,"#0f9"),r.fillStyle=s,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)),xt(t.toDataURL("image/png"))})(e)),R=await Lt(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return xt(qt({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),S=await Lt(()=>(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 xt(qt(r))})(e)),T=await Lt(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const s=t.createDynamicsCompressor();s.threshold.value=-48,s.knee.value=30,s.ratio.value=14,s.attack.value=0,s.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(s),s.connect(n),n.connect(t.destination),r.start(0);const o=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let l=3e3;l<5800;l+=2){const e=o[l];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=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(o.slice(4500,5e3)),s=e.width/r.length;for(let n=0;n<r.length;n++){const o=n*s,i=(r[n]+1)/2*e.height;0===n?t.moveTo(o,i):t.lineTo(o,i)}t.stroke(),document.body.appendChild(e)}return xt(c.toString(16))})(e)),O=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,A=await Lt(()=>window.screen.orientation?.type||null),I=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,C=I&&I.type||null,P=I?.effectiveType||null,N=!0===I?.saveData,D="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,_="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,L=await Lt(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),x=await Lt(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return qt(t)}),q={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:s||null,fonts:n,numberingSystem:o,languages:i,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:f,prefersContrast:p,prefersReducedTransparency:y,pdfViewerEnabled:D,webdriver:_,intlSupportedCalendars:L||null,permissionsState:x||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:m,devicePixelRatio:g,pixelDepth:w,colorDepth:b,touchSupport:v,screenOrientation:A||null,connectionType:C,effectiveType:P,saveData:N,canvasID:E,webglID:R,webgpuID:S,audioID:T},U={aspectRatio:O,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!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(q,U);const F=xt(qt(q)),M=Math.round(performance.now()-t);return{fingerprint:F,...q,elapsedMs:M}};"undefined"!=typeof window&&(window.getBrowserFingerprint=Ut);var Ft=async(e,t)=>{if(e instanceof ye){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)},Mt=e(void 0),kt=({props:e={},children:n})=>{const{organizationId:c,uid:l,fname:u,lname:h,theme:d="light"}=e,[f,p]=r(null),[y,m]=r(()=>{if("undefined"==typeof window)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:g,data:w,error:b}=pe({queryKey:[bt.QRATI_CONNECT_SESSION,c,l??null,u??null,h??null],queryFn:async()=>{const e=await(async()=>{const e=await Ut();return"string"==typeof e?e:e?.fingerprint})();try{return(await ze.post(Je.INITIALIZE_SESSION,{json:{uid:l,fname:u,lname:h,browserFingerprint:e},headers:{"x-org-id":c,...!y?.token||l||u||h?{}:{Authorization:`Bearer ${y.token}`}}}).json()).data}catch(t){if(t instanceof ye)try{const e=await t.response.json();t.apiMessage=e?.message||e?.error}catch{}throw t}},enabled:!!c});t(()=>{const e=w?.authSession?.session?.token??w?.authSession?.token,t=w?.authSession?.user;t&&e?(m(r=>({...r,...t,token:e,tcAccepted:void 0===t.tcAccepted?r?.tcAccepted:t.tcAccepted})),localStorage.setItem("qrati_token",e)):w?.organization?.customAuth&&l&&u&&m(e=>e??{_id:l,uid:l,name:h?`${u} ${h}`:u,fname:u,lname:h})},[w]);const v=s(()=>{const e=w?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=Ot("https://qrati.com"),s=t?Tt(t):"";return r&&s?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(s)}`:null})(0,e),r=((e,t)=>{const r=Ot("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const s=Tt(e.fontFamily);if("custom"===s&&t){const r=e.customFontName||"QratiCustomFont",s=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${n=r,n.replace(/"/g,'\\"')}";src:url("${t}") format("${s}");font-weight:400 700;font-style:normal;font-display:swap;}`}var n;const o=r||(e=>{if(!e)return null;const t=Tt(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(s);return o?`@import url("${o}");`:""})(w?.organization?.integrationSettings,w?.organization?.customFontUrl?r||w.organization.customFontUrl:void 0,t||void 0)},[w?.organization?.integrationSettings,w?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),v){if(v.startsWith("@import")){const t=v.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=v,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[v,c]);const E=a(async e=>{m(t=>({...t,...e}))},[]),R=a(async(e,t,r,s)=>{try{const n=await ze.post(Je.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":c}}).json();return n.error?{error:n.error}:(m({...n.user,token:n.token}),n.token&&localStorage.setItem("qrati_token",n.token),n)}catch(b){return{error:await Ft(b,"Registration failed")}}},[c]),S=a(async(e,t)=>{try{const r=await ze.post(Je.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:(m({...r.user,token:r.token}),r.token&&localStorage.setItem("qrati_token",r.token),r)}catch(b){return{error:await Ft(b,"Invalid email or password")}}},[c]),T=a(async e=>{const t=await((e,t,r)=>new Promise((s,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 o=new URL(`${r}/qc-social-auth`);o.searchParams.set("provider",e),o.searchParams.set("organizationId",t),o.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(o.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{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:o,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(o){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),s({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,c??"","https://qrati.com");return t?.user&&t?.token&&(m({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t},[c]),O=a(async()=>T("google"),[T]),A=a(async()=>T("apple"),[T]),I=a(async e=>{try{const t=await ze.post(Je.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(b){return{error:await Ft(b,"Failed to send password reset code")}}},[c]),C=a(async(e,t)=>{try{const r=await ze.post(Je.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(b){return{error:await Ft(b,"Invalid code, please check your email")}}},[c]),P=a(async(e,t)=>{try{const r=await ze.post(Je.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(b){return{error:b?.message}}},[c]),N=a(async()=>{try{const e=await ze.post(Je.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${y?.token}`}}).json();return e.error?{error:e.error}:(m(null),localStorage.removeItem("qrati_token"),e)}catch(b){return{error:b?.message}}},[c,y?.token]),D=s(()=>({props:e,initializing:g,sessionId:w?.sessionId,organization:w?.organization,folders:w?.folders,orgRole:w?.orgRole??null,loadingUser:g,user:y,updateUser:E,registerUsingEmail:R,loginWithGoogle:O,loginWithApple:A,loginUsingEmail:S,sendPasswordResetCode:I,verifyPasswordResetCode:C,resetPassword:P,signout:N,error:b,portalContainer:f}),[e,g,w,y,E,R,O,A,S,I,C,P,N,b,f]);if(b){const e=b,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
40
40
  return i(o,{fallback:null,children:/* @__PURE__ */i(Rt,{organizationId:c??"",errorType:t,errorMessage:"generic-error"===t?e.apiMessage:void 0})})}/* @__PURE__ */
41
- return i(Mt.Provider,{value:D,children:/* @__PURE__ */i("div",{ref:p,id:"qrati-connect-container",style:{..._t(w?.organization,d),fontFamily:w?.organization?.integrationSettings?.fontFamily&&"system"!==w.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:Pt("bg-background text-foreground relative min-h-[80vh]"),children:n})})},kt=()=>{const e=c(Mt);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{w as $,it as A,K as B,et as C,Be as D,nt as E,fe as F,k as G,z as H,le as I,R as J,y as K,ce as L,pt as M,ze as N,bt as O,pe as P,T as Q,re as R,tt as S,st as T,H as U,J as V,j as W,v as X,E as Y,p as Z,yt as _,_t as a,Ze as b,wt as c,lt as d,I as et,ut as f,dt as g,ct as h,Pt as i,l as it,ft as j,mt as k,gt as l,Xe as m,kt as n,x as nt,Ct as o,rt as p,S as q,Ut as r,u as rt,Ye as s,$t as t,U as tt,Je as u,at as v,ht as w,We as x,ot as y,Y as z};
41
+ return i(Mt.Provider,{value:D,children:/* @__PURE__ */i("div",{ref:p,id:"qrati-connect-container",style:{..._t(w?.organization,d),fontFamily:w?.organization?.integrationSettings?.fontFamily&&"system"!==w.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:Pt("bg-background text-foreground relative min-h-[80vh]"),children:n})})},$t=()=>{const e=c(Mt);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{w as $,it as A,K as B,et as C,Be as D,nt as E,fe as F,$ as G,z as H,le as I,R as J,y as K,ce as L,pt as M,ze as N,bt as O,pe as P,T as Q,re as R,tt as S,st as T,H as U,J as V,j as W,v as X,E as Y,p as Z,yt as _,_t as a,Ze as b,wt as c,lt as d,I as et,ut as f,dt as g,ct as h,Pt as i,l as it,ft as j,mt as k,gt as l,Xe as m,$t as n,x as nt,Ct as o,rt as p,S as q,Ut as r,u as rt,Ye as s,kt as t,U as tt,Je as u,at as v,ht as w,We as x,ot as y,Y as z};
@@ -1,4 +1,4 @@
1
- import{t as a}from"./qbHuxVSe.js";import{D as t,n as s}from"./TV5seYRS.js";import{i as e,n as r,u as o}from"./Crix9_9X.js";import{t as i}from"./CuRZaTn5.js";import{t as n}from"./YJHG0sOk.js";import{t as l}from"./DWbLshVZ.js";import{n as m,t as c}from"./DcL9Mr2r.js";import{t as g}from"./BCyTQnZ1.js";import{t as d}from"./DmSY4t_i.js";import{t as p}from"./CwE8D5S0.js";var v=()=>{const v=o(),{organization:f,props:h}=s(),u=h?.organizationId,{loading:N,event:j}=d({eventSlug:v.eventSlug});if(N)/* @__PURE__ */return a("div",{children:[
1
+ import{t as a}from"./C3uDEVBt.js";import{D as t,n as s}from"./BItJQVdK.js";import{i as e,n as r,u as o}from"./b6CwQBFC.js";import{t as i}from"./ekog7y-V.js";import{t as n}from"./CCLXmMXp.js";import{t as l}from"./DvTRhlvs.js";import{n as m,t as c}from"./C9ak4yUT.js";import{t as g}from"./D9NypPiv.js";import{t as d}from"./qWp4ucdT.js";import{t as p}from"./BglDIiFp.js";var v=()=>{const v=o(),{organization:f,props:h}=s(),u=h?.organizationId,{loading:N,event:j}=d({eventSlug:v.eventSlug});if(N)/* @__PURE__ */return a("div",{children:[
2
2
  /* @__PURE__ */a(i,{className:"mx-auto mt-4 h-8 w-64"}),
3
3
  /* @__PURE__ */a(i,{className:"mx-auto mt-6 h-6 w-72"}),
4
4
  /* @__PURE__ */a(i,{className:"mx-auto mt-6 h-8 w-72"}),
@@ -1,2 +1,2 @@
1
- import{D as e,T as a,b as t,h as s,p as o,t as n,v as d,y as l}from"./qbHuxVSe.js";import{a as r,i as m,n as c}from"./TV5seYRS.js";var i=e(null),p=({open:e,onOpenChange:a,children:l})=>{const[r,m]=s(!!e);t(()=>{"boolean"==typeof e&&m(e)},[e]);const c=d(e=>{m(e),a?.(e)},[a]),p=o(()=>({open:r,setOpen:c}),[r,c]);/* @__PURE__ */
2
- return n(i.Provider,{value:p,children:l})},x=({children:e})=>/* @__PURE__ */n(a,{children:e}),u=({className:e,...a})=>/* @__PURE__ */n("div",{"data-state":l(i)?.open?"open":"closed",className:m("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-2001 bg-black/15 backdrop-blur-md",e),...a}),f=({className:e,children:a,...s})=>{const{organization:o}=c(),d=l(i);return t(()=>{if(!d?.open)return;const e=e=>{"Escape"===e.key&&d.setOpen(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.open]),d?.open?/* @__PURE__ */n(x,{children:[/* @__PURE__ */n(u,{onClick:()=>d.setOpen(!1)}),/* @__PURE__ */n("div",{role:"dialog","aria-modal":"true","data-state":d?.open?"open":"closed",className:m("border-border bg-background shadow-outer data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=closed]:slide-out-to-bottom fixed top-[50%] left-[50%] z-2002 h-fit w-auto max-w-5xl translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-t border duration-300 max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:border-x-0 max-sm:border-b-0 sm:rounded",e),style:r(o),...s,children:a})]}):null},b=({className:e,...a})=>/* @__PURE__ */n("div",{className:m("flex flex-col space-y-1 p-3 text-center sm:text-left",e),...a}),h=({className:e,...a})=>/* @__PURE__ */n("div",{className:m("flex justify-end space-x-3 p-4",e),...a}),v=({className:e,...a})=>/* @__PURE__ */n("h2",{className:m("text-center text-lg font-semibold",e),...a}),N=({className:e,...a})=>/* @__PURE__ */n("p",{className:m("text-muted-foreground text-center text-sm",e),...a});export{b as a,h as i,f as n,v as o,N as r,p as t};
1
+ import{E as e,b as a,h as t,p as s,t as o,v as n,w as d,y as l}from"./C3uDEVBt.js";import{a as r,i as m,n as c}from"./BItJQVdK.js";var i=e(null),p=({open:e,onOpenChange:d,children:l})=>{const[r,m]=t(!!e);a(()=>{"boolean"==typeof e&&m(e)},[e]);const c=n(e=>{m(e),d?.(e)},[d]),p=s(()=>({open:r,setOpen:c}),[r,c]);/* @__PURE__ */
2
+ return o(i.Provider,{value:p,children:l})},x=({children:e})=>/* @__PURE__ */o(d,{children:e}),u=({className:e,...a})=>/* @__PURE__ */o("div",{"data-state":l(i)?.open?"open":"closed",className:m("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-2001 bg-black/15 backdrop-blur-md",e),...a}),f=({className:e,children:t,...s})=>{const{organization:n}=c(),d=l(i);return a(()=>{if(!d?.open)return;const e=e=>{"Escape"===e.key&&d.setOpen(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.open]),d?.open?/* @__PURE__ */o(x,{children:[/* @__PURE__ */o(u,{onClick:()=>d.setOpen(!1)}),/* @__PURE__ */o("div",{role:"dialog","aria-modal":"true","data-state":d?.open?"open":"closed",className:m("border-border bg-background shadow-outer data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=closed]:slide-out-to-bottom fixed top-[50%] left-[50%] z-2002 h-fit w-auto max-w-5xl translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-t border duration-300 max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:border-x-0 max-sm:border-b-0 sm:rounded",e),style:r(n),...s,children:t})]}):null},b=({className:e,...a})=>/* @__PURE__ */o("div",{className:m("flex flex-col space-y-1 p-3 text-center sm:text-left",e),...a}),h=({className:e,...a})=>/* @__PURE__ */o("div",{className:m("flex justify-end space-x-3 p-4",e),...a}),v=({className:e,...a})=>/* @__PURE__ */o("h2",{className:m("text-center text-lg font-semibold",e),...a}),N=({className:e,...a})=>/* @__PURE__ */o("p",{className:m("text-muted-foreground text-center text-sm",e),...a});export{b as a,h as i,f as n,v as o,N as r,p as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./qbHuxVSe.js";import{i as r}from"./TV5seYRS.js";import{t}from"./BCyTQnZ1.js";import{n as o,o as i,r as s,t as n}from"./Hfo3iOYG2.js";function a({color:r="#ff4800",className:t="mx-auto size-9",...o}){/* @__PURE__ */
1
+ import{t as e}from"./C3uDEVBt.js";import{i as r}from"./BItJQVdK.js";import{t}from"./D9NypPiv.js";import{n as o,o as i,r as s,t as n}from"./BQuhYd4G2.js";function a({color:r="#ff4800",className:t="mx-auto size-9",...o}){/* @__PURE__ */
2
2
  return e("svg",{className:t,viewBox:"0 0 20 20",role:"img","aria-hidden":"true",style:{color:r},...o,children:[
3
3
  /* @__PURE__ */e("defs",{children:/* @__PURE__ */e("linearGradient",{id:"RadialGradient8932",children:[/* @__PURE__ */e("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"1"}),/* @__PURE__ */e("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.25"})]})}),
4
4
  /* @__PURE__ */e("style",{children:"@keyframes spin8932 { to { transform: rotate(360deg); } }\n .circle8932 { transform-origin: 50% 50%; stroke: url(#RadialGradient8932); fill: none; animation: spin8932 .5s infinite linear; }"}),
@@ -1 +1 @@
1
- import{$ as t,G as e,J as s,K as i,Q as r,W as u,X as n,Y as a,Z as o,it as h,nt as c,q as l,rt as f,z as y}from"./TV5seYRS.js";import{t as d}from"./DB68-h-C.js";var m=class extends h{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Set,this.#e=/* @__PURE__ */new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=p(t);if("string"==typeof e){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=p(t);if("string"==typeof e){const s=this.#e.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=p(t);if("string"==typeof e){const s=this.#e.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=p(t);return"string"==typeof e?(this.#e.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){e.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>a(e,t))}findAll(t={}){return this.getAll().filter(e=>a(t,e))}notify(t){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return e.batch(()=>Promise.all(t.map(t=>t.continue().catch(o))))}};function p(t){return t.options.scope?.id}var q=class extends h{constructor(t={}){super(),this.config=t,this.#i=/* @__PURE__ */new Map}#i;build(t,e,i){const r=e.queryKey,u=e.queryHash??s(r,e);let n=this.get(u);return n||(n=new y({client:t,queryKey:r,queryHash:u,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#i.has(t.queryHash)||(this.#i.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#i.get(t.queryHash);e&&(t.destroy(),e===t&&this.#i.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){e.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#i.get(t)}getAll(){return[...this.#i.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){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){e.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){e.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new q,this.#u=t.mutationCache||new m,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=f.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=u.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#r.build(this,s),r=i.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),u=this.#r.get(r.queryHash)?.state.data,n=i(e,u);if(void 0!==n)return this.#r.build(this,r).setData(n,{...s,manual:!0})}setQueriesData(t,s,i){return e.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const s=this.#r;e.batch(()=>{s.findAll(t).forEach(t=>{s.remove(t)})})}resetQueries(t,s){const i=this.#r;return e.batch(()=>(i.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},s)))}cancelQueries(t,s={}){const i={revert:!0,...s},r=e.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(o).catch(o)}invalidateQueries(t,s={}){return e.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},s)))}refetchQueries(t,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},r=e.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(o)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(o)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#r.build(this,s);return i.isStaleByTime(t(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(o).catch(o)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(o).catch(o)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return u.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(l(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#a.values()],s={};return e.forEach(e=>{r(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#o.set(l(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#o.values()],s={};return e.forEach(e=>{r(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=s(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===c&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
1
+ import{$ as t,G as e,J as s,K as i,Q as r,W as u,X as n,Y as a,Z as o,it as h,nt as c,q as l,rt as f,z as y}from"./BItJQVdK.js";import{t as d}from"./4VTPoA38.js";var m=class extends h{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Set,this.#e=/* @__PURE__ */new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=p(t);if("string"==typeof e){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=p(t);if("string"==typeof e){const s=this.#e.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=p(t);if("string"==typeof e){const s=this.#e.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=p(t);return"string"==typeof e?(this.#e.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){e.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>a(e,t))}findAll(t={}){return this.getAll().filter(e=>a(t,e))}notify(t){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return e.batch(()=>Promise.all(t.map(t=>t.continue().catch(o))))}};function p(t){return t.options.scope?.id}var q=class extends h{constructor(t={}){super(),this.config=t,this.#i=/* @__PURE__ */new Map}#i;build(t,e,i){const r=e.queryKey,u=e.queryHash??s(r,e);let n=this.get(u);return n||(n=new y({client:t,queryKey:r,queryHash:u,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#i.has(t.queryHash)||(this.#i.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#i.get(t.queryHash);e&&(t.destroy(),e===t&&this.#i.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){e.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#i.get(t)}getAll(){return[...this.#i.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){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){e.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){e.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new q,this.#u=t.mutationCache||new m,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=f.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=u.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#r.build(this,s),r=i.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),u=this.#r.get(r.queryHash)?.state.data,n=i(e,u);if(void 0!==n)return this.#r.build(this,r).setData(n,{...s,manual:!0})}setQueriesData(t,s,i){return e.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const s=this.#r;e.batch(()=>{s.findAll(t).forEach(t=>{s.remove(t)})})}resetQueries(t,s){const i=this.#r;return e.batch(()=>(i.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},s)))}cancelQueries(t,s={}){const i={revert:!0,...s},r=e.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(o).catch(o)}invalidateQueries(t,s={}){return e.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},s)))}refetchQueries(t,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},r=e.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(o)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(o)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#r.build(this,s);return i.isStaleByTime(t(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(o).catch(o)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(o).catch(o)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return u.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(l(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#a.values()],s={};return e.forEach(e=>{r(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#o.set(l(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#o.values()],s={};return e.forEach(e=>{r(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=s(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===c&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
@@ -1,3 +1,3 @@
1
- import{t}from"./qbHuxVSe.js";import{D as e}from"./TV5seYRS.js";import{l as s}from"./Crix9_9X.js";function a({className:e}){/* @__PURE__ */
1
+ import{t}from"./C3uDEVBt.js";import{D as e}from"./BItJQVdK.js";import{l as s}from"./b6CwQBFC.js";function a({className:e}){/* @__PURE__ */
2
2
  return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m7.825 13l4.9 4.9q.3.3.288.7t-.313.7q-.3.275-.7.288t-.7-.288l-6.6-6.6q-.15-.15-.213-.325T4.426 12t.063-.375t.212-.325l6.6-6.6q.275-.275.688-.275t.712.275q.3.3.3.713t-.3.712L7.825 11H19q.425 0 .713.288T20 12t-.288.713T19 13z"})})}var r=()=>{const r=s();/* @__PURE__ */
3
3
  return t("button",{type:"button",onClick:()=>{window.history.length>1?r(-1):r(e.PUBLIC_EVENTS,{state:{internalNavigation:!0}})},className:"text-primary absolute top-0 left-0",children:/* @__PURE__ */t(a,{className:"size-6"})})};export{r as t};
@@ -1,2 +1,2 @@
1
- import{t}from"./qbHuxVSe.js";function e({className:e}){/* @__PURE__ */
1
+ import{t}from"./C3uDEVBt.js";function e({className:e}){/* @__PURE__ */
2
2
  return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z"})})}export{e as t};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./Cko4QHwX.js";import{b as t,f as o,h as l,p as r,t as a,w as n}from"./qbHuxVSe.js";import{I as i,a as f,n as c,w as p}from"./TV5seYRS.js";import{t as s}from"./DGHG5MsV.js";import{a as d,i as u,n as m,o as g,r as b,t as h}from"./CkgIN-cn2.js";import{t as x}from"./CfMNBPpx2.js";var k=[[90,-180],[-90,180]],v=[20,0],y="#fb8500",w={topLeft:[276,60],bottomRight:[60,60]},z=new s,A=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),E=({onExplore:s,logoUrl:E})=>{const L=o(null),R=o(null),C=o(null),T=o(null),M=o(null),O=o(null),I=o(null),W=o(!1),S=o(!1),Z=r(()=>(()=>{try{const e=sessionStorage.getItem(p);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[j,q]=l(!0),[D,B]=l(!1),{folderTree:H,activeFolderId:N,activeFolder:P,visibleEvents:U,setActiveFolderId:F,isLoadingEvents:Y}=g(),{organization:J}=c();return t(()=>{if(!L.current||R.current)return;x("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),x("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./BCTYvPrD.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./CgUphJWo.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!L.current)return;const a=l.map(L.current,{center:Z?.center?[Z.center.lat??v[0],Z.center.lng??v[1]]:v,zoom:Z?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(k),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{try{sessionStorage.setItem(p,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",c),a.on("moveend",c),R.current=a,C.current=r,T.current=n,O.current=i,M.current=f,"undefined"!=typeof ResizeObserver&&L.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(L.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),B(!0),q(!1),t=()=>{s?.disconnect(),I.current&&clearTimeout(I.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),C.current=null,R.current=null,T.current=null,O.current=null,M.current=null}}finally{o||q(!1)}})(),()=>{o=!0,t?.()}},[Z]),t(()=>{if(!D)return;const e=C.current;if(!e)return;const t=R.current;if(T.current?.clearLayers(),M.current?.clearLayers(),null===N&&H.length>0){t&&O.current&&(O.current.setLatLngs?.([]),t.hasLayer(O.current)&&t.removeLayer(O.current));const o=t=>{for(const l of t)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${b(l.color,y)};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${A(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>F(l.folder._id)).addTo(T.current)}else l.children.length>0&&o(l.children)};o(H)}else{if(0===U.length)return;const o=0===H.length&&null===N,l=b(P?.color,y);if(t&&O.current&&(o&&!t.hasLayer(O.current)?O.current.addTo(t):o||(O.current.setLatLngs?.([]),t.hasLayer(O.current)&&t.removeLayer(O.current))),U.forEach(t=>{const o=t.location.x,r=t.location.y,f=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${l};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${u(E)?`<img src="${u(E)}" style="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=e.marker([r,o],{icon:f}),p=document.createElement("div");p.style.width="fit-content",((e,t,o)=>{n(/* @__PURE__ */a(i,{client:z,children:/* @__PURE__ */a(d,{event:e,onExplore:o})}),t)})(t,p,s),c.bindPopup(p,{closeButton:!0,maxWidth:256}),M.current?.addLayer(c)}),o&&O.current){const e=U.reduce((e,t)=>Math.max(e,t.views??0),1),t=U.map(e=>[e.location.y,e.location.x,e.views??1]);O.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),O.current.setLatLngs?.(t)}if(o&&!S.current&&t&&(S.current=!0,!Z)){const o=e.latLngBounds([]);U.forEach(e=>o.extend([e.location.y,e.location.x])),o.isValid()&&t.fitBounds(o,{paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,maxZoom:8})}}},[N,H,U,D,s,E,F,P,Z]),t(()=>{if(!D)return;const e=R.current,t=C.current;if(!e||!t)return;if(!W.current&&Z)return void(W.current=!0);W.current=!0;const o={paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,duration:3,easeLinearity:1};if(N){const l=m(H,N);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(H),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[N,H,D,Z]),/* @__PURE__ */a("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:f(J),children:[
2
- /* @__PURE__ */a(h,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:H,activeFolderId:N,setActiveFolderId:F}),Y&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */a("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),j&&/* @__PURE__ */a("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */a("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */a("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */a("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
3
- /* @__PURE__ */a("div",{ref:L,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{E as default};
1
+ import{n as e}from"./Cko4QHwX.js";import{C as t,b as o,f as l,h as r,p as a,t as n}from"./C3uDEVBt.js";import{I as i,a as f,n as c,w as p}from"./BItJQVdK.js";import{t as s}from"./Be1e_ATJ.js";import{a as d,i as u,n as m,o as g,r as b,t as h}from"./R0dHh5Az2.js";import{t as x}from"./CfMNBPpx2.js";var k=[[90,-180],[-90,180]],v=[20,0],y="#fb8500",w={topLeft:[276,60],bottomRight:[60,60]},z=new s,A=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),E=({onExplore:s,logoUrl:E})=>{const L=l(null),R=l(null),C=l(null),T=l(null),M=l(null),O=l(null),I=l(null),W=l(!1),S=l(!1),Z=a(()=>(()=>{try{const e=sessionStorage.getItem(p);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[j,q]=r(!0),[D,B]=r(!1),{folderTree:H,activeFolderId:N,activeFolder:P,visibleEvents:U,setActiveFolderId:F,isLoadingEvents:Y}=g(),{organization:J}=c();return o(()=>{if(!L.current||R.current)return;x("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),x("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./BCTYvPrD.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./CgUphJWo.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!L.current)return;const a=l.map(L.current,{center:Z?.center?[Z.center.lat??v[0],Z.center.lng??v[1]]:v,zoom:Z?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(k),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{try{sessionStorage.setItem(p,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",c),a.on("moveend",c),R.current=a,C.current=r,T.current=n,O.current=i,M.current=f,"undefined"!=typeof ResizeObserver&&L.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(L.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),B(!0),q(!1),t=()=>{s?.disconnect(),I.current&&clearTimeout(I.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),C.current=null,R.current=null,T.current=null,O.current=null,M.current=null}}finally{o||q(!1)}})(),()=>{o=!0,t?.()}},[Z]),o(()=>{if(!D)return;const e=C.current;if(!e)return;const o=R.current;if(T.current?.clearLayers(),M.current?.clearLayers(),null===N&&H.length>0){o&&O.current&&(O.current.setLatLngs?.([]),o.hasLayer(O.current)&&o.removeLayer(O.current));const t=o=>{for(const l of o)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${b(l.color,y)};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${A(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>F(l.folder._id)).addTo(T.current)}else l.children.length>0&&t(l.children)};t(H)}else{if(0===U.length)return;const l=0===H.length&&null===N,r=b(P?.color,y);if(o&&O.current&&(l&&!o.hasLayer(O.current)?O.current.addTo(o):l||(O.current.setLatLngs?.([]),o.hasLayer(O.current)&&o.removeLayer(O.current))),U.forEach(o=>{const l=o.location.x,a=o.location.y,f=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${r};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${u(E)?`<img src="${u(E)}" style="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=e.marker([a,l],{icon:f}),p=document.createElement("div");p.style.width="fit-content",((e,o,l)=>{t(/* @__PURE__ */n(i,{client:z,children:/* @__PURE__ */n(d,{event:e,onExplore:l})}),o)})(o,p,s),c.bindPopup(p,{closeButton:!0,maxWidth:256}),M.current?.addLayer(c)}),l&&O.current){const e=U.reduce((e,t)=>Math.max(e,t.views??0),1),t=U.map(e=>[e.location.y,e.location.x,e.views??1]);O.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),O.current.setLatLngs?.(t)}if(l&&!S.current&&o&&(S.current=!0,!Z)){const t=e.latLngBounds([]);U.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&o.fitBounds(t,{paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,maxZoom:8})}}},[N,H,U,D,s,E,F,P,Z]),o(()=>{if(!D)return;const e=R.current,t=C.current;if(!e||!t)return;if(!W.current&&Z)return void(W.current=!0);W.current=!0;const o={paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,duration:3,easeLinearity:1};if(N){const l=m(H,N);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(H),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[N,H,D,Z]),/* @__PURE__ */n("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:f(J),children:[
2
+ /* @__PURE__ */n(h,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:H,activeFolderId:N,setActiveFolderId:F}),Y&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),j&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */n("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */n("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
3
+ /* @__PURE__ */n("div",{ref:L,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{E as default};