{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-profile-editor",
  "type": "registry:component",
  "title": "App Profile Editor",
  "description": "A portfolio profile editor with a live preview card beside the form, a photo upload, link rows you can add and remove, skill chips and a card color picker.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "app-ui",
    "profile",
    "editor",
    "form",
    "preview",
    "tags",
    "portfolio"
  ],
  "docs": "https://hyperblur.dev/effects/app-profile-editor",
  "files": [
    {
      "path": "registry/hyperblur/app-profile-editor.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/app-profile-editor.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AppProfileLink {\n  id: string;\n  label: string;\n  url: string;\n}\n\nexport interface AppProfileValue {\n  name: string;\n  headline: string;\n  location: string;\n  bio: string;\n  available: boolean;\n  theme: string;\n  links: AppProfileLink[];\n  tags: string[];\n  avatar?: string;\n}\n\nexport interface AppProfileEditorProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\" | \"defaultValue\"> {\n  defaultValue?: Partial<AppProfileValue>;\n  handle?: string;\n  themes?: string[];\n  maxLinks?: number;\n  maxTags?: number;\n  onChange?: (value: AppProfileValue) => void;\n  onPublish?: (value: AppProfileValue) => void;\n}\n\nconst baseValue: AppProfileValue = {\n  name: \"Maya Okafor\",\n  headline: \"Product designer, data-heavy interfaces\",\n  location: \"Lisbon, Portugal\",\n  bio: \"I design analytics tools people actually enjoy opening. Previously at Northwind and Ledgerline. Currently taking on two freelance projects for Q1.\",\n  available: true,\n  theme: \"#2f7bff\",\n  links: [\n    { id: \"l1\", label: \"Portfolio\", url: \"mayaokafor.design\" },\n    { id: \"l2\", label: \"Dribbble\", url: \"dribbble.com/mayaok\" },\n    { id: \"l3\", label: \"LinkedIn\", url: \"linkedin.com/in/mayaokafor\" },\n  ],\n  tags: [\"Product design\", \"Design systems\", \"Data viz\", \"Figma\", \"Prototyping\"],\n};\n\nconst defaultThemes = [\"#2f7bff\", \"#9b6bff\", \"#22c08a\", \"#f2a93b\", \"#ff6f5e\", \"#ededed\"];\n\nconst css = `\n.hb-ye6 {\n  --hb-ye6-theme: #2f7bff;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  min-height: 600px;\n  overflow: hidden;\n  border: 1px solid rgba(255,255,255,.08);\n  border-radius: 16px;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  font-size: 14px;\n  line-height: 1.45;\n}\n.hb-ye6 *, .hb-ye6 *::before, .hb-ye6 *::after { box-sizing: border-box; }\n.hb-ye6-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }\n.hb-ye6-top-title { margin: 0 auto 0 0; font-size: 15px; font-weight: 600; }\n.hb-ye6-top-title span { color: #737373; font-weight: 400; }\n.hb-ye6-status { display: inline-flex; align-items: center; gap: 6px; color: #8f8f8f; font-size: 12.5px; }\n.hb-ye6-status i { width: 7px; height: 7px; border-radius: 999px; background: #3ccf91; }\n.hb-ye6-status[data-dirty=\"true\"] i { background: #f5a524; }\n.hb-ye6-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; margin: 0; padding: 0 12px; border: 1px solid #262626; border-radius: 8px; background: #141414; color: #ededed; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s ease, filter .15s ease; }\n.hb-ye6-btn:hover { border-color: #3a3a3a; }\n.hb-ye6-btn[data-tone=\"primary\"] { border-color: transparent; background: #ededed; color: #0a0a0a; font-weight: 600; }\n.hb-ye6-btn[data-tone=\"primary\"]:hover { background: #fff; }\n.hb-ye6-btn svg { width: 15px; height: 15px; }\n.hb-ye6 button:focus-visible, .hb-ye6-input:focus-visible, .hb-ye6-tagbox:focus-within { outline: 2px solid var(--hb-ye6-theme); outline-offset: 1px; }\n.hb-ye6-body { display: grid; grid-template-columns: 1fr; }\n.hb-ye6-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 20px 18px 28px; }\n.hb-ye6-sec { display: flex; flex-direction: column; gap: 10px; }\n.hb-ye6-sec-h { color: #737373; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }\n.hb-ye6-avrow { display: flex; align-items: center; gap: 14px; }\n.hb-ye6-drop { position: relative; display: grid; place-items: center; width: 64px; height: 64px; flex: none; margin: 0; padding: 0; border: 1.5px dashed #3a3a3a; border-radius: 999px; background: #121212; color: #8f8f8f; cursor: pointer; overflow: hidden; transition: border-color .15s ease, color .15s ease; }\n.hb-ye6-drop:hover { border-color: var(--hb-ye6-theme); color: #ededed; }\n.hb-ye6-drop svg { width: 20px; height: 20px; }\n.hb-ye6-img { position: absolute; inset: 0; background-position: center; background-size: cover; }\n.hb-ye6-avtext { color: #8f8f8f; font-size: 12.5px; }\n.hb-ye6-avtext b { display: block; color: #ededed; font-size: 13.5px; font-weight: 500; }\n.hb-ye6-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }\n.hb-ye6-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }\n.hb-ye6-field > span { color: #a1a1a1; font-size: 12.5px; }\n.hb-ye6-input { width: 100%; height: 36px; margin: 0; padding: 0 11px; border: 1px solid #262626; border-radius: 8px; background: #111; color: #ededed; font: inherit; font-size: 13.5px; }\n.hb-ye6-input:hover { border-color: #333; }\ntextarea.hb-ye6-input { height: 78px; padding: 9px 11px; resize: vertical; line-height: 1.5; }\n.hb-ye6-links { display: flex; flex-direction: column; gap: 8px; }\n.hb-ye6-link { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; animation: hb-ye6-in .28s cubic-bezier(.2,.8,.2,1) both; }\n.hb-ye6-ib { display: grid; place-items: center; width: 32px; height: 36px; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #737373; cursor: pointer; }\n.hb-ye6-ib:hover { border-color: #262626; background: #141414; color: #ff8a8a; }\n.hb-ye6-ib svg { width: 16px; height: 16px; }\n.hb-ye6-add { align-self: flex-start; height: 30px; border-style: dashed; color: #a1a1a1; }\n.hb-ye6-tagbox { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #262626; border-radius: 10px; background: #111; cursor: text; }\n.hb-ye6-tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--hb-ye6-theme) 16%, #1a1a1a); color: color-mix(in srgb, var(--hb-ye6-theme) 45%, #fff); font-size: 12.5px; animation: hb-ye6-pop .22s cubic-bezier(.2,1.4,.4,1) both; }\n.hb-ye6-tag button { display: grid; place-items: center; width: 18px; height: 18px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: inherit; opacity: .7; cursor: pointer; }\n.hb-ye6-tag button:hover { opacity: 1; background: rgba(255,255,255,.1); }\n.hb-ye6-tag svg { width: 11px; height: 11px; }\n.hb-ye6-taginput { flex: 1; min-width: 120px; height: 26px; border: 0; background: transparent; color: #ededed; font: inherit; font-size: 13px; outline: none; }\n.hb-ye6-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.hb-ye6-swatches { display: flex; gap: 8px; }\n.hb-ye6-sw { width: 24px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 999px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); transition: transform .15s ease; }\n.hb-ye6-sw:hover { transform: scale(1.1); }\n.hb-ye6-sw[aria-checked=\"true\"] { box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px currentColor; }\n.hb-ye6-switch { position: relative; width: 36px; height: 20px; flex: none; margin: 0; padding: 0; border: 0; border-radius: 999px; background: #2a2a2a; cursor: pointer; transition: background-color .2s ease; }\n.hb-ye6-switch::after { content: \"\"; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: transform .22s cubic-bezier(.3,1.4,.5,1); }\n.hb-ye6-switch[aria-checked=\"true\"] { background: #22c08a; }\n.hb-ye6-switch[aria-checked=\"true\"]::after { transform: translateX(16px); }\n.hb-ye6-stage { position: relative; display: none; align-items: flex-start; justify-content: center; padding: 28px 24px; border-left: 1px solid rgba(255,255,255,.08); background-color: #0d0d0d; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 16px 16px; }\n.hb-ye6-stage-label { position: absolute; top: 12px; left: 14px; display: flex; align-items: center; gap: 6px; color: #737373; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }\n.hb-ye6-stage-label i { width: 6px; height: 6px; border-radius: 999px; background: #3ccf91; animation: hb-ye6-pulse 2s ease-in-out infinite; }\n.hb-ye6-card { width: 100%; max-width: 340px; margin-top: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: #111; box-shadow: 0 30px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05); overflow: hidden; }\n.hb-ye6-cover { position: relative; height: 92px; background: radial-gradient(120% 140% at 0% 0%, var(--hb-ye6-theme), transparent 60%), radial-gradient(100% 120% at 100% 100%, color-mix(in srgb, var(--hb-ye6-theme) 50%, #ff6f5e), transparent 60%), #1a1a1a; transition: background .4s ease; }\n.hb-ye6-cover::after { content: \"\"; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(180deg, #000, transparent); }\n.hb-ye6-cbody { padding: 0 18px 18px; }\n.hb-ye6-cav { position: relative; display: grid; place-items: center; width: 68px; height: 68px; margin-top: -34px; border: 4px solid #111; border-radius: 999px; background: linear-gradient(135deg, var(--hb-ye6-theme), #1f1f1f); color: #fff; font-size: 22px; font-weight: 700; overflow: hidden; }\n.hb-ye6-cname { margin-top: 10px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }\n.hb-ye6-chead { color: #a1a1a1; font-size: 13px; overflow-wrap: anywhere; }\n.hb-ye6-cmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: #8f8f8f; font-size: 12px; }\n.hb-ye6-cmeta svg { width: 13px; height: 13px; vertical-align: -2px; }\n.hb-ye6-avail { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; background: rgba(34,192,138,.14); color: #5fe0b1; font-size: 11px; font-weight: 600; animation: hb-ye6-pop .25s ease both; }\n.hb-ye6-avail i { width: 6px; height: 6px; border-radius: 999px; background: #22c08a; }\n.hb-ye6-cbio { margin: 12px 0 0; color: #d4d4d4; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }\n.hb-ye6-ctags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }\n.hb-ye6-ctags span { padding: 3px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; color: #d4d4d4; font-size: 11.5px; }\n.hb-ye6-clinks { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }\n.hb-ye6-clink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: #151515; color: #ededed; font-size: 12.5px; text-decoration: none; transition: border-color .15s ease, transform .15s ease; animation: hb-ye6-in .3s ease both; }\n.hb-ye6-clink:hover { border-color: color-mix(in srgb, var(--hb-ye6-theme) 60%, transparent); transform: translateX(2px); }\n.hb-ye6-clink i { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: color-mix(in srgb, var(--hb-ye6-theme) 20%, #1f1f1f); color: color-mix(in srgb, var(--hb-ye6-theme) 50%, #fff); font-size: 10px; font-style: normal; font-weight: 700; }\n.hb-ye6-clink span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.hb-ye6-clink small { color: #737373; font-size: 11.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 50%; }\n.hb-ye6-toast { position: absolute; right: 18px; bottom: 18px; z-index: 3; padding: 9px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: #171717; font-size: 13px; animation: hb-ye6-toast 2.6s ease both; }\n@keyframes hb-ye6-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }\n@keyframes hb-ye6-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }\n@keyframes hb-ye6-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }\n@keyframes hb-ye6-toast { 0% { opacity: 0; transform: translateY(8px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }\n@container (min-width: 520px) {\n  .hb-ye6-grid { grid-template-columns: 1fr 1fr; }\n  .hb-ye6-grid .hb-ye6-wide { grid-column: 1 / -1; }\n}\n@container (min-width: 780px) {\n  .hb-ye6-body { grid-template-columns: 1fr minmax(340px, 400px); }\n  .hb-ye6-stage { display: flex; }\n  .hb-ye6-form { padding: 22px 26px 30px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-ye6 *, .hb-ye6 *::before, .hb-ye6 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction Icon({ d }: { d: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d={d} />\n    </svg>\n  );\n}\n\nfunction initials(name: string) {\n  const p = name.split(/\\s+/).filter(Boolean);\n  return ((p[0]?.[0] ?? \"\") + (p.length > 1 ? p[p.length - 1][0] : \"\")).toUpperCase() || \"?\";\n}\n\nfunction href(url: string) {\n  return url.startsWith(\"http:\") || url.startsWith(\"https:\") ? url : `https://${url}`;\n}\n\nexport function AppProfileEditor({\n  defaultValue,\n  handle = \"folio.page/maya\",\n  themes = defaultThemes,\n  maxLinks = 6,\n  maxTags = 8,\n  onChange,\n  onPublish,\n  className,\n  style,\n  ...rest\n}: AppProfileEditorProps) {\n  const id = React.useId();\n  const [value, setValue] = React.useState<AppProfileValue>(() => ({ ...baseValue, ...defaultValue }));\n  const [published, setPublished] = React.useState(value);\n  const [tagDraft, setTagDraft] = React.useState(\"\");\n  const [toast, setToast] = React.useState(0);\n  const counter = React.useRef(0);\n  const fileRef = React.useRef<HTMLInputElement>(null);\n  const tagRef = React.useRef<HTMLInputElement>(null);\n  const linkRefs = React.useRef<Map<string, HTMLInputElement>>(new Map());\n  const focusLink = React.useRef<string | null>(null);\n\n  const dirty = JSON.stringify(value) !== JSON.stringify(published);\n\n  React.useEffect(() => {\n    if (focusLink.current) {\n      linkRefs.current.get(focusLink.current)?.focus();\n      focusLink.current = null;\n    }\n  });\n\n  React.useEffect(() => {\n    const url = value.avatar;\n    return () => {\n      if (url && url.startsWith(\"blob:\")) URL.revokeObjectURL(url);\n    };\n  }, [value.avatar]);\n\n  React.useEffect(() => {\n    if (!toast) return;\n    const t = window.setTimeout(() => setToast(0), 2600);\n    return () => window.clearTimeout(t);\n  }, [toast]);\n\n  const update = (patch: Partial<AppProfileValue>) => {\n    const next = { ...value, ...patch };\n    setValue(next);\n    onChange?.(next);\n  };\n\n  const addLink = () => {\n    if (value.links.length >= maxLinks) return;\n    counter.current += 1;\n    const linkId = `new-${counter.current}`;\n    focusLink.current = linkId;\n    update({ links: [...value.links, { id: linkId, label: \"\", url: \"\" }] });\n  };\n\n  const setLink = (linkId: string, patch: Partial<AppProfileLink>) => update({ links: value.links.map((l) => (l.id === linkId ? { ...l, ...patch } : l)) });\n  const removeLink = (linkId: string) => update({ links: value.links.filter((l) => l.id !== linkId) });\n\n  const addTag = (raw: string) => {\n    const t = raw.trim().replace(/,$/, \"\").trim();\n    if (!t || value.tags.length >= maxTags || value.tags.some((x) => x.toLowerCase() === t.toLowerCase())) return;\n    update({ tags: [...value.tags, t] });\n  };\n\n  const onTagKey = (e: React.KeyboardEvent<HTMLInputElement>) => {\n    if (e.key === \"Enter\" || e.key === \",\") {\n      e.preventDefault();\n      addTag(tagDraft);\n      setTagDraft(\"\");\n    } else if (e.key === \"Backspace\" && !tagDraft && value.tags.length) {\n      update({ tags: value.tags.slice(0, -1) });\n    }\n  };\n\n  const onFile = (e: React.ChangeEvent<HTMLInputElement>) => {\n    const f = e.target.files?.[0];\n    if (f && f.type.startsWith(\"image/\")) update({ avatar: URL.createObjectURL(f) });\n    e.target.value = \"\";\n  };\n\n  const publish = () => {\n    setPublished(value);\n    setToast((n) => n + 1);\n    onPublish?.(value);\n  };\n\n  return (\n    <div className={[\"hb-ye6\", className].filter(Boolean).join(\" \")} style={{ \"--hb-ye6-theme\": value.theme, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-app-profile-editor\" precedence=\"default\">{css}</style>\n      <header className=\"hb-ye6-top\">\n        <h2 className=\"hb-ye6-top-title\">Edit profile <span>· {handle}</span></h2>\n        <span className=\"hb-ye6-status\" data-dirty={dirty} aria-live=\"polite\"><i aria-hidden=\"true\" />{dirty ? \"Unpublished changes\" : \"Up to date\"}</span>\n        <button type=\"button\" className=\"hb-ye6-btn\" onClick={() => update(published)} disabled={!dirty}>Reset</button>\n        <button type=\"button\" className=\"hb-ye6-btn\" data-tone=\"primary\" onClick={publish}>Publish</button>\n      </header>\n      <div className=\"hb-ye6-body\">\n        <form className=\"hb-ye6-form\" onSubmit={(e) => { e.preventDefault(); publish(); }}>\n          <div className=\"hb-ye6-sec\">\n            <div className=\"hb-ye6-avrow\">\n              <button type=\"button\" className=\"hb-ye6-drop\" aria-label=\"Upload a profile photo\" onClick={() => fileRef.current?.click()}>\n                {value.avatar ? <span className=\"hb-ye6-img\" style={{ backgroundImage: `url(${value.avatar})` }} /> : <Icon d=\"M4 8h3l2-3h6l2 3h3v11H4V8Zm8 9a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z\" />}\n              </button>\n              <div className=\"hb-ye6-avtext\">\n                <b>Profile photo</b>\n                Square image, 400 px or larger.{\" \"}\n                {value.avatar && <button type=\"button\" className=\"hb-ye6-btn\" style={{ height: 24, padding: \"0 8px\", marginLeft: 4 }} onClick={() => update({ avatar: undefined })}>Remove</button>}\n              </div>\n              <input ref={fileRef} type=\"file\" accept=\"image/png,image/jpeg,image/webp,image/gif\" hidden onChange={onFile} />\n            </div>\n          </div>\n          <div className=\"hb-ye6-sec\">\n            <div className=\"hb-ye6-sec-h\">About</div>\n            <div className=\"hb-ye6-grid\">\n              <label className=\"hb-ye6-field\">\n                <span>Name</span>\n                <input className=\"hb-ye6-input\" value={value.name} maxLength={40} onChange={(e) => update({ name: e.target.value })} />\n              </label>\n              <label className=\"hb-ye6-field\">\n                <span>Location</span>\n                <input className=\"hb-ye6-input\" value={value.location} maxLength={40} onChange={(e) => update({ location: e.target.value })} />\n              </label>\n              <label className=\"hb-ye6-field hb-ye6-wide\">\n                <span>Headline</span>\n                <input className=\"hb-ye6-input\" value={value.headline} maxLength={60} onChange={(e) => update({ headline: e.target.value })} />\n              </label>\n              <label className=\"hb-ye6-field hb-ye6-wide\">\n                <span>Bio</span>\n                <textarea className=\"hb-ye6-input\" value={value.bio} maxLength={220} onChange={(e) => update({ bio: e.target.value })} />\n              </label>\n            </div>\n          </div>\n          <div className=\"hb-ye6-sec\">\n            <div className=\"hb-ye6-sec-h\">Links</div>\n            <div className=\"hb-ye6-links\">\n              {value.links.map((l, i) => (\n                <div className=\"hb-ye6-link\" key={l.id}>\n                  <input className=\"hb-ye6-input\" placeholder=\"Label\" aria-label={`Link ${i + 1} label`} value={l.label} ref={(el) => { if (el) linkRefs.current.set(l.id, el); else linkRefs.current.delete(l.id); }} onChange={(e) => setLink(l.id, { label: e.target.value })} />\n                  <input className=\"hb-ye6-input\" placeholder=\"example.com/you\" aria-label={`Link ${i + 1} address`} value={l.url} onChange={(e) => setLink(l.id, { url: e.target.value })} />\n                  <button type=\"button\" className=\"hb-ye6-ib\" aria-label={`Remove ${l.label || `link ${i + 1}`}`} onClick={() => removeLink(l.id)}><Icon d=\"M5 7h14M10 11v6m4-6v6M6 7l1 13h10l1-13M9 7V4h6v3\" /></button>\n                </div>\n              ))}\n              <button type=\"button\" className=\"hb-ye6-btn hb-ye6-add\" onClick={addLink} disabled={value.links.length >= maxLinks}><Icon d=\"M12 5v14M5 12h14\" />Add link</button>\n            </div>\n          </div>\n          <div className=\"hb-ye6-sec\">\n            <div className=\"hb-ye6-sec-h\" id={`${id}-tags`}>Skills <span style={{ textTransform: \"none\", letterSpacing: 0, fontWeight: 400 }}>· {value.tags.length}/{maxTags}</span></div>\n            <div className=\"hb-ye6-tagbox\" onClick={() => tagRef.current?.focus()}>\n              {value.tags.map((t) => (\n                <span className=\"hb-ye6-tag\" key={t}>\n                  {t}\n                  <button type=\"button\" aria-label={`Remove ${t}`} onClick={(e) => { e.stopPropagation(); update({ tags: value.tags.filter((x) => x !== t) }); }}><Icon d=\"M6 6l12 12M18 6 6 18\" /></button>\n                </span>\n              ))}\n              <input\n                ref={tagRef}\n                className=\"hb-ye6-taginput\"\n                value={tagDraft}\n                aria-labelledby={`${id}-tags`}\n                placeholder={value.tags.length >= maxTags ? \"Limit reached\" : \"Add a skill and press Enter\"}\n                disabled={value.tags.length >= maxTags}\n                onChange={(e) => setTagDraft(e.target.value)}\n                onKeyDown={onTagKey}\n                onBlur={() => { if (tagDraft.trim()) { addTag(tagDraft); setTagDraft(\"\"); } }}\n              />\n            </div>\n          </div>\n          <div className=\"hb-ye6-sec\">\n            <div className=\"hb-ye6-row\">\n              <div>\n                <div style={{ fontSize: 13.5, fontWeight: 500 }}>Open to work</div>\n                <div className=\"hb-ye6-avtext\">Shows a badge on your public card.</div>\n              </div>\n              <button type=\"button\" role=\"switch\" aria-checked={value.available} aria-label=\"Open to work\" className=\"hb-ye6-switch\" onClick={() => update({ available: !value.available })} />\n            </div>\n            <div className=\"hb-ye6-row\">\n              <div style={{ fontSize: 13.5, fontWeight: 500 }} id={`${id}-theme`}>Card color</div>\n              <div className=\"hb-ye6-swatches\" role=\"radiogroup\" aria-labelledby={`${id}-theme`}>\n                {themes.map((t, i) => (\n                  <button\n                    key={t}\n                    type=\"button\"\n                    role=\"radio\"\n                    aria-checked={value.theme === t}\n                    aria-label={t}\n                    tabIndex={value.theme === t ? 0 : -1}\n                    className=\"hb-ye6-sw\"\n                    style={{ background: t, color: t }}\n                    onClick={() => update({ theme: t })}\n                    onKeyDown={(e) => {\n                      const dir = e.key === \"ArrowRight\" || e.key === \"ArrowDown\" ? 1 : e.key === \"ArrowLeft\" || e.key === \"ArrowUp\" ? -1 : 0;\n                      if (!dir) return;\n                      e.preventDefault();\n                      const next = themes[(i + dir + themes.length) % themes.length];\n                      update({ theme: next });\n                      const sib = (e.currentTarget.parentElement?.children[(i + dir + themes.length) % themes.length] as HTMLButtonElement | undefined);\n                      sib?.focus();\n                    }}\n                  />\n                ))}\n              </div>\n            </div>\n          </div>\n        </form>\n        <aside className=\"hb-ye6-stage\" aria-label=\"Live preview\">\n          <span className=\"hb-ye6-stage-label\"><i aria-hidden=\"true\" />Live preview</span>\n          <article className=\"hb-ye6-card\">\n            <div className=\"hb-ye6-cover\" />\n            <div className=\"hb-ye6-cbody\">\n              <div className=\"hb-ye6-cav\">\n                {initials(value.name)}\n                {value.avatar && <span className=\"hb-ye6-img\" style={{ backgroundImage: `url(${value.avatar})` }} />}\n              </div>\n              <div className=\"hb-ye6-cname\">{value.name || \"Your name\"}</div>\n              <div className=\"hb-ye6-chead\">{value.headline || \"Add a headline\"}</div>\n              <div className=\"hb-ye6-cmeta\">\n                {value.location && <span><Icon d=\"M12 21s7-6.2 7-11.5a7 7 0 1 0-14 0C5 14.8 12 21 12 21Zm0-9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z\" /> {value.location}</span>}\n                {value.available && <span className=\"hb-ye6-avail\"><i />Open to work</span>}\n              </div>\n              {value.bio && <p className=\"hb-ye6-cbio\">{value.bio}</p>}\n              {value.tags.length > 0 && <div className=\"hb-ye6-ctags\">{value.tags.map((t) => <span key={t}>{t}</span>)}</div>}\n              {value.links.some((l) => l.url) && (\n                <div className=\"hb-ye6-clinks\">\n                  {value.links.filter((l) => l.url).map((l) => (\n                    <a key={l.id} className=\"hb-ye6-clink\" href={href(l.url)} target=\"_blank\" rel=\"noreferrer\">\n                      <i>{(l.label || l.url).charAt(0).toUpperCase()}</i>\n                      <span>{l.label || \"Link\"}</span>\n                      <small>{l.url.replace(/^https?:\\W+/, \"\")}</small>\n                    </a>\n                  ))}\n                </div>\n              )}\n            </div>\n          </article>\n        </aside>\n      </div>\n      {toast > 0 && <div className=\"hb-ye6-toast\" role=\"status\" key={toast}>Profile published to {handle}</div>}\n    </div>\n  );\n}\n\nexport default AppProfileEditor;\n"
    }
  ]
}