@tamagui/core 1.64.3 → 1.65.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.
package/dist/native.js CHANGED
@@ -27,11 +27,678 @@ var __export = (target, all) => {
27
27
  mod
28
28
  )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
29
29
 
30
- // ../polyfill-dev/index.js
31
- var require_polyfill_dev = __commonJS({
32
- "../polyfill-dev/index.js"() {
30
+ // ../react-native-use-responder-events/dist/cjs/utils.native.js
31
+ var require_utils_native = __commonJS({
32
+ "../react-native-use-responder-events/dist/cjs/utils.native.js"(exports, module2) {
33
33
  "use strict";
34
- typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = !0);
34
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
35
+ for (var name in all)
36
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
37
+ }, __copyProps2 = (to, from, except, desc) => {
38
+ if (from && typeof from == "object" || typeof from == "function")
39
+ for (let key of __getOwnPropNames2(from))
40
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
41
+ return to;
42
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), utils_exports = {};
43
+ __export2(utils_exports, {
44
+ canUseDOM: () => canUseDOM,
45
+ getBoundingClientRect: () => getBoundingClientRect2,
46
+ getLowestCommonAncestor: () => getLowestCommonAncestor,
47
+ getResponderPaths: () => getResponderPaths,
48
+ hasTargetTouches: () => hasTargetTouches,
49
+ hasValidSelection: () => hasValidSelection,
50
+ isPrimaryPointerDown: () => isPrimaryPointerDown,
51
+ isSelectionValid: () => isSelectionValid,
52
+ setResponderId: () => setResponderId
53
+ });
54
+ module2.exports = __toCommonJS2(utils_exports);
55
+ var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), getBoundingClientRect2 = (node) => {
56
+ if (node && node.nodeType === 1 && node.getBoundingClientRect)
57
+ return node.getBoundingClientRect();
58
+ };
59
+ function getEventPath(domEvent) {
60
+ var _a;
61
+ if (domEvent.type === "selectionchange") {
62
+ let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
63
+ return composedPathFallback(target);
64
+ } else
65
+ return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
66
+ }
67
+ function composedPathFallback(target) {
68
+ let path = [];
69
+ for (; target != null && target !== document.body; )
70
+ path.push(target), target = target.parentNode;
71
+ return path;
72
+ }
73
+ function getResponderId(node) {
74
+ return node != null ? node[keyName] : null;
75
+ }
76
+ function setResponderId(node, id) {
77
+ node != null && (node[keyName] = id);
78
+ }
79
+ function getResponderPaths(domEvent) {
80
+ let idPath = [], nodePath = [], eventPath = getEventPath(domEvent);
81
+ for (let i = 0; i < eventPath.length; i++) {
82
+ let node = eventPath[i], id = getResponderId(node);
83
+ id != null && (idPath.push(id), nodePath.push(node));
84
+ }
85
+ return { idPath, nodePath };
86
+ }
87
+ function getLowestCommonAncestor(pathA, pathB) {
88
+ let pathALength = pathA.length, pathBLength = pathB.length;
89
+ if (
90
+ // If either path is empty
91
+ pathALength === 0 || pathBLength === 0 || // If the last elements aren't the same there can't be a common ancestor
92
+ // that is connected to the responder system
93
+ pathA[pathALength - 1] !== pathB[pathBLength - 1]
94
+ )
95
+ return null;
96
+ let itemA = pathA[0], indexA = 0, itemB = pathB[0], indexB = 0;
97
+ pathALength - pathBLength > 0 && (indexA = pathALength - pathBLength, itemA = pathA[indexA], pathALength = pathBLength), pathBLength - pathALength > 0 && (indexB = pathBLength - pathALength, itemB = pathB[indexB], pathBLength = pathALength);
98
+ let depth = pathALength;
99
+ for (; depth--; ) {
100
+ if (itemA === itemB)
101
+ return itemA;
102
+ itemA = pathA[indexA++], itemB = pathB[indexB++];
103
+ }
104
+ return null;
105
+ }
106
+ function hasTargetTouches(target, touches) {
107
+ if (!touches || touches.length === 0)
108
+ return !1;
109
+ for (let i = 0; i < touches.length; i++) {
110
+ let node = touches[i].target;
111
+ if (node != null && target.contains(node))
112
+ return !0;
113
+ }
114
+ return !1;
115
+ }
116
+ function hasValidSelection(domEvent) {
117
+ return domEvent.type === "selectionchange" ? isSelectionValid() : domEvent.type === "select";
118
+ }
119
+ function isPrimaryPointerDown(domEvent) {
120
+ let { altKey, button, buttons, ctrlKey, type } = domEvent, isTouch = type === "touchstart" || type === "touchmove", isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1), isPrimaryMouseMove = type === "mousemove" && buttons === 1, noModifiers = altKey === !1 && ctrlKey === !1;
121
+ return !!(isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers);
122
+ }
123
+ function isSelectionValid() {
124
+ let selection = window.getSelection();
125
+ if (!selection)
126
+ return !1;
127
+ let string = selection.toString(), anchorNode = selection.anchorNode, focusNode = selection.focusNode, isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
128
+ return string.length >= 1 && string !== `
129
+ ` && !!isTextNode;
130
+ }
131
+ }
132
+ });
133
+
134
+ // ../react-native-use-responder-events/dist/cjs/createResponderEvent.native.js
135
+ var require_createResponderEvent_native = __commonJS({
136
+ "../react-native-use-responder-events/dist/cjs/createResponderEvent.native.js"(exports, module2) {
137
+ "use strict";
138
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
139
+ for (var name in all)
140
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
141
+ }, __copyProps2 = (to, from, except, desc) => {
142
+ if (from && typeof from == "object" || typeof from == "function")
143
+ for (let key of __getOwnPropNames2(from))
144
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
145
+ return to;
146
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createResponderEvent_exports = {};
147
+ __export2(createResponderEvent_exports, {
148
+ default: () => createResponderEvent
149
+ });
150
+ module2.exports = __toCommonJS2(createResponderEvent_exports);
151
+ var import_utils = require_utils_native(), emptyFunction = () => {
152
+ }, emptyObject = {}, emptyArray = [];
153
+ function normalizeIdentifier(identifier) {
154
+ return identifier > 20 ? identifier % 20 : identifier;
155
+ }
156
+ function createResponderEvent(domEvent, responderTouchHistoryStore) {
157
+ let rect, propagationWasStopped = !1, changedTouches, touches, domEventChangedTouches = domEvent.changedTouches, domEventType = domEvent.type, metaKey = domEvent.metaKey === !0, shiftKey = domEvent.shiftKey === !0, force = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].force) || 0, identifier = normalizeIdentifier((domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].identifier) || 0), clientX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientX) || domEvent.clientX, clientY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientY) || domEvent.clientY, pageX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageX) || domEvent.pageX, pageY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageY) || domEvent.pageY, preventDefault = typeof domEvent.preventDefault == "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction, timestamp = domEvent.timeStamp;
158
+ function normalizeTouches(touches2) {
159
+ return Array.prototype.slice.call(touches2).map((touch) => ({
160
+ force: touch.force,
161
+ identifier: normalizeIdentifier(touch.identifier),
162
+ get locationX() {
163
+ return locationX(touch.clientX);
164
+ },
165
+ get locationY() {
166
+ return locationY(touch.clientY);
167
+ },
168
+ pageX: touch.pageX,
169
+ pageY: touch.pageY,
170
+ target: touch.target,
171
+ timestamp
172
+ }));
173
+ }
174
+ if (domEventChangedTouches != null)
175
+ changedTouches = normalizeTouches(domEventChangedTouches), touches = normalizeTouches(domEvent.touches);
176
+ else {
177
+ let emulatedTouches = [
178
+ {
179
+ force,
180
+ identifier,
181
+ get locationX() {
182
+ return locationX(clientX);
183
+ },
184
+ get locationY() {
185
+ return locationY(clientY);
186
+ },
187
+ pageX,
188
+ pageY,
189
+ target: domEvent.target,
190
+ timestamp
191
+ }
192
+ ];
193
+ changedTouches = emulatedTouches, touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
194
+ }
195
+ let responderEvent = {
196
+ bubbles: !0,
197
+ cancelable: !0,
198
+ // `currentTarget` is set before dispatch
199
+ currentTarget: null,
200
+ defaultPrevented: domEvent.defaultPrevented,
201
+ dispatchConfig: emptyObject,
202
+ eventPhase: domEvent.eventPhase,
203
+ isDefaultPrevented() {
204
+ return domEvent.defaultPrevented;
205
+ },
206
+ isPropagationStopped() {
207
+ return propagationWasStopped;
208
+ },
209
+ isTrusted: domEvent.isTrusted,
210
+ nativeEvent: {
211
+ altKey: !1,
212
+ ctrlKey: !1,
213
+ metaKey,
214
+ shiftKey,
215
+ changedTouches,
216
+ force,
217
+ identifier,
218
+ get locationX() {
219
+ return locationX(clientX);
220
+ },
221
+ get locationY() {
222
+ return locationY(clientY);
223
+ },
224
+ pageX,
225
+ pageY,
226
+ target: domEvent.target,
227
+ timestamp,
228
+ touches,
229
+ type: domEventType
230
+ },
231
+ persist: emptyFunction,
232
+ preventDefault,
233
+ stopPropagation() {
234
+ propagationWasStopped = !0;
235
+ },
236
+ target: domEvent.target,
237
+ timeStamp: timestamp,
238
+ touchHistory: responderTouchHistoryStore.touchHistory
239
+ };
240
+ function locationX(x) {
241
+ if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
242
+ return x - rect.left;
243
+ }
244
+ function locationY(y) {
245
+ if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
246
+ return y - rect.top;
247
+ }
248
+ return responderEvent;
249
+ }
250
+ }
251
+ });
252
+
253
+ // ../react-native-use-responder-events/dist/cjs/types.native.js
254
+ var require_types_native = __commonJS({
255
+ "../react-native-use-responder-events/dist/cjs/types.native.js"(exports, module2) {
256
+ "use strict";
257
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
258
+ for (var name in all)
259
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
260
+ }, __copyProps2 = (to, from, except, desc) => {
261
+ if (from && typeof from == "object" || typeof from == "function")
262
+ for (let key of __getOwnPropNames2(from))
263
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
264
+ return to;
265
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), types_exports = {};
266
+ __export2(types_exports, {
267
+ BLUR: () => BLUR,
268
+ CONTEXT_MENU: () => CONTEXT_MENU,
269
+ FOCUS_OUT: () => FOCUS_OUT,
270
+ MOUSE_CANCEL: () => MOUSE_CANCEL,
271
+ MOUSE_DOWN: () => MOUSE_DOWN,
272
+ MOUSE_MOVE: () => MOUSE_MOVE,
273
+ MOUSE_UP: () => MOUSE_UP,
274
+ SCROLL: () => SCROLL,
275
+ SELECT: () => SELECT,
276
+ SELECTION_CHANGE: () => SELECTION_CHANGE,
277
+ TOUCH_CANCEL: () => TOUCH_CANCEL,
278
+ TOUCH_END: () => TOUCH_END,
279
+ TOUCH_MOVE: () => TOUCH_MOVE,
280
+ TOUCH_START: () => TOUCH_START,
281
+ isCancelish: () => isCancelish,
282
+ isEndish: () => isEndish,
283
+ isMoveish: () => isMoveish,
284
+ isScroll: () => isScroll,
285
+ isSelectionChange: () => isSelectionChange,
286
+ isStartish: () => isStartish
287
+ });
288
+ module2.exports = __toCommonJS2(types_exports);
289
+ var BLUR = "blur", CONTEXT_MENU = "contextmenu", FOCUS_OUT = "focusout", MOUSE_DOWN = "mousedown", MOUSE_MOVE = "mousemove", MOUSE_UP = "mouseup", MOUSE_CANCEL = "dragstart", TOUCH_START = "touchstart", TOUCH_MOVE = "touchmove", TOUCH_END = "touchend", TOUCH_CANCEL = "touchcancel", SCROLL = "scroll", SELECT = "select", SELECTION_CHANGE = "selectionchange";
290
+ function isStartish(eventType) {
291
+ return eventType === TOUCH_START || eventType === MOUSE_DOWN;
292
+ }
293
+ function isMoveish(eventType) {
294
+ return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
295
+ }
296
+ function isEndish(eventType) {
297
+ return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
298
+ }
299
+ function isCancelish(eventType) {
300
+ return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
301
+ }
302
+ function isScroll(eventType) {
303
+ return eventType === SCROLL;
304
+ }
305
+ function isSelectionChange(eventType) {
306
+ return eventType === SELECT || eventType === SELECTION_CHANGE;
307
+ }
308
+ }
309
+ });
310
+
311
+ // ../react-native-use-responder-events/dist/cjs/ResponderTouchHistoryStore.native.js
312
+ var require_ResponderTouchHistoryStore_native = __commonJS({
313
+ "../react-native-use-responder-events/dist/cjs/ResponderTouchHistoryStore.native.js"(exports, module2) {
314
+ "use strict";
315
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
316
+ for (var name in all)
317
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
318
+ }, __copyProps2 = (to, from, except, desc) => {
319
+ if (from && typeof from == "object" || typeof from == "function")
320
+ for (let key of __getOwnPropNames2(from))
321
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
322
+ return to;
323
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ResponderTouchHistoryStore_exports = {};
324
+ __export2(ResponderTouchHistoryStore_exports, {
325
+ ResponderTouchHistoryStore: () => ResponderTouchHistoryStore
326
+ });
327
+ module2.exports = __toCommonJS2(ResponderTouchHistoryStore_exports);
328
+ var import_types = require_types_native(), MAX_TOUCH_BANK = 20;
329
+ function timestampForTouch(touch) {
330
+ return touch.timeStamp || touch.timestamp;
331
+ }
332
+ function createTouchRecord(touch) {
333
+ return {
334
+ touchActive: !0,
335
+ startPageX: touch.pageX,
336
+ startPageY: touch.pageY,
337
+ startTimeStamp: timestampForTouch(touch),
338
+ currentPageX: touch.pageX,
339
+ currentPageY: touch.pageY,
340
+ currentTimeStamp: timestampForTouch(touch),
341
+ previousPageX: touch.pageX,
342
+ previousPageY: touch.pageY,
343
+ previousTimeStamp: timestampForTouch(touch)
344
+ };
345
+ }
346
+ function resetTouchRecord(touchRecord, touch) {
347
+ touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch);
348
+ }
349
+ function getTouchIdentifier({ identifier }) {
350
+ return identifier == null && console.error("Touch object is missing identifier."), process.env.NODE_ENV === "development" && identifier > MAX_TOUCH_BANK && console.error(
351
+ "Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.",
352
+ identifier,
353
+ MAX_TOUCH_BANK
354
+ ), identifier;
355
+ }
356
+ function recordTouchStart(touch, touchHistory) {
357
+ let identifier = getTouchIdentifier(touch), touchRecord = touchHistory.touchBank[identifier];
358
+ touchRecord ? resetTouchRecord(touchRecord, touch) : touchHistory.touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
359
+ }
360
+ function recordTouchMove(touch, touchHistory) {
361
+ let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
362
+ touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
363
+ `Cannot record touch move without a touch start.
364
+ `,
365
+ `Touch Move: ${printTouch(touch)}
366
+ `,
367
+ `Touch Bank: ${printTouchBank(touchHistory)}`
368
+ );
369
+ }
370
+ function recordTouchEnd(touch, touchHistory) {
371
+ let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
372
+ touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
373
+ `Cannot record touch end without a touch start.
374
+ `,
375
+ `Touch End: ${printTouch(touch)}
376
+ `,
377
+ `Touch Bank: ${printTouchBank(touchHistory)}`
378
+ );
379
+ }
380
+ function printTouch(touch) {
381
+ return JSON.stringify({
382
+ identifier: touch.identifier,
383
+ pageX: touch.pageX,
384
+ pageY: touch.pageY,
385
+ timestamp: timestampForTouch(touch)
386
+ });
387
+ }
388
+ function printTouchBank(touchHistory) {
389
+ let { touchBank } = touchHistory, printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
390
+ return touchBank.length > MAX_TOUCH_BANK && (printed += ` (original size: ${touchBank.length})`), printed;
391
+ }
392
+ var ResponderTouchHistoryStore = class {
393
+ constructor() {
394
+ this._touchHistory = {
395
+ touchBank: [],
396
+ //Array<TouchRecord>
397
+ numberActiveTouches: 0,
398
+ // If there is only one active touch, we remember its location. This prevents
399
+ // us having to loop through all of the touches all the time in the most
400
+ // common case.
401
+ indexOfSingleActiveTouch: -1,
402
+ mostRecentTimeStamp: 0
403
+ };
404
+ }
405
+ recordTouchTrack(topLevelType, nativeEvent) {
406
+ let touchHistory = this._touchHistory;
407
+ if ((0, import_types.isMoveish)(topLevelType))
408
+ nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory));
409
+ else if ((0, import_types.isStartish)(topLevelType))
410
+ nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1 && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);
411
+ else if ((0, import_types.isEndish)(topLevelType) && (nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1)) {
412
+ let { touchBank } = touchHistory;
413
+ for (let i = 0; i < touchBank.length; i++) {
414
+ let touchTrackToCheck = touchBank[i];
415
+ if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
416
+ touchHistory.indexOfSingleActiveTouch = i;
417
+ break;
418
+ }
419
+ }
420
+ if (process.env.NODE_ENV === "development") {
421
+ let activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
422
+ activeRecord != null && activeRecord.touchActive || console.error("Cannot find single active touch.");
423
+ }
424
+ }
425
+ }
426
+ get touchHistory() {
427
+ return this._touchHistory;
428
+ }
429
+ };
430
+ }
431
+ });
432
+
433
+ // ../react-native-use-responder-events/dist/cjs/ResponderSystem.native.js
434
+ var require_ResponderSystem_native = __commonJS({
435
+ "../react-native-use-responder-events/dist/cjs/ResponderSystem.native.js"(exports, module2) {
436
+ "use strict";
437
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
438
+ for (var name in all)
439
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
440
+ }, __copyProps2 = (to, from, except, desc) => {
441
+ if (from && typeof from == "object" || typeof from == "function")
442
+ for (let key of __getOwnPropNames2(from))
443
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
444
+ return to;
445
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
446
+ // If the importer is in node compatibility mode or this is not an ESM
447
+ // file that has been converted to a CommonJS file using a Babel-
448
+ // compatible transform (i.e. "__esModule" has not been set), then set
449
+ // "default" to the CommonJS "module.exports" for node compatibility.
450
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
451
+ mod
452
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ResponderSystem_exports = {};
453
+ __export2(ResponderSystem_exports, {
454
+ addNode: () => addNode,
455
+ attachListeners: () => attachListeners,
456
+ getResponderNode: () => getResponderNode,
457
+ removeNode: () => removeNode,
458
+ terminateResponder: () => terminateResponder
459
+ });
460
+ module2.exports = __toCommonJS2(ResponderSystem_exports);
461
+ var import_createResponderEvent = __toESM2(require_createResponderEvent_native()), import_ResponderTouchHistoryStore = require_ResponderTouchHistoryStore_native(), import_types = require_types_native(), import_utils = require_utils_native(), import_utils2 = require_utils_native(), emptyObject = {}, startRegistration = [
462
+ "onStartShouldSetResponderCapture",
463
+ "onStartShouldSetResponder",
464
+ { bubbles: !0 }
465
+ ], moveRegistration = [
466
+ "onMoveShouldSetResponderCapture",
467
+ "onMoveShouldSetResponder",
468
+ { bubbles: !0 }
469
+ ], scrollRegistration = [
470
+ "onScrollShouldSetResponderCapture",
471
+ "onScrollShouldSetResponder",
472
+ { bubbles: !1 }
473
+ ], shouldSetResponderEvents = {
474
+ touchstart: startRegistration,
475
+ mousedown: startRegistration,
476
+ touchmove: moveRegistration,
477
+ mousemove: moveRegistration,
478
+ scroll: scrollRegistration
479
+ }, emptyResponder = { id: null, idPath: null, node: null }, responderListenersMap = /* @__PURE__ */ new Map(), isEmulatingMouseEvents = !1, trackedTouchCount = 0, currentResponder = {
480
+ id: null,
481
+ node: null,
482
+ idPath: null
483
+ }, responderTouchHistoryStore = new import_ResponderTouchHistoryStore.ResponderTouchHistoryStore();
484
+ function changeCurrentResponder(responder) {
485
+ currentResponder = responder;
486
+ }
487
+ function getResponderConfig(id) {
488
+ return responderListenersMap.get(id) ?? emptyObject;
489
+ }
490
+ function eventListener(domEvent) {
491
+ let eventType = domEvent.type, eventTarget = domEvent.target;
492
+ if (eventType === "touchstart" && (isEmulatingMouseEvents = !0), (eventType === "touchmove" || trackedTouchCount > 1) && (isEmulatingMouseEvents = !1), // Ignore browser emulated mouse events
493
+ eventType === "mousedown" && isEmulatingMouseEvents || eventType === "mousemove" && isEmulatingMouseEvents || // Ignore mousemove if a mousedown didn't occur first
494
+ eventType === "mousemove" && trackedTouchCount < 1)
495
+ return;
496
+ if (isEmulatingMouseEvents && eventType === "mouseup") {
497
+ trackedTouchCount === 0 && (isEmulatingMouseEvents = !1);
498
+ return;
499
+ }
500
+ let isStartEvent = (0, import_types.isStartish)(eventType) && (0, import_utils2.isPrimaryPointerDown)(domEvent), isMoveEvent = (0, import_types.isMoveish)(eventType), isEndEvent = (0, import_types.isEndish)(eventType), isScrollEvent = (0, import_types.isScroll)(eventType), isSelectionChangeEvent = (0, import_types.isSelectionChange)(eventType), responderEvent = (0, import_createResponderEvent.default)(domEvent, responderTouchHistoryStore);
501
+ (isStartEvent || isMoveEvent || isEndEvent) && (domEvent.touches ? trackedTouchCount = domEvent.touches.length : isStartEvent ? trackedTouchCount = 1 : isEndEvent && (trackedTouchCount = 0), responderTouchHistoryStore.recordTouchTrack(
502
+ eventType,
503
+ responderEvent.nativeEvent
504
+ ));
505
+ let eventPaths = (0, import_utils2.getResponderPaths)(domEvent), wasNegotiated = !1, wantsResponder;
506
+ if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
507
+ let currentResponderIdPath = currentResponder.idPath, eventIdPath = eventPaths.idPath;
508
+ if (currentResponderIdPath != null && eventIdPath != null) {
509
+ let lowestCommonAncestor = (0, import_utils2.getLowestCommonAncestor)(
510
+ currentResponderIdPath,
511
+ eventIdPath
512
+ );
513
+ if (lowestCommonAncestor != null) {
514
+ let index = eventIdPath.indexOf(lowestCommonAncestor) + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
515
+ eventPaths = {
516
+ idPath: eventIdPath.slice(index),
517
+ nodePath: eventPaths.nodePath.slice(index)
518
+ };
519
+ } else
520
+ eventPaths = null;
521
+ }
522
+ eventPaths != null && (wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent), wantsResponder != null && (attemptTransfer(responderEvent, wantsResponder), wasNegotiated = !0));
523
+ }
524
+ if (currentResponder.id != null && currentResponder.node != null) {
525
+ let { id, node } = currentResponder, {
526
+ onResponderStart,
527
+ onResponderMove,
528
+ onResponderEnd,
529
+ onResponderRelease,
530
+ onResponderTerminate,
531
+ onResponderTerminationRequest
532
+ } = getResponderConfig(id);
533
+ if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, isStartEvent)
534
+ onResponderStart != null && (responderEvent.dispatchConfig.registrationName = "onResponderStart", onResponderStart(responderEvent));
535
+ else if (isMoveEvent)
536
+ onResponderMove != null && (responderEvent.dispatchConfig.registrationName = "onResponderMove", onResponderMove(responderEvent));
537
+ else {
538
+ let isTerminateEvent = (0, import_types.isCancelish)(eventType) || // native context menu
539
+ eventType === "contextmenu" || // window blur
540
+ eventType === "blur" && eventTarget === window || // responder (or ancestors) blur
541
+ eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
542
+ isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
543
+ isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
544
+ isSelectionChangeEvent && (0, import_utils2.hasValidSelection)(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, import_utils2.hasTargetTouches)(node, domEvent.touches);
545
+ if (isEndEvent && onResponderEnd != null && (responderEvent.dispatchConfig.registrationName = "onResponderEnd", onResponderEnd(responderEvent)), isReleaseEvent && (onResponderRelease != null && (responderEvent.dispatchConfig.registrationName = "onResponderRelease", onResponderRelease(responderEvent)), changeCurrentResponder(emptyResponder)), isTerminateEvent) {
546
+ let shouldTerminate = !0;
547
+ (eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") && (wasNegotiated ? shouldTerminate = !1 : onResponderTerminationRequest != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (shouldTerminate = !1))), shouldTerminate && (onResponderTerminate != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), changeCurrentResponder(emptyResponder), isEmulatingMouseEvents = !1, trackedTouchCount = 0);
548
+ }
549
+ }
550
+ }
551
+ }
552
+ function findWantsResponder(eventPaths, domEvent, responderEvent) {
553
+ let shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
554
+ if (shouldSetCallbacks != null) {
555
+ let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = function(id, node, callbackName) {
556
+ let shouldSetCallback = getResponderConfig(id)[callbackName];
557
+ if (shouldSetCallback != null && (responderEvent.currentTarget = node, shouldSetCallback(responderEvent) === !0)) {
558
+ let prunedIdPath = idPath.slice(idPath.indexOf(id));
559
+ return { id, node, idPath: prunedIdPath };
560
+ }
561
+ };
562
+ for (let i = idPath.length - 1; i >= 0; i--) {
563
+ let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackCaptureName);
564
+ if (result != null)
565
+ return result;
566
+ if (responderEvent.isPropagationStopped() === !0)
567
+ return;
568
+ }
569
+ if (bubbles)
570
+ for (let i = 0; i < idPath.length; i++) {
571
+ let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackBubbleName);
572
+ if (result != null)
573
+ return result;
574
+ if (responderEvent.isPropagationStopped() === !0)
575
+ return;
576
+ }
577
+ else {
578
+ let id = idPath[0], node = nodePath[0];
579
+ if (domEvent.target === node)
580
+ return check(id, node, shouldSetCallbackBubbleName);
581
+ }
582
+ }
583
+ }
584
+ function attemptTransfer(responderEvent, wantsResponder) {
585
+ let { id: currentId, node: currentNode } = currentResponder, { id, node } = wantsResponder, { onResponderGrant, onResponderReject } = getResponderConfig(id);
586
+ if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, currentId == null)
587
+ onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder);
588
+ else {
589
+ let { onResponderTerminate, onResponderTerminationRequest } = getResponderConfig(currentId), allowTransfer = !0;
590
+ onResponderTerminationRequest != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (allowTransfer = !1)), allowTransfer ? (onResponderTerminate != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder)) : onResponderReject != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderReject", onResponderReject(responderEvent));
591
+ }
592
+ }
593
+ var documentEventsCapturePhase = ["blur", "scroll"], documentEventsBubblePhase = [
594
+ // mouse
595
+ "mousedown",
596
+ "mousemove",
597
+ "mouseup",
598
+ "dragstart",
599
+ // touch
600
+ "touchstart",
601
+ "touchmove",
602
+ "touchend",
603
+ "touchcancel",
604
+ // other
605
+ "contextmenu",
606
+ "select",
607
+ "selectionchange"
608
+ ], isTamaguiResponderActive = Symbol();
609
+ function attachListeners() {
610
+ import_utils.canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
611
+ document.addEventListener(eventType, eventListener);
612
+ }), documentEventsCapturePhase.forEach((eventType) => {
613
+ document.addEventListener(eventType, eventListener, !0);
614
+ }), window[isTamaguiResponderActive] = !0);
615
+ }
616
+ function addNode(id, node, config) {
617
+ (0, import_utils2.setResponderId)(node, id), responderListenersMap.set(id, config);
618
+ }
619
+ function removeNode(id) {
620
+ currentResponder.id === id && terminateResponder(), responderListenersMap.has(id) && responderListenersMap.delete(id);
621
+ }
622
+ function terminateResponder() {
623
+ let { id, node } = currentResponder;
624
+ if (id != null && node != null) {
625
+ let { onResponderTerminate } = getResponderConfig(id);
626
+ if (onResponderTerminate != null) {
627
+ let event = (0, import_createResponderEvent.default)({}, responderTouchHistoryStore);
628
+ event.currentTarget = node, onResponderTerminate(event);
629
+ }
630
+ changeCurrentResponder(emptyResponder);
631
+ }
632
+ isEmulatingMouseEvents = !1, trackedTouchCount = 0;
633
+ }
634
+ function getResponderNode() {
635
+ return currentResponder.node;
636
+ }
637
+ }
638
+ });
639
+
640
+ // ../react-native-use-responder-events/dist/cjs/useResponderEvents.native.js
641
+ var require_useResponderEvents_native = __commonJS({
642
+ "../react-native-use-responder-events/dist/cjs/useResponderEvents.native.js"(exports, module2) {
643
+ "use strict";
644
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
645
+ for (var name in all)
646
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
647
+ }, __copyProps2 = (to, from, except, desc) => {
648
+ if (from && typeof from == "object" || typeof from == "function")
649
+ for (let key of __getOwnPropNames2(from))
650
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
651
+ return to;
652
+ }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
653
+ // If the importer is in node compatibility mode or this is not an ESM
654
+ // file that has been converted to a CommonJS file using a Babel-
655
+ // compatible transform (i.e. "__esModule" has not been set), then set
656
+ // "default" to the CommonJS "module.exports" for node compatibility.
657
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
658
+ mod
659
+ )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useResponderEvents_exports = {};
660
+ __export2(useResponderEvents_exports, {
661
+ useResponderEvents: () => useResponderEvents2
662
+ });
663
+ module2.exports = __toCommonJS2(useResponderEvents_exports);
664
+ var React = __toESM2(require("react")), ResponderSystem = __toESM2(require_ResponderSystem_native());
665
+ __reExport2(useResponderEvents_exports, require_utils_native(), module2.exports);
666
+ var emptyObject = {};
667
+ function useResponderEvents2(hostRef, config = emptyObject) {
668
+ let id = React.useId(), isAttachedRef = React.useRef(!1);
669
+ React.useEffect(() => (ResponderSystem.attachListeners(), () => {
670
+ ResponderSystem.removeNode(id);
671
+ }), [id]), React.useEffect(() => {
672
+ let {
673
+ onMoveShouldSetResponder,
674
+ onMoveShouldSetResponderCapture,
675
+ onScrollShouldSetResponder,
676
+ onScrollShouldSetResponderCapture,
677
+ onSelectionChangeShouldSetResponder,
678
+ onSelectionChangeShouldSetResponderCapture,
679
+ onStartShouldSetResponder,
680
+ onStartShouldSetResponderCapture
681
+ } = config, requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null, node = hostRef.current;
682
+ requiresResponderSystem ? (ResponderSystem.addNode(id, node, config), isAttachedRef.current = !0) : isAttachedRef.current && (ResponderSystem.removeNode(id), isAttachedRef.current = !1);
683
+ }, [config, hostRef, id]), process.env.NODE_ENV === "development" && (React.useDebugValue({
684
+ isResponder: hostRef.current === ResponderSystem.getResponderNode()
685
+ }), React.useDebugValue(config));
686
+ }
687
+ }
688
+ });
689
+
690
+ // ../react-native-use-responder-events/dist/cjs/index.native.js
691
+ var require_index_native = __commonJS({
692
+ "../react-native-use-responder-events/dist/cjs/index.native.js"(exports, module2) {
693
+ "use strict";
694
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
695
+ if (from && typeof from == "object" || typeof from == "function")
696
+ for (let key of __getOwnPropNames2(from))
697
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
698
+ return to;
699
+ }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
700
+ module2.exports = __toCommonJS2(src_exports2);
701
+ __reExport2(src_exports2, require_useResponderEvents_native(), module2.exports);
35
702
  }
36
703
  });
37
704
 
@@ -151,7 +818,7 @@ var require_concatClassName_native = __commonJS({
151
818
  });
152
819
 
153
820
  // ../constants/dist/cjs/index.native.js
154
- var require_index_native = __commonJS({
821
+ var require_index_native2 = __commonJS({
155
822
  "../constants/dist/cjs/index.native.js"(exports, module2) {
156
823
  "use strict";
157
824
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
@@ -208,7 +875,7 @@ var require_validStyleProps_native = __commonJS({
208
875
  validStylesOnBaseProps: () => validStylesOnBaseProps
209
876
  });
210
877
  module2.exports = __toCommonJS2(validStyleProps_exports);
211
- var import_constants2 = require_index_native(), placeHolderTextColors = {
878
+ var import_constants2 = require_index_native2(), placeHolderTextColors = {
212
879
  placeholderTextColor: !0
213
880
  }, validStylesOnBaseProps = {
214
881
  ...placeHolderTextColors
@@ -394,7 +1061,7 @@ var require_validStyleProps_native = __commonJS({
394
1061
  });
395
1062
 
396
1063
  // ../helpers/dist/cjs/types.native.js
397
- var require_types_native = __commonJS({
1064
+ var require_types_native2 = __commonJS({
398
1065
  "../helpers/dist/cjs/types.native.js"(exports, module2) {
399
1066
  "use strict";
400
1067
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
@@ -408,7 +1075,7 @@ var require_types_native = __commonJS({
408
1075
  });
409
1076
 
410
1077
  // ../simple-hash/dist/cjs/index.native.js
411
- var require_index_native2 = __commonJS({
1078
+ var require_index_native3 = __commonJS({
412
1079
  "../simple-hash/dist/cjs/index.native.js"(exports, module2) {
413
1080
  "use strict";
414
1081
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
@@ -453,7 +1120,7 @@ var require_index_native2 = __commonJS({
453
1120
  });
454
1121
 
455
1122
  // ../helpers/dist/cjs/index.native.js
456
- var require_index_native3 = __commonJS({
1123
+ var require_index_native4 = __commonJS({
457
1124
  "../helpers/dist/cjs/index.native.js"(exports, module2) {
458
1125
  "use strict";
459
1126
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
@@ -467,8 +1134,8 @@ var require_index_native3 = __commonJS({
467
1134
  __reExport2(src_exports2, require_composeEventHandlers_native(), module2.exports);
468
1135
  __reExport2(src_exports2, require_concatClassName_native(), module2.exports);
469
1136
  __reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
470
- __reExport2(src_exports2, require_types_native(), module2.exports);
471
- __reExport2(src_exports2, require_index_native2(), module2.exports);
1137
+ __reExport2(src_exports2, require_types_native2(), module2.exports);
1138
+ __reExport2(src_exports2, require_index_native3(), module2.exports);
472
1139
  }
473
1140
  });
474
1141
 
@@ -502,16 +1169,16 @@ var require_config_native = __commonJS({
502
1169
  useTokens: () => useTokens
503
1170
  });
504
1171
  module2.exports = __toCommonJS2(config_exports);
505
- var import_constants2 = require_index_native(), conf, setConfig = (next) => {
1172
+ var import_constants2 = require_index_native2(), conf, setConfig = (next) => {
506
1173
  conf = next, configListeners.forEach((cb) => cb(next));
507
1174
  }, setConfigFont = (name, font, fontParsed) => {
508
- if (!conf)
1175
+ if (process.env.NODE_ENV === "development" && !conf)
509
1176
  throw new Error("Haven't called createTamagui yet");
510
1177
  conf.fonts[name] = font, conf.fontsParsed[`$${name}`] = fontParsed;
511
1178
  }, getConfig2 = () => {
512
1179
  if (!conf)
513
1180
  throw new Error(
514
- "Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering. Also, make sure all of your tamagui dependencies are on the same version (`tamagui`, `@tamagui/package-name`, etc.)"
1181
+ process.env.NODE_ENV !== "production" ? "Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering. Also, make sure all of your tamagui dependencies are on the same version (`tamagui`, `@tamagui/package-name`, etc.)" : "Err0"
515
1182
  );
516
1183
  return conf;
517
1184
  }, tokensMerged;
@@ -521,7 +1188,7 @@ var require_config_native = __commonJS({
521
1188
  var getTokens2 = ({
522
1189
  prefixed
523
1190
  } = {}) => {
524
- if (!conf)
1191
+ if (process.env.NODE_ENV === "development" && !conf)
525
1192
  throw new Error("Haven't called createTamagui yet");
526
1193
  let { tokens, tokensParsed } = conf;
527
1194
  return prefixed === !1 ? tokens : prefixed === !0 ? tokensParsed : tokensMerged;
@@ -574,7 +1241,7 @@ var require_createVariable_native = __commonJS({
574
1241
  variableToString: () => variableToString
575
1242
  });
576
1243
  module2.exports = __toCommonJS2(createVariable_exports);
577
- var import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_config = require_config_native(), IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
1244
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
578
1245
  if (!skipHash && isVariable(props))
579
1246
  return props;
580
1247
  let { key, name, val } = props;
@@ -609,7 +1276,7 @@ var require_createVariable_native = __commonJS({
609
1276
  return isVariable(v) ? v.variable : v;
610
1277
  }
611
1278
  var createCSSVariable = (nameProp, includeVar = !0) => {
612
- if (!nameProp || typeof nameProp != "string")
1279
+ if (process.env.NODE_ENV === "development" && (!nameProp || typeof nameProp != "string"))
613
1280
  throw new Error(`createCSSVariable expected string, got: ${nameProp}`);
614
1281
  let name = (0, import_helpers.simpleHash)(nameProp, 60);
615
1282
  return includeVar ? `var(--${name})` : name;
@@ -642,11 +1309,11 @@ var require_insertStyleRule_native = __commonJS({
642
1309
  updateRules: () => updateRules
643
1310
  });
644
1311
  module2.exports = __toCommonJS2(insertStyleRule_exports);
645
- var import_constants2 = require_index_native(), import_createVariable = require_createVariable_native(), scannedCache = /* @__PURE__ */ new WeakMap(), totalSelectorsInserted = /* @__PURE__ */ new Map(), allSelectors = {}, allRules = {}, insertedTransforms = {}, getAllSelectors = () => allSelectors, getAllRules = () => Object.values(allRules), getAllTransforms = () => insertedTransforms;
1312
+ var import_constants2 = require_index_native2(), import_createVariable = require_createVariable_native(), scannedCache = /* @__PURE__ */ new WeakMap(), totalSelectorsInserted = /* @__PURE__ */ new Map(), allSelectors = {}, allRules = {}, insertedTransforms = {}, getAllSelectors = () => allSelectors, getAllRules = () => Object.values(allRules), getAllTransforms = () => insertedTransforms;
646
1313
  function addTransform(identifier, css, rule) {
647
1314
  let s = css.indexOf("transform:");
648
1315
  if (s === -1) {
649
- console.error(`\u274C Invalid transform, likely used deg/% improperly ${identifier}`);
1316
+ process.env.NODE_ENV === "development" && console.error(`\u274C Invalid transform, likely used deg/% improperly ${identifier}`);
650
1317
  return;
651
1318
  }
652
1319
  let startI = s + 10, endI = css.indexOf(";"), value = css.slice(startI, endI);
@@ -666,7 +1333,7 @@ var require_insertStyleRule_native = __commonJS({
666
1333
  }
667
1334
  var lastScannedSheets = null;
668
1335
  function scanAllSheets(collectThemes = !1, tokens) {
669
- if (!import_constants2.isClient)
1336
+ if (process.env.NODE_ENV === "test" || !import_constants2.isClient)
670
1337
  return;
671
1338
  let themes, sheets = document.styleSheets || [], prev = lastScannedSheets, current = new Set(sheets);
672
1339
  if (document.styleSheets) {
@@ -798,13 +1465,16 @@ var require_insertStyleRule_native = __commonJS({
798
1465
  allSelectors[identifier] = rules.join(`
799
1466
  `), track(identifier), updateRules(identifier, rules);
800
1467
  for (let rule of rules)
801
- try {
1468
+ if (process.env.NODE_ENV === "production")
802
1469
  sheet.insertRule(rule, sheet.cssRules.length);
803
- } catch (err) {
804
- console.groupCollapsed(
805
- `Error inserting rule into CSSStyleSheet: ${String(err)}`
806
- ), console.log({ rule, rulesToInsert }), console.trace(), console.groupEnd();
807
- }
1470
+ else
1471
+ try {
1472
+ sheet.insertRule(rule, sheet.cssRules.length);
1473
+ } catch (err) {
1474
+ console.groupCollapsed(
1475
+ `Error inserting rule into CSSStyleSheet: ${String(err)}`
1476
+ ), console.log({ rule, rulesToInsert }), console.trace(), console.groupEnd();
1477
+ }
808
1478
  }
809
1479
  }
810
1480
  }
@@ -812,7 +1482,7 @@ var require_insertStyleRule_native = __commonJS({
812
1482
  if (process.env.IS_STATIC === "is_static")
813
1483
  return !0;
814
1484
  let total = totalSelectorsInserted.get(identifier);
815
- return totalSelectorsInserted.size > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 5e4) && console.warn(
1485
+ return process.env.NODE_ENV === "development" && totalSelectorsInserted.size > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 5e4) && console.warn(
816
1486
  'Warning: inserting many CSS rules, you may be animating something and generating many CSS insertions, which can degrade performance. Instead, try using the "disableClassName" property on elements that change styles often. To disable this warning set TAMAGUI_STYLE_INSERTION_WARNING_LIMIT from 50000 to something higher'
817
1487
  ), total === void 0 || total < 2;
818
1488
  }
@@ -837,7 +1507,7 @@ var require_createProxy_native = __commonJS({
837
1507
  });
838
1508
  module2.exports = __toCommonJS2(createProxy_exports);
839
1509
  function createProxy(target, handler) {
840
- return (typeof target != "object" || !target) && console.warn(
1510
+ return process.env.NODE_ENV === "development" && (typeof target != "object" || !target) && console.warn(
841
1511
  "Invalid object given for proxy:",
842
1512
  target,
843
1513
  `
@@ -869,7 +1539,7 @@ var require_matchMedia_native = __commonJS({
869
1539
  module2.exports = __toCommonJS2(matchMedia_native_exports);
870
1540
  var matchMediaImpl = matchMediaFallback, matchMedia = (...args) => matchMediaImpl(...args);
871
1541
  function matchMediaFallback(query) {
872
- return console.warn("warning: matchMedia implementation is not provided."), {
1542
+ return process.env.NODE_ENV === "development" && console.warn("warning: matchMedia implementation is not provided."), {
873
1543
  match: (a, b) => !1,
874
1544
  addListener: () => {
875
1545
  },
@@ -902,10 +1572,11 @@ var require_isDevTools_native = __commonJS({
902
1572
  });
903
1573
  module2.exports = __toCommonJS2(isDevTools_exports);
904
1574
  var isDevTools = (() => {
905
- try {
906
- return new Function("try {return this===window;}catch(e){ return false;}")();
907
- } catch {
908
- }
1575
+ if (process.env.NODE_ENV === "development")
1576
+ try {
1577
+ return new Function("try {return this===window;}catch(e){ return false;}")();
1578
+ } catch {
1579
+ }
909
1580
  return !1;
910
1581
  })();
911
1582
  }
@@ -928,7 +1599,7 @@ var require_expandStyle_native = __commonJS({
928
1599
  expandStyle: () => expandStyle
929
1600
  });
930
1601
  module2.exports = __toCommonJS2(expandStyle_exports);
931
- var import_constants2 = require_index_native();
1602
+ var import_constants2 = require_index_native2();
932
1603
  function expandStyle(key, value) {
933
1604
  if (!1)
934
1605
  switch (key) {
@@ -1411,7 +2082,7 @@ var require_normalize_color = __commonJS({
1411
2082
  });
1412
2083
 
1413
2084
  // ../normalize-css-color/dist/cjs/index.native.js
1414
- var require_index_native4 = __commonJS({
2085
+ var require_index_native5 = __commonJS({
1415
2086
  "../normalize-css-color/dist/cjs/index.native.js"(exports, module2) {
1416
2087
  "use strict";
1417
2088
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
@@ -1489,7 +2160,7 @@ var require_normalizeColor_native = __commonJS({
1489
2160
  rgba: () => import_normalize_css_color2.rgba
1490
2161
  });
1491
2162
  module2.exports = __toCommonJS2(normalizeColor_exports);
1492
- var import_constants2 = require_index_native(), import_normalize_css_color = require_index_native4(), import_normalize_css_color2 = require_index_native4(), normalizeColor = (color, opacity) => {
2163
+ var import_constants2 = require_index_native2(), import_normalize_css_color = require_index_native5(), import_normalize_css_color2 = require_index_native5(), normalizeColor = (color, opacity) => {
1493
2164
  if (!color)
1494
2165
  return;
1495
2166
  if (color[0] === "$" || color[0] === "v" && color.startsWith("var(") || import_constants2.isWeb && opacity === 1)
@@ -1499,7 +2170,7 @@ var require_normalizeColor_native = __commonJS({
1499
2170
  let { r, g, b, a } = (0, import_normalize_css_color.rgba)(colorProcessed), alpha = (opacity ?? a ?? 1).toFixed(2);
1500
2171
  return `rgba(${r},${g},${b},${alpha})`;
1501
2172
  }
1502
- console.warn(`Unknown color value: ${color}`);
2173
+ process.env.NODE_ENV === "development" && console.warn(`Unknown color value: ${color}`);
1503
2174
  };
1504
2175
  }
1505
2176
  });
@@ -1522,7 +2193,7 @@ var require_normalizeValueWithProperty_native = __commonJS({
1522
2193
  reverseMapClassNameToValue: () => reverseMapClassNameToValue
1523
2194
  });
1524
2195
  module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
1525
- var import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
2196
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
1526
2197
  ...import_helpers.stylePropsAll,
1527
2198
  translateX: !0,
1528
2199
  translateY: !0
@@ -1539,13 +2210,13 @@ var require_normalizeValueWithProperty_native = __commonJS({
1539
2210
  if (rcache[cssRule])
1540
2211
  return rcache[cssRule];
1541
2212
  if (!cssRule) {
1542
- console.warn(
2213
+ process.env.NODE_ENV === "development" && console.warn(
1543
2214
  `No CSS rule found for ${key} looking for selector ".${className}", you may not be injecting extracted CSS`
1544
2215
  );
1545
2216
  return;
1546
2217
  }
1547
2218
  let cssVal = cssRule.replace(/.*:/, "").replace(/;.*/, "").trim(), res;
1548
- return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, typeof res == "number" && isNaN(res) && console.log("Tamagui invalid parsed value, NaN:", {
2219
+ return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, process.env.NODE_ENV === "development" && typeof res == "number" && isNaN(res) && console.log("Tamagui invalid parsed value, NaN:", {
1549
2220
  res,
1550
2221
  cssVal,
1551
2222
  cssRule,
@@ -1573,7 +2244,7 @@ var require_normalizeShadow_native = __commonJS({
1573
2244
  normalizeShadow: () => normalizeShadow
1574
2245
  });
1575
2246
  module2.exports = __toCommonJS2(normalizeShadow_native_exports);
1576
- var import_normalize_css_color = require_index_native4(), import_defaultOffset = require_defaultOffset_native(), import_normalizeColor = require_normalizeColor_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native();
2247
+ var import_normalize_css_color = require_index_native5(), import_defaultOffset = require_defaultOffset_native(), import_normalizeColor = require_normalizeColor_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native();
1577
2248
  function normalizeShadow({
1578
2249
  shadowColor,
1579
2250
  shadowOffset,
@@ -1668,7 +2339,7 @@ var require_expandStyles_native = __commonJS({
1668
2339
  fixStyles: () => fixStyles
1669
2340
  });
1670
2341
  module2.exports = __toCommonJS2(expandStyles_exports);
1671
- var import_constants2 = require_index_native(), import_expandStyle = require_expandStyle_native(), import_normalizeShadow = require_normalizeShadow_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
2342
+ var import_constants2 = require_index_native2(), import_expandStyle = require_expandStyle_native(), import_normalizeShadow = require_normalizeShadow_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
1672
2343
  function expandStylesAndRemoveNullishValues(style) {
1673
2344
  let res = {};
1674
2345
  for (let key in style) {
@@ -1805,7 +2476,7 @@ var require_propMapper_native = __commonJS({
1805
2476
  propMapper: () => propMapper
1806
2477
  });
1807
2478
  module2.exports = __toCommonJS2(propMapper_exports);
1808
- var import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
2479
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
1809
2480
  if (!import_constants2.isAndroid && key === "elevationAndroid")
1810
2481
  return;
1811
2482
  let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
@@ -1813,7 +2484,7 @@ var require_propMapper_native = __commonJS({
1813
2484
  return k === "curProps" ? subProps : Reflect.get(_, k);
1814
2485
  }
1815
2486
  }) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
1816
- if (fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
2487
+ if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
1817
2488
  `Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(conf.fontsParsed).join(
1818
2489
  ", "
1819
2490
  )}`
@@ -1831,7 +2502,7 @@ var require_propMapper_native = __commonJS({
1831
2502
  if (!variants)
1832
2503
  return;
1833
2504
  let variantValue = getVariantDefinition(variants[key], key, value, conf);
1834
- if (debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
2505
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
1835
2506
  key,
1836
2507
  value,
1837
2508
  variantValue,
@@ -1848,12 +2519,12 @@ var require_propMapper_native = __commonJS({
1848
2519
  }
1849
2520
  if (typeof variantValue == "function") {
1850
2521
  let fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
1851
- variantValue = fn(value, extras), debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
2522
+ variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
1852
2523
  }
1853
2524
  let fontFamilyResult;
1854
2525
  if ((0, import_isObj.isObj)(variantValue)) {
1855
2526
  let fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
1856
- fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
2527
+ fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
1857
2528
  key,
1858
2529
  variantValue,
1859
2530
  styleProps,
@@ -1882,7 +2553,7 @@ var require_propMapper_native = __commonJS({
1882
2553
  var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
1883
2554
  var _a;
1884
2555
  let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
1885
- debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
2556
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
1886
2557
  for (let rKey in value) {
1887
2558
  let fKey = conf.shorthands[rKey] || rKey, val = value[rKey];
1888
2559
  if (variants && fKey in variants) {
@@ -1911,10 +2582,10 @@ var require_propMapper_native = __commonJS({
1911
2582
  }
1912
2583
  if ((0, import_isObj.isObj)(val)) {
1913
2584
  let subObject = resolveTokensAndVariants(fKey, val, styleProps, styleState, key);
1914
- debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
2585
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
1915
2586
  } else
1916
2587
  res[fKey] = val;
1917
- debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
2588
+ process.env.NODE_ENV === "development" && debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
1918
2589
  }
1919
2590
  return res;
1920
2591
  }, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
@@ -1942,7 +2613,7 @@ var require_propMapper_native = __commonJS({
1942
2613
  return value;
1943
2614
  let { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
1944
2615
  if (theme && value in theme)
1945
- styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
2616
+ process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
1946
2617
  else if (value in conf.specificTokens)
1947
2618
  hasSet = !0, valOrVar = conf.specificTokens[value];
1948
2619
  else {
@@ -1973,7 +2644,7 @@ var require_propMapper_native = __commonJS({
1973
2644
  spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
1974
2645
  }
1975
2646
  }
1976
- return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
2647
+ return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
1977
2648
  };
1978
2649
  function resolveVariableValue(valOrVar, resolveVariablesAs) {
1979
2650
  return resolveVariablesAs === "none" ? valOrVar : (0, import_createVariable.isVariable)(valOrVar) ? !import_constants2.isWeb || resolveVariablesAs === "value" ? valOrVar.val : valOrVar.variable : valOrVar;
@@ -2025,7 +2696,7 @@ var require_ThemeManager_native = __commonJS({
2025
2696
  getNonComponentParentManager: () => getNonComponentParentManager
2026
2697
  });
2027
2698
  module2.exports = __toCommonJS2(ThemeManager_exports);
2028
- var import_constants2 = require_index_native(), import_config = require_config_native(), import_constants22 = require_constants_native(), emptyState = { name: "" };
2699
+ var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native(), emptyState = { name: "" };
2029
2700
  function getHasThemeUpdatingProps(props) {
2030
2701
  return props.name || props.componentName || props.inverse || props.reset;
2031
2702
  }
@@ -2036,9 +2707,9 @@ var require_ThemeManager_native = __commonJS({
2036
2707
  return;
2037
2708
  }
2038
2709
  if (!parentManagerIn)
2039
- throw new Error(
2710
+ throw process.env.NODE_ENV !== "production" ? new Error(
2040
2711
  "No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
2041
- );
2712
+ ) : "\u274C 0";
2042
2713
  if (this.parentManager = parentManagerIn, !this.updateStateFromProps(props, !1))
2043
2714
  return parentManagerIn || this;
2044
2715
  }
@@ -2052,7 +2723,7 @@ var require_ThemeManager_native = __commonJS({
2052
2723
  updateState(nextState, shouldNotify = !0) {
2053
2724
  this.state = nextState;
2054
2725
  let names = this.state.name.split("_"), lastName = names[names.length - 1][0];
2055
- this.isComponent = lastName[0] === lastName[0].toUpperCase(), this._allKeys = null, this.scheme = names[0] === "light" ? "light" : names[0] === "dark" ? "dark" : null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent++, shouldNotify && queueMicrotask(() => {
2726
+ this.isComponent = lastName[0] === lastName[0].toUpperCase(), this._allKeys = null, this.scheme = names[0] === "light" ? "light" : names[0] === "dark" ? "dark" : null, process.env.NODE_ENV === "development" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && queueMicrotask(() => {
2056
2727
  this.notify();
2057
2728
  });
2058
2729
  }
@@ -2080,7 +2751,7 @@ var require_ThemeManager_native = __commonJS({
2080
2751
  this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
2081
2752
  }
2082
2753
  onChangeTheme(cb, debugId) {
2083
- return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
2754
+ return process.env.NODE_ENV === "development" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
2084
2755
  this.themeListeners.delete(cb);
2085
2756
  };
2086
2757
  }
@@ -2098,7 +2769,7 @@ var require_ThemeManager_native = __commonJS({
2098
2769
  if (!props.name && !props.inverse && !props.reset && !props.componentName)
2099
2770
  return null;
2100
2771
  if (props.reset && !isDirectParentAComponentTheme && !(parentManager != null && parentManager.parentManager))
2101
- return console.warn("Cannot reset no grandparent exists"), null;
2772
+ return process.env.NODE_ENV === "development" && console.warn("Cannot reset no grandparent exists"), null;
2102
2773
  let result = null, nextName = props.reset ? isDirectParentAComponentTheme ? ((_a = parentManager == null ? void 0 : parentManager.state) == null ? void 0 : _a.name) || "" : ((_c = (_b = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _b.state) == null ? void 0 : _c.name) || "" : props.name || "", { componentName } = props, parentName = props.reset ? isDirectParentAComponentTheme ? (
2103
2774
  // here because parentManager already skipped componentTheme so we have to only go up once
2104
2775
  ((_d = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _d.state.name) || ""
@@ -2107,7 +2778,7 @@ var require_ThemeManager_native = __commonJS({
2107
2778
  let base = parentName.split(import_constants22.THEME_NAME_SEPARATOR), lastSegment = base[base.length - 1], isParentComponentTheme = parentName && lastSegment[0].toUpperCase() === lastSegment[0];
2108
2779
  isParentComponentTheme && base.pop();
2109
2780
  let parentBaseTheme = isParentComponentTheme ? base.slice(0, base.length).join(import_constants22.THEME_NAME_SEPARATOR) : parentName, max = base.length, min = componentName && !nextName ? max : 0;
2110
- typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.log({
2781
+ process.env.NODE_ENV === "development" && typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.log({
2111
2782
  props,
2112
2783
  parentName,
2113
2784
  parentBaseTheme,
@@ -2142,7 +2813,7 @@ var require_ThemeManager_native = __commonJS({
2142
2813
  potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
2143
2814
  }
2144
2815
  let found = potentials.find((t) => t in themes);
2145
- if (typeof props.debug == "string" && console.log(" - ", { found, potentials, parentManager }), found) {
2816
+ if (process.env.NODE_ENV === "development" && typeof props.debug == "string" && console.log(" - ", { found, potentials, parentManager }), found) {
2146
2817
  result = {
2147
2818
  name: found,
2148
2819
  theme: themes[found],
@@ -2154,7 +2825,7 @@ var require_ThemeManager_native = __commonJS({
2154
2825
  break;
2155
2826
  }
2156
2827
  }
2157
- return typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", {
2828
+ return process.env.NODE_ENV === "development" && typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", {
2158
2829
  result
2159
2830
  }), console.trace(), console.groupEnd()), result;
2160
2831
  }
@@ -2233,7 +2904,7 @@ var require_useTheme_native = __commonJS({
2233
2904
  useThemeWithState: () => useThemeWithState
2234
2905
  });
2235
2906
  module2.exports = __toCommonJS2(useTheme_exports);
2236
- var import_constants2 = require_index_native(), import_react = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
2907
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
2237
2908
  function getDefaultThemeProxied() {
2238
2909
  if (cached)
2239
2910
  return cached;
@@ -2251,20 +2922,20 @@ var require_useTheme_native = __commonJS({
2251
2922
  import_constants2.isServer ? void 0 : () => {
2252
2923
  var _a, _b;
2253
2924
  let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
2254
- return props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
2925
+ return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
2255
2926
  shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
2256
2927
  keys: [...keys.current]
2257
2928
  }), next;
2258
2929
  }
2259
2930
  ), { themeManager, state } = changedThemeState, { theme, name, className } = state;
2260
2931
  if (!theme)
2261
- throw new Error(
2932
+ throw process.env.NODE_ENV === "development" ? new Error(
2262
2933
  `No theme found given props ${JSON.stringify(
2263
2934
  props
2264
2935
  )}. Themes given to tamagui are: ${Object.keys((0, import_config.getConfig)().themes)}`
2265
- );
2936
+ ) : "\u274C 1";
2266
2937
  let themeProxied = (0, import_react.useMemo)(() => getThemeProxied(theme, themeManager, keys.current, props.debug), [theme, name, className, themeManager]);
2267
- return props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", name), console.log("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
2938
+ return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", name), console.log("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
2268
2939
  };
2269
2940
  function getThemeProxied(theme, themeManager, keys, debug) {
2270
2941
  return (0, import_createProxy.createProxy)(theme, {
@@ -2288,7 +2959,7 @@ var require_useTheme_native = __commonJS({
2288
2959
  // when they touch the actual value we only track it
2289
2960
  // if its a variable (web), its ignored!
2290
2961
  get(_2, subkey) {
2291
- return keys && (subkey === "val" || subkey === "get" && !import_constants2.isWeb) && !keys.includes(keyString) && (keys.push(keyString), debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${keyString}`)), subkey === "get" ? () => (0, import_createVariable.getVariable)(val) : Reflect.get(val, subkey);
2962
+ return keys && (subkey === "val" || subkey === "get" && !import_constants2.isWeb) && !keys.includes(keyString) && (keys.push(keyString), process.env.NODE_ENV === "development" && debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${keyString}`)), subkey === "get" ? () => (0, import_createVariable.getVariable)(val) : Reflect.get(val, subkey);
2292
2963
  }
2293
2964
  });
2294
2965
  }
@@ -2329,7 +3000,7 @@ var require_useTheme_native = __commonJS({
2329
3000
  forced && setThemeState((prev) => createState(prev, !0));
2330
3001
  }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
2331
3002
  let force = shouldUpdate == null ? void 0 : shouldUpdate(), doUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
2332
- props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
3003
+ process.env.NODE_ENV === "development" && props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
2333
3004
  force,
2334
3005
  doUpdate,
2335
3006
  props,
@@ -2350,7 +3021,7 @@ var require_useTheme_native = __commonJS({
2350
3021
  props.name,
2351
3022
  props.reset,
2352
3023
  mounted
2353
- ]), props.debug !== "profile" && (0, import_react.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
3024
+ ]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
2354
3025
  globalThis.TamaguiThemeManagers.delete(themeManager);
2355
3026
  }), [themeManager])), isInversingOnMount) {
2356
3027
  if (!parentManager)
@@ -2396,7 +3067,7 @@ var require_useTheme_native = __commonJS({
2396
3067
  isNewTheme: isNewTheme2,
2397
3068
  mounted: mounted2
2398
3069
  };
2399
- if (props.debug && import_constants2.isClient) {
3070
+ if (process.env.NODE_ENV === "development" && props.debug && import_constants2.isClient) {
2400
3071
  console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
2401
3072
  let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
2402
3073
  console.log({
@@ -2449,18 +3120,21 @@ var require_useMedia_native = __commonJS({
2449
3120
  useMediaPropsActive: () => useMediaPropsActive2
2450
3121
  });
2451
3122
  module2.exports = __toCommonJS2(useMedia_exports);
2452
- var import_constants2 = require_index_native(), import_react = require("react"), import_config = require_config_native(), import_createProxy = require_createProxy_native(), import_matchMedia = require_matchMedia_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useTheme = require_useTheme_native(), mediaState2 = (0, import_createProxy.createProxy)(
2453
- {},
2454
- {
2455
- get(target, key) {
2456
- if (typeof key == "string" && key[0] === "$" && // dont error on $$typeof
2457
- key[1] !== "$")
2458
- throw new Error(`Access mediaState should not use "$": ${key}`);
2459
- return Reflect.get(target, key);
3123
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createProxy = require_createProxy_native(), import_matchMedia = require_matchMedia_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useTheme = require_useTheme_native(), mediaState2 = (
3124
+ // development only safeguard
3125
+ process.env.NODE_ENV === "development" ? (0, import_createProxy.createProxy)(
3126
+ {},
3127
+ {
3128
+ get(target, key) {
3129
+ if (typeof key == "string" && key[0] === "$" && // dont error on $$typeof
3130
+ key[1] !== "$")
3131
+ throw new Error(`Access mediaState should not use "$": ${key}`);
3132
+ return Reflect.get(target, key);
3133
+ }
2460
3134
  }
2461
- }
3135
+ ) : {}
2462
3136
  ), mediaQueryConfig2 = {}, getMedia2 = () => mediaState2, mediaKeys = /* @__PURE__ */ new Set(), isMediaKey = (key) => mediaKeys.has(key) || key[0] === "$" && (key.startsWith("$platform-") || key.startsWith("$theme-") || key.startsWith("$group-")), initState, getInitialMediaState = () => ((0, import_config.getConfig)().disableSSR ? mediaState2 : initState) || {}, defaultMediaImportance = Object.keys(import_pseudoDescriptors.pseudoDescriptors).length, mediaKeysOrdered, getMediaKeyImportance = (key) => {
2463
- if (key[0] === "$")
3137
+ if (process.env.NODE_ENV === "development" && key[0] === "$")
2464
3138
  throw new Error("use short key");
2465
3139
  return (0, import_config.getConfig)().settings.mediaPropOrder ? defaultMediaImportance : mediaKeysOrdered.indexOf(key) + 100;
2466
3140
  }, dispose = /* @__PURE__ */ new Set(), mediaVersion = 0, configureMedia2 = (config) => {
@@ -2626,7 +3300,7 @@ var require_Tamagui_native = __commonJS({
2626
3300
  setIdentifierValue: () => setIdentifierValue
2627
3301
  });
2628
3302
  module2.exports = __toCommonJS2(Tamagui_exports);
2629
- var Helpers = __toESM2(require_index_native3()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
3303
+ var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
2630
3304
  constructor() {
2631
3305
  this.Helpers = Helpers;
2632
3306
  }
@@ -2679,7 +3353,7 @@ var require_compose_refs_native = __commonJS({
2679
3353
  useComposedRefs: () => useComposedRefs
2680
3354
  });
2681
3355
  module2.exports = __toCommonJS2(compose_refs_exports);
2682
- var React2 = __toESM2(require("react"));
3356
+ var React = __toESM2(require("react"));
2683
3357
  function setRef(ref, value) {
2684
3358
  typeof ref == "function" ? ref(value) : ref && (ref.current = value);
2685
3359
  }
@@ -2687,13 +3361,13 @@ var require_compose_refs_native = __commonJS({
2687
3361
  return (node) => refs.forEach((ref) => setRef(ref, node));
2688
3362
  }
2689
3363
  function useComposedRefs(...refs) {
2690
- return React2.useCallback(composeRefs(...refs), refs);
3364
+ return React.useCallback(composeRefs(...refs), refs);
2691
3365
  }
2692
3366
  }
2693
3367
  });
2694
3368
 
2695
3369
  // ../compose-refs/dist/cjs/index.native.js
2696
- var require_index_native5 = __commonJS({
3370
+ var require_index_native6 = __commonJS({
2697
3371
  "../compose-refs/dist/cjs/index.native.js"(exports, module2) {
2698
3372
  "use strict";
2699
3373
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
@@ -2708,7 +3382,7 @@ var require_index_native5 = __commonJS({
2708
3382
  });
2709
3383
 
2710
3384
  // ../use-did-finish-ssr/dist/cjs/index.native.js
2711
- var require_index_native6 = __commonJS({
3385
+ var require_index_native7 = __commonJS({
2712
3386
  "../use-did-finish-ssr/dist/cjs/index.native.js"(exports, module2) {
2713
3387
  "use strict";
2714
3388
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
@@ -3115,7 +3789,7 @@ var require_getSplitStyles_native = __commonJS({
3115
3789
  useSplitStyles: () => useSplitStyles
3116
3790
  });
3117
3791
  module2.exports = __toCommonJS2(getSplitStyles_exports);
3118
- var import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_react = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3792
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3119
3793
  var _a, _b, _c, _e, _f, _g;
3120
3794
  conf = conf || (0, import_config.getConfig)();
3121
3795
  let { shorthands } = conf, {
@@ -3142,7 +3816,7 @@ var require_getSplitStyles_native = __commonJS({
3142
3816
  context,
3143
3817
  debug
3144
3818
  };
3145
- debug && debug !== "profile" && import_constants2.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), console.log({
3819
+ process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants2.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), console.log({
3146
3820
  props,
3147
3821
  staticConfig,
3148
3822
  shouldDoClasses,
@@ -3209,7 +3883,7 @@ var require_getSplitStyles_native = __commonJS({
3209
3883
  continue;
3210
3884
  let shouldPassProp = !isStyleProp || // is in parent variants
3211
3885
  isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) != null && _a[keyInit] || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
3212
- if (debug === "verbose" && (console.groupCollapsed(
3886
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
3213
3887
  `\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
3214
3888
  ), console.log({ isVariant, valInit, shouldPassProp }), import_constants2.isClient && console.log({
3215
3889
  variants,
@@ -3225,7 +3899,7 @@ var require_getSplitStyles_native = __commonJS({
3225
3899
  continue;
3226
3900
  }
3227
3901
  let expanded = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit ? [[keyInit, valInit]] : (0, import_propMapper.propMapper)(keyInit, valInit, styleState), next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
3228
- if (next && (styleState.fontFamily = next), debug === "verbose") {
3902
+ if (next && (styleState.fontFamily = next), process.env.NODE_ENV === "development" && debug === "verbose") {
3229
3903
  console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
3230
3904
  try {
3231
3905
  !import_constants2.isServer && import_isDevTools.isDevTools && (console.log({
@@ -3252,7 +3926,7 @@ current`, {
3252
3926
  for (let [key, val] of expanded)
3253
3927
  if (!(val == null || key in usedKeys)) {
3254
3928
  if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = isMedia || isPseudo, isVariant = variants && key in variants, (inlineProps != null && inlineProps.has(key) || IS_STATIC && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key)) && (viewProps[key] = props[key] ?? val), isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]))) {
3255
- passDownProp(viewProps, key, val, isMediaOrPseudo), debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), console.log({ val, after: { ...viewProps[key] } }), console.groupEnd());
3929
+ passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), console.log({ val, after: { ...viewProps[key] } }), console.groupEnd());
3256
3930
  continue;
3257
3931
  }
3258
3932
  if (isPseudo) {
@@ -3264,7 +3938,7 @@ current`, {
3264
3938
  val,
3265
3939
  styleProps.noClassNames
3266
3940
  ), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
3267
- if (!styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit) && console.warn(
3941
+ if (process.env.NODE_ENV === "development" && !styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit) && console.warn(
3268
3942
  `No animation prop given to component ${staticConfig.componentName || ""} with enterStyle / exitStyle, these styles will be ignore.`
3269
3943
  ), !descriptor || isExit && !styleProps.isExiting)
3270
3944
  continue;
@@ -3274,12 +3948,12 @@ current`, {
3274
3948
  }
3275
3949
  if (shouldDoClasses && !isEnter && !isExit) {
3276
3950
  let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
3277
- debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), console.log({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
3951
+ process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), console.log({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
3278
3952
  for (let psuedoStyle of pseudoStyles)
3279
3953
  `${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
3280
3954
  } else {
3281
3955
  let descriptorKey = descriptor.stateKey || descriptor.name, pseudoState = componentState[descriptorKey], isDisabled = isExit ? !styleProps.isExiting : !pseudoState;
3282
- import_constants2.isWeb && !import_constants2.isClient && isEnter && (isDisabled = !1), debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), console.log(pseudoStyleObject, {
3956
+ import_constants2.isWeb && !import_constants2.isClient && isEnter && (isDisabled = !1), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), console.log(pseudoStyleObject, {
3283
3957
  isDisabled,
3284
3958
  descriptorKey,
3285
3959
  descriptor,
@@ -3296,7 +3970,7 @@ current`, {
3296
3970
  }
3297
3971
  } else {
3298
3972
  let curImportance = usedKeys[importance] || 0, shouldMerge = importance >= curImportance;
3299
- shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2), usedKeys[pkey] ||= 1), debug === "verbose" && console.log(" subKey", pkey, shouldMerge, {
3973
+ shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2), usedKeys[pkey] ||= 1), process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" subKey", pkey, shouldMerge, {
3300
3974
  importance,
3301
3975
  curImportance,
3302
3976
  pkey,
@@ -3332,7 +4006,7 @@ current`, {
3332
4006
  // TODO try true like pseudo
3333
4007
  !1
3334
4008
  ), mediaKeyShort = key.slice(1);
3335
- debug === "verbose" && console.log(` \u{1F4FA} ${key}`, { key, val, mediaStyle, props, shouldDoClasses, componentState });
4009
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.log(` \u{1F4FA} ${key}`, { key, val, mediaStyle, props, shouldDoClasses, componentState });
3336
4010
  let hasSpace = val.space;
3337
4011
  if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
3338
4012
  if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
@@ -3342,7 +4016,7 @@ current`, {
3342
4016
  usedKeys,
3343
4017
  !0
3344
4018
  );
3345
- importance && (space = val.space, usedKeys.space = importance, debug === "verbose" && console.log(
4019
+ importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(
3346
4020
  `Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
3347
4021
  ));
3348
4022
  }
@@ -3371,7 +4045,7 @@ current`, {
3371
4045
  } else if (isGroupMedia) {
3372
4046
  let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
3373
4047
  if (!groupContext) {
3374
- debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
4048
+ process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
3375
4049
  continue;
3376
4050
  }
3377
4051
  let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_c = componentState.group) == null ? void 0 : _c[groupName];
@@ -3423,7 +4097,7 @@ current`, {
3423
4097
  }
3424
4098
  isVariant || (viewProps[key] = val);
3425
4099
  }
3426
- if (debug === "verbose") {
4100
+ if (process.env.NODE_ENV === "development" && debug === "verbose") {
3427
4101
  console.groupCollapsed(" \u2714\uFE0F expand complete", keyInit);
3428
4102
  try {
3429
4103
  console.log("style", { ...style }), console.log("viewProps", { ...viewProps });
@@ -3458,9 +4132,9 @@ current`, {
3458
4132
  let overrideFace = (_g = (_f = faceInfo[style.fontWeight]) == null ? void 0 : _f[style.fontStyle || "normal"]) == null ? void 0 : _g.val;
3459
4133
  overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
3460
4134
  }
3461
- debug && debug !== "profile" && console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
4135
+ process.env.NODE_ENV === "development" && debug && debug !== "profile" && console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
3462
4136
  }
3463
- if (className && (classNames.className = className), debug === "verbose" && import_isDevTools.isDevTools) {
4137
+ if (className && (classNames.className = className), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
3464
4138
  console.groupCollapsed(" \u{1F539} ===>");
3465
4139
  try {
3466
4140
  let logs = {
@@ -3550,6 +4224,7 @@ current`, {
3550
4224
  // handled after loop so pseudos set usedKeys and override it if necessary
3551
4225
  group: 1
3552
4226
  };
4227
+ process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
3553
4228
  Object.assign(skipProps, {
3554
4229
  whiteSpace: 1,
3555
4230
  wordWrap: 1,
@@ -3705,7 +4380,7 @@ var require_Theme_native = __commonJS({
3705
4380
  wrapThemeElements: () => wrapThemeElements
3706
4381
  });
3707
4382
  module2.exports = __toCommonJS2(Theme_exports);
3708
- var import_constants2 = require_index_native(), import_react = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react.forwardRef)(function(props, ref) {
4383
+ var import_constants2 = require_index_native2(), import_react = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react.forwardRef)(function(props, ref) {
3709
4384
  if (props.disable)
3710
4385
  return props.children;
3711
4386
  let isRoot = !!props._isRoot, disableDirectChildTheme = props["disable-child-theme"], themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), children = (0, import_react.useMemo)(() => {
@@ -3718,7 +4393,7 @@ var require_Theme_native = __commonJS({
3718
4393
  import_react.default.Children.only(children2), children2 = (0, import_react.cloneElement)(children2, { ref });
3719
4394
  } catch {
3720
4395
  }
3721
- return props.debug === "visualize" && (children2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: children2 })), children2;
4396
+ return process.env.NODE_ENV === "development" && props.debug === "visualize" && (children2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: children2 })), children2;
3722
4397
  }, [props.children, disableDirectChildTheme]);
3723
4398
  return useThemedChildren(themeState, children, props, isRoot);
3724
4399
  });
@@ -3861,7 +4536,7 @@ var require_Slot_native = __commonJS({
3861
4536
  Slottable: () => Slottable
3862
4537
  });
3863
4538
  module2.exports = __toCommonJS2(Slot_exports);
3864
- var import_compose_refs = require_index_native5(), import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react.forwardRef)(function(props, forwardedRef) {
4539
+ var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react.forwardRef)(function(props, forwardedRef) {
3865
4540
  let { children, ...slotProps } = props;
3866
4541
  if ((0, import_react.isValidElement)(children)) {
3867
4542
  let mergedProps = mergeSlotProps(children, slotProps);
@@ -3922,7 +4597,7 @@ var require_createComponent_native = __commonJS({
3922
4597
  spacedChildren: () => spacedChildren
3923
4598
  });
3924
4599
  module2.exports = __toCommonJS2(createComponent_exports);
3925
- var import_compose_refs = require_index_native5(), import_constants2 = require_index_native(), import_helpers = require_index_native3(), import_use_did_finish_ssr = require_index_native6(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, mouseUps = /* @__PURE__ */ new Set();
4600
+ var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native7(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, mouseUps = /* @__PURE__ */ new Set();
3926
4601
  if (typeof document < "u") {
3927
4602
  let cancelTouches = () => {
3928
4603
  mouseUps.forEach((x) => x()), mouseUps.clear();
@@ -3936,7 +4611,7 @@ var require_createComponent_native = __commonJS({
3936
4611
  (0, import_config.onConfiguredOnce)((conf) => {
3937
4612
  if (config = conf, !tamaguiConfig && (tamaguiConfig = conf, !initialTheme)) {
3938
4613
  let next = conf.themes[Object.keys(conf.themes)[0]];
3939
- initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next), initialTheme || console.log("Warning: Missing theme");
4614
+ initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next), process.env.NODE_ENV === "development" && (initialTheme || console.log("Warning: Missing theme"));
3940
4615
  }
3941
4616
  });
3942
4617
  let {
@@ -3947,7 +4622,7 @@ var require_createComponent_native = __commonJS({
3947
4622
  validStyles: validStyles2 = {},
3948
4623
  variants = {}
3949
4624
  } = staticConfig, defaultComponentClassName = `is_${staticConfig.componentName}`, defaultProps = staticConfig.defaultProps;
3950
- (_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
4625
+ process.env.NODE_ENV === "development" && (_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
3951
4626
  staticConfig,
3952
4627
  defaultProps,
3953
4628
  defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
@@ -3959,6 +4634,7 @@ var require_createComponent_native = __commonJS({
3959
4634
  let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
3960
4635
  baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
3961
4636
  }
4637
+ process.env.NODE_ENV === "test" && propsIn["data-test-renders"] && (propsIn["data-test-renders"].current ??= 0, propsIn["data-test-renders"].current += 1);
3962
4638
  let componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context } = staticConfig;
3963
4639
  if (context) {
3964
4640
  contextValue = (0, import_react.useContext)(context);
@@ -3974,20 +4650,20 @@ var require_createComponent_native = __commonJS({
3974
4650
  let curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps, props;
3975
4651
  curDefaultProps ? props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn) : props = propsIn;
3976
4652
  let debugProp = props.debug, componentName = props.componentName || staticConfig.componentName;
3977
- time && time`start (ignore)`;
4653
+ process.env.NODE_ENV === "development" && time && time`start (ignore)`;
3978
4654
  let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)();
3979
- time && time`did-finish-ssr`;
4655
+ process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
3980
4656
  let stateRef = (0, import_react.useRef)(
3981
4657
  void 0
3982
4658
  );
3983
- stateRef.current ||= {}, time && time`stateref`;
4659
+ stateRef.current ||= {}, process.env.NODE_ENV === "development" && time && time`stateref`;
3984
4660
  let hostRef = (0, import_react.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
3985
4661
  if (import_constants2.isServer && !supportsCSSVars)
3986
4662
  return !1;
3987
4663
  let curState = stateRef.current;
3988
4664
  return !!(hasAnimationProp && !isHOC && useAnimations || curState.hasAnimated);
3989
4665
  })(), usePresence = animationsConfig == null ? void 0 : animationsConfig.usePresence, presence = willBeAnimated && (usePresence == null ? void 0 : usePresence()) || null, hasEnterStyle = !!props.enterStyle, needsMount = !!((!import_constants2.isWeb || import_constants2.isClient) && willBeAnimated);
3990
- time && time`pre-use-state`;
4666
+ process.env.NODE_ENV === "development" && time && time`pre-use-state`;
3991
4667
  let initialState = willBeAnimated ? supportsCSSVars ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState), groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
3992
4668
  if (groupName) {
3993
4669
  let groupContextState = componentContext.groups.state, og = setStateShallow;
@@ -4002,11 +4678,11 @@ var require_createComponent_native = __commonJS({
4002
4678
  groupContextState[groupName] = next;
4003
4679
  };
4004
4680
  }
4005
- time && time`use-state`;
4681
+ process.env.NODE_ENV === "development" && time && time`use-state`;
4006
4682
  let isAnimated = willBeAnimated;
4007
4683
  willBeAnimated && !supportsCSSVars && !presence && isHydrated && (import_constants2.isServer || state.unmounted === !0) && (isAnimated = !1), willBeAnimated && !stateRef.current.hasAnimated && (stateRef.current.hasAnimated = !0);
4008
4684
  let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_c = props.accessibilityState) == null ? void 0 : _c.disabled);
4009
- time && time`use-context`;
4685
+ process.env.NODE_ENV === "development" && time && time`use-context`;
4010
4686
  let element = import_constants2.isWeb && (!Component || typeof Component == "string") && props.tag || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
4011
4687
  AnimatedText = animationsConfig ? animationsConfig.Text : BaseTextComponent, AnimatedView = animationsConfig ? animationsConfig.View : BaseViewComponent;
4012
4688
  let elementType = isText ? (isAnimated ? AnimatedText : null) || BaseTextComponent : (isAnimated ? AnimatedView : null) || BaseViewComponent;
@@ -4014,11 +4690,11 @@ var require_createComponent_native = __commonJS({
4014
4690
  let presenceState = presence[2];
4015
4691
  if (presenceState) {
4016
4692
  let isEntering = state.unmounted, isExiting2 = !presenceState.isPresent, enterExitVariant = presenceState.enterExitVariant, enterVariant = enterExitVariant ?? presenceState.enterVariant, exitVariant = enterExitVariant ?? presenceState.exitVariant;
4017
- isEntering && enterVariant ? (debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
4693
+ isEntering && enterVariant ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
4018
4694
  }
4019
4695
  }
4020
4696
  let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants2.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableThemeProp = props["data-disable-theme"], disableTheme = disableThemeProp && !willBeAnimated || isHOC;
4021
- time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
4697
+ process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
4022
4698
  let themeStateProps = {
4023
4699
  name: props.theme,
4024
4700
  componentName,
@@ -4028,7 +4704,7 @@ var require_createComponent_native = __commonJS({
4028
4704
  shouldUpdate: () => stateRef.current.isListeningToTheme,
4029
4705
  debug: debugProp
4030
4706
  }, isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
4031
- {
4707
+ if (process.env.NODE_ENV === "development") {
4032
4708
  let id = (0, import_react.useId)();
4033
4709
  if (debugProp && debugProp !== "profile") {
4034
4710
  let name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${id}`;
@@ -4055,17 +4731,17 @@ var require_createComponent_native = __commonJS({
4055
4731
  }), console.groupEnd());
4056
4732
  }
4057
4733
  }
4058
- time && time`pre-theme-media`;
4734
+ process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
4059
4735
  let [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
4060
4736
  elementType = Component || elementType;
4061
4737
  let isStringElement = typeof elementType == "string";
4062
- time && time`theme`;
4738
+ process.env.NODE_ENV === "development" && time && time`theme`;
4063
4739
  let mediaState2 = (0, import_useMedia.useMedia)(
4064
4740
  // @ts-ignore, we just pass a stable object so we can get it later with
4065
4741
  // should match to the one used in `setMediaShouldUpdate` below
4066
4742
  stateRef
4067
4743
  );
4068
- time && time`media`, (0, import_createVariable.setDidGetVariableValue)(!1);
4744
+ process.env.NODE_ENV === "development" && time && time`media`, (0, import_createVariable.setDidGetVariableValue)(!1);
4069
4745
  let resolveVariablesAs = (
4070
4746
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
4071
4747
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
@@ -4088,14 +4764,14 @@ var require_createComponent_native = __commonJS({
4088
4764
  elementType,
4089
4765
  debugProp
4090
4766
  );
4091
- props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured && (splitStyles.style.opacity = 0), time && time`split-styles`, stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess;
4767
+ props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured && (splitStyles.style.opacity = 0), process.env.NODE_ENV === "development" && time && time`split-styles`, stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess;
4092
4768
  let isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
4093
4769
  (0, import_useMedia.setMediaShouldUpdate)(stateRef, {
4094
4770
  enabled: shouldListenForMedia,
4095
4771
  keys: mediaListeningKeys
4096
4772
  });
4097
4773
  let isAnimatedReactNativeWeb = hasAnimationProp && isReactNative;
4098
- if (debugProp && debugProp !== "profile" && (console.groupCollapsed(">>>"), console.log("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), console.log("splitStyles", splitStyles), console.log("media", { shouldListenForMedia, isMediaArray, mediaListeningKeys }), console.log("className", Object.values(splitStyles.classNames)), import_constants2.isClient && console.log("ref", hostRef, "(click to view)"), console.groupEnd(), debugProp === "break"))
4774
+ if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed(">>>"), console.log("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), console.log("splitStyles", splitStyles), console.log("media", { shouldListenForMedia, isMediaArray, mediaListeningKeys }), console.log("className", Object.values(splitStyles.classNames)), import_constants2.isClient && console.log("ref", hostRef, "(click to view)"), console.groupEnd(), debugProp === "break"))
4099
4775
  debugger;
4100
4776
  let {
4101
4777
  viewProps: viewPropsIn,
@@ -4118,7 +4794,7 @@ var require_createComponent_native = __commonJS({
4118
4794
  hostRef,
4119
4795
  staticConfig
4120
4796
  });
4121
- isAnimated && animations && (animationStyles = animations.style), time && time`animations`;
4797
+ isAnimated && animations && (animationStyles = animations.style), process.env.NODE_ENV === "development" && time && time`animations`;
4122
4798
  }
4123
4799
  let {
4124
4800
  asChild,
@@ -4146,11 +4822,11 @@ var require_createComponent_native = __commonJS({
4146
4822
  defaultVariants,
4147
4823
  ...nonTamaguiProps
4148
4824
  } = viewPropsIn;
4149
- props.untilMeasured && !props.group && console.warn(
4825
+ process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(
4150
4826
  `You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
4151
4827
 
4152
4828
  If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`
4153
- ), time && time`destructure`;
4829
+ ), process.env.NODE_ENV === "development" && time && time`destructure`;
4154
4830
  let disabled = ((_d = props.accessibilityState) == null ? void 0 : _d.disabled) || // @ts-expect-error (comes from core)
4155
4831
  props.accessibilityDisabled, viewProps = nonTamaguiProps;
4156
4832
  isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
@@ -4162,12 +4838,12 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4162
4838
  }
4163
4839
  )), viewProps = nonTamaguiProps;
4164
4840
  let composedRef = (0, import_compose_refs.useComposedRefs)(hostRef, forwardedRef);
4165
- viewProps.ref = composedRef, !isReactNative && !isText && import_constants2.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach((item) => {
4841
+ viewProps.ref = composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants2.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach((item) => {
4166
4842
  typeof item == "string" && item !== `
4167
4843
  ` && console.error(
4168
4844
  `Unexpected text node: ${item}. A text node cannot be a child of a <View>.`
4169
4845
  );
4170
- }), time && time`events-hooks`;
4846
+ }), process.env.NODE_ENV === "development" && time && time`events-hooks`;
4171
4847
  let unPress = () => setStateShallow({
4172
4848
  press: !1,
4173
4849
  pressIn: !1
@@ -4220,7 +4896,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4220
4896
  let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = avoidAnimationStyle ? splitStyles.style : animationStyles || splitStyles.style, className;
4221
4897
  viewProps.style = style;
4222
4898
  let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), isHoverable = import_constants2.isWeb && !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave), handlesPressEvents = !(import_constants2.isWeb || asChild), shouldAttach = !!(attachPress || isHoverable || noClassNames && "pressStyle" in props || import_constants2.isWeb && noClassNames && "hoverStyle" in props);
4223
- time && time`events-setup`;
4899
+ process.env.NODE_ENV === "development" && time && time`events-setup`;
4224
4900
  let events = shouldAttach && !isDisabled && !asChild ? {
4225
4901
  onPressOut: attachPress ? (e) => {
4226
4902
  unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
@@ -4257,9 +4933,9 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4257
4933
  delayPressOut: viewProps.delayPressOut,
4258
4934
  focusable: viewProps.focusable ?? !0,
4259
4935
  minPressDuration: 0
4260
- }), time && time`events`, debugProp === "verbose" && console.log("events", { events, isHoverable, attachPress }), (_i = (_h = import_setupHooks.hooks).useEvents) == null || _i.call(_h, viewProps, events, splitStyles, setStateShallow);
4936
+ }), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && console.log("events", { events, isHoverable, attachPress }), (_i = (_h = import_setupHooks.hooks).useEvents) == null || _i.call(_h, viewProps, events, splitStyles, setStateShallow);
4261
4937
  let direction = props.spaceDirection || "both";
4262
- time && time`hooks`;
4938
+ process.env.NODE_ENV === "development" && time && time`hooks`;
4263
4939
  let content = !children || asChild ? children : spacedChildren({
4264
4940
  separator,
4265
4941
  children,
@@ -4273,8 +4949,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4273
4949
  onLongPress,
4274
4950
  onPressIn,
4275
4951
  onPressOut
4276
- })), time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
4277
- elementType === BaseText || elementType === BaseView ? (viewProps.children = content, content = elementType.render(viewProps, viewProps.ref)) : content = (0, import_react.createElement)(elementType, viewProps, content), time && time`create-element`;
4952
+ })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
4953
+ process.env.NODE_ENV !== "test" && (elementType === BaseText || elementType === BaseView) ? (viewProps.children = content, content = elementType.render(viewProps, viewProps.ref)) : content = (0, import_react.createElement)(elementType, viewProps, content), process.env.NODE_ENV === "development" && time && time`create-element`;
4278
4954
  let subGroupContext = (0, import_react.useMemo)(() => {
4279
4955
  if (groupName)
4280
4956
  return {
@@ -4294,11 +4970,11 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4294
4970
  }
4295
4971
  };
4296
4972
  }, [groupName]);
4297
- if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { groups: subGroupContext, children: content })), time && time`group-context`, content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps), time && time`themed-children`, props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), overriddenContextProps) {
4973
+ if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), overriddenContextProps) {
4298
4974
  let Provider = staticConfig.context.Provider;
4299
4975
  content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { ...contextValue, ...overriddenContextProps, children: content });
4300
4976
  }
4301
- if (debugProp && debugProp !== "profile") {
4977
+ if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
4302
4978
  console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> with props`);
4303
4979
  try {
4304
4980
  console.log("viewProps", viewProps), console.log("viewPropsOrder", Object.keys(viewProps));
@@ -4337,7 +5013,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4337
5013
  }
4338
5014
  console.groupEnd(), console.groupEnd();
4339
5015
  }
4340
- return time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
5016
+ return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
4341
5017
  delete globalThis.willPrint, time.print(), time = null;
4342
5018
  }, 50))), content;
4343
5019
  });
@@ -4458,7 +5134,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4458
5134
  })
4459
5135
  ));
4460
5136
  }
4461
- return props.debug && console.log(" Spaced children", final, props), final;
5137
+ return process.env.NODE_ENV === "development" && props.debug && console.log(" Spaced children", final, props), final;
4462
5138
  }
4463
5139
  function createSpacer({ key, direction, space, spaceFlex }) {
4464
5140
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -4565,7 +5241,7 @@ var require_createVariables_native = __commonJS({
4565
5241
  createVariables: () => createVariables
4566
5242
  });
4567
5243
  module2.exports = __toCommonJS2(createVariables_exports);
4568
- var import_helpers = require_index_native3(), import_createVariable = require_createVariable_native(), cache = /* @__PURE__ */ new WeakMap(), createVariables = (tokens, parentPath = "", isFont = !1) => {
5244
+ var import_helpers = require_index_native4(), import_createVariable = require_createVariable_native(), cache = /* @__PURE__ */ new WeakMap(), createVariables = (tokens, parentPath = "", isFont = !1) => {
4569
5245
  if (cache.has(tokens))
4570
5246
  return tokens;
4571
5247
  let res = {}, i = 0;
@@ -4861,17 +5537,19 @@ var require_createTamagui_native = __commonJS({
4861
5537
  createTamagui: () => createTamagui
4862
5538
  });
4863
5539
  module2.exports = __toCommonJS2(createTamagui_exports);
4864
- var import_constants2 = require_index_native(), import_config = require_config_native(), import_createVariables = require_createVariables_native(), import_getThemeCSSRules = require_getThemeCSSRules_native(), import_insertStyleRule = require_insertStyleRule_native(), import_proxyThemeToParents = require_proxyThemeToParents_native(), import_registerCSSVariable = require_registerCSSVariable_native(), import_themes = require_themes_native(), import_useMedia = require_useMedia_native(), import_insertFont = require_insertFont_native(), import_Tamagui = require_Tamagui_native(), createdConfigs = /* @__PURE__ */ new WeakMap();
5540
+ var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariables = require_createVariables_native(), import_getThemeCSSRules = require_getThemeCSSRules_native(), import_insertStyleRule = require_insertStyleRule_native(), import_proxyThemeToParents = require_proxyThemeToParents_native(), import_registerCSSVariable = require_registerCSSVariable_native(), import_themes = require_themes_native(), import_useMedia = require_useMedia_native(), import_insertFont = require_insertFont_native(), import_Tamagui = require_Tamagui_native(), createdConfigs = /* @__PURE__ */ new WeakMap();
4865
5541
  function createTamagui(configIn) {
4866
5542
  var _a;
4867
5543
  if (createdConfigs.has(configIn))
4868
5544
  return configIn;
4869
- if (!configIn.tokens)
4870
- throw new Error("Must define tokens");
4871
- if (!configIn.themes)
4872
- throw new Error("Must define themes");
4873
- if (!configIn.fonts)
4874
- throw new Error("Must define fonts");
5545
+ if (process.env.NODE_ENV === "development") {
5546
+ if (!configIn.tokens)
5547
+ throw new Error("Must define tokens");
5548
+ if (!configIn.themes)
5549
+ throw new Error("Must define themes");
5550
+ if (!configIn.fonts)
5551
+ throw new Error("Must define fonts");
5552
+ }
4875
5553
  let tokens = (0, import_createVariables.createVariables)(configIn.tokens), tokensParsed = {}, tokensMerged = {};
4876
5554
  for (let cat in tokens) {
4877
5555
  tokensParsed[cat] = {}, tokensMerged[cat] = {};
@@ -4901,7 +5579,7 @@ var require_createTamagui_native = __commonJS({
4901
5579
  for (let key in tokens)
4902
5580
  for (let skey in tokens[key]) {
4903
5581
  let variable = tokens[key][skey];
4904
- if (specificTokens[`$${key}.${skey}`] = variable, typeof variable > "u")
5582
+ if (specificTokens[`$${key}.${skey}`] = variable, process.env.NODE_ENV === "development" && typeof variable > "u")
4905
5583
  throw new Error(
4906
5584
  `No value for tokens.${key}.${skey}:
4907
5585
  ${JSON.stringify(
@@ -4925,7 +5603,7 @@ ${JSON.stringify(
4925
5603
  language
4926
5604
  };
4927
5605
  }
4928
- let sep = configIn.cssStyleSeparator || " ";
5606
+ let sep = process.env.NODE_ENV === "development" ? configIn.cssStyleSeparator || " " : "";
4929
5607
  if (cssRuleSets.push(declarationsToRuleSet2(declarations)), fontDeclarations)
4930
5608
  for (let key in fontDeclarations) {
4931
5609
  let { name, declarations: declarations2, language = "default" } = fontDeclarations[key], fontSelector = `.font_${name}`, langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`, selectors = language === "default" ? ` ${fontSelector}, ${langSelector}` : langSelector, specificRuleSet = declarationsToRuleSet2(declarations2, selectors);
@@ -4994,7 +5672,7 @@ ${runtimeStyles}`;
4994
5672
  // const tokens = [...getToken(tokens.size[0])]
4995
5673
  // .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }
4996
5674
  };
4997
- return (0, import_useMedia.configureMedia)(config), (0, import_config.setConfig)(config), import_config.configListeners.size && (import_config.configListeners.forEach((cb) => cb(config)), import_config.configListeners.clear()), createdConfigs.set(config, !0), (_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.log("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui), config;
5675
+ return (0, import_useMedia.configureMedia)(config), (0, import_config.setConfig)(config), import_config.configListeners.size && (import_config.configListeners.forEach((cb) => cb(config)), import_config.configListeners.clear()), createdConfigs.set(config, !0), process.env.NODE_ENV === "development" && ((_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.log("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui)), config;
4998
5676
  }
4999
5677
  function getThemesDeduped(themes) {
5000
5678
  let dedupedThemes = [], existing = /* @__PURE__ */ new Map();
@@ -5150,7 +5828,7 @@ var require_styled_native = __commonJS({
5150
5828
  module2.exports = __toCommonJS2(styled_exports);
5151
5829
  var import_createComponent = require_createComponent_native(), import_mergeVariants = require_mergeVariants_native(), import_setupReactNative = require_setupReactNative_native();
5152
5830
  function styled(ComponentIn, options, staticExtractionOptions) {
5153
- if (!ComponentIn)
5831
+ if (process.env.NODE_ENV !== "production" && !ComponentIn)
5154
5832
  throw new Error("No component given to styled()");
5155
5833
  let parentStaticConfig = ComponentIn.staticConfig, isPlainStyledComponent = !!parentStaticConfig && !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC), Component = parentStaticConfig != null && parentStaticConfig.isHOC && !(parentStaticConfig != null && parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || ComponentIn, reactNativeConfig = (0, import_setupReactNative.getReactNativeConfig)(Component), isReactNative = !!(reactNativeConfig || staticExtractionOptions != null && staticExtractionOptions.isReactNative || parentStaticConfig != null && parentStaticConfig.isReactNative || (0, import_setupReactNative.getReactNativeConfig)(parentStaticConfig == null ? void 0 : parentStaticConfig.Component)), staticConfigProps = (() => {
5156
5834
  if (options) {
@@ -5200,7 +5878,7 @@ var require_styled_native = __commonJS({
5200
5878
  });
5201
5879
 
5202
5880
  // ../web/dist/cjs/types.native.js
5203
- var require_types_native2 = __commonJS({
5881
+ var require_types_native3 = __commonJS({
5204
5882
  "../web/dist/cjs/types.native.js"(exports, module2) {
5205
5883
  "use strict";
5206
5884
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
@@ -5378,7 +6056,7 @@ var require_useThemeName_native = __commonJS({
5378
6056
  useThemeName: () => useThemeName
5379
6057
  });
5380
6058
  module2.exports = __toCommonJS2(useThemeName_exports);
5381
- var import_constants2 = require_index_native(), import_react = require("react"), import_ThemeManagerContext = require_ThemeManagerContext_native();
6059
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_ThemeManagerContext = require_ThemeManagerContext_native();
5382
6060
  function useThemeName(opts) {
5383
6061
  let manager = (0, import_react.useContext)(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = (0, import_react.useState)((manager == null ? void 0 : manager.state.name) || "");
5384
6062
  return (0, import_constants2.useIsomorphicLayoutEffect)(() => {
@@ -5473,7 +6151,7 @@ var require_useIsTouchDevice_native = __commonJS({
5473
6151
  useIsTouchDevice: () => useIsTouchDevice
5474
6152
  });
5475
6153
  module2.exports = __toCommonJS2(useIsTouchDevice_exports);
5476
- var import_constants2 = require_index_native(), import_use_did_finish_ssr = require_index_native6(), useIsTouchDevice = () => import_constants2.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants2.isTouchable : !1 : !0;
6154
+ var import_constants2 = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), useIsTouchDevice = () => import_constants2.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants2.isTouchable : !1 : !0;
5477
6155
  }
5478
6156
  });
5479
6157
 
@@ -5521,7 +6199,7 @@ var require_Stack_native = __commonJS({
5521
6199
  Stack: () => Stack2
5522
6200
  });
5523
6201
  module2.exports = __toCommonJS2(Stack_exports);
5524
- var import_helpers = require_index_native3(), import_constants2 = require_constants_native(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
6202
+ var import_helpers = require_index_native4(), import_constants2 = require_constants_native(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
5525
6203
  acceptsClassName: !0,
5526
6204
  defaultProps: import_constants2.stackDefaultStyles,
5527
6205
  validStyles: import_helpers.validStyles
@@ -5546,7 +6224,7 @@ var require_View_native = __commonJS({
5546
6224
  View: () => View
5547
6225
  });
5548
6226
  module2.exports = __toCommonJS2(View_exports);
5549
- var import_helpers = require_index_native3(), import_createComponent = require_createComponent_native(), View = (0, import_createComponent.createComponent)({
6227
+ var import_helpers = require_index_native4(), import_createComponent = require_createComponent_native(), View = (0, import_createComponent.createComponent)({
5550
6228
  acceptsClassName: !0,
5551
6229
  defaultProps: {
5552
6230
  display: "flex"
@@ -5573,7 +6251,7 @@ var require_Text_native = __commonJS({
5573
6251
  Text: () => Text2
5574
6252
  });
5575
6253
  module2.exports = __toCommonJS2(Text_exports);
5576
- var import_helpers = require_index_native3(), import_createComponent = require_createComponent_native(), Text2 = (0, import_createComponent.createComponent)({
6254
+ var import_helpers = require_index_native4(), import_createComponent = require_createComponent_native(), Text2 = (0, import_createComponent.createComponent)({
5577
6255
  acceptsClassName: !0,
5578
6256
  isText: !0,
5579
6257
  defaultProps: {
@@ -5620,7 +6298,7 @@ var require_ThemeProvider_native = __commonJS({
5620
6298
  ThemeProvider: () => ThemeProvider
5621
6299
  });
5622
6300
  module2.exports = __toCommonJS2(ThemeProvider_exports);
5623
- var import_constants2 = require_index_native(), import_react = require("react"), import_constants22 = require_constants_native(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants2.isClient && (0, import_react.useLayoutEffect)(() => {
6301
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_constants22 = require_constants_native(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants2.isClient && (0, import_react.useLayoutEffect)(() => {
5624
6302
  if (props.disableRootThemeClass)
5625
6303
  return;
5626
6304
  let cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = props.themeClassNameOnRoot ? document.documentElement : document.body;
@@ -5688,14 +6366,14 @@ var require_TamaguiProvider_native = __commonJS({
5688
6366
  TamaguiProvider: () => TamaguiProvider
5689
6367
  });
5690
6368
  module2.exports = __toCommonJS2(TamaguiProvider_exports);
5691
- var import_constants2 = require_index_native(), React2 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_jsx_runtime = require("react/jsx-runtime");
6369
+ var import_constants2 = require_index_native2(), React = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_jsx_runtime = require("react/jsx-runtime");
5692
6370
  function TamaguiProvider({
5693
6371
  children,
5694
6372
  disableInjectCSS,
5695
6373
  config,
5696
6374
  ...themePropsProvider
5697
6375
  }) {
5698
- return import_constants2.isWeb && import_constants2.isServer || (0, import_useMedia.useMediaListeners)(config), import_constants2.isClient && React2.useLayoutEffect(() => {
6376
+ return import_constants2.isWeb && import_constants2.isServer || (0, import_useMedia.useMediaListeners)(config), import_constants2.isClient && React.useLayoutEffect(() => {
5699
6377
  if (document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), disableInjectCSS)
5700
6378
  return;
5701
6379
  let style = document.createElement("style");
@@ -5798,7 +6476,7 @@ var require_useEvent_native = __commonJS({
5798
6476
  });
5799
6477
 
5800
6478
  // ../use-event/dist/cjs/index.native.js
5801
- var require_index_native7 = __commonJS({
6479
+ var require_index_native8 = __commonJS({
5802
6480
  "../use-event/dist/cjs/index.native.js"(exports, module2) {
5803
6481
  "use strict";
5804
6482
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
@@ -5814,7 +6492,7 @@ var require_index_native7 = __commonJS({
5814
6492
  });
5815
6493
 
5816
6494
  // ../web/dist/cjs/index.native.js
5817
- var require_index_native8 = __commonJS({
6495
+ var require_index_native9 = __commonJS({
5818
6496
  "../web/dist/cjs/index.native.js"(exports, module2) {
5819
6497
  "use strict";
5820
6498
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
@@ -5842,7 +6520,6 @@ var require_index_native8 = __commonJS({
5842
6520
  useMediaPropsActive: () => import_useMedia.useMediaPropsActive
5843
6521
  });
5844
6522
  module2.exports = __toCommonJS2(src_exports2);
5845
- var import_polyfill_dev = require_polyfill_dev();
5846
6523
  __reExport2(src_exports2, require_Tamagui_native(), module2.exports);
5847
6524
  __reExport2(src_exports2, require_createComponent_native(), module2.exports);
5848
6525
  __reExport2(src_exports2, require_createShorthands_native(), module2.exports);
@@ -5855,7 +6532,7 @@ var require_index_native8 = __commonJS({
5855
6532
  __reExport2(src_exports2, require_insertFont_native(), module2.exports);
5856
6533
  __reExport2(src_exports2, require_styled_native(), module2.exports);
5857
6534
  __reExport2(src_exports2, require_setupReactNative_native(), module2.exports);
5858
- __reExport2(src_exports2, require_types_native2(), module2.exports);
6535
+ __reExport2(src_exports2, require_types_native3(), module2.exports);
5859
6536
  __reExport2(src_exports2, require_GetRef_native(), module2.exports);
5860
6537
  var import_config = require_config_native();
5861
6538
  __reExport2(src_exports2, require_constants_native(), module2.exports);
@@ -5897,11 +6574,11 @@ var require_index_native8 = __commonJS({
5897
6574
  __reExport2(src_exports2, require_FontLanguage_native(), module2.exports);
5898
6575
  __reExport2(src_exports2, require_TamaguiProvider_native(), module2.exports);
5899
6576
  __reExport2(src_exports2, require_AnimationDriverProvider_native(), module2.exports);
5900
- __reExport2(src_exports2, require_index_native6(), module2.exports);
5901
6577
  __reExport2(src_exports2, require_index_native7(), module2.exports);
5902
- __reExport2(src_exports2, require_index_native5(), module2.exports);
5903
- __reExport2(src_exports2, require_index_native3(), module2.exports);
5904
- __reExport2(src_exports2, require_index_native(), module2.exports);
6578
+ __reExport2(src_exports2, require_index_native8(), module2.exports);
6579
+ __reExport2(src_exports2, require_index_native6(), module2.exports);
6580
+ __reExport2(src_exports2, require_index_native4(), module2.exports);
6581
+ __reExport2(src_exports2, require_index_native2(), module2.exports);
5905
6582
  __reExport2(src_exports2, require_setupHooks_native(), module2.exports);
5906
6583
  }
5907
6584
  });
@@ -5956,525 +6633,14 @@ var idFn_default, init_idFn = __esm({
5956
6633
  }
5957
6634
  });
5958
6635
 
5959
- // src/native.ts
5960
- var native_exports = {};
5961
- __export(native_exports, {
5962
- Stack: () => Stack,
5963
- Text: () => Text
5964
- });
5965
- module.exports = __toCommonJS(native_exports);
5966
-
5967
6636
  // src/index.ts
5968
6637
  var src_exports = {};
5969
6638
  __export(src_exports, {
5970
6639
  Stack: () => Stack,
5971
6640
  Text: () => Text
5972
6641
  });
5973
-
5974
- // ../react-native-use-responder-events/dist/esm/useResponderEvents.js
5975
- var React = __toESM(require("react"));
5976
-
5977
- // ../react-native-use-responder-events/dist/esm/utils.js
5978
- var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), getBoundingClientRect = (node) => {
5979
- if (node && node.nodeType === 1 && node.getBoundingClientRect)
5980
- return node.getBoundingClientRect();
5981
- };
5982
- function getEventPath(domEvent) {
5983
- var _a;
5984
- if (domEvent.type === "selectionchange") {
5985
- let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
5986
- return composedPathFallback(target);
5987
- } else
5988
- return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
5989
- }
5990
- function composedPathFallback(target) {
5991
- let path = [];
5992
- for (; target != null && target !== document.body; )
5993
- path.push(target), target = target.parentNode;
5994
- return path;
5995
- }
5996
- function getResponderId(node) {
5997
- return node != null ? node[keyName] : null;
5998
- }
5999
- function setResponderId(node, id) {
6000
- node != null && (node[keyName] = id);
6001
- }
6002
- function getResponderPaths(domEvent) {
6003
- let idPath = [], nodePath = [], eventPath = getEventPath(domEvent);
6004
- for (let i = 0; i < eventPath.length; i++) {
6005
- let node = eventPath[i], id = getResponderId(node);
6006
- id != null && (idPath.push(id), nodePath.push(node));
6007
- }
6008
- return { idPath, nodePath };
6009
- }
6010
- function getLowestCommonAncestor(pathA, pathB) {
6011
- let pathALength = pathA.length, pathBLength = pathB.length;
6012
- if (
6013
- // If either path is empty
6014
- pathALength === 0 || pathBLength === 0 || // If the last elements aren't the same there can't be a common ancestor
6015
- // that is connected to the responder system
6016
- pathA[pathALength - 1] !== pathB[pathBLength - 1]
6017
- )
6018
- return null;
6019
- let itemA = pathA[0], indexA = 0, itemB = pathB[0], indexB = 0;
6020
- pathALength - pathBLength > 0 && (indexA = pathALength - pathBLength, itemA = pathA[indexA], pathALength = pathBLength), pathBLength - pathALength > 0 && (indexB = pathBLength - pathALength, itemB = pathB[indexB], pathBLength = pathALength);
6021
- let depth = pathALength;
6022
- for (; depth--; ) {
6023
- if (itemA === itemB)
6024
- return itemA;
6025
- itemA = pathA[indexA++], itemB = pathB[indexB++];
6026
- }
6027
- return null;
6028
- }
6029
- function hasTargetTouches(target, touches) {
6030
- if (!touches || touches.length === 0)
6031
- return !1;
6032
- for (let i = 0; i < touches.length; i++) {
6033
- let node = touches[i].target;
6034
- if (node != null && target.contains(node))
6035
- return !0;
6036
- }
6037
- return !1;
6038
- }
6039
- function hasValidSelection(domEvent) {
6040
- return domEvent.type === "selectionchange" ? isSelectionValid() : domEvent.type === "select";
6041
- }
6042
- function isPrimaryPointerDown(domEvent) {
6043
- let { altKey, button, buttons, ctrlKey, type } = domEvent, isTouch = type === "touchstart" || type === "touchmove", isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1), isPrimaryMouseMove = type === "mousemove" && buttons === 1, noModifiers = altKey === !1 && ctrlKey === !1;
6044
- return !!(isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers);
6045
- }
6046
- function isSelectionValid() {
6047
- let selection = window.getSelection();
6048
- if (!selection)
6049
- return !1;
6050
- let string = selection.toString(), anchorNode = selection.anchorNode, focusNode = selection.focusNode, isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
6051
- return string.length >= 1 && string !== `
6052
- ` && !!isTextNode;
6053
- }
6054
-
6055
- // ../react-native-use-responder-events/dist/esm/createResponderEvent.js
6056
- var emptyFunction = () => {
6057
- }, emptyObject = {}, emptyArray = [];
6058
- function normalizeIdentifier(identifier) {
6059
- return identifier > 20 ? identifier % 20 : identifier;
6060
- }
6061
- function createResponderEvent(domEvent, responderTouchHistoryStore2) {
6062
- let rect, propagationWasStopped = !1, changedTouches, touches, domEventChangedTouches = domEvent.changedTouches, domEventType = domEvent.type, metaKey = domEvent.metaKey === !0, shiftKey = domEvent.shiftKey === !0, force = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].force) || 0, identifier = normalizeIdentifier((domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].identifier) || 0), clientX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientX) || domEvent.clientX, clientY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientY) || domEvent.clientY, pageX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageX) || domEvent.pageX, pageY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageY) || domEvent.pageY, preventDefault = typeof domEvent.preventDefault == "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction, timestamp = domEvent.timeStamp;
6063
- function normalizeTouches(touches2) {
6064
- return Array.prototype.slice.call(touches2).map((touch) => ({
6065
- force: touch.force,
6066
- identifier: normalizeIdentifier(touch.identifier),
6067
- get locationX() {
6068
- return locationX(touch.clientX);
6069
- },
6070
- get locationY() {
6071
- return locationY(touch.clientY);
6072
- },
6073
- pageX: touch.pageX,
6074
- pageY: touch.pageY,
6075
- target: touch.target,
6076
- timestamp
6077
- }));
6078
- }
6079
- if (domEventChangedTouches != null)
6080
- changedTouches = normalizeTouches(domEventChangedTouches), touches = normalizeTouches(domEvent.touches);
6081
- else {
6082
- let emulatedTouches = [
6083
- {
6084
- force,
6085
- identifier,
6086
- get locationX() {
6087
- return locationX(clientX);
6088
- },
6089
- get locationY() {
6090
- return locationY(clientY);
6091
- },
6092
- pageX,
6093
- pageY,
6094
- target: domEvent.target,
6095
- timestamp
6096
- }
6097
- ];
6098
- changedTouches = emulatedTouches, touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
6099
- }
6100
- let responderEvent = {
6101
- bubbles: !0,
6102
- cancelable: !0,
6103
- // `currentTarget` is set before dispatch
6104
- currentTarget: null,
6105
- defaultPrevented: domEvent.defaultPrevented,
6106
- dispatchConfig: emptyObject,
6107
- eventPhase: domEvent.eventPhase,
6108
- isDefaultPrevented() {
6109
- return domEvent.defaultPrevented;
6110
- },
6111
- isPropagationStopped() {
6112
- return propagationWasStopped;
6113
- },
6114
- isTrusted: domEvent.isTrusted,
6115
- nativeEvent: {
6116
- altKey: !1,
6117
- ctrlKey: !1,
6118
- metaKey,
6119
- shiftKey,
6120
- changedTouches,
6121
- force,
6122
- identifier,
6123
- get locationX() {
6124
- return locationX(clientX);
6125
- },
6126
- get locationY() {
6127
- return locationY(clientY);
6128
- },
6129
- pageX,
6130
- pageY,
6131
- target: domEvent.target,
6132
- timestamp,
6133
- touches,
6134
- type: domEventType
6135
- },
6136
- persist: emptyFunction,
6137
- preventDefault,
6138
- stopPropagation() {
6139
- propagationWasStopped = !0;
6140
- },
6141
- target: domEvent.target,
6142
- timeStamp: timestamp,
6143
- touchHistory: responderTouchHistoryStore2.touchHistory
6144
- };
6145
- function locationX(x) {
6146
- if (rect = rect || getBoundingClientRect(responderEvent.currentTarget), rect)
6147
- return x - rect.left;
6148
- }
6149
- function locationY(y) {
6150
- if (rect = rect || getBoundingClientRect(responderEvent.currentTarget), rect)
6151
- return y - rect.top;
6152
- }
6153
- return responderEvent;
6154
- }
6155
-
6156
- // ../react-native-use-responder-events/dist/esm/types.js
6157
- var MOUSE_DOWN = "mousedown", MOUSE_MOVE = "mousemove", MOUSE_UP = "mouseup", MOUSE_CANCEL = "dragstart", TOUCH_START = "touchstart", TOUCH_MOVE = "touchmove", TOUCH_END = "touchend", TOUCH_CANCEL = "touchcancel", SCROLL = "scroll", SELECT = "select", SELECTION_CHANGE = "selectionchange";
6158
- function isStartish(eventType) {
6159
- return eventType === TOUCH_START || eventType === MOUSE_DOWN;
6160
- }
6161
- function isMoveish(eventType) {
6162
- return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
6163
- }
6164
- function isEndish(eventType) {
6165
- return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
6166
- }
6167
- function isCancelish(eventType) {
6168
- return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
6169
- }
6170
- function isScroll(eventType) {
6171
- return eventType === SCROLL;
6172
- }
6173
- function isSelectionChange(eventType) {
6174
- return eventType === SELECT || eventType === SELECTION_CHANGE;
6175
- }
6176
-
6177
- // ../react-native-use-responder-events/dist/esm/ResponderTouchHistoryStore.js
6178
- var MAX_TOUCH_BANK = 20;
6179
- function timestampForTouch(touch) {
6180
- return touch.timeStamp || touch.timestamp;
6181
- }
6182
- function createTouchRecord(touch) {
6183
- return {
6184
- touchActive: !0,
6185
- startPageX: touch.pageX,
6186
- startPageY: touch.pageY,
6187
- startTimeStamp: timestampForTouch(touch),
6188
- currentPageX: touch.pageX,
6189
- currentPageY: touch.pageY,
6190
- currentTimeStamp: timestampForTouch(touch),
6191
- previousPageX: touch.pageX,
6192
- previousPageY: touch.pageY,
6193
- previousTimeStamp: timestampForTouch(touch)
6194
- };
6195
- }
6196
- function resetTouchRecord(touchRecord, touch) {
6197
- touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch);
6198
- }
6199
- function getTouchIdentifier({ identifier }) {
6200
- return identifier == null && console.error("Touch object is missing identifier."), identifier > MAX_TOUCH_BANK && console.error(
6201
- "Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.",
6202
- identifier,
6203
- MAX_TOUCH_BANK
6204
- ), identifier;
6205
- }
6206
- function recordTouchStart(touch, touchHistory) {
6207
- let identifier = getTouchIdentifier(touch), touchRecord = touchHistory.touchBank[identifier];
6208
- touchRecord ? resetTouchRecord(touchRecord, touch) : touchHistory.touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
6209
- }
6210
- function recordTouchMove(touch, touchHistory) {
6211
- let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
6212
- touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
6213
- `Cannot record touch move without a touch start.
6214
- `,
6215
- `Touch Move: ${printTouch(touch)}
6216
- `,
6217
- `Touch Bank: ${printTouchBank(touchHistory)}`
6218
- );
6219
- }
6220
- function recordTouchEnd(touch, touchHistory) {
6221
- let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
6222
- touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
6223
- `Cannot record touch end without a touch start.
6224
- `,
6225
- `Touch End: ${printTouch(touch)}
6226
- `,
6227
- `Touch Bank: ${printTouchBank(touchHistory)}`
6228
- );
6229
- }
6230
- function printTouch(touch) {
6231
- return JSON.stringify({
6232
- identifier: touch.identifier,
6233
- pageX: touch.pageX,
6234
- pageY: touch.pageY,
6235
- timestamp: timestampForTouch(touch)
6236
- });
6237
- }
6238
- function printTouchBank(touchHistory) {
6239
- let { touchBank } = touchHistory, printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
6240
- return touchBank.length > MAX_TOUCH_BANK && (printed += ` (original size: ${touchBank.length})`), printed;
6241
- }
6242
- var ResponderTouchHistoryStore = class {
6243
- _touchHistory = {
6244
- touchBank: [],
6245
- //Array<TouchRecord>
6246
- numberActiveTouches: 0,
6247
- // If there is only one active touch, we remember its location. This prevents
6248
- // us having to loop through all of the touches all the time in the most
6249
- // common case.
6250
- indexOfSingleActiveTouch: -1,
6251
- mostRecentTimeStamp: 0
6252
- };
6253
- recordTouchTrack(topLevelType, nativeEvent) {
6254
- var _a, _b;
6255
- let touchHistory = this._touchHistory;
6256
- if (isMoveish(topLevelType))
6257
- nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory));
6258
- else if (isStartish(topLevelType))
6259
- nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1 && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);
6260
- else if (isEndish(topLevelType) && (nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1)) {
6261
- let { touchBank } = touchHistory;
6262
- for (let i = 0; i < touchBank.length; i++)
6263
- if ((_a = touchBank[i]) != null && _a.touchActive) {
6264
- touchHistory.indexOfSingleActiveTouch = i;
6265
- break;
6266
- }
6267
- (_b = touchBank[touchHistory.indexOfSingleActiveTouch]) != null && _b.touchActive || console.error("Cannot find single active touch.");
6268
- }
6269
- }
6270
- get touchHistory() {
6271
- return this._touchHistory;
6272
- }
6273
- };
6274
-
6275
- // ../react-native-use-responder-events/dist/esm/ResponderSystem.js
6276
- var emptyObject2 = {}, startRegistration = [
6277
- "onStartShouldSetResponderCapture",
6278
- "onStartShouldSetResponder",
6279
- { bubbles: !0 }
6280
- ], moveRegistration = [
6281
- "onMoveShouldSetResponderCapture",
6282
- "onMoveShouldSetResponder",
6283
- { bubbles: !0 }
6284
- ], scrollRegistration = [
6285
- "onScrollShouldSetResponderCapture",
6286
- "onScrollShouldSetResponder",
6287
- { bubbles: !1 }
6288
- ], shouldSetResponderEvents = {
6289
- touchstart: startRegistration,
6290
- mousedown: startRegistration,
6291
- touchmove: moveRegistration,
6292
- mousemove: moveRegistration,
6293
- scroll: scrollRegistration
6294
- }, emptyResponder = { id: null, idPath: null, node: null }, responderListenersMap = /* @__PURE__ */ new Map(), isEmulatingMouseEvents = !1, trackedTouchCount = 0, currentResponder = {
6295
- id: null,
6296
- node: null,
6297
- idPath: null
6298
- }, responderTouchHistoryStore = new ResponderTouchHistoryStore();
6299
- function changeCurrentResponder(responder) {
6300
- currentResponder = responder;
6301
- }
6302
- function getResponderConfig(id) {
6303
- return responderListenersMap.get(id) ?? emptyObject2;
6304
- }
6305
- function eventListener(domEvent) {
6306
- let eventType = domEvent.type, eventTarget = domEvent.target;
6307
- if (eventType === "touchstart" && (isEmulatingMouseEvents = !0), (eventType === "touchmove" || trackedTouchCount > 1) && (isEmulatingMouseEvents = !1), // Ignore browser emulated mouse events
6308
- eventType === "mousedown" && isEmulatingMouseEvents || eventType === "mousemove" && isEmulatingMouseEvents || // Ignore mousemove if a mousedown didn't occur first
6309
- eventType === "mousemove" && trackedTouchCount < 1)
6310
- return;
6311
- if (isEmulatingMouseEvents && eventType === "mouseup") {
6312
- trackedTouchCount === 0 && (isEmulatingMouseEvents = !1);
6313
- return;
6314
- }
6315
- let isStartEvent = isStartish(eventType) && isPrimaryPointerDown(domEvent), isMoveEvent = isMoveish(eventType), isEndEvent = isEndish(eventType), isScrollEvent = isScroll(eventType), isSelectionChangeEvent = isSelectionChange(eventType), responderEvent = createResponderEvent(domEvent, responderTouchHistoryStore);
6316
- (isStartEvent || isMoveEvent || isEndEvent) && (domEvent.touches ? trackedTouchCount = domEvent.touches.length : isStartEvent ? trackedTouchCount = 1 : isEndEvent && (trackedTouchCount = 0), responderTouchHistoryStore.recordTouchTrack(
6317
- eventType,
6318
- responderEvent.nativeEvent
6319
- ));
6320
- let eventPaths = getResponderPaths(domEvent), wasNegotiated = !1, wantsResponder;
6321
- if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
6322
- let currentResponderIdPath = currentResponder.idPath, eventIdPath = eventPaths.idPath;
6323
- if (currentResponderIdPath != null && eventIdPath != null) {
6324
- let lowestCommonAncestor = getLowestCommonAncestor(
6325
- currentResponderIdPath,
6326
- eventIdPath
6327
- );
6328
- if (lowestCommonAncestor != null) {
6329
- let index = eventIdPath.indexOf(lowestCommonAncestor) + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
6330
- eventPaths = {
6331
- idPath: eventIdPath.slice(index),
6332
- nodePath: eventPaths.nodePath.slice(index)
6333
- };
6334
- } else
6335
- eventPaths = null;
6336
- }
6337
- eventPaths != null && (wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent), wantsResponder != null && (attemptTransfer(responderEvent, wantsResponder), wasNegotiated = !0));
6338
- }
6339
- if (currentResponder.id != null && currentResponder.node != null) {
6340
- let { id, node } = currentResponder, {
6341
- onResponderStart,
6342
- onResponderMove,
6343
- onResponderEnd,
6344
- onResponderRelease,
6345
- onResponderTerminate,
6346
- onResponderTerminationRequest
6347
- } = getResponderConfig(id);
6348
- if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, isStartEvent)
6349
- onResponderStart != null && (responderEvent.dispatchConfig.registrationName = "onResponderStart", onResponderStart(responderEvent));
6350
- else if (isMoveEvent)
6351
- onResponderMove != null && (responderEvent.dispatchConfig.registrationName = "onResponderMove", onResponderMove(responderEvent));
6352
- else {
6353
- let isTerminateEvent = isCancelish(eventType) || // native context menu
6354
- eventType === "contextmenu" || // window blur
6355
- eventType === "blur" && eventTarget === window || // responder (or ancestors) blur
6356
- eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
6357
- isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
6358
- isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
6359
- isSelectionChangeEvent && hasValidSelection(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !hasTargetTouches(node, domEvent.touches);
6360
- if (isEndEvent && onResponderEnd != null && (responderEvent.dispatchConfig.registrationName = "onResponderEnd", onResponderEnd(responderEvent)), isReleaseEvent && (onResponderRelease != null && (responderEvent.dispatchConfig.registrationName = "onResponderRelease", onResponderRelease(responderEvent)), changeCurrentResponder(emptyResponder)), isTerminateEvent) {
6361
- let shouldTerminate = !0;
6362
- (eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") && (wasNegotiated ? shouldTerminate = !1 : onResponderTerminationRequest != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (shouldTerminate = !1))), shouldTerminate && (onResponderTerminate != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), changeCurrentResponder(emptyResponder), isEmulatingMouseEvents = !1, trackedTouchCount = 0);
6363
- }
6364
- }
6365
- }
6366
- }
6367
- function findWantsResponder(eventPaths, domEvent, responderEvent) {
6368
- let shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
6369
- if (shouldSetCallbacks != null) {
6370
- let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = function(id, node, callbackName) {
6371
- let shouldSetCallback = getResponderConfig(id)[callbackName];
6372
- if (shouldSetCallback != null && (responderEvent.currentTarget = node, shouldSetCallback(responderEvent) === !0)) {
6373
- let prunedIdPath = idPath.slice(idPath.indexOf(id));
6374
- return { id, node, idPath: prunedIdPath };
6375
- }
6376
- };
6377
- for (let i = idPath.length - 1; i >= 0; i--) {
6378
- let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackCaptureName);
6379
- if (result != null)
6380
- return result;
6381
- if (responderEvent.isPropagationStopped() === !0)
6382
- return;
6383
- }
6384
- if (bubbles)
6385
- for (let i = 0; i < idPath.length; i++) {
6386
- let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackBubbleName);
6387
- if (result != null)
6388
- return result;
6389
- if (responderEvent.isPropagationStopped() === !0)
6390
- return;
6391
- }
6392
- else {
6393
- let id = idPath[0], node = nodePath[0];
6394
- if (domEvent.target === node)
6395
- return check(id, node, shouldSetCallbackBubbleName);
6396
- }
6397
- }
6398
- }
6399
- function attemptTransfer(responderEvent, wantsResponder) {
6400
- let { id: currentId, node: currentNode } = currentResponder, { id, node } = wantsResponder, { onResponderGrant, onResponderReject } = getResponderConfig(id);
6401
- if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, currentId == null)
6402
- onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder);
6403
- else {
6404
- let { onResponderTerminate, onResponderTerminationRequest } = getResponderConfig(currentId), allowTransfer = !0;
6405
- onResponderTerminationRequest != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (allowTransfer = !1)), allowTransfer ? (onResponderTerminate != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder)) : onResponderReject != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderReject", onResponderReject(responderEvent));
6406
- }
6407
- }
6408
- var documentEventsCapturePhase = ["blur", "scroll"], documentEventsBubblePhase = [
6409
- // mouse
6410
- "mousedown",
6411
- "mousemove",
6412
- "mouseup",
6413
- "dragstart",
6414
- // touch
6415
- "touchstart",
6416
- "touchmove",
6417
- "touchend",
6418
- "touchcancel",
6419
- // other
6420
- "contextmenu",
6421
- "select",
6422
- "selectionchange"
6423
- ], isTamaguiResponderActive = Symbol();
6424
- function attachListeners() {
6425
- canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
6426
- document.addEventListener(eventType, eventListener);
6427
- }), documentEventsCapturePhase.forEach((eventType) => {
6428
- document.addEventListener(eventType, eventListener, !0);
6429
- }), window[isTamaguiResponderActive] = !0);
6430
- }
6431
- function addNode(id, node, config) {
6432
- setResponderId(node, id), responderListenersMap.set(id, config);
6433
- }
6434
- function removeNode(id) {
6435
- currentResponder.id === id && terminateResponder(), responderListenersMap.has(id) && responderListenersMap.delete(id);
6436
- }
6437
- function terminateResponder() {
6438
- let { id, node } = currentResponder;
6439
- if (id != null && node != null) {
6440
- let { onResponderTerminate } = getResponderConfig(id);
6441
- if (onResponderTerminate != null) {
6442
- let event = createResponderEvent({}, responderTouchHistoryStore);
6443
- event.currentTarget = node, onResponderTerminate(event);
6444
- }
6445
- changeCurrentResponder(emptyResponder);
6446
- }
6447
- isEmulatingMouseEvents = !1, trackedTouchCount = 0;
6448
- }
6449
- function getResponderNode() {
6450
- return currentResponder.node;
6451
- }
6452
-
6453
- // ../react-native-use-responder-events/dist/esm/useResponderEvents.js
6454
- var emptyObject3 = {};
6455
- function useResponderEvents(hostRef, config = emptyObject3) {
6456
- let id = React.useId(), isAttachedRef = React.useRef(!1);
6457
- React.useEffect(() => (attachListeners(), () => {
6458
- removeNode(id);
6459
- }), [id]), React.useEffect(() => {
6460
- let {
6461
- onMoveShouldSetResponder,
6462
- onMoveShouldSetResponderCapture,
6463
- onScrollShouldSetResponder,
6464
- onScrollShouldSetResponderCapture,
6465
- onSelectionChangeShouldSetResponder,
6466
- onSelectionChangeShouldSetResponderCapture,
6467
- onStartShouldSetResponder,
6468
- onStartShouldSetResponderCapture
6469
- } = config, requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null, node = hostRef.current;
6470
- requiresResponderSystem ? (addNode(id, node, config), isAttachedRef.current = !0) : isAttachedRef.current && (removeNode(id), isAttachedRef.current = !1);
6471
- }, [config, hostRef, id]), React.useDebugValue({
6472
- isResponder: hostRef.current === getResponderNode()
6473
- }), React.useDebugValue(config);
6474
- }
6475
-
6476
- // src/index.ts
6477
- var import_web2 = __toESM(require_index_native8());
6642
+ module.exports = __toCommonJS(src_exports);
6643
+ var import_react_native_use_responder_events = __toESM(require_index_native()), import_web2 = __toESM(require_index_native9());
6478
6644
 
6479
6645
  // src/getBaseViews.native.ts
6480
6646
  function getBaseViews() {
@@ -6486,10 +6652,10 @@ function getBaseViews() {
6486
6652
  }
6487
6653
 
6488
6654
  // src/hooks/useElementLayout.tsx
6489
- var import_constants = __toESM(require_index_native());
6655
+ var import_constants = __toESM(require_index_native2());
6490
6656
 
6491
6657
  // src/helpers/getBoundingClientRect.tsx
6492
- var getBoundingClientRect2 = (node) => {
6658
+ var getBoundingClientRect = (node) => {
6493
6659
  var _a;
6494
6660
  if (!(!node || node.nodeType !== 1))
6495
6661
  return (_a = node.getBoundingClientRect) == null ? void 0 : _a.call(node);
@@ -6497,7 +6663,7 @@ var getBoundingClientRect2 = (node) => {
6497
6663
 
6498
6664
  // src/helpers/getRect.tsx
6499
6665
  var getRect = (node) => {
6500
- let rect = getBoundingClientRect2(node);
6666
+ let rect = getBoundingClientRect(node);
6501
6667
  if (!rect)
6502
6668
  return;
6503
6669
  let { x, y, top, left } = rect;
@@ -6525,7 +6691,7 @@ typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new Resiz
6525
6691
  var measureLayout = (node, relativeTo, callback) => {
6526
6692
  let relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
6527
6693
  relativeNode instanceof HTMLElement && setTimeout(() => {
6528
- let relativeRect = getBoundingClientRect2(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
6694
+ let relativeRect = getBoundingClientRect(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
6529
6695
  callback(x, y, width, height, left, top);
6530
6696
  }, 0);
6531
6697
  };
@@ -6542,7 +6708,7 @@ function useElementLayout(ref, onLayout) {
6542
6708
  }
6543
6709
 
6544
6710
  // src/hooks/usePlatformMethods.ts
6545
- var import_web = __toESM(require_index_native8());
6711
+ var import_web = __toESM(require_index_native9());
6546
6712
  function usePlatformMethods(hostRef) {
6547
6713
  (0, import_web.useIsomorphicLayoutEffect)(() => {
6548
6714
  let node = hostRef.current;
@@ -6559,7 +6725,7 @@ function usePlatformMethods(hostRef) {
6559
6725
  var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
6560
6726
 
6561
6727
  // src/index.ts
6562
- __reExport(src_exports, __toESM(require_index_native8()));
6728
+ __reExport(src_exports, __toESM(require_index_native9()), module.exports);
6563
6729
  var Stack = import_web2.Stack, Text = import_web2.Text;
6564
6730
  (0, import_web2.setupHooks)({
6565
6731
  getBaseViews,
@@ -6592,7 +6758,7 @@ var Stack = import_web2.Stack, Text = import_web2.Text;
6592
6758
  hrefAttrs,
6593
6759
  ...viewProps
6594
6760
  } = propsIn;
6595
- if (usePlatformMethods(hostRef), useElementLayout(hostRef, onLayout), useResponderEvents(hostRef, {
6761
+ if (usePlatformMethods(hostRef), useElementLayout(hostRef, onLayout), (0, import_react_native_use_responder_events.useResponderEvents)(hostRef, {
6596
6762
  onMoveShouldSetResponder,
6597
6763
  onMoveShouldSetResponderCapture,
6598
6764
  onResponderEnd,
@@ -6634,7 +6800,9 @@ var Stack = import_web2.Stack, Text = import_web2.Text;
6634
6800
  var dontComposePressabilityKeys = {
6635
6801
  onClick: !0
6636
6802
  };
6637
-
6638
- // src/native.ts
6639
- __reExport(native_exports, src_exports, module.exports);
6803
+ // Annotate the CommonJS export names for ESM import in node:
6804
+ 0 && (module.exports = {
6805
+ Stack,
6806
+ Text
6807
+ });
6640
6808
  //# sourceMappingURL=native.js.map