@picked/vite-plugin-picked 0.0.1-dev.1786405786333 → 0.0.1-dev.1786601464574

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.
package/dist/esm/index.js CHANGED
@@ -1,28 +1,30 @@
1
1
  import { existsSync as e } from "node:fs";
2
2
  import { join as t, resolve as n } from "node:path";
3
- import { createClientHeaders as r, fetchExperienceContent as i, fetchProject as a } from "@picked/client/plugins/dynamic-experiences";
4
- import { appendFile as o, mkdir as s, readFile as c, writeFile as l } from "node:fs/promises";
3
+ import { createClientHeaders as r, fetchExperienceContent as i, fetchProject as a } from "@picked/delivery-api-client";
4
+ import { generate as o } from "@picked/typegen";
5
+ import { loadPickedConfig as s, loadResolvedPickedConfig as c } from "@picked/config";
6
+ import { appendFile as l, mkdir as u, readFile as d, writeFile as f } from "node:fs/promises";
5
7
  //#region \0@oxc-project+runtime@0.142.0/helpers/esm/taggedTemplateLiteral.js
6
- function u(e, t) {
8
+ function p(e, t) {
7
9
  return t ||= e.slice(0), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } }));
8
10
  }
9
11
  //#endregion
10
12
  //#region src/launcher.ts
11
- var d;
12
- function f(e) {
13
+ var m;
14
+ function h(e) {
13
15
  let t = JSON.stringify(e), n = e.length > 0 ? e.map((e) => `
14
16
  <div class="feature-row">
15
17
  <label>
16
- <input type="checkbox" data-feature-id="${m(e.id)}" checked>
17
- <span class="feature-name">${p(e.name)}</span>
18
- <span class="feature-id">${p(e.id)}</span>
18
+ <input type="checkbox" data-feature-id="${_(e.id)}" checked>
19
+ <span class="feature-name">${g(e.name)}</span>
20
+ <span class="feature-id">${g(e.id)}</span>
19
21
  </label>
20
- <select data-value-for="${m(e.id)}">
22
+ <select data-value-for="${_(e.id)}">
21
23
  <option value="true" selected>true</option>
22
24
  <option value="false">false</option>
23
25
  </select>
24
26
  </div>`).join("") : "<p class=\"text no-features\">No features configured for this project.</p>";
25
- return String.raw(d ||= u([
27
+ return String.raw(m ||= p([
26
28
  "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta name=\"robots\" content=\"noindex, nofollow\">\n <title>Picked</title>\n <style>\n main {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: grid;\n align-items: center;\n justify-content: center;\n font-family: monospace;\n color: #4A4A4A\n }\n\n .wrap {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n max-width: 480px;\n width: 100%;\n }\n\n .title {\n font-size: 1.125rem;\n font-weight: 700;\n margin-bottom: 0;\n }\n\n .text {\n margin-top: .5rem;\n font-size: .875rem\n }\n\n .text a {\n color: #4A4A4A;\n text-decoration: none;\n }\n\n .text a:hover {\n cursor: pointer;\n text-decoration: underline\n }\n\n .preview-form {\n margin-top: 2rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .preview-input {\n padding: 0.5rem;\n border: 1px solid #4A4A4A;\n border-radius: 0;\n font-family: monospace;\n }\n\n .preview-button {\n padding: 0.5rem;\n background: #4A4A4A;\n color: white;\n border: none;\n border-radius: 0;\n cursor: pointer;\n font-family: monospace;\n }\n\n .preview-button:hover {\n opacity: 0.9;\n }\n\n .buttons {\n display: grid;\n gap: 0.5em;\n grid-template-columns: 1fr 1fr;\n }\n\n #copy-status {\n font-size: 1em;\n text-align: right;\n margin-top: 0.5em;\n }\n\n .features-section {\n margin-top: 1.5rem;\n }\n\n .features-label {\n font-weight: 700;\n font-size: .875rem;\n margin-bottom: 0.5rem;\n }\n\n .feature-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n padding: 0.25rem 0;\n }\n\n .feature-row label {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n cursor: pointer;\n min-width: 0;\n flex: 1;\n }\n\n .feature-name {\n font-size: .875rem;\n }\n\n .feature-id {\n font-size: .75rem;\n color: #888;\n }\n\n .feature-row select {\n font-family: monospace;\n font-size: .75rem;\n padding: 0.125rem 0.25rem;\n border: 1px solid #4A4A4A;\n border-radius: 0;\n background: white;\n flex-shrink: 0;\n }\n\n .no-features {\n color: #888;\n font-style: italic;\n }\n\n .url-history {\n margin-top: 0.5rem;\n font-size: .75rem;\n }\n\n .url-history-item {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n padding: 0.125rem 0;\n }\n\n .url-history-item button {\n background: none;\n border: none;\n cursor: pointer;\n font-family: monospace;\n font-size: .75rem;\n color: #888;\n padding: 0;\n }\n\n .url-history-item button.url-link {\n color: #4A4A4A;\n text-decoration: none;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n min-width: 0;\n }\n\n .url-history-item button.url-link:hover {\n text-decoration: underline;\n }\n\n .url-history-item button.url-delete:hover {\n color: #b71c1c;\n }\n\n @media (min-width: 640px) {\n .title {\n font-size: 1.25rem\n }\n\n .text {\n font-size: 1rem\n }\n }\n </style>\n</head>\n<body>\n\n<main>\n <div class=\"wrap\">\n <p class=\"title\">Picked</p>\n <p class=\"text\">\n Learn more at\n <a href=\"https://picked.app\">\n https://picked.app\n </a>\n </p>\n <div class=\"preview-form\">\n <input type=\"text\" id=\"url-input\" pattern=\"^(https?://)?.+\" placeholder=\"Enter preview URL\" required\n class=\"preview-input\">\n <div id=\"url-history\" class=\"url-history\"></div>\n <div class=\"features-section\">\n <p class=\"features-label\">Features</p>\n ",
27
29
  "\n </div>\n <div class=\"buttons\">\n <button type=\"button\" class=\"preview-button\" id=\"copy-btn\">Copy</button>\n <button type=\"button\" class=\"preview-button\" id=\"preview-btn\">Preview</button>\n </div>\n <p class=\"text\" id=\"copy-status\" aria-live=\"polite\" style=\"visibility:hidden;\">\n &nbsp;\n </p>\n </div>\n </div>\n\n <script>\n var FEATURES = ",
28
30
  ";\n var STORAGE_KEY_URL = 'picked-launcher-url';\n var STORAGE_KEY_HISTORY = 'picked-launcher-history';\n var STORAGE_KEY_SELECTIONS = 'picked-launcher-selections';\n\n function getUrlInput() {\n return document.getElementById('url-input');\n }\n\n // URL history\n function getHistory() {\n try {\n var raw = localStorage.getItem(STORAGE_KEY_HISTORY);\n if (!raw) return [];\n var parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? parsed : [];\n } catch (e) {\n return [];\n }\n }\n\n function saveHistory(history) {\n localStorage.setItem(STORAGE_KEY_HISTORY, JSON.stringify(history));\n }\n\n function addToHistory(url) {\n var history = getHistory().filter(function(h) { return h !== url; });\n history.unshift(url);\n if (history.length > 10) history = history.slice(0, 10);\n saveHistory(history);\n renderHistory();\n }\n\n function removeFromHistory(url) {\n var history = getHistory().filter(function(h) { return h !== url; });\n saveHistory(history);\n renderHistory();\n }\n\n function renderHistory() {\n var container = document.getElementById('url-history');\n if (!container) return;\n var history = getHistory();\n if (history.length === 0) {\n container.innerHTML = '';\n return;\n }\n container.innerHTML = history.map(function(url) {\n return '<div class=\"url-history-item\">' +\n '<button type=\"button\" class=\"url-link\" data-history-url=\"' + escapeAttr(url) + '\">' + escapeHtml(url) + '</button>' +\n '<button type=\"button\" class=\"url-delete\" data-history-delete=\"' + escapeAttr(url) + '\">x</button>' +\n '</div>';\n }).join('');\n }\n\n // Feature selection persistence\n function getSelections() {\n try {\n var raw = localStorage.getItem(STORAGE_KEY_SELECTIONS);\n if (!raw) return {};\n var parsed = JSON.parse(raw);\n return typeof parsed === 'object' && parsed !== null ? parsed : {};\n } catch (e) {\n return {};\n }\n }\n\n function saveSelections() {\n var selections = {};\n FEATURES.forEach(function(f) {\n var checkbox = document.querySelector('input[data-feature-id=\"' + f.id + '\"]');\n var select = document.querySelector('select[data-value-for=\"' + f.id + '\"]');\n if (checkbox && select) {\n selections[f.id] = { checked: checkbox.checked, value: select.value };\n }\n });\n localStorage.setItem(STORAGE_KEY_SELECTIONS, JSON.stringify(selections));\n }\n\n function restoreSelections() {\n var selections = getSelections();\n FEATURES.forEach(function(f) {\n var saved = selections[f.id];\n if (!saved) return;\n var checkbox = document.querySelector('input[data-feature-id=\"' + f.id + '\"]');\n var select = document.querySelector('select[data-value-for=\"' + f.id + '\"]');\n if (checkbox) checkbox.checked = saved.checked;\n if (select) select.value = saved.value;\n });\n }\n\n function escapeHtml(str) {\n var div = document.createElement('div');\n div.textContent = str;\n return div.innerHTML;\n }\n\n function escapeAttr(str) {\n return str.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }\n\n function buildTargetUrl(inputValue) {\n var value = inputValue;\n if (!value.startsWith('http://') && !value.startsWith('https://')) {\n value = 'https://' + value;\n }\n var hostname = window.location.hostname;\n var subdomain = hostname.split('.').length > 2 ? hostname.split('.')[0] : '';\n var target = value;\n var sep = target.includes('?') ? '&' : '?';\n if (subdomain) {\n target = target + sep + 'cvly_env=' + encodeURIComponent(subdomain);\n sep = '&';\n }\n FEATURES.forEach(function(f) {\n var checkbox = document.querySelector('input[data-feature-id=\"' + f.id + '\"]');\n var select = document.querySelector('select[data-value-for=\"' + f.id + '\"]');\n if (checkbox && checkbox.checked && select) {\n target = target + sep + 'picked-feature=' + encodeURIComponent(f.id + ':' + select.value);\n sep = '&';\n }\n });\n return target;\n }\n\n function showCopyStatus(message, success) {\n var el = document.getElementById('copy-status');\n if (!el) return;\n el.textContent = message;\n el.style.visibility = 'visible';\n el.style.color = success ? '#2e7d32' : '#b71c1c';\n setTimeout(function() {\n el.style.visibility = 'hidden';\n }, 2000);\n }\n\n // Init\n window.addEventListener('load', function() {\n var input = getUrlInput();\n var savedUrl = localStorage.getItem(STORAGE_KEY_URL);\n if (savedUrl && input) {\n input.value = savedUrl;\n }\n renderHistory();\n restoreSelections();\n });\n\n // Delegate click events\n document.addEventListener('click', function(e) {\n var target = e.target;\n\n // History URL click\n var historyUrl = target.getAttribute('data-history-url');\n if (historyUrl) {\n var input = getUrlInput();\n if (input) input.value = historyUrl;\n return;\n }\n\n // History delete click\n var deleteUrl = target.getAttribute('data-history-delete');\n if (deleteUrl) {\n removeFromHistory(deleteUrl);\n return;\n }\n });\n\n // Feature change persistence\n document.addEventListener('change', function(e) {\n var target = e.target;\n if (target.getAttribute('data-feature-id') || target.getAttribute('data-value-for')) {\n saveSelections();\n }\n });\n\n // Copy button\n document.getElementById('copy-btn').addEventListener('click', function() {\n var input = getUrlInput();\n if (!input || !input.value) return;\n localStorage.setItem(STORAGE_KEY_URL, input.value);\n addToHistory(input.value);\n saveSelections();\n var target = buildTargetUrl(input.value);\n navigator.clipboard.writeText(target).then(function() {\n showCopyStatus('Preview URL copied to clipboard', true);\n });\n });\n\n // Preview button\n document.getElementById('preview-btn').addEventListener('click', function() {\n var input = getUrlInput();\n if (!input || !input.value) return;\n localStorage.setItem(STORAGE_KEY_URL, input.value);\n addToHistory(input.value);\n saveSelections();\n var target = buildTargetUrl(input.value);\n window.location.href = target;\n });\n <\/script>\n</main>\n</body>\n</html>"
@@ -32,46 +34,46 @@ function f(e) {
32
34
  ";\n var STORAGE_KEY_URL = 'picked-launcher-url';\n var STORAGE_KEY_HISTORY = 'picked-launcher-history';\n var STORAGE_KEY_SELECTIONS = 'picked-launcher-selections';\n\n function getUrlInput() {\n return document.getElementById('url-input');\n }\n\n // URL history\n function getHistory() {\n try {\n var raw = localStorage.getItem(STORAGE_KEY_HISTORY);\n if (!raw) return [];\n var parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? parsed : [];\n } catch (e) {\n return [];\n }\n }\n\n function saveHistory(history) {\n localStorage.setItem(STORAGE_KEY_HISTORY, JSON.stringify(history));\n }\n\n function addToHistory(url) {\n var history = getHistory().filter(function(h) { return h !== url; });\n history.unshift(url);\n if (history.length > 10) history = history.slice(0, 10);\n saveHistory(history);\n renderHistory();\n }\n\n function removeFromHistory(url) {\n var history = getHistory().filter(function(h) { return h !== url; });\n saveHistory(history);\n renderHistory();\n }\n\n function renderHistory() {\n var container = document.getElementById('url-history');\n if (!container) return;\n var history = getHistory();\n if (history.length === 0) {\n container.innerHTML = '';\n return;\n }\n container.innerHTML = history.map(function(url) {\n return '<div class=\"url-history-item\">' +\n '<button type=\"button\" class=\"url-link\" data-history-url=\"' + escapeAttr(url) + '\">' + escapeHtml(url) + '</button>' +\n '<button type=\"button\" class=\"url-delete\" data-history-delete=\"' + escapeAttr(url) + '\">x</button>' +\n '</div>';\n }).join('');\n }\n\n // Feature selection persistence\n function getSelections() {\n try {\n var raw = localStorage.getItem(STORAGE_KEY_SELECTIONS);\n if (!raw) return {};\n var parsed = JSON.parse(raw);\n return typeof parsed === 'object' && parsed !== null ? parsed : {};\n } catch (e) {\n return {};\n }\n }\n\n function saveSelections() {\n var selections = {};\n FEATURES.forEach(function(f) {\n var checkbox = document.querySelector('input[data-feature-id=\"' + f.id + '\"]');\n var select = document.querySelector('select[data-value-for=\"' + f.id + '\"]');\n if (checkbox && select) {\n selections[f.id] = { checked: checkbox.checked, value: select.value };\n }\n });\n localStorage.setItem(STORAGE_KEY_SELECTIONS, JSON.stringify(selections));\n }\n\n function restoreSelections() {\n var selections = getSelections();\n FEATURES.forEach(function(f) {\n var saved = selections[f.id];\n if (!saved) return;\n var checkbox = document.querySelector('input[data-feature-id=\"' + f.id + '\"]');\n var select = document.querySelector('select[data-value-for=\"' + f.id + '\"]');\n if (checkbox) checkbox.checked = saved.checked;\n if (select) select.value = saved.value;\n });\n }\n\n function escapeHtml(str) {\n var div = document.createElement('div');\n div.textContent = str;\n return div.innerHTML;\n }\n\n function escapeAttr(str) {\n return str.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }\n\n function buildTargetUrl(inputValue) {\n var value = inputValue;\n if (!value.startsWith('http://') && !value.startsWith('https://')) {\n value = 'https://' + value;\n }\n var hostname = window.location.hostname;\n var subdomain = hostname.split('.').length > 2 ? hostname.split('.')[0] : '';\n var target = value;\n var sep = target.includes('?') ? '&' : '?';\n if (subdomain) {\n target = target + sep + 'cvly_env=' + encodeURIComponent(subdomain);\n sep = '&';\n }\n FEATURES.forEach(function(f) {\n var checkbox = document.querySelector('input[data-feature-id=\"' + f.id + '\"]');\n var select = document.querySelector('select[data-value-for=\"' + f.id + '\"]');\n if (checkbox && checkbox.checked && select) {\n target = target + sep + 'picked-feature=' + encodeURIComponent(f.id + ':' + select.value);\n sep = '&';\n }\n });\n return target;\n }\n\n function showCopyStatus(message, success) {\n var el = document.getElementById('copy-status');\n if (!el) return;\n el.textContent = message;\n el.style.visibility = 'visible';\n el.style.color = success ? '#2e7d32' : '#b71c1c';\n setTimeout(function() {\n el.style.visibility = 'hidden';\n }, 2000);\n }\n\n // Init\n window.addEventListener('load', function() {\n var input = getUrlInput();\n var savedUrl = localStorage.getItem(STORAGE_KEY_URL);\n if (savedUrl && input) {\n input.value = savedUrl;\n }\n renderHistory();\n restoreSelections();\n });\n\n // Delegate click events\n document.addEventListener('click', function(e) {\n var target = e.target;\n\n // History URL click\n var historyUrl = target.getAttribute('data-history-url');\n if (historyUrl) {\n var input = getUrlInput();\n if (input) input.value = historyUrl;\n return;\n }\n\n // History delete click\n var deleteUrl = target.getAttribute('data-history-delete');\n if (deleteUrl) {\n removeFromHistory(deleteUrl);\n return;\n }\n });\n\n // Feature change persistence\n document.addEventListener('change', function(e) {\n var target = e.target;\n if (target.getAttribute('data-feature-id') || target.getAttribute('data-value-for')) {\n saveSelections();\n }\n });\n\n // Copy button\n document.getElementById('copy-btn').addEventListener('click', function() {\n var input = getUrlInput();\n if (!input || !input.value) return;\n localStorage.setItem(STORAGE_KEY_URL, input.value);\n addToHistory(input.value);\n saveSelections();\n var target = buildTargetUrl(input.value);\n navigator.clipboard.writeText(target).then(function() {\n showCopyStatus('Preview URL copied to clipboard', true);\n });\n });\n\n // Preview button\n document.getElementById('preview-btn').addEventListener('click', function() {\n var input = getUrlInput();\n if (!input || !input.value) return;\n localStorage.setItem(STORAGE_KEY_URL, input.value);\n addToHistory(input.value);\n saveSelections();\n var target = buildTargetUrl(input.value);\n window.location.href = target;\n });\n <\/script>\n</main>\n</body>\n</html>"
33
35
  ]), n, t);
34
36
  }
35
- function p(e) {
37
+ function g(e) {
36
38
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;");
37
39
  }
38
- function m(e) {
40
+ function _(e) {
39
41
  return e.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
40
42
  }
41
43
  //#endregion
42
44
  //#region src/log.ts
43
- var h = "picked", ee = "\x1B[0m";
44
- function te() {
45
+ var v = "picked", y = "\x1B[0m";
46
+ function ee() {
45
47
  let e = process.env.NO_COLOR;
46
48
  return e === "1" || e === "true";
47
49
  }
48
- function g(e) {
49
- return (t) => te() ? t : `${e}${t}${ee}`;
50
+ function b(e) {
51
+ return (t) => ee() ? t : `${e}${t}${y}`;
50
52
  }
51
- var _ = [
53
+ var x = [
52
54
  "debug",
53
55
  "info",
54
56
  "warn",
55
57
  "error",
56
58
  "silent"
57
- ], v = {
59
+ ], S = {
58
60
  debug: {
59
- color: g("\x1B[2m"),
61
+ color: b("\x1B[2m"),
60
62
  log: console.debug,
61
63
  enabled: !1
62
64
  },
63
65
  info: {
64
- color: g("\x1B[36m"),
66
+ color: b("\x1B[36m"),
65
67
  log: console.log,
66
68
  enabled: !0
67
69
  },
68
70
  warn: {
69
- color: g("\x1B[33m"),
71
+ color: b("\x1B[33m"),
70
72
  log: console.warn,
71
73
  enabled: !0
72
74
  },
73
75
  error: {
74
- color: g("\x1B[31m"),
76
+ color: b("\x1B[31m"),
75
77
  log: console.error,
76
78
  enabled: !0
77
79
  },
@@ -80,52 +82,52 @@ var _ = [
80
82
  enabled: !1
81
83
  }
82
84
  };
83
- function y(e, t) {
84
- return `${(/* @__PURE__ */ new Date()).toLocaleTimeString()} [${t ? `${h}:${t}` : h}] ${e}`;
85
+ function te(e, t) {
86
+ return `${(/* @__PURE__ */ new Date()).toLocaleTimeString()} [${t ? `${v}:${t}` : v}] ${e}`;
85
87
  }
86
- function b(e, t, n, r) {
88
+ function C(e, t, n, r) {
87
89
  if (!e.enabled) return;
88
- let i = y(t, r);
90
+ let i = te(t, r);
89
91
  e.log(e.color ? e.color(i) : i), n !== void 0 && e.log(n);
90
92
  }
91
- function x(e) {
92
- let t = v[e], n = /* @__PURE__ */ new Set();
93
+ function w(e) {
94
+ let t = S[e], n = /* @__PURE__ */ new Set();
93
95
  return Object.assign((e, n, r) => {
94
- b(t, e, n, r);
96
+ C(t, e, n, r);
95
97
  }, { once(e, r, i) {
96
- !t.enabled || n.has(e) || (n.add(e), b(t, e, r, i));
98
+ !t.enabled || n.has(e) || (n.add(e), C(t, e, r, i));
97
99
  } });
98
100
  }
99
- function S(e) {
100
- let t = _.indexOf(e);
101
+ function ne(e) {
102
+ let t = x.indexOf(e);
101
103
  if (t === -1) {
102
- b(v.error, `invalid log level: ${e}`);
104
+ C(S.error, `invalid log level: ${e}`);
103
105
  return;
104
106
  }
105
- for (let [e, n] of _.entries()) v[n].enabled = e >= t;
107
+ for (let [e, n] of x.entries()) S[n].enabled = e >= t;
106
108
  }
107
- var C = g("\x1B[34m"), w = g("\x1B[36m");
108
- function ne() {
109
+ var T = b("\x1B[34m"), E = b("\x1B[36m");
110
+ function re() {
109
111
  let e = [
110
- ` ${C("_")} ${w("_")} _ _ _`,
111
- `${C("(_)")} ${w("(_)")} _ __(_)__| |_____ __| |`,
112
- ` ${C("_")} ${C("_")} | '_ \\ / _| / / -_) _\` |`,
113
- `${C("(_)")} ${C("(_)")} | .__/_\\__|_\\_\\___\\__,_|`,
112
+ ` ${T("_")} ${E("_")} _ _ _`,
113
+ `${T("(_)")} ${E("(_)")} _ __(_)__| |_____ __| |`,
114
+ ` ${T("_")} ${T("_")} | '_ \\ / _| / / -_) _\` |`,
115
+ `${T("(_)")} ${T("(_)")} | .__/_\\__|_\\_\\___\\__,_|`,
114
116
  " |_|\n "
115
117
  ];
116
118
  console.log(e.join("\n"));
117
119
  }
118
- var T = {
119
- banner: ne,
120
- debug: x("debug"),
121
- info: x("info"),
122
- warn: x("warn"),
123
- error: x("error"),
124
- setLevel: S
120
+ var D = {
121
+ banner: re,
122
+ debug: w("debug"),
123
+ info: w("info"),
124
+ warn: w("warn"),
125
+ error: w("error"),
126
+ setLevel: ne
125
127
  };
126
128
  //#endregion
127
129
  //#region src/middleware.ts
128
- function re(e) {
130
+ function O(e) {
129
131
  return (t, n, r) => {
130
132
  if (t.method !== "GET") {
131
133
  r();
@@ -142,28 +144,28 @@ function re(e) {
142
144
  }
143
145
  //#endregion
144
146
  //#region src/gitignore.ts
145
- var E = ".picked/";
146
- async function D(n, r) {
147
+ var k = ".picked/";
148
+ async function ie(n, r) {
147
149
  if (r) return;
148
150
  let i = t(n, ".gitignore");
149
151
  if (!e(i)) {
150
- await l(i, `${E}
152
+ await f(i, `${k}
151
153
  `);
152
154
  return;
153
155
  }
154
- let a = await c(i, "utf8");
155
- if (O(a)) return;
156
- let s = `${a.length > 0 && !a.endsWith("\n") ? "\n" : ""}${E}
156
+ let a = await d(i, "utf8");
157
+ if (A(a)) return;
158
+ let o = `${a.length > 0 && !a.endsWith("\n") ? "\n" : ""}${k}
157
159
  `;
158
- await o(i, s);
160
+ await l(i, o);
159
161
  }
160
- function O(e) {
161
- return e.split(/\r?\n/).map((e) => e.trim()).some((e) => e === E || e === ".picked");
162
+ function A(e) {
163
+ return e.split(/\r?\n/).map((e) => e.trim()).some((e) => e === k || e === ".picked");
162
164
  }
163
165
  //#endregion
164
166
  //#region src/retry.ts
165
- var k = 6, ie = 5e3;
166
- function A(e) {
167
+ var j = 6, ae = 5e3;
168
+ function M(e) {
167
169
  let t;
168
170
  try {
169
171
  t = new URL(e).hostname;
@@ -172,12 +174,12 @@ function A(e) {
172
174
  }
173
175
  return t === "localhost" || t === "127.0.0.1" || t === "::1" || t === "[::1]" || t !== "api.picked.app" && t.endsWith(".picked.app");
174
176
  }
175
- function ae(e) {
177
+ function N(e) {
176
178
  return new Promise((t) => {
177
179
  setTimeout(t, e);
178
180
  });
179
181
  }
180
- async function j(e, t) {
182
+ async function P(e, t) {
181
183
  let n = null, r = null;
182
184
  try {
183
185
  n = await e();
@@ -185,9 +187,9 @@ async function j(e, t) {
185
187
  r = e;
186
188
  }
187
189
  if (n !== null) return n;
188
- for (let i = 1; i <= k; i++) {
189
- let a = ie * 2 ** (i - 1);
190
- t(i, k, a), await ae(a), r = null;
190
+ for (let i = 1; i <= j; i++) {
191
+ let a = ae * 2 ** (i - 1);
192
+ t(i, j, a), await N(a), r = null;
191
193
  try {
192
194
  n = await e();
193
195
  } catch (e) {
@@ -200,13 +202,13 @@ async function j(e, t) {
200
202
  }
201
203
  //#endregion
202
204
  //#region src/util.ts
203
- function M(e) {
205
+ function F(e) {
204
206
  return Array.isArray(e) ? e : [];
205
207
  }
206
208
  //#endregion
207
209
  //#region src/prefetch.ts
208
- var N = 2;
209
- function P(e) {
210
+ var I = 2;
211
+ function L(e) {
210
212
  let n = t(e, ".picked");
211
213
  return {
212
214
  pickedDir: n,
@@ -215,90 +217,96 @@ function P(e) {
215
217
  experiencesDir: t(n, "experiences")
216
218
  };
217
219
  }
218
- async function F(t) {
220
+ async function R(t) {
219
221
  if (!e(t)) return null;
220
222
  try {
221
- let e = await c(t, "utf8"), n = JSON.parse(e);
222
- return I(n) ? n : null;
223
+ let e = await d(t, "utf8"), n = JSON.parse(e);
224
+ return z(n) ? n : null;
223
225
  } catch {
224
226
  return null;
225
227
  }
226
228
  }
227
- function I(e) {
229
+ function z(e) {
228
230
  return !(typeof e != "object" || !e || !("version" in e) || typeof e.version != "number" || !("projectVersionId" in e) || typeof e.projectVersionId != "string" || !("workspaceId" in e) || typeof e.workspaceId != "string" || !("experiences" in e) || !Array.isArray(e.experiences));
229
231
  }
230
- function L(e) {
232
+ function B(e) {
231
233
  let t = /* @__PURE__ */ new Set();
232
- for (let n of M(e.steps)) n.layoutContentId && t.add(n.id);
234
+ for (let n of F(e.steps)) n.layoutContentId && t.add(n.id);
233
235
  if (t.size === 0) return [];
234
236
  let n = [];
235
- for (let r of M(e.experiences)) M(r.nodes).some((e) => e.type === "step" && t.has(e.stepId)) && n.push(r.id);
237
+ for (let r of F(e.experiences)) F(r.nodes).some((e) => e.type === "step" && t.has(e.stepId)) && n.push(r.id);
236
238
  return n;
237
239
  }
238
- async function R(n) {
239
- let { apiUrl: r, projectId: i, projectRoot: a, headers: o, reuseWhenUnchanged: c = !0 } = n, u = P(a), d = await B(r, i, o), f = L(d);
240
- if (await s(u.experiencesDir, { recursive: !0 }), await l(u.projectConfigPath, JSON.stringify(d, null, 2)), c) {
241
- let t = await F(u.manifestPath);
242
- if (t?.version === N && t.projectVersionId === d.versionId && t.workspaceId === d.workspaceId) {
243
- let n = z(u, f);
240
+ async function V(n) {
241
+ let { apiUrl: r, projectId: i, projectRoot: a, headers: o, previewToken: s, reuseWhenUnchanged: c = !0 } = n, l = L(a), d = await U(r, i, o, s), p = B(d);
242
+ if (await u(l.experiencesDir, { recursive: !0 }), await f(l.projectConfigPath, JSON.stringify(d, null, 2)), c) {
243
+ let t = await R(l.manifestPath);
244
+ if (t?.version === I && t.projectVersionId === d.versionId && t.workspaceId === d.workspaceId) {
245
+ let n = H(l, p);
244
246
  if (Object.values(n).every((t) => e(t))) return {
245
247
  config: d,
246
248
  manifest: t,
247
249
  experienceContentPaths: n
248
250
  };
249
- T.info("a manifest-referenced content file is missing; refetching every experience");
251
+ D.info("a manifest-referenced content file is missing; refetching every experience");
250
252
  }
251
253
  }
252
- let p = (/* @__PURE__ */ new Date()).toISOString(), m = [];
253
- for (let e of f) {
254
- let n = await V(r, i, e, o), a = t(u.experiencesDir, `${e}.json`);
255
- await l(a, JSON.stringify(n, null, 2)), m.push({
254
+ let m = (/* @__PURE__ */ new Date()).toISOString(), h = [];
255
+ for (let e of p) {
256
+ let n = await W(r, i, e, o, s), a = t(l.experiencesDir, `${e}.json`);
257
+ await f(a, JSON.stringify(n, null, 2)), h.push({
256
258
  id: e,
257
- fetchedAt: p
259
+ fetchedAt: m
258
260
  });
259
261
  }
260
- let h = {
261
- version: N,
262
- fetchedAt: p,
262
+ let g = {
263
+ version: I,
264
+ fetchedAt: m,
263
265
  projectVersionId: d.versionId,
264
266
  workspaceId: d.workspaceId,
265
267
  projectId: d.id,
266
- experiences: m
268
+ experiences: h
267
269
  };
268
- return await l(u.manifestPath, JSON.stringify(h, null, 2)), {
270
+ return await f(l.manifestPath, JSON.stringify(g, null, 2)), {
269
271
  config: d,
270
- manifest: h,
271
- experienceContentPaths: z(u, f)
272
+ manifest: g,
273
+ experienceContentPaths: H(l, p)
272
274
  };
273
275
  }
274
- function z(e, n) {
276
+ function H(e, n) {
275
277
  let r = {};
276
278
  for (let i of n) r[i] = t(e.experiencesDir, `${i}.json`);
277
279
  return r;
278
280
  }
279
- async function B(e, t, n) {
280
- let r = () => a(e, t, { headers: n }), i;
281
+ async function U(e, t, n, r) {
282
+ let i = () => a(e, t, {
283
+ headers: n,
284
+ previewToken: r
285
+ }), o;
281
286
  try {
282
- i = A(e) ? await j(r, (e, t, n) => {
283
- T.info(`project config not ready, retrying in ${(n / 1e3).toString()}s (${e.toString()}/${t.toString()})`);
284
- }) : await r();
287
+ o = M(e) ? await P(i, (e, t, n) => {
288
+ D.info(`project config not ready, retrying in ${(n / 1e3).toString()}s (${e.toString()}/${t.toString()})`);
289
+ }) : await i();
285
290
  } catch (n) {
286
- throw Error(`[picked] Build-time fetch of project config failed for "${t}" at ${e}: ${H(n)}`);
291
+ throw Error(`[picked] Build-time fetch of project config failed for "${t}" at ${e}: ${G(n)}`);
287
292
  }
288
- if (!i) throw Error(`[picked] Build-time fetch of project config returned no usable response for "${t}" at ${e}. Confirm the API is reachable and the project ID is correct.`);
289
- return i;
293
+ if (!o) throw Error(`[picked] Build-time fetch of project config returned no usable response for "${t}" at ${e}. Confirm the API is reachable and the project ID is correct.`);
294
+ return o;
290
295
  }
291
- async function V(e, t, n, r) {
292
- let a;
296
+ async function W(e, t, n, r, a) {
297
+ let o;
293
298
  try {
294
- a = await i(e, t, n, { headers: r });
299
+ o = await i(e, t, n, {
300
+ headers: r,
301
+ previewToken: a
302
+ });
295
303
  } catch (t) {
296
- throw Error(`[picked] Build-time fetch of content for experience "${n}" failed at ${e}: ${H(t)}`);
304
+ throw Error(`[picked] Build-time fetch of content for experience "${n}" failed at ${e}: ${G(t)}`);
297
305
  }
298
- if (!a) throw Error(`[picked] Build-time fetch of content for experience "${n}" returned no usable response. Confirm the experience id exists and the API is reachable.`);
299
- return a;
306
+ if (!o) throw Error(`[picked] Build-time fetch of content for experience "${n}" returned no usable response. Confirm the experience id exists and the API is reachable.`);
307
+ return o;
300
308
  }
301
- function H(e) {
309
+ function G(e) {
302
310
  if (e instanceof Error) return e.message;
303
311
  if (typeof e == "string") return e;
304
312
  try {
@@ -309,12 +317,12 @@ function H(e) {
309
317
  }
310
318
  //#endregion
311
319
  //#region src/virtual-module/api.ts
312
- function U() {
320
+ function K() {
313
321
  return "export const manifestMetadata = {\n mode: 'api',\n fetchedAt: null,\n projectVersionId: null,\n workspaceId: null,\n}\n";
314
322
  }
315
323
  //#endregion
316
324
  //#region src/virtual-module/build.ts
317
- function W(e) {
325
+ function q(e) {
318
326
  let { projectConfigPath: t, experienceContentPaths: n, manifestMetadata: r } = e, i = (e) => JSON.stringify(e), a = Object.entries(n).map(([e, t]) => ` ${JSON.stringify(e)}: () => import(${i(t)}).then((m) => m.default ?? m),`).join("\n");
319
327
  return `import { registerPickedBundle } from '@picked/client/plugins/dynamic-experiences'
320
328
  import projectConfigJson from ${i(t)}
@@ -344,19 +352,20 @@ registerPickedBundle({ projectConfig, experienceContent, manifestMetadata })
344
352
  }
345
353
  //#endregion
346
354
  //#region src/virtual-module/dev.ts
347
- function G(e) {
348
- let { apiUrl: t, projectId: n, projectConfig: r } = e, i = r ? "import { fetchExperienceContent, registerPickedBundle } from '@picked/client/plugins/dynamic-experiences'" : "import { fetchProject, fetchExperienceContent } from '@picked/client/plugins/dynamic-experiences'", a = r ? `export const projectConfig = ${JSON.stringify(r)}` : "export const projectConfig = await fetchProject(apiUrl, projectId)", o = r ? "\nregisterPickedBundle({ projectConfig, experienceContent, manifestMetadata })\n" : "";
349
- return `${i}
355
+ function J(e) {
356
+ let { apiUrl: t, projectId: n, projectConfig: r, previewToken: i } = e, a = r ? "import { fetchExperienceContent, registerPickedBundle } from '@picked/client/plugins/dynamic-experiences'" : "import { fetchProject, fetchExperienceContent } from '@picked/client/plugins/dynamic-experiences'", o = r ? `export const projectConfig = ${JSON.stringify(r)}` : "export const projectConfig = await fetchProject(apiUrl, projectId, { previewToken: previewToken ?? undefined })", s = r ? "\nregisterPickedBundle({ projectConfig, experienceContent, manifestMetadata })\n" : "";
357
+ return `${a}
350
358
 
351
359
  const apiUrl = ${JSON.stringify(t)}
352
360
  const projectId = ${JSON.stringify(n)}
361
+ const previewToken = ${JSON.stringify(i ?? null)}
353
362
 
354
- ${a}
363
+ ${o}
355
364
 
356
365
  export async function experienceContent(experience, options) {
357
366
  const id = typeof experience === 'string' ? experience : experience?.id
358
367
  if (!id) return null
359
- return await fetchExperienceContent(apiUrl, projectId, id, options)
368
+ return await fetchExperienceContent(apiUrl, projectId, id, { previewToken: previewToken ?? undefined, ...options })
360
369
  }
361
370
 
362
371
  export const manifestMetadata = {
@@ -365,14 +374,14 @@ export const manifestMetadata = {
365
374
  projectVersionId: projectConfig?.versionId ?? null,
366
375
  workspaceId: projectConfig?.workspaceId ?? null,
367
376
  }
368
- ${o}`;
377
+ ${s}`;
369
378
  }
370
379
  //#endregion
371
380
  //#region src/index.ts
372
- var K = 5;
373
- function q(e, t, n) {
381
+ var oe = 5;
382
+ function Y(e, t, n) {
374
383
  if (t.length === 0) return;
375
- if (t.length > K) {
384
+ if (t.length > oe) {
376
385
  console.log(`\n ${e}: ${t.length.toString()} loaded\n`);
377
386
  return;
378
387
  }
@@ -387,10 +396,10 @@ function q(e, t, n) {
387
396
  ""
388
397
  ].join("\n"));
389
398
  }
390
- function oe(e, t) {
399
+ function se(e, t) {
391
400
  t.length !== 0 && console.log(`\n ${e}: ${t.length.toString()} loaded\n`);
392
401
  }
393
- var se = [
402
+ var ce = [
394
403
  {
395
404
  header: "Name",
396
405
  value: (e) => e.name
@@ -411,7 +420,7 @@ var se = [
411
420
  header: "Ver",
412
421
  value: (e) => `v${e.version.toString()}`
413
422
  }
414
- ], ce = [
423
+ ], le = [
415
424
  {
416
425
  header: "Name",
417
426
  value: (e) => e.name
@@ -432,7 +441,7 @@ var se = [
432
441
  header: "Targets",
433
442
  value: (e) => e.targets.length.toString()
434
443
  }
435
- ], le = [
444
+ ], ue = [
436
445
  {
437
446
  header: "Name",
438
447
  value: (e) => e.name
@@ -445,7 +454,7 @@ var se = [
445
454
  header: "Fields",
446
455
  value: (e) => (e.fieldIds?.length ?? 0).toString()
447
456
  }
448
- ], ue = [
457
+ ], de = [
449
458
  {
450
459
  header: "Name",
451
460
  value: (e) => e.name
@@ -462,91 +471,115 @@ var se = [
462
471
  header: "Required",
463
472
  value: (e) => e.required ? "yes" : "no"
464
473
  }
465
- ], de = [{
474
+ ], fe = [{
466
475
  header: "Name",
467
476
  value: (e) => e.name
468
477
  }, {
469
478
  header: "Key",
470
479
  value: (e) => e.key
471
480
  }];
472
- function J() {
473
- return "0.0.1-dev.1786405786333";
481
+ function pe() {
482
+ return "0.0.1-dev.1786601464574";
474
483
  }
475
- var Y = "https://api.picked.app", X = "virtual:picked/data", Z = `\0${X}`;
476
- function fe(e) {
484
+ var me = "https://api.picked.app", X = "virtual:picked/data", Z = `\0${X}`;
485
+ function he(e) {
477
486
  for (let t of Object.values(e)) if (t.type === "chunk" && t.moduleIds.includes(Z)) return t.fileName;
478
487
  }
479
- function pe(e, t) {
488
+ function ge(e, t) {
480
489
  return e === "" || e.endsWith("/") ? `${e}${t}` : `${e}/${t}`;
481
490
  }
491
+ async function _e(e) {
492
+ try {
493
+ let t = await o({ config: e });
494
+ D.info(`generated types at ${t.typesOutput}`);
495
+ } catch (e) {
496
+ let t = e instanceof Error ? e.message : String(e);
497
+ D.warn(`type generation failed: ${t}`);
498
+ }
499
+ }
500
+ async function ve(e) {
501
+ let t = await c(e);
502
+ if (!t) throw Error("picked.config.{ts,js,json} is required. Add a picked.config.ts with projectId and apiUrl.");
503
+ return t;
504
+ }
505
+ async function ye(e, t) {
506
+ let n = await s(e);
507
+ n && n.projectId !== t && D.warn(`using project "${t}" (picked.config default: "${n.projectId}") — run 'picked status' to inspect`);
508
+ }
482
509
  var Q = /* @__PURE__ */ new Map();
483
- function me(e, t, n) {
510
+ function be(e, t, n) {
484
511
  return JSON.stringify([
485
512
  e,
486
513
  t,
487
514
  n
488
515
  ]);
489
516
  }
490
- function he(t) {
491
- let i = t.apiUrl ?? Y, o = t.mode ?? "bundle", s = [], c = process.cwd(), l = "serve", u = "/", d, p, m = null;
517
+ function xe(t = {}) {
518
+ let i = t.mode ?? "bundle", o = t.generateTypes ?? !0, s = [], c = process.cwd(), l = "serve", u = "/", d = null, f = !1, p, m, g = null;
492
519
  return {
493
520
  name: "picked",
494
- config: async (u, f) => {
495
- l = f.command, c = u.root === void 0 ? process.cwd() : n(process.cwd(), u.root), T.banner(), i !== Y && T.warn(`using custom API URL: ${i}`);
496
- let h = r("vite-plugin", J());
497
- if (o === "api") T.debug("mode is 'api': skipping the project-config prefetch");
498
- else if (f.command === "build") {
499
- let n = me(i, t.projectId, c);
500
- d = n;
501
- let r = Q.get(n);
502
- r === void 0 && (r = (async () => {
503
- T.info(`prefetching project config + content for "${t.projectId}"`);
504
- let n = P(c), r = e(n.pickedDir), a = performance.now(), o = await R({
505
- apiUrl: i,
506
- projectId: t.projectId,
521
+ config: async (t, u) => {
522
+ l = u.command, c = t.root === void 0 ? process.cwd() : n(process.cwd(), t.root), d = await ve(c);
523
+ let { projectId: h, apiUrl: _, previewToken: v } = d;
524
+ D.banner(), o && !f && (f = !0, await _e(d)), _ !== me && D.warn(`using custom API URL: ${_}`), await ye(c, h);
525
+ let y = r("vite-plugin", pe());
526
+ if (i === "api") D.debug("mode is 'api': skipping the project-config prefetch");
527
+ else if (u.command === "build") {
528
+ let t = be(_, h, c);
529
+ p = t;
530
+ let n = Q.get(t);
531
+ n === void 0 && (n = (async () => {
532
+ D.info(`prefetching project config + content for "${h}"`);
533
+ let t = L(c), n = e(t.pickedDir), r = performance.now(), i = await V({
534
+ apiUrl: _,
535
+ projectId: h,
507
536
  projectRoot: c,
508
- headers: h
509
- }), s = (performance.now() - a).toFixed(0);
510
- await D(c, r);
511
- let l = o.config;
512
- return $(l, s), {
513
- virtualSource: W({
514
- projectConfigPath: n.projectConfigPath,
515
- experienceContentPaths: o.experienceContentPaths,
537
+ headers: y,
538
+ previewToken: v ?? void 0
539
+ }), a = (performance.now() - r).toFixed(0);
540
+ await ie(c, n);
541
+ let o = i.config;
542
+ return $(o, a), {
543
+ virtualSource: q({
544
+ projectConfigPath: t.projectConfigPath,
545
+ experienceContentPaths: i.experienceContentPaths,
516
546
  manifestMetadata: {
517
547
  mode: "build",
518
- fetchedAt: o.manifest.fetchedAt,
519
- projectVersionId: o.manifest.projectVersionId,
520
- workspaceId: o.manifest.workspaceId
548
+ fetchedAt: i.manifest.fetchedAt,
549
+ projectVersionId: i.manifest.projectVersionId,
550
+ workspaceId: i.manifest.workspaceId
521
551
  }
522
552
  }),
523
- features: M(l.features)
553
+ features: F(o.features)
524
554
  };
525
- })(), r.catch(() => Q.delete(n)), Q.set(n, r));
526
- let a = await r;
527
- p = a.virtualSource, s = a.features;
528
- } else if (f.mode === "production") T.debug("skipping the dev project-config fetch for a production serve resolution");
555
+ })(), n.catch(() => Q.delete(t)), Q.set(t, n));
556
+ let r = await n;
557
+ m = r.virtualSource, s = r.features;
558
+ } else if (u.mode === "production") D.debug("skipping the dev project-config fetch for a production serve resolution");
529
559
  else {
530
- T.info(`fetching project config for "${t.projectId}" (dev)`);
531
- let e = performance.now(), n = () => a(i, t.projectId, { headers: h }), r = A(i) ? await j(n, (e, t, n) => {
532
- T.info(`local API not ready, retrying in ${(n / 1e3).toString()}s (${e.toString()}/${t.toString()})`);
533
- }) : await n(), o = (performance.now() - e).toFixed(0);
534
- m = r, r ? (s = M(r.features), $(r, o)) : T.warn(`failed to fetch project config for "${t.projectId}" (${o}ms)`);
560
+ D.info(`fetching project config for "${h}" (dev)`);
561
+ let e = performance.now(), t = () => a(_, h, {
562
+ headers: y,
563
+ previewToken: v ?? void 0
564
+ }), n = M(_) ? await P(t, (e, t, n) => {
565
+ D.info(`local API not ready, retrying in ${(n / 1e3).toString()}s (${e.toString()}/${t.toString()})`);
566
+ }) : await t(), r = (performance.now() - e).toFixed(0);
567
+ g = n, n ? (s = F(n.features), $(n, r)) : D.warn(`failed to fetch project config for "${h}" (${r}ms)`);
535
568
  }
536
569
  },
537
570
  configResolved(e) {
538
571
  u = e.base;
539
572
  },
540
573
  closeBundle() {
541
- d !== void 0 && Q.delete(d);
574
+ p !== void 0 && Q.delete(p);
542
575
  },
543
576
  transformIndexHtml: {
544
577
  order: "post",
545
578
  handler(e, t) {
546
- if (o === "api" || t.bundle === void 0) return;
547
- let n = fe(t.bundle);
579
+ if (i === "api" || t.bundle === void 0) return;
580
+ let n = he(t.bundle);
548
581
  if (n === void 0) return;
549
- let r = pe(u, n);
582
+ let r = ge(u, n);
550
583
  if (!e.includes(`"${r}"`)) return [{
551
584
  tag: "link",
552
585
  attrs: {
@@ -562,15 +595,21 @@ function he(t) {
562
595
  if (e === X) return Z;
563
596
  },
564
597
  load(e) {
565
- if (e === Z) return o === "api" ? U() : l === "build" ? p : G({
566
- apiUrl: i,
567
- projectId: t.projectId,
568
- projectConfig: m
569
- });
598
+ if (e === Z) {
599
+ if (i === "api") return K();
600
+ if (l === "build") return m;
601
+ if (!d) throw Error("picked plugin config hook must run before virtual module load");
602
+ return J({
603
+ apiUrl: d.apiUrl,
604
+ projectId: d.projectId,
605
+ projectConfig: g,
606
+ previewToken: d.previewToken ?? void 0
607
+ });
608
+ }
570
609
  },
571
610
  configureServer(e) {
572
611
  if (t.disableLauncher) return;
573
- e.middlewares.use(re(() => f(s)));
612
+ e.middlewares.use(O(() => h(s)));
574
613
  let n = e.printUrls.bind(e);
575
614
  e.printUrls = () => {
576
615
  let t = e.resolvedUrls?.local[0];
@@ -586,13 +625,13 @@ function he(t) {
586
625
  handler(e, n) {
587
626
  if (!t.disableLauncher) {
588
627
  if ("index.html" in n) {
589
- T.debug("index.html came from the build; skipping the launcher page");
628
+ D.debug("index.html came from the build; skipping the launcher page");
590
629
  return;
591
630
  }
592
631
  this.emitFile({
593
632
  type: "asset",
594
633
  fileName: "index.html",
595
- source: f(s)
634
+ source: h(s)
596
635
  });
597
636
  }
598
637
  }
@@ -600,7 +639,7 @@ function he(t) {
600
639
  };
601
640
  }
602
641
  function $(e, t) {
603
- let n = M(e.features), r = M(e.experiences), i = M(e.steps), a = M(e.fields), o = M(e.conditions), s = M(e.actions), c = JSON.stringify(e).length, l = [
642
+ let n = F(e.features), r = F(e.experiences), i = F(e.steps), a = F(e.fields), o = F(e.conditions), s = F(e.actions), c = JSON.stringify(e).length, l = [
604
643
  `${n.length.toString()} features`,
605
644
  `${r.length.toString()} experiences`,
606
645
  `${i.length.toString()} steps`,
@@ -608,7 +647,7 @@ function $(e, t) {
608
647
  `${o.length.toString()} conditions`,
609
648
  `${s.length.toString()} actions`
610
649
  ].join(", ");
611
- T.info(`fetched config in ${t}ms (${l})`), q("Features", n, se), q("Experiences", r, ce), q("Steps", i, le), q("Fields", a, ue), q("Conditions", o, de), oe("Actions", s), T.debug(`config size: ${c.toString()} bytes`);
650
+ D.info(`fetched config in ${t}ms (${l})`), Y("Features", n, ce), Y("Experiences", r, le), Y("Steps", i, ue), Y("Fields", a, de), Y("Conditions", o, fe), se("Actions", s), D.debug(`config size: ${c.toString()} bytes`);
612
651
  }
613
652
  //#endregion
614
- export { he as picked };
653
+ export { xe as picked };