@qwik.dev/core 2.0.0-beta.2 → 2.0.0-beta.3

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.
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core 2.0.0-beta.2-dev+3ddc6c7
3
+ * @qwik.dev/core 2.0.0-beta.3-dev+aa098fc
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
7
7
  */
8
8
  !function(global, factory) {
9
9
  "object" == typeof exports && "undefined" != typeof module ? factory(exports, require("@qwik.dev/core/build"), require("@qwik.dev/core/preloader")) : "function" == typeof define && define.amd ? define([ "exports", "@qwik.dev/core/build", "@qwik.dev/core/preloader" ], factory) : factory((global = "undefined" != typeof globalThis ? globalThis : global || self).qwikCore = {}, global.qwikBuild, global.qwikPreloader);
10
- }(this, (function(exports, build, preloader) {
10
+ }(this, function(exports, build, preloader) {
11
11
  "use strict";
12
12
  const qDev = !1;
13
13
  const seal = () => {
@@ -22,9 +22,9 @@
22
22
  const createAndLogError = (asyncThrow, message, ...optionalParams) => {
23
23
  const err = message instanceof Error ? message : new Error(message);
24
24
  return console.error("%cQWIK ERROR", "", err.message, ...optionalParams, err.stack),
25
- asyncThrow && setTimeout((() => {
25
+ asyncThrow && setTimeout(() => {
26
26
  throw err;
27
- }), 0), err;
27
+ }, 0), err;
28
28
  };
29
29
  const qError = (code, errorMessageArgs = []) => {
30
30
  const text = (code => `Code(Q${code}) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L${8 + code}`)(code, ...errorMessageArgs);
@@ -65,18 +65,18 @@
65
65
  const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();
66
66
  const urlCopy = new URL(urlDoc);
67
67
  urlCopy.hash = "";
68
- return import(urlCopy.href).then((mod => mod[symbolName]));
68
+ return import(urlCopy.href).then(mod => mod[symbolName]);
69
69
  },
70
- raf: fn => new Promise((resolve => {
71
- requestAnimationFrame((() => {
70
+ raf: fn => new Promise(resolve => {
71
+ requestAnimationFrame(() => {
72
72
  resolve(fn());
73
- }));
74
- })),
75
- nextTick: fn => new Promise((resolve => {
76
- setTimeout((() => {
73
+ });
74
+ }),
75
+ nextTick: fn => new Promise(resolve => {
76
+ setTimeout(() => {
77
77
  resolve(fn());
78
- }));
79
- })),
78
+ });
79
+ }),
80
80
  chunkForSymbol: (symbolName, chunk) => [ symbolName, chunk ?? "_" ]
81
81
  });
82
82
  const toUrl = (doc, containerEl, url) => {
@@ -102,9 +102,9 @@
102
102
  const shouldNotError = reason => {
103
103
  throwErrorAndStop(reason);
104
104
  };
105
- const delay = timeout => new Promise((resolve => {
105
+ const delay = timeout => new Promise(resolve => {
106
106
  setTimeout(resolve, timeout);
107
- }));
107
+ });
108
108
  function retryOnPromise(fn, retryCount = 0) {
109
109
  const retryOrThrow = e => {
110
110
  if (isPromise(e) && retryCount < 100) {
@@ -114,7 +114,7 @@
114
114
  };
115
115
  try {
116
116
  const result = fn();
117
- return isPromise(result) ? result.catch((e => retryOrThrow(e))) : result;
117
+ return isPromise(result) ? result.catch(e => retryOrThrow(e)) : result;
118
118
  } catch (e) {
119
119
  if (build.isDev && build.isServer && e instanceof ReferenceError && e.message.includes("window")) {
120
120
  throw e.message = 'It seems like you forgot to add "if (isBrowser) {...}" here:' + e.message,
@@ -163,7 +163,7 @@
163
163
  this.$untrackedValue$ = value;
164
164
  }
165
165
  get value() {
166
- return setupSignalValueAccess(this, (() => this.$effects$ ||= new Set), (() => this.untrackedValue));
166
+ return setupSignalValueAccess(this, () => this.$effects$ ||= new Set, () => this.untrackedValue);
167
167
  }
168
168
  set value(value) {
169
169
  value !== this.$untrackedValue$ && (this.$untrackedValue$ = value, triggerEffects(this.$container$, this, this.$effects$));
@@ -172,7 +172,7 @@
172
172
  qDev;
173
173
  }
174
174
  toString() {
175
- return build.isDev ? `[${this.constructor.name}${1 & this.$flags$ ? " INVALID" : ""} ${String(this.$untrackedValue$)}]` + (Array.from(this.$effects$ || []).map((e => "\n -> " + pad(qwikDebugToString(e[0]), " "))).join("\n") || "") : this.constructor.name;
175
+ return build.isDev ? `[${this.constructor.name}${1 & this.$flags$ ? " INVALID" : ""} ${String(this.$untrackedValue$)}]` + (Array.from(this.$effects$ || []).map(e => "\n -> " + pad(qwikDebugToString(e[0]), " ")).join("\n") || "") : this.constructor.name;
176
176
  }
177
177
  toJSON() {
178
178
  return {
@@ -225,7 +225,7 @@
225
225
  if (!(1 & this.$flags$)) {
226
226
  return !1;
227
227
  }
228
- const untrackedValue = trackSignal((() => this.$func$(...this.$args$)), this, ".", this.$container$);
228
+ const untrackedValue = trackSignal(() => this.$func$(...this.$args$), this, ".", this.$container$);
229
229
  const didChange = untrackedValue !== this.$untrackedValue$;
230
230
  return didChange && (this.$untrackedValue$ = untrackedValue), didChange;
231
231
  }
@@ -326,7 +326,7 @@
326
326
  }
327
327
  };
328
328
  const trackSignalAndAssignHost = (value, host, property, container, data) => (value instanceof WrappedSignalImpl && value.$hostElement$ !== host && host && (value.$hostElement$ = host),
329
- trackSignal((() => value.value), host, property, container, data));
329
+ trackSignal(() => value.value, host, property, container, data));
330
330
  const useSequentialScope = () => {
331
331
  const iCtx = useInvokeContext();
332
332
  const host = iCtx.$hostElement$;
@@ -400,7 +400,7 @@
400
400
  set(1));
401
401
  };
402
402
  const ERROR_CONTEXT = /*#__PURE__*/ createContextId("qk-error");
403
- const version = "2.0.0-beta.2-dev+3ddc6c7";
403
+ const version = "2.0.0-beta.3-dev+aa098fc";
404
404
  const EMPTY_ARRAY = [];
405
405
  const EMPTY_OBJ = {};
406
406
  Object.freeze(EMPTY_ARRAY), Object.freeze(EMPTY_OBJ);
@@ -424,7 +424,7 @@
424
424
  {
425
425
  const ref = "QWIK-SELF";
426
426
  const frames = new Error(ref).stack.split("\n");
427
- const start = frames.findIndex((f => f.includes(ref)));
427
+ const start = frames.findIndex(f => f.includes(ref));
428
428
  match = frames[start + 2 + stackOffset].match(EXTRACT_FILE_NAME), chunk = match ? match[1] : "main";
429
429
  }
430
430
  }
@@ -533,7 +533,7 @@
533
533
  const {deserialize, initial} = arg;
534
534
  const update = arg.update;
535
535
  const currentValue = this.$untrackedValue$ === NEEDS_COMPUTATION ? initial : this.$untrackedValue$;
536
- const untrackedValue = trackSignal((() => this.$didInitialize$ ? update?.(currentValue) : deserialize(currentValue)), this, ".", this.$container$);
536
+ const untrackedValue = trackSignal(() => this.$didInitialize$ ? update?.(currentValue) : deserialize(currentValue), this, ".", this.$container$);
537
537
  const didChange = this.$didInitialize$ && "undefined" !== untrackedValue || untrackedValue !== this.$untrackedValue$;
538
538
  return this.$flags$ &= -2, this.$didInitialize$ = !0, didChange && (this.$untrackedValue$ = untrackedValue),
539
539
  didChange;
@@ -665,7 +665,7 @@
665
665
  const trackFn = (target, container) => (obj, prop) => {
666
666
  const ctx = newInvokeContext();
667
667
  return ctx.$effectSubscriber$ = getSubscriber(target, ":"), ctx.$container$ = container || void 0,
668
- invoke(ctx, (() => {
668
+ invoke(ctx, () => {
669
669
  if (isFunction(obj)) {
670
670
  return obj();
671
671
  }
@@ -680,20 +680,20 @@
680
680
  obj;
681
681
  }
682
682
  throw qError(2);
683
- }));
683
+ });
684
684
  };
685
685
  const cleanupFn = (target, handleError) => {
686
686
  let cleanupFns = null;
687
687
  return [ fn => {
688
- "function" == typeof fn && (cleanupFns || (cleanupFns = [], target.$destroy$ = noSerialize((() => {
689
- target.$destroy$ = null, cleanupFns.forEach((fn => {
688
+ "function" == typeof fn && (cleanupFns || (cleanupFns = [], target.$destroy$ = noSerialize(() => {
689
+ target.$destroy$ = null, cleanupFns.forEach(fn => {
690
690
  try {
691
691
  fn();
692
692
  } catch (err) {
693
693
  handleError(err);
694
694
  }
695
- }));
696
- }))), cleanupFns.push(fn));
695
+ });
696
+ })), cleanupFns.push(fn));
697
697
  }, cleanupFns ?? [] ];
698
698
  };
699
699
  class AsyncComputedSignalImpl extends ComputedSignalImpl {
@@ -708,7 +708,7 @@
708
708
  super(container, fn, flags);
709
709
  }
710
710
  get loading() {
711
- return setupSignalValueAccess(this, (() => this.$loadingEffects$ ||= new Set), (() => this.untrackedLoading));
711
+ return setupSignalValueAccess(this, () => this.$loadingEffects$ ||= new Set, () => this.untrackedLoading);
712
712
  }
713
713
  set untrackedLoading(value) {
714
714
  value !== this.$untrackedLoading$ && (this.$untrackedLoading$ = value, this.$container$?.$scheduler$(7, null, this, this.$loadingEffects$));
@@ -717,7 +717,7 @@
717
717
  return this.$untrackedLoading$;
718
718
  }
719
719
  get error() {
720
- return setupSignalValueAccess(this, (() => this.$errorEffects$ ||= new Set), (() => this.untrackedError));
720
+ return setupSignalValueAccess(this, () => this.$errorEffects$ ||= new Set, () => this.untrackedError);
721
721
  }
722
722
  set untrackedError(value) {
723
723
  value !== this.$untrackedError$ && (this.$untrackedError$ = value, this.$container$?.$scheduler$(7, null, this, this.$errorEffects$));
@@ -731,17 +731,17 @@
731
731
  }
732
732
  const computeQrl = this.$computeQrl$;
733
733
  throwIfQRLNotResolved(computeQrl);
734
- const [cleanup] = cleanupFn(this, (err => this.$container$?.handleError(err, null)));
734
+ const [cleanup] = cleanupFn(this, err => this.$container$?.handleError(err, null));
735
735
  const untrackedValue = this.$promiseValue$ ?? computeQrl.getFn()({
736
736
  track: trackFn(this, this.$container$),
737
737
  cleanup
738
738
  });
739
739
  if (isPromise(untrackedValue)) {
740
- throw this.untrackedLoading = !0, this.untrackedError = null, untrackedValue.then((promiseValue => {
740
+ throw this.untrackedLoading = !0, this.untrackedError = null, untrackedValue.then(promiseValue => {
741
741
  this.$promiseValue$ = promiseValue, this.untrackedLoading = !1, this.untrackedError = null;
742
- })).catch((err => {
742
+ }).catch(err => {
743
743
  this.untrackedLoading = !1, this.untrackedError = err;
744
- }));
744
+ });
745
745
  }
746
746
  this.$promiseValue$ = null, this.$flags$ &= -2;
747
747
  const didChange = untrackedValue !== this.$untrackedValue$;
@@ -863,6 +863,7 @@
863
863
  }
864
864
  return classes.join(" ");
865
865
  };
866
+ const fromCamelToKebabCaseWithDash = text => text.replace(/([A-Z])/g, "-$1").toLowerCase();
866
867
  function serializeAttribute(key, value, styleScopedId) {
867
868
  if (isClassAttr(key)) {
868
869
  const serializedClass = serializeClass(value);
@@ -881,7 +882,7 @@
881
882
  for (const key in obj) {
882
883
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
883
884
  const value = obj[key];
884
- null != value && "function" != typeof value && (key.startsWith("--") ? chunks.push(key + ":" + value) : chunks.push(key.replace(/([A-Z])/g, "-$1").toLowerCase() + ":" + setValueForStyle(key, value)));
885
+ null != value && "function" != typeof value && (key.startsWith("--") ? chunks.push(key + ":" + value) : chunks.push(fromCamelToKebabCaseWithDash(key) + ":" + setValueForStyle(key, value)));
885
886
  }
886
887
  }
887
888
  return chunks.join(";");
@@ -958,14 +959,14 @@
958
959
  const inlineComponent = componentQRL;
959
960
  componentFn = () => invokeApply(iCtx, inlineComponent, [ props || EMPTY_OBJ ]);
960
961
  }
961
- const executeComponentWithPromiseExceptionRetry = (retryCount = 0) => safeCall((() => (isInlineComponent || (container.setHostProp(renderHost, "q:seqIdx", null),
962
- container.setHostProp(renderHost, ":onIdx", null), container.setHostProp(renderHost, "q:props", props)),
963
- vnode_isVNode(renderHost) && clearAllEffects(container, renderHost), componentFn(props))), (jsx => {
962
+ const executeComponentWithPromiseExceptionRetry = (retryCount = 0) => safeCall(() => (isInlineComponent || (container.setHostProp(renderHost, "q:seqIdx", null),
963
+ container.setHostProp(renderHost, ":onIdx", null)), vnode_isVNode(renderHost) && clearAllEffects(container, renderHost),
964
+ componentFn(props)), jsx => {
964
965
  const useOnEvents = container.getHostProp(renderHost, ":on");
965
966
  return useOnEvents ? function(jsx, useOnEvents) {
966
967
  const jsxElement = findFirstStringJSX(jsx);
967
968
  let jsxResult = jsx;
968
- return maybeThen(jsxElement, (jsxElement => {
969
+ return maybeThen(jsxElement, jsxElement => {
969
970
  let isInvisibleComponent = !1;
970
971
  jsxElement || (isInvisibleComponent = !0);
971
972
  for (const key in useOnEvents) {
@@ -986,14 +987,14 @@
986
987
  }
987
988
  }
988
989
  return jsxResult;
989
- }));
990
+ });
990
991
  }(jsx, useOnEvents) : jsx;
991
- }), (err => {
992
+ }, err => {
992
993
  if (isPromise(err) && retryCount < 100) {
993
- return err.then((() => executeComponentWithPromiseExceptionRetry(retryCount++)));
994
+ return err.then(() => executeComponentWithPromiseExceptionRetry(retryCount++));
994
995
  }
995
996
  throw err;
996
- }));
997
+ });
997
998
  return executeComponentWithPromiseExceptionRetry();
998
999
  };
999
1000
  function addUseOnEvent(jsxElement, key, value) {
@@ -1016,10 +1017,10 @@
1016
1017
  queue.push(...jsx);
1017
1018
  } else {
1018
1019
  if (isPromise(jsx)) {
1019
- return maybeThen(jsx, (jsx => findFirstStringJSX(jsx)));
1020
+ return maybeThen(jsx, jsx => findFirstStringJSX(jsx));
1020
1021
  }
1021
1022
  if (isSignal(jsx)) {
1022
- return findFirstStringJSX(untrack((() => jsx.value)));
1023
+ return findFirstStringJSX(untrack(() => jsx.value));
1023
1024
  }
1024
1025
  }
1025
1026
  }
@@ -1056,7 +1057,12 @@
1056
1057
  const value = stack.pop();
1057
1058
  if (value instanceof ParentComponentData) {
1058
1059
  options.currentStyleScoped = value.$scopedStyle$, options.parentComponentFrame = value.$componentFrame$;
1059
- } else if (value !== MaybeAsyncSignal) {
1060
+ } else {
1061
+ if (value === MaybeAsyncSignal) {
1062
+ const trackFn = stack.pop();
1063
+ await retryOnPromise(() => stack.push(trackFn()));
1064
+ continue;
1065
+ }
1060
1066
  if ("function" != typeof value) {
1061
1067
  processJSXNode(ssr, enqueue, value, {
1062
1068
  styleScoped: options.currentStyleScoped,
@@ -1069,9 +1075,6 @@
1069
1075
  }
1070
1076
  await value.apply(ssr);
1071
1077
  }
1072
- } else {
1073
- const trackFn = stack.pop();
1074
- await retryOnPromise((() => stack.push(trackFn())));
1075
1078
  }
1076
1079
  }
1077
1080
  })();
@@ -1093,22 +1096,22 @@
1093
1096
  } else if (isSignal(value)) {
1094
1097
  ssr.openFragment(build.isDev ? [ DEBUG_TYPE, "S" ] : EMPTY_ARRAY);
1095
1098
  const signalNode = ssr.getOrCreateLastNode();
1096
- enqueue(ssr.closeFragment), enqueue((() => trackSignalAndAssignHost(value, signalNode, ".", ssr))),
1099
+ enqueue(ssr.closeFragment), enqueue(() => trackSignalAndAssignHost(value, signalNode, ".", ssr)),
1097
1100
  enqueue(MaybeAsyncSignal);
1098
1101
  } else if (isPromise(value)) {
1099
1102
  ssr.openFragment(build.isDev ? [ DEBUG_TYPE, "A" ] : EMPTY_ARRAY), enqueue(ssr.closeFragment),
1100
- enqueue(value), enqueue(Promise), enqueue((() => ssr.commentNode("qkssr-f")));
1103
+ enqueue(value), enqueue(Promise), enqueue(() => ssr.commentNode("qkssr-f"));
1101
1104
  } else if (function(value) {
1102
1105
  return !!value[Symbol.asyncIterator];
1103
1106
  }(value)) {
1104
- enqueue((async () => {
1107
+ enqueue(async () => {
1105
1108
  for await (const chunk of value) {
1106
1109
  await _walkJSX(ssr, chunk, {
1107
1110
  currentStyleScoped: options.styleScoped,
1108
1111
  parentComponentFrame: options.parentComponentFrame
1109
1112
  }), ssr.commentNode("qkssr-f");
1110
1113
  }
1111
- }));
1114
+ });
1112
1115
  } else {
1113
1116
  const jsx = value;
1114
1117
  const type = jsx.type;
@@ -1229,10 +1232,10 @@
1229
1232
  }
1230
1233
  const eventValue = setEvent(serializationCtx, key, value);
1231
1234
  eventValue && ssrAttrs.push(jsxEventToHtmlAttribute(key), eventValue);
1232
- } else {
1233
- isSignal(value) ? isClassAttr(key) ? ssrAttrs.push(key, [ value, styleScopedId ]) : ssrAttrs.push(key, value) : (isPreventDefault(key) && addPreventDefaultEventToSerializationContext(serializationCtx, key),
1234
- value = serializeAttribute(key, value, styleScopedId), ssrAttrs.push(key, value));
1235
+ continue;
1235
1236
  }
1237
+ isSignal(value) ? isClassAttr(key) ? ssrAttrs.push(key, [ value, styleScopedId ]) : ssrAttrs.push(key, value) : (isPreventDefault(key) && addPreventDefaultEventToSerializationContext(serializationCtx, key),
1238
+ value = serializeAttribute(key, value, styleScopedId), ssrAttrs.push(key, value));
1236
1239
  }
1237
1240
  return null != key && ssrAttrs.push("q:key", key), ssrAttrs;
1238
1241
  }
@@ -1290,25 +1293,25 @@
1290
1293
  const task = new Task(10, i, iCtx.$hostElement$, qrl, void 0, null);
1291
1294
  set(task);
1292
1295
  const promise = iCtx.$container$.$scheduler$(3, task);
1293
- isPromise(promise) && promise.catch((() => {}));
1296
+ isPromise(promise) && promise.catch(() => {});
1294
1297
  };
1295
1298
  const runTask = (task, container, host) => {
1296
1299
  task.$flags$ &= -9, cleanupTask(task);
1297
1300
  const iCtx = newInvokeContext(container.$locale$, host, void 0, "qTask");
1298
1301
  iCtx.$container$ = container;
1299
- const taskFn = task.$qrl$.getFn(iCtx, (() => clearAllEffects(container, task)));
1302
+ const taskFn = task.$qrl$.getFn(iCtx, () => clearAllEffects(container, task));
1300
1303
  const track = trackFn(task, container);
1301
- const [cleanup] = cleanupFn(task, (reason => container.handleError(reason, host)));
1304
+ const [cleanup] = cleanupFn(task, reason => container.handleError(reason, host));
1302
1305
  const taskApi = {
1303
1306
  track,
1304
1307
  cleanup
1305
1308
  };
1306
- return safeCall((() => taskFn(taskApi)), cleanup, (err => {
1309
+ return safeCall(() => taskFn(taskApi), cleanup, err => {
1307
1310
  if (isPromise(err)) {
1308
- return err.then((() => runTask(task, container, host)));
1311
+ return err.then(() => runTask(task, container, host));
1309
1312
  }
1310
1313
  throw err;
1311
- }));
1314
+ });
1312
1315
  };
1313
1316
  const cleanupTask = task => {
1314
1317
  const destroy = task.$destroy$;
@@ -1348,11 +1351,11 @@
1348
1351
  };
1349
1352
  const _jsxSplit = (type, varProps, constProps, children, flags, key, dev) => {
1350
1353
  let sortedProps;
1351
- return sortedProps = varProps ? Object.fromEntries(untrack((() => Object.entries(varProps))).filter((entry => {
1354
+ return sortedProps = varProps ? Object.fromEntries(untrack(() => Object.entries(varProps)).filter(entry => {
1352
1355
  const attr = entry[0];
1353
1356
  return "children" === attr ? (children ??= entry[1], !1) : "key" === attr ? (key = entry[1],
1354
1357
  !1) : !constProps || !(attr in constProps) || /^on[A-Z].*\$$/.test(attr);
1355
- })).sort((([a], [b]) => a < b ? -1 : 1))) : "string" == typeof type ? EMPTY_OBJ : {},
1358
+ }).sort(([a], [b]) => a < b ? -1 : 1)) : "string" == typeof type ? EMPTY_OBJ : {},
1356
1359
  constProps && "children" in constProps && (children = constProps.children, constProps.children = void 0),
1357
1360
  _jsxSorted(type, sortedProps, constProps, children, flags, key, dev);
1358
1361
  };
@@ -1472,7 +1475,7 @@
1472
1475
  };
1473
1476
  const mapArray_set = (array, key, value, start) => {
1474
1477
  const indx = mapApp_findIndx(array, key, start);
1475
- indx >= 0 ? null == value ? array.splice(indx, 2) : array[indx + 1] = value : null != value && array.splice(~indx, 0, key, value);
1478
+ indx >= 0 ? null == value ? array.splice(indx, 2) : array[indx + 1] = value : null != value && array.splice(-1 ^ indx, 0, key, value);
1476
1479
  };
1477
1480
  const mapArray_get = (array, key, start) => {
1478
1481
  const indx = mapApp_findIndx(array, key, start);
@@ -1620,7 +1623,7 @@
1620
1623
  const jsxNode = asyncQueue.shift();
1621
1624
  const vHostNode = asyncQueue.shift();
1622
1625
  if (isPromise(jsxNode)) {
1623
- return jsxNode.then((jsxNode => (diff(jsxNode, vHostNode), drainAsyncQueue())));
1626
+ return jsxNode.then(jsxNode => (diff(jsxNode, vHostNode), drainAsyncQueue()));
1624
1627
  }
1625
1628
  diff(jsxNode, vHostNode);
1626
1629
  }
@@ -1707,7 +1710,7 @@
1707
1710
  }
1708
1711
  function expectProjection() {
1709
1712
  const slotName = jsxValue.key;
1710
- vCurrent = vnode_getProp(vParent, slotName, (id => vnode_locate(container.rootVNode, id))),
1713
+ vCurrent = vnode_getProp(vParent, slotName, id => vnode_locate(container.rootVNode, id)),
1711
1714
  vCurrent = vCurrent && 32 & vCurrent[0] ? null : vCurrent, null == vCurrent && (vNewNode = vnode_newVirtual(),
1712
1715
  build.isDev && vnode_setProp(vNewNode, DEBUG_TYPE, "P"), build.isDev && vnode_setProp(vNewNode, "q:code", "expectProjection"),
1713
1716
  vnode_setProp(vNewNode, QSlot, slotName), vnode_setProp(vNewNode, "q:sparent", vParent),
@@ -1773,43 +1776,43 @@
1773
1776
  htmlEvent && vnode_setAttr(journal, vNewNode, htmlEvent, "");
1774
1777
  }
1775
1778
  needsQDispatchEventPatch = !0;
1776
- } else {
1777
- if ("ref" === key) {
1778
- if (isSignal(value)) {
1779
- value.value = element;
1780
- continue;
1781
- }
1782
- if ("function" == typeof value) {
1783
- value(element);
1784
- continue;
1785
- }
1786
- if (null == value) {
1787
- continue;
1788
- }
1789
- throw qError(15, [ currentFile ]);
1790
- }
1779
+ continue;
1780
+ }
1781
+ if ("ref" === key) {
1791
1782
  if (isSignal(value)) {
1792
- const signalData = new SubscriptionData({
1793
- $scopedStyleIdPrefix$: scopedStyleIdPrefix,
1794
- $isConst$: !0
1795
- });
1796
- value = trackSignalAndAssignHost(value, vNewNode, key, container, signalData);
1783
+ value.value = element;
1784
+ continue;
1797
1785
  }
1798
- if ("dangerouslySetInnerHTML" !== key) {
1799
- if ("textarea" !== elementName || "value" !== key) {
1800
- value = serializeAttribute(key, value, scopedStyleIdPrefix), null != value && element.setAttribute(key, String(value));
1801
- } else {
1802
- if (value && "string" != typeof value) {
1803
- if (build.isDev) {
1804
- throw qError(23, [ currentFile, value ]);
1805
- }
1806
- continue;
1786
+ if ("function" == typeof value) {
1787
+ value(element);
1788
+ continue;
1789
+ }
1790
+ if (null == value) {
1791
+ continue;
1792
+ }
1793
+ throw qError(15, [ currentFile ]);
1794
+ }
1795
+ if (isSignal(value)) {
1796
+ const signalData = new SubscriptionData({
1797
+ $scopedStyleIdPrefix$: scopedStyleIdPrefix,
1798
+ $isConst$: !0
1799
+ });
1800
+ value = trackSignalAndAssignHost(value, vNewNode, key, container, signalData);
1801
+ }
1802
+ if ("dangerouslySetInnerHTML" !== key) {
1803
+ if ("textarea" !== elementName || "value" !== key) {
1804
+ value = serializeAttribute(key, value, scopedStyleIdPrefix), null != value && element.setAttribute(key, String(value));
1805
+ } else {
1806
+ if (value && "string" != typeof value) {
1807
+ if (build.isDev) {
1808
+ throw qError(23, [ currentFile, value ]);
1807
1809
  }
1808
- element.value = escapeHTML(value || "");
1810
+ continue;
1809
1811
  }
1810
- } else {
1811
- element.innerHTML = value, element.setAttribute("q:container", "html");
1812
+ element.value = escapeHTML(value || "");
1812
1813
  }
1814
+ } else {
1815
+ element.innerHTML = value, element.setAttribute("q:container", "html");
1813
1816
  }
1814
1817
  }
1815
1818
  }
@@ -1906,12 +1909,12 @@
1906
1909
  const eventProp = ":" + scope.substring(1) + ":" + eventName;
1907
1910
  const qrls = [ vnode_getProp(vNode, eventProp, null), vnode_getProp(vNode, HANDLER_PREFIX + eventProp, null) ];
1908
1911
  let returnValue = !1;
1909
- return qrls.flat(2).forEach((qrl => {
1912
+ return qrls.flat(2).forEach(qrl => {
1910
1913
  if (qrl) {
1911
1914
  const value = container.$scheduler$(2, vNode, qrl, [ event, element ]);
1912
1915
  returnValue = returnValue || !0 === value;
1913
1916
  }
1914
- })), returnValue;
1917
+ }), returnValue;
1915
1918
  }));
1916
1919
  }
1917
1920
  function registerQwikLoaderEvent(eventName) {
@@ -1963,8 +1966,8 @@
1963
1966
  host = vNewNode, shouldRender = !0) : (vNewNode = retrieveChildWithKey(null, lookupKey),
1964
1967
  vNewNode ? vnode_insertBefore(journal, vParent, vNewNode, vCurrent) : (insertNewComponent(host, componentQRL, jsxProps),
1965
1968
  shouldRender = !0), host = vNewNode), host) {
1966
- const vNodeProps = vnode_getProp(host, "q:props", container.$getObjectById$);
1967
- shouldRender = shouldRender || function(src, dst) {
1969
+ let vNodeProps = vnode_getProp(host, "q:props", container.$getObjectById$);
1970
+ const propsAreDifferent = function(src, dst) {
1968
1971
  const srcEmpty = isPropsEmpty(src);
1969
1972
  const dstEmpty = isPropsEmpty(dst);
1970
1973
  if (srcEmpty && dstEmpty) {
@@ -1987,7 +1990,11 @@
1987
1990
  }
1988
1991
  }
1989
1992
  return !1;
1990
- }(jsxProps, vNodeProps), shouldRender && (host[0] &= -33, container.$scheduler$(6, host, componentQRL, jsxProps));
1993
+ }(jsxProps, vNodeProps);
1994
+ shouldRender = shouldRender || propsAreDifferent, shouldRender && (propsAreDifferent && (vNodeProps ? (vNodeProps[_CONST_PROPS] = jsxProps[_CONST_PROPS],
1995
+ vNodeProps[_VAR_PROPS] = jsxProps[_VAR_PROPS]) : jsxProps && (vnode_setProp(host, "q:props", jsxProps),
1996
+ vNodeProps = jsxProps)), vnode_setProp(host, "q:renderFn", componentQRL), host[0] &= -33,
1997
+ container.$scheduler$(6, host, componentQRL, vNodeProps));
1991
1998
  }
1992
1999
  !function(children, host) {
1993
2000
  const projectionChildren = Array.isArray(children) ? children : [ children ];
@@ -2195,11 +2202,11 @@
2195
2202
  task.$flags$ &= -9, cleanupTask(task);
2196
2203
  const iCtx = newInvokeContext(container.$locale$, host, void 0, "qResource");
2197
2204
  iCtx.$container$ = container;
2198
- const taskFn = task.$qrl$.getFn(iCtx, (() => clearAllEffects(container, task)));
2205
+ const taskFn = task.$qrl$.getFn(iCtx, () => clearAllEffects(container, task));
2199
2206
  const resource = task.$state$;
2200
2207
  assertDefined();
2201
2208
  const track = trackFn(task, container);
2202
- const [cleanup, cleanups] = cleanupFn(task, (reason => container.handleError(reason, host)));
2209
+ const [cleanup, cleanups] = cleanupFn(task, reason => container.handleError(reason, host));
2203
2210
  const resourceTarget = unwrapStore(resource);
2204
2211
  const opts = {
2205
2212
  track,
@@ -2217,38 +2224,38 @@
2217
2224
  resource.loading = !1, resource._state = "resolved", resource._resolved = value,
2218
2225
  resource._error = void 0, resolve(value)) : (done = !0, resource.loading = !1, resource._state = "rejected",
2219
2226
  resource._error = value, reject(value)), !0);
2220
- cleanups.push((() => {
2221
- if (!0 === untrack((() => resource.loading))) {
2222
- const value = untrack((() => resource._resolved));
2227
+ cleanups.push(() => {
2228
+ if (!0 === untrack(() => resource.loading)) {
2229
+ const value = untrack(() => resource._resolved);
2223
2230
  setState(!0, value);
2224
2231
  }
2225
- })), invoke(iCtx, (() => {
2232
+ }), invoke(iCtx, () => {
2226
2233
  resource._state = "pending", resource.loading = !isServerPlatform();
2227
- (resource.value = new Promise(((r, re) => {
2234
+ (resource.value = new Promise((r, re) => {
2228
2235
  resolve = r, reject = re;
2229
- }))).catch(ignoreErrorToPreventNodeFromCrashing);
2230
- }));
2231
- const promise = safeCall((() => Promise.resolve(taskFn(opts))), (value => {
2236
+ })).catch(ignoreErrorToPreventNodeFromCrashing);
2237
+ });
2238
+ const promise = safeCall(() => Promise.resolve(taskFn(opts)), value => {
2232
2239
  setState(!0, value);
2233
- }), (err => {
2240
+ }, err => {
2234
2241
  if (isPromise(err)) {
2235
- return err.then((() => runResource(task, container, host)));
2242
+ return err.then(() => runResource(task, container, host));
2236
2243
  }
2237
2244
  setState(!1, err);
2238
- }));
2245
+ });
2239
2246
  const timeout = resourceTarget._timeout;
2240
- return timeout > 0 ? Promise.race([ promise, delay(timeout).then((() => {
2247
+ return timeout > 0 ? Promise.race([ promise, delay(timeout).then(() => {
2241
2248
  setState(!1, new Error("timeout")) && cleanupTask(task);
2242
- })) ]) : promise;
2249
+ }) ]) : promise;
2243
2250
  };
2244
2251
  const ignoreErrorToPreventNodeFromCrashing = () => {};
2245
2252
  const aVNodePath = [];
2246
2253
  const bVNodePath = [];
2247
2254
  const aSsrNodePath = [];
2248
2255
  const bSsrNodePath = [];
2249
- const getPromise = chore => chore.$promise$ ||= new Promise((resolve => {
2256
+ const getPromise = chore => chore.$promise$ ||= new Promise(resolve => {
2250
2257
  chore.$resolve$ = resolve;
2251
- }));
2258
+ });
2252
2259
  const createScheduler = (container, scheduleDrain, journalFlush) => {
2253
2260
  const choreQueue = [];
2254
2261
  const qrlRuns = [];
@@ -2297,11 +2304,11 @@
2297
2304
  return sortedArray.splice(~idx, 0, value), value;
2298
2305
  }
2299
2306
  const existing = sortedArray[idx];
2300
- 4 === existing.$type$ && (existing.$payload$ = value.$payload$);
2307
+ existing.$payload$ !== value.$payload$ && (existing.$payload$ = value.$payload$);
2301
2308
  existing.$executed$ && (existing.$executed$ = !1);
2302
2309
  return existing;
2303
2310
  }(choreQueue, chore, container.rootVNode || null), !drainScheduled && runLater && (drainScheduled = !0,
2304
- schedule(16), scheduleDrain()?.catch?.((() => {})));
2311
+ schedule(16), scheduleDrain()?.catch?.(() => {}));
2305
2312
  return runLater ? getPromise(chore) : drainUpTo(chore, isServer);
2306
2313
  };
2307
2314
  function drainUpTo(runUptoChore, isServer) {
@@ -2311,9 +2318,9 @@
2311
2318
  throw new Error("drainUpTo: max retries reached");
2312
2319
  }
2313
2320
  if (currentChore) {
2314
- return getPromise(currentChore).then((() => drainUpTo(runUptoChore, isServer))).catch((e => {
2321
+ return getPromise(currentChore).then(() => drainUpTo(runUptoChore, isServer)).catch(e => {
2315
2322
  container.handleError(e, currentChore?.$host$);
2316
- }));
2323
+ });
2317
2324
  }
2318
2325
  const nextChore = choreQueue[0];
2319
2326
  if (nextChore.$executed$) {
@@ -2321,10 +2328,9 @@
2321
2328
  break;
2322
2329
  }
2323
2330
  } else {
2324
- (chore = nextChore).$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0] && 48 !== nextChore.$type$ ? choreQueue.shift() : executeChore(nextChore, isServer);
2331
+ vNodeAlreadyDeleted(nextChore) && 48 !== nextChore.$type$ ? choreQueue.shift() : executeChore(nextChore, isServer);
2325
2332
  }
2326
2333
  }
2327
- var chore;
2328
2334
  return runUptoChore.$returnValue$;
2329
2335
  }
2330
2336
  function executeChore(chore, isServer) {
@@ -2342,27 +2348,27 @@
2342
2348
  break;
2343
2349
 
2344
2350
  case 6:
2345
- returnValue = safeCall((() => executeComponent(container, host, host, chore.$target$, chore.$payload$)), (jsx => {
2351
+ returnValue = safeCall(() => executeComponent(container, host, host, chore.$target$, chore.$payload$), jsx => {
2346
2352
  if (isServer) {
2347
2353
  return jsx;
2348
2354
  }
2349
2355
  {
2350
2356
  const styleScopedId = container.getHostProp(host, "q:sstyle");
2351
- return retryOnPromise((() => vnode_diff(container, jsx, host, addComponentStylePrefix(styleScopedId))));
2357
+ return retryOnPromise(() => vnode_diff(container, jsx, host, addComponentStylePrefix(styleScopedId)));
2352
2358
  }
2353
- }), (err => container.handleError(err, host)));
2359
+ }, err => container.handleError(err, host));
2354
2360
  break;
2355
2361
 
2356
2362
  case 2:
2357
2363
  {
2358
2364
  const fn = chore.$target$.getFn();
2359
- const result = retryOnPromise((() => fn(...chore.$payload$)));
2365
+ const result = retryOnPromise(() => fn(...chore.$payload$));
2360
2366
  if (isPromise(result)) {
2361
- const handled = result.finally((() => {
2367
+ const handled = result.finally(() => {
2362
2368
  qrlRuns.splice(qrlRuns.indexOf(handled), 1);
2363
- })).catch((error => {
2369
+ }).catch(error => {
2364
2370
  container.handleError(error, chore.$host$);
2365
- }));
2371
+ });
2366
2372
  return qrlRuns.push(handled), chore.$returnValue$ = handled, chore.$resolve$?.(handled),
2367
2373
  currentChore = null, void (chore.$executed$ = !0);
2368
2374
  }
@@ -2391,7 +2397,7 @@
2391
2397
  {
2392
2398
  const parentVirtualNode = chore.$target$;
2393
2399
  let jsx = chore.$payload$;
2394
- isSignal(jsx) && (jsx = jsx.value), returnValue = retryOnPromise((() => vnode_diff(container, jsx, parentVirtualNode, null)));
2400
+ isSignal(jsx) && (jsx = jsx.value), returnValue = retryOnPromise(() => vnode_diff(container, jsx, parentVirtualNode, null));
2395
2401
  }
2396
2402
  break;
2397
2403
 
@@ -2424,18 +2430,19 @@
2424
2430
  {
2425
2431
  const target = chore.$target$;
2426
2432
  const effects = chore.$payload$;
2427
- if (target instanceof ComputedSignalImpl || target instanceof WrappedSignalImpl) {
2433
+ const ctx = newInvokeContext();
2434
+ if (ctx.$container$ = container, target instanceof ComputedSignalImpl || target instanceof WrappedSignalImpl) {
2428
2435
  const forceRunEffects = target.$forceRunEffects$;
2429
- if (target.$forceRunEffects$ = !1, !target.$effects$?.size) {
2436
+ if (target.$forceRunEffects$ = !1, !effects?.size) {
2430
2437
  break;
2431
2438
  }
2432
- returnValue = retryOnPromise((() => {
2433
- (target.$computeIfNeeded$() || forceRunEffects) && triggerEffects(container, target, effects);
2434
- }));
2439
+ returnValue = maybeThen(retryOnPromise(() => invoke.call(target, ctx, target.$computeIfNeeded$)), didChange => {
2440
+ if (didChange || forceRunEffects) {
2441
+ return retryOnPromise(() => triggerEffects(container, target, effects));
2442
+ }
2443
+ });
2435
2444
  } else {
2436
- returnValue = retryOnPromise((() => {
2437
- triggerEffects(container, target, effects);
2438
- }));
2445
+ returnValue = retryOnPromise(() => triggerEffects(container, target, effects));
2439
2446
  }
2440
2447
  }
2441
2448
  }
@@ -2446,7 +2453,7 @@
2446
2453
  currentChore = null, chore.$executed$ = !0, error ? container.handleError(error, host) : (chore.$returnValue$ = value,
2447
2454
  chore.$resolve$?.(value));
2448
2455
  };
2449
- isPromise(returnValue) ? (chore.$promise$ = returnValue.then(after, (error => after(void 0, error))),
2456
+ isPromise(returnValue) ? (chore.$promise$ = returnValue.then(after, error => after(void 0, error)),
2450
2457
  chore.$resolve$?.(chore.$promise$), chore.$resolve$ = void 0) : after(returnValue);
2451
2458
  }
2452
2459
  function choreComparator(a, b, rootVNode) {
@@ -2465,10 +2472,10 @@
2465
2472
  let aDepth = -1;
2466
2473
  let bDepth = -1;
2467
2474
  for (;a; ) {
2468
- a = (aVNodePath[++aDepth] = a)[1] || rootVNode && vnode_getProp(a, "q:sparent", (id => vnode_locate(rootVNode, id)));
2475
+ a = (aVNodePath[++aDepth] = a)[1] || rootVNode && vnode_getProp(a, "q:sparent", id => vnode_locate(rootVNode, id));
2469
2476
  }
2470
2477
  for (;b; ) {
2471
- b = (bVNodePath[++bDepth] = b)[1] || rootVNode && vnode_getProp(b, "q:sparent", (id => vnode_locate(rootVNode, id)));
2478
+ b = (bVNodePath[++bDepth] = b)[1] || rootVNode && vnode_getProp(b, "q:sparent", id => vnode_locate(rootVNode, id));
2472
2479
  }
2473
2480
  for (;aDepth >= 0 && bDepth >= 0; ) {
2474
2481
  if ((a = aVNodePath[aDepth]) !== (b = bVNodePath[bDepth])) {
@@ -2484,7 +2491,7 @@
2484
2491
  return -1;
2485
2492
  }
2486
2493
  } while (cursor);
2487
- return rootVNode && vnode_getProp(b, "q:sparent", (id => vnode_locate(rootVNode, id))) ? -1 : 1;
2494
+ return rootVNode && vnode_getProp(b, "q:sparent", id => vnode_locate(rootVNode, id)) ? -1 : 1;
2488
2495
  }
2489
2496
  aDepth--, bDepth--;
2490
2497
  }
@@ -2527,10 +2534,13 @@
2527
2534
  return microTypeDiff;
2528
2535
  }
2529
2536
  const idxDiff = toNumber(a.$idx$) - toNumber(b.$idx$);
2530
- return 0 !== idxDiff ? idxDiff : a.$target$ !== b.$target$ || a.$payload$ !== b.$payload$ || b === currentChore ? 1 : 0;
2537
+ return 0 !== idxDiff ? idxDiff : a.$target$ !== b.$target$ ? isQrl(a.$target$) && isQrl(b.$target$) && a.$target$.$hash$ === b.$target$.$hash$ ? 0 : 1 : b === currentChore ? 1 : 0;
2531
2538
  }
2532
2539
  };
2533
2540
  const toNumber = value => "number" == typeof value ? value : -1;
2541
+ function vNodeAlreadyDeleted(chore) {
2542
+ return !!(chore.$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0]);
2543
+ }
2534
2544
  class _SharedContainer {
2535
2545
  $version$;
2536
2546
  $scheduler$;
@@ -2590,7 +2600,7 @@
2590
2600
  $styleIds$=null;
2591
2601
  $renderCount$=0;
2592
2602
  constructor(element) {
2593
- if (super((() => this.scheduleRender()), (() => vnode_applyJournal(this.$journal$)), {}, element.getAttribute("q:locale")),
2603
+ if (super(() => this.scheduleRender(), () => vnode_applyJournal(this.$journal$), {}, element.getAttribute("q:locale")),
2594
2604
  this.qContainer = element.getAttribute("q:container"), !this.qContainer) {
2595
2605
  throw qError(25);
2596
2606
  }
@@ -2614,14 +2624,14 @@
2614
2624
  };
2615
2625
  })(prototype, "nodeType");
2616
2626
  const attachVnodeDataAndRefs = element => {
2617
- Array.from(element.querySelectorAll('script[type="qwik/vnode"]')).forEach((script => {
2627
+ Array.from(element.querySelectorAll('script[type="qwik/vnode"]')).forEach(script => {
2618
2628
  script.setAttribute("type", "x-qwik/vnode");
2619
2629
  const qContainerElement = script.closest("[q\\:container]");
2620
2630
  qContainerElement.qVnodeData = script.textContent, qContainerElement.qVNodeRefs = new Map;
2621
- })), element.querySelectorAll("[q\\:shadowroot]").forEach((parent => {
2631
+ }), element.querySelectorAll("[q\\:shadowroot]").forEach(parent => {
2622
2632
  const shadowRoot = parent.shadowRoot;
2623
2633
  shadowRoot && attachVnodeDataAndRefs(shadowRoot);
2624
- }));
2634
+ });
2625
2635
  };
2626
2636
  attachVnodeDataAndRefs(document);
2627
2637
  const getFastNodeType = node => {
@@ -2821,22 +2831,22 @@
2821
2831
  return vnode_getProp(vNode, name, getObjectById);
2822
2832
  }
2823
2833
  scheduleRender() {
2824
- return this.$renderCount$++, this.renderDone ||= getPlatform().nextTick((() => this.processChores())),
2825
- this.renderDone.finally((() => emitEvent("qrender", {
2834
+ return this.$renderCount$++, this.renderDone ||= getPlatform().nextTick(() => this.processChores()),
2835
+ this.renderDone.finally(() => emitEvent("qrender", {
2826
2836
  instanceHash: this.$instanceHash$,
2827
2837
  renderCount: this.$renderCount$
2828
- })));
2838
+ }));
2829
2839
  }
2830
2840
  processChores() {
2831
2841
  let renderCount = this.$renderCount$;
2832
2842
  const result = this.$scheduler$(255);
2833
2843
  if (isPromise(result)) {
2834
- return result.then((async () => {
2844
+ return result.then(async () => {
2835
2845
  for (;renderCount !== this.$renderCount$; ) {
2836
2846
  renderCount = this.$renderCount$, await this.$scheduler$(255);
2837
2847
  }
2838
2848
  this.renderDone = null;
2839
- }));
2849
+ });
2840
2850
  }
2841
2851
  renderCount === this.$renderCount$ ? this.renderDone = null : this.processChores();
2842
2852
  }
@@ -2867,9 +2877,9 @@
2867
2877
  return Array.from(scopedStyleIds).join(" ");
2868
2878
  }(scopedStyleIds));
2869
2879
  }
2870
- if (null == this.$styleIds$ && (this.$styleIds$ = new Set, this.element.querySelectorAll("style[q\\:style]").forEach((style => {
2880
+ if (null == this.$styleIds$ && (this.$styleIds$ = new Set, this.element.querySelectorAll("style[q\\:style]").forEach(style => {
2871
2881
  this.$styleIds$.add(style.getAttribute("q:style"));
2872
- }))), !this.$styleIds$.has(styleId)) {
2882
+ })), !this.$styleIds$.has(styleId)) {
2873
2883
  this.$styleIds$.add(styleId);
2874
2884
  const styleElement = this.document.createElement("style");
2875
2885
  styleElement.setAttribute("q:style", styleId), styleElement.textContent = content,
@@ -3001,7 +3011,7 @@
3001
3011
  }
3002
3012
  return value;
3003
3013
  }
3004
- const pad = (text, prefix) => String(text).split("\n").map(((line, idx) => (idx ? prefix : "") + line)).join("\n");
3014
+ const pad = (text, prefix) => String(text).split("\n").map((line, idx) => (idx ? prefix : "") + line).join("\n");
3005
3015
  const jsxToString = value => {
3006
3016
  if (isJSXNode(value)) {
3007
3017
  let str = "<" + value.type;
@@ -3010,9 +3020,9 @@
3010
3020
  str += " " + key + "=" + qwikDebugToString(val);
3011
3021
  }
3012
3022
  const children = value.children;
3013
- null != children ? (str += ">", Array.isArray(children) ? children.forEach((child => {
3023
+ null != children ? (str += ">", Array.isArray(children) ? children.forEach(child => {
3014
3024
  str += jsxToString(child);
3015
- })) : str += jsxToString(children), str += "</" + value.type + ">") : str += "/>";
3025
+ }) : str += jsxToString(children), str += "</" + value.type + ">") : str += "/>";
3016
3026
  }
3017
3027
  return str;
3018
3028
  }
@@ -3502,16 +3512,13 @@
3502
3512
  let textIdx = 0;
3503
3513
  let combinedText = null;
3504
3514
  let container = null;
3505
- return processVNodeData(vData, ((peek, consumeValue, consume, nextToConsumeIdx) => {
3515
+ return processVNodeData(vData, (peek, consumeValue, consume, getChar, nextToConsumeIdx) => {
3506
3516
  if (isNumber(peek())) {
3507
- for (;!isElement(child); ) {
3517
+ for (;!isElement(child) || isQStyleElement(child); ) {
3508
3518
  if (!(child = fastNextSibling(child))) {
3509
3519
  throw qError(27, [ vData, peek(), nextToConsumeIdx ]);
3510
3520
  }
3511
3521
  }
3512
- for (;isQStyleElement(child); ) {
3513
- child = fastNextSibling(child);
3514
- }
3515
3522
  combinedText = null, previousTextNode = null;
3516
3523
  let value = 0;
3517
3524
  for (;isNumber(peek()); ) {
@@ -3531,7 +3538,9 @@
3531
3538
  } else if (peek() === VNodeDataChar_PROPS) {
3532
3539
  vnode_setAttr(null, vParent, "q:props", consumeValue());
3533
3540
  } else if (peek() === VNodeDataChar_KEY) {
3534
- vnode_setAttr(null, vParent, "q:key", consumeValue());
3541
+ let value;
3542
+ getChar(nextToConsumeIdx + 1) === VNodeDataChar_SEPARATOR ? (consume(), value = decodeURI(consumeValue()),
3543
+ consume()) : value = consumeValue(), vnode_setAttr(null, vParent, "q:key", value);
3535
3544
  } else if (peek() === VNodeDataChar_SEQ) {
3536
3545
  vnode_setAttr(null, vParent, "q:seq", consumeValue());
3537
3546
  } else if (peek() === VNodeDataChar_SEQ_IDX) {
@@ -3555,6 +3564,9 @@
3555
3564
  } else if (peek() === VNodeDataChar_SLOT) {
3556
3565
  vnode_setAttr(null, vParent, QSlot, consumeValue());
3557
3566
  } else {
3567
+ for (;isQStyleElement(child); ) {
3568
+ child = fastNextSibling(child);
3569
+ }
3558
3570
  const textNode = child && 3 === fastNodeType(child) ? child : null;
3559
3571
  null === combinedText && (combinedText = textNode ? textNode.nodeValue : null, textIdx = 0);
3560
3572
  let length = 0;
@@ -3570,7 +3582,7 @@
3570
3582
  assertFalse(vnode_isVirtualVNode(vnode)), vnode;
3571
3583
  })(previousTextNode, textNode, text)), textIdx += length;
3572
3584
  }
3573
- })), vParent[5] = vLast, vFirst;
3585
+ }), vParent[5] = vLast, vFirst;
3574
3586
  }(vNode, vNodeData, element, firstChild);
3575
3587
  }
3576
3588
  return materializeFromDOM(vNode, firstChild);
@@ -3679,7 +3691,7 @@
3679
3691
  }
3680
3692
  if (vParent[5] = vChild || null, vParent[4] = vFirstChild, vData) {
3681
3693
  let container = null;
3682
- processVNodeData(vData, ((peek, consumeValue) => {
3694
+ processVNodeData(vData, (peek, consumeValue) => {
3683
3695
  if (peek() === VNodeDataChar_ID) {
3684
3696
  container || (container = getDomContainer(vParent[6]));
3685
3697
  const id = consumeValue();
@@ -3688,7 +3700,7 @@
3688
3700
  peek() === VNodeDataChar_BACK_REFS ? (container || (container = getDomContainer(vParent[6])),
3689
3701
  setEffectBackRefFromVNodeData(vParent, consumeValue(), container)) : consumeValue();
3690
3702
  }
3691
- }));
3703
+ });
3692
3704
  }
3693
3705
  return vFirstChild;
3694
3706
  };
@@ -3710,7 +3722,8 @@
3710
3722
  let nextToConsumeIdx = 0;
3711
3723
  let ch = 0;
3712
3724
  let peekCh = 0;
3713
- const peek = () => 0 !== peekCh ? peekCh : peekCh = nextToConsumeIdx < vData.length ? vData.charCodeAt(nextToConsumeIdx) : 0;
3725
+ const getChar = idx => idx < vData.length ? vData.charCodeAt(idx) : 0;
3726
+ const peek = () => 0 !== peekCh ? peekCh : peekCh = getChar(nextToConsumeIdx);
3714
3727
  const consume = () => (ch = peek(), peekCh = 0, nextToConsumeIdx++, ch);
3715
3728
  const consumeValue = () => {
3716
3729
  consume();
@@ -3721,7 +3734,7 @@
3721
3734
  return vData.substring(start, nextToConsumeIdx);
3722
3735
  };
3723
3736
  for (;0 !== peek(); ) {
3724
- callback(peek, consumeValue, consume, nextToConsumeIdx);
3737
+ callback(peek, consumeValue, consume, getChar, nextToConsumeIdx);
3725
3738
  }
3726
3739
  };
3727
3740
  const vnode_getNextSibling = vnode => vnode[3];
@@ -3750,7 +3763,7 @@
3750
3763
  journal && journal.push(2, vnode[6], key, value);
3751
3764
  }
3752
3765
  null == value ? props.splice(idx, 2) : props[idx + 1] = value;
3753
- } else if (null != value && (props.splice(~idx, 0, key, value), 1 & type)) {
3766
+ } else if (null != value && (props.splice(-1 ^ idx, 0, key, value), 1 & type)) {
3754
3767
  journal && journal.push(2, vnode[6], key, value);
3755
3768
  }
3756
3769
  }
@@ -3781,7 +3794,7 @@
3781
3794
  ensureElementOrVirtualVNode(vnode);
3782
3795
  const props = vnode_getProps(vnode);
3783
3796
  const idx = mapApp_findIndx(props, key, 0);
3784
- idx >= 0 ? props[idx + 1] = value : null != value && props.splice(~idx, 0, key, value);
3797
+ idx >= 0 ? props[idx + 1] = value : null != value && props.splice(-1 ^ idx, 0, key, value);
3785
3798
  };
3786
3799
  const vnode_getProps = vnode => vnode[(vnode => {
3787
3800
  const type = 7 & vnode[0];
@@ -3813,12 +3826,12 @@
3813
3826
  strings.push(qwikDebugToString(vnode_getText(vnode)));
3814
3827
  } else if (vnode_isVirtualVNode(vnode)) {
3815
3828
  const attrs = [ "[" + String(vnode[0] >>> 8) + "]" ];
3816
- vnode_getAttrKeys(vnode).forEach((key => {
3829
+ vnode_getAttrKeys(vnode).forEach(key => {
3817
3830
  if (key !== DEBUG_TYPE) {
3818
3831
  const value = vnode_getAttr(vnode, key);
3819
3832
  attrs.push(" " + key + "=" + qwikDebugToString(value));
3820
3833
  }
3821
- }));
3834
+ });
3822
3835
  const name = (colorize ? "" : "") + (VirtualTypeName[vnode_getAttr(vnode, DEBUG_TYPE) || "V"] || VirtualTypeName.V) + (colorize ? "" : "");
3823
3836
  strings.push("<" + name + attrs.join("") + ">");
3824
3837
  const child = vnode_getFirstChild(vnode);
@@ -3828,10 +3841,10 @@
3828
3841
  const tag = vnode_getElementName(vnode);
3829
3842
  const attrs = [];
3830
3843
  const keys = vnode_getAttrKeys(vnode);
3831
- keys.forEach((key => {
3844
+ keys.forEach(key => {
3832
3845
  const value = vnode_getAttr(vnode, key);
3833
3846
  attrs.push(" " + key + "=" + qwikDebugToString(value));
3834
- }));
3847
+ });
3835
3848
  const node = vnode_getNode(vnode);
3836
3849
  if (node) {
3837
3850
  const vnodeData = node.ownerDocument.qVNodeData?.get(node);
@@ -3875,7 +3888,7 @@
3875
3888
  let projectionDepth = 1;
3876
3889
  for (;projectionDepth--; ) {
3877
3890
  for (;vHost && (!vnode_isVirtualVNode(vHost) || null === vnode_getProp(vHost, "q:renderFn", null)); ) {
3878
- const qSlotParent = vnode_getProp(vHost, "q:sparent", (id => vnode_locate(rootVNode, id)));
3891
+ const qSlotParent = vnode_getProp(vHost, "q:sparent", id => vnode_locate(rootVNode, id));
3879
3892
  const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
3880
3893
  vProjectionParent && projectionDepth++, vHost = vProjectionParent || vnode_getParent(vHost);
3881
3894
  }
@@ -4246,10 +4259,10 @@
4246
4259
  case 16:
4247
4260
  let resolve;
4248
4261
  let reject;
4249
- const promise = new Promise(((res, rej) => {
4262
+ const promise = new Promise((res, rej) => {
4250
4263
  resolve = res, reject = rej;
4251
- }));
4252
- return resolvers.set(promise, [ resolve, reject ]), promise.catch((() => {})), promise;
4264
+ });
4265
+ return resolvers.set(promise, [ resolve, reject ]), promise.catch(() => {}), promise;
4253
4266
 
4254
4267
  case 19:
4255
4268
  const encodedLength = value.length;
@@ -4285,7 +4298,7 @@
4285
4298
  const captureEnd = qrl.indexOf("]", captureStart);
4286
4299
  const chunk = qrl.slice(0, hashIdx > -1 ? hashIdx : captureStart);
4287
4300
  const symbol = captureStart > -1 ? qrl.slice(hashIdx + 1, captureStart) : qrl.slice(hashIdx + 1);
4288
- const captureIds = captureStart > -1 && captureEnd > -1 ? qrl.slice(captureStart + 1, captureEnd).split(" ").filter((v => v.length)).map((s => parseInt(s, 10))) : null;
4301
+ const captureIds = captureStart > -1 && captureEnd > -1 ? qrl.slice(captureStart + 1, captureEnd).split(" ").filter(v => v.length).map(s => parseInt(s, 10)) : null;
4289
4302
  let qrlRef = null;
4290
4303
  if (chunk === QRL_RUNTIME_CHUNK) {
4291
4304
  const backChannel = globalThis.__qrl_back_channel__;
@@ -4295,7 +4308,7 @@
4295
4308
  }
4296
4309
  function inflateQRL(container, qrl) {
4297
4310
  const captureIds = qrl.$capture$;
4298
- return qrl.$captureRef$ = captureIds ? captureIds.map((id => container.$getObjectById$(id))) : null,
4311
+ return qrl.$captureRef$ = captureIds ? captureIds.map(id => container.$getObjectById$(id)) : null,
4299
4312
  container.element && qrl.$setContainer$(container.element), qrl;
4300
4313
  }
4301
4314
  let isDomRef = () => !1;
@@ -4362,7 +4375,7 @@
4362
4375
  }
4363
4376
  $writer$.write(0 === lastIdx ? s : s.slice(lastIdx));
4364
4377
  } else {
4365
- depth++, outputArray(value, ((valueItem, idx) => {
4378
+ depth++, outputArray(value, (valueItem, idx) => {
4366
4379
  !function(serializationContext, obj, parent, index) {
4367
4380
  const {$wasSeen$, $seen$, $addRoot$} = serializationContext;
4368
4381
  if (!function(obj) {
@@ -4373,7 +4386,7 @@
4373
4386
  const seen = $wasSeen$(obj);
4374
4387
  void 0 === seen ? $seen$(obj, parent, index) : $addRoot$(obj, parent);
4375
4388
  }(serializationContext, valueItem, parent, idx), writeValue(valueItem);
4376
- })), depth--;
4389
+ }), depth--;
4377
4390
  }
4378
4391
  };
4379
4392
  const addPreloadQrl = qrl => {
@@ -4460,7 +4473,7 @@
4460
4473
  return "__brand" in value && "resource" === value.__brand;
4461
4474
  }(value)) {
4462
4475
  serializationContext.$resources$.add(value);
4463
- const forwardRefId = $resolvePromise$(value.value, $addRoot$, ((resolved, resolvedValue) => new PromiseResult(23, resolved, resolvedValue, getStoreHandler(value).$effects$)));
4476
+ const forwardRefId = $resolvePromise$(value.value, $addRoot$, (resolved, resolvedValue) => new PromiseResult(23, resolved, resolvedValue, getStoreHandler(value).$effects$));
4464
4477
  output(1, forwardRefId);
4465
4478
  } else {
4466
4479
  const storeHandler = getStoreHandler(value);
@@ -4484,7 +4497,7 @@
4484
4497
  } else if ("object" == typeof (obj = value) && null !== obj && "function" == typeof obj[SerializerSymbol]) {
4485
4498
  const result = value[SerializerSymbol](value);
4486
4499
  if (isPromise(result)) {
4487
- const forwardRef = $resolvePromise$(result, $addRoot$, ((resolved, resolvedValue) => new PromiseResult(29, resolved, resolvedValue, null, null)));
4500
+ const forwardRef = $resolvePromise$(result, $addRoot$, (resolved, resolvedValue) => new PromiseResult(29, resolved, resolvedValue, null, null));
4488
4501
  output(1, forwardRef);
4489
4502
  } else {
4490
4503
  depth--, writeValue(result), depth++;
@@ -4508,14 +4521,14 @@
4508
4521
  if (value instanceof SerializerSignalImpl) {
4509
4522
  addPreloadQrl(value.$computeQrl$);
4510
4523
  const forwardRefId = $resolvePromise$(function(signal, value) {
4511
- return new Promise((resolve => {
4512
- signal.$computeQrl$.resolve().then((arg => {
4524
+ return new Promise(resolve => {
4525
+ signal.$computeQrl$.resolve().then(arg => {
4513
4526
  let data;
4514
4527
  arg.serialize ? data = arg.serialize(value) : SerializerSymbol in value && (data = value[SerializerSymbol](value)),
4515
4528
  void 0 === data && (data = NEEDS_COMPUTATION), resolve(data);
4516
- }));
4517
- }));
4518
- }(value, value.$untrackedValue$), $addRoot$, ((resolved, resolvedValue) => new PromiseResult(29, resolved, resolvedValue, value.$effects$, value.$computeQrl$)));
4529
+ });
4530
+ });
4531
+ }(value, value.$untrackedValue$), $addRoot$, (resolved, resolvedValue) => new PromiseResult(29, resolved, resolvedValue, value.$effects$, value.$computeQrl$));
4519
4532
  return void output(1, forwardRefId);
4520
4533
  }
4521
4534
  const v = value instanceof ComputedSignalImpl && (1 & value.$flags$ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
@@ -4545,14 +4558,14 @@
4545
4558
  const rootIndex = $addRoot$(value);
4546
4559
  serializationContext.$setProp$(value, "q:id", String(rootIndex)), output(10, value.id);
4547
4560
  const vNodeData = value.vnodeData;
4548
- if (vNodeData && (discoverValuesForVNodeData(vNodeData, (vNodeDataValue => $addRoot$(vNodeDataValue))),
4561
+ if (vNodeData && (discoverValuesForVNodeData(vNodeData, vNodeDataValue => $addRoot$(vNodeDataValue)),
4549
4562
  vNodeData[0] |= 16), value.children) {
4550
4563
  for (const child of value.children) {
4551
4564
  const childVNodeData = child.vnodeData;
4552
4565
  if (childVNodeData) {
4553
4566
  for (const value of childVNodeData) {
4554
4567
  if (isSsrAttrs(value)) {
4555
- const backRefKeyIndex = value.findIndex((v => "q:brefs" === v));
4568
+ const backRefKeyIndex = value.findIndex(v => "q:brefs" === v);
4556
4569
  -1 !== backRefKeyIndex && $addRoot$(value[backRefKeyIndex + 1]);
4557
4570
  }
4558
4571
  }
@@ -4562,9 +4575,9 @@
4562
4575
  }
4563
4576
  } else if ("undefined" != typeof FormData && value instanceof FormData) {
4564
4577
  const array = [];
4565
- value.forEach(((value, key) => {
4578
+ value.forEach((value, key) => {
4566
4579
  array.push(key, "string" == typeof value ? value : value.name);
4567
- })), output(32, array);
4580
+ }), output(32, array);
4568
4581
  } else if (value instanceof URLSearchParams) {
4569
4582
  output(13, value.toString());
4570
4583
  } else if (value instanceof Set) {
@@ -4584,7 +4597,7 @@
4584
4597
  }
4585
4598
  output(22, out);
4586
4599
  } else if (isPromise(value)) {
4587
- const forwardRefId = $resolvePromise$(value, $addRoot$, ((resolved, resolvedValue) => new PromiseResult(16, resolved, resolvedValue)));
4600
+ const forwardRefId = $resolvePromise$(value, $addRoot$, (resolved, resolvedValue) => new PromiseResult(16, resolved, resolvedValue));
4588
4601
  output(1, forwardRefId);
4589
4602
  } else if (value instanceof PromiseResult) {
4590
4603
  if (23 === value.$type$) {
@@ -4618,11 +4631,11 @@
4618
4631
  };
4619
4632
  function $resolvePromise$(promise, $addRoot$, classCreator) {
4620
4633
  const forwardRefId = forwardRefsId++;
4621
- return promise.then((resolvedValue => {
4634
+ return promise.then(resolvedValue => {
4622
4635
  promises.delete(promise), forwardRefs[forwardRefId] = $addRoot$(classCreator(!0, resolvedValue));
4623
- })).catch((err => {
4636
+ }).catch(err => {
4624
4637
  promises.delete(promise), forwardRefs[forwardRefId] = $addRoot$(classCreator(!1, err));
4625
- })), promises.add(promise), forwardRefId;
4638
+ }), promises.add(promise), forwardRefId;
4626
4639
  }
4627
4640
  const outputRoots = async () => {
4628
4641
  $writer$.write("[");
@@ -4641,9 +4654,9 @@
4641
4654
  }
4642
4655
  lastRootsLength = rootsLength, rootsLength = serializationContext.$roots$.length;
4643
4656
  }
4644
- forwardRefs.length && ($writer$.write(","), $writer$.write("2,"), outputArray(forwardRefs, (value => {
4657
+ forwardRefs.length && ($writer$.write(","), $writer$.write("2,"), outputArray(forwardRefs, value => {
4645
4658
  $writer$.write(String(value));
4646
- }))), $writer$.write("]");
4659
+ })), $writer$.write("]");
4647
4660
  };
4648
4661
  await outputRoots();
4649
4662
  }(this);
@@ -4802,6 +4815,7 @@
4802
4815
  container.$state$ = state, element && (container.element = element), container;
4803
4816
  }
4804
4817
  function preprocessState(data, container) {
4818
+ const isRootDeepRef = (type, value) => 0 === type && "string" == typeof value;
4805
4819
  const isForwardRefsMap = type => 2 === type;
4806
4820
  const isPreloadQrlType = type => 21 === type;
4807
4821
  const processRootRef = index => {
@@ -4822,10 +4836,9 @@
4822
4836
  data[index + 1] = object;
4823
4837
  };
4824
4838
  for (let i = 0; i < data.length; i += 2) {
4825
- value = data[i + 1], 0 === data[i] && "string" == typeof value ? processRootRef(i) : isForwardRefsMap(data[i]) ? container.$forwardRefs$ = data[i + 1] : isPreloadQrlType(data[i]) && (container.$initialQRLsIndexes$ ||= [],
4839
+ isRootDeepRef(data[i], data[i + 1]) ? processRootRef(i) : isForwardRefsMap(data[i]) ? container.$forwardRefs$ = data[i + 1] : isPreloadQrlType(data[i]) && (container.$initialQRLsIndexes$ ||= [],
4826
4840
  container.$initialQRLsIndexes$.push(i / 2));
4827
4841
  }
4828
- var value;
4829
4842
  }
4830
4843
  const frameworkType = obj => "object" == typeof obj && null !== obj && (obj instanceof SignalImpl || obj instanceof Task || isJSXNode(obj)) || isQrl(obj);
4831
4844
  const canSerialize = (value, seen = new WeakSet) => {
@@ -4840,7 +4853,7 @@
4840
4853
  const proto = Object.getPrototypeOf(value);
4841
4854
  if (isStore(value) && (value = getStoreTarget(value)), proto == Object.prototype) {
4842
4855
  for (const key in value) {
4843
- if (!canSerialize(untrack((() => value[key])), seen)) {
4856
+ if (!canSerialize(untrack(() => value[key]), seen)) {
4844
4857
  return !1;
4845
4858
  }
4846
4859
  }
@@ -4906,7 +4919,7 @@
4906
4919
  const printRaw = (value, prefix) => {
4907
4920
  let result = vnode_isVNode(value) ? vnode_toString.call(value, 1, "", !0).replaceAll(/\n.*/gm, "") : "function" == typeof value ? String(value) : ((obj, indent) => {
4908
4921
  const seen = new WeakSet;
4909
- return JSON.stringify(obj, ((key, value) => {
4922
+ return JSON.stringify(obj, (key, value) => {
4910
4923
  if ("object" == typeof value && null !== value) {
4911
4924
  if (seen.has(value)) {
4912
4925
  return `[Circular ${value.constructor.name}]`;
@@ -4914,7 +4927,7 @@
4914
4927
  seen.add(value);
4915
4928
  }
4916
4929
  return value;
4917
- }), indent);
4930
+ }, indent);
4918
4931
  })(value, 2);
4919
4932
  return result.length > 500 && (result = result.slice(0, 500) + '"...'), result = result.replace(/\n/g, "\n" + prefix),
4920
4933
  result.includes("\n") ? result = `\n${prefix}${result}` : result;
@@ -4936,7 +4949,7 @@
4936
4949
  value.length > 120 && (value = value.slice(0, 120) + '"...')) : 2 === key ? value = `[\n${prefix} ${value.join(`\n${prefix} `)}\n${prefix}]` : Array.isArray(value) && (value = value.length ? `[\n${dumpState(value, color, `${prefix} `)}\n${prefix}]` : "[]"),
4937
4950
  out.push(`${RED}${typeIdToName(key)}${RESET} ${value}`));
4938
4951
  }
4939
- const result = out.map(((v, i) => `${prefix}${isRoot ? `${i} ` : ""}${v}`)).join("\n");
4952
+ const result = out.map((v, i) => `${prefix}${isRoot ? `${i} ` : ""}${v}`).join("\n");
4940
4953
  if (isRoot) {
4941
4954
  const count = hasRaw ? "" : `(${JSON.stringify(state).length} chars)`;
4942
4955
  return hasRaw = !1, `\n${result}\n${count}`;
@@ -4978,12 +4991,12 @@
4978
4991
  }
4979
4992
  if (isArray(unwrapped)) {
4980
4993
  let expectIndex = 0;
4981
- return unwrapped.forEach(((v, i) => {
4994
+ return unwrapped.forEach((v, i) => {
4982
4995
  if (i !== expectIndex) {
4983
4996
  throw qError(3, [ unwrapped ]);
4984
4997
  }
4985
4998
  _verifySerializable(v, seen, ctx + "[" + i + "]"), expectIndex = i + 1;
4986
- })), value;
4999
+ }), value;
4987
5000
  }
4988
5001
  if (isSerializableObject(unwrapped)) {
4989
5002
  for (const [key, item] of Object.entries(unwrapped)) {
@@ -5018,6 +5031,7 @@
5018
5031
  input);
5019
5032
  const NoSerializeSymbol = Symbol("noSerialize");
5020
5033
  const SerializerSymbol = Symbol("serialize");
5034
+ const resolvedSymbol = Symbol("resolved");
5021
5035
  const createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
5022
5036
  let _containerEl;
5023
5037
  const qrl = async function(...args) {
@@ -5028,12 +5042,12 @@
5028
5042
  function bindFnToContext(currentCtx, beforeFn) {
5029
5043
  const bound = (...args) => {
5030
5044
  if (!qrl.resolved) {
5031
- return retryOnPromise((() => qrl.resolve())).then((fn => {
5045
+ return retryOnPromise(() => qrl.resolve()).then(fn => {
5032
5046
  if (!isFunction(fn)) {
5033
5047
  throw qError(5);
5034
5048
  }
5035
5049
  return bound(...args);
5036
- }));
5050
+ });
5037
5051
  }
5038
5052
  if (beforeFn && !1 === beforeFn()) {
5039
5053
  return;
@@ -5067,7 +5081,8 @@
5067
5081
  return context = newInvokeContext(), context.$qrl$ = qrl, context.$event$ = this,
5068
5082
  invoke.call(this, context, fn, ...args);
5069
5083
  };
5070
- const resolve = async containerEl => {
5084
+ symbolFn && resolvedSymbol in symbolFn && (symbolRef = symbolFn[resolvedSymbol]);
5085
+ const resolve = symbolRef ? async () => symbolRef : async containerEl => {
5071
5086
  if (null !== symbolRef) {
5072
5087
  return symbolRef;
5073
5088
  }
@@ -5081,14 +5096,17 @@
5081
5096
  const start = now();
5082
5097
  const ctx = tryGetInvokeContext();
5083
5098
  if (null !== symbolFn) {
5084
- symbolRef = symbolFn().then((module => qrl.resolved = wrapFn(symbolRef = module[symbol])));
5099
+ symbolRef = symbolFn().then(module => {
5100
+ const resolved = wrapFn(symbolRef = module[symbol]);
5101
+ return symbolFn[resolvedSymbol] = resolved, qrl.resolved = resolved, resolved;
5102
+ });
5085
5103
  } else {
5086
5104
  const imported = getPlatform().importSymbol(_containerEl, chunk, symbol);
5087
- symbolRef = maybeThen(imported, (ref => qrl.resolved = wrapFn(symbolRef = ref)));
5105
+ symbolRef = maybeThen(imported, ref => qrl.resolved = wrapFn(symbolRef = ref));
5088
5106
  }
5089
- return "object" == typeof symbolRef && isPromise(symbolRef) && symbolRef.then((() => emitUsedSymbol(symbol, ctx?.$element$, start)), (err => {
5107
+ return isPromise(symbolRef) && symbolRef.then(() => emitUsedSymbol(symbol, ctx?.$element$, start), err => {
5090
5108
  console.error(`qrl ${symbol} failed to load`, err), symbolRef = null;
5091
- })), symbolRef;
5109
+ }), symbolRef;
5092
5110
  };
5093
5111
  const createOrReuseInvocationContext = invoke => null == invoke ? newInvokeContext() : isArray(invoke) ? newInvokeContextFromTuple(invoke) : invoke;
5094
5112
  const hash = getSymbolHash(symbol);
@@ -5097,7 +5115,6 @@
5097
5115
  getHash: () => hash,
5098
5116
  getCaptured: () => captureRef,
5099
5117
  resolve,
5100
- $resolveLazy$: containerEl => null !== symbolRef ? symbolRef : resolve(containerEl),
5101
5118
  $setContainer$: setContainer,
5102
5119
  $chunk$: chunk,
5103
5120
  $symbol$: symbol,
@@ -5107,7 +5124,7 @@
5107
5124
  $captureRef$: captureRef,
5108
5125
  dev: null,
5109
5126
  resolved: void 0
5110
- }), symbolRef && (symbolRef = maybeThen(symbolRef, (resolved => qrl.resolved = wrapFn(symbolRef = resolved)))),
5127
+ }), symbolRef && (symbolRef = maybeThen(symbolRef, resolved => qrl.resolved = wrapFn(symbolRef = resolved))),
5111
5128
  build.isDev && Object.defineProperty(qrl, "_devOnlySymbolRef", {
5112
5129
  get: () => symbolRef
5113
5130
  }), build.isBrowser && symbol && preloader.p(symbol, .8), qrl;
@@ -5275,7 +5292,7 @@
5275
5292
  const STRINGS_COMMENTS = [ [ ANY, 39, 14 ], [ ANY, 34, 15 ], [ ANY, 47, 16, "*" ] ];
5276
5293
  const STATE_MACHINE = [ [ [ ANY, 42, starSelector ], [ ANY, OPEN_BRACKET, 7 ], [ ANY, COLON, pseudoElement, ":", "before", "after", "first-letter", "first-line" ], [ ANY, COLON, pseudoGlobal, "global" ], [ ANY, COLON, 3, "has", "host-context", "not", "where", "is", "matches", "any" ], [ ANY, COLON, 4 ], [ ANY, IDENT, 1 ], [ ANY, DOT, 1 ], [ ANY, HASH, 1 ], [ ANY, 64, atRuleSelector, "keyframe" ], [ ANY, 64, atRuleBlock, "media", "supports", "container" ], [ ANY, 64, atRuleInert ], [ ANY, 123, 13 ], [ 47, 42, 16 ], [ ANY, 59, EXIT ], [ ANY, 125, EXIT ], [ ANY, CLOSE_PARENTHESIS, EXIT ], ...STRINGS_COMMENTS ], [ [ ANY, NOT_IDENT, EXIT_INSERT_SCOPE ] ], [ [ ANY, NOT_IDENT, EXIT_INSERT_SCOPE ] ], [ [ ANY, 40, rule ], [ ANY, NOT_IDENT, EXIT_INSERT_SCOPE ] ], [ [ ANY, 40, 8 ], [ ANY, NOT_IDENT, EXIT_INSERT_SCOPE ] ], [ [ ANY, 40, rule ], [ ANY, NOT_IDENT, EXIT ] ], [ [ ANY, NOT_IDENT, EXIT ] ], [ [ ANY, 93, EXIT_INSERT_SCOPE ], [ ANY, 39, 14 ], [ ANY, 34, 15 ] ], [ [ ANY, CLOSE_PARENTHESIS, EXIT ], ...STRINGS_COMMENTS ], [ [ ANY, 125, EXIT ], ...STRINGS_COMMENTS ], [ [ ANY, 125, EXIT ], [ WHITESPACE, IDENT, 1 ], [ ANY, COLON, pseudoGlobal, "global" ], [ ANY, 123, 13 ], ...STRINGS_COMMENTS ], [ [ ANY, 123, rule ], [ ANY, 59, EXIT ], ...STRINGS_COMMENTS ], [ [ ANY, 59, EXIT ], [ ANY, 123, 9 ], ...STRINGS_COMMENTS ], [ [ ANY, 125, EXIT ], [ ANY, 123, 13 ], [ ANY, 40, 8 ], ...STRINGS_COMMENTS ], [ [ ANY, 39, EXIT ] ], [ [ ANY, 34, EXIT ] ], [ [ 42, 47, EXIT ] ] ];
5277
5294
  const useStylesQrl = styles => ({
5278
- styleId: _useStyles(styles, (str => str), !1)
5295
+ styleId: _useStyles(styles, str => str, !1)
5279
5296
  });
5280
5297
  const useStyles$ = /*#__PURE__*/ implicit$FirstArg(useStylesQrl);
5281
5298
  const useStylesScopedQrl = styles => ({
@@ -5291,13 +5308,10 @@
5291
5308
  const styleId = (index = i, assertQrl(qStyles = styleQrl), `${hashCode(qStyles.$hash$)}-${index}`);
5292
5309
  var qStyles, index;
5293
5310
  const host = iCtx.$hostElement$;
5294
- set(styleId);
5295
- const value = styleQrl.$resolveLazy$(iCtx.$element$);
5296
- if (isPromise(value)) {
5297
- throw value.then((val => iCtx.$container$.$appendStyle$(transform(val, styleId), styleId, host, scoped))),
5298
- value;
5311
+ if (set(styleId), !styleQrl.resolved) {
5312
+ throw styleQrl.resolve().then(val => iCtx.$container$.$appendStyle$(transform(val, styleId), styleId, host, scoped));
5299
5313
  }
5300
- return iCtx.$container$.$appendStyle$(transform(value, styleId), styleId, host, scoped),
5314
+ return iCtx.$container$.$appendStyle$(transform(styleQrl.resolved, styleId), styleId, host, scoped),
5301
5315
  styleId;
5302
5316
  };
5303
5317
  const useOn = (event, eventQrl) => {
@@ -5317,7 +5331,7 @@
5317
5331
  };
5318
5332
  const _useOn = (eventName, eventQrl) => {
5319
5333
  const {isAdded, addEvent} = useOnEventsSequentialScope();
5320
- isAdded || eventQrl && (Array.isArray(eventName) ? eventName.forEach((event => addEvent(event, eventQrl))) : addEvent(eventName, eventQrl));
5334
+ isAdded || eventQrl && (Array.isArray(eventName) ? eventName.forEach(event => addEvent(event, eventQrl)) : addEvent(eventName, eventQrl));
5321
5335
  };
5322
5336
  const useOnEventsSequentialScope = () => {
5323
5337
  const iCtx = useInvokeContext();
@@ -5364,7 +5378,7 @@
5364
5378
  }
5365
5379
  assertQrl(qrl);
5366
5380
  const task = new Task(1, i, iCtx.$hostElement$, qrl, void 0, null);
5367
- set(task), useRunTask(task, eagerness), isServerPlatform() || (qrl.$resolveLazy$(iCtx.$element$),
5381
+ set(task), useRunTask(task, eagerness), isServerPlatform() || (qrl.resolve(iCtx.$element$),
5368
5382
  iCtx.$container$.$scheduler$(32, task));
5369
5383
  };
5370
5384
  const useRunTask = (task, eagerness) => {
@@ -5376,11 +5390,11 @@
5376
5390
  const useAsyncComputedQrl = qrl => useComputedCommon(qrl, AsyncComputedSignalImpl);
5377
5391
  const useAsyncComputed$ = implicit$FirstArg(useAsyncComputedQrl);
5378
5392
  const PREFETCH_CODE = /*#__PURE__*/ (c => {
5379
- "getRegistrations" in c && c.getRegistrations().then((registrations => {
5380
- registrations.forEach((registration => {
5393
+ "getRegistrations" in c && c.getRegistrations().then(registrations => {
5394
+ registrations.forEach(registration => {
5381
5395
  registration.active && registration.active.scriptURL.endsWith("_URL_") && registration.unregister().catch(console.error);
5382
- }));
5383
- }));
5396
+ });
5397
+ });
5384
5398
  }).toString();
5385
5399
  Object.defineProperty(exports, "isBrowser", {
5386
5400
  enumerable: !0,
@@ -5430,7 +5444,7 @@
5430
5444
  return Promise.resolve(resource._error).then(useBindInvokeContext(props.onRejected));
5431
5445
  }
5432
5446
  {
5433
- const resolvedValue = untrack((() => resource._resolved));
5447
+ const resolvedValue = untrack(() => resource._resolved);
5434
5448
  if (void 0 !== resolvedValue) {
5435
5449
  return Promise.resolve(resolvedValue).then(useBindInvokeContext(props.onResolved));
5436
5450
  }
@@ -5512,7 +5526,7 @@
5512
5526
  }
5513
5527
  return createPropsProxy(varPropsTarget, constPropsTarget);
5514
5528
  }, exports._run = queueQRL, exports._serialize = async function(data) {
5515
- const serializationContext = createSerializationContext(null, null, (() => ""), (() => ""), (() => {}), new WeakMap);
5529
+ const serializationContext = createSerializationContext(null, null, () => "", () => "", () => {}, new WeakMap);
5516
5530
  for (const root of data) {
5517
5531
  serializationContext.$addRoot$(root);
5518
5532
  }
@@ -5555,10 +5569,10 @@
5555
5569
  return qrl.dev = opts, qrl;
5556
5570
  }, exports.isSignal = isSignal, exports.jsx = jsx, exports.jsxDEV = (type, props, key, _isStatic, opts) => {
5557
5571
  const processed = null == key ? null : String(key);
5558
- const children = untrack((() => {
5572
+ const children = untrack(() => {
5559
5573
  const c = props.children;
5560
5574
  return "string" == typeof type && delete props.children, c;
5561
- }));
5575
+ });
5562
5576
  isString(type) && "className" in props && (props.class = props.className, delete props.className);
5563
5577
  const node = new JSXNodeImpl(type, props, null, children, 0, processed);
5564
5578
  return node.dev = {
@@ -5630,10 +5644,10 @@
5630
5644
  exports.useSerializerQrl = useSerializerQrl, exports.useServerData = function(key, defaultValue) {
5631
5645
  const ctx = tryGetInvokeContext();
5632
5646
  return ctx?.$container$?.$serverData$[key] ?? defaultValue;
5633
- }, exports.useSignal = initialState => useConstant((() => {
5647
+ }, exports.useSignal = initialState => useConstant(() => {
5634
5648
  const value = isFunction(initialState) && !isQwikComponent(initialState) ? invoke(void 0, initialState) : initialState;
5635
5649
  return createSignal(value);
5636
- })), exports.useStore = useStore, exports.useStyles$ = useStyles$, exports.useStylesQrl = useStylesQrl,
5650
+ }), exports.useStore = useStore, exports.useStyles$ = useStyles$, exports.useStylesQrl = useStylesQrl,
5637
5651
  exports.useStylesScoped$ = useStylesScoped$, exports.useStylesScopedQrl = useStylesScopedQrl,
5638
5652
  exports.useTask$ = useTask$, exports.useTaskQrl = useTaskQrl, exports.useVisibleTask$ = useVisibleTask$,
5639
5653
  exports.useVisibleTaskQrl = useVisibleTaskQrl, exports.version = version, exports.withLocale = function(locale, fn) {
@@ -5644,4 +5658,4 @@
5644
5658
  _locale = previousLang;
5645
5659
  }
5646
5660
  };
5647
- }));
5661
+ });