tamagui 1.123.17 → 1.124.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
@@ -3310,80 +3310,11 @@ var require_useMedia_native = __commonJS({
3310
3310
  }
3311
3311
  });
3312
3312
 
3313
- // ../../core/web/dist/cjs/constants/constants.native.js
3314
- var require_constants_native2 = __commonJS({
3315
- "../../core/web/dist/cjs/constants/constants.native.js"(exports2, module2) {
3316
- "use strict";
3317
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3318
- for (var name in all) __defProp2(target, name, {
3319
- get: all[name],
3320
- enumerable: !0
3321
- });
3322
- }, __copyProps2 = function(to, from, except, desc) {
3323
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3324
- if (from && typeof from == "object" || typeof from == "function") try {
3325
- for (var _loop = function() {
3326
- var key = _step.value;
3327
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3328
- get: function() {
3329
- return from[key];
3330
- },
3331
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3332
- });
3333
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3334
- } catch (err) {
3335
- _didIteratorError = !0, _iteratorError = err;
3336
- } finally {
3337
- try {
3338
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3339
- } finally {
3340
- if (_didIteratorError)
3341
- throw _iteratorError;
3342
- }
3343
- }
3344
- return to;
3345
- }, __toCommonJS2 = function(mod) {
3346
- return __copyProps2(__defProp2({}, "__esModule", {
3347
- value: !0
3348
- }), mod);
3349
- }, constants_exports = {};
3350
- __export2(constants_exports, {
3351
- FONT_DATA_ATTRIBUTE_NAME: function() {
3352
- return FONT_DATA_ATTRIBUTE_NAME;
3353
- },
3354
- THEME_CLASSNAME_PREFIX: function() {
3355
- return THEME_CLASSNAME_PREFIX;
3356
- },
3357
- THEME_NAME_SEPARATOR: function() {
3358
- return THEME_NAME_SEPARATOR;
3359
- },
3360
- stackDefaultStyles: function() {
3361
- return stackDefaultStyles;
3362
- },
3363
- webViewFlexCompatStyles: function() {
3364
- return webViewFlexCompatStyles;
3365
- }
3366
- });
3367
- module2.exports = __toCommonJS2(constants_exports);
3368
- var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", stackDefaultStyles = {}, webViewFlexCompatStyles = {
3369
- display: "flex",
3370
- alignItems: "stretch",
3371
- flexDirection: "column",
3372
- flexBasis: "auto",
3373
- boxSizing: "border-box",
3374
- position: "relative",
3375
- minHeight: 0,
3376
- minWidth: 0,
3377
- flexShrink: 0
3378
- };
3379
- }
3380
- });
3381
-
3382
- // ../../core/web/dist/cjs/helpers/ThemeManager.native.js
3383
- var require_ThemeManager_native = __commonJS({
3384
- "../../core/web/dist/cjs/helpers/ThemeManager.native.js"(exports2, module2) {
3313
+ // ../../core/web/dist/cjs/Tamagui.native.js
3314
+ var require_Tamagui_native = __commonJS({
3315
+ "../../core/web/dist/cjs/Tamagui.native.js"(exports2, module2) {
3385
3316
  "use strict";
3386
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3317
+ var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3387
3318
  for (var name in all) __defProp2(target, name, {
3388
3319
  get: all[name],
3389
3320
  enumerable: !0
@@ -3411,24 +3342,36 @@ var require_ThemeManager_native = __commonJS({
3411
3342
  }
3412
3343
  }
3413
3344
  return to;
3345
+ }, __toESM2 = function(mod, isNodeMode, target) {
3346
+ return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
3347
+ // If the importer is in node compatibility mode or this is not an ESM
3348
+ // file that has been converted to a CommonJS file using a Babel-
3349
+ // compatible transform (i.e. "__esModule" has not been set), then set
3350
+ // "default" to the CommonJS "module.exports" for node compatibility.
3351
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
3352
+ value: mod,
3353
+ enumerable: !0
3354
+ }) : target,
3355
+ mod
3356
+ );
3414
3357
  }, __toCommonJS2 = function(mod) {
3415
3358
  return __copyProps2(__defProp2({}, "__esModule", {
3416
3359
  value: !0
3417
3360
  }), mod);
3418
- }, ThemeManager_exports = {};
3419
- __export2(ThemeManager_exports, {
3420
- ThemeManager: function() {
3421
- return ThemeManager;
3361
+ }, Tamagui_exports = {};
3362
+ __export2(Tamagui_exports, {
3363
+ Tamagui: function() {
3364
+ return Tamagui;
3422
3365
  },
3423
- getHasThemeUpdatingProps: function() {
3424
- return getHasThemeUpdatingProps;
3366
+ getValueFromIdentifier: function() {
3367
+ return getValueFromIdentifier;
3425
3368
  },
3426
- getManagers: function() {
3427
- return getManagers;
3369
+ setIdentifierValue: function() {
3370
+ return setIdentifierValue;
3428
3371
  }
3429
3372
  });
3430
- module2.exports = __toCommonJS2(ThemeManager_exports);
3431
- var import_constants4 = require_index_native6(), import_config = require_config_native(), import_constants22 = require_constants_native2();
3373
+ module2.exports = __toCommonJS2(Tamagui_exports);
3374
+ var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native();
3432
3375
  function _class_call_check(instance, Constructor) {
3433
3376
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3434
3377
  }
@@ -3449,232 +3392,67 @@ var require_ThemeManager_native = __commonJS({
3449
3392
  writable: !0
3450
3393
  }) : obj[key] = value, obj;
3451
3394
  }
3452
- var emptyState = {
3453
- name: ""
3454
- };
3455
- function getHasThemeUpdatingProps(props) {
3456
- return !!(props.name || props.componentName || props.inverse || props.reset);
3457
- }
3458
- var uid = 0, ThemeManager = /* @__PURE__ */ function() {
3459
- "use strict";
3460
- function ThemeManager2() {
3461
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, parentManager = arguments.length > 1 ? arguments[1] : void 0;
3462
- if (_class_call_check(this, ThemeManager2), _define_property(this, "props", void 0), _define_property(this, "id", void 0), _define_property(this, "themeListeners", void 0), _define_property(this, "parentManager", void 0), _define_property(this, "state", void 0), _define_property(this, "_allKeys", void 0), _define_property(this, "_selfListener", void 0), this.props = props, this.id = 0, this.themeListeners = /* @__PURE__ */ new Set(), this.parentManager = null, this.state = emptyState, this._allKeys = null, uid = (uid + 1) % Number.MAX_VALUE, this.id = uid, parentManager === "root") {
3463
- this.updateStateFromProps(props, !1);
3464
- return;
3465
- }
3466
- if (!parentManager) throw process.env.NODE_ENV !== "production" ? new Error("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.") : "\u274C 000";
3467
- if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1)) return parentManager;
3468
- }
3469
- return _create_class(ThemeManager2, [
3470
- {
3471
- key: "updateStateFromProps",
3472
- value: function() {
3473
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props || {}, shouldNotify = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
3474
- if (this.props = props, props.forceTheme) return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
3475
- var nextState = this.getStateIfChanged(props);
3476
- if (nextState) return this.updateState(nextState, shouldNotify), nextState;
3477
- }
3478
- },
3479
- {
3480
- key: "getParents",
3481
- value: function() {
3482
- for (var parents = [], current = this; current; ) parents.push(current), current = current.parentManager;
3483
- return parents;
3484
- }
3485
- },
3486
- {
3487
- key: "updateState",
3488
- value: function(nextState) {
3489
- var shouldNotify = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
3490
- this.state = nextState, this._allKeys = null;
3491
- }
3492
- },
3493
- {
3494
- // if (shouldNotify) {
3495
- // if (process.env.TAMAGUI_TARGET === 'native') {
3496
- // // native is way slower with queueMicrotask
3497
- // this.notify()
3498
- // } else {
3499
- // // web is way faster this way
3500
- // queueMicrotask(() => {
3501
- // this.notify()
3502
- // })
3503
- // }
3504
- // }
3505
- key: "getStateIfChanged",
3506
- value: function() {
3507
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props, state = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.state, parentManager = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.parentManager, _ = this.getState(props, parentManager);
3508
- if (state && state !== emptyState && !_) return parentManager == null ? void 0 : parentManager.state;
3509
- if (this.getStateShouldChange(_, state)) return _;
3510
- }
3511
- },
3512
- {
3513
- key: "getStateShouldChange",
3514
- value: function(nextState) {
3515
- var state = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.state;
3516
- return !(!(nextState != null && nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme));
3517
- }
3518
- },
3519
- {
3520
- key: "getState",
3521
- value: function() {
3522
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props, parentManager = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.parentManager, next = getState(props, parentManager) || (parentManager == null ? void 0 : parentManager.state) || null;
3523
- return next;
3524
- }
3525
- },
3526
- {
3527
- key: "allKeys",
3528
- get: function() {
3529
- var _this_parentManager;
3530
- return this._allKeys || (this._allKeys = /* @__PURE__ */ new Set([
3531
- ...((_this_parentManager = this.parentManager) === null || _this_parentManager === void 0 ? void 0 : _this_parentManager.allKeys) || [],
3532
- ...Object.keys(this.state.theme || {})
3533
- ])), this._allKeys;
3534
- }
3535
- },
3536
- {
3537
- key: "notify",
3538
- value: function() {
3539
- var _this = this, forced = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
3540
- if (this.themeListeners.forEach(function(cb) {
3541
- return cb(_this.state.name, _this, forced);
3542
- }), process.env.NODE_ENV !== "production") {
3543
- var _numChangeEventsSent, _this_;
3544
- (_this_ = this[_numChangeEventsSent = "_numChangeEventsSent"]) !== null && _this_ !== void 0 || (this[_numChangeEventsSent] = 0), this._numChangeEventsSent++;
3545
- }
3546
- }
3547
- },
3548
- {
3549
- key: "selfUpdate",
3550
- value: function() {
3551
- var _this__selfListener, _this;
3552
- (_this__selfListener = (_this = this)._selfListener) === null || _this__selfListener === void 0 || _this__selfListener.call(_this, this.state.name, this, "self");
3553
- }
3554
- },
3555
- {
3556
- key: "onChangeTheme",
3557
- value: function(cb, debugId) {
3558
- var _this = this;
3559
- if (process.env.NODE_ENV !== "production" && debugId) {
3560
- var _this__listeningIds;
3561
- (_this__listeningIds = this._listeningIds) !== null && _this__listeningIds !== void 0 || (this._listeningIds = /* @__PURE__ */ new Set()), this._listeningIds.add(debugId);
3562
- }
3563
- return debugId === !0 && (this._selfListener = cb), this.themeListeners.add(cb), function() {
3564
- _this.themeListeners.delete(cb);
3565
- };
3566
- }
3567
- }
3568
- ]), ThemeManager2;
3569
- }(), cache = {};
3570
- function getState(props, manager) {
3571
- if (!getHasThemeUpdatingProps(props)) return null;
3572
- var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
3573
- return (x == null ? void 0 : x.state.name) || ".";
3574
- }).join("")}`, cached = cache[cacheKey];
3575
- if (!cached) {
3576
- var res = getStateUncached(props, manager);
3577
- return cache[cacheKey] = res, res;
3578
- }
3579
- return cached;
3580
- }
3581
- function getStateUncached(props, manager) {
3582
- if (props.name && props.reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
3583
- var themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
3584
- if (!baseManager && props.reset) return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
3585
- var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
3586
- baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
3587
- var nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map(function(x) {
3588
- return (x == null ? void 0 : x.state.name) || "";
3589
- });
3590
- isDirectParentAComponentTheme && allComponentThemes.shift();
3591
- for (var base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : (
3592
- // component name only don't search upwards
3593
- 0
3594
- ), i = max2; i >= min2; i--) {
3595
- var prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
3596
- props.inverse && (prefix = inverseThemeName(prefix));
3597
- var potentials = [];
3598
- if (prefix && prefix !== baseName && prefix.includes(nextName) && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
3599
- var lastSegment = potentials.findIndex(function(x) {
3600
- return !x.includes("_");
3601
- });
3602
- lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
3603
- }
3604
- if (componentName && !props.reset) {
3605
- var baseLen = base.length, componentPotentials = [];
3606
- if (nextName && baseLen > 1) {
3607
- var beforeSeparator = base[0];
3608
- componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
3395
+ var Tamagui = function() {
3396
+ if (process.env.NODE_ENV === "development") {
3397
+ var TamaguiManager = /* @__PURE__ */ function() {
3398
+ "use strict";
3399
+ function TamaguiManager2() {
3400
+ _class_call_check(this, TamaguiManager2), _define_property(this, "Helpers", Helpers);
3609
3401
  }
3610
- if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
3611
- if (i > baseLen) {
3612
- var prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
3613
- if (prefixLessOne) {
3614
- var lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
3615
- componentPotentials.unshift(lessSpecific);
3402
+ return _create_class(TamaguiManager2, [
3403
+ {
3404
+ key: "mediaState",
3405
+ get: function() {
3406
+ return {
3407
+ ...import_useMedia.mediaState
3408
+ };
3409
+ }
3410
+ },
3411
+ {
3412
+ key: "config",
3413
+ get: function() {
3414
+ return (0, import_config.getConfig)();
3415
+ }
3416
+ },
3417
+ {
3418
+ key: "insertedRules",
3419
+ get: function() {
3420
+ return (0, import_insertStyleRule.getAllRules)();
3421
+ }
3422
+ },
3423
+ {
3424
+ key: "allSelectors",
3425
+ get: function() {
3426
+ return (0, import_insertStyleRule.getAllSelectors)();
3427
+ }
3428
+ },
3429
+ {
3430
+ key: "allTransforms",
3431
+ get: function() {
3432
+ return (0, import_insertStyleRule.getAllTransforms)();
3433
+ }
3434
+ },
3435
+ {
3436
+ key: "identifierToValue",
3437
+ get: function() {
3438
+ return identifierToValue;
3616
3439
  }
3617
3440
  }
3618
- var moreSpecific = `${prefix}_${nextName}_${componentName}`;
3619
- componentPotentials.unshift(moreSpecific);
3620
- }
3621
- potentials = [
3622
- ...componentPotentials,
3623
- ...potentials,
3624
- ...allComponentThemes
3625
- ];
3626
- }
3627
- var found = potentials.find(function(t) {
3628
- return t in themes;
3629
- });
3630
- if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && import_constants4.isClient && console.info(` \u{1F537} [${manager == null ? void 0 : manager.id}] getState`, {
3631
- props,
3632
- found,
3633
- potentials,
3634
- baseManager,
3635
- nextName,
3636
- baseName,
3637
- prefix
3638
- }), found) {
3639
- var _this, names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants4.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_this = baseManager || parentManager) === null || _this === void 0 ? void 0 : _this.state, parentName = parentState == null ? void 0 : parentState.name;
3640
- result = {
3641
- name: found,
3642
- parentName,
3643
- theme: themes[found],
3644
- className,
3645
- isComponent,
3646
- isSchemeFixed: props.name === "light" || props.name === "dark",
3647
- scheme
3648
- };
3649
- break;
3650
- }
3441
+ ]), TamaguiManager2;
3442
+ }();
3443
+ return new TamaguiManager();
3651
3444
  }
3652
- return process.env.NODE_ENV !== "production" && props.debug === "verbose" && import_constants4.isClient && (console.groupCollapsed("ThemeManager.getState()"), console.info({
3653
- props,
3654
- baseName,
3655
- base,
3656
- min: min2,
3657
- max: max2
3658
- }), console.warn("result", {
3659
- result
3660
- }), console.trace(), console.groupEnd()), result;
3661
- }
3662
- var inverseThemeName = function(themeName) {
3663
- return themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
3445
+ }(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = function(identifier) {
3446
+ return identifierToValue.get(identifier);
3447
+ }, setIdentifierValue = function(identifier, value) {
3448
+ identifierToValue.set(identifier, value);
3664
3449
  };
3665
- function getManagers(themeManager) {
3666
- for (var comp = [], all = [], cur = themeManager; cur; ) all.push(cur), cur.state.isComponent && comp.push(cur), cur = cur.parentManager;
3667
- return [
3668
- all,
3669
- comp
3670
- ];
3671
- }
3672
3450
  }
3673
3451
  });
3674
3452
 
3675
- // ../../core/web/dist/cjs/helpers/ThemeManagerContext.native.js
3676
- var require_ThemeManagerContext_native = __commonJS({
3677
- "../../core/web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
3453
+ // ../../core/compose-refs/dist/cjs/compose-refs.native.js
3454
+ var require_compose_refs_native = __commonJS({
3455
+ "../../core/compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
3678
3456
  "use strict";
3679
3457
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3680
3458
  for (var name in all) __defProp2(target, name, {
@@ -3720,27 +3498,43 @@ var require_ThemeManagerContext_native = __commonJS({
3720
3498
  return __copyProps2(__defProp2({}, "__esModule", {
3721
3499
  value: !0
3722
3500
  }), mod);
3723
- }, ThemeManagerContext_exports = {};
3724
- __export2(ThemeManagerContext_exports, {
3725
- ThemeManagerContext: function() {
3726
- return ThemeManagerContext;
3501
+ }, compose_refs_exports = {};
3502
+ __export2(compose_refs_exports, {
3503
+ composeRefs: function() {
3504
+ return composeRefs;
3505
+ },
3506
+ setRef: function() {
3507
+ return setRef;
3508
+ },
3509
+ useComposedRefs: function() {
3510
+ return useComposedRefs3;
3727
3511
  }
3728
3512
  });
3729
- module2.exports = __toCommonJS2(ThemeManagerContext_exports);
3730
- var import_react3 = __toESM2(require("react")), ThemeManagerContext = /* @__PURE__ */ import_react3.default.createContext(null);
3513
+ module2.exports = __toCommonJS2(compose_refs_exports);
3514
+ var React4 = __toESM2(require("react"));
3515
+ function setRef(ref, value) {
3516
+ typeof ref == "function" ? ref(value) : ref && (ref.current = value);
3517
+ }
3518
+ function composeRefs() {
3519
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
3520
+ return function(node) {
3521
+ return refs.forEach(function(ref) {
3522
+ return setRef(ref, node);
3523
+ });
3524
+ };
3525
+ }
3526
+ function useComposedRefs3() {
3527
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
3528
+ return React4.useCallback(composeRefs(...refs), refs);
3529
+ }
3731
3530
  }
3732
3531
  });
3733
3532
 
3734
- // ../../core/web/dist/cjs/helpers/createShallowSetState.native.js
3735
- var require_createShallowSetState_native = __commonJS({
3736
- "../../core/web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
3533
+ // ../../core/compose-refs/dist/cjs/index.native.js
3534
+ var require_index_native12 = __commonJS({
3535
+ "../../core/compose-refs/dist/cjs/index.native.js"(exports2, module2) {
3737
3536
  "use strict";
3738
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3739
- for (var name in all) __defProp2(target, name, {
3740
- get: all[name],
3741
- enumerable: !0
3742
- });
3743
- }, __copyProps2 = function(to, from, except, desc) {
3537
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = function(to, from, except, desc) {
3744
3538
  var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3745
3539
  if (from && typeof from == "object" || typeof from == "function") try {
3746
3540
  for (var _loop = function() {
@@ -3763,57 +3557,21 @@ var require_createShallowSetState_native = __commonJS({
3763
3557
  }
3764
3558
  }
3765
3559
  return to;
3560
+ }, __reExport2 = function(target, mod, secondTarget) {
3561
+ return __copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default");
3766
3562
  }, __toCommonJS2 = function(mod) {
3767
3563
  return __copyProps2(__defProp2({}, "__esModule", {
3768
3564
  value: !0
3769
3565
  }), mod);
3770
- }, createShallowSetState_exports = {};
3771
- __export2(createShallowSetState_exports, {
3772
- createShallowSetState: function() {
3773
- return createShallowSetState;
3774
- },
3775
- isEqualShallow: function() {
3776
- return isEqualShallow;
3777
- },
3778
- mergeIfNotShallowEqual: function() {
3779
- return mergeIfNotShallowEqual;
3780
- }
3781
- });
3782
- module2.exports = __toCommonJS2(createShallowSetState_exports);
3783
- var import_react3 = require("react"), callImmediate = function(cb) {
3784
- return cb();
3785
- };
3786
- function createShallowSetState(setter, isDisabled, transition, debug) {
3787
- return function(next) {
3788
- var wrap = transition ? import_react3.startTransition : callImmediate;
3789
- wrap(function() {
3790
- setter(function(prev) {
3791
- return mergeIfNotShallowEqual(prev, next, isDisabled, debug);
3792
- });
3793
- });
3794
- };
3795
- }
3796
- function mergeIfNotShallowEqual(prev, next, isDisabled, debug) {
3797
- if (isDisabled || !prev || !next || isEqualShallow(prev, next)) return prev || next;
3798
- if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
3799
- prev,
3800
- next
3801
- }), debug === "break")) debugger;
3802
- return {
3803
- ...prev,
3804
- ...next
3805
- };
3806
- }
3807
- function isEqualShallow(prev, next) {
3808
- for (var key in next) if (prev[key] !== next[key]) return !1;
3809
- return !0;
3810
- }
3566
+ }, index_exports2 = {};
3567
+ module2.exports = __toCommonJS2(index_exports2);
3568
+ __reExport2(index_exports2, require_compose_refs_native(), module2.exports);
3811
3569
  }
3812
3570
  });
3813
3571
 
3814
- // ../../core/web/dist/cjs/hooks/shouldDeoptDueToParentScheme.native.js
3815
- var require_shouldDeoptDueToParentScheme_native = __commonJS({
3816
- "../../core/web/dist/cjs/hooks/shouldDeoptDueToParentScheme.native.js"(exports2, module2) {
3572
+ // ../../core/web/dist/cjs/constants/constants.native.js
3573
+ var require_constants_native2 = __commonJS({
3574
+ "../../core/web/dist/cjs/constants/constants.native.js"(exports2, module2) {
3817
3575
  "use strict";
3818
3576
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3819
3577
  for (var name in all) __defProp2(target, name, {
@@ -3847,41 +3605,95 @@ var require_shouldDeoptDueToParentScheme_native = __commonJS({
3847
3605
  return __copyProps2(__defProp2({}, "__esModule", {
3848
3606
  value: !0
3849
3607
  }), mod);
3850
- }, shouldDeoptDueToParentScheme_native_exports = {};
3851
- __export2(shouldDeoptDueToParentScheme_native_exports, {
3852
- shouldDeoptDueToParentScheme: function() {
3853
- return shouldDeoptDueToParentScheme;
3608
+ }, constants_exports = {};
3609
+ __export2(constants_exports, {
3610
+ FONT_DATA_ATTRIBUTE_NAME: function() {
3611
+ return FONT_DATA_ATTRIBUTE_NAME;
3612
+ },
3613
+ THEME_CLASSNAME_PREFIX: function() {
3614
+ return THEME_CLASSNAME_PREFIX;
3615
+ },
3616
+ THEME_NAME_SEPARATOR: function() {
3617
+ return THEME_NAME_SEPARATOR;
3618
+ },
3619
+ stackDefaultStyles: function() {
3620
+ return stackDefaultStyles;
3621
+ },
3622
+ webViewFlexCompatStyles: function() {
3623
+ return webViewFlexCompatStyles;
3854
3624
  }
3855
3625
  });
3856
- module2.exports = __toCommonJS2(shouldDeoptDueToParentScheme_native_exports);
3857
- var import_react_native4 = require("react-native");
3858
- function shouldDeoptDueToParentScheme(manager) {
3859
- var _parents_, parents = ((manager == null ? void 0 : manager.getParents()) || []).reverse(), rootScheme = (_parents_ = parents[0]) === null || _parents_ === void 0 ? void 0 : _parents_.state.scheme;
3860
- if (!rootScheme || import_react_native4.Appearance.getColorScheme() !== rootScheme) return !0;
3861
- var lastParentScheme = rootScheme, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3862
- try {
3863
- for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
3864
- var parent = _step.value;
3865
- if (parent.state.scheme !== lastParentScheme) return !0;
3866
- lastParentScheme = parent.state.scheme;
3867
- }
3626
+ module2.exports = __toCommonJS2(constants_exports);
3627
+ var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", stackDefaultStyles = {}, webViewFlexCompatStyles = {
3628
+ display: "flex",
3629
+ alignItems: "stretch",
3630
+ flexDirection: "column",
3631
+ flexBasis: "auto",
3632
+ boxSizing: "border-box",
3633
+ position: "relative",
3634
+ minHeight: 0,
3635
+ minWidth: 0,
3636
+ flexShrink: 0
3637
+ };
3638
+ }
3639
+ });
3640
+
3641
+ // ../../core/web/dist/cjs/constants/isDevTools.native.js
3642
+ var require_isDevTools_native = __commonJS({
3643
+ "../../core/web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
3644
+ "use strict";
3645
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3646
+ for (var name in all) __defProp2(target, name, {
3647
+ get: all[name],
3648
+ enumerable: !0
3649
+ });
3650
+ }, __copyProps2 = function(to, from, except, desc) {
3651
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3652
+ if (from && typeof from == "object" || typeof from == "function") try {
3653
+ for (var _loop = function() {
3654
+ var key = _step.value;
3655
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3656
+ get: function() {
3657
+ return from[key];
3658
+ },
3659
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3660
+ });
3661
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3868
3662
  } catch (err) {
3869
3663
  _didIteratorError = !0, _iteratorError = err;
3870
3664
  } finally {
3871
3665
  try {
3872
3666
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3873
3667
  } finally {
3874
- if (_didIteratorError) throw _iteratorError;
3668
+ if (_didIteratorError)
3669
+ throw _iteratorError;
3875
3670
  }
3876
3671
  }
3672
+ return to;
3673
+ }, __toCommonJS2 = function(mod) {
3674
+ return __copyProps2(__defProp2({}, "__esModule", {
3675
+ value: !0
3676
+ }), mod);
3677
+ }, isDevTools_exports = {};
3678
+ __export2(isDevTools_exports, {
3679
+ isDevTools: function() {
3680
+ return isDevTools;
3681
+ }
3682
+ });
3683
+ module2.exports = __toCommonJS2(isDevTools_exports);
3684
+ var isDevTools = function() {
3685
+ if (process.env.NODE_ENV === "development") try {
3686
+ return new Function("try {return this===window;}catch(e){ return false;}")();
3687
+ } catch {
3688
+ }
3877
3689
  return !1;
3878
- }
3690
+ }();
3879
3691
  }
3880
3692
  });
3881
3693
 
3882
- // ../../core/web/dist/cjs/hooks/useTheme.native.js
3883
- var require_useTheme_native = __commonJS({
3884
- "../../core/web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
3694
+ // ../../core/web/dist/cjs/helpers/objectIdentityKey.native.js
3695
+ var require_objectIdentityKey_native = __commonJS({
3696
+ "../../core/web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
3885
3697
  "use strict";
3886
3698
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3887
3699
  for (var name in all) __defProp2(target, name, {
@@ -3915,271 +3727,34 @@ var require_useTheme_native = __commonJS({
3915
3727
  return __copyProps2(__defProp2({}, "__esModule", {
3916
3728
  value: !0
3917
3729
  }), mod);
3918
- }, useTheme_exports = {};
3919
- __export2(useTheme_exports, {
3920
- activeThemeManagers: function() {
3921
- return activeThemeManagers;
3922
- },
3923
- getThemeManager: function() {
3924
- return getThemeManager;
3925
- },
3926
- useChangeThemeEffect: function() {
3927
- return useChangeThemeEffect;
3928
- },
3929
- useTheme: function() {
3930
- return useTheme4;
3931
- },
3932
- useThemeWithState: function() {
3933
- return useThemeWithState;
3730
+ }, objectIdentityKey_exports = {};
3731
+ __export2(objectIdentityKey_exports, {
3732
+ objectIdentityKey: function() {
3733
+ return objectIdentityKey;
3934
3734
  }
3935
3735
  });
3936
- module2.exports = __toCommonJS2(useTheme_exports);
3937
- var import_constants4 = require_index_native6(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_createShallowSetState = require_createShallowSetState_native(), import_shouldDeoptDueToParentScheme = require_shouldDeoptDueToParentScheme_native(), emptyProps = {
3938
- name: null
3939
- }, useTheme4 = function() {
3940
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyProps, [_, theme] = useThemeWithState(props), res = theme;
3941
- return res;
3942
- }, useThemeWithState = function(props) {
3943
- var keys = (0, import_react3.useRef)(null), changedThemeState = useChangeThemeEffect(props, !1, keys);
3944
- process.env.NODE_ENV === "development" && globalThis.time && time`theme-change-effect`;
3945
- var { themeManager, state } = changedThemeState;
3946
- process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(props)}).
3947
-
3948
- If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`));
3949
- var themeProxied = getThemeProxied(props, state, keys, themeManager);
3950
- return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(` \u{1F539} [${themeManager == null ? void 0 : themeManager.id}] useTheme =>`, state == null ? void 0 : state.name), console.info("returning state", changedThemeState.state, changedThemeState.isNewTheme, "from props", props), console.groupEnd()), [
3951
- changedThemeState,
3952
- themeProxied
3953
- ];
3954
- }, emptyObject = {}, ProxiedThemes = /* @__PURE__ */ new Map(), curKeys, curProps, curThemeManger;
3955
- function getThemeProxied(_props, state, _keys, _themeManager) {
3956
- var theme = state == null ? void 0 : state.theme;
3957
- if (!theme || !_themeManager) return emptyObject;
3958
- if (curKeys = _keys, curProps = _props, curThemeManger = _themeManager, ProxiedThemes.has(theme)) {
3959
- var proxied = ProxiedThemes.get(theme);
3960
- return proxied;
3961
- }
3962
- var { name, scheme } = state, config = (0, import_config.getConfig)();
3963
- function track(key) {
3964
- curKeys && (curKeys.current || (curKeys.current = []), curKeys.current.push(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
3965
- }
3966
- var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
3967
- var [key, value] = param, proxied2 = {
3968
- ...value,
3969
- get val() {
3970
- return globalThis.tamaguiAvoidTracking || track(key), value.val;
3971
- },
3972
- get(platform2) {
3973
- var outVal = (0, import_createVariable.getVariable)(value);
3974
- if (platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(curThemeManger) && scheme) {
3975
- var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
3976
- dynamic: {
3977
- [scheme]: color,
3978
- [oppositeScheme]: oppositeColor
3979
- }
3980
- };
3981
- return dynamicVal;
3982
- }
3983
- return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
3984
- not web: ${platform2 !== "web"}
3985
- isIOS: ${import_constants4.isIos}
3986
- deopt: ${curProps.deopt}
3987
- fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
3988
- inversed: ${getIsInversed(curThemeManger)}
3989
- `), track(key), outVal;
3990
- }
3991
- };
3992
- return [
3993
- [
3994
- key,
3995
- proxied2
3996
- ],
3997
- [
3998
- `$${key}`,
3999
- proxied2
4000
- ]
4001
- ];
4002
- }));
4003
- return ProxiedThemes.set(theme, proxied1), proxied1;
4004
- }
4005
- function getIsInversed(manager) {
4006
- for (var isInversed = !1, cur = manager; cur; ) {
4007
- if (!cur.parentManager) return isInversed;
4008
- cur.parentManager.state.scheme !== cur.state.scheme && (isInversed = !isInversed), cur = cur.parentManager;
4009
- }
4010
- return !1;
4011
- }
4012
- var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
4013
- return _idToUID[id];
4014
- }, getThemeManager = function(id) {
4015
- return _uidToManager.get(getId(id));
4016
- }, registerThemeManager = function(t) {
4017
- if (!_idToUID[t.id]) {
4018
- var id = _idToUID[t.id] = {};
4019
- _uidToManager.set(id, t);
4020
- }
4021
- }, ogLog = console.error, preventWarnSetState = process.env.NODE_ENV === "production" ? ogLog : (
4022
- // temporary fix for logs, they are harmless in that i've tried to rewrite this
4023
- // a few times using the "right" ways, but they are always slower. maybe skill issue
4024
- function(a) {
4025
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
4026
- if (!(typeof a == "string" && a.includes("Cannot update a component"))) return ogLog(a, ...args);
4027
- }
4028
- );
4029
- function getShouldUpdateTheme(props, parentManager, keys, themeState, nextState) {
4030
- var forceShouldChange = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1, _themeState_themeManager, _themeState_state;
4031
- if (!import_constants4.isServer && !(!forceShouldChange && !(keys != null && keys.current) && (!themeState || !themeState.isNewTheme) && !(0, import_ThemeManager.getHasThemeUpdatingProps)(props))) {
4032
- var next = nextState || (themeState == null || (_themeState_themeManager = themeState.themeManager) === null || _themeState_themeManager === void 0 ? void 0 : _themeState_themeManager.getState(props, parentManager));
4033
- if (forceShouldChange || !(!next || next.theme === (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.theme))) return next;
4034
- }
4035
- }
4036
- var useChangeThemeEffect = function(props) {
4037
- var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = arguments.length > 2 ? arguments[2] : void 0, _props_needsUpdate, { disable } = props, parentManager = (0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerContext), shouldAlwaysUpdate = ((_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props)) === !0 ? !0 : void 0;
4038
- if (!isRoot && !parentManager || disable) return {
4039
- isNewTheme: !1,
4040
- state: parentManager == null ? void 0 : parentManager.state,
4041
- themeManager: parentManager
4042
- };
4043
- var [themeState, setThemeState] = (0, import_react3.useState)(createState), { state, mounted, isNewTheme, themeManager, prevState } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
4044
- if (themeManager) {
4045
- var nextState = getShouldUpdateTheme(props, parentManager, keys, themeState, void 0, shouldAlwaysUpdate);
4046
- if (nextState) {
4047
- var _next_state, _themeState_state, next = createState(themeState, void 0, nextState);
4048
- ((_next_state = next.state) === null || _next_state === void 0 ? void 0 : _next_state.name) !== ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) && (setThemeState(next), console.error = preventWarnSetState, themeManager.notify(), console.error = ogLog);
4049
- }
4050
- }
4051
- if (import_constants4.isServer || ((0, import_react3.useEffect)(function() {
4052
- if (themeManager) {
4053
- if (props.inverse && !mounted) {
4054
- setThemeState(function(prev) {
4055
- return createState({
4056
- ...prev,
4057
- mounted: !0
4058
- });
4059
- });
4060
- return;
4061
- }
4062
- if ((isNewTheme || isRoot) && (activeThemeManagers.add(themeManager), process.env.NODE_ENV === "development" && isRoot)) {
4063
- var _globalThis, _TamaguiRootThemeManager;
4064
- (_globalThis = globalThis)[_TamaguiRootThemeManager = "TamaguiRootThemeManager"] || (_globalThis[_TamaguiRootThemeManager] = themeManager);
4065
- }
4066
- var updated = getShouldUpdateTheme(props, parentManager, keys, themeState, void 0, shouldAlwaysUpdate);
4067
- updated && setThemeState(function(prev) {
4068
- return createState(prev, void 0, updated);
4069
- });
4070
- var selfListenerDispose = themeManager.onChangeTheme(function(_a, _b, forced) {
4071
- forced && setThemeState(function(prev) {
4072
- var next2 = createState(prev, forced !== "self");
4073
- return next2;
4074
- });
4075
- }, !0), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(function(name, manager, forced) {
4076
- var force = forced || (import_constants4.isServer ? void 0 : keys != null && keys.current ? !0 : void 0) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.current || isNewTheme);
4077
- process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F538} onChange", {
4078
- id: themeManager.id,
4079
- force,
4080
- shouldTryUpdate,
4081
- props,
4082
- name,
4083
- keys
4084
- }), shouldTryUpdate && setThemeState(function(prev) {
4085
- return createState(prev, !0);
4086
- });
4087
- }, themeManager.id);
4088
- return function() {
4089
- selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), isNewTheme && activeThemeManagers.delete(themeManager);
4090
- };
4091
- }
4092
- }, [
4093
- themeManager,
4094
- parentManager,
4095
- isNewTheme,
4096
- props.componentName,
4097
- props.inverse,
4098
- props.name,
4099
- props.reset,
4100
- mounted
4101
- ]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react3.useEffect)(function() {
4102
- var _globalThis, _TamaguiThemeManagers, _;
4103
- return (_ = (_globalThis = globalThis)[_TamaguiThemeManagers = "TamaguiThemeManagers"]) !== null && _ !== void 0 || (_globalThis[_TamaguiThemeManagers] = /* @__PURE__ */ new Set()), globalThis.TamaguiThemeManagers.add(themeManager), function() {
4104
- globalThis.TamaguiThemeManagers.delete(themeManager);
4105
- };
4106
- }, [
4107
- themeManager
4108
- ])), import_constants4.isWeb && isInversingOnMount) return {
4109
- isNewTheme: !1,
4110
- inversed: !1,
4111
- themeManager: parentManager,
4112
- state: {
4113
- name: "",
4114
- ...parentManager == null ? void 0 : parentManager.state,
4115
- className: ""
4116
- }
4117
- };
4118
- return {
4119
- state,
4120
- isNewTheme,
4121
- inversed: !!props.inverse,
4122
- themeManager
4123
- };
4124
- function createState(prev) {
4125
- var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, foundNextState = arguments.length > 2 ? arguments[2] : void 0;
4126
- if (prev && !foundNextState && !(keys != null && keys.current) && !force) return prev;
4127
- var themeManager2 = parentManager, state2, hasThemeUpdatingProps = (0, import_ThemeManager.getHasThemeUpdatingProps)(props);
4128
- if (hasThemeUpdatingProps) {
4129
- var parentManagerProp = isRoot ? "root" : parentManager;
4130
- if (prev != null && prev.themeManager) {
4131
- themeManager2 = prev.themeManager;
4132
- var forceChange = force || shouldAlwaysUpdate || (keys != null && keys.current ? !0 : void 0), nextState2 = null;
4133
- if (foundNextState) nextState2 = foundNextState;
4134
- else {
4135
- var next2 = themeManager2.getState(props, parentManager);
4136
- nextState2 = getShouldUpdateTheme(props, parentManager, keys, prev, next2, forceChange);
4137
- }
4138
- nextState2 ? (state2 = nextState2, !prev.isNewTheme && !isRoot ? themeManager2 = new import_ThemeManager.ThemeManager(props, parentManagerProp) : themeManager2.updateState(nextState2)) : prev.isNewTheme && parentManager && !nextState2 && (themeManager2 = parentManager);
4139
- } else themeManager2 = new import_ThemeManager.ThemeManager(props, parentManagerProp), state2 = {
4140
- ...themeManager2.state
4141
- };
3736
+ module2.exports = __toCommonJS2(objectIdentityKey_exports);
3737
+ function objectIdentityKey(obj) {
3738
+ var k = "";
3739
+ for (var key in obj) {
3740
+ k += key;
3741
+ var arg = obj[key], type = typeof arg;
3742
+ if (!arg || type !== "object" && type !== "function") k += type + arg;
3743
+ else if (cache.has(arg)) k += cache.get(arg);
3744
+ else {
3745
+ var v = Math.random();
3746
+ cache.set(arg, v), k += v;
4142
3747
  }
4143
- var isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
4144
- isNewTheme2 && registerThemeManager(themeManager2);
4145
- var isWebSSR = import_constants4.isWeb ? !(0, import_config.getSetting)("disableSSR") : !1, mounted2 = isWebSSR ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
4146
- state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
4147
- var response = {
4148
- themeManager: themeManager2,
4149
- isNewTheme: isNewTheme2,
4150
- mounted: mounted2
4151
- };
4152
- props.inverse && (response.inversed = !0);
4153
- var shouldReturnPrev = prev && !force && // isEqualShallow uses the second arg as the keys so this should compare without state first...
4154
- (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
4155
- (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
4156
- if (prev && shouldReturnPrev) return prev;
4157
- if (response.state = state2, response.prevState = prev == null ? void 0 : prev.state, process.env.NODE_ENV === "development" && props.debug && import_constants4.isClient) {
4158
- console.groupCollapsed(`\u{1F537} [${themeManager2.id}] useChangeThemeEffect createState`);
4159
- var parentState = {
4160
- ...parentManager == null ? void 0 : parentManager.state
4161
- }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = {
4162
- ...themeManager2.state
4163
- };
4164
- console.info({
4165
- props,
4166
- parentState,
4167
- parentId,
4168
- themeManager: themeManager2,
4169
- prev,
4170
- response,
4171
- themeManagerState
4172
- }), console.groupEnd();
4173
- }
4174
- return response;
4175
3748
  }
4176
- };
3749
+ return k;
3750
+ }
3751
+ var cache = /* @__PURE__ */ new WeakMap();
4177
3752
  }
4178
3753
  });
4179
3754
 
4180
- // ../../core/web/dist/cjs/Tamagui.native.js
4181
- var require_Tamagui_native = __commonJS({
4182
- "../../core/web/dist/cjs/Tamagui.native.js"(exports2, module2) {
3755
+ // ../../core/web/dist/cjs/helpers/createStyledContext.native.js
3756
+ var require_createStyledContext_native = __commonJS({
3757
+ "../../core/web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
4183
3758
  "use strict";
4184
3759
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4185
3760
  for (var name in all) __defProp2(target, name, {
@@ -4225,109 +3800,48 @@ var require_Tamagui_native = __commonJS({
4225
3800
  return __copyProps2(__defProp2({}, "__esModule", {
4226
3801
  value: !0
4227
3802
  }), mod);
4228
- }, Tamagui_exports = {};
4229
- __export2(Tamagui_exports, {
4230
- Tamagui: function() {
4231
- return Tamagui;
4232
- },
4233
- getValueFromIdentifier: function() {
4234
- return getValueFromIdentifier;
4235
- },
4236
- setIdentifierValue: function() {
4237
- return setIdentifierValue;
3803
+ }, createStyledContext_exports = {};
3804
+ __export2(createStyledContext_exports, {
3805
+ createStyledContext: function() {
3806
+ return createStyledContext2;
4238
3807
  }
4239
3808
  });
4240
- module2.exports = __toCommonJS2(Tamagui_exports);
4241
- var Helpers = __toESM2(require_index_native7()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
4242
- function _class_call_check(instance, Constructor) {
4243
- if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4244
- }
4245
- function _defineProperties(target, props) {
4246
- for (var i = 0; i < props.length; i++) {
4247
- var descriptor = props[i];
4248
- descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
3809
+ module2.exports = __toCommonJS2(createStyledContext_exports);
3810
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native(), createReactContext = import_react3.default[Math.random(), "createContext"];
3811
+ function createStyledContext2(defaultValues) {
3812
+ var OGContext = createReactContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
3813
+ function getOrCreateScopedContext(scope) {
3814
+ var ScopedContext = scopedContexts.get(scope);
3815
+ return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
4249
3816
  }
3817
+ var Provider = function(param) {
3818
+ var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
3819
+ return {
3820
+ // this ! is a workaround for ts error
3821
+ ...defaultValues,
3822
+ ...values
3823
+ };
3824
+ }, [
3825
+ (0, import_objectIdentityKey.objectIdentityKey)(values)
3826
+ ]), Provider22 = OGProvider2;
3827
+ return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider22, {
3828
+ value: next,
3829
+ children
3830
+ });
3831
+ }, useStyledContext = function(scope) {
3832
+ var context = scope ? getOrCreateScopedContext(scope) : OGContext;
3833
+ return import_react3.default.useContext(context);
3834
+ };
3835
+ return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
4250
3836
  }
4251
- function _create_class(Constructor, protoProps, staticProps) {
4252
- return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
4253
- }
4254
- function _define_property(obj, key, value) {
4255
- return key in obj ? Object.defineProperty(obj, key, {
4256
- value,
4257
- enumerable: !0,
4258
- configurable: !0,
4259
- writable: !0
4260
- }) : obj[key] = value, obj;
4261
- }
4262
- var Tamagui = function() {
4263
- if (process.env.NODE_ENV === "development") {
4264
- var TamaguiManager = /* @__PURE__ */ function() {
4265
- "use strict";
4266
- function TamaguiManager2() {
4267
- _class_call_check(this, TamaguiManager2), _define_property(this, "Helpers", Helpers), _define_property(this, "getThemeManager", import_useTheme.getThemeManager);
4268
- }
4269
- return _create_class(TamaguiManager2, [
4270
- {
4271
- key: "activeThemeManagers",
4272
- get: function() {
4273
- return import_useTheme.activeThemeManagers;
4274
- }
4275
- },
4276
- {
4277
- key: "mediaState",
4278
- get: function() {
4279
- return {
4280
- ...import_useMedia.mediaState
4281
- };
4282
- }
4283
- },
4284
- {
4285
- key: "config",
4286
- get: function() {
4287
- return (0, import_config.getConfig)();
4288
- }
4289
- },
4290
- {
4291
- key: "insertedRules",
4292
- get: function() {
4293
- return (0, import_insertStyleRule.getAllRules)();
4294
- }
4295
- },
4296
- {
4297
- key: "allSelectors",
4298
- get: function() {
4299
- return (0, import_insertStyleRule.getAllSelectors)();
4300
- }
4301
- },
4302
- {
4303
- key: "allTransforms",
4304
- get: function() {
4305
- return (0, import_insertStyleRule.getAllTransforms)();
4306
- }
4307
- },
4308
- {
4309
- key: "identifierToValue",
4310
- get: function() {
4311
- return identifierToValue;
4312
- }
4313
- }
4314
- ]), TamaguiManager2;
4315
- }();
4316
- return new TamaguiManager();
4317
- }
4318
- }(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = function(identifier) {
4319
- return identifierToValue.get(identifier);
4320
- }, setIdentifierValue = function(identifier, value) {
4321
- identifierToValue.set(identifier, value);
4322
- };
4323
3837
  }
4324
3838
  });
4325
3839
 
4326
- // ../../core/compose-refs/dist/cjs/compose-refs.native.js
4327
- var require_compose_refs_native = __commonJS({
4328
- "../../core/compose-refs/dist/cjs/compose-refs.native.js"(exports2, module2) {
3840
+ // ../../core/web/dist/cjs/contexts/ComponentContext.native.js
3841
+ var require_ComponentContext_native = __commonJS({
3842
+ "../../core/web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
4329
3843
  "use strict";
4330
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3844
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4331
3845
  for (var name in all) __defProp2(target, name, {
4332
3846
  get: all[name],
4333
3847
  enumerable: !0
@@ -4355,59 +3869,42 @@ var require_compose_refs_native = __commonJS({
4355
3869
  }
4356
3870
  }
4357
3871
  return to;
4358
- }, __toESM2 = function(mod, isNodeMode, target) {
4359
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
4360
- // If the importer is in node compatibility mode or this is not an ESM
4361
- // file that has been converted to a CommonJS file using a Babel-
4362
- // compatible transform (i.e. "__esModule" has not been set), then set
4363
- // "default" to the CommonJS "module.exports" for node compatibility.
4364
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
4365
- value: mod,
4366
- enumerable: !0
4367
- }) : target,
4368
- mod
4369
- );
4370
3872
  }, __toCommonJS2 = function(mod) {
4371
3873
  return __copyProps2(__defProp2({}, "__esModule", {
4372
3874
  value: !0
4373
3875
  }), mod);
4374
- }, compose_refs_exports = {};
4375
- __export2(compose_refs_exports, {
4376
- composeRefs: function() {
4377
- return composeRefs;
4378
- },
4379
- setRef: function() {
4380
- return setRef;
4381
- },
4382
- useComposedRefs: function() {
4383
- return useComposedRefs3;
3876
+ }, ComponentContext_exports = {};
3877
+ __export2(ComponentContext_exports, {
3878
+ ComponentContext: function() {
3879
+ return ComponentContext2;
3880
+ }
3881
+ });
3882
+ module2.exports = __toCommonJS2(ComponentContext_exports);
3883
+ var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
3884
+ disableSSR: void 0,
3885
+ inText: !1,
3886
+ language: null,
3887
+ animationDriver: null,
3888
+ setParentFocusState: null,
3889
+ groups: {
3890
+ emit: null,
3891
+ subscribe: null,
3892
+ state: {}
4384
3893
  }
4385
3894
  });
4386
- module2.exports = __toCommonJS2(compose_refs_exports);
4387
- var React4 = __toESM2(require("react"));
4388
- function setRef(ref, value) {
4389
- typeof ref == "function" ? ref(value) : ref && (ref.current = value);
4390
- }
4391
- function composeRefs() {
4392
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
4393
- return function(node) {
4394
- return refs.forEach(function(ref) {
4395
- return setRef(ref, node);
4396
- });
4397
- };
4398
- }
4399
- function useComposedRefs3() {
4400
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
4401
- return React4.useCallback(composeRefs(...refs), refs);
4402
- }
4403
3895
  }
4404
3896
  });
4405
3897
 
4406
- // ../../core/compose-refs/dist/cjs/index.native.js
4407
- var require_index_native12 = __commonJS({
4408
- "../../core/compose-refs/dist/cjs/index.native.js"(exports2, module2) {
3898
+ // ../../core/web/dist/cjs/defaultComponentState.native.js
3899
+ var require_defaultComponentState_native = __commonJS({
3900
+ "../../core/web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
4409
3901
  "use strict";
4410
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = function(to, from, except, desc) {
3902
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3903
+ for (var name in all) __defProp2(target, name, {
3904
+ get: all[name],
3905
+ enumerable: !0
3906
+ });
3907
+ }, __copyProps2 = function(to, from, except, desc) {
4411
3908
  var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
4412
3909
  if (from && typeof from == "object" || typeof from == "function") try {
4413
3910
  for (var _loop = function() {
@@ -4430,21 +3927,45 @@ var require_index_native12 = __commonJS({
4430
3927
  }
4431
3928
  }
4432
3929
  return to;
4433
- }, __reExport2 = function(target, mod, secondTarget) {
4434
- return __copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default");
4435
3930
  }, __toCommonJS2 = function(mod) {
4436
3931
  return __copyProps2(__defProp2({}, "__esModule", {
4437
3932
  value: !0
4438
3933
  }), mod);
4439
- }, index_exports2 = {};
4440
- module2.exports = __toCommonJS2(index_exports2);
4441
- __reExport2(index_exports2, require_compose_refs_native(), module2.exports);
3934
+ }, defaultComponentState_exports = {};
3935
+ __export2(defaultComponentState_exports, {
3936
+ defaultComponentState: function() {
3937
+ return defaultComponentState;
3938
+ },
3939
+ defaultComponentStateMounted: function() {
3940
+ return defaultComponentStateMounted;
3941
+ },
3942
+ defaultComponentStateShouldEnter: function() {
3943
+ return defaultComponentStateShouldEnter;
3944
+ }
3945
+ });
3946
+ module2.exports = __toCommonJS2(defaultComponentState_exports);
3947
+ var defaultComponentState = {
3948
+ hover: !1,
3949
+ press: !1,
3950
+ pressIn: !1,
3951
+ focus: !1,
3952
+ focusVisible: !1,
3953
+ focusWithin: !1,
3954
+ unmounted: !0,
3955
+ disabled: !1
3956
+ }, defaultComponentStateMounted = {
3957
+ ...defaultComponentState,
3958
+ unmounted: !1
3959
+ }, defaultComponentStateShouldEnter = {
3960
+ ...defaultComponentState,
3961
+ unmounted: "should-enter"
3962
+ };
4442
3963
  }
4443
3964
  });
4444
3965
 
4445
- // ../../core/web/dist/cjs/constants/isDevTools.native.js
4446
- var require_isDevTools_native = __commonJS({
4447
- "../../core/web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
3966
+ // ../../core/web/dist/cjs/helpers/getShorthandValue.native.js
3967
+ var require_getShorthandValue_native = __commonJS({
3968
+ "../../core/web/dist/cjs/helpers/getShorthandValue.native.js"(exports2, module2) {
4448
3969
  "use strict";
4449
3970
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4450
3971
  for (var name in all) __defProp2(target, name, {
@@ -4478,26 +3999,24 @@ var require_isDevTools_native = __commonJS({
4478
3999
  return __copyProps2(__defProp2({}, "__esModule", {
4479
4000
  value: !0
4480
4001
  }), mod);
4481
- }, isDevTools_exports = {};
4482
- __export2(isDevTools_exports, {
4483
- isDevTools: function() {
4484
- return isDevTools;
4002
+ }, getShorthandValue_exports = {};
4003
+ __export2(getShorthandValue_exports, {
4004
+ getShorthandValue: function() {
4005
+ return getShorthandValue;
4485
4006
  }
4486
4007
  });
4487
- module2.exports = __toCommonJS2(isDevTools_exports);
4488
- var isDevTools = function() {
4489
- if (process.env.NODE_ENV === "development") try {
4490
- return new Function("try {return this===window;}catch(e){ return false;}")();
4491
- } catch {
4492
- }
4493
- return !1;
4494
- }();
4008
+ module2.exports = __toCommonJS2(getShorthandValue_exports);
4009
+ var import_config = require_config_native(), inverseShorthands = null, getShorthandValue = function(props, key) {
4010
+ inverseShorthands || (inverseShorthands = (0, import_config.getConfig)().inverseShorthands);
4011
+ var _props_key;
4012
+ return (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : inverseShorthands ? props[inverseShorthands[key]] : void 0;
4013
+ };
4495
4014
  }
4496
4015
  });
4497
4016
 
4498
- // ../../core/web/dist/cjs/helpers/objectIdentityKey.native.js
4499
- var require_objectIdentityKey_native = __commonJS({
4500
- "../../core/web/dist/cjs/helpers/objectIdentityKey.native.js"(exports2, module2) {
4017
+ // ../../core/web/dist/cjs/constants/accessibilityDirectMap.native.js
4018
+ var require_accessibilityDirectMap_native = __commonJS({
4019
+ "../../core/web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
4501
4020
  "use strict";
4502
4021
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4503
4022
  for (var name in all) __defProp2(target, name, {
@@ -4531,36 +4050,34 @@ var require_objectIdentityKey_native = __commonJS({
4531
4050
  return __copyProps2(__defProp2({}, "__esModule", {
4532
4051
  value: !0
4533
4052
  }), mod);
4534
- }, objectIdentityKey_exports = {};
4535
- __export2(objectIdentityKey_exports, {
4536
- objectIdentityKey: function() {
4537
- return objectIdentityKey;
4538
- }
4539
- });
4540
- module2.exports = __toCommonJS2(objectIdentityKey_exports);
4541
- function objectIdentityKey(obj) {
4542
- var k = "";
4543
- for (var key in obj) {
4544
- k += key;
4545
- var arg = obj[key], type = typeof arg;
4546
- if (!arg || type !== "object" && type !== "function") k += type + arg;
4547
- else if (cache.has(arg)) k += cache.get(arg);
4548
- else {
4549
- var v = Math.random();
4550
- cache.set(arg, v), k += v;
4551
- }
4053
+ }, accessibilityDirectMap_native_exports = {};
4054
+ __export2(accessibilityDirectMap_native_exports, {
4055
+ accessibilityDirectMap: function() {
4056
+ return accessibilityDirectMap;
4057
+ },
4058
+ accessibilityWebRoleToNativeRole: function() {
4059
+ return accessibilityWebRoleToNativeRole;
4060
+ },
4061
+ nativeAccessibilityState: function() {
4062
+ return nativeAccessibilityState;
4063
+ },
4064
+ nativeAccessibilityValue: function() {
4065
+ return nativeAccessibilityValue;
4066
+ },
4067
+ webToNativeAccessibilityDirectMap: function() {
4068
+ return webToNativeAccessibilityDirectMap;
4552
4069
  }
4553
- return k;
4554
- }
4555
- var cache = /* @__PURE__ */ new WeakMap();
4070
+ });
4071
+ module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
4072
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {}, nativeAccessibilityValue = {}, nativeAccessibilityState = {}, accessibilityWebRoleToNativeRole = {};
4556
4073
  }
4557
4074
  });
4558
4075
 
4559
- // ../../core/web/dist/cjs/helpers/createStyledContext.native.js
4560
- var require_createStyledContext_native = __commonJS({
4561
- "../../core/web/dist/cjs/helpers/createStyledContext.native.js"(exports2, module2) {
4076
+ // ../../core/web/dist/cjs/helpers/getGroupPropParts.native.js
4077
+ var require_getGroupPropParts_native = __commonJS({
4078
+ "../../core/web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
4562
4079
  "use strict";
4563
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4080
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4564
4081
  for (var name in all) __defProp2(target, name, {
4565
4082
  get: all[name],
4566
4083
  enumerable: !0
@@ -4588,62 +4105,32 @@ var require_createStyledContext_native = __commonJS({
4588
4105
  }
4589
4106
  }
4590
4107
  return to;
4591
- }, __toESM2 = function(mod, isNodeMode, target) {
4592
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
4593
- // If the importer is in node compatibility mode or this is not an ESM
4594
- // file that has been converted to a CommonJS file using a Babel-
4595
- // compatible transform (i.e. "__esModule" has not been set), then set
4596
- // "default" to the CommonJS "module.exports" for node compatibility.
4597
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
4598
- value: mod,
4599
- enumerable: !0
4600
- }) : target,
4601
- mod
4602
- );
4603
4108
  }, __toCommonJS2 = function(mod) {
4604
4109
  return __copyProps2(__defProp2({}, "__esModule", {
4605
4110
  value: !0
4606
4111
  }), mod);
4607
- }, createStyledContext_exports = {};
4608
- __export2(createStyledContext_exports, {
4609
- createStyledContext: function() {
4610
- return createStyledContext2;
4112
+ }, getGroupPropParts_exports = {};
4113
+ __export2(getGroupPropParts_exports, {
4114
+ getGroupPropParts: function() {
4115
+ return getGroupPropParts;
4611
4116
  }
4612
4117
  });
4613
- module2.exports = __toCommonJS2(createStyledContext_exports);
4614
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native(), createReactContext = import_react3.default[Math.random(), "createContext"];
4615
- function createStyledContext2(defaultValues) {
4616
- var OGContext = createReactContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
4617
- function getOrCreateScopedContext(scope) {
4618
- var ScopedContext = scopedContexts.get(scope);
4619
- return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
4620
- }
4621
- var Provider = function(param) {
4622
- var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
4623
- return {
4624
- // this ! is a workaround for ts error
4625
- ...defaultValues,
4626
- ...values
4627
- };
4628
- }, [
4629
- (0, import_objectIdentityKey.objectIdentityKey)(values)
4630
- ]), Provider22 = OGProvider2;
4631
- return scope && (Provider22 = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider22, {
4632
- value: next,
4633
- children
4634
- });
4635
- }, useStyledContext = function(scope) {
4636
- var context = scope ? getOrCreateScopedContext(scope) : OGContext;
4637
- return import_react3.default.useContext(context);
4118
+ module2.exports = __toCommonJS2(getGroupPropParts_exports);
4119
+ var import_useMedia = require_useMedia_native();
4120
+ function getGroupPropParts(groupProp) {
4121
+ var mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
4122
+ return media ? pseudo = part4 : pseudo = part3, {
4123
+ name,
4124
+ pseudo,
4125
+ media
4638
4126
  };
4639
- return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
4640
4127
  }
4641
4128
  }
4642
4129
  });
4643
4130
 
4644
- // ../../core/web/dist/cjs/contexts/ComponentContext.native.js
4645
- var require_ComponentContext_native = __commonJS({
4646
- "../../core/web/dist/cjs/contexts/ComponentContext.native.js"(exports2, module2) {
4131
+ // ../../core/web/dist/cjs/helpers/createMediaStyle.native.js
4132
+ var require_createMediaStyle_native = __commonJS({
4133
+ "../../core/web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
4647
4134
  "use strict";
4648
4135
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4649
4136
  for (var name in all) __defProp2(target, name, {
@@ -4677,31 +4164,83 @@ var require_ComponentContext_native = __commonJS({
4677
4164
  return __copyProps2(__defProp2({}, "__esModule", {
4678
4165
  value: !0
4679
4166
  }), mod);
4680
- }, ComponentContext_exports = {};
4681
- __export2(ComponentContext_exports, {
4682
- ComponentContext: function() {
4683
- return ComponentContext2;
4167
+ }, createMediaStyle_exports = {};
4168
+ __export2(createMediaStyle_exports, {
4169
+ MEDIA_SEP: function() {
4170
+ return MEDIA_SEP;
4171
+ },
4172
+ createMediaStyle: function() {
4173
+ return createMediaStyle;
4684
4174
  }
4685
4175
  });
4686
- module2.exports = __toCommonJS2(ComponentContext_exports);
4687
- var import_createStyledContext = require_createStyledContext_native(), ComponentContext2 = (0, import_createStyledContext.createStyledContext)({
4688
- disableSSR: void 0,
4689
- inText: !1,
4690
- language: null,
4691
- animationDriver: null,
4692
- setParentFocusState: null,
4693
- groups: {
4694
- emit: null,
4695
- subscribe: null,
4696
- state: {}
4697
- }
4176
+ module2.exports = __toCommonJS2(createMediaStyle_exports);
4177
+ var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
4178
+ press: "active",
4179
+ focusVisible: "focus-visible",
4180
+ focusWithin: "focus-within"
4181
+ }, specificities = new Array(5).fill(0).map(function(_, i) {
4182
+ return new Array(i).fill(":root").join("");
4698
4183
  });
4184
+ function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
4185
+ var isTheme = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, precedenceImportancePrefix = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "", selectorStart = styleInner.lastIndexOf(":root") + 5, selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = groupParts.pseudo ? groupPseudoToPseudoCSSMap[groupParts.pseudo] || groupParts.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${isGroup ? "group_" : ""}${name}${pseudoSelector}`;
4186
+ return [
4187
+ selector,
4188
+ `${presedencePrefix}${mediaSelector} ${selector.replaceAll(":root", "")}`
4189
+ ];
4190
+ }
4191
+ var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
4192
+ var [propertyIn, , identifier, pseudoIn, rules] = styleObject, property = propertyIn, enableMediaPropOrder = (0, import_config.getSetting)("mediaPropOrder"), isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
4193
+ return rule.replace(identifier, nextIdentifier);
4194
+ }).join(";"), isHover = !1;
4195
+ if (isNonWindowMedia) {
4196
+ var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
4197
+ if (isTheme || isGroup) {
4198
+ var groupParts = (0, import_getGroupPropParts.getGroupPropParts)(isTheme ? "theme-" + mediaKeyIn : mediaKeyIn), { name, media, pseudo } = groupParts;
4199
+ groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = !0);
4200
+ var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
4201
+ styleRule = styleInner.replace(selector, nextSelector);
4202
+ } else styleRule = `${specificities[specificity]}${styleInner}`;
4203
+ }
4204
+ if (!isNonWindowMedia || groupMediaKey) {
4205
+ if (!selectors) {
4206
+ var mediaKeys = Object.keys(mediaQueries);
4207
+ selectors = Object.fromEntries(mediaKeys.map(function(key) {
4208
+ return [
4209
+ key,
4210
+ (0, import_useMedia.mediaObjectToString)(mediaQueries[key])
4211
+ ];
4212
+ })), enableMediaPropOrder || (prefixes = Object.fromEntries(mediaKeys.map(function(k, index) {
4213
+ return [
4214
+ k,
4215
+ new Array(index + 1).fill(":root").join("")
4216
+ ];
4217
+ })));
4218
+ }
4219
+ var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
4220
+ // this new array should be cached
4221
+ specificities[priority]
4222
+ ) : (
4223
+ // @ts-ignore
4224
+ prefixes[mediaKey]
4225
+ ), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
4226
+ groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${(0, import_config.getSetting)("webContainerType") || "inline-size"}) {${styleRule}}`);
4227
+ }
4228
+ return isHover && (styleRule = `@media (hover:hover){${styleRule}}`), [
4229
+ property,
4230
+ void 0,
4231
+ nextIdentifier,
4232
+ void 0,
4233
+ [
4234
+ styleRule
4235
+ ]
4236
+ ];
4237
+ };
4699
4238
  }
4700
4239
  });
4701
4240
 
4702
- // ../../core/web/dist/cjs/defaultComponentState.native.js
4703
- var require_defaultComponentState_native = __commonJS({
4704
- "../../core/web/dist/cjs/defaultComponentState.native.js"(exports2, module2) {
4241
+ // ../../core/web/dist/cjs/helpers/defaultOffset.native.js
4242
+ var require_defaultOffset_native = __commonJS({
4243
+ "../../core/web/dist/cjs/helpers/defaultOffset.native.js"(exports2, module2) {
4705
4244
  "use strict";
4706
4245
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4707
4246
  for (var name in all) __defProp2(target, name, {
@@ -4735,366 +4274,23 @@ var require_defaultComponentState_native = __commonJS({
4735
4274
  return __copyProps2(__defProp2({}, "__esModule", {
4736
4275
  value: !0
4737
4276
  }), mod);
4738
- }, defaultComponentState_exports = {};
4739
- __export2(defaultComponentState_exports, {
4740
- defaultComponentState: function() {
4741
- return defaultComponentState;
4742
- },
4743
- defaultComponentStateMounted: function() {
4744
- return defaultComponentStateMounted;
4745
- },
4746
- defaultComponentStateShouldEnter: function() {
4747
- return defaultComponentStateShouldEnter;
4277
+ }, defaultOffset_exports = {};
4278
+ __export2(defaultOffset_exports, {
4279
+ defaultOffset: function() {
4280
+ return defaultOffset;
4748
4281
  }
4749
4282
  });
4750
- module2.exports = __toCommonJS2(defaultComponentState_exports);
4751
- var defaultComponentState = {
4752
- hover: !1,
4753
- press: !1,
4754
- pressIn: !1,
4755
- focus: !1,
4756
- focusVisible: !1,
4757
- focusWithin: !1,
4758
- unmounted: !0,
4759
- disabled: !1
4760
- }, defaultComponentStateMounted = {
4761
- ...defaultComponentState,
4762
- unmounted: !1
4763
- }, defaultComponentStateShouldEnter = {
4764
- ...defaultComponentState,
4765
- unmounted: "should-enter"
4283
+ module2.exports = __toCommonJS2(defaultOffset_exports);
4284
+ var defaultOffset = {
4285
+ height: 0,
4286
+ width: 0
4766
4287
  };
4767
4288
  }
4768
4289
  });
4769
4290
 
4770
- // ../../core/web/dist/cjs/helpers/getShorthandValue.native.js
4771
- var require_getShorthandValue_native = __commonJS({
4772
- "../../core/web/dist/cjs/helpers/getShorthandValue.native.js"(exports2, module2) {
4773
- "use strict";
4774
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4775
- for (var name in all) __defProp2(target, name, {
4776
- get: all[name],
4777
- enumerable: !0
4778
- });
4779
- }, __copyProps2 = function(to, from, except, desc) {
4780
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
4781
- if (from && typeof from == "object" || typeof from == "function") try {
4782
- for (var _loop = function() {
4783
- var key = _step.value;
4784
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
4785
- get: function() {
4786
- return from[key];
4787
- },
4788
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
4789
- });
4790
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
4791
- } catch (err) {
4792
- _didIteratorError = !0, _iteratorError = err;
4793
- } finally {
4794
- try {
4795
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
4796
- } finally {
4797
- if (_didIteratorError)
4798
- throw _iteratorError;
4799
- }
4800
- }
4801
- return to;
4802
- }, __toCommonJS2 = function(mod) {
4803
- return __copyProps2(__defProp2({}, "__esModule", {
4804
- value: !0
4805
- }), mod);
4806
- }, getShorthandValue_exports = {};
4807
- __export2(getShorthandValue_exports, {
4808
- getShorthandValue: function() {
4809
- return getShorthandValue;
4810
- }
4811
- });
4812
- module2.exports = __toCommonJS2(getShorthandValue_exports);
4813
- var import_config = require_config_native(), inverseShorthands = null, getShorthandValue = function(props, key) {
4814
- inverseShorthands || (inverseShorthands = (0, import_config.getConfig)().inverseShorthands);
4815
- var _props_key;
4816
- return (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : inverseShorthands ? props[inverseShorthands[key]] : void 0;
4817
- };
4818
- }
4819
- });
4820
-
4821
- // ../../core/web/dist/cjs/constants/accessibilityDirectMap.native.js
4822
- var require_accessibilityDirectMap_native = __commonJS({
4823
- "../../core/web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
4824
- "use strict";
4825
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4826
- for (var name in all) __defProp2(target, name, {
4827
- get: all[name],
4828
- enumerable: !0
4829
- });
4830
- }, __copyProps2 = function(to, from, except, desc) {
4831
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
4832
- if (from && typeof from == "object" || typeof from == "function") try {
4833
- for (var _loop = function() {
4834
- var key = _step.value;
4835
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
4836
- get: function() {
4837
- return from[key];
4838
- },
4839
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
4840
- });
4841
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
4842
- } catch (err) {
4843
- _didIteratorError = !0, _iteratorError = err;
4844
- } finally {
4845
- try {
4846
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
4847
- } finally {
4848
- if (_didIteratorError)
4849
- throw _iteratorError;
4850
- }
4851
- }
4852
- return to;
4853
- }, __toCommonJS2 = function(mod) {
4854
- return __copyProps2(__defProp2({}, "__esModule", {
4855
- value: !0
4856
- }), mod);
4857
- }, accessibilityDirectMap_native_exports = {};
4858
- __export2(accessibilityDirectMap_native_exports, {
4859
- accessibilityDirectMap: function() {
4860
- return accessibilityDirectMap;
4861
- },
4862
- accessibilityWebRoleToNativeRole: function() {
4863
- return accessibilityWebRoleToNativeRole;
4864
- },
4865
- nativeAccessibilityState: function() {
4866
- return nativeAccessibilityState;
4867
- },
4868
- nativeAccessibilityValue: function() {
4869
- return nativeAccessibilityValue;
4870
- },
4871
- webToNativeAccessibilityDirectMap: function() {
4872
- return webToNativeAccessibilityDirectMap;
4873
- }
4874
- });
4875
- module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
4876
- var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {}, nativeAccessibilityValue = {}, nativeAccessibilityState = {}, accessibilityWebRoleToNativeRole = {};
4877
- }
4878
- });
4879
-
4880
- // ../../core/web/dist/cjs/helpers/getGroupPropParts.native.js
4881
- var require_getGroupPropParts_native = __commonJS({
4882
- "../../core/web/dist/cjs/helpers/getGroupPropParts.native.js"(exports2, module2) {
4883
- "use strict";
4884
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4885
- for (var name in all) __defProp2(target, name, {
4886
- get: all[name],
4887
- enumerable: !0
4888
- });
4889
- }, __copyProps2 = function(to, from, except, desc) {
4890
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
4891
- if (from && typeof from == "object" || typeof from == "function") try {
4892
- for (var _loop = function() {
4893
- var key = _step.value;
4894
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
4895
- get: function() {
4896
- return from[key];
4897
- },
4898
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
4899
- });
4900
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
4901
- } catch (err) {
4902
- _didIteratorError = !0, _iteratorError = err;
4903
- } finally {
4904
- try {
4905
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
4906
- } finally {
4907
- if (_didIteratorError)
4908
- throw _iteratorError;
4909
- }
4910
- }
4911
- return to;
4912
- }, __toCommonJS2 = function(mod) {
4913
- return __copyProps2(__defProp2({}, "__esModule", {
4914
- value: !0
4915
- }), mod);
4916
- }, getGroupPropParts_exports = {};
4917
- __export2(getGroupPropParts_exports, {
4918
- getGroupPropParts: function() {
4919
- return getGroupPropParts;
4920
- }
4921
- });
4922
- module2.exports = __toCommonJS2(getGroupPropParts_exports);
4923
- var import_useMedia = require_useMedia_native();
4924
- function getGroupPropParts(groupProp) {
4925
- var mediaQueries = (0, import_useMedia.getMedia)(), [_, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
4926
- return media ? pseudo = part4 : pseudo = part3, {
4927
- name,
4928
- pseudo,
4929
- media
4930
- };
4931
- }
4932
- }
4933
- });
4934
-
4935
- // ../../core/web/dist/cjs/helpers/createMediaStyle.native.js
4936
- var require_createMediaStyle_native = __commonJS({
4937
- "../../core/web/dist/cjs/helpers/createMediaStyle.native.js"(exports2, module2) {
4938
- "use strict";
4939
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
4940
- for (var name in all) __defProp2(target, name, {
4941
- get: all[name],
4942
- enumerable: !0
4943
- });
4944
- }, __copyProps2 = function(to, from, except, desc) {
4945
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
4946
- if (from && typeof from == "object" || typeof from == "function") try {
4947
- for (var _loop = function() {
4948
- var key = _step.value;
4949
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
4950
- get: function() {
4951
- return from[key];
4952
- },
4953
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
4954
- });
4955
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
4956
- } catch (err) {
4957
- _didIteratorError = !0, _iteratorError = err;
4958
- } finally {
4959
- try {
4960
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
4961
- } finally {
4962
- if (_didIteratorError)
4963
- throw _iteratorError;
4964
- }
4965
- }
4966
- return to;
4967
- }, __toCommonJS2 = function(mod) {
4968
- return __copyProps2(__defProp2({}, "__esModule", {
4969
- value: !0
4970
- }), mod);
4971
- }, createMediaStyle_exports = {};
4972
- __export2(createMediaStyle_exports, {
4973
- MEDIA_SEP: function() {
4974
- return MEDIA_SEP;
4975
- },
4976
- createMediaStyle: function() {
4977
- return createMediaStyle;
4978
- }
4979
- });
4980
- module2.exports = __toCommonJS2(createMediaStyle_exports);
4981
- var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
4982
- press: "active",
4983
- focusVisible: "focus-visible",
4984
- focusWithin: "focus-within"
4985
- }, specificities = new Array(5).fill(0).map(function(_, i) {
4986
- return new Array(i).fill(":root").join("");
4987
- });
4988
- function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
4989
- var isTheme = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, precedenceImportancePrefix = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "", selectorStart = styleInner.lastIndexOf(":root") + 5, selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = groupParts.pseudo ? groupPseudoToPseudoCSSMap[groupParts.pseudo] || groupParts.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${isGroup ? "group_" : ""}${name}${pseudoSelector}`;
4990
- return [
4991
- selector,
4992
- `${presedencePrefix}${mediaSelector} ${selector.replaceAll(":root", "")}`
4993
- ];
4994
- }
4995
- var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
4996
- var [propertyIn, , identifier, pseudoIn, rules] = styleObject, property = propertyIn, enableMediaPropOrder = (0, import_config.getSetting)("mediaPropOrder"), isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
4997
- return rule.replace(identifier, nextIdentifier);
4998
- }).join(";"), isHover = !1;
4999
- if (isNonWindowMedia) {
5000
- var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
5001
- if (isTheme || isGroup) {
5002
- var groupParts = (0, import_getGroupPropParts.getGroupPropParts)(isTheme ? "theme-" + mediaKeyIn : mediaKeyIn), { name, media, pseudo } = groupParts;
5003
- groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = !0);
5004
- var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
5005
- styleRule = styleInner.replace(selector, nextSelector);
5006
- } else styleRule = `${specificities[specificity]}${styleInner}`;
5007
- }
5008
- if (!isNonWindowMedia || groupMediaKey) {
5009
- if (!selectors) {
5010
- var mediaKeys = Object.keys(mediaQueries);
5011
- selectors = Object.fromEntries(mediaKeys.map(function(key) {
5012
- return [
5013
- key,
5014
- (0, import_useMedia.mediaObjectToString)(mediaQueries[key])
5015
- ];
5016
- })), enableMediaPropOrder || (prefixes = Object.fromEntries(mediaKeys.map(function(k, index) {
5017
- return [
5018
- k,
5019
- new Array(index + 1).fill(":root").join("")
5020
- ];
5021
- })));
5022
- }
5023
- var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
5024
- // this new array should be cached
5025
- specificities[priority]
5026
- ) : (
5027
- // @ts-ignore
5028
- prefixes[mediaKey]
5029
- ), prefix = groupMediaKey ? `@container ${containerName}` : "@media";
5030
- groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${(0, import_config.getSetting)("webContainerType") || "inline-size"}) {${styleRule}}`);
5031
- }
5032
- return isHover && (styleRule = `@media (hover:hover){${styleRule}}`), [
5033
- property,
5034
- void 0,
5035
- nextIdentifier,
5036
- void 0,
5037
- [
5038
- styleRule
5039
- ]
5040
- ];
5041
- };
5042
- }
5043
- });
5044
-
5045
- // ../../core/web/dist/cjs/helpers/defaultOffset.native.js
5046
- var require_defaultOffset_native = __commonJS({
5047
- "../../core/web/dist/cjs/helpers/defaultOffset.native.js"(exports2, module2) {
5048
- "use strict";
5049
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
5050
- for (var name in all) __defProp2(target, name, {
5051
- get: all[name],
5052
- enumerable: !0
5053
- });
5054
- }, __copyProps2 = function(to, from, except, desc) {
5055
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
5056
- if (from && typeof from == "object" || typeof from == "function") try {
5057
- for (var _loop = function() {
5058
- var key = _step.value;
5059
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
5060
- get: function() {
5061
- return from[key];
5062
- },
5063
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
5064
- });
5065
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
5066
- } catch (err) {
5067
- _didIteratorError = !0, _iteratorError = err;
5068
- } finally {
5069
- try {
5070
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
5071
- } finally {
5072
- if (_didIteratorError)
5073
- throw _iteratorError;
5074
- }
5075
- }
5076
- return to;
5077
- }, __toCommonJS2 = function(mod) {
5078
- return __copyProps2(__defProp2({}, "__esModule", {
5079
- value: !0
5080
- }), mod);
5081
- }, defaultOffset_exports = {};
5082
- __export2(defaultOffset_exports, {
5083
- defaultOffset: function() {
5084
- return defaultOffset;
5085
- }
5086
- });
5087
- module2.exports = __toCommonJS2(defaultOffset_exports);
5088
- var defaultOffset = {
5089
- height: 0,
5090
- width: 0
5091
- };
5092
- }
5093
- });
5094
-
5095
- // ../../../node_modules/@react-native/normalize-color/index.js
5096
- var require_normalize_color = __commonJS({
5097
- "../../../node_modules/@react-native/normalize-color/index.js"(exports2, module2) {
4291
+ // ../../../node_modules/@react-native/normalize-color/index.js
4292
+ var require_normalize_color = __commonJS({
4293
+ "../../../node_modules/@react-native/normalize-color/index.js"(exports2, module2) {
5098
4294
  "use strict";
5099
4295
  function normalizeColor(color) {
5100
4296
  if (typeof color == "number")
@@ -7558,240 +6754,737 @@ var require_getSplitStyles_native = __commonJS({
7558
6754
  }
7559
6755
  }));
7560
6756
  }
7561
- process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants4.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
7562
- props,
7563
- staticConfig,
7564
- shouldDoClasses,
7565
- styleProps,
7566
- rulesToInsert,
7567
- componentState,
7568
- styleState,
7569
- theme: {
7570
- ...theme
7571
- }
7572
- }), console.groupEnd());
7573
- var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
7574
- for (var keyOg in props) _loop(keyOg);
7575
- process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
7576
- var avoidNormalize = styleProps.noNormalize === !1;
7577
- if (!avoidNormalize) {
7578
- if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), !styleProps.noExpand && !styleProps.noMergeStyle && import_constants4.isWeb && !isReactNative && (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
7579
- var _styleState;
7580
- (_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
7581
- var [a] = param, [b] = param1;
7582
- return (0, import_sortString.sortString)(a, b);
7583
- }).forEach(function(param) {
7584
- var [key4, val2] = param;
7585
- mergeTransform(styleState.style, key4, val2, !0);
6757
+ process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants4.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
6758
+ props,
6759
+ staticConfig,
6760
+ shouldDoClasses,
6761
+ styleProps,
6762
+ rulesToInsert,
6763
+ componentState,
6764
+ styleState,
6765
+ theme: {
6766
+ ...theme
6767
+ }
6768
+ }), console.groupEnd());
6769
+ var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
6770
+ for (var keyOg in props) _loop(keyOg);
6771
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
6772
+ var avoidNormalize = styleProps.noNormalize === !1;
6773
+ if (!avoidNormalize) {
6774
+ if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), !styleProps.noExpand && !styleProps.noMergeStyle && import_constants4.isWeb && !isReactNative && (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
6775
+ var _styleState;
6776
+ (_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
6777
+ var [a] = param, [b] = param1;
6778
+ return (0, import_sortString.sortString)(a, b);
6779
+ }).forEach(function(param) {
6780
+ var [key4, val2] = param;
6781
+ mergeTransform(styleState.style, key4, val2, !0);
6782
+ });
6783
+ }
6784
+ if (parentSplitStyles) {
6785
+ if (0) for (var key in parentSplitStyles.classNames) var val;
6786
+ if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
6787
+ var _styleState1;
6788
+ key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
6789
+ }
6790
+ }
6791
+ }
6792
+ if (0) var _styleState_style, shouldStringifyTransforms;
6793
+ if (0) {
6794
+ if (!styleProps.noMergeStyle && styleState.style && shouldDoClasses) {
6795
+ var retainedStyles, shouldRetain;
6796
+ if (!styleState.style.$$css) {
6797
+ var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
6798
+ try {
6799
+ for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
6800
+ } catch (err) {
6801
+ } finally {
6802
+ }
6803
+ }
6804
+ if (transforms) for (var namespace in transforms) {
6805
+ var hash, val1, identifier1;
6806
+ if (import_constants4.isClient && !insertedTransforms[identifier1]) var rule;
6807
+ }
6808
+ }
6809
+ if (isReactNative) {
6810
+ if (viewProps.tabIndex === 0) var _viewProps, _accessible;
6811
+ } else if (viewProps.tabIndex == null) var _viewProps_focusable, isFocusable, role;
6812
+ }
6813
+ var styleProp = props.style;
6814
+ if (!styleProps.noMergeStyle && styleProp) if (isHOC) viewProps.style = normalizeStyle(styleProp);
6815
+ else for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
6816
+ var style = isArray ? styleProp[i] : styleProp;
6817
+ if (style) if (style.$$css) Object.assign(styleState.classNames, style);
6818
+ else {
6819
+ var _styleState2;
6820
+ (_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
6821
+ }
6822
+ }
6823
+ var style1 = styleState.style;
6824
+ if (style1 != null && style1.fontFamily) {
6825
+ var _getFont, faceInfo = (_getFont = (0, import_config.getFont)(style1.fontFamily)) === null || _getFont === void 0 ? void 0 : _getFont.face;
6826
+ if (faceInfo) {
6827
+ var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[style1.fontWeight]) === null || _faceInfo_style_fontWeight === void 0 || (_faceInfo_style_fontWeight_ = _faceInfo_style_fontWeight[style1.fontStyle || "normal"]) === null || _faceInfo_style_fontWeight_ === void 0 ? void 0 : _faceInfo_style_fontWeight_.val;
6828
+ overrideFace && (style1.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style1.fontWeight, delete style1.fontStyle);
6829
+ }
6830
+ process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
6831
+ }
6832
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-pre-result`;
6833
+ var result = {
6834
+ space,
6835
+ hasMedia,
6836
+ fontFamily: styleState.fontFamily,
6837
+ viewProps,
6838
+ style: styleState.style,
6839
+ pseudos,
6840
+ classNames,
6841
+ rulesToInsert,
6842
+ dynamicThemeAccess,
6843
+ pseudoGroups,
6844
+ mediaGroups
6845
+ }, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
6846
+ if (!styleProps.noMergeStyle && !asChildExceptStyleLike) {
6847
+ var style2 = styleState.style;
6848
+ if (0) {
6849
+ var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
6850
+ if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) && isReactNative) {
6851
+ var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
6852
+ try {
6853
+ for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
6854
+ } catch (err) {
6855
+ } finally {
6856
+ }
6857
+ }
6858
+ } else style2 && (viewProps.style = style2);
6859
+ }
6860
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
6861
+ consoleGroupCollapsed("\u{1F539} getSplitStyles ===>");
6862
+ try {
6863
+ var logs = {
6864
+ ...result,
6865
+ className,
6866
+ componentState,
6867
+ transforms,
6868
+ viewProps,
6869
+ rulesToInsert,
6870
+ parentSplitStyles
6871
+ };
6872
+ for (var key3 in logs) (0, import_log.log)(key3, logs[key3]);
6873
+ } catch {
6874
+ }
6875
+ console.groupEnd();
6876
+ }
6877
+ return process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-done`, result;
6878
+ };
6879
+ function mergeClassName(transforms, classNames, key, val) {
6880
+ var isMediaOrPseudo = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, isInsertingNow = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1;
6881
+ if (0) var _transforms, _ns, ns, transform;
6882
+ }
6883
+ function mergeStyle(styleState, key, val) {
6884
+ var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { classNames, viewProps, usedKeys, styleProps, staticConfig } = styleState;
6885
+ if (import_constants4.isWeb && (val == null ? void 0 : val[0]) === "_") {
6886
+ var _usedKeys, _key;
6887
+ classNames[key] = val, (_usedKeys = usedKeys)[_key = key] || (_usedKeys[_key] = 1);
6888
+ } else if (key in import_helpers.stylePropsTransform) {
6889
+ var _styleState;
6890
+ (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
6891
+ } else {
6892
+ var shouldNormalize = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
6893
+ if (
6894
+ // accept is for props not styles
6895
+ staticConfig.accept && key in staticConfig.accept
6896
+ ) viewProps[key] = out;
6897
+ else {
6898
+ var _styleState1;
6899
+ (_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = out;
6900
+ }
6901
+ }
6902
+ }
6903
+ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
6904
+ var _loop = function(key1) {
6905
+ var val = styleIn[key1];
6906
+ key1 = conf2.shorthands[key1] || key1;
6907
+ var shouldSkip = !staticConfig.isHOC && key1 in import_skipProps.skipProps && !styleProps.noSkip;
6908
+ if (shouldSkip) return key = key1, "continue";
6909
+ (0, import_propMapper.propMapper)(key1, val, styleState, !1, function(skey, sval) {
6910
+ skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key1);
6911
+ }), key = key1;
6912
+ }, { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
6913
+ for (var key in styleIn) _loop(key);
6914
+ return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
6915
+ }, useInsertEffectCompat = import_constants4.isWeb ? import_react3.default.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : function() {
6916
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
6917
+ conf = conf || (0, import_config.getConfig)();
6918
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
6919
+ return res;
6920
+ };
6921
+ function addStyleToInsertRules(rulesToInsert, styleObject) {
6922
+ if (0) var identifier;
6923
+ }
6924
+ var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
6925
+ ...Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(function(param) {
6926
+ var [k, v] = param;
6927
+ return [
6928
+ k,
6929
+ defaultColor
6930
+ ];
6931
+ })),
6932
+ opacity: 1,
6933
+ scale: 1,
6934
+ rotate: "0deg",
6935
+ rotateY: "0deg",
6936
+ rotateX: "0deg",
6937
+ x: 0,
6938
+ y: 0,
6939
+ borderRadius: 0
6940
+ }, lowercaseHyphenate = function(match) {
6941
+ return `-${match.toLowerCase()}`;
6942
+ }, hyphenate = function(str) {
6943
+ return str.replace(/[A-Z]/g, lowercaseHyphenate);
6944
+ }, mergeTransform = function(obj, key, val) {
6945
+ var backwards = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, _obj;
6946
+ typeof obj.transform != "string" && ((_obj = obj).transform || (_obj.transform = []), obj.transform[backwards ? "unshift" : "push"]({
6947
+ [mapTransformKeys[key] || key]: val
6948
+ }));
6949
+ }, mapTransformKeys = {
6950
+ x: "translateX",
6951
+ y: "translateY"
6952
+ };
6953
+ function passDownProp(viewProps, key, val) {
6954
+ var shouldMergeObject = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
6955
+ if (shouldMergeObject) {
6956
+ var next = {
6957
+ ...viewProps[key],
6958
+ ...val
6959
+ };
6960
+ delete viewProps[key], viewProps[key] = next;
6961
+ } else viewProps[key] = val;
6962
+ }
6963
+ function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
6964
+ var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
6965
+ if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
6966
+ if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
6967
+ var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
6968
+ if (isDisabled) return !1;
6969
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
6970
+ } else mergeStyle(styleState, key, value);
6971
+ return !0;
6972
+ }
6973
+ function normalizeStyle(style) {
6974
+ var out = {};
6975
+ for (var key in style) {
6976
+ var val = style[key];
6977
+ key in import_helpers.stylePropsTransform ? mergeTransform(out, key, val) : out[key] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key);
6978
+ }
6979
+ return import_constants4.isWeb && Array.isArray(out.transform) && (out.transform = (0, import_transformsToString.transformsToString)(out.transform)), (0, import_expandStyles.fixStyles)(out), out;
6980
+ }
6981
+ function applyDefaultStyle(pkey, styleState) {
6982
+ var defaultValues = animatableDefaults[pkey];
6983
+ defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
6984
+ }
6985
+ }
6986
+ });
6987
+
6988
+ // ../../core/web/dist/cjs/helpers/mergeProps.native.js
6989
+ var require_mergeProps_native = __commonJS({
6990
+ "../../core/web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
6991
+ "use strict";
6992
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6993
+ for (var name in all) __defProp2(target, name, {
6994
+ get: all[name],
6995
+ enumerable: !0
6996
+ });
6997
+ }, __copyProps2 = function(to, from, except, desc) {
6998
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6999
+ if (from && typeof from == "object" || typeof from == "function") try {
7000
+ for (var _loop = function() {
7001
+ var key = _step.value;
7002
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7003
+ get: function() {
7004
+ return from[key];
7005
+ },
7006
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7586
7007
  });
7008
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7009
+ } catch (err) {
7010
+ _didIteratorError = !0, _iteratorError = err;
7011
+ } finally {
7012
+ try {
7013
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7014
+ } finally {
7015
+ if (_didIteratorError)
7016
+ throw _iteratorError;
7587
7017
  }
7588
- if (parentSplitStyles) {
7589
- if (0) for (var key in parentSplitStyles.classNames) var val;
7590
- if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
7591
- var _styleState1;
7592
- key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
7593
- }
7018
+ }
7019
+ return to;
7020
+ }, __toCommonJS2 = function(mod) {
7021
+ return __copyProps2(__defProp2({}, "__esModule", {
7022
+ value: !0
7023
+ }), mod);
7024
+ }, mergeProps_exports = {};
7025
+ __export2(mergeProps_exports, {
7026
+ mergeProps: function() {
7027
+ return mergeProps;
7028
+ }
7029
+ });
7030
+ module2.exports = __toCommonJS2(mergeProps_exports);
7031
+ var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = function(a, b, inverseShorthands) {
7032
+ var out = {};
7033
+ for (var key in a) mergeProp(out, a, b, key, inverseShorthands);
7034
+ if (b) for (var key1 in b) mergeProp(out, b, void 0, key1, inverseShorthands);
7035
+ return out;
7036
+ };
7037
+ function mergeProp(out, a, b, key, inverseShorthands) {
7038
+ var longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
7039
+ if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
7040
+ out[key] = {
7041
+ ...out[key],
7042
+ ...val
7043
+ };
7044
+ return;
7045
+ }
7046
+ b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
7047
+ }
7048
+ }
7049
+ });
7050
+
7051
+ // ../../core/web/dist/cjs/helpers/setElementProps.native.js
7052
+ var require_setElementProps_native = __commonJS({
7053
+ "../../core/web/dist/cjs/helpers/setElementProps.native.js"(exports2, module2) {
7054
+ "use strict";
7055
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7056
+ for (var name in all) __defProp2(target, name, {
7057
+ get: all[name],
7058
+ enumerable: !0
7059
+ });
7060
+ }, __copyProps2 = function(to, from, except, desc) {
7061
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7062
+ if (from && typeof from == "object" || typeof from == "function") try {
7063
+ for (var _loop = function() {
7064
+ var key = _step.value;
7065
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7066
+ get: function() {
7067
+ return from[key];
7068
+ },
7069
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7070
+ });
7071
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7072
+ } catch (err) {
7073
+ _didIteratorError = !0, _iteratorError = err;
7074
+ } finally {
7075
+ try {
7076
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7077
+ } finally {
7078
+ if (_didIteratorError)
7079
+ throw _iteratorError;
7594
7080
  }
7595
7081
  }
7596
- if (0) var _styleState_style, shouldStringifyTransforms;
7597
- if (0) {
7598
- if (!styleProps.noMergeStyle && styleState.style && shouldDoClasses) {
7599
- var retainedStyles, shouldRetain;
7600
- if (!styleState.style.$$css) {
7601
- var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
7602
- try {
7603
- for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
7604
- } catch (err) {
7605
- } finally {
7606
- }
7607
- }
7608
- if (transforms) for (var namespace in transforms) {
7609
- var hash, val1, identifier1;
7610
- if (import_constants4.isClient && !insertedTransforms[identifier1]) var rule;
7611
- }
7082
+ return to;
7083
+ }, __toCommonJS2 = function(mod) {
7084
+ return __copyProps2(__defProp2({}, "__esModule", {
7085
+ value: !0
7086
+ }), mod);
7087
+ }, setElementProps_native_exports = {};
7088
+ __export2(setElementProps_native_exports, {
7089
+ setElementProps: function() {
7090
+ return setElementProps;
7091
+ }
7092
+ });
7093
+ module2.exports = __toCommonJS2(setElementProps_native_exports);
7094
+ function setElementProps(element) {
7095
+ element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
7096
+ if (element.unstable_getBoundingClientRect != null) return element.unstable_getBoundingClientRect();
7097
+ });
7098
+ }
7099
+ }
7100
+ });
7101
+
7102
+ // ../../core/web/dist/cjs/helpers/createShallowSetState.native.js
7103
+ var require_createShallowSetState_native = __commonJS({
7104
+ "../../core/web/dist/cjs/helpers/createShallowSetState.native.js"(exports2, module2) {
7105
+ "use strict";
7106
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7107
+ for (var name in all) __defProp2(target, name, {
7108
+ get: all[name],
7109
+ enumerable: !0
7110
+ });
7111
+ }, __copyProps2 = function(to, from, except, desc) {
7112
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7113
+ if (from && typeof from == "object" || typeof from == "function") try {
7114
+ for (var _loop = function() {
7115
+ var key = _step.value;
7116
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7117
+ get: function() {
7118
+ return from[key];
7119
+ },
7120
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7121
+ });
7122
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7123
+ } catch (err) {
7124
+ _didIteratorError = !0, _iteratorError = err;
7125
+ } finally {
7126
+ try {
7127
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7128
+ } finally {
7129
+ if (_didIteratorError)
7130
+ throw _iteratorError;
7612
7131
  }
7613
- if (isReactNative) {
7614
- if (viewProps.tabIndex === 0) var _viewProps, _accessible;
7615
- } else if (viewProps.tabIndex == null) var _viewProps_focusable, isFocusable, role;
7616
7132
  }
7617
- var styleProp = props.style;
7618
- if (!styleProps.noMergeStyle && styleProp) if (isHOC) viewProps.style = normalizeStyle(styleProp);
7619
- else for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
7620
- var style = isArray ? styleProp[i] : styleProp;
7621
- if (style) if (style.$$css) Object.assign(styleState.classNames, style);
7622
- else {
7623
- var _styleState2;
7624
- (_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
7133
+ return to;
7134
+ }, __toCommonJS2 = function(mod) {
7135
+ return __copyProps2(__defProp2({}, "__esModule", {
7136
+ value: !0
7137
+ }), mod);
7138
+ }, createShallowSetState_exports = {};
7139
+ __export2(createShallowSetState_exports, {
7140
+ createShallowSetState: function() {
7141
+ return createShallowSetState;
7142
+ },
7143
+ isEqualShallow: function() {
7144
+ return isEqualShallow;
7145
+ },
7146
+ mergeIfNotShallowEqual: function() {
7147
+ return mergeIfNotShallowEqual;
7148
+ }
7149
+ });
7150
+ module2.exports = __toCommonJS2(createShallowSetState_exports);
7151
+ var import_react3 = require("react"), callImmediate = function(cb) {
7152
+ return cb();
7153
+ };
7154
+ function createShallowSetState(setter, isDisabled, transition, debug, callback) {
7155
+ return (0, import_react3.useCallback)(function(next) {
7156
+ var wrap = transition ? import_react3.startTransition : callImmediate;
7157
+ wrap(function() {
7158
+ setter(function(prev) {
7159
+ var out = mergeIfNotShallowEqual(prev, next, isDisabled, debug);
7160
+ return callback == null || callback(out), out;
7161
+ });
7162
+ });
7163
+ }, [
7164
+ setter,
7165
+ isDisabled,
7166
+ transition,
7167
+ debug
7168
+ ]);
7169
+ }
7170
+ function mergeIfNotShallowEqual(prev, next, isDisabled, debug) {
7171
+ if (isDisabled || !prev || !next || isEqualShallow(prev, next)) return prev || next;
7172
+ if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
7173
+ prev,
7174
+ next
7175
+ }), debug === "break")) debugger;
7176
+ return {
7177
+ ...prev,
7178
+ ...next
7179
+ };
7180
+ }
7181
+ function isEqualShallow(prev, next) {
7182
+ for (var key in next) if (prev[key] !== next[key]) return !1;
7183
+ return !0;
7184
+ }
7185
+ }
7186
+ });
7187
+
7188
+ // ../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js
7189
+ var require_subscribeToContextGroup_native = __commonJS({
7190
+ "../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
7191
+ "use strict";
7192
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7193
+ for (var name in all) __defProp2(target, name, {
7194
+ get: all[name],
7195
+ enumerable: !0
7196
+ });
7197
+ }, __copyProps2 = function(to, from, except, desc) {
7198
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7199
+ if (from && typeof from == "object" || typeof from == "function") try {
7200
+ for (var _loop = function() {
7201
+ var key = _step.value;
7202
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7203
+ get: function() {
7204
+ return from[key];
7205
+ },
7206
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7207
+ });
7208
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7209
+ } catch (err) {
7210
+ _didIteratorError = !0, _iteratorError = err;
7211
+ } finally {
7212
+ try {
7213
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7214
+ } finally {
7215
+ if (_didIteratorError)
7216
+ throw _iteratorError;
7625
7217
  }
7626
7218
  }
7627
- var style1 = styleState.style;
7628
- if (style1 != null && style1.fontFamily) {
7629
- var _getFont, faceInfo = (_getFont = (0, import_config.getFont)(style1.fontFamily)) === null || _getFont === void 0 ? void 0 : _getFont.face;
7630
- if (faceInfo) {
7631
- var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[style1.fontWeight]) === null || _faceInfo_style_fontWeight === void 0 || (_faceInfo_style_fontWeight_ = _faceInfo_style_fontWeight[style1.fontStyle || "normal"]) === null || _faceInfo_style_fontWeight_ === void 0 ? void 0 : _faceInfo_style_fontWeight_.val;
7632
- overrideFace && (style1.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style1.fontWeight, delete style1.fontStyle);
7633
- }
7634
- process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
7219
+ return to;
7220
+ }, __toCommonJS2 = function(mod) {
7221
+ return __copyProps2(__defProp2({}, "__esModule", {
7222
+ value: !0
7223
+ }), mod);
7224
+ }, subscribeToContextGroup_exports = {};
7225
+ __export2(subscribeToContextGroup_exports, {
7226
+ subscribeToContextGroup: function() {
7227
+ return subscribeToContextGroup;
7635
7228
  }
7636
- process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-pre-result`;
7637
- var result = {
7638
- space,
7639
- hasMedia,
7640
- fontFamily: styleState.fontFamily,
7641
- viewProps,
7642
- style: styleState.style,
7643
- pseudos,
7644
- classNames,
7645
- rulesToInsert,
7646
- dynamicThemeAccess,
7647
- pseudoGroups,
7648
- mediaGroups
7649
- }, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
7650
- if (!styleProps.noMergeStyle && !asChildExceptStyleLike) {
7651
- var style2 = styleState.style;
7652
- if (0) {
7653
- var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
7654
- if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) && isReactNative) {
7655
- var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
7656
- try {
7657
- for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
7658
- } catch (err) {
7659
- } finally {
7660
- }
7229
+ });
7230
+ module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
7231
+ var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
7232
+ var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
7233
+ if (pseudoGroups || mediaGroups) {
7234
+ var _componentContext_groups_subscribe, _componentContext_groups, current = {
7235
+ pseudo: {},
7236
+ media: {}
7237
+ };
7238
+ return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
7239
+ var { layout, pseudo } = param2;
7240
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
7241
+ else if (layout && mediaGroups) {
7242
+ var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
7243
+ next !== current.media && (Object.assign(current.media, next), persist());
7661
7244
  }
7662
- } else style2 && (viewProps.style = style2);
7245
+ function persist() {
7246
+ var group = {
7247
+ ...state.group,
7248
+ [name]: current
7249
+ };
7250
+ setStateShallow({
7251
+ group
7252
+ });
7253
+ }
7254
+ });
7663
7255
  }
7664
- if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
7665
- consoleGroupCollapsed("\u{1F539} getSplitStyles ===>");
7256
+ };
7257
+ }
7258
+ });
7259
+
7260
+ // ../../core/web/dist/cjs/hooks/useThemeState.native.js
7261
+ var require_useThemeState_native = __commonJS({
7262
+ "../../core/web/dist/cjs/hooks/useThemeState.native.js"(exports2, module2) {
7263
+ "use strict";
7264
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7265
+ for (var name in all) __defProp2(target, name, {
7266
+ get: all[name],
7267
+ enumerable: !0
7268
+ });
7269
+ }, __copyProps2 = function(to, from, except, desc) {
7270
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7271
+ if (from && typeof from == "object" || typeof from == "function") try {
7272
+ for (var _loop = function() {
7273
+ var key = _step.value;
7274
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7275
+ get: function() {
7276
+ return from[key];
7277
+ },
7278
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7279
+ });
7280
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7281
+ } catch (err) {
7282
+ _didIteratorError = !0, _iteratorError = err;
7283
+ } finally {
7666
7284
  try {
7667
- var logs = {
7668
- ...result,
7669
- className,
7670
- componentState,
7671
- transforms,
7672
- viewProps,
7673
- rulesToInsert,
7674
- parentSplitStyles
7675
- };
7676
- for (var key3 in logs) (0, import_log.log)(key3, logs[key3]);
7677
- } catch {
7285
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7286
+ } finally {
7287
+ if (_didIteratorError)
7288
+ throw _iteratorError;
7678
7289
  }
7679
- console.groupEnd();
7680
7290
  }
7681
- return process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-done`, result;
7682
- };
7683
- function mergeClassName(transforms, classNames, key, val) {
7684
- var isMediaOrPseudo = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, isInsertingNow = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1;
7685
- if (0) var _transforms, _ns, ns, transform;
7686
- }
7687
- function mergeStyle(styleState, key, val) {
7688
- var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { classNames, viewProps, usedKeys, styleProps, staticConfig } = styleState;
7689
- if (import_constants4.isWeb && (val == null ? void 0 : val[0]) === "_") {
7690
- var _usedKeys, _key;
7691
- classNames[key] = val, (_usedKeys = usedKeys)[_key = key] || (_usedKeys[_key] = 1);
7692
- } else if (key in import_helpers.stylePropsTransform) {
7693
- var _styleState;
7694
- (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
7695
- } else {
7696
- var shouldNormalize = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
7697
- if (
7698
- // accept is for props not styles
7699
- staticConfig.accept && key in staticConfig.accept
7700
- ) viewProps[key] = out;
7701
- else {
7702
- var _styleState1;
7703
- (_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = out;
7704
- }
7291
+ return to;
7292
+ }, __toCommonJS2 = function(mod) {
7293
+ return __copyProps2(__defProp2({}, "__esModule", {
7294
+ value: !0
7295
+ }), mod);
7296
+ }, useThemeState_exports = {};
7297
+ __export2(useThemeState_exports, {
7298
+ ThemeStateContext: function() {
7299
+ return ThemeStateContext;
7300
+ },
7301
+ forceUpdateThemes: function() {
7302
+ return forceUpdateThemes2;
7303
+ },
7304
+ getRootThemeState: function() {
7305
+ return getRootThemeState;
7306
+ },
7307
+ getThemeState: function() {
7308
+ return getThemeState;
7309
+ },
7310
+ hasThemeUpdatingProps: function() {
7311
+ return hasThemeUpdatingProps;
7312
+ },
7313
+ useThemeState: function() {
7314
+ return useThemeState;
7705
7315
  }
7706
- }
7707
- var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
7708
- var _loop = function(key1) {
7709
- var val = styleIn[key1];
7710
- key1 = conf2.shorthands[key1] || key1;
7711
- var shouldSkip = !staticConfig.isHOC && key1 in import_skipProps.skipProps && !styleProps.noSkip;
7712
- if (shouldSkip) return key = key1, "continue";
7713
- (0, import_propMapper.propMapper)(key1, val, styleState, !1, function(skey, sval) {
7714
- skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key1);
7715
- }), key = key1;
7716
- }, { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
7717
- for (var key in styleIn) _loop(key);
7718
- return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
7719
- }, useInsertEffectCompat = import_constants4.isWeb ? import_react3.default.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : function() {
7720
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
7721
- conf = conf || (0, import_config.getConfig)();
7722
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
7723
- return res;
7724
- };
7725
- function addStyleToInsertRules(rulesToInsert, styleObject) {
7726
- if (0) var identifier;
7727
- }
7728
- var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
7729
- ...Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(function(param) {
7730
- var [k, v] = param;
7731
- return [
7732
- k,
7733
- defaultColor
7734
- ];
7735
- })),
7736
- opacity: 1,
7737
- scale: 1,
7738
- rotate: "0deg",
7739
- rotateY: "0deg",
7740
- rotateX: "0deg",
7741
- x: 0,
7742
- y: 0,
7743
- borderRadius: 0
7744
- }, lowercaseHyphenate = function(match) {
7745
- return `-${match.toLowerCase()}`;
7746
- }, hyphenate = function(str) {
7747
- return str.replace(/[A-Z]/g, lowercaseHyphenate);
7748
- }, mergeTransform = function(obj, key, val) {
7749
- var backwards = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, _obj;
7750
- typeof obj.transform != "string" && ((_obj = obj).transform || (_obj.transform = []), obj.transform[backwards ? "unshift" : "push"]({
7751
- [mapTransformKeys[key] || key]: val
7752
- }));
7753
- }, mapTransformKeys = {
7754
- x: "translateX",
7755
- y: "translateY"
7756
- };
7757
- function passDownProp(viewProps, key, val) {
7758
- var shouldMergeObject = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
7759
- if (shouldMergeObject) {
7760
- var next = {
7761
- ...viewProps[key],
7762
- ...val
7763
- };
7764
- delete viewProps[key], viewProps[key] = next;
7765
- } else viewProps[key] = val;
7766
- }
7767
- function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
7768
- var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
7769
- if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
7770
- if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
7771
- var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
7772
- if (isDisabled) return !1;
7773
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
7774
- } else mergeStyle(styleState, key, value);
7775
- return !0;
7776
- }
7777
- function normalizeStyle(style) {
7778
- var out = {};
7779
- for (var key in style) {
7780
- var val = style[key];
7781
- key in import_helpers.stylePropsTransform ? mergeTransform(out, key, val) : out[key] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key);
7316
+ });
7317
+ module2.exports = __toCommonJS2(useThemeState_exports);
7318
+ var import_react3 = require("react"), import_config = require_config_native(), ThemeStateContext = (0, import_react3.createContext)(""), allListeners = /* @__PURE__ */ new Map(), listenersByParent = {}, states = /* @__PURE__ */ new Map(), forceUpdateThemes2 = function() {
7319
+ allListeners.forEach(function(cb) {
7320
+ return cb();
7321
+ });
7322
+ }, getThemeState = function(id) {
7323
+ return states.get(id);
7324
+ }, rootThemeState = null, getRootThemeState = function() {
7325
+ return rootThemeState;
7326
+ }, HasRenderedOnce = /* @__PURE__ */ new WeakMap(), useThemeState = function(props) {
7327
+ var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = arguments.length > 2 ? arguments[2] : void 0, { disable } = props, parentId = (0, import_react3.useContext)(ThemeStateContext);
7328
+ if (disable) return states.get(parentId) || {
7329
+ id: "",
7330
+ name: "light",
7331
+ theme: (0, import_config.getConfig)().themes.light,
7332
+ inverses: 0
7333
+ };
7334
+ var id = (0, import_react3.useId)(), subscribe = (0, import_react3.useCallback)(function(cb) {
7335
+ var _listenersByParent, _parentId;
7336
+ return (_listenersByParent = listenersByParent)[_parentId = parentId] || (_listenersByParent[_parentId] = /* @__PURE__ */ new Set()), listenersByParent[parentId].add(id), allListeners.set(id, cb), function() {
7337
+ allListeners.delete(id), listenersByParent[parentId].delete(id);
7338
+ };
7339
+ }, [
7340
+ id,
7341
+ parentId,
7342
+ keys
7343
+ ]), propsKey = getPropsKey(props), getSnapshot = function() {
7344
+ return getSnapshotFrom(props, propsKey, isRoot, id, parentId, keys);
7345
+ };
7346
+ process.env.NODE_ENV === "development" && globalThis.time && globalThis.time`theme-prep-uses`;
7347
+ var state = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
7348
+ return (0, import_react3.useLayoutEffect)(function() {
7349
+ if (propsKey) {
7350
+ if (!HasRenderedOnce.has(keys)) {
7351
+ HasRenderedOnce.set(keys, !0);
7352
+ return;
7353
+ }
7354
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
7355
+ var _states_get;
7356
+ console.warn(` \xB7 useTheme(${id}) scheduleUpdate`, propsKey, (_states_get = states.get(id)) === null || _states_get === void 0 ? void 0 : _states_get.name);
7357
+ }
7358
+ scheduleUpdate(id);
7359
+ }
7360
+ }, [
7361
+ keys,
7362
+ propsKey
7363
+ ]), process.env.NODE_ENV === "development" && props.debug && (console.groupCollapsed(` \xB7 useTheme(${id}) =>`, state.name, id === state.id ? "\u{1F389}" : "\u23ED\uFE0F"), console.info({
7364
+ state,
7365
+ parentId,
7366
+ props,
7367
+ propsKey,
7368
+ id,
7369
+ parentState: states.get(parentId)
7370
+ }), console.groupEnd()), state.id === id ? {
7371
+ ...state,
7372
+ isNew: !0
7373
+ } : state;
7374
+ }, themes = null, getSnapshotFrom = function(props, propsKey) {
7375
+ var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, id = arguments.length > 3 ? arguments[3] : void 0, parentId = arguments.length > 4 ? arguments[4] : void 0, keys = arguments.length > 5 ? arguments[5] : void 0, _keys_current, _props_needsUpdate, needsUpdate = (keys == null || (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) || ((_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props)), parentState = states.get(parentId);
7376
+ themes || (themes = (0, import_config.getConfig)().themes);
7377
+ var lastState = states.get(id), name = propsKey ? getNewThemeName(parentState == null ? void 0 : parentState.name, props, !!needsUpdate) : null;
7378
+ if (process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile") {
7379
+ var message = ` \xB7 useTheme(${id}) snapshot ${name}, parent ${parentState == null ? void 0 : parentState.id} needsUpdate ${needsUpdate}`;
7380
+ console.info(message);
7381
+ }
7382
+ var isSameAsParent = !name && propsKey;
7383
+ if (parentState && isSameAsParent) return parentState;
7384
+ if (!name) return lastState && !needsUpdate ? lastState : (states.set(id, parentState), parentState);
7385
+ if (lastState && lastState.name === name) return lastState;
7386
+ var scheme = getScheme(name), _parentState_inverses, parentInverses = (_parentState_inverses = parentState == null ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0, isInverse = parentState && scheme !== parentState.scheme, inverses = parentInverses + (isInverse ? 1 : 0), nextState = {
7387
+ id,
7388
+ name,
7389
+ theme: themes[name],
7390
+ scheme,
7391
+ parentId,
7392
+ parentName: parentState == null ? void 0 : parentState.name,
7393
+ inverses,
7394
+ isInverse
7395
+ };
7396
+ return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` \xB7 useTheme(${id}) \u23ED\uFE0F ${name}`), console.info("state", nextState), console.groupEnd()), states.set(id, nextState), isRoot && (rootThemeState = nextState), nextState;
7397
+ };
7398
+ function scheduleUpdate(id) {
7399
+ for (var queue = [
7400
+ id
7401
+ ], visited = /* @__PURE__ */ new Set(); queue.length; ) {
7402
+ var parent = queue.shift(), children = listenersByParent[parent];
7403
+ if (children) {
7404
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7405
+ try {
7406
+ for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
7407
+ var childId = _step.value;
7408
+ visited.has(childId) || (visited.add(childId), queue.push(childId));
7409
+ }
7410
+ } catch (err) {
7411
+ _didIteratorError = !0, _iteratorError = err;
7412
+ } finally {
7413
+ try {
7414
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7415
+ } finally {
7416
+ if (_didIteratorError) throw _iteratorError;
7417
+ }
7418
+ }
7419
+ }
7782
7420
  }
7783
- return import_constants4.isWeb && Array.isArray(out.transform) && (out.transform = (0, import_transformsToString.transformsToString)(out.transform)), (0, import_expandStyles.fixStyles)(out), out;
7421
+ visited.forEach(function(childId2) {
7422
+ var cb = allListeners.get(childId2);
7423
+ cb == null || cb();
7424
+ });
7784
7425
  }
7785
- function applyDefaultStyle(pkey, styleState) {
7786
- var defaultValues = animatableDefaults[pkey];
7787
- defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
7426
+ var validSchemes = {
7427
+ light: "light",
7428
+ dark: "dark"
7429
+ };
7430
+ function getScheme(name) {
7431
+ return validSchemes[name.split("_")[0]];
7432
+ }
7433
+ function getNewThemeName() {
7434
+ var parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", { name, reset, componentName, inverse } = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
7435
+ if (name && reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
7436
+ if (reset) {
7437
+ if (!parentName) throw new Error("\u203C\uFE0F");
7438
+ var lastPartIndex = parentName.lastIndexOf("_");
7439
+ return lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);
7440
+ }
7441
+ var { themes: themes2 } = (0, import_config.getConfig)(), parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
7442
+ lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
7443
+ for (var subNames = [
7444
+ name && componentName ? `${name}_${componentName}` : void 0,
7445
+ name,
7446
+ componentName
7447
+ ].filter(Boolean), found = null, max2 = parentParts.length, i = 0; i <= max2; i++) {
7448
+ var base = (i === 0 ? parentParts : parentParts.slice(0, -i)).join("_"), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7449
+ try {
7450
+ for (var _iterator = subNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
7451
+ var subName = _step.value, potential = base ? `${base}_${subName}` : subName;
7452
+ if (potential in themes2) {
7453
+ found = potential;
7454
+ break;
7455
+ }
7456
+ }
7457
+ } catch (err) {
7458
+ _didIteratorError = !0, _iteratorError = err;
7459
+ } finally {
7460
+ try {
7461
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7462
+ } finally {
7463
+ if (_didIteratorError) throw _iteratorError;
7464
+ }
7465
+ }
7466
+ if (found) break;
7467
+ }
7468
+ if (found && inverse) {
7469
+ var scheme = found.split("_")[0];
7470
+ found = found.replace(new RegExp(`^${scheme}`), scheme === "light" ? "dark" : "light");
7471
+ }
7472
+ return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
7473
+ // and we want to avoid reparenting
7474
+ !validSchemes[found] ? null : found;
7788
7475
  }
7476
+ var getPropsKey = function(param) {
7477
+ var { name, reset, inverse, forceClassName, componentName } = param;
7478
+ return `${name || ""}${inverse || ""}${reset || ""}${forceClassName || ""}${componentName || ""}`;
7479
+ }, hasThemeUpdatingProps = function(props) {
7480
+ return "inverse" in props || "name" in props || "reset" in props || "forceClassName" in props;
7481
+ };
7789
7482
  }
7790
7483
  });
7791
7484
 
7792
- // ../../core/web/dist/cjs/helpers/mergeProps.native.js
7793
- var require_mergeProps_native = __commonJS({
7794
- "../../core/web/dist/cjs/helpers/mergeProps.native.js"(exports2, module2) {
7485
+ // ../../core/web/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js
7486
+ var require_doesRootSchemeMatchSystem_native = __commonJS({
7487
+ "../../core/web/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js"(exports2, module2) {
7795
7488
  "use strict";
7796
7489
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7797
7490
  for (var name in all) __defProp2(target, name, {
@@ -7825,36 +7518,24 @@ var require_mergeProps_native = __commonJS({
7825
7518
  return __copyProps2(__defProp2({}, "__esModule", {
7826
7519
  value: !0
7827
7520
  }), mod);
7828
- }, mergeProps_exports = {};
7829
- __export2(mergeProps_exports, {
7830
- mergeProps: function() {
7831
- return mergeProps;
7521
+ }, doesRootSchemeMatchSystem_native_exports = {};
7522
+ __export2(doesRootSchemeMatchSystem_native_exports, {
7523
+ doesRootSchemeMatchSystem: function() {
7524
+ return doesRootSchemeMatchSystem;
7832
7525
  }
7833
7526
  });
7834
- module2.exports = __toCommonJS2(mergeProps_exports);
7835
- var import_useMedia = require_useMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), mergeProps = function(a, b, inverseShorthands) {
7836
- var out = {};
7837
- for (var key in a) mergeProp(out, a, b, key, inverseShorthands);
7838
- if (b) for (var key1 in b) mergeProp(out, b, void 0, key1, inverseShorthands);
7839
- return out;
7840
- };
7841
- function mergeProp(out, a, b, key, inverseShorthands) {
7842
- var longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
7843
- if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
7844
- out[key] = {
7845
- ...out[key],
7846
- ...val
7847
- };
7848
- return;
7849
- }
7850
- b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
7527
+ module2.exports = __toCommonJS2(doesRootSchemeMatchSystem_native_exports);
7528
+ var import_react_native4 = require("react-native"), import_useThemeState = require_useThemeState_native();
7529
+ function doesRootSchemeMatchSystem() {
7530
+ var _getRootThemeState;
7531
+ return ((_getRootThemeState = (0, import_useThemeState.getRootThemeState)()) === null || _getRootThemeState === void 0 ? void 0 : _getRootThemeState.scheme) === import_react_native4.Appearance.getColorScheme();
7851
7532
  }
7852
7533
  }
7853
7534
  });
7854
7535
 
7855
- // ../../core/web/dist/cjs/helpers/setElementProps.native.js
7856
- var require_setElementProps_native = __commonJS({
7857
- "../../core/web/dist/cjs/helpers/setElementProps.native.js"(exports2, module2) {
7536
+ // ../../core/web/dist/cjs/hooks/getThemeProxied.native.js
7537
+ var require_getThemeProxied_native = __commonJS({
7538
+ "../../core/web/dist/cjs/hooks/getThemeProxied.native.js"(exports2, module2) {
7858
7539
  "use strict";
7859
7540
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7860
7541
  for (var name in all) __defProp2(target, name, {
@@ -7888,24 +7569,69 @@ var require_setElementProps_native = __commonJS({
7888
7569
  return __copyProps2(__defProp2({}, "__esModule", {
7889
7570
  value: !0
7890
7571
  }), mod);
7891
- }, setElementProps_native_exports = {};
7892
- __export2(setElementProps_native_exports, {
7893
- setElementProps: function() {
7894
- return setElementProps;
7572
+ }, getThemeProxied_exports = {};
7573
+ __export2(getThemeProxied_exports, {
7574
+ getThemeProxied: function() {
7575
+ return getThemeProxied;
7895
7576
  }
7896
7577
  });
7897
- module2.exports = __toCommonJS2(setElementProps_native_exports);
7898
- function setElementProps(element) {
7899
- element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
7900
- if (element.unstable_getBoundingClientRect != null) return element.unstable_getBoundingClientRect();
7901
- });
7578
+ module2.exports = __toCommonJS2(getThemeProxied_exports);
7579
+ var import_constants4 = require_index_native6(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), cache = /* @__PURE__ */ new Map(), curKeys, curProps, emptyObject = {};
7580
+ function getThemeProxied(_props, state, _keys) {
7581
+ var theme = state == null ? void 0 : state.theme;
7582
+ if (!theme) return emptyObject;
7583
+ if (curKeys = _keys, curProps = _props, cache.has(theme)) {
7584
+ var proxied = cache.get(theme);
7585
+ return proxied;
7586
+ }
7587
+ var { name, scheme } = state, config = (0, import_config.getConfig)();
7588
+ function track(key) {
7589
+ curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
7590
+ }
7591
+ var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
7592
+ var [key, value] = param, proxied2 = {
7593
+ ...value,
7594
+ get val() {
7595
+ return globalThis.tamaguiAvoidTracking || track(key), value.val;
7596
+ },
7597
+ get(platform2) {
7598
+ var outVal = (0, import_createVariable.getVariable)(value), shouldOptimize = scheme && platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && state.inverses === 0 && (0, import_doesRootSchemeMatchSystem.doesRootSchemeMatchSystem)();
7599
+ if (shouldOptimize) {
7600
+ var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
7601
+ dynamic: {
7602
+ [scheme]: color,
7603
+ [oppositeScheme]: oppositeColor
7604
+ }
7605
+ };
7606
+ return dynamicVal;
7607
+ }
7608
+ return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
7609
+ not web: ${platform2 !== "web"}
7610
+ isIOS: ${import_constants4.isIos}
7611
+ deopt: ${curProps.deopt}
7612
+ fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
7613
+ `), track(key), outVal;
7614
+ }
7615
+ };
7616
+ return [
7617
+ [
7618
+ key,
7619
+ proxied2
7620
+ ],
7621
+ [
7622
+ `$${key}`,
7623
+ proxied2
7624
+ ]
7625
+ ];
7626
+ }));
7627
+ return cache.set(theme, proxied1), proxied1;
7902
7628
  }
7903
7629
  }
7904
7630
  });
7905
7631
 
7906
- // ../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js
7907
- var require_subscribeToContextGroup_native = __commonJS({
7908
- "../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
7632
+ // ../../core/web/dist/cjs/hooks/useTheme.native.js
7633
+ var require_useTheme_native = __commonJS({
7634
+ "../../core/web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
7909
7635
  "use strict";
7910
7636
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7911
7637
  for (var name in all) __defProp2(target, name, {
@@ -7939,38 +7665,29 @@ var require_subscribeToContextGroup_native = __commonJS({
7939
7665
  return __copyProps2(__defProp2({}, "__esModule", {
7940
7666
  value: !0
7941
7667
  }), mod);
7942
- }, subscribeToContextGroup_exports = {};
7943
- __export2(subscribeToContextGroup_exports, {
7944
- subscribeToContextGroup: function() {
7945
- return subscribeToContextGroup;
7668
+ }, useTheme_exports = {};
7669
+ __export2(useTheme_exports, {
7670
+ useTheme: function() {
7671
+ return useTheme4;
7672
+ },
7673
+ useThemeWithState: function() {
7674
+ return useThemeWithState;
7946
7675
  }
7947
7676
  });
7948
- module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
7949
- var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
7950
- var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
7951
- if (pseudoGroups || mediaGroups) {
7952
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
7953
- pseudo: {},
7954
- media: {}
7955
- };
7956
- return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
7957
- var { layout, pseudo } = param2;
7958
- if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
7959
- else if (layout && mediaGroups) {
7960
- var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
7961
- next !== current.media && (Object.assign(current.media, next), persist());
7962
- }
7963
- function persist() {
7964
- var group = {
7965
- ...state.group,
7966
- [name]: current
7967
- };
7968
- setStateShallow({
7969
- group
7970
- });
7971
- }
7972
- });
7973
- }
7677
+ module2.exports = __toCommonJS2(useTheme_exports);
7678
+ var import_react3 = require("react"), import_getThemeProxied = require_getThemeProxied_native(), import_useThemeState = require_useThemeState_native(), useTheme4 = function() {
7679
+ var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, [theme] = useThemeWithState(props), res = theme;
7680
+ return res;
7681
+ }, useThemeWithState = function(props) {
7682
+ var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = (0, import_react3.useRef)(null), themeState = (0, import_useThemeState.useThemeState)(props, isRoot, keys);
7683
+ process.env.NODE_ENV === "development" && (themeState != null && themeState.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(props)}).
7684
+
7685
+ If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`));
7686
+ var themeProxied = (0, import_getThemeProxied.getThemeProxied)(props, themeState, keys);
7687
+ return [
7688
+ themeProxied,
7689
+ themeState
7690
+ ];
7974
7691
  };
7975
7692
  }
7976
7693
  });
@@ -8084,25 +7801,22 @@ var require_Theme_native = __commonJS({
8084
7801
  }
8085
7802
  });
8086
7803
  module2.exports = __toCommonJS2(Theme_exports);
8087
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_log = require_log_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(param, ref) {
8088
- var { children, ...props } = param;
8089
- if (props.disable) return children;
8090
- var isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(children, function(child) {
7804
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_useTheme = require_useTheme_native(), import_useThemeState = require_useThemeState_native(), import_ThemeDebug = require_ThemeDebug_native(), empty = {
7805
+ className: "",
7806
+ style: {}
7807
+ }, Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
7808
+ if (props.disable) return props.children;
7809
+ var isRoot = !!props._isRoot, [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(props.children, function(child) {
8091
7810
  return /* @__PURE__ */ (0, import_react3.cloneElement)(child, {
8092
7811
  "data-disable-theme": !0
8093
7812
  });
8094
- }) : children;
7813
+ }) : props.children;
8095
7814
  if (ref) try {
8096
7815
  import_react3.default.Children.only(finalChildren), finalChildren = /* @__PURE__ */ (0, import_react3.cloneElement)(finalChildren, {
8097
7816
  ref
8098
7817
  });
8099
7818
  } catch {
8100
7819
  }
8101
- process.env.NODE_ENV === "development" && props.debug === "visualize" && (finalChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, {
8102
- themeState,
8103
- themeProps: props,
8104
- children: finalChildren
8105
- }));
8106
7820
  var stateRef = (0, import_react3.useRef)({
8107
7821
  hasEverThemed: !1
8108
7822
  });
@@ -8110,61 +7824,65 @@ var require_Theme_native = __commonJS({
8110
7824
  });
8111
7825
  Theme2.avoidForwardRef = !0;
8112
7826
  function getThemedChildren(themeState, children, props) {
8113
- var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { themeManager, isNewTheme } = themeState;
8114
- if (!themeManager) return children;
8115
- var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || "inverse" in props || "name" in props || "reset" in props || "forceClassName" in props || stateRef.current.hasEverThemed;
8116
- if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme) return children;
8117
- process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug === "verbose" && (0, import_log.log)(`adding theme: isRoot ${isRoot}, inverse ${"inverse" in props}, isNewTheme ${isNewTheme}, hasEver ${stateRef.current.hasEverThemed}`, props);
8118
- var next = children;
8119
- shallow && (next = import_react3.Children.toArray(children).map(function(child) {
8120
- return /* @__PURE__ */ (0, import_react3.isValidElement)(child) ? /* @__PURE__ */ (0, import_react3.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Theme2, {
8121
- name: themeManager.state.parentName,
8122
- children: child.props.children
8123
- })) : child;
8124
- }));
8125
- var elementsWithContext = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeManagerContext.ThemeManagerContext.Provider, {
8126
- value: themeManager,
8127
- children: next
8128
- });
8129
- return forceClassName === !1 ? elementsWithContext : import_constants4.isWeb ? wrapThemeElements({
8130
- children: elementsWithContext,
8131
- themeState,
8132
- forceClassName,
8133
- isRoot
8134
- }) : elementsWithContext;
8135
- }
8136
- function wrapThemeElements(param) {
8137
- var { children, themeState, forceClassName, isRoot } = param;
8138
- if (isRoot && forceClassName === !1) return children;
8139
- var inverse = themeState.inversed, requiresExtraWrapper = typeof inverse == "boolean" || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
8140
- className: `${className} _dsp_contents is_Theme`,
8141
- style,
7827
+ var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { shallow, forceClassName } = props, state = stateRef.current, hasEverThemed = state.hasEverThemed, shouldRenderChildrenWithTheme = hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);
7828
+ if (!shouldRenderChildrenWithTheme) return children;
7829
+ children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_useThemeState.ThemeStateContext.Provider, {
7830
+ value: themeState.id,
8142
7831
  children
8143
7832
  });
8144
- if (requiresExtraWrapper) {
8145
- var _themeState_state, name = ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", inverseClassName = name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "";
8146
- themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
8147
- className: `${inverse ? inverseClassName : ""} _dsp_contents`,
8148
- children: themedChildren
7833
+ var { isInverse, name } = themeState, requiresExtraWrapper = isInverse || forceClassName;
7834
+ if (state.hasEverThemed || (state.hasEverThemed = !0), (requiresExtraWrapper || // if the theme is exactly dark or light, its likely to change between dark/light
7835
+ // and that would require wrapping which would re-parent, so to avoid re-parenting do this
7836
+ themeState.name === "dark" || themeState.name === "light") && (state.hasEverThemed = "wrapped"), shallow && themeState.parentId) {
7837
+ var parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);
7838
+ if (!parentState) throw new Error("\u203C\uFE0F010");
7839
+ children = import_react3.Children.toArray(children).map(function(child) {
7840
+ return /* @__PURE__ */ (0, import_react3.isValidElement)(child) ? /* @__PURE__ */ (0, import_react3.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Theme2, {
7841
+ name: parentState.name,
7842
+ children: child.props.children
7843
+ })) : child;
8149
7844
  });
8150
7845
  }
8151
- return themedChildren;
7846
+ if (process.env.NODE_ENV === "development" && props.debug && (console.warn(" getThemedChildren", {
7847
+ requiresExtraWrapper,
7848
+ forceClassName,
7849
+ themeState,
7850
+ state,
7851
+ ...getThemeClassNameAndStyle(themeState, props, isRoot)
7852
+ }), children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, {
7853
+ themeState,
7854
+ themeProps: props,
7855
+ children
7856
+ })), forceClassName === !1) return children;
7857
+ if (import_constants4.isWeb) {
7858
+ var { className, style } = getThemeClassNameAndStyle(themeState, props, isRoot);
7859
+ if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7860
+ className: `${className} _dsp_contents is_Theme`,
7861
+ style,
7862
+ children
7863
+ }), state.hasEverThemed === "wrapped") {
7864
+ var className1 = requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} _dsp_contents` : "_dsp_contents";
7865
+ children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7866
+ className: className1,
7867
+ children
7868
+ });
7869
+ }
7870
+ return children;
7871
+ }
7872
+ return children;
8152
7873
  }
8153
- var emptyObj = {};
8154
- function getThemeClassNameAndStyle(themeState) {
8155
- var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, _themeState_state, _themeState_state1;
8156
- if (!themeState.isNewTheme) return {
8157
- className: "",
8158
- style: emptyObj
8159
- };
8160
- var themeColor = !((_themeState_state = themeState.state) === null || _themeState_state === void 0) && _themeState_state.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
7874
+ function getThemeClassNameAndStyle(themeState, props) {
7875
+ var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
7876
+ if (!themeState.isNew && !props.forceClassName) return empty;
7877
+ var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "", style = themeColor ? {
8161
7878
  color: themeColor
8162
- } : void 0, className = ((_themeState_state1 = themeState.state) === null || _themeState_state1 === void 0 ? void 0 : _themeState_state1.className) || "";
8163
- return isRoot && (className = className.replace("t_sub_theme", "")), {
7879
+ } : void 0, maxInverses = (0, import_config.getSetting)("maxDarkLightNesting") || 3, themeClassName = themeState.inverses >= maxInverses ? themeState.name : themeState.name.replace(schemePrefix, ""), className = `${isRoot ? "" : "t_sub_theme"} t_${themeClassName}`;
7880
+ return {
8164
7881
  style,
8165
7882
  className
8166
7883
  };
8167
7884
  }
7885
+ var schemePrefix = /^(dark|light)_/;
8168
7886
  }
8169
7887
  });
8170
7888
 
@@ -8379,7 +8097,21 @@ var require_useComponentState_native = __commonJS({
8379
8097
  import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
8380
8098
  ...state
8381
8099
  }));
8382
- var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
8100
+ var groupName = props.group, setStateWrapper;
8101
+ if (groupName) {
8102
+ var groupContextState = groups.state;
8103
+ setStateWrapper = function(state2) {
8104
+ curStateRef.group.emit(groupName, {
8105
+ pseudo: state2
8106
+ });
8107
+ var next = {
8108
+ ...groupContextState[groupName],
8109
+ ...state2
8110
+ };
8111
+ groupContextState[groupName] = next;
8112
+ };
8113
+ }
8114
+ var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug, setStateWrapper);
8383
8115
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
8384
8116
  process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
8385
8117
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
@@ -8396,7 +8128,6 @@ var require_useComponentState_native = __commonJS({
8396
8128
  isClassNameDisabled
8397
8129
  }));
8398
8130
  }
8399
- var groupName = props.group;
8400
8131
  if (groupName && !curStateRef.group) {
8401
8132
  var listeners = /* @__PURE__ */ new Set();
8402
8133
  curStateRef.group = {
@@ -8413,19 +8144,6 @@ var require_useComponentState_native = __commonJS({
8413
8144
  }
8414
8145
  };
8415
8146
  }
8416
- if (groupName) {
8417
- var groupContextState = groups.state, og = setStateShallow;
8418
- setStateShallow = function(state2) {
8419
- og(state2), curStateRef.group.emit(groupName, {
8420
- pseudo: state2
8421
- });
8422
- var next = {
8423
- ...groupContextState[groupName],
8424
- ...state2
8425
- };
8426
- groupContextState[groupName] = next;
8427
- };
8428
- }
8429
8147
  return {
8430
8148
  curStateRef,
8431
8149
  disabled,
@@ -8674,7 +8392,7 @@ var require_createComponent_native = __commonJS({
8674
8392
  }
8675
8393
  });
8676
8394
  module2.exports = __toCommonJS2(createComponent_exports);
8677
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native12(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_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(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
8395
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native12(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_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(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
8678
8396
  typeof document < "u" && (cancelTouches = function() {
8679
8397
  componentSetStates.forEach(function(setState) {
8680
8398
  return setState(function(prev) {
@@ -8739,7 +8457,7 @@ var require_createComponent_native = __commonJS({
8739
8457
  defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
8740
8458
  });
8741
8459
  var component = /* @__PURE__ */ import_react3.default.forwardRef(function(propsIn, forwardedRef) {
8742
- var _themeState_state, _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? import_react3.default.useId() : "";
8460
+ var _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? import_react3.default.useId() : "";
8743
8461
  if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
8744
8462
  var _hooks_getBaseViews;
8745
8463
  hasSetupBaseViews = !0;
@@ -8763,13 +8481,17 @@ var require_createComponent_native = __commonJS({
8763
8481
  finalVal !== void 0 && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = finalVal);
8764
8482
  }
8765
8483
  }
8484
+ var debugProp = propsIn.debug;
8485
+ if (0)
8486
+ var timer;
8487
+ process.env.NODE_ENV === "development" && time2 && time2`non-tamagui time (ignore)`;
8766
8488
  var curDefaultProps = styledContextProps ? {
8767
8489
  ...defaultProps,
8768
8490
  ...styledContextProps
8769
8491
  } : defaultProps, props = propsIn;
8770
8492
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
8771
- var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
8772
- if (process.env.NODE_ENV === "development" && import_constants4.isClient && import_react3.default.useEffect(function() {
8493
+ var componentName2 = props.componentName || staticConfig.componentName;
8494
+ process.env.NODE_ENV === "development" && import_constants4.isClient && import_react3.default.useEffect(function() {
8773
8495
  var overlay = null, debugVisualizerHandler = function() {
8774
8496
  var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curStateRef.host;
8775
8497
  if (node) if (show) {
@@ -8783,9 +8505,7 @@ var require_createComponent_native = __commonJS({
8783
8505
  };
8784
8506
  }, [
8785
8507
  componentName2
8786
- ]), !1)
8787
- var timer;
8788
- process.env.NODE_ENV === "development" && time2 && time2`start (ignore)`;
8508
+ ]);
8789
8509
  var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
8790
8510
  process.env.NODE_ENV === "development" && time2 && time2`use-state`;
8791
8511
  var hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
@@ -8829,7 +8549,7 @@ var require_createComponent_native = __commonJS({
8829
8549
  }
8830
8550
  }
8831
8551
  process.env.NODE_ENV === "development" && time2 && time2`pre-theme-media`;
8832
- var [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
8552
+ var [theme, themeState] = (0, import_useTheme.useThemeWithState)(themeStateProps);
8833
8553
  process.env.NODE_ENV === "development" && time2 && time2`theme`, elementType = Component || elementType;
8834
8554
  var isStringElement = typeof elementType == "string", mediaState3 = (0, import_useMedia.useMedia)(componentContext, debugProp);
8835
8555
  (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time2 && time2`media`;
@@ -8844,7 +8564,7 @@ var require_createComponent_native = __commonJS({
8844
8564
  isAnimated,
8845
8565
  willBeAnimated,
8846
8566
  styledContextProps
8847
- }, themeName = (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "";
8567
+ }, themeName = (themeState == null ? void 0 : themeState.name) || "";
8848
8568
  process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
8849
8569
  var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
8850
8570
  if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
@@ -8885,14 +8605,14 @@ var require_createComponent_native = __commonJS({
8885
8605
  (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
8886
8606
  );
8887
8607
  if (shouldUseAnimation) {
8888
- var _themeState_state1, animations = useAnimations({
8608
+ var animations = useAnimations({
8889
8609
  props: propsWithAnimation,
8890
8610
  // if hydrating, send empty style
8891
8611
  style: splitStylesStyle || {},
8892
8612
  presence,
8893
8613
  componentState: state,
8894
8614
  styleProps,
8895
- theme: (_themeState_state1 = themeState.state) === null || _themeState_state1 === void 0 ? void 0 : _themeState_state1.theme,
8615
+ theme,
8896
8616
  pseudos: pseudos || null,
8897
8617
  staticConfig,
8898
8618
  stateRef
@@ -9098,16 +8818,12 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9098
8818
  }, [
9099
8819
  groupName
9100
8820
  ]);
9101
- if ((groupName && subGroupContext || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8821
+ if ((groupName || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
9102
8822
  ...componentContext,
9103
8823
  groups: subGroupContext,
9104
8824
  setParentFocusState: setStateShallow,
9105
8825
  children: content
9106
- })), process.env.NODE_ENV === "development" && time2 && time2`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time2 && time2`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, {
9107
- themeState,
9108
- themeProps: props,
9109
- children: content
9110
- })), staticConfig.context) {
8826
+ })), process.env.NODE_ENV === "development" && time2 && time2`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time2 && time2`themed-children`, staticConfig.context) {
9111
8827
  var contextProps = staticConfig.context.props;
9112
8828
  for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
9113
8829
  var _viewProps_style;
@@ -10802,7 +10518,7 @@ var require_proxyThemeVariables_native = __commonJS({
10802
10518
  var require_useThemeName_native = __commonJS({
10803
10519
  "../../core/web/dist/cjs/hooks/useThemeName.native.js"(exports2, module2) {
10804
10520
  "use strict";
10805
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
10521
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
10806
10522
  for (var name in all) __defProp2(target, name, {
10807
10523
  get: all[name],
10808
10524
  enumerable: !0
@@ -10830,18 +10546,6 @@ var require_useThemeName_native = __commonJS({
10830
10546
  }
10831
10547
  }
10832
10548
  return to;
10833
- }, __toESM2 = function(mod, isNodeMode, target) {
10834
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
10835
- // If the importer is in node compatibility mode or this is not an ESM
10836
- // file that has been converted to a CommonJS file using a Babel-
10837
- // compatible transform (i.e. "__esModule" has not been set), then set
10838
- // "default" to the CommonJS "module.exports" for node compatibility.
10839
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
10840
- value: mod,
10841
- enumerable: !0
10842
- }) : target,
10843
- mod
10844
- );
10845
10549
  }, __toCommonJS2 = function(mod) {
10846
10550
  return __copyProps2(__defProp2({}, "__esModule", {
10847
10551
  value: !0
@@ -10853,17 +10557,20 @@ var require_useThemeName_native = __commonJS({
10853
10557
  }
10854
10558
  });
10855
10559
  module2.exports = __toCommonJS2(useThemeName_exports);
10856
- var import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_ThemeManagerContext = require_ThemeManagerContext_native();
10857
- function useThemeName2(opts) {
10858
- var manager = import_react3.default.useContext(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = import_react3.default.useState((manager == null ? void 0 : manager.state.name) || "");
10859
- return (0, import_constants4.useIsomorphicLayoutEffect)(function() {
10860
- if (manager) return setName(manager.state.name), manager.onChangeTheme(function(next, manager2) {
10861
- var name2 = opts != null && opts.parent && manager2.state.parentName || next;
10862
- name2 && setName(name2);
10863
- });
10864
- }, [
10865
- manager == null ? void 0 : manager.state.name
10866
- ]), name;
10560
+ var import_useThemeState = require_useThemeState_native(), forceUpdateState = {
10561
+ forceClassName: !0,
10562
+ deopt: !0,
10563
+ needsUpdate: function() {
10564
+ return !0;
10565
+ }
10566
+ }, forceKeys = {
10567
+ current: /* @__PURE__ */ new Set([
10568
+ ""
10569
+ ])
10570
+ };
10571
+ function useThemeName2() {
10572
+ var _useThemeState;
10573
+ return ((_useThemeState = (0, import_useThemeState.useThemeState)(forceUpdateState, !1, forceKeys)) === null || _useThemeState === void 0 ? void 0 : _useThemeState.name) || "";
10867
10574
  }
10868
10575
  }
10869
10576
  });
@@ -11113,14 +10820,14 @@ var require_useProps_native = __commonJS({
11113
10820
  return usePropsAndStyle2(props, opts)[1] || {};
11114
10821
  }
11115
10822
  function usePropsAndStyle2(props, opts) {
11116
- var _opts_forComponent, _themeState_state, _opts_forComponent_staticConfig, staticConfig = (_opts_forComponent_staticConfig = opts == null || (_opts_forComponent = opts.forComponent) === null || _opts_forComponent === void 0 ? void 0 : _opts_forComponent.staticConfig) !== null && _opts_forComponent_staticConfig !== void 0 ? _opts_forComponent_staticConfig : import_Stack.Stack.staticConfig, [themeState, theme] = (0, import_useTheme.useThemeWithState)({
10823
+ var _opts_forComponent, _opts_forComponent_staticConfig, staticConfig = (_opts_forComponent_staticConfig = opts == null || (_opts_forComponent = opts.forComponent) === null || _opts_forComponent === void 0 ? void 0 : _opts_forComponent.staticConfig) !== null && _opts_forComponent_staticConfig !== void 0 ? _opts_forComponent_staticConfig : import_Stack.Stack.staticConfig, [theme, themeState] = (0, import_useTheme.useThemeWithState)({
11117
10824
  componentName: staticConfig.componentName,
11118
10825
  name: "theme" in props ? props.theme : void 0,
11119
10826
  inverse: "themeInverse" in props ? props.themeInverse : void 0
11120
10827
  }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
11121
10828
  // not safe to use mediaState but really marginal to hit this
11122
10829
  import_useMedia.mediaState
11123
- ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, {
10830
+ ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, {
11124
10831
  isAnimated: !1,
11125
10832
  mediaState: mediaStateNow,
11126
10833
  noSkip: !0,
@@ -11365,7 +11072,7 @@ var require_ThemeProvider_native = __commonJS({
11365
11072
  // if root class disabled, force class here
11366
11073
  forceClassName: !disableRootThemeClass && !themeClassNameOnRoot,
11367
11074
  // @ts-expect-error
11368
- _isRoot: !0,
11075
+ _isRoot: import_react3.useId,
11369
11076
  children: props.children
11370
11077
  });
11371
11078
  };
@@ -11657,6 +11364,9 @@ var require_index_native14 = __commonJS({
11657
11364
  configureMedia: function() {
11658
11365
  return import_useMedia.configureMedia;
11659
11366
  },
11367
+ forceUpdateThemes: function() {
11368
+ return import_useThemeState.forceUpdateThemes;
11369
+ },
11660
11370
  getConfig: function() {
11661
11371
  return import_config.getConfig;
11662
11372
  },
@@ -11752,6 +11462,7 @@ var require_index_native14 = __commonJS({
11752
11462
  __reExport2(index_exports2, require_wrapStyleTags_native(), module2.exports);
11753
11463
  var import_useMedia = require_useMedia_native();
11754
11464
  __reExport2(index_exports2, require_useTheme_native(), module2.exports);
11465
+ var import_useThemeState = require_useThemeState_native();
11755
11466
  __reExport2(index_exports2, require_useThemeName_native(), module2.exports);
11756
11467
  __reExport2(index_exports2, require_useConfiguration_native(), module2.exports);
11757
11468
  __reExport2(index_exports2, require_useIsTouchDevice_native(), module2.exports);
@@ -29818,8 +29529,7 @@ var require_createSwitch_native = __commonJS({
29818
29529
  ...props,
29819
29530
  ...switchProps,
29820
29531
  ...!disableActiveTheme && !props.unstyled && {
29821
- theme: checked ? "active" : null,
29822
- themeShallow: !0
29532
+ theme: checked ? "active" : null
29823
29533
  },
29824
29534
  // expected variants
29825
29535
  checked,
@@ -30274,7 +29984,7 @@ var require_mutateTheme_native = __commonJS({
30274
29984
  }
30275
29985
  });
30276
29986
  module2.exports = __toCommonJS2(mutateTheme_exports);
30277
- var import_react3 = require("react"), import_constants4 = require_index_native6(), import_web = require_index_native14(), import_start_transition = require_index_native9();
29987
+ var import_constants4 = require_index_native6(), import_start_transition = require_index_native9(), import_web = require_index_native14();
30278
29988
  function mutateThemes2(param) {
30279
29989
  var { themes, batch, insertCSS = !0, ...props } = param, allThemesProxied = {}, allThemesRaw = {}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
30280
29990
  try {
@@ -30303,7 +30013,7 @@ var require_mutateTheme_native = __commonJS({
30303
30013
  return (0, import_start_transition.startTransition)(function() {
30304
30014
  for (var themeName in allThemesProxied) {
30305
30015
  var theme2 = allThemesProxied[themeName];
30306
- updateThemeConfig(themeName, theme2), notifyThemeManagersOfUpdate(themeName, theme2);
30016
+ updateThemeConfig(themeName, theme2), updateThemeStates(themeName, theme2);
30307
30017
  }
30308
30018
  }), {
30309
30019
  themes: allThemesProxied,
@@ -30334,19 +30044,14 @@ var require_mutateTheme_native = __commonJS({
30334
30044
  };
30335
30045
  return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
30336
30046
  [themeName]: theme1
30337
- })), updateThemeConfig(themeName, themeProxied), notifyThemeManagersOfUpdate(themeName, themeProxied)), response;
30047
+ })), updateThemeConfig(themeName, themeProxied), updateThemeStates(themeName, themeProxied)), response;
30338
30048
  }
30339
30049
  function updateThemeConfig(themeName, theme) {
30340
30050
  var config = (0, import_web.getConfig)();
30341
30051
  config.themes[themeName] = theme, (0, import_web.updateConfig)("themes", config.themes);
30342
30052
  }
30343
- function notifyThemeManagersOfUpdate(themeName, theme) {
30344
- import_web.activeThemeManagers.forEach(function(manager) {
30345
- manager.state.name === themeName && manager.updateStateFromProps({
30346
- name: themeName,
30347
- forceTheme: theme
30348
- }, !0);
30349
- });
30053
+ function updateThemeStates(themeName, theme) {
30054
+ (0, import_web.forceUpdateThemes)();
30350
30055
  }
30351
30056
  function insertThemeCSS(themes) {
30352
30057
  var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;