1
- // size: 17986 (min) 6770 (brotli)
1
+ // size: 18455 (min) 6945 (brotli)
2
2
var empty = [ ] ,
3
3
rest = Symbol ( ) ;
4
4
function attrTag ( attrs2 ) {
@@ -160,15 +160,15 @@ var registeredValues = {},
160
160
else if ( "[" === token )
161
161
this . d &&
162
162
( dataIndex && branchEnd ( this . d , visit , visit ) ,
163
- this . l . push ( this . d ) ) ,
163
+ this . n . push ( this . d ) ) ,
164
164
( this . d = scopeId ) ,
165
165
( scope . a = visit ) ;
166
166
else if ( "]" === token ) {
167
167
scope [ data3 ] = visit ;
168
168
let curParent = visit . parentNode ,
169
169
startNode = branchEnd ( this . d , visit , visit ) . a ;
170
170
curParent !== startNode . parentNode && curParent . prepend ( startNode ) ,
171
- ( this . d = this . l . pop ( ) ) ;
171
+ ( this . d = this . n . pop ( ) ) ;
172
172
} else if ( "|" === token || "=" === token ) {
173
173
let next = data3 . indexOf ( " " ) ,
174
174
curNode = visit ;
@@ -935,15 +935,12 @@ function dynamicClosure(valueAccessor, fn, getIntersection, getOwnerScope) {
935
935
for ( let subscriber of subscribers )
936
936
subscriber . g || queueSource ( subscriber , childSignal ) ;
937
937
} ,
938
- subscribe = ( scope ) => {
939
- let owner = getOwnerScope ? getOwnerScope ( scope ) : scope . _ ,
940
- subscribers = ( owner [ subscribersAccessor ] ||= new Set ( ) ) ;
941
- subscribers . has ( scope ) ||
942
- ( subscribers . add ( scope ) ,
943
- getAbortSignal ( scope , - 1 ) . addEventListener ( "abort" , ( ) =>
944
- subscribers . delete ( scope ) ,
945
- ) ) ;
946
- } ;
938
+ subscribe = ( ownerSignal . I = ( scope ) =>
939
+ subscribeToScopeSet (
940
+ getOwnerScope ? getOwnerScope ( scope ) : scope . _ ,
941
+ subscribersAccessor ,
942
+ scope ,
943
+ ) ) ;
947
944
return (
948
945
( ownerSignal . _ = ( scope ) => {
949
946
childSignal ( scope ) , subscribe ( scope ) ;
@@ -1046,7 +1043,7 @@ function queueSource(scope, signal, value2) {
1046
1043
}
1047
1044
function queueRender ( scope , signal , value2 ) {
1048
1045
let i = pendingRenders . length ,
1049
- render = { s : scope , I : signal , J : value2 , t : scope . c ?. f || 0 , u : i } ;
1046
+ render = { u : scope , J : signal , K : value2 , x : scope . c ?. f || 0 , y : i } ;
1050
1047
for ( pendingRenders . push ( render ) ; i ; ) {
1051
1048
let parentIndex = ( i - 1 ) >> 1 ,
1052
1049
parent = pendingRenders [ parentIndex ] ;
@@ -1112,15 +1109,15 @@ function runRenders() {
1112
1109
}
1113
1110
pendingRenders [ i ] = item ;
1114
1111
}
1115
- render . s . c ?. F || render . I ( render . s , render . J ) ;
1112
+ render . u . c ?. G || render . J ( render . u , render . K ) ;
1116
1113
}
1117
1114
! ( function ( ) {
1118
1115
for ( let scope of pendingScopes ) scope . g = 0 ;
1119
1116
pendingScopes = [ ] ;
1120
1117
} ) ( ) ;
1121
1118
}
1122
1119
function comparePendingRenders ( a , b ) {
1123
- return a . t - b . t || a . u - b . u ;
1120
+ return a . x - b . x || a . y - b . y ;
1124
1121
}
1125
1122
function resetAbortSignal ( scope , id ) {
1126
1123
let ctrl = scope . h ?. [ id ] ;
@@ -1155,9 +1152,11 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
1155
1152
( currentMultiplier = storedMultiplier ) ,
1156
1153
( storedMultiplier = 0 ) ,
1157
1154
32 === value2 )
1158
- )
1159
- scope [ currentScopeIndex ++ ] = walker . currentNode ;
1160
- else if ( 37 === value2 )
1155
+ ) {
1156
+ let node = walker . currentNode ;
1157
+ ( scope [ currentScopeIndex ] = node ) ,
1158
+ ( scope [ currentScopeIndex ++ + ">" ] = ( ) => node ) ;
1159
+ } else if ( 37 === value2 )
1161
1160
walker . currentNode . replaceWith (
1162
1161
( walker . currentNode = scope [ currentScopeIndex ++ ] = new Text ( ) ) ,
1163
1162
) ;
@@ -1188,7 +1187,7 @@ function createBranchScopeWithRenderer(
1188
1187
parentScope ,
1189
1188
parentNode ,
1190
1189
) {
1191
- let branch = createBranch ( $global , renderer . x || parentScope , parentScope ) ;
1190
+ let branch = createBranch ( $global , renderer . j || parentScope , parentScope ) ;
1192
1191
return initBranch ( renderer , branch , parentNode ) , branch ;
1193
1192
}
1194
1193
function createBranchScopeWithTagNameOrRenderer (
@@ -1204,9 +1203,9 @@ function createBranchScopeWithTagNameOrRenderer(
1204
1203
parentScope ,
1205
1204
parentNode ,
1206
1205
) ;
1207
- let branch = createBranch ( $global , parentScope , parentScope ) ;
1208
- return (
1209
- ( branch [ 0 ] =
1206
+ let branch = createBranch ( $global , parentScope , parentScope ) ,
1207
+ node =
1208
+ ( branch [ 0 ] =
1210
1209
branch . a =
1211
1210
branch . b =
1212
1211
document . createElementNS (
@@ -1216,9 +1215,8 @@ function createBranchScopeWithTagNameOrRenderer(
1216
1215
? "http://www.w3.org/1998/Math/MathML"
1217
1216
: parentNode . namespaceURI ,
1218
1217
tagNameOrRenderer ,
1219
- ) ) ,
1220
- branch
1221
- ) ;
1218
+ ) ) ;
1219
+ return ( branch [ "0>" ] = ( ) => node ) , branch ;
1222
1220
}
1223
1221
function createBranch ( $global , ownerScope , parentScope ) {
1224
1222
let branch = createScope ( $global ) ,
@@ -1228,43 +1226,50 @@ function createBranch($global, ownerScope, parentScope) {
1228
1226
( branch . c = branch ) ,
1229
1227
parentBranch
1230
1228
? ( ( branch . f = parentBranch . f + 1 ) ,
1231
- ( branch . q = parentBranch ) ,
1232
- ( parentBranch . j ||= new Set ( ) ) . add ( branch ) )
1229
+ ( branch . t = parentBranch ) ,
1230
+ ( parentBranch . l ||= new Set ( ) ) . add ( branch ) )
1233
1231
: ( branch . f = 1 ) ,
1234
1232
branch
1235
1233
) ;
1236
1234
}
1237
1235
function initBranch ( renderer , branch , parentNode ) {
1238
- let clone = renderer . k ( parentNode . namespaceURI ) ,
1236
+ let clone = renderer . m ( parentNode . namespaceURI ) ,
1239
1237
cloneParent = clone . parentNode ;
1240
1238
cloneParent
1241
- ? ( walk ( cloneParent . firstChild , renderer . y , branch ) ,
1239
+ ? ( walk ( cloneParent . firstChild , renderer . z , branch ) ,
1242
1240
( branch . a = cloneParent . firstChild ) ,
1243
1241
( branch . b = cloneParent . lastChild ) )
1244
- : ( walk ( clone , renderer . y , branch ) , ( branch . a = branch . b = clone ) ) ,
1245
- renderer . z && queueRender ( branch , renderer . z ) ;
1246
- }
1247
- function createRendererWithOwner ( template , rawWalks , setup , getArgs ) {
1242
+ : ( walk ( clone , renderer . z , branch ) , ( branch . a = branch . b = clone ) ) ,
1243
+ renderer . A && queueRender ( branch , renderer . A ) ;
1244
+ }
1245
+ function createRendererWithOwner (
1246
+ template ,
1247
+ rawWalks ,
1248
+ setup ,
1249
+ getArgs ,
1250
+ dynamicScopesAccessor ,
1251
+ ) {
1248
1252
let args ,
1249
1253
id = { } ,
1250
1254
walks = rawWalks ? trimWalkString ( rawWalks ) : " " ;
1251
1255
return ( owner ) => ( {
1252
- A : id ,
1253
- B : template ,
1254
- y : walks ,
1255
- z : setup ,
1256
- k : _clone ,
1257
- x : owner ,
1256
+ B : id ,
1257
+ C : template ,
1258
+ z : walks ,
1259
+ A : setup ,
1260
+ k : dynamicScopesAccessor ,
1261
+ m : _clone ,
1262
+ j : owner ,
1258
1263
get e ( ) {
1259
- return ( args ||= getArgs ?. ( ) ) ;
1264
+ return ( args ||= getArgs ? getArgs ( ) : void 0 ) ;
1260
1265
} ,
1261
1266
} ) ;
1262
1267
}
1263
1268
function createRenderer ( template , walks , setup , getArgs ) {
1264
1269
return createRendererWithOwner ( template , walks , setup , getArgs ) ( ) ;
1265
1270
}
1266
1271
function _clone ( ns ) {
1267
- return ( ( cloneCache [ ns ] ||= { } ) [ this . B ] ||= ( function ( html2 , ns ) {
1272
+ return ( ( cloneCache [ ns ] ||= { } ) [ this . C ] ||= ( function ( html2 , ns ) {
1268
1273
let { firstChild : firstChild , lastChild : lastChild } = parseHTML ( html2 , ns ) ,
1269
1274
parent = document . createElementNS ( ns , "t" ) ;
1270
1275
return (
@@ -1273,7 +1278,7 @@ function _clone(ns) {
1273
1278
? ( ) => firstChild . cloneNode ( ! 0 )
1274
1279
: ( ) => parent . cloneNode ( ! 0 ) . firstChild
1275
1280
) ;
1276
- } ) ( this . B , ns ) ) ( ) ;
1281
+ } ) ( this . C , ns ) ) ( ) ;
1277
1282
}
1278
1283
var cloneCache = { } ;
1279
1284
function conditional ( nodeAccessor , ...branches ) {
@@ -1306,27 +1311,43 @@ var dynamicTag = function (nodeAccessor, getContent, getTagVar, inputIsArgs) {
1306
1311
if ( value2 ) return value2 . content || value2 . default || value2 ;
1307
1312
} ) ( newRendererOrOp ) ;
1308
1313
if (
1309
- ( ( ! ( rendererAccessor in scope ) ||
1314
+ ( ! ( rendererAccessor in scope ) ||
1310
1315
( ( a = scope [ rendererAccessor ] ) !== ( b = newRenderer ) &&
1311
- ( a ?. A || 0 ) !== b ?. A ) ) &&
1312
- ( ( scope [ rendererAccessor ] = newRenderer ) ,
1313
- setConditionalRenderer (
1314
- scope ,
1315
- nodeAccessor ,
1316
- newRenderer || ( getContent ? getContent ( scope ) : void 0 ) ,
1317
- createBranchScopeWithTagNameOrRenderer ,
1318
- ) ,
1319
- getTagVar && setTagVar ( scope , childScopeAccessor , getTagVar ( ) ) ,
1320
- getContent &&
1321
- "string" == typeof newRenderer &&
1316
+ ( a ?. B || 0 ) !== b ?. B ) ) &&
1317
+ ( ( scope [ rendererAccessor ] = newRenderer ) ,
1318
+ setConditionalRenderer (
1319
+ scope ,
1320
+ nodeAccessor ,
1321
+ newRenderer || ( getContent ? getContent ( scope ) : void 0 ) ,
1322
+ createBranchScopeWithTagNameOrRenderer ,
1323
+ ) ,
1324
+ getTagVar && setTagVar ( scope , childScopeAccessor , getTagVar ( ) ) ,
1325
+ newRenderer )
1326
+ )
1327
+ if ( "string" == typeof newRenderer ) {
1328
+ if ( getContent ) {
1329
+ let content = getContent ( scope ) ;
1322
1330
setConditionalRenderer (
1323
1331
scope [ childScopeAccessor ] ,
1324
1332
0 ,
1325
- getContent ( scope ) ,
1333
+ content ,
1326
1334
createBranchScopeWithRenderer ,
1327
- ) ) ,
1328
- newRenderer )
1329
- ) {
1335
+ ) ,
1336
+ content . k &&
1337
+ subscribeToScopeSet (
1338
+ content . j ,
1339
+ content . k ,
1340
+ scope [ childScopeAccessor ] [ "0!" ] ,
1341
+ ) ;
1342
+ }
1343
+ } else
1344
+ newRenderer . k &&
1345
+ subscribeToScopeSet (
1346
+ newRenderer . j ,
1347
+ newRenderer . k ,
1348
+ scope [ childScopeAccessor ] ,
1349
+ ) ;
1350
+ if ( newRenderer ) {
1330
1351
let input = getInput ?. ( ) ;
1331
1352
"string" == typeof newRenderer
1332
1353
? attrs (
@@ -1630,7 +1651,7 @@ var classIdToBranch = new Map(),
1630
1651
: value2 ,
1631
1652
createRenderer ( args , clone ) {
1632
1653
let renderer = createRenderer ( "" , 0 , 0 , ( ) => args ) ;
1633
- return ( renderer . k = clone ) , renderer ;
1654
+ return ( renderer . m = clone ) , renderer ;
1634
1655
} ,
1635
1656
render ( out , component , renderer , args ) {
1636
1657
let branch = component . scope ;
@@ -1651,7 +1672,7 @@ var classIdToBranch = new Map(),
1651
1672
branch
1652
1673
? ( applyArgs ( branch , MARK ) , ( existing = ! 0 ) )
1653
1674
: ( ( branch = component . scope = createScope ( out . global ) ) ,
1654
- ( branch . _ = renderer . x ) ,
1675
+ ( branch . _ = renderer . j ) ,
1655
1676
initBranch ( renderer , branch , document . body ) ) ,
1656
1677
applyArgs ( branch , args ) ;
1657
1678
} ) ) ,
0 commit comments