tevrocsdk 0.1.16 → 0.1.18

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.
package/tevroc-sdk.esm.js CHANGED
@@ -1,9 +1,5 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
3
  var __esm = (fn, res, err) => function __init() {
8
4
  if (err) throw err[0];
9
5
  try {
@@ -12,1017 +8,10 @@ var __esm = (fn, res, err) => function __init() {
12
8
  throw err = [e], e;
13
9
  }
14
10
  };
15
- var __commonJS = (cb, mod) => function __require() {
16
- try {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
- } catch (e) {
19
- throw mod = 0, e;
20
- }
21
- };
22
11
  var __export = (target, all) => {
23
12
  for (var name in all)
24
13
  __defProp(target, name, { get: all[name], enumerable: true });
25
14
  };
26
- var __copyProps = (to, from, except, desc) => {
27
- if (from && typeof from === "object" || typeof from === "function") {
28
- for (let key of __getOwnPropNames(from))
29
- if (!__hasOwnProp.call(to, key) && key !== except)
30
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
- }
32
- return to;
33
- };
34
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
- // If the importer is in node compatibility mode or this is not an ESM
36
- // file that has been converted to a CommonJS file using a Babel-
37
- // compatible transform (i.e. "__esModule" has not been set), then set
38
- // "default" to the CommonJS "module.exports" for node compatibility.
39
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
- mod
41
- ));
42
-
43
- // node_modules/react/cjs/react.development.js
44
- var require_react_development = __commonJS({
45
- "node_modules/react/cjs/react.development.js"(exports, module) {
46
- "use strict";
47
- (function() {
48
- function defineDeprecationWarning(methodName, info) {
49
- Object.defineProperty(Component.prototype, methodName, {
50
- get: function() {
51
- console.warn(
52
- "%s(...) is deprecated in plain JavaScript React classes. %s",
53
- info[0],
54
- info[1]
55
- );
56
- }
57
- });
58
- }
59
- function getIteratorFn(maybeIterable) {
60
- if (null === maybeIterable || "object" !== typeof maybeIterable)
61
- return null;
62
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
63
- return "function" === typeof maybeIterable ? maybeIterable : null;
64
- }
65
- function warnNoop(publicInstance, callerName) {
66
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
67
- var warningKey = publicInstance + "." + callerName;
68
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
69
- "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.",
70
- callerName,
71
- publicInstance
72
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
73
- }
74
- function Component(props, context, updater) {
75
- this.props = props;
76
- this.context = context;
77
- this.refs = emptyObject;
78
- this.updater = updater || ReactNoopUpdateQueue;
79
- }
80
- function ComponentDummy() {
81
- }
82
- function PureComponent(props, context, updater) {
83
- this.props = props;
84
- this.context = context;
85
- this.refs = emptyObject;
86
- this.updater = updater || ReactNoopUpdateQueue;
87
- }
88
- function noop() {
89
- }
90
- function testStringCoercion(value) {
91
- return "" + value;
92
- }
93
- function checkKeyStringCoercion(value) {
94
- try {
95
- testStringCoercion(value);
96
- var JSCompiler_inline_result = false;
97
- } catch (e) {
98
- JSCompiler_inline_result = true;
99
- }
100
- if (JSCompiler_inline_result) {
101
- JSCompiler_inline_result = console;
102
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
103
- var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
104
- JSCompiler_temp_const.call(
105
- JSCompiler_inline_result,
106
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- JSCompiler_inline_result$jscomp$0
108
- );
109
- return testStringCoercion(value);
110
- }
111
- }
112
- function getComponentNameFromType(type) {
113
- if (null == type) return null;
114
- if ("function" === typeof type)
115
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
116
- if ("string" === typeof type) return type;
117
- switch (type) {
118
- case REACT_FRAGMENT_TYPE:
119
- return "Fragment";
120
- case REACT_PROFILER_TYPE:
121
- return "Profiler";
122
- case REACT_STRICT_MODE_TYPE:
123
- return "StrictMode";
124
- case REACT_SUSPENSE_TYPE:
125
- return "Suspense";
126
- case REACT_SUSPENSE_LIST_TYPE:
127
- return "SuspenseList";
128
- case REACT_ACTIVITY_TYPE:
129
- return "Activity";
130
- }
131
- if ("object" === typeof type)
132
- switch ("number" === typeof type.tag && console.error(
133
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
134
- ), type.$$typeof) {
135
- case REACT_PORTAL_TYPE:
136
- return "Portal";
137
- case REACT_CONTEXT_TYPE:
138
- return type.displayName || "Context";
139
- case REACT_CONSUMER_TYPE:
140
- return (type._context.displayName || "Context") + ".Consumer";
141
- case REACT_FORWARD_REF_TYPE:
142
- var innerType = type.render;
143
- type = type.displayName;
144
- type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
145
- return type;
146
- case REACT_MEMO_TYPE:
147
- return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
148
- case REACT_LAZY_TYPE:
149
- innerType = type._payload;
150
- type = type._init;
151
- try {
152
- return getComponentNameFromType(type(innerType));
153
- } catch (x) {
154
- }
155
- }
156
- return null;
157
- }
158
- function getTaskName(type) {
159
- if (type === REACT_FRAGMENT_TYPE) return "<>";
160
- if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
161
- return "<...>";
162
- try {
163
- var name = getComponentNameFromType(type);
164
- return name ? "<" + name + ">" : "<...>";
165
- } catch (x) {
166
- return "<...>";
167
- }
168
- }
169
- function getOwner() {
170
- var dispatcher = ReactSharedInternals.A;
171
- return null === dispatcher ? null : dispatcher.getOwner();
172
- }
173
- function UnknownOwner() {
174
- return Error("react-stack-top-frame");
175
- }
176
- function hasValidKey(config) {
177
- if (hasOwnProperty.call(config, "key")) {
178
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
179
- if (getter && getter.isReactWarning) return false;
180
- }
181
- return void 0 !== config.key;
182
- }
183
- function defineKeyPropWarningGetter(props, displayName) {
184
- function warnAboutAccessingKey() {
185
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
186
- "%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)",
187
- displayName
188
- ));
189
- }
190
- warnAboutAccessingKey.isReactWarning = true;
191
- Object.defineProperty(props, "key", {
192
- get: warnAboutAccessingKey,
193
- configurable: true
194
- });
195
- }
196
- function elementRefGetterWithDeprecationWarning() {
197
- var componentName = getComponentNameFromType(this.type);
198
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
199
- "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."
200
- ));
201
- componentName = this.props.ref;
202
- return void 0 !== componentName ? componentName : null;
203
- }
204
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
205
- var refProp = props.ref;
206
- type = {
207
- $$typeof: REACT_ELEMENT_TYPE,
208
- type,
209
- key,
210
- props,
211
- _owner: owner
212
- };
213
- null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
214
- enumerable: false,
215
- get: elementRefGetterWithDeprecationWarning
216
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
217
- type._store = {};
218
- Object.defineProperty(type._store, "validated", {
219
- configurable: false,
220
- enumerable: false,
221
- writable: true,
222
- value: 0
223
- });
224
- Object.defineProperty(type, "_debugInfo", {
225
- configurable: false,
226
- enumerable: false,
227
- writable: true,
228
- value: null
229
- });
230
- Object.defineProperty(type, "_debugStack", {
231
- configurable: false,
232
- enumerable: false,
233
- writable: true,
234
- value: debugStack
235
- });
236
- Object.defineProperty(type, "_debugTask", {
237
- configurable: false,
238
- enumerable: false,
239
- writable: true,
240
- value: debugTask
241
- });
242
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
243
- return type;
244
- }
245
- function cloneAndReplaceKey(oldElement, newKey) {
246
- newKey = ReactElement(
247
- oldElement.type,
248
- newKey,
249
- oldElement.props,
250
- oldElement._owner,
251
- oldElement._debugStack,
252
- oldElement._debugTask
253
- );
254
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
255
- return newKey;
256
- }
257
- function validateChildKeys(node) {
258
- 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));
259
- }
260
- function isValidElement(object) {
261
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
262
- }
263
- function escape2(key) {
264
- var escaperLookup = { "=": "=0", ":": "=2" };
265
- return "$" + key.replace(/[=:]/g, function(match) {
266
- return escaperLookup[match];
267
- });
268
- }
269
- function getElementKey(element, index) {
270
- return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape2("" + element.key)) : index.toString(36);
271
- }
272
- function resolveThenable(thenable) {
273
- switch (thenable.status) {
274
- case "fulfilled":
275
- return thenable.value;
276
- case "rejected":
277
- throw thenable.reason;
278
- default:
279
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
280
- function(fulfilledValue) {
281
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
282
- },
283
- function(error) {
284
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
285
- }
286
- )), thenable.status) {
287
- case "fulfilled":
288
- return thenable.value;
289
- case "rejected":
290
- throw thenable.reason;
291
- }
292
- }
293
- throw thenable;
294
- }
295
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
296
- var type = typeof children;
297
- if ("undefined" === type || "boolean" === type) children = null;
298
- var invokeCallback = false;
299
- if (null === children) invokeCallback = true;
300
- else
301
- switch (type) {
302
- case "bigint":
303
- case "string":
304
- case "number":
305
- invokeCallback = true;
306
- break;
307
- case "object":
308
- switch (children.$$typeof) {
309
- case REACT_ELEMENT_TYPE:
310
- case REACT_PORTAL_TYPE:
311
- invokeCallback = true;
312
- break;
313
- case REACT_LAZY_TYPE:
314
- return invokeCallback = children._init, mapIntoArray(
315
- invokeCallback(children._payload),
316
- array,
317
- escapedPrefix,
318
- nameSoFar,
319
- callback
320
- );
321
- }
322
- }
323
- if (invokeCallback) {
324
- invokeCallback = children;
325
- callback = callback(invokeCallback);
326
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
327
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
328
- return c;
329
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
330
- callback,
331
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
332
- userProvidedKeyEscapeRegex,
333
- "$&/"
334
- ) + "/") + childKey
335
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
336
- return 1;
337
- }
338
- invokeCallback = 0;
339
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
340
- if (isArrayImpl(children))
341
- for (var i = 0; i < children.length; i++)
342
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
343
- nameSoFar,
344
- array,
345
- escapedPrefix,
346
- type,
347
- callback
348
- );
349
- else if (i = getIteratorFn(children), "function" === typeof i)
350
- for (i === children.entries && (didWarnAboutMaps || console.warn(
351
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
352
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
353
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
354
- nameSoFar,
355
- array,
356
- escapedPrefix,
357
- type,
358
- callback
359
- );
360
- else if ("object" === type) {
361
- if ("function" === typeof children.then)
362
- return mapIntoArray(
363
- resolveThenable(children),
364
- array,
365
- escapedPrefix,
366
- nameSoFar,
367
- callback
368
- );
369
- array = String(children);
370
- throw Error(
371
- "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."
372
- );
373
- }
374
- return invokeCallback;
375
- }
376
- function mapChildren(children, func, context) {
377
- if (null == children) return children;
378
- var result = [], count = 0;
379
- mapIntoArray(children, result, "", "", function(child) {
380
- return func.call(context, child, count++);
381
- });
382
- return result;
383
- }
384
- function lazyInitializer(payload) {
385
- if (-1 === payload._status) {
386
- var ioInfo = payload._ioInfo;
387
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
388
- ioInfo = payload._result;
389
- var thenable = ioInfo();
390
- thenable.then(
391
- function(moduleObject) {
392
- if (0 === payload._status || -1 === payload._status) {
393
- payload._status = 1;
394
- payload._result = moduleObject;
395
- var _ioInfo = payload._ioInfo;
396
- null != _ioInfo && (_ioInfo.end = performance.now());
397
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
398
- }
399
- },
400
- function(error) {
401
- if (0 === payload._status || -1 === payload._status) {
402
- payload._status = 2;
403
- payload._result = error;
404
- var _ioInfo2 = payload._ioInfo;
405
- null != _ioInfo2 && (_ioInfo2.end = performance.now());
406
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
407
- }
408
- }
409
- );
410
- ioInfo = payload._ioInfo;
411
- if (null != ioInfo) {
412
- ioInfo.value = thenable;
413
- var displayName = thenable.displayName;
414
- "string" === typeof displayName && (ioInfo.name = displayName);
415
- }
416
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
417
- }
418
- if (1 === payload._status)
419
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
420
- "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?",
421
- ioInfo
422
- ), "default" in ioInfo || console.error(
423
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
424
- ioInfo
425
- ), ioInfo.default;
426
- throw payload._result;
427
- }
428
- function resolveDispatcher() {
429
- var dispatcher = ReactSharedInternals.H;
430
- null === dispatcher && console.error(
431
- "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."
432
- );
433
- return dispatcher;
434
- }
435
- function releaseAsyncTransition() {
436
- ReactSharedInternals.asyncTransitions--;
437
- }
438
- function enqueueTask(task) {
439
- if (null === enqueueTaskImpl)
440
- try {
441
- var requireString = ("require" + Math.random()).slice(0, 7);
442
- enqueueTaskImpl = (module && module[requireString]).call(
443
- module,
444
- "timers"
445
- ).setImmediate;
446
- } catch (_err) {
447
- enqueueTaskImpl = function(callback) {
448
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
449
- "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."
450
- ));
451
- var channel = new MessageChannel();
452
- channel.port1.onmessage = callback;
453
- channel.port2.postMessage(void 0);
454
- };
455
- }
456
- return enqueueTaskImpl(task);
457
- }
458
- function aggregateErrors(errors) {
459
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
460
- }
461
- function popActScope(prevActQueue, prevActScopeDepth) {
462
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
463
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
464
- );
465
- actScopeDepth = prevActScopeDepth;
466
- }
467
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
468
- var queue = ReactSharedInternals.actQueue;
469
- if (null !== queue)
470
- if (0 !== queue.length)
471
- try {
472
- flushActQueue(queue);
473
- enqueueTask(function() {
474
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
475
- });
476
- return;
477
- } catch (error) {
478
- ReactSharedInternals.thrownErrors.push(error);
479
- }
480
- else ReactSharedInternals.actQueue = null;
481
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
482
- }
483
- function flushActQueue(queue) {
484
- if (!isFlushing) {
485
- isFlushing = true;
486
- var i = 0;
487
- try {
488
- for (; i < queue.length; i++) {
489
- var callback = queue[i];
490
- do {
491
- ReactSharedInternals.didUsePromise = false;
492
- var continuation = callback(false);
493
- if (null !== continuation) {
494
- if (ReactSharedInternals.didUsePromise) {
495
- queue[i] = callback;
496
- queue.splice(0, i);
497
- return;
498
- }
499
- callback = continuation;
500
- } else break;
501
- } while (1);
502
- }
503
- queue.length = 0;
504
- } catch (error) {
505
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
506
- } finally {
507
- isFlushing = false;
508
- }
509
- }
510
- }
511
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
512
- 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"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
513
- isMounted: function() {
514
- return false;
515
- },
516
- enqueueForceUpdate: function(publicInstance) {
517
- warnNoop(publicInstance, "forceUpdate");
518
- },
519
- enqueueReplaceState: function(publicInstance) {
520
- warnNoop(publicInstance, "replaceState");
521
- },
522
- enqueueSetState: function(publicInstance) {
523
- warnNoop(publicInstance, "setState");
524
- }
525
- }, assign = Object.assign, emptyObject = {};
526
- Object.freeze(emptyObject);
527
- Component.prototype.isReactComponent = {};
528
- Component.prototype.setState = function(partialState, callback) {
529
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
530
- throw Error(
531
- "takes an object of state variables to update or a function which returns an object of state variables."
532
- );
533
- this.updater.enqueueSetState(this, partialState, callback, "setState");
534
- };
535
- Component.prototype.forceUpdate = function(callback) {
536
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
537
- };
538
- var deprecatedAPIs = {
539
- isMounted: [
540
- "isMounted",
541
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
542
- ],
543
- replaceState: [
544
- "replaceState",
545
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
546
- ]
547
- };
548
- for (fnName in deprecatedAPIs)
549
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
550
- ComponentDummy.prototype = Component.prototype;
551
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
552
- deprecatedAPIs.constructor = PureComponent;
553
- assign(deprecatedAPIs, Component.prototype);
554
- deprecatedAPIs.isPureReactComponent = true;
555
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
556
- H: null,
557
- A: null,
558
- T: null,
559
- S: null,
560
- actQueue: null,
561
- asyncTransitions: 0,
562
- isBatchingLegacy: false,
563
- didScheduleLegacyUpdate: false,
564
- didUsePromise: false,
565
- thrownErrors: [],
566
- getCurrentStack: null,
567
- recentlyCreatedOwnerStacks: 0
568
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
569
- return null;
570
- };
571
- deprecatedAPIs = {
572
- react_stack_bottom_frame: function(callStackForError) {
573
- return callStackForError();
574
- }
575
- };
576
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
577
- var didWarnAboutElementRef = {};
578
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
579
- deprecatedAPIs,
580
- UnknownOwner
581
- )();
582
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
583
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
584
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
585
- var event = new window.ErrorEvent("error", {
586
- bubbles: true,
587
- cancelable: true,
588
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
589
- error
590
- });
591
- if (!window.dispatchEvent(event)) return;
592
- } else if ("object" === typeof process && "function" === typeof process.emit) {
593
- process.emit("uncaughtException", error);
594
- return;
595
- }
596
- console.error(error);
597
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
598
- queueMicrotask(function() {
599
- return queueMicrotask(callback);
600
- });
601
- } : enqueueTask;
602
- deprecatedAPIs = Object.freeze({
603
- __proto__: null,
604
- c: function(size) {
605
- return resolveDispatcher().useMemoCache(size);
606
- }
607
- });
608
- var fnName = {
609
- map: mapChildren,
610
- forEach: function(children, forEachFunc, forEachContext) {
611
- mapChildren(
612
- children,
613
- function() {
614
- forEachFunc.apply(this, arguments);
615
- },
616
- forEachContext
617
- );
618
- },
619
- count: function(children) {
620
- var n = 0;
621
- mapChildren(children, function() {
622
- n++;
623
- });
624
- return n;
625
- },
626
- toArray: function(children) {
627
- return mapChildren(children, function(child) {
628
- return child;
629
- }) || [];
630
- },
631
- only: function(children) {
632
- if (!isValidElement(children))
633
- throw Error(
634
- "React.Children.only expected to receive a single React element child."
635
- );
636
- return children;
637
- }
638
- };
639
- exports.Activity = REACT_ACTIVITY_TYPE;
640
- exports.Children = fnName;
641
- exports.Component = Component;
642
- exports.Fragment = REACT_FRAGMENT_TYPE;
643
- exports.Profiler = REACT_PROFILER_TYPE;
644
- exports.PureComponent = PureComponent;
645
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
646
- exports.Suspense = REACT_SUSPENSE_TYPE;
647
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
648
- exports.__COMPILER_RUNTIME = deprecatedAPIs;
649
- exports.act = function(callback) {
650
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
651
- actScopeDepth++;
652
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
653
- try {
654
- var result = callback();
655
- } catch (error) {
656
- ReactSharedInternals.thrownErrors.push(error);
657
- }
658
- if (0 < ReactSharedInternals.thrownErrors.length)
659
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
660
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
661
- var thenable = result;
662
- queueSeveralMicrotasks(function() {
663
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
664
- "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 () => ...);"
665
- ));
666
- });
667
- return {
668
- then: function(resolve, reject) {
669
- didAwaitActCall = true;
670
- thenable.then(
671
- function(returnValue) {
672
- popActScope(prevActQueue, prevActScopeDepth);
673
- if (0 === prevActScopeDepth) {
674
- try {
675
- flushActQueue(queue), enqueueTask(function() {
676
- return recursivelyFlushAsyncActWork(
677
- returnValue,
678
- resolve,
679
- reject
680
- );
681
- });
682
- } catch (error$0) {
683
- ReactSharedInternals.thrownErrors.push(error$0);
684
- }
685
- if (0 < ReactSharedInternals.thrownErrors.length) {
686
- var _thrownError = aggregateErrors(
687
- ReactSharedInternals.thrownErrors
688
- );
689
- ReactSharedInternals.thrownErrors.length = 0;
690
- reject(_thrownError);
691
- }
692
- } else resolve(returnValue);
693
- },
694
- function(error) {
695
- popActScope(prevActQueue, prevActScopeDepth);
696
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
697
- ReactSharedInternals.thrownErrors
698
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
699
- }
700
- );
701
- }
702
- };
703
- }
704
- var returnValue$jscomp$0 = result;
705
- popActScope(prevActQueue, prevActScopeDepth);
706
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
707
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
708
- "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(() => ...)"
709
- ));
710
- }), ReactSharedInternals.actQueue = null);
711
- if (0 < ReactSharedInternals.thrownErrors.length)
712
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
713
- return {
714
- then: function(resolve, reject) {
715
- didAwaitActCall = true;
716
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
717
- return recursivelyFlushAsyncActWork(
718
- returnValue$jscomp$0,
719
- resolve,
720
- reject
721
- );
722
- })) : resolve(returnValue$jscomp$0);
723
- }
724
- };
725
- };
726
- exports.cache = function(fn) {
727
- return function() {
728
- return fn.apply(null, arguments);
729
- };
730
- };
731
- exports.cacheSignal = function() {
732
- return null;
733
- };
734
- exports.captureOwnerStack = function() {
735
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
736
- return null === getCurrentStack ? null : getCurrentStack();
737
- };
738
- exports.cloneElement = function(element, config, children) {
739
- if (null === element || void 0 === element)
740
- throw Error(
741
- "The argument must be a React element, but you passed " + element + "."
742
- );
743
- var props = assign({}, element.props), key = element.key, owner = element._owner;
744
- if (null != config) {
745
- var JSCompiler_inline_result;
746
- a: {
747
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
748
- config,
749
- "ref"
750
- ).get) && JSCompiler_inline_result.isReactWarning) {
751
- JSCompiler_inline_result = false;
752
- break a;
753
- }
754
- JSCompiler_inline_result = void 0 !== config.ref;
755
- }
756
- JSCompiler_inline_result && (owner = getOwner());
757
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
758
- for (propName in config)
759
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
760
- }
761
- var propName = arguments.length - 2;
762
- if (1 === propName) props.children = children;
763
- else if (1 < propName) {
764
- JSCompiler_inline_result = Array(propName);
765
- for (var i = 0; i < propName; i++)
766
- JSCompiler_inline_result[i] = arguments[i + 2];
767
- props.children = JSCompiler_inline_result;
768
- }
769
- props = ReactElement(
770
- element.type,
771
- key,
772
- props,
773
- owner,
774
- element._debugStack,
775
- element._debugTask
776
- );
777
- for (key = 2; key < arguments.length; key++)
778
- validateChildKeys(arguments[key]);
779
- return props;
780
- };
781
- exports.createContext = function(defaultValue) {
782
- defaultValue = {
783
- $$typeof: REACT_CONTEXT_TYPE,
784
- _currentValue: defaultValue,
785
- _currentValue2: defaultValue,
786
- _threadCount: 0,
787
- Provider: null,
788
- Consumer: null
789
- };
790
- defaultValue.Provider = defaultValue;
791
- defaultValue.Consumer = {
792
- $$typeof: REACT_CONSUMER_TYPE,
793
- _context: defaultValue
794
- };
795
- defaultValue._currentRenderer = null;
796
- defaultValue._currentRenderer2 = null;
797
- return defaultValue;
798
- };
799
- exports.createElement = function(type, config, children) {
800
- for (var i = 2; i < arguments.length; i++)
801
- validateChildKeys(arguments[i]);
802
- i = {};
803
- var key = null;
804
- if (null != config)
805
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
806
- "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"
807
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
808
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
809
- var childrenLength = arguments.length - 2;
810
- if (1 === childrenLength) i.children = children;
811
- else if (1 < childrenLength) {
812
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
813
- childArray[_i] = arguments[_i + 2];
814
- Object.freeze && Object.freeze(childArray);
815
- i.children = childArray;
816
- }
817
- if (type && type.defaultProps)
818
- for (propName in childrenLength = type.defaultProps, childrenLength)
819
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
820
- key && defineKeyPropWarningGetter(
821
- i,
822
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
823
- );
824
- var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
825
- return ReactElement(
826
- type,
827
- key,
828
- i,
829
- getOwner(),
830
- propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
831
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
832
- );
833
- };
834
- exports.createRef = function() {
835
- var refObject = { current: null };
836
- Object.seal(refObject);
837
- return refObject;
838
- };
839
- exports.forwardRef = function(render) {
840
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
841
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
842
- ) : "function" !== typeof render ? console.error(
843
- "forwardRef requires a render function but was given %s.",
844
- null === render ? "null" : typeof render
845
- ) : 0 !== render.length && 2 !== render.length && console.error(
846
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
847
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
848
- );
849
- null != render && null != render.defaultProps && console.error(
850
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
851
- );
852
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
853
- Object.defineProperty(elementType, "displayName", {
854
- enumerable: false,
855
- configurable: true,
856
- get: function() {
857
- return ownName;
858
- },
859
- set: function(name) {
860
- ownName = name;
861
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
862
- }
863
- });
864
- return elementType;
865
- };
866
- exports.isValidElement = isValidElement;
867
- exports.lazy = function(ctor) {
868
- ctor = { _status: -1, _result: ctor };
869
- var lazyType = {
870
- $$typeof: REACT_LAZY_TYPE,
871
- _payload: ctor,
872
- _init: lazyInitializer
873
- }, ioInfo = {
874
- name: "lazy",
875
- start: -1,
876
- end: -1,
877
- value: null,
878
- owner: null,
879
- debugStack: Error("react-stack-top-frame"),
880
- debugTask: console.createTask ? console.createTask("lazy()") : null
881
- };
882
- ctor._ioInfo = ioInfo;
883
- lazyType._debugInfo = [{ awaited: ioInfo }];
884
- return lazyType;
885
- };
886
- exports.memo = function(type, compare) {
887
- null == type && console.error(
888
- "memo: The first argument must be a component. Instead received: %s",
889
- null === type ? "null" : typeof type
890
- );
891
- compare = {
892
- $$typeof: REACT_MEMO_TYPE,
893
- type,
894
- compare: void 0 === compare ? null : compare
895
- };
896
- var ownName;
897
- Object.defineProperty(compare, "displayName", {
898
- enumerable: false,
899
- configurable: true,
900
- get: function() {
901
- return ownName;
902
- },
903
- set: function(name) {
904
- ownName = name;
905
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
906
- }
907
- });
908
- return compare;
909
- };
910
- exports.startTransition = function(scope) {
911
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
912
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
913
- ReactSharedInternals.T = currentTransition;
914
- try {
915
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
916
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
917
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
918
- } catch (error) {
919
- reportGlobalError(error);
920
- } finally {
921
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
922
- "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."
923
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
924
- "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."
925
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
926
- }
927
- };
928
- exports.unstable_useCacheRefresh = function() {
929
- return resolveDispatcher().useCacheRefresh();
930
- };
931
- exports.use = function(usable) {
932
- return resolveDispatcher().use(usable);
933
- };
934
- exports.useActionState = function(action, initialState, permalink) {
935
- return resolveDispatcher().useActionState(
936
- action,
937
- initialState,
938
- permalink
939
- );
940
- };
941
- exports.useCallback = function(callback, deps) {
942
- return resolveDispatcher().useCallback(callback, deps);
943
- };
944
- exports.useContext = function(Context) {
945
- var dispatcher = resolveDispatcher();
946
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
947
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
948
- );
949
- return dispatcher.useContext(Context);
950
- };
951
- exports.useDebugValue = function(value, formatterFn) {
952
- return resolveDispatcher().useDebugValue(value, formatterFn);
953
- };
954
- exports.useDeferredValue = function(value, initialValue) {
955
- return resolveDispatcher().useDeferredValue(value, initialValue);
956
- };
957
- exports.useEffect = function(create, deps) {
958
- null == create && console.warn(
959
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
960
- );
961
- return resolveDispatcher().useEffect(create, deps);
962
- };
963
- exports.useEffectEvent = function(callback) {
964
- return resolveDispatcher().useEffectEvent(callback);
965
- };
966
- exports.useId = function() {
967
- return resolveDispatcher().useId();
968
- };
969
- exports.useImperativeHandle = function(ref, create, deps) {
970
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
971
- };
972
- exports.useInsertionEffect = function(create, deps) {
973
- null == create && console.warn(
974
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
975
- );
976
- return resolveDispatcher().useInsertionEffect(create, deps);
977
- };
978
- exports.useLayoutEffect = function(create, deps) {
979
- null == create && console.warn(
980
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
981
- );
982
- return resolveDispatcher().useLayoutEffect(create, deps);
983
- };
984
- exports.useMemo = function(create, deps) {
985
- return resolveDispatcher().useMemo(create, deps);
986
- };
987
- exports.useOptimistic = function(passthrough, reducer) {
988
- return resolveDispatcher().useOptimistic(passthrough, reducer);
989
- };
990
- exports.useReducer = function(reducer, initialArg, init) {
991
- return resolveDispatcher().useReducer(reducer, initialArg, init);
992
- };
993
- exports.useRef = function(initialValue) {
994
- return resolveDispatcher().useRef(initialValue);
995
- };
996
- exports.useState = function(initialState) {
997
- return resolveDispatcher().useState(initialState);
998
- };
999
- exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1000
- return resolveDispatcher().useSyncExternalStore(
1001
- subscribe,
1002
- getSnapshot,
1003
- getServerSnapshot
1004
- );
1005
- };
1006
- exports.useTransition = function() {
1007
- return resolveDispatcher().useTransition();
1008
- };
1009
- exports.version = "19.2.7";
1010
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1011
- })();
1012
- }
1013
- });
1014
-
1015
- // node_modules/react/index.js
1016
- var require_react = __commonJS({
1017
- "node_modules/react/index.js"(exports, module) {
1018
- "use strict";
1019
- if (false) {
1020
- module.exports = null;
1021
- } else {
1022
- module.exports = require_react_development();
1023
- }
1024
- }
1025
- });
1026
15
 
1027
16
  // node_modules/@capacitor/core/dist/index.js
1028
17
  var ExceptionCode, CapacitorException, getPlatformId, createCapacitor, initCapacitorGlobal, Capacitor, registerPlugin, WebPlugin, encode, decode, CapacitorCookiesPluginWeb, CapacitorCookies, readBlobAsBase64, normalizeHttpHeaders, buildUrlParams, buildRequestInit, CapacitorHttpPluginWeb, CapacitorHttp, SystemBarsStyle, SystemBarType, SystemBarsPluginWeb, SystemBars;
@@ -1794,9 +783,6 @@ var init_event = __esm({
1794
783
  }
1795
784
  });
1796
785
 
1797
- // src/services/useGoogleAuth.js
1798
- var import_react = __toESM(require_react(), 1);
1799
-
1800
786
  // node_modules/@capacitor/app/dist/esm/index.js
1801
787
  init_dist();
1802
788
  var App = registerPlugin("App", {
@@ -4512,6 +3498,7 @@ var isCapacitor = platform === "android" || platform === "ios";
4512
3498
  var isTauri = platform === "tauri";
4513
3499
 
4514
3500
  // src/services/useGoogleAuth.js
3501
+ var googleInitialized = false;
4515
3502
  var googleListeners = [];
4516
3503
  function emitGoogleLogin(user, err = null) {
4517
3504
  googleListeners.forEach((cb) => {
@@ -4530,39 +3517,6 @@ function subscribeGoogleLogin(cb) {
4530
3517
  };
4531
3518
  }
4532
3519
  var authWindowRef = null;
4533
- var createGoogleLogin = async ({
4534
- appId = "tevrocsoft",
4535
- serviceUrl = "https://tevrocsoftapi.netlify.app"
4536
- } = {}) => {
4537
- let authUrl = `${serviceUrl}/login?mode=mobile&app=${appId}`;
4538
- if (isCapacitor) {
4539
- await Browser2.open({ url: authUrl });
4540
- return;
4541
- }
4542
- if (isTauri) {
4543
- const url = `${serviceUrl}/login?mode=desktop&app=${appId}`;
4544
- const win = new WebviewWindow("auth", {
4545
- url,
4546
- title: "Tevroc Login",
4547
- width: 550,
4548
- height: 500,
4549
- resizable: true,
4550
- center: true
4551
- });
4552
- authWindowRef = win;
4553
- win.once("tauri://created", () => {
4554
- console.log("Auth window opened");
4555
- });
4556
- win.once("tauri://error", (e) => {
4557
- console.error("Auth window error:", e);
4558
- });
4559
- return;
4560
- }
4561
- const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
4562
- const mode = isLocalhost ? "localhost" : "netlify";
4563
- authUrl = `${serviceUrl}/login?mode=${mode}&app=${appId}`;
4564
- window.location.href = authUrl;
4565
- };
4566
3520
  var handleCallback = async (url) => {
4567
3521
  try {
4568
3522
  if (!url?.includes("token=")) return;
@@ -4592,19 +3546,17 @@ var handleCallback = async (url) => {
4592
3546
  emitGoogleLogin(null, err);
4593
3547
  }
4594
3548
  };
4595
- (0, import_react.useEffect)(() => {
4596
- if (!isCapacitor) return;
4597
- const sub = App.addListener("appUrlOpen", (event) => {
4598
- handleCallback(event.url);
4599
- });
4600
- return () => sub.remove();
4601
- }, []);
4602
- (0, import_react.useEffect)(() => {
4603
- if (!isTauri) return;
4604
- let unlisten;
4605
- const setup = async () => {
3549
+ var initializeGoogleLogin = async () => {
3550
+ if (googleInitialized) return;
3551
+ googleInitialized = true;
3552
+ if (isCapacitor) {
3553
+ App.addListener("appUrlOpen", (event) => {
3554
+ handleCallback(event.url);
3555
+ });
3556
+ }
3557
+ if (isTauri) {
4606
3558
  const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
4607
- unlisten = await listen2("deep-link://open-url", async (event) => {
3559
+ await listen2("deep-link://open-url", async (event) => {
4608
3560
  let url = event.payload;
4609
3561
  if (typeof url === "object") {
4610
3562
  url = url?.url || url?.payload || null;
@@ -4619,16 +3571,57 @@ var handleCallback = async (url) => {
4619
3571
  }
4620
3572
  handleCallback(url);
4621
3573
  });
4622
- };
4623
- setup();
4624
- return () => {
4625
- unlisten?.();
4626
- };
4627
- }, []);
3574
+ }
3575
+ };
3576
+ var createGoogleLogin = async ({
3577
+ appId = "tevrocsoft",
3578
+ serviceUrl = "https://tevrocsoftapi.netlify.app"
3579
+ } = {}) => {
3580
+ console.log(isCapacitor, isTauri);
3581
+ return;
3582
+ await initializeGoogleLogin();
3583
+ let authUrl = `${serviceUrl}/login?mode=mobile&app=${appId}`;
3584
+ if (isCapacitor) {
3585
+ await Browser2.open({ url: authUrl });
3586
+ return;
3587
+ }
3588
+ if (isTauri) {
3589
+ const url = `${serviceUrl}/login?mode=desktop&app=${appId}`;
3590
+ const win = new WebviewWindow("auth", {
3591
+ url,
3592
+ title: "Tevroc Login",
3593
+ width: 550,
3594
+ height: 500,
3595
+ resizable: true,
3596
+ center: true
3597
+ });
3598
+ authWindowRef = win;
3599
+ win.once("tauri://created", () => {
3600
+ console.log("Auth window opened");
3601
+ });
3602
+ win.once("tauri://error", (e) => {
3603
+ console.error("Auth window error:", e);
3604
+ });
3605
+ return;
3606
+ }
3607
+ const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
3608
+ const mode = isLocalhost ? "localhost" : "netlify";
3609
+ authUrl = `${serviceUrl}/login?mode=${mode}&app=${appId}`;
3610
+ window.location.href = authUrl;
3611
+ };
4628
3612
 
4629
3613
  // src/services/useYocoPayment.js
4630
- var import_react2 = __toESM(require_react(), 1);
3614
+ var paymentInitialized = false;
4631
3615
  var paymentStatusListeners = [];
3616
+ function emitPaymentStatus(status, err = null) {
3617
+ paymentStatusListeners.forEach((cb) => {
3618
+ try {
3619
+ cb(status, err);
3620
+ } catch (e) {
3621
+ console.error("Payment listener error:", e);
3622
+ }
3623
+ });
3624
+ }
4632
3625
  function subscribePaymentStatus(cb) {
4633
3626
  paymentStatusListeners.push(cb);
4634
3627
  return () => {
@@ -4637,10 +3630,79 @@ function subscribePaymentStatus(cb) {
4637
3630
  };
4638
3631
  }
4639
3632
  var paymentWindowRef = null;
3633
+ var logs = [];
3634
+ var addLog = (...msgs) => {
3635
+ msgs.forEach((m) => {
3636
+ const log = {
3637
+ message: m,
3638
+ time: (/* @__PURE__ */ new Date()).toISOString()
3639
+ };
3640
+ logs.push(log);
3641
+ console.log(log);
3642
+ });
3643
+ };
3644
+ var handlePaymentCallback = async (url, externalCallback = () => {
3645
+ }) => {
3646
+ try {
3647
+ addLog("PAYMENT CALLBACK:", url);
3648
+ if (!url?.includes("state=")) return;
3649
+ const params = new URLSearchParams(url.split("?")[1]);
3650
+ const state = params.get("state");
3651
+ addLog("PAYMENT RESULT:", state);
3652
+ if (state == "success") {
3653
+ addLog("PAYMENT SUCCESS");
3654
+ } else {
3655
+ addLog("PAYMENT FAILED");
3656
+ }
3657
+ externalCallback(state, null);
3658
+ emitPaymentStatus(state, null);
3659
+ } catch (err) {
3660
+ addLog("PAYMENT CALLBACK ERROR:", err.message);
3661
+ externalCallback(null, err);
3662
+ emitPaymentStatus(null, err);
3663
+ }
3664
+ };
3665
+ var initializePayment = async (externalCallback = () => {
3666
+ }) => {
3667
+ if (paymentInitialized) return;
3668
+ paymentInitialized = true;
3669
+ if (isCapacitor) {
3670
+ App.addListener("appUrlOpen", (event) => {
3671
+ handlePaymentCallback(
3672
+ event.url,
3673
+ externalCallback
3674
+ );
3675
+ });
3676
+ }
3677
+ if (isTauri) {
3678
+ const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
3679
+ await listen2("deep-link://open-url", async (event) => {
3680
+ let url = event.payload;
3681
+ if (typeof url === "object") {
3682
+ url = url?.url || url?.payload || null;
3683
+ }
3684
+ if (!url) return;
3685
+ if (paymentWindowRef) {
3686
+ try {
3687
+ await paymentWindowRef.close();
3688
+ paymentWindowRef = null;
3689
+ } catch (e) {
3690
+ }
3691
+ }
3692
+ handlePaymentCallback(
3693
+ url,
3694
+ externalCallback
3695
+ );
3696
+ });
3697
+ }
3698
+ };
4640
3699
  var createPayment = async (amountZAR, {
4641
3700
  appId = "tevrocsoft",
4642
- serviceUrl = "https://tevrocsoftapi.netlify.app"
3701
+ serviceUrl = "https://tevrocsoftapi.netlify.app",
3702
+ externalCallback = () => {
3703
+ }
4643
3704
  } = {}) => {
3705
+ await initializePayment(externalCallback);
4644
3706
  const cents = Math.round(Number(amountZAR) * 100);
4645
3707
  const basePaymentUrl = `${serviceUrl}/pay`;
4646
3708
  const paymentUrl = `${basePaymentUrl}?mode=mobile&amount=${cents}&app=${appId}`;
@@ -5025,17 +4087,6 @@ export {
5025
4087
  };
5026
4088
  /*! Bundled license information:
5027
4089
 
5028
- react/cjs/react.development.js:
5029
- (**
5030
- * @license React
5031
- * react.development.js
5032
- *
5033
- * Copyright (c) Meta Platforms, Inc. and affiliates.
5034
- *
5035
- * This source code is licensed under the MIT license found in the
5036
- * LICENSE file in the root directory of this source tree.
5037
- *)
5038
-
5039
4090
  @capacitor/core/dist/index.js:
5040
4091
  (*! Capacitor: https://capacitorjs.com/ - MIT License *)
5041
4092
  */