@shopify/hydrogen-react 0.0.0-next-8e0752f → 0.0.0-next-35b1986
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.
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
withSelectorExports = v2;
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
|
-
var
|
|
184
|
+
var withSelector_development = {};
|
|
185
185
|
var shimExports = {};
|
|
186
186
|
var shim = {
|
|
187
187
|
get exports() {
|
|
@@ -191,59 +191,6 @@
|
|
|
191
191
|
shimExports = v2;
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
var useSyncExternalStoreShim_production_min = {};
|
|
195
|
-
/**
|
|
196
|
-
* @license React
|
|
197
|
-
* use-sync-external-store-shim.production.min.js
|
|
198
|
-
*
|
|
199
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the MIT license found in the
|
|
202
|
-
* LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/
|
|
204
|
-
var hasRequiredUseSyncExternalStoreShim_production_min;
|
|
205
|
-
function requireUseSyncExternalStoreShim_production_min() {
|
|
206
|
-
if (hasRequiredUseSyncExternalStoreShim_production_min)
|
|
207
|
-
return useSyncExternalStoreShim_production_min;
|
|
208
|
-
hasRequiredUseSyncExternalStoreShim_production_min = 1;
|
|
209
|
-
var e2 = React;
|
|
210
|
-
function h(a2, b) {
|
|
211
|
-
return a2 === b && (0 !== a2 || 1 / a2 === 1 / b) || a2 !== a2 && b !== b;
|
|
212
|
-
}
|
|
213
|
-
var k = "function" === typeof Object.is ? Object.is : h, l2 = e2.useState, m = e2.useEffect, n2 = e2.useLayoutEffect, p = e2.useDebugValue;
|
|
214
|
-
function q(a2, b) {
|
|
215
|
-
var d = b(), f2 = l2({ inst: { value: d, getSnapshot: b } }), c2 = f2[0].inst, g2 = f2[1];
|
|
216
|
-
n2(function() {
|
|
217
|
-
c2.value = d;
|
|
218
|
-
c2.getSnapshot = b;
|
|
219
|
-
r2(c2) && g2({ inst: c2 });
|
|
220
|
-
}, [a2, d, b]);
|
|
221
|
-
m(function() {
|
|
222
|
-
r2(c2) && g2({ inst: c2 });
|
|
223
|
-
return a2(function() {
|
|
224
|
-
r2(c2) && g2({ inst: c2 });
|
|
225
|
-
});
|
|
226
|
-
}, [a2]);
|
|
227
|
-
p(d);
|
|
228
|
-
return d;
|
|
229
|
-
}
|
|
230
|
-
function r2(a2) {
|
|
231
|
-
var b = a2.getSnapshot;
|
|
232
|
-
a2 = a2.value;
|
|
233
|
-
try {
|
|
234
|
-
var d = b();
|
|
235
|
-
return !k(a2, d);
|
|
236
|
-
} catch (f2) {
|
|
237
|
-
return true;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
function t2(a2, b) {
|
|
241
|
-
return b();
|
|
242
|
-
}
|
|
243
|
-
var u2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t2 : q;
|
|
244
|
-
useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e2.useSyncExternalStore ? e2.useSyncExternalStore : u2;
|
|
245
|
-
return useSyncExternalStoreShim_production_min;
|
|
246
|
-
}
|
|
247
194
|
var useSyncExternalStoreShim_development = {};
|
|
248
195
|
/**
|
|
249
196
|
* @license React
|
|
@@ -254,207 +201,125 @@
|
|
|
254
201
|
* This source code is licensed under the MIT license found in the
|
|
255
202
|
* LICENSE file in the root directory of this source tree.
|
|
256
203
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
var React$1 = React;
|
|
268
|
-
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
269
|
-
function error(format) {
|
|
204
|
+
{
|
|
205
|
+
(function() {
|
|
206
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
207
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
208
|
+
}
|
|
209
|
+
var React$1 = React;
|
|
210
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
211
|
+
function error(format) {
|
|
212
|
+
{
|
|
270
213
|
{
|
|
271
|
-
{
|
|
272
|
-
|
|
273
|
-
args[_key2 - 1] = arguments[_key2];
|
|
274
|
-
}
|
|
275
|
-
printWarning("error", format, args);
|
|
214
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
215
|
+
args[_key2 - 1] = arguments[_key2];
|
|
276
216
|
}
|
|
217
|
+
printWarning("error", format, args);
|
|
277
218
|
}
|
|
278
219
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
var argsWithFormat = args.map(function(item) {
|
|
288
|
-
return String(item);
|
|
289
|
-
});
|
|
290
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
291
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
220
|
+
}
|
|
221
|
+
function printWarning(level, format, args) {
|
|
222
|
+
{
|
|
223
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
224
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
225
|
+
if (stack !== "") {
|
|
226
|
+
format += "%s";
|
|
227
|
+
args = args.concat([stack]);
|
|
292
228
|
}
|
|
229
|
+
var argsWithFormat = args.map(function(item) {
|
|
230
|
+
return String(item);
|
|
231
|
+
});
|
|
232
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
233
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
293
234
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
235
|
+
}
|
|
236
|
+
function is(x, y) {
|
|
237
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
238
|
+
}
|
|
239
|
+
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
240
|
+
var useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue;
|
|
241
|
+
var didWarnOld18Alpha = false;
|
|
242
|
+
var didWarnUncachedGetSnapshot = false;
|
|
243
|
+
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
244
|
+
{
|
|
245
|
+
if (!didWarnOld18Alpha) {
|
|
246
|
+
if (React$1.startTransition !== void 0) {
|
|
247
|
+
didWarnOld18Alpha = true;
|
|
248
|
+
error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
|
|
308
249
|
}
|
|
309
250
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
251
|
+
}
|
|
252
|
+
var value = getSnapshot();
|
|
253
|
+
{
|
|
254
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
255
|
+
var cachedValue = getSnapshot();
|
|
256
|
+
if (!objectIs(value, cachedValue)) {
|
|
257
|
+
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
258
|
+
didWarnUncachedGetSnapshot = true;
|
|
318
259
|
}
|
|
319
260
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
261
|
+
}
|
|
262
|
+
var _useState = useState({
|
|
263
|
+
inst: {
|
|
264
|
+
value,
|
|
265
|
+
getSnapshot
|
|
266
|
+
}
|
|
267
|
+
}), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
268
|
+
useLayoutEffect(function() {
|
|
269
|
+
inst.value = value;
|
|
270
|
+
inst.getSnapshot = getSnapshot;
|
|
271
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
272
|
+
forceUpdate({
|
|
273
|
+
inst
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}, [subscribe, value, getSnapshot]);
|
|
277
|
+
useEffect(function() {
|
|
278
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
279
|
+
forceUpdate({
|
|
280
|
+
inst
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
var handleStoreChange = function() {
|
|
336
284
|
if (checkIfSnapshotChanged(inst)) {
|
|
337
285
|
forceUpdate({
|
|
338
286
|
inst
|
|
339
287
|
});
|
|
340
288
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
var prevValue = inst.value;
|
|
356
|
-
try {
|
|
357
|
-
var nextValue = latestGetSnapshot();
|
|
358
|
-
return !objectIs(prevValue, nextValue);
|
|
359
|
-
} catch (error2) {
|
|
360
|
-
return true;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
364
|
-
return getSnapshot();
|
|
365
|
-
}
|
|
366
|
-
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
367
|
-
var isServerEnvironment = !canUseDOM;
|
|
368
|
-
var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
369
|
-
var useSyncExternalStore$2 = React$1.useSyncExternalStore !== void 0 ? React$1.useSyncExternalStore : shim2;
|
|
370
|
-
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
371
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
372
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
289
|
+
};
|
|
290
|
+
return subscribe(handleStoreChange);
|
|
291
|
+
}, [subscribe]);
|
|
292
|
+
useDebugValue(value);
|
|
293
|
+
return value;
|
|
294
|
+
}
|
|
295
|
+
function checkIfSnapshotChanged(inst) {
|
|
296
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
297
|
+
var prevValue = inst.value;
|
|
298
|
+
try {
|
|
299
|
+
var nextValue = latestGetSnapshot();
|
|
300
|
+
return !objectIs(prevValue, nextValue);
|
|
301
|
+
} catch (error2) {
|
|
302
|
+
return true;
|
|
373
303
|
}
|
|
374
|
-
})();
|
|
375
|
-
}
|
|
376
|
-
return useSyncExternalStoreShim_development;
|
|
377
|
-
}
|
|
378
|
-
var hasRequiredShim;
|
|
379
|
-
function requireShim() {
|
|
380
|
-
if (hasRequiredShim)
|
|
381
|
-
return shimExports;
|
|
382
|
-
hasRequiredShim = 1;
|
|
383
|
-
(function(module2) {
|
|
384
|
-
if (process.env.NODE_ENV === "production") {
|
|
385
|
-
module2.exports = requireUseSyncExternalStoreShim_production_min();
|
|
386
|
-
} else {
|
|
387
|
-
module2.exports = requireUseSyncExternalStoreShim_development();
|
|
388
304
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
var hasRequiredWithSelector_production_min;
|
|
402
|
-
function requireWithSelector_production_min() {
|
|
403
|
-
if (hasRequiredWithSelector_production_min)
|
|
404
|
-
return withSelector_production_min;
|
|
405
|
-
hasRequiredWithSelector_production_min = 1;
|
|
406
|
-
var h = React, n2 = requireShim();
|
|
407
|
-
function p(a2, b) {
|
|
408
|
-
return a2 === b && (0 !== a2 || 1 / a2 === 1 / b) || a2 !== a2 && b !== b;
|
|
409
|
-
}
|
|
410
|
-
var q = "function" === typeof Object.is ? Object.is : p, r2 = n2.useSyncExternalStore, t2 = h.useRef, u2 = h.useEffect, v2 = h.useMemo, w = h.useDebugValue;
|
|
411
|
-
withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b, e2, l2, g2) {
|
|
412
|
-
var c2 = t2(null);
|
|
413
|
-
if (null === c2.current) {
|
|
414
|
-
var f2 = { hasValue: false, value: null };
|
|
415
|
-
c2.current = f2;
|
|
416
|
-
} else
|
|
417
|
-
f2 = c2.current;
|
|
418
|
-
c2 = v2(function() {
|
|
419
|
-
function a3(a4) {
|
|
420
|
-
if (!c3) {
|
|
421
|
-
c3 = true;
|
|
422
|
-
d2 = a4;
|
|
423
|
-
a4 = l2(a4);
|
|
424
|
-
if (void 0 !== g2 && f2.hasValue) {
|
|
425
|
-
var b2 = f2.value;
|
|
426
|
-
if (g2(b2, a4))
|
|
427
|
-
return k = b2;
|
|
428
|
-
}
|
|
429
|
-
return k = a4;
|
|
430
|
-
}
|
|
431
|
-
b2 = k;
|
|
432
|
-
if (q(d2, a4))
|
|
433
|
-
return b2;
|
|
434
|
-
var e3 = l2(a4);
|
|
435
|
-
if (void 0 !== g2 && g2(b2, e3))
|
|
436
|
-
return b2;
|
|
437
|
-
d2 = a4;
|
|
438
|
-
return k = e3;
|
|
439
|
-
}
|
|
440
|
-
var c3 = false, d2, k, m = void 0 === e2 ? null : e2;
|
|
441
|
-
return [function() {
|
|
442
|
-
return a3(b());
|
|
443
|
-
}, null === m ? void 0 : function() {
|
|
444
|
-
return a3(m());
|
|
445
|
-
}];
|
|
446
|
-
}, [b, e2, l2, g2]);
|
|
447
|
-
var d = r2(a2, c2[0], c2[1]);
|
|
448
|
-
u2(function() {
|
|
449
|
-
f2.hasValue = true;
|
|
450
|
-
f2.value = d;
|
|
451
|
-
}, [d]);
|
|
452
|
-
w(d);
|
|
453
|
-
return d;
|
|
454
|
-
};
|
|
455
|
-
return withSelector_production_min;
|
|
305
|
+
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
306
|
+
return getSnapshot();
|
|
307
|
+
}
|
|
308
|
+
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
309
|
+
var isServerEnvironment = !canUseDOM;
|
|
310
|
+
var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
311
|
+
var useSyncExternalStore$2 = React$1.useSyncExternalStore !== void 0 ? React$1.useSyncExternalStore : shim2;
|
|
312
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
313
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
314
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
315
|
+
}
|
|
316
|
+
})();
|
|
456
317
|
}
|
|
457
|
-
|
|
318
|
+
(function(module2) {
|
|
319
|
+
{
|
|
320
|
+
module2.exports = useSyncExternalStoreShim_development;
|
|
321
|
+
}
|
|
322
|
+
})(shim);
|
|
458
323
|
/**
|
|
459
324
|
* @license React
|
|
460
325
|
* use-sync-external-store-shim/with-selector.development.js
|
|
@@ -464,100 +329,91 @@
|
|
|
464
329
|
* This source code is licensed under the MIT license found in the
|
|
465
330
|
* LICENSE file in the root directory of this source tree.
|
|
466
331
|
*/
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
332
|
+
{
|
|
333
|
+
(function() {
|
|
334
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
335
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
336
|
+
}
|
|
337
|
+
var React$1 = React;
|
|
338
|
+
var shim2 = shimExports;
|
|
339
|
+
function is(x, y) {
|
|
340
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
341
|
+
}
|
|
342
|
+
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
343
|
+
var useSyncExternalStore = shim2.useSyncExternalStore;
|
|
344
|
+
var useRef = React$1.useRef, useEffect = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue = React$1.useDebugValue;
|
|
345
|
+
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual2) {
|
|
346
|
+
var instRef = useRef(null);
|
|
347
|
+
var inst;
|
|
348
|
+
if (instRef.current === null) {
|
|
349
|
+
inst = {
|
|
350
|
+
hasValue: false,
|
|
351
|
+
value: null
|
|
352
|
+
};
|
|
353
|
+
instRef.current = inst;
|
|
354
|
+
} else {
|
|
355
|
+
inst = instRef.current;
|
|
481
356
|
}
|
|
482
|
-
var
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
var
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
var _useMemo = useMemo(function() {
|
|
498
|
-
var hasMemo = false;
|
|
499
|
-
var memoizedSnapshot;
|
|
500
|
-
var memoizedSelection;
|
|
501
|
-
var memoizedSelector = function(nextSnapshot) {
|
|
502
|
-
if (!hasMemo) {
|
|
503
|
-
hasMemo = true;
|
|
504
|
-
memoizedSnapshot = nextSnapshot;
|
|
505
|
-
var _nextSelection = selector(nextSnapshot);
|
|
506
|
-
if (isEqual2 !== void 0) {
|
|
507
|
-
if (inst.hasValue) {
|
|
508
|
-
var currentSelection = inst.value;
|
|
509
|
-
if (isEqual2(currentSelection, _nextSelection)) {
|
|
510
|
-
memoizedSelection = currentSelection;
|
|
511
|
-
return currentSelection;
|
|
512
|
-
}
|
|
357
|
+
var _useMemo = useMemo(function() {
|
|
358
|
+
var hasMemo = false;
|
|
359
|
+
var memoizedSnapshot;
|
|
360
|
+
var memoizedSelection;
|
|
361
|
+
var memoizedSelector = function(nextSnapshot) {
|
|
362
|
+
if (!hasMemo) {
|
|
363
|
+
hasMemo = true;
|
|
364
|
+
memoizedSnapshot = nextSnapshot;
|
|
365
|
+
var _nextSelection = selector(nextSnapshot);
|
|
366
|
+
if (isEqual2 !== void 0) {
|
|
367
|
+
if (inst.hasValue) {
|
|
368
|
+
var currentSelection = inst.value;
|
|
369
|
+
if (isEqual2(currentSelection, _nextSelection)) {
|
|
370
|
+
memoizedSelection = currentSelection;
|
|
371
|
+
return currentSelection;
|
|
513
372
|
}
|
|
514
373
|
}
|
|
515
|
-
memoizedSelection = _nextSelection;
|
|
516
|
-
return _nextSelection;
|
|
517
|
-
}
|
|
518
|
-
var prevSnapshot = memoizedSnapshot;
|
|
519
|
-
var prevSelection = memoizedSelection;
|
|
520
|
-
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
521
|
-
return prevSelection;
|
|
522
|
-
}
|
|
523
|
-
var nextSelection = selector(nextSnapshot);
|
|
524
|
-
if (isEqual2 !== void 0 && isEqual2(prevSelection, nextSelection)) {
|
|
525
|
-
return prevSelection;
|
|
526
374
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
var
|
|
532
|
-
|
|
533
|
-
return
|
|
534
|
-
}
|
|
535
|
-
var
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
375
|
+
memoizedSelection = _nextSelection;
|
|
376
|
+
return _nextSelection;
|
|
377
|
+
}
|
|
378
|
+
var prevSnapshot = memoizedSnapshot;
|
|
379
|
+
var prevSelection = memoizedSelection;
|
|
380
|
+
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
381
|
+
return prevSelection;
|
|
382
|
+
}
|
|
383
|
+
var nextSelection = selector(nextSnapshot);
|
|
384
|
+
if (isEqual2 !== void 0 && isEqual2(prevSelection, nextSelection)) {
|
|
385
|
+
return prevSelection;
|
|
386
|
+
}
|
|
387
|
+
memoizedSnapshot = nextSnapshot;
|
|
388
|
+
memoizedSelection = nextSelection;
|
|
389
|
+
return nextSelection;
|
|
390
|
+
};
|
|
391
|
+
var maybeGetServerSnapshot = getServerSnapshot === void 0 ? null : getServerSnapshot;
|
|
392
|
+
var getSnapshotWithSelector = function() {
|
|
393
|
+
return memoizedSelector(getSnapshot());
|
|
394
|
+
};
|
|
395
|
+
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? void 0 : function() {
|
|
396
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
397
|
+
};
|
|
398
|
+
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
399
|
+
}, [getSnapshot, getServerSnapshot, selector, isEqual2]), getSelection = _useMemo[0], getServerSelection = _useMemo[1];
|
|
400
|
+
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
401
|
+
useEffect(function() {
|
|
402
|
+
inst.hasValue = true;
|
|
403
|
+
inst.value = value;
|
|
404
|
+
}, [value]);
|
|
405
|
+
useDebugValue(value);
|
|
406
|
+
return value;
|
|
407
|
+
}
|
|
408
|
+
withSelector_development.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
|
|
409
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
410
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
411
|
+
}
|
|
412
|
+
})();
|
|
555
413
|
}
|
|
556
414
|
(function(module2) {
|
|
557
|
-
|
|
558
|
-
module2.exports =
|
|
559
|
-
} else {
|
|
560
|
-
module2.exports = requireWithSelector_development();
|
|
415
|
+
{
|
|
416
|
+
module2.exports = withSelector_development;
|
|
561
417
|
}
|
|
562
418
|
})(withSelector);
|
|
563
419
|
function useConstant(fn) {
|
|
@@ -600,7 +456,7 @@
|
|
|
600
456
|
};
|
|
601
457
|
function useMachine(stateMachine, options) {
|
|
602
458
|
var persistedStateRef = React.useRef();
|
|
603
|
-
|
|
459
|
+
{
|
|
604
460
|
var _a = __read(React.useState(stateMachine), 1), initialMachine = _a[0];
|
|
605
461
|
if (stateMachine !== initialMachine) {
|
|
606
462
|
console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.");
|