curriculum-api 0.1.0 → 0.2.0
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/{admin-U7LVEF3Y.js → admin-LLA7YFBM.js} +1357 -438
- package/dist/chunk-2BZOKT6H.js +877 -0
- package/dist/{chunk-RL62MWPL.js → chunk-IM5Z67ZH.js} +79 -40
- package/dist/cli.js +19 -5
- package/dist/index.d.ts +20 -2
- package/dist/index.js +1129 -131
- package/drizzle/0003_zippy_frank_castle.sql +1 -0
- package/drizzle/0004_woozy_bloodaxe.sql +2 -0
- package/drizzle/0005_little_kronos.sql +8 -0
- package/drizzle/0006_drop_master_cv.sql +3 -0
- package/drizzle/0007_graceful_karma.sql +5 -0
- package/drizzle/meta/0003_snapshot.json +556 -0
- package/drizzle/meta/0004_snapshot.json +549 -0
- package/drizzle/meta/0005_snapshot.json +595 -0
- package/drizzle/meta/0006_snapshot.json +589 -0
- package/drizzle/meta/0007_snapshot.json +621 -0
- package/drizzle/meta/_journal.json +35 -0
- package/package.json +10 -3
- package/dist/chunk-N6XNQ5R5.js +0 -463
|
@@ -3,29 +3,38 @@ import {
|
|
|
3
3
|
ADMIN_SESSION_SECONDS,
|
|
4
4
|
DomainError,
|
|
5
5
|
ForbiddenError,
|
|
6
|
+
KINDS,
|
|
7
|
+
KIND_META,
|
|
6
8
|
LIMIT_NAMES,
|
|
7
9
|
LlmUnavailableError,
|
|
8
10
|
MODEL_AREAS,
|
|
11
|
+
MONTHS,
|
|
9
12
|
NotFoundError,
|
|
10
13
|
PAGE_SIZES,
|
|
11
14
|
PAGE_SIZE_KEY,
|
|
12
15
|
SETTINGS_KEYS,
|
|
13
16
|
VISIBILITIES,
|
|
14
17
|
ValidationError,
|
|
18
|
+
bandFor,
|
|
15
19
|
clearAdminCookie,
|
|
16
20
|
clientIp,
|
|
21
|
+
fieldLabel,
|
|
17
22
|
findPii,
|
|
23
|
+
formValues,
|
|
24
|
+
groupByKind,
|
|
25
|
+
leftOut,
|
|
18
26
|
limitKey,
|
|
27
|
+
metaLine,
|
|
19
28
|
modelKey,
|
|
20
|
-
renderMarkdown,
|
|
21
29
|
setAdminCookie,
|
|
22
30
|
setSessionCookie,
|
|
23
31
|
signSession,
|
|
32
|
+
temperatureKey,
|
|
24
33
|
verifySession
|
|
25
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-2BZOKT6H.js";
|
|
26
35
|
|
|
27
36
|
// src/admin/index.tsx
|
|
28
|
-
import { Hono as
|
|
37
|
+
import { Hono as Hono10 } from "hono";
|
|
29
38
|
import { createMiddleware as createMiddleware2 } from "hono/factory";
|
|
30
39
|
|
|
31
40
|
// src/middleware/require-admin.ts
|
|
@@ -59,11 +68,55 @@ import { Hono } from "hono";
|
|
|
59
68
|
var CHAT_PAGE_JS = '"use strict";(()=>{var i=e=>document.getElementById(e),f=i("chat-page"),p=f.dataset.base,E=encodeURIComponent(f.dataset.token),T=`${p}/api/r/${E}`,y=`${p}/admin/chat/${E}/session`,M=i("who"),L=i("remaining"),w=i("status"),l=i("log"),P=i("ask"),d=i("question"),R=i("send"),h=[],C=!1,c=!1,v={chat_revoked:"This link was revoked.",chat_expired:"This link has expired.",limit_reached:"The question quota for this link is used up.",llm_unavailable:"The model is unavailable. The question was not counted. Try again.",not_found:"This link does not exist.",unauthorized:"The chat session was not accepted."};function u(e){w.textContent=e}function m(e){C=e,R.disabled=e,d.disabled=e}function g(e,n){let s=document.createElement("div");return s.className=`msg ${e}`,s.textContent=n,l.appendChild(s),s}function S(e){let n=s=>{let o=s?v[s]:void 0;o||(o=e.status===400?"The request was rejected.":`Request failed (${e.status}).`);let r=new Error(o);return r.status=e.status,r};return e.json().then(s=>n(s?.error),()=>n(void 0))}function b(){return fetch(y,{method:"POST",credentials:"same-origin"}).then(e=>{if(e.redirected)throw new Error("Your admin session ended. Sign in again.");if(e.status===410)throw new Error("This link is revoked or expired.");if(e.status===404)throw new Error(v.not_found);if(!e.ok)throw new Error(`Could not start the chat session (${e.status}).`)})}function $(e){return fetch(`${T}/chat`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:e})})}function x(e){e!=null&&(L.textContent=String(e))}function H(){return fetch(T,{credentials:"same-origin"}).then(e=>e.ok?e.json():S(e).then(n=>{throw n})).then(e=>(M.textContent=e.recruiterName+(e.company?` (${e.company})`:""),x(e.remaining),b())).catch(e=>{u(e.message),c=!0,m(!0)})}function q(e,n){let s=e.body.getReader(),o=new TextDecoder,r="";function a(){return s.read().then(t=>t.done?(r+=o.decode(),n.textContent=r,r):(r+=o.decode(t.value,{stream:!0}),n.textContent=r,a()))}return a()}function I(e){let n=h.concat([{role:"user",content:e}]),s=!1;function o(){return $(n).then(t=>t.status===401&&!s?(s=!0,b().then(o)):t)}let r=g("user",e),a=null;return o().then(t=>t.ok?(x(t.headers.get("X-Remaining")),a=g("assistant",""),q(t,a)):S(t).then(k=>{throw k})).then(t=>{h.push({role:"user",content:e},{role:"assistant",content:t}),d.value="",u("")}).catch(t=>{l.removeChild(r),a&&l.removeChild(a),u(t.status?t.message:`The connection was interrupted. ${t.message}`),t.status===410&&(c=!0)})}P.addEventListener("submit",e=>{e.preventDefault();let n=d.value.trim();C||n===""||(u(""),m(!0),I(n).then(()=>{m(c),c||d.focus()}))});u("Loading...");H().then(()=>{w.textContent==="Loading..."&&u("")});})();\n';
|
|
60
69
|
|
|
61
70
|
// src/admin/static/admin-css.generated.ts
|
|
62
|
-
var ADMIN_CSS_VERSION = "
|
|
63
|
-
var admin_css_generated_default = '/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-leading:initial;--tw-tracking:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, sans-serif;--font-mono:"JetBrains Mono", ui-monospace, monospace;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-normal:1.5;--leading-relaxed:1.625;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-display:"Space Grotesk", "Inter", ui-sans-serif, sans-serif;--color-page:#f7f7f8;--color-surface:#fff;--color-subtle:#f1f1f4;--color-row-hover:#fafafa;--color-line:#e4e4e9;--color-ink:#18181b;--color-muted:#5f5f6b;--color-placeholder:#71717a;--color-primary:#4f46e5;--color-primary-hover:#4338ca;--color-primary-strong:#312e81;--color-primary-soft:#eef2ff;--color-on-primary:#fff;--color-success:#15803d;--color-danger:#dc2626;--color-danger-soft:#fef2f2;--radius-control:8px;--radius-card:12px;--text-eyebrow:12px;--text-eyebrow--letter-spacing:1px;--text-h1:34px;--text-h1--line-height:1.15;--text-h1--letter-spacing:-.02em;--text-h2:20px;--text-h2--line-height:1.3;--spacing-control:44px;--spacing-sidebar:240px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{background:var(--color-page);color:var(--color-ink);font-family:var(--font-sans);font-size:15px}body{margin:0}h1,h2,h3{font-family:var(--font-display)}a{color:var(--color-primary-hover)}a:hover{color:var(--color-primary-strong)}:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}::placeholder{color:var(--color-placeholder)}code{font-family:var(--font-mono);font-size:.9em}}@layer components{.app-shell{background-color:var(--color-page);min-height:100vh;color:var(--color-ink);flex-wrap:wrap;display:flex}.sidebar{flex:1 1 var(--spacing-sidebar);gap:calc(var(--spacing) * 8);border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--color-line);background-color:var(--color-surface);max-width:100%;padding-inline:18px;padding-block:calc(var(--spacing) * 7);flex-direction:column;display:flex}.main{min-width:0;padding-inline:clamp(20px,4vw,48px);padding-top:calc(var(--spacing) * 10);padding-bottom:calc(var(--spacing) * 16);flex:999 640px}.main-inner{gap:calc(var(--spacing) * 8);flex-direction:column;max-width:1120px;margin-inline:auto;display:flex}.brand{align-items:center;gap:calc(var(--spacing) * 3);padding-inline:calc(var(--spacing) * 1.5);display:flex}.logo-tile{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:var(--radius-control);background-color:var(--color-primary);font-family:var(--font-display);--tw-font-weight:var(--font-weight-bold);font-size:15px;font-weight:var(--font-weight-bold);color:var(--color-on-primary);justify-content:center;align-items:center;display:flex}.sidebar nav{gap:var(--spacing);flex-direction:column;display:flex}.sidebar nav a{min-height:var(--spacing-control);border-radius:var(--radius-control);padding-inline:calc(var(--spacing) * 3.5);--tw-font-weight:var(--font-weight-medium);font-size:15px;font-weight:var(--font-weight-medium);color:var(--color-muted);align-items:center;text-decoration-line:none;display:flex}@media (hover:hover){.sidebar nav a:hover{background-color:var(--color-subtle);color:var(--color-ink)}}body[data-section=dashboard] .sidebar nav a[href$=\\/admin],body[data-section=profile] .sidebar nav a[href$="/admin/profile"],body[data-section=settings] .sidebar nav a[href$="/admin/settings"],body[data-section=personal-info] .sidebar nav a[href$="/admin/personal-info"],body[data-section=resumes] .sidebar nav a[href$="/admin/resumes"],body[data-section=chats] .sidebar nav a[href$="/admin/chats"]{background-color:var(--color-subtle);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-ink);--tw-shadow:inset 3px 0 0 0 var(--tw-shadow-color,var(--color-primary));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.sidebar-foot{gap:calc(var(--spacing) * 3);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-line);padding-inline:calc(var(--spacing) * 1.5);padding-top:calc(var(--spacing) * 4);flex-direction:column;margin-top:auto;display:flex}.page-header{justify-content:space-between;align-items:flex-end;gap:calc(var(--spacing) * 5);flex-wrap:wrap;display:flex}.page-header-text{gap:calc(var(--spacing) * 2.5);flex-direction:column;min-width:0;display:flex}.eyebrow{font-family:var(--font-mono);font-size:var(--text-eyebrow);letter-spacing:var(--tw-tracking,var(--text-eyebrow--letter-spacing));color:var(--color-success);text-transform:uppercase}.page-title{font-family:var(--font-display);font-size:var(--text-h1);line-height:var(--tw-leading,var(--text-h1--line-height));letter-spacing:var(--tw-tracking,var(--text-h1--letter-spacing));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);margin:0}.page-sub{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--color-muted);margin:0}.section-title{font-family:var(--font-display);font-size:var(--text-h2);line-height:var(--tw-leading,var(--text-h2--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);margin:0}.back-link{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));text-decoration-line:none;display:inline-flex}.btn{min-height:var(--spacing-control);cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-control);border-style:var(--tw-border-style);background-color:var(--color-primary);font-family:var(--font-sans);--tw-font-weight:var(--font-weight-semibold);font-size:15px;font-weight:var(--font-weight-semibold);color:var(--color-on-primary);--tw-shadow:0 1px 2px var(--tw-shadow-color,#18181b1f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-width:0;padding-inline:18px;text-decoration-line:none;display:inline-flex}@media (hover:hover){.btn:hover{background-color:var(--color-primary-hover);color:var(--color-on-primary)}}.btn:active{--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.btn:disabled{cursor:not-allowed;opacity:.5}.btn-ghost{min-height:var(--spacing-control);cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 4);font-family:var(--font-sans);--tw-font-weight:var(--font-weight-medium);font-size:15px;font-weight:var(--font-weight-medium);color:var(--color-ink);text-decoration-line:none;display:inline-flex}@media (hover:hover){.btn-ghost:hover{background-color:var(--color-subtle);color:var(--color-ink)}}.btn-ghost:disabled{cursor:not-allowed;opacity:.5}.btn-sm{min-height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.btn-danger{color:var(--color-danger)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-danger-soft);color:var(--color-danger)}}.actions{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.form{gap:calc(var(--spacing) * 5);flex-direction:column;display:flex}.form-grid{gap:calc(var(--spacing) * 4);grid-template-columns:repeat(auto-fit,minmax(220px,1fr));display:grid}.field{gap:calc(var(--spacing) * 2);flex-direction:column;display:flex}.field-label{--tw-font-weight:var(--font-weight-semibold);font-size:13px;font-weight:var(--font-weight-semibold);color:var(--color-ink)}.field-help{color:var(--color-muted);margin:0;font-size:13px}.input{box-sizing:border-box;min-height:var(--spacing-control);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-page);width:100%;padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2.5);font-family:var(--font-sans);color:var(--color-ink);font-size:15px}textarea.input{resize:vertical;--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}textarea.input.mono{font-family:var(--font-mono);font-size:13px}.checks{column-gap:calc(var(--spacing) * 5);row-gap:calc(var(--spacing) * 2);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);padding:calc(var(--spacing) * 4);flex-wrap:wrap;margin:0;display:flex}.checks legend{padding-inline:var(--spacing);--tw-font-weight:var(--font-weight-semibold);font-size:13px;font-weight:var(--font-weight-semibold)}.check{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));display:inline-flex}.check input{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);accent-color:var(--color-primary)}.card{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface)}.card-pad{gap:calc(var(--spacing) * 5);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding:calc(var(--spacing) * 6);flex-direction:column;display:flex}.empty-state{border-radius:var(--radius-card);border-style:var(--tw-border-style);--tw-border-style:dashed;border-style:dashed;border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 8);padding-block:calc(var(--spacing) * 12);text-align:center;color:var(--color-muted);margin:0}.stats{gap:calc(var(--spacing) * 4);grid-template-columns:repeat(auto-fit,minmax(200px,1fr));margin:0;display:grid}.stat{gap:calc(var(--spacing) * 2);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding:calc(var(--spacing) * 6);flex-direction:column-reverse;display:flex}.stat dt{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-muted)}.stat dd{font-family:var(--font-display);--tw-leading:1;--tw-font-weight:var(--font-weight-bold);font-size:36px;line-height:1;font-weight:var(--font-weight-bold);margin:0}.table-wrap{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);overflow-x:auto}.table{border-collapse:collapse;text-align:left;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table th{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal);--tw-tracking:.5px;letter-spacing:.5px;white-space:nowrap;color:var(--color-muted);text-transform:uppercase}.table td{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-line);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle}.table tbody tr:hover{background-color:var(--color-row-hover)}.table td:last-child{text-align:right}.table .input{min-height:calc(var(--spacing) * 9);padding-block:calc(var(--spacing) * 1.5)}.error{border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-danger);background-color:var(--color-danger-soft);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-danger)}.status{min-height:calc(var(--spacing) * 5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-success);margin:0}.htmx-indicator{display:none}.htmx-request .htmx-indicator,.htmx-request.htmx-indicator{display:inline-flex}.muted{color:var(--color-muted)}.mono{font-family:var(--font-mono)}.editor-grid{align-items:flex-start;gap:calc(var(--spacing) * 6);grid-template-columns:repeat(auto-fit,minmax(380px,1fr));display:grid}.transcript pre{font-family:var(--font-sans);font-size:15px}details.disclosure{border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3)}details.disclosure summary{cursor:pointer;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}details.disclosure pre{margin-top:calc(var(--spacing) * 3);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));white-space:pre-wrap;color:var(--color-muted);margin-bottom:0}.paper{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 10);padding-block:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);--tw-shadow:0 8px 24px var(--tw-shadow-color,#18181b0f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.paper h1{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));margin-top:0}.paper h2{margin-top:calc(var(--spacing) * 6);margin-bottom:calc(var(--spacing) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);padding-bottom:var(--spacing);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.paper h3{margin-top:calc(var(--spacing) * 4);margin-bottom:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.paper ul{padding-left:calc(var(--spacing) * 5)}.transcript{gap:calc(var(--spacing) * 3);flex-direction:column;margin:0;padding:0;list-style-type:none;display:flex}.transcript li{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 5);padding-block:calc(var(--spacing) * 4)}.transcript li[data-role=user]{border-color:var(--color-primary-soft);background-color:var(--color-primary-soft)}.transcript strong{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.transcript time{font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-muted)}#log.chat-log{min-height:calc(var(--spacing) * 40);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 5);padding-block:calc(var(--spacing) * 4)}.chat-log .msg{margin-block:calc(var(--spacing) * 2);white-space:pre-wrap}.chat-log .msg.user{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.status:empty,#pi-error:empty,#created:empty{display:none}.table .actions{flex-wrap:nowrap}.btn,.btn-ghost,.table td.mono{white-space:nowrap}.paper h1,.paper h2,.paper h3{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.paper ul{list-style-type:disc}.paper ol{padding-left:calc(var(--spacing) * 5);list-style-type:decimal}}@layer utilities{.mx-auto{margin-inline:auto}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.block{display:block}.flex{display:flex}.table{display:table}.w-20{width:calc(var(--spacing) * 20)}.w-full{width:100%}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-6{gap:calc(var(--spacing) * 6)}.rounded-control{border-radius:var(--radius-control)}.border{border-style:var(--tw-border-style);border-width:1px}.bg-primary-soft{background-color:var(--color-primary-soft)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-3{padding-block:calc(var(--spacing) * 3)}.font-display{font-family:var(--font-display)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-ink{color:var(--color-ink)}.text-muted{color:var(--color-muted)}}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(fonts/inter.woff2)format("woff2-variations")}@font-face{font-family:Space Grotesk;font-style:normal;font-display:swap;font-weight:300 700;src:url(fonts/space-grotesk.woff2)format("woff2-variations")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:100 800;src:url(fonts/jetbrains-mono.woff2)format("woff2-variations")}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-leading{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}';
|
|
71
|
+
var ADMIN_CSS_VERSION = "6ab4482e60";
|
|
72
|
+
var admin_css_generated_default = '/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-outline-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-leading:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, sans-serif;--font-mono:"JetBrains Mono", ui-monospace, monospace;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-normal:1.5;--leading-relaxed:1.625;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-display:"Space Grotesk", "Inter", ui-sans-serif, sans-serif;--color-page:#f7f7f8;--color-surface:#fff;--color-subtle:#f1f1f4;--color-row-hover:#fafafa;--color-line:#e4e4e9;--color-ink:#18181b;--color-muted:#5f5f6b;--color-placeholder:#71717a;--color-primary:#4f46e5;--color-primary-hover:#4338ca;--color-primary-strong:#312e81;--color-primary-soft:#eef2ff;--color-on-primary:#fff;--color-success:#15803d;--color-danger:#dc2626;--color-danger-soft:#fef2f2;--radius-control:8px;--radius-card:12px;--radius-pill:999px;--shadow-raised:0 8px 24px #18181b0f;--text-eyebrow:12px;--text-eyebrow--letter-spacing:1px;--text-h1:34px;--text-h1--line-height:1.15;--text-h1--letter-spacing:-.02em;--text-h2:20px;--text-h2--line-height:1.3;--spacing-control:44px;--spacing-sidebar:240px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{background:var(--color-page);color:var(--color-ink);font-family:var(--font-sans);font-size:15px}body{margin:0}h1,h2,h3{font-family:var(--font-display)}a{color:var(--color-primary-hover)}a:hover{color:var(--color-primary-strong)}:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}::placeholder{color:var(--color-placeholder)}code{font-family:var(--font-mono);font-size:.9em}}@layer components{.app-shell{background-color:var(--color-page);min-height:100vh;color:var(--color-ink);flex-wrap:wrap;display:flex}.sidebar{flex:1 1 var(--spacing-sidebar);gap:calc(var(--spacing) * 8);border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--color-line);background-color:var(--color-surface);max-width:100%;padding-inline:18px;padding-block:calc(var(--spacing) * 7);flex-direction:column;display:flex}.main{min-width:0;padding-inline:clamp(20px,4vw,48px);padding-top:calc(var(--spacing) * 10);padding-bottom:calc(var(--spacing) * 16);flex:999 640px}.main-inner{gap:calc(var(--spacing) * 8);flex-direction:column;max-width:1120px;margin-inline:auto;display:flex}.brand{align-items:center;gap:calc(var(--spacing) * 3);padding-inline:calc(var(--spacing) * 1.5);display:flex}.logo-tile{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:var(--radius-control);background-color:var(--color-primary);font-family:var(--font-display);--tw-font-weight:var(--font-weight-bold);font-size:15px;font-weight:var(--font-weight-bold);color:var(--color-on-primary);justify-content:center;align-items:center;display:flex}.sidebar nav{gap:var(--spacing);flex-direction:column;display:flex}.sidebar nav a{min-height:var(--spacing-control);align-items:center;gap:calc(var(--spacing) * 3);border-radius:var(--radius-control);padding-inline:calc(var(--spacing) * 3.5);--tw-font-weight:var(--font-weight-medium);font-size:15px;font-weight:var(--font-weight-medium);color:var(--color-muted);text-decoration-line:none;display:flex}@media (hover:hover){.sidebar nav a:hover{background-color:var(--color-subtle);color:var(--color-ink)}}.sidebar nav a svg{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}body[data-section=profile] .sidebar nav a[href$="/admin/profile"],body[data-section=settings] .sidebar nav a[href$="/admin/settings"],body[data-section=personal-info] .sidebar nav a[href$="/admin/personal-info"],body[data-section=resumes] .sidebar nav a[href$="/admin/resumes"],body[data-section=chats] .sidebar nav a[href$="/admin/chats"]{background-color:var(--color-subtle);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-ink);--tw-shadow:inset 3px 0 0 0 var(--tw-shadow-color,var(--color-primary));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.sidebar-foot{gap:calc(var(--spacing) * 3);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-line);padding-inline:calc(var(--spacing) * 1.5);padding-top:calc(var(--spacing) * 4);flex-direction:column;margin-top:auto;display:flex}.page-header{justify-content:space-between;align-items:flex-end;gap:calc(var(--spacing) * 5);flex-wrap:wrap;display:flex}.page-header-text{gap:calc(var(--spacing) * 2.5);flex-direction:column;min-width:0;display:flex}.eyebrow{font-family:var(--font-mono);font-size:var(--text-eyebrow);letter-spacing:var(--tw-tracking,var(--text-eyebrow--letter-spacing));color:var(--color-success);text-transform:uppercase}.page-title{font-family:var(--font-display);font-size:var(--text-h1);line-height:var(--tw-leading,var(--text-h1--line-height));letter-spacing:var(--tw-tracking,var(--text-h1--letter-spacing));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);margin:0}.page-sub{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--color-muted);margin:0}.section-title{font-family:var(--font-display);font-size:var(--text-h2);line-height:var(--tw-leading,var(--text-h2--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);margin:0}.back-link{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));text-decoration-line:none;display:inline-flex}.tabs{margin-block:calc(var(--spacing) * 5);gap:var(--spacing);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);display:flex}.tab{border-bottom-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-muted);border-color:#0000;border-bottom-width:2px;margin-bottom:-1px;text-decoration-line:none}.tab:hover{color:var(--color-ink)}.tab[aria-selected=true]{border-color:var(--color-primary);color:var(--color-ink)}.btn{min-height:var(--spacing-control);cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-control);border-style:var(--tw-border-style);background-color:var(--color-primary);font-family:var(--font-sans);--tw-font-weight:var(--font-weight-semibold);font-size:15px;font-weight:var(--font-weight-semibold);color:var(--color-on-primary);--tw-shadow:0 1px 2px var(--tw-shadow-color,#18181b1f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-width:0;padding-inline:18px;text-decoration-line:none;display:inline-flex}@media (hover:hover){.btn:hover{background-color:var(--color-primary-hover);color:var(--color-on-primary)}}.btn:active{--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.btn:disabled{cursor:not-allowed;opacity:.5}.btn-ghost{min-height:var(--spacing-control);cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 4);font-family:var(--font-sans);--tw-font-weight:var(--font-weight-medium);font-size:15px;font-weight:var(--font-weight-medium);color:var(--color-ink);text-decoration-line:none;display:inline-flex}@media (hover:hover){.btn-ghost:hover{background-color:var(--color-subtle);color:var(--color-ink)}}.btn-ghost:disabled{cursor:not-allowed;opacity:.5}.btn-sm{min-height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.btn-danger{color:var(--color-danger)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-danger-soft);color:var(--color-danger)}}.actions{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.form{gap:calc(var(--spacing) * 5);flex-direction:column;display:flex}.form-grid{gap:calc(var(--spacing) * 4);grid-template-columns:repeat(auto-fit,minmax(220px,1fr));display:grid}.field{gap:calc(var(--spacing) * 2);flex-direction:column;display:flex}.field-label{--tw-font-weight:var(--font-weight-semibold);font-size:13px;font-weight:var(--font-weight-semibold);color:var(--color-ink)}.field-help{color:var(--color-muted);margin:0;font-size:13px}.input{box-sizing:border-box;min-height:var(--spacing-control);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-page);width:100%;padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2.5);font-family:var(--font-sans);color:var(--color-ink);font-size:15px}textarea.input{resize:vertical;--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}textarea.input.mono{font-family:var(--font-mono);font-size:13px}.checks{column-gap:calc(var(--spacing) * 5);row-gap:calc(var(--spacing) * 2);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);padding:calc(var(--spacing) * 4);flex-wrap:wrap;margin:0;display:flex}.checks legend{padding-inline:var(--spacing);--tw-font-weight:var(--font-weight-semibold);font-size:13px;font-weight:var(--font-weight-semibold)}.check{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));display:inline-flex}.check input{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);accent-color:var(--color-primary)}.card{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface)}.card-pad{gap:calc(var(--spacing) * 5);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding:calc(var(--spacing) * 6);flex-direction:column;display:flex}.empty-state{border-radius:var(--radius-card);border-style:var(--tw-border-style);--tw-border-style:dashed;border-style:dashed;border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 8);padding-block:calc(var(--spacing) * 12);text-align:center;color:var(--color-muted);margin:0}.stats{gap:calc(var(--spacing) * 4);grid-template-columns:repeat(auto-fit,minmax(200px,1fr));margin:0;display:grid}.stat{gap:calc(var(--spacing) * 2);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding:calc(var(--spacing) * 6);flex-direction:column-reverse;display:flex}.stat dt{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-muted)}.stat dd{font-family:var(--font-display);--tw-leading:1;--tw-font-weight:var(--font-weight-bold);font-size:36px;line-height:1;font-weight:var(--font-weight-bold);margin:0}.table-wrap{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);overflow-x:auto}.table{border-collapse:collapse;text-align:left;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table th{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal);--tw-tracking:.5px;letter-spacing:.5px;white-space:nowrap;color:var(--color-muted);text-transform:uppercase}.table td{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-line);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle}.table tbody tr:hover{background-color:var(--color-row-hover)}.table td:last-child{text-align:right}.table .input{min-height:calc(var(--spacing) * 9);padding-block:calc(var(--spacing) * 1.5)}.score{align-items:center;gap:calc(var(--spacing) * 3);white-space:nowrap;display:inline-flex}.score-track{height:calc(var(--spacing) * 2);width:calc(var(--spacing) * 28);border-radius:var(--radius-pill);background-color:var(--color-line);display:block;overflow:hidden}.score-fill{border-radius:var(--radius-pill);background-color:var(--color-success);height:100%;display:block}.score-value{text-align:right;--tw-font-weight:var(--font-weight-semibold);min-width:3ch;font-weight:var(--font-weight-semibold);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.error{border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-danger);background-color:var(--color-danger-soft);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-danger)}.status{min-height:calc(var(--spacing) * 5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-success);margin:0}.htmx-indicator{display:none}.htmx-request .htmx-indicator,.htmx-request.htmx-indicator{display:inline-flex}.muted{color:var(--color-muted)}.mono{font-family:var(--font-mono)}.assessment-grid{align-items:stretch;gap:calc(var(--spacing) * 6);grid-template-columns:repeat(1,minmax(0,1fr));display:grid}@media (min-width:48rem){.assessment-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}.editor-grid{align-items:flex-start;gap:calc(var(--spacing) * 6);grid-template-columns:repeat(auto-fit,minmax(380px,1fr));display:grid}.doc-form{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.doc-section{gap:calc(var(--spacing) * 4);flex-direction:column;display:flex}.doc-item{gap:calc(var(--spacing) * 3);border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);padding:calc(var(--spacing) * 4);flex-direction:column;display:flex}.transcript pre{font-family:var(--font-sans);font-size:15px}details.disclosure{border-radius:var(--radius-control);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3)}details.disclosure summary{cursor:pointer;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}details.disclosure pre{margin-top:calc(var(--spacing) * 3);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));white-space:pre-wrap;color:var(--color-muted);margin-bottom:0}.paper{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 10);padding-block:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);--tw-shadow:0 8px 24px var(--tw-shadow-color,#18181b0f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.paper h1{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));margin-top:0}.paper h2{margin-top:calc(var(--spacing) * 6);margin-bottom:calc(var(--spacing) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);padding-bottom:var(--spacing);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.paper h3{margin-top:calc(var(--spacing) * 4);margin-bottom:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.paper ul{padding-left:calc(var(--spacing) * 5)}.career-cards{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.career-toolbar{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-wrap:wrap;display:flex}.career-header-summary{cursor:pointer;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);list-style-type:none;display:flex}.career-header-summary:after{content:"\u2304";font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));color:var(--color-ink)}.career-header[open]>.career-header-summary:after{content:"\u2303"}.career-card{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 7);padding-block:calc(var(--spacing) * 6);flex-direction:column;display:flex}.career-head{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);border-bottom-style:var(--tw-border-style);border-bottom-width:2px;border-color:var(--color-line);padding-bottom:calc(var(--spacing) * 5);display:flex}.career-title{align-items:center;gap:calc(var(--spacing) * 3);font-family:var(--font-display);font-size:var(--text-h2);line-height:var(--tw-leading,var(--text-h2--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);margin:0;display:flex}.badge{border-radius:var(--radius-pill);background-color:var(--color-subtle);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * .5);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.career-add{cursor:pointer;align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);font-family:var(--font-sans);--tw-font-weight:var(--font-weight-semibold);font-size:15px;font-weight:var(--font-weight-semibold);color:var(--color-primary-hover);background-color:#0000;border-width:0;padding:0;display:inline-flex}@media (hover:hover){.career-add:hover{color:var(--color-primary-strong)}}.career-empty{padding-top:calc(var(--spacing) * 5);padding-bottom:var(--spacing);color:var(--color-muted);margin:0}.career-rows{flex-direction:column;margin:0;padding:0;list-style-type:none;display:flex}.career-row{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);padding-block:calc(var(--spacing) * 5);display:flex}.career-row:last-child{border-bottom-style:var(--tw-border-style);padding-bottom:var(--spacing);border-bottom-width:0}.career-row:has(>.career-form){display:block}.career-row-text{gap:var(--spacing);flex-direction:column;min-width:0;display:flex}.career-row-title{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.career-row-meta{color:var(--color-muted);font-size:15px}.career-row-controls{align-items:center;gap:var(--spacing);flex-shrink:0;display:flex}.career-icon{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);cursor:pointer;border-radius:var(--radius-control);border-style:var(--tw-border-style);color:var(--color-ink);background-color:#0000;border-width:0;justify-content:center;align-items:center;display:inline-flex}@media (hover:hover){.career-icon:hover{background-color:var(--color-subtle)}}.career-icon:disabled{cursor:not-allowed;color:var(--color-line)}@media (hover:hover){.career-icon:disabled:hover{background-color:#0000}}.career-danger{color:var(--color-danger)}@media (hover:hover){.career-danger:hover{background-color:var(--color-danger-soft)}}.career-form{margin-top:calc(var(--spacing) * 5);column-gap:calc(var(--spacing) * 6);row-gap:calc(var(--spacing) * 5);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);padding:calc(var(--spacing) * 6);grid-template-columns:repeat(2,minmax(0,1fr));display:grid}.career-wide{grid-column:span 2/span 2}.career-ongoing{color:var(--color-muted)}.career-ongoing input{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-muted);background-color:var(--color-surface);border-radius:2147483647px}.career-ongoing input:checked{border-color:var(--color-primary);background-color:var(--color-primary);--tw-shadow:inset 0 0 0 3px var(--tw-shadow-color,var(--color-surface));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.career-actions{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 6);display:flex}.career-cancel{cursor:pointer;border-style:var(--tw-border-style);font-family:var(--font-sans);--tw-font-weight:var(--font-weight-semibold);font-size:15px;font-weight:var(--font-weight-semibold);color:var(--color-ink);background-color:#0000;border-width:0;padding:0}.transcript{gap:calc(var(--spacing) * 3);flex-direction:column;margin:0;padding:0;list-style-type:none;display:flex}.transcript li{border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 5);padding-block:calc(var(--spacing) * 4)}.transcript li[data-role=user]{border-color:var(--color-primary-soft);background-color:var(--color-primary-soft)}.transcript strong{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.transcript time{font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-muted)}#log.chat-log{min-height:calc(var(--spacing) * 40);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding-inline:calc(var(--spacing) * 5);padding-block:calc(var(--spacing) * 4)}.chat-log .msg{margin-block:calc(var(--spacing) * 2);white-space:pre-wrap}.chat-log .msg.user{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.chats-split{align-items:flex-start;gap:calc(var(--spacing) * 6);display:grid}@media (min-width:64rem){.chats-split{grid-template-columns:minmax(0,1fr) 380px}}.chats-main{gap:calc(var(--spacing) * 6);flex-direction:column;min-width:0;display:flex}.chats-side{gap:calc(var(--spacing) * 4);flex-direction:column;display:flex}@media (min-width:64rem){.chats-side{top:calc(var(--spacing) * 6);position:sticky}}.chats-side .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.chats-side .stat{justify-content:flex-end}.test-panel{gap:calc(var(--spacing) * 4);border-radius:var(--radius-card);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);background-color:var(--color-surface);padding:calc(var(--spacing) * 6);flex-direction:column;display:flex}.test-head{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 3);display:flex}.test-title{font-family:var(--font-display);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);margin:0}.test-tag{font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:2px;letter-spacing:2px;color:var(--color-muted);text-transform:uppercase}.test-log{max-height:60vh;min-height:calc(var(--spacing) * 24);gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow-y:auto}.test-log:empty:before{content:"Questions here are not counted or stored.";font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-muted)}.test-msg{border-radius:var(--radius-control);max-width:88%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-leading:var(--leading-relaxed);font-size:15px;line-height:var(--leading-relaxed);white-space:pre-wrap}.test-msg.user{background-color:var(--color-subtle);align-self:flex-end}.test-msg.assistant{background-color:var(--color-primary-soft);align-self:flex-start}.test-msg.assistant:empty:before{content:"...";color:var(--color-muted)}.test-form{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.test-form .input{flex:1;min-width:0}.status:empty,#pi-error:empty,#created:empty,#test-status:empty{display:none}.table .actions{flex-wrap:nowrap}.btn,.btn-ghost,.table td.mono{white-space:nowrap}.paper h1,.paper h2,.paper h3{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.paper ul{list-style-type:disc}.paper ol{padding-left:calc(var(--spacing) * 5);list-style-type:decimal}}@layer utilities{.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.m-0{margin:0}.mx-auto{margin-inline:auto}.mt-8{margin-top:calc(var(--spacing) * 8)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.w-20{width:calc(var(--spacing) * 20)}.w-full{width:100%}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.rounded{border-radius:.25rem}.rounded-control{border-radius:var(--radius-control)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.bg-primary-soft{background-color:var(--color-primary-soft)}.p-0{padding:0}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-3{padding-block:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.font-display{font-family:var(--font-display)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-danger{color:var(--color-danger)}.text-ink{color:var(--color-ink)}.text-muted{color:var(--color-muted)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}@media (min-width:40rem){.sm\\:grid-cols-\\[3fr_1fr\\]{grid-template-columns:3fr 1fr}}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translate(25%)}to{opacity:1;transform:translate(0)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes ripple{0%{transform:scale(0)translateY(-45%)translate(13%)}to{transform:scale(1)translateY(-45%)translate(13%)}}.notyf{color:#fff;z-index:9999;pointer-events:none;box-sizing:border-box;flex-direction:column;justify-content:flex-end;align-items:flex-end;width:100%;height:100%;padding:20px;display:flex;position:fixed;top:0;left:0}.notyf__icon--error,.notyf__icon--success{background:#fff;border-radius:50%;width:21px;height:21px;margin:0 auto;display:block;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:"";background:currentColor;border-radius:3px;width:3px;height:12px;display:block;position:absolute;top:5px;left:9px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:"";background:currentColor;border-radius:3px;width:3px;display:block;position:absolute}.notyf__icon--success:after{height:6px;top:9px;left:6px;transform:rotate(-45deg)}.notyf__icon--success:before{height:11px;top:5px;left:10px;transform:rotate(45deg)}.notyf__toast{pointer-events:auto;box-sizing:border-box;border-radius:2px;flex-shrink:0;max-width:300px;padding:0 15px;animation:.3s ease-in forwards notyf-fadeinup;display:block;position:relative;overflow:hidden;transform:translateY(25%);box-shadow:0 3px 7px #00000040}.notyf__toast--disappear{animation:.3s .25s forwards notyf-fadeoutdown;transform:translateY(0)}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{opacity:1;animation:.3s forwards notyf-fadeoutdown;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{opacity:1;animation:.3s forwards notyf-fadeoutright;transform:translate(0)}.notyf__toast--disappear .notyf__message{animation-delay:50ms}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{transform-origin:100% 100%;z-index:5;border-radius:50%;width:400px;height:400px;animation:.4s ease-out forwards ripple;position:absolute;top:0;right:0;transform:scale(0)translateY(-51%)translate(13%)}.notyf__wrapper{z-index:10;border-radius:3px;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;display:flex;position:relative}.notyf__icon{text-align:center;opacity:0;width:22px;margin-right:13px;font-size:1.3em;animation:.3s .3s forwards notyf-fadeinup}.notyf__dismiss{opacity:0;width:26px;height:100%;margin-right:-15px;animation:.3s .35s forwards notyf-fadeinleft;position:absolute;top:0;right:0}.notyf__dismiss-btn{cursor:pointer;opacity:.35;background-color:#00000040;border:none;outline:none;width:100%;height:100%;transition:opacity .2s,background-color .2s}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:"";background:#fff;border-radius:3px;width:2px;height:12px;position:absolute;top:calc(50% - 5px);left:calc(50% - 1px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:#00000026}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;opacity:0;line-height:1.5em;animation:.3s .25s forwards notyf-fadeinup;position:relative}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{width:600px;height:600px;animation-duration:.5s}.notyf__toast{border-radius:0;width:100%;max-width:none;box-shadow:0 -2px 7px #00000021}.notyf__dismiss{width:56px}}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(fonts/inter.woff2)format("woff2-variations")}@font-face{font-family:Space Grotesk;font-style:normal;font-display:swap;font-weight:300 700;src:url(fonts/space-grotesk.woff2)format("woff2-variations")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:100 800;src:url(fonts/jetbrains-mono.woff2)format("woff2-variations")}[data-toast]{display:none}.notyf{z-index:100}.notyf__toast{border-radius:var(--radius-control);box-shadow:var(--shadow-raised);font-family:inherit;font-size:.875rem}.notyf__toast--success .notyf__icon--success,.notyf__toast--error .notyf__icon--error{background-color:#ffffff40}.notyf__toast--success .notyf__icon--success:before,.notyf__toast--success .notyf__icon--success:after,.notyf__toast--error .notyf__icon--error:before,.notyf__toast--error .notyf__icon--error:after{background-color:var(--color-on-primary)}.notyf__message{color:var(--color-on-primary)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-leading{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}';
|
|
73
|
+
|
|
74
|
+
// src/admin/static/toast-js.generated.ts
|
|
75
|
+
var TOAST_JS = '"use strict";(()=>{var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},r.apply(this,arguments)},S=(function(){function i(t){this.options=t,this.listeners={}}return i.prototype.on=function(t,e){var n=this.listeners[t]||[];this.listeners[t]=n.concat([e])},i.prototype.triggerEvent=function(t,e){var n=this,o=this.listeners[t]||[];o.forEach(function(s){return s({target:n,event:e})})},i})(),l;(function(i){i[i.Add=0]="Add",i[i.Remove=1]="Remove"})(l||(l={}));var H=(function(){function i(){this.notifications=[]}return i.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,l.Add,this.notifications)},i.prototype.splice=function(t,e){var n=this.notifications.splice(t,e)[0];return this.updateFn(n,l.Remove,this.notifications),n},i.prototype.indexOf=function(t){return this.notifications.indexOf(t)},i.prototype.onUpdate=function(t){this.updateFn=t},i})(),c;(function(i){i.Dismiss="dismiss",i.Click="click"})(c||(c={}));var x={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},I=(function(){function i(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),e=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(e),document.body.appendChild(t),this.container=e,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return i.prototype.on=function(t,e){var n;this.events=r(r({},this.events),(n={},n[t]=e,n))},i.prototype.update=function(t,e){e===l.Add?this.addNotification(t):e===l.Remove&&this.removeNotification(t)},i.prototype.removeNotification=function(t){var e=this,n=this._popRenderedNotification(t),o;if(n){o=n.node,o.classList.add("notyf__toast--disappear");var s;o.addEventListener(this.animationEndEventName,s=function(a){a.target===o&&(o.removeEventListener(e.animationEndEventName,s),e.container.removeChild(o))})}},i.prototype.addNotification=function(t){var e=this._renderNotification(t);this.notifications.push({notification:t,node:e}),this._announce(t.options.message||"Notification")},i.prototype._renderNotification=function(t){var e,n=this._buildNotificationCard(t),o=t.options.className;return o&&(e=n.classList).add.apply(e,o.split(" ")),this.container.appendChild(n),n},i.prototype._popRenderedNotification=function(t){for(var e=-1,n=0;n<this.notifications.length&&e<0;n++)this.notifications[n].notification===t&&(e=n);if(e!==-1)return this.notifications.splice(e,1)[0]},i.prototype.getXPosition=function(t){var e;return((e=t?.position)===null||e===void 0?void 0:e.x)||"right"},i.prototype.getYPosition=function(t){var e;return((e=t?.position)===null||e===void 0?void 0:e.y)||"bottom"},i.prototype.adjustContainerAlignment=function(t){var e=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],n=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],o=this.container.style;o.setProperty("justify-content",n),o.setProperty("align-items",e)},i.prototype._buildNotificationCard=function(t){var e=this,n=t.options,o=n.icon;this.adjustContainerAlignment(n);var s=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),a=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),u=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),f=this._createHTMLElement({tagName:"div",className:"notyf__message"});f.innerHTML=n.message||"";var h=n.background||n.backgroundColor;if(o){var m=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if((typeof o=="string"||o instanceof String)&&(m.innerHTML=new String(o).valueOf()),typeof o=="object"){var g=o.tagName,O=g===void 0?"i":g,P=o.className,M=o.text,_=o.color,N=_===void 0?h:_,E=this._createHTMLElement({tagName:O,className:P,text:M});N&&(E.style.color=N),m.appendChild(E)}u.appendChild(m)}if(u.appendChild(f),s.appendChild(u),h&&(n.ripple?(a.style.background=h,s.appendChild(a)):s.style.background=h),n.dismissible){var b=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),C=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});b.appendChild(C),u.appendChild(b),s.classList.add("notyf__toast--dismissible"),C.addEventListener("click",function(v){var p,d;(d=(p=e.events)[c.Dismiss])===null||d===void 0||d.call(p,{target:t,event:v}),v.stopPropagation()})}s.addEventListener("click",function(v){var p,d;return(d=(p=e.events)[c.Click])===null||d===void 0?void 0:d.call(p,{target:t,event:v})});var k=this.getYPosition(n)==="top"?"upper":"lower";return s.classList.add("notyf__toast--"+k),s},i.prototype._createHTMLElement=function(t){var e=t.tagName,n=t.className,o=t.text,s=document.createElement(e);return n&&(s.className=n),s.textContent=o||null,s},i.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},i.prototype._announce=function(t){var e=this;this.a11yContainer.textContent="",setTimeout(function(){e.a11yContainer.textContent=t},100)},i.prototype._getAnimationEndEventName=function(){var t=document.createElement("_fake"),e={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"},n;for(n in e)if(t.style[n]!==void 0)return e[n];return"animationend"},i})(),w=(function(){function i(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new H,this.view=new I;var n=this.registerTypes(t);this.options=r(r({},x),t),this.options.types=n,this.notifications.onUpdate(function(o,s){return e.view.update(o,s)}),this.view.on(c.Dismiss,function(o){var s=o.target,a=o.event;e._removeNotification(s),s.triggerEvent(c.Dismiss,a)}),this.view.on(c.Click,function(o){var s=o.target,a=o.event;return s.triggerEvent(c.Click,a)})}return i.prototype.error=function(t){var e=this.normalizeOptions("error",t);return this.open(e)},i.prototype.success=function(t){var e=this.normalizeOptions("success",t);return this.open(e)},i.prototype.open=function(t){var e=this.options.types.find(function(s){var a=s.type;return a===t.type})||{},n=r(r({},e),t);this.assignProps(["ripple","position","dismissible"],n);var o=new S(n);return this._pushNotification(o),o},i.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},i.prototype.assignProps=function(t,e){var n=this;t.forEach(function(o){e[o]=e[o]==null?n.options[o]:e[o]})},i.prototype._pushNotification=function(t){var e=this;this.notifications.push(t);var n=t.options.duration!==void 0?t.options.duration:this.options.duration;n&&setTimeout(function(){return e._removeNotification(t)},n)},i.prototype._removeNotification=function(t){var e=this.notifications.indexOf(t);e!==-1&&this.notifications.splice(e,1)},i.prototype.normalizeOptions=function(t,e){var n={type:t};return typeof e=="string"?n.message=e:typeof e=="object"&&(n=r(r({},n),e)),n},i.prototype.registerTypes=function(t){var e=(t&&t.types||[]).slice(),n=x.types.map(function(o){var s=-1;e.forEach(function(u,f){u.type===o.type&&(s=f)});var a=s!==-1?e.splice(s,1)[0]:{};return r(r({},o),a)});return n.concat(e)},i})();var L=new Set(["editor-status","chat-status","pi-error"]),F=new w({duration:3500,dismissible:!0,position:{x:"right",y:"bottom"},types:[{type:"success",background:"var(--color-success)",duration:3500},{type:"error",background:"var(--color-danger)",duration:6e3}]});function T(i,t){let e=t.trim();e&&F[i](e)}function A(i,t=!1){T(t||i.querySelector(".error, .text-danger")?"error":"success",i.textContent??""),i.textContent=""}function y(i){for(let t of i.querySelectorAll("[data-toast]:not([data-toasted])"))t.dataset.toasted="true",T(t.dataset.toast==="error"?"error":"success",t.textContent??"")}document.documentElement.classList.add("toast-ready");y(document);try{let i=new URL(window.location.href);i.searchParams.has("saved")&&(i.searchParams.delete("saved"),window.history.replaceState(window.history.state,"",i.pathname+i.search+i.hash))}catch{}for(let i of L){let t=document.getElementById(i);t?.textContent?.trim()&&A(t)}document.addEventListener("htmx:beforeSwap",i=>{let t=i.detail;t.xhr.status===400&&t.target.hasAttribute("data-swap-errors")&&(t.shouldSwap=!0,t.isError=!1)});document.addEventListener("htmx:afterSwap",i=>{let t=i.detail,e=t.target;if(!L.has(e.id)){y(document);return}e.querySelector("[data-toast]")?(y(e),e.textContent=""):A(e,t.xhr.status>=400)});})();\n';
|
|
64
76
|
|
|
65
77
|
// src/admin/layout.tsx
|
|
66
78
|
import { jsx, jsxs } from "hono/jsx/jsx-runtime";
|
|
79
|
+
var TOAST_JS_VERSION = (() => {
|
|
80
|
+
let h = 2166136261;
|
|
81
|
+
for (let i = 0; i < TOAST_JS.length; i++) h = Math.imul(h ^ TOAST_JS.charCodeAt(i), 16777619);
|
|
82
|
+
return (h >>> 0).toString(16);
|
|
83
|
+
})();
|
|
84
|
+
var NAV_ICON_PATHS = {
|
|
85
|
+
profile: ["M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", "M12 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8z"],
|
|
86
|
+
settings: [
|
|
87
|
+
"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
|
|
88
|
+
"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"
|
|
89
|
+
],
|
|
90
|
+
"personal-info": [
|
|
91
|
+
"M4 5h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z",
|
|
92
|
+
"M16 10h2",
|
|
93
|
+
"M16 14h2",
|
|
94
|
+
"M6.17 15a3 3 0 0 1 5.66 0",
|
|
95
|
+
"M9 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"
|
|
96
|
+
],
|
|
97
|
+
resumes: [
|
|
98
|
+
"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",
|
|
99
|
+
"M14 2v4a2 2 0 0 0 2 2h4",
|
|
100
|
+
"M10 9H8",
|
|
101
|
+
"M16 13H8",
|
|
102
|
+
"M16 17H8"
|
|
103
|
+
],
|
|
104
|
+
chats: ["M7.9 20A9 9 0 1 0 4 16.1L2 22z"]
|
|
105
|
+
};
|
|
106
|
+
var NavIcon = ({ name }) => /* @__PURE__ */ jsx(
|
|
107
|
+
"svg",
|
|
108
|
+
{
|
|
109
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
110
|
+
viewBox: "0 0 24 24",
|
|
111
|
+
fill: "none",
|
|
112
|
+
stroke: "currentColor",
|
|
113
|
+
"stroke-width": "2",
|
|
114
|
+
"stroke-linecap": "round",
|
|
115
|
+
"stroke-linejoin": "round",
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
children: NAV_ICON_PATHS[name].map((d) => /* @__PURE__ */ jsx("path", { d }))
|
|
118
|
+
}
|
|
119
|
+
);
|
|
67
120
|
var Layout = ({
|
|
68
121
|
title,
|
|
69
122
|
basePath,
|
|
@@ -78,24 +131,39 @@ var Layout = ({
|
|
|
78
131
|
/* @__PURE__ */ jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
79
132
|
/* @__PURE__ */ jsx("title", { children: title }),
|
|
80
133
|
/* @__PURE__ */ jsx("link", { rel: "stylesheet", href: `${admin}/static/admin.css?v=${ADMIN_CSS_VERSION}` }),
|
|
81
|
-
/* @__PURE__ */ jsx("script", { src: `${admin}/static/htmx.min.js` })
|
|
134
|
+
/* @__PURE__ */ jsx("script", { src: `${admin}/static/htmx.min.js` }),
|
|
135
|
+
/* @__PURE__ */ jsx("script", { src: `${admin}/static/toast.js?v=${TOAST_JS_VERSION}`, defer: true })
|
|
82
136
|
] }),
|
|
83
137
|
/* @__PURE__ */ jsx("body", { "data-section": section, children: /* @__PURE__ */ jsxs("div", { class: "app-shell", children: [
|
|
84
138
|
bare ? null : /* @__PURE__ */ jsxs("aside", { class: "sidebar", children: [
|
|
85
139
|
/* @__PURE__ */ jsxs("div", { class: "brand", children: [
|
|
86
140
|
/* @__PURE__ */ jsx("div", { class: "logo-tile", "aria-hidden": "true", children: "CV" }),
|
|
87
141
|
/* @__PURE__ */ jsxs("div", { class: "flex flex-col gap-0.5", children: [
|
|
88
|
-
/* @__PURE__ */ jsx("span", { class: "font-display text-base font-semibold", children: "
|
|
142
|
+
/* @__PURE__ */ jsx("span", { class: "font-display text-base font-semibold", children: "Curriculum" }),
|
|
89
143
|
/* @__PURE__ */ jsx("span", { class: "text-xs text-muted", children: "Admin" })
|
|
90
144
|
] })
|
|
91
145
|
] }),
|
|
92
146
|
/* @__PURE__ */ jsxs("nav", { "aria-label": "Admin", children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
147
|
+
/* @__PURE__ */ jsxs("a", { href: `${admin}/profile`, children: [
|
|
148
|
+
/* @__PURE__ */ jsx(NavIcon, { name: "profile" }),
|
|
149
|
+
"Profile"
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsxs("a", { href: `${admin}/settings`, children: [
|
|
152
|
+
/* @__PURE__ */ jsx(NavIcon, { name: "settings" }),
|
|
153
|
+
"Settings"
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsxs("a", { href: `${admin}/personal-info`, children: [
|
|
156
|
+
/* @__PURE__ */ jsx(NavIcon, { name: "personal-info" }),
|
|
157
|
+
"Personal info"
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsxs("a", { href: `${admin}/resumes`, children: [
|
|
160
|
+
/* @__PURE__ */ jsx(NavIcon, { name: "resumes" }),
|
|
161
|
+
"Resumes"
|
|
162
|
+
] }),
|
|
163
|
+
/* @__PURE__ */ jsxs("a", { href: `${admin}/chats`, children: [
|
|
164
|
+
/* @__PURE__ */ jsx(NavIcon, { name: "chats" }),
|
|
165
|
+
"Chats"
|
|
166
|
+
] })
|
|
99
167
|
] }),
|
|
100
168
|
/* @__PURE__ */ jsx("div", { class: "sidebar-foot", children: /* @__PURE__ */ jsx("form", { method: "post", action: `${admin}/logout`, children: /* @__PURE__ */ jsx("button", { type: "submit", class: "btn-ghost w-full", children: "Logout" }) }) })
|
|
101
169
|
] }),
|
|
@@ -208,9 +276,10 @@ messagesRouter.get(
|
|
|
208
276
|
|
|
209
277
|
// src/admin/chats/routes.ts
|
|
210
278
|
import { Hono as Hono3 } from "hono";
|
|
279
|
+
import { z } from "zod";
|
|
211
280
|
|
|
212
281
|
// src/admin/static/chats-js.generated.ts
|
|
213
|
-
var CHATS_JS = '"use strict";(()=>{function
|
|
282
|
+
var CHATS_JS = '"use strict";(()=>{function h(a){document.addEventListener("htmx:beforeSwap",e=>{let{detail:n}=e,i=document.getElementById(a);n.xhr.status>=400&&i&&!n.shouldSwap&&(n.shouldSwap=!0,n.isError=!1,n.target=i,n.swapOverride="innerHTML")})}document.addEventListener("click",a=>{let e=a.target.closest("[data-copy]");e&&navigator.clipboard&&navigator.clipboard.writeText(e.dataset.copy).then(()=>{e.textContent="Copied"})});h("chat-status");var w=document.getElementById("test-panel");if(w){let a=w.dataset.url,e=document.getElementById("test-log"),n=document.getElementById("test-status"),i=document.getElementById("test-ask"),d=document.getElementById("test-question"),u=document.getElementById("test-send"),m=[],g=(t,r)=>{let o=document.createElement("div");return o.className=`test-msg ${t}`,o.textContent=r,e.appendChild(o),e.scrollTop=e.scrollHeight,o},p=t=>{u.disabled=t,d.disabled=t},y=async t=>{let r=g("user",t),o=null;try{let s=await fetch(a,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[...m,{role:"user",content:t}]})});if(s.redirected)throw new Error("Your admin session ended. Sign in again.");if(!s.ok||!s.body)throw new Error(s.status===502?"The model is unavailable. Try again.":`Request failed (${s.status}).`);let c=g("assistant","");o=c;let b=s.body.getReader(),E=new TextDecoder,l="";for(;;){let f=await b.read();if(f.done)break;l+=E.decode(f.value,{stream:!0}),c.textContent=l,e.scrollTop=e.scrollHeight}l+=E.decode(),c.textContent=l,m.push({role:"user",content:t},{role:"assistant",content:l}),d.value="",n.textContent=""}catch(s){r.remove(),o?.remove(),n.textContent=s.message}};i.addEventListener("submit",t=>{t.preventDefault();let r=d.value.trim();r===""||u.disabled||(p(!0),y(r).finally(()=>{p(!1),d.focus()}))})}})();\n';
|
|
214
283
|
|
|
215
284
|
// src/admin/chats/view.tsx
|
|
216
285
|
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "hono/jsx/jsx-runtime";
|
|
@@ -302,12 +371,37 @@ var Rows = ({
|
|
|
302
371
|
// biome-ignore lint/complexity/noUselessFragments: c.html needs a single node, not an array
|
|
303
372
|
/* @__PURE__ */ jsx4(Fragment, { children: chats.map((chat) => /* @__PURE__ */ jsx4(ChatRow, { basePath, origin, chat })) })
|
|
304
373
|
);
|
|
374
|
+
var TestPanel = ({ basePath }) => /* @__PURE__ */ jsxs4("aside", { class: "test-panel", id: "test-panel", "data-url": `${basePath}/admin/chats/test`, children: [
|
|
375
|
+
/* @__PURE__ */ jsxs4("div", { class: "test-head", children: [
|
|
376
|
+
/* @__PURE__ */ jsx4("h2", { class: "test-title", children: "Test the assistant" }),
|
|
377
|
+
/* @__PURE__ */ jsx4("span", { class: "test-tag", title: "Not counted, not stored", children: "Draft" })
|
|
378
|
+
] }),
|
|
379
|
+
/* @__PURE__ */ jsx4("div", { id: "test-log", class: "test-log", "aria-live": "polite" }),
|
|
380
|
+
/* @__PURE__ */ jsx4("p", { id: "test-status", class: "status", role: "status" }),
|
|
381
|
+
/* @__PURE__ */ jsxs4("form", { id: "test-ask", class: "test-form", children: [
|
|
382
|
+
/* @__PURE__ */ jsx4(
|
|
383
|
+
"input",
|
|
384
|
+
{
|
|
385
|
+
class: "input",
|
|
386
|
+
id: "test-question",
|
|
387
|
+
type: "text",
|
|
388
|
+
name: "question",
|
|
389
|
+
placeholder: "Ask like a recruiter...",
|
|
390
|
+
"aria-label": "Question",
|
|
391
|
+
autocomplete: "off",
|
|
392
|
+
required: true
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
/* @__PURE__ */ jsx4("button", { type: "submit", class: "btn", id: "test-send", children: "Ask" })
|
|
396
|
+
] })
|
|
397
|
+
] });
|
|
305
398
|
var ChatsPage = ({
|
|
306
399
|
basePath,
|
|
307
400
|
origin,
|
|
308
401
|
chats,
|
|
309
402
|
resumes,
|
|
310
|
-
defaultMax
|
|
403
|
+
defaultMax,
|
|
404
|
+
counts
|
|
311
405
|
}) => /* @__PURE__ */ jsxs4(Layout, { title: "Chats", basePath, section: "chats", children: [
|
|
312
406
|
/* @__PURE__ */ jsx4(
|
|
313
407
|
PageHeader,
|
|
@@ -317,85 +411,102 @@ var ChatsPage = ({
|
|
|
317
411
|
sub: "Each link opens a chat with one resume as context. Revoke or reset it any time."
|
|
318
412
|
}
|
|
319
413
|
),
|
|
320
|
-
/* @__PURE__ */ jsx4("script", { src: `${basePath}/admin/chats/chats.js
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
/* @__PURE__ */ jsx4("
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
414
|
+
/* @__PURE__ */ jsx4("script", { src: `${basePath}/admin/chats/chats.js`, defer: true }),
|
|
415
|
+
/* @__PURE__ */ jsxs4("div", { class: "chats-split", children: [
|
|
416
|
+
/* @__PURE__ */ jsxs4("div", { class: "chats-main", children: [
|
|
417
|
+
/* @__PURE__ */ jsx4("p", { id: "chat-status", class: "status", role: "status" }),
|
|
418
|
+
/* @__PURE__ */ jsx4("div", { class: "table-wrap", children: /* @__PURE__ */ jsxs4("table", { class: "table", children: [
|
|
419
|
+
/* @__PURE__ */ jsx4("thead", { children: /* @__PURE__ */ jsxs4("tr", { children: [
|
|
420
|
+
/* @__PURE__ */ jsx4("th", { children: "Recruiter" }),
|
|
421
|
+
/* @__PURE__ */ jsx4("th", { children: "Company" }),
|
|
422
|
+
/* @__PURE__ */ jsx4("th", { children: "Used" }),
|
|
423
|
+
/* @__PURE__ */ jsx4("th", { children: "Status" }),
|
|
424
|
+
/* @__PURE__ */ jsx4("th", { children: "Expires" }),
|
|
425
|
+
/* @__PURE__ */ jsx4("th", { children: "Last used" }),
|
|
426
|
+
/* @__PURE__ */ jsx4("th", {})
|
|
427
|
+
] }) }),
|
|
428
|
+
/* @__PURE__ */ jsx4(
|
|
429
|
+
"tbody",
|
|
430
|
+
{
|
|
431
|
+
id: "chat-rows",
|
|
432
|
+
"hx-get": `${basePath}/admin/chats/rows`,
|
|
433
|
+
"hx-trigger": "chats-changed from:body",
|
|
434
|
+
"hx-swap": "innerHTML",
|
|
435
|
+
children: /* @__PURE__ */ jsx4(Rows, { basePath, origin, chats })
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
] }) }),
|
|
439
|
+
/* @__PURE__ */ jsxs4(
|
|
440
|
+
"form",
|
|
441
|
+
{
|
|
442
|
+
class: "card-pad",
|
|
443
|
+
"hx-post": `${basePath}/admin/chats`,
|
|
444
|
+
"hx-target": "#created",
|
|
445
|
+
"hx-swap": "outerHTML",
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ jsx4("h2", { class: "section-title", children: "New chat" }),
|
|
448
|
+
/* @__PURE__ */ jsx4("div", { id: "created" }),
|
|
449
|
+
/* @__PURE__ */ jsxs4("div", { class: "form-grid", children: [
|
|
450
|
+
/* @__PURE__ */ jsxs4("div", { class: "field", children: [
|
|
451
|
+
/* @__PURE__ */ jsx4("label", { class: "field-label", for: "recruiterName", children: "Recruiter name" }),
|
|
452
|
+
/* @__PURE__ */ jsx4("input", { class: "input", id: "recruiterName", type: "text", name: "recruiterName", required: true })
|
|
453
|
+
] }),
|
|
454
|
+
/* @__PURE__ */ jsxs4("div", { class: "field", children: [
|
|
455
|
+
/* @__PURE__ */ jsx4("label", { class: "field-label", for: "company", children: "Company" }),
|
|
456
|
+
/* @__PURE__ */ jsx4("input", { class: "input", id: "company", type: "text", name: "company" })
|
|
457
|
+
] })
|
|
458
|
+
] }),
|
|
459
|
+
/* @__PURE__ */ jsxs4("div", { class: "field", children: [
|
|
460
|
+
/* @__PURE__ */ jsx4("label", { class: "field-label", for: "jobDescriptionShort", children: "Job Description (max 2000 characters)" }),
|
|
461
|
+
/* @__PURE__ */ jsx4("textarea", { class: "input", id: "jobDescriptionShort", name: "jobDescriptionShort", rows: 6 })
|
|
462
|
+
] }),
|
|
463
|
+
/* @__PURE__ */ jsxs4("div", { class: "form-grid", children: [
|
|
464
|
+
/* @__PURE__ */ jsxs4("div", { class: "field", children: [
|
|
465
|
+
/* @__PURE__ */ jsx4("label", { class: "field-label", for: "maxQuestions", children: "Max questions" }),
|
|
466
|
+
/* @__PURE__ */ jsx4(
|
|
467
|
+
"input",
|
|
468
|
+
{
|
|
469
|
+
class: "input",
|
|
470
|
+
id: "maxQuestions",
|
|
471
|
+
type: "number",
|
|
472
|
+
name: "maxQuestions",
|
|
473
|
+
min: 1,
|
|
474
|
+
max: 100,
|
|
475
|
+
value: defaultMax
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
] }),
|
|
479
|
+
/* @__PURE__ */ jsxs4("div", { class: "field", children: [
|
|
480
|
+
/* @__PURE__ */ jsx4("label", { class: "field-label", for: "expiresAt", children: "Expires at" }),
|
|
481
|
+
/* @__PURE__ */ jsx4("input", { class: "input", id: "expiresAt", type: "datetime-local", name: "expiresAt" })
|
|
482
|
+
] }),
|
|
483
|
+
/* @__PURE__ */ jsxs4("div", { class: "field", children: [
|
|
484
|
+
/* @__PURE__ */ jsx4("label", { class: "field-label", for: "tailoredResumeId", children: "Resume" }),
|
|
485
|
+
/* @__PURE__ */ jsxs4("select", { class: "input", id: "tailoredResumeId", name: "tailoredResumeId", children: [
|
|
486
|
+
/* @__PURE__ */ jsx4("option", { value: "", selected: true, children: "Master CV" }),
|
|
487
|
+
resumes.map((r) => /* @__PURE__ */ jsx4("option", { value: r.id, children: r.title }))
|
|
488
|
+
] })
|
|
489
|
+
] })
|
|
490
|
+
] }),
|
|
491
|
+
/* @__PURE__ */ jsx4("div", { class: "actions", children: /* @__PURE__ */ jsx4("button", { type: "submit", class: "btn", children: "Create" }) })
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
)
|
|
495
|
+
] }),
|
|
496
|
+
/* @__PURE__ */ jsxs4("div", { class: "chats-side", children: [
|
|
497
|
+
/* @__PURE__ */ jsx4(TestPanel, { basePath }),
|
|
498
|
+
/* @__PURE__ */ jsxs4("dl", { class: "stats", children: [
|
|
499
|
+
/* @__PURE__ */ jsxs4("div", { class: "stat", children: [
|
|
500
|
+
/* @__PURE__ */ jsx4("dt", { children: "Public questions today" }),
|
|
501
|
+
/* @__PURE__ */ jsx4("dd", { id: "public-questions", children: counts.publicQuestionsToday })
|
|
394
502
|
] }),
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
503
|
+
/* @__PURE__ */ jsxs4("div", { class: "stat", children: [
|
|
504
|
+
/* @__PURE__ */ jsx4("dt", { children: "Active recruiter chats" }),
|
|
505
|
+
/* @__PURE__ */ jsx4("dd", { id: "active-chats", children: counts.activeChats })
|
|
506
|
+
] })
|
|
507
|
+
] })
|
|
508
|
+
] })
|
|
509
|
+
] })
|
|
399
510
|
] });
|
|
400
511
|
|
|
401
512
|
// src/admin/chats/routes.ts
|
|
@@ -413,10 +524,22 @@ chatsRouter.get("/chats", async (c) => {
|
|
|
413
524
|
origin: new URL(c.req.url).origin,
|
|
414
525
|
chats: await services.recruiterChat.list(),
|
|
415
526
|
resumes: await services.recruiterChat.resumeOptions(),
|
|
416
|
-
defaultMax: await services.settings.limit("recruiterQuestionsDefault")
|
|
527
|
+
defaultMax: await services.settings.limit("recruiterQuestionsDefault"),
|
|
528
|
+
counts: await services.adminAuth.dashboardCounts()
|
|
417
529
|
})
|
|
418
530
|
);
|
|
419
531
|
});
|
|
532
|
+
var testBody = z.object({
|
|
533
|
+
messages: z.array(z.object({ role: z.enum(["user", "assistant"]), content: z.string() }))
|
|
534
|
+
});
|
|
535
|
+
chatsRouter.post("/chats/test", async (c) => {
|
|
536
|
+
const parsed = testBody.safeParse(await c.req.json().catch(() => void 0));
|
|
537
|
+
if (!parsed.success) throw new ValidationError("Invalid request body");
|
|
538
|
+
const stream = await c.var.services.recruiterChat.test(parsed.data.messages);
|
|
539
|
+
return new Response(stream.pipeThrough(new TextEncoderStream()), {
|
|
540
|
+
headers: { "Content-Type": "text/plain; charset=utf-8", "Cache-Control": "no-store" }
|
|
541
|
+
});
|
|
542
|
+
});
|
|
420
543
|
chatsRouter.get(
|
|
421
544
|
"/chats/rows",
|
|
422
545
|
async (c) => c.html(
|
|
@@ -460,55 +583,22 @@ chatsRouter.delete("/chats/:id", async (c) => {
|
|
|
460
583
|
return c.body(null, 200);
|
|
461
584
|
});
|
|
462
585
|
|
|
463
|
-
// src/admin/dashboard/routes.ts
|
|
464
|
-
import { Hono as Hono4 } from "hono";
|
|
465
|
-
|
|
466
|
-
// src/admin/dashboard/view.tsx
|
|
467
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "hono/jsx/jsx-runtime";
|
|
468
|
-
var DashboardPage = ({
|
|
469
|
-
basePath,
|
|
470
|
-
counts
|
|
471
|
-
}) => /* @__PURE__ */ jsxs5(Layout, { title: "Dashboard", basePath, section: "dashboard", children: [
|
|
472
|
-
/* @__PURE__ */ jsx5(PageHeader, { eyebrow: "Overview", title: "Dashboard", sub: "What is happening on your site." }),
|
|
473
|
-
/* @__PURE__ */ jsxs5("dl", { class: "stats", children: [
|
|
474
|
-
/* @__PURE__ */ jsxs5("div", { class: "stat", children: [
|
|
475
|
-
/* @__PURE__ */ jsx5("dt", { children: "Active recruiter chats" }),
|
|
476
|
-
/* @__PURE__ */ jsx5("dd", { id: "active-chats", children: counts.activeChats })
|
|
477
|
-
] }),
|
|
478
|
-
/* @__PURE__ */ jsxs5("div", { class: "stat", children: [
|
|
479
|
-
/* @__PURE__ */ jsx5("dt", { children: "Tailored resumes" }),
|
|
480
|
-
/* @__PURE__ */ jsx5("dd", { id: "resumes", children: counts.resumes })
|
|
481
|
-
] }),
|
|
482
|
-
/* @__PURE__ */ jsxs5("div", { class: "stat", children: [
|
|
483
|
-
/* @__PURE__ */ jsx5("dt", { children: "Public questions today" }),
|
|
484
|
-
/* @__PURE__ */ jsx5("dd", { id: "public-questions", children: counts.publicQuestionsToday })
|
|
485
|
-
] })
|
|
486
|
-
] })
|
|
487
|
-
] });
|
|
488
|
-
|
|
489
|
-
// src/admin/dashboard/routes.ts
|
|
490
|
-
var dashboardRouter = new Hono4();
|
|
491
|
-
dashboardRouter.get("/", async (c) => {
|
|
492
|
-
const counts = await c.var.services.adminAuth.dashboardCounts();
|
|
493
|
-
return c.html(DashboardPage({ basePath: c.var.config.basePath, counts }));
|
|
494
|
-
});
|
|
495
|
-
|
|
496
586
|
// src/admin/error-fragment.tsx
|
|
497
|
-
import { jsx as
|
|
498
|
-
var ErrorFragment = ({ message }) => /* @__PURE__ */
|
|
587
|
+
import { jsx as jsx5 } from "hono/jsx/jsx-runtime";
|
|
588
|
+
var ErrorFragment = ({ message, toast }) => /* @__PURE__ */ jsx5("div", { class: "error", role: "alert", "data-toast": toast ? "error" : void 0, children: message });
|
|
499
589
|
|
|
500
590
|
// src/admin/login/routes.ts
|
|
501
|
-
import { Hono as
|
|
591
|
+
import { Hono as Hono4 } from "hono";
|
|
502
592
|
|
|
503
593
|
// src/admin/login/view.tsx
|
|
504
|
-
import { jsx as
|
|
505
|
-
var LoginPage = ({ basePath, error }) => /* @__PURE__ */
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
error ? /* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */
|
|
594
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "hono/jsx/jsx-runtime";
|
|
595
|
+
var LoginPage = ({ basePath, error }) => /* @__PURE__ */ jsx6(Layout, { title: "Sign in", basePath, bare: true, children: /* @__PURE__ */ jsxs5("div", { class: "card-pad mx-auto w-full max-w-sm", children: [
|
|
596
|
+
/* @__PURE__ */ jsx6("h1", { class: "section-title", children: "Sign in" }),
|
|
597
|
+
error ? /* @__PURE__ */ jsx6(ErrorFragment, { message: error }) : null,
|
|
598
|
+
/* @__PURE__ */ jsxs5("form", { class: "form", method: "post", action: `${basePath}/admin/login`, children: [
|
|
599
|
+
/* @__PURE__ */ jsxs5("label", { class: "field", children: [
|
|
600
|
+
/* @__PURE__ */ jsx6("span", { class: "field-label", children: "Password" }),
|
|
601
|
+
/* @__PURE__ */ jsx6(
|
|
512
602
|
"input",
|
|
513
603
|
{
|
|
514
604
|
class: "input",
|
|
@@ -519,12 +609,12 @@ var LoginPage = ({ basePath, error }) => /* @__PURE__ */ jsx7(Layout, { title: "
|
|
|
519
609
|
}
|
|
520
610
|
)
|
|
521
611
|
] }),
|
|
522
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ jsx6("button", { type: "submit", class: "btn", children: "Sign in" })
|
|
523
613
|
] })
|
|
524
614
|
] }) });
|
|
525
615
|
|
|
526
616
|
// src/admin/login/routes.ts
|
|
527
|
-
var loginRouter = new
|
|
617
|
+
var loginRouter = new Hono4();
|
|
528
618
|
loginRouter.get("/login", (c) => c.html(LoginPage({ basePath: c.var.config.basePath })));
|
|
529
619
|
loginRouter.post("/login", async (c) => {
|
|
530
620
|
const config = c.var.config;
|
|
@@ -555,13 +645,13 @@ loginRouter.post("/logout", (c) => {
|
|
|
555
645
|
});
|
|
556
646
|
|
|
557
647
|
// src/admin/personal-info/routes.ts
|
|
558
|
-
import { Hono as
|
|
648
|
+
import { Hono as Hono5 } from "hono";
|
|
559
649
|
|
|
560
650
|
// src/admin/static/personal-info-js.generated.ts
|
|
561
651
|
var UI_JS = '"use strict";(()=>{document.body.addEventListener("htmx:beforeSwap",n=>{let r=document.getElementById("pi-error");if(!r)return;let{detail:e}=n,t=e.xhr.status;t>=400&&t<500&&t!==401?(e.shouldSwap=!0,e.isError=!1,e.target=r,e.swapOverride="innerHTML"):t>=200&&t<300&&(r.textContent="")});})();\n';
|
|
562
652
|
|
|
563
653
|
// src/admin/personal-info/view.tsx
|
|
564
|
-
import { jsx as
|
|
654
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "hono/jsx/jsx-runtime";
|
|
565
655
|
var MASK = "\u2022\u2022\u2022\u2022\u2022\u2022";
|
|
566
656
|
var Row = ({
|
|
567
657
|
base,
|
|
@@ -569,11 +659,11 @@ var Row = ({
|
|
|
569
659
|
visibilities
|
|
570
660
|
}) => {
|
|
571
661
|
const url = `${base}/${field.key}`;
|
|
572
|
-
return /* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ jsxs6("tr", { id: `row-${field.key}`, children: [
|
|
663
|
+
/* @__PURE__ */ jsx7("td", { children: /* @__PURE__ */ jsx7("code", { children: field.key }) }),
|
|
664
|
+
/* @__PURE__ */ jsx7("td", { children: /* @__PURE__ */ jsx7("input", { class: "input", type: "text", name: "label", value: field.label, "aria-label": "Label" }) }),
|
|
665
|
+
/* @__PURE__ */ jsx7("td", { children: /* @__PURE__ */ jsx7("select", { class: "input", name: "visibility", "aria-label": "Visibility", children: visibilities.map((v) => /* @__PURE__ */ jsx7("option", { value: v, selected: v === field.visibility, children: v })) }) }),
|
|
666
|
+
/* @__PURE__ */ jsx7("td", { children: /* @__PURE__ */ jsx7(
|
|
577
667
|
"input",
|
|
578
668
|
{
|
|
579
669
|
class: "input w-20",
|
|
@@ -583,11 +673,11 @@ var Row = ({
|
|
|
583
673
|
"aria-label": "Sort order"
|
|
584
674
|
}
|
|
585
675
|
) }),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ jsxs6("td", { children: [
|
|
677
|
+
/* @__PURE__ */ jsxs6("div", { class: "mb-1.5 flex items-center gap-2", children: [
|
|
678
|
+
/* @__PURE__ */ jsx7("span", { id: `value-${field.key}`, class: "mono", children: MASK }),
|
|
589
679
|
" ",
|
|
590
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ jsx7(
|
|
591
681
|
"button",
|
|
592
682
|
{
|
|
593
683
|
type: "button",
|
|
@@ -599,7 +689,7 @@ var Row = ({
|
|
|
599
689
|
}
|
|
600
690
|
)
|
|
601
691
|
] }),
|
|
602
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ jsx7(
|
|
603
693
|
"input",
|
|
604
694
|
{
|
|
605
695
|
class: "input",
|
|
@@ -611,8 +701,8 @@ var Row = ({
|
|
|
611
701
|
}
|
|
612
702
|
)
|
|
613
703
|
] }),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ jsx7("td", { children: /* @__PURE__ */ jsxs6("div", { class: "actions justify-end", children: [
|
|
705
|
+
/* @__PURE__ */ jsx7(
|
|
616
706
|
"button",
|
|
617
707
|
{
|
|
618
708
|
type: "button",
|
|
@@ -625,7 +715,7 @@ var Row = ({
|
|
|
625
715
|
}
|
|
626
716
|
),
|
|
627
717
|
" ",
|
|
628
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ jsx7(
|
|
629
719
|
"button",
|
|
630
720
|
{
|
|
631
721
|
type: "button",
|
|
@@ -642,27 +732,27 @@ var Row = ({
|
|
|
642
732
|
};
|
|
643
733
|
var List = ({
|
|
644
734
|
base,
|
|
645
|
-
fields,
|
|
735
|
+
fields: fields3,
|
|
646
736
|
visibilities
|
|
647
|
-
}) => /* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
737
|
+
}) => /* @__PURE__ */ jsx7("div", { id: "pi-list", children: fields3.length === 0 ? /* @__PURE__ */ jsx7("p", { class: "empty-state", children: "No personal info yet" }) : /* @__PURE__ */ jsx7("div", { class: "table-wrap", children: /* @__PURE__ */ jsxs6("table", { class: "table", children: [
|
|
738
|
+
/* @__PURE__ */ jsx7("thead", { children: /* @__PURE__ */ jsxs6("tr", { children: [
|
|
739
|
+
/* @__PURE__ */ jsx7("th", { children: "Key" }),
|
|
740
|
+
/* @__PURE__ */ jsx7("th", { children: "Label" }),
|
|
741
|
+
/* @__PURE__ */ jsx7("th", { children: "Visibility" }),
|
|
742
|
+
/* @__PURE__ */ jsx7("th", { children: "Sort order" }),
|
|
743
|
+
/* @__PURE__ */ jsx7("th", { children: "Value" }),
|
|
744
|
+
/* @__PURE__ */ jsx7("th", {})
|
|
655
745
|
] }) }),
|
|
656
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ jsx7("tbody", { children: fields3.map((f) => /* @__PURE__ */ jsx7(Row, { base, field: f, visibilities })) })
|
|
657
747
|
] }) }) });
|
|
658
748
|
var PersonalInfoPage = ({
|
|
659
749
|
basePath,
|
|
660
|
-
fields,
|
|
750
|
+
fields: fields3,
|
|
661
751
|
visibilities
|
|
662
752
|
}) => {
|
|
663
753
|
const base = `${basePath}/admin/personal-info`;
|
|
664
|
-
return /* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
754
|
+
return /* @__PURE__ */ jsxs6(Layout, { title: "Personal info", basePath, section: "personal-info", children: [
|
|
755
|
+
/* @__PURE__ */ jsx7(
|
|
666
756
|
PageHeader,
|
|
667
757
|
{
|
|
668
758
|
eyebrow: "Personal info",
|
|
@@ -670,47 +760,47 @@ var PersonalInfoPage = ({
|
|
|
670
760
|
sub: "Contact data for the resume header. Encrypted, and never sent to the AI."
|
|
671
761
|
}
|
|
672
762
|
),
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ jsx7("div", { id: "pi-error" }),
|
|
764
|
+
/* @__PURE__ */ jsx7(List, { base, fields: fields3, visibilities }),
|
|
765
|
+
/* @__PURE__ */ jsxs6("form", { class: "card-pad", "hx-post": base, "hx-target": "#pi-list", "hx-swap": "outerHTML", children: [
|
|
766
|
+
/* @__PURE__ */ jsx7("h2", { class: "section-title", children: "Add field" }),
|
|
767
|
+
/* @__PURE__ */ jsxs6("div", { class: "form-grid", children: [
|
|
768
|
+
/* @__PURE__ */ jsxs6("div", { class: "field", children: [
|
|
769
|
+
/* @__PURE__ */ jsx7("label", { class: "field-label", for: "new-key", children: "Key" }),
|
|
770
|
+
/* @__PURE__ */ jsx7("input", { class: "input", id: "new-key", type: "text", name: "key", placeholder: "EMAIL" })
|
|
681
771
|
] }),
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ jsxs6("div", { class: "field", children: [
|
|
773
|
+
/* @__PURE__ */ jsx7("label", { class: "field-label", for: "new-label", children: "Label" }),
|
|
774
|
+
/* @__PURE__ */ jsx7("input", { class: "input", id: "new-label", type: "text", name: "label" })
|
|
685
775
|
] }),
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ jsxs6("div", { class: "field", children: [
|
|
777
|
+
/* @__PURE__ */ jsx7("label", { class: "field-label", for: "new-value", children: "Value" }),
|
|
778
|
+
/* @__PURE__ */ jsx7("input", { class: "input", id: "new-value", type: "text", name: "value", autocomplete: "off" })
|
|
689
779
|
] }),
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ jsxs6("div", { class: "field", children: [
|
|
781
|
+
/* @__PURE__ */ jsx7("label", { class: "field-label", for: "new-visibility", children: "Visibility" }),
|
|
782
|
+
/* @__PURE__ */ jsx7("select", { class: "input", id: "new-visibility", name: "visibility", children: visibilities.map((v) => /* @__PURE__ */ jsx7("option", { value: v, children: v })) })
|
|
693
783
|
] }),
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ jsxs6("div", { class: "field", children: [
|
|
785
|
+
/* @__PURE__ */ jsx7("label", { class: "field-label", for: "new-sort", children: "Sort order" }),
|
|
786
|
+
/* @__PURE__ */ jsx7("input", { class: "input", id: "new-sort", type: "number", name: "sortOrder", value: "0" })
|
|
697
787
|
] })
|
|
698
788
|
] }),
|
|
699
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ jsx7("div", { class: "actions", children: /* @__PURE__ */ jsx7("button", { type: "submit", class: "btn", children: "Add" }) })
|
|
700
790
|
] }),
|
|
701
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ jsx7("script", { src: `${base}/ui.js` })
|
|
702
792
|
] });
|
|
703
793
|
};
|
|
704
|
-
var RevealedValue = ({ value }) => /* @__PURE__ */
|
|
794
|
+
var RevealedValue = ({ value }) => /* @__PURE__ */ jsx7("span", { children: value });
|
|
705
795
|
|
|
706
796
|
// src/admin/personal-info/routes.ts
|
|
707
797
|
function text2(value) {
|
|
708
798
|
return typeof value === "string" ? value : "";
|
|
709
799
|
}
|
|
710
800
|
function sortOrderOf(value) {
|
|
711
|
-
const
|
|
712
|
-
if (
|
|
713
|
-
const n = Number(
|
|
801
|
+
const raw2 = text2(value).trim();
|
|
802
|
+
if (raw2 === "") return void 0;
|
|
803
|
+
const n = Number(raw2);
|
|
714
804
|
if (!Number.isInteger(n)) {
|
|
715
805
|
throw new ValidationError("Invalid sortOrder: must be an integer", {
|
|
716
806
|
sortOrder: "must be an integer"
|
|
@@ -718,7 +808,7 @@ function sortOrderOf(value) {
|
|
|
718
808
|
}
|
|
719
809
|
return n;
|
|
720
810
|
}
|
|
721
|
-
var personalInfoRouter = new
|
|
811
|
+
var personalInfoRouter = new Hono5();
|
|
722
812
|
personalInfoRouter.get(
|
|
723
813
|
"/personal-info",
|
|
724
814
|
async (c) => c.html(
|
|
@@ -783,7 +873,7 @@ personalInfoRouter.get("/personal-info/:key/reveal", async (c) => {
|
|
|
783
873
|
});
|
|
784
874
|
|
|
785
875
|
// src/admin/print/routes.ts
|
|
786
|
-
import { Hono as
|
|
876
|
+
import { Hono as Hono6 } from "hono";
|
|
787
877
|
|
|
788
878
|
// src/admin/static/print-js.generated.ts
|
|
789
879
|
var PRINT_JS = '"use strict";(()=>{document.getElementById("print-button")?.addEventListener("click",()=>window.print());})();\n';
|
|
@@ -822,47 +912,47 @@ img { max-width: 100%; }
|
|
|
822
912
|
}
|
|
823
913
|
|
|
824
914
|
// src/admin/print/view.tsx
|
|
825
|
-
import { jsx as
|
|
915
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "hono/jsx/jsx-runtime";
|
|
826
916
|
var PrintPage = ({
|
|
827
917
|
basePath,
|
|
828
918
|
data,
|
|
829
919
|
back
|
|
830
|
-
}) => /* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
920
|
+
}) => /* @__PURE__ */ jsxs7("html", { lang: "en", children: [
|
|
921
|
+
/* @__PURE__ */ jsxs7("head", { children: [
|
|
922
|
+
/* @__PURE__ */ jsx8("meta", { charset: "utf-8" }),
|
|
923
|
+
/* @__PURE__ */ jsx8("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
924
|
+
/* @__PURE__ */ jsx8("meta", { name: "robots", content: "noindex" }),
|
|
925
|
+
/* @__PURE__ */ jsx8("title", { children: data.fullName || "Resume" }),
|
|
926
|
+
/* @__PURE__ */ jsx8("style", { children: raw(printCss(data.pageSize === "Letter" ? "Letter" : "A4")) }),
|
|
927
|
+
/* @__PURE__ */ jsx8("script", { src: `${basePath}/admin/print/print.js`, defer: true })
|
|
838
928
|
] }),
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
data.warnings.length > 0 ? /* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ jsxs7("body", { children: [
|
|
930
|
+
data.warnings.length > 0 ? /* @__PURE__ */ jsxs7("div", { class: "screen-only banner", role: "alert", children: [
|
|
841
931
|
"Warning: your ",
|
|
842
932
|
data.warnings.join(", "),
|
|
843
933
|
" appears in the body. Keep contact data in Personal info."
|
|
844
934
|
] }) : null,
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ jsx8("p", { class: "screen-only", children: /* @__PURE__ */ jsx8("button", { id: "print-button", type: "button", children: "Print / Save as PDF" }) }),
|
|
936
|
+
/* @__PURE__ */ jsxs7("p", { class: "screen-only", children: [
|
|
937
|
+
/* @__PURE__ */ jsx8("a", { id: "print-back", href: back.href, children: back.label }),
|
|
848
938
|
" \xB7 ",
|
|
849
939
|
"Tip: in the print dialog turn off Headers and footers so the browser adds no URL or date."
|
|
850
940
|
] }),
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ jsxs7("header", { children: [
|
|
942
|
+
/* @__PURE__ */ jsx8("h1", { children: data.fullName }),
|
|
943
|
+
/* @__PURE__ */ jsx8("ul", { class: "contact", children: data.header.map((item) => /* @__PURE__ */ jsxs7("li", { children: [
|
|
854
944
|
item.label,
|
|
855
945
|
": ",
|
|
856
946
|
item.value
|
|
857
947
|
] })) })
|
|
858
948
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ jsx8("main", { children: data.empty ? /* @__PURE__ */ jsx8("p", { children: "This resume is empty" }) : raw(data.bodyHtml) })
|
|
860
950
|
] })
|
|
861
951
|
] });
|
|
862
952
|
|
|
863
953
|
// src/admin/print/routes.ts
|
|
864
954
|
var noindex = { "Cache-Control": "no-store", "X-Robots-Tag": "noindex" };
|
|
865
|
-
var printRouter = new
|
|
955
|
+
var printRouter = new Hono6();
|
|
866
956
|
printRouter.get(
|
|
867
957
|
"/print/print.js",
|
|
868
958
|
(c) => c.body(PRINT_JS, 200, { "Content-Type": "text/javascript; charset=utf-8" })
|
|
@@ -894,21 +984,376 @@ printRouter.get("/resumes/:id/download.md", async (c) => {
|
|
|
894
984
|
});
|
|
895
985
|
|
|
896
986
|
// src/admin/profile/routes.ts
|
|
897
|
-
import { Hono as
|
|
987
|
+
import { Hono as Hono7 } from "hono";
|
|
988
|
+
|
|
989
|
+
// src/admin/career/model.ts
|
|
990
|
+
var rowOf = (item) => ({ id: item.id, title: item.title, meta: metaLine(item) });
|
|
991
|
+
function cardsFrom(items, leftOut2) {
|
|
992
|
+
const left = leftOut2 ? groupByKind(leftOut2) : [];
|
|
993
|
+
return groupByKind(items).map(({ kind, section, items: group }) => ({
|
|
994
|
+
kind,
|
|
995
|
+
section,
|
|
996
|
+
add: KIND_META[kind].add,
|
|
997
|
+
rows: group.map(rowOf),
|
|
998
|
+
...leftOut2 ? { leftOut: (left.find((g) => g.kind === kind)?.items ?? []).map(rowOf) } : {}
|
|
999
|
+
}));
|
|
1000
|
+
}
|
|
1001
|
+
function fieldsOf(kind) {
|
|
1002
|
+
const fields3 = [];
|
|
1003
|
+
for (const field of KIND_META[kind].fields) {
|
|
1004
|
+
if (field === "current" || field === "bullets") continue;
|
|
1005
|
+
if (field === "text") fields3.push({ name: "details", label: fieldLabel(kind, "text") });
|
|
1006
|
+
else if (field === "skills") {
|
|
1007
|
+
fields3.push({
|
|
1008
|
+
name: kind === "skill_group" ? "skills" : "stack",
|
|
1009
|
+
label: fieldLabel(kind, "skills")
|
|
1010
|
+
});
|
|
1011
|
+
} else fields3.push({ name: field, label: fieldLabel(kind, field) });
|
|
1012
|
+
}
|
|
1013
|
+
return fields3;
|
|
1014
|
+
}
|
|
1015
|
+
function formFor(kind, options = {}) {
|
|
1016
|
+
return {
|
|
1017
|
+
kind,
|
|
1018
|
+
itemId: options.item?.id,
|
|
1019
|
+
fields: fieldsOf(kind),
|
|
1020
|
+
ongoing: KIND_META[kind].ongoing,
|
|
1021
|
+
months: MONTHS,
|
|
1022
|
+
values: options.values ?? (options.item ? formValues(options.item) : {}),
|
|
1023
|
+
error: options.error
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// src/admin/static/career-js.generated.ts
|
|
1028
|
+
var CAREER_JS = '"use strict";(()=>{document.addEventListener("htmx:beforeSwap",r=>{let{detail:e}=r,{status:t}=e.xhr;(t===400||t===503)&&e.target.id==="career-library"&&(e.shouldSwap=!0,e.isError=!1)});})();\n';
|
|
1029
|
+
|
|
1030
|
+
// src/admin/career/view.tsx
|
|
1031
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs8 } from "hono/jsx/jsx-runtime";
|
|
1032
|
+
var HALF = /* @__PURE__ */ new Set(["startYear", "startMonth", "endYear", "endMonth"]);
|
|
1033
|
+
var MONTH_FIELDS = /* @__PURE__ */ new Set(["startMonth", "endMonth"]);
|
|
1034
|
+
var ICONS = {
|
|
1035
|
+
up: "m6 15 6-6 6 6",
|
|
1036
|
+
down: "m6 9 6 6 6-6",
|
|
1037
|
+
edit: "M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z",
|
|
1038
|
+
remove: "M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6"
|
|
1039
|
+
};
|
|
1040
|
+
var Icon = ({ name }) => /* @__PURE__ */ jsx9(
|
|
1041
|
+
"svg",
|
|
1042
|
+
{
|
|
1043
|
+
viewBox: "0 0 24 24",
|
|
1044
|
+
width: "20",
|
|
1045
|
+
height: "20",
|
|
1046
|
+
fill: "none",
|
|
1047
|
+
stroke: "currentColor",
|
|
1048
|
+
"stroke-width": "2",
|
|
1049
|
+
"stroke-linecap": "round",
|
|
1050
|
+
"stroke-linejoin": "round",
|
|
1051
|
+
"aria-hidden": "true",
|
|
1052
|
+
children: /* @__PURE__ */ jsx9("path", { d: ICONS[name] })
|
|
1053
|
+
}
|
|
1054
|
+
);
|
|
1055
|
+
var FieldControl = ({ field, form }) => {
|
|
1056
|
+
const id = `f-${field.name}`;
|
|
1057
|
+
const value = form.values[field.name] ?? "";
|
|
1058
|
+
if (field.name === "details") {
|
|
1059
|
+
return /* @__PURE__ */ jsx9("textarea", { class: "input", id, name: field.name, rows: 6, children: value });
|
|
1060
|
+
}
|
|
1061
|
+
if (MONTH_FIELDS.has(field.name)) {
|
|
1062
|
+
return /* @__PURE__ */ jsxs8("select", { class: "input", id, name: field.name, children: [
|
|
1063
|
+
/* @__PURE__ */ jsx9("option", { value: "", children: "Month" }),
|
|
1064
|
+
form.months.map((month, i) => /* @__PURE__ */ jsx9("option", { value: String(i + 1), selected: value === String(i + 1), children: month }))
|
|
1065
|
+
] });
|
|
1066
|
+
}
|
|
1067
|
+
return /* @__PURE__ */ jsx9(
|
|
1068
|
+
"input",
|
|
1069
|
+
{
|
|
1070
|
+
class: "input",
|
|
1071
|
+
id,
|
|
1072
|
+
type: "text",
|
|
1073
|
+
name: field.name,
|
|
1074
|
+
value,
|
|
1075
|
+
inputmode: field.name.endsWith("Year") ? "numeric" : void 0
|
|
1076
|
+
}
|
|
1077
|
+
);
|
|
1078
|
+
};
|
|
1079
|
+
var ItemForm = ({ form, url }) => {
|
|
1080
|
+
const save = form.itemId ? { "hx-put": `${url}/${form.itemId}` } : { "hx-post": url };
|
|
1081
|
+
return /* @__PURE__ */ jsxs8("form", { class: "career-form", ...save, children: [
|
|
1082
|
+
form.itemId ? null : /* @__PURE__ */ jsx9("input", { type: "hidden", name: "kind", value: form.kind }),
|
|
1083
|
+
form.fields.map((field) => /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1084
|
+
/* @__PURE__ */ jsxs8("div", { class: HALF.has(field.name) ? "field" : "field career-wide", children: [
|
|
1085
|
+
/* @__PURE__ */ jsx9("label", { class: "field-label", for: `f-${field.name}`, children: field.label }),
|
|
1086
|
+
/* @__PURE__ */ jsx9(FieldControl, { field, form })
|
|
1087
|
+
] }),
|
|
1088
|
+
field.name === "endMonth" && form.ongoing ? /* @__PURE__ */ jsxs8("label", { class: "check career-wide career-ongoing", children: [
|
|
1089
|
+
/* @__PURE__ */ jsx9(
|
|
1090
|
+
"input",
|
|
1091
|
+
{
|
|
1092
|
+
type: "checkbox",
|
|
1093
|
+
name: "current",
|
|
1094
|
+
value: "on",
|
|
1095
|
+
checked: form.values.current === "on"
|
|
1096
|
+
}
|
|
1097
|
+
),
|
|
1098
|
+
form.ongoing
|
|
1099
|
+
] }) : null
|
|
1100
|
+
] })),
|
|
1101
|
+
form.error ? /* @__PURE__ */ jsx9("div", { class: "error career-wide", role: "alert", "data-toast": "error", children: form.error }) : null,
|
|
1102
|
+
/* @__PURE__ */ jsxs8("div", { class: "career-actions career-wide", children: [
|
|
1103
|
+
/* @__PURE__ */ jsx9("button", { type: "button", class: "career-cancel", "hx-get": url, children: "Cancel" }),
|
|
1104
|
+
/* @__PURE__ */ jsx9("button", { type: "submit", class: "btn", children: "Save" })
|
|
1105
|
+
] })
|
|
1106
|
+
] });
|
|
1107
|
+
};
|
|
1108
|
+
var Row2 = ({
|
|
1109
|
+
row,
|
|
1110
|
+
url,
|
|
1111
|
+
first,
|
|
1112
|
+
last
|
|
1113
|
+
}) => {
|
|
1114
|
+
const base = `${url}/${row.id}`;
|
|
1115
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1116
|
+
/* @__PURE__ */ jsxs8("div", { class: "career-row-text", children: [
|
|
1117
|
+
/* @__PURE__ */ jsx9("span", { class: "career-row-title", children: row.title }),
|
|
1118
|
+
row.meta ? /* @__PURE__ */ jsx9("span", { class: "career-row-meta", children: row.meta }) : null
|
|
1119
|
+
] }),
|
|
1120
|
+
/* @__PURE__ */ jsxs8("div", { class: "career-row-controls", children: [
|
|
1121
|
+
/* @__PURE__ */ jsx9(
|
|
1122
|
+
"button",
|
|
1123
|
+
{
|
|
1124
|
+
type: "button",
|
|
1125
|
+
class: "career-icon",
|
|
1126
|
+
"aria-label": `Move ${row.title} up`,
|
|
1127
|
+
"hx-post": `${base}/move`,
|
|
1128
|
+
"hx-vals": JSON.stringify({ direction: "up" }),
|
|
1129
|
+
disabled: first,
|
|
1130
|
+
children: /* @__PURE__ */ jsx9(Icon, { name: "up" })
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
/* @__PURE__ */ jsx9(
|
|
1134
|
+
"button",
|
|
1135
|
+
{
|
|
1136
|
+
type: "button",
|
|
1137
|
+
class: "career-icon",
|
|
1138
|
+
"aria-label": `Move ${row.title} down`,
|
|
1139
|
+
"hx-post": `${base}/move`,
|
|
1140
|
+
"hx-vals": JSON.stringify({ direction: "down" }),
|
|
1141
|
+
disabled: last,
|
|
1142
|
+
children: /* @__PURE__ */ jsx9(Icon, { name: "down" })
|
|
1143
|
+
}
|
|
1144
|
+
),
|
|
1145
|
+
/* @__PURE__ */ jsx9(
|
|
1146
|
+
"button",
|
|
1147
|
+
{
|
|
1148
|
+
type: "button",
|
|
1149
|
+
class: "career-icon",
|
|
1150
|
+
"aria-label": `Edit ${row.title}`,
|
|
1151
|
+
"hx-get": `${base}/edit`,
|
|
1152
|
+
children: /* @__PURE__ */ jsx9(Icon, { name: "edit" })
|
|
1153
|
+
}
|
|
1154
|
+
),
|
|
1155
|
+
/* @__PURE__ */ jsx9(
|
|
1156
|
+
"button",
|
|
1157
|
+
{
|
|
1158
|
+
type: "button",
|
|
1159
|
+
class: "career-icon career-danger",
|
|
1160
|
+
"aria-label": `Delete ${row.title}`,
|
|
1161
|
+
"hx-delete": base,
|
|
1162
|
+
"hx-confirm": "Delete this item?",
|
|
1163
|
+
children: /* @__PURE__ */ jsx9(Icon, { name: "remove" })
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
] })
|
|
1167
|
+
] });
|
|
1168
|
+
};
|
|
1169
|
+
var LeftOut = ({ rows, url }) => /* @__PURE__ */ jsxs8("details", { class: "disclosure", children: [
|
|
1170
|
+
/* @__PURE__ */ jsxs8("summary", { children: [
|
|
1171
|
+
"Left out (",
|
|
1172
|
+
rows.length,
|
|
1173
|
+
")"
|
|
1174
|
+
] }),
|
|
1175
|
+
/* @__PURE__ */ jsx9("ul", { class: "career-rows", children: rows.map((row) => /* @__PURE__ */ jsxs8("li", { class: "career-row", children: [
|
|
1176
|
+
/* @__PURE__ */ jsxs8("div", { class: "career-row-text", children: [
|
|
1177
|
+
/* @__PURE__ */ jsx9("span", { class: "career-row-title", children: row.title }),
|
|
1178
|
+
row.meta ? /* @__PURE__ */ jsx9("span", { class: "career-row-meta", children: row.meta }) : null
|
|
1179
|
+
] }),
|
|
1180
|
+
/* @__PURE__ */ jsx9("div", { class: "career-row-controls", children: /* @__PURE__ */ jsx9(
|
|
1181
|
+
"button",
|
|
1182
|
+
{
|
|
1183
|
+
type: "button",
|
|
1184
|
+
class: "career-add",
|
|
1185
|
+
"aria-label": `Add back ${row.title}`,
|
|
1186
|
+
"hx-post": `${url}/${row.id}`,
|
|
1187
|
+
children: "Add back"
|
|
1188
|
+
}
|
|
1189
|
+
) })
|
|
1190
|
+
] })) })
|
|
1191
|
+
] });
|
|
1192
|
+
var Card = ({
|
|
1193
|
+
card,
|
|
1194
|
+
url,
|
|
1195
|
+
leftOutUrl,
|
|
1196
|
+
form
|
|
1197
|
+
}) => {
|
|
1198
|
+
const adding = form && form.kind === card.kind && !form.itemId;
|
|
1199
|
+
return /* @__PURE__ */ jsxs8("section", { class: "career-card", "aria-labelledby": `career-${card.kind}`, children: [
|
|
1200
|
+
/* @__PURE__ */ jsxs8("header", { class: "career-head", children: [
|
|
1201
|
+
/* @__PURE__ */ jsxs8("h2", { id: `career-${card.kind}`, class: "career-title", children: [
|
|
1202
|
+
card.section,
|
|
1203
|
+
card.rows.length > 0 ? /* @__PURE__ */ jsx9("span", { class: "badge", children: card.rows.length }) : null
|
|
1204
|
+
] }),
|
|
1205
|
+
/* @__PURE__ */ jsxs8("button", { type: "button", class: "career-add", "hx-get": `${url}/new?kind=${card.kind}`, children: [
|
|
1206
|
+
/* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "+" }),
|
|
1207
|
+
" ",
|
|
1208
|
+
card.add
|
|
1209
|
+
] })
|
|
1210
|
+
] }),
|
|
1211
|
+
card.rows.length === 0 && !adding ? /* @__PURE__ */ jsx9("p", { class: "career-empty", children: "Nothing here yet." }) : null,
|
|
1212
|
+
card.rows.length > 0 ? /* @__PURE__ */ jsx9("ul", { class: "career-rows", children: card.rows.map((row, i) => /* @__PURE__ */ jsx9("li", { class: "career-row", children: form?.itemId === row.id ? /* @__PURE__ */ jsx9(ItemForm, { form, url }) : /* @__PURE__ */ jsx9(Row2, { row, url, first: i === 0, last: i === card.rows.length - 1 }) })) }) : null,
|
|
1213
|
+
adding ? /* @__PURE__ */ jsx9(ItemForm, { form, url }) : null,
|
|
1214
|
+
leftOutUrl && card.leftOut && card.leftOut.length > 0 ? /* @__PURE__ */ jsx9(LeftOut, { rows: card.leftOut, url: leftOutUrl }) : null
|
|
1215
|
+
] });
|
|
1216
|
+
};
|
|
1217
|
+
var CareerCards = ({
|
|
1218
|
+
cards,
|
|
1219
|
+
url,
|
|
1220
|
+
leftOutUrl,
|
|
1221
|
+
form,
|
|
1222
|
+
children
|
|
1223
|
+
}) => /* @__PURE__ */ jsxs8("div", { id: "career-library", class: "career-cards", "hx-target": "#career-library", "hx-swap": "outerHTML", children: [
|
|
1224
|
+
children,
|
|
1225
|
+
cards.map((card) => /* @__PURE__ */ jsx9(Card, { card, url, leftOutUrl, form }))
|
|
1226
|
+
] });
|
|
898
1227
|
|
|
899
1228
|
// src/admin/profile/view.tsx
|
|
900
|
-
import { jsx as jsx10, jsxs as jsxs9 } from "hono/jsx/jsx-runtime";
|
|
1229
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs9 } from "hono/jsx/jsx-runtime";
|
|
901
1230
|
var FIELDS = [
|
|
902
|
-
{ name: "fullName", label: "Full name", long: false, required: false },
|
|
903
|
-
{ name: "headline", label: "Headline", long: false, required: false },
|
|
904
|
-
{ name: "
|
|
905
|
-
{
|
|
906
|
-
|
|
907
|
-
|
|
1231
|
+
{ name: "fullName", label: "Full name", long: false, required: false, tab: "career" },
|
|
1232
|
+
{ name: "headline", label: "Headline", long: false, required: false, tab: "career" },
|
|
1233
|
+
{ name: "summary", label: "Summary", long: true, required: false, tab: "career" },
|
|
1234
|
+
{
|
|
1235
|
+
name: "publicSystemPrompt",
|
|
1236
|
+
label: "Public system prompt",
|
|
1237
|
+
long: true,
|
|
1238
|
+
required: true,
|
|
1239
|
+
tab: "ai"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
name: "recruiterSystemPrompt",
|
|
1243
|
+
label: "Recruiter system prompt",
|
|
1244
|
+
long: true,
|
|
1245
|
+
required: true,
|
|
1246
|
+
tab: "ai"
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
name: "tailorSystemPrompt",
|
|
1250
|
+
label: "Tailor system prompt",
|
|
1251
|
+
long: true,
|
|
1252
|
+
required: true,
|
|
1253
|
+
tab: "ai"
|
|
1254
|
+
}
|
|
908
1255
|
];
|
|
1256
|
+
var TABS = [
|
|
1257
|
+
{ id: "career", label: "Career content" },
|
|
1258
|
+
{ id: "ai", label: "AI behaviour" }
|
|
1259
|
+
];
|
|
1260
|
+
var ProfileTabs = ({ basePath, active }) => /* @__PURE__ */ jsx10("div", { class: "tabs", role: "tablist", "aria-label": "Profile sections", children: TABS.map((t) => /* @__PURE__ */ jsx10(
|
|
1261
|
+
"a",
|
|
1262
|
+
{
|
|
1263
|
+
class: "tab",
|
|
1264
|
+
role: "tab",
|
|
1265
|
+
href: `${basePath}/admin/profile?tab=${t.id}`,
|
|
1266
|
+
"aria-selected": t.id === active ? "true" : "false",
|
|
1267
|
+
"aria-current": t.id === active ? "page" : void 0,
|
|
1268
|
+
children: t.label
|
|
1269
|
+
}
|
|
1270
|
+
)) });
|
|
1271
|
+
var Toolbar = ({ base }) => /* @__PURE__ */ jsxs9("div", { class: "career-toolbar", children: [
|
|
1272
|
+
/* @__PURE__ */ jsx10("h2", { class: "section-title", children: "Career library" }),
|
|
1273
|
+
/* @__PURE__ */ jsxs9("div", { class: "actions", children: [
|
|
1274
|
+
/* @__PURE__ */ jsx10("button", { type: "button", class: "btn-ghost btn-sm", "hx-get": `${base}/markdown`, children: "Edit as markdown" }),
|
|
1275
|
+
/* @__PURE__ */ jsx10("button", { type: "button", class: "btn-ghost btn-sm", "hx-get": `${base}/import`, children: "Import from text" })
|
|
1276
|
+
] })
|
|
1277
|
+
] });
|
|
1278
|
+
var LibraryCards = ({
|
|
1279
|
+
basePath,
|
|
1280
|
+
cards,
|
|
1281
|
+
form
|
|
1282
|
+
}) => /* @__PURE__ */ jsx10(CareerCards, { cards, url: `${basePath}/admin/profile/items`, form, children: /* @__PURE__ */ jsx10(Toolbar, { base: `${basePath}/admin/profile` }) });
|
|
1283
|
+
var Actions = ({ cancel, submit }) => /* @__PURE__ */ jsxs9("div", { class: "career-actions", children: [
|
|
1284
|
+
/* @__PURE__ */ jsx10("button", { type: "button", class: "career-cancel", "hx-get": cancel, children: "Cancel" }),
|
|
1285
|
+
/* @__PURE__ */ jsx10("button", { type: "submit", class: "btn", children: submit })
|
|
1286
|
+
] });
|
|
1287
|
+
var MarkdownEditor = ({
|
|
1288
|
+
basePath,
|
|
1289
|
+
markdown,
|
|
1290
|
+
error
|
|
1291
|
+
}) => /* @__PURE__ */ jsx10("div", { id: "career-library", "hx-target": "#career-library", "hx-swap": "outerHTML", children: /* @__PURE__ */ jsxs9("form", { class: "card-pad", "hx-put": `${basePath}/admin/profile/markdown`, children: [
|
|
1292
|
+
/* @__PURE__ */ jsx10("h2", { class: "section-title", children: "Edit as markdown" }),
|
|
1293
|
+
/* @__PURE__ */ jsx10("label", { class: "field-label", for: "career-markdown", children: "Career library as markdown" }),
|
|
1294
|
+
/* @__PURE__ */ jsx10("textarea", { class: "input mono", id: "career-markdown", name: "markdown", rows: 28, children: markdown }),
|
|
1295
|
+
error ? /* @__PURE__ */ jsx10(ErrorFragment, { message: error, toast: true }) : null,
|
|
1296
|
+
/* @__PURE__ */ jsx10(Actions, { cancel: `${basePath}/admin/profile/items`, submit: "Save" })
|
|
1297
|
+
] }) });
|
|
1298
|
+
var ImportForm = ({
|
|
1299
|
+
basePath,
|
|
1300
|
+
text: text4,
|
|
1301
|
+
error
|
|
1302
|
+
}) => /* @__PURE__ */ jsx10("div", { id: "career-library", "hx-target": "#career-library", "hx-swap": "outerHTML", children: /* @__PURE__ */ jsxs9(
|
|
1303
|
+
"form",
|
|
1304
|
+
{
|
|
1305
|
+
class: "card-pad",
|
|
1306
|
+
"hx-post": `${basePath}/admin/profile/import`,
|
|
1307
|
+
"hx-indicator": "#import-indicator",
|
|
1308
|
+
"hx-disabled-elt": "find button[type=submit]",
|
|
1309
|
+
children: [
|
|
1310
|
+
/* @__PURE__ */ jsx10("h2", { class: "section-title", children: "Import from text" }),
|
|
1311
|
+
/* @__PURE__ */ jsx10("label", { class: "field-label", for: "career-import", children: "Paste your CV in any format" }),
|
|
1312
|
+
/* @__PURE__ */ jsx10("textarea", { class: "input", id: "career-import", name: "text", rows: 20, children: text4 }),
|
|
1313
|
+
error ? /* @__PURE__ */ jsx10(ErrorFragment, { message: error, toast: true }) : null,
|
|
1314
|
+
/* @__PURE__ */ jsxs9("div", { class: "career-actions", children: [
|
|
1315
|
+
/* @__PURE__ */ jsx10("span", { id: "import-indicator", class: "htmx-indicator muted", children: "Converting\u2026" }),
|
|
1316
|
+
/* @__PURE__ */ jsx10("button", { type: "button", class: "career-cancel", "hx-get": `${basePath}/admin/profile/items`, children: "Cancel" }),
|
|
1317
|
+
/* @__PURE__ */ jsx10("button", { type: "submit", class: "btn", children: "Convert" })
|
|
1318
|
+
] })
|
|
1319
|
+
]
|
|
1320
|
+
}
|
|
1321
|
+
) });
|
|
1322
|
+
var ProfileForm = ({
|
|
1323
|
+
basePath,
|
|
1324
|
+
values,
|
|
1325
|
+
tab,
|
|
1326
|
+
error,
|
|
1327
|
+
saved
|
|
1328
|
+
}) => /* @__PURE__ */ jsxs9(
|
|
1329
|
+
"form",
|
|
1330
|
+
{
|
|
1331
|
+
id: "profile-form",
|
|
1332
|
+
class: "card-pad",
|
|
1333
|
+
method: "post",
|
|
1334
|
+
action: `${basePath}/admin/profile`,
|
|
1335
|
+
"hx-post": `${basePath}/admin/profile`,
|
|
1336
|
+
"hx-target": "#profile-form",
|
|
1337
|
+
"hx-swap": "outerHTML",
|
|
1338
|
+
"hx-disabled-elt": "find button[type=submit]",
|
|
1339
|
+
"data-swap-errors": true,
|
|
1340
|
+
children: [
|
|
1341
|
+
error ? /* @__PURE__ */ jsx10(ErrorFragment, { message: error, toast: true }) : null,
|
|
1342
|
+
saved ? /* @__PURE__ */ jsx10("p", { class: "status", role: "status", "data-toast": "success", children: "Saved" }) : null,
|
|
1343
|
+
/* @__PURE__ */ jsx10("input", { type: "hidden", name: "tab", value: tab }),
|
|
1344
|
+
FIELDS.filter((f) => f.tab === tab).map((f) => /* @__PURE__ */ jsxs9("div", { class: "field", children: [
|
|
1345
|
+
/* @__PURE__ */ jsx10("label", { class: "field-label", for: f.name, children: f.label }),
|
|
1346
|
+
f.long ? /* @__PURE__ */ jsx10("textarea", { class: "input", id: f.name, name: f.name, rows: f.name === "summary" ? 5 : 8, children: values[f.name] }) : /* @__PURE__ */ jsx10("input", { class: "input", id: f.name, type: "text", name: f.name, value: values[f.name] })
|
|
1347
|
+
] })),
|
|
1348
|
+
/* @__PURE__ */ jsx10("div", { class: "actions", children: /* @__PURE__ */ jsx10("button", { type: "submit", class: "btn", children: "Save" }) })
|
|
1349
|
+
]
|
|
1350
|
+
}
|
|
1351
|
+
);
|
|
909
1352
|
var ProfilePage = ({
|
|
910
1353
|
basePath,
|
|
911
1354
|
values,
|
|
1355
|
+
cards,
|
|
1356
|
+
tab,
|
|
912
1357
|
error,
|
|
913
1358
|
saved
|
|
914
1359
|
}) => /* @__PURE__ */ jsxs9(Layout, { title: "Profile", basePath, section: "profile", children: [
|
|
@@ -917,34 +1362,22 @@ var ProfilePage = ({
|
|
|
917
1362
|
{
|
|
918
1363
|
eyebrow: "Profile",
|
|
919
1364
|
title: "Profile",
|
|
920
|
-
sub: "
|
|
1365
|
+
sub: "What the AI knows about you, and how it talks about it. Contact data lives in Personal info."
|
|
921
1366
|
}
|
|
922
1367
|
),
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
/* @__PURE__ */ jsxs9(
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
"textarea",
|
|
930
|
-
{
|
|
931
|
-
class: f.name === "masterCv" ? "input mono" : "input",
|
|
932
|
-
id: f.name,
|
|
933
|
-
name: f.name,
|
|
934
|
-
rows: f.name === "masterCv" ? 24 : 8,
|
|
935
|
-
children: values[f.name]
|
|
936
|
-
}
|
|
937
|
-
) : /* @__PURE__ */ jsx10("input", { class: "input", id: f.name, type: "text", name: f.name, value: values[f.name] })
|
|
938
|
-
] })),
|
|
939
|
-
/* @__PURE__ */ jsx10("div", { class: "actions", children: /* @__PURE__ */ jsx10("button", { type: "submit", class: "btn", children: "Save" }) })
|
|
940
|
-
] })
|
|
1368
|
+
/* @__PURE__ */ jsx10(ProfileTabs, { basePath, active: tab }),
|
|
1369
|
+
/* @__PURE__ */ jsx10(ProfileForm, { basePath, values, tab, error, saved }),
|
|
1370
|
+
tab === "career" ? /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1371
|
+
/* @__PURE__ */ jsx10(LibraryCards, { basePath, cards }),
|
|
1372
|
+
/* @__PURE__ */ jsx10("script", { src: `${basePath}/admin/profile/career.js` })
|
|
1373
|
+
] }) : null
|
|
941
1374
|
] });
|
|
942
1375
|
|
|
943
1376
|
// src/admin/profile/routes.ts
|
|
944
1377
|
var EMPTY = {
|
|
945
1378
|
fullName: "",
|
|
946
1379
|
headline: "",
|
|
947
|
-
|
|
1380
|
+
summary: "",
|
|
948
1381
|
publicSystemPrompt: "",
|
|
949
1382
|
recruiterSystemPrompt: "",
|
|
950
1383
|
tailorSystemPrompt: ""
|
|
@@ -955,7 +1388,7 @@ async function currentValues(c) {
|
|
|
955
1388
|
return {
|
|
956
1389
|
fullName: p.fullName,
|
|
957
1390
|
headline: p.headline,
|
|
958
|
-
|
|
1391
|
+
summary: p.summary,
|
|
959
1392
|
publicSystemPrompt: p.publicSystemPrompt,
|
|
960
1393
|
recruiterSystemPrompt: p.recruiterSystemPrompt,
|
|
961
1394
|
tailorSystemPrompt: p.tailorSystemPrompt
|
|
@@ -965,23 +1398,80 @@ async function currentValues(c) {
|
|
|
965
1398
|
throw error;
|
|
966
1399
|
}
|
|
967
1400
|
}
|
|
968
|
-
|
|
1401
|
+
async function currentCards(c) {
|
|
1402
|
+
return cardsFrom((await c.var.services.career.library()).items);
|
|
1403
|
+
}
|
|
1404
|
+
async function cardsFragment(c, form) {
|
|
1405
|
+
return LibraryCards({ basePath: c.var.config.basePath, cards: await currentCards(c), form });
|
|
1406
|
+
}
|
|
1407
|
+
function tabOf(value) {
|
|
1408
|
+
return value === "ai" ? "ai" : "career";
|
|
1409
|
+
}
|
|
1410
|
+
function kindOf(value) {
|
|
1411
|
+
const found = KINDS.find((k) => k === value);
|
|
1412
|
+
if (!found) throw new ValidationError("Unknown kind");
|
|
1413
|
+
return found;
|
|
1414
|
+
}
|
|
1415
|
+
async function fields(c) {
|
|
1416
|
+
const body = await c.req.parseBody();
|
|
1417
|
+
return Object.fromEntries(
|
|
1418
|
+
Object.entries(body).filter(([, v]) => typeof v === "string")
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
async function findItem(c, id) {
|
|
1422
|
+
const item = (await c.var.services.career.library()).items.find((i) => i.id === id);
|
|
1423
|
+
if (!item) throw new NotFoundError("Career item not found");
|
|
1424
|
+
return item;
|
|
1425
|
+
}
|
|
1426
|
+
async function change(c, run, reopen) {
|
|
1427
|
+
try {
|
|
1428
|
+
await run();
|
|
1429
|
+
} catch (error) {
|
|
1430
|
+
if (error instanceof ValidationError) {
|
|
1431
|
+
return c.html(await cardsFragment(c, await reopen(error.message)), 400);
|
|
1432
|
+
}
|
|
1433
|
+
throw error;
|
|
1434
|
+
}
|
|
1435
|
+
return c.html(await cardsFragment(c));
|
|
1436
|
+
}
|
|
1437
|
+
var profileRouter = new Hono7();
|
|
969
1438
|
profileRouter.get(
|
|
970
1439
|
"/profile",
|
|
971
|
-
async (c) => c.html(
|
|
1440
|
+
async (c) => c.html(
|
|
1441
|
+
ProfilePage({
|
|
1442
|
+
basePath: c.var.config.basePath,
|
|
1443
|
+
values: await currentValues(c),
|
|
1444
|
+
cards: await currentCards(c),
|
|
1445
|
+
tab: tabOf(c.req.query("tab")),
|
|
1446
|
+
saved: c.req.query("saved") === "1"
|
|
1447
|
+
})
|
|
1448
|
+
)
|
|
1449
|
+
);
|
|
1450
|
+
profileRouter.get(
|
|
1451
|
+
"/profile/career.js",
|
|
1452
|
+
(c) => c.body(CAREER_JS, 200, { "Content-Type": "text/javascript; charset=utf-8" })
|
|
972
1453
|
);
|
|
973
1454
|
profileRouter.post("/profile", async (c) => {
|
|
974
1455
|
const basePath = c.var.config.basePath;
|
|
975
1456
|
const body = await c.req.parseBody();
|
|
976
|
-
const values =
|
|
1457
|
+
const values = await currentValues(c);
|
|
977
1458
|
for (const f of FIELDS) {
|
|
978
|
-
const
|
|
979
|
-
|
|
1459
|
+
const raw2 = body[f.name];
|
|
1460
|
+
if (typeof raw2 === "string") values[f.name] = raw2;
|
|
980
1461
|
}
|
|
981
|
-
const
|
|
1462
|
+
const tab = tabOf(body.tab);
|
|
1463
|
+
const htmx = c.req.header("HX-Request") === "true";
|
|
1464
|
+
const reject = async (message, on = tab) => htmx ? c.html(ProfileForm({ basePath, values, tab, error: message }), 400) : c.html(
|
|
1465
|
+
ProfilePage({ basePath, values, cards: await currentCards(c), tab: on, error: message }),
|
|
1466
|
+
400
|
|
1467
|
+
);
|
|
982
1468
|
const missing = FIELDS.find((f) => f.required && values[f.name].trim() === "");
|
|
983
|
-
if (missing) return reject(`${missing.label} is required
|
|
984
|
-
const found = findPii(
|
|
1469
|
+
if (missing) return reject(`${missing.label} is required`, missing.tab);
|
|
1470
|
+
const found = findPii(
|
|
1471
|
+
`${values.headline}
|
|
1472
|
+
${values.summary}`,
|
|
1473
|
+
await c.var.services.personalInfo.allValues()
|
|
1474
|
+
)[0];
|
|
985
1475
|
if (found)
|
|
986
1476
|
return reject(`Your ${found.label} is in the body \u2014 keep contact data in Personal info`);
|
|
987
1477
|
try {
|
|
@@ -990,87 +1480,313 @@ profileRouter.post("/profile", async (c) => {
|
|
|
990
1480
|
if (error instanceof ValidationError) return reject(error.message);
|
|
991
1481
|
throw error;
|
|
992
1482
|
}
|
|
993
|
-
return c.html(
|
|
1483
|
+
if (htmx) return c.html(ProfileForm({ basePath, values, tab, saved: true }));
|
|
1484
|
+
return c.redirect(`${basePath}/admin/profile?tab=${tab}&saved=1`, 303);
|
|
1485
|
+
});
|
|
1486
|
+
profileRouter.get("/profile/items", async (c) => c.html(await cardsFragment(c)));
|
|
1487
|
+
profileRouter.get(
|
|
1488
|
+
"/profile/items/new",
|
|
1489
|
+
async (c) => c.html(await cardsFragment(c, formFor(kindOf(c.req.query("kind")))))
|
|
1490
|
+
);
|
|
1491
|
+
profileRouter.get("/profile/items/:id/edit", async (c) => {
|
|
1492
|
+
const item = await findItem(c, c.req.param("id"));
|
|
1493
|
+
return c.html(await cardsFragment(c, formFor(item.kind, { item })));
|
|
1494
|
+
});
|
|
1495
|
+
profileRouter.post("/profile/items", async (c) => {
|
|
1496
|
+
const body = await fields(c);
|
|
1497
|
+
const kind = kindOf(body.kind);
|
|
1498
|
+
return change(
|
|
1499
|
+
c,
|
|
1500
|
+
() => c.var.services.career.add(kind, body),
|
|
1501
|
+
async (error) => formFor(kind, { values: body, error })
|
|
1502
|
+
);
|
|
1503
|
+
});
|
|
1504
|
+
profileRouter.put("/profile/items/:id", async (c) => {
|
|
1505
|
+
const id = c.req.param("id");
|
|
1506
|
+
const body = await fields(c);
|
|
1507
|
+
const item = await findItem(c, id);
|
|
1508
|
+
return change(
|
|
1509
|
+
c,
|
|
1510
|
+
() => c.var.services.career.edit(id, body),
|
|
1511
|
+
async (error) => formFor(item.kind, { item, values: body, error })
|
|
1512
|
+
);
|
|
1513
|
+
});
|
|
1514
|
+
profileRouter.post("/profile/items/:id/move", async (c) => {
|
|
1515
|
+
const { direction } = await fields(c);
|
|
1516
|
+
if (direction !== "up" && direction !== "down") throw new ValidationError("Unknown direction");
|
|
1517
|
+
await c.var.services.career.move(c.req.param("id"), direction);
|
|
1518
|
+
return c.html(await cardsFragment(c));
|
|
1519
|
+
});
|
|
1520
|
+
profileRouter.delete("/profile/items/:id", async (c) => {
|
|
1521
|
+
await c.var.services.career.remove(c.req.param("id"));
|
|
1522
|
+
return c.html(await cardsFragment(c));
|
|
1523
|
+
});
|
|
1524
|
+
profileRouter.get(
|
|
1525
|
+
"/profile/markdown",
|
|
1526
|
+
async (c) => c.html(
|
|
1527
|
+
MarkdownEditor({
|
|
1528
|
+
basePath: c.var.config.basePath,
|
|
1529
|
+
markdown: await c.var.services.career.markdown()
|
|
1530
|
+
})
|
|
1531
|
+
)
|
|
1532
|
+
);
|
|
1533
|
+
profileRouter.put("/profile/markdown", async (c) => {
|
|
1534
|
+
const { markdown = "" } = await fields(c);
|
|
1535
|
+
try {
|
|
1536
|
+
await c.var.services.career.saveMarkdown(markdown);
|
|
1537
|
+
} catch (error) {
|
|
1538
|
+
if (error instanceof ValidationError) {
|
|
1539
|
+
return c.html(
|
|
1540
|
+
MarkdownEditor({ basePath: c.var.config.basePath, markdown, error: error.message }),
|
|
1541
|
+
400
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
throw error;
|
|
1545
|
+
}
|
|
1546
|
+
return c.html(await cardsFragment(c));
|
|
1547
|
+
});
|
|
1548
|
+
profileRouter.get(
|
|
1549
|
+
"/profile/import",
|
|
1550
|
+
(c) => c.html(ImportForm({ basePath: c.var.config.basePath, text: "" }))
|
|
1551
|
+
);
|
|
1552
|
+
profileRouter.post("/profile/import", async (c) => {
|
|
1553
|
+
const basePath = c.var.config.basePath;
|
|
1554
|
+
const { text: text4 = "" } = await fields(c);
|
|
1555
|
+
try {
|
|
1556
|
+
const markdown = await c.var.services.career.importText(text4);
|
|
1557
|
+
return c.html(MarkdownEditor({ basePath, markdown }));
|
|
1558
|
+
} catch (error) {
|
|
1559
|
+
if (error instanceof ValidationError) {
|
|
1560
|
+
return c.html(ImportForm({ basePath, text: text4, error: error.message }), 400);
|
|
1561
|
+
}
|
|
1562
|
+
if (error instanceof LlmUnavailableError) {
|
|
1563
|
+
return c.html(ImportForm({ basePath, text: text4, error: error.message }), 503);
|
|
1564
|
+
}
|
|
1565
|
+
throw error;
|
|
1566
|
+
}
|
|
994
1567
|
});
|
|
995
1568
|
|
|
996
1569
|
// src/admin/resumes/routes.ts
|
|
997
|
-
import { Hono as
|
|
998
|
-
import { raw as raw3 } from "hono/html";
|
|
1570
|
+
import { Hono as Hono8 } from "hono";
|
|
999
1571
|
|
|
1000
1572
|
// src/admin/static/resumes-js.generated.ts
|
|
1001
|
-
var EDITOR_JS = '"use strict";(()=>{function r
|
|
1573
|
+
var EDITOR_JS = '"use strict";(()=>{document.addEventListener("htmx:beforeSwap",r=>{let{detail:t}=r,{status:e}=t.xhr;(e===400||e===503)&&t.target.id==="career-library"&&(t.shouldSwap=!0,t.isError=!1)});function a(r){document.addEventListener("htmx:beforeSwap",t=>{let{detail:e}=t,o=document.getElementById(r);e.xhr.status>=400&&o&&!e.shouldSwap&&(e.shouldSwap=!0,e.isError=!1,e.target=o,e.swapOverride="innerHTML")})}a("editor-status");})();\n';
|
|
1002
1574
|
|
|
1003
1575
|
// src/admin/resumes/view.tsx
|
|
1004
|
-
import {
|
|
1005
|
-
|
|
1576
|
+
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs10 } from "hono/jsx/jsx-runtime";
|
|
1577
|
+
var NOT_GENERATED = "Not generated yet";
|
|
1578
|
+
var INVALID_DOCUMENT = "This resume's stored data is invalid; generate it again";
|
|
1006
1579
|
var day = (d) => d.toISOString().slice(0, 10);
|
|
1580
|
+
var ScoreBar = ({ score }) => {
|
|
1581
|
+
if (score === null || score === void 0) {
|
|
1582
|
+
return /* @__PURE__ */ jsxs10("span", { class: "muted", children: [
|
|
1583
|
+
/* @__PURE__ */ jsx11("span", { "aria-hidden": "true", children: "\u2014" }),
|
|
1584
|
+
/* @__PURE__ */ jsx11("span", { class: "sr-only", children: "Not assessed" })
|
|
1585
|
+
] });
|
|
1586
|
+
}
|
|
1587
|
+
const pct = Math.max(0, Math.min(100, Math.round(score)));
|
|
1588
|
+
return /* @__PURE__ */ jsxs10("span", { class: "score", children: [
|
|
1589
|
+
/* @__PURE__ */ jsx11("span", { class: "score-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx11("span", { class: "score-fill", style: `width: ${pct}%` }) }),
|
|
1590
|
+
/* @__PURE__ */ jsxs10("span", { class: "score-value", children: [
|
|
1591
|
+
pct,
|
|
1592
|
+
"%",
|
|
1593
|
+
/* @__PURE__ */ jsx11("span", { class: "sr-only", children: " match score" })
|
|
1594
|
+
] })
|
|
1595
|
+
] });
|
|
1596
|
+
};
|
|
1007
1597
|
var ResumeRow = ({ basePath, resume }) => {
|
|
1008
1598
|
const url = `${basePath}/admin/resumes/${resume.id}`;
|
|
1009
1599
|
return /* @__PURE__ */ jsxs10("tr", { children: [
|
|
1010
1600
|
/* @__PURE__ */ jsx11("td", { children: /* @__PURE__ */ jsx11("a", { class: "font-semibold", href: url, children: resume.title }) }),
|
|
1011
1601
|
/* @__PURE__ */ jsx11("td", { children: resume.company ?? "" }),
|
|
1012
|
-
/* @__PURE__ */ jsx11("td", { class: "mono muted", children: resume.model ?? "" }),
|
|
1013
1602
|
/* @__PURE__ */ jsx11("td", { class: "muted", children: day(resume.updatedAt) }),
|
|
1603
|
+
/* @__PURE__ */ jsx11("td", { children: /* @__PURE__ */ jsx11(ScoreBar, { score: resume.score }) }),
|
|
1014
1604
|
/* @__PURE__ */ jsx11("td", { children: /* @__PURE__ */ jsx11(
|
|
1015
1605
|
"button",
|
|
1016
1606
|
{
|
|
1017
1607
|
type: "button",
|
|
1018
|
-
class: "
|
|
1608
|
+
class: "career-icon career-danger",
|
|
1609
|
+
"aria-label": `Delete ${resume.title}`,
|
|
1019
1610
|
"hx-delete": url,
|
|
1020
1611
|
"hx-confirm": `Delete ${resume.title}?`,
|
|
1021
1612
|
"hx-target": "closest tr",
|
|
1022
1613
|
"hx-swap": "outerHTML",
|
|
1023
|
-
children: "
|
|
1614
|
+
children: /* @__PURE__ */ jsx11(Icon, { name: "remove" })
|
|
1024
1615
|
}
|
|
1025
1616
|
) })
|
|
1026
1617
|
] });
|
|
1027
1618
|
};
|
|
1028
|
-
var ResumesPage = ({
|
|
1619
|
+
var ResumesPage = ({
|
|
1620
|
+
basePath,
|
|
1621
|
+
resumes,
|
|
1622
|
+
options
|
|
1623
|
+
}) => /* @__PURE__ */ jsxs10(Layout, { title: "Resumes", basePath, section: "resumes", children: [
|
|
1029
1624
|
/* @__PURE__ */ jsx11(
|
|
1030
1625
|
PageHeader,
|
|
1031
1626
|
{
|
|
1032
1627
|
eyebrow: "Resumes",
|
|
1033
1628
|
title: "Tailored resumes",
|
|
1034
|
-
sub: "One resume per job description, generated from your
|
|
1629
|
+
sub: "One resume per job description, generated from your career library."
|
|
1035
1630
|
}
|
|
1036
1631
|
),
|
|
1037
1632
|
resumes.length === 0 ? /* @__PURE__ */ jsx11("p", { class: "empty-state", children: "No tailored resumes yet" }) : /* @__PURE__ */ jsx11("div", { class: "table-wrap", children: /* @__PURE__ */ jsxs10("table", { class: "table", children: [
|
|
1038
1633
|
/* @__PURE__ */ jsx11("thead", { children: /* @__PURE__ */ jsxs10("tr", { children: [
|
|
1039
1634
|
/* @__PURE__ */ jsx11("th", { children: "Title" }),
|
|
1040
1635
|
/* @__PURE__ */ jsx11("th", { children: "Company" }),
|
|
1041
|
-
/* @__PURE__ */ jsx11("th", { children: "Model" }),
|
|
1042
1636
|
/* @__PURE__ */ jsx11("th", { children: "Updated" }),
|
|
1043
|
-
/* @__PURE__ */ jsx11("th", {})
|
|
1637
|
+
/* @__PURE__ */ jsx11("th", { children: "Score" }),
|
|
1638
|
+
/* @__PURE__ */ jsx11("th", { children: /* @__PURE__ */ jsx11("span", { class: "sr-only", children: "Actions" }) })
|
|
1044
1639
|
] }) }),
|
|
1045
1640
|
/* @__PURE__ */ jsx11("tbody", { children: resumes.map((resume) => /* @__PURE__ */ jsx11(ResumeRow, { basePath, resume })) })
|
|
1046
1641
|
] }) }),
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1642
|
+
/* @__PURE__ */ jsx11("script", { src: `${basePath}/admin/resumes/editor.js` }),
|
|
1643
|
+
/* @__PURE__ */ jsxs10(
|
|
1644
|
+
"form",
|
|
1645
|
+
{
|
|
1646
|
+
class: "card-pad",
|
|
1647
|
+
method: "post",
|
|
1648
|
+
action: `${basePath}/admin/resumes`,
|
|
1649
|
+
"hx-boost": "true",
|
|
1650
|
+
"hx-disabled-elt": "find button[type=submit]",
|
|
1651
|
+
"hx-indicator": "#create-indicator",
|
|
1652
|
+
children: [
|
|
1653
|
+
/* @__PURE__ */ jsx11("h2", { class: "section-title", children: "New resume" }),
|
|
1654
|
+
/* @__PURE__ */ jsxs10("div", { class: "form-grid", children: [
|
|
1655
|
+
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1656
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "title", children: "Title" }),
|
|
1657
|
+
/* @__PURE__ */ jsx11("input", { class: "input", id: "title", type: "text", name: "title", required: true })
|
|
1658
|
+
] }),
|
|
1659
|
+
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1660
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "company", children: "Company" }),
|
|
1661
|
+
/* @__PURE__ */ jsx11("input", { class: "input", id: "company", type: "text", name: "company" })
|
|
1662
|
+
] })
|
|
1663
|
+
] }),
|
|
1664
|
+
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1665
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "jobDescription", children: "Job Description" }),
|
|
1666
|
+
/* @__PURE__ */ jsx11("textarea", { class: "input", id: "jobDescription", name: "jobDescription", rows: 12, required: true })
|
|
1667
|
+
] }),
|
|
1668
|
+
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1669
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "customInstructions", children: "Custom instructions" }),
|
|
1670
|
+
/* @__PURE__ */ jsx11("textarea", { class: "input", id: "customInstructions", name: "customInstructions", rows: 4 })
|
|
1671
|
+
] }),
|
|
1672
|
+
options.length > 0 && /* @__PURE__ */ jsxs10("fieldset", { class: "checks", children: [
|
|
1673
|
+
/* @__PURE__ */ jsx11("legend", { children: "Personal header" }),
|
|
1674
|
+
/* @__PURE__ */ jsx11("input", { type: "hidden", name: "headerFieldsPosted", value: "1" }),
|
|
1675
|
+
options.map((o) => /* @__PURE__ */ jsxs10("label", { class: "check", children: [
|
|
1676
|
+
/* @__PURE__ */ jsx11("input", { type: "checkbox", name: "headerFields", value: o.key, checked: true }),
|
|
1677
|
+
" ",
|
|
1678
|
+
o.label,
|
|
1679
|
+
" "
|
|
1680
|
+
] }))
|
|
1681
|
+
] }),
|
|
1682
|
+
/* @__PURE__ */ jsxs10("div", { class: "actions", children: [
|
|
1683
|
+
/* @__PURE__ */ jsx11("button", { type: "submit", class: "btn", children: "Create" }),
|
|
1684
|
+
" ",
|
|
1685
|
+
/* @__PURE__ */ jsx11("span", { id: "create-indicator", class: "htmx-indicator muted", children: "Generating\u2026" })
|
|
1686
|
+
] }),
|
|
1687
|
+
/* @__PURE__ */ jsx11("p", { id: "editor-status", class: "status", role: "status" })
|
|
1688
|
+
]
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
] });
|
|
1692
|
+
var HeaderCard = ({
|
|
1693
|
+
url,
|
|
1694
|
+
fullName: fullName2,
|
|
1695
|
+
headline,
|
|
1696
|
+
summary,
|
|
1697
|
+
error
|
|
1698
|
+
}) => /* @__PURE__ */ jsxs10("details", { class: "career-card career-header", open: error !== void 0, children: [
|
|
1699
|
+
/* @__PURE__ */ jsx11("summary", { class: "career-header-summary", children: /* @__PURE__ */ jsxs10("span", { class: "career-row-text", children: [
|
|
1700
|
+
/* @__PURE__ */ jsx11("span", { class: "career-title", children: "Header" }),
|
|
1701
|
+
/* @__PURE__ */ jsx11("span", { class: "career-row-meta", children: [fullName2, headline].filter(Boolean).join(" \xB7 ") })
|
|
1702
|
+
] }) }),
|
|
1703
|
+
/* @__PURE__ */ jsxs10("form", { class: "career-form", "hx-put": `${url}/header`, children: [
|
|
1704
|
+
/* @__PURE__ */ jsxs10("div", { class: "field career-wide", children: [
|
|
1705
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "header-headline", children: "Headline" }),
|
|
1706
|
+
/* @__PURE__ */ jsx11("input", { class: "input", id: "header-headline", type: "text", name: "headline", value: headline })
|
|
1062
1707
|
] }),
|
|
1063
|
-
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1064
|
-
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "
|
|
1065
|
-
/* @__PURE__ */ jsx11("textarea", { class: "input", id: "
|
|
1708
|
+
/* @__PURE__ */ jsxs10("div", { class: "field career-wide", children: [
|
|
1709
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "header-summary", children: "Summary" }),
|
|
1710
|
+
/* @__PURE__ */ jsx11("textarea", { class: "input", id: "header-summary", name: "summary", rows: 6, children: summary })
|
|
1066
1711
|
] }),
|
|
1067
|
-
/* @__PURE__ */ jsx11("div", { class: "
|
|
1712
|
+
error ? /* @__PURE__ */ jsx11("div", { class: "error career-wide", role: "alert", "data-toast": "error", children: error }) : null,
|
|
1713
|
+
/* @__PURE__ */ jsx11("div", { class: "career-actions career-wide", children: /* @__PURE__ */ jsx11("button", { type: "submit", class: "btn", children: "Save" }) })
|
|
1068
1714
|
] })
|
|
1069
1715
|
] });
|
|
1716
|
+
var ResumeCards = ({
|
|
1717
|
+
basePath,
|
|
1718
|
+
resume,
|
|
1719
|
+
fullName: fullName2,
|
|
1720
|
+
cards,
|
|
1721
|
+
form,
|
|
1722
|
+
headerError,
|
|
1723
|
+
leftOutError
|
|
1724
|
+
}) => {
|
|
1725
|
+
const url = `${basePath}/admin/resumes/${resume.id}`;
|
|
1726
|
+
if (!resume.document) {
|
|
1727
|
+
return /* @__PURE__ */ jsx11("div", { id: "career-library", children: /* @__PURE__ */ jsx11("p", { class: "empty-state", children: resume.invalid ? INVALID_DOCUMENT : NOT_GENERATED }) });
|
|
1728
|
+
}
|
|
1729
|
+
return /* @__PURE__ */ jsxs10(CareerCards, { cards, url: `${url}/items`, leftOutUrl: `${url}/left-out`, form, children: [
|
|
1730
|
+
leftOutError ? /* @__PURE__ */ jsx11("div", { class: "error", role: "alert", "data-toast": "error", children: leftOutError }) : null,
|
|
1731
|
+
/* @__PURE__ */ jsx11(
|
|
1732
|
+
HeaderCard,
|
|
1733
|
+
{
|
|
1734
|
+
url,
|
|
1735
|
+
fullName: fullName2,
|
|
1736
|
+
headline: resume.document.headline,
|
|
1737
|
+
summary: resume.document.summary,
|
|
1738
|
+
error: headerError
|
|
1739
|
+
}
|
|
1740
|
+
)
|
|
1741
|
+
] });
|
|
1742
|
+
};
|
|
1743
|
+
var AssessmentPanels = ({ assessment }) => {
|
|
1744
|
+
if (!assessment) {
|
|
1745
|
+
return /* @__PURE__ */ jsxs10("article", { class: "card-pad", id: "assessment", children: [
|
|
1746
|
+
/* @__PURE__ */ jsx11("h2", { class: "section-title", children: "Not assessed yet" }),
|
|
1747
|
+
/* @__PURE__ */ jsx11("p", { class: "muted", children: "Generate to see the assessment." })
|
|
1748
|
+
] });
|
|
1749
|
+
}
|
|
1750
|
+
return /* @__PURE__ */ jsxs10("div", { class: "assessment-grid", id: "assessment", children: [
|
|
1751
|
+
/* @__PURE__ */ jsxs10("article", { class: "card-pad", children: [
|
|
1752
|
+
/* @__PURE__ */ jsx11("h2", { class: "section-title", children: "Why this score" }),
|
|
1753
|
+
/* @__PURE__ */ jsx11("p", { children: /* @__PURE__ */ jsxs10("strong", { children: [
|
|
1754
|
+
assessment.score,
|
|
1755
|
+
" \xB7 ",
|
|
1756
|
+
assessment.band
|
|
1757
|
+
] }) }),
|
|
1758
|
+
/* @__PURE__ */ jsx11("p", { children: assessment.rationale })
|
|
1759
|
+
] }),
|
|
1760
|
+
/* @__PURE__ */ jsxs10("article", { class: "card-pad", children: [
|
|
1761
|
+
/* @__PURE__ */ jsx11("h2", { class: "section-title", children: "Missing skills" }),
|
|
1762
|
+
assessment.missingSkills.length === 0 ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1763
|
+
/* @__PURE__ */ jsx11("p", { children: /* @__PURE__ */ jsx11("strong", { children: "No significant gaps" }) }),
|
|
1764
|
+
/* @__PURE__ */ jsx11("p", { class: "muted", children: "Your career library covers the role's stated requirements." })
|
|
1765
|
+
] }) : /* @__PURE__ */ jsx11("p", { class: "flex flex-wrap gap-2", children: assessment.missingSkills.map((skill) => /* @__PURE__ */ jsx11("span", { class: "badge badge-warning", children: skill })) })
|
|
1766
|
+
] }),
|
|
1767
|
+
/* @__PURE__ */ jsxs10("article", { class: "card-pad", children: [
|
|
1768
|
+
/* @__PURE__ */ jsx11("h2", { class: "section-title", children: "What was left out" }),
|
|
1769
|
+
assessment.omissions.length === 0 ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1770
|
+
/* @__PURE__ */ jsx11("p", { children: /* @__PURE__ */ jsx11("strong", { children: "Nothing was left out" }) }),
|
|
1771
|
+
/* @__PURE__ */ jsx11("p", { class: "muted", children: "Your whole career library made it into this resume." })
|
|
1772
|
+
] }) : /* @__PURE__ */ jsx11("ul", { class: "flex flex-col gap-3", children: assessment.omissions.map((omission) => /* @__PURE__ */ jsxs10("li", { children: [
|
|
1773
|
+
/* @__PURE__ */ jsx11("strong", { children: omission.what }),
|
|
1774
|
+
/* @__PURE__ */ jsxs10("span", { class: "muted", children: [
|
|
1775
|
+
" ",
|
|
1776
|
+
omission.reason
|
|
1777
|
+
] })
|
|
1778
|
+
] })) })
|
|
1779
|
+
] })
|
|
1780
|
+
] });
|
|
1781
|
+
};
|
|
1070
1782
|
var Editor = ({
|
|
1071
1783
|
basePath,
|
|
1072
1784
|
resume,
|
|
1073
|
-
options
|
|
1785
|
+
options,
|
|
1786
|
+
fullName: fullName2,
|
|
1787
|
+
cards,
|
|
1788
|
+
assessment,
|
|
1789
|
+
error
|
|
1074
1790
|
}) => {
|
|
1075
1791
|
const url = `${basePath}/admin/resumes/${resume.id}`;
|
|
1076
1792
|
const selected = resume.headerFields;
|
|
@@ -1083,88 +1799,68 @@ var Editor = ({
|
|
|
1083
1799
|
/* @__PURE__ */ jsx11("summary", { children: "Job Description" }),
|
|
1084
1800
|
/* @__PURE__ */ jsx11("pre", { children: resume.jobDescription })
|
|
1085
1801
|
] }),
|
|
1086
|
-
/* @__PURE__ */ jsxs10("
|
|
1087
|
-
/* @__PURE__ */ jsxs10("
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
id: "content",
|
|
1095
|
-
name: "content",
|
|
1096
|
-
rows: 28,
|
|
1097
|
-
"hx-post": `${url}/preview`,
|
|
1098
|
-
"hx-trigger": "input changed delay:400ms",
|
|
1099
|
-
"hx-target": "#preview",
|
|
1100
|
-
children: resume.content
|
|
1101
|
-
}
|
|
1102
|
-
)
|
|
1103
|
-
] }),
|
|
1104
|
-
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1105
|
-
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "custom-instructions", children: "Custom instructions" }),
|
|
1106
|
-
/* @__PURE__ */ jsx11("textarea", { class: "input", id: "custom-instructions", name: "customInstructions", rows: 4, children: resume.customInstructions })
|
|
1107
|
-
] }),
|
|
1108
|
-
/* @__PURE__ */ jsxs10("fieldset", { class: "checks", children: [
|
|
1109
|
-
/* @__PURE__ */ jsx11("legend", { children: "Personal header" }),
|
|
1110
|
-
options.map((o) => /* @__PURE__ */ jsxs10("label", { class: "check", children: [
|
|
1111
|
-
/* @__PURE__ */ jsx11(
|
|
1112
|
-
"input",
|
|
1113
|
-
{
|
|
1114
|
-
type: "checkbox",
|
|
1115
|
-
name: "headerFields",
|
|
1116
|
-
value: o.key,
|
|
1117
|
-
checked: selected === null || selected.includes(o.key)
|
|
1118
|
-
}
|
|
1119
|
-
),
|
|
1120
|
-
" ",
|
|
1121
|
-
o.label,
|
|
1122
|
-
" "
|
|
1123
|
-
] }))
|
|
1124
|
-
] }),
|
|
1125
|
-
/* @__PURE__ */ jsxs10("div", { class: "actions", children: [
|
|
1126
|
-
/* @__PURE__ */ jsx11(
|
|
1127
|
-
"button",
|
|
1128
|
-
{
|
|
1129
|
-
type: "button",
|
|
1130
|
-
class: "btn",
|
|
1131
|
-
"hx-post": `${url}/generate`,
|
|
1132
|
-
"hx-target": "#editor",
|
|
1133
|
-
"hx-swap": "outerHTML",
|
|
1134
|
-
"hx-indicator": "#generate-indicator",
|
|
1135
|
-
"hx-disabled-elt": "this",
|
|
1136
|
-
"hx-include": "#custom-instructions",
|
|
1137
|
-
"hx-confirm": resume.content.trim() === "" ? void 0 : "Replace the current content?",
|
|
1138
|
-
children: "Generate"
|
|
1139
|
-
}
|
|
1140
|
-
),
|
|
1141
|
-
" ",
|
|
1142
|
-
/* @__PURE__ */ jsx11("span", { id: "generate-indicator", class: "htmx-indicator muted", children: "Generating\u2026" }),
|
|
1143
|
-
" ",
|
|
1802
|
+
/* @__PURE__ */ jsxs10("form", { id: "resume-form", class: "card-pad", children: [
|
|
1803
|
+
/* @__PURE__ */ jsxs10("div", { class: "field", children: [
|
|
1804
|
+
/* @__PURE__ */ jsx11("label", { class: "field-label", for: "custom-instructions", children: "Custom instructions" }),
|
|
1805
|
+
/* @__PURE__ */ jsx11("textarea", { class: "input", id: "custom-instructions", name: "customInstructions", rows: 4, children: resume.customInstructions })
|
|
1806
|
+
] }),
|
|
1807
|
+
/* @__PURE__ */ jsxs10("fieldset", { class: "checks", children: [
|
|
1808
|
+
/* @__PURE__ */ jsx11("legend", { children: "Personal header" }),
|
|
1809
|
+
options.map((o) => /* @__PURE__ */ jsxs10("label", { class: "check", children: [
|
|
1144
1810
|
/* @__PURE__ */ jsx11(
|
|
1145
|
-
"
|
|
1811
|
+
"input",
|
|
1146
1812
|
{
|
|
1147
|
-
type: "
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
"hx-target": "#editor-status",
|
|
1152
|
-
"hx-swap": "innerHTML",
|
|
1153
|
-
children: "Save"
|
|
1813
|
+
type: "checkbox",
|
|
1814
|
+
name: "headerFields",
|
|
1815
|
+
value: o.key,
|
|
1816
|
+
checked: selected === null || selected.includes(o.key)
|
|
1154
1817
|
}
|
|
1155
1818
|
),
|
|
1156
1819
|
" ",
|
|
1157
|
-
|
|
1158
|
-
" "
|
|
1159
|
-
|
|
1160
|
-
] }),
|
|
1161
|
-
/* @__PURE__ */ jsx11("p", { id: "editor-status", class: "status", role: "status" })
|
|
1820
|
+
o.label,
|
|
1821
|
+
" "
|
|
1822
|
+
] }))
|
|
1162
1823
|
] }),
|
|
1163
|
-
/* @__PURE__ */ jsxs10("
|
|
1164
|
-
/* @__PURE__ */ jsx11(
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1824
|
+
/* @__PURE__ */ jsxs10("div", { class: "actions", children: [
|
|
1825
|
+
/* @__PURE__ */ jsx11(
|
|
1826
|
+
"button",
|
|
1827
|
+
{
|
|
1828
|
+
type: "button",
|
|
1829
|
+
class: "btn",
|
|
1830
|
+
"hx-post": `${url}/generate`,
|
|
1831
|
+
"hx-target": "#editor",
|
|
1832
|
+
"hx-swap": "outerHTML",
|
|
1833
|
+
"hx-indicator": "#generate-indicator",
|
|
1834
|
+
"hx-disabled-elt": "this",
|
|
1835
|
+
"hx-include": "#custom-instructions",
|
|
1836
|
+
"hx-confirm": resume.document ? "Replace the current content?" : void 0,
|
|
1837
|
+
children: "Generate"
|
|
1838
|
+
}
|
|
1839
|
+
),
|
|
1840
|
+
" ",
|
|
1841
|
+
/* @__PURE__ */ jsx11("span", { id: "generate-indicator", class: "htmx-indicator muted", children: "Generating\u2026" }),
|
|
1842
|
+
" ",
|
|
1843
|
+
/* @__PURE__ */ jsx11(
|
|
1844
|
+
"button",
|
|
1845
|
+
{
|
|
1846
|
+
type: "button",
|
|
1847
|
+
class: "btn-ghost",
|
|
1848
|
+
"hx-put": url,
|
|
1849
|
+
"hx-include": "#resume-form",
|
|
1850
|
+
"hx-target": "#editor-status",
|
|
1851
|
+
"hx-swap": "innerHTML",
|
|
1852
|
+
children: "Save options"
|
|
1853
|
+
}
|
|
1854
|
+
),
|
|
1855
|
+
" ",
|
|
1856
|
+
/* @__PURE__ */ jsx11("a", { class: "btn-ghost", href: `${url}/print`, target: "_blank", rel: "noopener", children: "Print" }),
|
|
1857
|
+
" ",
|
|
1858
|
+
/* @__PURE__ */ jsx11("a", { class: "btn-ghost", href: `${url}/download.md`, children: "Download .md" })
|
|
1859
|
+
] }),
|
|
1860
|
+
/* @__PURE__ */ jsx11("p", { id: "editor-status", class: "status", role: "status", children: error && /* @__PURE__ */ jsx11("span", { class: "text-danger", children: error }) })
|
|
1861
|
+
] }),
|
|
1862
|
+
/* @__PURE__ */ jsx11(AssessmentPanels, { assessment }),
|
|
1863
|
+
/* @__PURE__ */ jsx11(ResumeCards, { basePath, resume, fullName: fullName2, cards })
|
|
1168
1864
|
] }) });
|
|
1169
1865
|
};
|
|
1170
1866
|
var EditorPage = (p) => /* @__PURE__ */ jsxs10(Layout, { title: p.resume.title, basePath: p.basePath, section: "resumes", children: [
|
|
@@ -1177,22 +1873,39 @@ var EditorPage = (p) => /* @__PURE__ */ jsxs10(Layout, { title: p.resume.title,
|
|
|
1177
1873
|
// src/admin/resumes/routes.ts
|
|
1178
1874
|
var text3 = (value) => typeof value === "string" ? value : "";
|
|
1179
1875
|
var optionalText = (value) => typeof value === "string" ? value : void 0;
|
|
1180
|
-
var
|
|
1876
|
+
var CREATE_ERRORS = {
|
|
1877
|
+
generate: "Generation failed, try again",
|
|
1878
|
+
"empty-library": "Add Career Items to your profile before generating",
|
|
1879
|
+
"full-name": "Your full name is in the career library \u2014 it is added when printed"
|
|
1880
|
+
};
|
|
1881
|
+
var createError = (code) => code !== void 0 && Object.hasOwn(CREATE_ERRORS, code) ? CREATE_ERRORS[code] : void 0;
|
|
1882
|
+
var headerKeys = (fields3) => (Array.isArray(fields3) ? fields3 : [fields3]).filter((k) => typeof k === "string");
|
|
1883
|
+
var resumesRouter = new Hono8();
|
|
1181
1884
|
resumesRouter.get(
|
|
1182
1885
|
"/resumes",
|
|
1183
1886
|
async (c) => c.html(
|
|
1184
|
-
ResumesPage({
|
|
1887
|
+
ResumesPage({
|
|
1888
|
+
basePath: c.var.config.basePath,
|
|
1889
|
+
resumes: (await c.var.services.resumes.list()).map((resume) => ({
|
|
1890
|
+
...resume,
|
|
1891
|
+
score: resume.assessment?.score ?? null
|
|
1892
|
+
})),
|
|
1893
|
+
options: await c.var.services.resumes.headerOptions()
|
|
1894
|
+
})
|
|
1185
1895
|
)
|
|
1186
1896
|
);
|
|
1187
1897
|
resumesRouter.post("/resumes", async (c) => {
|
|
1188
|
-
const body = await c.req.parseBody();
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1898
|
+
const body = await c.req.parseBody({ all: true });
|
|
1899
|
+
const first = (value) => text3(Array.isArray(value) ? value[0] : value);
|
|
1900
|
+
const { resume, error } = await c.var.services.resumes.createAndGenerate({
|
|
1901
|
+
title: first(body.title),
|
|
1902
|
+
company: first(body.company),
|
|
1903
|
+
jobDescription: first(body.jobDescription),
|
|
1904
|
+
customInstructions: first(body.customInstructions),
|
|
1905
|
+
headerKeys: body.headerFieldsPosted === void 0 ? void 0 : headerKeys(body.headerFields)
|
|
1194
1906
|
});
|
|
1195
|
-
|
|
1907
|
+
const query = error ? `?error=${error}` : "";
|
|
1908
|
+
return c.redirect(`${c.var.config.basePath}/admin/resumes/${resume.id}${query}`, 303);
|
|
1196
1909
|
});
|
|
1197
1910
|
resumesRouter.delete("/resumes/:id", async (c) => {
|
|
1198
1911
|
await c.var.services.resumes.delete(c.req.param("id"));
|
|
@@ -1202,16 +1915,43 @@ resumesRouter.get(
|
|
|
1202
1915
|
"/resumes/editor.js",
|
|
1203
1916
|
(c) => c.body(EDITOR_JS, 200, { "Content-Type": "text/javascript; charset=utf-8" })
|
|
1204
1917
|
);
|
|
1918
|
+
async function fullName(c) {
|
|
1919
|
+
try {
|
|
1920
|
+
return (await c.var.services.profile.get()).fullName;
|
|
1921
|
+
} catch (error) {
|
|
1922
|
+
if (error instanceof NotFoundError) return "";
|
|
1923
|
+
throw error;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1205
1926
|
async function editor(c, resume) {
|
|
1927
|
+
const items = resume.document?.items ?? [];
|
|
1928
|
+
const library = (await c.var.services.career.library()).items;
|
|
1206
1929
|
return {
|
|
1207
1930
|
basePath: c.var.config.basePath,
|
|
1208
1931
|
resume,
|
|
1209
|
-
|
|
1932
|
+
fullName: await fullName(c),
|
|
1933
|
+
cards: cardsFrom(items, leftOut(library, items)),
|
|
1934
|
+
options: await c.var.services.resumes.headerOptions(),
|
|
1935
|
+
assessment: resume.assessment && {
|
|
1936
|
+
score: resume.assessment.score,
|
|
1937
|
+
band: bandFor(resume.assessment.score).label,
|
|
1938
|
+
rationale: resume.assessment.rationale,
|
|
1939
|
+
missingSkills: resume.assessment.missingSkills,
|
|
1940
|
+
omissions: resume.assessment.omissions
|
|
1941
|
+
}
|
|
1210
1942
|
};
|
|
1211
1943
|
}
|
|
1944
|
+
async function cardsFragment2(c, resume, reopen = {}) {
|
|
1945
|
+
const { options: _options, ...props } = await editor(c, resume);
|
|
1946
|
+
const { header, ...extra } = reopen;
|
|
1947
|
+
const shown = resume.document && header ? { ...resume, document: { ...resume.document, ...header } } : resume;
|
|
1948
|
+
return ResumeCards({ ...props, resume: shown, ...extra });
|
|
1949
|
+
}
|
|
1212
1950
|
resumesRouter.get("/resumes/:id", async (c) => {
|
|
1213
1951
|
const resume = await c.var.services.resumes.get(c.req.param("id"));
|
|
1214
|
-
return c.html(
|
|
1952
|
+
return c.html(
|
|
1953
|
+
EditorPage({ ...await editor(c, resume), error: createError(c.req.query("error")) })
|
|
1954
|
+
);
|
|
1215
1955
|
});
|
|
1216
1956
|
resumesRouter.post("/resumes/:id/generate", async (c) => {
|
|
1217
1957
|
try {
|
|
@@ -1223,40 +1963,198 @@ resumesRouter.post("/resumes/:id/generate", async (c) => {
|
|
|
1223
1963
|
return c.html(Editor(await editor(c, resume)));
|
|
1224
1964
|
} catch (error) {
|
|
1225
1965
|
if (error instanceof LlmUnavailableError) {
|
|
1226
|
-
return c.html(ErrorFragment({ message: "Generation failed, try again" }),
|
|
1966
|
+
return c.html(ErrorFragment({ message: "Generation failed, try again", toast: true }), 503);
|
|
1227
1967
|
}
|
|
1228
1968
|
throw error;
|
|
1229
1969
|
}
|
|
1230
1970
|
});
|
|
1231
|
-
resumesRouter.post("/resumes/:id/preview", async (c) => {
|
|
1232
|
-
await c.var.services.resumes.get(c.req.param("id"));
|
|
1233
|
-
const body = await c.req.parseBody();
|
|
1234
|
-
return c.html(raw3(renderMarkdown(text3(body.content))));
|
|
1235
|
-
});
|
|
1236
1971
|
resumesRouter.put("/resumes/:id", async (c) => {
|
|
1237
1972
|
const body = await c.req.parseBody({ all: true });
|
|
1238
|
-
|
|
1239
|
-
const keys = (Array.isArray(fields) ? fields : [fields]).filter(
|
|
1240
|
-
(k) => typeof k === "string"
|
|
1241
|
-
);
|
|
1242
|
-
const content = Array.isArray(body.content) ? text3(body.content[0]) : text3(body.content);
|
|
1243
|
-
await c.var.services.resumes.save(
|
|
1973
|
+
await c.var.services.resumes.updateOptions(
|
|
1244
1974
|
c.req.param("id"),
|
|
1245
|
-
|
|
1246
|
-
keys,
|
|
1975
|
+
headerKeys(body.headerFields),
|
|
1247
1976
|
optionalText(body.customInstructions)
|
|
1248
1977
|
);
|
|
1249
1978
|
return c.html("Saved");
|
|
1250
1979
|
});
|
|
1980
|
+
function kindOf2(value) {
|
|
1981
|
+
const found = KINDS.find((k) => k === value);
|
|
1982
|
+
if (!found) throw new ValidationError("Unknown kind");
|
|
1983
|
+
return found;
|
|
1984
|
+
}
|
|
1985
|
+
async function fields2(c) {
|
|
1986
|
+
const body = await c.req.parseBody();
|
|
1987
|
+
return Object.fromEntries(
|
|
1988
|
+
Object.entries(body).filter(([, v]) => typeof v === "string")
|
|
1989
|
+
);
|
|
1990
|
+
}
|
|
1991
|
+
function findItem2(resume, itemId) {
|
|
1992
|
+
const item = resume.document?.items.find((i) => i.id === itemId);
|
|
1993
|
+
if (!item) throw new NotFoundError("Resume item not found");
|
|
1994
|
+
return item;
|
|
1995
|
+
}
|
|
1996
|
+
async function change2(c, run, reopen) {
|
|
1997
|
+
const id = c.req.param("id");
|
|
1998
|
+
try {
|
|
1999
|
+
return c.html(await cardsFragment2(c, await run()));
|
|
2000
|
+
} catch (error) {
|
|
2001
|
+
if (error instanceof ValidationError) {
|
|
2002
|
+
const resume = await c.var.services.resumes.get(id);
|
|
2003
|
+
return c.html(await cardsFragment2(c, resume, reopen(error.message)), 400);
|
|
2004
|
+
}
|
|
2005
|
+
throw error;
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
resumesRouter.get(
|
|
2009
|
+
"/resumes/:id/items",
|
|
2010
|
+
async (c) => c.html(await cardsFragment2(c, await c.var.services.resumes.get(c.req.param("id"))))
|
|
2011
|
+
);
|
|
2012
|
+
resumesRouter.get("/resumes/:id/items/new", async (c) => {
|
|
2013
|
+
const resume = await c.var.services.resumes.get(c.req.param("id"));
|
|
2014
|
+
return c.html(await cardsFragment2(c, resume, { form: formFor(kindOf2(c.req.query("kind"))) }));
|
|
2015
|
+
});
|
|
2016
|
+
resumesRouter.get("/resumes/:id/items/:itemId/edit", async (c) => {
|
|
2017
|
+
const resume = await c.var.services.resumes.get(c.req.param("id"));
|
|
2018
|
+
const item = findItem2(resume, c.req.param("itemId"));
|
|
2019
|
+
return c.html(await cardsFragment2(c, resume, { form: formFor(item.kind, { item }) }));
|
|
2020
|
+
});
|
|
2021
|
+
resumesRouter.post("/resumes/:id/items", async (c) => {
|
|
2022
|
+
const body = await fields2(c);
|
|
2023
|
+
const kind = kindOf2(body.kind);
|
|
2024
|
+
return change2(
|
|
2025
|
+
c,
|
|
2026
|
+
() => c.var.services.resumes.addItem(c.req.param("id"), kind, body),
|
|
2027
|
+
(error) => ({ form: formFor(kind, { values: body, error }) })
|
|
2028
|
+
);
|
|
2029
|
+
});
|
|
2030
|
+
resumesRouter.put("/resumes/:id/items/:itemId", async (c) => {
|
|
2031
|
+
const id = c.req.param("id");
|
|
2032
|
+
const itemId = c.req.param("itemId");
|
|
2033
|
+
const body = await fields2(c);
|
|
2034
|
+
const item = findItem2(await c.var.services.resumes.get(id), itemId);
|
|
2035
|
+
return change2(
|
|
2036
|
+
c,
|
|
2037
|
+
() => c.var.services.resumes.editItem(id, itemId, body),
|
|
2038
|
+
(error) => ({ form: formFor(item.kind, { item, values: body, error }) })
|
|
2039
|
+
);
|
|
2040
|
+
});
|
|
2041
|
+
resumesRouter.post("/resumes/:id/items/:itemId/move", async (c) => {
|
|
2042
|
+
const { direction } = await fields2(c);
|
|
2043
|
+
if (direction !== "up" && direction !== "down") throw new ValidationError("Unknown direction");
|
|
2044
|
+
const resume = await c.var.services.resumes.moveItem(
|
|
2045
|
+
c.req.param("id"),
|
|
2046
|
+
c.req.param("itemId"),
|
|
2047
|
+
direction
|
|
2048
|
+
);
|
|
2049
|
+
return c.html(await cardsFragment2(c, resume));
|
|
2050
|
+
});
|
|
2051
|
+
resumesRouter.delete("/resumes/:id/items/:itemId", async (c) => {
|
|
2052
|
+
const resume = await c.var.services.resumes.removeItem(c.req.param("id"), c.req.param("itemId"));
|
|
2053
|
+
return c.html(await cardsFragment2(c, resume));
|
|
2054
|
+
});
|
|
2055
|
+
resumesRouter.post(
|
|
2056
|
+
"/resumes/:id/left-out/:libraryItemId",
|
|
2057
|
+
(c) => change2(
|
|
2058
|
+
c,
|
|
2059
|
+
() => c.var.services.resumes.addBack(c.req.param("id"), c.req.param("libraryItemId")),
|
|
2060
|
+
(leftOutError) => ({ leftOutError })
|
|
2061
|
+
)
|
|
2062
|
+
);
|
|
2063
|
+
resumesRouter.put("/resumes/:id/header", async (c) => {
|
|
2064
|
+
const { headline = "", summary = "" } = await fields2(c);
|
|
2065
|
+
return change2(
|
|
2066
|
+
c,
|
|
2067
|
+
() => c.var.services.resumes.editHeader(c.req.param("id"), { headline, summary }),
|
|
2068
|
+
(error) => ({ headerError: error, header: { headline, summary } })
|
|
2069
|
+
);
|
|
2070
|
+
});
|
|
1251
2071
|
|
|
1252
2072
|
// src/admin/settings/routes.ts
|
|
1253
|
-
import { Hono as
|
|
2073
|
+
import { Hono as Hono9 } from "hono";
|
|
1254
2074
|
|
|
1255
2075
|
// src/admin/settings/view.tsx
|
|
1256
2076
|
import { jsx as jsx12, jsxs as jsxs11 } from "hono/jsx/jsx-runtime";
|
|
2077
|
+
var TextInput = ({ row }) => /* @__PURE__ */ jsx12(
|
|
2078
|
+
"input",
|
|
2079
|
+
{
|
|
2080
|
+
class: "input",
|
|
2081
|
+
id: row.key,
|
|
2082
|
+
type: "text",
|
|
2083
|
+
name: row.key,
|
|
2084
|
+
value: row.override,
|
|
2085
|
+
placeholder: row.fallback
|
|
2086
|
+
}
|
|
2087
|
+
);
|
|
2088
|
+
var SettingsForm = ({
|
|
2089
|
+
basePath,
|
|
2090
|
+
models,
|
|
2091
|
+
limits,
|
|
2092
|
+
pageSize,
|
|
2093
|
+
pageSizes,
|
|
2094
|
+
error,
|
|
2095
|
+
saved
|
|
2096
|
+
}) => /* @__PURE__ */ jsxs11(
|
|
2097
|
+
"form",
|
|
2098
|
+
{
|
|
2099
|
+
id: "settings-form",
|
|
2100
|
+
class: "card-pad",
|
|
2101
|
+
method: "post",
|
|
2102
|
+
action: `${basePath}/admin/settings`,
|
|
2103
|
+
"hx-post": `${basePath}/admin/settings`,
|
|
2104
|
+
"hx-target": "#settings-form",
|
|
2105
|
+
"hx-swap": "outerHTML",
|
|
2106
|
+
"hx-disabled-elt": "find button[type=submit]",
|
|
2107
|
+
"data-swap-errors": true,
|
|
2108
|
+
children: [
|
|
2109
|
+
error ? /* @__PURE__ */ jsx12(ErrorFragment, { message: error, toast: true }) : null,
|
|
2110
|
+
saved ? /* @__PURE__ */ jsx12("p", { class: "status", role: "status", "data-toast": "success", children: "Saved" }) : null,
|
|
2111
|
+
/* @__PURE__ */ jsxs11("section", { class: "flex flex-col gap-4", children: [
|
|
2112
|
+
/* @__PURE__ */ jsx12("h2", { class: "section-title", children: "AI models" }),
|
|
2113
|
+
/* @__PURE__ */ jsx12("p", { class: "field-help", children: 'Temperature is 0\u20132; leave it empty to use the deployment default (shown as placeholder), or enter "default" to send none (for reasoning models that reject it).' }),
|
|
2114
|
+
models.map((g) => /* @__PURE__ */ jsxs11("fieldset", { class: "m-0 flex flex-col gap-2 border-0 p-0", "data-area": g.area, children: [
|
|
2115
|
+
/* @__PURE__ */ jsx12("legend", { class: "field-label p-0 pb-2", children: g.title }),
|
|
2116
|
+
/* @__PURE__ */ jsxs11("div", { class: "grid grid-cols-1 gap-4 sm:grid-cols-[3fr_1fr]", children: [
|
|
2117
|
+
/* @__PURE__ */ jsxs11("div", { class: "field", children: [
|
|
2118
|
+
/* @__PURE__ */ jsx12("label", { class: "field-label", for: g.model.key, children: "Model" }),
|
|
2119
|
+
/* @__PURE__ */ jsx12(TextInput, { row: g.model })
|
|
2120
|
+
] }),
|
|
2121
|
+
/* @__PURE__ */ jsxs11("div", { class: "field", children: [
|
|
2122
|
+
/* @__PURE__ */ jsx12("label", { class: "field-label", for: g.temperature.key, children: "Temperature" }),
|
|
2123
|
+
/* @__PURE__ */ jsx12(TextInput, { row: g.temperature })
|
|
2124
|
+
] })
|
|
2125
|
+
] })
|
|
2126
|
+
] }))
|
|
2127
|
+
] }),
|
|
2128
|
+
/* @__PURE__ */ jsxs11("section", { class: "mt-8 flex flex-col gap-4", children: [
|
|
2129
|
+
/* @__PURE__ */ jsx12("h2", { class: "section-title", children: "Limits" }),
|
|
2130
|
+
/* @__PURE__ */ jsx12("div", { class: "form-grid", children: limits.map((r) => /* @__PURE__ */ jsxs11("div", { class: "field", children: [
|
|
2131
|
+
/* @__PURE__ */ jsx12("label", { class: "field-label", for: r.key, children: r.label ?? r.key }),
|
|
2132
|
+
/* @__PURE__ */ jsx12("p", { class: "field-help mono", children: r.key }),
|
|
2133
|
+
/* @__PURE__ */ jsx12(TextInput, { row: r })
|
|
2134
|
+
] })) })
|
|
2135
|
+
] }),
|
|
2136
|
+
/* @__PURE__ */ jsxs11("section", { class: "mt-8 flex flex-col gap-4", children: [
|
|
2137
|
+
/* @__PURE__ */ jsx12("h2", { class: "section-title", children: "Print" }),
|
|
2138
|
+
/* @__PURE__ */ jsxs11("div", { class: "field max-w-xs", children: [
|
|
2139
|
+
/* @__PURE__ */ jsx12("label", { class: "field-label", for: pageSize.key, children: "Page size" }),
|
|
2140
|
+
/* @__PURE__ */ jsxs11("select", { class: "input", id: pageSize.key, name: pageSize.key, children: [
|
|
2141
|
+
/* @__PURE__ */ jsxs11("option", { value: "", selected: pageSize.override === "", children: [
|
|
2142
|
+
"Default (",
|
|
2143
|
+
pageSize.fallback,
|
|
2144
|
+
")"
|
|
2145
|
+
] }),
|
|
2146
|
+
pageSizes.map((size) => /* @__PURE__ */ jsx12("option", { value: size, selected: pageSize.override === size, children: size }))
|
|
2147
|
+
] })
|
|
2148
|
+
] })
|
|
2149
|
+
] }),
|
|
2150
|
+
/* @__PURE__ */ jsx12("div", { class: "actions mt-8", children: /* @__PURE__ */ jsx12("button", { type: "submit", class: "btn", children: "Save" }) })
|
|
2151
|
+
]
|
|
2152
|
+
}
|
|
2153
|
+
);
|
|
1257
2154
|
var SettingsPage = ({
|
|
1258
2155
|
basePath,
|
|
1259
|
-
|
|
2156
|
+
models,
|
|
2157
|
+
limits,
|
|
1260
2158
|
pageSize,
|
|
1261
2159
|
pageSizes,
|
|
1262
2160
|
error,
|
|
@@ -1270,79 +2168,89 @@ var SettingsPage = ({
|
|
|
1270
2168
|
sub: "Leave a field empty to remove its override and use the deployment configuration."
|
|
1271
2169
|
}
|
|
1272
2170
|
),
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
value: r.override,
|
|
1286
|
-
placeholder: r.fallback
|
|
1287
|
-
}
|
|
1288
|
-
)
|
|
1289
|
-
] })) }),
|
|
1290
|
-
/* @__PURE__ */ jsxs11("div", { class: "field max-w-xs", children: [
|
|
1291
|
-
/* @__PURE__ */ jsx12("label", { class: "field-label mono", for: pageSize.key, children: pageSize.key }),
|
|
1292
|
-
/* @__PURE__ */ jsxs11("select", { class: "input", id: pageSize.key, name: pageSize.key, children: [
|
|
1293
|
-
/* @__PURE__ */ jsxs11("option", { value: "", selected: pageSize.override === "", children: [
|
|
1294
|
-
"Default (",
|
|
1295
|
-
pageSize.fallback,
|
|
1296
|
-
")"
|
|
1297
|
-
] }),
|
|
1298
|
-
pageSizes.map((size) => /* @__PURE__ */ jsx12("option", { value: size, selected: pageSize.override === size, children: size }))
|
|
1299
|
-
] })
|
|
1300
|
-
] }),
|
|
1301
|
-
/* @__PURE__ */ jsx12("div", { class: "actions", children: /* @__PURE__ */ jsx12("button", { type: "submit", class: "btn", children: "Save" }) })
|
|
1302
|
-
] })
|
|
2171
|
+
/* @__PURE__ */ jsx12(
|
|
2172
|
+
SettingsForm,
|
|
2173
|
+
{
|
|
2174
|
+
basePath,
|
|
2175
|
+
models,
|
|
2176
|
+
limits,
|
|
2177
|
+
pageSize,
|
|
2178
|
+
pageSizes,
|
|
2179
|
+
error,
|
|
2180
|
+
saved
|
|
2181
|
+
}
|
|
2182
|
+
)
|
|
1303
2183
|
] });
|
|
1304
2184
|
|
|
1305
2185
|
// src/admin/settings/routes.ts
|
|
1306
|
-
var
|
|
2186
|
+
var LIMIT_LABELS = {
|
|
2187
|
+
publicQuestionsPerIpPerDay: "Public questions per IP per day",
|
|
2188
|
+
recruiterQuestionsDefault: "Recruiter questions (default)",
|
|
2189
|
+
publicMaxOutputTokens: "Public max output tokens",
|
|
2190
|
+
recruiterMaxOutputTokens: "Recruiter max output tokens",
|
|
2191
|
+
maxQuestionChars: "Max question characters",
|
|
2192
|
+
maxHistoryMessages: "Max history messages",
|
|
2193
|
+
sessionTtlMinutes: "Session TTL (minutes)"
|
|
2194
|
+
};
|
|
2195
|
+
var settingsRouter = new Hono9();
|
|
1307
2196
|
async function rowsFor(c, submitted) {
|
|
1308
2197
|
const { config, services } = c.var;
|
|
1309
2198
|
const stored = await services.settings.overrides();
|
|
1310
2199
|
const pick = (key) => submitted?.[key] ?? stored[key] ?? "";
|
|
1311
|
-
const
|
|
1312
|
-
|
|
2200
|
+
const models = MODEL_AREAS.map((area) => ({
|
|
2201
|
+
area,
|
|
2202
|
+
title: `${area[0]?.toUpperCase()}${area.slice(1)}`,
|
|
2203
|
+
model: {
|
|
1313
2204
|
key: modelKey(area),
|
|
1314
2205
|
override: pick(modelKey(area)),
|
|
1315
2206
|
fallback: config.models[area] ?? ""
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
key:
|
|
1319
|
-
override: pick(
|
|
1320
|
-
fallback: String(config.
|
|
1321
|
-
}
|
|
1322
|
-
|
|
2207
|
+
},
|
|
2208
|
+
temperature: {
|
|
2209
|
+
key: temperatureKey(area),
|
|
2210
|
+
override: pick(temperatureKey(area)),
|
|
2211
|
+
fallback: String(config.temperatures[area])
|
|
2212
|
+
}
|
|
2213
|
+
}));
|
|
2214
|
+
const limits = LIMIT_NAMES.map((name) => ({
|
|
2215
|
+
key: limitKey(name),
|
|
2216
|
+
label: LIMIT_LABELS[name],
|
|
2217
|
+
override: pick(limitKey(name)),
|
|
2218
|
+
fallback: String(config.limits[name])
|
|
2219
|
+
}));
|
|
1323
2220
|
return {
|
|
1324
|
-
|
|
2221
|
+
models,
|
|
2222
|
+
limits,
|
|
1325
2223
|
pageSizes: PAGE_SIZES,
|
|
1326
2224
|
pageSize: { key: PAGE_SIZE_KEY, override: pick(PAGE_SIZE_KEY), fallback: "A4" }
|
|
1327
2225
|
};
|
|
1328
2226
|
}
|
|
1329
2227
|
settingsRouter.get(
|
|
1330
2228
|
"/settings",
|
|
1331
|
-
async (c) => c.html(
|
|
2229
|
+
async (c) => c.html(
|
|
2230
|
+
SettingsPage({
|
|
2231
|
+
basePath: c.var.config.basePath,
|
|
2232
|
+
...await rowsFor(c),
|
|
2233
|
+
saved: c.req.query("saved") === "1"
|
|
2234
|
+
})
|
|
2235
|
+
)
|
|
1332
2236
|
);
|
|
1333
2237
|
settingsRouter.post("/settings", async (c) => {
|
|
1334
2238
|
const basePath = c.var.config.basePath;
|
|
1335
2239
|
const body = await c.req.parseBody();
|
|
1336
2240
|
const submitted = {};
|
|
1337
2241
|
for (const key of SETTINGS_KEYS) {
|
|
1338
|
-
const
|
|
1339
|
-
if (typeof
|
|
2242
|
+
const raw2 = body[key];
|
|
2243
|
+
if (typeof raw2 === "string") submitted[key] = raw2.trim();
|
|
1340
2244
|
}
|
|
1341
|
-
const
|
|
2245
|
+
const htmx = c.req.header("HX-Request") === "true";
|
|
2246
|
+
const reject = async (message) => htmx ? c.html(SettingsForm({ basePath, ...await rowsFor(c, submitted), error: message }), 400) : c.html(SettingsPage({ basePath, ...await rowsFor(c, submitted), error: message }), 400);
|
|
1342
2247
|
for (const [key, value] of Object.entries(submitted)) {
|
|
1343
2248
|
if (key.startsWith("limits.") && value !== "" && !/^[1-9]\d*$/.test(value)) {
|
|
1344
2249
|
return reject(`${key} must be a positive integer`);
|
|
1345
2250
|
}
|
|
2251
|
+
if (key.startsWith("temperature.") && value !== "" && value !== "default" && !(/^\d+(\.\d+)?$/.test(value) && Number(value) <= 2)) {
|
|
2252
|
+
return reject(`${key} must be a number from 0 to 2 or "default"`);
|
|
2253
|
+
}
|
|
1346
2254
|
if (key === PAGE_SIZE_KEY && value !== "" && !PAGE_SIZES.some((p) => p === value)) {
|
|
1347
2255
|
return reject(`${key} must be A4 or Letter`);
|
|
1348
2256
|
}
|
|
@@ -1355,7 +2263,8 @@ settingsRouter.post("/settings", async (c) => {
|
|
|
1355
2263
|
if (error instanceof ValidationError) return reject(error.message);
|
|
1356
2264
|
throw error;
|
|
1357
2265
|
}
|
|
1358
|
-
return c.html(
|
|
2266
|
+
if (htmx) return c.html(SettingsForm({ basePath, ...await rowsFor(c), saved: true }));
|
|
2267
|
+
return c.redirect(`${basePath}/admin/settings?saved=1`, 303);
|
|
1359
2268
|
});
|
|
1360
2269
|
|
|
1361
2270
|
// src/admin/static/fonts.generated.ts
|
|
@@ -1392,15 +2301,15 @@ var sameOrigin = createMiddleware2(async (c, next) => {
|
|
|
1392
2301
|
await next();
|
|
1393
2302
|
});
|
|
1394
2303
|
function adminRouter(config, services) {
|
|
1395
|
-
const admin = new
|
|
2304
|
+
const admin = new Hono10().basePath(`${config.basePath}/admin`);
|
|
1396
2305
|
admin.onError((error, c) => {
|
|
1397
2306
|
if (error instanceof DomainError) {
|
|
1398
2307
|
const message = error.status >= 500 ? "Something went wrong" : error.message;
|
|
1399
2308
|
if (error.status >= 500) console.error(error);
|
|
1400
|
-
return c.html(/* @__PURE__ */ jsx13(ErrorFragment, { message }), error.status);
|
|
2309
|
+
return c.html(/* @__PURE__ */ jsx13(ErrorFragment, { message, toast: true }), error.status);
|
|
1401
2310
|
}
|
|
1402
2311
|
console.error(error);
|
|
1403
|
-
return c.html(/* @__PURE__ */ jsx13(ErrorFragment, { message: "Something went wrong" }), 500);
|
|
2312
|
+
return c.html(/* @__PURE__ */ jsx13(ErrorFragment, { message: "Something went wrong", toast: true }), 500);
|
|
1404
2313
|
});
|
|
1405
2314
|
admin.use("*", async (c, next) => {
|
|
1406
2315
|
c.set("config", config);
|
|
@@ -1415,6 +2324,13 @@ function adminRouter(config, services) {
|
|
|
1415
2324
|
"Cache-Control": "public, max-age=31536000, immutable"
|
|
1416
2325
|
})
|
|
1417
2326
|
);
|
|
2327
|
+
admin.get(
|
|
2328
|
+
"/static/toast.js",
|
|
2329
|
+
(c) => c.body(TOAST_JS, 200, {
|
|
2330
|
+
"Content-Type": "text/javascript; charset=utf-8",
|
|
2331
|
+
"Cache-Control": "public, max-age=31536000, immutable"
|
|
2332
|
+
})
|
|
2333
|
+
);
|
|
1418
2334
|
admin.get(
|
|
1419
2335
|
"/static/admin.css",
|
|
1420
2336
|
(c) => c.body(admin_css_generated_default, 200, {
|
|
@@ -1432,7 +2348,10 @@ function adminRouter(config, services) {
|
|
|
1432
2348
|
});
|
|
1433
2349
|
admin.use("*", requireAdmin);
|
|
1434
2350
|
admin.route("/", loginRouter);
|
|
1435
|
-
admin.
|
|
2351
|
+
admin.get("/", async (c) => {
|
|
2352
|
+
const filled = (await c.var.services.career.library()).items.length > 0;
|
|
2353
|
+
return c.redirect(`${config.basePath}/admin/${filled ? "resumes" : "profile"}`, 302);
|
|
2354
|
+
});
|
|
1436
2355
|
admin.route("/", profileRouter);
|
|
1437
2356
|
admin.route("/", settingsRouter);
|
|
1438
2357
|
admin.route("/", personalInfoRouter);
|