pi-roundtable-web 0.23.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +18 -1
  3. package/dist/chunk-character-creator-660d2t6p.js +1 -0
  4. package/dist/chunk-connectors-d19v8cjc.js +1 -0
  5. package/dist/chunk-conversations-4cmexmqq.js +1 -0
  6. package/dist/chunk-entry-8xpx35ef.js +1 -0
  7. package/dist/chunk-index-19g8jmr8.js +2 -0
  8. package/dist/chunk-index-362dfedj.js +1 -0
  9. package/dist/chunk-index-6g69tqt0.js +47 -0
  10. package/dist/chunk-index-89q2qdkj.css +1 -0
  11. package/dist/chunk-index-9tvf6es7.js +41 -0
  12. package/dist/{chunk-index-kkydgsrs.js → chunk-index-p8h0e861.js} +2 -2
  13. package/dist/chunk-index-xw5hhmfq.js +2 -0
  14. package/dist/chunk-notes-fefwds14.js +1 -0
  15. package/dist/chunk-overview-bxpwpmn6.js +1 -0
  16. package/dist/chunk-skills-pce3zgxy.js +1 -0
  17. package/dist/{chunk-table-ypqdgf66.js → chunk-table-zmpbrfvz.js} +1 -1
  18. package/dist/chunk-table2d-ac2gez71.js +1 -0
  19. package/dist/chunk-table3d-g258jemr.js +4229 -0
  20. package/dist/chunk-transcript-yhtjp3pd.js +1 -0
  21. package/dist/chunk-zh-tw-anqhqpaz.js +1 -0
  22. package/dist/index.html +1 -1
  23. package/dist/sw.js +1 -1
  24. package/package.json +2 -2
  25. package/src/features.ts +6 -1
  26. package/src/i18n/index.ts +13 -0
  27. package/src/i18n/locale.ts +11 -0
  28. package/src/i18n/zh-tw.ts +696 -0
  29. package/dist/chunk-character-creator-6vdshaj9.js +0 -1
  30. package/dist/chunk-connectors-s33pc7b8.js +0 -1
  31. package/dist/chunk-conversations-zpztvesk.js +0 -1
  32. package/dist/chunk-entry-th44mrfe.js +0 -1
  33. package/dist/chunk-index-4w1rf52n.js +0 -47
  34. package/dist/chunk-index-5pnpf9v5.js +0 -41
  35. package/dist/chunk-index-dkvf85c7.css +0 -1
  36. package/dist/chunk-index-mtcervy3.js +0 -2
  37. package/dist/chunk-index-x3cf4dsz.js +0 -1
  38. package/dist/chunk-notes-ytw8qcfk.js +0 -1
  39. package/dist/chunk-overview-fbea32dq.js +0 -1
  40. package/dist/chunk-skills-58f4qz3b.js +0 -1
  41. package/dist/chunk-table2d-bk1khqzq.js +0 -1
  42. package/dist/chunk-table3d-5vpp4bzh.js +0 -4229
  43. package/dist/chunk-transcript-nabrrayp.js +0 -1
@@ -1 +0,0 @@
1
- import{M,L,l,W,Z}from"./chunk-index-4w1rf52n.js";import{v,j,r,I,b,s,i,t,f,e,n,ie,S,C,g,q,a,u,N,D,P}from"./chunk-index-5pnpf9v5.js";var ye={"hat.none":"No hat","hat.goggcap":"Goggle cap","hat.tallcap":"Tall cap","hat.softcap":"Soft cap","hat.hardhat":"Hard hat","hat.fcap":"Flat cap","hat.winghelm":"Winged helm","hat.helm":"Helm","hat.mortar":"Mortarboard","hat.kettle":"Kettle hat","hat.cavalier":"Cavalier hat","hat.toque":"Chef's toque","hair.none":"No hair","beard.none":"No beard","accessory.none":"No accessory","prop.beads":"Prayer beads","prop.marotte":"Marotte","prop.map":"Map","outfit.surplice":"Surplice","outfit.overalls":"Overalls","hair.bob":"Bob","hair.bun":"Bun","hair.ponytail":"Ponytail"},se=(o)=>o.charAt(0).toUpperCase()+o.slice(1);function R(o,d){let p=`character.${o}.${d}`,y=t(p);if(y!==p)return y;if(o==="class")return l.classes[d]?.label??se(d);return ye[`${o}.${d}`]??se(d)}function oe(o){let d=`character.jobs.${o}`,p=t(d);return p!==d?p:l.classes[o]?.jobs??""}var Q=[{field:"hat",title:"Hat",ids:l.hats},{field:"outfit",title:"Outfit",ids:l.outfits},{field:"prop",title:"Prop",ids:l.props},{field:"hair",title:"Hair",ids:l.hair},{field:"beard",title:"Beard",ids:["none",...l.beards]},{field:"accessory",title:"Accessory",ids:["none",...l.accessories]}],ke=new Set(["class","colors","palette","build","skin","hairColor",...Q.map((o)=>o.field)]),ue=Object.keys(l.palettes),le={idle:"Idle",thinking:"Thinking",working:"Working",waiting:"Waiting for you",done:"Done",error:"Error",sleepy:"Sleepy"},ve={slim:"Slim",regular:"Regular",stout:"Stout"};function fe(o){return{class:o.class,outfit:o.outfit,hat:o.hat,prop:o.prop,hair:o.hair,beard:o.beard,accessory:o.accessory,build:o.build,skin:o.skin,hairColor:o.hairColor,colors:{...o.colors}}}var ce=(o)=>JSON.stringify(fe(o)),E=(o)=>o[Math.floor(Math.random()*o.length)];function Ce(){return{class:E(M),outfit:E(l.outfits),hat:E(l.hats),prop:E(l.props),hair:E(l.hair),beard:E(["none",...l.beards]),accessory:E(["none",...l.accessories]),build:E(["slim","regular","stout"]),skin:E([0,1,2,3,4,5]),hairColor:E(l.hairColors),palette:E(ue)}}var me=v(function(d){return n("button",{type:"button",className:"creator-tile","aria-pressed":d.pressed,title:d.hint?`${d.label} — ${d.hint}`:d.label,onClick:d.onPick,...d.data,children:[e(S,{spec:d.spec,size:d.size,live:!1}),e("span",{children:d.label})]})});function Se(o,d,p){let y=JSON.stringify({...o,[d]:0});return b(()=>p.map((m)=>({...o,[d]:m})),[y,d,p])}function Ne(){let o=s(null),[d,p]=i();return r(()=>{let y=o.current;if(!y)return;let m=()=>{let A=y.scrollLeft>1,H=y.scrollLeft+y.clientWidth<y.scrollWidth-1;p(A&&H?"both":H?"end":A?"start":void 0)};m(),y.addEventListener("scroll",m,{passive:!0});let k=typeof ResizeObserver>"u"?void 0:new ResizeObserver(m);return k?.observe(y),()=>{y.removeEventListener("scroll",m),k?.disconnect()}},[]),[o,d]}function Le(o){let{part:d}=o,p=Se(o.shown,d.field,d.ids),[y,m]=Ne();return e("div",{className:"creator-strip",ref:y,"data-more":m,children:d.ids.map((k,A)=>e(me,{data:{[`data-${d.field}`]:k},spec:p[A],size:44,label:R(d.field,k),pressed:o.draft[d.field]===k,onPick:()=>o.onPick(k)},k))})}function V(o){return e("button",{type:"button",className:"creator-swatch","aria-pressed":o.pressed,"aria-label":o.label,title:o.label,style:{background:o.background},onClick:o.onPick,...o.data})}function F(o){return n("div",{className:"creator-field","data-field":o.field,children:[o.title?e("h3",{children:o.title}):null,o.children,o.error?e("p",{className:"field-error",role:"alert",children:o.error}):null]})}function Ge(o){let[d,p]=i(o.character),y=j(d),[m,k]=i({}),[A,H]=i(!1),[z,he]=i("idle"),[X,K]=i(),[G,Y]=i(),x=N("(max-width: 719px)"),ee=s(null),_=I(),be=D(d),O=ce(d)!==ce(o.character);r(()=>p(o.character),[o.character]),r(()=>{if(!O)return;let c=(w)=>w.preventDefault(),h=(w)=>{if(w.button!==0||w.metaKey||w.ctrlKey||w.shiftKey||w.altKey)return;let B=w.target instanceof Element?w.target.closest("a"):null;if(!B||B.target||B.hasAttribute("download"))return;if(ee.current?.contains(B))return;w.preventDefault(),w.stopPropagation(),K({kind:"link",anchor:B})},U=ie((w)=>K({kind:"navigate",proceed:w}));return window.addEventListener("beforeunload",c),document.addEventListener("click",h,!0),()=>{U(),window.removeEventListener("beforeunload",c),document.removeEventListener("click",h,!0)}},[O]);let T=(c)=>{k({}),p((h)=>W(c,h))},ge=async()=>{H(!0),k({});try{let c=await a.setCharacter(o.name,fe(d));o.onSaved(c),g(t("Saved."))}catch(c){let h=c instanceof q&&c.field?c.field.split(".")[0]:void 0,U=h&&ke.has(h)?h:"*";k({[U]:u(c)})}finally{H(!1)}},pe=async()=>{let c=X;if(p(o.character),k({}),c?.kind==="link")setTimeout(()=>c.anchor.click(),0);else if(c?.kind==="navigate")c.proceed()},te=e(F,{field:"class",title:t("Class"),error:m.class,children:e("div",{className:"creator-grid",children:M.map((c)=>e(Pe,{id:c,base:y,pressed:d.class===c,onPick:()=>T({class:c,colors:d.colors})},c))})}),ae=n(F,{field:"colors",title:t("Colors"),error:m.colors??m.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),ue.map((c)=>{let h=l.palettes[c];return e(V,{data:{"data-palette":c},label:R("palette",c),pressed:d.palette===c,background:`linear-gradient(135deg, ${h.primary} 52%, ${h.trim} 52%)`,onPick:()=>T({palette:c})},c)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((c)=>n("label",{children:[e("span",{children:c==="primary"?t("Primary (the accent)"):c==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:d.colors[c],onChange:(h)=>T({colors:{[c]:h.target.value}})})]},c))})]}),re=Q.map((c)=>e(F,{field:c.field,title:t(c.title),error:m[c.field],children:e(Le,{part:c,draft:d,shown:y,onPick:(h)=>T({[c.field]:h})})},c.field)),ne=n(f,{children:[e(F,{field:"build",title:t("Build"),error:m.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((c)=>n("label",{"data-checked":d.build===c,children:[e("input",{type:"radio",name:`${_}-build`,checked:d.build===c,onChange:()=>T({build:c})}),de(c)]},c))]})}),e(F,{field:"skin",title:t("Skin tone"),error:m.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),l.skins.map((c,h)=>e(V,{data:{"data-skin":String(h)},label:t("Skin tone {n}",{n:h+1}),pressed:d.skin===h,background:c,onPick:()=>T({skin:h})},c))]})}),e(F,{field:"hairColor",title:t("Hair color"),error:m.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),l.hairColors.map((c,h)=>e(V,{data:{"data-hair-color":c},label:t("Hair color {n}",{n:h+1}),pressed:d.hairColor===c,background:c,onPick:()=>T({hairColor:c})},c)),e("input",{type:"color","aria-label":t("Hair color"),value:d.hairColor,onChange:(c)=>T({hairColor:c.target.value})})]})})]}),J=[{id:"class",title:t("Class"),summary:R("class",d.class),error:m.class,node:te},{id:"colors",title:t("Colors"),summary:d.palette?R("palette",d.palette):d.colors.primary,error:m.colors??m.palette,node:ae},...Q.map((c,h)=>({id:c.field,title:t(c.title),summary:R(c.field,d[c.field]),error:m[c.field],node:re[h]})),{id:"body",title:t("Body"),summary:de(d.build),error:m.build??m.skin??m.hairColor,node:ne}];return n("form",{ref:ee,className:"creator",style:be,"aria-labelledby":_,onSubmit:(c)=>{if(c.preventDefault(),O&&!A)ge()},children:[e("h2",{id:_,className:"visually-hidden",children:t("Character of {name}",{name:o.displayName})}),n("div",{className:"creator-preview",children:[e(S,{spec:d,name:o.name,state:z,size:176,label:t("{name}, {state}",{name:o.displayName,state:t(le[z])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>he((c)=>L[(L.indexOf(c)+1)%L.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(le[z])})]}),n("div",{className:"creator-body",children:[m["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:m["*"]}):null,x?e("ul",{className:"creator-sections",children:J.map((c)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>Y(c.id),children:[e("strong",{children:c.title}),e("span",{className:"meta",children:c.summary}),c.error?e("span",{className:"field-error",role:"alert",children:c.error}):null]})},c.id))}):n(f,{children:[te,ae,re,ne]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{k({}),p(Z({name:o.name,displayName:o.displayName,prompt:o.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>T(Ce()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(O)K({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!O||A,children:A?t("Saving…"):t("Save")})]})]}),e(C,{open:x&&G!==void 0,title:J.find((c)=>c.id===G)?.title??"",onClose:()=>Y(void 0),children:e("div",{className:"stack",children:J.find((c)=>c.id===G)?.node})}),e(P,{open:X!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>K(void 0),onConfirm:pe,children:e("p",{children:t("The new look for {name} has not been saved.",{name:o.displayName})})})]})}var de=(o)=>t(ve[o]);function Pe(o){let d=o.base.colors,p=b(()=>W({class:o.id,colors:d}),[o.id,d]);return e(me,{data:{"data-class":o.id},spec:p,size:56,label:R("class",o.id),hint:oe(o.id),pressed:o.pressed,onPick:o.onPick})}export{Ge as CharacterCreator};
@@ -1 +0,0 @@
1
- import{t,f,e,n,h,o,p,d,a,m,x}from"./chunk-index-5pnpf9v5.js";function N(){let{connectorAdminUrl:c}=m(),{data:s,error:l}=x(()=>a.connectors(),"connectors");return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Connectors")}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the assistant.")})]}),c?e("a",{href:c,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),l?e(o,{message:l}):null,!s&&!l?e(h,{}):null,s?n(f,{children:[e("h3",{children:t("Upstream gateways")}),s.gateways.length===0?e(p,{children:t("No gateways.")}):null,s.gateways.map((r)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:r.name}),e(d,{children:r.enabled?t("Enabled"):t("Disabled")}),e(d,{tone:r.reachable?"plain":"warn",children:r.reachable?t("Reachable"):t("Unreachable")}),e(d,{children:t("{count} tools",{count:r.tools})})]})},r.name)),e("h3",{children:t("Virtual servers")}),s.servers.length===0?e(p,{children:t("No virtual servers.")}):null,s.servers.map((r)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:r.name}),e(d,{children:t("{count} tools",{count:r.tools.length})})]}),n("p",{children:[t("Used by"),": ",r.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:r.tools.map((i)=>e("li",{children:i},i))})]})]},r.name))]}):null]})}export{N as ConnectorsPage};
@@ -1 +0,0 @@
1
- import{t,f,e,n,c,h,o,p,d,a,m,_,A,w,R,O,H,x}from"./chunk-index-5pnpf9v5.js";var y=[{kind:"owner",title:"Owner channels",note:"Direct messages and channels where the owner talks to the assistant."},{kind:"agent",title:"Agent channels",note:"The agent server's one-to-one channels."},{kind:"group",title:"Group channels",note:"The agent server's group channels."},{kind:"outside",title:"Outside agents",note:"Conversations an agent outside Discord holds over MCP."},{kind:"plugin",title:"Plugin conversations",note:"Conversations a plugin runs, such as a web chat, as the host recorded them."}];function F(){let{timeZone:s}=m(),{now:i}=_(),{data:l,error:r}=x(()=>a.conversations(),"conversations"),v=l?.conversations;if(!v)return r?e(o,{message:r}):e(h,{});return n(f,{children:[r?e(o,{message:r}):null,y.map((u)=>{let k=v.filter((g)=>g.kind===u.kind);return n("section",{className:"stack",children:[e("h2",{children:t(u.title)}),e("p",{className:"hint",children:t(u.note)}),k.length===0?e(p,{children:t("None stored.")}):null,k.map((g)=>e(C,{item:g,now:i,timeZone:s},g.key))]},u.kind)})]})}function C(s){let{item:i}=s,l=O(i.channel,i.id),r=H(i);return n("a",{className:"card card-link",href:c("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:r}),i.busy>0?e(d,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(d,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${w(i.startedAt,s.timeZone)} · `:l.detail?`${l.detail} · `:"",i.principal?`${t(i.visibility==="private"?"Private to {name}":"Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",A(i.lastActive,s.now,s.timeZone)," ·"," ",R(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{F as ConversationsPage};
@@ -1 +0,0 @@
1
- import{E}from"./chunk-index-5pnpf9v5.js";function y(){try{let l=document.createElement("canvas");return!!(l.getContext("webgl2")||l.getContext("webgl"))}catch{return!1}}function x(l,n){return[l,n.includes("?")?n.slice(n.indexOf("?")):""].some((d)=>{let a=new URLSearchParams(d).get("nogl");return a!==null&&a!=="0"&&a!=="false"})}async function A(l,n,g){let d=n.variant==="compact",a=new Map,v=(e)=>{a.clear();for(let t of e)a.set(t.id,{...t})};v(n.seats);let m={t:n.theme,s:n.scheme},s=null,r=document.createElement("div");r.className="rt-table",r.dataset.variant=d?"compact":"full";let u=document.createElement("div");u.className="rt-table-stage",r.appendChild(u);let i=null,f=!1,T=()=>!d&&(Boolean(n.listBelow)||f);l.appendChild(r);let c=new Map,b=()=>{if(!T()){i?.remove(),i=null,c.clear(),delete r.dataset.list;return}if(!i)i=document.createElement("ul"),i.className="rt-table-list",i.setAttribute("aria-label","Round table"),r.appendChild(i),r.dataset.list="";for(let e of[...c.keys()])if(!a.has(e))c.delete(e);for(let e of a.values()){let t=c.get(e.id);if(!t){t=document.createElement("button"),t.type="button";let o=e.id;t.addEventListener("click",()=>{let S=a.get(o);if(S)n.onSeatClick({id:S.id,name:S.name})}),c.set(e.id,t)}t.textContent=`${e.name} (${e.state??"idle"})`,t.style.setProperty("--seat",e.color)}i.replaceChildren(...[...a.values()].map((e)=>{let t=document.createElement("li"),o=c.get(e.id);if(o)t.appendChild(o);return t}))};b();let h=(e)=>{f=!e,b(),n.onNames?.(e)},p=async()=>{let{createTable2D:e}=await (E("bk1khqzq"),import("./chunk-table2d-bk1khqzq.js"));s=e(u,{...n,theme:m.t,scheme:m.s,seats:[...a.values()]}),h(!0)},w=async()=>{let{createTable3D:e}=await (E("5vpp4bzh"),import("./chunk-table3d-5vpp4bzh.js"));s=e(u,{...n,theme:m.t,scheme:m.s,seats:[...a.values()],onNames:h},()=>{s?.dispose(),p()})};if(d||g==="svg"||g!=="webgl"&&(x(location.search,location.hash)||!y()))await p();else try{await w()}catch{await p()}return{get kind(){return s.kind},setTheme(e,t){m={t:e,s:t},s.setTheme(e,t)},setSeats(e){v(e),b(),s.setSeats(e)},setState(e,t){let o=a.get(e);if(o)o.state=t;b(),s.setState(e,t)},setAvatar(e,t){let o=a.get(e);if(o)o.avatarSvg=t;return s.setAvatar(e,t)},setReducedMotion:(e)=>s.setReducedMotion(e),resetCamera:()=>s.resetCamera(),getStats:()=>s.getStats(),dispose(){s?.dispose(),r.remove()}}}export{A as mountRoundTable};
@@ -1,47 +0,0 @@
1
- function he(e){if(e&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.values(e))he(r)}return e}var M=["wizard","knight","scholar","smith","ranger","bard","alchemist","healer","steward","navigator","seer","scribe","engineer","druid","innkeeper","sentinel","envoy","rogue","monk","falconer","shipwright","jester","paladin","archivist"],q=["robe","scholar","armor","plate","apron","chef","cloak","tunic","coat","overalls","vest","habit","surplice","motley","sailor"],X=["none","wizard","helm","mortar","goggcap","hood","beret","goggles","coif","tallcap","tricorn","turban","softcap","hardhat","wreath","toque","kettle","cavalier","cowl","headband","fcap","sailor","jester","winghelm"],G=["staff","shield","scroll","hammer","bow","lute","flask","quill","tome","bell","keys","map","telescope","wrench","spade","ladle","lantern","seal","dagger","beads","bird","anchor","marotte","sword"],Y=["none","short","bob","long","bun","curly","ponytail","braid"],me=["full","mustache","goatee"],re=[...me,"none"],ge=["glasses","freckles","scar"],oe=[...ge,"none"],D=["slim","regular","stout"],ae=[0,1,2,3,4,5],K=["neutral","happy","thinking","concerned","apologetic","surprised","proud","amused","curious","sympathetic","playful","determined","sleepy"],L=["idle","thinking","working","waiting","done","error","sleepy"],J=he({idle:"neutral",thinking:"thinking",working:"determined",waiting:"curious",done:"proud",error:"apologetic",sleepy:"sleepy"}),ke={azure:{primary:"#3b6fd8",secondary:"#eef2ff",trim:"#f0c04a"},gules:{primary:"#d8473d",secondary:"#fff1e4",trim:"#f0c04a"},vert:{primary:"#2f9e6b",secondary:"#eefbea",trim:"#f0c04a"},purpure:{primary:"#7d52cc",secondary:"#f1e9ff",trim:"#f0c04a"},amber:{primary:"#e2a02a",secondary:"#fff6dc",trim:"#d5dbe8"},sable:{primary:"#454a5c",secondary:"#e9ecf4",trim:"#f0c04a"},teal:{primary:"#1f9aa6",secondary:"#e6fbfa",trim:"#f0c04a"},rose:{primary:"#d6507f",secondary:"#ffeef3",trim:"#d5dbe8"}},Ye=["#f7d6b8","#eab98c","#d4a070","#b9784c","#8e5b3c","#5c3a26"],Ue=["#2b2233","#6a4a33","#b0562f","#e0b45a","#aeb4c3","#f1f3fa"];function k(e){let{palette:r,...t}=e;return{...t,colors:{...ke[r]},palette:r}}var Ke={wizard:{label:"Wizard",jobs:"coordinator, planner, main assistant",keywords:["coordinat","orchestrat","lead","chief","manager","協調","統籌","總管","主管"],preset:k({outfit:"robe",hat:"wizard",prop:"staff",hair:"none",beard:"full",accessory:"none",build:"regular",skin:0,hairColor:"#f1f3fa",palette:"azure"})},knight:{label:"Knight",jobs:"reviewer, QA gate, guardian",keywords:["review","qa","quality","gate","lint","guardian","審查","審核","把關","品質"],preset:k({outfit:"armor",hat:"helm",prop:"shield",hair:"short",beard:"none",accessory:"none",build:"regular",skin:1,hairColor:"#6a4a33",palette:"gules"})},scholar:{label:"Scholar",jobs:"researcher, literature review",keywords:["research","literature","paper","study","survey","academic","研究","文獻","論文","學者"],preset:k({outfit:"scholar",hat:"mortar",prop:"scroll",hair:"bun",beard:"none",accessory:"glasses",build:"slim",skin:2,hairColor:"#2b2233",palette:"purpure"})},smith:{label:"Smith",jobs:"coder, builder, refactorer",keywords:["coder","coding","code","builder","implement","develop","refactor","software","程式","開發","實作","重構"],preset:k({outfit:"apron",hat:"goggcap",prop:"hammer",hair:"short",beard:"none",accessory:"none",build:"stout",skin:3,hairColor:"#7a4a2a",palette:"amber"})},ranger:{label:"Ranger",jobs:"scout, web search, crawler",keywords:["scout","search","crawl","explore","browse","web","搜尋","爬蟲","偵查","探索"],preset:k({outfit:"cloak",hat:"hood",prop:"bow",hair:"none",beard:"none",accessory:"freckles",build:"slim",skin:1,hairColor:"#a8683a",palette:"vert"})},bard:{label:"Bard",jobs:"writer, announcer, copywriter",keywords:["writer","write","copywrit","announce","content","blog","story","poet","寫作","文案","文章","公告"],preset:k({outfit:"tunic",hat:"beret",prop:"lute",hair:"long",beard:"none",accessory:"none",build:"regular",skin:4,hairColor:"#c0453d",palette:"rose"})},alchemist:{label:"Alchemist",jobs:"data analyst, ETL, transformer",keywords:["analyst","data","etl","transform","convert","spreadsheet","資料","數據","轉換","分析師"],preset:k({outfit:"coat",hat:"goggles",prop:"flask",hair:"curly",beard:"none",accessory:"none",build:"regular",skin:5,hairColor:"#2b2233",palette:"teal"})},healer:{label:"Healer",jobs:"debugger, fixer, support",keywords:["debug","fix","doctor","heal","bug","repair","triage","support","醫","修","除錯","診斷"],preset:k({outfit:"surplice",hat:"coif",prop:"bell",hair:"none",beard:"none",accessory:"none",build:"stout",skin:5,hairColor:"#2b2233",palette:"rose"})},steward:{label:"Steward",jobs:"ops, billing, access keys",keywords:["ops","billing","admin","account","access","finance","invoice","procure","帳務","財務","營運","請款","管理"],preset:k({outfit:"vest",hat:"tallcap",prop:"keys",hair:"short",beard:"mustache",accessory:"none",build:"stout",skin:0,hairColor:"#8a8f9c",palette:"sable"})},navigator:{label:"Navigator",jobs:"planner, routing, roadmap",keywords:["planner","planning","roadmap","route","routing","navigat","itinerary","規劃","路線","導航","行程"],preset:k({outfit:"coat",hat:"tricorn",prop:"map",hair:"ponytail",beard:"none",accessory:"none",build:"slim",skin:2,hairColor:"#6a4a33",palette:"azure"})},seer:{label:"Seer",jobs:"forecaster, monitoring, analytics",keywords:["forecast","monitor","predict","analytics","metric","observab","trend","預測","監控","觀測","趨勢"],preset:k({outfit:"habit",hat:"turban",prop:"telescope",hair:"none",beard:"none",accessory:"none",build:"slim",skin:3,hairColor:"#2b2233",palette:"purpure"})},scribe:{label:"Scribe",jobs:"documentation, notes, minutes",keywords:["document","docs","notes","minutes","transcri","changelog","文件","記錄","紀錄","筆記","會議"],preset:k({outfit:"scholar",hat:"softcap",prop:"quill",hair:"short",beard:"none",accessory:"glasses",build:"regular",skin:1,hairColor:"#3a2f45",palette:"sable"})},engineer:{label:"Engineer",jobs:"devops, infra, CI",keywords:["infra","devops","ci","sre","platform","kubernetes","server","cluster","維運","運維","基礎設施","伺服器"],preset:k({outfit:"overalls",hat:"hardhat",prop:"wrench",hair:"braid",beard:"none",accessory:"none",build:"regular",skin:4,hairColor:"#2b2233",palette:"amber"})},druid:{label:"Druid",jobs:"cleanup, data hygiene, maintenance",keywords:["cleanup","clean","hygiene","maintenance","garbage","prune","tidy","清理","整理","維護","保養"],preset:k({outfit:"cloak",hat:"wreath",prop:"spade",hair:"long",beard:"none",accessory:"none",build:"regular",skin:4,hairColor:"#6a4a33",palette:"vert"})},innkeeper:{label:"Innkeeper",jobs:"concierge, onboarding, scheduler",keywords:["concierge","onboard","scheduler","schedule","host","welcome","reception","接待","迎賓","排程","新人"],preset:k({outfit:"chef",hat:"toque",prop:"ladle",hair:"none",beard:"mustache",accessory:"none",build:"stout",skin:2,hairColor:"#2b2233",palette:"gules"})},sentinel:{label:"Sentinel",jobs:"security, on-call, alerts",keywords:["security","alert","incident","oncall","on-call","vulnerab","patrol","資安","安全","告警","警報","值班"],preset:k({outfit:"plate",hat:"kettle",prop:"lantern",hair:"none",beard:"none",accessory:"scar",build:"stout",skin:5,hairColor:"#2b2233",palette:"sable"})},envoy:{label:"Envoy",jobs:"email, partner comms, notifications",keywords:["email","mail","partner","notif","message","outreach","comms","信件","郵件","通知","聯絡"],preset:k({outfit:"tunic",hat:"cavalier",prop:"seal",hair:"bun",beard:"none",accessory:"none",build:"regular",skin:1,hairColor:"#aeb4c3",palette:"purpure"})},rogue:{label:"Rogue",jobs:"pen-tester, auditor, intel",keywords:["pentest","pen-test","penetration","auditor","audit","intel","exploit","osint","滲透","稽核","情報","紅隊"],preset:k({outfit:"cloak",hat:"cowl",prop:"dagger",hair:"none",beard:"none",accessory:"scar",build:"slim",skin:0,hairColor:"#2b2233",palette:"sable"})},monk:{label:"Monk",jobs:"long-running jobs, batch, patience",keywords:["long-running","batch","patient","background","overnight","meditat","cron","長時間","批次","批量","耐心"],preset:k({outfit:"habit",hat:"headband",prop:"beads",hair:"none",beard:"none",accessory:"none",build:"regular",skin:3,hairColor:"#2b2233",palette:"amber"})},falconer:{label:"Falconer",jobs:"retrieval, fetch, RAG lookup",keywords:["retriev","fetch","rag","lookup","vector","embedding","檢索","擷取","抓取","查詢"],preset:k({outfit:"cloak",hat:"fcap",prop:"bird",hair:"short",beard:"goatee",accessory:"none",build:"slim",skin:4,hairColor:"#2b2233",palette:"vert"})},shipwright:{label:"Shipwright",jobs:"release, build pipeline, packaging",keywords:["release","ship","packag","publish","deploy","pipeline","發版","發布","打包","上線","部署"],preset:k({outfit:"sailor",hat:"sailor",prop:"anchor",hair:"short",beard:"goatee",accessory:"none",build:"stout",skin:2,hairColor:"#e0b45a",palette:"azure"})},jester:{label:"Jester",jobs:"brainstorm, ideation, humor",keywords:["brainstorm","ideation","idea","humor","joke","creative","fun","腦力激盪","發想","創意","幽默","點子"],preset:k({outfit:"motley",hat:"jester",prop:"marotte",hair:"none",beard:"none",accessory:"freckles",build:"slim",skin:0,hairColor:"#b0562f",palette:"gules"})},paladin:{label:"Paladin",jobs:"compliance, policy, approvals",keywords:["compliance","policy","approval","approve","govern","legal","ethic","合規","法遵","核准","政策","規範"],preset:k({outfit:"plate",hat:"winghelm",prop:"sword",hair:"none",beard:"none",accessory:"none",build:"regular",skin:5,hairColor:"#2b2233",palette:"amber"})},archivist:{label:"Archivist",jobs:"knowledge base, indexing, memory",keywords:["knowledge","archive","index","memory","wiki","catalog","library","知識","索引","記憶","歸檔","典藏"],preset:k({outfit:"scholar",hat:"none",prop:"tome",hair:"bun",beard:"none",accessory:"glasses",build:"regular",skin:2,hairColor:"#e4e7f0",palette:"teal"})}},l=he({classes:Ke,outfits:q,hats:X,props:G,hair:Y,beards:me,accessories:ge,palettes:ke,skins:Ye,hairColors:Ue}),St=Object.keys(ke);var ye=(e)=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");function $e(e){let r=(t)=>Number.parseInt(e.slice(t,t+2),16);return[r(1),r(3),r(5)]}function We([e,r,t]){return`#${ye(e)}${ye(r)}${ye(t)}`}function P(e,r,t){let o=$e(e),a=$e(r);return We([o[0]+(a[0]-o[0])*t,o[1]+(a[1]-o[1])*t,o[2]+(a[2]-o[2])*t])}var U=(e,r)=>P(e,"#ffffff",r),z=(e,r)=>P(e,"#1a1330",r);function xe(e){let[r,t,o]=$e(e).map((a)=>{let i=a/255;return i<=0.03928?i/12.92:((i+0.055)/1.055)**2.4});return 0.2126*r+0.7152*t+0.0722*o}function Je(e,r){let[t,o]=[xe(e),xe(r)].sort((a,i)=>i-a);return(t+0.05)/(o+0.05)}var ve={light:"#ffffff",dark:"#0d1018","modern-light":"#ffffff","modern-dark":"#0d1018","camelot-light":"#e3d2a9","camelot-dark":"#243557"};function we(e,r){let t=ve[r],o=r.endsWith("light")?"#1a1330":"#ffffff";for(let a=0;a<=20;a++){let i=a===0?e:P(e,o,a/20);if(Je(i,t)>=3)return i}return o}class y extends Error{field;constructor(e,r){super(`${e}: ${r}`);this.name="CharacterError",this.field=e}}var et=/^#[0-9a-f]{6}$/;function j(e,r){if(typeof e!=="string")throw new y(r,"must be a #rrggbb color");let t=e.toLowerCase();if(!et.test(t))throw new y(r,"must be a #rrggbb color");return t}function c(e,r,t){let o=e.find((a)=>a===r);if(o===void 0)throw new y(t,`must be one of ${e.map(String).join(", ")}`);return o}function B(e){if(typeof e!=="object"||e===null||Array.isArray(e))return!1;let r=Object.getPrototypeOf(e);return r===Object.prototype||r===null}function v(e){for(let[r,t]of Object.entries(l.palettes))if(t.primary===e.primary&&t.secondary===e.secondary&&t.trim===e.trim)return r;return}function se(e){let r=l.classes[e].preset;return{v:1,class:e,outfit:r.outfit,hat:r.hat,prop:r.prop,hair:r.hair,beard:r.beard,accessory:r.accessory,build:r.build,skin:r.skin,hairColor:r.hairColor,colors:{...r.colors},...r.palette?{palette:r.palette}:{}}}var tt=new Set(["class","outfit","hat","prop","hair","beard","accessory","build","skin","hairColor","colors","palette"]),Ce=["primary","secondary","trim"];function rt(e,r,t){if(r!==void 0){let a=c(Object.keys(l.palettes),r,"palette");e.colors={...l.palettes[a]}}if(t!==void 0){if(!B(t))throw new y("colors","must be an object");for(let i of Object.keys(t))if(!Ce.includes(i))throw new y(`colors.${i}`,"is not a known color");let a={...e.colors};for(let i of Ce)if(t[i]!==void 0)a[i]=j(t[i],`colors.${i}`);e.colors=a}let o=v(e.colors);if(o)e.palette=o;else delete e.palette}function W(e,r){if(!B(e))throw new y("character","must be an object");for(let a of Object.keys(e))if(!tt.has(a))throw new y(a,"is not a known field");let t=e.class===void 0?r?.class:c(M,e.class,"class");if(!t)throw new y("class","is required");let o=r&&r.class===t?{...r,colors:{...r.colors}}:se(t);if(e.outfit!==void 0)o.outfit=c(q,e.outfit,"outfit");if(e.hat!==void 0)o.hat=c(X,e.hat,"hat");if(e.prop!==void 0)o.prop=c(G,e.prop,"prop");if(e.hair!==void 0)o.hair=c(Y,e.hair,"hair");if(e.beard!==void 0)o.beard=c(re,e.beard,"beard");if(e.accessory!==void 0)o.accessory=c(oe,e.accessory,"accessory");if(e.build!==void 0)o.build=c(D,e.build,"build");if(e.skin!==void 0)o.skin=c(ae,e.skin,"skin");if(e.hairColor!==void 0)o.hairColor=j(e.hairColor,"hairColor");return rt(o,e.palette,e.colors),o}var Ie=new Set(["v","class","outfit","hat","prop","hair","beard","accessory","build","skin","hairColor","colors","palette"]),ot=[...Ie].filter((e)=>e!=="palette"),be=["primary","secondary","trim"];function Me(e,r){if(!Object.hasOwn(e,r))throw new y(r,"is required")}function ee(e){if(!B(e))throw new y("character","must be an object");for(let a of Object.keys(e))if(!Ie.has(a))throw new y(a,"is not a known field");for(let a of ot)Me(e,a);if(e.v!==1)throw new y("v","must be 1");let r=e.colors;if(!B(r))throw new y("colors","must be an object");for(let a of Object.keys(r))if(!be.includes(a))throw new y(`colors.${a}`,"is not a known color");for(let a of be)Me(r,a);let t={primary:j(r.primary,"colors.primary"),secondary:j(r.secondary,"colors.secondary"),trim:j(r.trim,"colors.trim")},o=v(t);if(e.palette!==void 0){if(c(Object.keys(l.palettes),e.palette,"palette")!==o)throw new y("palette","does not match the colors")}return{v:1,class:c(M,e.class,"class"),outfit:c(q,e.outfit,"outfit"),hat:c(X,e.hat,"hat"),prop:c(G,e.prop,"prop"),hair:c(Y,e.hair,"hair"),beard:c(re,e.beard,"beard"),accessory:c(oe,e.accessory,"accessory"),build:c(D,e.build,"build"),skin:c(ae,e.skin,"skin"),hairColor:j(e.hairColor,"hairColor"),colors:t,...o?{palette:o}:{}}}function Se(e,r){try{return e()}catch(t){if(t instanceof y)return r;throw t}}function le(e){if(!B(e))return;let r=Se(()=>c(M,e.class,"class"),void 0);if(!r)return;let t=se(r),o=(i,n)=>{let m=Symbol("none"),d=Se(i,m);if(d!==m)n(d)};if(o(()=>c(q,e.outfit,"outfit"),(i)=>{t.outfit=i}),o(()=>c(X,e.hat,"hat"),(i)=>{t.hat=i}),o(()=>c(G,e.prop,"prop"),(i)=>{t.prop=i}),o(()=>c(Y,e.hair,"hair"),(i)=>{t.hair=i}),o(()=>c(re,e.beard,"beard"),(i)=>{t.beard=i}),o(()=>c(oe,e.accessory,"accessory"),(i)=>{t.accessory=i}),o(()=>c(D,e.build,"build"),(i)=>{t.build=i}),o(()=>c(ae,e.skin,"skin"),(i)=>{t.skin=i}),o(()=>j(e.hairColor,"hairColor"),(i)=>{t.hairColor=i}),B(e.colors)){let i=e.colors;for(let n of be)o(()=>j(i[n],`colors.${n}`),(m)=>{t.colors[n]=m})}let a=v(t.colors);if(a)t.palette=a;else delete t.palette;return t}var at={neutral:{eye:"open",look:[0,0],bl:[0,0],br:[0,0],mouth:"smile",fx:[]},happy:{eye:"sparkle",look:[0,0],bl:[-2,0],br:[-2,0],mouth:"grin",fx:["blush"]},thinking:{eye:"open",look:[2.2,-2.4],bl:[-0.5,0],br:[-4,-8],mouth:"flatR",fx:["dots"]},concerned:{eye:"open",look:[0,0.6],bl:[-1,-13],br:[-1,-13],mouth:"wobble",fx:[]},apologetic:{eye:"soft",look:[0,0],bl:[-1,-20],br:[-1,-20],mouth:"wobble",fx:["sweat","blush"]},surprised:{eye:"wide",look:[0,0],bl:[-4,-4],br:[-4,4],mouth:"o",fx:["burst"]},proud:{eye:"arc",look:[0,0],bl:[-3,0],br:[-3,0],mouth:"smirk",fx:["sparkle"]},amused:{eye:"xd",look:[0,0],bl:[-2,0],br:[-2,0],mouth:"grin",fx:["tear"]},curious:{eye:"open",look:[2.6,-0.4],bl:[-4,-6],br:[0,0],mouth:"tilt",fx:[],big:1},sympathetic:{eye:"soft",look:[0,1],bl:[-1,-10],br:[-1,-10],mouth:"smileS",fx:["blush"]},playful:{eye:"wink",look:[0,0],bl:[-3,-2],br:[1,0],mouth:"tongue",fx:["blush"]},determined:{eye:"narrow",look:[0,0],bl:[1,15],br:[1,15],mouth:"firm",fx:[]},sleepy:{eye:"closed",look:[0,0],bl:[2,6],br:[2,6],mouth:"yawn",fx:[]}},s=(e)=>+e.toFixed(2),pe={ex:[39,61],ey:52,rx:5.2,ry:6.4,sw:2.5,msw:2.2,bl:8.6,bw:2.2,bdy:-9.8,mx:50,my:64,ms:1,bx:6.5,by:8,br:4,fx:[76,40],fs:1,hw:28,by0:42},N={badge:[17,19],badgeR:9.5,orbit:[50,50,45],zz:[73,28]},ie={eyes:`50px ${pe.ey}px`,badge:`${N.badge[0]}px ${N.badge[1]}px`,orbit:`${N.orbit[0]}px ${N.orbit[1]}px`,character:"50px 94px"},ne="#2b2440";function st(e,r,t){let{rx:o,ry:a,sw:i}=pe,n=(d=1)=>`<ellipse rx="${s(o*d)}" ry="${s(a*d)}" fill="${t}"/><circle cx="${s(-o*0.3)}" cy="${s(-a*0.36)}" r="${s(o*0.4)}" fill="#fff"/><circle cx="${s(o*0.38)}" cy="${s(a*0.36)}" r="${s(o*0.18)}" fill="#fff"/>`,m=`<path d="M${s(-o*1.05)} ${s(a*0.35)}Q0 ${s(-a*1.15)} ${s(o*1.05)} ${s(a*0.35)}" fill="none" stroke="${t}" stroke-width="${i}" stroke-linecap="round"/>`;switch(e){case"open":return n();case"sparkle":return`${n(1.1)}<circle cx="${s(-o*0.1)}" cy="${s(a*0.5)}" r="${s(o*0.14)}" fill="#fff" opacity=".8"/>`;case"wide":return`<circle r="${s(a*1.12)}" fill="#fff" stroke="${t}" stroke-width="${s(i*0.7)}"/><circle r="${s(a*0.5)}" fill="${t}"/>`;case"arc":return m;case"closed":return`<path d="M${s(-o)} ${s(-a*0.1)}Q0 ${s(a*0.85)} ${s(o)} ${s(-a*0.1)}" fill="none" stroke="${t}" stroke-width="${i}" stroke-linecap="round"/>`;case"soft":return`<path d="M${s(-o)} ${s(-a*0.25)}H${s(o)}A${s(o)} ${s(a*1.05)} 0 0 1 ${s(-o)} ${s(-a*0.25)}Z" fill="${t}"/><circle cx="${s(-o*0.25)}" cy="${s(a*0.25)}" r="${s(o*0.34)}" fill="#fff"/>`;case"narrow":return`<ellipse rx="${s(o*0.98)}" ry="${s(a*0.6)}" fill="${t}"/><circle cx="${s(-o*0.3)}" cy="${s(-a*0.15)}" r="${s(o*0.26)}" fill="#fff"/>`;case"xd":{let d=r?-1:1;return`<path d="M${s(-d*o*0.85)} ${s(-a*0.75)}L${s(d*o*0.6)} 0L${s(-d*o*0.85)} ${s(a*0.75)}" fill="none" stroke="${t}" stroke-width="${i}" stroke-linecap="round" stroke-linejoin="round"/>`}case"wink":return r?m:n()}}function it(e,r){let t=`fill="none" stroke="${r}" stroke-width="${pe.msw}" stroke-linecap="round" stroke-linejoin="round"`;switch(e){case"smile":return`<path d="M-6 0Q0 5 6 0" ${t}/>`;case"smileS":return`<path d="M-4.2 0.4Q0 3.8 4.2 0.4" ${t}/>`;case"grin":return`<path d="M-7 -1Q0 3 7 -1Q5.5 8 0 8Q-5.5 8 -7 -1Z" fill="${r}"/><ellipse cy="6.3" rx="2.9" ry="1.5" fill="#ef7b8a"/>`;case"o":return`<ellipse cy="3" rx="2.9" ry="3.5" fill="${r}"/>`;case"flatR":return`<path d="M-3.5 2.4L4.5 0.4" ${t}/>`;case"firm":return`<path d="M-5 1.2H4.2L5.6 -0.4" ${t}/>`;case"wobble":return`<path d="M-6 3.2q1.5 -3 3 0t3 0t3 0t3 0" ${t}/>`;case"smirk":return`<path d="M-6 2.4Q0 4 6.4 -1.6" ${t}/>`;case"tongue":return`<path d="M-6.5 -0.5Q0 4.5 6.5 -0.5Z" fill="${r}"/><path d="M-2.6 2.2Q0 10 2.8 2.4Z" fill="#ef7b8a"/>`;case"yawn":return`<ellipse cy="3.4" rx="3.4" ry="4.2" fill="${r}"/><ellipse cy="5.6" rx="2" ry="1.4" fill="#ef7b8a"/>`;case"tilt":return`<ellipse cx="3" cy="2" rx="1.9" ry="2.4" fill="${r}"/>`}}var He=(e,r,t,o)=>`<path d="M${e} ${r-t}Q${e+t*0.22} ${r-t*0.22} ${e+t} ${r}Q${e+t*0.22} ${r+t*0.22} ${e} ${r+t}Q${e-t*0.22} ${r+t*0.22} ${e-t} ${r}Q${e-t*0.22} ${r-t*0.22} ${e} ${r-t}Z" fill="${o}"/>`,Le=(e,r,t,o)=>`<path d="M${e} ${r-3.6*t}Q${e+3*t} ${r+0.2*t} ${e} ${r+2.8*t}Q${e-3*t} ${r+0.2*t} ${e} ${r-3.6*t}Z" fill="${o}"/>`;function Ee(e,r){let t=pe,o=at[r],[a,i]=o.look,n=(f,x)=>{let h=o.big&&!x;return`<g transform="translate(${s(f+a)} ${s(t.ey+i)})${h?" scale(1.12)":""}">${st(o.eye,x,e.ink)}</g>`},m=`<g class="eyes">${n(t.ex[0],0)}${n(t.ex[1],1)}</g>`,d=(f,[x,h],C)=>`<path d="M${-t.bl/2} 0H${t.bl/2}" transform="translate(${f} ${s(t.ey+t.bdy+x)}) rotate(${C?-h:h})" stroke="${e.brow}" stroke-width="${t.bw}" stroke-linecap="round" fill="none"/>`,E=`<g class="brows">${d(t.ex[0],o.bl,0)}${d(t.ex[1],o.br,1)}</g>`,R=`<g class="mouth" transform="translate(${t.mx} ${t.my}) scale(${t.ms})">${it(o.mouth,e.ink)}</g>`,[w,I]=t.fx,p=(f)=>`<ellipse cx="${f}" cy="${t.ey+t.by}" rx="${t.br}" ry="${s(t.br*0.62)}" fill="#ff7a8e" opacity=".5"/>`,T={blush:p(t.ex[0]-t.bx)+p(t.ex[1]+t.bx),sweat:Le(w,I,t.fs,"#7fd0ff"),tear:Le(t.ex[1]+t.rx+1.5,t.ey+t.ry*0.9,t.fs*0.8,"#7fd0ff"),sparkle:He(w,I-1,4.4*t.fs,"#ffd84a")+He(w+5*t.fs,I+5*t.fs,2*t.fs,"#fff1a8"),dots:[1,1.5,2.1].map((f,x)=>`<circle cx="${s(w-1+x*4.2*t.fs)}" cy="${s(I-2-x*3.6*t.fs)}" r="${s(f*t.fs)}" fill="${e.dot}"/>`).join(""),burst:[-1,1].map((f)=>`<path d="M${50+f*(t.hw+1)} ${t.by0-3}l${f*4.5} -3M${50+f*(t.hw+2)} ${t.by0+3}l${f*5.5} 0M${50+f*(t.hw+1)} ${t.by0+9}l${f*4.5} 3" stroke="${e.dot}" stroke-width="1.7" stroke-linecap="round"/>`).join("")};return{eyes:m,brows:E,mouth:R,fx:`<g class="fx">${o.fx.map((f)=>T[f]).join("")}</g>`}}function Qe(e,r,t){let[o,a]=N.badge,i=N.badgeR,n=i/8,m=(A,V,_)=>`<g class="ov ${A}"><circle cx="${o}" cy="${a}" r="${i}" fill="${V}" stroke="#fff" stroke-width="1.6"/>${_}</g>`,d=m("o-wait","#f2a81d",`<path d="M${o} ${a-4.2*n}V${a+0.6*n}" stroke="#fff" stroke-width="${s(2.2*n)}" stroke-linecap="round"/><circle cx="${o}" cy="${s(a+3.6*n)}" r="${s(1.25*n)}" fill="#fff"/>`),E=m("o-done","#2fb36b",`<path d="M${s(o-3.6*n)} ${s(a+0.2*n)}L${s(o-1*n)} ${s(a+3*n)}L${s(o+3.8*n)} ${s(a-2.8*n)}" fill="none" stroke="#fff" stroke-width="${s(2.2*n)}" stroke-linecap="round" stroke-linejoin="round"/>`),R=m("o-err","#e5484d",`<path d="M${s(o-3*n)} ${s(a-3*n)}L${s(o+3*n)} ${s(a+3*n)}M${s(o+3*n)} ${s(a-3*n)}L${s(o-3*n)} ${s(a+3*n)}" stroke="#fff" stroke-width="${s(2.2*n)}" stroke-linecap="round"/>`),[w,I,p]=N.orbit,T=`<g class="ov o-think"><circle cx="${w}" cy="${s(I-p)}" r="3.3" fill="${e}" stroke="#fff" stroke-width="1.3"/></g>`,[f,x]=N.zz,h=(A,V,_,F)=>`<path d="M${A} ${V}H${A+_}L${A} ${V+_*1.15}H${A+_}" fill="none" stroke="${r}" stroke-width="${F}" stroke-linecap="round" stroke-linejoin="round"/>`,C=`<g class="ov o-zz">${h(f,x,7,2.2)}${h(f+8,x-9,5,1.8)}</g>`;return`<g class="fg">${t?{thinking:T,waiting:d,done:E,error:R,sleepy:C}[t]??"":T+d+E+R+C}</g>`}var Oe={none:()=>({back:"",front:""}),short:(e)=>({back:"",front:`<path d="M24 47C23 29 77 29 76 47C70 39 61 35 50 35C39 35 30 39 24 47Z" fill="${e.hr}"/>`}),bob:(e)=>({back:`<path d="M19 46C17 66 23 77 33 77H67C77 77 83 66 81 46C78 26 22 26 19 46Z" fill="${e.hr}"/>`,front:`<path d="M23 50C22 28 78 28 77 50C68 38 58 36 50 41C42 36 32 38 23 50Z" fill="${e.hr}"/>`}),long:(e)=>({back:`<path d="M18 48C14 72 20 92 34 92H66C80 92 86 72 82 48C80 26 20 26 18 48Z" fill="${e.hr}"/>`,front:`<path d="M23 52C22 28 78 28 77 52C70 38 62 36 56 38Q44 44 36 46Q28 48 23 52Z" fill="${e.hr}"/>`}),bun:(e)=>({back:`<circle cx="50" cy="21" r="9.5" fill="${e.hr}"/>`,front:`<path d="M24 47C23 29 77 29 76 47C70 39 61 35 50 35C39 35 30 39 24 47Z" fill="${e.hr}"/>`}),curly:(e)=>({back:"",front:`<g fill="${e.hr}"><circle cx="30" cy="38" r="9"/><circle cx="41" cy="30" r="9.5"/><circle cx="55" cy="29" r="9.5"/><circle cx="68" cy="35" r="9"/><circle cx="23" cy="50" r="6"/><circle cx="77" cy="50" r="6"/></g>`}),ponytail:(e)=>({back:`<path d="M70 40C92 42 94 66 82 76C86 62 80 54 68 52Z" fill="${e.hr}"/>`,front:`<path d="M24 47C23 29 77 29 76 47C70 39 61 35 50 35C39 35 30 39 24 47Z" fill="${e.hr}"/>`}),braid:(e)=>({back:`<path d="M24 46C14 60 20 76 28 90L34 88C28 76 28 62 32 52Z" fill="${e.hr}"/><circle cx="28" cy="90" r="3.6" fill="${e.p}"/>`,front:`<path d="M24 47C23 29 77 29 76 47C70 39 61 35 50 35C39 35 30 39 24 47Z" fill="${e.hr}"/>`})},Ae={full:(e)=>`<path d="M23.4 47C22 59 36 59 50 59.4C64 59 78 59 76.6 47C81 66 66 88 50 91.5C34 88 19 66 23.4 47Z" fill="${e.hr}"/><path d="M50 62V88" stroke="${e.hd}" stroke-width="1.2" opacity=".5"/><path d="M36 60Q50 66 64 60" fill="none" stroke="${e.hd}" stroke-width="1.2" opacity=".5"/>`,mustache:(e)=>`<path d="M38 60C42 54 48 58 50 60C52 58 58 54 62 60C58 62 53 60 50 61.4C47 60 42 62 38 60Z" fill="${e.hr}"/>`,goatee:(e)=>`<path d="M44 68C46 66 54 66 56 68C56 76 52 78 50 78C48 78 44 76 44 68Z" fill="${e.hr}"/>`},Re={glasses:(e)=>`<g fill="none" stroke="${e.ink}" stroke-width="1.7"><circle cx="39" cy="52" r="8.4"/><circle cx="61" cy="52" r="8.4"/><path d="M47.4 51Q50 49 52.6 51M30.6 50L25 47M69.4 50L75 47"/></g><path d="M33 47L37 45M56 47L60 45" stroke="#fff" stroke-width="1.6" stroke-linecap="round" opacity=".7"/>`,freckles:(e)=>`<g fill="${e.kd}"><circle cx="32.5" cy="60" r="1"/><circle cx="36" cy="62" r="1"/><circle cx="39.5" cy="60.4" r="1"/><circle cx="60.5" cy="60.4" r="1"/><circle cx="64" cy="62" r="1"/><circle cx="67.5" cy="60" r="1"/></g>`,scar:(e)=>`<path d="M64 44L70 57M62.4 51H67M65 47.6H69" stroke="${e.kd}" stroke-width="1.5" stroke-linecap="round" opacity=".85"/><path d="M64 44L70 57" stroke="#e9a0a0" stroke-width=".8" opacity=".7"/>`};var b=(e,r,t,o=4.8)=>`<circle cx="${r}" cy="${t}" r="${o}" fill="${e.k}"/>`,H=(e)=>`<path d="M31 94C29 79 35 71 50 71C65 71 71 79 69 94Z" fill="${e}"/>`,S=(e)=>`<ellipse cx="28.5" cy="80" rx="5.2" ry="8" transform="rotate(14 28.5 80)" fill="${e}"/><ellipse cx="71.5" cy="80" rx="5.2" ry="8" transform="rotate(-14 71.5 80)" fill="${e}"/>`,te=(e,r,t)=>`<path d="M${e} ${r-4}l1.5 3.2 3.5.4-2.6 2.4.7 3.5-3.1-1.8-3.1 1.8.7-3.5-2.6-2.4 3.5-.4z" fill="${t}"/>`,Ze={robe:(e)=>S(e.p)+H(e.p)+`<path d="M30 89H70L69.6 94H30.4Z" fill="${e.t}"/>`+te(50,77,e.t)+b(e,27,88,4.4),scholar:(e)=>S(e.pd)+H(e.pd)+`<path d="M39 71.5L50 85L61 71.5Z" fill="${e.s}"/><path d="M50 85V94" stroke="${e.t}" stroke-width="1.6"/><path d="M33 88H67" stroke="${e.p}" stroke-width="2.4" opacity=".7"/>`,armor:(e)=>S("#c7cfdd")+H("#c7cfdd")+`<path d="M44 71H56V94H44Z" fill="${e.p}"/><path d="M44 80H56" stroke="${e.t}" stroke-width="2"/><circle cx="31" cy="75.5" r="6.4" fill="#9aa5ba"/><circle cx="69" cy="75.5" r="6.4" fill="#9aa5ba"/><circle cx="29.5" cy="73.5" r="2" fill="#fff" opacity=".6"/><circle cx="67.5" cy="73.5" r="2" fill="#fff" opacity=".6"/>`,plate:(e)=>S("#e6eaf3")+H("#e6eaf3")+`<path d="M44 71H56L58 94H42Z" fill="${e.s}" stroke="${e.t}" stroke-width="1.6"/><path d="M50 74V92M45 81H55" stroke="${e.p}" stroke-width="3"/><circle cx="31" cy="75.5" r="6.4" fill="${e.t}"/><circle cx="69" cy="75.5" r="6.4" fill="${e.t}"/><circle cx="29.5" cy="73.5" r="2" fill="#fff" opacity=".6"/><circle cx="67.5" cy="73.5" r="2" fill="#fff" opacity=".6"/>`,apron:(e)=>S(e.s)+H(e.s)+'<path d="M38 71H62L66 94H34Z" fill="#a6713f"/><path d="M38 71L42 75M62 71L58 75" stroke="#7a4f27" stroke-width="2"/><rect x="43.5" y="82" width="13" height="8" rx="2" fill="#8d5c30"/><rect x="24" y="85" width="9" height="3" rx="1.5" fill="#8d5c30"/>',chef:(e)=>S("#fff")+H("#fff")+`<path d="M50 72V94" stroke="#cfd5e4" stroke-width="1.4"/><circle cx="45" cy="79" r="1.7" fill="${e.t}"/><circle cx="45" cy="87" r="1.7" fill="${e.t}"/><circle cx="55" cy="79" r="1.7" fill="${e.t}"/><circle cx="55" cy="87" r="1.7" fill="${e.t}"/><path d="M41 71.5Q50 77 59 71.5L57 75Q50 79 43 75Z" fill="${e.p}"/>`,cloak:(e)=>`<path d="M26 79Q50 66 74 79L72 94H28Z" fill="${e.pd}"/>`+S(e.p)+H(e.p)+`<path d="M32 87H68" stroke="#8b5a33" stroke-width="3.2"/><rect x="46" y="84.8" width="8" height="4.4" rx="1.4" fill="${e.t}"/><circle cx="50" cy="72.5" r="2.6" fill="${e.t}"/>`,tunic:(e)=>S(e.p)+H(e.p)+`<path d="M31 83L69 76V82L31 89Z" fill="${e.s}"/><circle cx="44" cy="90" r="1.8" fill="${e.t}"/><circle cx="56" cy="88" r="1.8" fill="${e.t}"/><path d="M37 71.5q3 5 6.3 0t6.4 0t6.3 0t6.3 0V75H37Z" fill="${e.s}"/>`,coat:(e)=>S(e.pd)+H(e.pd)+`<path d="M50 72V94" stroke="${e.ink}" stroke-width="1" opacity=".35"/><path d="M40 71.5L47 84L50 72ZM60 71.5L53 84L50 72Z" fill="${e.s}"/><circle cx="46" cy="87" r="1.8" fill="${e.t}"/><circle cx="54" cy="87" r="1.8" fill="${e.t}"/><circle cx="46" cy="80" r="1.8" fill="${e.t}" opacity="0"/>`,overalls:(e)=>S(e.s)+H(e.s)+`<path d="M36 80H64V94H36Z" fill="${e.p}"/><path d="M39 80L40 71.4M61 80L60 71.4" stroke="${e.p}" stroke-width="4"/><rect x="44.5" y="83" width="11" height="6" rx="1.5" fill="${e.pd}"/><circle cx="40" cy="79" r="1.6" fill="${e.t}"/><circle cx="60" cy="79" r="1.6" fill="${e.t}"/>`,vest:(e)=>S(e.s)+H(e.s)+`<path d="M37 71.5L45 94H36ZM63 71.5L55 94H64Z" fill="${e.p}"/><path d="M40 83Q50 90 60 83" fill="none" stroke="${e.t}" stroke-width="1.6"/><circle cx="50" cy="86" r="2" fill="${e.t}"/>`,habit:(e)=>S(e.p)+`<path d="M29 94C27 78 35 71 50 71C65 71 73 78 71 94Z" fill="${e.p}"/><path d="M40 71.5L50 82L60 71.5" fill="none" stroke="${e.s}" stroke-width="3.2" stroke-linejoin="round"/><path d="M29 87H71" stroke="${e.s}" stroke-width="3"/><circle cx="50" cy="87" r="2" fill="${e.t}"/>`,surplice:(e)=>S(e.s)+H(e.s)+`<path d="M46 74H54V79H59V85H54V93H46V85H41V79H46Z" fill="${e.p}"/><path d="M31 90H69" stroke="${e.sd}" stroke-width="2"/>`,motley:(e)=>S(e.p)+H(e.p)+`<path d="M50 71C65 71 71 79 69 94H50Z" fill="${e.s}"/><path d="M71.5 72A8 8 0 0 1 71.5 88Z" fill="${e.s}" opacity="0"/><path d="M41 82L50 90L59 82L50 74Z" fill="${e.t}" opacity=".9"/><path d="M36 71.5q3 5 6.5 0t7.5 0t7.5 0t6.5 0V75H36Z" fill="${e.t}"/>`,sailor:(e)=>S(e.s)+H(e.s)+`<path d="M31 78H69M31 84H69M31 90H69" stroke="${e.p}" stroke-width="2.6"/><path d="M38 71.5L50 82L62 71.5L56 71Q50 76 44 71Z" fill="${e.pd}"/>`};var Te="#c7cfdd",lt="#9aa5ba",Pe={none:()=>"",wizard:(e)=>`<path d="M30 31C32 20 42 11 60 3C57 13 62 22 70 31Z" fill="${e.p}"/><path d="M30 31C32 20 42 11 60 3" fill="none" stroke="#fff" stroke-width="1.6" opacity=".35"/><ellipse cx="50" cy="30" rx="37" ry="7.6" fill="${e.pd}"/><path d="M30.6 27.6Q50 33 69.4 27.6L70 31Q50 36.5 30 31Z" fill="${e.t}"/>`+te(49,16,e.t),helm:(e)=>`<path d="M50 24C42 6 66 -1 80 12C68 9 60 15 57 25Z" fill="${e.p}"/><path d="M23 47C21 23 79 23 77 47L72 39Q50 31 28 39Z" fill="${Te}"/><path d="M26 36Q50 24 74 36" fill="none" stroke="#fff" stroke-width="2" opacity=".55"/><path d="M28 39Q50 31 72 39" fill="none" stroke="${e.t}" stroke-width="3"/><circle cx="50" cy="26.5" r="3.4" fill="${e.t}"/>`,mortar:(e)=>`<path d="M30 29V37Q50 43 70 37V29Z" fill="${e.pd}"/><path d="M13 24L50 12L87 24L50 36Z" fill="${e.p}"/><path d="M13 24L50 36L87 24" fill="none" stroke="${e.pd}" stroke-width="1.6"/><path d="M50 24L82 26V38" fill="none" stroke="${e.t}" stroke-width="1.8" stroke-linejoin="round"/><rect x="79.6" y="37" width="4.8" height="7" rx="2" fill="${e.t}"/><circle cx="50" cy="24" r="2.4" fill="${e.t}"/>`,goggcap:(e)=>`<path d="M23 41C23 21 77 21 77 41Q50 33 23 41Z" fill="${e.p}"/><path d="M54 36Q78 32 85 41Q70 43 51 40Z" fill="${e.pd}"/><path d="M23 37Q50 28 77 37V40Q50 31 23 40Z" fill="${e.pd}"/><circle cx="40" cy="27.5" r="7" fill="#bfeaf6" stroke="${e.t}" stroke-width="2.6"/><circle cx="60" cy="27.5" r="7" fill="#bfeaf6" stroke="${e.t}" stroke-width="2.6"/><path d="M36.5 25Q39 23 42 24.5M56.5 25Q59 23 62 24.5" fill="none" stroke="#fff" stroke-width="1.6" stroke-linecap="round"/>`,hood:(e)=>`<path d="M21 53C20 26 80 26 79 53C76 40 66 33.5 50 33.5C34 33.5 24 40 21 53Z" fill="${e.p}"/><path d="M21 53C20 26 80 26 79 53" fill="none" stroke="${e.pd}" stroke-width="2"/><path d="M70 33Q90 24 93 8Q76 12 66 30Z" fill="${e.t}"/><path d="M72 29Q84 20 91 10" fill="none" stroke="${e.td}" stroke-width="1.2"/>`,beret:(e)=>`<path d="M19 39C16 14 58 4 77 19C86 27 83 40 70 38Q46 32 24 43Z" fill="${e.p}"/><path d="M22 40Q46 31 72 38" fill="none" stroke="${e.t}" stroke-width="2.6" stroke-linecap="round"/><path d="M66 20Q82 10 91 4Q90 18 76 28Z" fill="${e.s}" stroke="${e.t}" stroke-width="1.2"/><path d="M68 22Q80 14 90 6" fill="none" stroke="${e.td}" stroke-width="1"/>`,goggles:(e)=>`<path d="M22 41Q50 28 78 41V45Q50 33 22 45Z" fill="#5a4636"/><circle cx="39" cy="32.4" r="8" fill="#bfeaf6" stroke="${e.t}" stroke-width="3"/><circle cx="61" cy="32.4" r="8" fill="#bfeaf6" stroke="${e.t}" stroke-width="3"/><path d="M34.5 29.5Q38 26.5 42 28.5M56.5 29.5Q60 26.5 64 28.5" fill="none" stroke="#fff" stroke-width="1.8" stroke-linecap="round"/><rect x="45" y="30" width="10" height="3.4" fill="${e.t}"/>`,coif:(e)=>`<path d="M19 55C17 22 83 22 81 55C77 38 65 32 50 32C35 32 23 38 19 55Z" fill="#fff" stroke="#d9deeb" stroke-width="1.2"/><path d="M24 44Q50 30 76 44" fill="none" stroke="${e.t}" stroke-width="2.4"/><path d="M48.4 18H51.6V23H56.4V26H51.6V32H48.4V26H43.6V23H48.4Z" fill="${e.p}" transform="translate(0 4)"/>`,tallcap:(e)=>`<path d="M31 33V12Q50 6 69 12V33Z" fill="${e.pd}"/><ellipse cx="50" cy="12" rx="19" ry="4.4" fill="${e.p}"/><ellipse cx="50" cy="33" rx="30" ry="5.4" fill="${e.pd}"/><path d="M31 27H69V31H31Z" fill="${e.t}"/><rect x="46" y="25.4" width="8" height="7" rx="1.4" fill="none" stroke="${e.td}" stroke-width="1.6"/>`,tricorn:(e)=>`<path d="M10 36L33 16Q50 10 67 16L90 36Q50 26 10 36Z" fill="${e.pd}"/><path d="M10 36Q50 26 90 36" fill="none" stroke="${e.t}" stroke-width="2.8"/><circle cx="50" cy="22" r="3.6" fill="${e.p}" stroke="${e.t}" stroke-width="1.4"/>`,turban:(e)=>`<path d="M21 46C19 18 81 18 79 46C70 34 30 34 21 46Z" fill="${e.pl}"/><path d="M26 38Q50 22 74 38M23 44Q50 28 77 44" fill="none" stroke="${e.p}" stroke-width="2.4"/><path d="M50 22l2.6 4 4.6.6-3.4 3.2.9 4.6-4.7-2.4-4.7 2.4.9-4.6-3.4-3.2 4.6-.6z" fill="${e.t}" stroke="${e.td}" stroke-width="1"/>`,softcap:(e)=>`<path d="M23 41C20 17 76 12 78 38Q50 32 23 41Z" fill="${e.pl}"/><path d="M23 41Q50 32 78 38" fill="none" stroke="${e.p}" stroke-width="3"/><path d="M68 28Q80 20 88 6Q90 22 78 34Z" fill="${e.s}" stroke="${e.td}" stroke-width="1.2"/><path d="M70 28Q80 20 87 8" fill="none" stroke="${e.td}" stroke-width="1"/>`,hardhat:(e)=>`<path d="M25 41C24 11 76 11 75 41Z" fill="${e.t}"/><rect x="21" y="37" width="58" height="6.4" rx="3.2" fill="${e.td}"/><path d="M50 15V37M40 18V37M60 18V37" stroke="${e.td}" stroke-width="2" opacity=".5"/><circle cx="50" cy="24" r="5" fill="#fff" stroke="${e.ink}" stroke-width="1.6"/><circle cx="50" cy="24" r="2" fill="#ffe68a"/>`,wreath:(e)=>`<g fill="#4fae6c"><ellipse cx="28" cy="40" rx="6" ry="3.2" transform="rotate(60 28 40)"/><ellipse cx="31" cy="31" rx="6" ry="3.2" transform="rotate(30 31 31)"/><ellipse cx="40" cy="26" rx="6" ry="3.2" transform="rotate(8 40 26)"/><ellipse cx="50" cy="24" rx="6" ry="3.2"/><ellipse cx="60" cy="26" rx="6" ry="3.2" transform="rotate(-8 60 26)"/><ellipse cx="69" cy="31" rx="6" ry="3.2" transform="rotate(-30 69 31)"/><ellipse cx="72" cy="40" rx="6" ry="3.2" transform="rotate(-60 72 40)"/></g><g fill="#2f8a50"><ellipse cx="36" cy="28" rx="5" ry="2.6" transform="rotate(-20 36 28)"/><ellipse cx="64" cy="28" rx="5" ry="2.6" transform="rotate(20 64 28)"/></g><circle cx="50" cy="24" r="2.6" fill="${e.p}"/><circle cx="31" cy="32" r="2.2" fill="${e.t}"/><circle cx="69" cy="32" r="2.2" fill="${e.t}"/>`,toque:(e)=>`<path d="M31 37V30C22 28 21 12 36 12C38 5 62 5 64 12C79 12 78 28 69 30V37Z" fill="#fff" stroke="#d9deeb" stroke-width="1.2"/><rect x="31" y="32" width="38" height="6" rx="2" fill="${e.s}" stroke="#d9deeb" stroke-width="1"/><path d="M42 14Q43 24 41 30M58 14Q57 24 59 30" fill="none" stroke="#e1e5f0" stroke-width="1.4"/>`,kettle:(e)=>`<path d="M28 33C28 8 72 8 72 33Z" fill="${Te}"/><ellipse cx="50" cy="33" rx="38" ry="6.4" fill="${lt}"/><path d="M34 22Q50 12 66 22" fill="none" stroke="#fff" stroke-width="2" opacity=".5"/><circle cx="50" cy="17" r="2.4" fill="${e.t}"/><path d="M28 27H72" stroke="${e.p}" stroke-width="3"/>`,cavalier:(e)=>`<path d="M62 20Q80 4 92 6Q88 24 70 30Z" fill="${e.s}" stroke="${e.t}" stroke-width="1.4"/><path d="M30 33C30 14 70 14 70 33Z" fill="${e.p}"/><path d="M10 35Q50 18 90 35Q50 42 10 35Z" fill="${e.pd}"/><path d="M30 31Q50 36 70 31" fill="none" stroke="${e.t}" stroke-width="2.6"/>`,cowl:(e)=>`<path d="M19 54C16 30 38 14 58 3C58 18 82 32 81 54C75 41 63 34 50 34C37 34 25 41 19 54Z" fill="${e.pd}"/><path d="M26 44Q50 30 74 44" fill="none" stroke="${e.ink}" stroke-width="2" opacity=".3"/>`,headband:(e)=>`<path d="M22 39Q50 29 78 39V44.5Q50 34.5 22 44.5Z" fill="${e.p}"/><path d="M76 40Q86 38 90 46M76 42Q88 46 88 56" fill="none" stroke="${e.p}" stroke-width="3.2" stroke-linecap="round"/><circle cx="50" cy="31.5" r="2.4" fill="${e.t}"/>`,fcap:(e)=>`<path d="M23 42C22 20 78 18 77 40Q50 31 23 42Z" fill="${e.pd}"/><path d="M23 42Q50 31 77 40" fill="none" stroke="${e.t}" stroke-width="2.4"/><path d="M60 26Q78 22 94 8Q86 28 70 34Z" fill="${e.s}" stroke="${e.td}" stroke-width="1.2"/><path d="M62 28Q80 22 92 10" fill="none" stroke="${e.td}" stroke-width="1"/>`,sailor:(e)=>`<path d="M26 38C26 18 74 18 74 38Z" fill="#fff" stroke="#d9deeb" stroke-width="1.2"/><rect x="25" y="34" width="50" height="7" rx="3.4" fill="${e.pd}"/><path d="M50 14V22" stroke="${e.p}" stroke-width="3.4" stroke-linecap="round"/><path d="M26 28H74" stroke="${e.p}" stroke-width="2" opacity=".6"/>`,jester:(e)=>`<path d="M26 40C14 30 12 14 18 6C28 16 32 26 42 33Z" fill="${e.p}"/><path d="M74 40C86 30 88 14 82 6C72 16 68 26 58 33Z" fill="${e.s}" stroke="${e.sd}" stroke-width="1"/><path d="M26 40C26 28 74 28 74 40Q50 34 26 40Z" fill="${e.pd}"/><circle cx="18" cy="6" r="4" fill="${e.t}" stroke="${e.td}" stroke-width="1"/><circle cx="82" cy="6" r="4" fill="${e.t}" stroke="${e.td}" stroke-width="1"/><circle cx="50" cy="31" r="3.4" fill="${e.t}"/>`,winghelm:(e)=>`<path d="M24 36Q6 31 3 14Q18 14 30 27Z" fill="${e.s}" stroke="${e.t}" stroke-width="1.6"/><path d="M76 36Q94 31 97 14Q82 14 70 27Z" fill="${e.s}" stroke="${e.t}" stroke-width="1.6"/><path d="M23 47C21 23 79 23 77 47L72 39Q50 31 28 39Z" fill="#e6eaf3"/><path d="M28 39Q50 31 72 39" fill="none" stroke="${e.t}" stroke-width="3"/><path d="M26 36Q50 24 74 36" fill="none" stroke="#fff" stroke-width="2" opacity=".7"/><path d="M50 26l2.4 4.4 4.8.8-3.4 3.4.8 4.8-4.6-2.2-4.6 2.2.8-4.8-3.4-3.4 4.8-.8z" fill="${e.t}" transform="translate(0 -1)"/>`};var Q="#8b5a33",nt="#a6713f",u=(e)=>e,je={staff:"73px 82px",shield:"27px 82px",scroll:"76px 76px",hammer:"79px 84px",bow:"78px 70px",lute:"75px 70px",flask:"73px 66px",quill:"72px 82px",tome:"78px 76px",bell:"76px 62px",keys:"78px 62px",map:"77px 58px",telescope:"76px 74px",wrench:"78px 86px",spade:"76px 60px",ladle:"78px 78px",lantern:"76px 62px",seal:"76px 66px",dagger:"78px 86px",beads:"78px 62px",bird:"78px 76px",anchor:"76px 76px",marotte:"76px 62px",sword:"76px 82px"},Ve={staff:(e)=>u(`<circle class="glow" cx="73" cy="15" r="13" fill="${e.gl}"/><path d="M73 15V92" stroke="${Q}" stroke-width="4.2" stroke-linecap="round"/><circle cx="73" cy="14" r="6.4" fill="${e.gl}" stroke="${e.t}" stroke-width="2"/><circle cx="71" cy="12" r="1.8" fill="#fff" opacity=".85"/>${b(e,73,82)}`),shield:(e)=>u(`<path class="glow" d="M17 70H37V80Q37 89 27 93.5Q17 89 17 80Z" fill="none" stroke="${e.gl}" stroke-width="6"/><path d="M17 70H37V80Q37 89 27 93.5Q17 89 17 80Z" fill="${e.s}" stroke="${e.t}" stroke-width="2"/><path d="M17 70H27V93.5Q17 89 17 80Z" fill="${e.p}"/>`+te(27,79,e.t)),scroll:(e)=>u(`<g transform="rotate(-16 76 74)"><path class="glow" d="M76 38l2.4 5.4 5.7.6-4.3 3.9 1.2 5.7-5-2.9-5 2.9 1.2-5.7-4.3-3.9 5.7-.6z" fill="${e.t}"/><rect x="69.5" y="56" width="13" height="30" rx="2" fill="#fbefd0" stroke="#c9a867" stroke-width="1.2"/><ellipse cx="76" cy="56" rx="7.4" ry="2.8" fill="#f1d99b" stroke="#c9a867" stroke-width="1.2"/><ellipse cx="76" cy="86" rx="7.4" ry="2.8" fill="#f1d99b" stroke="#c9a867" stroke-width="1.2"/><path d="M72.5 63H79.5M72.5 68H79.5M72.5 73H77" stroke="${e.p}" stroke-width="1.6" stroke-linecap="round"/></g>${b(e,75.5,74,4.6)}`),hammer:(e)=>u(`<path class="glow" d="M89 49l1.8 4 4.2.4-3.2 2.9.9 4.2-3.7-2.2-3.7 2.2.9-4.2-3.2-2.9 4.2-.4z" fill="${e.t}"/><path d="M78 95L82 70" stroke="${Q}" stroke-width="4.4" stroke-linecap="round"/><g transform="rotate(8 81 66)"><rect x="68" y="59" width="26" height="14" rx="3.4" fill="#aab3c5" stroke="#7d879b" stroke-width="1.4"/><rect x="68" y="59" width="7" height="14" rx="3" fill="#8b95a9"/><path d="M73 61.4H90" stroke="#fff" stroke-width="1.6" stroke-linecap="round" opacity=".6"/></g>${b(e,79.4,85)}`),bow:(e)=>u(`<circle class="glow" cx="94" cy="70" r="8" fill="${e.gl}"/><path d="M74 40Q98 68 74 96" fill="none" stroke="${Q}" stroke-width="4.2" stroke-linecap="round"/><path d="M74 40V96" stroke="#9aa5ba" stroke-width="1" opacity=".9"/><path d="M66 70H94" stroke="${Q}" stroke-width="1.8" stroke-linecap="round"/><path d="M93 66.5L99 70L93 73.5Z" fill="${e.t}"/><path d="M66 70l-3.4-3M66 70l-3.4 3" stroke="${e.p}" stroke-width="1.8" stroke-linecap="round"/>${b(e,78,70)}`),lute:(e)=>u(`<g transform="rotate(18 76 80)"><path d="M74.2 70V44" stroke="${Q}" stroke-width="3.8"/><rect x="72.6" y="38" width="6.4" height="8" rx="1.6" fill="#6d4426"/><ellipse cx="76" cy="82" rx="11.4" ry="12.6" fill="#cd8b4a" stroke="#9a5f2c" stroke-width="1.6"/><circle cx="76" cy="82" r="3.6" fill="${e.ink}"/><path d="M74.8 46V88M77.2 46V88" stroke="#fff" stroke-width=".8" opacity=".85"/></g><g class="glow"><circle cx="89" cy="54" r="2.8" fill="${e.gl}"/><path d="M91.5 54V41q4.2 1 4.4 6" fill="none" stroke="${e.gl}" stroke-width="2" stroke-linecap="round"/></g>${b(e,75,68,4.6)}`),flask:(e)=>u(`<circle class="glow" cx="73.5" cy="78" r="17" fill="${e.gl}"/><rect x="70" y="56" width="7" height="12" fill="#eaf7fb" stroke="#9fc9d8" stroke-width="1.4"/><rect x="69" y="51.5" width="9" height="5.6" rx="1.6" fill="#b7773f"/><circle cx="73.5" cy="78" r="12.4" fill="#eaf7fb" stroke="#9fc9d8" stroke-width="1.6"/><path d="M61.4 77Q73.5 72.6 85.6 77A12.2 12.2 0 0 1 61.4 77Z" fill="${e.gl}"/><circle cx="70" cy="80" r="1.8" fill="#fff" opacity=".8"/><circle cx="76.5" cy="83.5" r="1.2" fill="#fff" opacity=".8"/>${b(e,73.5,64)}`),quill:(e)=>u(`<circle class="glow" cx="92" cy="30" r="8" fill="${e.t}"/><path d="M70 88C70 62 80 40 92 30C95 50 86 72 70 88Z" fill="${e.s}" stroke="${e.td}" stroke-width="1.3"/><path d="M70 88Q80 58 92 30" fill="none" stroke="${e.td}" stroke-width="1.5"/><path d="M80 52Q86 54 89 48M77 62Q84 63 88 57" fill="none" stroke="${e.sd}" stroke-width="1.3"/><path d="M70 88l-3 5" stroke="${e.ink}" stroke-width="2" stroke-linecap="round"/>${b(e,72.4,80)}`),tome:(e)=>u(`<circle class="glow" cx="80" cy="60" r="9" fill="${e.t}"/><g transform="rotate(-12 78 76)"><rect x="65" y="63" width="25" height="24" rx="2.4" fill="${e.pd}" stroke="${e.ink}" stroke-width="1" stroke-opacity=".3"/><rect x="67.4" y="65.4" width="20" height="19" rx="1.4" fill="none" stroke="${e.t}" stroke-width="1.2"/><path d="M90 66V84" stroke="#f8efd6" stroke-width="3"/><rect x="72" y="71" width="9" height="7" rx="1.4" fill="${e.t}"/></g>${b(e,66,80,4.4)}`),bell:(e)=>u(`<g class="glow"><path d="M90 66q4 6 0 12M94 62q7 10 0 20" fill="none" stroke="${e.gl}" stroke-width="2" stroke-linecap="round"/></g><path d="M66 85C70 83 69 68 76 66C83 68 82 83 86 85Z" fill="${e.t}" stroke="${e.td}" stroke-width="1.4" stroke-linejoin="round"/><circle cx="76" cy="87.6" r="2.4" fill="${e.td}"/><rect x="73.4" y="60" width="5.2" height="6.4" rx="1.6" fill="${Q}"/>${b(e,76,60,4.4)}`),keys:(e)=>u(`<circle class="glow" cx="79" cy="80" r="14" fill="${e.t}"/><circle cx="78" cy="62" r="5.6" fill="none" stroke="${e.t}" stroke-width="2.6"/><path d="M82 66L90 88M90 88L93 87M87 82L90 81" fill="none" stroke="${e.t}" stroke-width="2.6" stroke-linecap="round"/><path d="M74 66L70 84M70 84L73 85M71 78L74 78" fill="none" stroke="${e.td}" stroke-width="2.6" stroke-linecap="round"/>${b(e,78,62,4.4)}`),map:(e)=>u(`<circle class="glow" cx="81" cy="76" r="8" fill="${e.p}"/><rect x="66" y="58" width="24" height="29" rx="2" fill="#f3e2b5" stroke="#c9a867" stroke-width="1.3"/><path d="M70 66Q78 62 82 70T86 80M70 82L74 76" fill="none" stroke="#8ec7d8" stroke-width="2" stroke-linecap="round" stroke-dasharray="3 2.4"/><path d="M79 74l4 4M83 74l-4 4" stroke="${e.p}" stroke-width="2.2" stroke-linecap="round"/>${b(e,78,58,4.4)}`),telescope:(e)=>u(`<circle class="glow" cx="94" cy="48" r="8" fill="${e.gl}"/><g transform="rotate(-38 78 70)"><rect x="55" y="64.5" width="14" height="11" rx="2" fill="${e.pd}"/><rect x="68" y="65.6" width="14" height="8.8" fill="${e.p}"/><rect x="81" y="66.6" width="12" height="6.8" rx="1.4" fill="${e.pd}"/><rect x="68" y="64.5" width="2.4" height="11" fill="${e.t}"/><rect x="81" y="65.6" width="2.4" height="8.8" fill="${e.t}"/><rect x="91" y="63.6" width="3.6" height="12.8" rx="1.4" fill="${e.t}"/></g>${b(e,77,72,4.6)}`),wrench:(e)=>u(`<path class="glow" d="M90 52l1.6 3.6 3.8.4-2.8 2.6.8 3.8-3.4-2-3.4 2 .8-3.8-2.8-2.6 3.8-.4z" fill="${e.t}"/><path d="M76 94L83 66" stroke="#aab3c5" stroke-width="5" stroke-linecap="round"/><path d="M76 94L83 66" stroke="#fff" stroke-width="1.2" stroke-linecap="round" opacity=".5"/><path d="M77.6 58C77 52 84 50 86 54L84 57L87 59L89 57C92 62 86 68 81 66Z" fill="#aab3c5" stroke="#7d879b" stroke-width="1.2" stroke-linejoin="round"/>${b(e,77.4,86)}`),spade:(e)=>u(`<g class="glow"><ellipse cx="88" cy="62" rx="4.4" ry="2.4" transform="rotate(-30 88 62)" fill="#4fae6c"/><ellipse cx="91" cy="70" rx="4" ry="2.2" transform="rotate(20 91 70)" fill="#4fae6c"/></g><path d="M76 92V56" stroke="${Q}" stroke-width="4" stroke-linecap="round"/><path d="M70 56H82" stroke="${Q}" stroke-width="3.4" stroke-linecap="round"/><path d="M69.5 78H82.5V88Q76 97 69.5 88Z" fill="#aab3c5" stroke="#7d879b" stroke-width="1.3" stroke-linejoin="round"/>${b(e,76,59)}`),ladle:(e)=>u(`<g class="glow"><path d="M88 48q-3-4 0-8M93 50q-3-4 0-8" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round"/></g><path d="M74 94L82 62" stroke="${Q}" stroke-width="4" stroke-linecap="round"/><path d="M73 58H93A10 8 0 0 1 73 58Z" fill="#aab3c5" stroke="#7d879b" stroke-width="1.3" stroke-linejoin="round" transform="rotate(-14 83 58)"/><ellipse cx="83" cy="57" rx="8" ry="2" fill="#c97b3a" transform="rotate(-14 83 57)"/>${b(e,76.4,82)}`),lantern:(e)=>u(`<circle class="glow" cx="77" cy="78" r="20" fill="#ffd84a"/><path d="M69 66Q77 52 85 66" fill="none" stroke="${e.td}" stroke-width="2.2"/><rect x="69" y="66" width="16" height="4" rx="1.6" fill="${e.t}"/><rect x="70.4" y="70" width="13.2" height="16" fill="#fff3c2" stroke="${e.td}" stroke-width="1.4"/><path d="M77 73Q81 78 77 83Q73 78 77 73Z" fill="#ffa63a"/><rect x="69" y="86" width="16" height="4" rx="1.6" fill="${e.t}"/>${b(e,77,60,4.4)}`),seal:(e)=>u(`<circle class="glow" cx="79" cy="78" r="9" fill="${e.p}"/><g transform="rotate(-10 78 74)"><rect x="66" y="64" width="26" height="18" rx="2" fill="#fff7e6" stroke="#d3bd8e" stroke-width="1.2"/><path d="M66 65L79 75L92 65" fill="none" stroke="#d3bd8e" stroke-width="1.2"/><circle cx="79" cy="75" r="4.6" fill="${e.p}" stroke="${e.pd}" stroke-width="1"/>${te(79,75,e.t).replace('d="M','transform="scale(.6) translate(52 50)" d="M')}</g>${b(e,70,82,4.4)}`),dagger:(e)=>u(`<path class="glow" d="M78 50V80" stroke="#fff" stroke-width="5" stroke-linecap="round"/><path d="M78 52L82.4 78H73.6Z" fill="#dfe5f0" stroke="#9aa5ba" stroke-width="1.2" stroke-linejoin="round"/><path d="M78 56V76" stroke="#fff" stroke-width="1.2" opacity=".7"/><rect x="71" y="78" width="14" height="3.4" rx="1.6" fill="${e.t}"/><rect x="76.4" y="81" width="3.2" height="8" fill="${Q}"/>${b(e,78,86)}`),beads:(e)=>u(`<g class="glow"><circle cx="78" cy="78" r="12" fill="${e.t}"/></g><g fill="${e.t}" stroke="${e.td}" stroke-width="1"><circle cx="78" cy="66" r="2.4"/><circle cx="84.4" cy="68.4" r="2.4"/><circle cx="87" cy="75" r="2.4"/><circle cx="85.6" cy="82" r="2.4"/><circle cx="80.4" cy="86.6" r="2.4"/><circle cx="73.6" cy="86.6" r="2.4"/><circle cx="68.4" cy="82" r="2.4"/><circle cx="67" cy="75" r="2.4"/><circle cx="71.6" cy="68.4" r="2.4"/></g>${b(e,78,62,4.4)}`),bird:(e)=>u(`<circle class="glow" cx="88" cy="55" r="8" fill="${e.t}"/><ellipse cx="80" cy="64" rx="9" ry="6.4" transform="rotate(-24 80 64)" fill="#8a6a4a"/><path d="M72 70L66 76L76 70Z" fill="#6f5338"/><path d="M76 66Q82 64 86 66Q82 70 78 70Z" fill="#f1e2c4"/><circle cx="87" cy="56" r="5" fill="#8a6a4a"/><path d="M91 55L96 57L91 59Z" fill="${e.t}"/><circle cx="88" cy="55" r="1.3" fill="${e.ink}"/><path d="M78 70V75" stroke="${e.t}" stroke-width="2"/><circle cx="78" cy="79" r="6.2" fill="${nt}" stroke="#7a4f27" stroke-width="1.2"/>`),anchor:(e)=>u(`<path class="glow" d="M76 54l2 4.4 4.8.5-3.6 3.2 1 4.7-4.2-2.4-4.2 2.4 1-4.7-3.6-3.2 4.8-.5z" fill="${e.t}" transform="translate(11 -4)"/><circle cx="76" cy="58" r="3.4" fill="none" stroke="#aab3c5" stroke-width="2.4"/><path d="M76 61.4V90M69.6 66H82.4M65 82Q76 98 87 82" fill="none" stroke="#aab3c5" stroke-width="3.4" stroke-linecap="round"/><path d="M65 82L63 86M87 82L89 86" stroke="#aab3c5" stroke-width="3.4" stroke-linecap="round"/>${b(e,76,74)}`),marotte:(e)=>u(`<g class="glow"><circle cx="66" cy="40" r="3" fill="${e.t}"/><circle cx="86" cy="40" r="3" fill="${e.t}"/></g><path d="M76 94V52" stroke="${Q}" stroke-width="4" stroke-linecap="round"/><circle cx="76" cy="46" r="7" fill="${e.k}" stroke="${e.kd}" stroke-width="1"/><path d="M70 42Q64 36 66 40Q68 42 71 44ZM82 42Q88 36 86 40Q84 42 81 44Z" fill="${e.p}"/><path d="M69 42C64 38 62 36 66 40ZM83 42C88 38 90 36 86 40Z" fill="none"/><circle cx="74" cy="46" r="1" fill="${e.ink}"/><circle cx="78" cy="46" r="1" fill="${e.ink}"/><path d="M73.4 49Q76 51.4 78.6 49" fill="none" stroke="${e.ink}" stroke-width="1" stroke-linecap="round"/>${b(e,76,62,4.4)}`),sword:(e)=>u(`<path class="glow" d="M76 20V76" stroke="#fff" stroke-width="8" stroke-linecap="round"/><path d="M76 17L80.4 24V76H71.6V24Z" fill="#e1e7f2" stroke="#9aa5ba" stroke-width="1.2" stroke-linejoin="round"/><path d="M76 24V74" stroke="#fff" stroke-width="1.4" opacity=".8"/><rect x="67" y="76" width="18" height="4" rx="2" fill="${e.t}"/><rect x="74.4" y="80" width="3.6" height="8" fill="${Q}"/><circle cx="76.2" cy="90" r="2.4" fill="${e.t}"/>${b(e,76.2,83)}`)};var ct=["modern-light","modern-dark","camelot-light","camelot-dark"],dt=["disc","shield"],pt=/^[a-z0-9]{1,16}$/,_e=200,Ne=4096,ft={"modern-light":{bg:(e)=>U(e,0.8),ring:(e)=>e,width:3,line:null},"modern-dark":{bg:(e)=>P(e,"#0d1018",0.68),ring:(e)=>U(e,0.15),width:3,line:null},"camelot-light":{bg:(e)=>P("#f2e6c6",e,0.1),ring:()=>"#b98a2c",width:4.2,line:"#8a5f12"},"camelot-dark":{bg:(e)=>P("#16224c",e,0.16),ring:()=>"#e6b94c",width:4.2,line:"#ffe08a"}},De="M12 14H88V50Q88 78 50 97Q12 78 12 50Z",ht="#e5484d";function kt(e){return e.replace(/[&<>"'=()]/g,(r)=>`&#${r.charCodeAt(0)};`).replace(/href/gi,(r)=>`${r[0]}&#${r.charCodeAt(1)};${r.slice(2)}`)}function yt(e,r,t){let{primary:o,secondary:a,trim:i}=e.colors,n=l.skins[e.skin];return{tones:{p:o,pd:z(o,0.3),pl:U(o,0.35),pll:U(o,0.65),s:a,sd:z(a,0.16),t:i,td:z(i,0.3),k:n,kd:z(n,0.12),hr:e.hairColor,hd:z(e.hairColor,0.2),ink:ne,gl:U(o,0.5)},bg:r.bg(o),ring:t?ht:r.ring(o)}}function O(e,r,t=""){return r?`<g class="${e}" data-part="${e}"${t}>${r}</g>`:""}function ce(e,r={}){let t=ee(e),o=r.state===void 0?void 0:c(L,r.state,"state"),a=c(K,r.expr??J[o??"idle"],"expr"),i=c(ct,r.look??"modern-light","look"),n=c(dt,r.frame??"disc","frame"),m=r.uid??"a";if(typeof m!=="string"||!pt.test(m))throw new y("uid","must match /^[a-z0-9]{1,16}$/");let{size:d,label:E}=r;if(d!==void 0&&!(Number.isInteger(d)&&d>=1&&d<=Ne))throw new y("size",`must be an integer up to ${Ne}`);if(E!==void 0&&(typeof E!=="string"||E.length>_e))throw new y("label",`must be text of at most ${_e} characters`);let R=r.bare===!0,w=r.still===!0,I=ft[i],{tones:p,bg:T,ring:f}=yt(t,I,o==="error"),x=Ee({ink:ne,brow:P(t.hairColor,ne,0.5),dot:P(p.p,ne,0.1)},a),h=Oe[t.hair](p),C=t.hat==="hood"?`<path d="M17 62C12 22 88 22 83 62C81 72 72 77 66 78H34C28 77 19 72 17 62Z" fill="${p.pd}"/>`:"",fe=Ze[t.outfit](p),A={slim:0.8,regular:1,stout:1.3}[t.build],V=A===1?fe:`<g transform="translate(${+(50-50*A).toFixed(2)} 0) scale(${A} 1)">${fe}</g>`,_=V;if(!R)_=n==="shield"?`<g clip-path="url(#as${m})">${V}</g>`:`<clipPath id="ad${m}"><circle cx="50" cy="50" r="44.6"/></clipPath><g clip-path="url(#ad${m})">${V}</g>`;let F=I.line,qe=n==="shield"?`<clipPath id="as${m}"><path d="${De}"/></clipPath><path d="${De}" fill="${T}" stroke="${f}" stroke-width="${I.width}" stroke-linejoin="round" class="ring"/>${F?`<path d="M16.5 18.5H83.5V50Q83.5 74 50 91.6Q16.5 74 16.5 50Z" fill="none" stroke="${F}" stroke-width=".9" opacity=".55"/>`:""}`:`<circle cx="50" cy="50" r="46.4" fill="${T}" stroke="${f}" stroke-width="${I.width}" class="ring"/>${F?`<circle cx="50" cy="50" r="40.6" fill="none" stroke="${F}" stroke-width=".9" opacity=".55"/>`:""}<ellipse cx="50" cy="93" rx="19" ry="2.6" fill="#000" opacity=".12"/>`,Xe=`<circle cx="22.6" cy="54" r="4.2" fill="${p.k}"/><circle cx="77.4" cy="54" r="4.2" fill="${p.k}"/><ellipse cx="50" cy="51" rx="28" ry="26" fill="${p.k}"/><path d="M23 58Q50 88 77 58Q77 76 50 77Q23 76 23 58Z" fill="${p.kd}" opacity=".3"/><ellipse cx="50" cy="58.4" rx="1.7" ry="1.2" fill="${p.kd}"/>`+h.front+(t.beard==="none"?"":Ae[t.beard](p)),Ge=(R?"":O("frame",qe))+'<g class="ch">'+O("back",h.back+C)+O("body",_)+O("head",Xe)+O("hat",Pe[t.hat](p))+O("eyes-brows",x.eyes+x.brows)+O("mouth",x.mouth)+O("fx",x.fx)+O("acc",t.accessory==="none"?"":Re[t.accessory](p))+O("prop",Ve[t.prop](p),` data-prop="${t.prop}"`)+"</g>"+O("state",Qe(p.p,z(p.p,0.1),w?o??"idle":null));return`<svg ${['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 100 100"',d===void 0?"":`width="${d}" height="${d}"`,`class="${w?"av static":"av"}"`,o===void 0&&!w?"":`data-state="${o??"idle"}"`,`data-expr="${a}"`,E===void 0?'aria-hidden="true"':`role="img" aria-label="${kt(E)}"`].filter(Boolean).join(" ")}>${Ge}</svg>`.replace(/class="glow"/g,'class="glow" opacity=".3"')}function ue(e,r){return we(e.colors.primary,r)}var g=(e)=>`:is(.av,.av-host)[data-state=${e}]`;function de(){let e=Object.entries(je).map(([r,t])=>`.av [data-prop=${r}]{transform-origin:${t}}`).join(`
2
- `);return`/* Generated from src/characters/css.ts by scripts/build-character-css.ts; do not edit. */
3
- /* State motion for composed characters. Put data-state on the <svg class="av"> or on an .av-host around it. */
4
- .av{overflow:visible}
5
- .av .ov{opacity:0}
6
- .av .glow{opacity:.28}
7
- .av .ch,.av .prop,.av .eyes,.av .ov{transform-box:view-box}
8
- .av .ch{transform-origin:${ie.character}}
9
- .av .eyes{transform-origin:${ie.eyes};animation:av-blink 5.2s infinite}
10
- .av .o-wait,.av .o-done,.av .o-err{transform-origin:${ie.badge}}
11
- .av .o-think{transform-origin:${ie.orbit}}
12
- ${e}
13
- ${g("idle")} .ch{animation:av-breathe 3.8s ease-in-out infinite}
14
- ${g("thinking")} .ch{animation:av-tilt 3.2s ease-in-out infinite}
15
- ${g("thinking")} .o-think{opacity:1;animation:av-orbit 2.6s linear infinite}
16
- ${g("working")} .ch{animation:av-bob .56s ease-in-out infinite}
17
- ${g("working")} .prop{animation:av-sweep .56s ease-in-out infinite alternate}
18
- ${g("working")} .glow{animation:av-glow .56s ease-in-out infinite alternate}
19
- ${g("waiting")} .ch{animation:av-lean 1.6s ease-in-out infinite}
20
- ${g("waiting")} .o-wait{opacity:1;animation:av-badge 1.2s ease-in-out infinite}
21
- ${g("waiting")} .glow{animation:av-glow 1.2s ease-in-out infinite alternate}
22
- ${g("done")} .ch{animation:av-pop .7s cubic-bezier(.3,1.6,.5,1) 1}
23
- ${g("done")} .o-done{opacity:1;animation:av-badge-in .5s ease-out 1}
24
- ${g("done")} .glow{opacity:.7}
25
- ${g("error")} .ch{animation:av-shake .5s ease-in-out 2}
26
- ${g("error")} .o-err{opacity:1;animation:av-badge-in .3s ease-out 1}
27
- ${g("error")} .ring{stroke:#e5484d}
28
- ${g("error")} .glow{opacity:0}
29
- ${g("sleepy")} .ch{animation:av-breathe 6s ease-in-out infinite}
30
- ${g("sleepy")} .o-zz{opacity:1;animation:av-float 3s ease-in-out infinite}
31
- ${g("sleepy")} .glow{opacity:.08}
32
- @keyframes av-blink{0%,93%,100%{transform:scaleY(1)}96%{transform:scaleY(.08)}}
33
- @keyframes av-breathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.012,1.03)}}
34
- @keyframes av-tilt{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(3deg)}}
35
- @keyframes av-orbit{to{transform:rotate(360deg)}}
36
- @keyframes av-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2.4px)}}
37
- @keyframes av-sweep{from{transform:rotate(-9deg)}to{transform:rotate(9deg)}}
38
- @keyframes av-glow{from{opacity:.2}to{opacity:.85}}
39
- @keyframes av-lean{0%,100%{transform:rotate(-1deg) translateY(0)}50%{transform:rotate(-6deg) translateY(1px)}}
40
- @keyframes av-badge{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
41
- @keyframes av-badge-in{from{transform:scale(.2);opacity:0}to{transform:scale(1);opacity:1}}
42
- @keyframes av-pop{0%{transform:scale(1)}40%{transform:scale(1.1,.94)}70%{transform:scale(.97,1.05)}100%{transform:scale(1)}}
43
- @keyframes av-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-2.4px)}40%{transform:translateX(2.4px)}60%{transform:translateX(-1.6px)}80%{transform:translateX(1.6px)}}
44
- @keyframes av-float{0%,100%{transform:translateY(0);opacity:.35}50%{transform:translateY(-4px);opacity:1}}
45
- @media (prefers-reduced-motion:reduce){.av *{animation:none!important}.av .o-think{opacity:0!important}}
46
- .av.static *{animation:none!important}
47
- `}var ze=3,$t=1,bt=600,ut=/^[ -~]+$/,mt=3;function Be(e){let r=2166136261;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619)>>>0;return r>>>0}var gt=(e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function xt(e){let r=e.toLowerCase();if(!ut.test(r))return(o)=>o.includes(r);let t=new RegExp(`(?<![a-z0-9])${gt(r)}${r.length<=mt?"(?![a-z0-9])":""}`);return(o)=>t.test(o)}var wt=Object.fromEntries(M.map((e)=>[e,l.classes[e].keywords.map(xt)]));function Ct(e,r){let t=0;for(let o of wt[e])for(let[a,i]of r)if(o(a))t+=i;return t}var Fe=(e,r)=>e%r;function Z(e,r=[]){let t=Be(e.name),o=[[e.displayName.toLowerCase(),ze],[e.name.toLowerCase(),ze],[e.prompt.slice(0,bt).toLowerCase(),$t]],a=0,i=[];for(let h of M){let C=Ct(h,o);if(C>a)a=C,i=[h];else if(C===a&&C>0)i.push(h)}let n=a>0?i:[...M],m=new Set(r.map((h)=>h.class)),d=n.filter((h)=>!m.has(h)),E=d.length>0?d:n,R=E[Fe(t,E.length)],w=se(R);w.skin=t%6,w.build=D[Be(`build:${e.name}`)%3];let I=Object.keys(l.palettes),p=new Map(I.map((h)=>[h,0]));for(let h of r){let C=h.palette??v(h.colors);if(C)p.set(C,(p.get(C)??0)+1)}let T=Math.min(...p.values()),f=I.filter((h)=>p.get(h)===T),x=f[Fe(t,f.length)];return w.colors={...l.palettes[x]},w.palette=x,w}export{M,K,L,J,l,y,W,ee,le,ce,ue,de,Z};