@shadowclone/cli 0.0.30 → 0.0.32

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.
@@ -1 +1 @@
1
- :root{--buncss-light: ;--buncss-dark:initial;color-scheme:dark;color:#e5e4ed;--muted:#929bb3;--accent:#b6a2ee;--line:#303246;--surface:#171923;background:#090a10;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:15px}*{box-sizing:border-box}body{background:radial-gradient(at 50% 45%,#291d3c5c,#0000 65%);min-height:100vh;margin:0;padding:28px 24px}button,input,select,textarea{font:inherit}button,select{cursor:pointer}button{border:0}button:disabled{cursor:wait;opacity:.5}button,a,input,textarea,select{outline-offset:5px}:focus-visible{outline:2px solid var(--accent)}button,a{-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}.frame{overflow:clip;background:#10121b;border:1px solid #373043;border-radius:20px;max-width:1680px;margin:0 auto;box-shadow:0 24px 100px #0008,0 0 100px #9b71d208}.masthead{border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items: center;padding:18px 32px}.brand{display:inline-flex;color:inherit;text-decoration:none;align-items: center;gap:9px;font-weight:650}.brand-mark{filter:drop-shadow(0 0 8px #c0a0ff33);width:28px;height:28px}.local-badge{letter-spacing:.12em;color:var(--muted);font-size:10px}.local-badge span{display:inline-block;background:#8dd0bd;border-radius:50%;width:6px;height:6px;margin-right:6px}main{padding:32px 36px 0}.eyebrow{letter-spacing:.22em;color:var(--accent);margin:0 0 12px;font-size:10px;font-weight:650}h1,h2{font-family:Georgia,Times New Roman,serif;font-weight:400}h1{letter-spacing:-.035em;margin:0 0 12px;font-size:clamp(30px,4vw,44px)}h2{letter-spacing:-.02em;margin:0;font-size:28px}.subtitle{color:var(--muted);margin:0;line-height:1.6}.toolbar{display:flex;align-items: end;gap:14px;margin-top:24px}.scope-field{display:grid;letter-spacing:.04em;color:var(--muted);gap:7px;font-size:10px}.scope-field select{appearance:none;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0IiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJtMyA1IDQgNCA0LTQiIHN0cm9rZT0iI2I3YWVjOSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K);background-position:right 14px center;background-repeat:no-repeat;min-width:200px;padding-right:40px}input,select,textarea{color:#e5e4ed;border:1px solid var(--line);background-color:#12141f;border-radius:7px;padding:10px 12px;font-size:13px}textarea{resize:vertical;width:100%;line-height:1.6}input::placeholder,textarea::placeholder{color:#747c93}.search-field{flex:1}.search-field input{width:100%}.quiet-button{color:#bec3d4;background:0 0;border-radius:7px;padding:11px 12px;font-size:13px}.quiet-button:hover{color:#fff;background:#222533}.primary-button{color:#181323;background:linear-gradient(145deg,#c3acf5,#aa8dde);border:1px solid #dcc9ff4d;border-radius:8px;padding:14px 22px;transition:box-shadow .2s,transform .2s,background .2s;font-size:13px;font-weight:650;box-shadow:0 3px 20px #b997ec1f,inset 0 1px #f1e6ff30}.primary-button:hover{background:linear-gradient(145deg,#d3c0ff,#b79ae9);transform:translateY(-1px);box-shadow:0 0 26px #ba95f23b}.primary-button span{margin-left:16px}.scope-note{color:var(--muted);min-height:17px;margin:0;font-size:12px;line-height:1.6}.notice{color:#e1d4ab;background:#27231b;border:1px solid #796c44;border-radius:8px;margin-top:20px;padding:12px 16px;font-size:13px;line-height:1.6}.notice.success{color:#abdacb;background:#132722;border-color:#33594d}.visually-hidden{position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px}.footer{display:flex;border-top:1px solid var(--line);position:sticky;z-index:4;backdrop-filter:blur(18px);background:#171824ed;justify-content:space-between;align-items: center;gap:20px;padding:20px 32px;bottom:0;box-shadow:0 -12px 30px #0b0c1326}.footer strong{font-size:14px;font-weight:600}.footer p{color:var(--muted);margin:8px 0 0;font-size:12px}.footer-actions{display:flex;align-items: center;gap:12px}@media (width<=720px){body{padding:12px}main{padding:26px 18px 0}.masthead,.footer{padding:18px}.toolbar{flex-wrap:wrap}.scope-field,.scope-field select{width:100%}.footer{align-items: flex-start}.footer-actions{flex-direction:column-reverse;align-items: flex-end}.local-badge{font-size:9px}}@media (prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}.workspace{display:grid;grid-template-columns:minmax(0,1fr)290px;align-items: start;gap:32px;margin:28px 0}.constellation{position:relative;overflow:hidden;background:radial-gradient(circle at 50% 100%,#29203a99,#11131c 68%);border:1px solid #2c2a3a;border-radius:16px;min-width:0;min-height:360px}.constellation-controls{position:absolute;z-index:3;display:flex;gap:6px;top:12px;right:12px}.constellation-controls .quiet-button{background:#151723e8;padding:7px 10px;font-size:11px}.constellation-status{position:absolute;z-index:4;color:#d4d7e3;text-align:center;background:#151723;border:1px solid #423a50;border-radius:12px;width:min(280px,85%);padding:18px;top:40%;left:50%;transform:translate(-50%,-50%)}.constellation-status p{margin:0 0 12px}.constellation-map{position:relative;z-index:1;display:block;width:100%;margin-top:36px}.map-link{fill:none;stroke:#76668f;stroke-width:1;opacity:.62}.map-link.sibling{stroke-dasharray:2 6;opacity:.4}.map-node{color:#b1a7c6;outline:none}.map-node-skill{cursor:pointer}.map-node-hit{fill:transparent;stroke:none;rx:12px}.map-node-gem,.map-node circle{fill:#171824;stroke:#645474;stroke-width:1;transition:fill .16s,stroke .16s,opacity .16s}.map-node text{fill:#d4d7e3;paint-order:stroke;stroke:#10121b;stroke-width:5px;stroke-linejoin:round;font:13px Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.map-node-source text{fill:#cebaf5;letter-spacing:.02em;font-size:14px;font-weight:650}.map-node-category text{fill:#b9abd6;font-weight:600}.map-node-source .map-node-gem{fill:#211b2f;stroke:#a88cda}.map-node-category .map-node-gem{fill:#1b1a28;stroke:#8b75ae}.map-node-root circle{fill:#332647;stroke:#c1a5ee;stroke-width:1.5}.map-node-root image{pointer-events:none}.map-node-skill:hover .map-node-gem{fill:#382c4c;stroke:#d0b8ff;stroke-width:2}.map-node-skill:focus-visible .map-node-gem{fill:#382c4c;stroke:#d0b8ff;stroke-width:2}.map-node-skill.active .map-node-hit{stroke:#8dd0bd;stroke-width:1.5}.map-node-skill:focus-visible .map-node-hit{stroke:#8dd0bd;stroke-width:1.5}.map-node-skill.active text{fill:#f2eaff}.map-node.equipped .map-node-gem{fill:#544268;stroke:#ceb8ff;filter:drop-shadow(0 0 10px #b78cf766)}.map-node.search-miss{opacity:.16}.map-node-icon{display:grid;color:#c7b5ef;place-items: center;width:18px;height:18px}.map-node-icon svg{width:17px;height:17px}.constellation-list{position:relative;z-index:2;display:none;padding:56px 20px 20px}.list-view .constellation-map,.list-view .tree-hint{display:none}.list-view .constellation-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));align-content: start;gap:20px}.skill-list-group h3{color:#c9b2f1;letter-spacing:.08em;text-transform:uppercase;margin:0 0 9px;font-size:12px}.skill-list-item{display:block;color:#cfd3df;text-align:left;background:0 0;border-left:1px solid #423a50;width:100%;padding:8px 10px}.skill-list-item:hover,.skill-list-item:focus,.skill-list-item.equipped{color:#f2eaff;background:#241e30;border-left-color:#b999ed}.tree-hint{position:relative;z-index:2;color:var(--muted);text-align:center;pointer-events:none;margin:0 0 14px;font-size:11px}.map-node-category{cursor:pointer}.map-node-category:hover .map-node-gem{stroke:#d0b8ff;stroke-width:2}.map-node-category:focus-visible .map-node-gem{stroke:#d0b8ff;stroke-width:2}.map-node-category:focus-visible .map-node-hit{stroke:#8dd0bd;stroke-width:1.5}.map-node-category.partial .map-node-gem{stroke:#ceb8ff;stroke-dasharray:4 3}.map-collapse{cursor:pointer}.map-collapse circle{fill:#141522;stroke:#4c4260;stroke-width:1}.map-collapse path{fill:none;stroke:#cbbcec;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.map-collapse:hover circle{stroke:#8dd0bd}.map-collapse:focus-visible circle{stroke:#8dd0bd}.map-collapse:focus{outline:none}.map-node text.map-hidden-count{fill:#9a92b4;font-size:12px;font-weight:400}@media (width<=900px){.workspace{grid-template-columns:minmax(0,1fr)270px;gap:20px}}@media (width<=720px){.workspace{grid-template-columns:1fr}.constellation-map,.tree-hint{display:none}.constellation-list{display:grid;grid-template-columns:1fr;align-content: start;gap:20px}.constellation-controls{display:none}}.detail{position:sticky;background:linear-gradient(150deg,#1d1b2a,#151720 55%);border:1px solid #53446799;border-radius:14px;padding:24px;top:24px;box-shadow:0 12px 40px #0003,inset 0 1px #d2b9ff0a}.detail h2{font-size:26px;line-height:1.2}.detail-description{color:#a5afc5;display:-webkit-box;-webkit-line-clamp:3;overflow:hidden;-webkit-box-orient:vertical;margin:14px 0 24px;font-size:13px;line-height:1.7}.behavior{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:21px 0}.behavior p:last-child{color:#c3c5d0;white-space:pre-line;margin:0;font-size:13px;line-height:1.7}.skill-status{color:#8fcaba;margin:18px 0;font-size:11px;line-height:1.6}.detail .primary-button{width:100%}.detail .editor{margin-top:20px}.detail summary{color:#bdb5d2;cursor:pointer;font-size:12px}.detail textarea{min-height:200px;margin-top:12px;font:11px/1.65 ui-monospace,monospace}.detail .quiet-button{width:100%;margin-top:8px}.owner-note{color:var(--muted);font-size:11px;line-height:1.6}.identity{display:flex;border-top:1px solid #292b3d;justify-content:space-between;align-items: center;gap:24px;padding:26px 0}.identity h2{font-size:26px}.identity p:last-child{color:var(--muted);max-width:580px;margin-bottom:0;font-size:12px;line-height:1.7}.requirements{border:1px solid var(--line);background:#141824;border-radius:10px;margin:0 0 22px;padding:18px}.requirements h3{color:#b6c4d4;margin:0 0 10px;font-size:12px}.requirements p{color:var(--muted);margin:7px 0 0;font-size:12px;line-height:1.6}dialog{color:#e5e4ed;background:#151720;border:1px solid #414258;border-radius:18px;width:min(780px,100vw - 40px);max-height:88vh;padding:28px;box-shadow:0 35px 120px #0008}dialog::backdrop{backdrop-filter:blur(4px);background:#06070be3}.dialog-heading{display:flex;justify-content:space-between;align-items: flex-start;gap:20px;margin-bottom:25px}.dialog-heading .quiet-button{margin-top:-8px}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}#review-content{overflow:auto;max-height:52vh}.file-change{border:1px solid var(--line);border-radius:8px;margin:12px 0;padding:14px}.file-change summary{cursor:pointer;color:#c7b8e8;overflow-wrap:anywhere;font-size:12px}.file-change h4{text-transform:uppercase;letter-spacing:.12em;color:var(--muted);margin-bottom:8px;font-size:10px}.file-change pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#0e1119;border-radius:5px;padding:14px;font:11px/1.6 ui-monospace,monospace}.file-change p,.review-message{color:#a3adc2;font-size:12px;line-height:1.7}.review-warning{color:#dac895;font-size:12px;line-height:1.7}form label{display:grid;color:#bbc3d7;gap:9px;margin-top:20px;font-size:12px}@media (width<=720px){.detail{position:static}.identity{display:block}dialog{padding:20px}}.bot-dialog{overflow-y:auto;width:min(48rem,100vw - 3rem);max-height:calc(100vh - 3rem)}.bot-dialog .field{display:grid;gap:.4rem;margin:1rem 0}.bot-dialog details{margin:.7rem 0}.bot-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere}.bot-dialog .bot-consent{display:block;margin:1.3rem 0}.bot-dialog .bot-actions{display:block;margin:1rem 0}.voice-dialog{overflow-y:auto;width:min(48rem,100vw - 3rem);max-height:calc(100vh - 3rem)}.voice-dialog .voice-consent{display:block;margin:1rem 0}.voice-dialog .voice-file,.voice-dialog .voice-source{color:var(--muted);font-size:12px}.voice-dialog fieldset{display:grid;border:1px solid var(--line);border-radius:10px;gap:6px;margin:14px 0;padding:12px}.voice-dialog legend{color:#cebaf5;padding:0 6px;font-size:12px}.voice-dialog pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:#141824;border-radius:8px;padding:12px}.constellation{isolation:isolate}.constellation:before{content:"";position:absolute;pointer-events:none;z-index:-1;filter:blur(15px);background:radial-gradient(at 53% 72%,#be85f13d 0%,#0000 42%),radial-gradient(at 28% 52%,#8060c32b 0%,#0000 48%),radial-gradient(at 74% 41%,#59699b1f 0%,#0000 42%),radial-gradient(at 53% 57%,#7c47822e 0%,#0000 65%);inset:30px -35px 5px}.tree-root img{filter:drop-shadow(0 0 7px #bca1f38c);width:31px;height:31px}.tree-root span:before{content:"";position:absolute;border:1px solid #b19bdf26;border-radius:50%;inset:-9px;box-shadow:0 0 35px #be85f12e}.tree-root span{box-shadow:0 0 22px #c7a1ff40,0 0 75px #a776de26}.skill-node:hover .node-gem,.skill-node.active .node-gem{box-shadow:0 0 18px #c7a8fa33,0 0 55px #9773d92b}.skill-node.equipped .node-gem{box-shadow:0 0 16px #c7a8fa38,0 0 40px #a776de38,inset 0 0 12px #c7a8fa0d}.skill-node.equipped .node-icon{filter:drop-shadow(0 0 4px #d6bfff66)}.skill-node.equipped:after{box-shadow:0 0 10px #ceadff99}.scope-meta{display:flex;justify-content:space-between;align-items: start;gap:16px;margin-top:12px}.library-note{text-align:right;color:var(--muted);max-width:270px;font-size:11px;line-height:1.6}.library-note summary{cursor:pointer;color:#a799c3}.library-note p{margin:8px 0}.library-note code{display:block;color:#c8b4f0;font-size:10px}@media (width<=720px){.scope-meta{display:block}.library-note{text-align:left;margin-top:8px}}.starfield{position:absolute;pointer-events:none;z-index:-1;overflow:hidden;width:100%;height:100%;inset:0}.star{fill:#e6d6ff;opacity:0;animation:star-twinkle var(--twinkle)ease-in-out var(--delay)infinite,star-drift var(--drift)ease-in-out var(--delay)infinite alternate}.star-rays{stroke:#eadbff;stroke-width:.55;opacity:.75}.shooting-star{stroke:#f4ecff;stroke-width:1.4;stroke-linecap:round;stroke-dasharray:var(--length)2000px;stroke-dashoffset:var(--length);animation:shooting-star var(--shoot)ease-in forwards}.starfield.paused .star,.starfield.paused .shooting-star{animation-play-state:paused}@keyframes star-twinkle{0%,to{opacity:calc(var(--brightness)*.25)}50%{opacity:var(--brightness)}}@keyframes star-drift{0%{translate:0}to{translate:var(--drift-x)var(--drift-y)}}@keyframes shooting-star{0%{opacity:0}15%{opacity:.9}to{opacity:0;stroke-dashoffset:calc(-1*var(--travel))}}@media (prefers-reduced-motion:reduce){.star{animation:none;opacity:calc(var(--brightness)*.7);translate:none}.shooting-star{display:none}}.build-panel{position:sticky;display:grid;overflow:auto;scrollbar-width:thin;scrollbar-color:#4d3d65 transparent;gap:16px;max-height:calc(100dvh - 140px);margin:-3px;padding:3px;top:20px}.build-panel .identity{display:block;background:linear-gradient(145deg,#221c30,#14151f 80%);border:1px solid #44364f;border-radius:14px;padding:22px}.build-panel .identity h2{font-size:25px}.build-panel #identity-description{color:var(--muted);font-size:12px;line-height:1.65}.identity[data-naming=waiting] #identity-title,.identity[data-naming=loading] #identity-title{color:#8f84a8}.identity[data-naming=loading] #identity-description{animation:1.4s ease-in-out infinite naming-pulse}.identity[data-naming=failed] #identity-description{color:#f0b6b6}@keyframes naming-pulse{50%{opacity:.45}}.abilities{display:grid;list-style:none;gap:8px;margin:14px 0 0;padding:0}.abilities:empty{display:none}.abilities li{color:#cfd3df;font-size:12px;line-height:1.5}.abilities strong{display:block;color:#cebaf5;letter-spacing:.04em;font-size:11px}.build-panel .tradeoff{color:#d9c79a;margin:12px 0 0;font-size:12px;line-height:1.5}.naming-controls{display:flex;flex-wrap:wrap;align-items: center;gap:8px;margin-top:16px}.naming-controls .naming-source{color:var(--muted);flex:100%;margin:0;font-size:11px}.naming-controls .naming-source:empty{display:none}.naming-controls .quiet-button{padding:7px 10px;font-size:11px}@media (prefers-reduced-motion:reduce){.identity[data-naming=loading] #identity-description{animation:none}}.build-panel .detail{position:static}@media (width<=720px){.build-panel{position:static;overflow:visible;max-height:none}}
1
+ :root{--buncss-light: ;--buncss-dark:initial;color-scheme:dark;color:#e5e4ed;--muted:#929bb3;--accent:#b6a2ee;--line:#303246;--surface:#171923;background:#090a10;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:15px}*{box-sizing:border-box}body{background:radial-gradient(at 50% 45%,#291d3c5c,#0000 65%);min-height:100vh;margin:0;padding:28px 24px}button,input,select,textarea{font:inherit}button,select{cursor:pointer}button{border:0}button:disabled{cursor:wait;opacity:.5}button,a,input,textarea,select{outline-offset:5px}:focus-visible{outline:2px solid var(--accent)}button,a{-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}.frame{overflow:clip;background:#10121b;border:1px solid #373043;border-radius:20px;max-width:1680px;margin:0 auto;box-shadow:0 24px 100px #0008,0 0 100px #9b71d208}.masthead{border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items: center;padding:18px 32px}.brand{display:inline-flex;color:inherit;text-decoration:none;align-items: center;gap:9px;font-weight:650}.brand-mark{filter:drop-shadow(0 0 8px #c0a0ff33);width:28px;height:28px}.local-badge{letter-spacing:.12em;color:var(--muted);font-size:10px}.local-badge span{display:inline-block;background:#8dd0bd;border-radius:50%;width:6px;height:6px;margin-right:6px}main{padding:32px 36px 0}.eyebrow{letter-spacing:.22em;color:var(--accent);margin:0 0 12px;font-size:10px;font-weight:650}h1,h2{font-family:Georgia,Times New Roman,serif;font-weight:400}h1{letter-spacing:-.035em;margin:0 0 12px;font-size:clamp(30px,4vw,44px)}h2{letter-spacing:-.02em;margin:0;font-size:28px}.subtitle{color:var(--muted);margin:0;line-height:1.6}.toolbar{display:flex;align-items: end;gap:14px;margin-top:24px}.scope-field{display:grid;letter-spacing:.04em;color:var(--muted);gap:7px;font-size:10px}.scope-field select{appearance:none;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0IiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJtMyA1IDQgNCA0LTQiIHN0cm9rZT0iI2I3YWVjOSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K);background-position:right 14px center;background-repeat:no-repeat;min-width:200px;padding-right:40px}input,select,textarea{color:#e5e4ed;border:1px solid var(--line);background-color:#12141f;border-radius:7px;padding:10px 12px;font-size:13px}textarea{resize:vertical;width:100%;line-height:1.6}input::placeholder,textarea::placeholder{color:#747c93}.search-field{flex:1}.search-field input{width:100%}.quiet-button{color:#bec3d4;background:0 0;border-radius:7px;padding:11px 12px;font-size:13px}.quiet-button:hover{color:#fff;background:#222533}.primary-button{color:#181323;background:linear-gradient(145deg,#c3acf5,#aa8dde);border:1px solid #dcc9ff4d;border-radius:8px;padding:14px 22px;transition:box-shadow .2s,transform .2s,background .2s;font-size:13px;font-weight:650;box-shadow:0 3px 20px #b997ec1f,inset 0 1px #f1e6ff30}.primary-button:hover{background:linear-gradient(145deg,#d3c0ff,#b79ae9);transform:translateY(-1px);box-shadow:0 0 26px #ba95f23b}.primary-button span{margin-left:16px}.scope-note{color:var(--muted);min-height:17px;margin:0;font-size:12px;line-height:1.6}.notice{color:#e1d4ab;background:#27231b;border:1px solid #796c44;border-radius:8px;margin-top:20px;padding:12px 16px;font-size:13px;line-height:1.6}.notice.success{color:#abdacb;background:#132722;border-color:#33594d}.visually-hidden{position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px}.footer{display:flex;border-top:1px solid var(--line);position:sticky;z-index:4;backdrop-filter:blur(18px);background:#171824ed;justify-content:space-between;align-items: center;gap:20px;padding:20px 32px;bottom:0;box-shadow:0 -12px 30px #0b0c1326}.footer strong{font-size:14px;font-weight:600}.footer p{color:var(--muted);margin:8px 0 0;font-size:12px}.footer-actions{display:flex;align-items: center;gap:12px}@media (width<=720px){body{padding:12px}main{padding:26px 18px 0}.masthead,.footer{padding:18px}.toolbar{flex-wrap:wrap}.scope-field,.scope-field select{width:100%}.footer{align-items: flex-start}.footer-actions{flex-direction:column-reverse;align-items: flex-end}.local-badge{font-size:9px}}@media (prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}.workspace{display:grid;grid-template-columns:minmax(0,1fr)290px;align-items: start;gap:32px;margin:28px 0}.constellation{position:relative;overflow:hidden;background:radial-gradient(circle at 50% 100%,#29203a99,#11131c 68%);border:1px solid #2c2a3a;border-radius:16px;min-width:0;min-height:360px}.constellation-controls{position:absolute;z-index:3;display:flex;gap:6px;top:12px;right:12px}.constellation-controls .quiet-button{background:#151723e8;padding:7px 10px;font-size:11px}.constellation-status{position:absolute;z-index:4;color:#d4d7e3;text-align:center;background:#151723;border:1px solid #423a50;border-radius:12px;width:min(280px,85%);padding:18px;top:40%;left:50%;transform:translate(-50%,-50%)}.constellation-status p{margin:0 0 12px}.constellation-map{position:relative;z-index:1;display:block;width:100%;margin-top:36px}.map-link{fill:none;stroke:#76668f;stroke-width:1;opacity:.62}.map-link.sibling{stroke-dasharray:2 6;opacity:.4}.map-node{color:#b1a7c6;outline:none}.map-node-skill{cursor:pointer}.map-node-hit{fill:transparent;stroke:none;rx:12px}.map-node-gem,.map-node circle{fill:#171824;stroke:#645474;stroke-width:1;transition:fill .16s,stroke .16s,opacity .16s}.map-node text{fill:#d4d7e3;paint-order:stroke;stroke:#10121b;stroke-width:5px;stroke-linejoin:round;font:13px Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.map-node-source text{fill:#cebaf5;letter-spacing:.02em;font-size:14px;font-weight:650}.map-node-category text{fill:#b9abd6;font-weight:600}.map-node-source .map-node-gem{fill:#211b2f;stroke:#a88cda}.map-node-category .map-node-gem{fill:#1b1a28;stroke:#8b75ae}.map-node-root circle{fill:#332647;stroke:#c1a5ee;stroke-width:1.5}.map-node-root image{pointer-events:none}.map-node-skill:hover .map-node-gem{fill:#382c4c;stroke:#d0b8ff;stroke-width:2}.map-node-skill:focus-visible .map-node-gem{fill:#382c4c;stroke:#d0b8ff;stroke-width:2}.map-node-skill.active .map-node-hit{stroke:#8dd0bd;stroke-width:1.5}.map-node-skill:focus-visible .map-node-hit{stroke:#8dd0bd;stroke-width:1.5}.map-node-skill.active text{fill:#f2eaff}.map-node.equipped .map-node-gem{fill:#544268;stroke:#ceb8ff;filter:drop-shadow(0 0 10px #b78cf766)}.map-node.search-miss{opacity:.16}.map-node-icon{display:grid;color:#c7b5ef;place-items: center;width:18px;height:18px}.map-node-icon svg{width:17px;height:17px}.constellation-list{position:relative;z-index:2;display:none;padding:56px 20px 20px}.list-view .constellation-map,.list-view .tree-hint{display:none}.list-view .constellation-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));align-content: start;gap:20px}.skill-list-group h3{color:#c9b2f1;letter-spacing:.08em;text-transform:uppercase;margin:0 0 9px;font-size:12px}.skill-list-item{display:block;color:#cfd3df;text-align:left;background:0 0;border-left:1px solid #423a50;width:100%;padding:8px 10px}.skill-list-item:hover,.skill-list-item:focus,.skill-list-item.equipped{color:#f2eaff;background:#241e30;border-left-color:#b999ed}.tree-hint{position:relative;z-index:2;color:var(--muted);text-align:center;pointer-events:none;margin:0 0 14px;font-size:11px}.map-node-category{cursor:pointer}.map-node-category:hover .map-node-gem{stroke:#d0b8ff;stroke-width:2}.map-node-category:focus-visible .map-node-gem{stroke:#d0b8ff;stroke-width:2}.map-node-category:focus-visible .map-node-hit{stroke:#8dd0bd;stroke-width:1.5}.map-node-category.partial .map-node-gem{stroke:#ceb8ff;stroke-dasharray:4 3}.map-collapse{cursor:pointer}.map-collapse circle{fill:#141522;stroke:#4c4260;stroke-width:1}.map-collapse path{fill:none;stroke:#cbbcec;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.map-collapse:hover circle{stroke:#8dd0bd}.map-collapse:focus-visible circle{stroke:#8dd0bd}.map-collapse:focus{outline:none}.map-node text.map-hidden-count{fill:#9a92b4;font-size:12px;font-weight:400}@media (width<=900px){.workspace{grid-template-columns:minmax(0,1fr)270px;gap:20px}}@media (width<=720px){.workspace{grid-template-columns:1fr}.constellation-map,.tree-hint{display:none}.constellation-list{display:grid;grid-template-columns:1fr;align-content: start;gap:20px}.constellation-controls{display:none}}.detail{position:sticky;background:linear-gradient(150deg,#1d1b2a,#151720 55%);border:1px solid #53446799;border-radius:14px;padding:24px;top:24px;box-shadow:0 12px 40px #0003,inset 0 1px #d2b9ff0a}.detail h2{font-size:26px;line-height:1.2}.detail-description{color:#a5afc5;display:-webkit-box;-webkit-line-clamp:3;overflow:hidden;-webkit-box-orient:vertical;margin:14px 0 24px;font-size:13px;line-height:1.7}.behavior{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:21px 0}.behavior p:last-child{color:#c3c5d0;white-space:pre-line;margin:0;font-size:13px;line-height:1.7}.skill-status{color:#8fcaba;margin:18px 0;font-size:11px;line-height:1.6}.detail .primary-button{width:100%}.detail .editor{margin-top:20px}.detail summary{color:#bdb5d2;cursor:pointer;font-size:12px}.detail textarea{min-height:200px;margin-top:12px;font:11px/1.65 ui-monospace,monospace}.detail .quiet-button{width:100%;margin-top:8px}.owner-note{color:var(--muted);font-size:11px;line-height:1.6}.identity{display:flex;border-top:1px solid #292b3d;justify-content:space-between;align-items: center;gap:24px;padding:26px 0}.identity h2{font-size:26px}.identity p:last-child{color:var(--muted);max-width:580px;margin-bottom:0;font-size:12px;line-height:1.7}.requirements{border:1px solid var(--line);background:#141824;border-radius:10px;margin:0 0 22px;padding:18px}.requirements h3{color:#b6c4d4;margin:0 0 10px;font-size:12px}.requirements p{color:var(--muted);margin:7px 0 0;font-size:12px;line-height:1.6}dialog{color:#e5e4ed;background:#151720;border:1px solid #414258;border-radius:18px;width:min(780px,100vw - 40px);max-height:88vh;padding:28px;box-shadow:0 35px 120px #0008}dialog::backdrop{backdrop-filter:blur(4px);background:#06070be3}.dialog-heading{display:flex;justify-content:space-between;align-items: flex-start;gap:20px;margin-bottom:25px}.dialog-heading .quiet-button{margin-top:-8px}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}#review-content{overflow:auto;max-height:52vh}.file-change{border:1px solid var(--line);border-radius:8px;margin:12px 0;padding:14px}.file-change summary{cursor:pointer;color:#c7b8e8;overflow-wrap:anywhere;font-size:12px}.file-change h4{text-transform:uppercase;letter-spacing:.12em;color:var(--muted);margin-bottom:8px;font-size:10px}.file-change pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#0e1119;border-radius:5px;padding:14px;font:11px/1.6 ui-monospace,monospace}.file-change p,.review-message{color:#a3adc2;font-size:12px;line-height:1.7}.review-warning{color:#dac895;font-size:12px;line-height:1.7}form label{display:grid;color:#bbc3d7;gap:9px;margin-top:20px;font-size:12px}@media (width<=720px){.detail{position:static}.identity{display:block}dialog{padding:20px}}.constellation{isolation:isolate}.constellation:before{content:"";position:absolute;pointer-events:none;z-index:-1;filter:blur(15px);background:radial-gradient(at 53% 72%,#be85f13d 0%,#0000 42%),radial-gradient(at 28% 52%,#8060c32b 0%,#0000 48%),radial-gradient(at 74% 41%,#59699b1f 0%,#0000 42%),radial-gradient(at 53% 57%,#7c47822e 0%,#0000 65%);inset:30px -35px 5px}.tree-root img{filter:drop-shadow(0 0 7px #bca1f38c);width:31px;height:31px}.tree-root span:before{content:"";position:absolute;border:1px solid #b19bdf26;border-radius:50%;inset:-9px;box-shadow:0 0 35px #be85f12e}.tree-root span{box-shadow:0 0 22px #c7a1ff40,0 0 75px #a776de26}.skill-node:hover .node-gem,.skill-node.active .node-gem{box-shadow:0 0 18px #c7a8fa33,0 0 55px #9773d92b}.skill-node.equipped .node-gem{box-shadow:0 0 16px #c7a8fa38,0 0 40px #a776de38,inset 0 0 12px #c7a8fa0d}.skill-node.equipped .node-icon{filter:drop-shadow(0 0 4px #d6bfff66)}.skill-node.equipped:after{box-shadow:0 0 10px #ceadff99}.scope-meta{display:flex;justify-content:space-between;align-items: start;gap:16px;margin-top:12px}.library-note{text-align:right;color:var(--muted);max-width:270px;font-size:11px;line-height:1.6}.library-note summary{cursor:pointer;color:#a799c3}.library-note p{margin:8px 0}.library-note code{display:block;color:#c8b4f0;font-size:10px}@media (width<=720px){.scope-meta{display:block}.library-note{text-align:left;margin-top:8px}}.starfield{position:absolute;pointer-events:none;z-index:-1;overflow:hidden;width:100%;height:100%;inset:0}.star{fill:#e6d6ff;opacity:0;animation:star-twinkle var(--twinkle)ease-in-out var(--delay)infinite,star-drift var(--drift)ease-in-out var(--delay)infinite alternate}.star-rays{stroke:#eadbff;stroke-width:.55;opacity:.75}.shooting-star{stroke:#f4ecff;stroke-width:1.4;stroke-linecap:round;stroke-dasharray:var(--length)2000px;stroke-dashoffset:var(--length);animation:shooting-star var(--shoot)ease-in forwards}.starfield.paused .star,.starfield.paused .shooting-star{animation-play-state:paused}@keyframes star-twinkle{0%,to{opacity:calc(var(--brightness)*.25)}50%{opacity:var(--brightness)}}@keyframes star-drift{0%{translate:0}to{translate:var(--drift-x)var(--drift-y)}}@keyframes shooting-star{0%{opacity:0}15%{opacity:.9}to{opacity:0;stroke-dashoffset:calc(-1*var(--travel))}}@media (prefers-reduced-motion:reduce){.star{animation:none;opacity:calc(var(--brightness)*.7);translate:none}.shooting-star{display:none}}.build-panel{position:sticky;display:grid;overflow:auto;scrollbar-width:thin;scrollbar-color:#4d3d65 transparent;gap:16px;max-height:calc(100dvh - 140px);margin:-3px;padding:3px;top:20px}.build-panel .identity{display:block;background:linear-gradient(145deg,#221c30,#14151f 80%);border:1px solid #44364f;border-radius:14px;padding:22px}.build-panel .identity h2{font-size:25px}.build-panel #identity-description{color:var(--muted);font-size:12px;line-height:1.65}.identity[data-naming=waiting] #identity-title,.identity[data-naming=loading] #identity-title{color:#8f84a8}.identity[data-naming=loading] #identity-description{animation:1.4s ease-in-out infinite naming-pulse}.identity[data-naming=failed] #identity-description{color:#f0b6b6}@keyframes naming-pulse{50%{opacity:.45}}.abilities{display:grid;list-style:none;gap:8px;margin:14px 0 0;padding:0}.abilities:empty{display:none}.abilities li{color:#cfd3df;font-size:12px;line-height:1.5}.abilities strong{display:block;color:#cebaf5;letter-spacing:.04em;font-size:11px}.build-panel .tradeoff{color:#d9c79a;margin:12px 0 0;font-size:12px;line-height:1.5}.naming-controls{display:flex;flex-wrap:wrap;align-items: center;gap:8px;margin-top:16px}.naming-controls .naming-source{color:var(--muted);flex:100%;margin:0;font-size:11px}.naming-controls .naming-source:empty{display:none}.naming-controls .quiet-button{padding:7px 10px;font-size:11px}@media (prefers-reduced-motion:reduce){.identity[data-naming=loading] #identity-description{animation:none}}.build-panel .detail{position:static}@media (width<=720px){.build-panel{position:static;overflow:visible;max-height:none}}
@@ -0,0 +1,133 @@
1
+ function Be(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Yt(e,t="|"){return e.map((r)=>er(r)).join(t)}function Fe(e,t){if(typeof t==="bigint")return t.toString();return t}class fn{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function at(e){return new fn(e)}function mn(e){return e===null||e===void 0}function ct(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function hn(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function ee(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ut(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function de(e){return ut(e._zod.def)??e._zod.def.shape}function gn(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return ee(this,t,n),n},enumerable:!0,configurable:!0})}function yn(e,t,r){if(t in e)ee(e,t,r);else e[t]=r}function xe(e,t,r,n){let o=de(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)gn(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a});else yn(e,i,n?n(s.value,i):s.value)}}function Ec(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)gn(e,r,()=>t[r]);else yn(e,r,n.value)}}function W(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function bn(e){return JSON.stringify(e)}function xn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Xt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function je(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vn=at(()=>{if(J.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ve(e){if(je(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(je(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Qt(e){if(ve(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var wn=new Set(["string","number","symbol"]);function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oe(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function x(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function er(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function _n(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var lt=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),tr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Cc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return xe(i,e,dt(e,t)),oe(e,W(r,{shape:i,checks:[]}))}function dt(e,t){let r=de(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function Ac(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(dt(e,t)),s={};return xe(s,e,Reflect.ownKeys(de(e)).filter((a)=>!i.has(a))),oe(e,W(r,{shape:s,checks:[]}))}function Nc(e,t){if(!ve(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=de(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return oe(e,W(e._zod.def,{shape:kn(e,t)}))}function kn(e,t){let r={};return xe(r,e,Reflect.ownKeys(de(e))),Ec(r,t),r}function Tc(e,t){if(!ve(t))throw Error("Invalid input to safeExtend: expected a plain object");return oe(e,W(e._zod.def,{shape:kn(e,t)}))}function Rc(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};xe(r,e,Reflect.ownKeys(de(e))),xe(r,t,Reflect.ownKeys(de(t)));let n=W(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return oe(e,n)}function zn(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(dt(t,r)):void 0,c={};return xe(c,t,Reflect.ownKeys(de(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),oe(t,W(t._zod.def,{shape:c,checks:[]}))}function Mc(e,t,r){let n=r?new Set(dt(t,r)):void 0,o={};return xe(o,t,Reflect.ownKeys(de(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),oe(t,W(t._zod.def,{shape:o}))}function ie(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function $n(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ye(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function De(e){return typeof e==="string"?e:e?.message}function rr(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function se(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:De(e.inst?._zod.def?.error?.(e))??De(i?.(e))??De(t?.error?.(e))??De(r.customError?.(e))??De(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=s,t?.reportInput)a.input=e.input;return a}var Lc=/[\uD800-\uDBFF]/;function pt(e){let t=e.length;if(!Lc.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function ft(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Sn(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function we(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function Pn(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Dc(e,r,n.value)}}function pe(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function mt(e,t,r){return pe(e,t,r,!1)}function Zn(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return pe(this,r,n(this))},set(o){pe(this,r,o)}})}return t}function Dc(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:pe(this,t,r.bind(this))},set(n){pe(this,t,n)}})}function jc(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Ht,ge=!1,Bc={configurable:!0,get(){ge=!0;return}};function I(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Ht!==e._zod){Ht=void 0;return}Ht=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Bc);let o=ge;ge=!1;try{let i=r(this);if(ge)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return ge=ge||o,i}catch(i){throw delete this[t],ge=ge||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Fc(e,t,r,n){let o=jc(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var Uc="~constantCatch";function In(e){let t=()=>e;return t[Uc]=!0,t}var On;var nr={value:void 0,enumerable:!1},En="captureStackTrace"in Error?Error:null;function qc(e){let t=En;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return En=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(f){this.def=f,this.constr=d,this.traits=new Set}i.prototype=o;let s=r,a=s&&new WeakSet;function c(f,m){if(!f._zod){nr.value=new i(m);try{Object.defineProperty(f,"_zod",nr)}finally{nr.value=void 0}}else if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),t(f,m),a){let b=Object.getPrototypeOf(f),w=f._zod.constr.prototype,S=b;while(S&&S!==w)S=Object.getPrototypeOf(S);let P=S??b;if(!a.has(P))a.add(P),Pn(P,s)}let h=d.prototype;for(let b in h){if(!Object.prototype.hasOwnProperty.call(h,b))continue;if(!(b in f))f[b]=h[b].bind(f)}}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=n?.Parent?qc(l):this;c(m,f);let h=m._zod.deferred;if(h){for(let w of h)w();m._zod.deferred=void 0}let b=globalThis.__zod_globalConfig?.postProcessor;if(b)b(m);return m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(f)=>{if(n?.Parent&&f instanceof n.Parent)return!0;return f?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class ae extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ue extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(On=globalThis).__zod_globalConfig??(On.__zod_globalConfig={});var J=globalThis.__zod_globalConfig;function H(e){if(e)Object.assign(J,e);return J}function Vc(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Fe,2)),e.message}function Jc(e){this._zod.message=e}var Gc={get:Vc,set:Jc,enumerable:!0,configurable:!0},ir={value:void 0,enumerable:!1},Cn=new WeakSet([Object.prototype,Error.prototype]),An=(e,t)=>{e.name="$ZodError",ir.value=t,Object.defineProperty(e,"issues",ir),ir.value=void 0,Object.defineProperty(e,"message",Gc);let r=Object.getPrototypeOf(e);if(!Cn.has(r))Cn.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},Nn=p("$ZodError",An),Dd=p("$ZodError",An,void 0,{Parent:Error});function Kc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Tn(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)Kc(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Rn(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(s));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];if(d)f._errors.push(t(s));c=f,u++}}}};return n(e),r}function ht(e,t){return{callee:t?.callee??e,Err:t?.Err}}var gt=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new ae;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map((u)=>se(u,s,H())));throw Xt(c,i?.callee??t),c}return a.value};return t};var yt=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map((u)=>se(u,s,H())));throw Xt(c,i?.callee??t),c}return a.value};return t};var bt=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new ae;return i.issues.length?Mn(e,i.issues,o):{success:!0,data:i.value}};function Mn(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>se(o,r,H()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var xt=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Mn(e,i.issues,o):{success:!0,data:i.value}};var Wc=Symbol.for("zod.compile.invalid"),Hc=Symbol.for("zod.compile.fallback"),sr=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Wc)return!0;if(n.definite===!0&&r===void 0)return!1}return Yc(e,t,r)};function Yc(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[Hc]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new ae;return i.issues.length===0}var ar=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Ln=(e)=>{let t=gt(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,ht(r,s))};return r};var Dn=(e)=>{let t=gt(e),r=(n,o,i,s)=>t(n,o,i,ht(r,s));return r};var jn=(e)=>{let t=yt(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,ht(r,s))};return r};var Bn=(e)=>{let t=yt(e),r=async(n,o,i,s)=>await t(n,o,i,ht(r,s));return r};var Fn=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return bt(e)(t,r,o)};var Un=(e)=>(t,r,n)=>bt(e)(t,r,n);var qn=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return xt(e)(t,r,o)};var Vn=(e)=>async(t,r,n)=>xt(e)(t,r,n);var Jn=/^[cC][0-9a-z]{6,}$/,Gn=/^[0-9a-z]+$/,Kn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Wn=/^[0-9a-vA-V]{20}$/,Hn=/^[A-Za-z0-9]{27}$/,Yn=/^[a-zA-Z0-9_-]{21}$/;function Xn(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Qn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var eo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ur=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var to=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Xc="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ro(){return new RegExp(Xc,"u")}var no=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var io=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,so=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ao=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,co=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var uo=/^https?$/,lo=/^\+[1-9]\d{6,14}$/;var po="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Qc(e){return new RegExp(`^${e}$`)}var fo=Qc(po);function cr(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function mo(e){return new RegExp(`^${cr(e)}$`)}function ho(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${cr({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${cr({precision:e.precision})}`:r;return new RegExp(`^${po}T(?:${n})$`)}var go=/^[\s\S]{0,}$/;var lr=/^-?\d+$/,qe=/^-?\d+(?:\.\d+)?$/,yo=/^(?:true|false)$/i;var bo=/^[^A-Z]*$/,xo=/^[^a-z]*$/;var j=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var dr=(e)=>{let t=e.value;return!mn(t)&&t.length!==void 0},vt={number:"number",bigint:"bigint",object:"date"},pr=p("$ZodCheckLessThan",(e,t)=>{j.init(e,t);let r=vt[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:vt[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fr=p("$ZodCheckGreaterThan",(e,t)=>{j.init(e,t);let r=vt[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:vt[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vo=p("$ZodCheckMultipleOf",(e,t)=>{j.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):hn(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),wo=p("$ZodCheckNumberFormat",(e,t)=>{j.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=lt[t.format];e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(a<o)s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var _o=p("$ZodCheckMaxLength",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=dr),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?pt(o):i)<=t.maximum)return;let a=ft(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ko=p("$ZodCheckMinLength",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=dr),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?pt(o):i)>=t.minimum)return;let a=ft(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zo=p("$ZodCheckLengthEquals",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=dr),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?pt(o):i;if(s===t.length)return;let a=ft(o),c=s>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Je=p("$ZodCheckStringFormat",(e,t)=>{var r,n;if(j.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),$o=p("$ZodCheckRegex",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),So=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=bo),Je.init(e,t)}),Po=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xo),Je.init(e,t)}),Zo=p("$ZodCheckIncludes",(e,t)=>{j.init(e,t);let r=Oe(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Io=p("$ZodCheckStartsWith",(e,t)=>{j.init(e,t);let r=new RegExp(`^${Oe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Oo=p("$ZodCheckEndsWith",(e,t)=>{j.init(e,t);let r=new RegExp(`.*${Oe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var Eo=p("$ZodCheckOverwrite",(e,t)=>{j.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class mr{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
2
+ `).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
3
+ ${t.join(`
4
+ `)}
5
+ };`)(...Object.values(this.closed))}}var Ao={major:4,minor:6,patch:5};var A=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ao;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(a,c,u)=>{if(a.memo)return a;let l=ie(a),d;for(let f of c){if(f._zod.def.when){if($n(a))continue;if(!f._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,h=f._zod.check(a);if(h instanceof Promise&&u?.async===!1)throw new ae;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await h,a.issues.length===m)return;if(rr(a.issues,m,e),!l)l=ie(a,m)});else{if(a.issues.length===m)continue;if(rr(a.issues,m,e),!l)l=ie(a,m)}}if(d)return d.then(()=>a);return a},s=(a,c,u)=>{if(ie(a))return a.aborted=!0,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===!1)throw new ae;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>s(d,a,c));return s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new ae;return u.then((l)=>i(l,o,c))}return i(u,o,c)}}},{get "~standard"(){return mt(this,"~standard",gr(this))},set "~standard"(e){pe(this,"~standard",e)}}),qo=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>se(r,t,H()))}:{value:e.value};async function eu(e,t){let r={async:!0};return qo(await e._zod.run({value:t,issues:[]},r),r)}function gr(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return qo(n,r)}catch(n){}return eu(e,t)},vendor:"zod",version:1}}var zt=p("$ZodString",(e,t)=>{A.init(e,t),e._zod.pattern=t.pattern??go,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),O=p("$ZodStringFormat",(e,t)=>{Je.init(e,t),zt.init(e,t)}),Vo=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eo),O.init(e,t)}),Jo=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ur(n))}else t.pattern??(t.pattern=ur());O.init(e,t)}),Go=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=to),O.init(e,t)}),Ko=1,_t=2;function Wo(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function tu(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Wo(e)||_t;return ru(e,t)}function ru(e,t){if(!t.normalize&&t.protocol?.source===uo.source&&!/^https?:\/\//i.test(e))return Ko;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??_t}return new URL(e)}catch{return _t}}var nu=/[\t\n\r]/g;function No(e){return e.replace(nu,"")}function ou(e,t){return t.lastIndex=0,t.test(e.hostname)}function iu(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Ho=p("$ZodURL",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=tu(n,t);if(o===Ko){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===_t){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=No(n);return}if(t.hostname&&!ou(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!iu(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:No(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Yo=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ro()),O.init(e,t)}),Xo=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Yn:Xn(t.length)),O.init(e,t)}),Qo=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jn),O.init(e,t)}),ei=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gn),O.init(e,t)}),ti=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Kn),O.init(e,t)}),ri=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Wn),O.init(e,t)}),ni=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Hn),O.init(e,t)}),oi=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ho(t)),O.init(e,t)}),ii=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fo),O.init(e,t)}),si=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=mo(t)),O.init(e,t)}),ai=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Qn),O.init(e,t)}),ci=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=no),O.init(e,t)}),su=/^[0-9a-fA-F:.]+$/;function ui(e){if(!su.test(e))return!1;return Wo(`http://[${e}]`)}var li=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=oo),O.init(e,t),e._zod.check=(r)=>{if(!ui(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var di=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=io),O.init(e,t)});function au(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return ui(r)}var pi=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=so),O.init(e,t),e._zod.check=(r)=>{if(!au(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function fi(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var yr=/^[0-9a-zA-Z+/]*={0,2}$/,mi=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yr),O.init(e,t),e._zod.check=(r)=>{if(fi(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),$t=/^[A-Za-z0-9_-]*$/;function cu(e){if(!$t.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return fi(r)}var hi=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=$t),O.init(e,t),e._zod.check=(r)=>{if(cu(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),gi=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=lo),O.init(e,t)});function uu(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var yi=p("$ZodJWT",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(uu(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var br=p("$ZodNumber",(e,t)=>{A.init(e,t),e._zod.pattern=qe,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),bi=p("$ZodNumberFormat",(e,t)=>{wo.init(e,t),br.init(e,t)}),xi=p("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=yo,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var vi=p("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=(r)=>r}),wi=p("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function To(e,t,r){if(e.issues.length)t.issues.push(...ye(r,e.issues));t.value[r]=e.value}var _i=p("$ZodArray",(e,t)=>{A.init(e,t);let r=J.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then((d)=>To(d,n,c)));else if(To(l,n,c),a&&l.issues.length!==0&&ie(l))break}if(s.length)return Promise.all(s).then(()=>n);return n}});function kt(e,t,r,n,o,i){let s=r in n,a=i==="optional";if(!s&&a&&o==="optional")return;if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...ye(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||o==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var lu=[];function ki(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:lu,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=_n(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function zi(e,t,r,n,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,{optin:d,optout:f}=u,m=0;for(let h in t){if(s&&r.issues.length!==m){if(ie(r,m))break;m=r.issues.length}if(c.has(h))continue;if(h==="__proto__"){if(l==="never")a.push(h);continue}if(l==="never"){a.push(h);continue}let b=u.run({value:t[h],issues:[]},n);if(b instanceof Promise)e.push(b.then((w)=>kt(w,r,h,t,d,f)));else kt(b,r,h,t,d,f)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var du=p("$ZodObject",(e,t)=>{A.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(t,"shape",{get:u})}let o=at(()=>ki(t));I(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let f in l){let m=l[f]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(d,f))ee(d,f,new Set);for(let h of m.values)d[f].add(h);if(m.optin!==void 0)d[f].add(void 0)}}return d});let i=je,s=t.catchall,a,c=J.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let d=u.value;if(!i(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let f=[],m=a.shape,h=l?.abortEarly,b=u.issues.length;for(let w of a.allKeys){if(h&&u.issues.length!==b){if(ie(u,b))break;b=u.issues.length}if(w==="__proto__")continue;let S=m[w],P=S._zod.optin,L=S._zod.optout,V=S._zod.run({value:d[w],issues:[]},l);if(V instanceof Promise)f.push(V.then((z)=>kt(z,u,w,d,P,L)));else kt(V,u,w,d,P,L)}if(!s)return f.length?Promise.all(f).then(()=>u):u;return zi(f,d,u,l,o.value,e,h===!0)}}),$i=p("$ZodObjectJIT",(e,t)=>{du.init(e,t);let r=e._zod.parse,n=at(()=>ki(t)),o=J.memoizer,i=(m)=>{let h=n.value,b=h.symbolKeys,w=new mr(["payload","ctx"],{shape:m,inst:e,memo:o,syms:b}),S=(z)=>`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`,P=(z,k)=>`
6
+ let ${z}_ab = false;
7
+ for (let i = 0; i < ${z}.issues.length; i++) {
8
+ const iss = ${z}.issues[i];
9
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
10
+ payload.issues.push(iss);
11
+ if (iss.continue !== true) ${z}_ab = true;
12
+ }
13
+ if (${z}_ab && ctx && ctx.abortEarly) {
14
+ payload.value = newResult;
15
+ return payload;
16
+ }`;w.write("const input = payload.value;");let L=Object.create(null),V=0;for(let z of h.allKeys)L[z]=`key_${V++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let z of h.allKeys){if(z==="__proto__")continue;let k=L[z],Z=typeof z==="symbol"?`syms[${b.indexOf(z)}]`:bn(z),K=`${Z} in input`,B=m[z],X=B?._zod?.optin,le=X!==void 0,ot=B?._zod?.optout==="optional";if(w.write(`const ${k} = ${S(Z)};`),le&&ot){let it=X==="optional"?`${k}_present`:`${k}.value !== undefined || ${k}_present`;w.write(`
17
+ const ${k}_present = ${K};
18
+ if (!${k}.issues.length || ${k}_present) {
19
+ if (${k}.issues.length) {${P(k,Z)}
20
+ }
21
+
22
+ if (${it}) {
23
+ newResult[${Z}] = ${k}.value;
24
+ }
25
+ }
26
+
27
+ `)}else if(!le)w.write(`
28
+ const ${k}_present = ${K};
29
+ if (${k}.issues.length) {${P(k,Z)}
30
+ }
31
+ if (!${k}_present && !${k}.issues.length) {
32
+ payload.issues.push({
33
+ code: "invalid_type",
34
+ expected: "nonoptional",
35
+ input: undefined,
36
+ path: [${Z}]
37
+ });
38
+ if (ctx && ctx.abortEarly) {
39
+ payload.value = newResult;
40
+ return payload;
41
+ }
42
+ }
43
+
44
+ if (${k}_present) {
45
+ newResult[${Z}] = ${k}.value;
46
+ }
47
+
48
+ `);else if(w.write(`
49
+ if (${k}.issues.length) {${P(k,Z)}
50
+ }
51
+ `),X==="defaulted")w.write(`newResult[${Z}] = ${k}.value;`);else w.write(`
52
+ if (${k}.value !== undefined || ${K}) {
53
+ newResult[${Z}] = ${k}.value;
54
+ }
55
+ `)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()},s,a=je,c=!J.jitless,l=c&&vn.value,d=t.catchall,f;e._zod.parse=(m,h)=>{f??(f=n.value);let b=m.value;if(!a(b))return m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m;if(c&&l&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!d)return m;return zi([],b,m,h,f,e,h?.abortEarly===!0)}return r(m,h)}});function Ro(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!ie(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>se(s,n,H())))}),t}var Si=p("$ZodUnion",(e,t)=>{A.init(e,t),I(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),I(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),I(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),I(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>ct(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}if(!i)return Ro(s,n,e,o);return Promise.all(s).then((a)=>Ro(a,n,e,o))}});var Pi=p("$ZodIntersection",(e,t)=>{A.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([c,u])=>Mo(r,c,u));return Mo(r,i,s)}});function hr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ve(e)&&ve(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=hr(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=hr(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Mo(e,t,r){let n=new Map,o,i=new Map,s=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let f=String(u.path[0]);if(!i.has(f))i.set(f,u);d=[f]}else return!1;for(let f of d){if(!n.has(f))n.set(f,{});n.get(f)[l]=!0}return!0};for(let u of t.issues)if(!s(u,"l"))e.issues.push(u);for(let u of r.issues)if(!s(u,"r"))e.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter((l)=>o.keys.includes(l)):[];if(u.length)e.issues.push({...o,keys:u});for(let l of a)if(!u.includes(l)&&i.has(l))e.issues.push(i.get(l))}let c=hr(t.value,r.value);if(!c.valid){if(ie(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Zi=p("$ZodRecord",(e,t)=>{A.init(e,t);let r=J.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!ve(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((h)=>se(h,o,H())),input:l,path:[l],inst:e});continue}let f=d.value;if(f==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);if(m instanceof Promise)s.push(m.then((h)=>{if(h.issues.length)n.issues.push(...ye(l,h.issues));n.value[f]=h.value}));else{if(m.issues.length)n.issues.push(...ye(l,m.issues));n.value[f]=m.value}}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l]}else u=u??[],u.push(l);if(u&&u.length>0)n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&qe.test(u)&&l.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length===0)l=h}if(l.issues.length){if(t.mode==="loose")n.value[u]=i[u];else if(a)c=c??[],c.push(u);else n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((h)=>se(h,o,H())),input:u,path:[u],inst:e});continue}let f=l.value;if(f==="__proto__")continue;let m=t.valueType._zod.run({value:i[u],issues:[]},o);if(m instanceof Promise)s.push(m.then((h)=>{if(h.issues.length)n.issues.push(...ye(u,h.issues));n.value[f]=h.value}));else{if(m.issues.length)n.issues.push(...ye(u,m.issues));n.value[f]=m.value}}if(c&&c.length>0)n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}if(s.length)return Promise.all(s).then(()=>n);return n}});var Ii=p("$ZodEnum",(e,t)=>{A.init(e,t);let r=Be(t.entries),n=new Set(r);e._zod.values=n,I(e,"pattern",(o)=>{let i=Be(o.def.entries).filter((s)=>wn.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>Oe(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}});var Oi=p("$ZodTransform",(e,t)=>{A.init(e,t),e._zod.optin="optional",J.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ue(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new ae;return r.value=o,r}});function Lo(e,t){return e.value=t.issues.length?void 0:t.value,e}var xr=p("$ZodOptional",(e,t)=>{A.init(e,t),I(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",I(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),I(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ct(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>Lo(r,i));return Lo(r,o)}return t.innerType._zod.run(r,n)}}),Ei=p("$ZodExactOptional",(e,t)=>{xr.init(e,t),I(e,"values",(r)=>r.def.innerType._zod.values),I(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Ci=p("$ZodNullable",(e,t)=>{A.init(e,t),I(e,"optin",(r)=>r.def.innerType._zod.optin),I(e,"optout",(r)=>r.def.innerType._zod.optout),I(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ct(n.source)}|null)$`):void 0}),I(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),Ai=p("$ZodDefault",(e,t)=>{A.init(e,t),e._zod.optin="defaulted",I(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Do(i,t));return Do(o,t)}});function Do(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Ni=p("$ZodPrefault",(e,t)=>{A.init(e,t),e._zod.optin="defaulted",I(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),Ti=p("$ZodNonOptional",(e,t)=>{A.init(e,t),I(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>jo(i,e));return jo(o,e)}});function jo(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Bo(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>se(o,n,H()))},input:e.value}),e}var Ri=p("$ZodCatch",(e,t)=>{A.init(e,t),I(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),I(e,"optout",(r)=>r.def.innerType._zod.optout),I(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>Bo(r,i,t,n));return Bo(r,o,t,n)}});var Mi=p("$ZodPipe",(e,t)=>{A.init(e,t),I(e,"values",(r)=>r.def.in._zod.values),I(e,"optin",(r)=>r.def.in._zod.optin),I(e,"optout",(r)=>r.def.out._zod.optout),I(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((s)=>wt(s,t.in,n));return wt(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>wt(i,t.out,n));return wt(o,t.out,n)}});function wt(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Li=p("$ZodReadonly",(e,t)=>{A.init(e,t),I(e,"propValues",(r)=>r.def.innerType._zod.propValues),I(e,"values",(r)=>r.def.innerType._zod.values),I(e,"optin",(r)=>r.def.innerType?._zod?.optin),I(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(Fo);return Fo(o)}});function Fo(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Di=p("$ZodCustom",(e,t)=>{j.init(e,t),A.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>Uo(i,r,n,e));Uo(o,r,n,e);return}});function Uo(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(we(o))}}class Bi extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var wr="~memo",ji=[];function Fi(e){return e!==null&&typeof e==="object"}function vr(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Ui=new WeakMap,Ge=0,Zt=1,Ke=2;function It(e,t,r){let n=Ui.get(e);if(n!==void 0)return n?Ke:Ge;if(t.has(e))return Ke;t.add(e);let o=Ge,i=(l)=>{if(o!==Ke&&l?._zod){let d=It(l,t,r);if(d>o)o=d}},s=(l,d)=>{let f=Ge;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(d&&!h.enumerable)continue;let b=h.get?Zt:h.value?._zod?It(h.value,t,r):Ge;if(b>f)f=b}return f},a=(l)=>{if(l>o)o=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=ut(c);a(l?s(l,!0):Zt),i(c.catchall);break}case"array":i(c.element);break;case"tuple":for(let l of c.items)i(l);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(let l of c.options)i(l);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?It(l,t,!1):Zt);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let f=d.value;if(!f||typeof f!=="object")continue;if(f._zod)i(f);else if(Array.isArray(f))for(let m of f)i(m)}}return t.delete(e),pu(e,o)}function pu(e,t){if(t!==Zt)Ui.set(e,t===Ke);return t}function fu(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var St,Pt=[],mu={alloc(e,t,r){let n=St;if(!n)return r;St=void 0;let o={value:r,issues:null};return n.set(t.value,o),Pt.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&hu(i,o.value))throw new Bi;return r(o,i)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(r===void 0){let S=It(e,new Set,!1);if(S===Ge){if(e._zod.parse=s,e._zod.run===a)e._zod.run=s;return s(c,u)}if(S===Ke||n)r=!0;else n=!0}let l=c.value;if(!Fi(l))return s(c,u);let d=u[wr];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[wr]=d;let f;if(o===u)f=i;else f=fu(d,e),o=u,i=f;let m=f.get(l);if(m){if(c.value=m.value,m.issues){if(m.issues.length)c.issues.push(...vr(m.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(m.value);return c}St=f;let h=Pt.length,b=s(c,u);St=void 0;let w=Pt.length>h?Pt.pop():void 0;if(b instanceof Promise)return b.then((S)=>{if(w)w.issues=S.issues.length?vr(S.issues):ji;return S});if(w)w.issues=b.issues.length?vr(b.issues):ji;return b};if(e._zod.parse=a,e._zod.run===s)e._zod.run=a})}};function qi(){return mu}function hu(e,t){let r=e[wr]?.backEdges;return r!==void 0&&Fi(t)&&r.has(t)}var gu=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),a=Sn(i.input),c=o(a,i.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${er(i.values[0])}`;return`Invalid option: expected one of ${Yt(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);if(a)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);if(a)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Yt(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((a)=>`'${a}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function _r(){return{localeError:gu()}}var Vi;class Ji{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function yu(){return new Ji}(Vi=globalThis).__zod_globalRegistry??(Vi.__zod_globalRegistry=yu());var _e=globalThis.__zod_globalRegistry;function Gi(e){if(e.checks)e.checks=[...e.checks];return e}function Ki(e,t){return new e(Gi({type:"string",...x(t)}))}function Wi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(t)})}function Hi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(t)})}function kr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(t)})}function Yi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(t)})}function Xi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(t)})}function Qi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(t)})}function es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(t)})}function ts(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(t)})}function rs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(t)})}function ns(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(t)})}function os(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(t)})}function is(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(t)})}function ss(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(t)})}function as(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(t)})}function cs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(t)})}function us(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(t)})}function ls(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(t)})}function ds(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(t)})}function ps(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(t)})}function fs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(t)})}function ms(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(t)})}function hs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(t)})}function gs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(t)})}function ys(e,t){return new e({type:"string",format:"date",check:"string_format",...x(t)})}function bs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(t)})}function xs(e,t){return new e({type:"string",format:"duration",check:"string_format",...x(t)})}function vs(e,t){return new e(Gi({type:"number",checks:[],...x(t)}))}function ws(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...x(t)})}function _s(e,t){return new e({type:"boolean",...x(t)})}function ks(e){return new e({type:"unknown"})}function zs(e,t){return new e({type:"never",...x(t)})}function Ot(e,t){return new pr({check:"less_than",...x(t),value:e,inclusive:!1})}function We(e,t){return new pr({check:"less_than",...x(t),value:e,inclusive:!0})}function Et(e,t){return new fr({check:"greater_than",...x(t),value:e,inclusive:!1})}function He(e,t){return new fr({check:"greater_than",...x(t),value:e,inclusive:!0})}function Ct(e,t){return new vo({check:"multiple_of",...x(t),value:e})}function At(e,t){return new _o({check:"max_length",...x(t),maximum:e})}function Ee(e,t){return new ko({check:"min_length",...x(t),minimum:e})}function Nt(e,t){return new zo({check:"length_equals",...x(t),length:e})}function zr(e,t){return new $o({check:"string_format",format:"regex",...x(t),pattern:e})}function $r(e){return new So({check:"string_format",format:"lowercase",...x(e)})}function Sr(e){return new Po({check:"string_format",format:"uppercase",...x(e)})}function Pr(e,t){return new Zo({check:"string_format",format:"includes",...x(t),includes:e})}function Zr(e,t){return new Io({check:"string_format",format:"starts_with",...x(t),prefix:e})}function Ir(e,t){return new Oo({check:"string_format",format:"ends_with",...x(t),suffix:e})}function be(e){return new Eo({check:"overwrite",tx:e})}function Or(e){return be((t)=>t.normalize(e))}function Er(){return be((e)=>e.trim())}function Cr(){return be((e)=>e.toLowerCase())}function Ar(){return be((e)=>e.toUpperCase())}function Nr(){return be((e)=>xn(e))}function $s(e,t,r){return new e({type:"array",element:t,...x(r)})}function Ss(e,t,r){return new e({type:"custom",check:"custom",fn:t,...x(r)})}function Ps(e,t){let r=bu((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(we(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=n.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(we(i))}},e(n.value,n)),t);return r}function bu(e,t){let r=new j({check:"custom",...x(t)});return r._zod.check=e,r}function Ye(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))ee(e,n,r[n]);return e}function Rr(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??_e,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ke(e,t,r,n,o){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(o);return Object.assign(r,i),!0}function M(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let f=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,f,l)}let d=e._zod.parent;if(d){if(!s.ref)s.ref=d;M(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Ye(s.schema,c);if(t.io==="input"&&F(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Zs(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Mr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let o=(s)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,f=e.external.uri??((h)=>h);if(d)return{ref:f(d)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${f("__shared")}#/${a}/${Zs(m)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return{ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Zs(l)}},i=(s)=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
56
+
57
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Es(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;Es(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Cs=new Set(["type","properties","required","additionalProperties"]),Is=["oneOf","anyOf"];function Os(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Tr(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Cs.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??Os(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:Tr(a)??{allOf:a};ee(r,s,c)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let a=Os(s);if(a&&!i.some((c)=>JSON.stringify(c)===JSON.stringify(a)))i.push(a)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function xu(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Cs)if(o in e)return;let r=t.filter((o)=>Is.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=Tr(t);else{let o=r[0],i=Is.find((c)=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter((c)=>c!==o),a=o[i].map((c)=>Tr([...s,c]));if(a.some((c)=>!c))return;n={[i]:a}}if(!n)return;delete e.allOf,Ye(e,n)}function Lr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){n(d);let m=e.seen.get(d),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(h);else Ye(u,h);if(Ye(u,l),a._zod.parent===d)for(let w in u){if(w==="$ref"||w==="allOf")continue;if(!(w in l))delete u[w]}if(h.$ref&&m.def)for(let w in u){if(w==="$ref"||w==="allOf")continue;if(w in m.def&&JSON.stringify(u[w])===JSON.stringify(m.def[w]))delete u[w]}}let f=a._zod.parent;if(f&&f!==d){n(f);let m=e.seen.get(f);if(m?.schema.$ref){if(u.$ref=m.schema.$ref,m.def)for(let h in u){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h]))delete u[h]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Es(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])xu(u)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Ye(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&o.id===i)delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;ee(s,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xe(t,"input",e.processors),output:Xe(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function F(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return F(n.element,r);if(n.type==="set")return F(n.valueType,r);if(n.type==="lazy")return F(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return F(n.innerType,r);if(n.type==="intersection")return F(n.left,r)||F(n.right,r);if(n.type==="record"||n.type==="map")return F(n.keyType,r)||F(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return F(n.in,r)||F(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(F(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(F(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(F(o,r))return!0;if(n.rest&&F(n.rest,r))return!0;return!1}return!1}var As=(e,t={})=>(r)=>{let n=Rr({...r,processors:t});return M(e,n),Mr(n,e),Lr(n,e)},Xe=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Rr({...o??{},target:i,io:t,processors:r});return M(e,s),Mr(s,e),Lr(s,e)};var Ce=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Ae=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Ns=(e,t)=>{Ce(e,"minimum",t),Ae(e,"maximum",t)},Ls=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Ds=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},js=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Bs=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Ts=(e,t)=>Ce(e,"minimum",t.minimum),Rs=(e,t)=>Ae(e,"maximum",t.maximum),Ms=(e)=>(t,r)=>{Bs(t,r.format);let[n,o]=e[r.format];Ce(t,"minimum",n),Ae(t,"maximum",o)},vu={greater_than:(e,t)=>Ce(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ae(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ls(e,t.value),number_format:Ms(lt),bigint_format:Ms(tr),min_length:Ts,max_length:Rs,length_equals:(e,t)=>Ns(e,t.length),min_size:Ts,max_size:Rs,size_equals:(e,t)=>Ns(e,t.size),string_format:(e,t)=>{if(Bs(e,t.format),t.pattern)Ds(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>js(e,t.mime)};function Q(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)vu[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)Ce(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)Ce(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)Ae(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)Ae(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)Ls(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)js(t,o.mime);for(let i of o.patterns??[])Ds(t,i);return t}var wu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_u=new Map([[yr,ao],[$t,co]]),Fs=(e)=>_u.get(e)??e,Us=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Q(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(a){if(o.format=wu[a]??a,o.format==="")delete o.format;if(a==="time"||l)delete o.format}if(u)o.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(Fs);if(d.length===1)o.pattern=d[0].source;else if(d.length>1)o.allOf=[...d.map((f)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))]}},qs=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Q(e);o.type=l?"integer":"number";let d=typeof u==="number"&&u>=(i??Number.NEGATIVE_INFINITY),f=typeof c==="number"&&c<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(m)o.minimum=u,o.exclusiveMinimum=!0;else o.exclusiveMinimum=u;else if(typeof i==="number")o.minimum=i;if(f)if(m)o.maximum=c,o.exclusiveMaximum=!0;else o.exclusiveMaximum=c;else if(typeof s==="number")o.maximum=s;if(a){let h=new Set;for(let S of a)if(Number.isFinite(S)&&S!==0)h.add(Math.abs(S));else ke(e,t,o,n,`A multipleOf divisor of ${S} cannot be represented in JSON Schema`);let[b,...w]=h;if(b!==void 0)o.multipleOf=b;if(w.length)o.allOf=[...o.allOf??[],...w.map((S)=>({multipleOf:S}))]}},Vs=(e,t,r,n)=>{r.type="boolean"};var Js=(e,t,r,n)=>{r.not={}};var Gs=(e,t,r,n)=>{};var Ks=(e,t,r,n)=>{let o=e._zod.def,i=Be(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var Ws=(e,t,r,n)=>{ke(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Hs=(e,t,r,n)=>{ke(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Ys=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=Q(e);if(typeof s==="number")o.minItems=s;if(typeof a==="number")o.maxItems=a;o.type="array",o.items=M(i.element,t,{...n,path:[...n.path,"items"]})};function Tt(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Tt(t.out);if(t.type==="catch")return Tt(t.innerType);return e._zod.optin}var Xs=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&ke(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)ee(o.properties,u,M(s[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];if(t.io==="input"?Tt(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)o.required=c;if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=M(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},Qs=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>M(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));if(i)r.oneOf=s;else r.anyOf=s},ea=(e,t,r,n)=>{let o=e._zod.def,i=M(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=M(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c,t.intersections.push(c)};function Dr(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let b=Dr(e,h,r);return b===h?t:b}for(let h of["anyOf","oneOf"]){let b=t[h];if(!Array.isArray(b))continue;let w=b.map((S)=>Dr(e,S,r));if(w.some((S,P)=>S!==b[P]))t={...t,[h]:w}}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some((h)=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some((h)=>typeof h==="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...m}=t;if(m.enum)m.enum=m.enum.map((h)=>typeof h==="number"?String(h):h);else if(typeof m.const==="number")m.const=String(m.const);if(!o)return m;if(m.type="string",!i)m.pattern=(n.includes("number")?qe:lr).source;return m}var jr=new WeakMap;function ku(e){let t=new Map;for(let n of e.seen.values())if(n.def&&!t.has(n.schema))t.set(n.schema,n);let r=new Map;for(let n of jr.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let s=Dr(t,i,new Set);if(s!==i)r.set(i,s)}if(!r.size)return;for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);if(i)o.propertyNames=i}}var ta=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=Q(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=M(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of a)ee(o.patternProperties,Fs(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=M(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=jr.get(t);if(!l)l=[],jr.set(t,l),t.deferred.push(()=>ku(t));l.push(e)}o.additionalProperties=M(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let c=s._zod.values,u=t.io==="input"&&Tt(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)o.required=l.map(String)}},ra=(e,t,r,n)=>{let o=e._zod.def,i=M(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},na=(e,t,r,n)=>{let o=e._zod.def;M(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Br=Symbol();function oa(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return i=!0,null});if(!i)return JSON.parse(s);return ke(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Br}var ia=(e,t,r,n)=>{let o=e._zod.def;M(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=oa(o.defaultValue,e,t,r,n);if(s!==Br)r.default=s},sa=(e,t,r,n)=>{let o=e._zod.def;M(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=oa(o.defaultValue,e,t,r,n);if(s!==Br)r._prefault=s},aa=(e,t,r,n)=>{let o=e._zod.def;M(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{ke(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},ca=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;M(s,t,n);let a=t.seen.get(e);a.ref=s},ua=(e,t,r,n)=>{let o=e._zod.def;M(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var Fr=(e,t,r,n)=>{let o=e._zod.def;M(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var la=new WeakSet([Object.prototype,Error.prototype]);function Rt(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Eu=(e,t)=>{Nn.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(la.has(r))return;la.add(r),Rt(r,"format",(n)=>(o)=>Rn(n,o)),Rt(r,"flatten",(n)=>(o)=>Tn(n,o)),Rt(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Fe,2)}),Rt(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Fe,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var Y=p("ZodError",Eu,void 0,{Parent:Error});var da=gt(Y),pa=yt(Y),fa=bt(Y),ma=xt(Y),ha=Ln(Y),ga=Dn(Y),ya=jn(Y),ba=Bn(Y),xa=Fn(Y),va=Un(Y),wa=qn(Y),_a=Vn(Y);function Au(){if(!J.localeError)H(_r())}function Mt(){if(!J.memoizer)H({memoizer:qi()})}var T=p("ZodType",(e,t)=>(Au(),A.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(W(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return oe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Zl(e,t))},superRefine(e,t){return this.check(Il(e,t))},overwrite(e){return this.check(be(e))},optional(){return Sa(this)},exactOptional(){return hl(this)},nullable(){return Pa(this)},nullish(){return Sa(Pa(this))},nonoptional(e){return wl(this,e)},array(){return U(this)},or(e){return ll([this,e])},and(e){return pl(this,e)},transform(e){return Za(this,ml(e))},default(e){return bl(this,e)},prefault(e){return vl(this,e)},catch(e){return kl(this,e)},pipe(e){return Za(this,e)},readonly(){return Sl(this)},describe(e){let t=this.clone();return _e.add(t,{description:e}),t},meta(...e){if(e.length===0)return _e.get(this);let t=this.clone();return _e.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return mt(this,"~standard",{...gr(this),jsonSchema:{input:Xe(this,"input"),output:Xe(this,"output")}})},set "~standard"(e){pe(this,"~standard",e)},parse:function e(t,r){return da(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await pa(this,t,r,{callee:e})},safeParse(e,t){return fa(this,e,t)},async safeParseAsync(e,t){return ma(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){pe(this,"spa",e)},validate(e,t){return sr(this,e,t)},validateAsync(e,t){return ar(this,e,t)},encode:function e(t,r){return ha(this,t,r,{callee:e})},decode:function e(t,r){return ga(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ya(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ba(this,t,r,{callee:e})},safeEncode(e,t){return xa(this,e,t)},safeDecode(e,t){return va(this,e,t)},async safeEncodeAsync(e,t){return wa(this,e,t)},async safeDecodeAsync(e,t){return _a(this,e,t)},toJSONSchema(e){return As(this,{})(e)},get description(){return _e.get(this)?.description},get _def(){return this._zod.def}}),Ia=p("_ZodString",(e,t)=>{zt.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Us(e,r,n,o)},Zn({format:(e)=>Q(e).format??null,minLength:(e)=>Q(e).minimum??null,maxLength:(e)=>Q(e).maximum??null},{regex(...e){return this.check(zr(...e))},includes(...e){return this.check(Pr(...e))},startsWith(...e){return this.check(Zr(...e))},endsWith(...e){return this.check(Ir(...e))},min(...e){return this.check(Ee(...e))},max(...e){return this.check(At(...e))},length(...e){return this.check(Nt(...e))},nonempty(...e){return this.check(Ee(1,...e))},lowercase(e){return this.check($r(e))},uppercase(e){return this.check(Sr(e))},trim(){return this.check(Er())},normalize(...e){return this.check(Or(...e))},toLowerCase(){return this.check(Cr())},toUpperCase(){return this.check(Ar())},slugify(){return this.check(Nr())}})),Nu=p("ZodString",(e,t)=>{zt.init(e,t),Ia.init(e,t)},{email(e){return this.check(Wi(Du,e))},url(e){return this.check(es(Bu,e))},jwt(e){return this.check(hs(rl,e))},emoji(e){return this.check(ts(Fu,e))},guid(e){return this.check(Hi(ju,e))},uuid(e){return this.check(kr(Qe,e))},uuidv4(e){return this.check(Yi(Qe,e))},uuidv6(e){return this.check(Xi(Qe,e))},uuidv7(e){return this.check(Qi(Qe,e))},nanoid(e){return this.check(rs(Uu,e))},cuid(e){return this.check(ns(qu,e))},cuid2(e){return this.check(os(Vu,e))},ulid(e){return this.check(is(Ju,e))},base64(e){return this.check(ps(Qu,e))},base64url(e){return this.check(fs(el,e))},xid(e){return this.check(ss(Gu,e))},ksuid(e){return this.check(as(Ku,e))},ipv4(e){return this.check(cs(Wu,e))},ipv6(e){return this.check(us(Hu,e))},cidrv4(e){return this.check(ls(Yu,e))},cidrv6(e){return this.check(ds(Xu,e))},e164(e){return this.check(ms(tl,e))},datetime(e){return this.check(gs(Tu,e))},date(e){return this.check(ys(Ru,e))},time(e){return this.check(bs(Mu,e))},duration(e){return this.check(xs(Lu,e))}});function v(e){return Ki(Nu,e)}var N=p("ZodStringFormat",(e,t)=>{O.init(e,t),Ia.init(e,t)}),Tu=p("ZodISODateTime",(e,t)=>{oi.init(e,t),N.init(e,t)}),Ru=p("ZodISODate",(e,t)=>{ii.init(e,t),N.init(e,t)}),Mu=p("ZodISOTime",(e,t)=>{si.init(e,t),N.init(e,t)}),Lu=p("ZodISODuration",(e,t)=>{ai.init(e,t),N.init(e,t)}),Du=p("ZodEmail",(e,t)=>{Go.init(e,t),N.init(e,t)});var ju=p("ZodGUID",(e,t)=>{Vo.init(e,t),N.init(e,t)});var Qe=p("ZodUUID",(e,t)=>{Jo.init(e,t),N.init(e,t)});function Oa(e){return kr(Qe,e)}var Bu=p("ZodURL",(e,t)=>{Ho.init(e,t),N.init(e,t)});var Fu=p("ZodEmoji",(e,t)=>{Yo.init(e,t),N.init(e,t)});var Uu=p("ZodNanoID",(e,t)=>{Xo.init(e,t),N.init(e,t)});var qu=p("ZodCUID",(e,t)=>{Qo.init(e,t),N.init(e,t)});var Vu=p("ZodCUID2",(e,t)=>{ei.init(e,t),N.init(e,t)});var Ju=p("ZodULID",(e,t)=>{ti.init(e,t),N.init(e,t)});var Gu=p("ZodXID",(e,t)=>{ri.init(e,t),N.init(e,t)});var Ku=p("ZodKSUID",(e,t)=>{ni.init(e,t),N.init(e,t)});var Wu=p("ZodIPv4",(e,t)=>{ci.init(e,t),N.init(e,t)});var Hu=p("ZodIPv6",(e,t)=>{li.init(e,t),N.init(e,t)});var Yu=p("ZodCIDRv4",(e,t)=>{di.init(e,t),N.init(e,t)});var Xu=p("ZodCIDRv6",(e,t)=>{pi.init(e,t),N.init(e,t)});var Qu=p("ZodBase64",(e,t)=>{mi.init(e,t),N.init(e,t)});var el=p("ZodBase64URL",(e,t)=>{hi.init(e,t),N.init(e,t)});var tl=p("ZodE164",(e,t)=>{gi.init(e,t),N.init(e,t)});var rl=p("ZodJWT",(e,t)=>{yi.init(e,t),N.init(e,t)});var Ea=p("ZodNumber",(e,t)=>{br.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qs(e,r,n,o),e.isFinite=!0},Zn({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=Q(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=Q(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=Q(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>Q(e).format??null},{gt(e,t){return this.check(Et(e,t))},gte(e,t){return this.check(He(e,t))},min(e,t){return this.check(He(e,t))},lt(e,t){return this.check(Ot(e,t))},lte(e,t){return this.check(We(e,t))},max(e,t){return this.check(We(e,t))},int(e){return this.check(ka(e))},safe(e){return this.check(ka(e))},positive(e){return this.check(Et(0,e))},nonnegative(e){return this.check(He(0,e))},negative(e){return this.check(Ot(0,e))},nonpositive(e){return this.check(We(0,e))},multipleOf(e,t){return this.check(Ct(e,t))},step(e,t){return this.check(Ct(e,t))},finite(){return this}}));function nl(e){return vs(Ea,e)}var ol=p("ZodNumberFormat",(e,t)=>{bi.init(e,t),Ea.init(e,t)});function ka(e){return ws(ol,e)}var il=p("ZodBoolean",(e,t)=>{xi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vs(e,r,n,o)});function fe(e){return _s(il,e)}var sl=p("ZodUnknown",(e,t)=>{vi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gs(e,r,n,o)});function za(){return ks(sl)}var al=p("ZodNever",(e,t)=>{wi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Js(e,r,n,o)});function Ca(e){return zs(al,e)}var cl=p("ZodArray",(e,t)=>{Mt(),_i.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ys(e,r,n,o),e.element=t.element},{min(e,t){return this.check(Ee(e,t))},nonempty(e){return this.check(Ee(1,e))},max(e,t){return this.check(At(e,t))},length(e,t){return this.check(Nt(e,t))},unwrap(){return this.element}});function U(e,t){return $s(cl,e,t)}var Aa=p("ZodObject",(e,t)=>{Mt(),$i.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xs(e,r,n,o),Fc(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return Ne(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(W(this._zod.def,{catchall:e}))},passthrough(){return this.clone(W(this._zod.def,{catchall:za()}))},loose(){return this.clone(W(this._zod.def,{catchall:za()}))},strict(){return this.clone(W(this._zod.def,{catchall:Ca()}))},strip(){return this.clone(W(this._zod.def,{catchall:void 0}))},extend(e){return Nc(this,e)},safeExtend(e){return Tc(this,e)},merge(e){return Rc(this,e)},pick(e){return Cc(this,e)},omit(e){return Ac(this,e)},partial(...e){return zn(Na,this,e[0])},exactPartial(...e){return zn(Ta,this,e[0],"exactPartial")},required(...e){return Mc(Ra,this,e[0])}});function Vr(e,t){let r={type:"object",shape:e??{},...x(t)};return new Aa(r)}function E(e,t){return new Aa({type:"object",shape:e,catchall:Ca(),...x(t)})}var ul=p("ZodUnion",(e,t)=>{Si.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qs(e,r,n,o),e.options=t.options});function ll(e,t){return new ul({type:"union",options:e,...x(t)})}var dl=p("ZodIntersection",(e,t)=>{Pi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ea(e,r,n,o)});function pl(e,t){return new dl({type:"intersection",left:e,right:t})}var $a=p("ZodRecord",(e,t)=>{Mt(),Zi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ta(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Lt(e,t,r){if(!t||!t._zod)return new $a({type:"record",keyType:v(),valueType:e,...x(t)});return new $a({type:"record",keyType:e,valueType:t,...x(r)})}var qr=p("ZodEnum",(e,t)=>{Ii.init(e,t),T.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Ks(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new qr({...t,checks:[],...x(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new qr({...t,checks:[],...x(o),entries:i})}});function Ne(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new qr({type:"enum",entries:r,...x(t)})}var fl=p("ZodTransform",(e,t)=>{Mt(),Oi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hs(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ue(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(we(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(we(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function ml(e){return new fl({type:"transform",transform:e})}var Na=p("ZodOptional",(e,t)=>{xr.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Sa(e){return new Na({type:"optional",innerType:e})}var Ta=p("ZodExactOptional",(e,t)=>{Ei.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hl(e){return new Ta({type:"optional",innerType:e})}var gl=p("ZodNullable",(e,t)=>{Ci.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ra(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Pa(e){return new gl({type:"nullable",innerType:e})}var yl=p("ZodDefault",(e,t)=>{Ai.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ia(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bl(e,t){return new yl({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Qt(t)}})}var xl=p("ZodPrefault",(e,t)=>{Ni.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function vl(e,t){return new xl({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Qt(t)}})}var Ra=p("ZodNonOptional",(e,t)=>{Ti.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>na(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function wl(e,t){return new Ra({type:"nonoptional",innerType:e,...x(t)})}var _l=p("ZodCatch",(e,t)=>{Ri.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>aa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function kl(e,t){return new _l({type:"catch",innerType:e,catchValue:typeof t==="function"?t:In(t)})}var zl=p("ZodPipe",(e,t)=>{Mi.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ca(e,r,n,o),e.in=t.in,e.out=t.out});function Za(e,t){return new zl({type:"pipe",in:e,out:t})}var $l=p("ZodReadonly",(e,t)=>{Li.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ua(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new $l({type:"readonly",innerType:e})}var Pl=p("ZodCustom",(e,t)=>{Di.init(e,t),T.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ws(e,r,n,o)});function Zl(e,t={}){return Ss(Pl,e,t)}function Il(e,t){return Ps(e,t)}var Ol=E({id:v(),title:v(),parentId:v().nullable()}),El=E({id:v(),itemIds:U(v()).min(1),parentId:v(),relatedHubIds:U(v()).max(2)}),Dt=E({hubs:U(Ol),leaves:U(El)});var Cl=[["testing",["test","tests","testing","regression","coverage","tdd","e2e","playwright"]],["review",["review","reviews","reviewer","feedback","findings","audit"]],["debugging",["debug","debugging","diagnose","bug","bugs","incident","triage","flaky"]],["version-control",["git","merge","rebase","branch","commit","commits","conflict","worktree"]],["pull-requests",["pr","prs","pull"]],["writing",["write","writing","docs","documentation","prose","readme","voice"]],["planning",["plan","planning","architecture","roadmap"]],["typescript",["typescript","types","type"]],["frontend",["ui","css","react","frontend","browser","web","page","design"]],["data",["sql","database","data","schema","migration"]],["delivery",["deploy","release","ci","pipeline"]],["security",["security","secret","secrets","auth","permissions"]],["research",["research","search","investigate","sources"]]];function Al(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function Nl(e){return e.split("-").map((t)=>`${t[0]?.toUpperCase()??""}${t.slice(1)}`).join(" ")}function Tl(e){if(e.category)return e.category;let t=new Set(Al(`${e.name} ${e.title} ${e.description}`)),[r]=Cl.map(([n,o],i)=>({category:n,index:i,hits:o.filter((s)=>t.has(s)).length})).filter((n)=>n.hits>0).sort((n,o)=>o.hits-n.hits||n.index-o.index);return r?.category??"more"}function Jr(e){let r=Tl(e.item),n=`category:custom:${r}`,o=[...e.constellation.hubs];if(!o.some((i)=>i.id==="source:custom"))o.push({id:"source:custom",title:"Your custom skills",parentId:null});if(!o.some((i)=>i.id===n))o.push({id:n,title:r==="more"?"More skills":Nl(r),parentId:"source:custom"});return{hubs:o,leaves:[...e.constellation.leaves,{id:`skill:${e.item.id}`,itemIds:[e.item.id],parentId:n,relatedHubIds:[]}]}}var ze=Ne(["global","private","shared"]),Rl=v().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(48),$e=E({name:Rl,description:v().trim().min(1).max(300),body:v().trim().min(1).max(24000)}),jt=E({scope:ze,choices:Lt(v().max(128),fe()),edits:Lt(v().max(128),v().min(1).max(48000)).default({}),custom:U($e).max(40).default([])}),wm=jt.extend({directory:v(),id:v()});var Ml=E({id:v(),name:v(),title:v(),description:v(),text:v(),kind:Ne(["preference","skill"]),category:v().nullable(),section:v().nullable(),axis:v().nullable(),alwaysOn:fe(),owner:Ne(["packaged","managed","user","provider"])}),Ma=E({scope:ze,input:jt,inherited:Lt(v(),fe()),locked:Lt(v(),fe()),items:U(Ml),constellation:Dt,requirements:U(v()),libraryEnabled:fe(),revisionId:v().nullable()}),La=E({id:Oa(),changes:U(E({path:v(),before:v().nullable(),after:v().nullable(),internal:fe()})),warnings:U(v())}),Gr=E({revisionId:v().nullable()});var Kr=window.location.hash.slice(1),Ll=Kr||sessionStorage.getItem("shadowclone-session")||"";if(Kr)sessionStorage.setItem("shadowclone-session",Kr),history.replaceState(null,"",`${location.pathname}${location.search}`);async function R(e){let t=await fetch(e.path,{method:e.body===void 0?"GET":"POST",headers:{Authorization:`Bearer ${Ll}`,"Content-Type":"application/json"},body:e.body===void 0?void 0:JSON.stringify(e.body),signal:e.signal}),r=await t.json();if(!t.ok){let n=Vr({error:v()}).safeParse(r);throw Error(n.success?n.data.error:"The local editor could not complete this action.")}return e.schema.parse(r)}function _(e){let t=document.getElementById(e);if(t===null)throw Error("The editor is missing a required control");return t}function Wr(e){let t=document.querySelector(`#${e}`);if(!(t instanceof SVGSVGElement))throw Error("Expected an SVG canvas");return t}function G(e){let t=_(e);if(!(t instanceof HTMLInputElement))throw Error("Expected an input control");return t}function ue(e){let t=_(e);if(!(t instanceof HTMLSelectElement))throw Error("Expected a selection control");return t}function me(e){let t=_(e);if(!(t instanceof HTMLTextAreaElement))throw Error("Expected a text editor");return t}function Te(e){let t=_(e);if(!(t instanceof HTMLDialogElement))throw Error("Expected an editor dialog");return t}function g(e){let t=document.createElement(e.tag);if(e.className)t.className=e.className;if(e.text!==void 0)t.textContent=e.text;return t}function re(e){let t=_("notice");t.textContent=e.message,t.classList.toggle("success",e.success===!0),t.hidden=e.message.length===0}function he(e){re({message:e instanceof Error?e.message:"The action failed."})}var y={view:null,input:{scope:"global",choices:{},edits:{},custom:[]},activeId:"",search:"",dirty:!1};function D(e){let t=y.view?.locked[e.id];if(t!==void 0)return t;let r=y.input.choices[e.id];if(r!==void 0)return r;if(e.id.startsWith("custom:")&&y.input.custom.some((n)=>e.id===`custom:${n.name}`))return!0;return y.view?.inherited[e.id]===!0}function Re(e){if(y.view?.locked[e.id]!==void 0)return;let t=!D(e);if(y.input.choices[e.id]=t,t&&e.axis){for(let r of y.view?.items??[])if(r.axis===e.axis&&r.id!==e.id)y.input.choices[r.id]=!1,delete y.input.edits[r.id]}if(!t)delete y.input.edits[e.id];y.dirty=!0}function Hr(e){return e.filter((t)=>t.owner!=="provider"&&y.view?.locked[t.id]===void 0)}function Da(e){let t=Hr(e),r=!t.every(D),n=new Set;for(let o of t){if(D(o)===r){if(o.axis)n.add(o.axis);continue}if(r&&o.axis&&n.has(o.axis))continue;if(Re(o),o.axis)n.add(o.axis)}}function Yr(e){_("custom-status").textContent="",G("custom-name").value=e?`my-${e.name}`.slice(0,48):"",G("custom-description").value=e?`Use alongside ${e.name} for my working preferences.`:"",me("custom-body").value=e?`# Personal guidance for ${e.title}
58
+
59
+ `:"",Te("custom-dialog").showModal()}function ja(){let e=$e.parse({name:G("custom-name").value,description:G("custom-description").value,body:me("custom-body").value}),t=`custom:${e.name}`;if(y.view?.items.some((r)=>r.name===e.name))throw Error("Choose a name that does not replace an existing skill.");if(y.input.custom.push(e),y.input.choices[t]=!0,y.dirty=!0,y.activeId=t,y.view?.items.push({id:t,name:e.name,title:e.name.replaceAll("-"," "),description:e.description,text:`---
60
+ name: ${e.name}
61
+ description: ${JSON.stringify(e.description)}
62
+ ---
63
+
64
+ ${e.body}
65
+ `,kind:"skill",category:null,section:null,axis:null,alwaysOn:!1,owner:"managed"}),y.view)y.view.constellation=Jr({constellation:y.view.constellation,item:{id:t,name:e.name,title:e.name.replaceAll("-"," "),description:e.description,category:null}});Te("custom-dialog").close(),G("custom-name").value="",me("custom-body").value=""}var Xr={"design-deep-modules":{title:"Deep modules",summary:"Keep interfaces small and useful. Put complexity behind a clear boundary so callers have less to understand."},"typescript-type-safety":{title:"Explicit types",summary:"Represent valid states in the type system. Narrow uncertain values and keep unsafe assertions out of the implementation."},"verify-review-findings":{title:"Check review findings",summary:"Check each review comment against the code at the pull request head, and report a verdict before any change or reply."},"plan-with-review-page":{title:"Plan first",summary:"Read the code, ask one round of decisions with a recommendation, and share one plan with a review page before any edit."},"write-plain-english":{title:"Plain English",summary:"Write short sentences with one idea each and no dashes, in the user's voice. A checker reports long sentences and dashes."},"choose-by-consequence":{title:"Fail loudly",summary:"Compare each shortcut by what it does to the user's files and output. Pick the option that fails loudly and keeps counts true."},"scope-confirmed-changes":{title:"Reproduce, then fix",summary:"Reproduce the bug before any fix, then run the same reproduction after it. Keep the change to confirmed behavior."},"diagnose-before-editing":{title:"Find the cause",summary:"Reproduce the failure, make it smaller, and test one cause at a time until one cause predicts the symptom."},"tests-that-catch-bugs":{title:"Tests that catch bugs",summary:"Write a few tests that each name the bug they catch, check what the user sees, and fail when the fix is removed."},"verify-and-review":{title:"Verify the real outcome",summary:"Run what the user runs, read every count and exit code, and label each claim as measured, inferred, or not verified."},"research-primary-sources":{title:"Go to the source",summary:"Check authoritative documentation and original evidence when a technical decision depends on facts that need verification."},"planning-first":{title:"Plan the change",summary:"Establish the approach before implementation so the scope, decisions, and intended outcome are clear."},"planning-when-costly":{title:"Plan when it matters",summary:"Move directly on straightforward tasks. Pause for a plan when the cost, uncertainty, or consequences call for one."},"questions-autonomous":{title:"Keep moving",summary:"Use judgment to resolve routine choices. Ask when missing information changes the outcome or an action needs authorization."},"questions-early":{title:"Ask early",summary:"Resolve meaningful uncertainty with the user before investing in an implementation built on the wrong assumption."},"resolve-conflicts-by-intent":{title:"Preserve intent",summary:"Understand what both sides of a merge are trying to achieve. Resolve the conflict and verify the combined behavior."},"dependencies-existing":{title:"Know your tools",summary:"Look for a solution in the existing stack before adding another dependency."},"dependencies-mature":{title:"Choose proven tools",summary:"Use established, focused packages when they provide substantial reusable logic and justify the dependency."},"refactor-boundaries":{title:"Improve boundaries",summary:"Make a refactor when it improves responsibilities and simplifies the change. Keep its purpose connected to the task."},"refactor-preserve":{title:"Respect the structure",summary:"Work within the current structure and preserve unrelated code while making the requested change."}};function Se(e){return Xr[e.id]?.title??e.title}function Ba(e){let t=Xr[e.item.id];if(t&&e.editedText===void 0&&e.item.owner==="packaged")return t.summary;let r=(e.editedText??e.item.text).replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/,"").split(`
66
+ `).filter((n)=>n.trim()&&!n.startsWith("#")&&!n.startsWith("```")).slice(0,2).join(" ").replace(/\*\*/g,"");return r.length>320?`${r.slice(0,317).trimEnd()}…`:r}function Dl(e){let t=g({tag:"details",className:"editor"});t.append(g({tag:"summary",text:"Edit instructions"}));let r=g({tag:"textarea"});r.value=y.input.edits[e.item.id]??e.item.text,r.maxLength=48000,r.setAttribute("aria-label",`Instructions for ${e.item.title}`);let n=g({tag:"button",className:"quiet-button",text:"Save to draft"});return n.addEventListener("click",()=>{if(!D(e.item))Re(e.item);y.input.edits[e.item.id]=r.value,y.input.choices[e.item.id]=!0,y.dirty=!0,re({message:"Instructions added to your draft. Review the changes before applying.",success:!0}),e.rerender()}),t.append(r,n),t}function Fa(e){let t=_("detail"),r=y.view?.items.find((a)=>a.id===y.activeId);if(t.replaceChildren(),!r){t.append(g({tag:"h2",text:"Choose a skill."})),t.append(g({tag:"p",className:"detail-description",text:"Inspect a star to see what it teaches your agent."}));return}t.append(g({tag:"p",className:"eyebrow",text:`${(r.category??"CUSTOM").replaceAll("-"," ").toUpperCase()} / ${r.kind.toUpperCase()}`}),g({tag:"h2",text:Se(r)}),g({tag:"p",className:"detail-description",text:r.description}));let n=g({tag:"div",className:"behavior"});n.append(g({tag:"p",className:"eyebrow",text:"YOUR AGENT WILL"}),g({tag:"p",text:Ba({item:r,editedText:y.input.edits[r.id]})})),t.append(n);let o=r.owner==="provider",i=y.view?.locked[r.id]!==void 0;if(t.append(g({tag:"p",className:"skill-status",text:r.alwaysOn?"◇ Always on":i?"◇ Shared requirement":o?"◇ Managed by its provider":"◇ Workflow guidance"})),i){t.append(g({tag:"p",className:"owner-note",text:r.alwaysOn?"shadowclone always applies this skill. Your agent loads it before it writes any text that a person reads.":"This choice belongs to the shared repository build. Switch to shared scope to propose a reviewed change."}));return}let s=g({tag:"button",className:"primary-button",text:o?"Create a local companion":D(r)?"Unequip skill":"Equip skill"});if(s.addEventListener("click",()=>{if(o){e.companion(r);return}Re(r),e.rerender()}),t.append(s),o)t.append(g({tag:"p",className:"owner-note",text:"Enable or disable this package in its harness. A companion adds your own instructions without changing the package."}));else t.append(Dl({item:r,rerender:e.rerender}))}var jl=E({title:v().min(1).max(48),profile:v().min(1).max(420),abilities:U(E({skill:v().min(1).max(120),text:v().min(1).max(200)})).min(1).max(3),tradeoff:v().min(1).max(240)}),Ua=E({name:jl,destination:v()});function qa(e){let t=new Map,r={status:"empty"},n=null,o=null,i=null,s=(u)=>{r=u,e.onChange(u)},a=()=>{if(o)e.cancel(o.handle);o=null,i?.abort(),i=null},c=()=>{let u=n;if(o=null,!u?.key)return;let l=u.key,d=new AbortController;i?.abort(),i=d,s({status:"loading"}),e.fetchName({input:structuredClone(u.input),signal:d.signal}).then((f)=>{if(t.set(l,f),!d.signal.aborted&&n?.key===l)s({status:"ready",result:f})}).catch((f)=>{if(!d.signal.aborted&&n?.key===l)s({status:"failed",error:f instanceof Error?f.message:"The build could not be named."})}).finally(()=>{if(i===d)i=null})};return{state:()=>r,update(u){let l=n;if(n=u,!u.enabled){if(a(),r.status!=="off")s({status:"off"});return}if(l?.key===u.key&&l.enabled&&r.status!=="off")return;if(a(),u.key===null){s({status:"empty"});return}let d=t.get(u.key);if(d){s({status:"ready",result:d});return}if(!u.changed){s({status:"unnamed"});return}s({status:"waiting"}),o={handle:e.schedule({run:c,delayMilliseconds:5000})}},retry(){a(),c()}}}var Qr="shadowclone-build-naming";function Va(){try{return localStorage.getItem(Qr)!=="off"}catch{return!0}}function Bl(e){try{if(e)localStorage.removeItem(Qr);else localStorage.setItem(Qr,"off")}catch{return}}var Fl={empty:"Choose the instincts you want your agent to bring to work.",off:"Build naming is off. Turn it on to name your build with your fast model.",unnamed:"Name this build now, or change a skill and it gets a name 5 seconds later.",waiting:"Your build gets a name 5 seconds after your last change.",loading:"Naming your build…"};function Ja(e){let t=_("identity"),r=_("abilities"),n=_("tradeoff"),o=e.status==="ready"?e.result:null;t.dataset.naming=e.status,t.setAttribute("aria-busy",String(e.status==="loading")),_("identity-title").textContent=o?.name.title??"An open canvas",_("identity-description").textContent=e.status==="ready"?e.result.name.profile:e.status==="failed"?e.error:Fl[e.status],r.replaceChildren(...(o?.name.abilities??[]).map((a)=>{let c=g({tag:"li"});return c.append(g({tag:"strong",text:a.skill}),g({tag:"span",text:a.text})),c})),n.hidden=!o,n.textContent=o?`Tradeoff: ${o.name.tradeoff}`:"",_("naming-source").textContent=o?`Named by ${o.destination}`:"";let i=_("retry-name");i.hidden=e.status!=="failed"&&e.status!=="unnamed",i.textContent=e.status==="unnamed"?"Name my build":"Retry";let s=_("toggle-naming");s.textContent=e.status==="off"?"Turn naming on":"Turn naming off",s.setAttribute("aria-pressed",String(e.status!=="off"))}var en=qa({schedule:({run:e,delayMilliseconds:t})=>window.setTimeout(e,t),cancel:(e)=>window.clearTimeout(e),fetchName:({input:e,signal:t})=>R({path:"/api/build-name",schema:Ua,body:e,signal:t}),onChange:Ja});function Ga(){return y.view?.items.filter((e)=>e.owner!=="provider"&&!e.alwaysOn&&D(e))??[]}function Ka(){let e=Ga();en.update({key:e.length?JSON.stringify([y.input.scope,e.map((t)=>t.id).sort(),y.input.custom]):null,input:y.input,enabled:Va(),changed:y.dirty})}function Wa(){_("retry-name").addEventListener("click",()=>en.retry()),_("toggle-naming").addEventListener("click",()=>{Bl(!Va()),Ka()}),Ja(en.state())}function Ha(){let e=Ga();_("equipped-count").textContent=`${e.length} ${e.length===1?"skill":"skills"} equipped${y.dirty?" · unsaved changes":""}`,Ka();let t=_("requirements");if(t.replaceChildren(),t.hidden=!y.view?.requirements.length,y.view?.requirements.length){t.append(g({tag:"h3",text:"◇ Repository requirements"}));for(let r of y.view.requirements)t.append(g({tag:"p",text:r}))}}var Bt=null;async function Ya(){if(y.view===null)throw Error("Wait for your skills to load before reviewing the build.");let e=await R({path:"/api/preview",schema:La,body:y.input});Bt=e;let t=_("review-content");t.replaceChildren(),t.append(g({tag:"p",className:"review-message",text:`${e.changes.length} local files will change. Review the instructions and destinations below.`}));for(let r of e.warnings)t.append(g({tag:"p",className:"review-warning",text:r}));for(let r of e.changes){let n=g({tag:"details",className:"file-change"});if(n.append(g({tag:"summary",text:r.path})),r.internal)n.append(g({tag:"p",text:"Local configuration or supporting resource. Its previous version is retained for undo."}));else n.append(g({tag:"h4",text:"Before"}),g({tag:"pre",text:r.before??"New file"}),g({tag:"h4",text:"After"}),g({tag:"pre",text:r.after??"Remove managed file"}));t.append(n)}Te("review-dialog").showModal()}async function Xa(){if(Bt===null)throw Error("Review your build before applying it.");await R({path:"/api/apply",schema:Gr,body:{previewId:Bt.id}}),Bt=null,Te("review-dialog").close(),re({message:"Build equipped. Start a fresh agent session to use your updated skills.",success:!0})}async function Qa(){let e=y.view?.revisionId;if(!e||!window.confirm("Restore the files from before the last apply? Later edits will be preserved if they conflict."))return;await R({path:"/api/undo",schema:Gr,body:{revisionId:e}}),re({message:"Restored the previous build.",success:!0})}function Ul(e){let t=e.map((r)=>y.view?.items.find((n)=>n.id===r)).filter((r)=>r!==void 0);return t.find(D)??t[0]}function ql(e){return`${Se(e)} ${e.description}`.toLowerCase().includes(y.search.toLowerCase())}function ec(e){let t=_("constellation-list");t.replaceChildren();let r=new Map(e.constellation.hubs.map((n)=>[n.id,n.parentId]));for(let n of e.constellation.hubs.filter((o)=>o.parentId===null)){let o=g({tag:"section",className:"skill-list-group"});o.append(g({tag:"h3",text:n.title}));for(let i of e.constellation.leaves.filter((s)=>{let a=s.parentId;while(a){if(a===n.id)return!0;a=r.get(a)??null}return!1})){let s=Ul(i.itemIds);if(!s||!ql(s))continue;let a=g({tag:"button",className:"skill-list-item",text:Se(s)});a.classList.toggle("equipped",D(s)),a.addEventListener("click",()=>e.inspect(s.id)),o.append(a)}if(o.childElementCount>1)t.append(o)}}var C={padding:32,rootX:56,sourceX:176,categoryX:296,cellWidth:120,cellHeight:96,groupGap:12,sourceGap:28,labelWidth:108,jitterX:4,jitterY:5};function tc(e){let t=2166136261;for(let r of e.key)t=Math.imul(t^(r.codePointAt(0)??0),16777619);return(t>>>0)/4294967295*e.range*2-e.range}function tn(e){let t=e-C.categoryX-C.padding+C.cellWidth/2;return Math.max(2,Math.floor(t/C.cellWidth))}function Ft(e){return{id:`${e.from.id}:${e.to.id}`,sourceX:e.from.x,sourceY:e.from.y,targetX:e.to.x,targetY:e.to.y,sibling:e.sibling??!1}}function Vl(e){let t=[],r=e.cells;for(let n of e.blocks){if(r+1+n.columns>e.cells)t.push([]),r=0;t.at(-1)?.push(n),r+=1+n.columns}return t}function rc(e){let t=tn(e.width),{hubs:r,leaves:n}=e.constellation,o=[],i=[],s=[],a=e.collapsed??new Set,c=C.padding;for(let f of r.filter((m)=>m.parentId===null)){let m=[],h=[],b=r.filter((z)=>z.parentId===f.id),w=a.has(f.id),S=(w?[]:b).map((z)=>{let k=n.filter((K)=>K.parentId===z.id),Z=a.has(z.id)?[]:k;return{category:z,members:Z,hidden:k.length-Z.length,columns:Math.max(1,Math.min(Z.length,t-1))}});for(let z of Vl({blocks:S,cells:t})){let k=0,Z=1,K=null;for(let B of z){let X=C.categoryX+k*C.cellWidth,le={id:B.category.id,title:B.category.title,itemIds:[],kind:"category",parentId:f.id,x:X,y:c+C.cellHeight/2,hidden:B.hidden},ot=le;if(m.push(le),K)i.push(Ft({from:K,to:le,sibling:!0}));else h.push(le);for(let[it,st]of B.members.entries()){let pn=it%B.columns,Wt={id:st.id,title:"",itemIds:st.itemIds,kind:"skill",parentId:B.category.id,hidden:0,x:X+(pn+1)*C.cellWidth+tc({key:st.id,range:C.jitterX}),y:c+Math.floor(it/B.columns)*C.cellHeight+C.cellHeight/2+tc({key:`${st.id}:y`,range:C.jitterY})};i.push(Ft({from:pn===0?le:ot,to:Wt})),o.push(Wt),ot=Wt}Z=Math.max(Z,Math.ceil(B.members.length/B.columns)),k+=1+B.columns,K=le}c+=Z*C.cellHeight+C.groupGap}let P=m[0],L=m.at(-1),V={id:f.id,title:f.title,itemIds:[],kind:"source",parentId:"constellation-root",x:C.sourceX,y:P&&L?(P.y+L.y)/2:c+C.cellHeight/2,hidden:w?n.filter((z)=>b.some((k)=>k.id===z.parentId)).length:0};if(w)c+=C.cellHeight;s.push(V),o.push(V,...m),i.push(...h.map((z)=>Ft({from:V,to:z}))),c+=C.sourceGap}let u=s[0],l=s.at(-1),d={id:"constellation-root",title:"shadowclone",itemIds:[],kind:"root",parentId:null,hidden:0,x:C.rootX,y:u&&l?(u.y+l.y)/2:C.padding+C.cellHeight/2};return i.push(...s.map((f)=>Ft({from:d,to:f}))),{nodes:[d,...o],links:i,height:Math.max(c+C.padding,C.cellHeight*2)}}var Jl={modules:"M4 4h6v6H4ZM14 4h6v6h-6ZM4 14h6v6H4ZM14 14h6v6h-6Z",code:"m8 5-6 7 6 7m8-14 6 7-6 7m-3-16-2 18",focus:"M8 3H4v4m12-4h4v4M4 17v4h4m12-4v4h-4M8 9h8v6H8Z",bug:"M9 5 7 2m8 3 2-3M8 9V7a4 4 0 0 1 8 0v2M6 9h12v6a6 6 0 0 1-12 0Zm6 0v12M2 10h4m12 0h4M2 15h4m12 0h4M4 21l3-3m10 0 3 3",flask:"M9 3h6m-5 0v7l-6 9q-1 2 2 2h12q3 0 2-2l-6-9V3M7 15h10",check:"m2 12 5 5L19 5M12 17l10-10",route:"M7 5h10a3 3 0 0 1 0 6H7a3 3 0 0 0 0 6h10M7 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6m10 12a3 3 0 1 0 0 6 3 3 0 0 0 0-6",compass:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20m-3 7 8-2-2 8-8 2Z",flag:"M5 22V3q4-3 8 0t7 0v10q-3 3-7 0t-8 0",merge:"M6 2v8q0 5 6 5h6m-4-4 4 4-4 4M6 18v4M18 2v5",layers:"m12 2 10 6-10 6L2 8Zm-9 11 9 5 9-5M3 17l9 5 9-5",link:"m9 15 6-6m-7 4-2 2a4 4 0 0 0 6 6l3-3m1-5 2-2a4 4 0 0 0-6-6L9 8",shield:"m12 2 8 3v7q0 6-8 10-8-4-8-10V5Zm-4 9 3 3 5-6",question:"M8 7a4 4 0 1 1 6 4q-2 1-2 4m0 4v1M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20",spark:"m12 2 3 7 7 3-7 3-3 7-3-7-7-3 7-3Z",search:"M10 3a7 7 0 1 0 0 14 7 7 0 0 0 0-14m5 12 6 6"},Gl={"design-deep-modules":"modules","typescript-type-safety":"code","scope-confirmed-changes":"focus","choose-by-consequence":"compass","write-plain-english":"spark","plan-with-review-page":"route","verify-review-findings":"search","refactor-boundaries":"layers","refactor-preserve":"shield","dependencies-existing":"link","dependencies-mature":"layers","diagnose-before-editing":"bug","tests-that-catch-bugs":"flask","research-primary-sources":"search","verify-and-review":"check","planning-first":"route","planning-when-costly":"compass","questions-autonomous":"flag","questions-early":"question","resolve-conflicts-by-intent":"merge"};function nc(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg"),r=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.25"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true"),r.setAttribute("d",Jl[e]),t.append(r),t}function oc(e){return nc(Gl[e.id]??"spark")}function ic(e){let t=e.toLowerCase(),n=Object.entries({engineering:"code",architecture:"modules",typescript:"code",workflow:"route",dependenc:"layers",testing:"flask",communication:"question",debugging:"bug",planning:"compass",research:"search",review:"check",setup:"spark"}).find(([o])=>t.includes(o))?.[1]??"compass";return nc(n)}var Kl="http://www.w3.org/2000/svg",ac="shadowclone-collapsed-groups";function Wl(){try{let e=JSON.parse(localStorage.getItem(ac)??"[]");return new Set(Array.isArray(e)?e.filter((t)=>typeof t==="string"):[])}catch{return new Set}}var Pe=Wl();function rn(){return Pe}function cc(e){if(Pe=new Set(Pe),!Pe.delete(e))Pe.add(e);try{localStorage.setItem(ac,JSON.stringify([...Pe]))}catch{return}}function et(e){return document.createElementNS(Kl,e)}function sc(e){e.target.addEventListener("click",(t)=>{t.stopPropagation(),e.action()}),e.target.addEventListener("keydown",(t)=>{if(t.key==="Enter"||t.key===" ")t.preventDefault(),t.stopPropagation(),e.action()})}function uc(e){let{container:t,node:r}=e,n=!Pe.has(r.id),o=et("g"),i=et("circle"),s=et("path");if(o.setAttribute("class","map-collapse"),o.setAttribute("transform","translate(36 0)"),o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.setAttribute("aria-expanded",String(n)),o.setAttribute("aria-label",`${n?"Collapse":"Expand"} ${r.title}`),i.setAttribute("r","12"),s.setAttribute("d",n?"M2 -4L-2 0L2 4":"M-2 -4L2 0L-2 4"),o.append(i,s),sc({target:o,action:()=>e.toggle(r.id)}),t.append(o),r.hidden>0){let c=et("text");c.setAttribute("class","map-hidden-count"),c.setAttribute("x","54"),c.setAttribute("y","4"),c.textContent=`${r.hidden} hidden`,t.append(c)}if(r.kind!=="category")return;let a=et("rect");for(let[c,u]of Object.entries({x:"-26",y:"-26",width:"52",height:"52",class:"map-node-hit"}))a.setAttribute(c,u);t.prepend(a),t.setAttribute("role","button"),t.setAttribute("tabindex","0"),sc({target:t,action:()=>e.equipAll(r.id)})}function lc(e){if(e.node.kind!=="category")return;let t=Hr(e.items),r=t.length>0&&t.every(D);e.element.classList.toggle("equipped",r),e.element.classList.toggle("partial",!r&&t.some(D)),e.element.setAttribute("aria-pressed",String(r)),e.element.setAttribute("aria-disabled",String(t.length===0)),e.element.setAttribute("aria-label",t.length===0?`${e.node.title}, managed by plugins`:`${r?"Unequip":"Equip"} all ${t.length} skills in ${e.node.title}`)}var Hl="http://www.w3.org/2000/svg",tt=()=>{return},qt=()=>{return},dc="",nn=new Map,on=new Map,sn=new Map;function ne(e){return document.createElementNS(Hl,e)}function rt(e){let t=e.itemIds.map((r)=>nn.get(r)).filter((r)=>r!==void 0);return t.find(D)??t[0]}function pc(e){return(y.view?.constellation.leaves??[]).filter((t)=>t.parentId===e).flatMap((t)=>{let r=t.itemIds.map((o)=>nn.get(o)).filter((o)=>o!==void 0),n=r.find(D)??r[0];return n?[n]:[]})}function Ut(e){let t=rt(e);return t?Se(t):e.title}function Yl(e){let t=rt(e);return!y.search||`${Ut(e)} ${t?.description??""}`.toLowerCase().includes(y.search.toLowerCase())}function Xl(e){let t=[""];for(let r of e.split(/\s+/)){let n=t.at(-1)??"";if(n&&n.length+r.length>=16)t.push(r);else t[t.length-1]=`${n} ${r}`.trim()}return t.slice(0,2).map((r,n)=>`${r.slice(0,17)}${n===1&&t.length>2||r.length>17?"…":""}`)}function Ql(e){let{node:t}=e,r=rt(t),n=ne("g"),o=t.kind==="skill"?26:t.kind==="root"?0:32,i=ne("text");if(n.setAttribute("class",`map-node map-node-${t.kind}`),n.setAttribute("transform",`translate(${t.x} ${t.y})`),n.dataset.nodeId=t.id,t.kind==="skill"){let a=ne("rect");for(let[c,u]of Object.entries({x:"-26",y:"-26",width:"52",height:"52",class:"map-node-hit"}))a.setAttribute(c,u);n.append(a),n.setAttribute("role","button"),n.setAttribute("tabindex","0")}if(t.kind==="root"){let a=ne("circle");a.setAttribute("r","26"),n.append(a)}else{let a=ne("rect");for(let[c,u]of Object.entries({x:String(-o/2),y:String(-o/2),width:String(o),height:String(o),rx:"6",transform:"rotate(45)",class:"map-node-gem"}))a.setAttribute(c,u);n.append(a)}i.setAttribute("text-anchor","middle");for(let[a,c]of Xl(Ut(t)).entries()){let u=ne("tspan");u.setAttribute("x","0"),u.setAttribute("y",String((t.kind==="skill"?34:44)+a*16)),u.textContent=c,i.append(u)}let s=ne("title");if(s.textContent=Ut(t),n.append(s,i),t.kind==="root"){let a=document.querySelector(".brand-mark");if(a instanceof HTMLImageElement){let c=ne("image");for(let[u,l]of Object.entries({href:a.src,x:"-16",y:"-16",width:"32",height:"32"}))c.setAttribute(u,l);n.append(c)}}else{let a=ne("foreignObject"),c=g({tag:"span",className:"map-node-icon"});for(let[u,l]of Object.entries({x:"-9",y:"-9",width:"18",height:"18"}))a.setAttribute(u,l);c.append(r?oc(r):ic(t.title)),a.append(c),n.append(a)}if(t.kind==="category"||t.kind==="source")uc({container:n,node:t,toggle:(a)=>{cc(a),rd(),document.querySelector(`[data-node-id="${CSS.escape(a)}"] .map-collapse`)?.focus()},equipAll:(a)=>qt(pc(a))}),sn.set(t.id,{node:t,element:n});if(t.kind==="skill"&&r){let a=()=>tt(rt(t)??r);n.addEventListener("click",a),n.addEventListener("keydown",(c)=>{if(c.key==="Enter"||c.key===" ")c.preventDefault(),a()}),on.set(t.id,{node:t,element:n})}e.group.append(n)}function ed(e){if(!e.sibling)return`M${e.sourceX} ${e.sourceY}L${e.targetX} ${e.targetY}`;let t=(e.sourceX+e.targetX)/2;return`M${e.sourceX} ${e.sourceY-18}Q${t} ${e.sourceY-60} ${e.targetX} ${e.targetY-18}`}function td(){for(let{node:e,element:t}of sn.values())lc({element:t,node:e,items:pc(e.id)});for(let{node:e,element:t}of on.values()){let r=rt(e),n=r?D(r):!1;t.classList.toggle("equipped",n),t.classList.toggle("active",r?.id===y.activeId),t.classList.toggle("search-miss",!Yl(e)),t.setAttribute("aria-pressed",String(n)),t.setAttribute("aria-label",`${Ut(e)}${r?.owner==="provider"?", managed by its plugin":r?.alwaysOn?", always on":n?", equipped":""}`)}}function Vt(e){tt=e.choose,qt=e.chooseGroup;let t=Wr("constellation-map"),r=y.view;if(!r)return;ec({constellation:r.constellation,inspect:(i)=>{let s=r.items.find((a)=>a.id===i);if(s)tt(s)}});let n=t.getBoundingClientRect().width;if(n<=0)return;nn=new Map(r.items.map((i)=>[i.id,i]));let o=JSON.stringify([tn(n),r.constellation,[...rn()]]);if(o!==dc){let i=rc({constellation:r.constellation,width:n,collapsed:rn()}),s=ne("g");dc=o,on.clear(),sn.clear(),t.setAttribute("viewBox",`0 0 ${Math.round(n)} ${Math.round(i.height)}`),t.style.height=`${Math.round(i.height)}px`,t.replaceChildren(s);for(let a of i.links){let c=ne("path");c.setAttribute("class",a.sibling?"map-link sibling":"map-link"),c.setAttribute("d",ed(a)),s.append(c)}for(let a of i.nodes)Ql({group:s,node:a})}td()}function fc(){let e=Wr("constellation-map"),t=0;new ResizeObserver(()=>{let n=e.getBoundingClientRect().width;if(Math.round(n)!==Math.round(t))t=n,Vt({choose:tt,chooseGroup:qt})}).observe(e);let r=_("toggle-constellation-view");r.addEventListener("click",()=>{let n=_("constellation").classList.toggle("list-view");r.setAttribute("aria-pressed",String(n))})}function rd(){Vt({choose:tt,chooseGroup:qt})}var an={squarePixelsPerStar:9000,maximumStars:600,attemptsPerStar:30};function mc(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let r=Math.imul(t^t>>>15,t|1);return r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function hc(e){return Math.min(an.maximumStars,Math.round(Math.max(0,e.width)*Math.max(0,e.height)/an.squarePixelsPerStar))}function nd(e){let t=Math.max(1,hc(e));return Math.sqrt(e.width*e.height/t)*0.55}function q(e){return e.low+e.random()*(e.high-e.low)}function od(e){let{random:t}=e,r=t()<0.08,n=t()*Math.PI*2,o=q({random:t,low:4,high:14});return{id:e.id,x:e.x,y:e.y,radius:r?q({random:t,low:1.4,high:1.9}):q({random:t,low:0.5,high:1.2}),brightness:q({random:t,low:0.35,high:1}),twinkleSeconds:q({random:t,low:3.5,high:14}),delaySeconds:-q({random:t,low:0,high:14}),driftX:Math.cos(n)*o,driftY:Math.sin(n)*o,driftSeconds:q({random:t,low:18,high:60}),sparkle:r}}function gc(e){let t=hc(e),r=nd(e),n=e.existing.filter((l)=>l.x>=0&&l.x<=e.width&&l.y>=0&&l.y<=e.height).slice(0,t),o=[...n],i=r/Math.SQRT2,s=new Map,a=(l)=>`${Math.floor(l.x/i)}:${Math.floor(l.y/i)}`,c=(l)=>{let d=Math.floor(l.x/i),f=Math.floor(l.y/i);for(let m=-2;m<=2;m+=1)for(let h=-2;h<=2;h+=1){let b=s.get(`${d+m}:${f+h}`);if(b&&Math.hypot(b.x-l.x,b.y-l.y)<r)return!0}return!1},u=Math.max(0,...o.map((l)=>l.id+1));for(let l of n)s.set(a(l),l);for(let l=0;o.length<t&&l<t*an.attemptsPerStar;l+=1){let d={x:e.random()*e.width,y:e.random()*e.height};if(c(d))continue;let f=od({id:u,...d,random:e.random});u+=1,o.push(f),s.set(a(f),f)}return o}function yc(e){if(e.reducedMotion||e.width<=0||e.height<=0)return null;let{random:t}=e;return{waitMilliseconds:q({random:t,low:9000,high:28000}),star:{x:q({random:t,low:e.width*0.1,high:e.width*0.9}),y:q({random:t,low:0,high:Math.min(e.height*0.5,600)}),angle:t()<0.5?q({random:t,low:20,high:40}):q({random:t,low:140,high:160}),length:q({random:t,low:70,high:140}),travel:q({random:t,low:220,high:380}),seconds:q({random:t,low:0.7,high:1.3})}}}var Jt="http://www.w3.org/2000/svg";function bc(e){for(let[t,r]of Object.entries(e.properties))e.element.style.setProperty(t,r)}function id(e){let t=document.createElementNS(Jt,"g"),r=document.createElementNS(Jt,"circle");if(t.setAttribute("class",e.sparkle?"star sparkle":"star"),t.setAttribute("transform",`translate(${e.x.toFixed(1)} ${e.y.toFixed(1)})`),r.setAttribute("r",e.radius.toFixed(2)),bc({element:t,properties:{"--brightness":e.brightness.toFixed(2),"--twinkle":`${e.twinkleSeconds.toFixed(2)}s`,"--delay":`${e.delaySeconds.toFixed(2)}s`,"--drift-x":`${e.driftX.toFixed(1)}px`,"--drift-y":`${e.driftY.toFixed(1)}px`,"--drift":`${e.driftSeconds.toFixed(1)}s`}}),t.append(r),e.sparkle){let n=document.createElementNS(Jt,"path");n.setAttribute("d","M-4 0h8M0 -4v8"),n.setAttribute("class","star-rays"),t.append(n)}return t}function xc(){let e=_("starfield"),t=mc(crypto.getRandomValues(new Uint32Array(1))[0]??Date.now()),r=window.matchMedia("(prefers-reduced-motion: reduce)"),n=new Map,o=[],i={width:0,height:0},s=!1,a=()=>{let l=e.getBoundingClientRect(),d=Math.max(1,Math.round(l.width)),f=Math.max(1,Math.round(l.height));if(d===i.width&&f===i.height)return;i={width:d,height:f},e.setAttribute("viewBox",`0 0 ${d} ${f}`),o=gc({width:d,height:f,existing:o,random:t});let m=new Set(o.map((h)=>h.id));for(let[h,b]of n)if(!m.has(h))b.remove(),n.delete(h);for(let h of o){if(n.has(h.id))continue;let b=id(h);n.set(h.id,b),e.append(b)}},c=()=>{let l=s?null:yc({...i,random:t,reducedMotion:r.matches});if(!l)return;s=!0,window.setTimeout(()=>{if(s=!1,!document.hidden&&!r.matches){let d=document.createElementNS(Jt,"line");d.setAttribute("class","shooting-star"),d.setAttribute("x2",l.star.travel.toFixed(0)),d.setAttribute("transform",`translate(${l.star.x.toFixed(0)} ${l.star.y.toFixed(0)}) rotate(${l.star.angle.toFixed(0)})`),bc({element:d,properties:{"--shoot":`${l.star.seconds.toFixed(2)}s`,"--length":`${l.star.length.toFixed(0)}px`,"--travel":`${l.star.travel.toFixed(0)}px`}}),d.addEventListener("animationend",()=>d.remove()),e.append(d)}c()},l.waitMilliseconds)},u=()=>{e.classList.toggle("paused",document.hidden)};document.addEventListener("visibilitychange",u),r.addEventListener("change",c),new ResizeObserver(a).observe(e),a(),u(),c()}var Ph=E({name:v().trim().max(48),description:v().trim().max(300),body:v().trim().min(1).max(24000)}),vc=E({id:Oa(),destination:v(),payload:v(),limits:v(),cached:$e.nullable()}),wc=E({skill:$e});function Gt(e){let t=!1,r=(n)=>{let o=e.getBoundingClientRect();return n.target===e&&(n.clientX<o.left||n.clientX>o.right||n.clientY<o.top||n.clientY>o.bottom)};e.addEventListener("pointerdown",(n)=>{t=r(n)}),e.addEventListener("click",(n)=>{if(t&&r(n))e.close();t=!1})}function _c(e){let t=g({tag:"dialog"}),r=g({tag:"div",className:"dialog-heading"}),n=g({tag:"button",className:"quiet-button",text:"✕"}),o=g({tag:"details",className:"file-change"}),i=g({tag:"div",className:"dialog-actions"}),s=g({tag:"p",className:"review-message"}),a=g({tag:"button",className:"quiet-button",text:"Keep editing"}),c=g({tag:"button",className:"primary-button",text:e.confirm}),u=new AbortController;t.setAttribute("aria-label",e.title),n.setAttribute("aria-label","Close model request"),s.setAttribute("role","status"),n.addEventListener("click",()=>t.close()),Gt(t),r.append(g({tag:"h2",text:e.title}),n),o.append(g({tag:"summary",text:"Exact payload sent to the model"}),g({tag:"pre",text:e.review.payload})),a.addEventListener("click",()=>t.close()),t.addEventListener("close",()=>{u.abort(),t.remove()});async function l(){if(c.disabled)return;c.disabled=!0,c.textContent="Generating…",a.textContent="Cancel generation",s.textContent="Your model is working. You can cancel and keep your original draft.";try{let d=await R({path:e.path,schema:e.schema,body:{previewId:e.review.id},signal:u.signal});if(!u.signal.aborted)e.accept(d),t.close()}catch(d){if(u.signal.aborted)return;s.className="review-warning",s.textContent=d instanceof Error?d.message:"Generation failed. Your draft is unchanged.",c.textContent="Request ended",a.textContent="Back to editing"}}c.addEventListener("click",()=>{l().catch(()=>{s.textContent="Generation failed. Return to editing to try again."})}),i.append(a,c),t.append(r,g({tag:"p",className:"review-message",text:`Destination: ${e.review.destination}`}),g({tag:"p",className:"review-message",text:e.review.limits}),g({tag:"p",className:"review-message",text:e.explanation}),o,s,i),document.body.append(t),t.showModal()}function Ze(e){_("custom-status").textContent=e}async function sd(){let e=me("custom-body").value;if(!e.trim()){Ze("Describe what your agent should do, then use AI to shape it into a skill."),me("custom-body").focus();return}let t=await R({path:"/api/skill/preview",schema:vc,body:{name:G("custom-name").value,description:G("custom-description").value,body:e}});_c({review:t,title:"Draft your skill with AI.",explanation:"Only the form fields below are sent. The result fills this form for you to edit; adding and applying it remain your choice.",confirm:"Send and draft",path:"/api/skill/generate",schema:wc,accept:({skill:r})=>{G("custom-name").value=r.name,G("custom-description").value=r.description,me("custom-body").value=r.body,Ze("AI draft ready. Edit the instructions before adding the skill to your build."),me("custom-body").focus()}})}function kc(){let e=_("custom-ai");if(!(e instanceof HTMLButtonElement))return;e.addEventListener("click",()=>{if(e.disabled)return;e.disabled=!0,Ze("Preparing your model request…"),sd().catch((t)=>{Ze(t instanceof Error?t.message:"Could not prepare an AI draft. Your text is unchanged.")}).finally(()=>{if(e.disabled=!1,_("custom-status").textContent==="Preparing your model request…")Ze("")})})}var cn=!1;async function Me(e){if(cn)return;cn=!0;let t=document.querySelectorAll("button, input, select, textarea"),r=Array.from(t,(n)=>({control:n,disabled:n.disabled}));for(let{control:n}of r)n.disabled=!0;try{await e()}finally{for(let{control:n,disabled:o}of r)n.disabled=o;cn=!1}}function Ie(e){_(e.id).addEventListener("click",()=>Me(e.action).catch(he))}function zc(){let e=document.createElement("template");e.innerHTML=`
67
+ <dialog id="review-dialog" aria-labelledby="review-title">
68
+ <div class="dialog-heading">
69
+ <div>
70
+ <p class="eyebrow">READY TO EQUIP</p>
71
+ <h2 id="review-title">Review your changes.</h2>
72
+ </div>
73
+ <button class="close-dialog quiet-button" aria-label="Close review">
74
+ ✕
75
+ </button>
76
+ </div>
77
+ <div id="review-content"></div>
78
+ <div class="dialog-actions">
79
+ <button class="close-dialog quiet-button">Keep editing</button>
80
+ <button id="apply" class="primary-button">Apply build</button>
81
+ </div>
82
+ </dialog>
83
+
84
+ <dialog id="custom-dialog" aria-labelledby="custom-title">
85
+ <div class="dialog-heading">
86
+ <h2 id="custom-title">Create a skill.</h2>
87
+ <button
88
+ class="close-dialog quiet-button"
89
+ aria-label="Close skill editor"
90
+ >
91
+ ✕
92
+ </button>
93
+ </div>
94
+ <form id="custom-form">
95
+ <label>
96
+ Skill name
97
+ <input
98
+ id="custom-name"
99
+ pattern="[a-z0-9]+(-[a-z0-9]+)*"
100
+ maxlength="48"
101
+ placeholder="review-with-evidence"
102
+ required
103
+ >
104
+ </label>
105
+ <label>
106
+ When should your agent use it?
107
+ <input
108
+ id="custom-description"
109
+ maxlength="300"
110
+ placeholder="Use when reviewing an implementation."
111
+ required
112
+ >
113
+ </label>
114
+ <label>
115
+ What should your agent do?
116
+ <textarea
117
+ id="custom-body"
118
+ rows="9"
119
+ maxlength="24000"
120
+ placeholder="Describe the decisions, steps, and evidence you expect."
121
+ required
122
+ ></textarea>
123
+ </label>
124
+ <p id="custom-status" class="review-message" role="status"></p>
125
+ <div class="dialog-actions">
126
+ <button id="custom-ai" type="button" class="quiet-button">✦ Use AI</button>
127
+ <button type="submit" class="primary-button">
128
+ Add to your build
129
+ </button>
130
+ </div>
131
+ </form>
132
+ </dialog>
133
+ `,document.body.append(e.content);for(let t of document.querySelectorAll("dialog"))Gt(t)}var ad=E({engine:Ne(["claude-code","codex","cursor-agent","pi"]),model:v().min(1).optional(),name:v()}),un=E({choices:U(ad),selected:Vr({engine:v().optional(),model:v().optional()})});function $c(){let e=null;Ie({id:"load-models",action:async()=>{e=await R({path:"/api/learning-models",schema:un});let t=ue("learning-model"),r=g({tag:"option",text:"Choose a configured model"});if(r.value="",r.disabled=!0,r.selected=!e.choices.some((n)=>n.engine===e?.selected.engine&&n.model===e?.selected.model),t.replaceChildren(r,...e.choices.map((n,o)=>{let i=g({tag:"option",text:n.name});return i.value=String(o),i.selected=n.engine===e?.selected.engine&&n.model===e?.selected.model,i})),e.choices.length===0)re({message:"Configure a model in your coding harness, then refresh models."})}}),ue("learning-model").addEventListener("change",()=>{let t=ue("learning-model").value;if(t==="")return;let r=e?.choices[Number(t)];if(!r)return;Me(async()=>{await R({path:"/api/learning-model",schema:Vr({saved:fe()}),body:{engine:r.engine,model:r.model}}),re({message:"Saved your learning model. Session learning follows the session model unless overridden.",success:!0})}).catch(he)})}var ln=v().min(1).max(200),cd=E({traits:U(ln).min(3).max(8),do:U(ln).min(2).max(8),dont:U(ln).min(2).max(8)}),ud=E({pullRequest:v().min(1).max(1500),reviewComment:v().min(1).max(700),commitMessage:v().min(1).max(200)}),Sc=E({profile:cd,samples:ud});var Kt=E({consent:fe(),allowed:fe(),voiceFile:E({path:v(),state:Ne(["missing","file","link"]),target:v().nullable()})}),dn=E({draft:Sc,destination:v(),sourceCount:nl().int().optional()}),Pc=E({path:v()});var ld={pullRequest:"Invented pull request",reviewComment:"Invented review comment",commitMessage:"Invented commit message"},Zc={traits:"Traits",do:"Do",dont:"Do not"};function Ic(){let e=g({tag:"dialog"}),t=g({tag:"h2",text:"Your writing voice"}),r=g({tag:"p",text:"shadowclone can read your own pull requests, review comments, and commit messages through your gh login, and ask your model to describe how you write. You see only that description and invented examples, never your writing itself."}),n=g({tag:"p",className:"voice-file"}),o=g({tag:"label",className:"voice-consent"}),i=g({tag:"input"}),s=g({tag:"button",className:"primary-button",text:"Read my writing and describe my voice"}),a=g({tag:"div",className:"voice-result"}),c=g({tag:"p",className:"review-message"}),u=g({tag:"button",className:"quiet-button",text:"Close"}),l=null,d=null,f=!1;e.className="voice-dialog",t.id="voice-title",e.setAttribute("aria-labelledby",t.id),c.setAttribute("role","status"),i.type="checkbox",i.id="voice-consent",o.append(i," Let shadowclone read my GitHub writing for this"),e.append(t,r,n,o,s,a,c,u),document.body.append(e);let m=async(P)=>{c.textContent=P.message,e.setAttribute("aria-busy","true");try{await P.action()}catch(L){c.textContent=L instanceof Error?L.message:"The voice request failed."}finally{e.setAttribute("aria-busy","false"),h()}},h=()=>{let P=l?.voiceFile.state!=="missing";i.checked=l?.consent??!1,i.disabled=!l?.allowed,s.disabled=!l?.consent,n.textContent=!l?"":!l.allowed?"Your managed policy does not allow shadowclone to read GitHub writing.":P?`${l.voiceFile.path} already exists${l.voiceFile.target?` as a link to ${l.voiceFile.target}`:""}. shadowclone will not change it.`:`Saving writes ${l.voiceFile.path}.`;for(let L of a.querySelectorAll("[data-action=save]"))L.disabled=P;for(let L of a.querySelectorAll("[data-action=rewrite]"))L.disabled=!f},b=()=>{let P=(L)=>[...a.querySelectorAll(`input[data-list=${L}]`)].map((V)=>V.value.trim()).filter(Boolean);return{traits:P("traits"),do:P("do"),dont:P("dont")}},w=(P)=>{if(a.replaceChildren(),f=!1,!d)return;a.append(g({tag:"p",className:"voice-source",text:`Described by ${P.destination}${P.sourceCount?` from ${P.sourceCount} pieces of your writing`:""}. Edit any line, then rewrite the samples.`}));for(let Z of["traits","do","dont"]){let K=g({tag:"fieldset"});K.append(g({tag:"legend",text:Zc[Z]}));for(let B of d.profile[Z]){let X=g({tag:"input"});X.value=B,X.dataset.list=Z,X.setAttribute("aria-label",`${Zc[Z]} line`),X.addEventListener("input",()=>{f=!0,h()}),K.append(X)}a.append(K)}for(let Z of["pullRequest","reviewComment","commitMessage"])a.append(g({tag:"h3",text:ld[Z]}),g({tag:"pre",text:d.samples[Z]}));let L=g({tag:"div",className:"dialog-actions"}),V=g({tag:"button",className:"quiet-button",text:"Discard"}),z=g({tag:"button",className:"quiet-button",text:"Rewrite the samples"}),k=g({tag:"button",className:"primary-button",text:"Save my voice"});z.dataset.action="rewrite",k.dataset.action="save",V.addEventListener("click",()=>{d=null,a.replaceChildren(),c.textContent="Discarded. Nothing was saved."}),z.addEventListener("click",()=>m({message:"Rewriting the samples with your fast model…",action:async()=>{let Z=await R({path:"/api/voice/rewrite",schema:dn,body:{profile:b()}});d=Z.draft,w({destination:Z.destination}),c.textContent="The samples now follow your edits."}})),k.addEventListener("click",()=>m({message:"Saving…",action:async()=>{if(!d)return;let Z=await R({path:"/api/voice/save",schema:Pc,body:{...d,profile:b()}});l=await R({path:"/api/voice/status",schema:Kt,body:{}}),c.textContent=`Saved ${Z.path}.`}})),L.append(V,z,k),a.append(L),h()};i.addEventListener("change",()=>m({message:i.checked?"Saving your consent…":"Turning reading off…",action:async()=>{l=await R({path:"/api/voice/consent",schema:Kt,body:{enabled:i.checked}}),c.textContent=l.consent?"shadowclone may read your GitHub writing.":"Reading is off. Collected writing was discarded."}})),s.addEventListener("click",()=>m({message:"Reading your writing and asking your model. This can take a minute…",action:async()=>{let P=await R({path:"/api/voice/capture",schema:dn,body:{}});d=P.draft,w(P),c.textContent="Review the description and the invented examples."}})),u.addEventListener("click",()=>e.close());let S=g({tag:"button",className:"quiet-button",text:"My voice"});S.addEventListener("click",()=>{e.showModal(),m({message:"",action:async()=>{l=await R({path:"/api/voice/status",schema:Kt,body:{}})}}).catch(he)}),document.querySelector(".toolbar")?.append(S)}zc();$c();Ic();function Le(){Vt({choose:(e)=>{if(y.activeId=e.id,e.owner!=="provider")Re(e);Le()},chooseGroup:(e)=>{Da(e),Le()}}),Fa({rerender:Le,companion:Yr}),Ha(),_("undo").hidden=y.view?.revisionId===null}async function dd(e){let t=await R({path:`/api/build?scope=${e}`,schema:Ma});if(y.view=t,y.input=structuredClone(t.input),y.dirty=!1,!t.items.some((n)=>n.id===y.activeId))y.activeId=t.items.find(D)?.id??t.items[0]?.id??"";ue("scope").value=e;let r={global:"Your personal build follows you across coding agents.",private:"Only this repository. Stored privately on your machine; shared requirements stay in force.",shared:"A portable build for this repository. Review every file before sharing it with your team."};_("scope-note").textContent=r[e],_("library-note").hidden=t.libraryEnabled,Le()}async function nt(e){let t=_("constellation-status"),r=_("retry-build");if(!r.hidden)re({message:""});t.hidden=!1,r.hidden=!0,_("constellation-status-text").textContent="Loading your skills…",_("constellation").setAttribute("aria-busy","true");try{await dd(e),t.hidden=!0}catch(n){throw _("constellation-status-text").textContent="Your skills couldn't be loaded. Retry to reconnect to the local editor.",r.hidden=!1,ue("scope").value=y.input.scope,n}finally{_("constellation").setAttribute("aria-busy","false")}}Ie({id:"retry-build",action:()=>nt(y.input.scope)});Ie({id:"review",action:Ya});Ie({id:"apply",action:async()=>{await Xa(),await nt(y.input.scope)}});Ie({id:"undo",action:async()=>{await Qa(),await nt(y.input.scope)}});_("new-skill").addEventListener("click",()=>Yr());_("custom-form").addEventListener("submit",(e)=>{e.preventDefault();try{ja(),Le()}catch(t){Ze(t instanceof Error?t.message:"The skill could not be added.")}});G("search").addEventListener("input",()=>{y.search=G("search").value,Le()});ue("scope").addEventListener("change",()=>{if(y.dirty&&!window.confirm("Discard the draft and switch build scope?")){ue("scope").value=y.input.scope;return}let e=ze.parse(ue("scope").value);Me(()=>nt(e)).catch(he)});for(let e of document.querySelectorAll(".close-dialog"))e.addEventListener("click",()=>e.closest("dialog")?.close());window.addEventListener("beforeunload",(e)=>{if(y.dirty)e.preventDefault()});var Oc=ze.safeParse(new URLSearchParams(location.search).get("scope")??"global");xc();fc();Wa();kc();Me(()=>nt(Oc.success?Oc.data:"global")).catch(he);
package/evals.md CHANGED
@@ -10,9 +10,9 @@ Each task checks one preference family. The score averages repetitions and tasks
10
10
  | ----------------------------------------- | ----------: | ---------: | ----------------: | --------------: |
11
11
  | Agent alone | 77.3% | 59.0% | 56.5% | 53.2% |
12
12
  | Existing user skills | 85.2% | 80.6% | 76.4% | 73.6% |
13
- | Existing skills + Shadowclone routing | 86.1% | 72.7% | 76.9% | 75.9% |
13
+ | Existing skills + shadowclone routing | 86.1% | 72.7% | 76.9% | 75.9% |
14
14
  | Existing skills + handwritten preferences | 92.4% | 81.2% | 91.7% | 86.1% |
15
- | Existing skills + Shadowclone learning | 89.4% | 83.3% | 90.0% | 82.9% |
15
+ | Existing skills + shadowclone learning | 89.4% | 83.3% | 90.0% | 82.9% |
16
16
 
17
17
  Learning beats existing user skills on all four models. Handwritten preferences score higher than learned ones on GPT 6.1 Sol, Sonnet, and Opus, but not on GPT 6 Luna. Learning delivery and model behavior affect this comparison.
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shadowclone/cli",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "description": "Turns how you work into a portable, tested environment for the coding agents you already use.",
6
6
  "keywords": [
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "shadowclone",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "Set up and maintain portable coding-agent skills with explicit local consent.",
5
5
  "author": {
6
- "name": "Shadowclone"
6
+ "name": "shadowclone"
7
7
  },
8
8
  "homepage": "https://shadowclone.co",
9
9
  "repository": "https://github.com/theonly1me/shadowclone",