@qratilabs/qrati-connect 2.23.8 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +84 -54
  2. package/element/2CMH9VMM.js +4 -0
  3. package/element/BKDqpSN62.js +3 -0
  4. package/element/{lrjV8c1G2.js → BM9ujORR2.js} +1 -1
  5. package/element/BOQzjiMV.js +9 -0
  6. package/element/{BYEF5Khs.js → BOqkzZ92.js} +1 -1
  7. package/{umd/BpVacqmD2.js → element/BP2rYgya2.js} +10 -10
  8. package/element/BZu3c37u.js +1 -0
  9. package/{umd/ls36Q8v0.js → element/Bb7nx5xF.js} +5 -5
  10. package/element/Bh8kXbe92.js +93 -0
  11. package/{umd/NwT4xmUR2.js → element/Bow6F3212.js} +29 -29
  12. package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
  13. package/element/{C8_zGNAf.js → C12iSy3L.js} +1 -1
  14. package/element/{D9NypPiv.js → C3dOFk9A.js} +1 -1
  15. package/element/C52SUIvC2.js +35 -0
  16. package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
  17. package/element/{Cb1JRT_1.js → CATr-3VW.js} +1 -1
  18. package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
  19. package/element/CHTzn6mh2.js +4 -0
  20. package/element/CL_evx_l.js +1 -0
  21. package/element/{e_wwJ5wx2.js → CLdpUOLk2.js} +4 -4
  22. package/element/{qWp4ucdT.js → CM46vluW.js} +1 -1
  23. package/{umd/BtN9y353.js → element/CVRTTCyF.js} +1 -1
  24. package/element/{9QY9BKOL2.js → CWhnvMey2.js} +8 -8
  25. package/{umd/B14kCOq8.js → element/CZ9iaxjO.js} +1 -1
  26. package/element/CaX2xgrP.js +41 -0
  27. package/element/{b6CwQBFC.js → ChJXhA9c.js} +5 -5
  28. package/element/{4VTPoA38.js → CqBk9L5O.js} +1 -1
  29. package/{umd/CiiNqDJq.js → element/CsfDBJh72.js} +1 -1
  30. package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
  31. package/element/D5TKEdBd2.js +3 -0
  32. package/element/{CCLXmMXp.js → DF0LxcV7.js} +1 -1
  33. package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
  34. package/element/{ekog7y-V.js → DGbyGc8b.js} +1 -1
  35. package/element/DN26AtHL2.js +4 -0
  36. package/element/{DsvRTvCp.js → DWBbTgnB.js} +1 -1
  37. package/element/{BQuhYd4G2.js → DZtaQWVG2.js} +1 -1
  38. package/element/{D0VKfxwE.js → DdOwRfWG.js} +2 -2
  39. package/element/DkG0zv7_2.js +9 -0
  40. package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
  41. package/element/{DXx41__x2.js → DlqJDAie2.js} +1 -1
  42. package/element/DnIueBGr2.js +1 -0
  43. package/element/{BglDIiFp.js → DnQ6XaLR.js} +2 -2
  44. package/element/DrrpB4Om.js +1 -0
  45. package/element/DtRwaUYF2.js +85 -0
  46. package/element/{CSO2IaJ1.js → LYboLIEU.js} +2 -2
  47. package/element/{DNG5BSHx2.js → N4HKgEC52.js} +1 -1
  48. package/element/Rcen6i0h.js +80 -0
  49. package/{umd/MpvHkxaz2.js → element/Z0-Tddye2.js} +1 -1
  50. package/element/dT6WSX65.js +1 -0
  51. package/element/h4ZjZXfe2.js +1 -0
  52. package/element/kiL9JENf2.js +3 -0
  53. package/element/{BdOzsWR32.js → lcKuIs2T2.js} +1 -1
  54. package/element/{CXg838Gr2.js → mIANlVHi2.js} +8 -8
  55. package/element/mQzpzQ_t.js +3 -0
  56. package/element/web.es.js +26 -108
  57. package/package.json +3 -15
  58. package/react/index.d.mts +182 -6
  59. package/react/index.d.ts +182 -6
  60. package/element/B14kCOq8.js +0 -2
  61. package/element/BItJQVdK.js +0 -41
  62. package/element/BYoa-kpQ2.js +0 -9
  63. package/element/Be1e_ATJ.js +0 -1
  64. package/element/BfkCwRAR2.js +0 -3
  65. package/element/BkvtmX4K.js +0 -2
  66. package/element/BpVacqmD2.js +0 -14
  67. package/element/BsT0vqml.js +0 -1
  68. package/element/BtN9y353.js +0 -1
  69. package/element/C030L_Hu2.js +0 -4
  70. package/element/C0MGOytI.js +0 -1
  71. package/element/C3tT7YRo2.js +0 -37
  72. package/element/C3uDEVBt.js +0 -1
  73. package/element/CiiNqDJq.js +0 -3
  74. package/element/CnoPTYOO.js +0 -1
  75. package/element/D4apO9G62.js +0 -4
  76. package/element/DB1jhaAe2.js +0 -85
  77. package/element/Do2aldFH.js +0 -9
  78. package/element/Drl8BMLL2.js +0 -93
  79. package/element/LJWh_4Di.js +0 -2
  80. package/element/MpvHkxaz2.js +0 -16
  81. package/element/NwT4xmUR2.js +0 -39
  82. package/element/gjXXuILV2.js +0 -3
  83. package/element/gk4TX_a62.js +0 -7
  84. package/element/ls36Q8v0.js +0 -9
  85. package/element/qNDy94Dr2.js +0 -3
  86. package/element/styles.css +0 -288
  87. package/umd/4VTPoA38.js +0 -1
  88. package/umd/9QY9BKOL2.js +0 -8
  89. package/umd/BCTYvPrD.js +0 -1
  90. package/umd/BItJQVdK.js +0 -41
  91. package/umd/BQuhYd4G2.js +0 -2
  92. package/umd/BYEF5Khs.js +0 -1
  93. package/umd/BYoa-kpQ2.js +0 -9
  94. package/umd/BdOzsWR32.js +0 -9
  95. package/umd/Be1e_ATJ.js +0 -1
  96. package/umd/BfkCwRAR2.js +0 -3
  97. package/umd/BglDIiFp.js +0 -3
  98. package/umd/BkIDQGIs.js +0 -1
  99. package/umd/Bki5T_lb.js +0 -1
  100. package/umd/BsT0vqml.js +0 -1
  101. package/umd/Byk0pccK.js +0 -1
  102. package/umd/C030L_Hu2.js +0 -4
  103. package/umd/C0MGOytI.js +0 -1
  104. package/umd/C3tT7YRo2.js +0 -37
  105. package/umd/C3uDEVBt.js +0 -1
  106. package/umd/C8_zGNAf.js +0 -1
  107. package/umd/CCLXmMXp.js +0 -3
  108. package/umd/CSO2IaJ1.js +0 -2
  109. package/umd/CXg838Gr2.js +0 -13
  110. package/umd/Cb1JRT_1.js +0 -1
  111. package/umd/CfMNBPpx2.js +0 -1
  112. package/umd/CgUphJWo.js +0 -1
  113. package/umd/Cko4QHwX.js +0 -1
  114. package/umd/CnoPTYOO.js +0 -1
  115. package/umd/D0VKfxwE.js +0 -10
  116. package/umd/D4apO9G62.js +0 -4
  117. package/umd/D9NypPiv.js +0 -7
  118. package/umd/DB1jhaAe2.js +0 -85
  119. package/umd/DIYUC8M3.js +0 -2
  120. package/umd/DNG5BSHx2.js +0 -2
  121. package/umd/DXx41__x2.js +0 -2
  122. package/umd/Do2aldFH.js +0 -9
  123. package/umd/Drl8BMLL2.js +0 -93
  124. package/umd/DsvRTvCp.js +0 -8
  125. package/umd/DvTRhlvs.js +0 -2
  126. package/umd/LJWh_4Di.js +0 -2
  127. package/umd/_ty2jtjs.js +0 -2
  128. package/umd/b6CwQBFC.js +0 -5
  129. package/umd/e_wwJ5wx2.js +0 -5
  130. package/umd/ekog7y-V.js +0 -1
  131. package/umd/gjXXuILV2.js +0 -3
  132. package/umd/index.d.ts +0 -14
  133. package/umd/lrjV8c1G2.js +0 -8
  134. package/umd/qNDy94Dr2.js +0 -3
  135. package/umd/qWp4ucdT.js +0 -1
  136. package/umd/rtH8O6Hc.js +0 -1
  137. package/umd/web.es.js +0 -125
  138. package/umd/web.umd.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qratilabs/qrati-connect",
3
- "version": "2.23.8",
3
+ "version": "2.24.0",
4
4
  "description": "Qrati Connect - Preact-based embeddable SDK with React wrapper",
5
5
  "author": "Qrati Labs",
6
6
  "license": "UNLICENSED",
@@ -45,27 +45,17 @@
45
45
  },
46
46
  "default": "./element/web.es.js"
47
47
  },
48
- "./umd": {
49
- "import": {
50
- "types": "./umd/index.d.ts",
51
- "default": "./umd/web.umd.js"
52
- },
53
- "default": "./umd/web.umd.js"
54
- },
55
48
  "./embed": {
56
49
  "import": {
57
50
  "types": "./embed/index.d.ts",
58
51
  "default": "./embed/embed.js"
59
52
  },
60
53
  "default": "./embed/embed.js"
61
- },
62
- "./styles.css": "./element/styles.css",
63
- "./element/styles.css": "./element/styles.css"
54
+ }
64
55
  },
65
56
  "files": [
66
57
  "react",
67
58
  "element",
68
- "umd",
69
59
  "embed",
70
60
  "README.md",
71
61
  "LICENSE"
@@ -84,9 +74,7 @@
84
74
  },
85
75
  "sideEffects": [
86
76
  "./element/web.es.js",
87
- "./umd/web.umd.js",
88
- "./embed/embed.js",
89
- "*.css"
77
+ "./embed/embed.js"
90
78
  ],
91
79
  "engines": {
92
80
  "node": ">=24.0.0"
package/react/index.d.mts CHANGED
@@ -1,6 +1,182 @@
1
- export * from './src/exports/react'
2
- export {}
3
- import QratiConnect from './src/exports/react'
4
- export default QratiConnect
5
- export * from './src/exports/react'
6
- export {}
1
+ import { VNode } from 'preact';
2
+
3
+ export declare interface I18nState {
4
+ locale: Locale;
5
+ translations: Translations;
6
+ isLoading: boolean;
7
+ error: string | null;
8
+ }
9
+
10
+ /**
11
+ * Lazily load and register the <qrati-connect> custom element.
12
+ * Safe to call repeatedly — the import is cached after the first call.
13
+ */
14
+ export declare function loadQratiElement(): Promise<unknown>;
15
+
16
+ export declare type Locale = string;
17
+
18
+ /** Error callback type */
19
+ export declare type OnErrorCallback = (error: Error) => void;
20
+
21
+ declare const QratiConnect: (props: QratiConnectProps & {
22
+ elementRef?: (el: HTMLElement | null) => void;
23
+ }) => VNode;
24
+ export { QratiConnect }
25
+ export default QratiConnect;
26
+
27
+ /**
28
+ * Props for QratiConnect component
29
+ */
30
+ export declare interface QratiConnectProps {
31
+ /** Router type - 'memory' (default) or 'hash' */
32
+ router?: RouterType;
33
+ /** Organization ID (required) */
34
+ organizationId: string;
35
+ /** User ID (optional) */
36
+ uid?: string;
37
+ /** First name (optional) */
38
+ fname?: string;
39
+ /** Last name (optional) */
40
+ lname?: string;
41
+ /** Theme - 'light' (default) or 'dark' */
42
+ theme?: ThemeType;
43
+ /** Error callback (optional) */
44
+ onError?: OnErrorCallback;
45
+ }
46
+
47
+ export declare interface QratiConnectRef {
48
+ element: HTMLElement | null;
49
+ }
50
+
51
+ /** Router type for navigation */
52
+ export declare type RouterType = 'memory' | 'hash';
53
+
54
+ /** Theme type */
55
+ export declare type ThemeType = 'light' | 'dark';
56
+
57
+ declare type TranslationKey = string;
58
+
59
+ export declare type Translations = Record<TranslationKey, string>;
60
+
61
+ export { }
62
+
63
+
64
+ declare global {
65
+ namespace JSX {
66
+ interface IntrinsicElements {
67
+ 'qrati-connect': {
68
+ router?: RouterType;
69
+ 'organization-id'?: string;
70
+ uid?: string;
71
+ fname?: string;
72
+ lname?: string;
73
+ theme?: ThemeType;
74
+ } & Record<string, unknown>;
75
+ }
76
+ }
77
+ }
78
+
79
+ /**
80
+ * GPT (Google Publisher Tag) loader for Google Ad Manager.
81
+ *
82
+ * GPT must be loaded in the host document <head> — NOT inside a Shadow DOM.
83
+ * Slots are then targeted via DOM element references, which works across Shadow DOM boundaries.
84
+ */
85
+ declare global {
86
+ interface Window {
87
+ googletag: {
88
+ cmd: Array<() => void>;
89
+ defineSlot: (adUnitPath: string, sizes: number[][], div: string | HTMLElement | null) => {
90
+ addService: (service: unknown) => {
91
+ getSlotElementId?: () => string;
92
+ setConfig: (config: unknown) => void;
93
+ getResponseInformation: () => unknown;
94
+ [k: string]: unknown;
95
+ };
96
+ [k: string]: unknown;
97
+ } | null;
98
+ pubads: () => {
99
+ enableSingleRequest: () => void;
100
+ addEventListener: (event: string, listener: (e: {
101
+ slot: unknown;
102
+ isEmpty?: boolean;
103
+ }) => void) => void;
104
+ refresh: (slots?: unknown[]) => void;
105
+ setTargeting: (key: string, value: string) => void;
106
+ getSlots?: () => Array<{
107
+ getSlotElementId?: () => string;
108
+ }>;
109
+ [k: string]: unknown;
110
+ };
111
+ setConfig: (config: unknown) => void;
112
+ enableServices: () => void;
113
+ display: (divOrSlot: string | HTMLElement | null) => void;
114
+ destroySlots: (slots: unknown[]) => boolean;
115
+ };
116
+ }
117
+ }
118
+
119
+ /// <reference types="leaflet" />
120
+
121
+ declare namespace L {
122
+ interface HeatLayerOptions {
123
+ minOpacity?: number;
124
+ maxZoom?: number;
125
+ radius?: number;
126
+ blur?: number;
127
+ max?: number;
128
+ gradient?: Record<number, string>;
129
+ }
130
+
131
+ function heatLayer(latlngs: Array<[number, number, number?]>, options?: HeatLayerOptions): L.Layer;
132
+
133
+ interface MarkerClusterGroupOptions extends L.LayerOptions {
134
+ showCoverageOnHover?: boolean;
135
+ zoomToBoundsOnClick?: boolean;
136
+ spiderfyOnMaxZoom?: boolean;
137
+ removeOutsideVisibleBounds?: boolean;
138
+ animate?: boolean;
139
+ animateAddingMarkers?: boolean;
140
+ disableClusteringAtZoom?: number | null;
141
+ maxClusterRadius?: number;
142
+ singleMarkerMode?: boolean;
143
+ spiderfyDistanceMultiplier?: number;
144
+ chunkedLoading?: boolean;
145
+ chunkDelay?: number;
146
+ chunkInterval?: number;
147
+ [key: string]: unknown;
148
+ }
149
+
150
+ interface MarkerClusterGroup extends L.FeatureGroup {
151
+ addLayers(layers: L.Layer[]): void;
152
+ removeLayers(layers: L.Layer[]): void;
153
+ clearLayers(): void;
154
+ getBounds(): L.LatLngBounds;
155
+ }
156
+
157
+ function markerClusterGroup(options?: MarkerClusterGroupOptions): MarkerClusterGroup;
158
+ }
159
+
160
+
161
+
162
+ declare module 'leaflet.heat' {}
163
+
164
+
165
+ declare module 'leaflet.markercluster' {}
166
+
167
+
168
+
169
+ declare global {
170
+ namespace JSX {
171
+ interface IntrinsicElements {
172
+ 'qrati-connect': {
173
+ router?: RouterType;
174
+ 'organization-id'?: string;
175
+ uid?: string;
176
+ fname?: string;
177
+ lname?: string;
178
+ theme?: ThemeType;
179
+ } & Record<string, unknown>;
180
+ }
181
+ }
182
+ }
package/react/index.d.ts CHANGED
@@ -1,6 +1,182 @@
1
- export * from './src/exports/react'
2
- export {}
3
- import QratiConnect from './src/exports/react'
4
- export default QratiConnect
5
- export * from './src/exports/react'
6
- export {}
1
+ import { VNode } from 'preact';
2
+
3
+ export declare interface I18nState {
4
+ locale: Locale;
5
+ translations: Translations;
6
+ isLoading: boolean;
7
+ error: string | null;
8
+ }
9
+
10
+ /**
11
+ * Lazily load and register the <qrati-connect> custom element.
12
+ * Safe to call repeatedly — the import is cached after the first call.
13
+ */
14
+ export declare function loadQratiElement(): Promise<unknown>;
15
+
16
+ export declare type Locale = string;
17
+
18
+ /** Error callback type */
19
+ export declare type OnErrorCallback = (error: Error) => void;
20
+
21
+ declare const QratiConnect: (props: QratiConnectProps & {
22
+ elementRef?: (el: HTMLElement | null) => void;
23
+ }) => VNode;
24
+ export { QratiConnect }
25
+ export default QratiConnect;
26
+
27
+ /**
28
+ * Props for QratiConnect component
29
+ */
30
+ export declare interface QratiConnectProps {
31
+ /** Router type - 'memory' (default) or 'hash' */
32
+ router?: RouterType;
33
+ /** Organization ID (required) */
34
+ organizationId: string;
35
+ /** User ID (optional) */
36
+ uid?: string;
37
+ /** First name (optional) */
38
+ fname?: string;
39
+ /** Last name (optional) */
40
+ lname?: string;
41
+ /** Theme - 'light' (default) or 'dark' */
42
+ theme?: ThemeType;
43
+ /** Error callback (optional) */
44
+ onError?: OnErrorCallback;
45
+ }
46
+
47
+ export declare interface QratiConnectRef {
48
+ element: HTMLElement | null;
49
+ }
50
+
51
+ /** Router type for navigation */
52
+ export declare type RouterType = 'memory' | 'hash';
53
+
54
+ /** Theme type */
55
+ export declare type ThemeType = 'light' | 'dark';
56
+
57
+ declare type TranslationKey = string;
58
+
59
+ export declare type Translations = Record<TranslationKey, string>;
60
+
61
+ export { }
62
+
63
+
64
+ declare global {
65
+ namespace JSX {
66
+ interface IntrinsicElements {
67
+ 'qrati-connect': {
68
+ router?: RouterType;
69
+ 'organization-id'?: string;
70
+ uid?: string;
71
+ fname?: string;
72
+ lname?: string;
73
+ theme?: ThemeType;
74
+ } & Record<string, unknown>;
75
+ }
76
+ }
77
+ }
78
+
79
+ /**
80
+ * GPT (Google Publisher Tag) loader for Google Ad Manager.
81
+ *
82
+ * GPT must be loaded in the host document <head> — NOT inside a Shadow DOM.
83
+ * Slots are then targeted via DOM element references, which works across Shadow DOM boundaries.
84
+ */
85
+ declare global {
86
+ interface Window {
87
+ googletag: {
88
+ cmd: Array<() => void>;
89
+ defineSlot: (adUnitPath: string, sizes: number[][], div: string | HTMLElement | null) => {
90
+ addService: (service: unknown) => {
91
+ getSlotElementId?: () => string;
92
+ setConfig: (config: unknown) => void;
93
+ getResponseInformation: () => unknown;
94
+ [k: string]: unknown;
95
+ };
96
+ [k: string]: unknown;
97
+ } | null;
98
+ pubads: () => {
99
+ enableSingleRequest: () => void;
100
+ addEventListener: (event: string, listener: (e: {
101
+ slot: unknown;
102
+ isEmpty?: boolean;
103
+ }) => void) => void;
104
+ refresh: (slots?: unknown[]) => void;
105
+ setTargeting: (key: string, value: string) => void;
106
+ getSlots?: () => Array<{
107
+ getSlotElementId?: () => string;
108
+ }>;
109
+ [k: string]: unknown;
110
+ };
111
+ setConfig: (config: unknown) => void;
112
+ enableServices: () => void;
113
+ display: (divOrSlot: string | HTMLElement | null) => void;
114
+ destroySlots: (slots: unknown[]) => boolean;
115
+ };
116
+ }
117
+ }
118
+
119
+ /// <reference types="leaflet" />
120
+
121
+ declare namespace L {
122
+ interface HeatLayerOptions {
123
+ minOpacity?: number;
124
+ maxZoom?: number;
125
+ radius?: number;
126
+ blur?: number;
127
+ max?: number;
128
+ gradient?: Record<number, string>;
129
+ }
130
+
131
+ function heatLayer(latlngs: Array<[number, number, number?]>, options?: HeatLayerOptions): L.Layer;
132
+
133
+ interface MarkerClusterGroupOptions extends L.LayerOptions {
134
+ showCoverageOnHover?: boolean;
135
+ zoomToBoundsOnClick?: boolean;
136
+ spiderfyOnMaxZoom?: boolean;
137
+ removeOutsideVisibleBounds?: boolean;
138
+ animate?: boolean;
139
+ animateAddingMarkers?: boolean;
140
+ disableClusteringAtZoom?: number | null;
141
+ maxClusterRadius?: number;
142
+ singleMarkerMode?: boolean;
143
+ spiderfyDistanceMultiplier?: number;
144
+ chunkedLoading?: boolean;
145
+ chunkDelay?: number;
146
+ chunkInterval?: number;
147
+ [key: string]: unknown;
148
+ }
149
+
150
+ interface MarkerClusterGroup extends L.FeatureGroup {
151
+ addLayers(layers: L.Layer[]): void;
152
+ removeLayers(layers: L.Layer[]): void;
153
+ clearLayers(): void;
154
+ getBounds(): L.LatLngBounds;
155
+ }
156
+
157
+ function markerClusterGroup(options?: MarkerClusterGroupOptions): MarkerClusterGroup;
158
+ }
159
+
160
+
161
+
162
+ declare module 'leaflet.heat' {}
163
+
164
+
165
+ declare module 'leaflet.markercluster' {}
166
+
167
+
168
+
169
+ declare global {
170
+ namespace JSX {
171
+ interface IntrinsicElements {
172
+ 'qrati-connect': {
173
+ router?: RouterType;
174
+ 'organization-id'?: string;
175
+ uid?: string;
176
+ fname?: string;
177
+ lname?: string;
178
+ theme?: ThemeType;
179
+ } & Record<string, unknown>;
180
+ }
181
+ }
182
+ }
@@ -1,2 +0,0 @@
1
- import{t as h}from"./C3uDEVBt.js";function e({className:e}){/* @__PURE__ */
2
- return h("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__ */h("path",{fill:"currentColor",d:"M4 19h4v-8H4zm6 0h4V5h-4zm6 0h4v-6h-4zM2 19v-8q0-.825.588-1.412T4 9h4V5q0-.825.588-1.412T10 3h4q.825 0 1.413.588T16 5v6h4q.825 0 1.413.588T22 13v6q0 .825-.587 1.413T20 21H4q-.825 0-1.412-.587T2 19"})})}export{e as t};
@@ -1,41 +0,0 @@
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
- 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
- /* @__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
- /* @__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"}),
5
- /* @__PURE__ */i("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
6
- /* @__PURE__ */i("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
7
- /* @__PURE__ */i("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
8
- /* @__PURE__ */i("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
9
- /* @__PURE__ */i("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
10
- /* @__PURE__ */i("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
11
- /* @__PURE__ */i("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
12
- /* @__PURE__ */i("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
13
- /* @__PURE__ */i("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
14
- /* @__PURE__ */i("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
15
- /* @__PURE__ */i("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
16
- /* @__PURE__ */i("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
17
- /* @__PURE__ */i("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
18
- /* @__PURE__ */i("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
19
- /* @__PURE__ */i("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
20
- /* @__PURE__ */i("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
21
- /* @__PURE__ */i("g",{transform:"translate(696.754 297.373)",children:[
22
- /* @__PURE__ */i("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
23
- /* @__PURE__ */i("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
24
- /* @__PURE__ */i("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
25
- /* @__PURE__ */i("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
26
- /* @__PURE__ */i("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
27
- /* @__PURE__ */i("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
28
- /* @__PURE__ */i("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
29
- /* @__PURE__ */i("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */i("div",{className:"space-y-4",children:[/* @__PURE__ */i("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */i("p",{className:"text-muted-foreground text-center",children:t})]})]})}var Et=({organizationId:e})=>/* @__PURE__ */i("a",{className:"font-medium text-blue-500",href:We.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Guide"});function Rt({organizationId:e,errorType:t,errorMessage:r}){/* @__PURE__ */
30
- return i(vt,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom auth is enabled. Pass ",
31
- /* @__PURE__ */i("code",{children:"uid"}),", ",
32
- /* @__PURE__ */i("code",{children:"fname"}),", and ",
33
- /* @__PURE__ */i("code",{children:"lname"})," as props to QratiConnect to complete setup. See our ",
34
- /* @__PURE__ */i(Et,{organizationId:e})," for details."]}:"service-unavailable"===t?{title:"We'll be right back!",children:["Our service is getting a quick tune-up. Hang tight — great things are coming your way soon! See our"," ",
35
- /* @__PURE__ */i(Et,{organizationId:e})," if you need help in the meantime."]}:"generic-error"===t&&r?{title:"Setup needed",children:[r," See our ",
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
- /* @__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
- /* @__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),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
- 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})})},$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};