import { __exports as d } from "../../../../../../_virtual/use-sync-external-store-with-selector.development.js";
import p from "react";
/**
 * @license React
 * use-sync-external-store-with-selector.development.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var s;
function b() {
  return s ? d : (s = 1, process.env.NODE_ENV !== "production" && function() {
    function S(r, u) {
      return r === u && (r !== 0 || 1 / r === 1 / u) || r !== r && u !== u;
    }
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
    var o = p, A = typeof Object.is == "function" ? Object.is : S, R = o.useSyncExternalStore, T = o.useRef, V = o.useEffect, y = o.useMemo, D = o.useDebugValue;
    d.useSyncExternalStoreWithSelector = function(r, u, a, c, f) {
      var t = T(null);
      if (t.current === null) {
        var _ = { hasValue: !1, value: null };
        t.current = _;
      } else _ = t.current;
      t = y(
        function() {
          function E(e) {
            if (!v) {
              if (v = !0, i = e, e = c(e), f !== void 0 && _.hasValue) {
                var n = _.value;
                if (f(n, e))
                  return O = n;
              }
              return O = e;
            }
            if (n = O, A(i, e))
              return n;
            var m = c(e);
            return f !== void 0 && f(n, m) ? (i = e, n) : (i = e, O = m);
          }
          var v = !1, i, O, L = a === void 0 ? null : a;
          return [
            function() {
              return E(u());
            },
            L === null ? void 0 : function() {
              return E(L());
            }
          ];
        },
        [u, a, c, f]
      );
      var l = R(r, t[0], t[1]);
      return V(
        function() {
          _.hasValue = !0, _.value = l;
        },
        [l]
      ), D(l), l;
    }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
  }(), d);
}
export {
  b as __require
};
//# sourceMappingURL=use-sync-external-store-with-selector.development.js.map
