@stacksjs/browser 0.70.10 → 0.70.12

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 (2) hide show
  1. package/dist/index.js +217 -400
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -14740,8 +14740,31 @@ var HasElementTags = /* @__PURE__ */ new Set([
14740
14740
  "script",
14741
14741
  "noscript"
14742
14742
  ]);
14743
+ var ValidHeadTags = /* @__PURE__ */ new Set([
14744
+ "title",
14745
+ "titleTemplate",
14746
+ "templateParams",
14747
+ "base",
14748
+ "htmlAttrs",
14749
+ "bodyAttrs",
14750
+ "meta",
14751
+ "link",
14752
+ "style",
14753
+ "script",
14754
+ "noscript"
14755
+ ]);
14743
14756
  var UniqueTags = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]);
14744
14757
  var TagConfigKeys = /* @__PURE__ */ new Set(["tagPosition", "tagPriority", "tagDuplicateStrategy", "children", "innerHTML", "textContent", "processTemplateParams"]);
14758
+ var IsBrowser = typeof window !== "undefined";
14759
+ var composableNames = [
14760
+ "getActiveHead",
14761
+ "useHead",
14762
+ "useSeoMeta",
14763
+ "useHeadSafe",
14764
+ "useServerHead",
14765
+ "useServerSeoMeta",
14766
+ "useServerHeadSafe"
14767
+ ];
14745
14768
  function defineHeadPlugin(plugin) {
14746
14769
  return plugin;
14747
14770
  }
@@ -14850,6 +14873,42 @@ function fixKeyCase(key) {
14850
14873
  return key.replace(/([A-Z])/g, ":$1").toLowerCase();
14851
14874
  return updated;
14852
14875
  }
14876
+ function thenable(val, thenFn) {
14877
+ if (val instanceof Promise) {
14878
+ return val.then(thenFn);
14879
+ }
14880
+ return thenFn(val);
14881
+ }
14882
+ function normaliseTag(tagName, input, e, normalizedProps) {
14883
+ const props = normalizedProps || normaliseProps(typeof input === "object" && typeof input !== "function" && !(input instanceof Promise) ? { ...input } : { [tagName === "script" || tagName === "noscript" || tagName === "style" ? "innerHTML" : "textContent"]: input }, tagName === "templateParams" || tagName === "titleTemplate");
14884
+ if (props instanceof Promise) {
14885
+ return props.then((val) => normaliseTag(tagName, input, e, val));
14886
+ }
14887
+ const tag = {
14888
+ tag: tagName,
14889
+ props
14890
+ };
14891
+ for (const k2 of TagConfigKeys) {
14892
+ const val = tag.props[k2] !== undefined ? tag.props[k2] : e[k2];
14893
+ if (val !== undefined) {
14894
+ if (!(k2 === "innerHTML" || k2 === "textContent" || k2 === "children") || TagsWithInnerContent.has(tag.tag)) {
14895
+ tag[k2 === "children" ? "innerHTML" : k2] = val;
14896
+ }
14897
+ delete tag.props[k2];
14898
+ }
14899
+ }
14900
+ if (tag.props.body) {
14901
+ tag.tagPosition = "bodyClose";
14902
+ delete tag.props.body;
14903
+ }
14904
+ if (tag.tag === "script") {
14905
+ if (typeof tag.innerHTML === "object") {
14906
+ tag.innerHTML = JSON.stringify(tag.innerHTML);
14907
+ tag.props.type = tag.props.type || "application/json";
14908
+ }
14909
+ }
14910
+ return Array.isArray(tag.props.content) ? tag.props.content.map((v) => ({ ...tag, props: { ...tag.props, content: v } })) : tag;
14911
+ }
14853
14912
  function normaliseStyleClassProps(key, v) {
14854
14913
  const sep = key === "class" ? " " : ";";
14855
14914
  if (v && typeof v === "object" && !Array.isArray(v)) {
@@ -14891,6 +14950,86 @@ function normaliseProps(props, virtual = false) {
14891
14950
  }
14892
14951
  return props;
14893
14952
  }
14953
+ var TagEntityBits = 10;
14954
+ function nestedNormaliseEntryTags(headTags, tagPromises, startIndex) {
14955
+ for (let i = startIndex;i < tagPromises.length; i += 1) {
14956
+ const tags = tagPromises[i];
14957
+ if (tags instanceof Promise) {
14958
+ return tags.then((val) => {
14959
+ tagPromises[i] = val;
14960
+ return nestedNormaliseEntryTags(headTags, tagPromises, i);
14961
+ });
14962
+ }
14963
+ if (Array.isArray(tags)) {
14964
+ headTags.push(...tags);
14965
+ } else {
14966
+ headTags.push(tags);
14967
+ }
14968
+ }
14969
+ }
14970
+ function normaliseEntryTags(e) {
14971
+ const tagPromises = [];
14972
+ const input = e.resolvedInput;
14973
+ for (const k2 in input) {
14974
+ if (!Object.prototype.hasOwnProperty.call(input, k2)) {
14975
+ continue;
14976
+ }
14977
+ const v = input[k2];
14978
+ if (v === undefined || !ValidHeadTags.has(k2)) {
14979
+ continue;
14980
+ }
14981
+ if (Array.isArray(v)) {
14982
+ for (const props of v) {
14983
+ tagPromises.push(normaliseTag(k2, props, e));
14984
+ }
14985
+ continue;
14986
+ }
14987
+ tagPromises.push(normaliseTag(k2, v, e));
14988
+ }
14989
+ if (tagPromises.length === 0) {
14990
+ return [];
14991
+ }
14992
+ const headTags = [];
14993
+ return thenable(nestedNormaliseEntryTags(headTags, tagPromises, 0), () => headTags.map((t, i) => {
14994
+ t._e = e._i;
14995
+ e.mode && (t._m = e.mode);
14996
+ t._p = (e._i << TagEntityBits) + i;
14997
+ return t;
14998
+ }));
14999
+ }
15000
+ var NetworkEvents = /* @__PURE__ */ new Set(["onload", "onerror", "onabort", "onprogress", "onloadstart"]);
15001
+ var TAG_WEIGHTS = {
15002
+ base: -10,
15003
+ title: 10
15004
+ };
15005
+ var TAG_ALIASES = {
15006
+ critical: -80,
15007
+ high: -10,
15008
+ low: 20
15009
+ };
15010
+ function tagWeight(tag) {
15011
+ const priority = tag.tagPriority;
15012
+ if (typeof priority === "number")
15013
+ return priority;
15014
+ let weight = 100;
15015
+ if (tag.tag === "meta") {
15016
+ if (tag.props["http-equiv"] === "content-security-policy")
15017
+ weight = -30;
15018
+ else if (tag.props.charset)
15019
+ weight = -20;
15020
+ else if (tag.props.name === "viewport")
15021
+ weight = -15;
15022
+ } else if (tag.tag === "link" && tag.props.rel === "preconnect") {
15023
+ weight = 20;
15024
+ } else if (tag.tag in TAG_WEIGHTS) {
15025
+ weight = TAG_WEIGHTS[tag.tag];
15026
+ }
15027
+ if (priority && priority in TAG_ALIASES) {
15028
+ return weight + TAG_ALIASES[priority];
15029
+ }
15030
+ return weight;
15031
+ }
15032
+ var SortModifiers = [{ prefix: "before:", offset: -1 }, { prefix: "after:", offset: 1 }];
14894
15033
  var allowedMetaProperties = ["name", "property", "http-equiv"];
14895
15034
  function tagDedupeKey(tag) {
14896
15035
  const { props, tag: tagName } = tag;
@@ -14911,7 +15050,57 @@ function tagDedupeKey(tag) {
14911
15050
  return false;
14912
15051
  }
14913
15052
  var sepSub = "%separator";
15053
+ function sub(p2, token, isJson = false) {
15054
+ let val;
15055
+ if (token === "s" || token === "pageTitle") {
15056
+ val = p2.pageTitle;
15057
+ } else if (token.includes(".")) {
15058
+ const dotIndex = token.indexOf(".");
15059
+ val = p2[token.substring(0, dotIndex)]?.[token.substring(dotIndex + 1)];
15060
+ } else {
15061
+ val = p2[token];
15062
+ }
15063
+ if (val !== undefined) {
15064
+ return isJson ? (val || "").replace(/"/g, "\\\"") : val || "";
15065
+ }
15066
+ return;
15067
+ }
14914
15068
  var sepSubRe = new RegExp(`${sepSub}(?:\\s*${sepSub})*`, "g");
15069
+ function processTemplateParams(s, p2, sep, isJson = false) {
15070
+ if (typeof s !== "string" || !s.includes("%"))
15071
+ return s;
15072
+ let decoded = s;
15073
+ try {
15074
+ decoded = decodeURI(s);
15075
+ } catch {}
15076
+ const tokens2 = decoded.match(/%\w+(?:\.\w+)?/g);
15077
+ if (!tokens2) {
15078
+ return s;
15079
+ }
15080
+ const hasSepSub = s.includes(sepSub);
15081
+ s = s.replace(/%\w+(?:\.\w+)?/g, (token) => {
15082
+ if (token === sepSub || !tokens2.includes(token)) {
15083
+ return token;
15084
+ }
15085
+ const re = sub(p2, token.slice(1), isJson);
15086
+ return re !== undefined ? re : token;
15087
+ }).trim();
15088
+ if (hasSepSub) {
15089
+ if (s.endsWith(sepSub))
15090
+ s = s.slice(0, -sepSub.length);
15091
+ if (s.startsWith(sepSub))
15092
+ s = s.slice(sepSub.length);
15093
+ s = s.replace(sepSubRe, sep).trim();
15094
+ }
15095
+ return s;
15096
+ }
15097
+ function resolveTitleTemplate(template2, title) {
15098
+ if (template2 == null)
15099
+ return title || null;
15100
+ if (typeof template2 === "function")
15101
+ return template2(title);
15102
+ return template2;
15103
+ }
14915
15104
 
14916
15105
  // ../../../../node_modules/@unhead/dom/dist/index.mjs
14917
15106
  async function renderDOMHead(head, options = {}) {
@@ -15099,378 +15288,6 @@ function DomPlugin(options) {
15099
15288
  });
15100
15289
  }
15101
15290
 
15102
- // ../../../../node_modules/@vueuse/head/node_modules/@unhead/vue/node_modules/@unhead/shared/dist/index.mjs
15103
- var TagsWithInnerContent2 = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
15104
- var HasElementTags2 = /* @__PURE__ */ new Set([
15105
- "base",
15106
- "meta",
15107
- "link",
15108
- "style",
15109
- "script",
15110
- "noscript"
15111
- ]);
15112
- var ValidHeadTags = /* @__PURE__ */ new Set([
15113
- "title",
15114
- "titleTemplate",
15115
- "templateParams",
15116
- "base",
15117
- "htmlAttrs",
15118
- "bodyAttrs",
15119
- "meta",
15120
- "link",
15121
- "style",
15122
- "script",
15123
- "noscript"
15124
- ]);
15125
- var UniqueTags2 = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]);
15126
- var TagConfigKeys2 = /* @__PURE__ */ new Set(["tagPosition", "tagPriority", "tagDuplicateStrategy", "children", "innerHTML", "textContent", "processTemplateParams"]);
15127
- var IsBrowser = typeof window !== "undefined";
15128
- var composableNames = [
15129
- "getActiveHead",
15130
- "useHead",
15131
- "useSeoMeta",
15132
- "useHeadSafe",
15133
- "useServerHead",
15134
- "useServerSeoMeta",
15135
- "useServerHeadSafe"
15136
- ];
15137
- function defineHeadPlugin2(plugin) {
15138
- return plugin;
15139
- }
15140
- function hashCode2(s) {
15141
- let h2 = 9;
15142
- for (let i = 0;i < s.length; )
15143
- h2 = Math.imul(h2 ^ s.charCodeAt(i++), 9 ** 9);
15144
- return ((h2 ^ h2 >>> 9) + 65536).toString(16).substring(1, 8).toLowerCase();
15145
- }
15146
- function hashTag2(tag) {
15147
- if (tag._h) {
15148
- return tag._h;
15149
- }
15150
- if (tag._d) {
15151
- return hashCode2(tag._d);
15152
- }
15153
- let content = `${tag.tag}:${tag.textContent || tag.innerHTML || ""}:`;
15154
- for (const key in tag.props) {
15155
- content += `${key}:${String(tag.props[key])},`;
15156
- }
15157
- return hashCode2(content);
15158
- }
15159
- var p2 = (p22) => ({ keyValue: p22, metaKey: "property" });
15160
- var k2 = (p22) => ({ keyValue: p22 });
15161
- var MetaPackingSchema2 = {
15162
- appleItunesApp: {
15163
- unpack: {
15164
- entrySeparator: ", ",
15165
- resolve({ key, value }) {
15166
- return `${fixKeyCase2(key)}=${value}`;
15167
- }
15168
- }
15169
- },
15170
- articleExpirationTime: p2("article:expiration_time"),
15171
- articleModifiedTime: p2("article:modified_time"),
15172
- articlePublishedTime: p2("article:published_time"),
15173
- bookReleaseDate: p2("book:release_date"),
15174
- charset: {
15175
- metaKey: "charset"
15176
- },
15177
- contentSecurityPolicy: {
15178
- unpack: {
15179
- entrySeparator: "; ",
15180
- resolve({ key, value }) {
15181
- return `${fixKeyCase2(key)} ${value}`;
15182
- }
15183
- },
15184
- metaKey: "http-equiv"
15185
- },
15186
- contentType: {
15187
- metaKey: "http-equiv"
15188
- },
15189
- defaultStyle: {
15190
- metaKey: "http-equiv"
15191
- },
15192
- fbAppId: p2("fb:app_id"),
15193
- msapplicationConfig: k2("msapplication-Config"),
15194
- msapplicationTileColor: k2("msapplication-TileColor"),
15195
- msapplicationTileImage: k2("msapplication-TileImage"),
15196
- ogAudioSecureUrl: p2("og:audio:secure_url"),
15197
- ogAudioUrl: p2("og:audio"),
15198
- ogImageSecureUrl: p2("og:image:secure_url"),
15199
- ogImageUrl: p2("og:image"),
15200
- ogSiteName: p2("og:site_name"),
15201
- ogVideoSecureUrl: p2("og:video:secure_url"),
15202
- ogVideoUrl: p2("og:video"),
15203
- profileFirstName: p2("profile:first_name"),
15204
- profileLastName: p2("profile:last_name"),
15205
- profileUsername: p2("profile:username"),
15206
- refresh: {
15207
- metaKey: "http-equiv",
15208
- unpack: {
15209
- entrySeparator: ";",
15210
- resolve({ key, value }) {
15211
- if (key === "seconds")
15212
- return `${value}`;
15213
- }
15214
- }
15215
- },
15216
- robots: {
15217
- unpack: {
15218
- entrySeparator: ", ",
15219
- resolve({ key, value }) {
15220
- if (typeof value === "boolean")
15221
- return `${fixKeyCase2(key)}`;
15222
- else
15223
- return `${fixKeyCase2(key)}:${value}`;
15224
- }
15225
- }
15226
- },
15227
- xUaCompatible: {
15228
- metaKey: "http-equiv"
15229
- }
15230
- };
15231
- var openGraphNamespaces2 = /* @__PURE__ */ new Set([
15232
- "og",
15233
- "book",
15234
- "article",
15235
- "profile"
15236
- ]);
15237
- function fixKeyCase2(key) {
15238
- const updated = key.replace(/([A-Z])/g, "-$1").toLowerCase();
15239
- const prefixIndex = updated.indexOf("-");
15240
- const fKey = updated.substring(0, prefixIndex);
15241
- if (fKey === "twitter" || openGraphNamespaces2.has(fKey))
15242
- return key.replace(/([A-Z])/g, ":$1").toLowerCase();
15243
- return updated;
15244
- }
15245
- function thenable(val, thenFn) {
15246
- if (val instanceof Promise) {
15247
- return val.then(thenFn);
15248
- }
15249
- return thenFn(val);
15250
- }
15251
- function normaliseTag(tagName, input, e, normalizedProps) {
15252
- const props = normalizedProps || normaliseProps2(typeof input === "object" && typeof input !== "function" && !(input instanceof Promise) ? { ...input } : { [tagName === "script" || tagName === "noscript" || tagName === "style" ? "innerHTML" : "textContent"]: input }, tagName === "templateParams" || tagName === "titleTemplate");
15253
- if (props instanceof Promise) {
15254
- return props.then((val) => normaliseTag(tagName, input, e, val));
15255
- }
15256
- const tag = {
15257
- tag: tagName,
15258
- props
15259
- };
15260
- for (const k3 of TagConfigKeys2) {
15261
- const val = tag.props[k3] !== undefined ? tag.props[k3] : e[k3];
15262
- if (val !== undefined) {
15263
- if (!(k3 === "innerHTML" || k3 === "textContent" || k3 === "children") || TagsWithInnerContent2.has(tag.tag)) {
15264
- tag[k3 === "children" ? "innerHTML" : k3] = val;
15265
- }
15266
- delete tag.props[k3];
15267
- }
15268
- }
15269
- if (tag.props.body) {
15270
- tag.tagPosition = "bodyClose";
15271
- delete tag.props.body;
15272
- }
15273
- if (tag.tag === "script") {
15274
- if (typeof tag.innerHTML === "object") {
15275
- tag.innerHTML = JSON.stringify(tag.innerHTML);
15276
- tag.props.type = tag.props.type || "application/json";
15277
- }
15278
- }
15279
- return Array.isArray(tag.props.content) ? tag.props.content.map((v) => ({ ...tag, props: { ...tag.props, content: v } })) : tag;
15280
- }
15281
- function normaliseStyleClassProps2(key, v) {
15282
- const sep = key === "class" ? " " : ";";
15283
- if (v && typeof v === "object" && !Array.isArray(v)) {
15284
- v = Object.entries(v).filter(([, v2]) => v2).map(([k3, v2]) => key === "style" ? `${k3}:${v2}` : k3);
15285
- }
15286
- return String(Array.isArray(v) ? v.join(sep) : v)?.split(sep).filter((c) => Boolean(c.trim())).join(sep);
15287
- }
15288
- function nestedNormaliseProps2(props, virtual, keys2, startIndex) {
15289
- for (let i = startIndex;i < keys2.length; i += 1) {
15290
- const k3 = keys2[i];
15291
- if (k3 === "class" || k3 === "style") {
15292
- props[k3] = normaliseStyleClassProps2(k3, props[k3]);
15293
- continue;
15294
- }
15295
- if (props[k3] instanceof Promise) {
15296
- return props[k3].then((val) => {
15297
- props[k3] = val;
15298
- return nestedNormaliseProps2(props, virtual, keys2, i);
15299
- });
15300
- }
15301
- if (!virtual && !TagConfigKeys2.has(k3)) {
15302
- const v = String(props[k3]);
15303
- const isDataKey = k3.startsWith("data-");
15304
- if (v === "true" || v === "") {
15305
- props[k3] = isDataKey ? "true" : true;
15306
- } else if (!props[k3]) {
15307
- if (isDataKey && v === "false")
15308
- props[k3] = "false";
15309
- else
15310
- delete props[k3];
15311
- }
15312
- }
15313
- }
15314
- }
15315
- function normaliseProps2(props, virtual = false) {
15316
- const resolvedProps = nestedNormaliseProps2(props, virtual, Object.keys(props), 0);
15317
- if (resolvedProps instanceof Promise) {
15318
- return resolvedProps.then(() => props);
15319
- }
15320
- return props;
15321
- }
15322
- var TagEntityBits = 10;
15323
- function nestedNormaliseEntryTags(headTags, tagPromises, startIndex) {
15324
- for (let i = startIndex;i < tagPromises.length; i += 1) {
15325
- const tags = tagPromises[i];
15326
- if (tags instanceof Promise) {
15327
- return tags.then((val) => {
15328
- tagPromises[i] = val;
15329
- return nestedNormaliseEntryTags(headTags, tagPromises, i);
15330
- });
15331
- }
15332
- if (Array.isArray(tags)) {
15333
- headTags.push(...tags);
15334
- } else {
15335
- headTags.push(tags);
15336
- }
15337
- }
15338
- }
15339
- function normaliseEntryTags(e) {
15340
- const tagPromises = [];
15341
- const input = e.resolvedInput;
15342
- for (const k3 in input) {
15343
- if (!Object.prototype.hasOwnProperty.call(input, k3)) {
15344
- continue;
15345
- }
15346
- const v = input[k3];
15347
- if (v === undefined || !ValidHeadTags.has(k3)) {
15348
- continue;
15349
- }
15350
- if (Array.isArray(v)) {
15351
- for (const props of v) {
15352
- tagPromises.push(normaliseTag(k3, props, e));
15353
- }
15354
- continue;
15355
- }
15356
- tagPromises.push(normaliseTag(k3, v, e));
15357
- }
15358
- if (tagPromises.length === 0) {
15359
- return [];
15360
- }
15361
- const headTags = [];
15362
- return thenable(nestedNormaliseEntryTags(headTags, tagPromises, 0), () => headTags.map((t, i) => {
15363
- t._e = e._i;
15364
- e.mode && (t._m = e.mode);
15365
- t._p = (e._i << TagEntityBits) + i;
15366
- return t;
15367
- }));
15368
- }
15369
- var NetworkEvents = /* @__PURE__ */ new Set(["onload", "onerror", "onabort", "onprogress", "onloadstart"]);
15370
- var TAG_WEIGHTS = {
15371
- base: -10,
15372
- title: 10
15373
- };
15374
- var TAG_ALIASES = {
15375
- critical: -80,
15376
- high: -10,
15377
- low: 20
15378
- };
15379
- function tagWeight(tag) {
15380
- const priority = tag.tagPriority;
15381
- if (typeof priority === "number")
15382
- return priority;
15383
- let weight = 100;
15384
- if (tag.tag === "meta") {
15385
- if (tag.props["http-equiv"] === "content-security-policy")
15386
- weight = -30;
15387
- else if (tag.props.charset)
15388
- weight = -20;
15389
- else if (tag.props.name === "viewport")
15390
- weight = -15;
15391
- } else if (tag.tag === "link" && tag.props.rel === "preconnect") {
15392
- weight = 20;
15393
- } else if (tag.tag in TAG_WEIGHTS) {
15394
- weight = TAG_WEIGHTS[tag.tag];
15395
- }
15396
- if (priority && priority in TAG_ALIASES) {
15397
- return weight + TAG_ALIASES[priority];
15398
- }
15399
- return weight;
15400
- }
15401
- var SortModifiers = [{ prefix: "before:", offset: -1 }, { prefix: "after:", offset: 1 }];
15402
- var allowedMetaProperties2 = ["name", "property", "http-equiv"];
15403
- function tagDedupeKey2(tag) {
15404
- const { props, tag: tagName } = tag;
15405
- if (UniqueTags2.has(tagName))
15406
- return tagName;
15407
- if (tagName === "link" && props.rel === "canonical")
15408
- return "canonical";
15409
- if (props.charset)
15410
- return "charset";
15411
- if (props.id) {
15412
- return `${tagName}:id:${props.id}`;
15413
- }
15414
- for (const n of allowedMetaProperties2) {
15415
- if (props[n] !== undefined) {
15416
- return `${tagName}:${n}:${props[n]}`;
15417
- }
15418
- }
15419
- return false;
15420
- }
15421
- var sepSub2 = "%separator";
15422
- function sub(p3, token, isJson = false) {
15423
- let val;
15424
- if (token === "s" || token === "pageTitle") {
15425
- val = p3.pageTitle;
15426
- } else if (token.includes(".")) {
15427
- const dotIndex = token.indexOf(".");
15428
- val = p3[token.substring(0, dotIndex)]?.[token.substring(dotIndex + 1)];
15429
- } else {
15430
- val = p3[token];
15431
- }
15432
- if (val !== undefined) {
15433
- return isJson ? (val || "").replace(/"/g, "\\\"") : val || "";
15434
- }
15435
- return;
15436
- }
15437
- var sepSubRe2 = new RegExp(`${sepSub2}(?:\\s*${sepSub2})*`, "g");
15438
- function processTemplateParams(s, p3, sep, isJson = false) {
15439
- if (typeof s !== "string" || !s.includes("%"))
15440
- return s;
15441
- let decoded = s;
15442
- try {
15443
- decoded = decodeURI(s);
15444
- } catch {}
15445
- const tokens2 = decoded.match(/%\w+(?:\.\w+)?/g);
15446
- if (!tokens2) {
15447
- return s;
15448
- }
15449
- const hasSepSub = s.includes(sepSub2);
15450
- s = s.replace(/%\w+(?:\.\w+)?/g, (token) => {
15451
- if (token === sepSub2 || !tokens2.includes(token)) {
15452
- return token;
15453
- }
15454
- const re = sub(p3, token.slice(1), isJson);
15455
- return re !== undefined ? re : token;
15456
- }).trim();
15457
- if (hasSepSub) {
15458
- if (s.endsWith(sepSub2))
15459
- s = s.slice(0, -sepSub2.length);
15460
- if (s.startsWith(sepSub2))
15461
- s = s.slice(sepSub2.length);
15462
- s = s.replace(sepSubRe2, sep).trim();
15463
- }
15464
- return s;
15465
- }
15466
- function resolveTitleTemplate(template2, title) {
15467
- if (template2 == null)
15468
- return title || null;
15469
- if (typeof template2 === "function")
15470
- return template2(title);
15471
- return template2;
15472
- }
15473
-
15474
15291
  // ../../../../node_modules/hookable/dist/index.mjs
15475
15292
  function flatHooks(configHooks, hooks = {}, parentName) {
15476
15293
  for (const key in configHooks) {
@@ -15669,7 +15486,7 @@ function createHooks() {
15669
15486
 
15670
15487
  // ../../../../node_modules/@vueuse/head/node_modules/@unhead/vue/node_modules/unhead/dist/index.mjs
15671
15488
  var UsesMergeStrategy = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]);
15672
- var DedupePlugin = defineHeadPlugin2({
15489
+ var DedupePlugin = defineHeadPlugin({
15673
15490
  hooks: {
15674
15491
  "tag:normalise": ({ tag }) => {
15675
15492
  if (tag.props.hid) {
@@ -15684,7 +15501,7 @@ var DedupePlugin = defineHeadPlugin2({
15684
15501
  tag.key = tag.props.key;
15685
15502
  delete tag.props.key;
15686
15503
  }
15687
- const generatedKey = tagDedupeKey2(tag);
15504
+ const generatedKey = tagDedupeKey(tag);
15688
15505
  if (generatedKey && !generatedKey.startsWith("meta:og:") && !generatedKey.startsWith("meta:twitter:")) {
15689
15506
  delete tag.key;
15690
15507
  }
@@ -15695,7 +15512,7 @@ var DedupePlugin = defineHeadPlugin2({
15695
15512
  "tags:resolve": (ctx) => {
15696
15513
  const deduping = /* @__PURE__ */ Object.create(null);
15697
15514
  for (const tag of ctx.tags) {
15698
- const dedupeKey = (tag.key ? `${tag.tag}:${tag.key}` : tag._d) || hashTag2(tag);
15515
+ const dedupeKey = (tag.key ? `${tag.tag}:${tag.key}` : tag._d) || hashTag(tag);
15699
15516
  const dupedTag = deduping[dedupeKey];
15700
15517
  if (dupedTag) {
15701
15518
  let strategy = tag?.tagDuplicateStrategy;
@@ -15729,7 +15546,7 @@ var DedupePlugin = defineHeadPlugin2({
15729
15546
  }
15730
15547
  }
15731
15548
  const hasProps = tag.innerHTML || tag.textContent || Object.keys(tag.props).length !== 0;
15732
- if (!hasProps && HasElementTags2.has(tag.tag)) {
15549
+ if (!hasProps && HasElementTags.has(tag.tag)) {
15733
15550
  delete deduping[dedupeKey];
15734
15551
  continue;
15735
15552
  }
@@ -15751,7 +15568,7 @@ var DedupePlugin = defineHeadPlugin2({
15751
15568
  }
15752
15569
  });
15753
15570
  var ValidEventTags = /* @__PURE__ */ new Set(["script", "link", "bodyAttrs"]);
15754
- var EventHandlersPlugin = defineHeadPlugin2((head) => ({
15571
+ var EventHandlersPlugin = defineHeadPlugin((head) => ({
15755
15572
  hooks: {
15756
15573
  "tags:resolve": (ctx) => {
15757
15574
  for (const tag of ctx.tags) {
@@ -15779,7 +15596,7 @@ var EventHandlersPlugin = defineHeadPlugin2((head) => ({
15779
15596
  tag._eventHandlers[key] = value;
15780
15597
  }
15781
15598
  if (head.ssr && tag._eventHandlers && (tag.props.src || tag.props.href)) {
15782
- tag.key = tag.key || hashCode2(tag.props.src || tag.props.href);
15599
+ tag.key = tag.key || hashCode(tag.props.src || tag.props.href);
15783
15600
  }
15784
15601
  }
15785
15602
  },
@@ -15788,11 +15605,11 @@ var EventHandlersPlugin = defineHeadPlugin2((head) => ({
15788
15605
  if (!dataset) {
15789
15606
  return;
15790
15607
  }
15791
- for (const k3 in dataset) {
15792
- if (!k3.endsWith("fired")) {
15608
+ for (const k2 in dataset) {
15609
+ if (!k2.endsWith("fired")) {
15793
15610
  continue;
15794
15611
  }
15795
- const ek = k3.slice(0, -5);
15612
+ const ek = k2.slice(0, -5);
15796
15613
  if (!NetworkEvents.has(ek)) {
15797
15614
  continue;
15798
15615
  }
@@ -15802,16 +15619,16 @@ var EventHandlersPlugin = defineHeadPlugin2((head) => ({
15802
15619
  }
15803
15620
  }));
15804
15621
  var DupeableTags = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]);
15805
- var HashKeyedPlugin = defineHeadPlugin2({
15622
+ var HashKeyedPlugin = defineHeadPlugin({
15806
15623
  hooks: {
15807
15624
  "tag:normalise": ({ tag }) => {
15808
15625
  if (tag.key && DupeableTags.has(tag.tag)) {
15809
- tag.props["data-hid"] = tag._h = hashCode2(tag.key);
15626
+ tag.props["data-hid"] = tag._h = hashCode(tag.key);
15810
15627
  }
15811
15628
  }
15812
15629
  }
15813
15630
  });
15814
- var PayloadPlugin = defineHeadPlugin2({
15631
+ var PayloadPlugin = defineHeadPlugin({
15815
15632
  mode: "server",
15816
15633
  hooks: {
15817
15634
  "tags:beforeResolve": (ctx) => {
@@ -15834,7 +15651,7 @@ var PayloadPlugin = defineHeadPlugin2({
15834
15651
  }
15835
15652
  }
15836
15653
  });
15837
- var SortPlugin = defineHeadPlugin2({
15654
+ var SortPlugin = defineHeadPlugin({
15838
15655
  hooks: {
15839
15656
  "tags:resolve": (ctx) => {
15840
15657
  for (const tag of ctx.tags) {
@@ -15872,7 +15689,7 @@ var SupportedAttrs = {
15872
15689
  htmlAttrs: "lang"
15873
15690
  };
15874
15691
  var contentAttrs = ["innerHTML", "textContent"];
15875
- var TemplateParamsPlugin = defineHeadPlugin2((head) => ({
15692
+ var TemplateParamsPlugin = defineHeadPlugin((head) => ({
15876
15693
  hooks: {
15877
15694
  "tags:resolve": (ctx) => {
15878
15695
  const { tags } = ctx;
@@ -15897,9 +15714,9 @@ var TemplateParamsPlugin = defineHeadPlugin2((head) => ({
15897
15714
  if (v && typeof tag.props[v] === "string") {
15898
15715
  tag.props[v] = processTemplateParams(tag.props[v], params, sep);
15899
15716
  } else if (tag.processTemplateParams || tag.tag === "titleTemplate" || tag.tag === "title") {
15900
- for (const p3 of contentAttrs) {
15901
- if (typeof tag[p3] === "string")
15902
- tag[p3] = processTemplateParams(tag[p3], params, sep, tag.tag === "script" && tag.props.type.endsWith("json"));
15717
+ for (const p2 of contentAttrs) {
15718
+ if (typeof tag[p2] === "string")
15719
+ tag[p2] = processTemplateParams(tag[p2], params, sep, tag.tag === "script" && tag.props.type.endsWith("json"));
15903
15720
  }
15904
15721
  }
15905
15722
  }
@@ -15920,7 +15737,7 @@ var TemplateParamsPlugin = defineHeadPlugin2((head) => ({
15920
15737
  }
15921
15738
  }
15922
15739
  }));
15923
- var TitleTemplatePlugin = defineHeadPlugin2({
15740
+ var TitleTemplatePlugin = defineHeadPlugin({
15924
15741
  hooks: {
15925
15742
  "tags:resolve": (ctx) => {
15926
15743
  const { tags } = ctx;
@@ -15955,7 +15772,7 @@ var TitleTemplatePlugin = defineHeadPlugin2({
15955
15772
  }
15956
15773
  }
15957
15774
  });
15958
- var XSSPlugin = defineHeadPlugin2({
15775
+ var XSSPlugin = defineHeadPlugin({
15959
15776
  hooks: {
15960
15777
  "tags:afterResolve": (ctx) => {
15961
15778
  for (const tag of ctx.tags) {
@@ -15999,8 +15816,8 @@ function createHeadCore(options = {}) {
15999
15816
  headEntries() {
16000
15817
  return entries;
16001
15818
  },
16002
- use(p3) {
16003
- const plugin = typeof p3 === "function" ? p3(head) : p3;
15819
+ use(p2) {
15820
+ const plugin = typeof p2 === "function" ? p2(head) : p2;
16004
15821
  if (!plugin.key || !plugins.some((p22) => p22.key === plugin.key)) {
16005
15822
  plugins.push(plugin);
16006
15823
  filterMode(plugin.mode, ssr) && hooks.addHooks(plugin.hooks || {});
@@ -16063,7 +15880,7 @@ function createHeadCore(options = {}) {
16063
15880
  TitleTemplatePlugin,
16064
15881
  XSSPlugin,
16065
15882
  ...options?.plugins || []
16066
- ].forEach((p3) => head.use(p3));
15883
+ ].forEach((p2) => head.use(p2));
16067
15884
  head.hooks.callHook("init", head);
16068
15885
  return head;
16069
15886
  }
@@ -16089,21 +15906,21 @@ function resolveUnrefHeadInput(ref2) {
16089
15906
  return root.map((r) => resolveUnrefHeadInput(r));
16090
15907
  if (typeof root === "object") {
16091
15908
  const resolved = {};
16092
- for (const k3 in root) {
16093
- if (!Object.prototype.hasOwnProperty.call(root, k3)) {
15909
+ for (const k2 in root) {
15910
+ if (!Object.prototype.hasOwnProperty.call(root, k2)) {
16094
15911
  continue;
16095
15912
  }
16096
- if (k3 === "titleTemplate" || k3[0] === "o" && k3[1] === "n") {
16097
- resolved[k3] = unref(root[k3]);
15913
+ if (k2 === "titleTemplate" || k2[0] === "o" && k2[1] === "n") {
15914
+ resolved[k2] = unref(root[k2]);
16098
15915
  continue;
16099
15916
  }
16100
- resolved[k3] = resolveUnrefHeadInput(root[k3]);
15917
+ resolved[k2] = resolveUnrefHeadInput(root[k2]);
16101
15918
  }
16102
15919
  return resolved;
16103
15920
  }
16104
15921
  return root;
16105
15922
  }
16106
- var VueReactivityPlugin = defineHeadPlugin2({
15923
+ var VueReactivityPlugin = defineHeadPlugin({
16107
15924
  hooks: {
16108
15925
  "entries:resolve": (ctx) => {
16109
15926
  for (const entry of ctx.entries)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/browser",
3
3
  "type": "module",
4
- "version": "0.70.10",
4
+ "version": "0.70.12",
5
5
  "description": "Stacks core frontend/browser functionalities.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -34,7 +34,7 @@
34
34
  "prepublishOnly": "bun run build"
35
35
  },
36
36
  "devDependencies": {
37
- "@stacksjs/development": "0.70.8",
38
- "@stacksjs/utils": "0.70.8"
37
+ "@stacksjs/development": "0.70.11",
38
+ "@stacksjs/utils": "0.70.11"
39
39
  }
40
40
  }