@timardex/cluemart-server-shared 1.1.38 → 2.0.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.
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -27,6 +30,1467 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
30
  ));
28
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
32
 
33
+ // node_modules/react/cjs/react.production.js
34
+ var require_react_production = __commonJS({
35
+ "node_modules/react/cjs/react.production.js"(exports2) {
36
+ "use strict";
37
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
38
+ var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
39
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
40
+ var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
41
+ var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
42
+ var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
43
+ var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
44
+ var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
45
+ var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
46
+ var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
47
+ var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
48
+ var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
49
+ var REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition");
50
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
51
+ function getIteratorFn(maybeIterable) {
52
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
53
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
54
+ return "function" === typeof maybeIterable ? maybeIterable : null;
55
+ }
56
+ var ReactNoopUpdateQueue = {
57
+ isMounted: function() {
58
+ return false;
59
+ },
60
+ enqueueForceUpdate: function() {
61
+ },
62
+ enqueueReplaceState: function() {
63
+ },
64
+ enqueueSetState: function() {
65
+ }
66
+ };
67
+ var assign = Object.assign;
68
+ var emptyObject = {};
69
+ function Component(props, context, updater) {
70
+ this.props = props;
71
+ this.context = context;
72
+ this.refs = emptyObject;
73
+ this.updater = updater || ReactNoopUpdateQueue;
74
+ }
75
+ Component.prototype.isReactComponent = {};
76
+ Component.prototype.setState = function(partialState, callback) {
77
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
78
+ throw Error(
79
+ "takes an object of state variables to update or a function which returns an object of state variables."
80
+ );
81
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
82
+ };
83
+ Component.prototype.forceUpdate = function(callback) {
84
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
85
+ };
86
+ function ComponentDummy() {
87
+ }
88
+ ComponentDummy.prototype = Component.prototype;
89
+ function PureComponent(props, context, updater) {
90
+ this.props = props;
91
+ this.context = context;
92
+ this.refs = emptyObject;
93
+ this.updater = updater || ReactNoopUpdateQueue;
94
+ }
95
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
96
+ pureComponentPrototype.constructor = PureComponent;
97
+ assign(pureComponentPrototype, Component.prototype);
98
+ pureComponentPrototype.isPureReactComponent = true;
99
+ var isArrayImpl = Array.isArray;
100
+ function noop() {
101
+ }
102
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null };
103
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
104
+ function ReactElement(type, key, props) {
105
+ var refProp = props.ref;
106
+ return {
107
+ $$typeof: REACT_ELEMENT_TYPE,
108
+ type,
109
+ key,
110
+ ref: void 0 !== refProp ? refProp : null,
111
+ props
112
+ };
113
+ }
114
+ function cloneAndReplaceKey(oldElement, newKey) {
115
+ return ReactElement(oldElement.type, newKey, oldElement.props);
116
+ }
117
+ function isValidElement(object) {
118
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
119
+ }
120
+ function escape(key) {
121
+ var escaperLookup = { "=": "=0", ":": "=2" };
122
+ return "$" + key.replace(/[=:]/g, function(match) {
123
+ return escaperLookup[match];
124
+ });
125
+ }
126
+ var userProvidedKeyEscapeRegex = /\/+/g;
127
+ function getElementKey(element, index) {
128
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
129
+ }
130
+ function resolveThenable(thenable) {
131
+ switch (thenable.status) {
132
+ case "fulfilled":
133
+ return thenable.value;
134
+ case "rejected":
135
+ throw thenable.reason;
136
+ default:
137
+ switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
138
+ function(fulfilledValue) {
139
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
140
+ },
141
+ function(error) {
142
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
143
+ }
144
+ )), thenable.status) {
145
+ case "fulfilled":
146
+ return thenable.value;
147
+ case "rejected":
148
+ throw thenable.reason;
149
+ }
150
+ }
151
+ throw thenable;
152
+ }
153
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
154
+ var type = typeof children;
155
+ if ("undefined" === type || "boolean" === type) children = null;
156
+ var invokeCallback = false;
157
+ if (null === children) invokeCallback = true;
158
+ else
159
+ switch (type) {
160
+ case "bigint":
161
+ case "string":
162
+ case "number":
163
+ invokeCallback = true;
164
+ break;
165
+ case "object":
166
+ switch (children.$$typeof) {
167
+ case REACT_ELEMENT_TYPE:
168
+ case REACT_PORTAL_TYPE:
169
+ invokeCallback = true;
170
+ break;
171
+ case REACT_LAZY_TYPE:
172
+ return invokeCallback = children._init, mapIntoArray(
173
+ invokeCallback(children._payload),
174
+ array,
175
+ escapedPrefix,
176
+ nameSoFar,
177
+ callback
178
+ );
179
+ }
180
+ }
181
+ if (invokeCallback)
182
+ return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
183
+ return c;
184
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
185
+ callback,
186
+ escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
187
+ userProvidedKeyEscapeRegex,
188
+ "$&/"
189
+ ) + "/") + invokeCallback
190
+ )), array.push(callback)), 1;
191
+ invokeCallback = 0;
192
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
193
+ if (isArrayImpl(children))
194
+ for (var i = 0; i < children.length; i++)
195
+ nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
196
+ nameSoFar,
197
+ array,
198
+ escapedPrefix,
199
+ type,
200
+ callback
201
+ );
202
+ else if (i = getIteratorFn(children), "function" === typeof i)
203
+ for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
204
+ nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
205
+ nameSoFar,
206
+ array,
207
+ escapedPrefix,
208
+ type,
209
+ callback
210
+ );
211
+ else if ("object" === type) {
212
+ if ("function" === typeof children.then)
213
+ return mapIntoArray(
214
+ resolveThenable(children),
215
+ array,
216
+ escapedPrefix,
217
+ nameSoFar,
218
+ callback
219
+ );
220
+ array = String(children);
221
+ throw Error(
222
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
223
+ );
224
+ }
225
+ return invokeCallback;
226
+ }
227
+ function mapChildren(children, func, context) {
228
+ if (null == children) return children;
229
+ var result = [], count = 0;
230
+ mapIntoArray(children, result, "", "", function(child) {
231
+ return func.call(context, child, count++);
232
+ });
233
+ return result;
234
+ }
235
+ function lazyInitializer(payload) {
236
+ if (-1 === payload._status) {
237
+ var ctor = payload._result, thenable = ctor();
238
+ thenable.then(
239
+ function(moduleObject) {
240
+ if (0 === payload._status || -1 === payload._status)
241
+ payload._status = 1, payload._result = moduleObject, void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
242
+ },
243
+ function(error) {
244
+ if (0 === payload._status || -1 === payload._status)
245
+ payload._status = 2, payload._result = error, void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
246
+ }
247
+ );
248
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
249
+ }
250
+ if (1 === payload._status) return payload._result.default;
251
+ throw payload._result;
252
+ }
253
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
254
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
255
+ var event = new window.ErrorEvent("error", {
256
+ bubbles: true,
257
+ cancelable: true,
258
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
259
+ error
260
+ });
261
+ if (!window.dispatchEvent(event)) return;
262
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
263
+ process.emit("uncaughtException", error);
264
+ return;
265
+ }
266
+ console.error(error);
267
+ };
268
+ function startTransition(scope) {
269
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
270
+ currentTransition.types = null !== prevTransition ? prevTransition.types : null;
271
+ ReactSharedInternals.T = currentTransition;
272
+ try {
273
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
274
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
275
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
276
+ } catch (error) {
277
+ reportGlobalError(error);
278
+ } finally {
279
+ null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
280
+ }
281
+ }
282
+ function addTransitionType(type) {
283
+ var transition = ReactSharedInternals.T;
284
+ if (null !== transition) {
285
+ var transitionTypes = transition.types;
286
+ null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
287
+ } else startTransition(addTransitionType.bind(null, type));
288
+ }
289
+ var Children = {
290
+ map: mapChildren,
291
+ forEach: function(children, forEachFunc, forEachContext) {
292
+ mapChildren(
293
+ children,
294
+ function() {
295
+ forEachFunc.apply(this, arguments);
296
+ },
297
+ forEachContext
298
+ );
299
+ },
300
+ count: function(children) {
301
+ var n = 0;
302
+ mapChildren(children, function() {
303
+ n++;
304
+ });
305
+ return n;
306
+ },
307
+ toArray: function(children) {
308
+ return mapChildren(children, function(child) {
309
+ return child;
310
+ }) || [];
311
+ },
312
+ only: function(children) {
313
+ if (!isValidElement(children))
314
+ throw Error(
315
+ "React.Children.only expected to receive a single React element child."
316
+ );
317
+ return children;
318
+ }
319
+ };
320
+ exports2.Activity = REACT_ACTIVITY_TYPE;
321
+ exports2.Children = Children;
322
+ exports2.Component = Component;
323
+ exports2.Fragment = REACT_FRAGMENT_TYPE;
324
+ exports2.Profiler = REACT_PROFILER_TYPE;
325
+ exports2.PureComponent = PureComponent;
326
+ exports2.StrictMode = REACT_STRICT_MODE_TYPE;
327
+ exports2.Suspense = REACT_SUSPENSE_TYPE;
328
+ exports2.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
329
+ exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
330
+ exports2.__COMPILER_RUNTIME = {
331
+ __proto__: null,
332
+ c: function(size) {
333
+ return ReactSharedInternals.H.useMemoCache(size);
334
+ }
335
+ };
336
+ exports2.addTransitionType = addTransitionType;
337
+ exports2.cache = function(fn) {
338
+ return function() {
339
+ return fn.apply(null, arguments);
340
+ };
341
+ };
342
+ exports2.cacheSignal = function() {
343
+ return null;
344
+ };
345
+ exports2.cloneElement = function(element, config, children) {
346
+ if (null === element || void 0 === element)
347
+ throw Error(
348
+ "The argument must be a React element, but you passed " + element + "."
349
+ );
350
+ var props = assign({}, element.props), key = element.key;
351
+ if (null != config)
352
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
353
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
354
+ var propName = arguments.length - 2;
355
+ if (1 === propName) props.children = children;
356
+ else if (1 < propName) {
357
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
358
+ childArray[i] = arguments[i + 2];
359
+ props.children = childArray;
360
+ }
361
+ return ReactElement(element.type, key, props);
362
+ };
363
+ exports2.createContext = function(defaultValue) {
364
+ defaultValue = {
365
+ $$typeof: REACT_CONTEXT_TYPE,
366
+ _currentValue: defaultValue,
367
+ _currentValue2: defaultValue,
368
+ _threadCount: 0,
369
+ Provider: null,
370
+ Consumer: null
371
+ };
372
+ defaultValue.Provider = defaultValue;
373
+ defaultValue.Consumer = {
374
+ $$typeof: REACT_CONSUMER_TYPE,
375
+ _context: defaultValue
376
+ };
377
+ return defaultValue;
378
+ };
379
+ exports2.createElement = function(type, config, children) {
380
+ var propName, props = {}, key = null;
381
+ if (null != config)
382
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
383
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
384
+ var childrenLength = arguments.length - 2;
385
+ if (1 === childrenLength) props.children = children;
386
+ else if (1 < childrenLength) {
387
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
388
+ childArray[i] = arguments[i + 2];
389
+ props.children = childArray;
390
+ }
391
+ if (type && type.defaultProps)
392
+ for (propName in childrenLength = type.defaultProps, childrenLength)
393
+ void 0 === props[propName] && (props[propName] = childrenLength[propName]);
394
+ return ReactElement(type, key, props);
395
+ };
396
+ exports2.createRef = function() {
397
+ return { current: null };
398
+ };
399
+ exports2.forwardRef = function(render) {
400
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render };
401
+ };
402
+ exports2.isValidElement = isValidElement;
403
+ exports2.lazy = function(ctor) {
404
+ return {
405
+ $$typeof: REACT_LAZY_TYPE,
406
+ _payload: { _status: -1, _result: ctor },
407
+ _init: lazyInitializer
408
+ };
409
+ };
410
+ exports2.memo = function(type, compare) {
411
+ return {
412
+ $$typeof: REACT_MEMO_TYPE,
413
+ type,
414
+ compare: void 0 === compare ? null : compare
415
+ };
416
+ };
417
+ exports2.startTransition = startTransition;
418
+ exports2.unstable_useCacheRefresh = function() {
419
+ return ReactSharedInternals.H.useCacheRefresh();
420
+ };
421
+ exports2.use = function(usable) {
422
+ return ReactSharedInternals.H.use(usable);
423
+ };
424
+ exports2.useActionState = function(action, initialState, permalink) {
425
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
426
+ };
427
+ exports2.useCallback = function(callback, deps) {
428
+ return ReactSharedInternals.H.useCallback(callback, deps);
429
+ };
430
+ exports2.useContext = function(Context) {
431
+ return ReactSharedInternals.H.useContext(Context);
432
+ };
433
+ exports2.useDebugValue = function() {
434
+ };
435
+ exports2.useDeferredValue = function(value, initialValue) {
436
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
437
+ };
438
+ exports2.useEffect = function(create, deps) {
439
+ return ReactSharedInternals.H.useEffect(create, deps);
440
+ };
441
+ exports2.useEffectEvent = function(callback) {
442
+ return ReactSharedInternals.H.useEffectEvent(callback);
443
+ };
444
+ exports2.useId = function() {
445
+ return ReactSharedInternals.H.useId();
446
+ };
447
+ exports2.useImperativeHandle = function(ref, create, deps) {
448
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
449
+ };
450
+ exports2.useInsertionEffect = function(create, deps) {
451
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
452
+ };
453
+ exports2.useLayoutEffect = function(create, deps) {
454
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
455
+ };
456
+ exports2.useMemo = function(create, deps) {
457
+ return ReactSharedInternals.H.useMemo(create, deps);
458
+ };
459
+ exports2.useOptimistic = function(passthrough, reducer) {
460
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
461
+ };
462
+ exports2.useReducer = function(reducer, initialArg, init) {
463
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
464
+ };
465
+ exports2.useRef = function(initialValue) {
466
+ return ReactSharedInternals.H.useRef(initialValue);
467
+ };
468
+ exports2.useState = function(initialState) {
469
+ return ReactSharedInternals.H.useState(initialState);
470
+ };
471
+ exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
472
+ return ReactSharedInternals.H.useSyncExternalStore(
473
+ subscribe,
474
+ getSnapshot,
475
+ getServerSnapshot
476
+ );
477
+ };
478
+ exports2.useTransition = function() {
479
+ return ReactSharedInternals.H.useTransition();
480
+ };
481
+ exports2.version = "19.3.0";
482
+ }
483
+ });
484
+
485
+ // node_modules/react/cjs/react.development.js
486
+ var require_react_development = __commonJS({
487
+ "node_modules/react/cjs/react.development.js"(exports2, module2) {
488
+ "use strict";
489
+ "production" !== process.env.NODE_ENV && (function() {
490
+ function defineDeprecationWarning(methodName, info) {
491
+ Object.defineProperty(Component.prototype, methodName, {
492
+ get: function() {
493
+ console.warn(
494
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
495
+ info[0],
496
+ info[1]
497
+ );
498
+ }
499
+ });
500
+ }
501
+ function getIteratorFn(maybeIterable) {
502
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
503
+ return null;
504
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
505
+ return "function" === typeof maybeIterable ? maybeIterable : null;
506
+ }
507
+ function warnNoop(publicInstance, callerName) {
508
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
509
+ var warningKey = publicInstance + "." + callerName;
510
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
511
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
512
+ callerName,
513
+ publicInstance
514
+ ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
515
+ }
516
+ function Component(props, context, updater) {
517
+ this.props = props;
518
+ this.context = context;
519
+ this.refs = emptyObject;
520
+ this.updater = updater || ReactNoopUpdateQueue;
521
+ }
522
+ function ComponentDummy() {
523
+ }
524
+ function PureComponent(props, context, updater) {
525
+ this.props = props;
526
+ this.context = context;
527
+ this.refs = emptyObject;
528
+ this.updater = updater || ReactNoopUpdateQueue;
529
+ }
530
+ function noop() {
531
+ }
532
+ function testStringCoercion(value) {
533
+ return "" + value;
534
+ }
535
+ function checkKeyStringCoercion(value) {
536
+ try {
537
+ testStringCoercion(value);
538
+ var JSCompiler_inline_result = false;
539
+ } catch (e) {
540
+ JSCompiler_inline_result = true;
541
+ }
542
+ if (JSCompiler_inline_result) {
543
+ JSCompiler_inline_result = console;
544
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
545
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
546
+ JSCompiler_temp_const.call(
547
+ JSCompiler_inline_result,
548
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
549
+ JSCompiler_inline_result$jscomp$0
550
+ );
551
+ return testStringCoercion(value);
552
+ }
553
+ }
554
+ function getComponentNameFromType(type) {
555
+ if (null == type) return null;
556
+ if ("function" === typeof type)
557
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
558
+ if ("string" === typeof type) return type;
559
+ switch (type) {
560
+ case REACT_FRAGMENT_TYPE:
561
+ return "Fragment";
562
+ case REACT_PROFILER_TYPE:
563
+ return "Profiler";
564
+ case REACT_STRICT_MODE_TYPE:
565
+ return "StrictMode";
566
+ case REACT_SUSPENSE_TYPE:
567
+ return "Suspense";
568
+ case REACT_SUSPENSE_LIST_TYPE:
569
+ return "SuspenseList";
570
+ case REACT_ACTIVITY_TYPE:
571
+ return "Activity";
572
+ case REACT_VIEW_TRANSITION_TYPE:
573
+ return "ViewTransition";
574
+ }
575
+ if ("object" === typeof type)
576
+ switch ("number" === typeof type.tag && console.error(
577
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
578
+ ), type.$$typeof) {
579
+ case REACT_PORTAL_TYPE:
580
+ return "Portal";
581
+ case REACT_CONTEXT_TYPE:
582
+ return type.displayName || "Context";
583
+ case REACT_CONSUMER_TYPE:
584
+ return (type._context.displayName || "Context") + ".Consumer";
585
+ case REACT_FORWARD_REF_TYPE:
586
+ var innerType = type.render;
587
+ type = type.displayName;
588
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
589
+ return type;
590
+ case REACT_MEMO_TYPE:
591
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
592
+ case REACT_LAZY_TYPE:
593
+ innerType = type._payload;
594
+ type = type._init;
595
+ try {
596
+ return getComponentNameFromType(type(innerType));
597
+ } catch (x) {
598
+ }
599
+ }
600
+ return null;
601
+ }
602
+ function getTaskName(type) {
603
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
604
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
605
+ return "<...>";
606
+ try {
607
+ var name = getComponentNameFromType(type);
608
+ return name ? "<" + name + ">" : "<...>";
609
+ } catch (x) {
610
+ return "<...>";
611
+ }
612
+ }
613
+ function getOwner() {
614
+ var dispatcher = ReactSharedInternals.A;
615
+ return null === dispatcher ? null : dispatcher.getOwner();
616
+ }
617
+ function UnknownOwner() {
618
+ return Error("react-stack-top-frame");
619
+ }
620
+ function hasValidKey(config) {
621
+ if (hasOwnProperty.call(config, "key")) {
622
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
623
+ if (getter && getter.isReactWarning) return false;
624
+ }
625
+ return void 0 !== config.key;
626
+ }
627
+ function defineKeyPropWarningGetter(props, displayName) {
628
+ function warnAboutAccessingKey() {
629
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
630
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
631
+ displayName
632
+ ));
633
+ }
634
+ warnAboutAccessingKey.isReactWarning = true;
635
+ Object.defineProperty(props, "key", {
636
+ get: warnAboutAccessingKey,
637
+ configurable: true
638
+ });
639
+ }
640
+ function elementRefGetterWithDeprecationWarning() {
641
+ var componentName = getComponentNameFromType(this.type);
642
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
643
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
644
+ ));
645
+ componentName = this.props.ref;
646
+ return void 0 !== componentName ? componentName : null;
647
+ }
648
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
649
+ var refProp = props.ref;
650
+ type = {
651
+ $$typeof: REACT_ELEMENT_TYPE,
652
+ type,
653
+ key,
654
+ props,
655
+ _owner: owner
656
+ };
657
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
658
+ enumerable: false,
659
+ get: elementRefGetterWithDeprecationWarning
660
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
661
+ type._store = {};
662
+ Object.defineProperty(type._store, "validated", {
663
+ configurable: false,
664
+ enumerable: false,
665
+ writable: true,
666
+ value: 0
667
+ });
668
+ Object.defineProperty(type, "_debugInfo", {
669
+ configurable: false,
670
+ enumerable: false,
671
+ writable: true,
672
+ value: null
673
+ });
674
+ Object.defineProperty(type, "_debugStack", {
675
+ configurable: false,
676
+ enumerable: false,
677
+ writable: true,
678
+ value: debugStack
679
+ });
680
+ Object.defineProperty(type, "_debugTask", {
681
+ configurable: false,
682
+ enumerable: false,
683
+ writable: true,
684
+ value: debugTask
685
+ });
686
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
687
+ return type;
688
+ }
689
+ function cloneAndReplaceKey(oldElement, newKey) {
690
+ newKey = ReactElement(
691
+ oldElement.type,
692
+ newKey,
693
+ oldElement.props,
694
+ oldElement._owner,
695
+ oldElement._debugStack,
696
+ oldElement._debugTask
697
+ );
698
+ oldElement._store && (newKey._store.validated = oldElement._store.validated);
699
+ return newKey;
700
+ }
701
+ function validateChildKeys(node) {
702
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
703
+ }
704
+ function isValidElement(object) {
705
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
706
+ }
707
+ function escape(key) {
708
+ var escaperLookup = { "=": "=0", ":": "=2" };
709
+ return "$" + key.replace(/[=:]/g, function(match) {
710
+ return escaperLookup[match];
711
+ });
712
+ }
713
+ function getElementKey(element, index) {
714
+ return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
715
+ }
716
+ function resolveThenable(thenable) {
717
+ switch (thenable.status) {
718
+ case "fulfilled":
719
+ return thenable.value;
720
+ case "rejected":
721
+ throw thenable.reason;
722
+ default:
723
+ switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
724
+ function(fulfilledValue) {
725
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
726
+ },
727
+ function(error) {
728
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
729
+ }
730
+ )), thenable.status) {
731
+ case "fulfilled":
732
+ return thenable.value;
733
+ case "rejected":
734
+ throw thenable.reason;
735
+ }
736
+ }
737
+ throw thenable;
738
+ }
739
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
740
+ var type = typeof children;
741
+ if ("undefined" === type || "boolean" === type) children = null;
742
+ var invokeCallback = false;
743
+ if (null === children) invokeCallback = true;
744
+ else
745
+ switch (type) {
746
+ case "bigint":
747
+ case "string":
748
+ case "number":
749
+ invokeCallback = true;
750
+ break;
751
+ case "object":
752
+ switch (children.$$typeof) {
753
+ case REACT_ELEMENT_TYPE:
754
+ case REACT_PORTAL_TYPE:
755
+ invokeCallback = true;
756
+ break;
757
+ case REACT_LAZY_TYPE:
758
+ return invokeCallback = children._init, mapIntoArray(
759
+ invokeCallback(children._payload),
760
+ array,
761
+ escapedPrefix,
762
+ nameSoFar,
763
+ callback
764
+ );
765
+ }
766
+ }
767
+ if (invokeCallback) {
768
+ invokeCallback = children;
769
+ callback = callback(invokeCallback);
770
+ var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
771
+ isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
772
+ return c;
773
+ })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
774
+ callback,
775
+ escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
776
+ userProvidedKeyEscapeRegex,
777
+ "$&/"
778
+ ) + "/") + childKey
779
+ ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
780
+ return 1;
781
+ }
782
+ invokeCallback = 0;
783
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
784
+ if (isArrayImpl(children))
785
+ for (var i = 0; i < children.length; i++)
786
+ nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
787
+ nameSoFar,
788
+ array,
789
+ escapedPrefix,
790
+ type,
791
+ callback
792
+ );
793
+ else if (i = getIteratorFn(children), "function" === typeof i)
794
+ for (i === children.entries && (didWarnAboutMaps || console.warn(
795
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
796
+ ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
797
+ nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
798
+ nameSoFar,
799
+ array,
800
+ escapedPrefix,
801
+ type,
802
+ callback
803
+ );
804
+ else if ("object" === type) {
805
+ if ("function" === typeof children.then)
806
+ return mapIntoArray(
807
+ resolveThenable(children),
808
+ array,
809
+ escapedPrefix,
810
+ nameSoFar,
811
+ callback
812
+ );
813
+ array = String(children);
814
+ throw Error(
815
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
816
+ );
817
+ }
818
+ return invokeCallback;
819
+ }
820
+ function mapChildren(children, func, context) {
821
+ if (null == children) return children;
822
+ var result = [], count = 0;
823
+ mapIntoArray(children, result, "", "", function(child) {
824
+ return func.call(context, child, count++);
825
+ });
826
+ return result;
827
+ }
828
+ function lazyInitializer(payload) {
829
+ if (-1 === payload._status) {
830
+ var resolveDebugValue = null, rejectDebugValue = null, ioInfo = payload._ioInfo;
831
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now(), ioInfo.value = new Promise(function(resolve, reject) {
832
+ resolveDebugValue = resolve;
833
+ rejectDebugValue = reject;
834
+ }));
835
+ ioInfo = payload._result;
836
+ var thenable = ioInfo();
837
+ thenable.then(
838
+ function(moduleObject) {
839
+ if (0 === payload._status || -1 === payload._status) {
840
+ payload._status = 1;
841
+ payload._result = moduleObject;
842
+ var _ioInfo = payload._ioInfo;
843
+ if (null != _ioInfo) {
844
+ _ioInfo.end = performance.now();
845
+ var debugValue = null == moduleObject ? void 0 : moduleObject.default;
846
+ resolveDebugValue(debugValue);
847
+ _ioInfo.value.status = "fulfilled";
848
+ _ioInfo.value.value = debugValue;
849
+ }
850
+ void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
851
+ }
852
+ },
853
+ function(error) {
854
+ if (0 === payload._status || -1 === payload._status) {
855
+ payload._status = 2;
856
+ payload._result = error;
857
+ var _ioInfo2 = payload._ioInfo;
858
+ null != _ioInfo2 && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop, noop), rejectDebugValue(error), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error);
859
+ void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
860
+ }
861
+ }
862
+ );
863
+ ioInfo = payload._ioInfo;
864
+ if (null != ioInfo) {
865
+ var displayName = thenable.displayName;
866
+ "string" === typeof displayName && (ioInfo.name = displayName);
867
+ }
868
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
869
+ }
870
+ if (1 === payload._status)
871
+ return ioInfo = payload._result, void 0 === ioInfo && console.error(
872
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
873
+ ioInfo
874
+ ), "default" in ioInfo || console.error(
875
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
876
+ ioInfo
877
+ ), ioInfo.default;
878
+ throw payload._result;
879
+ }
880
+ function resolveDispatcher() {
881
+ var dispatcher = ReactSharedInternals.H;
882
+ null === dispatcher && console.error(
883
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
884
+ );
885
+ return dispatcher;
886
+ }
887
+ function releaseAsyncTransition() {
888
+ ReactSharedInternals.asyncTransitions--;
889
+ }
890
+ function startTransition(scope) {
891
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
892
+ currentTransition.types = null !== prevTransition ? prevTransition.types : null;
893
+ currentTransition._updatedFibers = /* @__PURE__ */ new Set();
894
+ ReactSharedInternals.T = currentTransition;
895
+ try {
896
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
897
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
898
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
899
+ } catch (error) {
900
+ reportGlobalError(error);
901
+ } finally {
902
+ null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
903
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
904
+ )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
905
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
906
+ ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
907
+ }
908
+ }
909
+ function addTransitionType(type) {
910
+ var transition = ReactSharedInternals.T;
911
+ if (null !== transition) {
912
+ var transitionTypes = transition.types;
913
+ null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
914
+ } else
915
+ 0 === ReactSharedInternals.asyncTransitions && console.error(
916
+ "addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
917
+ ), startTransition(addTransitionType.bind(null, type));
918
+ }
919
+ function enqueueTask(task) {
920
+ if (null === enqueueTaskImpl)
921
+ try {
922
+ var requireString = ("require" + Math.random()).slice(0, 7);
923
+ enqueueTaskImpl = (module2 && module2[requireString]).call(
924
+ module2,
925
+ "timers"
926
+ ).setImmediate;
927
+ } catch (_err) {
928
+ enqueueTaskImpl = function(callback) {
929
+ false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
930
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
931
+ ));
932
+ var channel = new MessageChannel();
933
+ channel.port1.onmessage = callback;
934
+ channel.port2.postMessage(void 0);
935
+ };
936
+ }
937
+ return enqueueTaskImpl(task);
938
+ }
939
+ function aggregateErrors(errors) {
940
+ return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
941
+ }
942
+ function popActScope(prevActQueue, prevActScopeDepth) {
943
+ prevActScopeDepth !== actScopeDepth - 1 && console.error(
944
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
945
+ );
946
+ actScopeDepth = prevActScopeDepth;
947
+ }
948
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
949
+ var queue = ReactSharedInternals.actQueue;
950
+ if (null !== queue)
951
+ if (0 !== queue.length)
952
+ try {
953
+ flushActQueue(queue);
954
+ enqueueTask(function() {
955
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
956
+ });
957
+ return;
958
+ } catch (error) {
959
+ ReactSharedInternals.thrownErrors.push(error);
960
+ }
961
+ else ReactSharedInternals.actQueue = null;
962
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
963
+ }
964
+ function flushActQueue(queue) {
965
+ if (!isFlushing) {
966
+ isFlushing = true;
967
+ var i = 0;
968
+ try {
969
+ for (; i < queue.length; i++) {
970
+ var callback = queue[i];
971
+ do {
972
+ ReactSharedInternals.didUsePromise = false;
973
+ var continuation = callback(false);
974
+ if (null !== continuation) {
975
+ if (ReactSharedInternals.didUsePromise) {
976
+ queue[i] = callback;
977
+ queue.splice(0, i);
978
+ return;
979
+ }
980
+ callback = continuation;
981
+ } else break;
982
+ } while (1);
983
+ }
984
+ queue.length = 0;
985
+ } catch (error) {
986
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
987
+ } finally {
988
+ isFlushing = false;
989
+ }
990
+ }
991
+ }
992
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
993
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
994
+ isMounted: function() {
995
+ return false;
996
+ },
997
+ enqueueForceUpdate: function(publicInstance) {
998
+ warnNoop(publicInstance, "forceUpdate");
999
+ },
1000
+ enqueueReplaceState: function(publicInstance) {
1001
+ warnNoop(publicInstance, "replaceState");
1002
+ },
1003
+ enqueueSetState: function(publicInstance) {
1004
+ warnNoop(publicInstance, "setState");
1005
+ }
1006
+ }, assign = Object.assign, emptyObject = {};
1007
+ Object.freeze(emptyObject);
1008
+ Component.prototype.isReactComponent = {};
1009
+ Component.prototype.setState = function(partialState, callback) {
1010
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
1011
+ throw Error(
1012
+ "takes an object of state variables to update or a function which returns an object of state variables."
1013
+ );
1014
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1015
+ };
1016
+ Component.prototype.forceUpdate = function(callback) {
1017
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1018
+ };
1019
+ var deprecatedAPIs = {
1020
+ isMounted: [
1021
+ "isMounted",
1022
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1023
+ ],
1024
+ replaceState: [
1025
+ "replaceState",
1026
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1027
+ ]
1028
+ };
1029
+ for (fnName in deprecatedAPIs)
1030
+ deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1031
+ ComponentDummy.prototype = Component.prototype;
1032
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1033
+ deprecatedAPIs.constructor = PureComponent;
1034
+ assign(deprecatedAPIs, Component.prototype);
1035
+ deprecatedAPIs.isPureReactComponent = true;
1036
+ var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
1037
+ H: null,
1038
+ A: null,
1039
+ T: null,
1040
+ S: null,
1041
+ actQueue: null,
1042
+ asyncTransitions: 0,
1043
+ isBatchingLegacy: false,
1044
+ didScheduleLegacyUpdate: false,
1045
+ didUsePromise: false,
1046
+ thrownErrors: [],
1047
+ getCurrentStack: null,
1048
+ recentlyCreatedOwnerStacks: 0
1049
+ }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
1050
+ return null;
1051
+ };
1052
+ deprecatedAPIs = {
1053
+ react_stack_bottom_frame: function(callStackForError) {
1054
+ return callStackForError();
1055
+ }
1056
+ };
1057
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1058
+ var didWarnAboutElementRef = {};
1059
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1060
+ deprecatedAPIs,
1061
+ UnknownOwner
1062
+ )();
1063
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1064
+ var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1065
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1066
+ var event = new window.ErrorEvent("error", {
1067
+ bubbles: true,
1068
+ cancelable: true,
1069
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1070
+ error
1071
+ });
1072
+ if (!window.dispatchEvent(event)) return;
1073
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
1074
+ process.emit("uncaughtException", error);
1075
+ return;
1076
+ }
1077
+ console.error(error);
1078
+ }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1079
+ queueMicrotask(function() {
1080
+ return queueMicrotask(callback);
1081
+ });
1082
+ } : enqueueTask;
1083
+ deprecatedAPIs = Object.freeze({
1084
+ __proto__: null,
1085
+ c: function(size) {
1086
+ return resolveDispatcher().useMemoCache(size);
1087
+ }
1088
+ });
1089
+ var fnName = {
1090
+ map: mapChildren,
1091
+ forEach: function(children, forEachFunc, forEachContext) {
1092
+ mapChildren(
1093
+ children,
1094
+ function() {
1095
+ forEachFunc.apply(this, arguments);
1096
+ },
1097
+ forEachContext
1098
+ );
1099
+ },
1100
+ count: function(children) {
1101
+ var n = 0;
1102
+ mapChildren(children, function() {
1103
+ n++;
1104
+ });
1105
+ return n;
1106
+ },
1107
+ toArray: function(children) {
1108
+ return mapChildren(children, function(child) {
1109
+ return child;
1110
+ }) || [];
1111
+ },
1112
+ only: function(children) {
1113
+ if (!isValidElement(children))
1114
+ throw Error(
1115
+ "React.Children.only expected to receive a single React element child."
1116
+ );
1117
+ return children;
1118
+ }
1119
+ };
1120
+ exports2.Activity = REACT_ACTIVITY_TYPE;
1121
+ exports2.Children = fnName;
1122
+ exports2.Component = Component;
1123
+ exports2.Fragment = REACT_FRAGMENT_TYPE;
1124
+ exports2.Profiler = REACT_PROFILER_TYPE;
1125
+ exports2.PureComponent = PureComponent;
1126
+ exports2.StrictMode = REACT_STRICT_MODE_TYPE;
1127
+ exports2.Suspense = REACT_SUSPENSE_TYPE;
1128
+ exports2.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1129
+ exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1130
+ exports2.__COMPILER_RUNTIME = deprecatedAPIs;
1131
+ exports2.act = function(callback) {
1132
+ var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1133
+ actScopeDepth++;
1134
+ var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1135
+ try {
1136
+ var result = callback();
1137
+ } catch (error) {
1138
+ ReactSharedInternals.thrownErrors.push(error);
1139
+ }
1140
+ if (0 < ReactSharedInternals.thrownErrors.length)
1141
+ throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1142
+ if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1143
+ var thenable = result;
1144
+ queueSeveralMicrotasks(function() {
1145
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1146
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1147
+ ));
1148
+ });
1149
+ return {
1150
+ then: function(resolve, reject) {
1151
+ didAwaitActCall = true;
1152
+ thenable.then(
1153
+ function(returnValue) {
1154
+ popActScope(prevActQueue, prevActScopeDepth);
1155
+ if (0 === prevActScopeDepth) {
1156
+ try {
1157
+ flushActQueue(queue), enqueueTask(function() {
1158
+ return recursivelyFlushAsyncActWork(
1159
+ returnValue,
1160
+ resolve,
1161
+ reject
1162
+ );
1163
+ });
1164
+ } catch (error$0) {
1165
+ ReactSharedInternals.thrownErrors.push(error$0);
1166
+ }
1167
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1168
+ var _thrownError = aggregateErrors(
1169
+ ReactSharedInternals.thrownErrors
1170
+ );
1171
+ ReactSharedInternals.thrownErrors.length = 0;
1172
+ reject(_thrownError);
1173
+ }
1174
+ } else resolve(returnValue);
1175
+ },
1176
+ function(error) {
1177
+ popActScope(prevActQueue, prevActScopeDepth);
1178
+ 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1179
+ ReactSharedInternals.thrownErrors
1180
+ ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1181
+ }
1182
+ );
1183
+ }
1184
+ };
1185
+ }
1186
+ var returnValue$jscomp$0 = result;
1187
+ popActScope(prevActQueue, prevActScopeDepth);
1188
+ 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1189
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1190
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1191
+ ));
1192
+ }), ReactSharedInternals.actQueue = null);
1193
+ if (0 < ReactSharedInternals.thrownErrors.length)
1194
+ throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1195
+ return {
1196
+ then: function(resolve, reject) {
1197
+ didAwaitActCall = true;
1198
+ 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1199
+ return recursivelyFlushAsyncActWork(
1200
+ returnValue$jscomp$0,
1201
+ resolve,
1202
+ reject
1203
+ );
1204
+ })) : resolve(returnValue$jscomp$0);
1205
+ }
1206
+ };
1207
+ };
1208
+ exports2.addTransitionType = addTransitionType;
1209
+ exports2.cache = function(fn) {
1210
+ return function() {
1211
+ return fn.apply(null, arguments);
1212
+ };
1213
+ };
1214
+ exports2.cacheSignal = function() {
1215
+ return null;
1216
+ };
1217
+ exports2.captureOwnerStack = function() {
1218
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1219
+ return null === getCurrentStack ? null : getCurrentStack();
1220
+ };
1221
+ exports2.cloneElement = function(element, config, children) {
1222
+ if (null === element || void 0 === element)
1223
+ throw Error(
1224
+ "The argument must be a React element, but you passed " + element + "."
1225
+ );
1226
+ var props = assign({}, element.props), key = element.key, owner = element._owner;
1227
+ if (null != config) {
1228
+ var JSCompiler_inline_result;
1229
+ a: {
1230
+ if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1231
+ config,
1232
+ "ref"
1233
+ ).get) && JSCompiler_inline_result.isReactWarning) {
1234
+ JSCompiler_inline_result = false;
1235
+ break a;
1236
+ }
1237
+ JSCompiler_inline_result = void 0 !== config.ref;
1238
+ }
1239
+ JSCompiler_inline_result && (owner = getOwner());
1240
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1241
+ for (propName in config)
1242
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1243
+ }
1244
+ var propName = arguments.length - 2;
1245
+ if (1 === propName) props.children = children;
1246
+ else if (1 < propName) {
1247
+ JSCompiler_inline_result = Array(propName);
1248
+ for (var i = 0; i < propName; i++)
1249
+ JSCompiler_inline_result[i] = arguments[i + 2];
1250
+ props.children = JSCompiler_inline_result;
1251
+ }
1252
+ props = ReactElement(
1253
+ element.type,
1254
+ key,
1255
+ props,
1256
+ owner,
1257
+ element._debugStack,
1258
+ element._debugTask
1259
+ );
1260
+ for (key = 2; key < arguments.length; key++)
1261
+ validateChildKeys(arguments[key]);
1262
+ return props;
1263
+ };
1264
+ exports2.createContext = function(defaultValue) {
1265
+ defaultValue = {
1266
+ $$typeof: REACT_CONTEXT_TYPE,
1267
+ _currentValue: defaultValue,
1268
+ _currentValue2: defaultValue,
1269
+ _threadCount: 0,
1270
+ Provider: null,
1271
+ Consumer: null
1272
+ };
1273
+ defaultValue.Provider = defaultValue;
1274
+ defaultValue.Consumer = {
1275
+ $$typeof: REACT_CONSUMER_TYPE,
1276
+ _context: defaultValue
1277
+ };
1278
+ defaultValue._currentRenderer = null;
1279
+ defaultValue._currentRenderer2 = null;
1280
+ return defaultValue;
1281
+ };
1282
+ exports2.createElement = function(type, config, children) {
1283
+ for (var i = 2; i < arguments.length; i++)
1284
+ validateChildKeys(arguments[i]);
1285
+ var propName;
1286
+ i = {};
1287
+ var key = null;
1288
+ if (null != config)
1289
+ for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1290
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1291
+ )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1292
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1293
+ var childrenLength = arguments.length - 2;
1294
+ if (1 === childrenLength) i.children = children;
1295
+ else if (1 < childrenLength) {
1296
+ for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1297
+ childArray[_i] = arguments[_i + 2];
1298
+ Object.freeze && Object.freeze(childArray);
1299
+ i.children = childArray;
1300
+ }
1301
+ if (type && type.defaultProps)
1302
+ for (propName in childrenLength = type.defaultProps, childrenLength)
1303
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1304
+ key && defineKeyPropWarningGetter(
1305
+ i,
1306
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1307
+ );
1308
+ (propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++) ? (childArray = Error.stackTraceLimit, Error.stackTraceLimit = 10, childrenLength = Error("react-stack-top-frame"), Error.stackTraceLimit = childArray) : childrenLength = unknownOwnerDebugStack;
1309
+ return ReactElement(
1310
+ type,
1311
+ key,
1312
+ i,
1313
+ getOwner(),
1314
+ childrenLength,
1315
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1316
+ );
1317
+ };
1318
+ exports2.createRef = function() {
1319
+ var refObject = { current: null };
1320
+ Object.seal(refObject);
1321
+ return refObject;
1322
+ };
1323
+ exports2.forwardRef = function(render) {
1324
+ null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1325
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1326
+ ) : "function" !== typeof render ? console.error(
1327
+ "forwardRef requires a render function but was given %s.",
1328
+ null === render ? "null" : typeof render
1329
+ ) : 0 !== render.length && 2 !== render.length && console.error(
1330
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1331
+ 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1332
+ );
1333
+ null != render && null != render.defaultProps && console.error(
1334
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1335
+ );
1336
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1337
+ Object.defineProperty(elementType, "displayName", {
1338
+ enumerable: false,
1339
+ configurable: true,
1340
+ get: function() {
1341
+ return ownName;
1342
+ },
1343
+ set: function(name) {
1344
+ ownName = name;
1345
+ render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1346
+ }
1347
+ });
1348
+ return elementType;
1349
+ };
1350
+ exports2.isValidElement = isValidElement;
1351
+ exports2.lazy = function(ctor) {
1352
+ ctor = { _status: -1, _result: ctor };
1353
+ var lazyType = {
1354
+ $$typeof: REACT_LAZY_TYPE,
1355
+ _payload: ctor,
1356
+ _init: lazyInitializer
1357
+ }, ioInfo = {
1358
+ name: "lazy",
1359
+ start: -1,
1360
+ end: -1,
1361
+ value: null,
1362
+ owner: null,
1363
+ debugStack: Error("react-stack-top-frame"),
1364
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1365
+ };
1366
+ ctor._ioInfo = ioInfo;
1367
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1368
+ return lazyType;
1369
+ };
1370
+ exports2.memo = function(type, compare) {
1371
+ null == type && console.error(
1372
+ "memo: The first argument must be a component. Instead received: %s",
1373
+ null === type ? "null" : typeof type
1374
+ );
1375
+ compare = {
1376
+ $$typeof: REACT_MEMO_TYPE,
1377
+ type,
1378
+ compare: void 0 === compare ? null : compare
1379
+ };
1380
+ var ownName;
1381
+ Object.defineProperty(compare, "displayName", {
1382
+ enumerable: false,
1383
+ configurable: true,
1384
+ get: function() {
1385
+ return ownName;
1386
+ },
1387
+ set: function(name) {
1388
+ ownName = name;
1389
+ type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1390
+ }
1391
+ });
1392
+ return compare;
1393
+ };
1394
+ exports2.startTransition = startTransition;
1395
+ exports2.unstable_useCacheRefresh = function() {
1396
+ return resolveDispatcher().useCacheRefresh();
1397
+ };
1398
+ exports2.use = function(usable) {
1399
+ return resolveDispatcher().use(usable);
1400
+ };
1401
+ exports2.useActionState = function(action, initialState, permalink) {
1402
+ return resolveDispatcher().useActionState(
1403
+ action,
1404
+ initialState,
1405
+ permalink
1406
+ );
1407
+ };
1408
+ exports2.useCallback = function(callback, deps) {
1409
+ return resolveDispatcher().useCallback(callback, deps);
1410
+ };
1411
+ exports2.useContext = function(Context) {
1412
+ var dispatcher = resolveDispatcher();
1413
+ Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1414
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1415
+ );
1416
+ return dispatcher.useContext(Context);
1417
+ };
1418
+ exports2.useDebugValue = function(value, formatterFn) {
1419
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1420
+ };
1421
+ exports2.useDeferredValue = function(value, initialValue) {
1422
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1423
+ };
1424
+ exports2.useEffect = function(create, deps) {
1425
+ null == create && console.warn(
1426
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1427
+ );
1428
+ return resolveDispatcher().useEffect(create, deps);
1429
+ };
1430
+ exports2.useEffectEvent = function(callback) {
1431
+ return resolveDispatcher().useEffectEvent(callback);
1432
+ };
1433
+ exports2.useId = function() {
1434
+ return resolveDispatcher().useId();
1435
+ };
1436
+ exports2.useImperativeHandle = function(ref, create, deps) {
1437
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1438
+ };
1439
+ exports2.useInsertionEffect = function(create, deps) {
1440
+ null == create && console.warn(
1441
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1442
+ );
1443
+ return resolveDispatcher().useInsertionEffect(create, deps);
1444
+ };
1445
+ exports2.useLayoutEffect = function(create, deps) {
1446
+ null == create && console.warn(
1447
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1448
+ );
1449
+ return resolveDispatcher().useLayoutEffect(create, deps);
1450
+ };
1451
+ exports2.useMemo = function(create, deps) {
1452
+ return resolveDispatcher().useMemo(create, deps);
1453
+ };
1454
+ exports2.useOptimistic = function(passthrough, reducer) {
1455
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1456
+ };
1457
+ exports2.useReducer = function(reducer, initialArg, init) {
1458
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1459
+ };
1460
+ exports2.useRef = function(initialValue) {
1461
+ return resolveDispatcher().useRef(initialValue);
1462
+ };
1463
+ exports2.useState = function(initialState) {
1464
+ return resolveDispatcher().useState(initialState);
1465
+ };
1466
+ exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1467
+ return resolveDispatcher().useSyncExternalStore(
1468
+ subscribe,
1469
+ getSnapshot,
1470
+ getServerSnapshot
1471
+ );
1472
+ };
1473
+ exports2.useTransition = function() {
1474
+ return resolveDispatcher().useTransition();
1475
+ };
1476
+ exports2.version = "19.3.0";
1477
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1478
+ })();
1479
+ }
1480
+ });
1481
+
1482
+ // node_modules/react/index.js
1483
+ var require_react = __commonJS({
1484
+ "node_modules/react/index.js"(exports2, module2) {
1485
+ "use strict";
1486
+ if (process.env.NODE_ENV === "production") {
1487
+ module2.exports = require_react_production();
1488
+ } else {
1489
+ module2.exports = require_react_development();
1490
+ }
1491
+ }
1492
+ });
1493
+
30
1494
  // src/mongoose/index.ts
31
1495
  var mongoose_exports = {};
32
1496
  __export(mongoose_exports, {
@@ -34,6 +1498,8 @@ __export(mongoose_exports, {
34
1498
  AdModel: () => AdModel,
35
1499
  AffiliateModel: () => AffiliateModel,
36
1500
  AppSettingModel: () => AppSettingModel,
1501
+ BILLING_CATALOG_COLLECTION_NAME: () => BILLING_CATALOG_COLLECTION_NAME,
1502
+ BillingCatalogModel: () => BillingCatalogModel,
37
1503
  CategorySchema: () => CategorySchema,
38
1504
  ChatModel: () => ChatModel,
39
1505
  ChatReportModel: () => ChatReportModel,
@@ -61,7 +1527,9 @@ __export(mongoose_exports, {
61
1527
  VendorModel: () => VendorModel,
62
1528
  VerificationTokenModel: () => VerificationTokenModel,
63
1529
  baseResourceFields: () => baseResourceFields,
1530
+ buildInitialBillingCatalogEntries: () => buildInitialBillingCatalogEntries,
64
1531
  dateTimeSchema: () => dateTimeSchema2,
1532
+ getBillingCatalogDefinition: () => getBillingCatalogDefinition,
65
1533
  locationGeoSchema: () => locationGeoSchema,
66
1534
  locationsSchema: () => locationsSchema,
67
1535
  refundPolicySchema: () => refundPolicySchema,
@@ -284,6 +1752,7 @@ setVerbosity(globalThis.__DEV__ !== false ? "log" : "silent");
284
1752
 
285
1753
  // node_modules/@timardex/cluemart-shared/dist/index.mjs
286
1754
  var import_graphql2 = require("graphql");
1755
+ var import_react = __toESM(require_react(), 1);
287
1756
  var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
288
1757
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
289
1758
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -366,8 +1835,8 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
366
1835
  return EnumRelationResource22;
367
1836
  })(EnumRelationResource || {});
368
1837
  var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
369
- EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
370
1838
  EnumNotificationResourceType22["AFFILIATE_REWARD_RECEIVED"] = "affiliate_reward_received";
1839
+ EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
371
1840
  EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
372
1841
  EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
373
1842
  EnumNotificationResourceType22["APPROVED_SCHOOL"] = "approved_school";
@@ -395,6 +1864,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
395
1864
  EnumNotificationResourceType22["NEW_POST_CREATED"] = "new_post_created";
396
1865
  EnumNotificationResourceType22["REGISTERED_USER_BY_SCHOOL_CODE"] = "registered_user_by_school_code";
397
1866
  EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
1867
+ EnumNotificationResourceType22["USER_COUPON_REDEEMED"] = "user_coupon_redeemed";
398
1868
  EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
399
1869
  EnumNotificationResourceType22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
400
1870
  return EnumNotificationResourceType22;
@@ -469,6 +1939,11 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
469
1939
  EnumSubscriptionStatus22["TRIALING"] = "trialing";
470
1940
  return EnumSubscriptionStatus22;
471
1941
  })(EnumSubscriptionStatus || {});
1942
+ var EnumBillingPeriod = /* @__PURE__ */ ((EnumBillingPeriod22) => {
1943
+ EnumBillingPeriod22["MONTHLY_CANCEL_ANYTIME"] = "monthly_cancel_anytime";
1944
+ EnumBillingPeriod22["YEARLY_ANNUAL_BILLED"] = "yearly_annual_billed";
1945
+ return EnumBillingPeriod22;
1946
+ })(EnumBillingPeriod || {});
472
1947
  var EnumReward = /* @__PURE__ */ ((EnumReward22) => {
473
1948
  EnumReward22["MYSTERY_JOY_BOX"] = "mystery_joy_box";
474
1949
  EnumReward22["MYSTERY_SQUEEZE_BOX"] = "mystery_squeeze_box";
@@ -1711,6 +3186,80 @@ var availableCategories = assignColorToCategories([
1711
3186
  ...petProductsAndAnimalGoods,
1712
3187
  ...serviceAndExperience
1713
3188
  ]);
3189
+ var BILLING_CATALOG_KEYS = [
3190
+ "pro_vendor_monthly",
3191
+ "pro_vendor_yearly",
3192
+ "pro_plus_vendor_monthly",
3193
+ "pro_plus_vendor_yearly"
3194
+ ];
3195
+ var BILLING_CATALOG_CURRENCY = "nzd";
3196
+ var BILLING_CATALOG_DEFINITIONS = {
3197
+ pro_plus_vendor_monthly: {
3198
+ billingPeriod: "monthly_cancel_anytime",
3199
+ licenceType: "pro_plus_vendor"
3200
+ /* PRO_PLUS_VENDOR */
3201
+ },
3202
+ pro_plus_vendor_yearly: {
3203
+ billingPeriod: "yearly_annual_billed",
3204
+ licenceType: "pro_plus_vendor"
3205
+ /* PRO_PLUS_VENDOR */
3206
+ },
3207
+ pro_vendor_monthly: {
3208
+ billingPeriod: "monthly_cancel_anytime",
3209
+ licenceType: "pro_vendor"
3210
+ /* PRO_VENDOR */
3211
+ },
3212
+ pro_vendor_yearly: {
3213
+ billingPeriod: "yearly_annual_billed",
3214
+ licenceType: "pro_vendor"
3215
+ /* PRO_VENDOR */
3216
+ }
3217
+ };
3218
+ var INITIAL_BILLING_CATALOG = [
3219
+ {
3220
+ active: true,
3221
+ billingPeriod: "monthly_cancel_anytime",
3222
+ currency: BILLING_CATALOG_CURRENCY,
3223
+ key: "pro_vendor_monthly",
3224
+ licenceType: "pro_vendor",
3225
+ taxInclusive: true,
3226
+ unitAmount: 3999
3227
+ },
3228
+ {
3229
+ active: true,
3230
+ billingPeriod: "yearly_annual_billed",
3231
+ currency: BILLING_CATALOG_CURRENCY,
3232
+ key: "pro_vendor_yearly",
3233
+ licenceType: "pro_vendor",
3234
+ taxInclusive: true,
3235
+ unitAmount: 40788
3236
+ },
3237
+ {
3238
+ active: true,
3239
+ billingPeriod: "monthly_cancel_anytime",
3240
+ currency: BILLING_CATALOG_CURRENCY,
3241
+ key: "pro_plus_vendor_monthly",
3242
+ licenceType: "pro_plus_vendor",
3243
+ taxInclusive: true,
3244
+ unitAmount: 6499
3245
+ },
3246
+ {
3247
+ active: true,
3248
+ billingPeriod: "yearly_annual_billed",
3249
+ currency: BILLING_CATALOG_CURRENCY,
3250
+ key: "pro_plus_vendor_yearly",
3251
+ licenceType: "pro_plus_vendor",
3252
+ taxInclusive: true,
3253
+ unitAmount: 62388
3254
+ }
3255
+ ];
3256
+ function billingCatalogDefinitionMatches(entry) {
3257
+ const definition = BILLING_CATALOG_DEFINITIONS[entry.key];
3258
+ if (!definition) {
3259
+ return false;
3260
+ }
3261
+ return definition.billingPeriod === entry.billingPeriod && definition.licenceType === entry.licenceType;
3262
+ }
1714
3263
  var packagingTypes = [
1715
3264
  "Biodegradable",
1716
3265
  "Compostable",
@@ -2155,12 +3704,19 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
2155
3704
  `;
2156
3705
  var STRIPE_FIELDS_FRAGMENT = gql`
2157
3706
  fragment StripeSubscriptionFields on StripeSubscriptionType {
3707
+ billingPeriod
3708
+ cancelAtPeriodEnd
2158
3709
  customerId
2159
3710
  subscriptionId
2160
3711
  status
2161
3712
  currentPlan
2162
3713
  startDate
2163
3714
  endDate
3715
+ pendingPlan
3716
+ pendingBillingPeriod
3717
+ pendingChangeEffectiveAt
3718
+ priceId
3719
+ scheduleId
2164
3720
  }
2165
3721
  `;
2166
3722
  var USER_FIELDS_FRAGMENT = gql`
@@ -2437,8 +3993,11 @@ var EVENT = gql`
2437
3993
  ${SOCIAL_SHARE_RESOURCE_FIELDS_FRAGMENT}
2438
3994
  `;
2439
3995
  var GET_EVENTS = gql`
2440
- query getEvents($dateStatus: EventDateStatusEnumType) {
2441
- events(dateStatus: $dateStatus) {
3996
+ query getEvents(
3997
+ $dateStatus: EventDateStatusEnumType
3998
+ $options: PaginationOptions
3999
+ ) {
4000
+ events(dateStatus: $dateStatus, options: $options) {
2442
4001
  ...EventListItemFields
2443
4002
  }
2444
4003
  }
@@ -2740,8 +4299,8 @@ var UNREGISTERED_VENDOR = gql`
2740
4299
  ${UNREGISTERED_VENDOR_INVITATION_FRAGMENT}
2741
4300
  `;
2742
4301
  var GET_VENDORS = gql`
2743
- query getVendors {
2744
- vendors {
4302
+ query getVendors($options: PaginationOptions) {
4303
+ vendors(options: $options) {
2745
4304
  ...VendorFields
2746
4305
  }
2747
4306
  }
@@ -2978,8 +4537,8 @@ var PARTNER = gql`
2978
4537
  ${SOCIAL_SHARE_RESOURCE_FIELDS_FRAGMENT}
2979
4538
  `;
2980
4539
  var GET_PARTNERS = gql`
2981
- query getPartners {
2982
- partners {
4540
+ query getPartners($options: PaginationOptions) {
4541
+ partners(options: $options) {
2983
4542
  ...PartnerFields
2984
4543
  }
2985
4544
  }
@@ -3184,8 +4743,8 @@ var POST_FIELDS_FRAGMENT = gql`
3184
4743
  ${SOCIAL_SHARE_RESOURCE_FIELDS_FRAGMENT}
3185
4744
  `;
3186
4745
  var GET_POSTS = gql`
3187
- query getPosts {
3188
- posts {
4746
+ query getPosts($options: PaginationOptions) {
4747
+ posts(options: $options) {
3189
4748
  ...PostFields
3190
4749
  }
3191
4750
  }
@@ -3200,13 +4759,114 @@ var GET_POST = gql`
3200
4759
  ${POST_FIELDS_FRAGMENT}
3201
4760
  `;
3202
4761
  var GET_POSTS_BY_TYPE = gql`
3203
- query getPostsByType($postType: PostTypeEnum!) {
3204
- postsByType(postType: $postType) {
4762
+ query getPostsByType($postType: PostTypeEnum!, $options: PaginationOptions) {
4763
+ postsByType(postType: $postType, options: $options) {
3205
4764
  ...PostFields
3206
4765
  }
3207
4766
  }
3208
4767
  ${POST_FIELDS_FRAGMENT}
3209
4768
  `;
4769
+ var GET_USERS = gql`
4770
+ query getUsers($options: PaginationOptions) {
4771
+ users(options: $options) {
4772
+ ...UserFields
4773
+ }
4774
+ }
4775
+ ${USER_FIELDS_FRAGMENT}
4776
+ `;
4777
+ var GET_USER = gql`
4778
+ query getUser($_id: ID!) {
4779
+ user(_id: $_id) {
4780
+ ...UserFields
4781
+ }
4782
+ }
4783
+ ${USER_FIELDS_FRAGMENT}
4784
+ `;
4785
+ var GET_USER_EVENTS = gql`
4786
+ query getUserEvents {
4787
+ userEvents {
4788
+ ...EventFields
4789
+ }
4790
+ }
4791
+ ${EVENT}
4792
+ `;
4793
+ var GET_USER_VENDORS = gql`
4794
+ query getUserVendors {
4795
+ userVendors {
4796
+ ...VendorFields
4797
+ }
4798
+ }
4799
+ ${VENDOR}
4800
+ `;
4801
+ var GET_USER_PARTNERS = gql`
4802
+ query getUserPartners {
4803
+ userPartners {
4804
+ ...PartnerFields
4805
+ }
4806
+ }
4807
+ ${PARTNER}
4808
+ `;
4809
+ var GET_USER_ACTIVITIES = gql`
4810
+ query getUserActivities {
4811
+ userActivities {
4812
+ favourites {
4813
+ events {
4814
+ ...EventListItemFields
4815
+ }
4816
+ partners {
4817
+ ...PartnerFields
4818
+ }
4819
+ vendors {
4820
+ ...VendorFields
4821
+ }
4822
+ }
4823
+ going {
4824
+ events {
4825
+ ...EventListItemFields
4826
+ }
4827
+ }
4828
+ interested {
4829
+ events {
4830
+ ...EventListItemFields
4831
+ }
4832
+ }
4833
+ present {
4834
+ events {
4835
+ ...EventListItemFields
4836
+ }
4837
+ }
4838
+ }
4839
+ }
4840
+ ${EVENT_LIST_ITEM}
4841
+ ${VENDOR}
4842
+ ${PARTNER}
4843
+ `;
4844
+ var GET_USER_RESOURCES = gql`
4845
+ query getUserResources($userId: ID!) {
4846
+ userResources(userId: $userId) {
4847
+ resources {
4848
+ _id
4849
+ logo
4850
+ name
4851
+ resourceType
4852
+ }
4853
+ }
4854
+ }
4855
+ `;
4856
+ var GET_USERS_BY_PROMO_CODE = gql`
4857
+ query getUsersByPromoCode($promoCode: String!, $limit: Int, $offset: Int) {
4858
+ usersByPromoCode(promoCode: $promoCode, limit: $limit, offset: $offset) {
4859
+ active
4860
+ avatar {
4861
+ ...ResourceImageFields
4862
+ }
4863
+ deletedAt
4864
+ nickName
4865
+ userId
4866
+ }
4867
+ }
4868
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
4869
+ `;
3210
4870
  var GET_EVENT_BY_SLUG = gql`
3211
4871
  query getEventBySlug($slug: String!) {
3212
4872
  eventBySlug(slug: $slug) {
@@ -3671,137 +5331,36 @@ var UPDATE_EVENT_INFO_MUTATION = gql`
3671
5331
  }
3672
5332
  ${EVENT_INFO}
3673
5333
  `;
3674
- var GET_USERS = gql`
3675
- query getUsers {
3676
- users {
3677
- ...UserFields
5334
+ var NOTIFICATION_FRAGMENT = gql`
5335
+ fragment NotificationFields on Notification {
5336
+ _id
5337
+ userId
5338
+ title
5339
+ message
5340
+ type
5341
+ isRead
5342
+ data {
5343
+ resourceId
5344
+ resourceName
5345
+ resourceType
3678
5346
  }
5347
+ createdAt
5348
+ updatedAt
3679
5349
  }
3680
- ${USER_FIELDS_FRAGMENT}
3681
5350
  `;
3682
- var GET_USER = gql`
3683
- query getUser($_id: ID!) {
3684
- user(_id: $_id) {
3685
- ...UserFields
5351
+ var GET_USER_NOTIFICATIONS = gql`
5352
+ query getUserNotifications($limit: Int, $offset: Int) {
5353
+ userNotifications(limit: $limit, offset: $offset) {
5354
+ ...NotificationFields
3686
5355
  }
3687
5356
  }
3688
- ${USER_FIELDS_FRAGMENT}
5357
+ ${NOTIFICATION_FRAGMENT}
3689
5358
  `;
3690
- var GET_USER_EVENTS = gql`
3691
- query getUserEvents {
3692
- userEvents {
3693
- ...EventFields
3694
- }
3695
- }
3696
- ${EVENT}
3697
- `;
3698
- var GET_USER_VENDORS = gql`
3699
- query getUserVendors {
3700
- userVendors {
3701
- ...VendorFields
3702
- }
3703
- }
3704
- ${VENDOR}
3705
- `;
3706
- var GET_USER_PARTNERS = gql`
3707
- query getUserPartners {
3708
- userPartners {
3709
- ...PartnerFields
3710
- }
3711
- }
3712
- ${PARTNER}
3713
- `;
3714
- var GET_USER_ACTIVITIES = gql`
3715
- query getUserActivities {
3716
- userActivities {
3717
- favourites {
3718
- events {
3719
- ...EventListItemFields
3720
- }
3721
- partners {
3722
- ...PartnerFields
3723
- }
3724
- vendors {
3725
- ...VendorFields
3726
- }
3727
- }
3728
- going {
3729
- events {
3730
- ...EventListItemFields
3731
- }
3732
- }
3733
- interested {
3734
- events {
3735
- ...EventListItemFields
3736
- }
3737
- }
3738
- present {
3739
- events {
3740
- ...EventListItemFields
3741
- }
3742
- }
3743
- }
3744
- }
3745
- ${EVENT_LIST_ITEM}
3746
- ${VENDOR}
3747
- ${PARTNER}
3748
- `;
3749
- var GET_USER_RESOURCES = gql`
3750
- query getUserResources($userId: ID!) {
3751
- userResources(userId: $userId) {
3752
- resources {
3753
- _id
3754
- logo
3755
- name
3756
- resourceType
3757
- }
3758
- }
3759
- }
3760
- `;
3761
- var GET_USERS_BY_PROMO_CODE = gql`
3762
- query getUsersByPromoCode($promoCode: String!, $limit: Int, $offset: Int) {
3763
- usersByPromoCode(promoCode: $promoCode, limit: $limit, offset: $offset) {
3764
- active
3765
- avatar {
3766
- ...ResourceImageFields
3767
- }
3768
- deletedAt
3769
- nickName
3770
- userId
3771
- }
3772
- }
3773
- ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
3774
- `;
3775
- var NOTIFICATION_FRAGMENT = gql`
3776
- fragment NotificationFields on Notification {
3777
- _id
3778
- userId
3779
- title
3780
- message
3781
- type
3782
- isRead
3783
- data {
3784
- resourceId
3785
- resourceName
3786
- resourceType
3787
- }
3788
- createdAt
3789
- updatedAt
3790
- }
3791
- `;
3792
- var GET_USER_NOTIFICATIONS = gql`
3793
- query getUserNotifications($limit: Int, $offset: Int) {
3794
- userNotifications(limit: $limit, offset: $offset) {
3795
- ...NotificationFields
3796
- }
3797
- }
3798
- ${NOTIFICATION_FRAGMENT}
3799
- `;
3800
- var GET_NOTIFICATION_COUNT = gql`
3801
- query getNotificationCount {
3802
- notificationCount {
3803
- total
3804
- unread
5359
+ var GET_NOTIFICATION_COUNT = gql`
5360
+ query getNotificationCount {
5361
+ notificationCount {
5362
+ total
5363
+ unread
3805
5364
  }
3806
5365
  }
3807
5366
  `;
@@ -4194,11 +5753,8 @@ var GET_RESOURCE_ACTIVITY = gql`
4194
5753
  ${RESOURCE_ACTIVITY_FIELDS_FRAGMENT}
4195
5754
  `;
4196
5755
  var CREATE_CHECKOUT_SESSION_MUTATION = gql`
4197
- mutation createCheckoutSession(
4198
- $planId: LicencesEnumType!
4199
- $billingPeriod: BillingPeriodEnumType
4200
- ) {
4201
- createCheckoutSession(planId: $planId, billingPeriod: $billingPeriod) {
5756
+ mutation createCheckoutSession($input: CreateCheckoutSessionInputType!) {
5757
+ createCheckoutSession(input: $input) {
4202
5758
  data {
4203
5759
  sessionId
4204
5760
  checkoutUrl
@@ -4210,25 +5766,38 @@ var CREATE_CHECKOUT_SESSION_MUTATION = gql`
4210
5766
  var CANCEL_SUBSCRIPTION_MUTATION = gql`
4211
5767
  mutation cancelSubscription {
4212
5768
  cancelSubscription {
4213
- data
5769
+ data {
5770
+ billingPeriod
5771
+ cancelAtPeriodEnd
5772
+ currentPlan
5773
+ endDate
5774
+ pendingBillingPeriod
5775
+ pendingChangeEffectiveAt
5776
+ pendingPlan
5777
+ priceId
5778
+ scheduleId
5779
+ status
5780
+ subscriptionId
5781
+ }
4214
5782
  message
4215
5783
  }
4216
5784
  }
4217
5785
  `;
4218
5786
  var UPDATE_SUBSCRIPTION_PLAN_MUTATION = gql`
4219
- mutation updateSubscriptionPlan(
4220
- $newPlanId: LicencesEnumType!
4221
- $billingPeriod: BillingPeriodEnumType
4222
- ) {
4223
- updateSubscriptionPlan(
4224
- newPlanId: $newPlanId
4225
- billingPeriod: $billingPeriod
4226
- ) {
5787
+ mutation updateSubscriptionPlan($input: UpdateSubscriptionPlanInputType!) {
5788
+ updateSubscriptionPlan(input: $input) {
4227
5789
  data {
4228
- subscriptionId
4229
- status
4230
- priceId
5790
+ billingPeriod
5791
+ cancelAtPeriodEnd
4231
5792
  currentPlan
5793
+ endDate
5794
+ pendingBillingPeriod
5795
+ pendingChangeEffectiveAt
5796
+ pendingPlan
5797
+ priceId
5798
+ scheduleId
5799
+ status
5800
+ subscriptionId
4232
5801
  }
4233
5802
  message
4234
5803
  }
@@ -4244,36 +5813,20 @@ var CREATE_CUSTOMER_PORTAL = gql`
4244
5813
  }
4245
5814
  }
4246
5815
  `;
4247
- var SELECT_PACKAGE_MUTATION = gql`
4248
- mutation selectPackage(
4249
- $billingPeriod: BillingPeriodEnumType
4250
- $selectedLicence: LicencesEnumType!
4251
- $useStripe: Boolean
4252
- ) {
4253
- selectPackage(
4254
- billingPeriod: $billingPeriod
4255
- selectedLicence: $selectedLicence
4256
- useStripe: $useStripe
4257
- ) {
4258
- data {
4259
- checkoutUrl
4260
- licences {
4261
- ...LicenceFields
4262
- }
4263
- userId
4264
- }
4265
- message
4266
- }
4267
- }
4268
- ${LICENCE_FIELDS_FRAGMENT}
4269
- `;
4270
5816
  var GET_SUBSCRIPTION_STATUS = gql`
4271
5817
  query getSubscriptionStatus {
4272
5818
  getSubscriptionStatus {
4273
- subscriptionId
4274
- status
4275
- priceId
5819
+ billingPeriod
5820
+ cancelAtPeriodEnd
4276
5821
  currentPlan
5822
+ endDate
5823
+ pendingBillingPeriod
5824
+ pendingChangeEffectiveAt
5825
+ pendingPlan
5826
+ priceId
5827
+ scheduleId
5828
+ status
5829
+ subscriptionId
4277
5830
  }
4278
5831
  }
4279
5832
  `;
@@ -4300,7 +5853,6 @@ var GET_SUBSCRIPTION_PLANS = gql`
4300
5853
  }
4301
5854
  }
4302
5855
  isNewUser
4303
- isTester
4304
5856
  appliedDiscountType
4305
5857
  }
4306
5858
  }
@@ -4408,6 +5960,57 @@ var GET_APP_SETTINGS = gql`
4408
5960
  }
4409
5961
  ${APP_SETTINGS_FIELDS_FRAGMENT}
4410
5962
  `;
5963
+ var BILLING_CATALOG_FIELDS_FRAGMENT = gql`
5964
+ fragment BillingCatalogFields on BillingCatalogEntryType {
5965
+ _id
5966
+ active
5967
+ billingPeriod
5968
+ createdAt
5969
+ currency
5970
+ effectiveFrom
5971
+ key
5972
+ licenceType
5973
+ revision
5974
+ stripePriceId
5975
+ stripeProductId
5976
+ taxInclusive
5977
+ unitAmount
5978
+ updatedAt
5979
+ updatedBy
5980
+ }
5981
+ `;
5982
+ var GET_BILLING_CATALOG = gql`
5983
+ query getBillingCatalog {
5984
+ billingCatalog {
5985
+ ...BillingCatalogFields
5986
+ }
5987
+ }
5988
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
5989
+ `;
5990
+ var UPDATE_BILLING_CATALOG_PRICE_MUTATION = gql`
5991
+ mutation updateBillingCatalogPrice(
5992
+ $input: UpdateBillingCatalogPriceInputType!
5993
+ ) {
5994
+ updateBillingCatalogPrice(input: $input) {
5995
+ data {
5996
+ ...BillingCatalogFields
5997
+ }
5998
+ message
5999
+ }
6000
+ }
6001
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
6002
+ `;
6003
+ var SYNC_BILLING_CATALOG_PRICE_MUTATION = gql`
6004
+ mutation syncBillingCatalogPrice($input: SyncBillingCatalogPriceInputType!) {
6005
+ syncBillingCatalogPrice(input: $input) {
6006
+ data {
6007
+ ...BillingCatalogFields
6008
+ }
6009
+ message
6010
+ }
6011
+ }
6012
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
6013
+ `;
4411
6014
  var GAME_HISTORY_FIELDS_FRAGMENT = gql`
4412
6015
  fragment GameHistoryFields on GameHistoryType {
4413
6016
  createdAt
@@ -5246,46 +6849,220 @@ schema.index({
5246
6849
  start: 1,
5247
6850
  status: 1
5248
6851
  });
6852
+ schema.index({
6853
+ status: 1,
6854
+ targetRegion: 1,
6855
+ // eslint-disable-next-line sort-keys
6856
+ start: -1
6857
+ });
5249
6858
  var AdModel = import_mongoose.default.models.Ad || import_mongoose.default.model("Ad", schema);
5250
6859
 
5251
- // src/mongoose/chat/Chat.ts
6860
+ // src/mongoose/BillingCatalog.ts
5252
6861
  var import_mongoose2 = __toESM(require("mongoose"));
5253
6862
  var MongooseSchema2 = import_mongoose2.default.Schema;
5254
- var MessageReplyPreviewSchema = new MongooseSchema2(
6863
+ var BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
6864
+ var paidVendorLicences = [
6865
+ EnumUserLicence.PRO_VENDOR,
6866
+ EnumUserLicence.PRO_PLUS_VENDOR
6867
+ ];
6868
+ var supportedBillingPeriods = [
6869
+ EnumBillingPeriod.MONTHLY_CANCEL_ANYTIME,
6870
+ EnumBillingPeriod.YEARLY_ANNUAL_BILLED
6871
+ ];
6872
+ var unitAmountField = {
6873
+ min: 1,
6874
+ required: true,
6875
+ type: Number,
6876
+ validate: {
6877
+ message: "Billing catalogue price must be a positive integer.",
6878
+ validator: Number.isInteger
6879
+ }
6880
+ };
6881
+ var currencyField = {
6882
+ default: BILLING_CATALOG_CURRENCY,
6883
+ enum: [BILLING_CATALOG_CURRENCY],
6884
+ immutable: true,
6885
+ lowercase: true,
6886
+ required: true,
6887
+ trim: true,
6888
+ type: String
6889
+ };
6890
+ var stripePriceIdField = {
6891
+ default: null,
6892
+ required: false,
6893
+ trim: true,
6894
+ type: String
6895
+ };
6896
+ var stripeProductIdField = {
6897
+ default: null,
6898
+ required: false,
6899
+ trim: true,
6900
+ type: String
6901
+ };
6902
+ var priceHistorySchema = new MongooseSchema2(
6903
+ {
6904
+ changedAt: { required: true, type: Date },
6905
+ changedBy: {
6906
+ default: null,
6907
+ ref: "User",
6908
+ required: false,
6909
+ type: import_mongoose2.default.Schema.Types.ObjectId
6910
+ },
6911
+ currency: currencyField,
6912
+ effectiveFrom: { required: true, type: Date },
6913
+ effectiveTo: { required: true, type: Date },
6914
+ stripePriceId: stripePriceIdField,
6915
+ stripeProductId: stripeProductIdField,
6916
+ unitAmount: unitAmountField
6917
+ },
6918
+ { _id: false }
6919
+ );
6920
+ var schema2 = new MongooseSchema2(
6921
+ {
6922
+ active: { default: true, required: true, type: Boolean },
6923
+ billingPeriod: {
6924
+ enum: supportedBillingPeriods,
6925
+ immutable: true,
6926
+ required: true,
6927
+ type: String
6928
+ },
6929
+ currency: currencyField,
6930
+ effectiveFrom: { default: Date.now, required: true, type: Date },
6931
+ key: {
6932
+ enum: BILLING_CATALOG_KEYS,
6933
+ immutable: true,
6934
+ required: true,
6935
+ type: String,
6936
+ unique: true
6937
+ },
6938
+ licenceType: {
6939
+ enum: paidVendorLicences,
6940
+ immutable: true,
6941
+ required: true,
6942
+ type: String
6943
+ },
6944
+ priceHistory: {
6945
+ default: [],
6946
+ required: true,
6947
+ type: [priceHistorySchema]
6948
+ },
6949
+ revision: {
6950
+ default: 1,
6951
+ min: 1,
6952
+ required: true,
6953
+ type: Number,
6954
+ validate: {
6955
+ message: "Billing catalogue revision must be a positive integer.",
6956
+ validator: Number.isInteger
6957
+ }
6958
+ },
6959
+ stripePriceId: stripePriceIdField,
6960
+ stripeProductId: stripeProductIdField,
6961
+ taxInclusive: {
6962
+ default: true,
6963
+ immutable: true,
6964
+ required: true,
6965
+ type: Boolean,
6966
+ validate: {
6967
+ message: "Billing catalogue prices must include GST.",
6968
+ validator: (value) => value === true
6969
+ }
6970
+ },
6971
+ unitAmount: unitAmountField,
6972
+ updatedBy: {
6973
+ default: null,
6974
+ ref: "User",
6975
+ required: false,
6976
+ type: import_mongoose2.default.Schema.Types.ObjectId
6977
+ }
6978
+ },
6979
+ {
6980
+ collection: BILLING_CATALOG_COLLECTION_NAME,
6981
+ strict: true,
6982
+ timestamps: true
6983
+ }
6984
+ );
6985
+ schema2.pre("validate", function validateDefinition() {
6986
+ if (!billingCatalogDefinitionMatches(this)) {
6987
+ this.invalidate(
6988
+ "key",
6989
+ "Billing catalogue key does not match its licence and billing period."
6990
+ );
6991
+ }
6992
+ });
6993
+ schema2.index({ billingPeriod: 1, licenceType: 1 }, { unique: true });
6994
+ schema2.index({ active: 1, licenceType: 1 });
6995
+ schema2.index(
6996
+ { stripePriceId: 1 },
6997
+ {
6998
+ partialFilterExpression: { stripePriceId: { $type: "string" } },
6999
+ unique: true
7000
+ }
7001
+ );
7002
+ var BillingCatalogModel = import_mongoose2.default.models.BillingCatalogEntry || import_mongoose2.default.model(
7003
+ "BillingCatalogEntry",
7004
+ schema2,
7005
+ BILLING_CATALOG_COLLECTION_NAME
7006
+ );
7007
+ function buildInitialBillingCatalogEntries(now = /* @__PURE__ */ new Date()) {
7008
+ return INITIAL_BILLING_CATALOG.map((entry) => ({
7009
+ active: entry.active,
7010
+ billingPeriod: entry.billingPeriod,
7011
+ currency: entry.currency,
7012
+ effectiveFrom: new Date(now.getTime()),
7013
+ key: entry.key,
7014
+ licenceType: entry.licenceType,
7015
+ priceHistory: [],
7016
+ revision: 1,
7017
+ stripePriceId: null,
7018
+ stripeProductId: null,
7019
+ taxInclusive: entry.taxInclusive,
7020
+ unitAmount: entry.unitAmount,
7021
+ updatedBy: null
7022
+ }));
7023
+ }
7024
+ function getBillingCatalogDefinition(key) {
7025
+ return BILLING_CATALOG_DEFINITIONS[key];
7026
+ }
7027
+
7028
+ // src/mongoose/chat/Chat.ts
7029
+ var import_mongoose3 = __toESM(require("mongoose"));
7030
+ var MongooseSchema3 = import_mongoose3.default.Schema;
7031
+ var MessageReplyPreviewSchema = new MongooseSchema3(
5255
7032
  {
5256
7033
  contentPreview: { required: true, type: String },
5257
7034
  senderId: {
5258
7035
  ref: "User",
5259
7036
  required: true,
5260
- type: import_mongoose2.default.Schema.Types.ObjectId
7037
+ type: import_mongoose3.default.Schema.Types.ObjectId
5261
7038
  },
5262
7039
  senderName: { required: true, type: String }
5263
7040
  },
5264
7041
  { _id: false }
5265
7042
  );
5266
- var MessageReactionSchema = new MongooseSchema2(
7043
+ var MessageReactionSchema = new MongooseSchema3(
5267
7044
  {
5268
7045
  createdAt: { required: true, type: Date },
5269
7046
  userId: {
5270
7047
  ref: "User",
5271
7048
  required: true,
5272
- type: import_mongoose2.default.Schema.Types.ObjectId
7049
+ type: import_mongoose3.default.Schema.Types.ObjectId
5273
7050
  }
5274
7051
  },
5275
7052
  { _id: false }
5276
7053
  );
5277
- var MessageSeenSchema = new MongooseSchema2(
7054
+ var MessageSeenSchema = new MongooseSchema3(
5278
7055
  {
5279
7056
  seenAt: { required: true, type: Date },
5280
7057
  userId: {
5281
7058
  ref: "User",
5282
7059
  required: true,
5283
- type: import_mongoose2.default.Schema.Types.ObjectId
7060
+ type: import_mongoose3.default.Schema.Types.ObjectId
5284
7061
  }
5285
7062
  },
5286
7063
  { _id: false }
5287
7064
  );
5288
- var MessageSchema = new MongooseSchema2(
7065
+ var MessageSchema = new MongooseSchema3(
5289
7066
  {
5290
7067
  content: { required: true, type: String },
5291
7068
  likedBy: { default: [], required: false, type: [MessageReactionSchema] },
@@ -5296,18 +7073,18 @@ var MessageSchema = new MongooseSchema2(
5296
7073
  replyToMessageId: {
5297
7074
  ref: "Chat.messages",
5298
7075
  required: false,
5299
- type: import_mongoose2.default.Schema.Types.ObjectId
7076
+ type: import_mongoose3.default.Schema.Types.ObjectId
5300
7077
  },
5301
7078
  seenBy: { default: [], required: false, type: [MessageSeenSchema] },
5302
7079
  senderId: {
5303
7080
  ref: "User",
5304
7081
  required: true,
5305
- type: import_mongoose2.default.Schema.Types.ObjectId
7082
+ type: import_mongoose3.default.Schema.Types.ObjectId
5306
7083
  }
5307
7084
  },
5308
7085
  { timestamps: true }
5309
7086
  );
5310
- var ParticipantSchema = new MongooseSchema2(
7087
+ var ParticipantSchema = new MongooseSchema3(
5311
7088
  {
5312
7089
  active: { default: true, required: true, type: Boolean },
5313
7090
  userAvatar: { required: false, type: String },
@@ -5315,14 +7092,14 @@ var ParticipantSchema = new MongooseSchema2(
5315
7092
  userId: {
5316
7093
  ref: "User",
5317
7094
  required: true,
5318
- type: import_mongoose2.default.Schema.Types.ObjectId
7095
+ type: import_mongoose3.default.Schema.Types.ObjectId
5319
7096
  },
5320
7097
  userName: { required: true, type: String }
5321
7098
  },
5322
7099
  { _id: false }
5323
7100
  // Prevents Mongoose from creating an additional _id field for subdocuments
5324
7101
  );
5325
- var ChatSchema = new MongooseSchema2(
7102
+ var ChatSchema = new MongooseSchema3(
5326
7103
  {
5327
7104
  active: { default: true, required: true, type: Boolean },
5328
7105
  chatDescription: { required: false, type: String },
@@ -5346,12 +7123,12 @@ ChatSchema.index({
5346
7123
  "participants.userId": 1,
5347
7124
  updatedAt: -1
5348
7125
  });
5349
- var ChatModel = import_mongoose2.default.models.Chat || import_mongoose2.default.model("Chat", ChatSchema);
7126
+ var ChatModel = import_mongoose3.default.models.Chat || import_mongoose3.default.model("Chat", ChatSchema);
5350
7127
 
5351
7128
  // src/mongoose/chat/ChatReport.ts
5352
- var import_mongoose3 = __toESM(require("mongoose"));
5353
- var MongooseSchema3 = import_mongoose3.default.Schema;
5354
- var ReasonSchema = new MongooseSchema3(
7129
+ var import_mongoose4 = __toESM(require("mongoose"));
7130
+ var MongooseSchema4 = import_mongoose4.default.Schema;
7131
+ var ReasonSchema = new MongooseSchema4(
5355
7132
  {
5356
7133
  details: { default: null, required: false, type: String },
5357
7134
  reasonType: {
@@ -5362,23 +7139,23 @@ var ReasonSchema = new MongooseSchema3(
5362
7139
  },
5363
7140
  { _id: false }
5364
7141
  );
5365
- var ChatReportSchema = new MongooseSchema3(
7142
+ var ChatReportSchema = new MongooseSchema4(
5366
7143
  {
5367
7144
  chatId: {
5368
7145
  ref: "Chat",
5369
7146
  required: true,
5370
- type: import_mongoose3.default.Schema.Types.ObjectId
7147
+ type: import_mongoose4.default.Schema.Types.ObjectId
5371
7148
  },
5372
7149
  reason: { required: true, type: ReasonSchema },
5373
7150
  reportedUserId: {
5374
7151
  ref: "User",
5375
7152
  required: true,
5376
- type: import_mongoose3.default.Schema.Types.ObjectId
7153
+ type: import_mongoose4.default.Schema.Types.ObjectId
5377
7154
  },
5378
7155
  reporterUserId: {
5379
7156
  ref: "User",
5380
7157
  required: true,
5381
- type: import_mongoose3.default.Schema.Types.ObjectId
7158
+ type: import_mongoose4.default.Schema.Types.ObjectId
5382
7159
  },
5383
7160
  resolved: { default: false, required: true, type: Boolean }
5384
7161
  },
@@ -5386,18 +7163,18 @@ var ChatReportSchema = new MongooseSchema3(
5386
7163
  );
5387
7164
  ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
5388
7165
  ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
5389
- var ChatReportModel = import_mongoose3.default.models.ChatReport || import_mongoose3.default.model("ChatReport", ChatReportSchema);
7166
+ var ChatReportModel = import_mongoose4.default.models.ChatReport || import_mongoose4.default.model("ChatReport", ChatReportSchema);
5390
7167
 
5391
7168
  // src/mongoose/global.ts
5392
- var import_mongoose6 = __toESM(require("mongoose"));
7169
+ var import_mongoose7 = __toESM(require("mongoose"));
5393
7170
 
5394
7171
  // src/mongoose/Relation.ts
5395
- var import_mongoose5 = __toESM(require("mongoose"));
7172
+ var import_mongoose6 = __toESM(require("mongoose"));
5396
7173
 
5397
7174
  // src/mongoose/event/EventInfo.ts
5398
- var import_mongoose4 = __toESM(require("mongoose"));
5399
- var MongooseSchema4 = import_mongoose4.default.Schema;
5400
- var StallTypeSchema = new MongooseSchema4(
7175
+ var import_mongoose5 = __toESM(require("mongoose"));
7176
+ var MongooseSchema5 = import_mongoose5.default.Schema;
7177
+ var StallTypeSchema = new MongooseSchema5(
5401
7178
  {
5402
7179
  label: { required: false, type: String },
5403
7180
  price: { required: false, type: Number },
@@ -5408,7 +7185,7 @@ var StallTypeSchema = new MongooseSchema4(
5408
7185
  // Prevents Mongoose from creating an additional _id field for subdocuments
5409
7186
  }
5410
7187
  );
5411
- var dateTimeSchema = new MongooseSchema4(
7188
+ var dateTimeSchema = new MongooseSchema5(
5412
7189
  {
5413
7190
  dateStatus: {
5414
7191
  enum: Object.values(EnumEventDateStatus),
@@ -5424,7 +7201,7 @@ var dateTimeSchema = new MongooseSchema4(
5424
7201
  { _id: false }
5425
7202
  // Prevents Mongoose from creating an additional _id field for subdocuments
5426
7203
  );
5427
- var paymentInfoSchema = new MongooseSchema4(
7204
+ var paymentInfoSchema = new MongooseSchema5(
5428
7205
  {
5429
7206
  accountHolderName: { required: false, type: String },
5430
7207
  accountNumber: { required: false, type: String },
@@ -5438,7 +7215,7 @@ var paymentInfoSchema = new MongooseSchema4(
5438
7215
  { _id: false }
5439
7216
  // Prevents Mongoose from creating an additional _id field
5440
7217
  );
5441
- var requirementsSchema = new MongooseSchema4(
7218
+ var requirementsSchema = new MongooseSchema5(
5442
7219
  {
5443
7220
  category: { required: true, type: String },
5444
7221
  label: { required: true, type: String },
@@ -5449,7 +7226,7 @@ var requirementsSchema = new MongooseSchema4(
5449
7226
  // Prevents Mongoose from creating an additional _id field for
5450
7227
  }
5451
7228
  );
5452
- var refundPolicySchema = new MongooseSchema4(
7229
+ var refundPolicySchema = new MongooseSchema5(
5453
7230
  {
5454
7231
  category: { required: true, type: String },
5455
7232
  label: { required: true, type: String },
@@ -5457,7 +7234,7 @@ var refundPolicySchema = new MongooseSchema4(
5457
7234
  },
5458
7235
  { _id: false }
5459
7236
  );
5460
- var schema2 = new MongooseSchema4(
7237
+ var schema3 = new MongooseSchema5(
5461
7238
  {
5462
7239
  active: { default: true, type: Boolean },
5463
7240
  applicationDeadlineHours: { required: true, type: Number },
@@ -5465,7 +7242,7 @@ var schema2 = new MongooseSchema4(
5465
7242
  eventId: {
5466
7243
  ref: "Event",
5467
7244
  required: true,
5468
- type: import_mongoose4.default.Schema.Types.ObjectId
7245
+ type: import_mongoose5.default.Schema.Types.ObjectId
5469
7246
  },
5470
7247
  packInTime: { required: true, type: Number },
5471
7248
  paymentDueHours: { required: true, type: Number },
@@ -5475,11 +7252,12 @@ var schema2 = new MongooseSchema4(
5475
7252
  },
5476
7253
  { timestamps: true }
5477
7254
  );
5478
- var EventInfoModel = import_mongoose4.default.models.EventInfo || import_mongoose4.default.model("EventInfo", schema2);
7255
+ schema3.index({ eventId: 1 });
7256
+ var EventInfoModel = import_mongoose5.default.models.EventInfo || import_mongoose5.default.model("EventInfo", schema3);
5479
7257
 
5480
7258
  // src/mongoose/Relation.ts
5481
- var MongooseSchema5 = import_mongoose5.default.Schema;
5482
- var relationDateTimeSchema = new MongooseSchema5(
7259
+ var MongooseSchema6 = import_mongoose6.default.Schema;
7260
+ var relationDateTimeSchema = new MongooseSchema6(
5483
7261
  {
5484
7262
  dateStatus: {
5485
7263
  enum: Object.values(EnumEventDateStatus),
@@ -5494,7 +7272,7 @@ var relationDateTimeSchema = new MongooseSchema5(
5494
7272
  },
5495
7273
  { _id: false }
5496
7274
  );
5497
- var relationDatesSchema = new MongooseSchema5(
7275
+ var relationDatesSchema = new MongooseSchema6(
5498
7276
  {
5499
7277
  dateTime: {
5500
7278
  required: true,
@@ -5513,19 +7291,19 @@ var relationDatesSchema = new MongooseSchema5(
5513
7291
  },
5514
7292
  { _id: false }
5515
7293
  );
5516
- var RelationTypeSchema = new MongooseSchema5(
7294
+ var RelationTypeSchema = new MongooseSchema6(
5517
7295
  {
5518
7296
  active: { default: true, required: true, type: Boolean },
5519
7297
  chatId: {
5520
7298
  ref: "Chat",
5521
7299
  required: true,
5522
- type: import_mongoose5.default.Schema.Types.ObjectId
7300
+ type: import_mongoose6.default.Schema.Types.ObjectId
5523
7301
  },
5524
7302
  deletedAt: { default: null, required: false, type: Date },
5525
7303
  eventId: {
5526
7304
  ref: "Event",
5527
7305
  required: true,
5528
- type: import_mongoose5.default.Schema.Types.ObjectId
7306
+ type: import_mongoose6.default.Schema.Types.ObjectId
5529
7307
  },
5530
7308
  lastUpdateBy: {
5531
7309
  enum: Object.values(EnumResourceType),
@@ -5541,7 +7319,7 @@ var RelationTypeSchema = new MongooseSchema5(
5541
7319
  vendorId: {
5542
7320
  ref: "Vendor",
5543
7321
  required: true,
5544
- type: import_mongoose5.default.Schema.Types.ObjectId
7322
+ type: import_mongoose6.default.Schema.Types.ObjectId
5545
7323
  }
5546
7324
  },
5547
7325
  { timestamps: true }
@@ -5553,23 +7331,23 @@ RelationTypeSchema.index({
5553
7331
  "relationDates.status": 1,
5554
7332
  vendorId: 1
5555
7333
  });
5556
- var RelationModel = import_mongoose5.default.models.Relation || import_mongoose5.default.model("Relation", RelationTypeSchema);
7334
+ var RelationModel = import_mongoose6.default.models.Relation || import_mongoose6.default.model("Relation", RelationTypeSchema);
5557
7335
 
5558
7336
  // src/mongoose/global.ts
5559
- var MongooseSchema6 = import_mongoose6.default.Schema;
5560
- var OwnerTypeSchema = new MongooseSchema6(
7337
+ var MongooseSchema7 = import_mongoose7.default.Schema;
7338
+ var OwnerTypeSchema = new MongooseSchema7(
5561
7339
  {
5562
7340
  email: { required: true, type: String },
5563
7341
  userId: {
5564
7342
  ref: "User",
5565
7343
  required: true,
5566
- type: import_mongoose6.default.Schema.Types.ObjectId
7344
+ type: import_mongoose7.default.Schema.Types.ObjectId
5567
7345
  }
5568
7346
  },
5569
7347
  { _id: false }
5570
7348
  // Prevents Mongoose from creating an additional _id field for subdocuments
5571
7349
  );
5572
- var SocialMediaTypeSchema = new MongooseSchema6(
7350
+ var SocialMediaTypeSchema = new MongooseSchema7(
5573
7351
  {
5574
7352
  link: { required: true, type: String },
5575
7353
  name: { required: true, type: String }
@@ -5577,7 +7355,7 @@ var SocialMediaTypeSchema = new MongooseSchema6(
5577
7355
  { _id: false }
5578
7356
  // Prevents Mongoose from creating an additional _id field
5579
7357
  );
5580
- var ResourceImageTypeSchema = new MongooseSchema6(
7358
+ var ResourceImageTypeSchema = new MongooseSchema7(
5581
7359
  {
5582
7360
  active: { default: true, required: true, type: Boolean },
5583
7361
  source: { required: false, type: String },
@@ -5586,7 +7364,7 @@ var ResourceImageTypeSchema = new MongooseSchema6(
5586
7364
  { _id: false }
5587
7365
  // Prevents Mongoose from creating an additional _id field for subdocuments
5588
7366
  );
5589
- var SubCategorySchema = new MongooseSchema6(
7367
+ var SubCategorySchema = new MongooseSchema7(
5590
7368
  {
5591
7369
  id: { required: false, type: String },
5592
7370
  items: [
@@ -5600,7 +7378,7 @@ var SubCategorySchema = new MongooseSchema6(
5600
7378
  { _id: false }
5601
7379
  // Prevents Mongoose from creating an additional _id field for subdocuments
5602
7380
  );
5603
- var CategorySchema = new MongooseSchema6(
7381
+ var CategorySchema = new MongooseSchema7(
5604
7382
  {
5605
7383
  id: { required: true, type: String },
5606
7384
  name: { required: true, type: String },
@@ -5609,7 +7387,7 @@ var CategorySchema = new MongooseSchema6(
5609
7387
  { _id: false }
5610
7388
  // Prevents Mongoose from creating an additional _id field for subdocuments
5611
7389
  );
5612
- var PosterUsageTypeSchema = new MongooseSchema6(
7390
+ var PosterUsageTypeSchema = new MongooseSchema7(
5613
7391
  {
5614
7392
  count: { default: 0, required: false, type: Number },
5615
7393
  month: { required: false, type: String }
@@ -5617,7 +7395,7 @@ var PosterUsageTypeSchema = new MongooseSchema6(
5617
7395
  { _id: false }
5618
7396
  // Prevents Mongoose from creating an additional _id field for subdocuments
5619
7397
  );
5620
- var userLicenseSchema = new MongooseSchema6(
7398
+ var userLicenseSchema = new MongooseSchema7(
5621
7399
  {
5622
7400
  expiryDate: { required: true, type: Date },
5623
7401
  issuedDate: { required: true, type: Date },
@@ -5634,7 +7412,7 @@ var userLicenseSchema = new MongooseSchema6(
5634
7412
  },
5635
7413
  { _id: false, timestamps: false }
5636
7414
  );
5637
- var ContactDetailsSchema = new MongooseSchema6(
7415
+ var ContactDetailsSchema = new MongooseSchema7(
5638
7416
  {
5639
7417
  email: { required: false, type: String },
5640
7418
  landlinePhone: { required: false, type: String },
@@ -5643,7 +7421,7 @@ var ContactDetailsSchema = new MongooseSchema6(
5643
7421
  { _id: false }
5644
7422
  // Prevents Mongoose from creating an additional _id field for subdocuments
5645
7423
  );
5646
- var termsAgreementSchema = new MongooseSchema6(
7424
+ var termsAgreementSchema = new MongooseSchema7(
5647
7425
  {
5648
7426
  appBuildNumber: { required: true, type: String },
5649
7427
  appId: { required: true, type: String },
@@ -5660,7 +7438,7 @@ var termsAgreementSchema = new MongooseSchema6(
5660
7438
  },
5661
7439
  { _id: false }
5662
7440
  );
5663
- var resourceRelationsSchema = new MongooseSchema6(
7441
+ var resourceRelationsSchema = new MongooseSchema7(
5664
7442
  {
5665
7443
  relationDates: {
5666
7444
  default: [],
@@ -5670,12 +7448,12 @@ var resourceRelationsSchema = new MongooseSchema6(
5670
7448
  relationId: {
5671
7449
  ref: "Relation",
5672
7450
  required: false,
5673
- type: import_mongoose6.default.Schema.Types.ObjectId
7451
+ type: import_mongoose7.default.Schema.Types.ObjectId
5674
7452
  }
5675
7453
  },
5676
7454
  { _id: false }
5677
7455
  );
5678
- var dateTimeSchema2 = new MongooseSchema6(
7456
+ var dateTimeSchema2 = new MongooseSchema7(
5679
7457
  {
5680
7458
  dateStatus: {
5681
7459
  enum: Object.values(EnumEventDateStatus),
@@ -5690,7 +7468,7 @@ var dateTimeSchema2 = new MongooseSchema6(
5690
7468
  { _id: false }
5691
7469
  // Prevents Mongoose from creating an additional _id field for subdocuments
5692
7470
  );
5693
- var locationGeoSchema = new MongooseSchema6(
7471
+ var locationGeoSchema = new MongooseSchema7(
5694
7472
  {
5695
7473
  coordinates: { required: true, type: [Number] },
5696
7474
  // [longitude, latitude]
@@ -5699,7 +7477,7 @@ var locationGeoSchema = new MongooseSchema6(
5699
7477
  { _id: false }
5700
7478
  // Prevents Mongoose from creating an additional _id field for subdocuments
5701
7479
  );
5702
- var locationsSchema = new MongooseSchema6(
7480
+ var locationsSchema = new MongooseSchema7(
5703
7481
  {
5704
7482
  city: { required: true, type: String },
5705
7483
  country: { required: true, type: String },
@@ -5715,13 +7493,13 @@ var locationsSchema = new MongooseSchema6(
5715
7493
  { _id: false }
5716
7494
  // Prevents Mongoose from creating an additional _id field for subdocuments
5717
7495
  );
5718
- var relatedPostSchema = new MongooseSchema6(
7496
+ var relatedPostSchema = new MongooseSchema7(
5719
7497
  {
5720
7498
  postActive: { default: true, required: true, type: Boolean },
5721
7499
  postId: {
5722
7500
  ref: "Post",
5723
7501
  required: true,
5724
- type: import_mongoose6.default.Schema.Types.ObjectId
7502
+ type: import_mongoose7.default.Schema.Types.ObjectId
5725
7503
  },
5726
7504
  postSlug: { required: true, type: String },
5727
7505
  postType: {
@@ -5733,7 +7511,7 @@ var relatedPostSchema = new MongooseSchema6(
5733
7511
  { _id: false }
5734
7512
  // Prevents Mongoose from creating an additional _id field for subdocuments
5735
7513
  );
5736
- var socialShareResourceSchema = new MongooseSchema6(
7514
+ var socialShareResourceSchema = new MongooseSchema7(
5737
7515
  {
5738
7516
  qrCode: { required: true, type: ResourceImageTypeSchema },
5739
7517
  socialImage: { required: true, type: ResourceImageTypeSchema }
@@ -5746,7 +7524,7 @@ var baseResourceFields = {
5746
7524
  adIds: {
5747
7525
  ref: "Ad",
5748
7526
  required: false,
5749
- type: [import_mongoose6.default.Schema.Types.ObjectId]
7527
+ type: [import_mongoose7.default.Schema.Types.ObjectId]
5750
7528
  },
5751
7529
  approvedAt: { default: null, required: false, type: Date },
5752
7530
  contactDetails: { required: false, type: ContactDetailsSchema },
@@ -5776,9 +7554,64 @@ var baseResourceFields = {
5776
7554
  };
5777
7555
 
5778
7556
  // src/mongoose/GoogleImportedMarket.ts
5779
- var import_mongoose7 = __toESM(require("mongoose"));
5780
- var MongooseSchema7 = import_mongoose7.default.Schema;
5781
- var addressComponentSchema = new MongooseSchema7(
7557
+ var import_mongoose8 = __toESM(require("mongoose"));
7558
+
7559
+ // src/mongoose/searchNamePlugin.ts
7560
+ function deriveSearchName(name) {
7561
+ return typeof name === "string" ? name.trim().toLowerCase() : "";
7562
+ }
7563
+ function searchNamePlugin(schema20) {
7564
+ schema20.add({ searchName: { default: "", required: false, type: String } });
7565
+ schema20.index({ searchName: 1 });
7566
+ schema20.pre("save", function syncSearchNameOnSave(next) {
7567
+ const doc = this;
7568
+ doc.searchName = deriveSearchName(doc.name);
7569
+ next();
7570
+ });
7571
+ schema20.pre("insertMany", function syncSearchNameOnInsertMany(next, docs) {
7572
+ const list = Array.isArray(docs) ? docs : [docs];
7573
+ for (const doc of list) {
7574
+ if (doc && typeof doc.name === "string") {
7575
+ doc.searchName = deriveSearchName(doc.name);
7576
+ }
7577
+ }
7578
+ next();
7579
+ });
7580
+ schema20.pre("bulkWrite", function syncSearchNameOnBulkWrite(next, ops) {
7581
+ for (const op of ops) {
7582
+ const doc = op.insertOne?.document ?? op.replaceOne?.replacement;
7583
+ if (doc && typeof doc.name === "string") {
7584
+ doc.searchName = deriveSearchName(doc.name);
7585
+ }
7586
+ const $set = op.updateOne?.update?.$set;
7587
+ if ($set && typeof $set.name === "string") {
7588
+ $set.searchName = deriveSearchName($set.name);
7589
+ }
7590
+ }
7591
+ next();
7592
+ });
7593
+ const syncSearchNameOnUpdate = function(next) {
7594
+ const update = this.getUpdate();
7595
+ if (update && typeof update === "object" && "$set" in update) {
7596
+ const $set = update.$set;
7597
+ if ($set && typeof $set.name === "string") {
7598
+ this.setUpdate({
7599
+ ...update,
7600
+ $set: { ...$set, searchName: deriveSearchName($set.name) }
7601
+ });
7602
+ }
7603
+ }
7604
+ next();
7605
+ };
7606
+ schema20.pre(
7607
+ ["findOneAndUpdate", "updateOne", "updateMany"],
7608
+ syncSearchNameOnUpdate
7609
+ );
7610
+ }
7611
+
7612
+ // src/mongoose/GoogleImportedMarket.ts
7613
+ var MongooseSchema8 = import_mongoose8.default.Schema;
7614
+ var addressComponentSchema = new MongooseSchema8(
5782
7615
  {
5783
7616
  longName: { required: false, type: String },
5784
7617
  shortName: { required: false, type: String },
@@ -5786,7 +7619,7 @@ var addressComponentSchema = new MongooseSchema7(
5786
7619
  },
5787
7620
  { _id: false }
5788
7621
  );
5789
- var schema3 = new MongooseSchema7(
7622
+ var schema4 = new MongooseSchema8(
5790
7623
  {
5791
7624
  active: { default: false, required: true, type: Boolean },
5792
7625
  address: { required: true, type: String },
@@ -5798,7 +7631,7 @@ var schema3 = new MongooseSchema7(
5798
7631
  claimedByUserId: {
5799
7632
  ref: "User",
5800
7633
  required: false,
5801
- type: import_mongoose7.default.Schema.Types.ObjectId
7634
+ type: import_mongoose8.default.Schema.Types.ObjectId
5802
7635
  },
5803
7636
  cover: {
5804
7637
  required: false,
@@ -5810,7 +7643,7 @@ var schema3 = new MongooseSchema7(
5810
7643
  eventId: {
5811
7644
  ref: "Event",
5812
7645
  required: false,
5813
- type: import_mongoose7.default.Schema.Types.ObjectId
7646
+ type: import_mongoose8.default.Schema.Types.ObjectId
5814
7647
  },
5815
7648
  eventType: {
5816
7649
  enum: Object.values(EnumEventType),
@@ -5849,18 +7682,20 @@ var schema3 = new MongooseSchema7(
5849
7682
  },
5850
7683
  { timestamps: true }
5851
7684
  );
5852
- schema3.index({ "location.geo": "2dsphere" });
5853
- schema3.index({ name: 1 });
5854
- schema3.index({ region: 1 });
5855
- schema3.index({ deletedAt: 1 });
5856
- schema3.index({ "dateTime.dateStatus": 1 });
5857
- schema3.index({ slug: 1 });
5858
- var GoogleImportedMarketModel = import_mongoose7.default.models.GoogleImportedMarket || import_mongoose7.default.model("GoogleImportedMarket", schema3);
7685
+ schema4.index({ "location.geo": "2dsphere" });
7686
+ schema4.index({ name: 1 });
7687
+ schema4.index({ region: 1 });
7688
+ schema4.index({ deletedAt: 1 });
7689
+ schema4.index({ "dateTime.dateStatus": 1 });
7690
+ schema4.index({ slug: 1 });
7691
+ schema4.index({ name: "text", description: "text" });
7692
+ schema4.plugin(searchNamePlugin);
7693
+ var GoogleImportedMarketModel = import_mongoose8.default.models.GoogleImportedMarket || import_mongoose8.default.model("GoogleImportedMarket", schema4);
5859
7694
 
5860
7695
  // src/mongoose/Notification.ts
5861
- var import_mongoose8 = __toESM(require("mongoose"));
5862
- var MongooseSchema8 = import_mongoose8.default.Schema;
5863
- var schema4 = new MongooseSchema8(
7696
+ var import_mongoose9 = __toESM(require("mongoose"));
7697
+ var MongooseSchema9 = import_mongoose9.default.Schema;
7698
+ var schema5 = new MongooseSchema9(
5864
7699
  {
5865
7700
  data: {
5866
7701
  resourceId: { required: true, type: String },
@@ -5883,16 +7718,16 @@ var schema4 = new MongooseSchema8(
5883
7718
  userId: {
5884
7719
  ref: "User",
5885
7720
  required: true,
5886
- type: import_mongoose8.default.Schema.Types.ObjectId
7721
+ type: import_mongoose9.default.Schema.Types.ObjectId
5887
7722
  }
5888
7723
  },
5889
7724
  { timestamps: true }
5890
7725
  );
5891
- schema4.index({ isRead: 1, userId: 1 });
5892
- schema4.index({ createdAt: -1, userId: 1 });
5893
- var NotificationModel = import_mongoose8.default.models.Notification || import_mongoose8.default.model("Notification", schema4);
7726
+ schema5.index({ isRead: 1, userId: 1 });
7727
+ schema5.index({ createdAt: -1, userId: 1 });
7728
+ var NotificationModel = import_mongoose9.default.models.Notification || import_mongoose9.default.model("Notification", schema5);
5894
7729
 
5895
- // node_modules/@timardex/cluemart-shared/dist/chunk-7IB7QPVH.mjs
7730
+ // node_modules/@timardex/cluemart-shared/dist/chunk-P4NLBWEJ.mjs
5896
7731
  var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
5897
7732
  EnumOSPlatform22["ANDROID"] = "android";
5898
7733
  EnumOSPlatform22["IOS"] = "ios";
@@ -5901,9 +7736,9 @@ var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
5901
7736
  })(EnumOSPlatform2 || {});
5902
7737
 
5903
7738
  // src/mongoose/PushToken.ts
5904
- var import_mongoose9 = __toESM(require("mongoose"));
5905
- var MongooseSchema9 = import_mongoose9.default.Schema;
5906
- var schema5 = new MongooseSchema9(
7739
+ var import_mongoose10 = __toESM(require("mongoose"));
7740
+ var MongooseSchema10 = import_mongoose10.default.Schema;
7741
+ var schema6 = new MongooseSchema10(
5907
7742
  {
5908
7743
  platform: {
5909
7744
  enum: Object.values(EnumOSPlatform2),
@@ -5914,17 +7749,17 @@ var schema5 = new MongooseSchema9(
5914
7749
  userId: {
5915
7750
  ref: "User",
5916
7751
  required: true,
5917
- type: import_mongoose9.default.Schema.Types.ObjectId
7752
+ type: import_mongoose10.default.Schema.Types.ObjectId
5918
7753
  }
5919
7754
  },
5920
7755
  { timestamps: true }
5921
7756
  );
5922
- var PushTokenModel = import_mongoose9.default.models.PushToken || import_mongoose9.default.model("PushToken", schema5);
7757
+ var PushTokenModel = import_mongoose10.default.models.PushToken || import_mongoose10.default.model("PushToken", schema6);
5923
7758
 
5924
7759
  // src/mongoose/ResourceActivity.ts
5925
- var import_mongoose10 = __toESM(require("mongoose"));
5926
- var MongooseSchema10 = import_mongoose10.default.Schema;
5927
- var ActivitySchema = new MongooseSchema10(
7760
+ var import_mongoose11 = __toESM(require("mongoose"));
7761
+ var MongooseSchema11 = import_mongoose11.default.Schema;
7762
+ var ActivitySchema = new MongooseSchema11(
5928
7763
  {
5929
7764
  activityType: {
5930
7765
  enum: Object.values(EnumActivity),
@@ -5952,7 +7787,7 @@ var ActivitySchema = new MongooseSchema10(
5952
7787
  },
5953
7788
  { _id: false }
5954
7789
  );
5955
- var schema6 = new MongooseSchema10(
7790
+ var schema7 = new MongooseSchema11(
5956
7791
  {
5957
7792
  activity: { default: [], type: [ActivitySchema] },
5958
7793
  resourceId: { required: true, type: String },
@@ -5964,46 +7799,55 @@ var schema6 = new MongooseSchema10(
5964
7799
  },
5965
7800
  { timestamps: true }
5966
7801
  );
5967
- schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
5968
- schema6.index({ "views.location": "2dsphere" });
5969
- var ResourceActivityModel = import_mongoose10.default.models.ResourceActivity || import_mongoose10.default.model("ResourceActivity", schema6);
7802
+ schema7.index({ resourceId: 1, resourceType: 1 }, { unique: true });
7803
+ schema7.index({ "views.location": "2dsphere" });
7804
+ var ResourceActivityModel = import_mongoose11.default.models.ResourceActivity || import_mongoose11.default.model("ResourceActivity", schema7);
5970
7805
 
5971
7806
  // src/mongoose/User.ts
5972
- var import_mongoose11 = __toESM(require("mongoose"));
5973
- var MongooseSchema11 = import_mongoose11.default.Schema;
5974
- var userActivityEventSchema = new MongooseSchema11(
7807
+ var import_mongoose12 = __toESM(require("mongoose"));
7808
+ var MongooseSchema12 = import_mongoose12.default.Schema;
7809
+ var userActivityEventSchema = new MongooseSchema12(
5975
7810
  {
5976
7811
  dateTime: dateTimeSchema2,
5977
7812
  resourceId: {
5978
7813
  ref: "Event",
5979
7814
  required: false,
5980
- type: import_mongoose11.default.Schema.Types.ObjectId
7815
+ type: import_mongoose12.default.Schema.Types.ObjectId
5981
7816
  }
5982
7817
  },
5983
7818
  { _id: false }
5984
7819
  );
5985
- var userActivityFavouritesSchema = new MongooseSchema11(
7820
+ var userActivityFavouritesSchema = new MongooseSchema12(
5986
7821
  {
5987
7822
  events: {
5988
7823
  ref: "Event",
5989
7824
  required: false,
5990
- type: [import_mongoose11.default.Schema.Types.ObjectId]
7825
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
5991
7826
  },
5992
7827
  partners: {
5993
7828
  ref: "Partner",
5994
7829
  required: false,
5995
- type: [import_mongoose11.default.Schema.Types.ObjectId]
7830
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
5996
7831
  },
5997
7832
  vendors: {
5998
7833
  ref: "Vendor",
5999
7834
  required: false,
6000
- type: [import_mongoose11.default.Schema.Types.ObjectId]
7835
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
6001
7836
  }
6002
7837
  },
6003
7838
  { _id: false }
6004
7839
  );
6005
- var stripeSchema = new MongooseSchema11(
7840
+ var stripeSchema = new MongooseSchema12(
6006
7841
  {
7842
+ billingPeriod: {
7843
+ enum: Object.values(EnumBillingPeriod),
7844
+ required: false,
7845
+ type: String
7846
+ },
7847
+ cancelAtPeriodEnd: {
7848
+ required: false,
7849
+ type: Boolean
7850
+ },
6007
7851
  currentPlan: {
6008
7852
  enum: Object.values(EnumUserLicence),
6009
7853
  required: false,
@@ -6017,6 +7861,28 @@ var stripeSchema = new MongooseSchema11(
6017
7861
  required: false,
6018
7862
  type: Date
6019
7863
  },
7864
+ pendingBillingPeriod: {
7865
+ enum: Object.values(EnumBillingPeriod),
7866
+ required: false,
7867
+ type: String
7868
+ },
7869
+ pendingChangeEffectiveAt: {
7870
+ required: false,
7871
+ type: Date
7872
+ },
7873
+ pendingPlan: {
7874
+ enum: Object.values(EnumUserLicence),
7875
+ required: false,
7876
+ type: String
7877
+ },
7878
+ priceId: {
7879
+ required: false,
7880
+ type: String
7881
+ },
7882
+ scheduleId: {
7883
+ required: false,
7884
+ type: String
7885
+ },
6020
7886
  startDate: {
6021
7887
  required: false,
6022
7888
  type: Date
@@ -6029,11 +7895,19 @@ var stripeSchema = new MongooseSchema11(
6029
7895
  subscriptionId: {
6030
7896
  required: false,
6031
7897
  type: String
7898
+ },
7899
+ subscriptionMutationLockExpiresAt: {
7900
+ required: false,
7901
+ type: Date
7902
+ },
7903
+ subscriptionMutationLockId: {
7904
+ required: false,
7905
+ type: String
6032
7906
  }
6033
7907
  },
6034
7908
  { _id: false }
6035
7909
  );
6036
- var redeemedRewardSchema = new MongooseSchema11(
7910
+ var redeemedRewardSchema = new MongooseSchema12(
6037
7911
  {
6038
7912
  name: {
6039
7913
  enum: Object.values(EnumReward),
@@ -6045,13 +7919,13 @@ var redeemedRewardSchema = new MongooseSchema11(
6045
7919
  },
6046
7920
  { _id: false }
6047
7921
  );
6048
- var schema7 = new MongooseSchema11(
7922
+ var schema8 = new MongooseSchema12(
6049
7923
  {
6050
7924
  active: { default: false, required: true, type: Boolean },
6051
7925
  affiliate: {
6052
7926
  ref: "Affiliate",
6053
7927
  required: false,
6054
- type: import_mongoose11.default.Schema.Types.ObjectId
7928
+ type: import_mongoose12.default.Schema.Types.ObjectId
6055
7929
  },
6056
7930
  avatar: {
6057
7931
  required: false,
@@ -6060,7 +7934,7 @@ var schema7 = new MongooseSchema11(
6060
7934
  coupon: {
6061
7935
  ref: "Coupon",
6062
7936
  required: false,
6063
- type: import_mongoose11.default.Schema.Types.ObjectId
7937
+ type: import_mongoose12.default.Schema.Types.ObjectId
6064
7938
  },
6065
7939
  deletedAt: { default: null, required: false, type: Date },
6066
7940
  email: { required: true, type: String },
@@ -6072,13 +7946,13 @@ var schema7 = new MongooseSchema11(
6072
7946
  events: {
6073
7947
  ref: "Event",
6074
7948
  required: false,
6075
- type: [import_mongoose11.default.Schema.Types.ObjectId]
7949
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
6076
7950
  },
6077
7951
  firstName: { required: true, type: String },
6078
7952
  game: {
6079
7953
  ref: "Game",
6080
7954
  required: false,
6081
- type: import_mongoose11.default.Schema.Types.ObjectId
7955
+ type: import_mongoose12.default.Schema.Types.ObjectId
6082
7956
  },
6083
7957
  interests: {
6084
7958
  enum: Object.values(EnumResourceType),
@@ -6100,7 +7974,7 @@ var schema7 = new MongooseSchema11(
6100
7974
  partner: {
6101
7975
  ref: "Partner",
6102
7976
  required: false,
6103
- type: import_mongoose11.default.Schema.Types.ObjectId
7977
+ type: import_mongoose12.default.Schema.Types.ObjectId
6104
7978
  },
6105
7979
  password: { required: true, type: String },
6106
7980
  platform: {
@@ -6133,7 +8007,7 @@ var schema7 = new MongooseSchema11(
6133
8007
  school: {
6134
8008
  ref: "School",
6135
8009
  required: false,
6136
- type: import_mongoose11.default.Schema.Types.ObjectId
8010
+ type: import_mongoose12.default.Schema.Types.ObjectId
6137
8011
  },
6138
8012
  stripe: {
6139
8013
  required: false,
@@ -6158,19 +8032,20 @@ var schema7 = new MongooseSchema11(
6158
8032
  vendor: {
6159
8033
  ref: "Vendor",
6160
8034
  required: false,
6161
- type: import_mongoose11.default.Schema.Types.ObjectId
8035
+ type: import_mongoose12.default.Schema.Types.ObjectId
6162
8036
  }
6163
8037
  },
6164
8038
  { strict: false, timestamps: true }
6165
8039
  );
6166
- schema7.index({ "licences.expiryDate": 1 });
6167
- schema7.index({ "licences.licenceType": 1 });
6168
- var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema7);
8040
+ schema8.index({ "licences.expiryDate": 1 });
8041
+ schema8.index({ "licences.licenceType": 1 });
8042
+ schema8.index({ promoCodes: 1, active: 1, deletedAt: 1 });
8043
+ var UserModel = import_mongoose12.default.models.User || import_mongoose12.default.model("User", schema8);
6169
8044
 
6170
8045
  // src/mongoose/VerificationToken.ts
6171
- var import_mongoose12 = __toESM(require("mongoose"));
6172
- var MongooseSchema12 = import_mongoose12.default.Schema;
6173
- var schema8 = new MongooseSchema12(
8046
+ var import_mongoose13 = __toESM(require("mongoose"));
8047
+ var MongooseSchema13 = import_mongoose13.default.Schema;
8048
+ var schema9 = new MongooseSchema13(
6174
8049
  {
6175
8050
  createdAt: {
6176
8051
  default: Date.now,
@@ -6185,12 +8060,12 @@ var schema8 = new MongooseSchema12(
6185
8060
  },
6186
8061
  { timestamps: true }
6187
8062
  );
6188
- var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
8063
+ var VerificationTokenModel = import_mongoose13.default.models.VerificationToken || import_mongoose13.default.model("VerificationToken", schema9);
6189
8064
 
6190
8065
  // src/mongoose/vendor/Vendor.ts
6191
- var import_mongoose13 = __toESM(require("mongoose"));
6192
- var MongooseSchema13 = import_mongoose13.default.Schema;
6193
- var vendorProductTypeSchema = new MongooseSchema13(
8066
+ var import_mongoose14 = __toESM(require("mongoose"));
8067
+ var MongooseSchema14 = import_mongoose14.default.Schema;
8068
+ var vendorProductTypeSchema = new MongooseSchema14(
6194
8069
  {
6195
8070
  description: { required: false, type: String },
6196
8071
  name: { required: true, type: String },
@@ -6201,14 +8076,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
6201
8076
  },
6202
8077
  { timestamps: true }
6203
8078
  );
6204
- var productWrapperSchema = new MongooseSchema13(
8079
+ var productWrapperSchema = new MongooseSchema14(
6205
8080
  {
6206
8081
  active: { default: false, required: false, type: Boolean },
6207
8082
  productsList: { required: false, type: [vendorProductTypeSchema] }
6208
8083
  },
6209
8084
  { _id: false }
6210
8085
  );
6211
- var calendarSchema = new MongooseSchema13(
8086
+ var calendarSchema = new MongooseSchema14(
6212
8087
  {
6213
8088
  dateTime: {
6214
8089
  dateStatus: {
@@ -6229,14 +8104,14 @@ var calendarSchema = new MongooseSchema13(
6229
8104
  },
6230
8105
  { _id: false }
6231
8106
  );
6232
- var calendarWrapperSchema = new MongooseSchema13(
8107
+ var calendarWrapperSchema = new MongooseSchema14(
6233
8108
  {
6234
8109
  active: { default: false, required: true, type: Boolean },
6235
8110
  calendarData: { required: false, type: [calendarSchema] }
6236
8111
  },
6237
8112
  { _id: false }
6238
8113
  );
6239
- var schema9 = new MongooseSchema13(
8114
+ var schema10 = new MongooseSchema14(
6240
8115
  {
6241
8116
  ...baseResourceFields,
6242
8117
  // Importing base resource fields from global.ts
@@ -6250,6 +8125,7 @@ var schema9 = new MongooseSchema13(
6250
8125
  type: calendarWrapperSchema
6251
8126
  },
6252
8127
  categories: { required: true, type: [CategorySchema] },
8128
+ categoriesNames: { default: [], required: false, type: [String] },
6253
8129
  claimed: { default: true, required: false, type: Boolean },
6254
8130
  foodTruck: { required: true, type: Boolean },
6255
8131
  products: { required: false, type: productWrapperSchema },
@@ -6262,12 +8138,12 @@ var schema9 = new MongooseSchema13(
6262
8138
  unregisteredVendorId: {
6263
8139
  ref: "UnregisteredVendor",
6264
8140
  required: false,
6265
- type: import_mongoose13.default.Schema.Types.ObjectId
8141
+ type: import_mongoose14.default.Schema.Types.ObjectId
6266
8142
  },
6267
8143
  vendorInfoId: {
6268
8144
  ref: "VendorInfo",
6269
8145
  required: false,
6270
- type: import_mongoose13.default.Schema.Types.ObjectId
8146
+ type: import_mongoose14.default.Schema.Types.ObjectId
6271
8147
  },
6272
8148
  vendorType: {
6273
8149
  enum: Object.values(EnumVendorType),
@@ -6277,24 +8153,31 @@ var schema9 = new MongooseSchema13(
6277
8153
  },
6278
8154
  { timestamps: true }
6279
8155
  );
6280
- schema9.index({ name: 1 });
6281
- schema9.index({ description: 1 });
6282
- schema9.index({ region: 1 });
6283
- schema9.index({ "categories.name": 1 });
6284
- schema9.index({ slug: 1 });
6285
- var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema9);
8156
+ schema10.index({ name: 1 });
8157
+ schema10.index({ description: 1 });
8158
+ schema10.index({ region: 1 });
8159
+ schema10.index({ "categories.name": 1 });
8160
+ schema10.index({ slug: 1 });
8161
+ schema10.index({
8162
+ name: "text",
8163
+ description: "text",
8164
+ categoriesNames: "text"
8165
+ });
8166
+ schema10.index({ "owner.userId": 1, deletedAt: 1 });
8167
+ schema10.plugin(searchNamePlugin);
8168
+ var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
6286
8169
 
6287
8170
  // src/mongoose/vendor/VendorInfo.ts
6288
- var import_mongoose14 = __toESM(require("mongoose"));
6289
- var MongooseSchema14 = import_mongoose14.default.Schema;
6290
- var AttributesSchema = new MongooseSchema14(
8171
+ var import_mongoose15 = __toESM(require("mongoose"));
8172
+ var MongooseSchema15 = import_mongoose15.default.Schema;
8173
+ var AttributesSchema = new MongooseSchema15(
6291
8174
  {
6292
8175
  details: { required: false, type: String },
6293
8176
  isRequired: { default: false, required: true, type: Boolean }
6294
8177
  },
6295
8178
  { _id: false }
6296
8179
  );
6297
- var schema10 = new MongooseSchema14(
8180
+ var schema11 = new MongooseSchema15(
6298
8181
  {
6299
8182
  active: { default: true, type: Boolean },
6300
8183
  compliance: {
@@ -6329,28 +8212,29 @@ var schema10 = new MongooseSchema14(
6329
8212
  vendorId: {
6330
8213
  ref: "Vendor",
6331
8214
  required: true,
6332
- type: import_mongoose14.default.Schema.Types.ObjectId
8215
+ type: import_mongoose15.default.Schema.Types.ObjectId
6333
8216
  }
6334
8217
  },
6335
8218
  { timestamps: true }
6336
8219
  );
6337
- var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema10);
8220
+ schema11.index({ vendorId: 1 });
8221
+ var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
6338
8222
 
6339
8223
  // src/mongoose/vendor/UnregisteredVendor.ts
6340
- var import_mongoose15 = __toESM(require("mongoose"));
6341
- var MongooseSchema15 = import_mongoose15.default.Schema;
6342
- var invitationSchema = new MongooseSchema15(
8224
+ var import_mongoose16 = __toESM(require("mongoose"));
8225
+ var MongooseSchema16 = import_mongoose16.default.Schema;
8226
+ var invitationSchema = new MongooseSchema16(
6343
8227
  {
6344
8228
  dateTime: { required: true, type: [dateTimeSchema2] },
6345
8229
  inviterId: {
6346
8230
  ref: "Event",
6347
8231
  required: true,
6348
- type: import_mongoose15.default.Schema.Types.ObjectId
8232
+ type: import_mongoose16.default.Schema.Types.ObjectId
6349
8233
  }
6350
8234
  },
6351
8235
  { _id: false }
6352
8236
  );
6353
- var schema11 = new MongooseSchema15(
8237
+ var schema12 = new MongooseSchema16(
6354
8238
  {
6355
8239
  active: { default: true, required: true, type: Boolean },
6356
8240
  categoryIds: { required: true, type: [String] },
@@ -6359,7 +8243,7 @@ var schema11 = new MongooseSchema15(
6359
8243
  claimedByUserId: {
6360
8244
  ref: "User",
6361
8245
  required: false,
6362
- type: import_mongoose15.default.Schema.Types.ObjectId
8246
+ type: import_mongoose16.default.Schema.Types.ObjectId
6363
8247
  },
6364
8248
  claimInitiatedAt: { default: null, required: false, type: Date },
6365
8249
  claimToken: { default: null, required: false, type: String },
@@ -6372,14 +8256,14 @@ var schema11 = new MongooseSchema15(
6372
8256
  },
6373
8257
  { timestamps: true }
6374
8258
  );
6375
- schema11.index({ name: 1 });
6376
- schema11.index({ email: 1 });
6377
- var UnregisteredVendorModel = import_mongoose15.default.models.UnregisteredVendor || import_mongoose15.default.model("UnregisteredVendor", schema11);
8259
+ schema12.index({ name: 1 });
8260
+ schema12.index({ email: 1 });
8261
+ var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
6378
8262
 
6379
8263
  // src/mongoose/event/Event.ts
6380
- var import_mongoose16 = __toESM(require("mongoose"));
6381
- var MongooseSchema16 = import_mongoose16.default.Schema;
6382
- var schema12 = new MongooseSchema16(
8264
+ var import_mongoose17 = __toESM(require("mongoose"));
8265
+ var MongooseSchema17 = import_mongoose17.default.Schema;
8266
+ var schema13 = new MongooseSchema17(
6383
8267
  {
6384
8268
  ...baseResourceFields,
6385
8269
  // Importing base resource fields from global.ts
@@ -6388,7 +8272,7 @@ var schema12 = new MongooseSchema16(
6388
8272
  eventInfoId: {
6389
8273
  ref: "EventInfo",
6390
8274
  required: false,
6391
- type: import_mongoose16.default.Schema.Types.ObjectId
8275
+ type: import_mongoose17.default.Schema.Types.ObjectId
6392
8276
  },
6393
8277
  eventType: {
6394
8278
  enum: Object.values(EnumEventType),
@@ -6417,20 +8301,23 @@ var schema12 = new MongooseSchema16(
6417
8301
  },
6418
8302
  { timestamps: true }
6419
8303
  );
6420
- schema12.index({ name: 1 });
6421
- schema12.index({ description: 1 });
6422
- schema12.index({ region: 1 });
6423
- schema12.index({ "location.geo": "2dsphere" });
6424
- schema12.index({ tags: 1 });
6425
- schema12.index({ deletedAt: 1 });
6426
- schema12.index({ "dateTime.dateStatus": 1 });
6427
- schema12.index({ slug: 1 });
6428
- var EventModel = import_mongoose16.default.models.Event || import_mongoose16.default.model("Event", schema12);
8304
+ schema13.index({ name: 1 });
8305
+ schema13.index({ description: 1 });
8306
+ schema13.index({ region: 1 });
8307
+ schema13.index({ "location.geo": "2dsphere" });
8308
+ schema13.index({ tags: 1 });
8309
+ schema13.index({ deletedAt: 1 });
8310
+ schema13.index({ "dateTime.dateStatus": 1 });
8311
+ schema13.index({ slug: 1 });
8312
+ schema13.index({ name: "text", description: "text", tags: "text" });
8313
+ schema13.index({ "owner.userId": 1, deletedAt: 1 });
8314
+ schema13.plugin(searchNamePlugin);
8315
+ var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
6429
8316
 
6430
8317
  // src/mongoose/Partner.ts
6431
- var import_mongoose17 = __toESM(require("mongoose"));
6432
- var MongooseSchema17 = import_mongoose17.default.Schema;
6433
- var schema13 = new MongooseSchema17(
8318
+ var import_mongoose18 = __toESM(require("mongoose"));
8319
+ var MongooseSchema18 = import_mongoose18.default.Schema;
8320
+ var schema14 = new MongooseSchema18(
6434
8321
  {
6435
8322
  ...baseResourceFields,
6436
8323
  location: {
@@ -6446,19 +8333,22 @@ var schema13 = new MongooseSchema17(
6446
8333
  },
6447
8334
  { timestamps: true }
6448
8335
  );
6449
- schema13.index({ name: 1 });
6450
- schema13.index({ description: 1 });
6451
- schema13.index({ region: 1 });
6452
- schema13.index({ "location.geo": "2dsphere" });
6453
- schema13.index({ slug: 1 });
6454
- var PartnerModel = import_mongoose17.default.models.Partner || import_mongoose17.default.model("Partner", schema13);
8336
+ schema14.index({ name: 1 });
8337
+ schema14.index({ description: 1 });
8338
+ schema14.index({ region: 1 });
8339
+ schema14.index({ "location.geo": "2dsphere" });
8340
+ schema14.index({ slug: 1 });
8341
+ schema14.index({ name: "text", description: "text" });
8342
+ schema14.index({ "owner.userId": 1, deletedAt: 1 });
8343
+ schema14.plugin(searchNamePlugin);
8344
+ var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
6455
8345
 
6456
8346
  // src/mongoose/Post.ts
6457
- var import_mongoose18 = __toESM(require("mongoose"));
6458
- var MongooseSchema18 = import_mongoose18.default.Schema;
6459
- var contentSchema = new MongooseSchema18(
8347
+ var import_mongoose19 = __toESM(require("mongoose"));
8348
+ var MongooseSchema19 = import_mongoose19.default.Schema;
8349
+ var contentSchema = new MongooseSchema19(
6460
8350
  {
6461
- contentData: import_mongoose18.Schema.Types.Mixed,
8351
+ contentData: import_mongoose19.Schema.Types.Mixed,
6462
8352
  contentOrder: { required: true, type: Number },
6463
8353
  contentType: {
6464
8354
  enum: Object.values(EnumPostContentType),
@@ -6468,7 +8358,7 @@ var contentSchema = new MongooseSchema18(
6468
8358
  },
6469
8359
  { _id: false }
6470
8360
  );
6471
- var resourceSchema = new MongooseSchema18(
8361
+ var resourceSchema = new MongooseSchema19(
6472
8362
  {
6473
8363
  resourceId: { required: true, type: String },
6474
8364
  resourceRegion: { required: true, type: String },
@@ -6481,7 +8371,7 @@ var resourceSchema = new MongooseSchema18(
6481
8371
  },
6482
8372
  { _id: false }
6483
8373
  );
6484
- var schema14 = new MongooseSchema18(
8374
+ var schema15 = new MongooseSchema19(
6485
8375
  {
6486
8376
  active: { default: false, required: true, type: Boolean },
6487
8377
  approvedAt: { default: null, required: false, type: Date },
@@ -6512,16 +8402,16 @@ var schema14 = new MongooseSchema18(
6512
8402
  },
6513
8403
  { timestamps: true }
6514
8404
  );
6515
- schema14.index({ title: 1 });
6516
- schema14.index({ tags: 1 });
6517
- schema14.index({ postType: 1, slug: 1 }, { unique: true });
6518
- var PostModel = import_mongoose18.default.models.Post || import_mongoose18.default.model("Post", schema14);
8405
+ schema15.index({ title: 1 });
8406
+ schema15.index({ tags: 1 });
8407
+ schema15.index({ postType: 1, slug: 1 }, { unique: true });
8408
+ var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
6519
8409
 
6520
8410
  // src/mongoose/AppSetting.ts
6521
- var import_mongoose19 = __toESM(require("mongoose"));
6522
- var MongooseSchema19 = import_mongoose19.default.Schema;
8411
+ var import_mongoose20 = __toESM(require("mongoose"));
8412
+ var MongooseSchema20 = import_mongoose20.default.Schema;
6523
8413
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
6524
- var AppSettingSchema = new MongooseSchema19(
8414
+ var AppSettingSchema = new MongooseSchema20(
6525
8415
  {
6526
8416
  activeSchoolsStudentCountTotal: {
6527
8417
  default: 0,
@@ -6552,18 +8442,18 @@ var AppSettingSchema = new MongooseSchema19(
6552
8442
  },
6553
8443
  { timestamps: true }
6554
8444
  );
6555
- var AppSettingModel = import_mongoose19.default.models.AppSetting || import_mongoose19.default.model("AppSetting", AppSettingSchema);
8445
+ var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
6556
8446
 
6557
8447
  // src/mongoose/game/Game.ts
6558
- var import_mongoose23 = __toESM(require("mongoose"));
8448
+ var import_mongoose24 = __toESM(require("mongoose"));
6559
8449
 
6560
8450
  // src/mongoose/game/DailyClue.ts
6561
- var import_mongoose21 = __toESM(require("mongoose"));
8451
+ var import_mongoose22 = __toESM(require("mongoose"));
6562
8452
 
6563
8453
  // src/mongoose/game/utils.ts
6564
- var import_mongoose20 = __toESM(require("mongoose"));
6565
- var MongooseSchema20 = import_mongoose20.default.Schema;
6566
- var schemaGameDate = new MongooseSchema20(
8454
+ var import_mongoose21 = __toESM(require("mongoose"));
8455
+ var MongooseSchema21 = import_mongoose21.default.Schema;
8456
+ var schemaGameDate = new MongooseSchema21(
6567
8457
  {
6568
8458
  endDate: { required: true, type: Date },
6569
8459
  startDate: { required: true, type: Date }
@@ -6572,8 +8462,8 @@ var schemaGameDate = new MongooseSchema20(
6572
8462
  );
6573
8463
 
6574
8464
  // src/mongoose/game/DailyClue.ts
6575
- var MongooseSchema21 = import_mongoose21.default.Schema;
6576
- var schemaLetters = new MongooseSchema21(
8465
+ var MongooseSchema22 = import_mongoose22.default.Schema;
8466
+ var schemaLetters = new MongooseSchema22(
6577
8467
  {
6578
8468
  collected: { required: false, type: [String] },
6579
8469
  solutionShuffled: { required: true, type: [String] }
@@ -6581,14 +8471,14 @@ var schemaLetters = new MongooseSchema21(
6581
8471
  },
6582
8472
  { _id: false }
6583
8473
  );
6584
- var schemaDailyClueBaseGame = new MongooseSchema21(
8474
+ var schemaDailyClueBaseGame = new MongooseSchema22(
6585
8475
  {
6586
8476
  gameDate: { required: true, type: schemaGameDate },
6587
8477
  gameSolution: { required: true, type: String }
6588
8478
  },
6589
8479
  { _id: false }
6590
8480
  );
6591
- var schemaDailyClueGameData = new MongooseSchema21(
8481
+ var schemaDailyClueGameData = new MongooseSchema22(
6592
8482
  {
6593
8483
  gameFields: { required: true, type: schemaDailyClueBaseGame },
6594
8484
  lastFoundDate: { default: null, required: false, type: Date },
@@ -6603,9 +8493,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
6603
8493
  );
6604
8494
 
6605
8495
  // src/mongoose/game/PuzzleGame.ts
6606
- var import_mongoose22 = __toESM(require("mongoose"));
6607
- var MongooseSchema22 = import_mongoose22.default.Schema;
6608
- var schemaPuzzleAnswer = new MongooseSchema22(
8496
+ var import_mongoose23 = __toESM(require("mongoose"));
8497
+ var MongooseSchema23 = import_mongoose23.default.Schema;
8498
+ var schemaPuzzleAnswer = new MongooseSchema23(
6609
8499
  {
6610
8500
  answer: { required: true, type: String },
6611
8501
  answerId: { required: true, type: String },
@@ -6613,7 +8503,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
6613
8503
  },
6614
8504
  { _id: false }
6615
8505
  );
6616
- var schemaPuzzleQuestion = new MongooseSchema22(
8506
+ var schemaPuzzleQuestion = new MongooseSchema23(
6617
8507
  {
6618
8508
  answers: { required: true, type: [schemaPuzzleAnswer] },
6619
8509
  question: { required: true, type: String },
@@ -6621,20 +8511,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
6621
8511
  },
6622
8512
  { _id: false }
6623
8513
  );
6624
- var schemaPuzzleBaseGame = new MongooseSchema22(
8514
+ var schemaPuzzleBaseGame = new MongooseSchema23(
6625
8515
  {
6626
8516
  questions: { required: true, type: [schemaPuzzleQuestion] }
6627
8517
  },
6628
8518
  { _id: false }
6629
8519
  );
6630
- var schemaPuzzleAnsweredQuestion = new MongooseSchema22(
8520
+ var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
6631
8521
  {
6632
8522
  questionId: { required: true, type: String },
6633
8523
  selectedAnswerId: { required: true, type: String }
6634
8524
  },
6635
8525
  { _id: false }
6636
8526
  );
6637
- var schemaPuzzleGameData = new MongooseSchema22(
8527
+ var schemaPuzzleGameData = new MongooseSchema23(
6638
8528
  {
6639
8529
  answeredQuestions: {
6640
8530
  default: null,
@@ -6649,19 +8539,19 @@ var schemaPuzzleGameData = new MongooseSchema22(
6649
8539
  );
6650
8540
 
6651
8541
  // src/mongoose/game/Game.ts
6652
- var MongooseSchema23 = import_mongoose23.default.Schema;
8542
+ var MongooseSchema24 = import_mongoose24.default.Schema;
6653
8543
  var gameDataSchemas = {
6654
8544
  [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
6655
8545
  [EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
6656
8546
  [EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
6657
8547
  };
6658
8548
  var gameDataDefinition = Object.fromEntries(
6659
- Object.entries(gameDataSchemas).map(([key, schema19]) => [
8549
+ Object.entries(gameDataSchemas).map(([key, schema20]) => [
6660
8550
  key,
6661
- { default: null, required: false, type: schema19 }
8551
+ { default: null, required: false, type: schema20 }
6662
8552
  ])
6663
8553
  );
6664
- var gameHistorySchema = new MongooseSchema23(
8554
+ var gameHistorySchema = new MongooseSchema24(
6665
8555
  {
6666
8556
  createdAt: { required: true, type: Date },
6667
8557
  gameDate: { required: true, type: schemaGameDate },
@@ -6681,7 +8571,7 @@ var gameHistorySchema = new MongooseSchema23(
6681
8571
  },
6682
8572
  { _id: false }
6683
8573
  );
6684
- var gameTypeSchema = new MongooseSchema23(
8574
+ var gameTypeSchema = new MongooseSchema24(
6685
8575
  {
6686
8576
  active: { default: true, required: true, type: Boolean },
6687
8577
  gameData: gameDataDefinition,
@@ -6696,7 +8586,7 @@ var gameTypeSchema = new MongooseSchema23(
6696
8586
  },
6697
8587
  { timestamps: true }
6698
8588
  );
6699
- var schema15 = new MongooseSchema23(
8589
+ var schema16 = new MongooseSchema24(
6700
8590
  {
6701
8591
  active: { default: false, required: true, type: Boolean },
6702
8592
  deletedAt: { default: null, required: false, type: Date },
@@ -6709,12 +8599,12 @@ var schema15 = new MongooseSchema23(
6709
8599
  },
6710
8600
  { timestamps: true }
6711
8601
  );
6712
- var GameModel = import_mongoose23.default.models.Game || import_mongoose23.default.model("Game", schema15);
8602
+ var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
6713
8603
 
6714
8604
  // src/mongoose/School.ts
6715
- var import_mongoose24 = __toESM(require("mongoose"));
6716
- var MongooseSchema24 = import_mongoose24.default.Schema;
6717
- var campaignsSchema = new MongooseSchema24(
8605
+ var import_mongoose25 = __toESM(require("mongoose"));
8606
+ var MongooseSchema25 = import_mongoose25.default.Schema;
8607
+ var campaignsSchema = new MongooseSchema25(
6718
8608
  {
6719
8609
  endDate: { required: true, type: Date },
6720
8610
  name: { required: true, type: String },
@@ -6722,7 +8612,7 @@ var campaignsSchema = new MongooseSchema24(
6722
8612
  },
6723
8613
  { _id: false }
6724
8614
  );
6725
- var schema16 = new MongooseSchema24(
8615
+ var schema17 = new MongooseSchema25(
6726
8616
  {
6727
8617
  // New schools are active by default
6728
8618
  active: { default: false, required: true, type: Boolean },
@@ -6749,19 +8639,19 @@ var schema16 = new MongooseSchema24(
6749
8639
  },
6750
8640
  { timestamps: true }
6751
8641
  );
6752
- schema16.index(
8642
+ schema17.index(
6753
8643
  { schoolCode: 1 },
6754
8644
  {
6755
8645
  partialFilterExpression: { active: true, deletedAt: null },
6756
8646
  unique: true
6757
8647
  }
6758
8648
  );
6759
- var SchoolModel = import_mongoose24.default.models.School || import_mongoose24.default.model("School", schema16);
8649
+ var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
6760
8650
 
6761
8651
  // src/mongoose/Affiliate.ts
6762
- var import_mongoose25 = __toESM(require("mongoose"));
6763
- var MongooseSchema25 = import_mongoose25.default.Schema;
6764
- var affiliateRewardSchema = new MongooseSchema25(
8652
+ var import_mongoose26 = __toESM(require("mongoose"));
8653
+ var MongooseSchema26 = import_mongoose26.default.Schema;
8654
+ var affiliateRewardSchema = new MongooseSchema26(
6765
8655
  {
6766
8656
  createdAt: { required: true, type: Date },
6767
8657
  redeemedAt: { default: null, required: false, type: Date },
@@ -6775,13 +8665,13 @@ var affiliateRewardSchema = new MongooseSchema25(
6775
8665
  },
6776
8666
  { _id: false }
6777
8667
  );
6778
- var affiliateResourceSchema = new MongooseSchema25(
8668
+ var affiliateResourceSchema = new MongooseSchema26(
6779
8669
  {
6780
8670
  resourceActive: { default: true, required: true, type: Boolean },
6781
8671
  resourceDeletedAt: { default: null, required: false, type: Date },
6782
8672
  resourceId: {
6783
8673
  required: true,
6784
- type: import_mongoose25.default.Schema.Types.ObjectId
8674
+ type: import_mongoose26.default.Schema.Types.ObjectId
6785
8675
  },
6786
8676
  resourceName: { required: true, type: String },
6787
8677
  resourceOwner: {
@@ -6801,20 +8691,20 @@ var affiliateResourceSchema = new MongooseSchema25(
6801
8691
  },
6802
8692
  { _id: false }
6803
8693
  );
6804
- var affiliateContactDetailsSchema = new MongooseSchema25(
8694
+ var affiliateContactDetailsSchema = new MongooseSchema26(
6805
8695
  {
6806
8696
  mobilePhone: { required: true, type: String }
6807
8697
  },
6808
8698
  { _id: false }
6809
8699
  );
6810
- var affiliateBankAccountDetailsSchema = new MongooseSchema25(
8700
+ var affiliateBankAccountDetailsSchema = new MongooseSchema26(
6811
8701
  {
6812
8702
  accountHolderName: { required: true, type: String },
6813
8703
  accountNumber: { required: true, type: String }
6814
8704
  },
6815
8705
  { _id: false }
6816
8706
  );
6817
- var affiliateDetailsSchema = new MongooseSchema25(
8707
+ var affiliateDetailsSchema = new MongooseSchema26(
6818
8708
  {
6819
8709
  bankAccountDetails: {
6820
8710
  required: true,
@@ -6836,7 +8726,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
6836
8726
  },
6837
8727
  { _id: false }
6838
8728
  );
6839
- var redeemHistorySchema = new MongooseSchema25(
8729
+ var redeemHistorySchema = new MongooseSchema26(
6840
8730
  {
6841
8731
  paidAt: { default: null, required: false, type: Date },
6842
8732
  redeemedAt: { required: true, type: Date },
@@ -6844,7 +8734,7 @@ var redeemHistorySchema = new MongooseSchema25(
6844
8734
  },
6845
8735
  { _id: false }
6846
8736
  );
6847
- var schema17 = new MongooseSchema25(
8737
+ var schema18 = new MongooseSchema26(
6848
8738
  {
6849
8739
  active: { default: false, required: true, type: Boolean },
6850
8740
  affiliateBonusRewards: {
@@ -6874,19 +8764,19 @@ var schema17 = new MongooseSchema25(
6874
8764
  },
6875
8765
  { timestamps: true }
6876
8766
  );
6877
- schema17.index(
8767
+ schema18.index(
6878
8768
  { affiliateCode: 1 },
6879
8769
  {
6880
8770
  partialFilterExpression: { active: true, deletedAt: null },
6881
8771
  unique: true
6882
8772
  }
6883
8773
  );
6884
- var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoose25.default.model("Affiliate", schema17);
8774
+ var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
6885
8775
 
6886
8776
  // src/mongoose/Coupon.ts
6887
- var import_mongoose26 = __toESM(require("mongoose"));
6888
- var MongooseSchema26 = import_mongoose26.default.Schema;
6889
- var couponOptionSchema = new MongooseSchema26(
8777
+ var import_mongoose27 = __toESM(require("mongoose"));
8778
+ var MongooseSchema27 = import_mongoose27.default.Schema;
8779
+ var couponOptionSchema = new MongooseSchema27(
6890
8780
  {
6891
8781
  buy: { required: false, type: Number },
6892
8782
  get: { required: false, type: Number },
@@ -6901,29 +8791,29 @@ var couponOptionSchema = new MongooseSchema26(
6901
8791
  },
6902
8792
  { _id: false }
6903
8793
  );
6904
- var couponVendorProductSchema = new MongooseSchema26(
8794
+ var couponVendorProductSchema = new MongooseSchema27(
6905
8795
  {
6906
8796
  couponId: {
6907
8797
  required: true,
6908
- type: import_mongoose26.default.Schema.Types.ObjectId
8798
+ type: import_mongoose27.default.Schema.Types.ObjectId
6909
8799
  },
6910
8800
  productId: {
6911
8801
  required: true,
6912
- type: import_mongoose26.default.Schema.Types.ObjectId
8802
+ type: import_mongoose27.default.Schema.Types.ObjectId
6913
8803
  },
6914
8804
  vendorCouponId: {
6915
8805
  required: false,
6916
- type: import_mongoose26.default.Schema.Types.ObjectId
8806
+ type: import_mongoose27.default.Schema.Types.ObjectId
6917
8807
  },
6918
8808
  vendorId: {
6919
8809
  ref: "Vendor",
6920
8810
  required: true,
6921
- type: import_mongoose26.default.Schema.Types.ObjectId
8811
+ type: import_mongoose27.default.Schema.Types.ObjectId
6922
8812
  }
6923
8813
  },
6924
8814
  { _id: false }
6925
8815
  );
6926
- var couponCodeSchema = new MongooseSchema26(
8816
+ var couponCodeSchema = new MongooseSchema27(
6927
8817
  {
6928
8818
  code: { required: true, type: String },
6929
8819
  qrCode: { required: true, type: ResourceImageTypeSchema },
@@ -6931,7 +8821,7 @@ var couponCodeSchema = new MongooseSchema26(
6931
8821
  },
6932
8822
  { _id: false }
6933
8823
  );
6934
- var couponParticipantUserSchema = new MongooseSchema26(
8824
+ var couponParticipantUserSchema = new MongooseSchema27(
6935
8825
  {
6936
8826
  couponCollectedCount: { default: 0, required: true, type: Number },
6937
8827
  couponCycleRedeemed: { default: false, required: true, type: Boolean },
@@ -6940,12 +8830,12 @@ var couponParticipantUserSchema = new MongooseSchema26(
6940
8830
  userId: {
6941
8831
  ref: "User",
6942
8832
  required: true,
6943
- type: import_mongoose26.default.Schema.Types.ObjectId
8833
+ type: import_mongoose27.default.Schema.Types.ObjectId
6944
8834
  }
6945
8835
  },
6946
8836
  { timestamps: true }
6947
8837
  );
6948
- var couponDataSchema = new MongooseSchema26(
8838
+ var couponDataSchema = new MongooseSchema27(
6949
8839
  {
6950
8840
  active: { default: true, required: true, type: Boolean },
6951
8841
  couponCode: { required: false, type: couponCodeSchema },
@@ -6972,7 +8862,7 @@ var couponDataSchema = new MongooseSchema26(
6972
8862
  },
6973
8863
  { timestamps: true }
6974
8864
  );
6975
- var schema18 = new MongooseSchema26(
8865
+ var schema19 = new MongooseSchema27(
6976
8866
  {
6977
8867
  active: { default: true, required: true, type: Boolean },
6978
8868
  couponData: { default: [], required: false, type: [couponDataSchema] },
@@ -6984,13 +8874,17 @@ var schema18 = new MongooseSchema26(
6984
8874
  },
6985
8875
  { timestamps: true }
6986
8876
  );
6987
- var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
8877
+ schema19.index({ active: 1, deletedAt: 1, "owner.userId": 1 });
8878
+ schema19.index({ "couponData.participantUsers.userId": 1 });
8879
+ var CouponModel = import_mongoose27.default.models.Coupon || import_mongoose27.default.model("Coupon", schema19);
6988
8880
  // Annotate the CommonJS export names for ESM import in node:
6989
8881
  0 && (module.exports = {
6990
8882
  APP_SETTINGS_ID,
6991
8883
  AdModel,
6992
8884
  AffiliateModel,
6993
8885
  AppSettingModel,
8886
+ BILLING_CATALOG_COLLECTION_NAME,
8887
+ BillingCatalogModel,
6994
8888
  CategorySchema,
6995
8889
  ChatModel,
6996
8890
  ChatReportModel,
@@ -7018,7 +8912,9 @@ var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.d
7018
8912
  VendorModel,
7019
8913
  VerificationTokenModel,
7020
8914
  baseResourceFields,
8915
+ buildInitialBillingCatalogEntries,
7021
8916
  dateTimeSchema,
8917
+ getBillingCatalogDefinition,
7022
8918
  locationGeoSchema,
7023
8919
  locationsSchema,
7024
8920
  refundPolicySchema,
@@ -7030,4 +8926,28 @@ var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.d
7030
8926
  userLicenseSchema,
7031
8927
  vendorProductTypeSchema
7032
8928
  });
8929
+ /*! Bundled license information:
8930
+
8931
+ react/cjs/react.production.js:
8932
+ (**
8933
+ * @license React
8934
+ * react.production.js
8935
+ *
8936
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8937
+ *
8938
+ * This source code is licensed under the MIT license found in the
8939
+ * LICENSE file in the root directory of this source tree.
8940
+ *)
8941
+
8942
+ react/cjs/react.development.js:
8943
+ (**
8944
+ * @license React
8945
+ * react.development.js
8946
+ *
8947
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8948
+ *
8949
+ * This source code is licensed under the MIT license found in the
8950
+ * LICENSE file in the root directory of this source tree.
8951
+ *)
8952
+ */
7033
8953
  //# sourceMappingURL=index.cjs.map