@solidjs/web 2.0.0-experimental.9 → 2.0.0-rc.1

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.
Files changed (85) hide show
  1. package/README.md +22 -4
  2. package/dist/dev.cjs +1588 -224
  3. package/dist/dev.js +1513 -200
  4. package/dist/server.cjs +2722 -254
  5. package/dist/server.js +2659 -245
  6. package/dist/web.cjs +1524 -218
  7. package/dist/web.js +1449 -194
  8. package/frames/dist/client.cjs +1916 -0
  9. package/frames/dist/client.dev.cjs +1933 -0
  10. package/frames/dist/client.dev.js +1921 -0
  11. package/frames/dist/client.js +1904 -0
  12. package/frames/dist/server.cjs +3756 -0
  13. package/frames/dist/server.js +3743 -0
  14. package/frames/package.json +30 -0
  15. package/package.json +350 -37
  16. package/serialization/decode/package.json +20 -0
  17. package/serialization/dist/decode.cjs +122 -0
  18. package/serialization/dist/decode.js +116 -0
  19. package/serialization/dist/serialization.cjs +244 -0
  20. package/serialization/dist/serialization.js +227 -0
  21. package/serialization/package.json +20 -0
  22. package/serialization/types/index.d.ts +182 -0
  23. package/serialization/types/serializer-decode.d.ts +182 -0
  24. package/serialization/types-cjs/index.d.cts +182 -0
  25. package/serialization/types-cjs/package.json +3 -0
  26. package/serialization/types-cjs/serializer-decode.d.cts +182 -0
  27. package/server-functions/dist/client.cjs +793 -0
  28. package/server-functions/dist/client.js +763 -0
  29. package/server-functions/dist/rich-args.cjs +11 -0
  30. package/server-functions/dist/rich-args.js +9 -0
  31. package/server-functions/dist/server.cjs +1171 -0
  32. package/server-functions/dist/server.dev.cjs +1171 -0
  33. package/server-functions/dist/server.dev.js +1137 -0
  34. package/server-functions/dist/server.js +1137 -0
  35. package/server-functions/package.json +40 -0
  36. package/server-functions/rich-args/package.json +20 -0
  37. package/storage/package.json +8 -3
  38. package/storage/types/index.d.ts +26 -0
  39. package/storage/types-cjs/index.d.cts +28 -0
  40. package/storage/types-cjs/package.json +3 -0
  41. package/types/client.d.ts +290 -27
  42. package/types/cookies.d.ts +93 -0
  43. package/types/core.d.ts +6 -2
  44. package/types/frames/client.d.ts +36 -0
  45. package/types/frames/frame-client.d.ts +338 -0
  46. package/types/frames/frame-sink.d.ts +194 -0
  47. package/types/frames/frame-transport.d.ts +222 -0
  48. package/types/frames/serializer.d.ts +182 -0
  49. package/types/frames/server.d.ts +52 -0
  50. package/types/index.d.ts +223 -24
  51. package/types/jsx-properties.d.ts +93 -0
  52. package/types/jsx.d.ts +4159 -1
  53. package/types/response.d.ts +174 -0
  54. package/types/serializer-decode.d.ts +182 -0
  55. package/types/serializer.d.ts +182 -0
  56. package/types/server-functions/client.d.ts +231 -0
  57. package/types/server-functions/flash.d.ts +38 -0
  58. package/types/server-functions/rich-args.d.ts +10 -0
  59. package/types/server-functions/server.d.ts +616 -0
  60. package/types/server-functions/shared.d.ts +523 -0
  61. package/types/server-mock.d.ts +249 -12
  62. package/types/server.d.ts +424 -51
  63. package/types-cjs/client.d.cts +337 -0
  64. package/types-cjs/cookies.d.cts +93 -0
  65. package/types-cjs/core.d.cts +6 -0
  66. package/types-cjs/frames/client.d.cts +36 -0
  67. package/types-cjs/frames/frame-client.d.cts +338 -0
  68. package/types-cjs/frames/frame-sink.d.cts +194 -0
  69. package/types-cjs/frames/frame-transport.d.cts +222 -0
  70. package/types-cjs/frames/serializer.d.cts +182 -0
  71. package/types-cjs/frames/server.d.cts +52 -0
  72. package/types-cjs/index.d.cts +244 -0
  73. package/types-cjs/jsx-properties.d.cts +93 -0
  74. package/types-cjs/jsx.d.cts +4159 -0
  75. package/types-cjs/package.json +3 -0
  76. package/types-cjs/response.d.cts +174 -0
  77. package/types-cjs/serializer-decode.d.cts +182 -0
  78. package/types-cjs/serializer.d.cts +182 -0
  79. package/types-cjs/server-functions/client.d.cts +231 -0
  80. package/types-cjs/server-functions/flash.d.cts +38 -0
  81. package/types-cjs/server-functions/rich-args.d.cts +10 -0
  82. package/types-cjs/server-functions/server.d.cts +616 -0
  83. package/types-cjs/server-functions/shared.d.cts +523 -0
  84. package/types-cjs/server-mock.d.cts +277 -0
  85. package/types-cjs/server.d.cts +523 -0
package/dist/dev.cjs CHANGED
@@ -2,33 +2,91 @@
2
2
 
3
3
  var solidJs = require('solid-js');
4
4
 
5
- const Properties = /*#__PURE__*/new Set([
6
- "value", "checked", "selected", "muted"]);
5
+ const DOMWithState = {
6
+ INPUT: {
7
+ value: 1,
8
+ defaultValue: 2,
9
+ checked: 1,
10
+ defaultChecked: 2
11
+ },
12
+ SELECT: {
13
+ value: 1
14
+ },
15
+ OPTION: {
16
+ value: 1,
17
+ selected: 1,
18
+ defaultSelected: 2
19
+ },
20
+ TEXTAREA: {
21
+ value: 1,
22
+ defaultValue: 2
23
+ },
24
+ VIDEO: {
25
+ muted: 1,
26
+ defaultMuted: 2
27
+ },
28
+ AUDIO: {
29
+ muted: 1,
30
+ defaultMuted: 2
31
+ }
32
+ };
7
33
  const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
34
+ const $$SLOT = /*#__PURE__*/Symbol("slot");
35
+ const $$HOST = /*#__PURE__*/Symbol("host");
8
36
  const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
9
37
  const SVGElements = /*#__PURE__*/new Set([
10
38
  "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
11
39
  "set", "stop",
12
40
  "svg", "switch", "symbol", "text", "textPath",
13
41
  "tref", "tspan", "use", "view", "vkern"]);
14
- const SVGNamespace = {
42
+ const MathMLElements = /*#__PURE__*/new Set(["annotation", "annotation-xml", "maction", "math", "menclose", "merror", "mfenced", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics"]);
43
+ const Namespaces = {
44
+ svg: "http://www.w3.org/2000/svg",
45
+ mathml: "http://www.w3.org/1998/Math/MathML",
15
46
  xlink: "http://www.w3.org/1999/xlink",
16
47
  xml: "http://www.w3.org/XML/1998/namespace"
17
48
  };
18
- const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input", "h1", "h2", "h3", "h4", "h5", "h6",
19
- "webview",
20
- "isindex", "listing", "multicol", "nextid", "noindex", "search"]);
49
+ const VoidElements = /*#__PURE__*/new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
50
+ const RawTextElements = /*#__PURE__*/new Set(["style", "script", "noscript", "template", "textarea", "title"]);
51
+ const DOMElements = /*#__PURE__*/new Set(/*#__PURE__*/"a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,math,menu,menuitem,meta,meter,multicol,nav,nextid,nobr,noembed,noframes,noindex,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,portal,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,search,section,select,shadow,slot,small,source,spacer,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,webview,xmp".split(","));
21
52
 
22
- const memo = fn => solidJs.createMemo(() => fn());
53
+ const transparentOptions = {
54
+ transparent: true,
55
+ sync: true
56
+ };
57
+ const syncOptions = {
58
+ sync: true
59
+ };
60
+ const effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
61
+ sync: true,
62
+ ...options,
63
+ transparent: !options.scope
64
+ } : transparentOptions);
65
+ const memo = fn => solidJs.createMemo(() => fn(), syncOptions);
66
+ const assetGates = new WeakMap();
67
+ const waitAsset = promise => {
68
+ let gate = assetGates.get(promise);
69
+ if (!gate) {
70
+ solidJs.runWithOwner(null, () => {
71
+ gate = solidJs.createMemo(() => promise);
72
+ });
73
+ assetGates.set(promise, gate);
74
+ }
75
+ gate();
76
+ };
23
77
 
24
- function reconcileArrays(parentNode, a, b) {
78
+ function reconcileArrays(parentNode, a, b, marker) {
25
79
  let bLength = b.length,
26
80
  aEnd = a.length,
27
81
  bEnd = bLength,
28
82
  aStart = 0,
29
83
  bStart = 0,
30
- after = a[aEnd - 1].nextSibling,
31
- map = null;
84
+ tail = a[aEnd - 1],
85
+ tailTag = tail[$$SLOT],
86
+ after = tail.parentNode === parentNode && (!tailTag || tailTag === marker) ? tail.nextSibling : marker || null,
87
+ map = null,
88
+ anchor,
89
+ anchorTag;
32
90
  while (aStart < aEnd || bStart < bEnd) {
33
91
  if (a[aStart] === b[bStart]) {
34
92
  aStart++;
@@ -40,18 +98,43 @@ function reconcileArrays(parentNode, a, b) {
40
98
  bEnd--;
41
99
  }
42
100
  if (aEnd === aStart) {
43
- const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
44
- while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
101
+ let node;
102
+ if (bEnd < bLength) {
103
+ if (bStart) {
104
+ const prev = b[bStart - 1];
105
+ const prevTag = prev[$$SLOT];
106
+ node = prev.parentNode === parentNode && (!prevTag || prevTag === marker) ? prev.nextSibling : after;
107
+ } else node = b[bEnd - bStart];
108
+ } else node = after;
109
+ while (bStart < bEnd) {
110
+ const n = b[bStart++];
111
+ parentNode.insertBefore(n, node);
112
+ if (marker) n[$$SLOT] = marker;
113
+ }
45
114
  } else if (bEnd === bStart) {
46
115
  while (aStart < aEnd) {
47
- if (!map || !map.has(a[aStart])) a[aStart].remove();
48
- aStart++;
116
+ const n = a[aStart++];
117
+ if (!map || !map.has(n)) {
118
+ const tag = n[$$SLOT];
119
+ if (n.parentNode === parentNode && (!tag || tag === marker)) n.remove();
120
+ }
121
+ }
122
+ } else if ((anchor = a[aStart]) === b[bEnd - 1] && b[bStart] === a[aEnd - 1] && anchor.parentNode === parentNode && (!(anchorTag = anchor[$$SLOT]) || anchorTag === marker)) {
123
+ if (marker) {
124
+ do {
125
+ const n = a[--aEnd];
126
+ parentNode.insertBefore(n, anchor);
127
+ n[$$SLOT] = marker;
128
+ bStart++;
129
+ if (aStart >= aEnd - 1 || bStart >= bEnd) break;
130
+ } while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
131
+ } else {
132
+ do {
133
+ parentNode.insertBefore(a[--aEnd], anchor);
134
+ bStart++;
135
+ if (aStart >= aEnd - 1 || bStart >= bEnd) break;
136
+ } while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
49
137
  }
50
- } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
51
- const node = a[--aEnd].nextSibling;
52
- parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
53
- parentNode.insertBefore(b[--bEnd], node);
54
- a[aEnd] = b[bEnd];
55
138
  } else {
56
139
  if (!map) {
57
140
  map = new Map();
@@ -69,78 +152,338 @@ function reconcileArrays(parentNode, a, b) {
69
152
  sequence++;
70
153
  }
71
154
  if (sequence > index - bStart) {
72
- const node = a[aStart];
73
- while (bStart < index) parentNode.insertBefore(b[bStart++], node);
74
- } else parentNode.replaceChild(b[bStart++], a[aStart++]);
155
+ const head = a[aStart];
156
+ const headTag = head[$$SLOT];
157
+ const node = head.parentNode === parentNode && (!headTag || headTag === marker) ? head : after;
158
+ while (bStart < index) {
159
+ const n = b[bStart++];
160
+ parentNode.insertBefore(n, node);
161
+ if (marker) n[$$SLOT] = marker;
162
+ }
163
+ } else {
164
+ const oldNode = a[aStart++];
165
+ const newNode = b[bStart++];
166
+ const oldTag = oldNode[$$SLOT];
167
+ if (oldNode.parentNode === parentNode && (!oldTag || oldTag === marker)) {
168
+ parentNode.replaceChild(newNode, oldNode);
169
+ } else {
170
+ parentNode.insertBefore(newNode, after);
171
+ }
172
+ if (marker) newNode[$$SLOT] = marker;
173
+ }
75
174
  } else aStart++;
76
- } else a[aStart++].remove();
175
+ } else {
176
+ const n = a[aStart++];
177
+ const nTag = n[$$SLOT];
178
+ if (n.parentNode === parentNode && (!nTag || nTag === marker)) n.remove();
179
+ }
77
180
  }
78
181
  }
79
182
  }
80
183
 
81
- const $$EVENTS = "_$DX_DELEGATE";
82
- function render(code, element, init, options = {}) {
184
+ const HEAD_ELIGIBLE_TAGS = new Set(["title", "meta", "link", "style", "script", "base"]);
185
+ const HEAD_ATTR_NAME = /^[a-zA-Z_][a-zA-Z0-9_:.-]*$/;
186
+ const RESOURCE_LINK_RELS = new Set(["preload", "modulepreload", "prefetch", "preconnect", "dns-prefetch", "stylesheet"]);
187
+ const RESOURCE_QUALIFIERS = ["as", "crossorigin", "type", "media", "imagesrcset", "imagesizes"];
188
+ const STYLESHEET_FETCH_META = new Set(["crossorigin", "integrity", "referrerpolicy", "fetchpriority"]);
189
+ function evalHeadValue(v) {
190
+ return typeof v === "function" ? v() : v;
191
+ }
192
+ function evalHeadProps(props, presets) {
193
+ const out = {};
194
+ for (const name in props) out[name] = presets && name in presets ? presets[name] : evalHeadValue(props[name]);
195
+ return out;
196
+ }
197
+ function classifyHeadTag(desc) {
198
+ const tag = desc.tag;
199
+ if (tag === "link") {
200
+ const rel = evalHeadValue(desc.props && desc.props.rel);
201
+ return {
202
+ resource: RESOURCE_LINK_RELS.has(rel),
203
+ rel
204
+ };
205
+ }
206
+ if (tag === "style") return {
207
+ resource: !!(desc.props && "href" in desc.props)
208
+ };
209
+ if (tag === "script") return {
210
+ resource: !!(desc.props && "src" in desc.props)
211
+ };
212
+ return {
213
+ resource: false
214
+ };
215
+ }
216
+ function resourceIdentity(tag, props) {
217
+ let id = "res:" + tag + ":" + (props.rel || "") + ":" + (props.href || props.src || "");
218
+ for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
219
+ const q = RESOURCE_QUALIFIERS[i];
220
+ if (props[q] != null) id += ":" + q + "=" + props[q];
221
+ }
222
+ return id;
223
+ }
224
+ function replaceableIdentity(tag, props, key, unique) {
225
+ if (tag === "title") return "title";
226
+ if (tag === "base") return "base";
227
+ if (tag === "meta" && props.charset != null) return "charset";
228
+ if (key != null) return tag + ":key:" + key;
229
+ if (tag === "meta") {
230
+ for (const ns of ["name", "property", "http-equiv"]) if (props[ns] != null) return "meta:" + ns + ":" + props[ns] + (props.media != null ? ":media=" + props.media : "");
231
+ return unique;
232
+ }
233
+ if (tag === "link") {
234
+ const rel = props.rel || "";
235
+ if (rel === "icon" || rel === "apple-touch-icon") return "link:" + rel + (props.sizes != null ? ":sizes=" + props.sizes : "") + (props.type != null ? ":type=" + props.type : "");
236
+ return "link:" + rel + ":" + (props.href || "");
237
+ }
238
+ return unique;
239
+ }
240
+ function resolveHead(groups) {
241
+ const winners = new Map();
242
+ const sorted = groups.slice().sort((a, b) => a.seq - b.seq);
243
+ for (let i = 0; i < sorted.length; i++) {
244
+ const group = sorted[i];
245
+ const byIdentity = new Map();
246
+ for (let j = 0; j < group.tags.length; j++) {
247
+ const t = group.tags[j];
248
+ let list = byIdentity.get(t.identity);
249
+ if (!list) byIdentity.set(t.identity, list = []);
250
+ list.push(t);
251
+ }
252
+ for (const [identity, tags] of byIdentity) {
253
+ if (identity === "title") {
254
+ if (tags.length > 1) console.warn("Multiple <title> tags in one head group; the last one wins.");
255
+ winners.set(identity, {
256
+ seq: group.seq,
257
+ tags: [tags[tags.length - 1]]
258
+ });
259
+ } else {
260
+ winners.set(identity, {
261
+ seq: group.seq,
262
+ tags
263
+ });
264
+ }
265
+ }
266
+ }
267
+ return winners;
268
+ }
269
+
270
+ function parseCookieHeader(header) {
271
+ const cookies = {};
272
+ if (!header) return cookies;
273
+ for (const part of header.split(";")) {
274
+ const eq = part.indexOf("=");
275
+ if (eq < 0) continue;
276
+ const name = decodeSafe(part.slice(0, eq).trim());
277
+ let value = part.slice(eq + 1).trim();
278
+ if (value.length > 1 && value[0] === '"' && value[value.length - 1] === '"') {
279
+ value = value.slice(1, -1);
280
+ }
281
+ cookies[name] = decodeSafe(value);
282
+ }
283
+ return cookies;
284
+ }
285
+ function decodeSafe(text) {
286
+ try {
287
+ return decodeURIComponent(text);
288
+ } catch {
289
+ return text;
290
+ }
291
+ }
292
+ function serializeCookie(name, value, options = {}) {
293
+ let cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
294
+ cookie += `; Path=${options.path === undefined ? "/" : options.path}`;
295
+ if (options.domain) cookie += `; Domain=${options.domain}`;
296
+ if (options.maxAge !== undefined) cookie += `; Max-Age=${Math.trunc(options.maxAge)}`;
297
+ if (options.expires) cookie += `; Expires=${options.expires.toUTCString()}`;
298
+ if (options.httpOnly) cookie += "; HttpOnly";
299
+ if (options.secure) cookie += "; Secure";
300
+ if (options.sameSite) {
301
+ const sameSite = options.sameSite.toLowerCase();
302
+ cookie += `; SameSite=${sameSite === "none" ? "None" : sameSite === "strict" ? "Strict" : "Lax"}`;
303
+ }
304
+ return cookie;
305
+ }
306
+ const FLASH_COOKIE = "flash";
307
+ const FLASH_MATCHER = new RegExp(`(?:^|;\\s*)${FLASH_COOKIE}=([^;]+)`);
308
+ function hasFlashCookie(cookieHeader) {
309
+ return !!cookieHeader && FLASH_MATCHER.test(cookieHeader);
310
+ }
311
+ function clearFlashCookie() {
312
+ return `${FLASH_COOKIE}=; Max-Age=0; Path=/`;
313
+ }
314
+
315
+ const SERVER_FUNCTION_METADATA = Symbol.for("solid.ServerFunctionMetadata");
316
+ function getServerFunctionMetadata(fn) {
317
+ if (typeof fn !== "function") return undefined;
318
+ return fn[SERVER_FUNCTION_METADATA] || undefined;
319
+ }
320
+ function isServerFunction(fn) {
321
+ return typeof fn === "function" && !!fn[SERVER_FUNCTION_METADATA];
322
+ }
323
+ const SERVER_FUNCTION_RPC = Symbol.for("solid.ServerFunctionRPC");
324
+ function getServerFunctionRPC() {
325
+ return globalThis[SERVER_FUNCTION_RPC];
326
+ }
327
+
328
+ const $$EVENT_OWNER = "_$DX_EVENT_OWNER";
329
+ const INNER_OWNED = {};
330
+ const delegatedEvents = new Set();
331
+ const delegatedContainers = new Map();
332
+ function render$1(code, element, init, options = {}) {
83
333
  if (!element) {
84
334
  throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
85
335
  }
86
336
  let disposer;
87
- solidJs.createRoot(dispose => {
88
- disposer = dispose;
89
- element === document ? solidJs.flatten(code) : insert(element, code(), element.firstChild ? null : undefined, init);
90
- }, {
91
- id: options.renderId
92
- });
337
+ registerDelegatedRoot(element);
338
+ try {
339
+ solidJs.createRoot(dispose => {
340
+ disposer = dispose;
341
+ if (element === document) {
342
+ const tree = code();
343
+ effect(() => solidJs.flatten(tree), () => {});
344
+ } else {
345
+ const tree = code();
346
+ insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
347
+ }
348
+ }, {
349
+ id: options.renderId
350
+ });
351
+ } catch (err) {
352
+ if (disposer) disposer();
353
+ unregisterDelegatedRoot(element);
354
+ throw err;
355
+ }
93
356
  return () => {
94
357
  disposer();
358
+ unregisterDelegatedRoot(element);
95
359
  element.textContent = "";
96
360
  };
97
361
  }
98
- function template(html, isImportNode, isSVG, isMathML) {
362
+ function create(html, bypassGuard, flag) {
363
+ if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
364
+ const t = document.createElement("template");
365
+ t.innerHTML = html;
366
+ return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
367
+ }
368
+ function template(html, flag) {
99
369
  let node;
100
- const create = () => {
101
- if (isHydrating()) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
102
- const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
103
- t.innerHTML = html;
104
- return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
105
- };
106
- return isImportNode ? () => solidJs.untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
370
+ const fn = flag === 1 ? bypassGuard => document.importNode(node || (node = create(html, bypassGuard, flag)), true) : bypassGuard => (node || (node = create(html, bypassGuard, flag))).cloneNode(true);
371
+ fn._html = flag === 2 ? html.replace(/^<[^>]+>/, "") : html;
372
+ return fn;
107
373
  }
108
- function delegateEvents(eventNames, document = window.document) {
109
- const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());
374
+ function delegateEvents(eventNames) {
110
375
  for (let i = 0, l = eventNames.length; i < l; i++) {
111
376
  const name = eventNames[i];
112
- if (!e.has(name)) {
113
- e.add(name);
114
- document.addEventListener(name, eventHandler);
377
+ if (!delegatedEvents.has(name)) {
378
+ delegatedEvents.add(name);
379
+ delegatedContainers.forEach((state, container) => attachDelegatedEvent(name, container, state));
115
380
  }
116
381
  }
117
382
  }
118
- function clearDelegatedEvents(document = window.document) {
119
- if (document[$$EVENTS]) {
120
- for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);
121
- delete document[$$EVENTS];
383
+ function registerDelegatedRoot(root) {
384
+ const state = registerDelegatedContainer(root, root);
385
+ if (state) state.roots = (state.roots || 0) + 1;
386
+ }
387
+ function unregisterDelegatedRoot(root) {
388
+ const state = delegatedContainers.get(root);
389
+ if (state) state.roots > 1 ? state.roots-- : delete state.roots;
390
+ unregisterDelegatedContainer(root, root);
391
+ }
392
+ function registerDelegatedContainer(container, owner = container) {
393
+ if (!container || !owner) return;
394
+ let state = delegatedContainers.get(container);
395
+ if (!state) delegatedContainers.set(container, state = {
396
+ owners: new Map(),
397
+ handlers: new Map()
398
+ });
399
+ state.owners.set(owner, (state.owners.get(owner) || 0) + 1);
400
+ delegatedEvents.forEach(name => attachDelegatedEvent(name, container, state));
401
+ return state;
402
+ }
403
+ function unregisterDelegatedContainer(container, owner = container) {
404
+ const state = delegatedContainers.get(container);
405
+ if (!state) return;
406
+ const count = state.owners.get(owner);
407
+ if (count > 1) state.owners.set(owner, count - 1);else state.owners.delete(owner);
408
+ if (state.owners.size) return;
409
+ state.handlers.forEach((handler, name) => container.removeEventListener(name, handler));
410
+ delegatedContainers.delete(container);
411
+ }
412
+ function attachDelegatedEvent(name, container, state) {
413
+ if (state.handlers.has(name)) return;
414
+ const handler = e => eventHandler(e, container, state);
415
+ state.handlers.set(name, handler);
416
+ container.addEventListener(name, handler);
417
+ }
418
+ function getDelegatedRoot(node) {
419
+ while (node) {
420
+ if (delegatedContainers.get(node)?.roots) return node;
421
+ node = node._$host || node.parentNode || node.host;
422
+ }
423
+ }
424
+ function findOwner(target, state) {
425
+ let node = target;
426
+ let distance = 0;
427
+ while (node) {
428
+ if (state.owners.has(node)) return {
429
+ owner: node,
430
+ distance
431
+ };
432
+ distance++;
433
+ node = node._$host || node.parentNode || node.host;
122
434
  }
123
435
  }
124
436
  function setProperty(node, name, value) {
125
437
  if (isHydrating(node)) return;
126
438
  node[name] = value;
127
439
  }
440
+ let claimHandlers = null;
441
+ const CLAIM_SEAM = Symbol.for("dom-expressions.element-claims");
442
+ function registerElementClaim(handler) {
443
+ (claimHandlers || (claimHandlers = globalThis[CLAIM_SEAM] = [])).push(handler);
444
+ return () => {
445
+ const index = claimHandlers.indexOf(handler);
446
+ index > -1 && claimHandlers.splice(index, 1);
447
+ };
448
+ }
449
+ const CLAIMED_ELEMENTS = "a[href], form[action]";
450
+ function claimElementTree(root) {
451
+ const handlers = globalThis[CLAIM_SEAM];
452
+ if (handlers === undefined || handlers.length === 0) return root;
453
+ const isElement = root.nodeType === 1;
454
+ if (!isElement && root.nodeType !== 11) return root;
455
+ if (isElement && root.matches(CLAIMED_ELEMENTS)) {
456
+ for (let i = 0; i < handlers.length; i++) handlers[i](root);
457
+ }
458
+ const found = root.querySelectorAll(CLAIMED_ELEMENTS);
459
+ for (let i = 0; i < found.length; i++) {
460
+ for (let j = 0; j < handlers.length; j++) handlers[j](found[i]);
461
+ }
462
+ return root;
463
+ }
464
+ function claimElement(node) {
465
+ if (claimHandlers !== null) {
466
+ for (let i = 0; i < claimHandlers.length; i++) claimHandlers[i](node);
467
+ }
468
+ return node;
469
+ }
128
470
  function setAttribute(node, name, value) {
129
471
  if (isHydrating(node)) return;
130
472
  if (value == null || value === false) node.removeAttribute(name);else node.setAttribute(name, value === true ? "" : value);
473
+ if (claimHandlers !== null && (name === "href" || name === "action")) claimElement(node);
131
474
  }
132
475
  function setAttributeNS(node, namespace, name, value) {
133
476
  if (isHydrating(node)) return;
134
- if (value == null) node.removeAttributeNS(namespace, name);else node.setAttributeNS(namespace, name, value);
477
+ if (value == null || value === false) node.removeAttributeNS(namespace, name.indexOf(":") > -1 ? name.split(":").pop() : name);else node.setAttributeNS(namespace, name, value === true ? "" : value);
135
478
  }
136
- function className(node, value, isSVG, prev) {
479
+ function className(node, value, prev) {
137
480
  if (isHydrating(node)) return;
138
481
  if (value == null || value === false) {
139
482
  prev && node.removeAttribute("class");
140
483
  return;
141
484
  }
142
485
  if (typeof value === "string") {
143
- value !== prev && (isSVG ? node.setAttribute("class", value) : node.className = value);
486
+ value !== prev && node.setAttribute("class", value);
144
487
  return;
145
488
  }
146
489
  if (typeof prev === "string") {
@@ -154,16 +497,16 @@ function className(node, value, isSVG, prev) {
154
497
  for (i = 0, len = prevKeys.length; i < len; i++) {
155
498
  const key = prevKeys[i];
156
499
  if (!key || key === "undefined" || value[key]) continue;
157
- toggleClassKey(node, key, false);
500
+ node.classList.remove(key);
158
501
  }
159
502
  for (i = 0, len = classKeys.length; i < len; i++) {
160
503
  const key = classKeys[i],
161
504
  classValue = !!value[key];
162
505
  if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
163
- toggleClassKey(node, key, true);
506
+ node.classList.add(key);
164
507
  }
165
508
  }
166
- function addEventListener(node, name, handler, delegate) {
509
+ function addEvent(node, name, handler, delegate) {
167
510
  if (delegate) {
168
511
  if (Array.isArray(handler)) {
169
512
  node[`$$${name}`] = handler[0];
@@ -176,42 +519,60 @@ function addEventListener(node, name, handler, delegate) {
176
519
  }
177
520
  function style(node, value, prev) {
178
521
  if (!value) {
179
- prev ? setAttribute(node, "style") : value;
522
+ if (prev || node._$styles) {
523
+ setAttribute(node, "style");
524
+ node._$styles = undefined;
525
+ }
180
526
  return;
181
527
  }
182
528
  const nodeStyle = node.style;
183
- if (typeof value === "string") return nodeStyle.cssText = value;
184
- typeof prev === "string" && (nodeStyle.cssText = prev = undefined);
185
- prev || (prev = {});
186
- value || (value = {});
529
+ if (typeof value === "string") {
530
+ node._$styles = undefined;
531
+ return nodeStyle.cssText = value;
532
+ }
533
+ if (typeof prev === "string") {
534
+ nodeStyle.cssText = "";
535
+ prev = undefined;
536
+ }
537
+ let applied = node._$styles;
538
+ if (!applied) {
539
+ applied = node._$styles = prev ? {
540
+ ...prev
541
+ } : {};
542
+ }
187
543
  let v, s;
544
+ for (s in applied) {
545
+ if (value[s] == null) {
546
+ nodeStyle.removeProperty(s);
547
+ delete applied[s];
548
+ }
549
+ }
188
550
  for (s in value) {
189
551
  v = value[s];
190
- if (v !== prev[s]) nodeStyle.setProperty(s, v);
191
- delete prev[s];
552
+ if (v != null && v !== applied[s]) {
553
+ nodeStyle.setProperty(s, v);
554
+ applied[s] = v;
555
+ }
192
556
  }
193
- for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
194
557
  }
195
558
  function setStyleProperty(node, name, value) {
196
559
  value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
197
560
  }
198
- function spread(node, props = {}, isSVG, skipChildren) {
561
+ function spread(node, props = {}, skipChildren) {
199
562
  const prevProps = {};
200
- if (!skipChildren) {
201
- solidJs.createRenderEffect(() => normalize(props.children, prevProps.children), value => {
202
- insertExpression(node, value, prevProps.children);
203
- prevProps.children = value;
204
- });
205
- }
206
- solidJs.createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node), () => {});
207
- solidJs.createRenderEffect(() => {
563
+ if (!skipChildren) insert(node, () => props.children);
564
+ effect(() => {
565
+ const r = props.ref;
566
+ (typeof r === "function" || Array.isArray(r)) && ref(() => r, node);
567
+ }, () => {});
568
+ effect(() => {
208
569
  const newProps = {};
209
570
  for (const prop in props) {
210
571
  if (prop === "children" || prop === "ref") continue;
211
572
  newProps[prop] = props[prop];
212
573
  }
213
574
  return newProps;
214
- }, props => assign(node, props, isSVG, true, prevProps, true));
575
+ }, props => assign(node, props, true, prevProps, true));
215
576
  return prevProps;
216
577
  }
217
578
  function dynamicProperty(props, key) {
@@ -224,48 +585,628 @@ function dynamicProperty(props, key) {
224
585
  });
225
586
  return props;
226
587
  }
227
- function use(fn, element, arg) {
228
- solidJs.untrack(() => fn(element, arg));
588
+ function applyRef(r, element) {
589
+ Array.isArray(r) ? r.flat(Infinity).forEach(f => f && f(element)) : r(element);
229
590
  }
230
- function insert(parent, accessor, marker, initial) {
591
+ function ref(fn, element) {
592
+ const resolved = solidJs.untrack(fn);
593
+ solidJs.runWithOwner(null, () => applyRef(resolved, element));
594
+ }
595
+ function scope(fn) {
596
+ fn.$s = true;
597
+ return fn;
598
+ }
599
+ const SCOPE_OPTIONS = {
600
+ scope: true
601
+ };
602
+ let hydrationRt = null;
603
+ function installHydrationRuntime() {
604
+ hydrationRt = {
605
+ claimInitial(parent, multi, initial) {
606
+ if (isHydrating(parent)) {
607
+ if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
608
+ if (Array.isArray(initial)) stripTextSeparators(initial);
609
+ }
610
+ return initial;
611
+ },
612
+ reclaimRegion(current, parent, marker) {
613
+ if (!solidJs.sharedConfig.hydrating || !current || !parent.isConnected) return current;
614
+ const first = Array.isArray(current) ? current[0] : current;
615
+ if (!first || !first.nodeType || first.isConnected) return current;
616
+ let nodes;
617
+ if (marker) {
618
+ nodes = [];
619
+ let node = marker.previousSibling,
620
+ depth = 0;
621
+ while (node) {
622
+ if (node.nodeType === 8) {
623
+ const v = node.nodeValue;
624
+ if (v === "/") depth++;else if (v === "$") {
625
+ if (depth === 0) break;
626
+ depth--;
627
+ }
628
+ }
629
+ nodes.unshift(node);
630
+ node = node.previousSibling;
631
+ }
632
+ } else nodes = [...parent.childNodes];
633
+ return stripTextSeparators(nodes);
634
+ },
635
+ dedupEvent(e) {
636
+ return !!(solidJs.sharedConfig.registry && solidJs.sharedConfig.events && solidJs.sharedConfig.events.find(([el, ev]) => ev === e));
637
+ }
638
+ };
639
+ }
640
+ function stripTextSeparators(nodes) {
641
+ let j = 0;
642
+ for (let i = 0; i < nodes.length; i++) {
643
+ const node = nodes[i],
644
+ t = node.nodeType;
645
+ if (t === 8) {
646
+ const v = node.nodeValue;
647
+ if (v === "!$") {
648
+ node.remove();
649
+ continue;
650
+ }
651
+ if (v.startsWith("pl-")) continue;
652
+ } else if (t === 1 && node.localName === "template" && node.id.startsWith("pl-")) continue;
653
+ nodes[j++] = node;
654
+ }
655
+ nodes.length = j;
656
+ return nodes;
657
+ }
658
+ function insert(parent, accessor, marker, initial, options) {
231
659
  const multi = marker !== undefined;
660
+ const host = options && options.host;
232
661
  if (multi && !initial) initial = [];
662
+ if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
233
663
  if (typeof accessor !== "function") {
234
664
  accessor = normalize(accessor, initial, multi, true);
235
- if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
665
+ if (typeof accessor !== "function") {
666
+ insertExpression(parent, accessor, initial, marker);
667
+ host && tagHost(accessor, host);
668
+ return;
669
+ }
670
+ }
671
+ if (multi && initial.length === 0) {
672
+ const placeholder = document.createTextNode("");
673
+ parent.insertBefore(placeholder, marker);
674
+ initial = [placeholder];
236
675
  }
237
- solidJs.createRenderEffect(prev => normalize(accessor, prev, multi), (value, current) => insertExpression(parent, value, current, marker), initial);
676
+ let current = initial;
677
+ effect(prev => {
678
+ if (hydrationRt !== null) current = hydrationRt.reclaimRegion(current, parent, marker);
679
+ const value = normalize(accessor(), current, multi, true);
680
+ if (typeof value !== "function") return value;
681
+ effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
682
+ current = insertExpression(parent, inner, current, marker);
683
+ host && tagHost(current, host);
684
+ }, prev !== undefined && !(options && options.schedule) ? {
685
+ ...options,
686
+ schedule: true
687
+ } : options);
688
+ return INNER_OWNED;
689
+ }, value => {
690
+ if (value === INNER_OWNED) return;
691
+ current = insertExpression(parent, value, current, marker);
692
+ host && tagHost(current, host);
693
+ },
694
+ accessor.$s ? options ? {
695
+ ...options,
696
+ scope: true
697
+ } : SCOPE_OPTIONS : options);
238
698
  }
239
- function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
699
+ function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
700
+ const nodeName = node.nodeName;
240
701
  props || (props = {});
241
702
  for (const prop in prevProps) {
242
703
  if (!(prop in props)) {
243
704
  if (prop === "children") continue;
244
- prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
705
+ prevProps[prop] = assignProp(node, prop, null, prevProps[prop], skipRef, nodeName);
245
706
  }
246
707
  }
247
708
  for (const prop in props) {
248
709
  if (prop === "children") {
249
- if (!skipChildren) insertExpression(node, props.children);
710
+ if (!skipChildren) insertExpression(node, normalize(props.children, undefined, false));
711
+ continue;
712
+ }
713
+ prevProps[prop] = assignProp(node, prop, props[prop], prevProps[prop], skipRef, nodeName);
714
+ }
715
+ }
716
+ const ASSET_REMOVAL_GRACE = 100;
717
+ const assetRegistry = new Map();
718
+ function assetEntryKey(descriptor) {
719
+ if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
720
+ return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
721
+ }
722
+ function findAssetElement(selector, attr, value) {
723
+ const nodes = document.querySelectorAll(selector);
724
+ for (let i = 0; i < nodes.length; i++) {
725
+ if (nodes[i].getAttribute(attr) === value) return nodes[i];
726
+ }
727
+ return null;
728
+ }
729
+ function setAssetAttrs(el, attrs) {
730
+ for (const name in attrs) el.setAttribute(name, attrs[name]);
731
+ }
732
+ function mountAssetElement(descriptor) {
733
+ let el;
734
+ if (descriptor.type === "inline-style") {
735
+ el = findAssetElement("style[data-asset]", "data-asset", descriptor.id);
736
+ if (!el) {
737
+ el = document.createElement("style");
738
+ el.setAttribute("data-asset", descriptor.id);
739
+ el.textContent = descriptor.content || "";
740
+ }
741
+ } else {
742
+ const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
743
+ el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
744
+ if (!el) {
745
+ el = document.createElement("link");
746
+ el.rel = rel;
747
+ el.href = descriptor.href;
748
+ }
749
+ }
750
+ if (descriptor.attrs) setAssetAttrs(el, descriptor.attrs);
751
+ if (!el.isConnected) document.head.appendChild(el);
752
+ return el;
753
+ }
754
+ const assetLoadSettled = /*#__PURE__*/Promise.resolve();
755
+ function trackAssetLoad(entry, adopted) {
756
+ if (entry.loadPromise) return;
757
+ const el = entry.element;
758
+ let settled = el.sheet != null;
759
+ if (!settled && adopted && typeof performance !== "undefined" && performance.getEntriesByName) {
760
+ settled = performance.getEntriesByName(el.href).length > 0;
761
+ }
762
+ if (settled) {
763
+ entry.loadState = "loaded";
764
+ entry.loadPromise = assetLoadSettled;
765
+ return;
766
+ }
767
+ entry.loadState = "pending";
768
+ entry.loadPromise = new Promise(resolve => {
769
+ const settle = state => {
770
+ entry.loadState = state;
771
+ resolve();
772
+ };
773
+ el.addEventListener("load", () => settle("loaded"), {
774
+ once: true
775
+ });
776
+ el.addEventListener("error", () => settle("errored"), {
777
+ once: true
778
+ });
779
+ });
780
+ }
781
+ function warmAsset(descriptor) {
782
+ if (descriptor.policy === "exclusive" || descriptor.type === "inline-style") return;
783
+ const key = assetEntryKey(descriptor);
784
+ let entry = assetRegistry.get(key);
785
+ if (!entry) {
786
+ entry = {
787
+ count: 0,
788
+ element: null,
789
+ timer: null
790
+ };
791
+ assetRegistry.set(key, entry);
792
+ }
793
+ let adopted = true;
794
+ if (!entry.element || !entry.element.isConnected) {
795
+ const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
796
+ let el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
797
+ if (!el && descriptor.type === "style") {
798
+ el = findAssetElement('link[rel="preload"][as="style"]', "href", descriptor.href);
799
+ }
800
+ if (!el) {
801
+ adopted = false;
802
+ el = document.createElement("link");
803
+ if (descriptor.type === "style") {
804
+ el.setAttribute("rel", "preload");
805
+ el.setAttribute("as", "style");
806
+ } else {
807
+ el.setAttribute("rel", "modulepreload");
808
+ }
809
+ el.setAttribute("href", descriptor.href);
810
+ if (!document.body) el.setAttribute("blocking", "render");
811
+ }
812
+ if (descriptor.attrs) setAssetAttrs(el, descriptor.attrs);
813
+ if (!el.isConnected) document.head.appendChild(el);
814
+ entry.element = el;
815
+ entry.loadState = undefined;
816
+ entry.loadPromise = undefined;
817
+ }
818
+ if (descriptor.type === "style") trackAssetLoad(entry, adopted);
819
+ return entry;
820
+ }
821
+ function acquireAsset(descriptor) {
822
+ const key = assetEntryKey(descriptor);
823
+ let entry = assetRegistry.get(key);
824
+ if (descriptor.policy === "exclusive") {
825
+ if (!entry) {
826
+ entry = {
827
+ original: descriptor.get(),
828
+ set: descriptor.set,
829
+ writers: []
830
+ };
831
+ assetRegistry.set(key, entry);
832
+ }
833
+ const writer = {
834
+ value: descriptor.value
835
+ };
836
+ entry.writers.push(writer);
837
+ entry.set(writer.value);
838
+ let released = false;
839
+ return () => {
840
+ if (released) return;
841
+ released = true;
842
+ const index = entry.writers.indexOf(writer);
843
+ const wasTop = index === entry.writers.length - 1;
844
+ entry.writers.splice(index, 1);
845
+ if (!wasTop) return;
846
+ if (entry.writers.length) {
847
+ entry.set(entry.writers[entry.writers.length - 1].value);
848
+ } else {
849
+ entry.set(entry.original);
850
+ assetRegistry.delete(key);
851
+ }
852
+ };
853
+ }
854
+ if (!entry) {
855
+ entry = {
856
+ count: 0,
857
+ element: null,
858
+ timer: null
859
+ };
860
+ assetRegistry.set(key, entry);
861
+ }
862
+ if (entry.timer) {
863
+ clearTimeout(entry.timer);
864
+ entry.timer = null;
865
+ }
866
+ entry.count++;
867
+ if (!entry.element || !entry.element.isConnected) {
868
+ entry.element = mountAssetElement(descriptor);
869
+ } else if (descriptor.type === "style" && entry.element.getAttribute("rel") === "preload") {
870
+ entry.element.removeAttribute("as");
871
+ entry.element.setAttribute("rel", "stylesheet");
872
+ }
873
+ let released = false;
874
+ return () => {
875
+ if (released) return;
876
+ released = true;
877
+ if (--entry.count > 0) return;
878
+ entry.timer = setTimeout(() => {
879
+ assetRegistry.delete(key);
880
+ entry.element && entry.element.remove();
881
+ }, ASSET_REMOVAL_GRACE);
882
+ };
883
+ }
884
+ let headRegistrations = null;
885
+ let headSeq = 0;
886
+ let headUid = 0;
887
+ let headOwned = null;
888
+ let headApplied = null;
889
+ let headFallbackTitle = null;
890
+ let headScheduled = false;
891
+ const headMountedResources = new Set();
892
+ function initHeadRegistry() {
893
+ if (headRegistrations) return;
894
+ headRegistrations = [];
895
+ headOwned = new Map();
896
+ headApplied = new Map();
897
+ const t = document.querySelector("title");
898
+ headFallbackTitle = t && !t.hasAttribute("data-dh") ? t.textContent : null;
899
+ if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
900
+ }
901
+ function applyServerHeadOps(ops) {
902
+ for (let i = 0; i < ops.length; i++) {
903
+ const op = ops[i];
904
+ const identity = op[0] === "t" ? "title" : op[1];
905
+ if (headOwned.has(identity)) continue;
906
+ if (op[0] === "t") setHeadTitle(op[1]);else if (op[0] === "r") {
907
+ const els = headMarkedElements(identity);
908
+ for (let j = 0; j < els.length; j++) els[j].remove();
909
+ } else {
910
+ const el = document.createElement(op[2]);
911
+ for (const name in op[3]) el.setAttribute(name, op[3][name]);
912
+ if (op[4] != null) el.textContent = op[4];
913
+ el.setAttribute("data-dh", identity);
914
+ document.head.appendChild(el);
915
+ }
916
+ }
917
+ }
918
+ function headMarkedElements(identity) {
919
+ const nodes = document.head.querySelectorAll("[data-dh]");
920
+ const out = [];
921
+ for (let i = 0; i < nodes.length; i++) {
922
+ if (nodes[i].getAttribute("data-dh") === identity) out.push(nodes[i]);
923
+ }
924
+ return out;
925
+ }
926
+ function setHeadTitle(text) {
927
+ let el = document.querySelector("title");
928
+ if (!el) {
929
+ el = document.createElement("title");
930
+ document.head.appendChild(el);
931
+ }
932
+ el.textContent = text;
933
+ el.setAttribute("data-dh", "title");
934
+ return el;
935
+ }
936
+ function scheduleHeadApply() {
937
+ if (headScheduled) return;
938
+ headScheduled = true;
939
+ queueMicrotask(flushHeadRegistry);
940
+ }
941
+ function flushHeadRegistry() {
942
+ if (solidJs.sharedConfig.hydrating) {
943
+ setTimeout(flushHeadRegistry, 0);
944
+ return;
945
+ }
946
+ headScheduled = false;
947
+ const winners = resolveHead(headRegistrations);
948
+ for (const [identity, els] of headOwned) {
949
+ if (winners.has(identity)) continue;
950
+ headOwned.delete(identity);
951
+ headApplied.delete(identity);
952
+ if (identity === "title") {
953
+ if (headFallbackTitle != null) setHeadTitle(headFallbackTitle).removeAttribute("data-dh");
954
+ } else {
955
+ for (let i = 0; i < els.length; i++) els[i].remove();
956
+ }
957
+ }
958
+ for (const [identity, winner] of winners) {
959
+ let sig = "";
960
+ for (let i = 0; i < winner.tags.length; i++) sig += winner.tags[i].tag + JSON.stringify(winner.tags[i].props) + "|";
961
+ if (headApplied.get(identity) === sig) continue;
962
+ headApplied.set(identity, sig);
963
+ if (identity === "base" || identity === "charset") {
964
+ console.warn(`useHead: <${winner.tags[0].tag}> (${identity}) is shell-only and ignored on the client`);
965
+ continue;
966
+ }
967
+ if (identity === "title") {
968
+ const children = winner.tags[0].props.children;
969
+ setHeadTitle(children == null ? "" : String(children));
970
+ headOwned.set(identity, []);
971
+ continue;
972
+ }
973
+ const existing = headMarkedElements(identity);
974
+ const els = [];
975
+ for (let i = 0; i < winner.tags.length; i++) {
976
+ els.push(renderHeadElement(winner.tags[i], identity, existing));
977
+ }
978
+ for (let i = 0; i < existing.length; i++) {
979
+ if (els.indexOf(existing[i]) === -1) existing[i].remove();
980
+ }
981
+ headOwned.set(identity, els);
982
+ }
983
+ }
984
+ function createHeadElement(tag, props) {
985
+ const el = document.createElement(tag);
986
+ for (const name in props) {
987
+ if (name === "children" || name === "ref" || name.slice(0, 2) === "on") continue;
988
+ if (!HEAD_ATTR_NAME.test(name)) {
989
+ console.warn(`useHead: ignoring invalid attribute name "${name}"`);
250
990
  continue;
251
991
  }
252
- const value = props[prop];
253
- prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);
992
+ const v = props[name];
993
+ if (v == null || v === false) continue;
994
+ el.setAttribute(name, v === true ? "" : String(v));
995
+ }
996
+ if (props.children != null) el.textContent = String(props.children);
997
+ return el;
998
+ }
999
+ function renderHeadElement(t, identity, existing) {
1000
+ for (let i = 0; i < existing.length; i++) {
1001
+ if (headElementMatches(existing[i], t)) return existing.splice(i, 1)[0];
1002
+ }
1003
+ const el = createHeadElement(t.tag, t.props);
1004
+ el.setAttribute("data-dh", identity);
1005
+ document.head.appendChild(el);
1006
+ return el;
1007
+ }
1008
+ function headElementMatches(el, t) {
1009
+ if (el.tagName.toLowerCase() !== t.tag) return false;
1010
+ for (const name in t.props) {
1011
+ if (name === "children" || name === "ref" || name.slice(0, 2) === "on") continue;
1012
+ if (!HEAD_ATTR_NAME.test(name)) continue;
1013
+ const v = t.props[name];
1014
+ if (v == null || v === false) {
1015
+ if (el.hasAttribute(name)) return false;
1016
+ } else if (el.getAttribute(name) !== (v === true ? "" : String(v))) return false;
1017
+ }
1018
+ const children = t.props.children;
1019
+ return (children == null ? "" : String(children)) === el.textContent;
1020
+ }
1021
+ function mountHeadResource(tag, props) {
1022
+ const identity = resourceIdentity(tag, props);
1023
+ if (headMountedResources.has(identity)) return;
1024
+ headMountedResources.add(identity);
1025
+ const url = props.href || props.src;
1026
+ let el = null;
1027
+ if (url != null) {
1028
+ if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
1029
+ }
1030
+ if (!el) document.head.appendChild(createHeadElement(tag, props));
1031
+ }
1032
+ function gateHeadResource(props) {
1033
+ const descriptor = {
1034
+ type: props.rel === "stylesheet" ? "style" : "module",
1035
+ href: props.href
1036
+ };
1037
+ let gateable = props.rel === "stylesheet" && props.href != null;
1038
+ let attrs = null;
1039
+ for (const name in props) {
1040
+ if (name === "rel" || name === "href") continue;
1041
+ if (!STYLESHEET_FETCH_META.has(name)) gateable = false;
1042
+ if (!HEAD_ATTR_NAME.test(name)) continue;
1043
+ const v = props[name];
1044
+ if (v == null || v === false) continue;
1045
+ (attrs || (attrs = {}))[name] = v === true ? "" : String(v);
1046
+ }
1047
+ if (attrs) descriptor.attrs = attrs;
1048
+ effect(() => {
1049
+ const entry = warmAsset(descriptor);
1050
+ if (gateable && entry.loadState === "pending" && typeof waitAsset === "function") waitAsset(entry.loadPromise);
1051
+ }, () => acquireAsset(descriptor));
1052
+ }
1053
+ function useHead(tags) {
1054
+ initHeadRegistry();
1055
+ const reg = {
1056
+ seq: -1,
1057
+ tags: null
1058
+ };
1059
+ const uid = ++headUid;
1060
+ effect(() => {
1061
+ let list = typeof tags === "function" ? tags() : tags;
1062
+ if (!Array.isArray(list)) list = [list];
1063
+ const replaceable = [];
1064
+ const resources = [];
1065
+ for (let i = 0; i < list.length; i++) {
1066
+ const desc = list[i];
1067
+ if (!desc || !HEAD_ELIGIBLE_TAGS.has(desc.tag)) {
1068
+ console.warn(`useHead: ignoring non-head tag`, desc);
1069
+ continue;
1070
+ }
1071
+ const cls = classifyHeadTag(desc);
1072
+ const props = evalHeadProps(desc.props || {}, cls.rel !== undefined ? {
1073
+ rel: cls.rel
1074
+ } : undefined);
1075
+ if (cls.resource) {
1076
+ if (desc.tag === "link" && (props.rel === "stylesheet" || props.rel === "modulepreload")) {
1077
+ gateHeadResource(props);
1078
+ } else if (desc.tag === "link") {
1079
+ mountHeadResource(desc.tag, props);
1080
+ } else {
1081
+ resources.push({
1082
+ tag: desc.tag,
1083
+ props
1084
+ });
1085
+ }
1086
+ } else {
1087
+ const key = evalHeadValue(desc.key);
1088
+ replaceable.push({
1089
+ tag: desc.tag,
1090
+ props,
1091
+ identity: replaceableIdentity(desc.tag, props, key, "u:c" + uid + ":" + i)
1092
+ });
1093
+ }
1094
+ }
1095
+ return {
1096
+ replaceable,
1097
+ resources
1098
+ };
1099
+ }, evaluated => {
1100
+ for (let i = 0; i < evaluated.resources.length; i++) {
1101
+ mountHeadResource(evaluated.resources[i].tag, evaluated.resources[i].props);
1102
+ }
1103
+ reg.tags = evaluated.replaceable;
1104
+ if (reg.seq < 0) reg.seq = ++headSeq;
1105
+ if (headRegistrations.indexOf(reg) === -1) headRegistrations.push(reg);
1106
+ scheduleHeadApply();
1107
+ return () => {
1108
+ const idx = headRegistrations.indexOf(reg);
1109
+ if (idx > -1) headRegistrations.splice(idx, 1);
1110
+ scheduleHeadApply();
1111
+ };
1112
+ });
1113
+ }
1114
+ function loadModuleAssets(mapping) {
1115
+ const hy = globalThis._$HY;
1116
+ if (!hy) return;
1117
+ const pending = [];
1118
+ for (const key in mapping) {
1119
+ if (hy.modules[key]) continue;
1120
+ const entryUrl = mapping[key];
1121
+ if (!hy.loading[key]) {
1122
+ hy.loading[key] = import(entryUrl).then(mod => {
1123
+ hy.modules[key] = mod;
1124
+ }, err => {
1125
+ delete hy.loading[key];
1126
+ throw err;
1127
+ });
1128
+ }
1129
+ pending.push(hy.loading[key]);
254
1130
  }
1131
+ return pending.length ? Promise.all(pending).then(() => {}) : undefined;
255
1132
  }
256
1133
  function hydrate$1(code, element, options = {}) {
257
- if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);
1134
+ installHydrationRuntime();
1135
+ if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
258
1136
  options.renderId ||= "";
1137
+ if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
1138
+ if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
259
1139
  solidJs.sharedConfig.completed = globalThis._$HY.completed;
260
1140
  solidJs.sharedConfig.events = globalThis._$HY.events;
261
1141
  solidJs.sharedConfig.load = id => globalThis._$HY.r[id];
262
1142
  solidJs.sharedConfig.has = id => id in globalThis._$HY.r;
263
1143
  solidJs.sharedConfig.gather = root => gatherHydratable(element, root);
1144
+ solidJs.sharedConfig.loadModuleAssets = loadModuleAssets;
1145
+ solidJs.sharedConfig.cleanupFragment = id => {
1146
+ const tpl = document.getElementById("pl-" + id);
1147
+ if (tpl) {
1148
+ let node = tpl.nextSibling;
1149
+ while (node) {
1150
+ const next = node.nextSibling;
1151
+ if (node.nodeType === 8 && node.nodeValue === "pl-" + id) {
1152
+ node.remove();
1153
+ break;
1154
+ }
1155
+ node.remove();
1156
+ node = next;
1157
+ }
1158
+ tpl.remove();
1159
+ }
1160
+ };
264
1161
  solidJs.sharedConfig.registry = new Map();
1162
+ if (!solidJs.sharedConfig.boundaryScopes) solidJs.sharedConfig.boundaryScopes = new Map();
1163
+ solidJs.sharedConfig.captureBoundaryScope = id => {
1164
+ if (solidJs.sharedConfig.registry) solidJs.sharedConfig.boundaryScopes.set(id, {
1165
+ registry: solidJs.sharedConfig.registry,
1166
+ gather: solidJs.sharedConfig.gather
1167
+ });
1168
+ };
265
1169
  solidJs.sharedConfig.hydrating = true;
1170
+ {
1171
+ solidJs.sharedConfig.verifyHydration = () => {
1172
+ if (solidJs.sharedConfig.registry && solidJs.sharedConfig.registry.size) {
1173
+ const orphaned = [...solidJs.sharedConfig.registry.values()].filter(node => node.isConnected);
1174
+ solidJs.sharedConfig.registry.clear();
1175
+ if (!orphaned.length) return;
1176
+ console.warn(`Hydration completed with ${orphaned.length} unclaimed server-rendered node(s):\n` + orphaned.map(node => ` ${node.outerHTML.slice(0, 100)}`).join("\n"));
1177
+ }
1178
+ };
1179
+ }
1180
+ const hyr = globalThis._$HY.r;
1181
+ const rootMapping = hyr && (hyr[options.renderId + "_assets"] || hyr["_assets"]);
1182
+ if (rootMapping && typeof rootMapping === "object") {
1183
+ const p = loadModuleAssets(rootMapping);
1184
+ if (p) {
1185
+ gatherHydratable(element, options.renderId);
1186
+ const registry = solidJs.sharedConfig.registry;
1187
+ const gather = solidJs.sharedConfig.gather;
1188
+ let disposer;
1189
+ p.then(() => {
1190
+ solidJs.sharedConfig.registry = registry;
1191
+ solidJs.sharedConfig.gather = gather;
1192
+ solidJs.sharedConfig.hydrating = true;
1193
+ try {
1194
+ disposer = render$1(code, element, [...element.childNodes], options);
1195
+ } finally {
1196
+ solidJs.sharedConfig.hydrating = false;
1197
+ }
1198
+ }, err => {
1199
+ console.error("Hydration module preload failed, falling back to client render:", err);
1200
+ solidJs.sharedConfig.hydrating = false;
1201
+ solidJs.sharedConfig.registry = undefined;
1202
+ disposer = render$1(code, element, [...element.childNodes], options);
1203
+ });
1204
+ return () => disposer && disposer();
1205
+ }
1206
+ }
266
1207
  try {
267
1208
  gatherHydratable(element, options.renderId);
268
- return render(code, element, [...element.childNodes], options);
1209
+ return render$1(code, element, [...element.childNodes], options);
269
1210
  } finally {
270
1211
  solidJs.sharedConfig.hydrating = false;
271
1212
  }
@@ -275,11 +1216,19 @@ function getNextElement(template) {
275
1216
  key,
276
1217
  hydrating = isHydrating();
277
1218
  if (!hydrating || !(node = solidJs.sharedConfig.registry.get(key = getHydrationKey()))) {
1219
+ if (!template) {
1220
+ throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);
1221
+ }
278
1222
  if (hydrating) {
279
- solidJs.sharedConfig.done = true;
280
- throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}\n${template ? template().outerHTML : ""}`);
1223
+ console.warn(`Hydration key miss for "${key}": no server-rendered element carries this key` + (template._html ? ` (template: ${template._html.slice(0, 60)})` : "") + `. A detached element was created instead; its subtree will not appear in the ` + `document or become interactive. This usually means the server and client ` + `hydration id namespaces are misaligned — when hydrating a subtree of a larger ` + `server render, wrap the document shell in <NoHydration> and re-enter with ` + `<Hydration> around the hydrated subtree (or pass hydrate() a renderId matching ` + `the server's <Hydration id>).`);
1224
+ }
1225
+ return template(true);
1226
+ }
1227
+ if (template && template._html) {
1228
+ const expected = template._html.match(/^<(\w+)/)?.[1];
1229
+ if (expected && node.localName !== expected) {
1230
+ console.warn(`Hydration tag mismatch for key "${key}": expected <${expected}> but found`, node);
281
1231
  }
282
- return template();
283
1232
  }
284
1233
  if (solidJs.sharedConfig.completed) solidJs.sharedConfig.completed.add(node);
285
1234
  solidJs.sharedConfig.registry.delete(key);
@@ -308,6 +1257,50 @@ function getNextMarker(start) {
308
1257
  }
309
1258
  return [end, current];
310
1259
  }
1260
+ function getFirstChild(node, expectedTag) {
1261
+ const child = node.firstChild;
1262
+ if (isHydrating() && expectedTag && child?.localName !== expectedTag) {
1263
+ const isMissing = !child || child.nodeType !== 1;
1264
+ console.warn("Hydration structure mismatch: expected <" + expectedTag + "> as first child of", node, "\n " + describeSiblings(node, child, expectedTag, isMissing));
1265
+ }
1266
+ return child;
1267
+ }
1268
+ function getNextSibling(node, expectedTag) {
1269
+ const sibling = node.nextSibling;
1270
+ if (isHydrating() && expectedTag && sibling?.localName !== expectedTag) {
1271
+ const parent = node.parentNode;
1272
+ const isMissing = !sibling || sibling.nodeType !== 1;
1273
+ console.warn("Hydration structure mismatch: expected <" + expectedTag + "> after", node, "in", parent, "\n " + describeSiblings(parent, sibling, expectedTag, isMissing));
1274
+ }
1275
+ return sibling;
1276
+ }
1277
+ function describeSiblings(parent, mismatchChild, expectedTag, isMissing) {
1278
+ if (!parent) return `<${expectedTag} \u2190 parent unavailable>`;
1279
+ const children = [];
1280
+ let child = parent.firstChild;
1281
+ while (child) {
1282
+ if (child.nodeType === 1) children.push(child);
1283
+ child = child.nextSibling;
1284
+ }
1285
+ const pTag = parent.localName || "#fragment";
1286
+ if (isMissing) {
1287
+ const tags = children.map(c => `<${c.localName}>`).join("");
1288
+ return `<${pTag}>${tags}<${expectedTag} \u2190 missing></${pTag}>`;
1289
+ }
1290
+ const idx = children.indexOf(mismatchChild);
1291
+ let start = 0,
1292
+ end = children.length;
1293
+ let prefix = "",
1294
+ suffix = "";
1295
+ if (children.length > 6) {
1296
+ start = Math.max(0, idx - 2);
1297
+ end = Math.min(children.length, idx + 3);
1298
+ if (start > 0) prefix = "...";
1299
+ if (end < children.length) suffix = "...";
1300
+ }
1301
+ const tags = children.slice(start, end).map(c => c === mismatchChild ? `<${c.localName} \u2190 expected ${expectedTag}>` : `<${c.localName}>`).join("");
1302
+ return `<${pTag}>${prefix}${tags}${suffix}</${pTag}>`;
1303
+ }
311
1304
  function runHydrationEvents() {
312
1305
  if (solidJs.sharedConfig.events && !solidJs.sharedConfig.events.queued) {
313
1306
  queueMicrotask(() => {
@@ -321,7 +1314,32 @@ function runHydrationEvents() {
321
1314
  const [el, e] = events[0];
322
1315
  if (!completed.has(el)) return;
323
1316
  events.shift();
324
- eventHandler(e);
1317
+ let matchContainer, matchState, matchDistance, matches;
1318
+ for (const [container, state] of delegatedContainers) {
1319
+ if (!state.handlers.has(e.type)) continue;
1320
+ const entry = findOwner(e.target, state);
1321
+ if (!entry) continue;
1322
+ if (matchContainer) {
1323
+ if (!matches) matches = [{
1324
+ container: matchContainer,
1325
+ state: matchState,
1326
+ distance: matchDistance
1327
+ }];
1328
+ matches.push({
1329
+ container,
1330
+ state,
1331
+ distance: entry.distance
1332
+ });
1333
+ } else {
1334
+ matchContainer = container;
1335
+ matchState = state;
1336
+ matchDistance = entry.distance;
1337
+ }
1338
+ }
1339
+ if (matches) {
1340
+ matches.sort((a, b) => a.distance - b.distance);
1341
+ for (let i = 0; i < matches.length; i++) eventHandler(e, matches[i].container, matches[i].state);
1342
+ } else if (matchContainer) eventHandler(e, matchContainer, matchState);
325
1343
  }
326
1344
  if (solidJs.sharedConfig.done) {
327
1345
  solidJs.sharedConfig.events = _$HY.events = null;
@@ -332,16 +1350,31 @@ function runHydrationEvents() {
332
1350
  }
333
1351
  }
334
1352
  function isHydrating(node) {
335
- return solidJs.sharedConfig.hydrating && !solidJs.sharedConfig.done && (!node || node.isConnected);
336
- }
337
- function toggleClassKey(node, key, value) {
338
- const classNames = key.trim().split(/\s+/);
339
- for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
1353
+ if (!solidJs.sharedConfig.hydrating) return false;
1354
+ if (!node || node.isConnected) return true;
1355
+ const roots = solidJs.sharedConfig.claimRoots;
1356
+ if (roots) {
1357
+ for (let i = 0; i < roots.length; i++) {
1358
+ if (roots[i].contains(node)) return true;
1359
+ }
1360
+ }
1361
+ return false;
340
1362
  }
341
1363
  function classListToObject(classList) {
342
1364
  if (Array.isArray(classList)) {
343
1365
  const result = {};
344
1366
  flattenClassList(classList, result);
1367
+ classList = result;
1368
+ }
1369
+ if (classList && typeof classList === "object") {
1370
+ const result = {},
1371
+ keys = Object.keys(classList);
1372
+ for (let i = 0, len = keys.length; i < len; i++) {
1373
+ const key = keys[i];
1374
+ if (!classList[key]) continue;
1375
+ const classNames = key.trim().split(/\s+/);
1376
+ for (let j = 0, nameLen = classNames.length; j < nameLen; j++) classNames[j] && (result[classNames[j]] = true);
1377
+ }
345
1378
  return result;
346
1379
  }
347
1380
  return classList;
@@ -352,18 +1385,16 @@ function flattenClassList(list, result) {
352
1385
  if (Array.isArray(item)) flattenClassList(item, result);else if (typeof item === "object" && item != null) Object.assign(result, item);else if (item || item === 0) result[item] = true;
353
1386
  }
354
1387
  }
355
- function assignProp(node, prop, value, prev, isSVG, skipRef) {
356
- let forceProp;
1388
+ function assignProp(node, prop, value, prev, skipRef, nodeName) {
357
1389
  if (prop === "style") return style(node, value, prev), value;
358
- if (prop === "class") return className(node, value, isSVG, prev), value;
359
- if (value === prev) return prev;
1390
+ if (prop === "class") return className(node, value, prev), value;
1391
+ if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
360
1392
  if (prop === "ref") {
361
- if (!skipRef) value(node);
362
- } else if (prop.slice(0, 3) === "on:") {
363
- const e = prop.slice(3);
364
- prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
365
- value && node.addEventListener(e, value, typeof value !== "function" && value);
366
- } else if (prop.slice(0, 2) === "on") {
1393
+ if (!skipRef && value) ref(() => value, node);
1394
+ return value;
1395
+ }
1396
+ const hasNamespace = prop.indexOf(":") > -1;
1397
+ if (!hasNamespace && prop.slice(0, 2) === "on") {
367
1398
  const name = prop.slice(2).toLowerCase();
368
1399
  const delegate = DelegatedEvents.has(name);
369
1400
  if (!delegate && prev) {
@@ -371,26 +1402,35 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
371
1402
  node.removeEventListener(name, h);
372
1403
  }
373
1404
  if (delegate || value) {
374
- addEventListener(node, name, value, delegate);
1405
+ addEvent(node, name, value, delegate);
375
1406
  delegate && delegateEvents([name]);
376
1407
  }
377
- } else if ((forceProp = prop.slice(0, 5) === "prop:") || ChildProperties.has(prop) || !isSVG && Properties.has(prop)) {
378
- if (forceProp) prop = prop.slice(5);else if (isHydrating(node)) return value;
379
- if (prop === "value" && node.nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else node[prop] = value;
1408
+ } else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
1409
+ if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
1410
+ if (prop === "value" && nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else if ((prop === "value" || prop === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA"))
1411
+ node[prop] = value ?? "";else node[prop] = value;
380
1412
  } else {
381
- const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
1413
+ const ns = hasNamespace && Namespaces[prop.split(":")[0]];
382
1414
  if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
383
1415
  }
384
1416
  return value;
385
1417
  }
386
- function eventHandler(e) {
387
- if (solidJs.sharedConfig.registry && solidJs.sharedConfig.events) {
388
- if (solidJs.sharedConfig.events.find(([el, ev]) => ev === e)) return;
1418
+ function eventHandler(e, container, state) {
1419
+ if (hydrationRt !== null && hydrationRt.dedupEvent(e)) return;
1420
+ const prev = e[$$EVENT_OWNER];
1421
+ let resumeNode;
1422
+ if (prev) {
1423
+ if (prev === true || prev === container || !container.contains(prev)) return;
1424
+ resumeNode = prev;
389
1425
  }
390
- let node = e.target;
1426
+ const owner = state && (state.owners.size === 1 && state.owners.has(container) ? container : findOwner(e.target, state)?.owner);
1427
+ if (state && !owner) return;
1428
+ if (owner && owner === resumeNode) return;
1429
+ e[$$EVENT_OWNER] = owner || true;
1430
+ let node = resumeNode || e.target;
391
1431
  const key = `$$${e.type}`;
392
1432
  const oriTarget = e.target;
393
- const oriCurrentTarget = e.currentTarget;
1433
+ const boundary = owner || container || e.currentTarget;
394
1434
  const retarget = value => Object.defineProperty(e, "target", {
395
1435
  configurable: true,
396
1436
  value
@@ -406,52 +1446,72 @@ function eventHandler(e) {
406
1446
  return true;
407
1447
  };
408
1448
  const walkUpTree = () => {
409
- while (handleNode() && (node = node._$host || node.parentNode || node.host));
1449
+ while (node && handleNode()) {
1450
+ if (node === boundary || node.parentNode === boundary) break;
1451
+ node = node._$host || node.parentNode || node.host;
1452
+ }
410
1453
  };
411
1454
  Object.defineProperty(e, "currentTarget", {
412
1455
  configurable: true,
413
1456
  get() {
414
- return node || document;
1457
+ return node || boundary || document;
415
1458
  }
416
1459
  });
417
- if (solidJs.sharedConfig.registry && !solidJs.sharedConfig.done) solidJs.sharedConfig.done = _$HY.done = true;
418
- if (e.composedPath) {
1460
+ if (resumeNode) {
1461
+ if (resumeNode === e.target) node = resumeNode._$host || resumeNode.parentNode || resumeNode.host;
1462
+ if (node && node !== boundary) walkUpTree();
1463
+ } else if (e.composedPath) {
419
1464
  const path = e.composedPath();
420
- retarget(path[0]);
421
- for (let i = 0; i < path.length - 2; i++) {
422
- node = path[i];
423
- if (!handleNode()) break;
424
- if (node._$host) {
425
- node = node._$host;
426
- walkUpTree();
427
- break;
428
- }
429
- if (node.parentNode === oriCurrentTarget) {
430
- break;
1465
+ if (path.length) {
1466
+ retarget(path[0]);
1467
+ for (let i = 0; i < path.length; i++) {
1468
+ node = path[i];
1469
+ if (!handleNode()) break;
1470
+ if (node._$host) {
1471
+ node = node._$host;
1472
+ walkUpTree();
1473
+ break;
1474
+ }
1475
+ if (node === boundary || node.parentNode === boundary) {
1476
+ break;
1477
+ }
431
1478
  }
432
- }
1479
+ } else walkUpTree();
433
1480
  }
434
1481
  else walkUpTree();
435
1482
  retarget(oriTarget);
436
1483
  }
437
1484
  function insertExpression(parent, value, current, marker) {
438
- if (isHydrating(parent)) return;
439
- if (value === current) return;
1485
+ if (hydrationRt !== null && isHydrating(parent)) {
1486
+ if (value && value !== current) for (const n of Array.isArray(value) ? value : [value]) if (n && n.nodeType && !isHydrating(n)) return current;
1487
+ return value;
1488
+ }
1489
+ if (value === current) return value;
440
1490
  const t = typeof value,
441
1491
  multi = marker !== undefined;
442
1492
  if (t === "string" || t === "number") {
443
1493
  const tc = typeof current;
444
1494
  if (tc === "string" || tc === "number") {
445
1495
  parent.firstChild.data = value;
446
- } else parent.textContent = value;
1496
+ } else {
1497
+ if (ownsAllChildren(parent, current)) parent.textContent = value;else {
1498
+ removeOwnedChildren(parent, current);
1499
+ parent.insertBefore(document.createTextNode(value), parent.firstChild);
1500
+ }
1501
+ }
447
1502
  } else if (value === undefined) {
448
1503
  cleanChildren(parent, current, marker);
449
1504
  } else if (value.nodeType) {
450
1505
  if (Array.isArray(current)) {
451
1506
  cleanChildren(parent, current, multi ? marker : null, value);
452
- } else if (current === undefined || !parent.firstChild) {
1507
+ } else if (current && current.nodeType) {
1508
+ current.parentNode === parent ? parent.replaceChild(value, current) : parent.appendChild(value);
1509
+ } else if (current && parent.firstChild) {
1510
+ parent.replaceChild(value, parent.firstChild);
1511
+ } else {
453
1512
  parent.appendChild(value);
454
- } else parent.replaceChild(value, parent.firstChild);
1513
+ }
1514
+ if (marker) value[$$SLOT] = marker;
455
1515
  } else if (Array.isArray(value)) {
456
1516
  const currentArray = current && Array.isArray(current);
457
1517
  if (value.length === 0) {
@@ -459,12 +1519,13 @@ function insertExpression(parent, value, current, marker) {
459
1519
  } else if (currentArray) {
460
1520
  if (current.length === 0) {
461
1521
  appendNodes(parent, value, marker);
462
- } else reconcileArrays(parent, current, value);
1522
+ } else reconcileArrays(parent, current, value, marker);
463
1523
  } else {
464
- current && cleanChildren(parent);
1524
+ current && cleanChildren(parent, current);
465
1525
  appendNodes(parent, value);
466
1526
  }
467
1527
  } else console.warn(`Unrecognized value. Skipped inserting`, value);
1528
+ return value;
468
1529
  }
469
1530
  function normalize(value, current, multi, doNotUnwrap) {
470
1531
  value = solidJs.flatten(value, {
@@ -478,44 +1539,87 @@ function normalize(value, current, multi, doNotUnwrap) {
478
1539
  const item = value[i],
479
1540
  prev = current && current[i],
480
1541
  t = typeof item;
481
- if (t === "string" || t === "number") value[i] = prev && prev.nodeType === 3 && prev.data === item ? prev : document.createTextNode(item);
1542
+ if (t === "string" || t === "number") value[i] = prev && prev.nodeType === 3 && (solidJs.sharedConfig.hydrating || prev.data === "" + item) ? prev : document.createTextNode(item);
482
1543
  }
483
1544
  }
484
1545
  return value;
485
1546
  }
1547
+ function tagHost(value, host) {
1548
+ if (Array.isArray(value)) {
1549
+ for (let i = 0, len = value.length; i < len; i++) tagHost(value[i], host);
1550
+ } else if (value && value.nodeType && value[$$HOST] !== host) {
1551
+ value[$$HOST] = host;
1552
+ Object.defineProperty(value, "_$host", {
1553
+ get: host,
1554
+ configurable: true
1555
+ });
1556
+ }
1557
+ }
486
1558
  function appendNodes(parent, array, marker = null) {
487
- for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
1559
+ for (let i = 0, len = array.length; i < len; i++) {
1560
+ const n = array[i];
1561
+ parent.insertBefore(n, marker);
1562
+ if (marker) n[$$SLOT] = marker;
1563
+ }
1564
+ }
1565
+ function ownsAllChildren(parent, current) {
1566
+ if (current == null) return true;
1567
+ if (Array.isArray(current)) {
1568
+ return current.length ? parent.firstChild === current[0] && parent.lastChild === current[current.length - 1] : parent.firstChild === null;
1569
+ }
1570
+ if (current === "") return parent.firstChild === null;
1571
+ if (current.nodeType) return parent.firstChild === current && parent.lastChild === current;
1572
+ const first = parent.firstChild;
1573
+ return first !== null && first.nodeType === 3 && parent.lastChild === first;
1574
+ }
1575
+ function removeOwnedChildren(parent, current) {
1576
+ if (Array.isArray(current)) {
1577
+ for (let i = 0; i < current.length; i++) {
1578
+ const el = current[i];
1579
+ if (el.parentNode === parent) el.remove();
1580
+ }
1581
+ } else if (current.nodeType) {
1582
+ if (current.parentNode === parent) current.remove();
1583
+ } else {
1584
+ const first = parent.firstChild;
1585
+ if (first && first.nodeType === 3) first.remove();
1586
+ }
488
1587
  }
489
1588
  function cleanChildren(parent, current, marker, replacement) {
490
- if (marker === undefined) return parent.textContent = "";
1589
+ if (marker === undefined) {
1590
+ if (ownsAllChildren(parent, current)) return parent.textContent = "";
1591
+ return removeOwnedChildren(parent, current);
1592
+ }
491
1593
  if (current.length) {
492
1594
  let inserted = false;
493
1595
  for (let i = current.length - 1; i >= 0; i--) {
494
1596
  const el = current[i];
495
1597
  if (replacement !== el) {
496
- const isParent = el.parentNode === parent;
497
- if (replacement && !inserted && !i) isParent ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else isParent && el.remove();
1598
+ const tag = el[$$SLOT];
1599
+ const owns = el.parentNode === parent && (!tag || tag === marker);
1600
+ if (replacement && !inserted && !i) owns ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else if (owns) el.remove();
498
1601
  } else inserted = true;
499
1602
  }
500
1603
  } else if (replacement) parent.insertBefore(replacement, marker);
1604
+ if (replacement && marker) replacement[$$SLOT] = marker;
501
1605
  }
502
1606
  function gatherHydratable(element, root) {
503
1607
  const templates = element.querySelectorAll(`*[_hk]`);
504
1608
  for (let i = 0; i < templates.length; i++) {
505
1609
  const node = templates[i];
506
1610
  const key = node.getAttribute("_hk");
507
- if ((!root || key.startsWith(root)) && !solidJs.sharedConfig.registry.has(key)) solidJs.sharedConfig.registry.set(key, node);
1611
+ if (root) {
1612
+ if (!key.startsWith(root)) continue;
1613
+ } else {
1614
+ const frame = node.closest("[data-fid]");
1615
+ if (frame && frame !== element && element.contains(frame)) continue;
1616
+ }
1617
+ if (!solidJs.sharedConfig.registry.has(key)) solidJs.sharedConfig.registry.set(key, node);
508
1618
  }
509
1619
  }
510
1620
  function getHydrationKey() {
511
1621
  return solidJs.sharedConfig.getNextContextId();
512
1622
  }
513
- function NoHydration(props) {
514
- return solidJs.sharedConfig.hydrating ? undefined : props.children;
515
- }
516
- function Hydration(props) {
517
- return props.children;
518
- }
519
1623
  const voidFn = () => undefined;
520
1624
  const RequestContext = Symbol();
521
1625
 
@@ -526,112 +1630,337 @@ function throwInBrowser(func) {
526
1630
  function renderToString(fn, options) {
527
1631
  throwInBrowser(renderToString);
528
1632
  }
529
- function renderToStringAsync(fn, options) {
530
- throwInBrowser(renderToStringAsync);
531
- }
532
1633
  function renderToStream(fn, options) {
533
1634
  throwInBrowser(renderToStream);
534
1635
  }
1636
+ function createResponseStub() {
1637
+ throwInBrowser(createResponseStub);
1638
+ }
1639
+ function createRequestEvent(request, init) {
1640
+ throwInBrowser(createRequestEvent);
1641
+ }
1642
+ function getExpectedRedirectStatus(response) {
1643
+ throwInBrowser(getExpectedRedirectStatus);
1644
+ }
1645
+ function createSSRResponse() {
1646
+ throwInBrowser(createSSRResponse);
1647
+ }
1648
+ function commitEventResponse(response, event) {
1649
+ throwInBrowser(commitEventResponse);
1650
+ }
1651
+ function composeMiddleware(middlewares) {
1652
+ throwInBrowser(composeMiddleware);
1653
+ }
535
1654
  function ssr(template, ...nodes) {}
536
1655
  function ssrElement(name, props, children, needsId) {}
537
- function ssrClassList(value) {}
1656
+ function ssrClassName(value) {}
538
1657
  function ssrStyle(value) {}
1658
+ function ssrStyleProperty(name, value) {}
539
1659
  function ssrAttribute(key, value) {}
1660
+ function ssrGroup(fn, n) {}
540
1661
  function ssrHydrationKey() {}
541
- function resolveSSRNode(node) {}
542
- function escape(html) {}
1662
+ function resolveSSRNode(node, result, top) {}
1663
+ function escape(s, attr) {}
1664
+
1665
+ const ENVELOPE = Symbol.for("solid.ResponseEnvelope");
1666
+ // PURE-annotated factory (same convention as solid's MockPromise): the brand
1667
+ const ResponseEnvelope = /* @__PURE__ */(() => {
1668
+ class ResponseEnvelope {
1669
+ constructor(response, value) {
1670
+ this.response = response;
1671
+ this.value = value;
1672
+ }
1673
+ }
1674
+ ResponseEnvelope.prototype[ENVELOPE] = true;
1675
+ return ResponseEnvelope;
1676
+ })();
1677
+ function isResponseEnvelope(value) {
1678
+ return !!(value && typeof value === "object" && value[ENVELOPE]);
1679
+ }
1680
+ const HREF = Symbol.for("solid.Href");
1681
+ function isHref(value) {
1682
+ return !!(value && (typeof value === "object" || typeof value === "function") && value[HREF]);
1683
+ }
1684
+ const SAFE_ERROR = Symbol.for("solid.SafeError");
1685
+ function markSafeError(error) {
1686
+ if (error && (typeof error === "object" || typeof error === "function")) {
1687
+ Object.defineProperty(error, SAFE_ERROR, {
1688
+ value: true,
1689
+ enumerable: false,
1690
+ configurable: true
1691
+ });
1692
+ }
1693
+ return error;
1694
+ }
1695
+ function isSafeError(value) {
1696
+ return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
1697
+ }
1698
+ const REVALIDATE_HEADER = "X-Revalidate";
1699
+ function initWithRevalidate(init) {
1700
+ const {
1701
+ revalidate,
1702
+ ...responseInit
1703
+ } = init;
1704
+ let headers;
1705
+ if (responseInit.headers && responseInit.headers.getSetCookie) {
1706
+ headers = new Headers();
1707
+ responseInit.headers.forEach((value, key) => {
1708
+ if (key !== "set-cookie") headers.append(key, value);
1709
+ });
1710
+ for (const cookie of responseInit.headers.getSetCookie()) {
1711
+ headers.append("Set-Cookie", cookie);
1712
+ }
1713
+ } else {
1714
+ headers = new Headers(responseInit.headers);
1715
+ }
1716
+ revalidate !== undefined && headers.set(REVALIDATE_HEADER, revalidate.toString());
1717
+ return {
1718
+ responseInit,
1719
+ headers
1720
+ };
1721
+ }
1722
+ function redirect(url, init = 302) {
1723
+ if (typeof url !== "string" && !isHref(url)) {
1724
+ throw new TypeError("redirect() expects a string URL or an Href-branded value (Symbol.for('solid.Href')).");
1725
+ }
1726
+ const {
1727
+ responseInit,
1728
+ headers
1729
+ } = initWithRevalidate(typeof init === "number" ? {
1730
+ status: init
1731
+ } : init);
1732
+ if (responseInit.status === undefined) {
1733
+ responseInit.status = 302;
1734
+ }
1735
+ headers.set("Location", String(url));
1736
+ return new Response(null, {
1737
+ ...responseInit,
1738
+ headers
1739
+ });
1740
+ }
1741
+ function reload(init = {}) {
1742
+ const {
1743
+ responseInit,
1744
+ headers
1745
+ } = initWithRevalidate(init);
1746
+ return new Response(null, {
1747
+ ...responseInit,
1748
+ headers
1749
+ });
1750
+ }
1751
+ function respond(value, init = {}) {
1752
+ const {
1753
+ responseInit,
1754
+ headers
1755
+ } = initWithRevalidate(init);
1756
+ headers.set("Content-Type", "application/json");
1757
+ return new ResponseEnvelope(new Response(JSON.stringify(value), {
1758
+ ...responseInit,
1759
+ headers
1760
+ }), value);
1761
+ }
543
1762
 
1763
+ const mergeProps = solidJs.merge;
544
1764
  const isServer = false;
545
1765
  const isDev = true;
546
- const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
547
- function createElement(tagName, isSVG = false, is = undefined) {
548
- return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {
549
- is
550
- });
1766
+ function render(code, element, init, options = {}) {
1767
+ solidJs.enforceLoadingBoundary(true);
1768
+ try {
1769
+ const dispose = render$1(code, element, init, {
1770
+ ...options,
1771
+ insertOptions: {
1772
+ schedule: true
1773
+ }
1774
+ });
1775
+ solidJs.flush();
1776
+ return dispose;
1777
+ } finally {
1778
+ solidJs.enforceLoadingBoundary(false);
1779
+ }
551
1780
  }
552
1781
  const hydrate = (...args) => {
553
1782
  solidJs.enableHydration();
554
1783
  return hydrate$1(...args);
555
1784
  };
556
1785
  function Portal(props) {
1786
+ return solidJs.runWithOwner(solidJs.createOwner(), () => portalImpl(props));
1787
+ }
1788
+ function portalImpl(props) {
557
1789
  const treeMarker = document.createTextNode(""),
558
1790
  startMarker = document.createTextNode(""),
559
1791
  endMarker = document.createTextNode(""),
560
- mount = () => createElementProxy(props.mount || document.body, treeMarker);
561
- let content = solidJs.createMemo(() => [startMarker, props.children]);
562
- solidJs.createRenderEffect(() => [mount(), content()], ([m, c]) => {
1792
+ mount = () => props.mount || document.body,
1793
+ content = solidJs.createMemo(() => [startMarker, props.children], {
1794
+ ssrSource: "client",
1795
+ loadingValue: undefined
1796
+ });
1797
+ solidJs.createRenderEffect(
1798
+ () => [mount(), content(), solidJs.getOwner()], ([, c, owner]) => {
1799
+ const m = solidJs.untrack(mount);
563
1800
  m.appendChild(endMarker);
564
- insert(m, c, endMarker);
1801
+ const dispose = solidJs.runWithOwner(owner, () => solidJs.createRoot(d => {
1802
+ insert(m, c, endMarker, undefined, {
1803
+ host: () => treeMarker.parentNode
1804
+ });
1805
+ return d;
1806
+ }));
565
1807
  return () => {
1808
+ dispose();
566
1809
  let c = startMarker;
567
- while (c && c !== endMarker) {
1810
+ while (c) {
568
1811
  const n = c.nextSibling;
569
1812
  m.removeChild(c);
1813
+ if (c === endMarker) break;
570
1814
  c = n;
571
1815
  }
572
1816
  };
1817
+ },
1818
+ {
1819
+ schedule: true,
1820
+ ssrSource: "client"
1821
+ });
1822
+ solidJs.createEffect(mount, () => {
1823
+ const m = solidJs.untrack(mount);
1824
+ const ownerRoot = getDelegatedRoot(treeMarker);
1825
+ if (!ownerRoot || ownerRoot.contains(m)) return;
1826
+ registerDelegatedContainer(m, ownerRoot);
1827
+ return () => unregisterDelegatedContainer(m, ownerRoot);
1828
+ }, {
1829
+ ssrSource: "client"
1830
+ });
1831
+ if (solidJs.sharedConfig.hydrating) return solidJs.createMemo(() => treeMarker, {
1832
+ ssrSource: "client",
1833
+ loadingValue: undefined
573
1834
  });
574
1835
  return treeMarker;
575
1836
  }
576
- function createElementProxy(el, marker) {
577
- return new Proxy(el, {
578
- get(target, prop) {
579
- if (prop === "appendChild" || prop === "insertBefore") {
580
- return (...args) => {
581
- Object.defineProperty(args[0], "_$host", {
582
- get: () => marker.parentNode,
583
- configurable: true
584
- });
585
- target[prop](...args);
586
- };
587
- }
588
- const value = Reflect.get(target, prop);
589
- return typeof value === "function" ? value.bind(target) : value;
590
- }
591
- });
1837
+ const COMPONENT_BINDING = Symbol.for("dom-expressions.component-binding");
1838
+ function bindingOf(value) {
1839
+ return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
592
1840
  }
593
- function createDynamic(component, props) {
594
- const cached = solidJs.createMemo(component);
595
- return solidJs.createMemo(() => {
596
- const component = cached();
597
- switch (typeof component) {
598
- case "function":
599
- Object.assign(component, {
600
- [solidJs.$DEVCOMP]: true
601
- });
602
- return solidJs.untrack(() => component(props));
603
- case "string":
604
- const isSvg = SVGElements.has(component);
605
- const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, isSvg, solidJs.untrack(() => props.is));
606
- spread(el, props, isSvg);
607
- return el;
1841
+ function dynamic(source) {
1842
+ let latest = 0;
1843
+ const sites = new Set();
1844
+ let deliveredAddress;
1845
+ const resolveBinding = (next, prev) => {
1846
+ const binding = bindingOf(next);
1847
+ if (!binding) return next;
1848
+ deliveredAddress = binding.address;
1849
+ const prevBinding = bindingOf(prev);
1850
+ if (prevBinding && prevBinding.component === binding.component) {
1851
+ for (const deliver of sites) deliver(binding.address);
1852
+ return prev;
608
1853
  }
1854
+ return next;
1855
+ };
1856
+ const cached = solidJs.createMemo(prev => {
1857
+ const next = source();
1858
+ if (!next || typeof next.then !== "function") return resolveBinding(next, prev);
1859
+ const token = ++latest;
1860
+ return {
1861
+ then: (onFulfilled, onRejected) => next.then(resolved => onFulfilled(token === latest ? resolveBinding(resolved, prev) : resolved), onRejected)
1862
+ };
1863
+ }, {
1864
+ lazy: true
609
1865
  });
1866
+ return props => {
1867
+ return solidJs.createMemo(() => {
1868
+ const component = cached();
1869
+ switch (typeof component) {
1870
+ case "function":
1871
+ {
1872
+ Object.assign(component, {
1873
+ [solidJs.$DEVCOMP]: true
1874
+ });
1875
+ const binding = bindingOf(component);
1876
+ if (binding) {
1877
+ const [address, setAddress] = solidJs.createSignal(deliveredAddress ?? binding.address);
1878
+ sites.add(setAddress);
1879
+ solidJs.onCleanup(() => sites.delete(setAddress));
1880
+ return solidJs.untrack(() => binding.component(props, address));
1881
+ }
1882
+ return solidJs.untrack(() => component(props));
1883
+ }
1884
+ case "string":
1885
+ const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, solidJs.untrack(() => props.is));
1886
+ spread(el, props);
1887
+ return el;
1888
+ }
1889
+ });
1890
+ };
610
1891
  }
611
1892
  function Dynamic(props) {
612
- const others = solidJs.omit(props, "component");
613
- return createDynamic(() => props.component, others);
1893
+ const Comp = dynamic(() => props.component);
1894
+ return solidJs.createComponent(Comp, solidJs.omit(props, "component"));
1895
+ }
1896
+ function createElement(tagName, is = undefined) {
1897
+ return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
1898
+ is
1899
+ });
614
1900
  }
1901
+ function loadClientOnly(fn, setComp, exportName) {
1902
+ fn().then(m => setComp(() => exportName ? m[exportName] : m.default));
1903
+ }
1904
+ function clientOnly(fn, options = {},
1905
+ _moduleUrl) {
1906
+ const [comp, setComp] = solidJs.createSignal();
1907
+ let started = !options.lazy;
1908
+ started && loadClientOnly(fn, setComp, options.export);
1909
+ return props => {
1910
+ let Comp;
1911
+ let m;
1912
+ const rest = solidJs.omit(props, "fallback");
1913
+ if (!started) {
1914
+ started = true;
1915
+ loadClientOnly(fn, setComp, options.export);
1916
+ }
1917
+ if ((Comp = solidJs.untrack(comp)) && !solidJs.sharedConfig.hydrating) return Comp(rest);
1918
+ const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.hydrating);
1919
+ const gate = solidJs.createMemo(() => (Comp = comp(), m = mounted(), solidJs.untrack(() => Comp && m ? Comp(rest) : props.fallback)));
1920
+ const onHydrationEnd = solidJs.sharedConfig.onHydrationEnd;
1921
+ const release = () => setMounted(true);
1922
+ onHydrationEnd ? onHydrationEnd(release) : queueMicrotask(release);
1923
+ return gate;
1924
+ };
1925
+ }
1926
+ function httpStatus(_code, _text) {}
1927
+ function httpHeader(_name, _value, _options) {}
615
1928
 
616
- Object.defineProperty(exports, "ErrorBoundary", {
1929
+ Object.defineProperty(exports, "Errored", {
617
1930
  enumerable: true,
618
- get: function () { return solidJs.ErrorBoundary; }
1931
+ get: function () { return solidJs.Errored; }
619
1932
  });
620
1933
  Object.defineProperty(exports, "For", {
621
1934
  enumerable: true,
622
1935
  get: function () { return solidJs.For; }
623
1936
  });
1937
+ Object.defineProperty(exports, "Hydration", {
1938
+ enumerable: true,
1939
+ get: function () { return solidJs.Hydration; }
1940
+ });
1941
+ Object.defineProperty(exports, "Loading", {
1942
+ enumerable: true,
1943
+ get: function () { return solidJs.Loading; }
1944
+ });
624
1945
  Object.defineProperty(exports, "Match", {
625
1946
  enumerable: true,
626
1947
  get: function () { return solidJs.Match; }
627
1948
  });
628
- Object.defineProperty(exports, "Show", {
1949
+ Object.defineProperty(exports, "NoHydration", {
629
1950
  enumerable: true,
630
- get: function () { return solidJs.Show; }
1951
+ get: function () { return solidJs.NoHydration; }
631
1952
  });
632
- Object.defineProperty(exports, "Suspense", {
1953
+ Object.defineProperty(exports, "Repeat", {
633
1954
  enumerable: true,
634
- get: function () { return solidJs.Suspense; }
1955
+ get: function () { return solidJs.Repeat; }
1956
+ });
1957
+ Object.defineProperty(exports, "Reveal", {
1958
+ enumerable: true,
1959
+ get: function () { return solidJs.Reveal; }
1960
+ });
1961
+ Object.defineProperty(exports, "Show", {
1962
+ enumerable: true,
1963
+ get: function () { return solidJs.Show; }
635
1964
  });
636
1965
  Object.defineProperty(exports, "Switch", {
637
1966
  enumerable: true,
@@ -641,61 +1970,92 @@ Object.defineProperty(exports, "createComponent", {
641
1970
  enumerable: true,
642
1971
  get: function () { return solidJs.createComponent; }
643
1972
  });
644
- Object.defineProperty(exports, "effect", {
645
- enumerable: true,
646
- get: function () { return solidJs.createRenderEffect; }
647
- });
648
1973
  Object.defineProperty(exports, "getOwner", {
649
1974
  enumerable: true,
650
1975
  get: function () { return solidJs.getOwner; }
651
1976
  });
652
- Object.defineProperty(exports, "mergeProps", {
653
- enumerable: true,
654
- get: function () { return solidJs.merge; }
655
- });
656
1977
  Object.defineProperty(exports, "untrack", {
657
1978
  enumerable: true,
658
1979
  get: function () { return solidJs.untrack; }
659
1980
  });
660
- exports.Assets = voidFn;
661
1981
  exports.ChildProperties = ChildProperties;
662
1982
  exports.DOMElements = DOMElements;
1983
+ exports.DOMWithState = DOMWithState;
663
1984
  exports.DelegatedEvents = DelegatedEvents;
664
1985
  exports.Dynamic = Dynamic;
665
- exports.Hydration = Hydration;
1986
+ exports.HREF = HREF;
666
1987
  exports.HydrationScript = voidFn;
667
- exports.NoHydration = NoHydration;
1988
+ exports.MathMLElements = MathMLElements;
1989
+ exports.Namespaces = Namespaces;
668
1990
  exports.Portal = Portal;
669
- exports.Properties = Properties;
1991
+ exports.REVALIDATE_HEADER = REVALIDATE_HEADER;
1992
+ exports.RawTextElements = RawTextElements;
670
1993
  exports.RequestContext = RequestContext;
1994
+ exports.ResponseEnvelope = ResponseEnvelope;
1995
+ exports.SAFE_ERROR = SAFE_ERROR;
671
1996
  exports.SVGElements = SVGElements;
672
- exports.SVGNamespace = SVGNamespace;
673
- exports.addEventListener = addEventListener;
1997
+ exports.VoidElements = VoidElements;
1998
+ exports.acquireAsset = acquireAsset;
1999
+ exports.addEvent = addEvent;
2000
+ exports.applyRef = applyRef;
674
2001
  exports.assign = assign;
2002
+ exports.claimElement = claimElement;
2003
+ exports.claimElementTree = claimElementTree;
675
2004
  exports.className = className;
676
- exports.clearDelegatedEvents = clearDelegatedEvents;
677
- exports.createDynamic = createDynamic;
2005
+ exports.clearFlashCookie = clearFlashCookie;
2006
+ exports.clientOnly = clientOnly;
2007
+ exports.commitEventResponse = commitEventResponse;
2008
+ exports.composeMiddleware = composeMiddleware;
2009
+ exports.createRequestEvent = createRequestEvent;
2010
+ exports.createResponseStub = createResponseStub;
2011
+ exports.createSSRResponse = createSSRResponse;
678
2012
  exports.delegateEvents = delegateEvents;
2013
+ exports.dynamic = dynamic;
679
2014
  exports.dynamicProperty = dynamicProperty;
2015
+ exports.effect = effect;
680
2016
  exports.escape = escape;
681
2017
  exports.generateHydrationScript = voidFn;
682
- exports.getAssets = voidFn;
2018
+ exports.getDelegatedRoot = getDelegatedRoot;
2019
+ exports.getExpectedRedirectStatus = getExpectedRedirectStatus;
2020
+ exports.getFirstChild = getFirstChild;
683
2021
  exports.getHydrationKey = getHydrationKey;
684
2022
  exports.getNextElement = getNextElement;
685
2023
  exports.getNextMarker = getNextMarker;
686
2024
  exports.getNextMatch = getNextMatch;
2025
+ exports.getNextSibling = getNextSibling;
687
2026
  exports.getRequestEvent = voidFn;
2027
+ exports.getServerFunctionMetadata = getServerFunctionMetadata;
2028
+ exports.getServerFunctionRPC = getServerFunctionRPC;
2029
+ exports.hasFlashCookie = hasFlashCookie;
2030
+ exports.httpHeader = httpHeader;
2031
+ exports.httpStatus = httpStatus;
688
2032
  exports.hydrate = hydrate;
689
2033
  exports.insert = insert;
2034
+ exports.installHydrationRuntime = installHydrationRuntime;
690
2035
  exports.isDev = isDev;
2036
+ exports.isHref = isHref;
2037
+ exports.isResponseEnvelope = isResponseEnvelope;
2038
+ exports.isSafeError = isSafeError;
691
2039
  exports.isServer = isServer;
2040
+ exports.isServerFunction = isServerFunction;
2041
+ exports.markSafeError = markSafeError;
692
2042
  exports.memo = memo;
2043
+ exports.mergeProps = mergeProps;
2044
+ exports.parseCookieHeader = parseCookieHeader;
2045
+ exports.redirect = redirect;
2046
+ exports.ref = ref;
2047
+ exports.registerDelegatedContainer = registerDelegatedContainer;
2048
+ exports.registerDelegatedRoot = registerDelegatedRoot;
2049
+ exports.registerElementClaim = registerElementClaim;
2050
+ exports.reload = reload;
693
2051
  exports.render = render;
694
2052
  exports.renderToStream = renderToStream;
695
2053
  exports.renderToString = renderToString;
696
- exports.renderToStringAsync = renderToStringAsync;
697
2054
  exports.resolveSSRNode = resolveSSRNode;
2055
+ exports.respond = respond;
698
2056
  exports.runHydrationEvents = runHydrationEvents;
2057
+ exports.scope = scope;
2058
+ exports.serializeCookie = serializeCookie;
699
2059
  exports.setAttribute = setAttribute;
700
2060
  exports.setAttributeNS = setAttributeNS;
701
2061
  exports.setProperty = setProperty;
@@ -703,11 +2063,15 @@ exports.setStyleProperty = setStyleProperty;
703
2063
  exports.spread = spread;
704
2064
  exports.ssr = ssr;
705
2065
  exports.ssrAttribute = ssrAttribute;
706
- exports.ssrClassList = ssrClassList;
2066
+ exports.ssrClassName = ssrClassName;
707
2067
  exports.ssrElement = ssrElement;
2068
+ exports.ssrGroup = ssrGroup;
708
2069
  exports.ssrHydrationKey = ssrHydrationKey;
709
2070
  exports.ssrStyle = ssrStyle;
2071
+ exports.ssrStyleProperty = ssrStyleProperty;
710
2072
  exports.style = style;
711
2073
  exports.template = template;
712
- exports.use = use;
713
- exports.useAssets = voidFn;
2074
+ exports.unregisterDelegatedContainer = unregisterDelegatedContainer;
2075
+ exports.unregisterDelegatedRoot = unregisterDelegatedRoot;
2076
+ exports.useHead = useHead;
2077
+ exports.warmAsset = warmAsset;