@cloud-cli/on 1.35.0 → 1.36.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.
- package/dist/dashboard.d.ts +1 -1
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/on.js +1083 -569
- package/dist/run-view.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/html-state.d.ts +0 -2
- package/dist/html-state.d.ts.map +0 -1
package/dist/on.js
CHANGED
|
@@ -326,15 +326,10 @@ var de = class extends l {
|
|
|
326
326
|
for (let n of t) e = e.replaceAll(n, "****");
|
|
327
327
|
return e;
|
|
328
328
|
}
|
|
329
|
-
}, he = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"theme-color\" content=\"#030712\" />\n <meta name=\"mobile-web-app-capable\" content=\"yes\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n <link rel=\"icon\" href=\"/app-icon.svg\" type=\"image/svg+xml\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/lucide-icon.html\" />\n <title>Workflow Engine Dashboard</title>\n <script type=\"importmap\">\n { \"imports\": { \"@li3/\": \"https://cdn.li3.dev/@li3/\" } }\n <\/script>\n </head>\n <body class=\"bg-gray-950 text-gray-100 min-h-screen p-4 md:p-6 font-sans\">\n <template app>\n <main class=\"max-w-6xl mx-auto space-y-6\">\n <header class=\"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-gray-800 pb-4\">\n <div>\n <h1 class=\"text-2xl font-bold text-white\">Runner Engine Status</h1>\n <p class=\"text-xs text-gray-400\">Live Job Queue & Execution Traces</p>\n </div>\n <div class=\"flex flex-wrap items-center gap-3 text-xs font-mono\">\n <a href=\"/help\" aria-label=\"Help\" title=\"Help\" class=\"inline-flex h-9 w-9 items-center justify-center rounded-full border border-indigo-500/40 bg-indigo-500/10 text-indigo-200 outline-none transition hover:bg-indigo-500/20 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path><path d=\"M12 17h.01\"></path></svg>\n </a>\n <a href=\"/workflows\" aria-label=\"Settings\" title=\"Settings\" class=\"inline-flex h-9 w-9 items-center justify-center rounded-full border border-indigo-500/40 bg-indigo-500/10 text-indigo-200 outline-none transition hover:bg-indigo-500/20 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n <lucide-icon icon=\"settings\" size=\"16\"></lucide-icon>\n </a>\n <template if=\"notificationsSupported\">\n <button\n aria-label=\"Notifications\"\n title=\"Notifications\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-full border outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n bind-class=\"notificationsEnabled ? 'border-emerald-500/30.bg-emerald-500/10.text-emerald-300' : 'border-indigo-500/40.bg-indigo-500/10.text-indigo-300'\"\n on-click=\"toggleNotifications()\"\n >\n <lucide-icon bind-icon=\"notificationsEnabled ? 'bell-ring' : 'bell-off'\" size=\"16\"></lucide-icon>\n <span class=\"sr-only\">{{ notificationsEnabled ? 'Notifications on' : 'Enable notifications' }}</span>\n </button>\n </template>\n <template if=\"refreshError\">\n <span class=\"rounded border border-rose-500/20 bg-rose-500/10 px-3 py-1 text-rose-400\"\n >Refresh failed</span\n >\n </template>\n </div>\n </header>\n\n <form class=\"flex items-center gap-2\" on-submit.prevent=\"applyFilter()\">\n <div class=\"relative min-w-0 flex-1\">\n <label class=\"sr-only\" for=\"job-filter\">Filter jobs</label>\n <input\n id=\"job-filter\"\n bind-value=\"filter\"\n on-input=\"setFilter($event)\"\n class=\"w-full rounded-lg border border-gray-800 bg-gray-900 px-3 py-2 pr-10 text-sm text-gray-200 outline-none placeholder:text-gray-600 focus:border-indigo-500\"\n placeholder=\"Filter: name:cloud-cli/* or search JSON\"\n />\n <template if=\"filter\">\n <button\n type=\"button\"\n on-click=\"clearFilter()\"\n class=\"absolute right-1 top-1/2 -translate-y-1/2 rounded-md p-1 text-gray-500 hover:bg-gray-800 hover:text-gray-200\"\n >\n <lucide-icon icon=\"x\" size=\"15\"></lucide-icon>\n <span class=\"sr-only\">Clear job filter</span>\n </button>\n </template>\n </div>\n <button\n type=\"submit\"\n aria-label=\"Search jobs\"\n class=\"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-indigo-500/40 bg-indigo-500/10 text-indigo-200 hover:bg-indigo-500/20\"\n >\n <lucide-icon icon=\"search\" size=\"16\"></lucide-icon>\n </button>\n </form>\n\n <template if=\"activeFilter\">\n <p class=\"text-xs text-gray-400\">\n Showing {{ jobs.length }} jobs matching <span class=\"font-mono text-indigo-300\">{{ activeFilter }}</span>\n </p>\n </template>\n\n <template if=\"notificationNotice\">\n <button\n class=\"w-full rounded-lg border border-gray-700 bg-gray-900 px-4 py-3 text-left text-sm text-gray-300\"\n on-click=\"notificationNotice = ''\"\n >\n {{ notificationNotice }}\n </button>\n </template>\n\n <section class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden hidden md:block\">\n <table class=\"w-full text-left text-sm\">\n <thead class=\"bg-gray-800/50 text-gray-400 text-xs uppercase font-mono border-b border-gray-800\">\n <tr>\n <th class=\"py-3 px-4\">Job ID</th>\n <th class=\"py-3 px-4\">Workflow</th>\n <th class=\"py-3 px-4\">Status</th>\n <th class=\"py-3 px-4 hidden xl:table-cell\">Worker</th>\n <th class=\"py-3 px-4 hidden lg:table-cell\">Created At</th>\n <th class=\"py-3 px-4 text-right\">Action</th>\n </tr>\n </thead>\n <tbody>\n <template for=\"job of jobs\">\n <tr class=\"border-b border-gray-800 hover:bg-gray-800/40 transition\">\n <td class=\"py-3 px-4 font-mono text-indigo-400\">\n <a attr-href=\"'/runs/' + job.id\" class=\"hover:underline\">#{{ job.id }}</a>\n </td>\n <td class=\"py-3 px-4 font-medium text-white\">{{ job.workflowId }}</td>\n <td class=\"py-3 px-4\">\n <span\n class=\"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400': job.status === 'success',\n 'bg-rose-500/10.text-rose-400': job.status === 'failed',\n 'bg-indigo-500/10.text-indigo-400.animate-pulse': job.status === 'running' || job.status === 'pending',\n 'bg-gray-500/10.text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n >\n <lucide-icon\n class=\"shrink-0\"\n bind-class=\"{\n 'text-emerald-400': job.status === 'success',\n 'text-rose-400': job.status === 'failed',\n 'text-indigo-400.animate-spin': job.status === 'running' || job.status === 'pending',\n 'text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n bind-icon=\"\n job.status === 'success'\n ? 'circle-check'\n : job.status === 'failed'\n ? 'circle-x'\n : job.status === 'running'\n ? 'loader-circle'\n : 'circle'\n \"\n size=\"14\"\n ></lucide-icon>\n {{ upper(job.status) }}\n </span>\n </td>\n <td class=\"py-3 px-4 hidden xl:table-cell text-xs font-mono text-gray-400\">\n {{ job.workerId || '-' }}\n </td>\n <td class=\"py-3 px-4 hidden lg:table-cell text-xs text-gray-400\">{{ job.createdAt }}</td>\n <td class=\"py-3 px-4 text-right whitespace-nowrap\">\n <a\n attr-href=\"'/runs/' + job.id\"\n class=\"text-xs bg-gray-800 hover:bg-gray-700 text-gray-200 px-3 py-1 rounded border border-gray-700\"\n >View Trace</a\n >\n </td>\n </tr>\n </template>\n </tbody>\n </table>\n <template if=\"!jobs.length\">\n <div class=\"p-8 text-center text-gray-500\">\n {{ activeFilter ? 'No jobs match the current filter.' : 'No jobs recorded yet.' }}\n </div>\n </template>\n </section>\n\n <section\n class=\"md:hidden bg-gray-900 border border-gray-800 rounded-xl divide-y divide-gray-800 overflow-hidden\"\n >\n <template for=\"job of jobs\">\n <a\n attr-href=\"'/runs/' + job.id\"\n class=\"block p-4 bg-gray-900/60 hover:bg-gray-800/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400\"\n >\n <div class=\"flex items-start justify-between gap-3\">\n <div class=\"min-w-0\">\n <div class=\"flex items-center gap-2\">\n <lucide-icon\n class=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray-700/70\"\n bind-class=\"{\n 'text-emerald-400': job.status === 'success',\n 'text-rose-400': job.status === 'failed',\n 'text-indigo-400.animate-spin': job.status === 'running' || job.status === 'pending',\n 'text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n bind-icon=\"\n job.status === 'success'\n ? 'circle-check'\n : job.status === 'failed'\n ? 'circle-x'\n : job.status === 'running'\n ? 'loader-circle'\n : 'circle'\n \"\n size=\"15\"\n ></lucide-icon>\n <h2 class=\"font-medium text-white truncate\">{{ job.workflowId }}</h2>\n </div>\n <p class=\"mt-1 pl-[36px] text-xs font-mono text-gray-400\">#{{ job.id }} · {{ upper(job.status) }}</p>\n </div>\n </div>\n </a>\n </template>\n <template if=\"!jobs.length\">\n <div class=\"p-8 text-center text-gray-500\">\n {{ activeFilter ? 'No jobs match the current filter.' : 'No jobs recorded yet.' }}\n </div>\n </template>\n </section>\n\n <template if=\"hasMore\">\n <div class=\"flex justify-center\">\n <button\n class=\"px-4 py-2 text-sm text-gray-200 bg-gray-800 hover:bg-gray-700 border border-gray-700 rounded-lg\"\n on-click=\"loadMore()\"\n >\n {{ loadingMore ? 'Loading...' : 'Load more' }}\n </button>\n </div>\n </template>\n </main>\n\n <script setup>\n import { onDestroy, onInit, ref } from '@li3/web';\n\n export default function setup() {\n const jobs = ref([]);\n const refreshError = ref(false);\n const hasMore = ref(false);\n const loadingMore = ref(false);\n const filter = ref('');\n const activeFilter = ref('');\n const pushConfigured = ref(false);\n const notificationsSupported = ref('Notification' in window && 'serviceWorker' in navigator);\n const notificationsEnabled = ref(\n notificationsSupported.value &&\n Notification.permission === 'granted' &&\n localStorage.getItem('runner-notifications') === 'enabled',\n );\n const notificationNotice = ref('');\n let refreshTimer;\n let eventSource;\n let refreshing = false;\n let refreshPending = false;\n let searchInProgress = false;\n let refreshGeneration = 0;\n\n const upper = (value) => String(value || '').toUpperCase();\n const terminalStatuses = new Set(['success', 'failed', 'cancelled']);\n const notifyCompletedJob = async (job) => {\n if (!notificationsEnabled.value || pushConfigured.value || !['success', 'failed'].includes(job.status)) return;\n try {\n const registration = await navigator.serviceWorker.ready;\n await registration.showNotification(\n job.status === 'success' ? `Job #${job.id} succeeded` : `Job #${job.id} failed`,\n {\n body: `${job.workflowId} finished with status ${job.status}.`,\n icon: '/app-icon.svg',\n badge: '/app-icon.svg',\n tag: `runner-job-${job.id}`,\n renotify: true,\n data: { url: `/runs/${job.id}` },\n },\n );\n } catch (error) {\n console.error('Unable to show job notification', error);\n }\n };\n const toggleNotifications = async () => {\n if (notificationsEnabled.value) {\n notificationsEnabled.value = false;\n localStorage.removeItem('runner-notifications');\n await disablePushNotifications();\n notificationNotice.value = 'Job notifications are paused on this device.';\n return;\n }\n if (Notification.permission === 'denied') {\n notificationNotice.value =\n 'Notifications are blocked. Allow them in this site’s Android browser settings.';\n return;\n }\n const permission = await Notification.requestPermission();\n notificationsEnabled.value = permission === 'granted';\n if (notificationsEnabled.value) {\n localStorage.setItem('runner-notifications', 'enabled');\n await enablePushNotifications();\n notificationNotice.value =\n 'Notifications enabled. Background delivery is available when server push is configured.';\n } else {\n notificationNotice.value = 'Notification permission was not granted.';\n }\n };\n const urlBase64ToUint8Array = (value) => {\n const padding = '='.repeat((4 - (value.length % 4)) % 4);\n const raw = atob((value + padding).replace(/-/g, '+').replace(/_/g, '/'));\n return Uint8Array.from([...raw].map((character) => character.charCodeAt(0)));\n };\n const enablePushNotifications = async () => {\n try {\n if (!notificationsSupported.value) return;\n const response = await fetch('/api/push/public-key', { headers: { accept: 'application/json' } });\n if (!response.ok) return;\n const { publicKey } = await response.json();\n pushConfigured.value = true;\n const registration = await navigator.serviceWorker.ready;\n const subscription =\n (await registration.pushManager.getSubscription()) ||\n (await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(publicKey),\n }));\n const saveResponse = await fetch('/api/push/subscriptions', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(subscription),\n });\n if (!saveResponse.ok) throw new Error(`Push subscription failed: ${saveResponse.status}`);\n } catch (error) {\n console.error('Unable to enable background notifications', error);\n }\n };\n const disablePushNotifications = async () => {\n try {\n const registration = await navigator.serviceWorker.ready;\n const subscription = await registration.pushManager.getSubscription();\n if (!subscription) return;\n await fetch('/api/push/subscriptions', {\n method: 'DELETE',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ endpoint: subscription.endpoint }),\n });\n await subscription.unsubscribe();\n } catch (error) {\n console.error('Unable to disable background notifications', error);\n }\n };\n const refreshJobs = async (isSearch = false) => {\n if (searchInProgress && !isSearch) return;\n if (refreshing && !isSearch) {\n refreshPending = true;\n return;\n }\n refreshing = true;\n const generation = refreshGeneration;\n\n try {\n const activeIds = jobs.value\n .filter((job) => !terminalStatuses.has(job.status))\n .map((job) => Number(job.id));\n const knownIds = jobs.value.map((job) => Number(job.id));\n const afterId = activeIds.length\n ? Math.max(0, Math.min(...activeIds) - 1)\n : knownIds.length\n ? Math.max(...knownIds)\n : null;\n const filterQuery = activeFilter.value ? `&filter=${encodeURIComponent(activeFilter.value)}` : '';\n const url =\n afterId === null\n ? `/api/jobs?limit=500${filterQuery}`\n : `/api/jobs?afterId=${afterId}&limit=500${filterQuery}`;\n const response = await fetch(url, { headers: { accept: 'application/json' } });\n if (!response.ok) throw new Error(`Dashboard refresh failed: ${response.status}`);\n\n const data = await response.json();\n if (generation !== refreshGeneration) return;\n const previousStatuses = new Map(jobs.value.map((job) => [job.id, job.status]));\n const merged = new Map(jobs.value.map((job) => [job.id, job]));\n for (const job of data.jobs) {\n const previousStatus = previousStatuses.get(job.id);\n merged.set(job.id, job);\n if (previousStatus && !terminalStatuses.has(previousStatus) && terminalStatuses.has(job.status)) {\n void notifyCompletedJob(job);\n }\n }\n jobs.value = Array.from(merged.values()).sort((a, b) => Number(b.id) - Number(a.id));\n refreshError.value = false;\n } catch (error) {\n console.error(error);\n refreshError.value = true;\n } finally {\n refreshing = false;\n if (refreshPending && !searchInProgress) {\n refreshPending = false;\n void refreshJobs();\n }\n }\n };\n\n const loadMore = async () => {\n if (loadingMore.value || !hasMore.value || !jobs.value.length) return;\n loadingMore.value = true;\n\n try {\n const beforeId = Math.min(...jobs.value.map((job) => Number(job.id)));\n const filterQuery = activeFilter.value ? `&filter=${encodeURIComponent(activeFilter.value)}` : '';\n const response = await fetch(`/api/jobs?beforeId=${beforeId}${filterQuery}`, {\n headers: { accept: 'application/json' },\n });\n if (!response.ok) throw new Error(`Loading older jobs failed: ${response.status}`);\n\n const data = await response.json();\n const merged = new Map(jobs.value.map((job) => [job.id, job]));\n for (const job of data.jobs) merged.set(job.id, job);\n jobs.value = Array.from(merged.values()).sort((a, b) => Number(b.id) - Number(a.id));\n hasMore.value = data.hasMore;\n } catch (error) {\n console.error(error);\n refreshError.value = true;\n } finally {\n loadingMore.value = false;\n }\n };\n const applyFilter = async () => {\n searchInProgress = true;\n refreshGeneration++;\n activeFilter.value = filter.value.trim();\n jobs.value = [];\n hasMore.value = false;\n try {\n await refreshJobs(true);\n } finally {\n searchInProgress = false;\n refreshPending = false;\n }\n };\n const setFilter = (event) => {\n filter.value = event.target.value;\n };\n const clearFilter = async () => {\n searchInProgress = true;\n refreshGeneration++;\n filter.value = '';\n activeFilter.value = '';\n jobs.value = [];\n hasMore.value = false;\n try {\n await refreshJobs(true);\n } finally {\n searchInProgress = false;\n refreshPending = false;\n }\n };\n\n onInit(() => {\n if (notificationsSupported.value) {\n navigator.serviceWorker\n .register('/service-worker.js')\n .then(() => {\n if (notificationsEnabled.value) void enablePushNotifications();\n })\n .catch((error) => {\n console.error('Service worker registration failed', error);\n });\n }\n eventSource = new EventSource('/api/events');\n eventSource.addEventListener('jobs.available', refreshJobs);\n eventSource.addEventListener('jobs.changed', refreshJobs);\n eventSource.onerror = () => {\n refreshError.value = true;\n };\n refreshTimer = setInterval(refreshJobs, 60000);\n });\n onDestroy(() => {\n eventSource?.close();\n clearInterval(refreshTimer);\n });\n\n return {\n jobs,\n refreshError,\n hasMore,\n loadingMore,\n filter,\n activeFilter,\n pushConfigured,\n setFilter,\n loadMore,\n applyFilter,\n clearFilter,\n upper,\n notificationsSupported,\n notificationsEnabled,\n notificationNotice,\n toggleNotifications,\n };\n }\n <\/script>\n <script state>\n __DASHBOARD_STATE__\n <\/script>\n </template>\n\n <script type=\"module\">\n import '@li3/web';\n <\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n </body>\n</html>\n";
|
|
330
|
-
//#endregion
|
|
331
|
-
//#region src/html-state.ts
|
|
332
|
-
function ge(e) {
|
|
333
|
-
return JSON.stringify(e).replace(/[<>&\u2028\u2029]/g, (e) => `\\u${e.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
334
|
-
}
|
|
329
|
+
}, he = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"theme-color\" content=\"#030712\" />\n <meta name=\"mobile-web-app-capable\" content=\"yes\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n <link rel=\"icon\" href=\"/app-icon.svg\" type=\"image/svg+xml\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/lucide-icon.html\" />\n <title>Workflow Engine Dashboard</title>\n <script type=\"importmap\">\n { \"imports\": { \"@li3/\": \"https://cdn.li3.dev/@li3/\" } }\n <\/script>\n </head>\n <body class=\"bg-gray-950 text-gray-100 min-h-screen p-4 md:p-6 font-sans\">\n <template app>\n <main class=\"max-w-6xl mx-auto space-y-6\">\n <header class=\"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-gray-800 pb-4\">\n <div>\n <h1 class=\"text-2xl font-bold text-white\">Runner Engine Status</h1>\n <p class=\"text-xs text-gray-400\">Live Job Queue & Execution Traces</p>\n </div>\n <div class=\"flex flex-wrap items-center gap-3 text-xs font-mono\">\n <a\n href=\"/help\"\n aria-label=\"Help\"\n title=\"Help\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-full border border-indigo-500/40 bg-indigo-500/10 text-indigo-200 outline-none transition hover:bg-indigo-500/20 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path>\n <path d=\"M12 17h.01\"></path>\n </svg>\n </a>\n <a\n href=\"/workflows\"\n aria-label=\"Settings\"\n title=\"Settings\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-full border border-indigo-500/40 bg-indigo-500/10 text-indigo-200 outline-none transition hover:bg-indigo-500/20 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <lucide-icon icon=\"settings\" size=\"16\"></lucide-icon>\n </a>\n <template if=\"notificationsSupported\">\n <button\n aria-label=\"Notifications\"\n title=\"Notifications\"\n class=\"inline-flex h-9 w-9 items-center justify-center rounded-full border outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n bind-class=\"notificationsEnabled ? 'border-emerald-500/30 bg-emerald-500/10 text-emerald-300' : 'border-indigo-500/40 bg-indigo-500/10 text-indigo-300'\"\n on-click=\"toggleNotifications()\"\n >\n <lucide-icon bind-icon=\"notificationsEnabled ? 'bell-ring' : 'bell-off'\" size=\"16\"></lucide-icon>\n <span class=\"sr-only\">{{ notificationsEnabled ? 'Notifications on' : 'Enable notifications' }}</span>\n </button>\n </template>\n <template if=\"refreshError\">\n <span class=\"rounded border border-rose-500/20 bg-rose-500/10 px-3 py-1 text-rose-400\"\n >Refresh failed</span\n >\n </template>\n </div>\n </header>\n\n <form class=\"flex items-center gap-2\" on-submit.prevent=\"applyFilter()\">\n <div class=\"relative min-w-0 flex-1\">\n <label class=\"sr-only\" for=\"job-filter\">Filter jobs</label>\n <input\n id=\"job-filter\"\n bind-value=\"filter\"\n on-input=\"setFilter($event)\"\n class=\"w-full rounded-lg border border-gray-800 bg-gray-900 px-3 py-2 pr-10 text-sm text-gray-200 outline-none placeholder:text-gray-600 focus:border-indigo-500\"\n placeholder=\"Filter: name:cloud-cli/* or text search\"\n />\n <template if=\"filter\">\n <button\n type=\"button\"\n on-click=\"clearFilter()\"\n class=\"absolute right-1 top-1/2 -translate-y-1/2 rounded-md p-1 text-gray-500 hover:bg-gray-800 hover:text-gray-200\"\n >\n <lucide-icon icon=\"x\" size=\"15\"></lucide-icon>\n <span class=\"sr-only\">Clear job filter</span>\n </button>\n </template>\n </div>\n <button\n type=\"submit\"\n aria-label=\"Search jobs\"\n class=\"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-indigo-500/40 bg-indigo-500/10 text-indigo-200 hover:bg-indigo-500/20\"\n >\n <lucide-icon icon=\"search\" size=\"16\"></lucide-icon>\n </button>\n </form>\n\n <template if=\"activeFilter\">\n <p class=\"flex items-center gap-1\">\n <span class=\"text-xs text-gray-400\">Showing {{ jobs.length }} jobs matching </span\n ><span class=\"font-mono text-indigo-300\">{{ activeFilter }}</span>\n </p>\n </template>\n\n <template if=\"notificationNotice\">\n <button\n class=\"w-full rounded-lg border border-gray-700 bg-gray-900 px-4 py-3 text-left text-sm text-gray-300\"\n on-click=\"notificationNotice = ''\"\n >\n {{ notificationNotice }}\n </button>\n </template>\n\n <section class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden hidden md:block\">\n <table class=\"w-full text-left text-sm\">\n <thead class=\"bg-gray-800/50 text-gray-400 text-xs uppercase font-mono border-b border-gray-800\">\n <tr>\n <th class=\"py-3 px-4\">Job ID</th>\n <th class=\"py-3 px-4\">Workflow</th>\n <th class=\"py-3 px-4\">Status</th>\n <th class=\"py-3 px-4 hidden xl:table-cell\">Worker</th>\n <th class=\"py-3 px-4 hidden lg:table-cell\">Created At</th>\n <th class=\"py-3 px-4 text-right\">Action</th>\n </tr>\n </thead>\n <tbody>\n <template for=\"job of jobs\">\n <tr class=\"border-b border-gray-800 hover:bg-gray-800/40 transition\">\n <td class=\"py-3 px-4 font-mono text-indigo-400\">\n <a attr-href=\"'/runs/' + job.id\" class=\"hover:underline\">#{{ job.id }}</a>\n </td>\n <td class=\"py-3 px-4 font-medium text-white\">{{ job.workflowId }}</td>\n <td class=\"py-3 px-4\">\n <span\n class=\"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400': job.status === 'success',\n 'bg-rose-500/10.text-rose-400': job.status === 'failed',\n 'bg-indigo-500/10.text-indigo-400.animate-pulse': job.status === 'running' || job.status === 'pending',\n 'bg-gray-500/10.text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n >\n <lucide-icon\n class=\"shrink-0\"\n bind-class=\"{\n 'text-emerald-400': job.status === 'success',\n 'text-rose-400': job.status === 'failed',\n 'text-indigo-400.animate-spin': job.status === 'running' || job.status === 'pending',\n 'text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n bind-icon=\"\n job.status === 'success'\n ? 'circle-check'\n : job.status === 'failed'\n ? 'circle-x'\n : job.status === 'running'\n ? 'loader-circle'\n : 'circle'\n \"\n size=\"14\"\n ></lucide-icon>\n {{ upper(job.status) }}\n </span>\n </td>\n <td class=\"py-3 px-4 hidden xl:table-cell text-xs font-mono text-gray-400\">\n {{ job.workerId || '-' }}\n </td>\n <td class=\"py-3 px-4 hidden lg:table-cell text-xs text-gray-400\">{{ job.createdAt }}</td>\n <td class=\"py-3 px-4 text-right whitespace-nowrap\">\n <a\n attr-href=\"'/runs/' + job.id\"\n class=\"text-xs bg-gray-800 hover:bg-gray-700 text-gray-200 px-3 py-1 rounded border border-gray-700\"\n >View Trace</a\n >\n </td>\n </tr>\n </template>\n </tbody>\n </table>\n <template if=\"!jobs.length\">\n <div class=\"p-8 text-center text-gray-500\">\n {{ activeFilter ? 'No jobs match the current filter.' : 'No jobs recorded yet.' }}\n </div>\n </template>\n </section>\n\n <section\n class=\"md:hidden bg-gray-900 border border-gray-800 rounded-xl divide-y divide-gray-800 overflow-hidden\"\n >\n <template for=\"job of jobs\">\n <a\n attr-href=\"'/runs/' + job.id\"\n class=\"block p-4 bg-gray-900/60 hover:bg-gray-800/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400\"\n >\n <div class=\"flex items-start justify-between gap-3\">\n <div class=\"min-w-0\">\n <div class=\"flex items-center gap-2\">\n <lucide-icon\n class=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray-700/70\"\n bind-class=\"{\n 'text-emerald-400': job.status === 'success',\n 'text-rose-400': job.status === 'failed',\n 'text-indigo-400.animate-spin': job.status === 'running' || job.status === 'pending',\n 'text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n bind-icon=\"\n job.status === 'success'\n ? 'circle-check'\n : job.status === 'failed'\n ? 'circle-x'\n : job.status === 'running'\n ? 'loader-circle'\n : 'circle'\n \"\n size=\"15\"\n ></lucide-icon>\n <h2 class=\"font-medium text-white truncate\">{{ job.workflowId }}</h2>\n </div>\n <p class=\"mt-1 pl-[36px] text-xs font-mono text-gray-400\">#{{ job.id }} · {{ upper(job.status) }}</p>\n </div>\n </div>\n </a>\n </template>\n <template if=\"!jobs.length\">\n <div class=\"p-8 text-center text-gray-500\">\n {{ activeFilter ? 'No jobs match the current filter.' : 'No jobs recorded yet.' }}\n </div>\n </template>\n </section>\n\n <template if=\"hasMore\">\n <div class=\"flex justify-center\">\n <button\n class=\"px-4 py-2 text-sm text-gray-200 bg-gray-800 hover:bg-gray-700 border border-gray-700 rounded-lg\"\n on-click=\"loadMore()\"\n >\n {{ loadingMore ? 'Loading...' : 'Load more' }}\n </button>\n </div>\n </template>\n </main>\n\n <script setup>\n import { onDestroy, onInit, ref } from '@li3/web';\n\n export default function setup() {\n const jobs = ref([]);\n const refreshError = ref(false);\n const hasMore = ref(false);\n const loadingMore = ref(false);\n const filter = ref('');\n const activeFilter = ref('');\n const pushConfigured = ref(false);\n const notificationsSupported = ref('Notification' in window && 'serviceWorker' in navigator);\n const notificationsEnabled = ref(\n notificationsSupported.value &&\n Notification.permission === 'granted' &&\n localStorage.getItem('runner-notifications') === 'enabled',\n );\n const notificationNotice = ref('');\n let refreshTimer;\n let eventSource;\n let refreshing = false;\n let refreshPending = false;\n let searchInProgress = false;\n let refreshGeneration = 0;\n\n const upper = (value) => String(value || '').toUpperCase();\n const terminalStatuses = new Set(['success', 'failed', 'cancelled']);\n const notifyCompletedJob = async (job) => {\n if (!notificationsEnabled.value || pushConfigured.value || !['success', 'failed'].includes(job.status))\n return;\n try {\n const registration = await navigator.serviceWorker.ready;\n await registration.showNotification(\n job.status === 'success' ? `Job #${job.id} succeeded` : `Job #${job.id} failed`,\n {\n body: `${job.workflowId} finished with status ${job.status}.`,\n icon: '/app-icon.svg',\n badge: '/app-icon.svg',\n tag: `runner-job-${job.id}`,\n renotify: true,\n data: { url: `/runs/${job.id}` },\n },\n );\n } catch (error) {\n console.error('Unable to show job notification', error);\n }\n };\n const toggleNotifications = async () => {\n if (notificationsEnabled.value) {\n notificationsEnabled.value = false;\n localStorage.removeItem('runner-notifications');\n await disablePushNotifications();\n notificationNotice.value = 'Job notifications are paused on this device.';\n return;\n }\n if (Notification.permission === 'denied') {\n notificationNotice.value =\n 'Notifications are blocked. Allow them in this site’s Android browser settings.';\n return;\n }\n const permission = await Notification.requestPermission();\n notificationsEnabled.value = permission === 'granted';\n if (notificationsEnabled.value) {\n localStorage.setItem('runner-notifications', 'enabled');\n await enablePushNotifications();\n notificationNotice.value =\n 'Notifications enabled. Background delivery is available when server push is configured.';\n } else {\n notificationNotice.value = 'Notification permission was not granted.';\n }\n };\n const urlBase64ToUint8Array = (value) => {\n const padding = '='.repeat((4 - (value.length % 4)) % 4);\n const raw = atob((value + padding).replace(/-/g, '+').replace(/_/g, '/'));\n return Uint8Array.from([...raw].map((character) => character.charCodeAt(0)));\n };\n const enablePushNotifications = async () => {\n try {\n if (!notificationsSupported.value) return;\n const response = await fetch('/api/push/public-key', { headers: { accept: 'application/json' } });\n if (!response.ok) return;\n const { publicKey } = await response.json();\n pushConfigured.value = true;\n const registration = await navigator.serviceWorker.ready;\n const subscription =\n (await registration.pushManager.getSubscription()) ||\n (await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(publicKey),\n }));\n const saveResponse = await fetch('/api/push/subscriptions', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(subscription),\n });\n if (!saveResponse.ok) throw new Error(`Push subscription failed: ${saveResponse.status}`);\n } catch (error) {\n console.error('Unable to enable background notifications', error);\n }\n };\n const disablePushNotifications = async () => {\n try {\n const registration = await navigator.serviceWorker.ready;\n const subscription = await registration.pushManager.getSubscription();\n if (!subscription) return;\n await fetch('/api/push/subscriptions', {\n method: 'DELETE',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ endpoint: subscription.endpoint }),\n });\n await subscription.unsubscribe();\n } catch (error) {\n console.error('Unable to disable background notifications', error);\n }\n };\n const refreshJobs = async (isSearch = false) => {\n if (searchInProgress && !isSearch) return;\n if (refreshing && !isSearch) {\n refreshPending = true;\n return;\n }\n refreshing = true;\n const generation = refreshGeneration;\n\n try {\n const activeIds = jobs.value\n .filter((job) => !terminalStatuses.has(job.status))\n .map((job) => Number(job.id));\n const knownIds = jobs.value.map((job) => Number(job.id));\n const afterId = activeIds.length\n ? Math.max(0, Math.min(...activeIds) - 1)\n : knownIds.length\n ? Math.max(...knownIds)\n : null;\n const filterQuery = activeFilter.value ? `&filter=${encodeURIComponent(activeFilter.value)}` : '';\n const url =\n afterId === null\n ? `/api/jobs?limit=100${filterQuery}`\n : `/api/jobs?afterId=${afterId}&limit=100${filterQuery}`;\n const response = await fetch(url, { headers: { accept: 'application/json' } });\n if (!response.ok) throw new Error(`Dashboard refresh failed: ${response.status}`);\n\n const data = await response.json();\n if (generation !== refreshGeneration) return;\n hasMore.value = data.hasMore;\n const previousStatuses = new Map(jobs.value.map((job) => [job.id, job.status]));\n const merged = new Map(jobs.value.map((job) => [job.id, job]));\n for (const job of data.jobs) {\n const previousStatus = previousStatuses.get(job.id);\n merged.set(job.id, job);\n if (previousStatus && !terminalStatuses.has(previousStatus) && terminalStatuses.has(job.status)) {\n void notifyCompletedJob(job);\n }\n }\n jobs.value = Array.from(merged.values()).sort((a, b) => Number(b.id) - Number(a.id));\n refreshError.value = false;\n } catch (error) {\n console.error(error);\n refreshError.value = true;\n } finally {\n refreshing = false;\n if (refreshPending && !searchInProgress) {\n refreshPending = false;\n void refreshJobs();\n }\n }\n };\n\n const loadMore = async () => {\n if (loadingMore.value || !hasMore.value || !jobs.value.length) return;\n loadingMore.value = true;\n\n try {\n const beforeId = Math.min(...jobs.value.map((job) => Number(job.id)));\n const filterQuery = activeFilter.value ? `&filter=${encodeURIComponent(activeFilter.value)}` : '';\n const response = await fetch(`/api/jobs?beforeId=${beforeId}${filterQuery}`, {\n headers: { accept: 'application/json' },\n });\n if (!response.ok) throw new Error(`Loading older jobs failed: ${response.status}`);\n\n const data = await response.json();\n const merged = new Map(jobs.value.map((job) => [job.id, job]));\n for (const job of data.jobs) merged.set(job.id, job);\n jobs.value = Array.from(merged.values()).sort((a, b) => Number(b.id) - Number(a.id));\n hasMore.value = data.hasMore;\n } catch (error) {\n console.error(error);\n refreshError.value = true;\n } finally {\n loadingMore.value = false;\n }\n };\n const applyFilter = async () => {\n searchInProgress = true;\n refreshGeneration++;\n activeFilter.value = filter.value.trim();\n jobs.value = [];\n hasMore.value = false;\n try {\n await refreshJobs(true);\n } finally {\n searchInProgress = false;\n refreshPending = false;\n }\n };\n const setFilter = (event) => {\n filter.value = event.target.value;\n };\n const clearFilter = async () => {\n searchInProgress = true;\n refreshGeneration++;\n filter.value = '';\n activeFilter.value = '';\n jobs.value = [];\n hasMore.value = false;\n try {\n await refreshJobs(true);\n } finally {\n searchInProgress = false;\n refreshPending = false;\n }\n };\n\n onInit(() => {\n if (notificationsSupported.value) {\n navigator.serviceWorker\n .register('/service-worker.js')\n .then(() => {\n if (notificationsEnabled.value) void enablePushNotifications();\n })\n .catch((error) => {\n console.error('Service worker registration failed', error);\n });\n }\n eventSource = new EventSource('/api/events');\n eventSource.addEventListener('jobs.available', refreshJobs);\n eventSource.addEventListener('jobs.changed', refreshJobs);\n eventSource.onerror = () => {\n refreshError.value = true;\n };\n void refreshJobs();\n refreshTimer = setInterval(refreshJobs, 60000);\n });\n onDestroy(() => {\n eventSource?.close();\n clearInterval(refreshTimer);\n });\n\n return {\n jobs,\n refreshError,\n hasMore,\n loadingMore,\n filter,\n activeFilter,\n pushConfigured,\n setFilter,\n loadMore,\n applyFilter,\n clearFilter,\n upper,\n notificationsSupported,\n notificationsEnabled,\n notificationNotice,\n toggleNotifications,\n };\n }\n <\/script>\n </template>\n\n <script type=\"module\">\n import '@li3/web';\n <\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n </body>\n</html>\n";
|
|
335
330
|
//#endregion
|
|
336
331
|
//#region src/dashboard.ts
|
|
337
|
-
function
|
|
332
|
+
function ge(e) {
|
|
338
333
|
return e.map((e) => ({
|
|
339
334
|
id: e.id,
|
|
340
335
|
workflowId: e.workflow_id,
|
|
@@ -344,15 +339,12 @@ function _e(e) {
|
|
|
344
339
|
updatedAt: e.updated_at
|
|
345
340
|
}));
|
|
346
341
|
}
|
|
347
|
-
function
|
|
348
|
-
return he
|
|
349
|
-
jobs: e,
|
|
350
|
-
hasMore: t
|
|
351
|
-
}));
|
|
342
|
+
function _e(e = [], t = !1) {
|
|
343
|
+
return he;
|
|
352
344
|
}
|
|
353
345
|
//#endregion
|
|
354
346
|
//#region src/events.ts
|
|
355
|
-
var
|
|
347
|
+
var ve = class {
|
|
356
348
|
clients = /* @__PURE__ */ new Map();
|
|
357
349
|
nextId = 1;
|
|
358
350
|
maxClients = 1e3;
|
|
@@ -384,7 +376,7 @@ var ye = class {
|
|
|
384
376
|
this.clients.clear();
|
|
385
377
|
}
|
|
386
378
|
};
|
|
387
|
-
async function
|
|
379
|
+
async function ye(e, t, n, r) {
|
|
388
380
|
let i = await fetch(new URL("/api/events", e), {
|
|
389
381
|
headers: { Accept: "text/event-stream" },
|
|
390
382
|
signal: t
|
|
@@ -407,16 +399,16 @@ async function be(e, t, n, r) {
|
|
|
407
399
|
}
|
|
408
400
|
//#endregion
|
|
409
401
|
//#region src/preprocessors/github.ts
|
|
410
|
-
function
|
|
402
|
+
function be(e, t) {
|
|
411
403
|
let n = t.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*");
|
|
412
404
|
return RegExp(`^${n}$`).test(e);
|
|
413
405
|
}
|
|
414
|
-
var
|
|
415
|
-
function
|
|
416
|
-
let n =
|
|
406
|
+
var xe = (e) => Array.isArray(e) ? e : [e];
|
|
407
|
+
function Se(e, t) {
|
|
408
|
+
let n = xe(t), r = n.filter((e) => !e.startsWith("!"));
|
|
417
409
|
return !n.some((t) => t.startsWith("!") && t.slice(1) === e) && (r.length === 0 || r.includes(e));
|
|
418
410
|
}
|
|
419
|
-
var
|
|
411
|
+
var Ce = class {
|
|
420
412
|
name = "github";
|
|
421
413
|
parse(e, t, n) {
|
|
422
414
|
let r = !1, i = null, a = e["x-hub-signature-256"];
|
|
@@ -453,12 +445,12 @@ var we = class {
|
|
|
453
445
|
}
|
|
454
446
|
filter(e, t) {
|
|
455
447
|
let n = !0;
|
|
456
|
-
return t.events && !t.events.includes(e.event) && (n = !1), t.owner && !
|
|
448
|
+
return t.events && !t.events.includes(e.event) && (n = !1), t.owner && !Se(e.owner, t.owner) && (n = !1), t.repo && !Se(e.repo, t.repo) && (n = !1), t.name && !Se(e.full_name, t.name) && (n = !1), t.branches && e.ref && !xe(t.branches).some((t) => be(e.ref, String(t))) && (n = !1), t.refs && e.ref && !xe(t.refs).some((t) => be(e.ref, String(t))) && (n = !1), t.tag !== void 0 && !!e.tag !== t.tag && (n = !1), t.paths && ((Array.isArray(e.changes) ? e.changes : []).some((e) => t.paths?.some((t) => be(e, t))) || (n = !1)), {
|
|
457
449
|
isValid: n,
|
|
458
450
|
inputs: e
|
|
459
451
|
};
|
|
460
452
|
}
|
|
461
|
-
},
|
|
453
|
+
}, we = JSON.stringify({
|
|
462
454
|
id: "/runs",
|
|
463
455
|
name: "Runner Engine",
|
|
464
456
|
short_name: "Runner",
|
|
@@ -474,9 +466,9 @@ var we = class {
|
|
|
474
466
|
type: "image/svg+xml",
|
|
475
467
|
purpose: "any maskable"
|
|
476
468
|
}]
|
|
477
|
-
}), Ee = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <rect width=\"512\" height=\"512\" rx=\"112\" fill=\"#030712\"/>\n <path d=\"M128 144h256v224H128z\" fill=\"#111827\" stroke=\"#6366f1\" stroke-width=\"24\"/>\n <path d=\"m174 218 62 38-62 38M260 300h78\" fill=\"none\" stroke=\"#f9fafb\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"24\"/>\n <circle cx=\"365\" cy=\"147\" r=\"47\" fill=\"#10b981\" stroke=\"#030712\" stroke-width=\"18\"/>\n</svg>", De = "self.addEventListener('install', () => self.skipWaiting());\nself.addEventListener('activate', (event) => event.waitUntil(self.clients.claim()));\nself.addEventListener('push', (event) => {\n const data = event.data?.json() || {};\n event.waitUntil(self.registration.showNotification(data.title || 'Runner Engine', {\n body: data.body || 'A job status changed.',\n icon: '/app-icon.svg',\n badge: '/app-icon.svg',\n data: { url: data.url || '/runs' },\n }));\n});\nself.addEventListener('notificationclick', (event) => {\n event.notification.close();\n const target = event.notification.data?.url || '/runs';\n event.waitUntil((async () => {\n const windows = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });\n const existing = windows.find((client) => new URL(client.url).pathname === target);\n if (existing) return existing.focus();\n return self.clients.openWindow(target);\n })());\n});", Oe = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"theme-color\" content=\"#030712\" />\n <meta name=\"mobile-web-app-capable\" content=\"yes\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n <link rel=\"icon\" href=\"/app-icon.svg\" type=\"image/svg+xml\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/lucide-icon.html\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/code-block.html\" />\n <title>Workflow Run</title>\n <script type=\"importmap\">\n {\n \"imports\": {\n \"@li3/\": \"https://cdn.li3.dev/@li3/\",\n \"ansi_up\": \"https://esm.sh/ansi_up@6.0.6\"\n }\n }\n <\/script>\n <style>\n </style>\n </head>\n <body class=\"bg-gray-950 text-gray-100 min-h-screen p-4 md:p-6 font-sans\">\n <template app>\n <div class=\"max-w-5xl mx-auto space-y-4\">\n <header class=\"flex flex-col md:flex-row md:items-center justify-between border-b border-gray-800 pb-6 gap-4\">\n <div class=\"min-w-0\">\n <a href=\"/runs\" class=\"text-xs text-indigo-400 hover:underline mb-1 inline-block\">Back to Dashboard</a>\n <a href=\"/help\" class=\"ml-3 inline-flex items-center gap-1 text-xs text-indigo-400 outline-none hover:underline focus-visible:rounded focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path><path d=\"M12 17h.01\"></path></svg>\n Help\n </a>\n <h1 class=\"text-2xl font-bold text-white flex flex-wrap items-center gap-3\">\n {{ report.workflowName }}\n <span class=\"text-sm font-mono text-gray-500\">#{{ report.jobId }}</span>\n <template if=\"report.parentId\">\n <a attr-href=\"'/runs/' + report.parentId\" class=\"text-sm font-mono text-indigo-400 hover:underline\">\n from #{{ report.parentId }}\n </a>\n </template>\n </h1>\n <p class=\"text-xs text-gray-400 mt-1\">\n Started {{ report.startedAt }} · {{ timing }}\n <template if=\"report.workerId\"> · worker: {{ report.workerId }}</template>\n </p>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span\n class=\"px-4 py-1.5 rounded-full text-sm font-semibold border\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400.border-emerald-500/20': report.status === 'success',\n 'bg-rose-500/10.text-rose-400.border-rose-500/20': report.status === 'failed',\n 'bg-indigo-500/10.text-indigo-400.border-indigo-500/20': report.status === 'running',\n 'bg-amber-500/10.text-amber-400.border-amber-500/20': !['success', 'failed', 'running'].includes(report.status)\n }\"\n >\n {{ upper(report.status) }}\n </span>\n <template if=\"report.status === 'running'\">\n <button\n class=\"text-sm text-rose-300 px-4 py-1.5 border border-rose-500/50 hover:border-rose-400 rounded-full disabled:opacity-50\"\n on-click=\"cancelJob()\"\n attr-disabled=\"cancelling\"\n >\n {{ cancelling ? 'Cancelling...' : 'Cancel' }}\n </button>\n </template>\n <template if=\"report.status !== 'running'\">\n <button\n class=\"text-sm text-white px-4 py-1.5 border border-gray-600 hover:border-gray-400 rounded-full\"\n on-click=\"restartJob()\"\n >\n Restart\n </button>\n </template>\n </div>\n </header>\n\n <section class=\"rounded overflow-hidden border-b border-gray-800\">\n <h2 class=\"sr-only\">Execution Steps</h2>\n <template for=\"step of report.steps\">\n <details class=\"border border-b-0 border-gray-800 bg-gray-900/50 text-sm\">\n <summary\n class=\"flex flex-col md:flex-row md:items-center justify-between gap-2 p-3 bg-gray-800/40 border-b border-gray-800 cursor-pointer\"\n >\n <div class=\"flex items-center gap-3 min-w-0\">\n <lucide-icon\n class=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-gray-700/70\"\n bind-class=\"{\n 'text-emerald-400': step.status === 'success',\n 'text-rose-400': step.status === 'failed',\n 'text-indigo-400.animate-spin': step.status === 'running',\n 'text-gray-400': !['success', 'failed', 'running'].includes(step.status)\n }\"\n bind-icon=\"\n step.status === 'success'\n ? 'circle-check'\n : step.status === 'failed'\n ? 'circle-x'\n : step.status === 'running'\n ? 'loader-circle'\n : 'circle'\n \"\n size=\"15\"\n ></lucide-icon>\n <template if=\"step.exitCode !== undefined && step.exitCode !== 0\">\n <span class=\"font-mono text-gray-500\">({{ step.exitCode }})</span>\n </template>\n <h3 class=\"font-semibold text-gray-200 truncate min-w-0 flex-1\">{{ step.name }}</h3>\n <div class=\"font-mono text-gray-400 shrink-0\">{{ step.durationMs }}ms</div>\n <span\n class=\"sr-only px-2.5 py-0.5 rounded-full font-medium\"\n bind-class=\"{\n 'text-emerald-400.bg-emerald-500/10': step.status === 'success',\n 'text-rose-400.bg-rose-500/10': step.status === 'failed',\n 'text-indigo-400.bg-indigo-500/10': step.status === 'running',\n 'text-gray-400.bg-gray-500/10': !['success', 'failed', 'running'].includes(step.status)\n }\"\n >\n {{ upper(step.status) }}\n </span>\n </div>\n </summary>\n <template if=\"report.canViewLogs\">\n <div class=\"p-4 bg-gray-950 font-mono text-gray-300 leading-relaxed overflow-auto w-full\">\n <pre class=\"whitespace-pre-wrap\" bind-innerhtml=\"stepLog(step)\"></pre>\n </div>\n </template>\n <template if=\"!report.canViewLogs\">\n <div class=\"p-4 bg-gray-950 text-sm text-gray-500\">Logs are available to authenticated users.</div>\n </template>\n </details>\n </template>\n </section>\n\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden\">\n <summary class=\"cursor-pointer px-4 py-3 text-xs font-semibold uppercase tracking-wider text-gray-400 outline-none transition hover:bg-gray-800 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n Trigger Inputs\n </summary>\n <code-block\n language=\"json\"\n theme=\"atom-one-dark\"\n bind-source=\"inputsJson\"\n class=\"block max-h-[38rem] overflow-auto border-t border-gray-800 bg-gray-950 p-4\"\n ></code-block>\n </details>\n <template if=\"report.workflowSourceYaml\">\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden\">\n <summary class=\"cursor-pointer px-4 py-3 text-xs font-semibold uppercase tracking-wider text-gray-400 outline-none transition hover:bg-gray-800 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n Workflow source YAML · revision {{ report.workflowRevision }}\n </summary>\n <code-block\n language=\"yaml\"\n theme=\"atom-one-dark\"\n bind-source=\"report.workflowSourceYaml\"\n class=\"block max-h-[38rem] overflow-auto border-t border-gray-800 bg-gray-950 p-4\"\n ></code-block>\n </details>\n </template>\n <template if=\"report.canViewLogs && report.artifacts.length\">\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden\">\n <summary class=\"cursor-pointer px-4 py-3 text-xs font-semibold uppercase tracking-wider text-gray-400 outline-none transition hover:bg-gray-800 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n Artifacts\n </summary>\n <ul class=\"divide-y divide-gray-800 border-t border-gray-800\">\n <template for=\"artifact of report.artifacts\">\n <li class=\"px-4 py-3\">\n <a\n attr-href=\"artifactUrl(artifact)\"\n class=\"font-mono text-sm text-indigo-300 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >{{ artifact }}</a>\n </li>\n </template>\n </ul>\n </details>\n </template>\n </div>\n\n <script setup>\n import { computed, onDestroy, onInit, ref } from '@li3/web';\n import { AnsiUp } from 'ansi_up';\n\n export default function setup() {\n const report = ref({});\n const now = ref(Date.now());\n const ansiUp = new AnsiUp();\n ansiUp.use_classes = false;\n let eventSource;\n let refreshTimer;\n let clockTimer;\n let refreshing = false;\n let refreshPending = false;\n const cancelling = ref(false);\n\n const active = computed(() => ['pending', 'running'].includes(report.value.status));\n const inputsJson = computed(() => JSON.stringify(report.value.inputs || {}, null, 2));\n const timing = computed(() => {\n if (report.value.status === 'pending') return 'Waiting for a worker';\n if (report.value.status === 'running') {\n return `Running for ${Math.max(0, now.value - Date.parse(report.value.startedAt))}ms`;\n }\n return `Finished in ${report.value.durationMs}ms`;\n });\n\n const upper = (value) => String(value || '').toUpperCase();\n const artifactUrl = (path) => `/api/runs/${report.value.jobId}/artifacts/${encodeURIComponent(path)}`;\n const stepLog = (step) => {\n if (step.status === 'skipped') return '';\n if (step.status === 'running')\n return '<span class=\"text-indigo-400\">Step is running. Logs will appear after it finishes.</span>';\n if (step.status === 'pending') return '<span class=\"text-gray-500\">Waiting to run.</span>';\n if (step.logContent) return ansiUp.ansi_to_html(step.logContent);\n return '<span class=\"text-gray-500\">(No terminal log output recorded for this step)</span>';\n };\n const restartJob = async () => {\n const response = await fetch(`/restart/${report.value.jobId}`, { method: 'POST' });\n if (response.ok) {\n const { id } = await response.json();\n location.href = `/runs/${id}`;\n }\n };\n const cancelJob = async () => {\n if (cancelling.value || report.value.status !== 'running') return;\n cancelling.value = true;\n try {\n const response = await fetch(`/api/jobs/${report.value.jobId}/cancel`, { method: 'POST' });\n if (!response.ok) throw new Error(`Cancel failed: ${response.status}`);\n await refreshRun();\n } catch (error) {\n console.error(error);\n } finally {\n cancelling.value = false;\n }\n };\n const refreshRun = async () => {\n if (refreshing) {\n refreshPending = true;\n return;\n }\n refreshing = true;\n\n try {\n const response = await fetch(`/api/runs/${report.value.jobId}`, {\n headers: { accept: 'application/json' },\n });\n if (!response.ok) throw new Error(`Run refresh failed: ${response.status}`);\n const previousStatus = report.value.status;\n const nextReport = await response.json();\n report.value = nextReport;\n if (\n ['pending', 'running'].includes(previousStatus) &&\n ['success', 'failed'].includes(nextReport.status) &&\n 'Notification' in window &&\n 'serviceWorker' in navigator &&\n Notification.permission === 'granted' &&\n localStorage.getItem('runner-notifications') === 'enabled'\n ) {\n const registration = await navigator.serviceWorker.ready;\n await registration.showNotification(\n nextReport.status === 'success'\n ? `Job #${nextReport.jobId} succeeded`\n : `Job #${nextReport.jobId} failed`,\n {\n body: `${nextReport.workflowName} finished with status ${nextReport.status}.`,\n icon: '/app-icon.svg',\n badge: '/app-icon.svg',\n tag: `runner-job-${nextReport.jobId}`,\n renotify: true,\n data: { url: `/runs/${nextReport.jobId}` },\n },\n );\n }\n } catch (error) {\n console.error(error);\n } finally {\n refreshing = false;\n if (refreshPending) {\n refreshPending = false;\n void refreshRun();\n }\n }\n };\n const handleJobChange = (event) => {\n const data = JSON.parse(event.data || '{}');\n if (!data.jobId || String(data.jobId) === String(report.value.jobId)) void refreshRun();\n };\n\n onInit(() => {\n document.title = `Run #${report.value.jobId} - ${report.value.workflowName}`;\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register('/service-worker.js').catch((error) => {\n console.error('Service worker registration failed', error);\n });\n }\n eventSource = new EventSource('/api/events');\n eventSource.addEventListener('jobs.changed', handleJobChange);\n refreshTimer = setInterval(() => {\n if (active.value) void refreshRun();\n }, 60000);\n clockTimer = setInterval(() => {\n now.value = Date.now();\n }, 1000);\n });\n onDestroy(() => {\n eventSource?.close();\n clearInterval(refreshTimer);\n clearInterval(clockTimer);\n });\n\n return { report, inputsJson, timing, upper, artifactUrl, stepLog, restartJob, cancelJob, cancelling };\n }\n <\/script>\n <script state>\n __REPORT_STATE__\n <\/script>\n </template>\n\n <script type=\"module\">\n import '@li3/web';\n <\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n </body>\n</html>\n", ke = /(?:^|[_-])auth(?:entication)?(?:$|[_-])|access[_-]?key|api[_-]?key|authorization|cookie|credential|passphrase|password|private[_-]?key|secret|session(?:id)?|signing[_-]?key|token/i;
|
|
478
|
-
function
|
|
479
|
-
let o = JSON.parse(e.payload), s = e.report ? JSON.parse(e.report) :
|
|
469
|
+
}), Te = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <rect width=\"512\" height=\"512\" rx=\"112\" fill=\"#030712\"/>\n <path d=\"M128 144h256v224H128z\" fill=\"#111827\" stroke=\"#6366f1\" stroke-width=\"24\"/>\n <path d=\"m174 218 62 38-62 38M260 300h78\" fill=\"none\" stroke=\"#f9fafb\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"24\"/>\n <circle cx=\"365\" cy=\"147\" r=\"47\" fill=\"#10b981\" stroke=\"#030712\" stroke-width=\"18\"/>\n</svg>", Ee = "self.addEventListener('install', () => self.skipWaiting());\nself.addEventListener('activate', (event) => event.waitUntil(self.clients.claim()));\nself.addEventListener('push', (event) => {\n const data = event.data?.json() || {};\n event.waitUntil(self.registration.showNotification(data.title || 'Runner Engine', {\n body: data.body || 'A job status changed.',\n icon: '/app-icon.svg',\n badge: '/app-icon.svg',\n data: { url: data.url || '/runs' },\n }));\n});\nself.addEventListener('notificationclick', (event) => {\n event.notification.close();\n const target = event.notification.data?.url || '/runs';\n event.waitUntil((async () => {\n const windows = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });\n const existing = windows.find((client) => new URL(client.url).pathname === target);\n if (existing) return existing.focus();\n return self.clients.openWindow(target);\n })());\n});", De = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"theme-color\" content=\"#030712\" />\n <meta name=\"mobile-web-app-capable\" content=\"yes\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n <link rel=\"icon\" href=\"/app-icon.svg\" type=\"image/svg+xml\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/lucide-icon.html\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/code-block.html\" />\n <title>Workflow Run</title>\n <script type=\"importmap\">\n {\n \"imports\": {\n \"@li3/\": \"https://cdn.li3.dev/@li3/\",\n \"ansi_up\": \"https://esm.sh/ansi_up@6.0.6\"\n }\n }\n <\/script>\n <style>\n </style>\n </head>\n <body class=\"bg-gray-950 text-gray-100 min-h-screen p-4 md:p-6 font-sans\">\n <template app>\n <div class=\"max-w-5xl mx-auto space-y-4\">\n <header class=\"flex flex-col md:flex-row md:items-center justify-between border-b border-gray-800 pb-6 gap-4\">\n <div class=\"min-w-0\">\n <a href=\"/runs\" class=\"text-xs text-indigo-400 hover:underline mb-1 inline-block\">Back to Dashboard</a>\n <a href=\"/help\" class=\"ml-3 inline-flex items-center gap-1 text-xs text-indigo-400 outline-none hover:underline focus-visible:rounded focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"9\"></circle><path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path><path d=\"M12 17h.01\"></path></svg>\n Help\n </a>\n <h1 class=\"text-2xl font-bold text-white flex flex-wrap items-center gap-3\">\n {{ report.workflowName }}\n <span class=\"text-sm font-mono text-gray-500\">#{{ report.jobId }}</span>\n <template if=\"report.parentId\">\n <a attr-href=\"'/runs/' + report.parentId\" class=\"text-sm font-mono text-indigo-400 hover:underline\">\n from #{{ report.parentId }}\n </a>\n </template>\n </h1>\n <p class=\"text-xs text-gray-400 mt-1\">\n Started {{ report.startedAt }} · {{ timing }}\n <template if=\"report.workerId\"> · worker: {{ report.workerId }}</template>\n </p>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span\n class=\"px-4 py-1.5 rounded-full text-sm font-semibold border\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400.border-emerald-500/20': report.status === 'success',\n 'bg-rose-500/10.text-rose-400.border-rose-500/20': report.status === 'failed',\n 'bg-indigo-500/10.text-indigo-400.border-indigo-500/20': report.status === 'running',\n 'bg-amber-500/10.text-amber-400.border-amber-500/20': !['success', 'failed', 'running'].includes(report.status)\n }\"\n >\n {{ upper(report.status) }}\n </span>\n <template if=\"report.status === 'running'\">\n <button\n class=\"text-sm text-rose-300 px-4 py-1.5 border border-rose-500/50 hover:border-rose-400 rounded-full disabled:opacity-50\"\n on-click=\"cancelJob()\"\n attr-disabled=\"cancelling\"\n >\n {{ cancelling ? 'Cancelling...' : 'Cancel' }}\n </button>\n </template>\n <template if=\"report.status !== 'running'\">\n <button\n class=\"text-sm text-white px-4 py-1.5 border border-gray-600 hover:border-gray-400 rounded-full\"\n on-click=\"restartJob()\"\n >\n Restart\n </button>\n </template>\n </div>\n </header>\n\n <section class=\"rounded overflow-hidden border-b border-gray-800\">\n <h2 class=\"sr-only\">Execution Steps</h2>\n <template for=\"step of report.steps\">\n <details class=\"border border-b-0 border-gray-800 bg-gray-900/50 text-sm\">\n <summary\n class=\"flex flex-col md:flex-row md:items-center justify-between gap-2 p-3 bg-gray-800/40 border-b border-gray-800 cursor-pointer\"\n >\n <div class=\"flex items-center gap-3 min-w-0\">\n <lucide-icon\n class=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-gray-700/70\"\n bind-class=\"{\n 'text-emerald-400': step.status === 'success',\n 'text-rose-400': step.status === 'failed',\n 'text-indigo-400.animate-spin': step.status === 'running',\n 'text-gray-400': !['success', 'failed', 'running'].includes(step.status)\n }\"\n bind-icon=\"\n step.status === 'success'\n ? 'circle-check'\n : step.status === 'failed'\n ? 'circle-x'\n : step.status === 'running'\n ? 'loader-circle'\n : 'circle'\n \"\n size=\"15\"\n ></lucide-icon>\n <template if=\"step.exitCode !== undefined && step.exitCode !== 0\">\n <span class=\"font-mono text-gray-500\">({{ step.exitCode }})</span>\n </template>\n <h3 class=\"font-semibold text-gray-200 truncate min-w-0 flex-1\">{{ step.name }}</h3>\n <div class=\"font-mono text-gray-400 shrink-0\">{{ step.durationMs }}ms</div>\n <span\n class=\"sr-only px-2.5 py-0.5 rounded-full font-medium\"\n bind-class=\"{\n 'text-emerald-400.bg-emerald-500/10': step.status === 'success',\n 'text-rose-400.bg-rose-500/10': step.status === 'failed',\n 'text-indigo-400.bg-indigo-500/10': step.status === 'running',\n 'text-gray-400.bg-gray-500/10': !['success', 'failed', 'running'].includes(step.status)\n }\"\n >\n {{ upper(step.status) }}\n </span>\n </div>\n </summary>\n <template if=\"report.canViewLogs\">\n <div class=\"p-4 bg-gray-950 font-mono text-gray-300 leading-relaxed overflow-auto w-full\">\n <pre class=\"whitespace-pre-wrap\" bind-innerhtml=\"stepLog(step)\"></pre>\n </div>\n </template>\n <template if=\"!report.canViewLogs\">\n <div class=\"p-4 bg-gray-950 text-sm text-gray-500\">Logs are available to authenticated users.</div>\n </template>\n </details>\n </template>\n </section>\n\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden\">\n <summary class=\"cursor-pointer px-4 py-3 text-xs font-semibold uppercase tracking-wider text-gray-400 outline-none transition hover:bg-gray-800 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n Trigger Inputs\n </summary>\n <code-block\n language=\"json\"\n theme=\"atom-one-dark\"\n bind-source=\"inputsJson\"\n class=\"block max-h-[38rem] overflow-auto border-t border-gray-800 bg-gray-950 p-4\"\n ></code-block>\n </details>\n <template if=\"report.workflowSourceYaml\">\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden\">\n <summary class=\"cursor-pointer px-4 py-3 text-xs font-semibold uppercase tracking-wider text-gray-400 outline-none transition hover:bg-gray-800 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n Workflow source YAML · revision {{ report.workflowRevision }}\n </summary>\n <code-block\n language=\"yaml\"\n theme=\"atom-one-dark\"\n bind-source=\"report.workflowSourceYaml\"\n class=\"block max-h-[38rem] overflow-auto border-t border-gray-800 bg-gray-950 p-4\"\n ></code-block>\n </details>\n </template>\n <template if=\"report.canViewLogs && report.artifacts.length\">\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden\">\n <summary class=\"cursor-pointer px-4 py-3 text-xs font-semibold uppercase tracking-wider text-gray-400 outline-none transition hover:bg-gray-800 focus-visible:ring-2 focus-visible:ring-indigo-400/60\">\n Artifacts\n </summary>\n <ul class=\"divide-y divide-gray-800 border-t border-gray-800\">\n <template for=\"artifact of report.artifacts\">\n <li class=\"px-4 py-3\">\n <a\n attr-href=\"artifactUrl(artifact)\"\n class=\"font-mono text-sm text-indigo-300 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >{{ artifact }}</a>\n </li>\n </template>\n </ul>\n </details>\n </template>\n </div>\n\n <script setup>\n import { computed, onDestroy, onInit, ref } from '@li3/web';\n import { AnsiUp } from 'ansi_up';\n\n export default function setup() {\n const jobId = window.location.pathname.split('/').filter(Boolean).pop() || '';\n const report = ref({ jobId });\n const now = ref(Date.now());\n const ansiUp = new AnsiUp();\n ansiUp.use_classes = false;\n let eventSource;\n let refreshTimer;\n let clockTimer;\n let refreshing = false;\n let refreshPending = false;\n const cancelling = ref(false);\n\n const active = computed(() => ['pending', 'running'].includes(report.value.status));\n const inputsJson = computed(() => JSON.stringify(report.value.inputs || {}, null, 2));\n const timing = computed(() => {\n if (report.value.status === 'pending') return 'Waiting for a worker';\n if (report.value.status === 'running') {\n return `Running for ${Math.max(0, now.value - Date.parse(report.value.startedAt))}ms`;\n }\n return `Finished in ${report.value.durationMs}ms`;\n });\n\n const upper = (value) => String(value || '').toUpperCase();\n const artifactUrl = (path) => `/api/runs/${report.value.jobId}/artifacts/${encodeURIComponent(path)}`;\n const stepLog = (step) => {\n if (step.status === 'skipped') return '';\n if (step.status === 'running')\n return '<span class=\"text-indigo-400\">Step is running. Logs will appear after it finishes.</span>';\n if (step.status === 'pending') return '<span class=\"text-gray-500\">Waiting to run.</span>';\n if (step.logContent) return ansiUp.ansi_to_html(step.logContent);\n return '<span class=\"text-gray-500\">(No terminal log output recorded for this step)</span>';\n };\n const restartJob = async () => {\n const response = await fetch(`/restart/${report.value.jobId}`, { method: 'POST' });\n if (response.ok) {\n const { id } = await response.json();\n location.href = `/runs/${id}`;\n }\n };\n const cancelJob = async () => {\n if (cancelling.value || report.value.status !== 'running') return;\n cancelling.value = true;\n try {\n const response = await fetch(`/api/jobs/${report.value.jobId}/cancel`, { method: 'POST' });\n if (!response.ok) throw new Error(`Cancel failed: ${response.status}`);\n await refreshRun();\n } catch (error) {\n console.error(error);\n } finally {\n cancelling.value = false;\n }\n };\n const refreshRun = async () => {\n if (refreshing) {\n refreshPending = true;\n return;\n }\n refreshing = true;\n\n try {\n const response = await fetch(`/api/runs/${jobId}`, {\n headers: { accept: 'application/json' },\n });\n if (!response.ok) throw new Error(`Run refresh failed: ${response.status}`);\n const previousStatus = report.value.status;\n const nextReport = await response.json();\n report.value = nextReport;\n document.title = `Run #${nextReport.jobId} - ${nextReport.workflowName}`;\n if (\n ['pending', 'running'].includes(previousStatus) &&\n ['success', 'failed'].includes(nextReport.status) &&\n 'Notification' in window &&\n 'serviceWorker' in navigator &&\n Notification.permission === 'granted' &&\n localStorage.getItem('runner-notifications') === 'enabled'\n ) {\n const registration = await navigator.serviceWorker.ready;\n await registration.showNotification(\n nextReport.status === 'success'\n ? `Job #${nextReport.jobId} succeeded`\n : `Job #${nextReport.jobId} failed`,\n {\n body: `${nextReport.workflowName} finished with status ${nextReport.status}.`,\n icon: '/app-icon.svg',\n badge: '/app-icon.svg',\n tag: `runner-job-${nextReport.jobId}`,\n renotify: true,\n data: { url: `/runs/${nextReport.jobId}` },\n },\n );\n }\n } catch (error) {\n console.error(error);\n } finally {\n refreshing = false;\n if (refreshPending) {\n refreshPending = false;\n void refreshRun();\n }\n }\n };\n const handleJobChange = (event) => {\n const data = JSON.parse(event.data || '{}');\n if (!data.jobId || String(data.jobId) === String(report.value.jobId)) void refreshRun();\n };\n\n onInit(() => {\n void refreshRun();\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register('/service-worker.js').catch((error) => {\n console.error('Service worker registration failed', error);\n });\n }\n eventSource = new EventSource('/api/events');\n eventSource.addEventListener('jobs.changed', handleJobChange);\n refreshTimer = setInterval(() => {\n if (active.value) void refreshRun();\n }, 60000);\n clockTimer = setInterval(() => {\n now.value = Date.now();\n }, 1000);\n });\n onDestroy(() => {\n eventSource?.close();\n clearInterval(refreshTimer);\n clearInterval(clockTimer);\n });\n\n return { report, inputsJson, timing, upper, artifactUrl, stepLog, restartJob, cancelJob, cancelling };\n }\n <\/script>\n </template>\n\n <script type=\"module\">\n import '@li3/web';\n <\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n </body>\n</html>\n", Oe = /(?:^|[_-])auth(?:entication)?(?:$|[_-])|access[_-]?key|api[_-]?key|authorization|cookie|credential|passphrase|password|private[_-]?key|secret|session(?:id)?|signing[_-]?key|token/i;
|
|
470
|
+
function ke(e, t, n, r = [], i = !0, a) {
|
|
471
|
+
let o = JSON.parse(e.payload), s = e.report ? JSON.parse(e.report) : je(e, o, r), c = e.status;
|
|
480
472
|
return {
|
|
481
473
|
jobId: String(e.id),
|
|
482
474
|
workerId: e.worker_id || void 0,
|
|
@@ -489,7 +481,7 @@ function Ae(e, t, n, r = [], i = !0, a) {
|
|
|
489
481
|
durationMs: c === "running" ? Math.max(0, Date.now() - Date.parse(s.startedAt)) : s.durationMs,
|
|
490
482
|
startedAt: s.startedAt,
|
|
491
483
|
finishedAt: s.finishedAt,
|
|
492
|
-
inputs:
|
|
484
|
+
inputs: Me(s.inputs || {}, n),
|
|
493
485
|
steps: (s.steps || []).map((e) => {
|
|
494
486
|
let r = Object.hasOwn(t, e.id) && typeof t[e.id] == "string" ? t[e.id] : "";
|
|
495
487
|
return {
|
|
@@ -501,7 +493,7 @@ function Ae(e, t, n, r = [], i = !0, a) {
|
|
|
501
493
|
startedAt: e.startedAt,
|
|
502
494
|
finishedAt: e.finishedAt,
|
|
503
495
|
error: e.error ? n(e.error) : void 0,
|
|
504
|
-
outputs:
|
|
496
|
+
outputs: Me(e.outputs || {}, n),
|
|
505
497
|
logContent: !i || e.status === "running" || e.status === "pending" ? "" : n(r || e.logContent || "")
|
|
506
498
|
};
|
|
507
499
|
}),
|
|
@@ -509,10 +501,10 @@ function Ae(e, t, n, r = [], i = !0, a) {
|
|
|
509
501
|
canViewLogs: i
|
|
510
502
|
};
|
|
511
503
|
}
|
|
512
|
-
function
|
|
513
|
-
return
|
|
504
|
+
function Ae(e) {
|
|
505
|
+
return De;
|
|
514
506
|
}
|
|
515
|
-
function
|
|
507
|
+
function je(e, t, n) {
|
|
516
508
|
let r = e.started_at || e.created_at;
|
|
517
509
|
return {
|
|
518
510
|
jobId: String(e.id),
|
|
@@ -535,12 +527,12 @@ function Me(e, t, n) {
|
|
|
535
527
|
rerunToken: ""
|
|
536
528
|
};
|
|
537
529
|
}
|
|
538
|
-
function
|
|
539
|
-
return typeof e == "string" ? t(e) : Array.isArray(e) ? e.map((e) =>
|
|
530
|
+
function Me(e, t) {
|
|
531
|
+
return typeof e == "string" ? t(e) : Array.isArray(e) ? e.map((e) => Me(e, t)) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([e]) => !Oe.test(e)).map(([e, n]) => [e, Me(n, t)]));
|
|
540
532
|
}
|
|
541
533
|
//#endregion
|
|
542
534
|
//#region node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
|
|
543
|
-
var
|
|
535
|
+
var Ne = [
|
|
544
536
|
509,
|
|
545
537
|
0,
|
|
546
538
|
227,
|
|
@@ -871,7 +863,7 @@ var Pe = [
|
|
|
871
863
|
9,
|
|
872
864
|
787719,
|
|
873
865
|
239
|
|
874
|
-
],
|
|
866
|
+
], Pe = [
|
|
875
867
|
0,
|
|
876
868
|
11,
|
|
877
869
|
2,
|
|
@@ -1490,29 +1482,29 @@ var Pe = [
|
|
|
1490
1482
|
4938,
|
|
1491
1483
|
6,
|
|
1492
1484
|
8489
|
|
1493
|
-
],
|
|
1485
|
+
], Fe = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", Ie = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", Le = {
|
|
1494
1486
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
1495
1487
|
5: "class enum extends super const export import",
|
|
1496
1488
|
6: "enum",
|
|
1497
1489
|
strict: "implements interface let package private protected public static yield",
|
|
1498
1490
|
strictBind: "eval arguments"
|
|
1499
|
-
},
|
|
1500
|
-
5:
|
|
1501
|
-
"5module":
|
|
1502
|
-
6:
|
|
1503
|
-
},
|
|
1504
|
-
function
|
|
1491
|
+
}, Re = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", ze = {
|
|
1492
|
+
5: Re,
|
|
1493
|
+
"5module": Re + " export import",
|
|
1494
|
+
6: Re + " const class extends export import super"
|
|
1495
|
+
}, Be = /^in(stanceof)?$/, Ve = RegExp("[" + Ie + "]"), He = RegExp("[" + Ie + Fe + "]");
|
|
1496
|
+
function Ue(e, t) {
|
|
1505
1497
|
for (var n = 65536, r = 0; r < t.length; r += 2) {
|
|
1506
1498
|
if (n += t[r], n > e) return !1;
|
|
1507
1499
|
if (n += t[r + 1], n >= e) return !0;
|
|
1508
1500
|
}
|
|
1509
1501
|
return !1;
|
|
1510
1502
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
1503
|
+
function We(e, t) {
|
|
1504
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Ve.test(String.fromCharCode(e)) : t !== !1 && Ue(e, Pe);
|
|
1513
1505
|
}
|
|
1514
|
-
function
|
|
1515
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
1506
|
+
function Ge(e, t) {
|
|
1507
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && He.test(String.fromCharCode(e)) : t === !1 ? !1 : Ue(e, Pe) || Ue(e, Ne);
|
|
1516
1508
|
}
|
|
1517
1509
|
var w = function(e, t) {
|
|
1518
1510
|
t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
|
|
@@ -1523,9 +1515,9 @@ function T(e, t) {
|
|
|
1523
1515
|
binop: t
|
|
1524
1516
|
});
|
|
1525
1517
|
}
|
|
1526
|
-
var E = { beforeExpr: !0 }, D = { startsExpr: !0 },
|
|
1518
|
+
var E = { beforeExpr: !0 }, D = { startsExpr: !0 }, Ke = {};
|
|
1527
1519
|
function O(e, t) {
|
|
1528
|
-
return t === void 0 && (t = {}), t.keyword = e,
|
|
1520
|
+
return t === void 0 && (t = {}), t.keyword = e, Ke[e] = new w(e, t);
|
|
1529
1521
|
}
|
|
1530
1522
|
var k = {
|
|
1531
1523
|
num: new w("num", D),
|
|
@@ -1660,46 +1652,46 @@ var k = {
|
|
|
1660
1652
|
prefix: !0,
|
|
1661
1653
|
startsExpr: !0
|
|
1662
1654
|
})
|
|
1663
|
-
}, A = /\r\n?|\n|\u2028|\u2029/,
|
|
1664
|
-
function
|
|
1655
|
+
}, A = /\r\n?|\n|\u2028|\u2029/, qe = new RegExp(A.source, "g");
|
|
1656
|
+
function Je(e) {
|
|
1665
1657
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1666
1658
|
}
|
|
1667
|
-
function
|
|
1659
|
+
function Ye(e, t, n) {
|
|
1668
1660
|
n === void 0 && (n = e.length);
|
|
1669
1661
|
for (var r = t; r < n; r++) {
|
|
1670
1662
|
var i = e.charCodeAt(r);
|
|
1671
|
-
if (
|
|
1663
|
+
if (Je(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
1672
1664
|
}
|
|
1673
1665
|
return -1;
|
|
1674
1666
|
}
|
|
1675
|
-
var
|
|
1676
|
-
return
|
|
1677
|
-
}),
|
|
1678
|
-
return
|
|
1679
|
-
}),
|
|
1680
|
-
function
|
|
1681
|
-
return
|
|
1667
|
+
var Xe = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, j = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Ze = Object.prototype, Qe = Ze.hasOwnProperty, $e = Ze.toString, et = Object.hasOwn || (function(e, t) {
|
|
1668
|
+
return Qe.call(e, t);
|
|
1669
|
+
}), tt = Array.isArray || (function(e) {
|
|
1670
|
+
return $e.call(e) === "[object Array]";
|
|
1671
|
+
}), nt = Object.create(null);
|
|
1672
|
+
function rt(e) {
|
|
1673
|
+
return nt[e] || (nt[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1682
1674
|
}
|
|
1683
|
-
function
|
|
1675
|
+
function it(e) {
|
|
1684
1676
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
1685
1677
|
}
|
|
1686
|
-
var
|
|
1678
|
+
var at = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, ot = function(e, t) {
|
|
1687
1679
|
this.line = e, this.column = t;
|
|
1688
1680
|
};
|
|
1689
|
-
|
|
1690
|
-
return new
|
|
1681
|
+
ot.prototype.offset = function(e) {
|
|
1682
|
+
return new ot(this.line, this.column + e);
|
|
1691
1683
|
};
|
|
1692
|
-
var
|
|
1684
|
+
var st = function(e, t, n) {
|
|
1693
1685
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
1694
1686
|
};
|
|
1695
|
-
function
|
|
1687
|
+
function ct(e, t) {
|
|
1696
1688
|
for (var n = 1, r = 0;;) {
|
|
1697
|
-
var i =
|
|
1698
|
-
if (i < 0) return new
|
|
1689
|
+
var i = Ye(e, r, t);
|
|
1690
|
+
if (i < 0) return new ot(n, t - r);
|
|
1699
1691
|
++n, r = i;
|
|
1700
1692
|
}
|
|
1701
1693
|
}
|
|
1702
|
-
var
|
|
1694
|
+
var lt = {
|
|
1703
1695
|
ecmaVersion: null,
|
|
1704
1696
|
sourceType: "script",
|
|
1705
1697
|
strict: !1,
|
|
@@ -1721,20 +1713,20 @@ var ut = {
|
|
|
1721
1713
|
sourceFile: null,
|
|
1722
1714
|
directSourceFile: null,
|
|
1723
1715
|
preserveParens: !1
|
|
1724
|
-
},
|
|
1725
|
-
function
|
|
1716
|
+
}, ut = !1;
|
|
1717
|
+
function dt(e) {
|
|
1726
1718
|
var t = {};
|
|
1727
|
-
for (var n in
|
|
1728
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
1719
|
+
for (var n in lt) t[n] = e && et(e, n) ? e[n] : lt[n];
|
|
1720
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!ut && typeof console == "object" && console.warn && (ut = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), tt(t.onToken)) {
|
|
1729
1721
|
var r = t.onToken;
|
|
1730
1722
|
t.onToken = function(e) {
|
|
1731
1723
|
return r.push(e);
|
|
1732
1724
|
};
|
|
1733
1725
|
}
|
|
1734
|
-
if (
|
|
1726
|
+
if (tt(t.onComment) && (t.onComment = ft(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1735
1727
|
return t;
|
|
1736
1728
|
}
|
|
1737
|
-
function
|
|
1729
|
+
function ft(e, t) {
|
|
1738
1730
|
return function(n, r, i, a, o, s) {
|
|
1739
1731
|
var c = {
|
|
1740
1732
|
type: n ? "Block" : "Line",
|
|
@@ -1742,19 +1734,19 @@ function pt(e, t) {
|
|
|
1742
1734
|
start: i,
|
|
1743
1735
|
end: a
|
|
1744
1736
|
};
|
|
1745
|
-
e.locations && (c.loc = new
|
|
1737
|
+
e.locations && (c.loc = new st(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1746
1738
|
};
|
|
1747
1739
|
}
|
|
1748
|
-
var
|
|
1749
|
-
function
|
|
1750
|
-
return
|
|
1740
|
+
var pt = 1, mt = 2, ht = 4, gt = 8, _t = 16, vt = 32, yt = 64, bt = 128, xt = 256, St = 512, Ct = 1024, wt = pt | mt | xt;
|
|
1741
|
+
function Tt(e, t) {
|
|
1742
|
+
return mt | (e ? ht : 0) | (t ? gt : 0);
|
|
1751
1743
|
}
|
|
1752
|
-
var
|
|
1753
|
-
this.options = e =
|
|
1744
|
+
var Et = 0, Dt = 1, Ot = 2, kt = 3, At = 4, jt = 5, M = function(e, t, n) {
|
|
1745
|
+
this.options = e = dt(e), this.sourceFile = e.sourceFile, this.keywords = rt(ze[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1754
1746
|
var r = "";
|
|
1755
|
-
e.allowReserved !== !0 && (r =
|
|
1756
|
-
var i = (r ? r + " " : "") +
|
|
1757
|
-
this.reservedWordsStrict =
|
|
1747
|
+
e.allowReserved !== !0 && (r = Le[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = rt(r);
|
|
1748
|
+
var i = (r ? r + " " : "") + Le.strict;
|
|
1749
|
+
this.reservedWordsStrict = rt(i), this.reservedWordsStrictBind = rt(i + " " + Le.strictBind), this.input = String(t), this.containsEsc = !1, this.pos = n || 0, this.curLine = 1, e.startLocation ? (this.lineStart = this.pos - e.startLocation.column, this.curLine = e.startLocation.line) : n ? (this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.options.locations && (this.curLine = this.input.slice(0, this.lineStart).split(A).length)) : this.lineStart = 0, this.type = k.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? mt : pt), this.regexpState = null, this.privateNameStack = [];
|
|
1758
1750
|
}, N = {
|
|
1759
1751
|
inFunction: { configurable: !0 },
|
|
1760
1752
|
inGenerator: { configurable: !0 },
|
|
@@ -1774,37 +1766,37 @@ M.prototype.parse = function() {
|
|
|
1774
1766
|
return e.parseTopLevel(t);
|
|
1775
1767
|
});
|
|
1776
1768
|
}, N.inFunction.get = function() {
|
|
1777
|
-
return (this.currentVarScope().flags &
|
|
1769
|
+
return (this.currentVarScope().flags & mt) > 0;
|
|
1778
1770
|
}, N.inGenerator.get = function() {
|
|
1779
|
-
return (this.currentVarScope().flags & _t) > 0;
|
|
1780
|
-
}, N.inAsync.get = function() {
|
|
1781
1771
|
return (this.currentVarScope().flags & gt) > 0;
|
|
1772
|
+
}, N.inAsync.get = function() {
|
|
1773
|
+
return (this.currentVarScope().flags & ht) > 0;
|
|
1782
1774
|
}, N.canAwait.get = function() {
|
|
1783
1775
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1784
1776
|
var t = this.scopeStack[e].flags;
|
|
1785
|
-
if (t & (
|
|
1786
|
-
if (t &
|
|
1777
|
+
if (t & (xt | St)) return !1;
|
|
1778
|
+
if (t & mt) return (t & ht) > 0;
|
|
1787
1779
|
}
|
|
1788
1780
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1789
1781
|
}, N.allowReturn.get = function() {
|
|
1790
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
1782
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & pt);
|
|
1791
1783
|
}, N.allowSuper.get = function() {
|
|
1792
|
-
return (this.currentThisScope().flags &
|
|
1784
|
+
return (this.currentThisScope().flags & yt) > 0 || this.options.allowSuperOutsideMethod;
|
|
1793
1785
|
}, N.allowDirectSuper.get = function() {
|
|
1794
|
-
return (this.currentThisScope().flags &
|
|
1786
|
+
return (this.currentThisScope().flags & bt) > 0;
|
|
1795
1787
|
}, N.treatFunctionsAsVar.get = function() {
|
|
1796
1788
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1797
1789
|
}, N.allowNewDotTarget.get = function() {
|
|
1798
1790
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1799
1791
|
var t = this.scopeStack[e].flags;
|
|
1800
|
-
if (t & (
|
|
1792
|
+
if (t & (xt | St) || t & mt && !(t & _t)) return !0;
|
|
1801
1793
|
}
|
|
1802
1794
|
return !1;
|
|
1803
1795
|
}, N.allowUsing.get = function() {
|
|
1804
1796
|
var e = this.currentScope().flags;
|
|
1805
|
-
return !(e &
|
|
1797
|
+
return !(e & Ct || !this.inModule && e & pt);
|
|
1806
1798
|
}, N.inClassStaticBlock.get = function() {
|
|
1807
|
-
return (this.currentVarScope().flags &
|
|
1799
|
+
return (this.currentVarScope().flags & xt) > 0;
|
|
1808
1800
|
}, M.extend = function() {
|
|
1809
1801
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
1810
1802
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
@@ -1817,12 +1809,12 @@ M.prototype.parse = function() {
|
|
|
1817
1809
|
}, M.tokenizer = function(e, t) {
|
|
1818
1810
|
return new this(t, e);
|
|
1819
1811
|
}, Object.defineProperties(M.prototype, N);
|
|
1820
|
-
var P = M.prototype,
|
|
1812
|
+
var P = M.prototype, Mt = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1821
1813
|
P.strictDirective = function(e) {
|
|
1822
1814
|
if (this.options.ecmaVersion < 5) return !1;
|
|
1823
1815
|
for (;;) {
|
|
1824
1816
|
j.lastIndex = e, e += j.exec(this.input)[0].length;
|
|
1825
|
-
var t =
|
|
1817
|
+
var t = Mt.exec(this.input.slice(e));
|
|
1826
1818
|
if (!t) return !1;
|
|
1827
1819
|
if ((t[1] || t[2]) === "use strict") {
|
|
1828
1820
|
j.lastIndex = e + t[0].length;
|
|
@@ -1859,7 +1851,7 @@ P.strictDirective = function(e) {
|
|
|
1859
1851
|
}, P.unexpected = function(e) {
|
|
1860
1852
|
this.raise(e ?? this.start, "Unexpected token");
|
|
1861
1853
|
};
|
|
1862
|
-
var
|
|
1854
|
+
var Nt = function() {
|
|
1863
1855
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
1864
1856
|
};
|
|
1865
1857
|
P.checkPatternErrors = function(e, t) {
|
|
@@ -1891,7 +1883,7 @@ F.parseTopLevel = function(e) {
|
|
|
1891
1883
|
}
|
|
1892
1884
|
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
1893
1885
|
};
|
|
1894
|
-
var
|
|
1886
|
+
var Pt = { kind: "loop" }, Ft = { kind: "switch" };
|
|
1895
1887
|
F.isLet = function(e) {
|
|
1896
1888
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1897
1889
|
j.lastIndex = this.pos;
|
|
@@ -1899,21 +1891,21 @@ F.isLet = function(e) {
|
|
|
1899
1891
|
if (r === 91 || r === 92) return !0;
|
|
1900
1892
|
if (e) return !1;
|
|
1901
1893
|
if (r === 123) return !0;
|
|
1902
|
-
if (
|
|
1894
|
+
if (We(r)) {
|
|
1903
1895
|
var i = n;
|
|
1904
1896
|
do
|
|
1905
1897
|
n += r <= 65535 ? 1 : 2;
|
|
1906
|
-
while (
|
|
1898
|
+
while (Ge(r = this.fullCharCodeAt(n)));
|
|
1907
1899
|
if (r === 92) return !0;
|
|
1908
1900
|
var a = this.input.slice(i, n);
|
|
1909
|
-
if (!
|
|
1901
|
+
if (!Be.test(a)) return !0;
|
|
1910
1902
|
}
|
|
1911
1903
|
return !1;
|
|
1912
1904
|
}, F.isAsyncFunction = function() {
|
|
1913
1905
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1914
1906
|
j.lastIndex = this.pos;
|
|
1915
1907
|
var e = j.exec(this.input), t = this.pos + e[0].length, n;
|
|
1916
|
-
return !A.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(
|
|
1908
|
+
return !A.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(Ge(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1917
1909
|
}, F.isUsingKeyword = function(e, t) {
|
|
1918
1910
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1919
1911
|
j.lastIndex = this.pos;
|
|
@@ -1921,20 +1913,20 @@ F.isLet = function(e) {
|
|
|
1921
1913
|
if (A.test(this.input.slice(this.pos, r))) return !1;
|
|
1922
1914
|
if (e) {
|
|
1923
1915
|
var i = r + 5, a;
|
|
1924
|
-
if (this.input.slice(r, i) !== "using" || i === this.input.length ||
|
|
1916
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || Ge(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
1925
1917
|
j.lastIndex = i;
|
|
1926
1918
|
var o = j.exec(this.input);
|
|
1927
1919
|
if (r = i + o[0].length, o && A.test(this.input.slice(i, r))) return !1;
|
|
1928
1920
|
}
|
|
1929
1921
|
var s = this.fullCharCodeAt(r);
|
|
1930
|
-
if (!
|
|
1922
|
+
if (!We(s) && s !== 92) return !1;
|
|
1931
1923
|
var c = r;
|
|
1932
1924
|
do
|
|
1933
1925
|
r += s <= 65535 ? 1 : 2;
|
|
1934
|
-
while (
|
|
1926
|
+
while (Ge(s = this.fullCharCodeAt(r)));
|
|
1935
1927
|
if (s === 92) return !0;
|
|
1936
1928
|
var l = this.input.slice(c, r);
|
|
1937
|
-
if (
|
|
1929
|
+
if (Be.test(l)) return !1;
|
|
1938
1930
|
if (t && !e && l === "of") {
|
|
1939
1931
|
j.lastIndex = r;
|
|
1940
1932
|
var u = j.exec(this.input);
|
|
@@ -1992,11 +1984,11 @@ F.isLet = function(e) {
|
|
|
1992
1984
|
}, F.parseDebuggerStatement = function(e) {
|
|
1993
1985
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1994
1986
|
}, F.parseDoStatement = function(e) {
|
|
1995
|
-
return this.next(), this.labels.push(
|
|
1987
|
+
return this.next(), this.labels.push(Pt), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(k._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(k.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
1996
1988
|
}, F.parseForStatement = function(e) {
|
|
1997
1989
|
this.next();
|
|
1998
1990
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1999
|
-
if (this.labels.push(
|
|
1991
|
+
if (this.labels.push(Pt), this.enterScope(0), this.expect(k.parenL), this.type === k.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
2000
1992
|
var n = this.isLet();
|
|
2001
1993
|
if (this.type === k._var || this.type === k._const || n) {
|
|
2002
1994
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
@@ -2007,18 +1999,18 @@ F.isLet = function(e) {
|
|
|
2007
1999
|
var c = this.startNode();
|
|
2008
2000
|
return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
|
|
2009
2001
|
}
|
|
2010
|
-
var l = this.containsEsc, u = new
|
|
2002
|
+
var l = this.containsEsc, u = new Nt(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
2011
2003
|
return this.type === k._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === k._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
2012
2004
|
}, F.parseForAfterInit = function(e, t, n) {
|
|
2013
2005
|
return (this.type === k._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === k._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
2014
2006
|
}, F.parseFunctionStatement = function(e, t, n) {
|
|
2015
|
-
return this.next(), this.parseFunction(e,
|
|
2007
|
+
return this.next(), this.parseFunction(e, Lt | (n ? 0 : Rt), !1, t);
|
|
2016
2008
|
}, F.parseIfStatement = function(e) {
|
|
2017
2009
|
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(k._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
2018
2010
|
}, F.parseReturnStatement = function(e) {
|
|
2019
2011
|
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(k.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
2020
2012
|
}, F.parseSwitchStatement = function(e) {
|
|
2021
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(k.braceL), this.labels.push(
|
|
2013
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(k.braceL), this.labels.push(Ft), this.enterScope(Ct);
|
|
2022
2014
|
for (var t, n = !1; this.type !== k.braceR;) if (this.type === k._case || this.type === k._default) {
|
|
2023
2015
|
var r = this.type === k._case;
|
|
2024
2016
|
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(k.colon);
|
|
@@ -2027,10 +2019,10 @@ F.isLet = function(e) {
|
|
|
2027
2019
|
}, F.parseThrowStatement = function(e) {
|
|
2028
2020
|
return this.next(), A.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
2029
2021
|
};
|
|
2030
|
-
var
|
|
2022
|
+
var It = [];
|
|
2031
2023
|
F.parseCatchClauseParam = function() {
|
|
2032
2024
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
2033
|
-
return this.enterScope(t ?
|
|
2025
|
+
return this.enterScope(t ? vt : 0), this.checkLValPattern(e, t ? At : Ot), this.expect(k.parenR), e;
|
|
2034
2026
|
}, F.parseTryStatement = function(e) {
|
|
2035
2027
|
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === k._catch) {
|
|
2036
2028
|
var t = this.startNode();
|
|
@@ -2040,7 +2032,7 @@ F.parseCatchClauseParam = function() {
|
|
|
2040
2032
|
}, F.parseVarStatement = function(e, t, n) {
|
|
2041
2033
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
2042
2034
|
}, F.parseWhileStatement = function(e) {
|
|
2043
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(
|
|
2035
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(Pt), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
2044
2036
|
}, F.parseWithStatement = function(e) {
|
|
2045
2037
|
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
|
|
2046
2038
|
}, F.parseEmptyStatement = function(e) {
|
|
@@ -2077,13 +2069,13 @@ F.parseCatchClauseParam = function() {
|
|
|
2077
2069
|
}
|
|
2078
2070
|
return e;
|
|
2079
2071
|
}, F.parseVarId = function(e, t) {
|
|
2080
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
2072
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Dt : Ot, !1);
|
|
2081
2073
|
};
|
|
2082
|
-
var
|
|
2074
|
+
var Lt = 1, Rt = 2, zt = 4;
|
|
2083
2075
|
F.parseFunction = function(e, t, n, r, i) {
|
|
2084
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === k.star && t &
|
|
2076
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === k.star && t & Rt && this.unexpected(), e.generator = this.eat(k.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Lt && (e.id = t & zt && this.type !== k.name ? null : this.parseIdent(), e.id && !(t & Rt) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Dt : Ot : kt));
|
|
2085
2077
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
2086
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
2078
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Tt(e.async, e.generator)), t & Lt || (e.id = this.type === k.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & Lt ? "FunctionDeclaration" : "FunctionExpression");
|
|
2087
2079
|
}, F.parseFunctionParams = function(e) {
|
|
2088
2080
|
this.expect(k.parenL), e.params = this.parseBindingList(k.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
2089
2081
|
}, F.parseClass = function(e, t) {
|
|
@@ -2093,7 +2085,7 @@ F.parseFunction = function(e, t, n, r, i) {
|
|
|
2093
2085
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
2094
2086
|
for (i.body = [], this.expect(k.braceL); this.type !== k.braceR;) {
|
|
2095
2087
|
var o = this.parseClassElement(e.superClass !== null);
|
|
2096
|
-
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" &&
|
|
2088
|
+
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Bt(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
2097
2089
|
}
|
|
2098
2090
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
2099
2091
|
}, F.parseClassElement = function(e) {
|
|
@@ -2108,7 +2100,7 @@ F.parseFunction = function(e, t, n, r, i) {
|
|
|
2108
2100
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
2109
2101
|
}
|
|
2110
2102
|
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === k.parenL || o !== "method" || i || a) {
|
|
2111
|
-
var l = !n.static &&
|
|
2103
|
+
var l = !n.static && Vt(n, "constructor"), u = l && e;
|
|
2112
2104
|
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
2113
2105
|
} else this.parseClassField(n);
|
|
2114
2106
|
return n;
|
|
@@ -2118,21 +2110,21 @@ F.parseFunction = function(e, t, n, r, i) {
|
|
|
2118
2110
|
this.type === k.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
2119
2111
|
}, F.parseClassMethod = function(e, t, n, r) {
|
|
2120
2112
|
var i = e.key;
|
|
2121
|
-
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static &&
|
|
2113
|
+
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && Vt(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
2122
2114
|
var a = e.value = this.parseMethod(t, n, r);
|
|
2123
2115
|
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
2124
2116
|
}, F.parseClassField = function(e) {
|
|
2125
|
-
return
|
|
2117
|
+
return Vt(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Vt(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(k.eq) ? (this.enterScope(St | yt), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
2126
2118
|
}, F.parseClassStaticBlock = function(e) {
|
|
2127
2119
|
e.body = [];
|
|
2128
2120
|
var t = this.labels;
|
|
2129
|
-
for (this.labels = [], this.enterScope(
|
|
2121
|
+
for (this.labels = [], this.enterScope(xt | yt); this.type !== k.braceR;) {
|
|
2130
2122
|
var n = this.parseStatement(null);
|
|
2131
2123
|
e.body.push(n);
|
|
2132
2124
|
}
|
|
2133
2125
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
2134
2126
|
}, F.parseClassId = function(e, t) {
|
|
2135
|
-
this.type === k.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id,
|
|
2127
|
+
this.type === k.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, Ot, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
2136
2128
|
}, F.parseClassSuper = function(e) {
|
|
2137
2129
|
e.superClass = this.eat(k._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
2138
2130
|
}, F.enterClassBody = function() {
|
|
@@ -2145,14 +2137,14 @@ F.parseFunction = function(e, t, n, r, i) {
|
|
|
2145
2137
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
2146
2138
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
2147
2139
|
var o = n[a];
|
|
2148
|
-
|
|
2140
|
+
et(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
2149
2141
|
}
|
|
2150
2142
|
};
|
|
2151
|
-
function
|
|
2143
|
+
function Bt(e, t) {
|
|
2152
2144
|
var n = t.key.name, r = e[n], i = "true";
|
|
2153
2145
|
return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : r ? !0 : (e[n] = i, !1);
|
|
2154
2146
|
}
|
|
2155
|
-
function
|
|
2147
|
+
function Vt(e, t) {
|
|
2156
2148
|
var n = e.computed, r = e.key;
|
|
2157
2149
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
2158
2150
|
}
|
|
@@ -2180,7 +2172,7 @@ F.parseExportAllDeclaration = function(e, t) {
|
|
|
2180
2172
|
var e;
|
|
2181
2173
|
if (this.type === k._function || (e = this.isAsyncFunction())) {
|
|
2182
2174
|
var t = this.startNode();
|
|
2183
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
2175
|
+
return this.next(), e && this.next(), this.parseFunction(t, Lt | zt, !1, e);
|
|
2184
2176
|
}
|
|
2185
2177
|
if (this.type === k._class) {
|
|
2186
2178
|
var n = this.startNode();
|
|
@@ -2189,7 +2181,7 @@ F.parseExportAllDeclaration = function(e, t) {
|
|
|
2189
2181
|
var r = this.parseMaybeAssign();
|
|
2190
2182
|
return this.semicolon(), r;
|
|
2191
2183
|
}, F.checkExport = function(e, t, n) {
|
|
2192
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
2184
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), et(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
2193
2185
|
}, F.checkPatternExport = function(e, t) {
|
|
2194
2186
|
var n = t.type;
|
|
2195
2187
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
@@ -2221,16 +2213,16 @@ F.parseExportAllDeclaration = function(e, t) {
|
|
|
2221
2213
|
}
|
|
2222
2214
|
return t;
|
|
2223
2215
|
}, F.parseImport = function(e) {
|
|
2224
|
-
return this.next(), this.type === k.string ? (e.specifiers =
|
|
2216
|
+
return this.next(), this.type === k.string ? (e.specifiers = It, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === k.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
2225
2217
|
}, F.parseImportSpecifier = function() {
|
|
2226
2218
|
var e = this.startNode();
|
|
2227
|
-
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local,
|
|
2219
|
+
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, Ot), this.finishNode(e, "ImportSpecifier");
|
|
2228
2220
|
}, F.parseImportDefaultSpecifier = function() {
|
|
2229
2221
|
var e = this.startNode();
|
|
2230
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
2222
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, Ot), this.finishNode(e, "ImportDefaultSpecifier");
|
|
2231
2223
|
}, F.parseImportNamespaceSpecifier = function() {
|
|
2232
2224
|
var e = this.startNode();
|
|
2233
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
2225
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, Ot), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
2234
2226
|
}, F.parseImportSpecifiers = function() {
|
|
2235
2227
|
var e = [], t = !0;
|
|
2236
2228
|
if (this.type === k.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(k.comma))) return e;
|
|
@@ -2249,7 +2241,7 @@ F.parseExportAllDeclaration = function(e, t) {
|
|
|
2249
2241
|
if (n) n = !1;
|
|
2250
2242
|
else if (this.expect(k.comma), this.afterTrailingComma(k.braceR)) break;
|
|
2251
2243
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
2252
|
-
|
|
2244
|
+
et(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
2253
2245
|
}
|
|
2254
2246
|
return e;
|
|
2255
2247
|
}, F.parseImportAttribute = function() {
|
|
@@ -2258,7 +2250,7 @@ F.parseExportAllDeclaration = function(e, t) {
|
|
|
2258
2250
|
}, F.parseModuleExportName = function() {
|
|
2259
2251
|
if (this.options.ecmaVersion >= 13 && this.type === k.string) {
|
|
2260
2252
|
var e = this.parseLiteral(this.value);
|
|
2261
|
-
return
|
|
2253
|
+
return at.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
2262
2254
|
}
|
|
2263
2255
|
return this.parseIdent(!0);
|
|
2264
2256
|
}, F.adaptDirectivePrologue = function(e) {
|
|
@@ -2349,11 +2341,11 @@ I.toAssignable = function(e, t, n) {
|
|
|
2349
2341
|
var r = this.startNodeAt(e, t);
|
|
2350
2342
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
2351
2343
|
}, I.checkLValSimple = function(e, t, n) {
|
|
2352
|
-
t === void 0 && (t =
|
|
2353
|
-
var r = t !==
|
|
2344
|
+
t === void 0 && (t = Et);
|
|
2345
|
+
var r = t !== Et;
|
|
2354
2346
|
switch (e.type) {
|
|
2355
2347
|
case "Identifier":
|
|
2356
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t ===
|
|
2348
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === Ot && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (et(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== jt && this.declareName(e.name, t, e.start));
|
|
2357
2349
|
break;
|
|
2358
2350
|
case "ChainExpression":
|
|
2359
2351
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -2365,7 +2357,7 @@ I.toAssignable = function(e, t, n) {
|
|
|
2365
2357
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
2366
2358
|
}
|
|
2367
2359
|
}, I.checkLValPattern = function(e, t, n) {
|
|
2368
|
-
switch (t === void 0 && (t =
|
|
2360
|
+
switch (t === void 0 && (t = Et), e.type) {
|
|
2369
2361
|
case "ObjectPattern":
|
|
2370
2362
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
2371
2363
|
var a = i[r];
|
|
@@ -2381,7 +2373,7 @@ I.toAssignable = function(e, t, n) {
|
|
|
2381
2373
|
default: this.checkLValSimple(e, t, n);
|
|
2382
2374
|
}
|
|
2383
2375
|
}, I.checkLValInnerPattern = function(e, t, n) {
|
|
2384
|
-
switch (t === void 0 && (t =
|
|
2376
|
+
switch (t === void 0 && (t = Et), e.type) {
|
|
2385
2377
|
case "Property":
|
|
2386
2378
|
this.checkLValInnerPattern(e.value, t, n);
|
|
2387
2379
|
break;
|
|
@@ -2394,39 +2386,39 @@ I.toAssignable = function(e, t, n) {
|
|
|
2394
2386
|
default: this.checkLValPattern(e, t, n);
|
|
2395
2387
|
}
|
|
2396
2388
|
};
|
|
2397
|
-
var
|
|
2389
|
+
var Ht = function(e, t, n, r, i) {
|
|
2398
2390
|
this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
|
|
2399
2391
|
}, L = {
|
|
2400
|
-
b_stat: new
|
|
2401
|
-
b_expr: new
|
|
2402
|
-
b_tmpl: new
|
|
2403
|
-
p_stat: new
|
|
2404
|
-
p_expr: new
|
|
2405
|
-
q_tmpl: new
|
|
2392
|
+
b_stat: new Ht("{", !1),
|
|
2393
|
+
b_expr: new Ht("{", !0),
|
|
2394
|
+
b_tmpl: new Ht("${", !1),
|
|
2395
|
+
p_stat: new Ht("(", !1),
|
|
2396
|
+
p_expr: new Ht("(", !0),
|
|
2397
|
+
q_tmpl: new Ht("`", !0, !0, function(e) {
|
|
2406
2398
|
return e.tryReadTemplateToken();
|
|
2407
2399
|
}),
|
|
2408
|
-
f_stat: new
|
|
2409
|
-
f_expr: new
|
|
2410
|
-
f_expr_gen: new
|
|
2411
|
-
f_gen: new
|
|
2412
|
-
},
|
|
2413
|
-
|
|
2400
|
+
f_stat: new Ht("function", !1),
|
|
2401
|
+
f_expr: new Ht("function", !0),
|
|
2402
|
+
f_expr_gen: new Ht("function", !0, !1, null, !0),
|
|
2403
|
+
f_gen: new Ht("function", !1, !1, null, !0)
|
|
2404
|
+
}, Ut = M.prototype;
|
|
2405
|
+
Ut.initialContext = function() {
|
|
2414
2406
|
return [L.b_stat];
|
|
2415
|
-
},
|
|
2407
|
+
}, Ut.curContext = function() {
|
|
2416
2408
|
return this.context[this.context.length - 1];
|
|
2417
|
-
},
|
|
2409
|
+
}, Ut.braceIsBlock = function(e) {
|
|
2418
2410
|
var t = this.curContext();
|
|
2419
2411
|
return t === L.f_expr || t === L.f_stat ? !0 : e === k.colon && (t === L.b_stat || t === L.b_expr) ? !t.isExpr : e === k._return || e === k.name && this.exprAllowed ? A.test(this.input.slice(this.lastTokEnd, this.start)) : e === k._else || e === k.semi || e === k.eof || e === k.parenR || e === k.arrow ? !0 : e === k.braceL ? t === L.b_stat : e === k._var || e === k._const || e === k.name ? !1 : !this.exprAllowed;
|
|
2420
|
-
},
|
|
2412
|
+
}, Ut.inGeneratorContext = function() {
|
|
2421
2413
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
2422
2414
|
var t = this.context[e];
|
|
2423
2415
|
if (t.token === "function") return t.generator;
|
|
2424
2416
|
}
|
|
2425
2417
|
return !1;
|
|
2426
|
-
},
|
|
2418
|
+
}, Ut.updateContext = function(e) {
|
|
2427
2419
|
var t, n = this.type;
|
|
2428
2420
|
n.keyword && e === k.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
2429
|
-
},
|
|
2421
|
+
}, Ut.overrideContext = function(e) {
|
|
2430
2422
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
2431
2423
|
}, k.parenR.updateContext = k.braceR.updateContext = function() {
|
|
2432
2424
|
if (this.context.length === 1) {
|
|
@@ -2501,7 +2493,7 @@ R.checkPropClash = function(e, t, n) {
|
|
|
2501
2493
|
this.exprAllowed = !1;
|
|
2502
2494
|
}
|
|
2503
2495
|
var r = !1, i = -1, a = -1, o = -1;
|
|
2504
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
2496
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Nt(), r = !0);
|
|
2505
2497
|
var s = this.start, c = this.startLoc;
|
|
2506
2498
|
(this.type === k.parenL || this.type === k.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
2507
2499
|
var l = this.parseMaybeConditional(e, t);
|
|
@@ -2541,7 +2533,7 @@ R.checkPropClash = function(e, t, n) {
|
|
|
2541
2533
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2542
2534
|
else if (this.type.prefix) {
|
|
2543
2535
|
var s = this.startNode(), c = this.type === k.incDec;
|
|
2544
|
-
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" &&
|
|
2536
|
+
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && Wt(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && Gt(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
2545
2537
|
} else if (!t && this.type === k.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== k._in && this.unexpected();
|
|
2546
2538
|
else {
|
|
2547
2539
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
@@ -2555,11 +2547,11 @@ R.checkPropClash = function(e, t, n) {
|
|
|
2555
2547
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2556
2548
|
} else return o;
|
|
2557
2549
|
};
|
|
2558
|
-
function
|
|
2559
|
-
return e.type === "Identifier" || e.type === "ParenthesizedExpression" &&
|
|
2550
|
+
function Wt(e) {
|
|
2551
|
+
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && Wt(e.expression);
|
|
2560
2552
|
}
|
|
2561
|
-
function
|
|
2562
|
-
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" &&
|
|
2553
|
+
function Gt(e) {
|
|
2554
|
+
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && Gt(e.expression) || e.type === "ParenthesizedExpression" && Gt(e.expression);
|
|
2563
2555
|
}
|
|
2564
2556
|
R.parseExprSubscripts = function(e, t) {
|
|
2565
2557
|
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
@@ -2590,7 +2582,7 @@ R.parseExprSubscripts = function(e, t) {
|
|
|
2590
2582
|
var u = this.startNodeAt(t, n);
|
|
2591
2583
|
u.object = e, l ? (u.property = this.parseExpression(), this.expect(k.bracketR)) : u.property = this.type === k.privateId && e.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2592
2584
|
} else if (!r && this.eat(k.parenL)) {
|
|
2593
|
-
var d = new
|
|
2585
|
+
var d = new Nt(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2594
2586
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2595
2587
|
var h = this.parseExprList(k.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2596
2588
|
if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, h, o);
|
|
@@ -2674,7 +2666,7 @@ R.parseExprSubscripts = function(e, t) {
|
|
|
2674
2666
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
2675
2667
|
if (this.options.ecmaVersion >= 6) {
|
|
2676
2668
|
this.next();
|
|
2677
|
-
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new
|
|
2669
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new Nt(), f = this.yieldPos, p = this.awaitPos, m;
|
|
2678
2670
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== k.parenR;) {
|
|
2679
2671
|
if (l ? l = !1 : this.expect(k.comma), a && this.afterTrailingComma(k.parenR, !0)) {
|
|
2680
2672
|
u = !0;
|
|
@@ -2700,7 +2692,7 @@ R.parseExprSubscripts = function(e, t) {
|
|
|
2700
2692
|
}, R.parseParenArrowList = function(e, t, n, r) {
|
|
2701
2693
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
2702
2694
|
};
|
|
2703
|
-
var
|
|
2695
|
+
var Kt = [];
|
|
2704
2696
|
R.parseNew = function() {
|
|
2705
2697
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2706
2698
|
var e = this.startNode();
|
|
@@ -2711,7 +2703,7 @@ R.parseNew = function() {
|
|
|
2711
2703
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
2712
2704
|
}
|
|
2713
2705
|
var r = this.start, i = this.startLoc;
|
|
2714
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(k.parenL) ? this.parseExprList(k.parenR, this.options.ecmaVersion >= 8, !1) :
|
|
2706
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(k.parenL) ? this.parseExprList(k.parenR, this.options.ecmaVersion >= 8, !1) : Kt, this.finishNode(e, "NewExpression");
|
|
2715
2707
|
}, R.parseTemplateElement = function(e) {
|
|
2716
2708
|
var t = e.isTagged, n = this.startNode();
|
|
2717
2709
|
return this.type === k.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
@@ -2767,10 +2759,10 @@ R.parseNew = function() {
|
|
|
2767
2759
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2768
2760
|
}, R.parseMethod = function(e, t, n) {
|
|
2769
2761
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2770
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
2762
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Tt(t, r.generator) | yt | (n ? bt : 0)), this.expect(k.parenL), r.params = this.parseBindingList(k.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
2771
2763
|
}, R.parseArrowExpression = function(e, t, n, r) {
|
|
2772
2764
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2773
|
-
return this.enterScope(
|
|
2765
|
+
return this.enterScope(Tt(n, !1) | _t), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
|
|
2774
2766
|
}, R.parseFunctionBody = function(e, t, n, r) {
|
|
2775
2767
|
var i = t && this.type !== k.braceL, a = this.strict, o = !1;
|
|
2776
2768
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
@@ -2778,7 +2770,7 @@ R.parseNew = function() {
|
|
|
2778
2770
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
2779
2771
|
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
2780
2772
|
var c = this.labels;
|
|
2781
|
-
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id,
|
|
2773
|
+
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, jt), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
2782
2774
|
}
|
|
2783
2775
|
this.exitScope();
|
|
2784
2776
|
}, R.isSimpleParamList = function(e) {
|
|
@@ -2787,7 +2779,7 @@ R.parseNew = function() {
|
|
|
2787
2779
|
}, R.checkParams = function(e, t) {
|
|
2788
2780
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
2789
2781
|
var a = i[r];
|
|
2790
|
-
this.checkLValInnerPattern(a,
|
|
2782
|
+
this.checkLValInnerPattern(a, Dt, t ? null : n);
|
|
2791
2783
|
}
|
|
2792
2784
|
}, R.parseExprList = function(e, t, n, r) {
|
|
2793
2785
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
@@ -2799,7 +2791,7 @@ R.parseNew = function() {
|
|
|
2799
2791
|
return i;
|
|
2800
2792
|
}, R.checkUnreserved = function(e) {
|
|
2801
2793
|
var t = e.start, n = e.end, r = e.name;
|
|
2802
|
-
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags &
|
|
2794
|
+
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & wt) && r === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (r === "arguments" || r === "await") && this.raise(t, "Cannot use " + r + " in class static initialization block"), this.keywords.test(r) && this.raise(t, "Unexpected keyword '" + r + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, n).indexOf("\\") !== -1) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(r) && (!this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + r + "' is reserved"));
|
|
2803
2795
|
}, R.parseIdent = function(e) {
|
|
2804
2796
|
var t = this.parseIdentNode();
|
|
2805
2797
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
@@ -2818,139 +2810,139 @@ R.parseNew = function() {
|
|
|
2818
2810
|
var t = this.startNode();
|
|
2819
2811
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
2820
2812
|
};
|
|
2821
|
-
var
|
|
2822
|
-
|
|
2823
|
-
var n =
|
|
2813
|
+
var qt = M.prototype;
|
|
2814
|
+
qt.raise = function(e, t) {
|
|
2815
|
+
var n = ct(this.input, e);
|
|
2824
2816
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2825
2817
|
var r = SyntaxError(t);
|
|
2826
2818
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2827
|
-
},
|
|
2828
|
-
if (this.options.locations) return new
|
|
2819
|
+
}, qt.raiseRecoverable = qt.raise, qt.curPosition = function() {
|
|
2820
|
+
if (this.options.locations) return new ot(this.curLine, this.pos - this.lineStart);
|
|
2829
2821
|
};
|
|
2830
|
-
var
|
|
2822
|
+
var Jt = M.prototype, Yt = function(e) {
|
|
2831
2823
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
2832
2824
|
};
|
|
2833
|
-
|
|
2834
|
-
this.scopeStack.push(new
|
|
2835
|
-
},
|
|
2825
|
+
Jt.enterScope = function(e) {
|
|
2826
|
+
this.scopeStack.push(new Yt(e));
|
|
2827
|
+
}, Jt.exitScope = function() {
|
|
2836
2828
|
this.scopeStack.pop();
|
|
2837
|
-
},
|
|
2838
|
-
return e.flags &
|
|
2839
|
-
},
|
|
2829
|
+
}, Jt.treatFunctionsAsVarInScope = function(e) {
|
|
2830
|
+
return e.flags & mt || !this.inModule && e.flags & pt;
|
|
2831
|
+
}, Jt.declareName = function(e, t, n) {
|
|
2840
2832
|
var r = !1;
|
|
2841
|
-
if (t ===
|
|
2833
|
+
if (t === Ot) {
|
|
2842
2834
|
var i = this.currentScope();
|
|
2843
|
-
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags &
|
|
2844
|
-
} else if (t ===
|
|
2845
|
-
else if (t ===
|
|
2835
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & pt && delete this.undefinedExports[e];
|
|
2836
|
+
} else if (t === At) this.currentScope().lexical.push(e);
|
|
2837
|
+
else if (t === kt) {
|
|
2846
2838
|
var a = this.currentScope();
|
|
2847
2839
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
2848
2840
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
2849
2841
|
var s = this.scopeStack[o];
|
|
2850
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
2842
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & vt && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
2851
2843
|
r = !0;
|
|
2852
2844
|
break;
|
|
2853
2845
|
}
|
|
2854
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
2846
|
+
if (s.var.push(e), this.inModule && s.flags & pt && delete this.undefinedExports[e], s.flags & wt) break;
|
|
2855
2847
|
}
|
|
2856
2848
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2857
|
-
},
|
|
2849
|
+
}, Jt.checkLocalExport = function(e) {
|
|
2858
2850
|
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
2859
|
-
},
|
|
2851
|
+
}, Jt.currentScope = function() {
|
|
2860
2852
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
2861
|
-
},
|
|
2853
|
+
}, Jt.currentVarScope = function() {
|
|
2862
2854
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2863
2855
|
var t = this.scopeStack[e];
|
|
2864
|
-
if (t.flags & (
|
|
2856
|
+
if (t.flags & (wt | St | xt)) return t;
|
|
2865
2857
|
}
|
|
2866
|
-
},
|
|
2858
|
+
}, Jt.currentThisScope = function() {
|
|
2867
2859
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2868
2860
|
var t = this.scopeStack[e];
|
|
2869
|
-
if (t.flags & (
|
|
2861
|
+
if (t.flags & (wt | St | xt) && !(t.flags & _t)) return t;
|
|
2870
2862
|
}
|
|
2871
2863
|
};
|
|
2872
|
-
var
|
|
2873
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
2874
|
-
},
|
|
2875
|
-
|
|
2876
|
-
return new
|
|
2877
|
-
},
|
|
2878
|
-
return new
|
|
2864
|
+
var Xt = function(e, t, n) {
|
|
2865
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new st(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2866
|
+
}, Zt = M.prototype;
|
|
2867
|
+
Zt.startNode = function() {
|
|
2868
|
+
return new Xt(this, this.start, this.startLoc);
|
|
2869
|
+
}, Zt.startNodeAt = function(e, t) {
|
|
2870
|
+
return new Xt(this, e, t);
|
|
2879
2871
|
};
|
|
2880
|
-
function
|
|
2872
|
+
function Qt(e, t, n, r) {
|
|
2881
2873
|
return e.type = t, e.end = n, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = n), e;
|
|
2882
2874
|
}
|
|
2883
|
-
|
|
2884
|
-
return
|
|
2885
|
-
},
|
|
2886
|
-
return
|
|
2887
|
-
},
|
|
2888
|
-
var t = new
|
|
2875
|
+
Zt.finishNode = function(e, t) {
|
|
2876
|
+
return Qt.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
2877
|
+
}, Zt.finishNodeAt = function(e, t, n, r) {
|
|
2878
|
+
return Qt.call(this, e, t, n, r);
|
|
2879
|
+
}, Zt.copyNode = function(e) {
|
|
2880
|
+
var t = new Xt(this, e.start, this.startLoc);
|
|
2889
2881
|
for (var n in e) t[n] = e[n];
|
|
2890
2882
|
return t;
|
|
2891
2883
|
};
|
|
2892
|
-
var
|
|
2893
|
-
9:
|
|
2894
|
-
10:
|
|
2895
|
-
11:
|
|
2896
|
-
12:
|
|
2897
|
-
13:
|
|
2898
|
-
14:
|
|
2899
|
-
},
|
|
2884
|
+
var $t = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", en = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", tn = en + " Extended_Pictographic", nn = tn, rn = nn + " EBase EComp EMod EPres ExtPict", an = rn, on = {
|
|
2885
|
+
9: en,
|
|
2886
|
+
10: tn,
|
|
2887
|
+
11: nn,
|
|
2888
|
+
12: rn,
|
|
2889
|
+
13: an,
|
|
2890
|
+
14: an
|
|
2891
|
+
}, sn = {
|
|
2900
2892
|
9: "",
|
|
2901
2893
|
10: "",
|
|
2902
2894
|
11: "",
|
|
2903
2895
|
12: "",
|
|
2904
2896
|
13: "",
|
|
2905
2897
|
14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
|
|
2906
|
-
},
|
|
2907
|
-
9:
|
|
2908
|
-
10:
|
|
2909
|
-
11:
|
|
2910
|
-
12:
|
|
2911
|
-
13:
|
|
2912
|
-
14:
|
|
2913
|
-
},
|
|
2914
|
-
function
|
|
2915
|
-
var t =
|
|
2916
|
-
binary:
|
|
2917
|
-
binaryOfStrings:
|
|
2898
|
+
}, cn = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", ln = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", un = ln + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", dn = un + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", fn = dn + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", pn = fn + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", mn = {
|
|
2899
|
+
9: ln,
|
|
2900
|
+
10: un,
|
|
2901
|
+
11: dn,
|
|
2902
|
+
12: fn,
|
|
2903
|
+
13: pn,
|
|
2904
|
+
14: pn + " " + $t
|
|
2905
|
+
}, hn = {};
|
|
2906
|
+
function gn(e) {
|
|
2907
|
+
var t = hn[e] = {
|
|
2908
|
+
binary: rt(on[e] + " " + cn),
|
|
2909
|
+
binaryOfStrings: rt(sn[e]),
|
|
2918
2910
|
nonBinary: {
|
|
2919
|
-
General_Category:
|
|
2920
|
-
Script:
|
|
2911
|
+
General_Category: rt(cn),
|
|
2912
|
+
Script: rt(mn[e])
|
|
2921
2913
|
}
|
|
2922
2914
|
};
|
|
2923
2915
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
2924
2916
|
}
|
|
2925
|
-
for (var
|
|
2917
|
+
for (var _n = 0, vn = [
|
|
2926
2918
|
9,
|
|
2927
2919
|
10,
|
|
2928
2920
|
11,
|
|
2929
2921
|
12,
|
|
2930
2922
|
13,
|
|
2931
2923
|
14
|
|
2932
|
-
];
|
|
2933
|
-
var
|
|
2934
|
-
|
|
2924
|
+
]; _n < vn.length; _n += 1) {
|
|
2925
|
+
var yn = vn[_n];
|
|
2926
|
+
gn(yn);
|
|
2935
2927
|
}
|
|
2936
|
-
var z = M.prototype,
|
|
2928
|
+
var z = M.prototype, bn = function(e, t) {
|
|
2937
2929
|
this.parent = e, this.base = t || this;
|
|
2938
2930
|
};
|
|
2939
|
-
|
|
2931
|
+
bn.prototype.separatedFrom = function(e) {
|
|
2940
2932
|
for (var t = this; t; t = t.parent) for (var n = e; n; n = n.parent) if (t.base === n.base && t !== n) return !0;
|
|
2941
2933
|
return !1;
|
|
2942
|
-
},
|
|
2943
|
-
return new
|
|
2934
|
+
}, bn.prototype.sibling = function() {
|
|
2935
|
+
return new bn(this.parent, this.base);
|
|
2944
2936
|
};
|
|
2945
|
-
var
|
|
2946
|
-
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties =
|
|
2937
|
+
var xn = function(e) {
|
|
2938
|
+
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = hn[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
2947
2939
|
};
|
|
2948
|
-
|
|
2940
|
+
xn.prototype.reset = function(e, t, n) {
|
|
2949
2941
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2950
2942
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2951
|
-
},
|
|
2943
|
+
}, xn.prototype.raise = function(e) {
|
|
2952
2944
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2953
|
-
},
|
|
2945
|
+
}, xn.prototype.at = function(e, t) {
|
|
2954
2946
|
t === void 0 && (t = !1);
|
|
2955
2947
|
var n = this.source, r = n.length;
|
|
2956
2948
|
if (e >= r) return -1;
|
|
@@ -2958,21 +2950,21 @@ Sn.prototype.reset = function(e, t, n) {
|
|
|
2958
2950
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2959
2951
|
var a = n.charCodeAt(e + 1);
|
|
2960
2952
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2961
|
-
},
|
|
2953
|
+
}, xn.prototype.nextIndex = function(e, t) {
|
|
2962
2954
|
t === void 0 && (t = !1);
|
|
2963
2955
|
var n = this.source, r = n.length;
|
|
2964
2956
|
if (e >= r) return r;
|
|
2965
2957
|
var i = n.charCodeAt(e), a;
|
|
2966
2958
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2967
|
-
},
|
|
2959
|
+
}, xn.prototype.current = function(e) {
|
|
2968
2960
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2969
|
-
},
|
|
2961
|
+
}, xn.prototype.lookahead = function(e) {
|
|
2970
2962
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2971
|
-
},
|
|
2963
|
+
}, xn.prototype.advance = function(e) {
|
|
2972
2964
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2973
|
-
},
|
|
2965
|
+
}, xn.prototype.eat = function(e, t) {
|
|
2974
2966
|
return t === void 0 && (t = !1), this.current(t) === e && (this.advance(t), !0);
|
|
2975
|
-
},
|
|
2967
|
+
}, xn.prototype.eatChars = function(e, t) {
|
|
2976
2968
|
t === void 0 && (t = !1);
|
|
2977
2969
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
2978
2970
|
var a = i[r], o = this.at(n, t);
|
|
@@ -2987,12 +2979,12 @@ Sn.prototype.reset = function(e, t, n) {
|
|
|
2987
2979
|
}
|
|
2988
2980
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
2989
2981
|
};
|
|
2990
|
-
function
|
|
2982
|
+
function Sn(e) {
|
|
2991
2983
|
for (var t in e) return !0;
|
|
2992
2984
|
return !1;
|
|
2993
2985
|
}
|
|
2994
2986
|
z.validateRegExpPattern = function(e) {
|
|
2995
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
2987
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && Sn(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2996
2988
|
}, z.regexp_pattern = function(e) {
|
|
2997
2989
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
2998
2990
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
@@ -3001,7 +2993,7 @@ z.validateRegExpPattern = function(e) {
|
|
|
3001
2993
|
}
|
|
3002
2994
|
}, z.regexp_disjunction = function(e) {
|
|
3003
2995
|
var t = this.options.ecmaVersion >= 16;
|
|
3004
|
-
for (t && (e.branchID = new
|
|
2996
|
+
for (t && (e.branchID = new bn(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
3005
2997
|
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
|
|
3006
2998
|
}, z.regexp_alternative = function(e) {
|
|
3007
2999
|
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
@@ -3076,10 +3068,10 @@ z.validateRegExpPattern = function(e) {
|
|
|
3076
3068
|
}
|
|
3077
3069
|
return !1;
|
|
3078
3070
|
}, z.regexp_eatModifiers = function(e) {
|
|
3079
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
3071
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && Cn(n);) t += it(n), e.advance();
|
|
3080
3072
|
return t;
|
|
3081
3073
|
};
|
|
3082
|
-
function
|
|
3074
|
+
function Cn(e) {
|
|
3083
3075
|
return e === 105 || e === 109 || e === 115;
|
|
3084
3076
|
}
|
|
3085
3077
|
z.regexp_eatExtendedAtom = function(e) {
|
|
@@ -3088,13 +3080,13 @@ z.regexp_eatExtendedAtom = function(e) {
|
|
|
3088
3080
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
3089
3081
|
}, z.regexp_eatSyntaxCharacter = function(e) {
|
|
3090
3082
|
var t = e.current();
|
|
3091
|
-
return
|
|
3083
|
+
return wn(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
3092
3084
|
};
|
|
3093
|
-
function
|
|
3085
|
+
function wn(e) {
|
|
3094
3086
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
3095
3087
|
}
|
|
3096
3088
|
z.regexp_eatPatternCharacters = function(e) {
|
|
3097
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
3089
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !wn(n);) e.advance();
|
|
3098
3090
|
return e.pos !== t;
|
|
3099
3091
|
}, z.regexp_eatExtendedPatternCharacter = function(e) {
|
|
3100
3092
|
var t = e.current();
|
|
@@ -3117,23 +3109,23 @@ z.regexp_eatPatternCharacters = function(e) {
|
|
|
3117
3109
|
return !1;
|
|
3118
3110
|
}, z.regexp_eatRegExpIdentifierName = function(e) {
|
|
3119
3111
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
3120
|
-
for (e.lastStringValue +=
|
|
3112
|
+
for (e.lastStringValue += it(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += it(e.lastIntValue);
|
|
3121
3113
|
return !0;
|
|
3122
3114
|
}
|
|
3123
3115
|
return !1;
|
|
3124
3116
|
}, z.regexp_eatRegExpIdentifierStart = function(e) {
|
|
3125
3117
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
3126
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
3118
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Tn(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
3127
3119
|
};
|
|
3128
|
-
function
|
|
3129
|
-
return
|
|
3120
|
+
function Tn(e) {
|
|
3121
|
+
return We(e, !0) || e === 36 || e === 95;
|
|
3130
3122
|
}
|
|
3131
3123
|
z.regexp_eatRegExpIdentifierPart = function(e) {
|
|
3132
3124
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
3133
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
3125
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), En(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
3134
3126
|
};
|
|
3135
|
-
function
|
|
3136
|
-
return
|
|
3127
|
+
function En(e) {
|
|
3128
|
+
return Ge(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
3137
3129
|
}
|
|
3138
3130
|
z.regexp_eatAtomEscape = function(e) {
|
|
3139
3131
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
@@ -3162,15 +3154,15 @@ z.regexp_eatAtomEscape = function(e) {
|
|
|
3162
3154
|
}
|
|
3163
3155
|
return !1;
|
|
3164
3156
|
}, z.regexp_eatZero = function(e) {
|
|
3165
|
-
return e.current() === 48 && !
|
|
3157
|
+
return e.current() === 48 && !Ln(e.lookahead()) && (e.lastIntValue = 0, e.advance(), !0);
|
|
3166
3158
|
}, z.regexp_eatControlEscape = function(e) {
|
|
3167
3159
|
var t = e.current();
|
|
3168
3160
|
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 && (e.lastIntValue = 13, e.advance(), !0);
|
|
3169
3161
|
}, z.regexp_eatControlLetter = function(e) {
|
|
3170
3162
|
var t = e.current();
|
|
3171
|
-
return
|
|
3163
|
+
return Dn(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
3172
3164
|
};
|
|
3173
|
-
function
|
|
3165
|
+
function Dn(e) {
|
|
3174
3166
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
3175
3167
|
}
|
|
3176
3168
|
z.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
@@ -3189,12 +3181,12 @@ z.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
3189
3181
|
}
|
|
3190
3182
|
return !0;
|
|
3191
3183
|
}
|
|
3192
|
-
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) &&
|
|
3184
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && On(e.lastIntValue)) return !0;
|
|
3193
3185
|
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
3194
3186
|
}
|
|
3195
3187
|
return !1;
|
|
3196
3188
|
};
|
|
3197
|
-
function
|
|
3189
|
+
function On(e) {
|
|
3198
3190
|
return e >= 0 && e <= 1114111;
|
|
3199
3191
|
}
|
|
3200
3192
|
z.regexp_eatIdentityEscape = function(e) {
|
|
@@ -3212,10 +3204,10 @@ z.regexp_eatIdentityEscape = function(e) {
|
|
|
3212
3204
|
}
|
|
3213
3205
|
return !1;
|
|
3214
3206
|
};
|
|
3215
|
-
var
|
|
3207
|
+
var kn = 0, An = 1, B = 2;
|
|
3216
3208
|
z.regexp_eatCharacterClassEscape = function(e) {
|
|
3217
3209
|
var t = e.current();
|
|
3218
|
-
if (
|
|
3210
|
+
if (jn(t)) return e.lastIntValue = -1, e.advance(), An;
|
|
3219
3211
|
var n = !1;
|
|
3220
3212
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
3221
3213
|
e.lastIntValue = -1, e.advance();
|
|
@@ -3223,9 +3215,9 @@ z.regexp_eatCharacterClassEscape = function(e) {
|
|
|
3223
3215
|
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === B && e.raise("Invalid property name"), r;
|
|
3224
3216
|
e.raise("Invalid property name");
|
|
3225
3217
|
}
|
|
3226
|
-
return
|
|
3218
|
+
return kn;
|
|
3227
3219
|
};
|
|
3228
|
-
function
|
|
3220
|
+
function jn(e) {
|
|
3229
3221
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
3230
3222
|
}
|
|
3231
3223
|
z.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
@@ -3234,35 +3226,35 @@ z.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
3234
3226
|
var n = e.lastStringValue;
|
|
3235
3227
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
3236
3228
|
var r = e.lastStringValue;
|
|
3237
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
3229
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), An;
|
|
3238
3230
|
}
|
|
3239
3231
|
}
|
|
3240
3232
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
3241
3233
|
var i = e.lastStringValue;
|
|
3242
3234
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
3243
3235
|
}
|
|
3244
|
-
return
|
|
3236
|
+
return kn;
|
|
3245
3237
|
}, z.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
3246
|
-
|
|
3238
|
+
et(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
3247
3239
|
}, z.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
3248
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
3240
|
+
if (e.unicodeProperties.binary.test(t)) return An;
|
|
3249
3241
|
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return B;
|
|
3250
3242
|
e.raise("Invalid property name");
|
|
3251
3243
|
}, z.regexp_eatUnicodePropertyName = function(e) {
|
|
3252
3244
|
var t = 0;
|
|
3253
|
-
for (e.lastStringValue = "";
|
|
3245
|
+
for (e.lastStringValue = ""; Mn(t = e.current());) e.lastStringValue += it(t), e.advance();
|
|
3254
3246
|
return e.lastStringValue !== "";
|
|
3255
3247
|
};
|
|
3256
|
-
function
|
|
3257
|
-
return
|
|
3248
|
+
function Mn(e) {
|
|
3249
|
+
return Dn(e) || e === 95;
|
|
3258
3250
|
}
|
|
3259
3251
|
z.regexp_eatUnicodePropertyValue = function(e) {
|
|
3260
3252
|
var t = 0;
|
|
3261
|
-
for (e.lastStringValue = "";
|
|
3253
|
+
for (e.lastStringValue = ""; Nn(t = e.current());) e.lastStringValue += it(t), e.advance();
|
|
3262
3254
|
return e.lastStringValue !== "";
|
|
3263
3255
|
};
|
|
3264
|
-
function
|
|
3265
|
-
return
|
|
3256
|
+
function Nn(e) {
|
|
3257
|
+
return Mn(e) || Ln(e);
|
|
3266
3258
|
}
|
|
3267
3259
|
z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
3268
3260
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
@@ -3273,7 +3265,7 @@ z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3273
3265
|
}
|
|
3274
3266
|
return !1;
|
|
3275
3267
|
}, z.regexp_classContents = function(e) {
|
|
3276
|
-
return e.current() === 93 ?
|
|
3268
|
+
return e.current() === 93 ? An : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), An);
|
|
3277
3269
|
}, z.regexp_nonEmptyClassRanges = function(e) {
|
|
3278
3270
|
for (; this.regexp_eatClassAtom(e);) {
|
|
3279
3271
|
var t = e.lastIntValue;
|
|
@@ -3288,7 +3280,7 @@ z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3288
3280
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
3289
3281
|
if (e.switchU) {
|
|
3290
3282
|
var n = e.current();
|
|
3291
|
-
(n === 99 ||
|
|
3283
|
+
(n === 99 || Bn(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
3292
3284
|
}
|
|
3293
3285
|
e.pos = t;
|
|
3294
3286
|
}
|
|
@@ -3304,13 +3296,13 @@ z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3304
3296
|
}
|
|
3305
3297
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
3306
3298
|
}, z.regexp_classSetExpression = function(e) {
|
|
3307
|
-
var t =
|
|
3299
|
+
var t = An, n;
|
|
3308
3300
|
if (!this.regexp_eatClassSetRange(e)) {
|
|
3309
3301
|
if (n = this.regexp_eatClassSetOperand(e)) {
|
|
3310
3302
|
n === B && (t = B);
|
|
3311
3303
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
3312
3304
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
3313
|
-
n !== B && (t =
|
|
3305
|
+
n !== B && (t = An);
|
|
3314
3306
|
continue;
|
|
3315
3307
|
}
|
|
3316
3308
|
e.raise("Invalid character in character class");
|
|
@@ -3336,7 +3328,7 @@ z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3336
3328
|
}
|
|
3337
3329
|
return !1;
|
|
3338
3330
|
}, z.regexp_eatClassSetOperand = function(e) {
|
|
3339
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
3331
|
+
return this.regexp_eatClassSetCharacter(e) ? An : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
3340
3332
|
}, z.regexp_eatNestedClass = function(e) {
|
|
3341
3333
|
var t = e.pos;
|
|
3342
3334
|
if (e.eat(91)) {
|
|
@@ -3365,29 +3357,29 @@ z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3365
3357
|
return t;
|
|
3366
3358
|
}, z.regexp_classString = function(e) {
|
|
3367
3359
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
3368
|
-
return t === 1 ?
|
|
3360
|
+
return t === 1 ? An : B;
|
|
3369
3361
|
}, z.regexp_eatClassSetCharacter = function(e) {
|
|
3370
3362
|
var t = e.pos;
|
|
3371
3363
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
3372
3364
|
var n = e.current();
|
|
3373
|
-
return n < 0 || n === e.lookahead() &&
|
|
3365
|
+
return n < 0 || n === e.lookahead() && Pn(n) || Fn(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
3374
3366
|
};
|
|
3375
|
-
function
|
|
3367
|
+
function Pn(e) {
|
|
3376
3368
|
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
3377
3369
|
}
|
|
3378
|
-
function
|
|
3370
|
+
function Fn(e) {
|
|
3379
3371
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
3380
3372
|
}
|
|
3381
3373
|
z.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
3382
3374
|
var t = e.current();
|
|
3383
|
-
return
|
|
3375
|
+
return In(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
3384
3376
|
};
|
|
3385
|
-
function
|
|
3377
|
+
function In(e) {
|
|
3386
3378
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
3387
3379
|
}
|
|
3388
3380
|
z.regexp_eatClassControlLetter = function(e) {
|
|
3389
3381
|
var t = e.current();
|
|
3390
|
-
return
|
|
3382
|
+
return Ln(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
3391
3383
|
}, z.regexp_eatHexEscapeSequence = function(e) {
|
|
3392
3384
|
var t = e.pos;
|
|
3393
3385
|
if (e.eat(120)) {
|
|
@@ -3397,21 +3389,21 @@ z.regexp_eatClassControlLetter = function(e) {
|
|
|
3397
3389
|
return !1;
|
|
3398
3390
|
}, z.regexp_eatDecimalDigits = function(e) {
|
|
3399
3391
|
var t = e.pos, n = 0;
|
|
3400
|
-
for (e.lastIntValue = 0;
|
|
3392
|
+
for (e.lastIntValue = 0; Ln(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
3401
3393
|
return e.pos !== t;
|
|
3402
3394
|
};
|
|
3403
|
-
function
|
|
3395
|
+
function Ln(e) {
|
|
3404
3396
|
return e >= 48 && e <= 57;
|
|
3405
3397
|
}
|
|
3406
3398
|
z.regexp_eatHexDigits = function(e) {
|
|
3407
3399
|
var t = e.pos, n = 0;
|
|
3408
|
-
for (e.lastIntValue = 0;
|
|
3400
|
+
for (e.lastIntValue = 0; Rn(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + zn(n), e.advance();
|
|
3409
3401
|
return e.pos !== t;
|
|
3410
3402
|
};
|
|
3411
|
-
function
|
|
3403
|
+
function Rn(e) {
|
|
3412
3404
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
3413
3405
|
}
|
|
3414
|
-
function
|
|
3406
|
+
function zn(e) {
|
|
3415
3407
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
3416
3408
|
}
|
|
3417
3409
|
z.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
@@ -3426,9 +3418,9 @@ z.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
3426
3418
|
return !1;
|
|
3427
3419
|
}, z.regexp_eatOctalDigit = function(e) {
|
|
3428
3420
|
var t = e.current();
|
|
3429
|
-
return
|
|
3421
|
+
return Bn(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
3430
3422
|
};
|
|
3431
|
-
function
|
|
3423
|
+
function Bn(e) {
|
|
3432
3424
|
return e >= 48 && e <= 55;
|
|
3433
3425
|
}
|
|
3434
3426
|
z.regexp_eatFixedHexDigits = function(e, t) {
|
|
@@ -3436,18 +3428,18 @@ z.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
3436
3428
|
e.lastIntValue = 0;
|
|
3437
3429
|
for (var r = 0; r < t; ++r) {
|
|
3438
3430
|
var i = e.current();
|
|
3439
|
-
if (!
|
|
3440
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
3431
|
+
if (!Rn(i)) return e.pos = n, !1;
|
|
3432
|
+
e.lastIntValue = 16 * e.lastIntValue + zn(i), e.advance();
|
|
3441
3433
|
}
|
|
3442
3434
|
return !0;
|
|
3443
3435
|
};
|
|
3444
|
-
var
|
|
3445
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
3436
|
+
var Vn = function(e) {
|
|
3437
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new st(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
3446
3438
|
}, V = M.prototype;
|
|
3447
3439
|
V.next = function(e) {
|
|
3448
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
3440
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Vn(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
3449
3441
|
}, V.getToken = function() {
|
|
3450
|
-
return this.next(), new
|
|
3442
|
+
return this.next(), new Vn(this);
|
|
3451
3443
|
}, typeof Symbol < "u" && (V[Symbol.iterator] = function() {
|
|
3452
3444
|
var e = this;
|
|
3453
3445
|
return { next: function() {
|
|
@@ -3463,7 +3455,7 @@ V.next = function(e) {
|
|
|
3463
3455
|
if (e.override) return e.override(this);
|
|
3464
3456
|
this.readToken(this.fullCharCodeAtPos());
|
|
3465
3457
|
}, V.readToken = function(e) {
|
|
3466
|
-
return
|
|
3458
|
+
return We(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
3467
3459
|
}, V.fullCharCodeAt = function(e) {
|
|
3468
3460
|
var t = this.input.charCodeAt(e);
|
|
3469
3461
|
if (t <= 55295 || t >= 56320) return t;
|
|
@@ -3473,10 +3465,10 @@ V.next = function(e) {
|
|
|
3473
3465
|
return this.fullCharCodeAt(this.pos);
|
|
3474
3466
|
}, V.skipBlockComment = function() {
|
|
3475
3467
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
3476
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r =
|
|
3468
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = Ye(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
3477
3469
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
3478
3470
|
}, V.skipLineComment = function(e) {
|
|
3479
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
3471
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !Je(r);) r = this.input.charCodeAt(++this.pos);
|
|
3480
3472
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
3481
3473
|
}, V.skipSpace = function() {
|
|
3482
3474
|
loop: for (; this.pos < this.input.length;) {
|
|
@@ -3503,7 +3495,7 @@ V.next = function(e) {
|
|
|
3503
3495
|
default: break loop;
|
|
3504
3496
|
}
|
|
3505
3497
|
break;
|
|
3506
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
3498
|
+
default: if (e > 8 && e < 14 || e >= 5760 && Xe.test(String.fromCharCode(e))) ++this.pos;
|
|
3507
3499
|
else break loop;
|
|
3508
3500
|
}
|
|
3509
3501
|
}
|
|
@@ -3549,8 +3541,8 @@ V.next = function(e) {
|
|
|
3549
3541
|
return this.finishOp(k.question, 1);
|
|
3550
3542
|
}, V.readToken_numberSign = function() {
|
|
3551
3543
|
var e = this.options.ecmaVersion, t = 35;
|
|
3552
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
3553
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3544
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), We(t, !0) || t === 92)) return this.finishToken(k.privateId, this.readWord1());
|
|
3545
|
+
this.raise(this.pos, "Unexpected character '" + it(t) + "'");
|
|
3554
3546
|
}, V.getTokenFromCode = function(e) {
|
|
3555
3547
|
switch (e) {
|
|
3556
3548
|
case 46: return this.readToken_dot();
|
|
@@ -3600,7 +3592,7 @@ V.next = function(e) {
|
|
|
3600
3592
|
case 126: return this.finishOp(k.prefix, 1);
|
|
3601
3593
|
case 35: return this.readToken_numberSign();
|
|
3602
3594
|
}
|
|
3603
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3595
|
+
this.raise(this.pos, "Unexpected character '" + it(e) + "'");
|
|
3604
3596
|
}, V.finishOp = function(e, t) {
|
|
3605
3597
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3606
3598
|
return this.pos += t, this.finishToken(e, n);
|
|
@@ -3621,7 +3613,7 @@ V.next = function(e) {
|
|
|
3621
3613
|
++this.pos;
|
|
3622
3614
|
var a = this.pos, o = this.readWord1();
|
|
3623
3615
|
this.containsEsc && this.unexpected(a);
|
|
3624
|
-
var s = this.regexpState ||= new
|
|
3616
|
+
var s = this.regexpState ||= new xn(this);
|
|
3625
3617
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3626
3618
|
var c = null;
|
|
3627
3619
|
try {
|
|
@@ -3644,17 +3636,17 @@ V.next = function(e) {
|
|
|
3644
3636
|
}
|
|
3645
3637
|
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
3646
3638
|
};
|
|
3647
|
-
function
|
|
3639
|
+
function Hn(e, t) {
|
|
3648
3640
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3649
3641
|
}
|
|
3650
|
-
function
|
|
3642
|
+
function Un(e) {
|
|
3651
3643
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3652
3644
|
}
|
|
3653
3645
|
V.readRadixNumber = function(e) {
|
|
3654
3646
|
var t = this.pos;
|
|
3655
3647
|
this.pos += 2;
|
|
3656
3648
|
var n = this.readInt(e);
|
|
3657
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n =
|
|
3649
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Un(this.input.slice(t, this.pos)), ++this.pos) : We(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(k.num, n);
|
|
3658
3650
|
}, V.readNumber = function(e) {
|
|
3659
3651
|
var t = this.pos;
|
|
3660
3652
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
@@ -3662,11 +3654,11 @@ V.readRadixNumber = function(e) {
|
|
|
3662
3654
|
n && this.strict && this.raise(t, "Invalid number");
|
|
3663
3655
|
var r = this.input.charCodeAt(this.pos);
|
|
3664
3656
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3665
|
-
var i =
|
|
3666
|
-
return ++this.pos,
|
|
3657
|
+
var i = Un(this.input.slice(t, this.pos));
|
|
3658
|
+
return ++this.pos, We(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(k.num, i);
|
|
3667
3659
|
}
|
|
3668
|
-
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")),
|
|
3669
|
-
var a =
|
|
3660
|
+
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), We(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3661
|
+
var a = Hn(this.input.slice(t, this.pos), n);
|
|
3670
3662
|
return this.finishToken(k.num, a);
|
|
3671
3663
|
}, V.readCodePoint = function() {
|
|
3672
3664
|
var e = this.input.charCodeAt(this.pos), t;
|
|
@@ -3681,22 +3673,22 @@ V.readRadixNumber = function(e) {
|
|
|
3681
3673
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3682
3674
|
var r = this.input.charCodeAt(this.pos);
|
|
3683
3675
|
if (r === e) break;
|
|
3684
|
-
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (
|
|
3676
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (Je(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3685
3677
|
}
|
|
3686
3678
|
return t += this.input.slice(n, this.pos++), this.finishToken(k.string, t);
|
|
3687
3679
|
};
|
|
3688
|
-
var
|
|
3680
|
+
var Wn = {};
|
|
3689
3681
|
V.tryReadTemplateToken = function() {
|
|
3690
3682
|
this.inTemplateElement = !0;
|
|
3691
3683
|
try {
|
|
3692
3684
|
this.readTmplToken();
|
|
3693
3685
|
} catch (e) {
|
|
3694
|
-
if (e ===
|
|
3686
|
+
if (e === Wn) this.readInvalidTemplateToken();
|
|
3695
3687
|
else throw e;
|
|
3696
3688
|
}
|
|
3697
3689
|
this.inTemplateElement = !1;
|
|
3698
3690
|
}, V.invalidStringToken = function(e, t) {
|
|
3699
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
3691
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Wn;
|
|
3700
3692
|
this.raise(e, t);
|
|
3701
3693
|
}, V.readTmplToken = function() {
|
|
3702
3694
|
for (var e = "", t = this.pos;;) {
|
|
@@ -3704,7 +3696,7 @@ V.tryReadTemplateToken = function() {
|
|
|
3704
3696
|
var n = this.input.charCodeAt(this.pos);
|
|
3705
3697
|
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === k.template || this.type === k.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(k.dollarBraceL)) : (++this.pos, this.finishToken(k.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(k.template, e));
|
|
3706
3698
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3707
|
-
else if (
|
|
3699
|
+
else if (Je(n)) {
|
|
3708
3700
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3709
3701
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3710
3702
|
case 10:
|
|
@@ -3734,7 +3726,7 @@ V.tryReadTemplateToken = function() {
|
|
|
3734
3726
|
case 110: return "\n";
|
|
3735
3727
|
case 114: return "\r";
|
|
3736
3728
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
3737
|
-
case 117: return
|
|
3729
|
+
case 117: return it(this.readCodePoint());
|
|
3738
3730
|
case 116: return " ";
|
|
3739
3731
|
case 98: return "\b";
|
|
3740
3732
|
case 118: return "\v";
|
|
@@ -3751,7 +3743,7 @@ V.tryReadTemplateToken = function() {
|
|
|
3751
3743
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3752
3744
|
return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
|
|
3753
3745
|
}
|
|
3754
|
-
return
|
|
3746
|
+
return Je(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3755
3747
|
}
|
|
3756
3748
|
}, V.readHexChar = function(e) {
|
|
3757
3749
|
var t = this.pos, n = this.readInt(16, e);
|
|
@@ -3760,53 +3752,53 @@ V.tryReadTemplateToken = function() {
|
|
|
3760
3752
|
this.containsEsc = !1;
|
|
3761
3753
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3762
3754
|
var i = this.fullCharCodeAtPos();
|
|
3763
|
-
if (
|
|
3755
|
+
if (Ge(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
3764
3756
|
else if (i === 92) {
|
|
3765
3757
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
3766
3758
|
var a = this.pos;
|
|
3767
3759
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3768
3760
|
var o = this.readCodePoint();
|
|
3769
|
-
(t ?
|
|
3761
|
+
(t ? We : Ge)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += it(o), n = this.pos;
|
|
3770
3762
|
} else break;
|
|
3771
3763
|
t = !1;
|
|
3772
3764
|
}
|
|
3773
3765
|
return e + this.input.slice(n, this.pos);
|
|
3774
3766
|
}, V.readWord = function() {
|
|
3775
3767
|
var e = this.readWord1(), t = k.name;
|
|
3776
|
-
return this.keywords.test(e) && (t =
|
|
3768
|
+
return this.keywords.test(e) && (t = Ke[e]), this.finishToken(t, e);
|
|
3777
3769
|
}, M.acorn = {
|
|
3778
3770
|
Parser: M,
|
|
3779
3771
|
version: "8.18.0",
|
|
3780
|
-
defaultOptions:
|
|
3781
|
-
Position:
|
|
3782
|
-
SourceLocation:
|
|
3783
|
-
getLineInfo:
|
|
3784
|
-
Node:
|
|
3772
|
+
defaultOptions: lt,
|
|
3773
|
+
Position: ot,
|
|
3774
|
+
SourceLocation: st,
|
|
3775
|
+
getLineInfo: ct,
|
|
3776
|
+
Node: Xt,
|
|
3785
3777
|
TokenType: w,
|
|
3786
3778
|
tokTypes: k,
|
|
3787
|
-
keywordTypes:
|
|
3788
|
-
TokContext:
|
|
3779
|
+
keywordTypes: Ke,
|
|
3780
|
+
TokContext: Ht,
|
|
3789
3781
|
tokContexts: L,
|
|
3790
|
-
isIdentifierChar:
|
|
3791
|
-
isIdentifierStart:
|
|
3792
|
-
Token:
|
|
3793
|
-
isNewLine:
|
|
3782
|
+
isIdentifierChar: Ge,
|
|
3783
|
+
isIdentifierStart: We,
|
|
3784
|
+
Token: Vn,
|
|
3785
|
+
isNewLine: Je,
|
|
3794
3786
|
lineBreak: A,
|
|
3795
|
-
lineBreakG:
|
|
3796
|
-
nonASCIIwhitespace:
|
|
3787
|
+
lineBreakG: qe,
|
|
3788
|
+
nonASCIIwhitespace: Xe
|
|
3797
3789
|
};
|
|
3798
|
-
function
|
|
3790
|
+
function Gn(e, t, n) {
|
|
3799
3791
|
return M.parseExpressionAt(e, t, n);
|
|
3800
3792
|
}
|
|
3801
3793
|
//#endregion
|
|
3802
3794
|
//#region src/debug.ts
|
|
3803
|
-
var
|
|
3804
|
-
function
|
|
3805
|
-
|
|
3795
|
+
var Kn = !!process.env.DEBUG;
|
|
3796
|
+
function qn(...e) {
|
|
3797
|
+
Kn && console.log(...e);
|
|
3806
3798
|
}
|
|
3807
3799
|
//#endregion
|
|
3808
3800
|
//#region src/safe-eval.ts
|
|
3809
|
-
var
|
|
3801
|
+
var Jn = {
|
|
3810
3802
|
String: (e) => String(e ?? ""),
|
|
3811
3803
|
Number: (e) => Number(e),
|
|
3812
3804
|
Boolean: (e) => !!e,
|
|
@@ -3816,7 +3808,7 @@ var Yn = {
|
|
|
3816
3808
|
},
|
|
3817
3809
|
Object: { keys: (e) => Object.keys(e) }
|
|
3818
3810
|
};
|
|
3819
|
-
function
|
|
3811
|
+
function Yn(t) {
|
|
3820
3812
|
let n = i.resolve(t), r = (...e) => {
|
|
3821
3813
|
let t = i.resolve(n, ...e);
|
|
3822
3814
|
if (t !== n && !t.startsWith(`${n}${i.sep}`)) throw Error("Workspace file path escapes working directory");
|
|
@@ -3828,7 +3820,7 @@ function Xn(t) {
|
|
|
3828
3820
|
join: (...e) => r(...e)
|
|
3829
3821
|
};
|
|
3830
3822
|
}
|
|
3831
|
-
var
|
|
3823
|
+
var Xn = class {
|
|
3832
3824
|
static async evaluateValue(e, t = {}) {
|
|
3833
3825
|
if (typeof e != "string" || !e.includes("${")) return e;
|
|
3834
3826
|
let n = `\`${e}\``;
|
|
@@ -3838,7 +3830,7 @@ var Zn = class {
|
|
|
3838
3830
|
typeof e == "string" && (e = [e]);
|
|
3839
3831
|
for (let n of e) {
|
|
3840
3832
|
let e = await this.evaluateExpression(n, t);
|
|
3841
|
-
if (
|
|
3833
|
+
if (qn("condition", e, n, t), e) return !0;
|
|
3842
3834
|
}
|
|
3843
3835
|
return !1;
|
|
3844
3836
|
}
|
|
@@ -3846,7 +3838,7 @@ var Zn = class {
|
|
|
3846
3838
|
if (!e || typeof e != "string") return e;
|
|
3847
3839
|
let n = e.trim(), r;
|
|
3848
3840
|
try {
|
|
3849
|
-
r =
|
|
3841
|
+
r = Gn(n, 0, {
|
|
3850
3842
|
ecmaVersion: 2020,
|
|
3851
3843
|
allowAwaitOutsideFunction: !1
|
|
3852
3844
|
});
|
|
@@ -3858,7 +3850,7 @@ var Zn = class {
|
|
|
3858
3850
|
static async evalNodeAsync(e, t) {
|
|
3859
3851
|
switch (e.type) {
|
|
3860
3852
|
case "Literal": return e.value;
|
|
3861
|
-
case "Identifier": return e.name in t ? t[e.name] : e.name in
|
|
3853
|
+
case "Identifier": return e.name in t ? t[e.name] : e.name in Jn ? Jn[e.name] : void 0;
|
|
3862
3854
|
case "MemberExpression": {
|
|
3863
3855
|
let n = await this.evalNodeAsync(e.object, t);
|
|
3864
3856
|
if (n == null) return;
|
|
@@ -3884,7 +3876,7 @@ var Zn = class {
|
|
|
3884
3876
|
else throw Error(`Property '${i}' is not a callable function on target object.`);
|
|
3885
3877
|
} else if (e.callee.type === "Identifier") {
|
|
3886
3878
|
let r = e.callee.name;
|
|
3887
|
-
if (n = t[r] ??
|
|
3879
|
+
if (n = t[r] ?? Jn[r], !n || typeof n != "function") throw Error(`Unknown function helper '${r}'.`);
|
|
3888
3880
|
}
|
|
3889
3881
|
if (!n) throw Error("Invalid function invocation target.");
|
|
3890
3882
|
let i = await Promise.all(e.arguments.map((e) => this.evalNodeAsync(e, t)));
|
|
@@ -3943,7 +3935,7 @@ var Zn = class {
|
|
|
3943
3935
|
};
|
|
3944
3936
|
//#endregion
|
|
3945
3937
|
//#region src/parser/matrix-expander.ts
|
|
3946
|
-
function
|
|
3938
|
+
function Zn(e) {
|
|
3947
3939
|
if (!e.matrix || Object.keys(e.matrix).length === 0) return [e];
|
|
3948
3940
|
let t = e.matrix;
|
|
3949
3941
|
return Object.keys(t).reduce((e, n) => {
|
|
@@ -3970,18 +3962,18 @@ function Qn(e) {
|
|
|
3970
3962
|
}
|
|
3971
3963
|
//#endregion
|
|
3972
3964
|
//#region src/secret-repository.ts
|
|
3973
|
-
function
|
|
3965
|
+
function Qn() {
|
|
3974
3966
|
let e = process.env.CREDENTIALS_DIRECTORY ? `${process.env.CREDENTIALS_DIRECTORY}/on-master-key` : "", t = process.env.RUNNER_MASTER_KEY || (e ? n(e, "utf8").trim() : "");
|
|
3975
3967
|
if (!t) throw Error("RUNNER_MASTER_KEY or systemd credential on-master-key is required for secrets");
|
|
3976
3968
|
return u.createHash("sha256").update(t).digest();
|
|
3977
3969
|
}
|
|
3978
|
-
var
|
|
3970
|
+
var $n = class {
|
|
3979
3971
|
key;
|
|
3980
3972
|
async init() {
|
|
3981
3973
|
await C.exec("CREATE TABLE IF NOT EXISTS secrets (\n name TEXT PRIMARY KEY, ciphertext TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP\n )");
|
|
3982
3974
|
}
|
|
3983
3975
|
encryptionKey() {
|
|
3984
|
-
return this.key ||=
|
|
3976
|
+
return this.key ||= Qn();
|
|
3985
3977
|
}
|
|
3986
3978
|
async set(e, t) {
|
|
3987
3979
|
if (!/^[A-Z][A-Z0-9_]*$/.test(e)) throw Error("Secret names must be uppercase letters, numbers, and underscores");
|
|
@@ -4007,7 +3999,7 @@ var er = class {
|
|
|
4007
3999
|
let t = Buffer.from(e, "base64"), n = u.createDecipheriv("aes-256-gcm", this.encryptionKey(), t.subarray(0, 12));
|
|
4008
4000
|
return n.setAuthTag(t.subarray(12, 28)), Buffer.concat([n.update(t.subarray(28)), n.final()]).toString("utf8");
|
|
4009
4001
|
}
|
|
4010
|
-
},
|
|
4002
|
+
}, er = class {
|
|
4011
4003
|
config;
|
|
4012
4004
|
constructor(e) {
|
|
4013
4005
|
this.config = e;
|
|
@@ -4054,7 +4046,7 @@ var er = class {
|
|
|
4054
4046
|
};
|
|
4055
4047
|
//#endregion
|
|
4056
4048
|
//#region node_modules/.pnpm/marked@18.0.11/node_modules/marked/lib/marked.esm.js
|
|
4057
|
-
function
|
|
4049
|
+
function tr() {
|
|
4058
4050
|
return {
|
|
4059
4051
|
async: !1,
|
|
4060
4052
|
breaks: !1,
|
|
@@ -4068,12 +4060,12 @@ function nr() {
|
|
|
4068
4060
|
walkTokens: null
|
|
4069
4061
|
};
|
|
4070
4062
|
}
|
|
4071
|
-
var
|
|
4072
|
-
function
|
|
4073
|
-
|
|
4063
|
+
var nr = tr();
|
|
4064
|
+
function rr(e) {
|
|
4065
|
+
nr = e;
|
|
4074
4066
|
}
|
|
4075
|
-
var
|
|
4076
|
-
function
|
|
4067
|
+
var ir = { exec: () => null };
|
|
4068
|
+
function ar(e) {
|
|
4077
4069
|
let t = [];
|
|
4078
4070
|
return (n) => {
|
|
4079
4071
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -4090,7 +4082,7 @@ function H(e, t = "") {
|
|
|
4090
4082
|
};
|
|
4091
4083
|
return r;
|
|
4092
4084
|
}
|
|
4093
|
-
var
|
|
4085
|
+
var or = ((e = "") => {
|
|
4094
4086
|
try {
|
|
4095
4087
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
4096
4088
|
} catch {
|
|
@@ -4147,105 +4139,105 @@ var sr = ((e = "") => {
|
|
|
4147
4139
|
notSpaceStart: /^\S*/,
|
|
4148
4140
|
endingNewline: /\n$/,
|
|
4149
4141
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
4150
|
-
nextBulletRegex:
|
|
4151
|
-
hrRegex:
|
|
4152
|
-
fencesBeginRegex:
|
|
4153
|
-
headingBeginRegex:
|
|
4154
|
-
htmlBeginRegex:
|
|
4155
|
-
blockquoteBeginRegex:
|
|
4156
|
-
},
|
|
4157
|
-
blockquote: H(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
4158
|
-
code:
|
|
4159
|
-
def:
|
|
4160
|
-
fences:
|
|
4161
|
-
heading:
|
|
4162
|
-
hr:
|
|
4163
|
-
html:
|
|
4142
|
+
nextBulletRegex: ar((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
4143
|
+
hrRegex: ar((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
|
|
4144
|
+
fencesBeginRegex: ar((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
4145
|
+
headingBeginRegex: ar((e) => RegExp(`^ {0,${e}}#`)),
|
|
4146
|
+
htmlBeginRegex: ar((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
|
|
4147
|
+
blockquoteBeginRegex: ar((e) => RegExp(`^ {0,${e}}>`))
|
|
4148
|
+
}, sr = /^(?:[ \t]*(?:\n|$))+/, cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, lr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ur = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, dr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, fr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, pr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, mr = H(pr).replace(/bull/g, fr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), hr = H(pr).replace(/bull/g, fr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), gr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, _r = /^[^\n]+/, vr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, yr = H(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", vr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), br = H(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, fr).getRegex(), xr = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Sr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Cr = H("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Sr).replace("tag", xr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), wr = (e) => H(gr).replace("hr", ur).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", xr).getRegex(), Tr = wr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Er = wr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Dr = {
|
|
4149
|
+
blockquote: H(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Er).getRegex(),
|
|
4150
|
+
code: cr,
|
|
4151
|
+
def: yr,
|
|
4152
|
+
fences: lr,
|
|
4153
|
+
heading: dr,
|
|
4154
|
+
hr: ur,
|
|
4155
|
+
html: Cr,
|
|
4156
|
+
lheading: mr,
|
|
4157
|
+
list: br,
|
|
4158
|
+
newline: sr,
|
|
4159
|
+
paragraph: Tr,
|
|
4160
|
+
table: ir,
|
|
4161
|
+
text: _r
|
|
4162
|
+
}, Or = H("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ur).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", xr).getRegex(), kr = {
|
|
4163
|
+
...Dr,
|
|
4164
4164
|
lheading: hr,
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
}, kr = H("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", dr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Sr).getRegex(), Ar = {
|
|
4171
|
-
...Or,
|
|
4172
|
-
lheading: gr,
|
|
4173
|
-
table: kr,
|
|
4174
|
-
paragraph: H(_r).replace("hr", dr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", kr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Sr).getRegex()
|
|
4175
|
-
}, jr = {
|
|
4176
|
-
...Or,
|
|
4177
|
-
html: H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Cr).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
4165
|
+
table: Or,
|
|
4166
|
+
paragraph: H(gr).replace("hr", ur).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Or).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", xr).getRegex()
|
|
4167
|
+
}, Ar = {
|
|
4168
|
+
...Dr,
|
|
4169
|
+
html: H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Sr).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
4178
4170
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
4179
4171
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
4180
|
-
fences:
|
|
4172
|
+
fences: ir,
|
|
4181
4173
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
4182
|
-
paragraph: H(
|
|
4183
|
-
},
|
|
4184
|
-
_backpedal:
|
|
4185
|
-
anyPunctuation:
|
|
4186
|
-
autolink:
|
|
4187
|
-
blockSkip:
|
|
4188
|
-
br:
|
|
4189
|
-
code:
|
|
4190
|
-
del:
|
|
4191
|
-
delLDelim:
|
|
4192
|
-
delRDelim:
|
|
4193
|
-
emStrongLDelim:
|
|
4194
|
-
emStrongRDelimAst:
|
|
4174
|
+
paragraph: H(gr).replace("hr", ur).replace("heading", " *#{1,6} *[^\n]").replace("lheading", mr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
4175
|
+
}, jr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Nr = /^( {2,}|\\)\n(?!\s*$)/, Pr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Fr = /[\p{P}\p{S}]/u, Ir = /[\s\p{P}\p{S}]/u, Lr = /[^\s\p{P}\p{S}]/u, Rr = H(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ir).getRegex(), zr = /[\p{Pi}\p{Ps}"']/u, Br = /(?!~)[\p{P}\p{S}]/u, Vr = /(?!~)[\s\p{P}\p{S}]/u, Hr = /(?:[^\s\p{P}\p{S}]|~)/u, Ur = H(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", or ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Wr = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Gr = H(Wr, "u").replace(/punct/g, Fr).getRegex(), Kr = H(Wr, "u").replace(/punct/g, Br).getRegex(), qr = H(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, zr).replace(/punct/g, Fr).getRegex(), Jr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Yr = H(Jr, "gu").replace(/notPunctSpace/g, Lr).replace(/punctSpace/g, Ir).replace(/punct/g, Fr).getRegex(), Xr = H(Jr, "gu").replace(/notPunctSpace/g, Hr).replace(/punctSpace/g, Vr).replace(/punct/g, Br).getRegex(), Zr = H("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Lr).replace(/punctSpace/g, Ir).replace(/punct/g, Fr).getRegex(), Qr = H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Lr).replace(/punctSpace/g, Ir).replace(/punct/g, Fr).getRegex(), $r = H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Lr).replace(/punctSpace/g, Ir).replace(/punct/g, Fr).getRegex(), ei = H(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Fr).getRegex(), ti = H("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Lr).replace(/punctSpace/g, Ir).replace(/punct/g, Fr).getRegex(), ni = H(/\\(punct)/, "gu").replace(/punct/g, Fr).getRegex(), ri = H(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ii = H(Sr).replace("(?:-->|$)", "-->").getRegex(), ai = H("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ii).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), oi = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, si = H(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", oi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ci = H(/^!?\[(label)\]\[(ref)\]/).replace("label", oi).replace("ref", vr).getRegex(), li = H(/^!?\[(ref)\](?:\[\])?/).replace("ref", vr).getRegex(), ui = H("reflink|nolink(?!\\()", "g").replace("reflink", ci).replace("nolink", li).getRegex(), di = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, fi = {
|
|
4176
|
+
_backpedal: ir,
|
|
4177
|
+
anyPunctuation: ni,
|
|
4178
|
+
autolink: ri,
|
|
4179
|
+
blockSkip: Ur,
|
|
4180
|
+
br: Nr,
|
|
4181
|
+
code: Mr,
|
|
4182
|
+
del: ir,
|
|
4183
|
+
delLDelim: ir,
|
|
4184
|
+
delRDelim: ir,
|
|
4185
|
+
emStrongLDelim: Gr,
|
|
4186
|
+
emStrongRDelimAst: Yr,
|
|
4187
|
+
emStrongRDelimUnd: Qr,
|
|
4188
|
+
escape: jr,
|
|
4189
|
+
link: si,
|
|
4190
|
+
nolink: li,
|
|
4191
|
+
punctuation: Rr,
|
|
4192
|
+
reflink: ci,
|
|
4193
|
+
reflinkSearch: ui,
|
|
4194
|
+
tag: ai,
|
|
4195
|
+
text: Pr,
|
|
4196
|
+
url: ir
|
|
4197
|
+
}, pi = {
|
|
4198
|
+
...fi,
|
|
4199
|
+
emStrongLDelim: qr,
|
|
4200
|
+
emStrongRDelimAst: Zr,
|
|
4195
4201
|
emStrongRDelimUnd: $r,
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
nolink: ui,
|
|
4199
|
-
punctuation: zr,
|
|
4200
|
-
reflink: li,
|
|
4201
|
-
reflinkSearch: di,
|
|
4202
|
-
tag: oi,
|
|
4203
|
-
text: Fr,
|
|
4204
|
-
url: ar
|
|
4202
|
+
link: H(/^!?\[(label)\]\((.*?)\)/).replace("label", oi).getRegex(),
|
|
4203
|
+
reflink: H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", oi).getRegex()
|
|
4205
4204
|
}, mi = {
|
|
4206
|
-
...
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
}, hi = {
|
|
4213
|
-
...pi,
|
|
4214
|
-
emStrongRDelimAst: Zr,
|
|
4215
|
-
emStrongLDelim: qr,
|
|
4216
|
-
delLDelim: ti,
|
|
4217
|
-
delRDelim: ni,
|
|
4218
|
-
url: H(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", fi).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
4205
|
+
...fi,
|
|
4206
|
+
emStrongRDelimAst: Xr,
|
|
4207
|
+
emStrongLDelim: Kr,
|
|
4208
|
+
delLDelim: ei,
|
|
4209
|
+
delRDelim: ti,
|
|
4210
|
+
url: H(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", di).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
4219
4211
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
4220
4212
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
4221
|
-
text: H(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",
|
|
4213
|
+
text: H(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", di).getRegex()
|
|
4214
|
+
}, hi = {
|
|
4215
|
+
...mi,
|
|
4216
|
+
br: H(Nr).replace("{2,}", "*").getRegex(),
|
|
4217
|
+
text: H(mi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
4222
4218
|
}, gi = {
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4219
|
+
normal: Dr,
|
|
4220
|
+
gfm: kr,
|
|
4221
|
+
pedantic: Ar
|
|
4226
4222
|
}, _i = {
|
|
4227
|
-
normal:
|
|
4228
|
-
gfm:
|
|
4229
|
-
|
|
4223
|
+
normal: fi,
|
|
4224
|
+
gfm: mi,
|
|
4225
|
+
breaks: hi,
|
|
4226
|
+
pedantic: pi
|
|
4230
4227
|
}, vi = {
|
|
4231
|
-
normal: pi,
|
|
4232
|
-
gfm: hi,
|
|
4233
|
-
breaks: gi,
|
|
4234
|
-
pedantic: mi
|
|
4235
|
-
}, yi = {
|
|
4236
4228
|
"&": "&",
|
|
4237
4229
|
"<": "<",
|
|
4238
4230
|
">": ">",
|
|
4239
4231
|
"\"": """,
|
|
4240
4232
|
"'": "'"
|
|
4241
|
-
},
|
|
4242
|
-
function
|
|
4233
|
+
}, yi = (e) => vi[e];
|
|
4234
|
+
function bi(e, t) {
|
|
4243
4235
|
if (t) {
|
|
4244
|
-
if (U.escapeTest.test(e)) return e.replace(U.escapeReplace,
|
|
4245
|
-
} else if (U.escapeTestNoEncode.test(e)) return e.replace(U.escapeReplaceNoEncode,
|
|
4236
|
+
if (U.escapeTest.test(e)) return e.replace(U.escapeReplace, yi);
|
|
4237
|
+
} else if (U.escapeTestNoEncode.test(e)) return e.replace(U.escapeReplaceNoEncode, yi);
|
|
4246
4238
|
return e;
|
|
4247
4239
|
}
|
|
4248
|
-
function
|
|
4240
|
+
function xi(e) {
|
|
4249
4241
|
try {
|
|
4250
4242
|
e = encodeURI(e).replace(U.percentDecode, "%");
|
|
4251
4243
|
} catch {
|
|
@@ -4253,7 +4245,7 @@ function Si(e) {
|
|
|
4253
4245
|
}
|
|
4254
4246
|
return e;
|
|
4255
4247
|
}
|
|
4256
|
-
function
|
|
4248
|
+
function Si(e, t) {
|
|
4257
4249
|
let n = e.replace(U.findPipe, (e, t, n) => {
|
|
4258
4250
|
let r = !1, i = t;
|
|
4259
4251
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -4266,7 +4258,7 @@ function Ci(e, t) {
|
|
|
4266
4258
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(U.slashPipe, "|");
|
|
4267
4259
|
return n;
|
|
4268
4260
|
}
|
|
4269
|
-
function
|
|
4261
|
+
function Ci(e, t, n) {
|
|
4270
4262
|
let r = e.length;
|
|
4271
4263
|
if (r === 0) return "";
|
|
4272
4264
|
let i = 0;
|
|
@@ -4278,12 +4270,12 @@ function wi(e, t, n) {
|
|
|
4278
4270
|
}
|
|
4279
4271
|
return e.slice(0, r - i);
|
|
4280
4272
|
}
|
|
4281
|
-
function
|
|
4273
|
+
function wi(e) {
|
|
4282
4274
|
let t = e.split("\n"), n = t.length - 1;
|
|
4283
4275
|
for (; n >= 0 && U.blankLine.test(t[n]);) n--;
|
|
4284
4276
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
4285
4277
|
}
|
|
4286
|
-
function
|
|
4278
|
+
function Ti(e, t) {
|
|
4287
4279
|
if (e.indexOf(t[1]) === -1) return -1;
|
|
4288
4280
|
let n = 0;
|
|
4289
4281
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -4291,7 +4283,7 @@ function Ei(e, t) {
|
|
|
4291
4283
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
4292
4284
|
return n > 0 ? -2 : -1;
|
|
4293
4285
|
}
|
|
4294
|
-
function
|
|
4286
|
+
function Ei(e, t = 0) {
|
|
4295
4287
|
let n = t, r = "";
|
|
4296
4288
|
for (let t of e) if (t === " ") {
|
|
4297
4289
|
let e = 4 - n % 4;
|
|
@@ -4299,7 +4291,7 @@ function Di(e, t = 0) {
|
|
|
4299
4291
|
} else r += t, n++;
|
|
4300
4292
|
return r;
|
|
4301
4293
|
}
|
|
4302
|
-
function
|
|
4294
|
+
function Di(e, t, n, r, i) {
|
|
4303
4295
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
|
|
4304
4296
|
r.state.inLink = !0;
|
|
4305
4297
|
let l = r.state.linkEmitted, u = r.state.inRawBlock;
|
|
@@ -4321,7 +4313,7 @@ function Oi(e, t, n, r, i) {
|
|
|
4321
4313
|
tokens: d
|
|
4322
4314
|
};
|
|
4323
4315
|
}
|
|
4324
|
-
function
|
|
4316
|
+
function Oi(e, t, n) {
|
|
4325
4317
|
let r = e.match(n.other.indentCodeCompensation);
|
|
4326
4318
|
if (r === null) return t;
|
|
4327
4319
|
let i = r[1];
|
|
@@ -4332,12 +4324,12 @@ function ki(e, t, n) {
|
|
|
4332
4324
|
return r.length >= i.length ? e.slice(i.length) : e;
|
|
4333
4325
|
}).join("\n");
|
|
4334
4326
|
}
|
|
4335
|
-
var
|
|
4327
|
+
var ki = class {
|
|
4336
4328
|
options;
|
|
4337
4329
|
rules;
|
|
4338
4330
|
lexer;
|
|
4339
4331
|
constructor(e) {
|
|
4340
|
-
this.options = e ||
|
|
4332
|
+
this.options = e || nr;
|
|
4341
4333
|
}
|
|
4342
4334
|
space(e) {
|
|
4343
4335
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -4349,7 +4341,7 @@ var Ai = class {
|
|
|
4349
4341
|
code(e) {
|
|
4350
4342
|
let t = this.rules.block.code.exec(e);
|
|
4351
4343
|
if (t) {
|
|
4352
|
-
let e = this.options.pedantic ? t[0] :
|
|
4344
|
+
let e = this.options.pedantic ? t[0] : wi(t[0]);
|
|
4353
4345
|
return {
|
|
4354
4346
|
type: "code",
|
|
4355
4347
|
raw: e,
|
|
@@ -4361,7 +4353,7 @@ var Ai = class {
|
|
|
4361
4353
|
fences(e) {
|
|
4362
4354
|
let t = this.rules.block.fences.exec(e);
|
|
4363
4355
|
if (t) {
|
|
4364
|
-
let e = t[0], n =
|
|
4356
|
+
let e = t[0], n = Oi(e, t[3] || "", this.rules);
|
|
4365
4357
|
return {
|
|
4366
4358
|
type: "code",
|
|
4367
4359
|
raw: e,
|
|
@@ -4375,12 +4367,12 @@ var Ai = class {
|
|
|
4375
4367
|
if (t) {
|
|
4376
4368
|
let e = t[2].trim();
|
|
4377
4369
|
if (this.rules.other.endingHash.test(e)) {
|
|
4378
|
-
let t =
|
|
4370
|
+
let t = Ci(e, "#");
|
|
4379
4371
|
(this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
|
|
4380
4372
|
}
|
|
4381
4373
|
return {
|
|
4382
4374
|
type: "heading",
|
|
4383
|
-
raw:
|
|
4375
|
+
raw: Ci(t[0], "\n"),
|
|
4384
4376
|
depth: t[1].length,
|
|
4385
4377
|
text: e,
|
|
4386
4378
|
tokens: this.lexer.inline(e)
|
|
@@ -4391,13 +4383,13 @@ var Ai = class {
|
|
|
4391
4383
|
let t = this.rules.block.hr.exec(e);
|
|
4392
4384
|
if (t) return {
|
|
4393
4385
|
type: "hr",
|
|
4394
|
-
raw:
|
|
4386
|
+
raw: Ci(t[0], "\n")
|
|
4395
4387
|
};
|
|
4396
4388
|
}
|
|
4397
4389
|
blockquote(e) {
|
|
4398
4390
|
let t = this.rules.block.blockquote.exec(e);
|
|
4399
4391
|
if (t) {
|
|
4400
|
-
let e =
|
|
4392
|
+
let e = Ci(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
4401
4393
|
for (; e.length > 0;) {
|
|
4402
4394
|
let t = !1, a = [], o;
|
|
4403
4395
|
for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -4449,7 +4441,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4449
4441
|
let n = !1, r = "", s = "";
|
|
4450
4442
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
4451
4443
|
r = t[0], e = e.substring(r.length);
|
|
4452
|
-
let c =
|
|
4444
|
+
let c = Ei(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
|
|
4453
4445
|
if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
|
|
4454
4446
|
let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
|
|
4455
4447
|
for (; e;) {
|
|
@@ -4514,7 +4506,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4514
4506
|
html(e) {
|
|
4515
4507
|
let t = this.rules.block.html.exec(e);
|
|
4516
4508
|
if (t) {
|
|
4517
|
-
let e =
|
|
4509
|
+
let e = wi(t[0]);
|
|
4518
4510
|
return {
|
|
4519
4511
|
type: "html",
|
|
4520
4512
|
block: !0,
|
|
@@ -4531,7 +4523,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4531
4523
|
return {
|
|
4532
4524
|
type: "def",
|
|
4533
4525
|
tag: e,
|
|
4534
|
-
raw:
|
|
4526
|
+
raw: Ci(t[0], "\n"),
|
|
4535
4527
|
href: n,
|
|
4536
4528
|
title: r
|
|
4537
4529
|
};
|
|
@@ -4540,9 +4532,9 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4540
4532
|
table(e) {
|
|
4541
4533
|
let t = this.rules.block.table.exec(e);
|
|
4542
4534
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
4543
|
-
let n =
|
|
4535
|
+
let n = Si(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
|
|
4544
4536
|
type: "table",
|
|
4545
|
-
raw:
|
|
4537
|
+
raw: Ci(t[0], "\n"),
|
|
4546
4538
|
header: [],
|
|
4547
4539
|
align: [],
|
|
4548
4540
|
rows: []
|
|
@@ -4555,7 +4547,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4555
4547
|
header: !0,
|
|
4556
4548
|
align: a.align[e]
|
|
4557
4549
|
});
|
|
4558
|
-
for (let e of i) a.rows.push(
|
|
4550
|
+
for (let e of i) a.rows.push(Si(e, a.header.length).map((e, t) => ({
|
|
4559
4551
|
text: e,
|
|
4560
4552
|
tokens: this.lexer.inline(e),
|
|
4561
4553
|
header: !1,
|
|
@@ -4570,7 +4562,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4570
4562
|
let e = t[1].trim();
|
|
4571
4563
|
return {
|
|
4572
4564
|
type: "heading",
|
|
4573
|
-
raw:
|
|
4565
|
+
raw: Ci(t[0], "\n"),
|
|
4574
4566
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
4575
4567
|
text: e,
|
|
4576
4568
|
tokens: this.lexer.inline(e)
|
|
@@ -4623,10 +4615,10 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4623
4615
|
let e = t[2].trim();
|
|
4624
4616
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
|
|
4625
4617
|
if (!this.rules.other.endAngleBracket.test(e)) return;
|
|
4626
|
-
let t =
|
|
4618
|
+
let t = Ci(e.slice(0, -1), "\\");
|
|
4627
4619
|
if ((e.length - t.length) % 2 == 0) return;
|
|
4628
4620
|
} else {
|
|
4629
|
-
let e =
|
|
4621
|
+
let e = Ti(t[2], "()");
|
|
4630
4622
|
if (e === -2) return;
|
|
4631
4623
|
if (e > -1) {
|
|
4632
4624
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -4638,7 +4630,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4638
4630
|
let e = this.rules.other.pedanticHrefTitle.exec(n);
|
|
4639
4631
|
e && (n = e[1], r = e[3]);
|
|
4640
4632
|
} else r = t[3] ? t[3].slice(1, -1) : "";
|
|
4641
|
-
return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)),
|
|
4633
|
+
return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Di(t, {
|
|
4642
4634
|
href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
4643
4635
|
title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
|
|
4644
4636
|
}, t[0], this.lexer, this.rules);
|
|
@@ -4656,7 +4648,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4656
4648
|
text: e
|
|
4657
4649
|
};
|
|
4658
4650
|
}
|
|
4659
|
-
return
|
|
4651
|
+
return Di(n, e, n[0], this.lexer, this.rules);
|
|
4660
4652
|
}
|
|
4661
4653
|
}
|
|
4662
4654
|
emStrong(e, t, n = "") {
|
|
@@ -4792,14 +4784,14 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4792
4784
|
};
|
|
4793
4785
|
}
|
|
4794
4786
|
}
|
|
4795
|
-
},
|
|
4787
|
+
}, Ai = class e {
|
|
4796
4788
|
tokens;
|
|
4797
4789
|
options;
|
|
4798
4790
|
state;
|
|
4799
4791
|
inlineQueue;
|
|
4800
4792
|
tokenizer;
|
|
4801
4793
|
constructor(e) {
|
|
4802
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
4794
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || nr, this.options.tokenizer = this.options.tokenizer || new ki(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
4803
4795
|
inLink: !1,
|
|
4804
4796
|
inRawBlock: !1,
|
|
4805
4797
|
linkEmitted: !1,
|
|
@@ -4807,15 +4799,15 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
4807
4799
|
};
|
|
4808
4800
|
let t = {
|
|
4809
4801
|
other: U,
|
|
4810
|
-
block:
|
|
4811
|
-
inline:
|
|
4802
|
+
block: gi.normal,
|
|
4803
|
+
inline: _i.normal
|
|
4812
4804
|
};
|
|
4813
|
-
this.options.pedantic ? (t.block =
|
|
4805
|
+
this.options.pedantic ? (t.block = gi.pedantic, t.inline = _i.pedantic) : this.options.gfm && (t.block = gi.gfm, t.inline = this.options.breaks ? _i.breaks : _i.gfm), this.tokenizer.rules = t;
|
|
4814
4806
|
}
|
|
4815
4807
|
static get rules() {
|
|
4816
4808
|
return {
|
|
4817
|
-
block:
|
|
4818
|
-
inline:
|
|
4809
|
+
block: gi,
|
|
4810
|
+
inline: _i
|
|
4819
4811
|
};
|
|
4820
4812
|
}
|
|
4821
4813
|
static lex(t, n) {
|
|
@@ -5033,18 +5025,18 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
5033
5025
|
if (this.options.silent) console.error(t);
|
|
5034
5026
|
else throw Error(t);
|
|
5035
5027
|
}
|
|
5036
|
-
},
|
|
5028
|
+
}, ji = class {
|
|
5037
5029
|
options;
|
|
5038
5030
|
parser;
|
|
5039
5031
|
constructor(e) {
|
|
5040
|
-
this.options = e ||
|
|
5032
|
+
this.options = e || nr;
|
|
5041
5033
|
}
|
|
5042
5034
|
space(e) {
|
|
5043
5035
|
return "";
|
|
5044
5036
|
}
|
|
5045
5037
|
code({ text: e, lang: t, escaped: n }) {
|
|
5046
5038
|
let r = (t || "").match(U.notSpaceStart)?.[0], i = e.replace(U.endingNewline, "") + "\n";
|
|
5047
|
-
return r ? "<pre><code class=\"language-" +
|
|
5039
|
+
return r ? "<pre><code class=\"language-" + bi(r) + "\">" + (n ? i : bi(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : bi(i, !0)) + "</code></pre>\n";
|
|
5048
5040
|
}
|
|
5049
5041
|
blockquote({ tokens: e }) {
|
|
5050
5042
|
return `<blockquote>
|
|
@@ -5114,7 +5106,7 @@ ${e}</tr>
|
|
|
5114
5106
|
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
5115
5107
|
}
|
|
5116
5108
|
codespan({ text: e }) {
|
|
5117
|
-
return `<code>${
|
|
5109
|
+
return `<code>${bi(e, !0)}</code>`;
|
|
5118
5110
|
}
|
|
5119
5111
|
br(e) {
|
|
5120
5112
|
return "<br>";
|
|
@@ -5123,24 +5115,24 @@ ${e}</tr>
|
|
|
5123
5115
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
5124
5116
|
}
|
|
5125
5117
|
link({ href: e, title: t, tokens: n }) {
|
|
5126
|
-
let r = this.parser.parseInline(n), i =
|
|
5118
|
+
let r = this.parser.parseInline(n), i = xi(e);
|
|
5127
5119
|
if (i === null) return r;
|
|
5128
5120
|
e = i;
|
|
5129
5121
|
let a = "<a href=\"" + e + "\"";
|
|
5130
|
-
return t && (a += " title=\"" +
|
|
5122
|
+
return t && (a += " title=\"" + bi(t) + "\""), a += ">" + r + "</a>", a;
|
|
5131
5123
|
}
|
|
5132
5124
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
5133
5125
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
5134
|
-
let i =
|
|
5135
|
-
if (i === null) return
|
|
5126
|
+
let i = xi(e);
|
|
5127
|
+
if (i === null) return bi(n);
|
|
5136
5128
|
e = i;
|
|
5137
|
-
let a = `<img src="${e}" alt="${
|
|
5138
|
-
return t && (a += ` title="${
|
|
5129
|
+
let a = `<img src="${e}" alt="${bi(n)}"`;
|
|
5130
|
+
return t && (a += ` title="${bi(t)}"`), a += ">", a;
|
|
5139
5131
|
}
|
|
5140
5132
|
text(e) {
|
|
5141
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text :
|
|
5133
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : bi(e.text);
|
|
5142
5134
|
}
|
|
5143
|
-
},
|
|
5135
|
+
}, Mi = class {
|
|
5144
5136
|
strong({ text: e }) {
|
|
5145
5137
|
return e;
|
|
5146
5138
|
}
|
|
@@ -5171,12 +5163,12 @@ ${e}</tr>
|
|
|
5171
5163
|
checkbox({ raw: e }) {
|
|
5172
5164
|
return e;
|
|
5173
5165
|
}
|
|
5174
|
-
},
|
|
5166
|
+
}, Ni = class e {
|
|
5175
5167
|
options;
|
|
5176
5168
|
renderer;
|
|
5177
5169
|
textRenderer;
|
|
5178
5170
|
constructor(e) {
|
|
5179
|
-
this.options = e ||
|
|
5171
|
+
this.options = e || nr, this.options.renderer = this.options.renderer || new ji(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Mi();
|
|
5180
5172
|
}
|
|
5181
5173
|
static parse(t, n) {
|
|
5182
5174
|
return new e(n).parse(t);
|
|
@@ -5324,11 +5316,11 @@ ${e}</tr>
|
|
|
5324
5316
|
}
|
|
5325
5317
|
return n;
|
|
5326
5318
|
}
|
|
5327
|
-
},
|
|
5319
|
+
}, Pi = class {
|
|
5328
5320
|
options;
|
|
5329
5321
|
block;
|
|
5330
5322
|
constructor(e) {
|
|
5331
|
-
this.options = e ||
|
|
5323
|
+
this.options = e || nr;
|
|
5332
5324
|
}
|
|
5333
5325
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
5334
5326
|
"preprocess",
|
|
@@ -5354,22 +5346,22 @@ ${e}</tr>
|
|
|
5354
5346
|
return e;
|
|
5355
5347
|
}
|
|
5356
5348
|
provideLexer(e = this.block) {
|
|
5357
|
-
return e ?
|
|
5349
|
+
return e ? Ai.lex : Ai.lexInline;
|
|
5358
5350
|
}
|
|
5359
5351
|
provideParser(e = this.block) {
|
|
5360
|
-
return e ?
|
|
5352
|
+
return e ? Ni.parse : Ni.parseInline;
|
|
5361
5353
|
}
|
|
5362
|
-
},
|
|
5363
|
-
defaults =
|
|
5354
|
+
}, Fi = new class {
|
|
5355
|
+
defaults = tr();
|
|
5364
5356
|
options = this.setOptions;
|
|
5365
5357
|
parse = this.parseMarkdown(!0);
|
|
5366
5358
|
parseInline = this.parseMarkdown(!1);
|
|
5367
|
-
Parser =
|
|
5368
|
-
Renderer =
|
|
5369
|
-
TextRenderer =
|
|
5370
|
-
Lexer =
|
|
5371
|
-
Tokenizer =
|
|
5372
|
-
Hooks =
|
|
5359
|
+
Parser = Ni;
|
|
5360
|
+
Renderer = ji;
|
|
5361
|
+
TextRenderer = Mi;
|
|
5362
|
+
Lexer = Ai;
|
|
5363
|
+
Tokenizer = ki;
|
|
5364
|
+
Hooks = Pi;
|
|
5373
5365
|
constructor(...e) {
|
|
5374
5366
|
this.use(...e);
|
|
5375
5367
|
}
|
|
@@ -5420,7 +5412,7 @@ ${e}</tr>
|
|
|
5420
5412
|
}
|
|
5421
5413
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
5422
5414
|
}), n.extensions = t), e.renderer) {
|
|
5423
|
-
let t = this.defaults.renderer || new
|
|
5415
|
+
let t = this.defaults.renderer || new ji(this.defaults);
|
|
5424
5416
|
for (let n in e.renderer) {
|
|
5425
5417
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
5426
5418
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -5433,7 +5425,7 @@ ${e}</tr>
|
|
|
5433
5425
|
n.renderer = t;
|
|
5434
5426
|
}
|
|
5435
5427
|
if (e.tokenizer) {
|
|
5436
|
-
let t = this.defaults.tokenizer || new
|
|
5428
|
+
let t = this.defaults.tokenizer || new ki(this.defaults);
|
|
5437
5429
|
for (let n in e.tokenizer) {
|
|
5438
5430
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
5439
5431
|
if ([
|
|
@@ -5450,13 +5442,13 @@ ${e}</tr>
|
|
|
5450
5442
|
n.tokenizer = t;
|
|
5451
5443
|
}
|
|
5452
5444
|
if (e.hooks) {
|
|
5453
|
-
let t = this.defaults.hooks || new
|
|
5445
|
+
let t = this.defaults.hooks || new Pi();
|
|
5454
5446
|
for (let n in e.hooks) {
|
|
5455
5447
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
5456
5448
|
if (["options", "block"].includes(n)) continue;
|
|
5457
5449
|
let r = n, i = e.hooks[r], a = t[r];
|
|
5458
|
-
t[r] =
|
|
5459
|
-
if (this.defaults.async &&
|
|
5450
|
+
t[r] = Pi.passThroughHooks.has(n) ? (e) => {
|
|
5451
|
+
if (this.defaults.async && Pi.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
5460
5452
|
let n = await i.call(t, e);
|
|
5461
5453
|
return a.call(t, n);
|
|
5462
5454
|
})();
|
|
@@ -5493,10 +5485,10 @@ ${e}</tr>
|
|
|
5493
5485
|
}, this;
|
|
5494
5486
|
}
|
|
5495
5487
|
lexer(e, t) {
|
|
5496
|
-
return
|
|
5488
|
+
return Ai.lex(e, t ?? this.defaults);
|
|
5497
5489
|
}
|
|
5498
5490
|
parser(e, t) {
|
|
5499
|
-
return
|
|
5491
|
+
return Ni.parse(e, t ?? this.defaults);
|
|
5500
5492
|
}
|
|
5501
5493
|
parseMarkdown(e) {
|
|
5502
5494
|
return (t, n) => {
|
|
@@ -5508,16 +5500,16 @@ ${e}</tr>
|
|
|
5508
5500
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
5509
5501
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
5510
5502
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
5511
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
5503
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Ai.lex : Ai.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
5512
5504
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
5513
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
5505
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? Ni.parse : Ni.parseInline)(a, i);
|
|
5514
5506
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
5515
5507
|
})().catch(a);
|
|
5516
5508
|
try {
|
|
5517
5509
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
5518
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
5510
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Ai.lex : Ai.lexInline)(t, i);
|
|
5519
5511
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
5520
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
5512
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? Ni.parse : Ni.parseInline)(n, i);
|
|
5521
5513
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
5522
5514
|
} catch (e) {
|
|
5523
5515
|
return a(e);
|
|
@@ -5527,7 +5519,7 @@ ${e}</tr>
|
|
|
5527
5519
|
onError(e, t) {
|
|
5528
5520
|
return (n) => {
|
|
5529
5521
|
if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
|
|
5530
|
-
let e = "<p>An error occurred:</p><pre>" +
|
|
5522
|
+
let e = "<p>An error occurred:</p><pre>" + bi(n.message + "", !0) + "</pre>";
|
|
5531
5523
|
return t ? Promise.resolve(e) : e;
|
|
5532
5524
|
}
|
|
5533
5525
|
if (t) return Promise.reject(n);
|
|
@@ -5536,25 +5528,25 @@ ${e}</tr>
|
|
|
5536
5528
|
}
|
|
5537
5529
|
}();
|
|
5538
5530
|
function W(e, t) {
|
|
5539
|
-
return
|
|
5531
|
+
return Fi.parse(e, t);
|
|
5540
5532
|
}
|
|
5541
5533
|
W.options = W.setOptions = function(e) {
|
|
5542
|
-
return
|
|
5543
|
-
}, W.getDefaults =
|
|
5544
|
-
function
|
|
5545
|
-
return
|
|
5546
|
-
}
|
|
5547
|
-
W.use =
|
|
5548
|
-
return
|
|
5549
|
-
}, W.parseInline =
|
|
5534
|
+
return Fi.setOptions(e), W.defaults = Fi.defaults, rr(W.defaults), W;
|
|
5535
|
+
}, W.getDefaults = tr, W.defaults = nr;
|
|
5536
|
+
function Ii(...e) {
|
|
5537
|
+
return Fi.use(...e), W.defaults = Fi.defaults, rr(W.defaults), W;
|
|
5538
|
+
}
|
|
5539
|
+
W.use = Ii, W.walkTokens = function(e, t) {
|
|
5540
|
+
return Fi.walkTokens(e, t);
|
|
5541
|
+
}, W.parseInline = Fi.parseInline, W.Parser = Ni, W.parser = Ni.parse, W.Renderer = ji, W.TextRenderer = Mi, W.Lexer = Ai, W.lexer = Ai.lex, W.Tokenizer = ki, W.Hooks = Pi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, Ni.parse, Ai.lex;
|
|
5550
5542
|
//#endregion
|
|
5551
5543
|
//#region docs/workflow-syntax.md?raw
|
|
5552
|
-
var Ri = "# Workflow Documentation\n\nThis is the living documentation for workflow authors. It is organized using the four Diataxis modes:\n\n- **Tutorials** teach the shortest path to a working workflow.\n- **How-to guides** solve focused tasks.\n- **Reference** documents the accepted syntax.\n- **Explanation** describes execution and security decisions.\n\n## Tutorials\n\n### Your First Workflow\n\nCreate a draft in the authenticated workflow editor, or send the YAML to the API:\n\n```yaml\nname: Hello\n\non:\n generic: {}\n\nsteps:\n - id: greet\n name: Greet\n run: echo \"Hello ${inputs.name}\"\n```\n\nSave it, validate it, and publish it. Only published and enabled workflows receive webhook or scheduled events.\n\nThe `generic` provider accepts a JSON request body as `inputs`. For example:\n\n```bash\ncurl -X POST http://localhost:11235/webhooks/generic \\\n -H 'content-type: application/json' \\\n --data '{\"name\":\"Ada\"}'\n```\n\n### Build a GitHub Workflow\n\n```yaml\nname: Build\n\non:\n github:\n events: [push]\n owner: cloud-cli\n repo: on\n branches: [main]\n\nsteps:\n - id: checkout\n name: Checkout\n env:\n clone_url: ${inputs.clone_url}\n commit_sha: ${inputs.commit_sha}\n run: |\n git clone --depth 1 \"$clone_url\" .\n git checkout \"$commit_sha\"\n\n - id: test\n name: Test\n run: pnpm install && pnpm test\n```\n\nGitHub webhooks must be signed with the configured `GITHUB_WEBHOOK_SECRET`. The preprocessor exposes normalized inputs including `event`, `owner`, `repo`, `branch`, `tag`, `ref`, `full_name`, `clone_url`, `commit_sha`, `author`, `action`, `changes`, and the original `raw` body.\n\n## How-To Guides\n\n### Reference Another Environment Value\n\nEnvironment entries are evaluated from top to bottom. Earlier values are available through `env` to later values:\n\n```yaml\nenv:\n image: ${inputs.repo}\n image_tag: ${env.image}:latest\n artifact_name: ${env.image_tag}-${inputs.commit_sha}\n```\n\nWorkflow-level values are available to every step. Step-level `env` values are evaluated after workflow-level values and can override them for that step.\n\nUse `${inputs.name}`, `${env.NAME}`, `${secrets.NAME}`, and `${steps.step_id.outputs.value}` where the value is available. A value without `${...}` remains literal text.\n\n### Run a Container with a Host Volume\n\nUse `image` with `volumes`. A volume is passed directly to `docker run` as a `-v` mapping:\n\n```yaml\nsteps:\n - id: sign\n name: Sign release\n image: alpine:latest\n volumes:\n - /var/lib/runner/secrets-store:/secrets:ro\n run: |\n ./sign.sh /secrets/signing.key dist/release.tar.gz\n```\n\nThe source path is on the worker host. The destination path is inside the container. Use absolute host paths when a specific host directory is required. The workflow must be trusted because volume mappings can expose host data to a container.\n\nA single string is also accepted:\n\n```yaml\nvolumes: /var/lib/runner/secrets-store:/secrets:ro\n```\n\n### Pass Additional Docker Arguments\n\nUse `dockerArgs` for additional arguments to `docker run`, before the image name:\n\n```yaml\nsteps:\n - id: build\n image: docker:cli\n dockerArgs:\n - --network=host\n - --user=1000:1000\n run: docker build -t example:latest .\n```\n\nArguments are not interpreted or shell-expanded by the runner. They are passed as individual Docker CLI arguments.\n\n### Use a Matrix\n\nKeep the matrix in the workflow definition:\n\n```yaml\nname: Package\n\nmatrix:\n node: [18, 20]\n os: [ubuntu, alpine]\n\non:\n generic: {}\n\nenv:\n node_version: ${env.MATRIX_NODE}\n\nsteps:\n - id: package\n image: node:${env.MATRIX_NODE}\n run: npm pack\n```\n\nThe runner creates one job for every Cartesian combination. The example creates four jobs. Each variant receives `MATRIX_NODE` and `MATRIX_OS` environment variables.\n\n### Add a Scheduled Trigger\n\n```yaml\non:\n schedule:\n - id: nightly\n cron: '0 2 * * *'\n timezone: Europe/Berlin\n```\n\nCron expressions have five fields: minute, hour, day of month, month, and day of week. The scheduler uses the declared IANA timezone.\n\nSolar triggers use `sunrise` or `sunset` and geographic coordinates:\n\n```yaml\non:\n solar:\n - id: morning\n event: sunrise\n latitude: 52.52\n longitude: 13.405\n offset: +15m\n```\n\n### Use Secrets\n\nCreate a secret in the management UI or with the API, then reference it in environment values:\n\n```yaml\nsteps:\n - id: publish\n env:\n npm_token: ${secrets.NPM_TOKEN}\n run: npm publish\n```\n\nSecret values are delivered to a worker after it claims the job. Do not write them into reports or artifacts.\n\n### Persist Artifacts and Caches\n\nArtifacts are captured from the workspace after a successful run:\n\n```yaml\nartifacts:\n paths:\n - dist\n - reports/**/*.json\n```\n\nCaches are restored before steps start and saved after a successful run:\n\n```yaml\ncache:\n key: npm-${inputs.repo}-${inputs.branch}\n paths:\n - node_modules\n```\n\nConfigure a shared FileBin backend on the server and workers with `RUNNER_FILE_API_URL`, `RUNNER_FILE_BIN`, and optionally `RUNNER_FILE_PASSWORD`. Create a bin with `POST /bin`, then configure its ID. Without FileBin configuration, the runner uses the central database fallback. Cache keys are scoped by workflow; artifacts are scoped by job. Stored collections are limited to 50 MiB per capture.\n\nAdministrators can download a captured artifact with `GET /api/runs/:jobId/artifacts/:path`.\n\nPopulate workspace files from managed secrets before steps run:\n\n```yaml\nsecretFiles:\n .config/signing.key: SIGNING_KEY\n```\n\nSecret files are created with owner-only permissions in the worker workspace. They must be handled according to the worker storage lifecycle and should not be included in artifacts or caches.\n\n## Reference\n\n### Top-Level Workflow Fields\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | string | Required human-readable workflow name shown in the UI and reports. |\n| `id` | string | Optional identifier used when deriving an ID outside the management API. The management API ID is authoritative after creation. |\n| `on` | object | Required trigger configuration. |\n| `env` | object | Workflow environment values, evaluated in declaration order. |\n| `matrix` | object | Matrix dimensions. Each value is an array of strings, numbers, or booleans. |\n| `concurrency` | object | Optional concurrency group and cancellation policy. |\n| `tags` | string[] | Worker capability tags required by the job. |\n| `artifacts` | object | Workspace paths captured after successful runs. |\n| `cache` | object | Keyed workspace paths restored before and saved after successful runs. |\n| `secretFiles` | object | Workspace-relative file paths mapped to secret names. |\n| `steps` | object[] | Required non-empty ordered list of steps. |\n| `retries` | integer | Additional attempts for a failed step. Must be zero or greater. |\n\n`includes` and workflow-to-workflow imports are not supported. Workflow definitions are stored as complete database revisions. Reusable behavior should be implemented through the planned step reuse mechanism rather than filesystem imports.\n\n### Triggers\n\nThe first non-`schedule`/`solar` key in `on` is the provider trigger. Supported providers include `generic` and `github`.\n\n#### GitHub Trigger Filters\n\n| Field | Type | Behavior |\n| --- | --- | --- |\n| `events` | string[] | Exact event names such as `push` or `pull_request`. |\n| `owner` | string or string[] | Exact repository owner. |\n| `repo` | string or string[] | Exact repository name. |\n| `name` | string or string[] | Exact `owner/repo` name. |\n| `branches` | string or string[] | Glob patterns matching normalized branches or tags. |\n| `refs` | string or string[] | Alias for branch/ref matching. |\n| `tag` | boolean | Requires a tag push when true, a non-tag event when false. |\n| `tags` | string[] | Regular expressions matched against the tag value. |\n| `paths` | string[] | Glob patterns matched against changed files. |\n| `if` | string or string[] | Safe JavaScript condition evaluated after provider filters. |\n\nConfigured fields are combined with AND. Multiple values within a field are combined with OR. Negated `!value` entries are supported by exact-value filters.\n\n#### Schedule Trigger\n\n```yaml\nschedule:\n - id: hourly\n cron: '0 * * * *'\n timezone: UTC\n```\n\n#### Solar Trigger\n\n```yaml\nsolar:\n - id: sunrise-build\n event: sunrise\n latitude: 52.52\n longitude: 13.405\n timezone: Europe/Berlin\n offset: -15m\n```\n\n### Environment and Expressions\n\nInterpolated strings use standard JavaScript template expressions inside `${...}`. The safe evaluator supports literals, property access, arithmetic, comparisons, boolean operators, ternaries, arrays, objects, and these helpers:\n\n```text\nString(value)\nNumber(value)\nBoolean(value)\nJSON.parse(value)\nJSON.stringify(value)\nObject.keys(value)\n```\n\nAvailable context objects are:\n\n| Object | Available data |\n| --- | --- |\n| `inputs` | Trigger payload and normalized provider inputs. |\n| `env` | Runner environment plus earlier workflow or step environment entries. |\n| `secrets` | Decrypted job-scoped secrets. |\n| `steps` | Earlier step statuses, exit codes, and outputs. |\n| `files` | Workspace-scoped `exists`, `readFile`, and `join` helpers for `eval:` steps. |\n\nExpressions cannot access JavaScript constructors or prototypes. Shell commands are not expression-evaluated; only declared interpolation fields are evaluated.\n\n### Steps\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | string | Stable identifier used by `steps.<id>`. |\n| `name` | string | Display name. Defaults to `id`. |\n| `run` | string | Shell command or script. Mutually exclusive with `eval`. |\n| `eval` | string | In-process safe expression. Mutually exclusive with `run`. |\n| `env` | object | Step environment, evaluated after workflow environment. |\n| `image` | string | Docker image. Selects container execution for the step. |\n| `volumes` | string or string[] | Docker `-v` mappings. |\n| `dockerArgs` | string[] | Additional raw arguments for `docker run`. |\n| `timeoutMs` | positive integer | Maximum step runtime. Defaults to 30 seconds. |\n| `if` | string | Safe condition. False conditions produce a skipped step. |\n\n`run` steps execute through the selected worker driver. With `image`, the command runs as `sh -c` inside Docker. Without `image`, it runs through the worker shell. `eval` steps run inside the worker process and can produce structured outputs for later steps.\n\n### Management and API\n\nWorkflow definitions are drafted, validated, published, enabled, and deleted through the authenticated management UI or these endpoints:\n\n```text\nPOST /api/workflows/validate\nGET /api/workflows\nGET /api/workflows/:id\nPUT /api/workflows/:id\nPOST /api/workflows/:id/publish\nDELETE /api/workflows/:id\n```\n\nOnly published workflows with `enabled: true` are matched for incoming triggers. Saving a workflow creates a new immutable revision. Existing jobs continue to use the revision recorded when they were created.\n\n## Explanation\n\n### Why Workflow YAML Lives in the Database\n\nThe server stores source YAML and normalized revisions in the database. Workers are stateless: they fetch the referenced revision when claiming a job and do not read workflow files from their local filesystem. This keeps every worker on the same definition and makes published revisions reproducible.\n\n### Why Matrix Expansion Happens at Trigger Time\n\nThe stored revision remains one canonical workflow. When a trigger matches, the server creates one queue job per matrix combination. The payload records the matrix context, and the worker resolves that same variant before execution. This avoids storing duplicate workflow revisions while keeping each job independently observable.\n\n### Docker Volumes and Trust\n\n`volumes` and `dockerArgs` are intentionally powerful options. A host volume can expose credentials or signing material, and Docker arguments can change networking, users, capabilities, or isolation. Only trusted administrators should publish workflows using these fields. The runner does not copy, inspect, or redact files mounted into containers.\n\n### Reuse and Imports\n\nFilesystem imports were removed because workers no longer load workflow files. Future step reuse should operate on database-owned definitions or explicit reusable step mechanisms, keeping revisioning and authorization visible to the control plane.\n", zi = "\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path>\n <path d=\"M12 17h.01\"></path>\n </svg>", Bi = "\n :root { color-scheme: dark; }\n * { box-sizing: border-box; }\n body { margin: 0; background: #030712; color: #e5e7eb; font-family: ui-sans-serif, system-ui, sans-serif; }\n main { max-width: 78rem; margin: 0 auto; padding: 2rem 1rem 5rem; }\n article { max-width: 54rem; margin: 0 auto; line-height: 1.7; }\n h1, h2, h3 { color: #f9fafb; line-height: 1.2; letter-spacing: -0.02em; }\n h1 { font-size: 2.25rem; margin: 0 0 1rem; }\n h2 { border-top: 1px solid #1f2937; margin-top: 3rem; padding-top: 1.5rem; font-size: 1.6rem; }\n h3 { margin-top: 2rem; font-size: 1.15rem; }\n p, li { color: #cbd5e1; }\n a { color: #93c5fd; }\n code { border-radius: .35rem; background: #111827; color: #bfdbfe; padding: .12rem .35rem; font-size: .9em; }\n pre { overflow-x: auto; border: 1px solid #1f2937; border-radius: .75rem; background: #0b1120; padding: 1rem; }\n pre code { background: transparent; padding: 0; color: #d1d5db; }\n table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; margin: 1rem 0; }\n th, td { border-bottom: 1px solid #1f2937; padding: .65rem .75rem; text-align: left; vertical-align: top; }\n th { color: #f9fafb; background: #111827; }\n blockquote { border-left: 3px solid #6366f1; margin-left: 0; padding-left: 1rem; color: #94a3b8; }\n .topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; max-width: 78rem; margin: 0 auto; padding: 1rem; }\n .back { display: inline-flex; align-items: center; gap: .45rem; color: #94a3b8; text-decoration: none; font-size: .85rem; }\n .back:hover, .back:focus-visible { color: #f9fafb; }\n .help-layout { display: grid; grid-template-columns: minmax(0, 54rem); gap: 3rem; justify-content: center; }\n .toc { display: none; }\n .toc nav { position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; border-left: 1px solid #1f2937; padding-left: 1rem; }\n .toc-title { margin: 0 0 .65rem; color: #f9fafb; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }\n .toc ul { display: grid; gap: .15rem; list-style: none; margin: 0; padding: 0; }\n .toc a { display: block; border-radius: .35rem; color: #94a3b8; font-size: .8rem; line-height: 1.35; padding: .3rem .45rem; text-decoration: none; }\n .toc a:hover, .toc a:focus-visible { background: #111827; color: #dbeafe; outline: none; }\n .toc-depth-2 { padding-left: .9rem !important; }\n .toc-depth-3 { padding-left: 1.8rem !important; font-size: .75rem !important; }\n @media (min-width: 1024px) { .help-layout { grid-template-columns: minmax(0, 54rem) 16rem; justify-content: center; } .toc { display: block; } }\n @media (min-width: 640px) { main { padding: 3rem 1.5rem 6rem; } }\n";
|
|
5553
|
-
function
|
|
5544
|
+
var Li = "# Workflow Documentation\n\nThis is the living documentation for workflow authors. It is organized using the four Diataxis modes:\n\n- **Tutorials** teach the shortest path to a working workflow.\n- **How-to guides** solve focused tasks.\n- **Reference** documents the accepted syntax.\n- **Explanation** describes execution and security decisions.\n\n## Tutorials\n\n### Your First Workflow\n\nCreate a draft in the authenticated workflow editor, or send the YAML to the API:\n\n```yaml\nname: Hello\n\non:\n generic: {}\n\nsteps:\n - id: greet\n name: Greet\n run: echo \"Hello ${inputs.name}\"\n```\n\nSave it, validate it, and publish it. Only published and enabled workflows receive webhook or scheduled events.\n\nThe `generic` provider accepts a JSON request body as `inputs`. For example:\n\n```bash\ncurl -X POST http://localhost:11235/webhooks/generic \\\n -H 'content-type: application/json' \\\n --data '{\"name\":\"Ada\"}'\n```\n\n### Build a GitHub Workflow\n\n```yaml\nname: Build\n\non:\n github:\n events: [push]\n owner: cloud-cli\n repo: on\n branches: [main]\n\nsteps:\n - id: checkout\n name: Checkout\n env:\n clone_url: ${inputs.clone_url}\n commit_sha: ${inputs.commit_sha}\n run: |\n git clone --depth 1 \"$clone_url\" .\n git checkout \"$commit_sha\"\n\n - id: test\n name: Test\n run: pnpm install && pnpm test\n```\n\nGitHub webhooks must be signed with the configured `GITHUB_WEBHOOK_SECRET`. The preprocessor exposes normalized inputs including `event`, `owner`, `repo`, `branch`, `tag`, `ref`, `full_name`, `clone_url`, `commit_sha`, `author`, `action`, `changes`, and the original `raw` body.\n\n## How-To Guides\n\n### Reference Another Environment Value\n\nEnvironment entries are evaluated from top to bottom. Earlier values are available through `env` to later values:\n\n```yaml\nenv:\n image: ${inputs.repo}\n image_tag: ${env.image}:latest\n artifact_name: ${env.image_tag}-${inputs.commit_sha}\n```\n\nWorkflow-level values are available to every step. Step-level `env` values are evaluated after workflow-level values and can override them for that step.\n\nUse `${inputs.name}`, `${env.NAME}`, `${secrets.NAME}`, and `${steps.step_id.outputs.value}` where the value is available. A value without `${...}` remains literal text.\n\n### Run a Container with a Host Volume\n\nUse `image` with `volumes`. A volume is passed directly to `docker run` as a `-v` mapping:\n\n```yaml\nsteps:\n - id: sign\n name: Sign release\n image: alpine:latest\n volumes:\n - /var/lib/runner/secrets-store:/secrets:ro\n run: |\n ./sign.sh /secrets/signing.key dist/release.tar.gz\n```\n\nThe source path is on the worker host. The destination path is inside the container. Use absolute host paths when a specific host directory is required. The workflow must be trusted because volume mappings can expose host data to a container.\n\nA single string is also accepted:\n\n```yaml\nvolumes: /var/lib/runner/secrets-store:/secrets:ro\n```\n\n### Pass Additional Docker Arguments\n\nUse `dockerArgs` for additional arguments to `docker run`, before the image name:\n\n```yaml\nsteps:\n - id: build\n image: docker:cli\n dockerArgs:\n - --network=host\n - --user=1000:1000\n run: docker build -t example:latest .\n```\n\nArguments are not interpreted or shell-expanded by the runner. They are passed as individual Docker CLI arguments.\n\n### Use a Matrix\n\nKeep the matrix in the workflow definition:\n\n```yaml\nname: Package\n\nmatrix:\n node: [18, 20]\n os: [ubuntu, alpine]\n\non:\n generic: {}\n\nenv:\n node_version: ${env.MATRIX_NODE}\n\nsteps:\n - id: package\n image: node:${env.MATRIX_NODE}\n run: npm pack\n```\n\nThe runner creates one job for every Cartesian combination. The example creates four jobs. Each variant receives `MATRIX_NODE` and `MATRIX_OS` environment variables.\n\n### Add a Scheduled Trigger\n\n```yaml\non:\n schedule:\n - id: nightly\n cron: '0 2 * * *'\n timezone: Europe/Berlin\n```\n\nCron expressions have five fields: minute, hour, day of month, month, and day of week. The scheduler uses the declared IANA timezone.\n\nSolar triggers use `sunrise` or `sunset` and geographic coordinates:\n\n```yaml\non:\n solar:\n - id: morning\n event: sunrise\n latitude: 52.52\n longitude: 13.405\n offset: +15m\n```\n\n### Use Secrets\n\nCreate a secret in the management UI or with the API, then reference it in environment values:\n\n```yaml\nsteps:\n - id: publish\n env:\n npm_token: ${secrets.NPM_TOKEN}\n run: npm publish\n```\n\nSecret values are delivered to a worker after it claims the job. Do not write them into reports or artifacts.\n\n### Persist Artifacts and Caches\n\nArtifacts are captured from the workspace after a successful run:\n\n```yaml\nartifacts:\n paths:\n - dist\n - reports/**/*.json\n```\n\nCaches are restored before steps start and saved after a successful run:\n\n```yaml\ncache:\n key: npm-${inputs.repo}-${inputs.branch}\n paths:\n - node_modules\n```\n\nConfigure a shared FileBin backend on the server and workers with `RUNNER_FILE_API_URL`, `RUNNER_FILE_BIN`, and optionally `RUNNER_FILE_PASSWORD`. Create a bin with `POST /bin`, then configure its ID. Without FileBin configuration, the runner uses the central database fallback. Cache keys are scoped by workflow; artifacts are scoped by job. Stored collections are limited to 50 MiB per capture.\n\nAdministrators can download a captured artifact with `GET /api/runs/:jobId/artifacts/:path`.\n\nPopulate workspace files from managed secrets before steps run:\n\n```yaml\nsecretFiles:\n .config/signing.key: SIGNING_KEY\n```\n\nSecret files are created with owner-only permissions in the worker workspace. They must be handled according to the worker storage lifecycle and should not be included in artifacts or caches.\n\n## Reference\n\n### Top-Level Workflow Fields\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | string | Required human-readable workflow name shown in the UI and reports. |\n| `id` | string | Optional identifier used when deriving an ID outside the management API. The management API ID is authoritative after creation. |\n| `on` | object | Required trigger configuration. |\n| `env` | object | Workflow environment values, evaluated in declaration order. |\n| `matrix` | object | Matrix dimensions. Each value is an array of strings, numbers, or booleans. |\n| `concurrency` | object | Optional concurrency group and cancellation policy. |\n| `tags` | string[] | Worker capability tags required by the job. |\n| `artifacts` | object | Workspace paths captured after successful runs. |\n| `cache` | object | Keyed workspace paths restored before and saved after successful runs. |\n| `secretFiles` | object | Workspace-relative file paths mapped to secret names. |\n| `steps` | object[] | Required non-empty ordered list of steps. |\n| `retries` | integer | Additional attempts for a failed step. Must be zero or greater. |\n\n`includes` and workflow-to-workflow imports are not supported. Workflow definitions are stored as complete database revisions. Reusable behavior should be implemented through the planned step reuse mechanism rather than filesystem imports.\n\n### Triggers\n\nThe first non-`schedule`/`solar` key in `on` is the provider trigger. Supported providers include `generic` and `github`.\n\n#### GitHub Trigger Filters\n\n| Field | Type | Behavior |\n| --- | --- | --- |\n| `events` | string[] | Exact event names such as `push` or `pull_request`. |\n| `owner` | string or string[] | Exact repository owner. |\n| `repo` | string or string[] | Exact repository name. |\n| `name` | string or string[] | Exact `owner/repo` name. |\n| `branches` | string or string[] | Glob patterns matching normalized branches or tags. |\n| `refs` | string or string[] | Alias for branch/ref matching. |\n| `tag` | boolean | Requires a tag push when true, a non-tag event when false. |\n| `tags` | string[] | Regular expressions matched against the tag value. |\n| `paths` | string[] | Glob patterns matched against changed files. |\n| `if` | string or string[] | Safe JavaScript condition evaluated after provider filters. |\n\nConfigured fields are combined with AND. Multiple values within a field are combined with OR. Negated `!value` entries are supported by exact-value filters.\n\n#### Schedule Trigger\n\n```yaml\nschedule:\n - id: hourly\n cron: '0 * * * *'\n timezone: UTC\n```\n\n#### Solar Trigger\n\n```yaml\nsolar:\n - id: sunrise-build\n event: sunrise\n latitude: 52.52\n longitude: 13.405\n timezone: Europe/Berlin\n offset: -15m\n```\n\n### Environment and Expressions\n\nInterpolated strings use standard JavaScript template expressions inside `${...}`. The safe evaluator supports literals, property access, arithmetic, comparisons, boolean operators, ternaries, arrays, objects, and these helpers:\n\n```text\nString(value)\nNumber(value)\nBoolean(value)\nJSON.parse(value)\nJSON.stringify(value)\nObject.keys(value)\n```\n\nAvailable context objects are:\n\n| Object | Available data |\n| --- | --- |\n| `inputs` | Trigger payload and normalized provider inputs. |\n| `env` | Runner environment plus earlier workflow or step environment entries. |\n| `secrets` | Decrypted job-scoped secrets. |\n| `steps` | Earlier step statuses, exit codes, and outputs. |\n| `files` | Workspace-scoped `exists`, `readFile`, and `join` helpers for `eval:` steps. |\n\nExpressions cannot access JavaScript constructors or prototypes. Shell commands are not expression-evaluated; only declared interpolation fields are evaluated.\n\n### Steps\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | string | Stable identifier used by `steps.<id>`. |\n| `name` | string | Display name. Defaults to `id`. |\n| `run` | string | Shell command or script. Mutually exclusive with `eval`. |\n| `eval` | string | In-process safe expression. Mutually exclusive with `run`. |\n| `env` | object | Step environment, evaluated after workflow environment. |\n| `image` | string | Docker image. Selects container execution for the step. |\n| `volumes` | string or string[] | Docker `-v` mappings. |\n| `dockerArgs` | string[] | Additional raw arguments for `docker run`. |\n| `timeoutMs` | positive integer | Maximum step runtime. Defaults to 30 seconds. |\n| `if` | string | Safe condition. False conditions produce a skipped step. |\n\n`run` steps execute through the selected worker driver. With `image`, the command runs as `sh -c` inside Docker. Without `image`, it runs through the worker shell. `eval` steps run inside the worker process and can produce structured outputs for later steps.\n\n### Management and API\n\nWorkflow definitions are drafted, validated, published, enabled, and deleted through the authenticated management UI or these endpoints:\n\n```text\nPOST /api/workflows/validate\nGET /api/workflows\nGET /api/workflows/:id\nPUT /api/workflows/:id\nPOST /api/workflows/:id/publish\nDELETE /api/workflows/:id\n```\n\nOnly published workflows with `enabled: true` are matched for incoming triggers. Saving a workflow creates a new immutable revision. Existing jobs continue to use the revision recorded when they were created.\n\n## Explanation\n\n### Why Workflow YAML Lives in the Database\n\nThe server stores source YAML and normalized revisions in the database. Workers are stateless: they fetch the referenced revision when claiming a job and do not read workflow files from their local filesystem. This keeps every worker on the same definition and makes published revisions reproducible.\n\n### Why Matrix Expansion Happens at Trigger Time\n\nThe stored revision remains one canonical workflow. When a trigger matches, the server creates one queue job per matrix combination. The payload records the matrix context, and the worker resolves that same variant before execution. This avoids storing duplicate workflow revisions while keeping each job independently observable.\n\n### Docker Volumes and Trust\n\n`volumes` and `dockerArgs` are intentionally powerful options. A host volume can expose credentials or signing material, and Docker arguments can change networking, users, capabilities, or isolation. Only trusted administrators should publish workflows using these fields. The runner does not copy, inspect, or redact files mounted into containers.\n\n### Reuse and Imports\n\nFilesystem imports were removed because workers no longer load workflow files. Future step reuse should operate on database-owned definitions or explicit reusable step mechanisms, keeping revisioning and authorization visible to the control plane.\n", Ri = "\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path>\n <path d=\"M12 17h.01\"></path>\n </svg>", zi = "\n :root { color-scheme: dark; }\n * { box-sizing: border-box; }\n body { margin: 0; background: #030712; color: #e5e7eb; font-family: ui-sans-serif, system-ui, sans-serif; }\n main { max-width: 78rem; margin: 0 auto; padding: 2rem 1rem 5rem; }\n article { max-width: 54rem; margin: 0 auto; line-height: 1.7; }\n h1, h2, h3 { color: #f9fafb; line-height: 1.2; letter-spacing: -0.02em; }\n h1 { font-size: 2.25rem; margin: 0 0 1rem; }\n h2 { border-top: 1px solid #1f2937; margin-top: 3rem; padding-top: 1.5rem; font-size: 1.6rem; }\n h3 { margin-top: 2rem; font-size: 1.15rem; }\n p, li { color: #cbd5e1; }\n a { color: #93c5fd; }\n code { border-radius: .35rem; background: #111827; color: #bfdbfe; padding: .12rem .35rem; font-size: .9em; }\n pre { overflow-x: auto; border: 1px solid #1f2937; border-radius: .75rem; background: #0b1120; padding: 1rem; }\n pre code { background: transparent; padding: 0; color: #d1d5db; }\n table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; margin: 1rem 0; }\n th, td { border-bottom: 1px solid #1f2937; padding: .65rem .75rem; text-align: left; vertical-align: top; }\n th { color: #f9fafb; background: #111827; }\n blockquote { border-left: 3px solid #6366f1; margin-left: 0; padding-left: 1rem; color: #94a3b8; }\n .topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; max-width: 78rem; margin: 0 auto; padding: 1rem; }\n .back { display: inline-flex; align-items: center; gap: .45rem; color: #94a3b8; text-decoration: none; font-size: .85rem; }\n .back:hover, .back:focus-visible { color: #f9fafb; }\n .help-layout { display: grid; grid-template-columns: minmax(0, 54rem); gap: 3rem; justify-content: center; }\n .toc { display: none; }\n .toc nav { position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; border-left: 1px solid #1f2937; padding-left: 1rem; }\n .toc-title { margin: 0 0 .65rem; color: #f9fafb; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }\n .toc ul { display: grid; gap: .15rem; list-style: none; margin: 0; padding: 0; }\n .toc a { display: block; border-radius: .35rem; color: #94a3b8; font-size: .8rem; line-height: 1.35; padding: .3rem .45rem; text-decoration: none; }\n .toc a:hover, .toc a:focus-visible { background: #111827; color: #dbeafe; outline: none; }\n .toc-depth-2 { padding-left: .9rem !important; }\n .toc-depth-3 { padding-left: 1.8rem !important; font-size: .75rem !important; }\n @media (min-width: 1024px) { .help-layout { grid-template-columns: minmax(0, 54rem) 16rem; justify-content: center; } .toc { display: block; } }\n @media (min-width: 640px) { main { padding: 3rem 1.5rem 6rem; } }\n";
|
|
5545
|
+
function Bi(e = !1) {
|
|
5554
5546
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
5555
5547
|
let n = e.replace(/[`*_~]/g, "").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "section", r = t.get(n) || 0;
|
|
5556
5548
|
return t.set(n, r + 1), r ? `${n}-${r + 1}` : n;
|
|
5557
|
-
}, r = W.lexer(
|
|
5549
|
+
}, r = W.lexer(Li).filter((e) => e.type === "heading" && (e.depth || 0) <= 3).map((e) => ({
|
|
5558
5550
|
depth: e.depth,
|
|
5559
5551
|
text: e.text || "",
|
|
5560
5552
|
id: n(e.text || "")
|
|
@@ -5562,7 +5554,7 @@ function Vi(e = !1) {
|
|
|
5562
5554
|
t.clear();
|
|
5563
5555
|
let i = 0, a = new W.Renderer();
|
|
5564
5556
|
a.heading = ({ text: e, depth: t }) => `<h${t} id="${r[i++]?.id || n(e)}">${e}</h${t}>`;
|
|
5565
|
-
let o = W.parse(
|
|
5557
|
+
let o = W.parse(Li, {
|
|
5566
5558
|
async: !1,
|
|
5567
5559
|
renderer: a
|
|
5568
5560
|
}), s = (e) => e.replace(/[&<>"']/g, (e) => ({
|
|
@@ -5578,17 +5570,536 @@ function Vi(e = !1) {
|
|
|
5578
5570
|
<meta charset="utf-8" />
|
|
5579
5571
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
5580
5572
|
<title>Workflow help</title>
|
|
5581
|
-
<style>${
|
|
5573
|
+
<style>${zi}</style>
|
|
5582
5574
|
</head>
|
|
5583
5575
|
<body>
|
|
5584
|
-
${e ? "" : `<div class="topbar"><a class="back" href="/runs">${
|
|
5576
|
+
${e ? "" : `<div class="topbar"><a class="back" href="/runs">${Ri}<span>Back to jobs</span></a><a class="back" href="/workflows">Manage workflows</a></div>`}
|
|
5585
5577
|
<main><div class="help-layout"><article>${o}</article>${e ? "" : c}</div></main>
|
|
5586
5578
|
</body>
|
|
5587
5579
|
</html>`;
|
|
5588
5580
|
}
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
var Hi = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"theme-color\" content=\"#030712\" />\n <meta name=\"mobile-web-app-capable\" content=\"yes\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n <link rel=\"icon\" href=\"/app-icon.svg\" type=\"image/svg+xml\" />\n <title>Runner Workflow Management</title>\n <script type=\"importmap\">\n { \"imports\": { \"@li3/\": \"https://cdn.li3.dev/@li3/\" } }\n <\/script>\n <style>\n body[data-page='list'] .editor-panel {\n display: none;\n }\n body[data-page='editor'] .workflow-list,\n body[data-page='editor'] .secrets-panel {\n display: none;\n }\n </style>\n </head>\n <body data-page=\"__WORKFLOW_PAGE__\" class=\"min-h-screen bg-gray-950 p-4 font-sans text-gray-100 md:p-6\">\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/code-editor.html\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/code-block.html\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/lucide-icon.html\" />\n\n <template app>\n <main class=\"mx-auto max-w-6xl space-y-5\">\n <header class=\"flex flex-col gap-4 border-b border-gray-800 pb-5 sm:flex-row sm:items-end sm:justify-between\">\n <div class=\"flex items-start gap-3\">\n <a\n href=\"/runs\"\n aria-label=\"Back to dashboard\"\n class=\"mt-1 rounded-lg border border-gray-800 bg-gray-900 p-2 text-gray-400 transition hover:border-indigo-500/60 hover:text-indigo-300\"\n >\n <lucide-icon icon=\"arrow-left\" size=\"17\"></lucide-icon>\n </a>\n <div>\n <p class=\"text-xs font-semibold uppercase tracking-[0.18em] text-indigo-400\">Runner engine</p>\n <h1 class=\"mt-1 text-2xl font-bold tracking-tight text-white\">Workflow control room</h1>\n <p class=\"mt-1 text-sm text-gray-400\">Draft, validate, and publish revisioned YAML definitions.</p>\n </div>\n </div>\n <a\n href=\"/workflows/new\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg bg-indigo-500 px-4 py-2.5 text-sm font-semibold text-white shadow-lg shadow-indigo-950/40 transition hover:bg-indigo-400\"\n >\n <lucide-icon icon=\"plus\" size=\"16\"></lucide-icon>\n New workflow\n </a>\n <a\n href=\"/help\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-800 bg-gray-900 px-3 py-2.5 text-sm font-medium text-gray-300 outline-none transition hover:border-indigo-500/50 hover:text-indigo-200 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path>\n <path d=\"M12 17h.01\"></path>\n </svg>\n Help\n </a>\n </header>\n\n <template if=\"notice\">\n <div\n role=\"status\"\n class=\"flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm\"\n bind-class=\"noticeError ? 'border-rose-500/40 bg-rose-500/10 text-rose-100' : 'border-emerald-500/40 bg-emerald-500/10 text-emerald-100'\"\n >\n <lucide-icon bind-icon=\"noticeError ? 'circle-alert' : 'circle-check'\" size=\"17\"></lucide-icon>\n <span>{{ notice }}</span>\n </div>\n </template>\n\n <section id=\"workflow-layout\" class=\"space-y-5\">\n <nav\n class=\"workflow-list rounded-2xl border border-gray-800 bg-gray-900/80 p-4 shadow-xl shadow-black/10\"\n aria-labelledby=\"workflow-list-title\"\n >\n <div class=\"mb-4 flex items-end justify-between gap-3 border-b border-gray-800 pb-4\">\n <div>\n <p class=\"text-[11px] font-semibold uppercase tracking-[0.18em] text-indigo-400\">Definitions</p>\n <h2 id=\"workflow-list-title\" class=\"mt-1 text-lg font-semibold text-white\">Workflows</h2>\n </div>\n <span\n class=\"rounded-full border border-gray-700 bg-gray-950 px-2.5 py-1 text-xs font-mono text-gray-400\"\n aria-label=\"Workflow count\"\n >\n {{ workflows.length }}\n </span>\n </div>\n <ul class=\"grid gap-2\" aria-label=\"Workflow definitions\">\n <template for=\"workflow of workflows\">\n <li>\n <a\n attr-href=\"'/workflows/' + workflow.id\"\n class=\"group flex min-h-16 items-center gap-3 rounded-xl border border-gray-800 bg-gray-950/50 px-3.5 py-3 text-left text-sm text-gray-300 outline-none transition hover:border-indigo-500/50 hover:bg-indigo-500/10 focus-visible:border-indigo-400 focus-visible:ring-2 focus-visible:ring-indigo-400/50\"\n >\n <span\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-800 text-gray-400 transition group-hover:bg-indigo-500/15 group-hover:text-indigo-300\"\n >\n <lucide-icon icon=\"workflow\" size=\"17\"></lucide-icon>\n </span>\n <span class=\"min-w-0 flex-1\">\n <span class=\"block truncate font-medium text-gray-100\">{{ workflow.name }}</span>\n <span class=\"mt-0.5 block truncate font-mono text-[11px] text-gray-500\">{{ workflow.id }}</span>\n </span>\n <span\n class=\"rounded-full border px-2 py-1 text-[10px] font-semibold uppercase tracking-wide\"\n bind-class=\"workflow.status === 'published' ? 'border-emerald-500/30 bg-emerald-500/10 text-emerald-300' : workflow.status === 'archived' ? 'border-gray-700 bg-gray-800 text-gray-500' : 'border-amber-500/30 bg-amber-500/10 text-amber-300'\"\n >{{ workflow.status }}</span\n >\n <lucide-icon\n icon=\"arrow-up-right\"\n size=\"16\"\n class=\"shrink-0 text-gray-600 transition group-hover:text-indigo-300\"\n ></lucide-icon>\n </a>\n </li>\n </template>\n </ul>\n <div\n class=\"rounded-xl border border-dashed border-gray-700 px-4 py-8 text-center\"\n class-hidden=\"workflows.length > 0\"\n >\n <lucide-icon icon=\"workflow\" size=\"22\" class=\"mx-auto text-gray-600\"></lucide-icon>\n <p class=\"mt-2 text-sm font-medium text-gray-300\">No workflows yet</p>\n <p class=\"mt-1 text-xs text-gray-500\">Create a definition to start automating jobs.</p>\n </div>\n </nav>\n\n <section\n class=\"editor-panel overflow-hidden rounded-xl border border-gray-800 bg-gray-900/80 shadow-xl shadow-black/10\"\n >\n <div class=\"border-b border-gray-800 px-4 pt-3 sm:px-5\">\n <a\n href=\"/workflows\"\n class=\"inline-flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium text-gray-400 outline-none transition hover:bg-gray-800 hover:text-gray-100 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <lucide-icon icon=\"arrow-left\" size=\"14\"></lucide-icon>\n Back to workflows\n </a>\n </div>\n <div class=\"border-b border-gray-800 bg-gray-900 px-4 py-4 sm:px-5\">\n <div class=\"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between\">\n <label class=\"block max-w-xl flex-1 text-xs font-semibold uppercase tracking-wider text-gray-400\"\n >Workflow ID\n <input\n bind-value=\"workflowId\"\n on-input=\"setWorkflowId($event)\"\n bind-disabled=\"selectedId\"\n aria-describedby=\"workflow-id-help\"\n class=\"mt-2 w-full rounded-lg border border-gray-700 bg-gray-950 px-3 py-2.5 font-mono text-sm normal-case tracking-normal text-white outline-none transition focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20\"\n placeholder=\"derived-from-workflow-name\"\n />\n <span\n id=\"workflow-id-help\"\n class=\"mt-1 block text-[11px] font-normal normal-case tracking-normal text-gray-500\"\n >The ID becomes permanent after the first save.</span\n >\n </label>\n <label class=\"inline-flex items-center gap-2 text-sm text-gray-300\">\n <input\n type=\"checkbox\"\n bind-checked=\"enabled\"\n on-change=\"setEnabled($event)\"\n class=\"h-4 w-4 rounded border-gray-700 bg-gray-950 text-indigo-500 focus:ring-2 focus:ring-indigo-500/30\"\n />\n Enabled\n </label>\n <div class=\"flex flex-wrap gap-2\" class-hidden=\"readOnly\">\n <button\n type=\"button\"\n aria-label=\"Save workflow draft\"\n title=\"Save workflow draft\"\n on-click=\"save()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center gap-2 rounded-lg bg-indigo-500 px-3 py-2.5 text-sm font-semibold text-white transition hover:bg-indigo-400 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon icon=\"save\" size=\"16\"></lucide-icon>\n <span class=\"hidden sm:inline\">Save draft</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Publish workflow\"\n title=\"Publish workflow\"\n on-click=\"publish()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center gap-2 rounded-lg border border-emerald-500/50 px-3 py-2.5 text-sm font-medium text-emerald-300 transition hover:bg-emerald-500/10 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon icon=\"rocket\" size=\"16\"></lucide-icon>\n <span class=\"hidden sm:inline\">Publish</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Delete workflow\"\n title=\"Delete workflow\"\n on-click=\"remove()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center gap-2 rounded-lg border border-rose-500/50 px-3 py-2.5 text-sm font-medium text-rose-300 transition hover:bg-rose-500/10 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon icon=\"trash\" size=\"16\"></lucide-icon>\n <span class=\"hidden sm:inline\">Delete</span>\n </button>\n </div>\n </div>\n </div>\n <div class=\"p-3 sm:p-5\">\n <div class=\"mb-2 flex items-center justify-between px-1 text-xs text-gray-500\">\n <div class=\"flex items-center gap-2\">\n <button\n type=\"button\"\n aria-label=\"Validate workflow\"\n title=\"Validate workflow\"\n on-click=\"validate(1)\"\n bind-disabled=\"validation.running\"\n bind-class=\"{ 'hidden': readOnly, 'text-emerald-400': validation.valid, 'text-rose-400': !validation.valid }\"\n class=\"disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon\n class=\"inline-block\"\n bind-icon=\"validation.running ? 'loader-circle' : (validation.valid ? 'circle-check' : 'circle-alert')\"\n bind-class=\"validation.running ? 'animate-spin' : ''\"\n size=\"16\"\n ></lucide-icon>\n </button>\n <span class=\"font-medium\" bind-class=\"validation.error ? 'bg-rose-500/10 text-rose-100' : ''\"\n >{{ validation.error || '' }}</span\n >\n </div>\n <span class=\"font-mono\">{{ source.length }} characters</span>\n </div>\n <template if=\"readOnly\">\n <code-block\n language=\"yaml\"\n theme=\"atom-one-dark\"\n class=\"block h-[calc(100vh-23rem)] min-h-[28rem] overflow-auto rounded-lg border border-gray-700 bg-gray-950 p-4\"\n bind-source=\"source\"\n ></code-block>\n </template>\n <template if=\"!readOnly\">\n <code-editor\n id=\"source-yaml\"\n language=\"yaml\"\n theme=\"atom-one-dark\"\n nostatus=\"true\"\n class=\"block h-[calc(100vh-23rem)] min-h-[28rem] overflow-hidden rounded-lg border border-gray-700 bg-gray-950\"\n bind-value=\"source\"\n on-change=\"setSource($event.detail)\"\n ></code-editor>\n </template>\n <details\n class=\"mt-4 overflow-hidden rounded-xl border border-gray-800 bg-gray-950/50\"\n on-toggle=\"loadHelp($event)\"\n >\n <summary\n class=\"cursor-pointer list-none px-4 py-3 text-sm font-medium text-gray-300 outline-none transition hover:bg-gray-900 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <span class=\"inline-flex items-center gap-2\"\n ><lucide-icon icon=\"circle-question-mark\" size=\"16\"></lucide-icon>Syntax</span\n >\n <span class=\"ml-2 text-xs font-normal text-gray-500\">Reference, tutorials, and examples</span>\n </summary>\n <div\n ref=\"helpContent\"\n class=\"max-h-[38rem] overflow-y-auto border-t border-gray-800 bg-gray-950 px-4 py-5\"\n role=\"region\"\n aria-label=\"Workflow syntax help\"\n aria-live=\"polite\"\n >\n <p class=\"text-sm text-gray-500\">Expand to load the workflow syntax reference.</p>\n </div>\n </details>\n </div>\n </section>\n </section>\n\n <section\n class=\"secrets-panel rounded-2xl border border-gray-800 bg-gray-900/80 p-4 shadow-xl shadow-black/10 sm:p-5\"\n aria-labelledby=\"secrets-title\"\n >\n <div class=\"mb-5 flex items-start justify-between gap-3\">\n <div class=\"flex items-start gap-3\">\n <span class=\"rounded-lg bg-indigo-500/10 p-2 text-indigo-300\"\n ><lucide-icon icon=\"key-round\" size=\"18\"></lucide-icon\n ></span>\n <div>\n <h2 id=\"secrets-title\" class=\"text-lg font-semibold text-white\">Secrets</h2>\n <p class=\"mt-0.5 text-sm text-gray-400\">Write-only credentials available to workflows.</p>\n </div>\n </div>\n <span\n class=\"rounded-full border border-gray-700 bg-gray-950 px-2.5 py-1 text-xs font-mono text-gray-400\"\n aria-label=\"Secret count\"\n >{{ secrets.length }}</span\n >\n </div>\n <div class=\"mb-5 rounded-xl border border-gray-800 bg-gray-950/50 p-3\">\n <p class=\"mb-3 text-xs text-gray-500\">Saving an existing name replaces its encrypted value.</p>\n <div class=\"grid gap-3 md:grid-cols-[14rem_1fr_auto_auto]\">\n <label class=\"sr-only\" for=\"secret-name\">Secret name</label>\n <input\n id=\"secret-name\"\n bind-value=\"secretName\"\n on-input=\"setSecretName($event)\"\n class=\"rounded-lg border border-gray-700 bg-gray-900 px-3 py-2.5 font-mono text-sm uppercase outline-none transition placeholder:text-gray-600 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/30\"\n placeholder=\"NPM_TOKEN\"\n />\n <label class=\"sr-only\" for=\"secret-value\">Secret value</label>\n <input\n id=\"secret-value\"\n ref=\"secretValueInput\"\n bind-value=\"secretValue\"\n on-input=\"setSecretValue($event)\"\n type=\"password\"\n class=\"rounded-lg border border-gray-700 bg-gray-900 px-3 py-2.5 font-mono text-sm outline-none transition placeholder:text-gray-600 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/30\"\n placeholder=\"New secret value\"\n />\n <button\n type=\"button\"\n aria-label=\"Save secret value\"\n title=\"Save secret value\"\n on-click=\"saveSecret()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg border border-indigo-500/60 px-3 py-2.5 text-sm font-medium text-indigo-200 outline-none transition hover:bg-indigo-500/10 focus-visible:ring-2 focus-visible:ring-indigo-400/60 disabled:opacity-50\"\n >\n <lucide-icon icon=\"lock-keyhole\" size=\"16\"></lucide-icon><span class=\"hidden sm:inline\">Save</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Delete secret\"\n title=\"Delete secret\"\n on-click=\"removeSecret()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg border border-rose-500/50 px-3 py-2.5 text-sm font-medium text-rose-300 outline-none transition hover:bg-rose-500/10 focus-visible:ring-2 focus-visible:ring-rose-400/60 disabled:opacity-50\"\n >\n <lucide-icon icon=\"trash\" size=\"16\"></lucide-icon><span class=\"hidden sm:inline\">Delete</span>\n </button>\n </div>\n </div>\n <ul class=\"grid gap-2\" aria-label=\"Saved secrets\">\n <template for=\"name of secrets\">\n <li>\n <button\n type=\"button\"\n on-click=\"selectSecret(name)\"\n class=\"group flex min-h-14 w-full items-center gap-3 rounded-xl border border-gray-800 bg-gray-950/50 px-3.5 py-3 text-left outline-none transition hover:border-indigo-500/50 hover:bg-indigo-500/10 focus-visible:border-indigo-400 focus-visible:ring-2 focus-visible:ring-indigo-400/50\"\n aria-label=\"Edit secret {{ name }}\"\n >\n <span\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-800 text-gray-500 group-hover:text-indigo-300\"\n ><lucide-icon icon=\"key-round\" size=\"15\"></lucide-icon\n ></span>\n <span class=\"min-w-0 flex-1 truncate font-mono text-sm text-gray-200\">{{ name }}</span>\n <span class=\"text-xs text-gray-500\">Select</span>\n <lucide-icon\n icon=\"chevron-right\"\n size=\"16\"\n class=\"text-gray-600 transition group-hover:text-indigo-300\"\n ></lucide-icon>\n </button>\n </li>\n </template>\n </ul>\n <div\n class=\"rounded-xl border border-dashed border-gray-700 px-4 py-8 text-center\"\n class-hidden=\"secrets.length > 0\"\n >\n <lucide-icon icon=\"key-round\" size=\"22\" class=\"mx-auto text-gray-600\"></lucide-icon>\n <p class=\"mt-2 text-sm font-medium text-gray-300\">No secrets configured</p>\n <p class=\"mt-1 text-xs text-gray-500\">Add one above to make it available to a workflow.</p>\n </div>\n </section>\n </main>\n\n <script setup>\n import { onDestroy, onInit, ref, templateRef } from '@li3/web';\n\n export default function () {\n const page = document.body.dataset.page;\n const initialId = __WORKFLOW_ID__;\n const initialRevision = __WORKFLOW_REVISION__;\n const readOnly = Boolean(initialRevision);\n const workflows = ref([]);\n const secrets = ref([]);\n const source = ref('');\n const validation = ref({ valid: true });\n const savedSource = ref('');\n const workflowId = ref('');\n const enabled = ref(true);\n const savedEnabled = ref(true);\n const selectedId = ref('');\n const secretName = ref('');\n const secretValue = ref('');\n const notice = ref('');\n const noticeError = ref(false);\n const busy = ref(false);\n const secretValueInput = templateRef('secretValueInput');\n const helpContent = templateRef('helpContent');\n const helpLoaded = ref(false);\n const helpLoading = ref(false);\n let validationTimer;\n\n const showNotice = (message, error = false) => {\n notice.value = message;\n noticeError.value = error;\n };\n\n const api = async (url, options = {}) => {\n const response = await fetch(url, {\n headers: { accept: 'application/json', ...(options.body ? { 'content-type': 'application/json' } : {}) },\n ...options,\n });\n const body = response.status === 204 ? null : await response.json().catch(() => ({}));\n if (!response.ok) throw new Error(body.error || `Request failed: ${response.status}`);\n return body;\n };\n\n const derivedId = () =>\n source.value\n .match(/^\\s*(?:id:\\s*([^\\n]+)|name:\\s*([^\\n]+))/m)\n ?.slice(1)\n .find(Boolean)\n ?.trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '-')\n .replace(/(^-|-$)/g, '') || '';\n\n const run = async (action) => {\n if (busy.value) return;\n\n busy.value = true;\n\n try {\n await action();\n } catch (error) {\n showNotice(error.message, true);\n } finally {\n busy.value = false;\n }\n };\n\n const loadWorkflows = async () => {\n workflows.value = (await api('/api/workflows')).workflows;\n };\n\n const loadSecrets = async () => {\n secrets.value = (await api('/api/secrets')).secrets;\n };\n\n const openWorkflow = async (id) => {\n const workflowUrl = initialRevision\n ? `/api/workflows/${id}?revision=${initialRevision}`\n : `/api/workflows/${id}`;\n const workflow = await api(workflowUrl);\n selectedId.value = workflow.id;\n workflowId.value = workflow.id;\n source.value = workflow.sourceYaml;\n savedSource.value = workflow.sourceYaml;\n enabled.value = workflow.enabled;\n savedEnabled.value = workflow.enabled;\n };\n\n const validateSource = async () => {\n validation.value = await api('/api/workflows/validate', {\n method: 'POST',\n body: JSON.stringify({ sourceYaml: source.value }),\n });\n };\n\n const validate = (ms = 1000) => {\n if (page !== 'editor') return;\n\n clearTimeout(validationTimer);\n validationTimer = setTimeout(() => {\n validation.running = true;\n validateSource();\n }, ms);\n };\n\n const save = () =>\n run(async () => {\n const id = workflowId.value.trim() || derivedId();\n if (!id) throw new Error('Set an ID or add a workflow name first.');\n if (\n initialId &&\n id === selectedId.value &&\n source.value === savedSource.value &&\n enabled.value === savedEnabled.value\n ) {\n showNotice('No changes to save.');\n return;\n }\n const workflow = await api(`/api/workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify({ sourceYaml: source.value, enabled: enabled.value }),\n });\n selectedId.value = workflow.id;\n workflowId.value = workflow.id;\n savedSource.value = source.value;\n savedEnabled.value = enabled.value;\n showNotice(`Saved ${workflow.id} as draft revision ${workflow.revision}.`);\n if (!initialId) history.replaceState(null, '', `/workflows/${workflow.id}`);\n });\n const publish = () =>\n run(async () => {\n const id = workflowId.value.trim() || selectedId.value;\n if (!id) throw new Error('Save a workflow before publishing it.');\n const workflow = await api(`/api/workflows/${id}/publish`, { method: 'POST' });\n selectedId.value = workflow.id;\n showNotice(`Published ${workflow.id} revision ${workflow.revision}.`);\n });\n const remove = () =>\n run(async () => {\n const id = workflowId.value.trim() || selectedId.value;\n if (!id || !confirm(`Delete ${id} and all of its revisions?`)) return;\n await api(`/api/workflows/${id}`, { method: 'DELETE' });\n window.location.href = '/workflows';\n });\n const saveSecret = () =>\n run(async () => {\n const name = secretName.value.trim();\n if (!name || !secretValue.value) throw new Error('Set a secret name and value first.');\n await api(`/api/secrets/${name}`, { method: 'PUT', body: JSON.stringify({ value: secretValue.value }) });\n secretValue.value = '';\n await loadSecrets();\n showNotice(`Saved ${name}.`);\n });\n const removeSecret = () =>\n run(async () => {\n const name = secretName.value.trim();\n if (!name || !confirm(`Delete ${name}?`)) return;\n await api(`/api/secrets/${name}`, { method: 'DELETE' });\n secretName.value = '';\n secretValue.value = '';\n await loadSecrets();\n showNotice(`Deleted ${name}.`);\n });\n const setSource = (value) => {\n source.value = value;\n validate();\n };\n const setWorkflowId = (event) => {\n workflowId.value = event.target.value;\n };\n const setEnabled = (event) => {\n enabled.value = event.target.checked;\n };\n const setSecretName = (event) => {\n secretName.value = event.target.value;\n };\n const setSecretValue = (event) => {\n secretValue.value = event.target.value;\n };\n const selectSecret = (name) => {\n secretName.value = name;\n secretValueInput.value?.focus();\n };\n const visitWorkflow = (id) => {\n window.location.href = `/workflows/${id}`;\n };\n const loadHelp = async (event) => {\n if (!event.target.open || helpLoaded.value || helpLoading.value || !helpContent.value) return;\n helpLoading.value = true;\n helpContent.value.textContent = 'Loading workflow syntax help...';\n try {\n const response = await fetch('/help?embed=1', { headers: { accept: 'text/html' } });\n if (!response.ok) throw new Error(`Help request failed: ${response.status}`);\n const html = await response.text();\n const parsed = new DOMParser().parseFromString(html, 'text/html');\n const sourceNodes = [\n ...Array.from(parsed.head.querySelectorAll('style')),\n ...Array.from(parsed.body.childNodes),\n ];\n const nodes = sourceNodes.map((node) => document.importNode(node, true));\n helpContent.value.replaceChildren(...nodes);\n helpLoaded.value = true;\n } catch (error) {\n helpContent.value.textContent = 'Unable to load workflow syntax help.';\n console.error(error);\n } finally {\n helpLoading.value = false;\n }\n };\n\n onDestroy(() => clearTimeout(validationTimer));\n\n onInit(() => {\n const loadPage =\n page === 'editor'\n ? initialId\n ? openWorkflow(initialId)\n : Promise.resolve()\n : Promise.all([loadWorkflows(), loadSecrets()]);\n loadPage.catch((error) => showNotice(error.message, true));\n });\n\n return {\n workflows,\n secrets,\n source,\n validation,\n workflowId,\n enabled,\n readOnly,\n selectedId,\n secretName,\n secretValue,\n notice,\n noticeError,\n busy,\n validate,\n save,\n publish,\n remove,\n saveSecret,\n removeSecret,\n setSource,\n setWorkflowId,\n setEnabled,\n setSecretName,\n setSecretValue,\n selectSecret,\n visitWorkflow,\n loadHelp,\n };\n }\n <\/script>\n </template>\n\n <script type=\"module\">\n import '@li3/web';\n <\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n </body>\n</html>\n";
|
|
5581
|
+
var Vi = {
|
|
5582
|
+
openapi: "3.0.3",
|
|
5583
|
+
info: {
|
|
5584
|
+
title: "On Workflow Runner API",
|
|
5585
|
+
version: "1.0.0",
|
|
5586
|
+
description: "Control-plane, job, workflow, webhook, event, secret, artifact, and notification APIs for the On workflow runner."
|
|
5587
|
+
},
|
|
5588
|
+
servers: [{ url: "/" }],
|
|
5589
|
+
security: [{ bearerAuth: [] }, { basicAuth: [] }],
|
|
5590
|
+
tags: [
|
|
5591
|
+
{ name: "discovery" },
|
|
5592
|
+
{ name: "jobs" },
|
|
5593
|
+
{ name: "workflows" },
|
|
5594
|
+
{ name: "secrets" },
|
|
5595
|
+
{ name: "events" },
|
|
5596
|
+
{ name: "webhooks" },
|
|
5597
|
+
{ name: "notifications" }
|
|
5598
|
+
],
|
|
5599
|
+
paths: {
|
|
5600
|
+
"/api": { get: {
|
|
5601
|
+
tags: ["discovery"],
|
|
5602
|
+
summary: "Get this OpenAPI specification",
|
|
5603
|
+
security: [],
|
|
5604
|
+
responses: { 200: {
|
|
5605
|
+
description: "OpenAPI JSON document",
|
|
5606
|
+
content: { "application/json": { schema: { type: "object" } } }
|
|
5607
|
+
} }
|
|
5608
|
+
} },
|
|
5609
|
+
"/api/jobs": { get: {
|
|
5610
|
+
tags: ["jobs"],
|
|
5611
|
+
summary: "List jobs",
|
|
5612
|
+
security: [],
|
|
5613
|
+
parameters: [
|
|
5614
|
+
{ $ref: "#/components/parameters/AfterId" },
|
|
5615
|
+
{ $ref: "#/components/parameters/BeforeId" },
|
|
5616
|
+
{ $ref: "#/components/parameters/Limit" },
|
|
5617
|
+
{ $ref: "#/components/parameters/Filter" }
|
|
5618
|
+
],
|
|
5619
|
+
responses: { 200: {
|
|
5620
|
+
description: "Dashboard job list",
|
|
5621
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/JobList" } } }
|
|
5622
|
+
} }
|
|
5623
|
+
} },
|
|
5624
|
+
"/api/jobs/{jobId}/cancel": { post: {
|
|
5625
|
+
tags: ["jobs"],
|
|
5626
|
+
summary: "Cancel an active job",
|
|
5627
|
+
parameters: [{ $ref: "#/components/parameters/JobId" }],
|
|
5628
|
+
responses: {
|
|
5629
|
+
200: {
|
|
5630
|
+
description: "Job cancelled",
|
|
5631
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/JobStatus" } } }
|
|
5632
|
+
},
|
|
5633
|
+
404: { $ref: "#/components/responses/NotFound" },
|
|
5634
|
+
409: { $ref: "#/components/responses/Conflict" }
|
|
5635
|
+
}
|
|
5636
|
+
} },
|
|
5637
|
+
"/api/jobs/{jobId}/secrets": { get: {
|
|
5638
|
+
tags: ["jobs"],
|
|
5639
|
+
summary: "Get secrets for an assigned worker job",
|
|
5640
|
+
security: [{ workerBearerAuth: [] }],
|
|
5641
|
+
parameters: [{ $ref: "#/components/parameters/JobId" }, { $ref: "#/components/parameters/WorkerId" }],
|
|
5642
|
+
responses: {
|
|
5643
|
+
200: {
|
|
5644
|
+
description: "Decrypted job secrets",
|
|
5645
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/Secrets" } } }
|
|
5646
|
+
},
|
|
5647
|
+
403: { $ref: "#/components/responses/Forbidden" }
|
|
5648
|
+
}
|
|
5649
|
+
} },
|
|
5650
|
+
"/api/runs/{jobId}": { get: {
|
|
5651
|
+
tags: ["jobs"],
|
|
5652
|
+
summary: "Get a run view",
|
|
5653
|
+
parameters: [{ $ref: "#/components/parameters/JobId" }],
|
|
5654
|
+
responses: {
|
|
5655
|
+
200: {
|
|
5656
|
+
description: "Run details",
|
|
5657
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/RunView" } } }
|
|
5658
|
+
},
|
|
5659
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5660
|
+
}
|
|
5661
|
+
} },
|
|
5662
|
+
"/api/runs/{jobId}/artifacts/{path}": { get: {
|
|
5663
|
+
tags: ["jobs"],
|
|
5664
|
+
summary: "Download an artifact",
|
|
5665
|
+
parameters: [{ $ref: "#/components/parameters/JobId" }, {
|
|
5666
|
+
name: "path",
|
|
5667
|
+
in: "path",
|
|
5668
|
+
required: !0,
|
|
5669
|
+
schema: { type: "string" }
|
|
5670
|
+
}],
|
|
5671
|
+
responses: {
|
|
5672
|
+
200: {
|
|
5673
|
+
description: "Artifact bytes",
|
|
5674
|
+
content: { "application/octet-stream": { schema: {
|
|
5675
|
+
type: "string",
|
|
5676
|
+
format: "binary"
|
|
5677
|
+
} } }
|
|
5678
|
+
},
|
|
5679
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5680
|
+
}
|
|
5681
|
+
} },
|
|
5682
|
+
"/api/workflows/validate": { post: {
|
|
5683
|
+
tags: ["workflows"],
|
|
5684
|
+
summary: "Validate workflow YAML",
|
|
5685
|
+
requestBody: {
|
|
5686
|
+
required: !0,
|
|
5687
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/WorkflowSource" } } }
|
|
5688
|
+
},
|
|
5689
|
+
responses: {
|
|
5690
|
+
200: {
|
|
5691
|
+
description: "Valid workflow definitions",
|
|
5692
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/ValidationResult" } } }
|
|
5693
|
+
},
|
|
5694
|
+
422: { $ref: "#/components/responses/ValidationError" }
|
|
5695
|
+
}
|
|
5696
|
+
} },
|
|
5697
|
+
"/api/workflows": { get: {
|
|
5698
|
+
tags: ["workflows"],
|
|
5699
|
+
summary: "List workflows",
|
|
5700
|
+
responses: { 200: {
|
|
5701
|
+
description: "Workflow list",
|
|
5702
|
+
content: { "application/json": { schema: {
|
|
5703
|
+
type: "object",
|
|
5704
|
+
properties: { workflows: {
|
|
5705
|
+
type: "array",
|
|
5706
|
+
items: { $ref: "#/components/schemas/Workflow" }
|
|
5707
|
+
} }
|
|
5708
|
+
} } }
|
|
5709
|
+
} }
|
|
5710
|
+
} },
|
|
5711
|
+
"/api/workflows/{workflowId}": {
|
|
5712
|
+
get: {
|
|
5713
|
+
tags: ["workflows"],
|
|
5714
|
+
summary: "Get a workflow or historical revision",
|
|
5715
|
+
parameters: [{ $ref: "#/components/parameters/WorkflowId" }, { $ref: "#/components/parameters/Revision" }],
|
|
5716
|
+
responses: {
|
|
5717
|
+
200: {
|
|
5718
|
+
description: "Workflow definition",
|
|
5719
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/Workflow" } } }
|
|
5720
|
+
},
|
|
5721
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5722
|
+
}
|
|
5723
|
+
},
|
|
5724
|
+
put: {
|
|
5725
|
+
tags: ["workflows"],
|
|
5726
|
+
summary: "Save a workflow draft",
|
|
5727
|
+
parameters: [{ $ref: "#/components/parameters/WorkflowId" }],
|
|
5728
|
+
requestBody: {
|
|
5729
|
+
required: !0,
|
|
5730
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/WorkflowSave" } } }
|
|
5731
|
+
},
|
|
5732
|
+
responses: {
|
|
5733
|
+
200: {
|
|
5734
|
+
description: "Draft saved",
|
|
5735
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/Workflow" } } }
|
|
5736
|
+
},
|
|
5737
|
+
422: { $ref: "#/components/responses/ValidationError" }
|
|
5738
|
+
}
|
|
5739
|
+
},
|
|
5740
|
+
delete: {
|
|
5741
|
+
tags: ["workflows"],
|
|
5742
|
+
summary: "Delete a workflow and its revisions",
|
|
5743
|
+
parameters: [{ $ref: "#/components/parameters/WorkflowId" }],
|
|
5744
|
+
responses: {
|
|
5745
|
+
204: { description: "Workflow deleted" },
|
|
5746
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5749
|
+
},
|
|
5750
|
+
"/api/workflows/{workflowId}/publish": { post: {
|
|
5751
|
+
tags: ["workflows"],
|
|
5752
|
+
summary: "Publish the latest workflow revision",
|
|
5753
|
+
parameters: [{ $ref: "#/components/parameters/WorkflowId" }],
|
|
5754
|
+
responses: {
|
|
5755
|
+
200: {
|
|
5756
|
+
description: "Workflow published",
|
|
5757
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/Workflow" } } }
|
|
5758
|
+
},
|
|
5759
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5760
|
+
}
|
|
5761
|
+
} },
|
|
5762
|
+
"/api/secrets": { get: {
|
|
5763
|
+
tags: ["secrets"],
|
|
5764
|
+
summary: "List secret names",
|
|
5765
|
+
responses: { 200: {
|
|
5766
|
+
description: "Secret names",
|
|
5767
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/SecretNames" } } }
|
|
5768
|
+
} }
|
|
5769
|
+
} },
|
|
5770
|
+
"/api/secrets/{name}": {
|
|
5771
|
+
put: {
|
|
5772
|
+
tags: ["secrets"],
|
|
5773
|
+
summary: "Create or replace an encrypted secret",
|
|
5774
|
+
parameters: [{ $ref: "#/components/parameters/SecretName" }],
|
|
5775
|
+
requestBody: {
|
|
5776
|
+
required: !0,
|
|
5777
|
+
content: { "application/json": { schema: { $ref: "#/components/schemas/SecretValue" } } }
|
|
5778
|
+
},
|
|
5779
|
+
responses: { 204: { description: "Secret saved" } }
|
|
5780
|
+
},
|
|
5781
|
+
delete: {
|
|
5782
|
+
tags: ["secrets"],
|
|
5783
|
+
summary: "Delete a secret",
|
|
5784
|
+
parameters: [{ $ref: "#/components/parameters/SecretName" }],
|
|
5785
|
+
responses: {
|
|
5786
|
+
204: { description: "Secret deleted" },
|
|
5787
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5790
|
+
},
|
|
5791
|
+
"/api/events": {
|
|
5792
|
+
get: {
|
|
5793
|
+
tags: ["events"],
|
|
5794
|
+
summary: "Subscribe to runner events",
|
|
5795
|
+
security: [],
|
|
5796
|
+
responses: { 200: {
|
|
5797
|
+
description: "Server-sent event stream",
|
|
5798
|
+
content: { "text/event-stream": { schema: { type: "string" } } }
|
|
5799
|
+
} }
|
|
5800
|
+
},
|
|
5801
|
+
post: {
|
|
5802
|
+
tags: ["events"],
|
|
5803
|
+
summary: "Publish a worker job-change event",
|
|
5804
|
+
security: [{ workerBearerAuth: [] }],
|
|
5805
|
+
requestBody: { content: { "application/json": { schema: { $ref: "#/components/schemas/JobEvent" } } } },
|
|
5806
|
+
responses: { 202: { description: "Event accepted" } }
|
|
5807
|
+
}
|
|
5808
|
+
},
|
|
5809
|
+
"/api/push/public-key": { get: {
|
|
5810
|
+
tags: ["notifications"],
|
|
5811
|
+
summary: "Get the Web Push public key",
|
|
5812
|
+
security: [],
|
|
5813
|
+
responses: { 200: {
|
|
5814
|
+
description: "VAPID public key",
|
|
5815
|
+
content: { "application/json": { schema: {
|
|
5816
|
+
type: "object",
|
|
5817
|
+
properties: { publicKey: { type: "string" } }
|
|
5818
|
+
} } }
|
|
5819
|
+
} }
|
|
5820
|
+
} },
|
|
5821
|
+
"/api/push/subscriptions": {
|
|
5822
|
+
post: {
|
|
5823
|
+
tags: ["notifications"],
|
|
5824
|
+
summary: "Register a Web Push subscription",
|
|
5825
|
+
security: [],
|
|
5826
|
+
requestBody: {
|
|
5827
|
+
required: !0,
|
|
5828
|
+
content: { "application/json": { schema: { type: "object" } } }
|
|
5829
|
+
},
|
|
5830
|
+
responses: { 201: { description: "Subscription saved" } }
|
|
5831
|
+
},
|
|
5832
|
+
delete: {
|
|
5833
|
+
tags: ["notifications"],
|
|
5834
|
+
summary: "Remove a Web Push subscription",
|
|
5835
|
+
security: [],
|
|
5836
|
+
requestBody: {
|
|
5837
|
+
required: !0,
|
|
5838
|
+
content: { "application/json": { schema: {
|
|
5839
|
+
type: "object",
|
|
5840
|
+
required: ["endpoint"],
|
|
5841
|
+
properties: { endpoint: {
|
|
5842
|
+
type: "string",
|
|
5843
|
+
format: "uri"
|
|
5844
|
+
} }
|
|
5845
|
+
} } }
|
|
5846
|
+
},
|
|
5847
|
+
responses: { 204: { description: "Subscription removed" } }
|
|
5848
|
+
}
|
|
5849
|
+
},
|
|
5850
|
+
"/webhooks/{provider}": { post: {
|
|
5851
|
+
tags: ["webhooks"],
|
|
5852
|
+
summary: "Receive a provider webhook",
|
|
5853
|
+
security: [],
|
|
5854
|
+
parameters: [{
|
|
5855
|
+
name: "provider",
|
|
5856
|
+
in: "path",
|
|
5857
|
+
required: !0,
|
|
5858
|
+
schema: { type: "string" }
|
|
5859
|
+
}],
|
|
5860
|
+
requestBody: {
|
|
5861
|
+
required: !0,
|
|
5862
|
+
content: { "application/json": { schema: { type: "object" } } }
|
|
5863
|
+
},
|
|
5864
|
+
responses: {
|
|
5865
|
+
202: { description: "Webhook accepted" },
|
|
5866
|
+
401: { $ref: "#/components/responses/Unauthorized" },
|
|
5867
|
+
413: { $ref: "#/components/responses/PayloadTooLarge" }
|
|
5868
|
+
}
|
|
5869
|
+
} },
|
|
5870
|
+
"/restart/{jobId}": { post: {
|
|
5871
|
+
tags: ["jobs"],
|
|
5872
|
+
summary: "Create a new run from the active workflow revision",
|
|
5873
|
+
parameters: [{ $ref: "#/components/parameters/JobId" }],
|
|
5874
|
+
responses: {
|
|
5875
|
+
201: {
|
|
5876
|
+
description: "New job created",
|
|
5877
|
+
content: { "application/json": { schema: {
|
|
5878
|
+
type: "object",
|
|
5879
|
+
properties: { id: { type: "integer" } }
|
|
5880
|
+
} } }
|
|
5881
|
+
},
|
|
5882
|
+
404: { $ref: "#/components/responses/NotFound" }
|
|
5883
|
+
}
|
|
5884
|
+
} },
|
|
5885
|
+
"/admin/reload-secrets": { post: {
|
|
5886
|
+
tags: ["secrets"],
|
|
5887
|
+
summary: "Reload legacy in-memory secrets",
|
|
5888
|
+
responses: {
|
|
5889
|
+
200: { description: "Secrets reloaded" },
|
|
5890
|
+
403: { $ref: "#/components/responses/Forbidden" }
|
|
5891
|
+
}
|
|
5892
|
+
} }
|
|
5893
|
+
},
|
|
5894
|
+
components: {
|
|
5895
|
+
securitySchemes: {
|
|
5896
|
+
bearerAuth: {
|
|
5897
|
+
type: "http",
|
|
5898
|
+
scheme: "bearer"
|
|
5899
|
+
},
|
|
5900
|
+
basicAuth: {
|
|
5901
|
+
type: "http",
|
|
5902
|
+
scheme: "basic"
|
|
5903
|
+
},
|
|
5904
|
+
workerBearerAuth: {
|
|
5905
|
+
type: "http",
|
|
5906
|
+
scheme: "bearer",
|
|
5907
|
+
description: "RUNNER_WORKER_SECRET"
|
|
5908
|
+
}
|
|
5909
|
+
},
|
|
5910
|
+
parameters: {
|
|
5911
|
+
JobId: {
|
|
5912
|
+
name: "jobId",
|
|
5913
|
+
in: "path",
|
|
5914
|
+
required: !0,
|
|
5915
|
+
schema: {
|
|
5916
|
+
type: "integer",
|
|
5917
|
+
minimum: 1
|
|
5918
|
+
}
|
|
5919
|
+
},
|
|
5920
|
+
WorkflowId: {
|
|
5921
|
+
name: "workflowId",
|
|
5922
|
+
in: "path",
|
|
5923
|
+
required: !0,
|
|
5924
|
+
schema: {
|
|
5925
|
+
type: "string",
|
|
5926
|
+
pattern: "^[a-z0-9-]+$"
|
|
5927
|
+
}
|
|
5928
|
+
},
|
|
5929
|
+
Revision: {
|
|
5930
|
+
name: "revision",
|
|
5931
|
+
in: "query",
|
|
5932
|
+
required: !1,
|
|
5933
|
+
schema: {
|
|
5934
|
+
type: "integer",
|
|
5935
|
+
minimum: 1
|
|
5936
|
+
}
|
|
5937
|
+
},
|
|
5938
|
+
SecretName: {
|
|
5939
|
+
name: "name",
|
|
5940
|
+
in: "path",
|
|
5941
|
+
required: !0,
|
|
5942
|
+
schema: {
|
|
5943
|
+
type: "string",
|
|
5944
|
+
pattern: "^[A-Z][A-Z0-9_]*$"
|
|
5945
|
+
}
|
|
5946
|
+
},
|
|
5947
|
+
WorkerId: {
|
|
5948
|
+
name: "X-Runner-Worker-Id",
|
|
5949
|
+
in: "header",
|
|
5950
|
+
required: !0,
|
|
5951
|
+
schema: { type: "string" }
|
|
5952
|
+
},
|
|
5953
|
+
AfterId: {
|
|
5954
|
+
name: "afterId",
|
|
5955
|
+
in: "query",
|
|
5956
|
+
schema: {
|
|
5957
|
+
type: "integer",
|
|
5958
|
+
minimum: 0
|
|
5959
|
+
}
|
|
5960
|
+
},
|
|
5961
|
+
BeforeId: {
|
|
5962
|
+
name: "beforeId",
|
|
5963
|
+
in: "query",
|
|
5964
|
+
schema: {
|
|
5965
|
+
type: "integer",
|
|
5966
|
+
minimum: 1
|
|
5967
|
+
}
|
|
5968
|
+
},
|
|
5969
|
+
Limit: {
|
|
5970
|
+
name: "limit",
|
|
5971
|
+
in: "query",
|
|
5972
|
+
schema: {
|
|
5973
|
+
type: "integer",
|
|
5974
|
+
minimum: 1,
|
|
5975
|
+
maximum: 500,
|
|
5976
|
+
default: 50
|
|
5977
|
+
}
|
|
5978
|
+
},
|
|
5979
|
+
Filter: {
|
|
5980
|
+
name: "filter",
|
|
5981
|
+
in: "query",
|
|
5982
|
+
schema: {
|
|
5983
|
+
type: "string",
|
|
5984
|
+
maxLength: 200
|
|
5985
|
+
}
|
|
5986
|
+
}
|
|
5987
|
+
},
|
|
5988
|
+
responses: {
|
|
5989
|
+
Unauthorized: { description: "Unauthorized" },
|
|
5990
|
+
Forbidden: { description: "Forbidden" },
|
|
5991
|
+
NotFound: { description: "Not found" },
|
|
5992
|
+
Conflict: { description: "Conflict" },
|
|
5993
|
+
ValidationError: { description: "Validation error" },
|
|
5994
|
+
PayloadTooLarge: { description: "Payload too large" }
|
|
5995
|
+
},
|
|
5996
|
+
schemas: {
|
|
5997
|
+
Job: {
|
|
5998
|
+
type: "object",
|
|
5999
|
+
properties: {
|
|
6000
|
+
id: { type: "integer" },
|
|
6001
|
+
workflowId: { type: "string" },
|
|
6002
|
+
status: { type: "string" },
|
|
6003
|
+
workerId: { type: ["string", "null"] },
|
|
6004
|
+
createdAt: { type: "string" },
|
|
6005
|
+
updatedAt: { type: "string" }
|
|
6006
|
+
}
|
|
6007
|
+
},
|
|
6008
|
+
JobList: {
|
|
6009
|
+
type: "object",
|
|
6010
|
+
required: ["jobs", "hasMore"],
|
|
6011
|
+
properties: {
|
|
6012
|
+
jobs: {
|
|
6013
|
+
type: "array",
|
|
6014
|
+
items: { $ref: "#/components/schemas/Job" }
|
|
6015
|
+
},
|
|
6016
|
+
hasMore: { type: "boolean" }
|
|
6017
|
+
}
|
|
6018
|
+
},
|
|
6019
|
+
JobStatus: {
|
|
6020
|
+
type: "object",
|
|
6021
|
+
properties: {
|
|
6022
|
+
id: { type: "integer" },
|
|
6023
|
+
status: { type: "string" }
|
|
6024
|
+
}
|
|
6025
|
+
},
|
|
6026
|
+
JobEvent: {
|
|
6027
|
+
type: "object",
|
|
6028
|
+
properties: { jobId: { type: "integer" } }
|
|
6029
|
+
},
|
|
6030
|
+
Workflow: {
|
|
6031
|
+
type: "object",
|
|
6032
|
+
properties: {
|
|
6033
|
+
id: { type: "string" },
|
|
6034
|
+
name: { type: "string" },
|
|
6035
|
+
sourceYaml: { type: "string" },
|
|
6036
|
+
revision: { type: "integer" },
|
|
6037
|
+
status: { type: "string" },
|
|
6038
|
+
enabled: { type: "boolean" }
|
|
6039
|
+
}
|
|
6040
|
+
},
|
|
6041
|
+
WorkflowSource: {
|
|
6042
|
+
type: "object",
|
|
6043
|
+
required: ["sourceYaml"],
|
|
6044
|
+
properties: { sourceYaml: { type: "string" } }
|
|
6045
|
+
},
|
|
6046
|
+
WorkflowSave: { allOf: [{ $ref: "#/components/schemas/WorkflowSource" }, {
|
|
6047
|
+
type: "object",
|
|
6048
|
+
properties: { enabled: { type: "boolean" } }
|
|
6049
|
+
}] },
|
|
6050
|
+
ValidationResult: {
|
|
6051
|
+
type: "object",
|
|
6052
|
+
properties: {
|
|
6053
|
+
valid: { type: "boolean" },
|
|
6054
|
+
workflows: {
|
|
6055
|
+
type: "array",
|
|
6056
|
+
items: { type: "object" }
|
|
6057
|
+
}
|
|
6058
|
+
}
|
|
6059
|
+
},
|
|
6060
|
+
SecretNames: {
|
|
6061
|
+
type: "object",
|
|
6062
|
+
properties: { secrets: {
|
|
6063
|
+
type: "array",
|
|
6064
|
+
items: { type: "string" }
|
|
6065
|
+
} }
|
|
6066
|
+
},
|
|
6067
|
+
SecretValue: {
|
|
6068
|
+
type: "object",
|
|
6069
|
+
required: ["value"],
|
|
6070
|
+
properties: { value: {
|
|
6071
|
+
type: "string",
|
|
6072
|
+
format: "password"
|
|
6073
|
+
} }
|
|
6074
|
+
},
|
|
6075
|
+
Secrets: {
|
|
6076
|
+
type: "object",
|
|
6077
|
+
properties: { secrets: {
|
|
6078
|
+
type: "object",
|
|
6079
|
+
additionalProperties: { type: "string" }
|
|
6080
|
+
} }
|
|
6081
|
+
},
|
|
6082
|
+
RunView: {
|
|
6083
|
+
type: "object",
|
|
6084
|
+
properties: {
|
|
6085
|
+
jobId: { type: "string" },
|
|
6086
|
+
workflowName: { type: "string" },
|
|
6087
|
+
status: { type: "string" },
|
|
6088
|
+
inputs: { type: "object" },
|
|
6089
|
+
steps: {
|
|
6090
|
+
type: "array",
|
|
6091
|
+
items: { type: "object" }
|
|
6092
|
+
},
|
|
6093
|
+
artifacts: {
|
|
6094
|
+
type: "array",
|
|
6095
|
+
items: { type: "string" }
|
|
6096
|
+
},
|
|
6097
|
+
canViewLogs: { type: "boolean" }
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
}
|
|
6101
|
+
}
|
|
6102
|
+
}, Hi = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"theme-color\" content=\"#030712\" />\n <meta name=\"mobile-web-app-capable\" content=\"yes\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n <link rel=\"icon\" href=\"/app-icon.svg\" type=\"image/svg+xml\" />\n <title>Runner Workflow Management</title>\n <script type=\"importmap\">\n { \"imports\": { \"@li3/\": \"https://cdn.li3.dev/@li3/\" } }\n <\/script>\n <style>\n body[data-page='list'] .editor-panel {\n display: none;\n }\n body[data-page='editor'] .workflow-list,\n body[data-page='editor'] .secrets-panel {\n display: none;\n }\n </style>\n </head>\n <body data-page=\"__WORKFLOW_PAGE__\" class=\"min-h-screen bg-gray-950 p-4 font-sans text-gray-100 md:p-6\">\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/code-editor.html\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/code-block.html\" />\n <link rel=\"component\" href=\"https://sodium.static.apphor.de/lucide-icon.html\" />\n\n <template app>\n <main class=\"mx-auto max-w-6xl space-y-5\">\n <header class=\"flex flex-col gap-4 border-b border-gray-800 pb-5 sm:flex-row sm:items-end sm:justify-between\">\n <div class=\"flex items-start gap-3\">\n <a\n href=\"/runs\"\n aria-label=\"Back to dashboard\"\n class=\"mt-1 rounded-lg border border-gray-800 bg-gray-900 p-2 text-gray-400 transition hover:border-indigo-500/60 hover:text-indigo-300\"\n >\n <lucide-icon icon=\"arrow-left\" size=\"17\"></lucide-icon>\n </a>\n <div>\n <p class=\"text-xs font-semibold uppercase tracking-[0.18em] text-indigo-400\">Runner engine</p>\n <h1 class=\"mt-1 text-2xl font-bold tracking-tight text-white\">Workflow control room</h1>\n <p class=\"mt-1 text-sm text-gray-400\">Draft, validate, and publish revisioned YAML definitions.</p>\n </div>\n </div>\n <a\n href=\"/workflows/new\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg bg-indigo-500 px-4 py-2.5 text-sm font-semibold text-white shadow-lg shadow-indigo-950/40 transition hover:bg-indigo-400\"\n >\n <lucide-icon icon=\"plus\" size=\"16\"></lucide-icon>\n New workflow\n </a>\n <a\n href=\"/help\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-800 bg-gray-900 px-3 py-2.5 text-sm font-medium text-gray-300 outline-none transition hover:border-indigo-500/50 hover:text-indigo-200 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <path d=\"M9.6 9a2.5 2.5 0 1 1 4.2 1.8c-1.2 1-1.8 1.4-1.8 2.7\"></path>\n <path d=\"M12 17h.01\"></path>\n </svg>\n Help\n </a>\n </header>\n\n <template if=\"notice\">\n <div\n role=\"status\"\n class=\"flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm\"\n bind-class=\"noticeError ? 'border-rose-500/40 bg-rose-500/10 text-rose-100' : 'border-emerald-500/40 bg-emerald-500/10 text-emerald-100'\"\n >\n <lucide-icon bind-icon=\"noticeError ? 'circle-alert' : 'circle-check'\" size=\"17\"></lucide-icon>\n <span>{{ notice }}</span>\n </div>\n </template>\n\n <section id=\"workflow-layout\" class=\"space-y-5\">\n <nav\n class=\"workflow-list rounded-2xl border border-gray-800 bg-gray-900/80 p-4 shadow-xl shadow-black/10\"\n aria-labelledby=\"workflow-list-title\"\n >\n <div class=\"mb-4 flex items-end justify-between gap-3 border-b border-gray-800 pb-4\">\n <div>\n <p class=\"text-[11px] font-semibold uppercase tracking-[0.18em] text-indigo-400\">Definitions</p>\n <h2 id=\"workflow-list-title\" class=\"mt-1 text-lg font-semibold text-white\">Workflows</h2>\n </div>\n <span\n class=\"rounded-full border border-gray-700 bg-gray-950 px-2.5 py-1 text-xs font-mono text-gray-400\"\n aria-label=\"Workflow count\"\n >\n {{ workflows.length }}\n </span>\n </div>\n <ul class=\"grid gap-2\" aria-label=\"Workflow definitions\">\n <template for=\"workflow of workflows\">\n <li>\n <a\n attr-href=\"'/workflows/' + workflow.id\"\n class=\"group flex min-h-16 items-center gap-3 rounded-xl border border-gray-800 bg-gray-950/50 px-3.5 py-3 text-left text-sm text-gray-300 outline-none transition hover:border-indigo-500/50 hover:bg-indigo-500/10 focus-visible:border-indigo-400 focus-visible:ring-2 focus-visible:ring-indigo-400/50\"\n >\n <span\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-800 text-gray-400 transition group-hover:bg-indigo-500/15 group-hover:text-indigo-300\"\n >\n <lucide-icon icon=\"workflow\" size=\"17\"></lucide-icon>\n </span>\n <span class=\"min-w-0 flex-1\">\n <span class=\"block truncate font-medium text-gray-100\">{{ workflow.name }}</span>\n <span class=\"mt-0.5 block truncate font-mono text-[11px] text-gray-500\">{{ workflow.id }}</span>\n </span>\n <span\n class=\"rounded-full border px-2 py-1 text-[10px] font-semibold uppercase tracking-wide\"\n bind-class=\"workflow.status === 'published' ? 'border-emerald-500/30 bg-emerald-500/10 text-emerald-300' : workflow.status === 'archived' ? 'border-gray-700 bg-gray-800 text-gray-500' : 'border-amber-500/30 bg-amber-500/10 text-amber-300'\"\n >{{ workflow.status }}</span\n >\n <lucide-icon\n icon=\"arrow-up-right\"\n size=\"16\"\n class=\"shrink-0 text-gray-600 transition group-hover:text-indigo-300\"\n ></lucide-icon>\n </a>\n </li>\n </template>\n </ul>\n <div\n class=\"rounded-xl border border-dashed border-gray-700 px-4 py-8 text-center\"\n class-hidden=\"workflows.length > 0\"\n >\n <lucide-icon icon=\"workflow\" size=\"22\" class=\"mx-auto text-gray-600\"></lucide-icon>\n <p class=\"mt-2 text-sm font-medium text-gray-300\">No workflows yet</p>\n <p class=\"mt-1 text-xs text-gray-500\">Create a definition to start automating jobs.</p>\n </div>\n </nav>\n\n <section\n class=\"editor-panel overflow-hidden rounded-xl border border-gray-800 bg-gray-900/80 shadow-xl shadow-black/10\"\n >\n <div class=\"border-b border-gray-800 px-4 pt-3 sm:px-5\">\n <a\n href=\"/workflows\"\n class=\"inline-flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium text-gray-400 outline-none transition hover:bg-gray-800 hover:text-gray-100 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <lucide-icon icon=\"arrow-left\" size=\"14\"></lucide-icon>\n Back to workflows\n </a>\n </div>\n <div class=\"border-b border-gray-800 bg-gray-900 px-4 py-4 sm:px-5\">\n <div class=\"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between\">\n <label class=\"block max-w-xl flex-1 text-xs font-semibold uppercase tracking-wider text-gray-400\"\n >Workflow ID\n <input\n bind-value=\"workflowId\"\n on-input=\"setWorkflowId($event)\"\n bind-disabled=\"selectedId\"\n aria-describedby=\"workflow-id-help\"\n class=\"mt-2 w-full rounded-lg border border-gray-700 bg-gray-950 px-3 py-2.5 font-mono text-sm normal-case tracking-normal text-white outline-none transition focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20\"\n placeholder=\"derived-from-workflow-name\"\n />\n <span\n id=\"workflow-id-help\"\n class=\"mt-1 block text-[11px] font-normal normal-case tracking-normal text-gray-500\"\n >The ID becomes permanent after the first save.</span\n >\n </label>\n <label class=\"inline-flex items-center gap-2 text-sm text-gray-300\">\n <input\n type=\"checkbox\"\n bind-checked=\"enabled\"\n on-change=\"setEnabled($event)\"\n class=\"h-4 w-4 rounded border-gray-700 bg-gray-950 text-indigo-500 focus:ring-2 focus:ring-indigo-500/30\"\n />\n Enabled\n </label>\n <div class=\"flex flex-wrap gap-2\" class-hidden=\"readOnly\">\n <button\n type=\"button\"\n aria-label=\"Save workflow draft\"\n title=\"Save workflow draft\"\n on-click=\"save()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center gap-2 rounded-lg bg-indigo-500 px-3 py-2.5 text-sm font-semibold text-white transition hover:bg-indigo-400 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon icon=\"save\" size=\"16\"></lucide-icon>\n <span class=\"hidden sm:inline\">Save draft</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Publish workflow\"\n title=\"Publish workflow\"\n on-click=\"publish()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center gap-2 rounded-lg border border-emerald-500/50 px-3 py-2.5 text-sm font-medium text-emerald-300 transition hover:bg-emerald-500/10 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon icon=\"rocket\" size=\"16\"></lucide-icon>\n <span class=\"hidden sm:inline\">Publish</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Delete workflow\"\n title=\"Delete workflow\"\n on-click=\"remove()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center gap-2 rounded-lg border border-rose-500/50 px-3 py-2.5 text-sm font-medium text-rose-300 transition hover:bg-rose-500/10 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon icon=\"trash\" size=\"16\"></lucide-icon>\n <span class=\"hidden sm:inline\">Delete</span>\n </button>\n </div>\n </div>\n </div>\n <div class=\"p-3 sm:p-5\">\n <div class=\"mb-2 flex items-center justify-between px-1 text-xs text-gray-500\">\n <div class=\"flex items-center gap-2\">\n <button\n type=\"button\"\n aria-label=\"Validate workflow\"\n title=\"Validate workflow\"\n on-click=\"validate(1)\"\n bind-disabled=\"validation.running\"\n bind-class=\"{ 'hidden': readOnly, 'text-emerald-400': validation.valid, 'text-rose-400': !validation.valid }\"\n class=\"disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <lucide-icon\n class=\"inline-block\"\n bind-icon=\"validation.running ? 'loader-circle' : (validation.valid ? 'circle-check' : 'circle-alert')\"\n bind-class=\"validation.running ? 'animate-spin' : ''\"\n size=\"16\"\n ></lucide-icon>\n </button>\n <span class=\"font-medium\" bind-class=\"validation.error ? 'bg-rose-500/10 text-rose-100' : ''\"\n >{{ validation.error || '' }}</span\n >\n </div>\n <span class=\"font-mono\">{{ source.length }} characters</span>\n </div>\n <template if=\"readOnly\">\n <code-block\n language=\"yaml\"\n theme=\"atom-one-dark\"\n class=\"block h-[calc(100vh-23rem)] min-h-[28rem] overflow-auto rounded-lg border border-gray-700 bg-gray-950 p-4\"\n bind-source=\"source\"\n ></code-block>\n </template>\n <template if=\"!readOnly\">\n <code-editor\n id=\"source-yaml\"\n language=\"yaml\"\n theme=\"atom-one-dark\"\n nostatus=\"true\"\n class=\"block h-[calc(100vh-23rem)] min-h-[28rem] overflow-hidden rounded-lg border border-gray-700 bg-gray-950\"\n bind-value=\"source\"\n on-change=\"setSource($event.detail)\"\n ></code-editor>\n </template>\n <details\n class=\"mt-4 overflow-hidden rounded-xl border border-gray-800 bg-gray-950/50\"\n on-toggle=\"loadHelp($event)\"\n >\n <summary\n class=\"cursor-pointer list-none px-4 py-3 text-sm font-medium text-gray-300 outline-none transition hover:bg-gray-900 focus-visible:ring-2 focus-visible:ring-indigo-400/60\"\n >\n <span class=\"inline-flex items-center gap-2\"\n ><lucide-icon icon=\"circle-question-mark\" size=\"16\"></lucide-icon>Syntax</span\n >\n <span class=\"ml-2 text-xs font-normal text-gray-500\">Reference, tutorials, and examples</span>\n </summary>\n <div\n ref=\"helpContent\"\n class=\"max-h-[38rem] overflow-y-auto border-t border-gray-800 bg-gray-950 px-4 py-5\"\n role=\"region\"\n aria-label=\"Workflow syntax help\"\n aria-live=\"polite\"\n >\n <p class=\"text-sm text-gray-500\">Expand to load the workflow syntax reference.</p>\n </div>\n </details>\n </div>\n </section>\n </section>\n\n <section\n class=\"secrets-panel rounded-2xl border border-gray-800 bg-gray-900/80 p-4 shadow-xl shadow-black/10 sm:p-5\"\n aria-labelledby=\"secrets-title\"\n >\n <div class=\"mb-5 flex items-start justify-between gap-3\">\n <div class=\"flex items-start gap-3\">\n <span class=\"rounded-lg bg-indigo-500/10 p-2 text-indigo-300\"\n ><lucide-icon icon=\"key-round\" size=\"18\"></lucide-icon\n ></span>\n <div>\n <h2 id=\"secrets-title\" class=\"text-lg font-semibold text-white\">Secrets</h2>\n <p class=\"mt-0.5 text-sm text-gray-400\">Write-only credentials available to workflows.</p>\n </div>\n </div>\n <span\n class=\"rounded-full border border-gray-700 bg-gray-950 px-2.5 py-1 text-xs font-mono text-gray-400\"\n aria-label=\"Secret count\"\n >{{ secrets.length }}</span\n >\n </div>\n <div class=\"mb-5 rounded-xl border border-gray-800 bg-gray-950/50 p-3\">\n <p class=\"mb-3 text-xs text-gray-500\">Saving an existing name replaces its encrypted value.</p>\n <div class=\"grid gap-3 md:grid-cols-[14rem_1fr_auto_auto]\">\n <label class=\"sr-only\" for=\"secret-name\">Secret name</label>\n <input\n id=\"secret-name\"\n bind-value=\"secretName\"\n on-input=\"setSecretName($event)\"\n class=\"rounded-lg border border-gray-700 bg-gray-900 px-3 py-2.5 font-mono text-sm uppercase outline-none transition placeholder:text-gray-600 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/30\"\n placeholder=\"NPM_TOKEN\"\n />\n <label class=\"sr-only\" for=\"secret-value\">Secret value</label>\n <input\n id=\"secret-value\"\n ref=\"secretValueInput\"\n bind-value=\"secretValue\"\n on-input=\"setSecretValue($event)\"\n type=\"password\"\n class=\"rounded-lg border border-gray-700 bg-gray-900 px-3 py-2.5 font-mono text-sm outline-none transition placeholder:text-gray-600 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/30\"\n placeholder=\"New secret value\"\n />\n <button\n type=\"button\"\n aria-label=\"Save secret value\"\n title=\"Save secret value\"\n on-click=\"saveSecret()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg border border-indigo-500/60 px-3 py-2.5 text-sm font-medium text-indigo-200 outline-none transition hover:bg-indigo-500/10 focus-visible:ring-2 focus-visible:ring-indigo-400/60 disabled:opacity-50\"\n >\n <lucide-icon icon=\"lock-keyhole\" size=\"16\"></lucide-icon><span class=\"hidden sm:inline\">Save</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Delete secret\"\n title=\"Delete secret\"\n on-click=\"removeSecret()\"\n bind-disabled=\"busy\"\n class=\"inline-flex items-center justify-center gap-2 rounded-lg border border-rose-500/50 px-3 py-2.5 text-sm font-medium text-rose-300 outline-none transition hover:bg-rose-500/10 focus-visible:ring-2 focus-visible:ring-rose-400/60 disabled:opacity-50\"\n >\n <lucide-icon icon=\"trash\" size=\"16\"></lucide-icon><span class=\"hidden sm:inline\">Delete</span>\n </button>\n </div>\n </div>\n <ul class=\"grid gap-2\" aria-label=\"Saved secrets\">\n <template for=\"name of secrets\">\n <li>\n <button\n type=\"button\"\n on-click=\"selectSecret(name)\"\n class=\"group flex min-h-14 w-full items-center gap-3 rounded-xl border border-gray-800 bg-gray-950/50 px-3.5 py-3 text-left outline-none transition hover:border-indigo-500/50 hover:bg-indigo-500/10 focus-visible:border-indigo-400 focus-visible:ring-2 focus-visible:ring-indigo-400/50\"\n aria-label=\"Edit secret {{ name }}\"\n >\n <span\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-800 text-gray-500 group-hover:text-indigo-300\"\n ><lucide-icon icon=\"key-round\" size=\"15\"></lucide-icon\n ></span>\n <span class=\"min-w-0 flex-1 truncate font-mono text-sm text-gray-200\">{{ name }}</span>\n <span class=\"text-xs text-gray-500\">Select</span>\n <lucide-icon\n icon=\"chevron-right\"\n size=\"16\"\n class=\"text-gray-600 transition group-hover:text-indigo-300\"\n ></lucide-icon>\n </button>\n </li>\n </template>\n </ul>\n <div\n class=\"rounded-xl border border-dashed border-gray-700 px-4 py-8 text-center\"\n class-hidden=\"secrets.length > 0\"\n >\n <lucide-icon icon=\"key-round\" size=\"22\" class=\"mx-auto text-gray-600\"></lucide-icon>\n <p class=\"mt-2 text-sm font-medium text-gray-300\">No secrets configured</p>\n <p class=\"mt-1 text-xs text-gray-500\">Add one above to make it available to a workflow.</p>\n </div>\n </section>\n </main>\n\n <script setup>\n import { onDestroy, onInit, ref, templateRef } from '@li3/web';\n\n export default function () {\n const page = document.body.dataset.page;\n const initialId = __WORKFLOW_ID__;\n const initialRevision = __WORKFLOW_REVISION__;\n const readOnly = Boolean(initialRevision);\n const workflows = ref([]);\n const secrets = ref([]);\n const source = ref('');\n const validation = ref({ valid: true });\n const savedSource = ref('');\n const workflowId = ref('');\n const enabled = ref(true);\n const savedEnabled = ref(true);\n const selectedId = ref('');\n const secretName = ref('');\n const secretValue = ref('');\n const notice = ref('');\n const noticeError = ref(false);\n const busy = ref(false);\n const secretValueInput = templateRef('secretValueInput');\n const helpContent = templateRef('helpContent');\n const helpLoaded = ref(false);\n const helpLoading = ref(false);\n let validationTimer;\n\n const showNotice = (message, error = false) => {\n notice.value = message;\n noticeError.value = error;\n };\n\n const api = async (url, options = {}) => {\n const response = await fetch(url, {\n headers: { accept: 'application/json', ...(options.body ? { 'content-type': 'application/json' } : {}) },\n ...options,\n });\n const body = response.status === 204 ? null : await response.json().catch(() => ({}));\n if (!response.ok) throw new Error(body.error || `Request failed: ${response.status}`);\n return body;\n };\n\n const derivedId = () =>\n source.value\n .match(/^\\s*(?:id:\\s*([^\\n]+)|name:\\s*([^\\n]+))/m)\n ?.slice(1)\n .find(Boolean)\n ?.trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '-')\n .replace(/(^-|-$)/g, '') || '';\n\n const run = async (action) => {\n if (busy.value) return;\n\n busy.value = true;\n\n try {\n await action();\n } catch (error) {\n showNotice(error.message, true);\n } finally {\n busy.value = false;\n }\n };\n\n const loadWorkflows = async () => {\n workflows.value = (await api('/api/workflows')).workflows;\n };\n\n const loadSecrets = async () => {\n secrets.value = (await api('/api/secrets')).secrets;\n };\n\n const openWorkflow = async (id) => {\n const workflowUrl = initialRevision\n ? `/api/workflows/${id}?revision=${initialRevision}`\n : `/api/workflows/${id}`;\n const workflow = await api(workflowUrl);\n selectedId.value = workflow.id;\n workflowId.value = workflow.id;\n source.value = workflow.sourceYaml;\n savedSource.value = workflow.sourceYaml;\n enabled.value = workflow.enabled;\n savedEnabled.value = workflow.enabled;\n };\n\n const validateSource = async () => {\n validation.value = await api('/api/workflows/validate', {\n method: 'POST',\n body: JSON.stringify({ sourceYaml: source.value }),\n });\n };\n\n const validate = (ms = 1000) => {\n if (page !== 'editor') return;\n\n clearTimeout(validationTimer);\n validationTimer = setTimeout(() => {\n validation.running = true;\n validateSource();\n }, ms);\n };\n\n const save = () =>\n run(async () => {\n const id = workflowId.value.trim() || derivedId();\n if (!id) throw new Error('Set an ID or add a workflow name first.');\n if (\n initialId &&\n id === selectedId.value &&\n source.value === savedSource.value &&\n enabled.value === savedEnabled.value\n ) {\n showNotice('No changes to save.');\n return;\n }\n const workflow = await api(`/api/workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify({ sourceYaml: source.value, enabled: enabled.value }),\n });\n selectedId.value = workflow.id;\n workflowId.value = workflow.id;\n savedSource.value = source.value;\n savedEnabled.value = enabled.value;\n showNotice(`Saved ${workflow.id} as draft revision ${workflow.revision}.`);\n if (!initialId) history.replaceState(null, '', `/workflows/${workflow.id}`);\n });\n const publish = () =>\n run(async () => {\n const id = workflowId.value.trim() || selectedId.value;\n if (!id) throw new Error('Save a workflow before publishing it.');\n const workflow = await api(`/api/workflows/${id}/publish`, { method: 'POST' });\n selectedId.value = workflow.id;\n showNotice(`Published ${workflow.id} revision ${workflow.revision}.`);\n });\n const remove = () =>\n run(async () => {\n const id = workflowId.value.trim() || selectedId.value;\n if (!id || !confirm(`Delete ${id} and all of its revisions?`)) return;\n await api(`/api/workflows/${id}`, { method: 'DELETE' });\n window.location.href = '/workflows';\n });\n const saveSecret = () =>\n run(async () => {\n const name = secretName.value.trim();\n if (!name || !secretValue.value) throw new Error('Set a secret name and value first.');\n await api(`/api/secrets/${name}`, { method: 'PUT', body: JSON.stringify({ value: secretValue.value }) });\n secretValue.value = '';\n await loadSecrets();\n showNotice(`Saved ${name}.`);\n });\n const removeSecret = () =>\n run(async () => {\n const name = secretName.value.trim();\n if (!name || !confirm(`Delete ${name}?`)) return;\n await api(`/api/secrets/${name}`, { method: 'DELETE' });\n secretName.value = '';\n secretValue.value = '';\n await loadSecrets();\n showNotice(`Deleted ${name}.`);\n });\n const setSource = (value) => {\n source.value = value;\n validate();\n };\n const setWorkflowId = (event) => {\n workflowId.value = event.target.value;\n };\n const setEnabled = (event) => {\n enabled.value = event.target.checked;\n };\n const setSecretName = (event) => {\n secretName.value = event.target.value;\n };\n const setSecretValue = (event) => {\n secretValue.value = event.target.value;\n };\n const selectSecret = (name) => {\n secretName.value = name;\n secretValueInput.value?.focus();\n };\n const visitWorkflow = (id) => {\n window.location.href = `/workflows/${id}`;\n };\n const loadHelp = async (event) => {\n if (!event.target.open || helpLoaded.value || helpLoading.value || !helpContent.value) return;\n helpLoading.value = true;\n helpContent.value.textContent = 'Loading workflow syntax help...';\n try {\n const response = await fetch('/help?embed=1', { headers: { accept: 'text/html' } });\n if (!response.ok) throw new Error(`Help request failed: ${response.status}`);\n const html = await response.text();\n const parsed = new DOMParser().parseFromString(html, 'text/html');\n const sourceNodes = [\n ...Array.from(parsed.head.querySelectorAll('style')),\n ...Array.from(parsed.body.childNodes),\n ];\n const nodes = sourceNodes.map((node) => document.importNode(node, true));\n helpContent.value.replaceChildren(...nodes);\n helpLoaded.value = true;\n } catch (error) {\n helpContent.value.textContent = 'Unable to load workflow syntax help.';\n console.error(error);\n } finally {\n helpLoading.value = false;\n }\n };\n\n onDestroy(() => clearTimeout(validationTimer));\n\n onInit(() => {\n const loadPage =\n page === 'editor'\n ? initialId\n ? openWorkflow(initialId)\n : Promise.resolve()\n : Promise.all([loadWorkflows(), loadSecrets()]);\n loadPage.catch((error) => showNotice(error.message, true));\n });\n\n return {\n workflows,\n secrets,\n source,\n validation,\n workflowId,\n enabled,\n readOnly,\n selectedId,\n secretName,\n secretValue,\n notice,\n noticeError,\n busy,\n validate,\n save,\n publish,\n remove,\n saveSecret,\n removeSecret,\n setSource,\n setWorkflowId,\n setEnabled,\n setSecretName,\n setSecretValue,\n selectSecret,\n visitWorkflow,\n loadHelp,\n };\n }\n <\/script>\n </template>\n\n <script type=\"module\">\n import '@li3/web';\n <\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n </body>\n</html>\n";
|
|
5592
6103
|
//#endregion
|
|
5593
6104
|
//#region src/workflows-ui.ts
|
|
5594
6105
|
function Ui(e, t = "", n) {
|
|
@@ -10056,20 +10567,20 @@ var Yc = class {
|
|
|
10056
10567
|
server;
|
|
10057
10568
|
preprocessors = /* @__PURE__ */ new Map();
|
|
10058
10569
|
workflows = new Yc();
|
|
10059
|
-
secretRepository = new
|
|
10570
|
+
secretRepository = new $n();
|
|
10060
10571
|
queue;
|
|
10061
10572
|
secrets;
|
|
10062
10573
|
push;
|
|
10063
10574
|
adminToken;
|
|
10064
10575
|
workerToken;
|
|
10065
|
-
events = new
|
|
10576
|
+
events = new ve();
|
|
10066
10577
|
workflowsLoaded;
|
|
10067
10578
|
static async withPort(t) {
|
|
10068
10579
|
let { port: n, ...r } = t;
|
|
10069
10580
|
return new e(r).listen(n);
|
|
10070
10581
|
}
|
|
10071
10582
|
constructor(e) {
|
|
10072
|
-
this.queue = e.queue, this.secrets = e.secrets, this.push = new
|
|
10583
|
+
this.queue = e.queue, this.secrets = e.secrets, this.push = new er(e.config), this.adminToken = e.adminToken, this.workerToken = e.config.workerToken, this.workflowsLoaded = Promise.all([this.workflows.init(), this.secretRepository.init()]).then(() => void 0), this.registerPreprocessor(new Ce()), this.server = d.createServer((e, t) => this.handleRequest(e, t));
|
|
10073
10584
|
}
|
|
10074
10585
|
registerPreprocessor(e) {
|
|
10075
10586
|
this.preprocessors.set(e.name, e);
|
|
@@ -10079,20 +10590,24 @@ var Yc = class {
|
|
|
10079
10590
|
if (e.method === "GET" && n.pathname === "/manifest.webmanifest") return t.writeHead(200, {
|
|
10080
10591
|
"Cache-Control": "public, max-age=3600",
|
|
10081
10592
|
"Content-Type": "application/manifest+json"
|
|
10082
|
-
}), t.end(
|
|
10593
|
+
}), t.end(we);
|
|
10083
10594
|
if (e.method === "GET" && n.pathname === "/app-icon.svg") return t.writeHead(200, {
|
|
10084
10595
|
"Cache-Control": "public, max-age=86400",
|
|
10085
10596
|
"Content-Type": "image/svg+xml"
|
|
10086
|
-
}), t.end(
|
|
10597
|
+
}), t.end(Te);
|
|
10087
10598
|
if (e.method === "GET" && n.pathname === "/service-worker.js") return t.writeHead(200, {
|
|
10088
10599
|
"Cache-Control": "no-cache",
|
|
10089
10600
|
"Content-Type": "text/javascript; charset=utf-8"
|
|
10090
|
-
}), t.end(
|
|
10601
|
+
}), t.end(Ee);
|
|
10091
10602
|
if (e.method === "GET" && (n.pathname === "/runs" || n.pathname === "/")) return this.renderDashboard(t);
|
|
10092
10603
|
if (e.method === "GET" && n.pathname === "/help") return t.writeHead(200, {
|
|
10093
10604
|
"Content-Type": "text/html; charset=utf-8",
|
|
10094
10605
|
"Cache-Control": "no-store"
|
|
10095
|
-
}), t.end(
|
|
10606
|
+
}), t.end(Bi(n.searchParams.get("embed") === "1"));
|
|
10607
|
+
if (e.method === "GET" && n.pathname === "/api") return t.writeHead(200, {
|
|
10608
|
+
"Cache-Control": "no-store",
|
|
10609
|
+
"Content-Type": "application/json; charset=utf-8"
|
|
10610
|
+
}), t.end(JSON.stringify(Vi));
|
|
10096
10611
|
if (e.method === "GET" && n.pathname === "/workflows") return this.requireAdmin(e, t) ? (t.writeHead(200, {
|
|
10097
10612
|
"Content-Type": "text/html; charset=utf-8",
|
|
10098
10613
|
"Cache-Control": "no-store"
|
|
@@ -10219,21 +10734,21 @@ var Yc = class {
|
|
|
10219
10734
|
if (r.on.provider !== e) continue;
|
|
10220
10735
|
let n = this.preprocessors.get(e);
|
|
10221
10736
|
if (n?.filter && !n.filter(t, r.on).isValid) {
|
|
10222
|
-
|
|
10737
|
+
qn(`⏩ Skipped ${r.id} based on ${e} webhook filters`, { inputs: t });
|
|
10223
10738
|
continue;
|
|
10224
10739
|
}
|
|
10225
10740
|
if (r.on.if) try {
|
|
10226
|
-
if (!await
|
|
10227
|
-
|
|
10741
|
+
if (!await Xn.evaluateConditions(r.on.if, { inputs: t })) {
|
|
10742
|
+
qn(`⏩ Skipped ${r.id} based on conditions: ${r.on.if}`, { inputs: t });
|
|
10228
10743
|
continue;
|
|
10229
10744
|
}
|
|
10230
10745
|
} catch (e) {
|
|
10231
10746
|
console.error(`⚠️ Condition evaluation error in workflow [${r.id}]:`, e.message);
|
|
10232
10747
|
continue;
|
|
10233
10748
|
}
|
|
10234
|
-
for (let e of
|
|
10749
|
+
for (let e of Zn(r)) {
|
|
10235
10750
|
let n = "";
|
|
10236
|
-
e.concurrency?.group && (n = await
|
|
10751
|
+
e.concurrency?.group && (n = await Xn.evaluateValue(e.concurrency.group, { inputs: t }));
|
|
10237
10752
|
let a = {
|
|
10238
10753
|
inputs: t,
|
|
10239
10754
|
matrix: e.matrixContext
|
|
@@ -10409,8 +10924,7 @@ var Yc = class {
|
|
|
10409
10924
|
}
|
|
10410
10925
|
}
|
|
10411
10926
|
async renderDashboard(e) {
|
|
10412
|
-
|
|
10413
|
-
e.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), e.end(r);
|
|
10927
|
+
e.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), e.end(_e());
|
|
10414
10928
|
}
|
|
10415
10929
|
async renderDashboardJobs(e, t, n, r, i) {
|
|
10416
10930
|
let a;
|
|
@@ -10419,7 +10933,7 @@ var Yc = class {
|
|
|
10419
10933
|
} catch (t) {
|
|
10420
10934
|
return e.writeHead(400, { "Content-Type": "application/json; charset=utf-8" }), e.end(JSON.stringify({ error: t.message }));
|
|
10421
10935
|
}
|
|
10422
|
-
let o =
|
|
10936
|
+
let o = ge(a.slice(0, t)), s = await this.redactText(JSON.stringify({
|
|
10423
10937
|
jobs: o,
|
|
10424
10938
|
hasMore: a.length > t
|
|
10425
10939
|
}));
|
|
@@ -10434,12 +10948,12 @@ var Yc = class {
|
|
|
10434
10948
|
let e = n === "json" ? "application/json; charset=utf-8" : "text/html; charset=utf-8";
|
|
10435
10949
|
return t.writeHead(404, { "Content-Type": e }), t.end(n === "json" ? JSON.stringify({ error: "Run not found" }) : "<h1>404 - Run Not Found</h1>");
|
|
10436
10950
|
}
|
|
10437
|
-
let a = r ? await this.queue.getJobLogs(e) : {}, o = await this.currentSecrets(), s = await this.workflows.getRevision(i.workflow_id, i.workflow_revision), c = r ? await this.workflows.getRevisionSnapshot(i.workflow_id, i.workflow_revision) : null, l =
|
|
10951
|
+
let a = r ? await this.queue.getJobLogs(e) : {}, o = await this.currentSecrets(), s = await this.workflows.getRevision(i.workflow_id, i.workflow_revision), c = r ? await this.workflows.getRevisionSnapshot(i.workflow_id, i.workflow_revision) : null, l = ke(i, a, (e) => this.redact(e, o), s?.steps, r, c?.sourceYaml);
|
|
10438
10952
|
if (n === "json") return t.writeHead(200, {
|
|
10439
10953
|
"Cache-Control": "no-store",
|
|
10440
10954
|
"Content-Type": "application/json; charset=utf-8"
|
|
10441
10955
|
}), t.end(JSON.stringify(l));
|
|
10442
|
-
t.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), t.end(
|
|
10956
|
+
t.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), t.end(Ae(l));
|
|
10443
10957
|
}
|
|
10444
10958
|
async handleRestartJob(e, t, n) {
|
|
10445
10959
|
if (!this.requireAdmin(e, n)) return;
|
|
@@ -10564,7 +11078,7 @@ var Yc = class {
|
|
|
10564
11078
|
"-e",
|
|
10565
11079
|
"-c",
|
|
10566
11080
|
t.command
|
|
10567
|
-
]),
|
|
11081
|
+
]), qn("$ systemd-run", [
|
|
10568
11082
|
...c,
|
|
10569
11083
|
"--",
|
|
10570
11084
|
...u
|
|
@@ -10673,7 +11187,7 @@ var Yc = class {
|
|
|
10673
11187
|
"-e",
|
|
10674
11188
|
"-c",
|
|
10675
11189
|
t.command
|
|
10676
|
-
]),
|
|
11190
|
+
]), qn("$ " + s, c.join(" "));
|
|
10677
11191
|
let u;
|
|
10678
11192
|
try {
|
|
10679
11193
|
u = h(s, c, {
|
|
@@ -10847,7 +11361,7 @@ async function fl(e, t, n) {
|
|
|
10847
11361
|
let r = 1e3;
|
|
10848
11362
|
for (; !t.aborted;) {
|
|
10849
11363
|
try {
|
|
10850
|
-
await
|
|
11364
|
+
await ye(e.serverUrl, t, (t, r) => {
|
|
10851
11365
|
t === "jobs.available" && (Array.isArray(r.tags) ? r.tags.filter((e) => typeof e == "string") : []).every((t) => e.tags.includes(t)) && n();
|
|
10852
11366
|
}, n), r = 1e3;
|
|
10853
11367
|
} catch (e) {
|
|
@@ -10888,9 +11402,9 @@ async function hl(e, t) {
|
|
|
10888
11402
|
body: JSON.stringify({ jobId: t }),
|
|
10889
11403
|
signal: AbortSignal.timeout(5e3)
|
|
10890
11404
|
});
|
|
10891
|
-
n.ok ||
|
|
11405
|
+
n.ok || qn(`Failed to publish job status event: HTTP ${n.status}`);
|
|
10892
11406
|
} catch (e) {
|
|
10893
|
-
|
|
11407
|
+
qn("Failed to publish job status event:", e);
|
|
10894
11408
|
}
|
|
10895
11409
|
}
|
|
10896
11410
|
async function gl(e, t, n) {
|
|
@@ -10914,7 +11428,7 @@ async function _l(e) {
|
|
|
10914
11428
|
console.log(`\n[${t}] 📦 Claimed Job #${n.id} (Workflow: ${n.workflow_id})`);
|
|
10915
11429
|
let s = typeof n.payload == "string" ? JSON.parse(n.payload) : n.payload;
|
|
10916
11430
|
if (!e.workflow) throw Error(`Workflow ${n.workflow_id} revision ${n.workflow_revision} was not resolved`);
|
|
10917
|
-
let c = s.matrix ?
|
|
11431
|
+
let c = s.matrix ? Zn(e.workflow).find((e) => JSON.stringify(e.matrixContext) === JSON.stringify(s.matrix)) : e.workflow;
|
|
10918
11432
|
if (!c) throw Error(`Matrix variant for job ${n.id} was not found`);
|
|
10919
11433
|
let l = c, u = {
|
|
10920
11434
|
...e,
|
|
@@ -10926,7 +11440,7 @@ async function _l(e) {
|
|
|
10926
11440
|
steps: {},
|
|
10927
11441
|
logsDir: h,
|
|
10928
11442
|
workingDir: g,
|
|
10929
|
-
files:
|
|
11443
|
+
files: Yn(g)
|
|
10930
11444
|
}, v = "", y = d.map((e, t) => (e.id ||= `step-${t}`, e.name ||= e.id, {
|
|
10931
11445
|
id: e.id,
|
|
10932
11446
|
name: e.name,
|
|
@@ -10937,7 +11451,7 @@ async function _l(e) {
|
|
|
10937
11451
|
})), b = jl(n, "running", p, f, _.env, y, s);
|
|
10938
11452
|
await o.saveReport(n.id, b), hl(r, n.id);
|
|
10939
11453
|
try {
|
|
10940
|
-
Object.assign(_.env, await xl(l.env, _)), Ol(l.secretFiles, a.getAll(), g), v = l.cache ? String(await
|
|
11454
|
+
Object.assign(_.env, await xl(l.env, _)), Ol(l.secretFiles, a.getAll(), g), v = l.cache ? String(await Xn.evaluateValue(l.cache.key, _)) : "", v && l.cache && await Dl(o, "cache", `${n.workflow_id}:${v}`, l.cache.paths, g), await o.saveReport(n.id, b);
|
|
10941
11455
|
} catch (e) {
|
|
10942
11456
|
b.status = "failed", b.finishedAt = (/* @__PURE__ */ new Date()).toISOString(), b.durationMs = Date.now() - p;
|
|
10943
11457
|
let r = {
|
|
@@ -11045,7 +11559,7 @@ async function vl(e, t) {
|
|
|
11045
11559
|
}
|
|
11046
11560
|
async function yl(e) {
|
|
11047
11561
|
let { step: t, stepIndex: n, executionContext: r } = e;
|
|
11048
|
-
if (t.id ||= `step-${n}`, t.name ||= t.id, t.if && !await
|
|
11562
|
+
if (t.id ||= `step-${n}`, t.name ||= t.id, t.if && !await Xn.evaluateConditions(t.if, r)) return qn(`⏩ Skipped step ${t.id} based on condition: ${t.if}`, r), {
|
|
11049
11563
|
failed: !1,
|
|
11050
11564
|
cancelled: !1,
|
|
11051
11565
|
skipped: !0,
|
|
@@ -11078,7 +11592,7 @@ async function yl(e) {
|
|
|
11078
11592
|
});
|
|
11079
11593
|
} catch (n) {
|
|
11080
11594
|
let i = n?.message || String(n);
|
|
11081
|
-
return await e.queue.saveStepLog(e.jobId, t.id, `[STEP ERROR]:\n${i}`),
|
|
11595
|
+
return await e.queue.saveStepLog(e.jobId, t.id, `[STEP ERROR]:\n${i}`), qn(`⏩ Failed to run step ${t.id}`, r, n), {
|
|
11082
11596
|
failed: !0,
|
|
11083
11597
|
cancelled: !1,
|
|
11084
11598
|
skipped: !1,
|
|
@@ -11100,7 +11614,7 @@ async function bl(e) {
|
|
|
11100
11614
|
try {
|
|
11101
11615
|
let e = new Promise((e, t) => {
|
|
11102
11616
|
l = setTimeout(() => t(/* @__PURE__ */ Error(`Step timed out after ${n.timeoutMs}ms`)), n.timeoutMs), l.unref();
|
|
11103
|
-
}), u = await Promise.race([
|
|
11617
|
+
}), u = await Promise.race([Xn.evaluateExpression(a.eval, r), e]);
|
|
11104
11618
|
r.steps[s] = {
|
|
11105
11619
|
status: "success",
|
|
11106
11620
|
exitCode: 0,
|
|
@@ -11147,7 +11661,7 @@ async function bl(e) {
|
|
|
11147
11661
|
}
|
|
11148
11662
|
async function xl(e, t) {
|
|
11149
11663
|
let n = {};
|
|
11150
|
-
if (e) for (let [r, i] of Object.entries(e)) n[r] = String(await
|
|
11664
|
+
if (e) for (let [r, i] of Object.entries(e)) n[r] = String(await Xn.evaluateValue(i, {
|
|
11151
11665
|
...t,
|
|
11152
11666
|
env: {
|
|
11153
11667
|
...t.env,
|
|
@@ -11373,7 +11887,7 @@ var Il = class {
|
|
|
11373
11887
|
scheduledFor: i.toISOString(),
|
|
11374
11888
|
...n
|
|
11375
11889
|
} };
|
|
11376
|
-
for (let n of
|
|
11890
|
+
for (let n of Zn(e)) {
|
|
11377
11891
|
let r = {
|
|
11378
11892
|
inputs: o,
|
|
11379
11893
|
matrix: n.matrixContext
|