marko 6.0.14 → 6.0.16

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.
@@ -35,14 +35,10 @@ export declare function hoist(scopeId: number, id?: string): {
35
35
  };
36
36
  export declare function resumeClosestBranch(scopeId: number): void;
37
37
  export declare function withBranchId<T>(branchId: number, cb: () => T): T;
38
- export declare function resumeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
39
- export declare function resumeSingleNodeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
40
- export declare function resumeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
41
- export declare function resumeSingleNodeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
42
- export declare function resumeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
43
- export declare function resumeSingleNodeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
44
- export declare function resumeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
45
- export declare function resumeSingleNodeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string): void;
38
+ export declare function resumeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
39
+ export declare function resumeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
40
+ export declare function resumeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
41
+ export declare function resumeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1): void;
46
42
  declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
47
43
  export { writeScope };
48
44
  export declare function writeExistingScope(scopeId: number): ScopeInternals;
package/dist/html.d.ts CHANGED
@@ -5,4 +5,4 @@ export { escapeScript, escapeStyle, escapeXML, toString } from "./html/content";
5
5
  export { createContent, dynamicTag, registerContent } from "./html/dynamic-tag";
6
6
  export { forIn, forInBy, forOf, forOfBy, forTo, forToBy } from "./html/for";
7
7
  export { createTemplate } from "./html/template";
8
- export { $global, commentSeparator, ensureScopeWithId, fork, getScopeById, hoist, markResumeNode, nextScopeId, nextTagId, nodeRef, peekNextScopeId, register, resumeClosestBranch, resumeConditional, resumeForIn, resumeForOf, resumeForTo, resumeSingleNodeConditional, resumeSingleNodeForIn, resumeSingleNodeForOf, resumeSingleNodeForTo, serializeGuard, serializeIf, setTagVar, tryContent, write, writeEffect, writeExistingScope, writeScope, writeSubscribe, writeTrailers, } from "./html/writer";
8
+ export { $global, commentSeparator, ensureScopeWithId, fork, getScopeById, hoist, markResumeNode, nextScopeId, nextTagId, nodeRef, peekNextScopeId, register, resumeClosestBranch, resumeConditional, resumeForIn, resumeForOf, resumeForTo, serializeGuard, serializeIf, setTagVar, tryContent, write, writeEffect, writeExistingScope, writeScope, writeSubscribe, writeTrailers, } from "./html/writer";
package/dist/html.js CHANGED
@@ -61,10 +61,6 @@ __export(html_exports, {
61
61
  resumeForIn: () => resumeForIn,
62
62
  resumeForOf: () => resumeForOf,
63
63
  resumeForTo: () => resumeForTo,
64
- resumeSingleNodeConditional: () => resumeSingleNodeConditional,
65
- resumeSingleNodeForIn: () => resumeSingleNodeForIn,
66
- resumeSingleNodeForOf: () => resumeSingleNodeForOf,
67
- resumeSingleNodeForTo: () => resumeSingleNodeForTo,
68
64
  serializeGuard: () => serializeGuard,
69
65
  serializeIf: () => serializeIf,
70
66
  setTagVar: () => setTagVar,
@@ -1172,43 +1168,15 @@ var branchIdKey = Symbol();
1172
1168
  function withBranchId(branchId, cb) {
1173
1169
  return withContext(branchIdKey, branchId, cb);
1174
1170
  }
1175
- function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1176
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0;
1171
+ function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1172
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
1177
1173
  if (resumeBranch) {
1178
1174
  let loopScopes = /* @__PURE__ */ new Map();
1179
1175
  forOf(list, (item, index) => {
1180
1176
  let branchId = peekNextScopeId();
1181
- resumeMarker && $chunk.writeHTML(
1182
- $chunk.boundary.state.mark(
1183
- "[" /* BranchStart */,
1184
- branchId + (index ? " " : "")
1185
- )
1186
- ), withBranchId(branchId, () => {
1187
- cb(item, index), loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
1188
- });
1189
- }), loopScopes.size && writeScope(scopeId, {
1190
- ["m" /* LoopScopeMap */ + accessor]: loopScopes
1191
- });
1192
- } else
1193
- forOf(list, cb);
1194
- writeBranchEnd(
1195
- scopeId,
1196
- accessor,
1197
- resumeMarker,
1198
- parentEndTag,
1199
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1200
- "]" /* BranchEnd */,
1201
- scopeId + " " + accessor
1202
- )
1203
- );
1204
- }
1205
- function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1206
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchIds = "";
1207
- if (resumeBranch) {
1208
- let loopScopes = /* @__PURE__ */ new Map();
1209
- forOf(list, (item, index) => {
1210
- let branchId = peekNextScopeId();
1211
- resumeMarker && (branchIds = " " + branchId + branchIds), withBranchId(branchId, () => {
1177
+ resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : $chunk.writeHTML(
1178
+ state.mark("[" /* BranchStart */, branchId + (index ? " " : ""))
1179
+ )), withBranchId(branchId, () => {
1212
1180
  cb(item, index), loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
1213
1181
  });
1214
1182
  }), loopScopes.size && writeScope(scopeId, {
@@ -1221,21 +1189,21 @@ function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch,
1221
1189
  accessor,
1222
1190
  resumeMarker,
1223
1191
  parentEndTag,
1224
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1192
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1225
1193
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1226
- scopeId + " " + accessor + branchIds
1227
- )
1194
+ scopeId + " " + accessor + singleNodeBranchIds
1195
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1228
1196
  );
1229
1197
  }
1230
- function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1231
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0;
1198
+ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1199
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
1232
1200
  if (resumeBranch) {
1233
1201
  let loopScopes = /* @__PURE__ */ new Map(), sep = "";
1234
1202
  forIn(obj, (key, value) => {
1235
1203
  let branchId = peekNextScopeId();
1236
- resumeMarker && ($chunk.writeHTML(
1237
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
1238
- ), sep = " "), withBranchId(branchId, () => {
1204
+ resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : ($chunk.writeHTML(
1205
+ state.mark("[" /* BranchStart */, branchId + sep)
1206
+ ), sep = " ")), withBranchId(branchId, () => {
1239
1207
  cb(key, value), loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
1240
1208
  });
1241
1209
  }), loopScopes.size && writeScope(scopeId, {
@@ -1248,46 +1216,21 @@ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeM
1248
1216
  accessor,
1249
1217
  resumeMarker,
1250
1218
  parentEndTag,
1251
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1252
- "]" /* BranchEnd */,
1253
- scopeId + " " + accessor
1254
- )
1255
- );
1256
- }
1257
- function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1258
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchIds = "";
1259
- if (resumeBranch) {
1260
- let loopScopes = /* @__PURE__ */ new Map();
1261
- forIn(obj, (key, value) => {
1262
- let branchId = peekNextScopeId();
1263
- resumeMarker && (branchIds = " " + branchId + branchIds), withBranchId(branchId, () => {
1264
- cb(key, value), loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
1265
- });
1266
- }), loopScopes.size && writeScope(scopeId, {
1267
- ["m" /* LoopScopeMap */ + accessor]: loopScopes
1268
- });
1269
- } else
1270
- forIn(obj, cb);
1271
- writeBranchEnd(
1272
- scopeId,
1273
- accessor,
1274
- resumeMarker,
1275
- parentEndTag,
1276
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1219
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1277
1220
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1278
- scopeId + " " + accessor + branchIds
1279
- )
1221
+ scopeId + " " + accessor + singleNodeBranchIds
1222
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1280
1223
  );
1281
1224
  }
1282
- function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1283
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0;
1225
+ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1226
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
1284
1227
  if (resumeBranch) {
1285
1228
  let loopScopes = /* @__PURE__ */ new Map(), sep = "";
1286
1229
  forTo(to, from, step, (i) => {
1287
1230
  let branchId = peekNextScopeId();
1288
- resumeMarker && ($chunk.writeHTML(
1289
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
1290
- ), sep = " "), withBranchId(branchId, () => {
1231
+ resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : ($chunk.writeHTML(
1232
+ state.mark("[" /* BranchStart */, branchId + sep)
1233
+ ), sep = " ")), withBranchId(branchId, () => {
1291
1234
  cb(i), loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
1292
1235
  });
1293
1236
  }), loopScopes.size && writeScope(scopeId, {
@@ -1300,59 +1243,16 @@ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1300
1243
  accessor,
1301
1244
  resumeMarker,
1302
1245
  parentEndTag,
1303
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1304
- "]" /* BranchEnd */,
1305
- scopeId + " " + accessor
1306
- )
1307
- );
1308
- }
1309
- function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1310
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchIds = "";
1311
- if (resumeBranch) {
1312
- let loopScopes = /* @__PURE__ */ new Map();
1313
- forTo(to, from, step, (i) => {
1314
- let branchId = peekNextScopeId();
1315
- resumeMarker && (branchIds = " " + branchId + branchIds), withBranchId(branchId, () => {
1316
- cb(i), loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
1317
- });
1318
- }), loopScopes.size && writeScope(scopeId, {
1319
- ["m" /* LoopScopeMap */ + accessor]: loopScopes
1320
- });
1321
- } else
1322
- forTo(to, from, step, cb);
1323
- writeBranchEnd(
1324
- scopeId,
1325
- accessor,
1326
- resumeMarker,
1327
- parentEndTag,
1328
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1246
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1329
1247
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1330
- scopeId + " " + accessor + branchIds
1331
- )
1332
- );
1333
- }
1334
- function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1335
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = peekNextScopeId();
1336
- resumeMarker && resumeBranch && $chunk.writeHTML(
1337
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
1338
- );
1339
- let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
1340
- resumeBranch && branchIndex !== void 0 && writeScope(scopeId, {
1341
- ["c" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1342
- ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1343
- }), writeBranchEnd(
1344
- scopeId,
1345
- accessor,
1346
- resumeMarker,
1347
- parentEndTag,
1348
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1349
- "]" /* BranchEnd */,
1350
- scopeId + " " + accessor
1351
- )
1248
+ scopeId + " " + accessor + singleNodeBranchIds
1249
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1352
1250
  );
1353
1251
  }
1354
- function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1355
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = peekNextScopeId(), branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1252
+ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1253
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = peekNextScopeId();
1254
+ resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, branchId + ""));
1255
+ let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1356
1256
  shouldWriteBranch && writeScope(scopeId, {
1357
1257
  ["c" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1358
1258
  ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
@@ -1361,10 +1261,10 @@ function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, ser
1361
1261
  accessor,
1362
1262
  resumeMarker,
1363
1263
  parentEndTag,
1364
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1264
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1365
1265
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1366
1266
  scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
1367
- )
1267
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1368
1268
  );
1369
1269
  }
1370
1270
  function writeBranchEnd(scopeId, accessor, resumeMarker, parentEndTag, mark) {
@@ -2267,10 +2167,6 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2267
2167
  resumeForIn,
2268
2168
  resumeForOf,
2269
2169
  resumeForTo,
2270
- resumeSingleNodeConditional,
2271
- resumeSingleNodeForIn,
2272
- resumeSingleNodeForOf,
2273
- resumeSingleNodeForTo,
2274
2170
  serializeGuard,
2275
2171
  serializeIf,
2276
2172
  setTagVar,
package/dist/html.mjs CHANGED
@@ -1090,43 +1090,15 @@ var branchIdKey = Symbol();
1090
1090
  function withBranchId(branchId, cb) {
1091
1091
  return withContext(branchIdKey, branchId, cb);
1092
1092
  }
1093
- function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1094
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0;
1093
+ function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1094
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
1095
1095
  if (resumeBranch) {
1096
1096
  let loopScopes = /* @__PURE__ */ new Map();
1097
1097
  forOf(list, (item, index) => {
1098
1098
  let branchId = peekNextScopeId();
1099
- resumeMarker && $chunk.writeHTML(
1100
- $chunk.boundary.state.mark(
1101
- "[" /* BranchStart */,
1102
- branchId + (index ? " " : "")
1103
- )
1104
- ), withBranchId(branchId, () => {
1105
- cb(item, index), loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
1106
- });
1107
- }), loopScopes.size && writeScope(scopeId, {
1108
- ["m" /* LoopScopeMap */ + accessor]: loopScopes
1109
- });
1110
- } else
1111
- forOf(list, cb);
1112
- writeBranchEnd(
1113
- scopeId,
1114
- accessor,
1115
- resumeMarker,
1116
- parentEndTag,
1117
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1118
- "]" /* BranchEnd */,
1119
- scopeId + " " + accessor
1120
- )
1121
- );
1122
- }
1123
- function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1124
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchIds = "";
1125
- if (resumeBranch) {
1126
- let loopScopes = /* @__PURE__ */ new Map();
1127
- forOf(list, (item, index) => {
1128
- let branchId = peekNextScopeId();
1129
- resumeMarker && (branchIds = " " + branchId + branchIds), withBranchId(branchId, () => {
1099
+ resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : $chunk.writeHTML(
1100
+ state.mark("[" /* BranchStart */, branchId + (index ? " " : ""))
1101
+ )), withBranchId(branchId, () => {
1130
1102
  cb(item, index), loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
1131
1103
  });
1132
1104
  }), loopScopes.size && writeScope(scopeId, {
@@ -1139,21 +1111,21 @@ function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch,
1139
1111
  accessor,
1140
1112
  resumeMarker,
1141
1113
  parentEndTag,
1142
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1114
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1143
1115
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1144
- scopeId + " " + accessor + branchIds
1145
- )
1116
+ scopeId + " " + accessor + singleNodeBranchIds
1117
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1146
1118
  );
1147
1119
  }
1148
- function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1149
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0;
1120
+ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1121
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
1150
1122
  if (resumeBranch) {
1151
1123
  let loopScopes = /* @__PURE__ */ new Map(), sep = "";
1152
1124
  forIn(obj, (key, value) => {
1153
1125
  let branchId = peekNextScopeId();
1154
- resumeMarker && ($chunk.writeHTML(
1155
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
1156
- ), sep = " "), withBranchId(branchId, () => {
1126
+ resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : ($chunk.writeHTML(
1127
+ state.mark("[" /* BranchStart */, branchId + sep)
1128
+ ), sep = " ")), withBranchId(branchId, () => {
1157
1129
  cb(key, value), loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
1158
1130
  });
1159
1131
  }), loopScopes.size && writeScope(scopeId, {
@@ -1166,46 +1138,21 @@ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeM
1166
1138
  accessor,
1167
1139
  resumeMarker,
1168
1140
  parentEndTag,
1169
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1170
- "]" /* BranchEnd */,
1171
- scopeId + " " + accessor
1172
- )
1173
- );
1174
- }
1175
- function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1176
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchIds = "";
1177
- if (resumeBranch) {
1178
- let loopScopes = /* @__PURE__ */ new Map();
1179
- forIn(obj, (key, value) => {
1180
- let branchId = peekNextScopeId();
1181
- resumeMarker && (branchIds = " " + branchId + branchIds), withBranchId(branchId, () => {
1182
- cb(key, value), loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
1183
- });
1184
- }), loopScopes.size && writeScope(scopeId, {
1185
- ["m" /* LoopScopeMap */ + accessor]: loopScopes
1186
- });
1187
- } else
1188
- forIn(obj, cb);
1189
- writeBranchEnd(
1190
- scopeId,
1191
- accessor,
1192
- resumeMarker,
1193
- parentEndTag,
1194
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1141
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1195
1142
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1196
- scopeId + " " + accessor + branchIds
1197
- )
1143
+ scopeId + " " + accessor + singleNodeBranchIds
1144
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1198
1145
  );
1199
1146
  }
1200
- function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1201
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0;
1147
+ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1148
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
1202
1149
  if (resumeBranch) {
1203
1150
  let loopScopes = /* @__PURE__ */ new Map(), sep = "";
1204
1151
  forTo(to, from, step, (i) => {
1205
1152
  let branchId = peekNextScopeId();
1206
- resumeMarker && ($chunk.writeHTML(
1207
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
1208
- ), sep = " "), withBranchId(branchId, () => {
1153
+ resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : ($chunk.writeHTML(
1154
+ state.mark("[" /* BranchStart */, branchId + sep)
1155
+ ), sep = " ")), withBranchId(branchId, () => {
1209
1156
  cb(i), loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
1210
1157
  });
1211
1158
  }), loopScopes.size && writeScope(scopeId, {
@@ -1218,59 +1165,16 @@ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
1218
1165
  accessor,
1219
1166
  resumeMarker,
1220
1167
  parentEndTag,
1221
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1222
- "]" /* BranchEnd */,
1223
- scopeId + " " + accessor
1224
- )
1225
- );
1226
- }
1227
- function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1228
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchIds = "";
1229
- if (resumeBranch) {
1230
- let loopScopes = /* @__PURE__ */ new Map();
1231
- forTo(to, from, step, (i) => {
1232
- let branchId = peekNextScopeId();
1233
- resumeMarker && (branchIds = " " + branchId + branchIds), withBranchId(branchId, () => {
1234
- cb(i), loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
1235
- });
1236
- }), loopScopes.size && writeScope(scopeId, {
1237
- ["m" /* LoopScopeMap */ + accessor]: loopScopes
1238
- });
1239
- } else
1240
- forTo(to, from, step, cb);
1241
- writeBranchEnd(
1242
- scopeId,
1243
- accessor,
1244
- resumeMarker,
1245
- parentEndTag,
1246
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1168
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1247
1169
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1248
- scopeId + " " + accessor + branchIds
1249
- )
1250
- );
1251
- }
1252
- function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1253
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = peekNextScopeId();
1254
- resumeMarker && resumeBranch && $chunk.writeHTML(
1255
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
1256
- );
1257
- let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
1258
- resumeBranch && branchIndex !== void 0 && writeScope(scopeId, {
1259
- ["c" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1260
- ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1261
- }), writeBranchEnd(
1262
- scopeId,
1263
- accessor,
1264
- resumeMarker,
1265
- parentEndTag,
1266
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1267
- "]" /* BranchEnd */,
1268
- scopeId + " " + accessor
1269
- )
1170
+ scopeId + " " + accessor + singleNodeBranchIds
1171
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1270
1172
  );
1271
1173
  }
1272
- function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
1273
- let resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = peekNextScopeId(), branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1174
+ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
1175
+ let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = peekNextScopeId();
1176
+ resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, branchId + ""));
1177
+ let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1274
1178
  shouldWriteBranch && writeScope(scopeId, {
1275
1179
  ["c" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1276
1180
  ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
@@ -1279,10 +1183,10 @@ function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, ser
1279
1183
  accessor,
1280
1184
  resumeMarker,
1281
1185
  parentEndTag,
1282
- resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
1186
+ resumeMarker && (!parentEndTag || resumeBranch) && (singleNode ? state.mark(
1283
1187
  parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
1284
1188
  scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
1285
- )
1189
+ ) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
1286
1190
  );
1287
1191
  }
1288
1192
  function writeBranchEnd(scopeId, accessor, resumeMarker, parentEndTag, mark) {
@@ -2184,10 +2088,6 @@ export {
2184
2088
  resumeForIn,
2185
2089
  resumeForOf,
2186
2090
  resumeForTo,
2187
- resumeSingleNodeConditional,
2188
- resumeSingleNodeForIn,
2189
- resumeSingleNodeForOf,
2190
- resumeSingleNodeForTo,
2191
2091
  serializeGuard,
2192
2092
  serializeIf,
2193
2093
  setTagVar,