brief-lens 0.1.2 → 0.1.3

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 (85) hide show
  1. package/dist/python/prompts/chat_insights.md +34 -0
  2. package/dist/python/src/chat_cli.py +28 -9
  3. package/dist/python/src/chat_insights.py +200 -0
  4. package/dist/python/src/local_llm/config.py +5 -0
  5. package/dist/python/src/local_llm/indexer.py +63 -10
  6. package/dist/python/src/workflow/definitions/chat_insights.py +83 -0
  7. package/dist/python/src/workflow/definitions/daily.py +4 -1
  8. package/dist/python/web/routers/chat.py +36 -19
  9. package/dist/python/web/routers/config.py +28 -0
  10. package/dist/web/.next-pack/BUILD_ID +1 -1
  11. package/dist/web/.next-pack/app-build-manifest.json +33 -32
  12. package/dist/web/.next-pack/app-path-routes-manifest.json +1 -1
  13. package/dist/web/.next-pack/build-manifest.json +2 -2
  14. package/dist/web/.next-pack/prerender-manifest.json +1 -1
  15. package/dist/web/.next-pack/server/app/(main)/auth/page.js.nft.json +1 -1
  16. package/dist/web/.next-pack/server/app/(main)/auth/page_client-reference-manifest.js +1 -1
  17. package/dist/web/.next-pack/server/app/(main)/briefing/page.js.nft.json +1 -1
  18. package/dist/web/.next-pack/server/app/(main)/briefing/page_client-reference-manifest.js +1 -1
  19. package/dist/web/.next-pack/server/app/(main)/chat/page.js +1 -1
  20. package/dist/web/.next-pack/server/app/(main)/chat/page.js.nft.json +1 -1
  21. package/dist/web/.next-pack/server/app/(main)/chat/page_client-reference-manifest.js +1 -1
  22. package/dist/web/.next-pack/server/app/(main)/config/usage/page.js.nft.json +1 -1
  23. package/dist/web/.next-pack/server/app/(main)/config/usage/page_client-reference-manifest.js +1 -1
  24. package/dist/web/.next-pack/server/app/(main)/credentials/page.js.nft.json +1 -1
  25. package/dist/web/.next-pack/server/app/(main)/credentials/page_client-reference-manifest.js +1 -1
  26. package/dist/web/.next-pack/server/app/(main)/geopolitical/page.js.nft.json +1 -1
  27. package/dist/web/.next-pack/server/app/(main)/geopolitical/page_client-reference-manifest.js +1 -1
  28. package/dist/web/.next-pack/server/app/(main)/journal/page.js +1 -1
  29. package/dist/web/.next-pack/server/app/(main)/journal/page.js.nft.json +1 -1
  30. package/dist/web/.next-pack/server/app/(main)/journal/page_client-reference-manifest.js +1 -1
  31. package/dist/web/.next-pack/server/app/(main)/monitor/page.js.nft.json +1 -1
  32. package/dist/web/.next-pack/server/app/(main)/monitor/page_client-reference-manifest.js +1 -1
  33. package/dist/web/.next-pack/server/app/(main)/portfolio/page.js.nft.json +1 -1
  34. package/dist/web/.next-pack/server/app/(main)/portfolio/page_client-reference-manifest.js +1 -1
  35. package/dist/web/.next-pack/server/app/(main)/run/page.js.nft.json +1 -1
  36. package/dist/web/.next-pack/server/app/(main)/run/page_client-reference-manifest.js +1 -1
  37. package/dist/web/.next-pack/server/app/(main)/watch-sectors/page.js.nft.json +1 -1
  38. package/dist/web/.next-pack/server/app/(main)/watch-sectors/page_client-reference-manifest.js +1 -1
  39. package/dist/web/.next-pack/server/app/(main)/workspace/page.js.nft.json +1 -1
  40. package/dist/web/.next-pack/server/app/(main)/workspace/page_client-reference-manifest.js +1 -1
  41. package/dist/web/.next-pack/server/app/_not-found/page.js.nft.json +1 -1
  42. package/dist/web/.next-pack/server/app/_not-found/page_client-reference-manifest.js +1 -1
  43. package/dist/web/.next-pack/server/app/_not-found.html +2 -2
  44. package/dist/web/.next-pack/server/app/_not-found.rsc +1 -1
  45. package/dist/web/.next-pack/server/app/api/[...path]/route.js.nft.json +1 -1
  46. package/dist/web/.next-pack/server/app/api/attachments/[...path]/route.js.nft.json +1 -1
  47. package/dist/web/.next-pack/server/app/api/attachments/upload/route.js.nft.json +1 -1
  48. package/dist/web/.next-pack/server/app/api/images/[...path]/route.js.nft.json +1 -1
  49. package/dist/web/.next-pack/server/app/api/images/upload/route.js.nft.json +1 -1
  50. package/dist/web/.next-pack/server/app/icon.svg/route.js.nft.json +1 -1
  51. package/dist/web/.next-pack/server/app/page.js +9 -9
  52. package/dist/web/.next-pack/server/app/page.js.nft.json +1 -1
  53. package/dist/web/.next-pack/server/app/page_client-reference-manifest.js +1 -1
  54. package/dist/web/.next-pack/server/app-paths-manifest.json +6 -6
  55. package/dist/web/.next-pack/server/chunks/1442.js +2 -2
  56. package/dist/web/.next-pack/server/chunks/899.js +1 -0
  57. package/dist/web/.next-pack/server/pages/404.html +2 -2
  58. package/dist/web/.next-pack/server/pages/500.html +1 -1
  59. package/dist/web/.next-pack/server/pages/_app.js.nft.json +1 -1
  60. package/dist/web/.next-pack/server/pages/_document.js.nft.json +1 -1
  61. package/dist/web/.next-pack/server/pages/_error.js.nft.json +1 -1
  62. package/dist/web/.next-pack/server/server-reference-manifest.json +1 -1
  63. package/dist/web/.next-pack/static/chunks/2793-3a816c3e63003cd6.js +1 -0
  64. package/dist/web/.next-pack/static/chunks/4397-f2bbfac974a09e4a.js +1 -0
  65. package/dist/web/.next-pack/static/chunks/6739-73ae2a518896a21d.js +1 -0
  66. package/dist/web/.next-pack/static/chunks/9095-7b51a045d7ef3c03.js +1 -0
  67. package/dist/web/.next-pack/static/chunks/app/(main)/briefing/page-2bd110800f6f6092.js +1 -0
  68. package/dist/web/.next-pack/static/chunks/app/(main)/chat/page-4787522c9ae8eb98.js +1 -0
  69. package/dist/web/.next-pack/static/chunks/app/(main)/journal/page-f06bd837eb652eec.js +1 -0
  70. package/dist/web/.next-pack/static/chunks/app/(main)/layout-722c5f8b47c03713.js +1 -0
  71. package/dist/web/.next-pack/static/chunks/app/page-31f1d43bab366b86.js +1 -0
  72. package/dist/web/.next-pack/static/css/eeafe748380067e9.css +3 -0
  73. package/package.json +1 -1
  74. package/dist/web/.next-pack/server/chunks/3462.js +0 -1
  75. package/dist/web/.next-pack/static/chunks/2941-b28caa63b1192cbf.js +0 -1
  76. package/dist/web/.next-pack/static/chunks/6739-26a12feb3f34ac69.js +0 -1
  77. package/dist/web/.next-pack/static/chunks/8480-3e063ceeceee7e6a.js +0 -1
  78. package/dist/web/.next-pack/static/chunks/app/(main)/briefing/page-32855bc0aad3c4c5.js +0 -1
  79. package/dist/web/.next-pack/static/chunks/app/(main)/chat/page-f176f405e29e9deb.js +0 -1
  80. package/dist/web/.next-pack/static/chunks/app/(main)/journal/page-d0b70496ffe17f8d.js +0 -1
  81. package/dist/web/.next-pack/static/chunks/app/(main)/layout-b0cecbd1d6c9d290.js +0 -1
  82. package/dist/web/.next-pack/static/chunks/app/page-ecd907ac75b147cf.js +0 -1
  83. package/dist/web/.next-pack/static/css/ddefc688f27e14b2.css +0 -3
  84. /package/dist/web/.next-pack/static/{VdoUHqMuKEB2yUBQvac5b → HRelvfbIJ8aRo0S_dK4jo}/_buildManifest.js +0 -0
  85. /package/dist/web/.next-pack/static/{VdoUHqMuKEB2yUBQvac5b → HRelvfbIJ8aRo0S_dK4jo}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ @font-face{font-family:__geistSans_1e4310;src:url(/_next/static/media/4473ecc91f70f139-s.p.woff) format("woff");font-display:swap;font-weight:100 900}@font-face{font-family:__geistSans_Fallback_1e4310;src:local("Arial");ascent-override:85.83%;descent-override:20.52%;line-gap-override:9.33%;size-adjust:107.19%}.__className_1e4310{font-family:__geistSans_1e4310,__geistSans_Fallback_1e4310}.__variable_1e4310{--font-geist-sans:"__geistSans_1e4310","__geistSans_Fallback_1e4310"}@font-face{font-family:__geistMono_c3aa02;src:url(/_next/static/media/463dafcda517f24f-s.p.woff) format("woff");font-display:swap;font-weight:100 900}@font-face{font-family:__geistMono_Fallback_c3aa02;src:local("Arial");ascent-override:69.97%;descent-override:16.73%;line-gap-override:7.61%;size-adjust:131.49%}.__className_c3aa02{font-family:__geistMono_c3aa02,__geistMono_Fallback_c3aa02}.__variable_c3aa02{--font-geist-mono:"__geistMono_c3aa02","__geistMono_Fallback_c3aa02"}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*
2
+ ! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
3
+ */*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{color-scheme:light;--background:0 0% 100%;--foreground:222.2 84% 4.9%;--card:0 0% 100%;--card-foreground:222.2 84% 4.9%;--popover:0 0% 100%;--popover-foreground:222.2 84% 4.9%;--primary:222.2 47.4% 11.2%;--primary-foreground:210 40% 98%;--secondary:210 40% 96.1%;--secondary-foreground:222.2 47.4% 11.2%;--muted:210 40% 96.1%;--muted-foreground:215.4 16.3% 46.9%;--accent:210 40% 96.1%;--accent-foreground:222.2 47.4% 11.2%;--destructive:0 84.2% 60.2%;--destructive-foreground:210 40% 98%;--border:214.3 31.8% 91.4%;--input:214.3 31.8% 91.4%;--ring:222.2 84% 4.9%;--radius:0.5rem;--bg-soft-start:210 40% 98%;--bg-soft-mid:220 35% 92%;--bg-soft-end:225 30% 88%;--series-1:#86b6ef;--series-2:#5598e7;--series-3:#2f7fd9;--series-4:#2264b8;--series-5:#1a4b8f;--series-6:#123566}.dark{color-scheme:dark;--background:222.2 84% 4.9%;--foreground:210 40% 98%;--card:222.2 84% 4.9%;--card-foreground:210 40% 98%;--popover:222.2 84% 4.9%;--popover-foreground:210 40% 98%;--primary:210 40% 98%;--primary-foreground:222.2 47.4% 11.2%;--secondary:217.2 32.6% 17.5%;--secondary-foreground:210 40% 98%;--muted:217.2 32.6% 17.5%;--muted-foreground:215 20.2% 65.1%;--accent:217.2 32.6% 17.5%;--accent-foreground:210 40% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:210 40% 98%;--border:217.2 32.6% 17.5%;--input:217.2 32.6% 17.5%;--ring:212.7 26.8% 83.9%;--bg-soft-start:222.2 84% 6%;--bg-soft-mid:220 50% 8%;--bg-soft-end:217.2 35% 12%;--series-1:#9fd4fa;--series-2:#7ab8f2;--series-3:#55a0ea;--series-4:#3987e5;--series-5:#2a6ecb;--series-6:#1f52a0}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}html[data-bg=soft] body{background:radial-gradient(circle at top left,hsl(var(--bg-soft-start)) 0,hsl(var(--bg-soft-mid)) 40%,hsl(var(--bg-soft-end)) 100%)}html[data-bg=soft]:not(.dark){--border:214.3 31.8% 78%;--input:214.3 31.8% 78%}.\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\201C""\201D""\2018""\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:rgba(17,24,39,.1);--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:hsla(0,0%,100%,.1);--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[80vh\]{height:80vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-80{max-height:20rem}.max-h-\[70vh\]{max-height:70vh}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\[7rem\]{min-height:7rem}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-48{width:12rem}.w-56{width:14rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[80vw\]{width:80vw}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[10rem\]{min-width:10rem}.max-w-3xl{max-width:48rem}.max-w-\[160px\]{max-width:160px}.max-w-\[80\%\]{max-width:80%}.max-w-\[80vw\]{max-width:80vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.origin-top-right{transform-origin:top right}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.-translate-y-full{--tw-translate-y:-100%}.-translate-y-full,.translate-x-\[-50\%\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x:-50%}.translate-y-\[-50\%\]{--tw-translate-y:-50%}.-rotate-45,.translate-y-\[-50\%\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-45{--tw-rotate:-45deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-zoom-in{cursor:zoom-in}.resize-none{resize:none}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-3{column-gap:.75rem}.gap-x-4{column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-br-md{border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-border{border-color:hsl(var(--border))}.border-destructive\/40{border-color:hsl(var(--destructive)/.4)}.border-green-700{--tw-border-opacity:1;border-color:rgb(21 128 61/var(--tw-border-opacity,1))}.border-input{border-color:hsl(var(--input))}.border-muted-foreground\/40{border-color:hsl(var(--muted-foreground)/.4)}.border-muted-foreground\/60{border-color:hsl(var(--muted-foreground)/.6)}.border-primary{border-color:hsl(var(--primary))}.border-red-700{--tw-border-opacity:1;border-color:rgb(185 28 28/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-accent\/60{background-color:hsl(var(--accent)/.6)}.bg-background{background-color:hsl(var(--background))}.bg-background\/30{background-color:hsl(var(--background)/.3)}.bg-black\/80{background-color:rgba(0,0,0,.8)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.bg-card{background-color:hsl(var(--card))}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/5{background-color:hsl(var(--destructive)/.05)}.bg-foreground{background-color:hsl(var(--foreground))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.bg-gray-950{--tw-bg-opacity:1;background-color:rgb(3 7 18/var(--tw-bg-opacity,1))}.bg-green-600\/70{background-color:rgba(22,163,74,.7)}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted)/.5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-600\/70{background-color:rgba(220,38,38,.7)}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from:#60a5fa var(--tw-gradient-from-position);--tw-gradient-to:rgba(96,165,250,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from:#3b82f6 var(--tw-gradient-from-position);--tw-gradient-to:rgba(59,130,246,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-blue-600{--tw-gradient-from:#2563eb var(--tw-gradient-from-position);--tw-gradient-to:rgba(37,99,235,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-blue-700{--tw-gradient-from:#1d4ed8 var(--tw-gradient-from-position);--tw-gradient-to:rgba(29,78,216,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-blue-300{--tw-gradient-to:#93c5fd var(--tw-gradient-to-position)}.to-blue-400{--tw-gradient-to:#60a5fa var(--tw-gradient-to-position)}.to-blue-500{--tw-gradient-to:#3b82f6 var(--tw-gradient-to-position)}.to-blue-600{--tw-gradient-to:#2563eb var(--tw-gradient-to-position)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-0{padding-right:0}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-6{padding-right:1.5rem}.pr-7{padding-right:1.75rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-700{--tw-text-opacity:1;color:rgb(180 83 9/var(--tw-text-opacity,1))}.text-background{color:hsl(var(--background))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/70{color:hsl(var(--muted-foreground)/.7)}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-none{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-primary{--tw-ring-color:hsl(var(--primary))}.ring-offset-0{--tw-ring-offset-width:0px}.ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.blur{--tw-blur:blur(8px)}.blur,.brightness-100{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-100{--tw-brightness:brightness(1)}.brightness-110{--tw-brightness:brightness(1.1)}.brightness-110,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.duration-200{animation-duration:.2s}.running{animation-play-state:running}.\[animation-delay\:-0\.15s\]{animation-delay:-.15s}.\[animation-delay\:-0\.3s\]{animation-delay:-.3s}.dark .prose{--tw-prose-invert-body:#fff}.scrollbar-slim{scrollbar-width:thin;scrollbar-color:hsl(var(--muted-foreground)/.35) transparent}.scrollbar-slim::-webkit-scrollbar{width:6px}.scrollbar-slim::-webkit-scrollbar-thumb{background:hsl(var(--muted-foreground)/.35);border-radius:999px}.scrollbar-slim::-webkit-scrollbar-track{background:transparent}[data-sidebar-rail]{width:var(--sidebar-width,15rem);overflow-x:hidden}html[data-sidebar-collapsed=true] [data-sidebar-rail]{width:3.5rem}[data-sidebar-label],[data-sidebar-row]{white-space:nowrap}html[data-sidebar-collapsed=true] [data-sidebar-brand],html[data-sidebar-collapsed=true] [data-sidebar-label]{display:none}html[data-sidebar-collapsed=true] [data-sidebar-header]{justify-content:center}html[data-sidebar-collapsed=true] [data-sidebar-row]{justify-content:center;padding-left:0;padding-right:0}html[data-sidebar-collapsed=true] [data-sidebar-toggle-icon]:before{content:"›"}html:not([data-sidebar-collapsed=true]) [data-sidebar-toggle-icon]:before{content:"‹"}.dark\:prose-invert:is(.dark *){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-kbd:var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows:var(--tw-prose-invert-kbd-shadows);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}.file\:border-0::file-selector-button{border-width:0}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.last\:border-0:last-child{border-width:0}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent)/.5)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive)/.8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary)/.8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\:from-blue-700:hover{--tw-gradient-from:#1d4ed8 var(--tw-gradient-from-position);--tw-gradient-to:rgba(29,78,216,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.hover\:to-blue-400:hover{--tw-gradient-to:#60a5fa var(--tw-gradient-to-position)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.focus\:opacity-100:focus,.hover\:opacity-100:hover{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-1:focus,.focus\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\:ring-white\/60:focus{--tw-ring-color:hsla(0,0%,100%,.6)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.focus-visible\:ring-blue-400:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(96 165 250/var(--tw-ring-opacity,1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:bg-primary\/50{background-color:hsl(var(--primary)/.5)}.group:hover .group-hover\:opacity-100{opacity:1}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.prose-headings\:scroll-mt-4 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){scroll-margin-top:1rem}.prose-a\:text-blue-600 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.prose-a\:no-underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:none}.hover\:prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{text-decoration-line:underline}.dark\:text-amber-400:is(.dark *){--tw-text-opacity:1;color:rgb(251 191 36/var(--tw-text-opacity,1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.dark\:prose-a\:text-blue-400 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width:768px){.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:1024px){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-\[length\:var\(--doc-width\)\]{width:var(--doc-width)}.lg\:flex-none{flex:none}.lg\:pr-4{padding-right:1rem}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brief-lens",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Personal market-intelligence briefing agent — local Web UI driven by the Claude Code CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- "use strict";exports.id=3462,exports.ids=[3462],exports.modules={75858:(e,t,a)=>{a.d(t,{J:()=>f});var n=a(10326),r=a(17577);async function l(e){let t=new FormData;t.append("file",e);let a=await fetch("/api/images/upload",{method:"POST",body:t}),n=await a.json();if(!a.ok||!n.url||!n.path)throw Error(n.error??"Upload failed, please try again");return{url:n.url,path:n.path}}function i({onAttach:e,disabled:t}){let a=(0,r.useRef)(null),[i,s]=(0,r.useState)(null),[c,u]=(0,r.useState)(!1);async function o(t){let n=t.target.files?.[0];if(n){s(null),u(!0);try{let t=await l(n);e(t)}catch(e){s(e instanceof Error?e.message:"Upload failed, please try again")}finally{u(!1),a.current&&(a.current.value="")}}}return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[n.jsx("input",{ref:a,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:o}),n.jsx("button",{type:"button","aria-label":"Attach image",disabled:t||c,onClick:()=>a.current?.click(),className:"flex h-8 w-8 items-center justify-center rounded-md border bg-background text-sm font-medium hover:bg-accent disabled:opacity-50",children:c?"…":"+"}),i&&n.jsx("p",{className:"text-xs text-destructive",children:i})]})}var s=a(80380);function c({image:e,onRemove:t}){return(0,n.jsxs)("div",{className:"relative inline-block",children:[n.jsx("img",{src:e.url,alt:"Attached image","aria-label":"Attached image",className:"h-16 w-16 rounded-md border object-cover"}),n.jsx("button",{type:"button","aria-label":"Remove attached image",onClick:t,className:"absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-[10px] text-destructive-foreground",children:n.jsx(s.Z,{"aria-hidden":!0,className:"h-3 w-3"})})]})}var u=a(35315);let o=(0,u.Z)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),d=(0,u.Z)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);async function m(e){let t=new FormData;t.append("file",e);let a=await fetch("/api/attachments/upload",{method:"POST",body:t}),n=await a.json();if(!a.ok||!n.url||!n.path||!n.name)throw Error(n.error??"Upload failed, please try again");return{url:n.url,path:n.path,name:n.name}}function p({onAttachImage:e,onInsertFile:t,disabled:a}){let i=(0,r.useRef)(null),s=(0,r.useRef)(null),c=(0,r.useRef)(null),[u,p]=(0,r.useState)(!1),[f,h]=(0,r.useState)(!1),[g,x]=(0,r.useState)(null);async function b(t){let a=t.target.files?.[0];if(a){x(null),h(!0);try{e(await l(a))}catch(e){x(e instanceof Error?e.message:"Upload failed, please try again")}finally{h(!1),i.current&&(i.current.value="")}}}async function y(e){let a=e.target.files?.[0];if(a){x(null),h(!0);try{let e=await m(a);t(`[${e.name}](${e.url})`)}catch(e){x(e instanceof Error?e.message:"Upload failed, please try again")}finally{h(!1),s.current&&(s.current.value="")}}}return(0,n.jsxs)("div",{ref:c,className:"relative flex flex-col gap-1",children:[n.jsx("input",{ref:i,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:b}),n.jsx("input",{ref:s,type:"file",accept:".pdf,.csv,.txt,.md",className:"hidden",onChange:y}),n.jsx("button",{type:"button","aria-label":"Attach","aria-haspopup":"menu","aria-expanded":u,disabled:a||f,onClick:()=>p(e=>!e),className:"flex h-8 w-8 items-center justify-center rounded-md border bg-background text-sm font-medium hover:bg-accent disabled:opacity-50",children:f?"…":"+"}),u&&(0,n.jsxs)("div",{role:"menu",className:"absolute bottom-full left-0 z-10 mb-1 min-w-[10rem] overflow-hidden rounded-md border bg-popover py-1 text-sm shadow-md",children:[(0,n.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{p(!1),i.current?.click()},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-accent",children:[n.jsx(o,{"aria-hidden":!0,className:"h-4 w-4"}),"Insert image"]}),(0,n.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{p(!1),s.current?.click()},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-accent",children:[n.jsx(d,{"aria-hidden":!0,className:"h-4 w-4"}),"Attach file"]})]}),g&&n.jsx("p",{className:"text-xs text-destructive",children:g})]})}function f({attachedImage:e,onAttach:t,onRemove:a,disabled:r,isDragging:l,onInsertFile:s}){return(0,n.jsxs)("div",{className:`flex items-center gap-2 ${l?"ring-2 ring-primary rounded-md":""}`,children:[s?n.jsx(p,{onAttachImage:t,onInsertFile:s,disabled:r}):n.jsx(i,{onAttach:t,disabled:r}),e&&n.jsx(c,{image:e,onRemove:a})]})}},68517:(e,t,a)=>{a.d(t,{x:()=>l});var n=a(10326),r=a(77863);function l({label:e="Thinking",className:t,...a}){return(0,n.jsxs)("span",{role:"status","aria-label":e||"loading",className:(0,r.cn)("inline-flex items-center gap-1.5 text-current",t),...a,children:[e&&n.jsx("span",{className:"text-xs text-muted-foreground",children:e}),(0,n.jsxs)("span",{className:"inline-flex items-end gap-1",children:[n.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-current opacity-70 [animation-delay:-0.3s]"}),n.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-current opacity-70 [animation-delay:-0.15s]"}),n.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-current opacity-70"})]})]})}},94557:(e,t,a)=>{a.d(t,{fO:()=>s,od:()=>c,zC:()=>i});var n=a(64455),r=a(95732);function l(){let e=new Map;return t=>{let a=t.toLowerCase().replace(/[\s]+/g,"-").replace(/["'`()[\]{}<>()「」、。,.!?!?::;;/\\|#*~]/g,""),n=e.get(a)??0;return e.set(a,n+1),0===n?a:`${a}-${n}`}}function i(){return e=>{let t=l();(0,r.Vn)(e,"element",e=>{/^h[1-3]$/.test(e.tagName)&&(e.properties={...e.properties,id:t(function e(t){return"text"===t.type?t.value:"children"in t?t.children.map(e).join(""):""}(e))})})}}let s={...n.R,clobberPrefix:"",attributes:{...n.R.attributes,h1:[...n.R.attributes?.h1??[],"id"],h2:[...n.R.attributes?.h2??[],"id"],h3:[...n.R.attributes?.h3??[],"id"]}};function c(e){let t=l(),a=[];for(let n of e.split("\n")){let e=n.match(/^(#{1,3})\s+(.+)/);if(!e)continue;let r=e[2].trim();a.push({id:t(r),text:r,level:e[1].length})}return a}},71089:(e,t,a)=>{a.d(t,{H:()=>r});var n=a(17577);function r(e,t){let[a,r]=(0,n.useState)(!1);return(0,n.useRef)(t).current=t,{isDragging:a}}},55786:(e,t,a)=>{a.d(t,{x:()=>r});var n=a(17577);function r({onTranscript:e,lang:t="ja-JP"}){let[a,r]=(0,n.useState)(!1),[l,i]=(0,n.useState)(!1),s=(0,n.useRef)(null);((0,n.useRef)(""),(0,n.useRef)(!0),(0,n.useRef)(e)).current=e;let c=(0,n.useCallback)(e=>{if(l){s.current?.stop();return}},[t,l]);return{supportsMic:a,listening:l,toggle:c}}},32457:(e,t,a)=>{a.d(t,{B:()=>n});function n(e,t,a){if(!e)return t+a;let n=e.value,r=e.selectionStart??n.length,l=e.selectionEnd??n.length,i=n.slice(0,r)+a+n.slice(l),s=r+a.length;return requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(s,s)}),i}},43179:(e,t,a)=>{a.d(t,{Z:()=>n});let n=(0,a(35315).Z)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]])},90197:(e,t,a)=>{a.d(t,{Z:()=>n});let n=(0,a(35315).Z)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])}};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2941],{20580:function(e,t,n){n.d(t,{Qq:function(){return i},Tw:function(){return u},XH:function(){return o},h0:function(){return c},jG:function(){return l}});var r=n(57437);function a(e){let{size:t=14,children:n}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n})}function l(e){return(0,r.jsxs)(a,{...e,children:[(0,r.jsx)("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),(0,r.jsx)("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),(0,r.jsx)("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),(0,r.jsx)("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]})}function i(e){return(0,r.jsxs)(a,{...e,children:[(0,r.jsx)("path",{d:"M15 3h6v6"}),(0,r.jsx)("path",{d:"M9 21H3v-6"}),(0,r.jsx)("path",{d:"M21 3l-7 7"}),(0,r.jsx)("path",{d:"M3 21l7-7"})]})}function u(e){return(0,r.jsxs)(a,{...e,children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function o(e){let{size:t=14}=e;return(0,r.jsxs)(a,{size:t,children:[(0,r.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,r.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,r.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,r.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function c(e){let{size:t=12}=e;return(0,r.jsxs)(a,{size:t,children:[(0,r.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,r.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,r.jsx)("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}},83379:function(e,t,n){n.d(t,{J:function(){return m}});var r=n(57437),a=n(2265),l=n(83494);function i(e){let{onAttach:t,disabled:n}=e,i=(0,a.useRef)(null),[u,o]=(0,a.useState)(null),[c,s]=(0,a.useState)(!1);async function d(e){var n;let r=null===(n=e.target.files)||void 0===n?void 0:n[0];if(r){o(null),s(!0);try{let e=await (0,l.I)(r);t(e)}catch(e){o(e instanceof Error?e.message:"Upload failed, please try again")}finally{s(!1),i.current&&(i.current.value="")}}}return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("input",{ref:i,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:d}),(0,r.jsx)("button",{type:"button","aria-label":"Attach image",disabled:n||c,onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.click()},className:"flex h-8 w-8 items-center justify-center rounded-md border bg-background text-sm font-medium hover:bg-accent disabled:opacity-50",children:c?"…":"+"}),u&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:u})]})}var u=n(54891);function o(e){let{image:t,onRemove:n}=e;return(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsx)("img",{src:t.url,alt:"Attached image","aria-label":"Attached image",className:"h-16 w-16 rounded-md border object-cover"}),(0,r.jsx)("button",{type:"button","aria-label":"Remove attached image",onClick:n,className:"absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-[10px] text-destructive-foreground",children:(0,r.jsx)(u.Z,{"aria-hidden":!0,className:"h-3 w-3"})})]})}var c=n(58135);let s=(0,c.Z)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),d=(0,c.Z)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);async function f(e){let t=new FormData;t.append("file",e);let n=await fetch("/api/attachments/upload",{method:"POST",body:t}),r=await n.json();if(!n.ok||!r.url||!r.path||!r.name){var a;throw Error(null!==(a=r.error)&&void 0!==a?a:"Upload failed, please try again")}return{url:r.url,path:r.path,name:r.name}}function h(e){let{onAttachImage:t,onInsertFile:n,disabled:i}=e,u=(0,a.useRef)(null),o=(0,a.useRef)(null),c=(0,a.useRef)(null),[h,m]=(0,a.useState)(!1),[p,v]=(0,a.useState)(!1),[x,g]=(0,a.useState)(null);async function y(e){var n;let r=null===(n=e.target.files)||void 0===n?void 0:n[0];if(r){g(null),v(!0);try{t(await (0,l.I)(r))}catch(e){g(e instanceof Error?e.message:"Upload failed, please try again")}finally{v(!1),u.current&&(u.current.value="")}}}async function b(e){var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(r){g(null),v(!0);try{let e=await f(r);n("[".concat(e.name,"](").concat(e.url,")"))}catch(e){g(e instanceof Error?e.message:"Upload failed, please try again")}finally{v(!1),o.current&&(o.current.value="")}}}return(0,a.useEffect)(()=>{if(h)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){c.current&&!c.current.contains(e.target)&&m(!1)}function t(e){"Escape"===e.key&&m(!1)}},[h]),(0,r.jsxs)("div",{ref:c,className:"relative flex flex-col gap-1",children:[(0,r.jsx)("input",{ref:u,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:y}),(0,r.jsx)("input",{ref:o,type:"file",accept:".pdf,.csv,.txt,.md",className:"hidden",onChange:b}),(0,r.jsx)("button",{type:"button","aria-label":"Attach","aria-haspopup":"menu","aria-expanded":h,disabled:i||p,onClick:()=>m(e=>!e),className:"flex h-8 w-8 items-center justify-center rounded-md border bg-background text-sm font-medium hover:bg-accent disabled:opacity-50",children:p?"…":"+"}),h&&(0,r.jsxs)("div",{role:"menu",className:"absolute bottom-full left-0 z-10 mb-1 min-w-[10rem] overflow-hidden rounded-md border bg-popover py-1 text-sm shadow-md",children:[(0,r.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{var e;m(!1),null===(e=u.current)||void 0===e||e.click()},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-accent",children:[(0,r.jsx)(s,{"aria-hidden":!0,className:"h-4 w-4"}),"Insert image"]}),(0,r.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{var e;m(!1),null===(e=o.current)||void 0===e||e.click()},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-accent",children:[(0,r.jsx)(d,{"aria-hidden":!0,className:"h-4 w-4"}),"Attach file"]})]}),x&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:x})]})}function m(e){let{attachedImage:t,onAttach:n,onRemove:a,disabled:l,isDragging:u,onInsertFile:c}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2 ".concat(u?"ring-2 ring-primary rounded-md":""),children:[c?(0,r.jsx)(h,{onAttachImage:n,onInsertFile:c,disabled:l}):(0,r.jsx)(i,{onAttach:n,disabled:l}),t&&(0,r.jsx)(o,{image:t,onRemove:a})]})}},53819:function(e,t,n){n.d(t,{x:function(){return l}});var r=n(57437),a=n(94508);function l(e){let{label:t="Thinking",className:n,...l}=e;return(0,r.jsxs)("span",{role:"status","aria-label":t||"loading",className:(0,a.cn)("inline-flex items-center gap-1.5 text-current",n),...l,children:[t&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:t}),(0,r.jsxs)("span",{className:"inline-flex items-end gap-1",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-current opacity-70 [animation-delay:-0.3s]"}),(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-current opacity-70 [animation-delay:-0.15s]"}),(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-current opacity-70"})]})]})}},54367:function(e,t,n){n.d(t,{fO:function(){return h},od:function(){return m},zC:function(){return f}});var r,a,l,i,u,o,c=n(94428),s=n(46882);function d(){let e=new Map;return t=>{var n;let r=t.toLowerCase().replace(/[\s]+/g,"-").replace(/["'`()[\]{}<>()「」、。,.!?!?::;;/\\|#*~]/g,""),a=null!==(n=e.get(r))&&void 0!==n?n:0;return e.set(r,a+1),0===a?r:"".concat(r,"-").concat(a)}}function f(){return e=>{let t=d();(0,s.Vn)(e,"element",e=>{/^h[1-3]$/.test(e.tagName)&&(e.properties={...e.properties,id:t(function e(t){return"text"===t.type?t.value:"children"in t?t.children.map(e).join(""):""}(e))})})}}let h={...c.R,clobberPrefix:"",attributes:{...c.R.attributes,h1:[...null!==(i=null===(r=c.R.attributes)||void 0===r?void 0:r.h1)&&void 0!==i?i:[],"id"],h2:[...null!==(u=null===(a=c.R.attributes)||void 0===a?void 0:a.h2)&&void 0!==u?u:[],"id"],h3:[...null!==(o=null===(l=c.R.attributes)||void 0===l?void 0:l.h3)&&void 0!==o?o:[],"id"]}};function m(e){let t=d(),n=[];for(let r of e.split("\n")){let e=r.match(/^(#{1,3})\s+(.+)/);if(!e)continue;let a=e[2].trim();n.push({id:t(a),text:a,level:e[1].length})}return n}},37614:function(e,t,n){n.d(t,{H:function(){return l}});var r=n(2265),a=n(83494);function l(e,t){let[n,l]=(0,r.useState)(!1),i=(0,r.useRef)(t);return i.current=t,(0,r.useEffect)(()=>{function t(e){var t,n;return null!==(n=null===(t=e.dataTransfer)||void 0===t?void 0:t.types.includes("Files"))&&void 0!==n&&n}function n(t){let n=e.current;return!!n&&t.target instanceof Node&&n.contains(t.target)}function r(e){t(e)&&(e.preventDefault(),l(n(e)))}function u(e){e.relatedTarget||l(!1)}async function o(e){var r;if(!t(e)||(e.preventDefault(),l(!1),!n(e)))return;let u=null===(r=e.dataTransfer)||void 0===r?void 0:r.files[0];if(u&&u.type.startsWith("image/"))try{let e=await (0,a.I)(u);i.current(e)}catch(e){}}return document.addEventListener("dragover",r),document.addEventListener("dragleave",u),document.addEventListener("drop",o),()=>{document.removeEventListener("dragover",r),document.removeEventListener("dragleave",u),document.removeEventListener("drop",o)}},[e]),{isDragging:n}}},14092:function(e,t,n){n.d(t,{x:function(){return l}});var r=n(2265);function a(){var e,t;let n=window;return null!==(t=null!==(e=n.SpeechRecognition)&&void 0!==e?e:n.webkitSpeechRecognition)&&void 0!==t?t:null}function l(e){let{onTranscript:t,lang:n="ja-JP"}=e,[l,i]=(0,r.useState)(!1),[u,o]=(0,r.useState)(!1),c=(0,r.useRef)(null),s=(0,r.useRef)(""),d=(0,r.useRef)(!0),f=(0,r.useRef)(t);f.current=t,(0,r.useEffect)(()=>(d.current=!0,i(null!==a()),()=>{var e;d.current=!1,null===(e=c.current)||void 0===e||e.stop()}),[]);let h=(0,r.useCallback)(e=>{if(u){var t;null===(t=c.current)||void 0===t||t.stop();return}let r=a();if(!r)return;let l=new r;l.lang=n,l.continuous=!0,l.interimResults=!0,s.current=e,l.onresult=e=>{let t="";for(let n=0;n<e.results.length;n++)t+=e.results[n][0].transcript;let n=s.current,r=n&&!/\s$/.test(n)?" ":"";f.current(n+r+t)};let i=()=>{d.current&&o(!1),c.current=null,s.current=""};l.onend=i,l.onerror=i,l.start(),c.current=l,o(!0)},[n,u]);return{supportsMic:l,listening:u,toggle:h}}},83494:function(e,t,n){n.d(t,{I:function(){return r}});async function r(e){let t=new FormData;t.append("file",e);let n=await fetch("/api/images/upload",{method:"POST",body:t}),r=await n.json();if(!n.ok||!r.url||!r.path){var a;throw Error(null!==(a=r.error)&&void 0!==a?a:"Upload failed, please try again")}return{url:r.url,path:r.path}}},31583:function(e,t,n){n.d(t,{B:function(){return r}});function r(e,t,n){var r,a;if(!e)return t+n;let l=e.value,i=null!==(r=e.selectionStart)&&void 0!==r?r:l.length,u=null!==(a=e.selectionEnd)&&void 0!==a?a:l.length,o=l.slice(0,i)+n+l.slice(u),c=i+n.length;return requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(c,c)}),o}},22384:function(e,t,n){function r(e){let t;let n=[],r=e;for(;-1!==(t=r.indexOf("\n\n"));){let e=a(r.slice(0,t));r=r.slice(t+2),null!==e&&n.push(e)}return{events:n,rest:r}}function a(e){let t="message",n=[];for(let r of e.split("\n"))r.startsWith("event:")?t=r.slice(6).replace(/^ /,""):r.startsWith("data:")&&n.push(r.slice(5).replace(/^ /,""));return 0===n.length&&"message"===t?null:{type:t,data:n.join("\n")}}function l(e,t){return e?"".concat(e,"\n").concat(t):t}async function*i(e,t){let n=e.getReader(),l=()=>void n.cancel().catch(()=>{});null==t||t.addEventListener("abort",l,{once:!0});let i=new TextDecoder,u="";try{for(;;){let e;try{e=await n.read()}catch(e){if((null==t?void 0:t.aborted)&&e instanceof DOMException&&"AbortError"===e.name)return;throw e}if(e.done)break;u+=i.decode(e.value,{stream:!0});let{events:a,rest:l}=r(u);for(let e of(u=l,a))yield e}let e=a(u);null!==e&&(yield e)}finally{null==t||t.removeEventListener("abort",l)}}n.d(t,{Tg:function(){return r},bv:function(){return l},v$:function(){return i}})},94508:function(e,t,n){n.d(t,{E:function(){return i},_:function(){return u},cn:function(){return l}});var r=n(61994),a=n(53335);function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.m6)((0,r.W)(t))}function i(e){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/);return t[t.length-1]||e}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)}},58135:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(2265);let a=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),u=e=>{let t=i(e);return t.charAt(0).toUpperCase()+t.slice(1)};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},s=(0,r.createContext)({}),d=()=>(0,r.useContext)(s),f=(0,r.forwardRef)((e,t)=>{var n,l,i;let{color:u,size:s,strokeWidth:f,absoluteStrokeWidth:h,className:m="",children:p,iconNode:v,...x}=e,{size:g=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,color:j="currentColor",className:w=""}=null!==(n=d())&&void 0!==n?n:{},k=(null!=h?h:b)?24*Number(null!=f?f:y)/Number(null!=s?s:g):null!=f?f:y;return(0,r.createElement)("svg",{ref:t,...o,width:null!==(l=null!=s?s:g)&&void 0!==l?l:o.width,height:null!==(i=null!=s?s:g)&&void 0!==i?i:o.height,stroke:null!=u?u:j,strokeWidth:k,className:a("lucide",w,m),...!p&&!c(x)&&{"aria-hidden":"true"},...x},[...v.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(p)?p:[p]])}),h=(e,t)=>{let n=(0,r.forwardRef)((n,i)=>{let{className:o,...c}=n;return(0,r.createElement)(f,{ref:i,iconNode:t,className:a("lucide-".concat(l(u(e))),"lucide-".concat(e),o),...c})});return n.displayName=u(e),n}},67608:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(58135).Z)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]])},83922:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(58135).Z)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},54891:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(58135).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6739],{90160:function(t,e,n){n.d(e,{JournalChatJobStateProvider:function(){return f},R:function(){return d}});var r=n(57437),a=n(2265),u=n(22384);let l="ai-agent:journal-chat-job:v1",o={jobId:null,status:"idle",question:"",targetEntryId:null,imagePath:null,assistantContent:"",error:null},s=t=>"pending"===t||"running"===t;function i(){try{window.sessionStorage.removeItem(l)}catch(t){}}let c=(0,a.createContext)(null);function f(t){let{children:e}=t,[n,f]=(0,a.useState)(o),[d,h]=(0,a.useState)(!1),g=(0,a.useRef)(!1);(0,a.useEffect)(()=>{f(function(){try{let t=window.sessionStorage.getItem(l);if(!t)return o;let e=JSON.parse(t),n={...o,...e};if(s(n.status)&&!n.jobId)return o;return n}catch(t){return o}}()),h(!0)},[]),(0,a.useEffect)(()=>{d&&(n.jobId&&s(n.status)?function(t){try{window.sessionStorage.setItem(l,JSON.stringify({...t,assistantContent:""}))}catch(t){}}(n):i())},[n,d]);let m=n.jobId,b=s(n.status);(0,a.useEffect)(()=>{if(!d||!m||!b)return;let t=new AbortController,e=!1,n=t=>{e||f(e=>e.jobId!==m?e:t(e))};return(async()=>{let e;n(t=>({...t,assistantContent:""}));try{e=await fetch("/api/chat/".concat(m,"/stream"),{method:"GET",cache:"no-store",signal:t.signal})}catch(e){if(t.signal.aborted)return;n(t=>({...t,status:"failed",error:e instanceof Error?e.message:"Network error"}));return}if(t.signal.aborted)return;if(404===e.status){n(()=>({...o,status:"failed",error:"The previous brainstorm job is no longer available — please ask again."}));return}if(!e.ok||!e.body){let t=await e.text().catch(()=>"");n(n=>({...n,status:"failed",error:"Stream failed (HTTP ".concat(e.status,"): ").concat(t)}));return}let r="";try{for await(let a of(0,u.v$)(e.body,t.signal))"message"===a.type&&(r=(0,u.bv)(r,a.data),n(t=>({...t,assistantContent:(0,u.bv)(t.assistantContent,a.data)})))}catch(e){if(t.signal.aborted)return;n(t=>({...t,status:"failed",error:e instanceof Error?e.message:"Stream read error"}));return}if(!t.signal.aborted){if(!r){n(t=>({...t,status:"failed",error:"Brainstorm returned an empty answer."}));return}n(t=>({...t,status:"done"}))}})(),()=>{e=!0,t.abort()}},[d,m,b]);let y=(0,a.useCallback)(async t=>{let e;g.current=!1,f(()=>{var e;return{...o,status:"pending",question:t.question,targetEntryId:t.targetEntryId,imagePath:null!==(e=t.imagePath)&&void 0!==e?e:null}});try{e=await fetch("/api/journal/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({question:t.question,...t.imagePath?{image_path:t.imagePath}:{}})})}catch(t){f(e=>({...e,status:"failed",error:t instanceof Error?t.message:"Network error"}));return}if(!e.ok){let t=await e.text().catch(()=>""),n=404===e.status?"No journal entries yet — record something first.":"Brainstorm failed (HTTP ".concat(e.status,"): ").concat(t);f(t=>({...t,status:"failed",error:n}));return}let n=await e.json();if(!n.job_id){f(t=>({...t,status:"failed",error:"POST /api/journal/chat returned no job_id"}));return}if(g.current){fetch("/api/chat/".concat(n.job_id),{method:"DELETE",cache:"no-store"}),g.current=!1,f(()=>o);return}f(t=>{var e;return"pending"===t.status?{...t,jobId:null!==(e=n.job_id)&&void 0!==e?e:null,status:"running"}:t})},[]),p=(0,a.useCallback)(()=>{n.jobId?(fetch("/api/chat/".concat(n.jobId),{method:"DELETE",cache:"no-store"}),f(o),i()):g.current=!0},[n.jobId]),j=(0,a.useCallback)(()=>{f(o),i()},[]),w=(0,a.useCallback)(t=>{f(e=>({...e,status:"failed",error:t}))},[]),S=(0,a.useMemo)(()=>({...n,startJob:y,cancelJob:p,reset:j,setError:w}),[n,y,p,j,w]);return(0,r.jsx)(c.Provider,{value:S,children:e})}function d(){let t=(0,a.useContext)(c);if(!t)throw Error("useJournalChatJobState must be used inside <JournalChatJobStateProvider>");return t}},75408:function(t,e,n){n.d(e,{JournalChatStateProvider:function(){return c},l:function(){return f}});var r=n(57437),a=n(2265);let u="ai-agent:journal-chat-history:v1";function l(t){return"object"==typeof t&&null!==t&&"string"==typeof t.question&&"string"==typeof t.answer}function o(t){return t.length<=50?t:t.slice(t.length-50)}function s(){try{window.sessionStorage.removeItem(u)}catch(t){}}let i=(0,a.createContext)(null);function c(t){let{children:e}=t,[n,c]=(0,a.useState)([]),[f,d]=(0,a.useState)(null),[h,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=function(){try{let t=window.sessionStorage.getItem(u);if(!t)return{turns:[],entryId:null};let e=JSON.parse(t),n=Array.isArray(e.turns)?o(e.turns.filter(l)):[],r="string"==typeof e.entryId?e.entryId:null;return{turns:n,entryId:r}}catch(t){return{turns:[],entryId:null}}}();c(t.turns),d(t.entryId),g(!0)},[]),(0,a.useEffect)(()=>{h&&(0===n.length&&null===f?s():function(t){try{window.sessionStorage.setItem(u,JSON.stringify(t))}catch(t){}}({turns:n,entryId:f}))},[n,f,h]);let m=(0,a.useCallback)(t=>{c(e=>o([...e,t]))},[]),b=(0,a.useCallback)(t=>{d(t)},[]),y=(0,a.useCallback)(()=>{c([]),d(null),s()},[]),p=(0,a.useMemo)(()=>({turns:n,entryId:f,addTurn:m,setEntryId:b,reset:y}),[n,f,m,b,y]);return(0,r.jsx)(i.Provider,{value:p,children:e})}function f(){let t=(0,a.useContext)(i);if(!t)throw Error("useJournalChatState must be used inside <JournalChatStateProvider>");return t}},5620:function(t,e,n){n.d(e,{JournalNavProvider:function(){return i},O:function(){return c}});var r=n(57437),a=n(99376),u=n(2265),l=n(90160),o=n(75408);let s=(0,u.createContext)(null);function i(t){let{children:e}=t,[n,i]=(0,u.useState)([]),[c,f]=(0,u.useState)(null),[d,h]=(0,u.useState)([]),[g,m]=(0,u.useState)(!1),[b,y]=(0,u.useState)(null),[p,j]=(0,u.useState)(!1),[w,S]=(0,u.useState)(""),C=(0,u.useRef)(0),[k,E]=(0,u.useState)(null),[v,I]=(0,u.useState)(""),P=(0,u.useRef)(0),T=(0,o.l)(),J=(0,l.R)(),N=(0,a.usePathname)(),x="/journal"===N||!!(null==N?void 0:N.startsWith("/journal/")),O=(0,u.useRef)(0),_=(0,u.useCallback)(async()=>{try{f(null);let t=await fetch("/api/journal",{cache:"no-store"});if(!t.ok){f("Failed to load entries (HTTP ".concat(t.status,")"));return}let e=await t.json();return i(e.entries),e.entries}catch(t){f("Failed to load entries: ".concat(String(t)))}},[]),R=(0,u.useCallback)(async t=>{let e;let n=++C.current;y(t),j(!1),m(!1),E(null),O.current+=1,T.reset(),T.setEntryId(t),S("");try{e=await fetch("/api/journal/".concat(t),{cache:"no-store"})}catch(t){return}if(n!==C.current||!e.ok)return;let r=await e.json();n===C.current&&S(r.content)},[T]),q=(0,u.useCallback)(async t=>{let e;let n=++P.current;E(t),I("");try{e=await fetch("/api/journal/trash/".concat(t),{cache:"no-store"})}catch(t){return}if(n!==P.current||!e.ok)return;let r=await e.json();n===P.current&&I(r.content)},[]),H=(0,u.useCallback)(async()=>{try{f(null);let t=await fetch("/api/journal/trash",{cache:"no-store"});if(!t.ok){f("Failed to load trash (HTTP ".concat(t.status,")"));return}let e=await t.json();h(e.entries)}catch(t){f("Failed to load trash: ".concat(String(t)))}},[]);(0,u.useEffect)(()=>{x&&_()},[_,x]),(0,u.useEffect)(()=>{let t=T.turns.length>0||null!==J.jobId,e=null===b&&!p&&null===k;t&&e&&j(!0)},[T.turns.length,J.jobId,b,p,k]);let D=(0,u.useCallback)(()=>{y(null),j(!1),E(null),T.setEntryId(null)},[T]),L=(0,u.useCallback)(()=>{y(null),E(null),m(!1),O.current+=1,T.reset(),j(!0)},[T]),M=(0,u.useCallback)(async t=>{try{let e=await fetch("/api/journal/".concat(t),{method:"DELETE"});if(!e.ok){f("Delete failed (HTTP ".concat(e.status,")"));return}y(e=>e===t?null:e),await _()}catch(t){f("Delete failed: ".concat(String(t)))}},[_]),A=(0,u.useCallback)(async t=>{try{let e=await fetch("/api/journal/".concat(t,"/restore"),{method:"POST"});if(!e.ok){f("Restore failed (HTTP ".concat(e.status,")"));return}E(e=>e===t?null:e),await Promise.all([_(),H()])}catch(t){f("Restore failed: ".concat(String(t)))}},[_,H]),F=(0,u.useCallback)(async t=>{try{let e=await fetch("/api/journal/".concat(t,"?purge=true"),{method:"DELETE"});if(!e.ok){f("Permanent delete failed (HTTP ".concat(e.status,")"));return}E(e=>e===t?null:e),await H()}catch(t){f("Permanent delete failed: ".concat(String(t)))}},[H]),B=(0,u.useCallback)(()=>{let t=!g;m(t),y(null),j(!1),E(null),O.current+=1,T.reset(),t&&H()},[g,H,T]),G=(0,u.useMemo)(()=>[...n].sort((t,e)=>e.id.localeCompare(t.id)),[n]),$=G.find(t=>t.id===b),W=d.find(t=>t.id===k),Y=null!==b||p||null!==k,z=(0,u.useMemo)(()=>({entries:n,sortedEntries:G,entriesError:c,trash:d,showTrash:g,selected:b,composing:p,trashPreview:k,content:w,trashContent:v,panelOpen:Y,selectedMeta:$,trashMeta:W,viewEpoch:O,loadDates:_,loadEntry:R,loadTrashEntry:q,loadTrash:H,deleteEntry:M,restoreEntry:A,purgeEntry:F,toggleTrash:B,startCompose:L,closePanel:D}),[n,G,c,d,g,b,p,k,w,v,Y,$,W,_,R,q,H,M,A,F,B,L,D]);return(0,r.jsx)(s.Provider,{value:z,children:e})}function c(){let t=(0,u.useContext)(s);if(!t)throw Error("useJournalNav must be used inside <JournalNavProvider>");return t}},30641:function(t,e,n){n.d(e,{GL:function(){return s},ML:function(){return i}});let r="**You:**",a="**AI:**",u=[r,a].map(t=>[t,t.replaceAll("*","\\*")]);function l(t){return t.split("\n").map(t=>{let e=u.find(e=>{let[n]=e;return t.trim()===n});return e?t.replace(e[0],e[1]):t}).join("\n")}function o(t){return t.map(t=>{let e=u.find(e=>{let[,n]=e;return t.trim()===n});return e?t.replace(e[1],e[0]):t}).join("\n")}function s(t,e){return"".concat(r,"\n\n").concat(l(t),"\n\n").concat(a,"\n\n").concat(l(e))}function i(t){let e=t.split("\n"),n=e.flatMap((t,e)=>t.trim()===r?[e]:[]);return 0===n.length?null:{preamble:e.slice(0,n[0]).join("\n").trim(),turns:n.map((t,r)=>{let u=r+1<n.length?n[r+1]:e.length,l=e.slice(t+1,u),s=l.findIndex(t=>t.trim()===a),i=o(-1===s?l:l.slice(0,s)),c=-1===s?"":o(l.slice(s+1));return{question:i.trim(),answer:c.trim().replace(/\n*-{3,}$/,"").trim()}})}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8480],{6970:function(e,t,r){r.d(t,{O:function(){return o}});var n=r(57437),a=r(94508);function o(e){let{onPointerDown:t,edge:r="right",ariaLabel:o="Resize panel",className:s,...i}=e;return(0,n.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"data-testid":i["data-testid"],onPointerDown:t,className:(0,a.cn)("group absolute inset-y-0 z-10 w-3 cursor-col-resize bg-transparent","left"===r?"left-0":"right-0",s),children:(0,n.jsx)("div",{className:(0,a.cn)("pointer-events-none absolute inset-y-0 w-1 group-hover:bg-primary/50","left"===r?"left-0":"right-0")})})}},62869:function(e,t,r){r.d(t,{z:function(){return c}});var n=r(57437),a=r(2265),o=r(37053),s=r(90535),i=r(94508);let u=(0,s.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=a.forwardRef((e,t)=>{let{className:r,variant:a,size:s,asChild:c=!1,...l}=e,d=c?o.g7:"button";return(0,n.jsx)(d,{className:(0,i.cn)(u({variant:a,size:s,className:r})),ref:t,...l})});c.displayName="Button"},66070:function(e,t,r){r.d(t,{Ol:function(){return i},SZ:function(){return c},Zb:function(){return s},aY:function(){return l},eW:function(){return d},ll:function(){return u}});var n=r(57437),a=r(2265),o=r(94508);let s=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("rounded-xl border bg-card text-card-foreground shadow",r),...a})});s.displayName="Card";let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("flex flex-col space-y-1.5 p-6",r),...a})});i.displayName="CardHeader";let u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("font-semibold leading-none tracking-tight",r),...a})});u.displayName="CardTitle";let c=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",r),...a})});c.displayName="CardDescription";let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("p-6 pt-0",r),...a})});l.displayName="CardContent";let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("flex items-center p-6 pt-0",r),...a})});d.displayName="CardFooter"},96215:function(e,t,r){r.d(t,{ChatJobStateProvider:function(){return l},w:function(){return d}});var n=r(57437),a=r(87411),o=r(22384);let s={jobId:null,status:"idle",question:"",date:"",searchHistory:!1,assistantContent:"",error:null,sessionExpired:!1,staleSession:!1},i=e=>"pending"===e||"running"===e,{Provider:u,useStore:c}=(0,a.U)({storageKey:"ai-agent:chat-job:v1",initialState:s,getJobId:e=>e.jobId,isInFlight:e=>i(e.status),isPersistable:e=>!!e.jobId&&i(e.status),serializeForStorage:e=>({...e,assistantContent:"",sessionExpired:!1,staleSession:!1}),start:async(e,t)=>{let{question:r,date:n,image_path:a,search_history:o}=e,{setState:i}=t;i(()=>({...s,status:"pending",question:r,date:n,searchHistory:!!o}));try{let e=await fetch("/api/chat",{method:"POST",cache:"no-store",headers:{"content-type":"application/json"},body:JSON.stringify({date:n,question:r,...a?{image_path:a}:{},...o?{search_history:!0}:{}})});if(401===e.status){i(()=>({...s,sessionExpired:!0}));return}if(!e.ok){let t=await e.text().catch(()=>"");i(r=>({...r,status:"failed",error:"POST /api/chat failed (HTTP ".concat(e.status,"): ").concat(t)}));return}let t=await e.json();if(!t.job_id){i(e=>({...e,status:"failed",error:"POST /api/chat returned no job_id"}));return}i(e=>{var r;return{...e,jobId:null!==(r=t.job_id)&&void 0!==r?r:null,status:"running"}})}catch(e){i(t=>({...t,status:"failed",error:e instanceof Error?e.message:"Network error"}))}},watch:async(e,t)=>{let r,{signal:n,setState:a}=t;a(e=>({...e,assistantContent:""}));try{r=await fetch("/api/chat/".concat(e,"/stream"),{method:"GET",cache:"no-store",signal:n})}catch(e){if(n.aborted)return;a(t=>({...t,status:"failed",error:e instanceof Error?e.message:"Network error"}));return}if(n.aborted)return;if(401===r.status){a(e=>({...e,sessionExpired:!0,status:"failed"}));return}if(404===r.status){a(()=>({...s,status:"failed",error:"The previous chat job is no longer available — please ask again."}));return}if(!r.ok||!r.body){let t=await r.text().catch(()=>"");a(n=>({...n,status:"failed",error:"GET /api/chat/".concat(e,"/stream failed (HTTP ").concat(r.status,"): ").concat(t)}));return}let i=r.body.getReader(),u=new TextDecoder,c="";try{for(;;){let{value:e,done:t}=await i.read();if(t)break;if(n.aborted)return;c+=u.decode(e,{stream:!0});let{events:r,rest:s}=(0,o.Tg)(c);for(let e of(c=s,r)){if(n.aborted)return;"message"===e.type?a(t=>({...t,assistantContent:(0,o.bv)(t.assistantContent,e.data)})):"stale_session"===e.type?a(e=>({...e,staleSession:!0})):"error"===e.type&&a(t=>({...t,error:e.data||"stream error"}))}}}catch(e){if(n.aborted)return;a(t=>({...t,status:"failed",error:e instanceof Error?e.message:"Stream read error"}));return}n.aborted||a(e=>({...e,status:e.error?"failed":"done"}))}});function l(e){let{children:t}=e;return(0,n.jsx)(u,{children:t})}function d(){return c()}},56743:function(e,t,r){r.d(t,{ChatStateProvider:function(){return l},R:function(){return d}});var n=r(57437),a=r(2265);let o="ai-agent:chat-history:v1";function s(e){return e.length<=50?e:e.slice(e.length-50)}function i(e){return"object"==typeof e&&null!==e&&("user"===e.role||"assistant"===e.role)&&"string"==typeof e.content&&(void 0===e.error||null===e.error||"string"==typeof e.error)&&(void 0===e.cancelled||"boolean"==typeof e.cancelled)}function u(){try{window.sessionStorage.removeItem(o)}catch(e){}}let c=(0,a.createContext)(null);function l(e){let{children:t}=e,[r,l]=(0,a.useState)([]),[d,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{l(function(){try{let e=window.sessionStorage.getItem(o);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return s(t.filter(i))}catch(e){return[]}}()),f(!0)},[]),(0,a.useEffect)(()=>{d&&(0===r.length?u():function(e){try{window.sessionStorage.setItem(o,JSON.stringify(e))}catch(e){}}(r))},[r,d]);let h=(0,a.useCallback)(e=>{l(t=>s("function"==typeof e?e(t):e))},[]),g=(0,a.useCallback)(()=>{l([]),u()},[]),p=(0,a.useMemo)(()=>({messages:r,setMessages:h,reset:g,hydrated:d}),[r,h,g,d]);return(0,n.jsx)(c.Provider,{value:p,children:t})}function d(){let e=(0,a.useContext)(c);if(!e)throw Error("useChatState must be used inside <ChatStateProvider>");return e}},87411:function(e,t,r){r.d(t,{U:function(){return s}});var n=r(57437),a=r(2265);function o(e){try{window.sessionStorage.removeItem(e)}catch(e){}}function s(e){let{storageKey:t,initialState:r,getJobId:s,isInFlight:i,isPersistable:u,isUnresumable:c=e=>i(e)&&null===s(e),serializeForStorage:l=e=>e,start:d,watch:f}=e,h=(0,a.createContext)(null);return{Provider:function(e){let{children:g}=e,[p,b]=(0,a.useState)(r),[v,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{b(function(e,t,r){try{let n=window.sessionStorage.getItem(e);if(!n)return t;let a=JSON.parse(n),o={...t,...a};if(r(o))return t;return o}catch(e){return t}}(t,r,c)),m(!0)},[]),(0,a.useEffect)(()=>{v&&(u(p)?function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}(t,l(p)):o(t))},[p,v]);let y=s(p),w=i(p);(0,a.useEffect)(()=>{if(!v||!y||!w)return;let e=new AbortController,t=!1,r=e=>{t||b(t=>s(t)!==y?t:e(t))};return(async()=>{try{await f(y,{signal:e.signal,setState:r})}catch(e){}})(),()=>{t=!0,e.abort()}},[v,y,w]);let x=(0,a.useCallback)(async e=>{await d(e,{setState:e=>{b(e)}})},[]),S=(0,a.useCallback)(()=>{b(r),o(t)},[]),C=(0,a.useMemo)(()=>({...p,isBackgrounded:w,startJob:x,reset:S}),[p,w,x,S]);return(0,n.jsx)(h.Provider,{value:C,children:g})},useStore:function(){let e=(0,a.useContext)(h);if(!e)throw Error("useStore must be used inside the Provider returned by createJobStoreProvider");return e}}}},12886:function(e,t,r){r.d(t,{L:function(){return a}});var n=r(2265);function a(e){let{storageKey:t,defaultWidth:r,minWidth:a,maxWidth:o,edge:s="right"}=e,[i,u]=(0,n.useState)(r);(0,n.useEffect)(()=>{try{let e=Number(localStorage.getItem(t));e>=a&&e<=o&&u(e)}catch(e){}},[t,a,o]);let c=(0,n.useCallback)(e=>{e.preventDefault();let r=e.clientX,n="left"===s?-1:1,c=e=>Math.min(o,Math.max(a,e)),l=new AbortController,{signal:d}=l,f=i,h=()=>{l.abort();try{localStorage.setItem(t,String(f))}catch(e){}};window.addEventListener("pointermove",e=>{u(f=c(i+n*(e.clientX-r)))},{signal:d}),window.addEventListener("pointerup",h,{signal:d}),window.addEventListener("pointercancel",h,{signal:d})},[i,t,a,o,s]);return{width:i,startResize:c}}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6535],{92126:function(e,t,n){Promise.resolve().then(n.bind(n,5642))},6970:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=n(57437),a=n(94508);function l(e){let{onPointerDown:t,edge:n="right",ariaLabel:l="Resize panel",className:i,...s}=e;return(0,r.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":l,"data-testid":s["data-testid"],onPointerDown:t,className:(0,a.cn)("group absolute inset-y-0 z-10 w-3 cursor-col-resize bg-transparent","left"===n?"left-0":"right-0",i),children:(0,r.jsx)("div",{className:(0,a.cn)("pointer-events-none absolute inset-y-0 w-1 group-hover:bg-primary/50","left"===n?"left-0":"right-0")})})}},10644:function(e,t,n){"use strict";n.d(t,{Y:function(){return p}});var r=n(57437),a=n(2265),l=n(20200),i=n(78537),s=n(43713),o=n(54367),c=n(52115),u=n(94508);function d(e){let{entries:t,scrollContainer:n,activeId:a,onClose:l}=e;if(0===t.length)return null;let i=e=>{var t;let r=null===(t=n.current)||void 0===t?void 0:t.querySelector('[id="'.concat(CSS.escape(e),'"]'));null==r||r.scrollIntoView({behavior:"smooth",block:"start"}),l()};return(0,r.jsxs)("nav",{"data-testid":"briefing-toc",className:"absolute right-0 top-0 bottom-0 w-56 overflow-y-auto border-l bg-background/30 px-3 py-4 backdrop-blur-sm",children:[(0,r.jsx)("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"目次"}),(0,r.jsx)("ul",{className:"space-y-0.5",children:t.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)("button",{onClick:()=>i(e.id),className:(0,u.cn)("w-full rounded px-2 py-1 text-left text-xs transition-colors hover:bg-accent hover:text-accent-foreground",1===e.level&&"font-medium",2===e.level&&"pl-4 text-muted-foreground",3===e.level&&"pl-6 text-muted-foreground/70",a===e.id&&"bg-accent/60 text-accent-foreground"),children:e.text})},e.id))})]})}var f=n(20580);let h="rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",x={a:e=>{let{children:t,...n}=e;return(0,r.jsx)("a",{...n,target:"_blank",rel:"noopener noreferrer",children:t})}};function p(e){let{file:t,content:n,loading:p,error:m,fullSize:g=!1,onToggleFullSize:v,onClose:b}=e,[j,y]=(0,a.useState)(!1),w=(0,a.useRef)(null),N=(0,a.useMemo)(()=>n?(0,o.od)(n):[],[n]),k=function(e,t){let[n,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let t=e.current;if(!t||"undefined"==typeof IntersectionObserver)return;let n=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){r(t.target.getAttribute("id"));break}},{root:t,rootMargin:"0px 0px -80% 0px",threshold:0});return t.querySelectorAll("h1[id], h2[id], h3[id]").forEach(e=>n.observe(e)),()=>n.disconnect()},[e,t]),n}(w,n);return(0,r.jsxs)("div",{"data-testid":"briefing-panel",className:(0,u.cn)("flex h-full flex-col overflow-hidden bg-background transition-all",g?"rounded-lg border":"border-l"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex gap-3 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{"data-testid":"panel-type",children:(0,c.C)(t.type)}),(0,r.jsx)("span",{"data-testid":"panel-date",children:t.date}),(0,r.jsxs)("span",{"data-testid":"panel-size",children:[(t.size/1024).toFixed(1)," KB"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[N.length>0&&(0,r.jsx)("button",{"data-testid":"panel-toc-btn",onClick:()=>y(e=>!e),"aria-label":"Toggle table of contents",className:(0,u.cn)("rounded p-1 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground",j&&"bg-accent text-accent-foreground"),children:"目次"}),v&&(0,r.jsx)("button",{"data-testid":"panel-fullsize-btn",onClick:v,"aria-label":g?"Collapse":"Full size",className:h,children:g?(0,r.jsx)(f.jG,{}):(0,r.jsx)(f.Qq,{})}),b&&(0,r.jsx)("button",{"data-testid":"panel-close-btn",onClick:b,"aria-label":"Close panel",className:h,children:(0,r.jsx)(f.Tw,{})})]})]}),(0,r.jsx)("div",{className:"border-b px-4 py-3",children:(0,r.jsx)("h2",{className:"text-sm font-semibold","data-testid":"panel-title",children:t.name})}),(0,r.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[(0,r.jsx)("div",{ref:w,className:"h-full overflow-y-auto px-4 py-4 pr-6",children:p?(0,r.jsx)("p",{"data-testid":"briefing-content-loading",className:"text-sm text-muted-foreground",children:"Loading…"}):null!==m?(0,r.jsxs)("p",{"data-testid":"briefing-content-error",className:"text-sm text-destructive",children:["Failed to load content: ",m]}):null!==n?(0,r.jsx)("div",{"data-testid":"briefing-content",className:"prose prose-sm max-w-none dark:prose-invert prose-headings:scroll-mt-4 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline dark:prose-a:text-blue-400",children:(0,r.jsx)(l.UG,{remarkPlugins:[s.Z],rehypePlugins:[o.zC,[i.Z,o.fO]],components:x,children:n})}):null}),(0,r.jsx)("div",{className:(0,u.cn)("pointer-events-none absolute inset-y-0 right-0 transition-opacity duration-200",j?"pointer-events-auto opacity-100":"opacity-0"),children:(0,r.jsx)(d,{entries:N,scrollContainer:w,activeId:k,onClose:()=>y(!1)})})]})]})}},20580:function(e,t,n){"use strict";n.d(t,{Qq:function(){return i},Tw:function(){return s},XH:function(){return o},h0:function(){return c},jG:function(){return l}});var r=n(57437);function a(e){let{size:t=14,children:n}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n})}function l(e){return(0,r.jsxs)(a,{...e,children:[(0,r.jsx)("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),(0,r.jsx)("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),(0,r.jsx)("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),(0,r.jsx)("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]})}function i(e){return(0,r.jsxs)(a,{...e,children:[(0,r.jsx)("path",{d:"M15 3h6v6"}),(0,r.jsx)("path",{d:"M9 21H3v-6"}),(0,r.jsx)("path",{d:"M21 3l-7 7"}),(0,r.jsx)("path",{d:"M3 21l7-7"})]})}function s(e){return(0,r.jsxs)(a,{...e,children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function o(e){let{size:t=14}=e;return(0,r.jsxs)(a,{size:t,children:[(0,r.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,r.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,r.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,r.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function c(e){let{size:t=12}=e;return(0,r.jsxs)(a,{size:t,children:[(0,r.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,r.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,r.jsx)("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}},5642:function(e,t,n){"use strict";n.d(t,{BriefingDashboard:function(){return N}});var r=n(57437),a=n(2265),l=n(90535),i=n(54891),s=n(94508);let o=(0,l.j)("pointer-events-auto flex items-start gap-3 rounded-md border px-4 py-3 shadow-lg",{variants:{variant:{success:"border-green-700 bg-green-600/70 text-white backdrop-blur-sm",error:"border-red-700 bg-red-600/70 text-white backdrop-blur-sm"}},defaultVariants:{variant:"success"}});function c(e){let{className:t,variant:n,onClose:a,children:l,role:c,...u}=e;return(0,r.jsxs)("div",{role:null!=c?c:"error"===n?"alert":"status",className:(0,s.cn)(o({variant:n}),t),...u,children:[(0,r.jsx)("div",{className:"flex-1 break-words text-sm",children:l}),a&&(0,r.jsx)("button",{type:"button","aria-label":"Close","data-testid":"toast-close",onClick:a,className:"rounded-sm opacity-80 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-white/60",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})]})}function u(e){let{className:t,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)("pointer-events-none fixed left-1/2 top-4 z-50 flex w-full -translate-x-1/2 flex-col gap-2 px-4",t),...n})}function d(){let[e,t]=(0,a.useState)("idle"),[n,l]=(0,a.useState)(""),i=async()=>{t("running"),l("");try{var e,n;let r=await fetch("/api/archive",{method:"POST",cache:"no-store"}),a=await r.json().catch(()=>({}));if(!r.ok){t("error"),l(String(null!==(e=null==a?void 0:a.detail)&&void 0!==e?e:"HTTP ".concat(r.status)));return}t("done"),l(String(null!==(n=null==a?void 0:a.stdout)&&void 0!==n?n:"").trim()||"Archive complete.")}catch(e){t("error"),l(String(e))}},s=("done"===e||"error"===e)&&n;return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1",children:[(0,r.jsx)("button",{"data-testid":"archive-button",onClick:i,disabled:"running"===e,className:"rounded border px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:"running"===e?"Archiving…":"Archive last month"}),s&&(0,r.jsx)(u,{children:(0,r.jsx)(c,{"data-testid":"archive-message",variant:"error"===e?"error":"success",onClose:()=>{t("idle"),l("")},children:n})})]})}var f=n(10644),h=n(52115),x=n(20580);function p(e){let{file:t,selected:n,onOpen:a,onHover:l}=e;return(0,r.jsxs)("tr",{"data-testid":"briefing-row-".concat(t.name),tabIndex:0,"aria-selected":n,onClick:()=>a(t),onMouseEnter:()=>l(t),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a(t))},className:(0,s.cn)("group cursor-pointer border-b text-xs transition-colors last:border-0",n?"bg-accent font-medium text-accent-foreground":"hover:bg-accent/50"),children:[(0,r.jsx)("td",{className:"max-w-[160px] truncate px-3 py-2",title:t.name,children:t.name}),(0,r.jsx)("td",{className:"px-3 py-2",children:(0,h.C)(t.type)}),(0,r.jsx)("td",{className:"px-3 py-2 tabular-nums",children:t.date}),(0,r.jsx)("td",{className:"px-2 py-2",children:(0,r.jsx)("button",{"data-testid":"briefing-open-".concat(t.name),onClick:()=>a(t),"aria-label":"Open ".concat(t.name),className:"rounded p-0.5 text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground focus:opacity-100 group-hover:opacity-100",children:(0,r.jsx)(x.h0,{})})})]})}function m(e){let{onSearch:t,debounceMs:n=250}=e,[l,i]=(0,a.useState)(""),s=(0,a.useRef)(t);return s.current=t,(0,a.useEffect)(()=>{let e=setTimeout(()=>s.current(l.trim()),n);return()=>clearTimeout(e)},[l,n]),(0,r.jsxs)("div",{className:"relative flex items-center px-2 py-1",children:[(0,r.jsx)("input",{"data-testid":"briefing-search-input",type:"search",value:l,onChange:e=>i(e.target.value),placeholder:"Search name or content…","aria-label":"Search briefings",className:"w-full rounded border bg-background px-2 py-1 pr-7 text-xs focus:outline-none focus:ring-1 focus:ring-ring"}),l&&(0,r.jsx)("button",{"data-testid":"briefing-search-clear",onClick:()=>i(""),"aria-label":"Clear search",className:"absolute right-3 rounded p-0.5 text-muted-foreground hover:text-foreground",children:(0,r.jsx)(x.Tw,{})})]})}let g="__all__";function v(e){let{files:t,selected:n,onSelect:a}=e,l=function(e){let t=new Set,n=[];for(let r of e)t.has(r.type)||(t.add(r.type),n.push(r.type));return n}(t);return(0,r.jsx)("div",{"data-testid":"briefing-tabs",className:"flex gap-1 border-b px-2 py-1",children:[g,...l].map(e=>(0,r.jsx)("button",{"data-testid":"briefing-tab-".concat(e),onClick:()=>a(e),"aria-selected":n===e,className:(0,s.cn)("rounded px-3 py-1 text-xs transition-colors",n===e?"bg-accent font-medium text-accent-foreground":"text-muted-foreground hover:bg-accent/50"),children:e===g?"All":(0,h.C)(e)},e))})}var b=n(6970),j=n(46915),y=n(12886);function w(){var e;return null!==(e=new URLSearchParams(window.location.search).get("type"))&&void 0!==e?e:g}function N(){let{files:e,selected:t,content:n,loadingContent:l,listError:i,contentError:o,fetchContent:c,prefetch:u,close:h}=(0,j.N)(),[x,N]=(0,a.useState)(!1),{width:k,startResize:S}=(0,y.L)({storageKey:"ai-agent:briefing-list-width:v1",defaultWidth:288,minWidth:200,maxWidth:560}),[C,E]=(0,a.useState)(w),[M,z]=(0,a.useState)(""),[R,A]=(0,a.useState)(null),[L,O]=(0,a.useState)(!1),[T,P]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=new URL(window.location.href);C===g?e.searchParams.delete("type"):e.searchParams.set("type",C),window.history.replaceState(null,"",e.toString())},[C]),(0,a.useEffect)(()=>{if(""===M){A(null),O(!1),P(null);return}let e=!1;return O(!0),P(null),fetch("/api/briefing/search?q=".concat(encodeURIComponent(M)),{cache:"no-store"}).then(e=>e.ok?e.json():Promise.reject(Error("HTTP ".concat(e.status)))).then(t=>{e||A(t.files)}).catch(t=>{e||(A([]),P(String(t)))}).finally(()=>{e||O(!1)}),()=>{e=!0}},[M]);let _=(0,a.useMemo)(()=>(""!==M?null!=R?R:[]:null!=e?e:[]).filter(e=>C===g||e.type===C),[e,C,M,R]);return i?(0,r.jsxs)("p",{"data-testid":"briefing-error",className:"text-sm text-destructive",children:["Failed to load briefings: ",i]}):null===e?(0,r.jsx)("p",{"data-testid":"briefing-loading",className:"text-sm text-muted-foreground",children:"Loading briefings…"}):0===e.length?(0,r.jsx)("p",{"data-testid":"briefing-empty",className:"text-sm text-muted-foreground",children:"No briefing files found."}):(0,r.jsxs)("div",{"data-testid":"briefing-dashboard",className:"flex h-full",children:[(0,r.jsxs)("div",{"data-testid":"briefing-records-list",style:t&&!x?{width:k}:void 0,className:(0,s.cn)("relative flex-shrink-0 overflow-y-auto border-r",!(t&&!x)&&"flex-1",x&&"hidden"),children:[(0,r.jsx)(d,{}),(0,r.jsx)(m,{onSearch:z}),(0,r.jsx)(v,{files:e,selected:C,onSelect:E}),(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b bg-muted/50 text-left text-xs text-muted-foreground",children:[(0,r.jsx)("th",{className:"px-3 py-2",children:"Name"}),(0,r.jsx)("th",{className:"px-3 py-2",children:"Type"}),(0,r.jsx)("th",{className:"px-3 py-2",children:"Date"}),(0,r.jsx)("th",{className:"w-8 px-3 py-2"})]})}),(0,r.jsx)("tbody",{children:_.map(e=>(0,r.jsx)(p,{file:e,selected:(null==t?void 0:t.name)===e.name,onOpen:c,onHover:u},e.name))})]}),L&&(0,r.jsx)("p",{"data-testid":"briefing-search-loading",className:"px-3 py-2 text-xs text-muted-foreground",children:"Searching…"}),!L&&T&&(0,r.jsxs)("p",{"data-testid":"briefing-search-error",className:"px-3 py-2 text-xs text-destructive",children:["Search failed: ",T]}),!L&&!T&&0===_.length&&(0,r.jsx)("p",{"data-testid":"briefing-no-results",className:"px-3 py-2 text-xs text-muted-foreground",children:"No matching briefings."}),t&&!x&&(0,r.jsx)(b.O,{onPointerDown:S,ariaLabel:"Resize briefing list","data-testid":"briefing-list-resizer"})]}),t&&(0,r.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,r.jsx)(f.Y,{file:t,content:n,loading:l,error:o,fullSize:x,onToggleFullSize:()=>N(e=>!e),onClose:()=>{N(!1),h()}})})]})}},54367:function(e,t,n){"use strict";n.d(t,{fO:function(){return h},od:function(){return x},zC:function(){return f}});var r,a,l,i,s,o,c=n(94428),u=n(46882);function d(){let e=new Map;return t=>{var n;let r=t.toLowerCase().replace(/[\s]+/g,"-").replace(/["'`()[\]{}<>()「」、。,.!?!?::;;/\\|#*~]/g,""),a=null!==(n=e.get(r))&&void 0!==n?n:0;return e.set(r,a+1),0===a?r:"".concat(r,"-").concat(a)}}function f(){return e=>{let t=d();(0,u.Vn)(e,"element",e=>{/^h[1-3]$/.test(e.tagName)&&(e.properties={...e.properties,id:t(function e(t){return"text"===t.type?t.value:"children"in t?t.children.map(e).join(""):""}(e))})})}}let h={...c.R,clobberPrefix:"",attributes:{...c.R.attributes,h1:[...null!==(i=null===(r=c.R.attributes)||void 0===r?void 0:r.h1)&&void 0!==i?i:[],"id"],h2:[...null!==(s=null===(a=c.R.attributes)||void 0===a?void 0:a.h2)&&void 0!==s?s:[],"id"],h3:[...null!==(o=null===(l=c.R.attributes)||void 0===l?void 0:l.h3)&&void 0!==o?o:[],"id"]}};function x(e){let t=d(),n=[];for(let r of e.split("\n")){let e=r.match(/^(#{1,3})\s+(.+)/);if(!e)continue;let a=e[2].trim();n.push({id:t(a),text:a,level:e[1].length})}return n}},52115:function(e,t,n){"use strict";n.d(t,{C:function(){return a}});let r={briefing:"Briefing",local:"Local","weekly-summary":"Weekly"};function a(e){var t;return null!==(t=r[e])&&void 0!==t?t:e?e[0].toUpperCase()+e.slice(1):e}},46915:function(e,t,n){"use strict";n.d(t,{N:function(){return i}});var r=n(2265);function a(e){return"/api/briefing/".concat(encodeURIComponent(e))}async function l(e){let t=await fetch(e,{cache:"no-store"});if(!t.ok)throw Error("HTTP ".concat(t.status));return t.json()}function i(){let[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null),[s,o]=(0,r.useState)(null),[c,u]=(0,r.useState)(!1),[d,f]=(0,r.useState)(null),[h,x]=(0,r.useState)(null),p=(0,r.useRef)(new Map),m=(0,r.useRef)(null),g=(0,r.useCallback)(e=>{m.current=e.name,i(e);let t=p.current.get(e.name);if(void 0!==t){o(t),u(!1),x(null);return}u(!0),o(null),x(null),l(a(e.name)).then(t=>{p.current.set(e.name,t.content),m.current===e.name&&(o(t.content),u(!1))}).catch(t=>{m.current===e.name&&(x(String(t)),u(!1))})},[]),v=(0,r.useCallback)(e=>{p.current.has(e.name)||l(a(e.name)).then(t=>p.current.set(e.name,t.content)).catch(()=>{})},[]),b=(0,r.useCallback)(e=>{m.current===e&&(p.current.delete(e),l(a(e)).then(t=>{p.current.set(e,t.content),m.current===e&&(o(t.content),x(null))}).catch(t=>{console.warn("Failed to refresh briefing content:",e,t)}))},[]),j=(0,r.useCallback)(()=>{m.current=null,i(null),o(null),x(null)},[]);return(0,r.useEffect)(()=>{let e=!1;return l("/api/briefing").then(n=>{e||t(n.files)}).catch(t=>{e||f(String(t))}),()=>{e=!0}},[]),{files:e,selected:n,content:s,loadingContent:c,listError:d,contentError:h,fetchContent:g,prefetch:v,refreshContent:b,close:j}}},12886:function(e,t,n){"use strict";n.d(t,{L:function(){return a}});var r=n(2265);function a(e){let{storageKey:t,defaultWidth:n,minWidth:a,maxWidth:l,edge:i="right"}=e,[s,o]=(0,r.useState)(n);(0,r.useEffect)(()=>{try{let e=Number(localStorage.getItem(t));e>=a&&e<=l&&o(e)}catch(e){}},[t,a,l]);let c=(0,r.useCallback)(e=>{e.preventDefault();let n=e.clientX,r="left"===i?-1:1,c=e=>Math.min(l,Math.max(a,e)),u=new AbortController,{signal:d}=u,f=s,h=()=>{u.abort();try{localStorage.setItem(t,String(f))}catch(e){}};window.addEventListener("pointermove",e=>{o(f=c(s+r*(e.clientX-n)))},{signal:d}),window.addEventListener("pointerup",h,{signal:d}),window.addEventListener("pointercancel",h,{signal:d})},[s,t,a,l,i]);return{width:s,startResize:c}}},94508:function(e,t,n){"use strict";n.d(t,{E:function(){return i},_:function(){return s},cn:function(){return l}});var r=n(61994),a=n(53335);function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.m6)((0,r.W)(t))}function i(e){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/);return t[t.length-1]||e}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)}},90535:function(e,t,n){"use strict";n.d(t,{j:function(){return i}});var r=n(61994);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=r.W,i=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return l(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(e=>{let t=null==n?void 0:n[e],r=null==s?void 0:s[e];if(null===t)return null;let l=a(t)||a(r);return i[e][l]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return l(e,o,null==t?void 0:null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...s,...c}[t]):({...s,...c})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}},58135:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2265);let a=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),s=e=>{let t=i(e);return t.charAt(0).toUpperCase()+t.slice(1)};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},u=(0,r.createContext)({}),d=()=>(0,r.useContext)(u),f=(0,r.forwardRef)((e,t)=>{var n,l,i;let{color:s,size:u,strokeWidth:f,absoluteStrokeWidth:h,className:x="",children:p,iconNode:m,...g}=e,{size:v=24,strokeWidth:b=2,absoluteStrokeWidth:j=!1,color:y="currentColor",className:w=""}=null!==(n=d())&&void 0!==n?n:{},N=(null!=h?h:j)?24*Number(null!=f?f:b)/Number(null!=u?u:v):null!=f?f:b;return(0,r.createElement)("svg",{ref:t,...o,width:null!==(l=null!=u?u:v)&&void 0!==l?l:o.width,height:null!==(i=null!=u?u:v)&&void 0!==i?i:o.height,stroke:null!=s?s:y,strokeWidth:N,className:a("lucide",w,x),...!p&&!c(g)&&{"aria-hidden":"true"},...g},[...m.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(p)?p:[p]])}),h=(e,t)=>{let n=(0,r.forwardRef)((n,i)=>{let{className:o,...c}=n;return(0,r.createElement)(f,{ref:i,iconNode:t,className:a("lucide-".concat(l(s(e))),"lucide-".concat(e),o),...c})});return n.displayName=s(e),n}},54891:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(58135).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},function(e){e.O(0,[6137,6892,2971,2117,1744],function(){return e(e.s=92126)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1069],{97627:function(e,t,n){Promise.resolve().then(n.bind(n,59214))},1618:function(e,t,n){"use strict";n.d(t,{v:function(){return a}});var r=n(57437),l=n(66070);function a(){return(0,r.jsx)(l.Zb,{children:(0,r.jsxs)(l.aY,{className:"space-y-2 pt-6 text-sm","data-testid":"session-expired",children:[(0,r.jsx)("p",{className:"font-medium text-destructive",children:"Session expired"}),(0,r.jsxs)("p",{className:"text-muted-foreground",children:["The bearer token in ",(0,r.jsx)("code",{className:"font-mono",children:"apps/web/.token"})," ","no longer matches"," ",(0,r.jsx)("code",{className:"font-mono",children:"~/.ai-agent/session-token"}),". Restart the dev server (",(0,r.jsx)("code",{className:"font-mono",children:"bin/serve.sh"}),") to mirror a fresh token and refresh this page."]})]})})}},10644:function(e,t,n){"use strict";n.d(t,{Y:function(){return m}});var r=n(57437),l=n(2265),a=n(20200),s=n(78537),o=n(43713),i=n(54367),c=n(52115),d=n(94508);function u(e){let{entries:t,scrollContainer:n,activeId:l,onClose:a}=e;if(0===t.length)return null;let s=e=>{var t;let r=null===(t=n.current)||void 0===t?void 0:t.querySelector('[id="'.concat(CSS.escape(e),'"]'));null==r||r.scrollIntoView({behavior:"smooth",block:"start"}),a()};return(0,r.jsxs)("nav",{"data-testid":"briefing-toc",className:"absolute right-0 top-0 bottom-0 w-56 overflow-y-auto border-l bg-background/30 px-3 py-4 backdrop-blur-sm",children:[(0,r.jsx)("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"目次"}),(0,r.jsx)("ul",{className:"space-y-0.5",children:t.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)("button",{onClick:()=>s(e.id),className:(0,d.cn)("w-full rounded px-2 py-1 text-left text-xs transition-colors hover:bg-accent hover:text-accent-foreground",1===e.level&&"font-medium",2===e.level&&"pl-4 text-muted-foreground",3===e.level&&"pl-6 text-muted-foreground/70",l===e.id&&"bg-accent/60 text-accent-foreground"),children:e.text})},e.id))})]})}var f=n(20580);let h="rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",p={a:e=>{let{children:t,...n}=e;return(0,r.jsx)("a",{...n,target:"_blank",rel:"noopener noreferrer",children:t})}};function m(e){let{file:t,content:n,loading:m,error:x,fullSize:g=!1,onToggleFullSize:v,onClose:b}=e,[y,j]=(0,l.useState)(!1),N=(0,l.useRef)(null),w=(0,l.useMemo)(()=>n?(0,i.od)(n):[],[n]),k=function(e,t){let[n,r]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let t=e.current;if(!t||"undefined"==typeof IntersectionObserver)return;let n=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){r(t.target.getAttribute("id"));break}},{root:t,rootMargin:"0px 0px -80% 0px",threshold:0});return t.querySelectorAll("h1[id], h2[id], h3[id]").forEach(e=>n.observe(e)),()=>n.disconnect()},[e,t]),n}(N,n);return(0,r.jsxs)("div",{"data-testid":"briefing-panel",className:(0,d.cn)("flex h-full flex-col overflow-hidden bg-background transition-all",g?"rounded-lg border":"border-l"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex gap-3 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{"data-testid":"panel-type",children:(0,c.C)(t.type)}),(0,r.jsx)("span",{"data-testid":"panel-date",children:t.date}),(0,r.jsxs)("span",{"data-testid":"panel-size",children:[(t.size/1024).toFixed(1)," KB"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[w.length>0&&(0,r.jsx)("button",{"data-testid":"panel-toc-btn",onClick:()=>j(e=>!e),"aria-label":"Toggle table of contents",className:(0,d.cn)("rounded p-1 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground",y&&"bg-accent text-accent-foreground"),children:"目次"}),v&&(0,r.jsx)("button",{"data-testid":"panel-fullsize-btn",onClick:v,"aria-label":g?"Collapse":"Full size",className:h,children:g?(0,r.jsx)(f.jG,{}):(0,r.jsx)(f.Qq,{})}),b&&(0,r.jsx)("button",{"data-testid":"panel-close-btn",onClick:b,"aria-label":"Close panel",className:h,children:(0,r.jsx)(f.Tw,{})})]})]}),(0,r.jsx)("div",{className:"border-b px-4 py-3",children:(0,r.jsx)("h2",{className:"text-sm font-semibold","data-testid":"panel-title",children:t.name})}),(0,r.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[(0,r.jsx)("div",{ref:N,className:"h-full overflow-y-auto px-4 py-4 pr-6",children:m?(0,r.jsx)("p",{"data-testid":"briefing-content-loading",className:"text-sm text-muted-foreground",children:"Loading…"}):null!==x?(0,r.jsxs)("p",{"data-testid":"briefing-content-error",className:"text-sm text-destructive",children:["Failed to load content: ",x]}):null!==n?(0,r.jsx)("div",{"data-testid":"briefing-content",className:"prose prose-sm max-w-none dark:prose-invert prose-headings:scroll-mt-4 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline dark:prose-a:text-blue-400",children:(0,r.jsx)(a.UG,{remarkPlugins:[o.Z],rehypePlugins:[i.zC,[s.Z,i.fO]],components:p,children:n})}):null}),(0,r.jsx)("div",{className:(0,d.cn)("pointer-events-none absolute inset-y-0 right-0 transition-opacity duration-200",y?"pointer-events-auto opacity-100":"opacity-0"),children:(0,r.jsx)(u,{entries:w,scrollContainer:N,activeId:k,onClose:()=>j(!1)})})]})]})}},59214:function(e,t,n){"use strict";n.d(t,{ChatSplitView:function(){return I}});var r=n(57437),l=n(2265),a=n(10644),s=n(83922),o=n(67608),i=n(62869),c=n(66070),d=n(83379),u=n(37614),f=n(31583);function h(e){e.style.height="auto";let t=Math.min(Math.max(e.scrollHeight,40),200);e.style.height="".concat(t,"px"),e.style.overflowY=e.scrollHeight>200?"auto":"hidden"}function p(e){let{input:t,setInput:n,busy:a,supportsMic:p,listening:m,onToggleMic:x,onSend:g,onCancel:v,onHistoryKeyDown:b,searchHistory:y,onToggleSearchHistory:j}=e,N=(0,l.useRef)(!1),w=(0,l.useRef)(null),[k,C]=(0,l.useState)(null),{isDragging:S}=(0,u.H)(w,C);function E(){if(0===t.trim().length)return;let e=null==k?void 0:k.path;C(null),g(e)}return(0,l.useEffect)(()=>{w.current&&h(w.current)},[t]),(0,r.jsx)(c.Zb,{children:(0,r.jsxs)(c.aY,{className:"space-y-2 pt-6",children:[(0,r.jsxs)("div",{className:"flex items-end gap-2",children:[(0,r.jsx)("textarea",{ref:w,"aria-label":"Chat message",value:t,onChange:e=>{n(e.target.value),h(e.target)},onCompositionStart:()=>{N.current=!0},onCompositionEnd:()=>{N.current=!1},onKeyDown:e=>{if(!N.current&&!e.nativeEvent.isComposing){if("Enter"===e.key&&!e.shiftKey){e.preventDefault(),E();return}null==b||b(e)}},placeholder:"Ask about today's briefing…",rows:2,className:"flex-1 resize-none overflow-hidden rounded-md border bg-background px-3 py-2 text-sm".concat(S?" ring-2 ring-primary":""),"data-testid":"chat-input"}),p&&(0,r.jsx)(i.z,{type:"button",variant:m?"destructive":"outline",onClick:()=>x(t),"data-testid":"mic-button","aria-label":m?"音声入力停止":"音声入力開始","aria-pressed":m,title:m?"音声入力停止":"音声入力開始 (ja-JP)",children:m?(0,r.jsx)(s.Z,{"aria-hidden":!0,className:"h-4 w-4"}):(0,r.jsx)(o.Z,{"aria-hidden":!0,className:"h-4 w-4"})}),a?(0,r.jsx)(i.z,{type:"button",variant:"destructive",onClick:v,"data-testid":"cancel-button",title:"送信中の応答を中止 (Esc)",children:"Cancel"}):(0,r.jsx)(i.z,{onClick:E,disabled:0===t.trim().length,"data-testid":"send-button",children:"Send"})]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:y,onChange:e=>j(e.target.checked),disabled:a,"data-testid":"search-history-toggle"}),"過去ブリーフィングを検索"]}),(0,r.jsx)(d.J,{attachedImage:k,onAttach:C,onRemove:()=>C(null),disabled:a,isDragging:S,onInsertFile:e=>n((0,f.B)(w.current,t,e))}),!p&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"mic-unsupported",children:"Voice input is unavailable in this browser (Chrome / Edge supported)."})]})})}var m=n(20200),x=n(78537),g=n(43713),v=n(53819),b=n(94508);function y(e){let{messages:t,busy:n,retrying:l,notionReady:a,notionState:s,onNotionSave:o,fill:i=!1}=e;return(0,r.jsx)(c.Zb,{className:(0,b.cn)(i&&"flex min-h-0 flex-1 flex-col"),children:(0,r.jsxs)(c.aY,{className:(0,b.cn)("space-y-3 overflow-y-auto pt-6",i?"min-h-0 flex-1":"max-h-[60vh]"),"data-testid":"chat-log",children:[0===t.length?(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Ask anything about today's briefing — e.g."," ","“半導体セクターの新着リスクは?”"]}):t.map((e,l)=>(0,r.jsxs)("div",{className:(0,b.cn)("rounded-md border p-3 text-sm","user"===e.role?"border-primary/30 bg-primary/5":"border-muted bg-muted/30"),"data-testid":"chat-msg-".concat(e.role),children:[(0,r.jsx)("p",{className:"mb-1 text-[10px] font-medium uppercase text-muted-foreground",children:e.role}),"assistant"===e.role?e.content?(0,r.jsx)("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:(0,r.jsx)(m.UG,{remarkPlugins:[g.Z],rehypePlugins:[x.Z],children:e.content})}):n&&l===t.length-1&&!e.cancelled?(0,r.jsx)(v.x,{label:"調査中","data-testid":"chat-thinking"}):null:(0,r.jsx)("p",{className:"whitespace-pre-wrap",children:e.content}),e.error&&(0,r.jsx)("p",{className:"mt-2 text-xs text-destructive","data-testid":"chat-error",children:e.error}),"assistant"===e.role&&e.cancelled&&(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"chat-cancelled",children:"Cancelled"}),"assistant"===e.role&&e.content&&!e.error&&!e.cancelled&&(0,r.jsx)(j,{state:s[l],enabled:a&&!(n&&l===t.length-1),onSave:()=>o(l)})]},l)),l&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"chat-retrying",children:"Session expired upstream, retrying…"})]})})}function j(e){var t,n;let{state:l,enabled:a,onSave:s}=e,o=null!==(t=null==l?void 0:l.status)&&void 0!==t?t:"idle";return(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[(0,r.jsx)(i.z,{type:"button",variant:"outline",size:"sm",onClick:s,disabled:!a||"saving"===o||"saved"===o,title:a?void 0:"Notion 認証情報が未設定です(Credentials タブで設定してください)","data-testid":"notion-save-button",children:"saving"===o?"追記中…":"saved"===o?"✓ Notion に追記済":"error"===o?"追記を再試行":"Notion ブリーフィングに追記"}),"saved"===o&&(null==l?void 0:l.url)&&(0,r.jsx)("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"text-primary underline","data-testid":"notion-save-link",children:"ページを開く"}),"saved"===o&&(null==l?void 0:l.localSaved)&&(0,r.jsx)("span",{className:"text-muted-foreground","data-testid":"local-save-note",children:"ローカル md にも追記済"}),"saved"===o&&(null==l?void 0:l.localSaved)===!1&&(0,r.jsxs)("span",{className:"text-destructive","data-testid":"local-save-error",children:["ローカル md への追記に失敗: ",null!==(n=l.localError)&&void 0!==n?n:"unknown error"]}),"error"===o&&(null==l?void 0:l.error)&&(0,r.jsx)("span",{className:"text-destructive","data-testid":"notion-save-error",children:l.error})]})}var N=n(1618),w=n(96215),k=n(56743),C=n(14092);function S(){let{fill:e=!1,onLocalSave:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{messages:n,setMessages:a,hydrated:s}=(0,k.R)(),o=(0,w.w)(),{draft:i,setDraft:c}=function(e){let{storageKey:t}=e,[n,r]=(0,l.useState)(""),[a,s]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{try{var e;r(null!==(e=window.sessionStorage.getItem(t))&&void 0!==e?e:"")}catch(e){}s(!0)},[t]),(0,l.useEffect)(()=>{if(a)try{""===n?window.sessionStorage.removeItem(t):window.sessionStorage.setItem(t,n)}catch(e){}},[n,a,t]),{draft:n,setDraft:r,hydrated:a}}({storageKey:"ai-agent:chat-draft:v1"}),[d,u]=(0,l.useState)(!1),[f,h]=(0,l.useState)(!1),{notionReady:m}=function(){let[e,t]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=!1;return fetch("/api/credentials",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(n=>{e||t(null!=n?n:{})}).catch(()=>{}),()=>{e=!0}},[]),{notionReady:!!(e&&e.NOTION_API_KEY&&e.NOTION_DATABASE_ID),hydrated:null!==e}}(),{supportsMic:x,listening:g,toggle:v}=(0,C.x)({onTranscript:c}),{notionState:j,saveToNotion:S}=function(e){let{messages:t,autoSave:n=!1,hydrated:r=!1,onLocalSave:a}=e,[s,o]=(0,l.useState)({}),i=(0,l.useRef)(!0),c=(0,l.useRef)(a);c.current=a,(0,l.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let d=(0,l.useCallback)(async e=>{let n=t[e];if(!n||"assistant"!==n.role||!n.content)return;let r="";for(let n=e-1;n>=0;n--)if("user"===t[n].role){r=t[n].content;break}if(r){o(t=>({...t,[e]:{status:"saving"}}));try{let t=await fetch("/api/chat/notion-import",{method:"POST",cache:"no-store",headers:{"content-type":"application/json"},body:JSON.stringify({date:(0,b._)(),question:r,answer:n.content})});if(!t.ok){let n="HTTP ".concat(t.status);try{let e=await t.json();e.detail&&(n=e.detail)}catch(e){}if(!i.current)return;o(t=>({...t,[e]:{status:"error",error:n}}));return}let a=await t.json();if(!i.current)return;if(o(t=>{var n,r,l;return{...t,[e]:{status:"saved",url:a.url,localPath:null!==(n=a.local_path)&&void 0!==n?n:void 0,localSaved:null!==(r=a.local_saved)&&void 0!==r&&r,localError:null!==(l=a.local_error)&&void 0!==l?l:void 0}}}),a.local_saved&&a.local_path){var l;null===(l=c.current)||void 0===l||l.call(c,a.local_path)}}catch(t){if(!i.current)return;o(n=>({...n,[e]:{status:"error",error:t instanceof Error?t.message:"Network error"}}))}}},[t]),u=(0,l.useRef)(null),f=(0,l.useRef)(new Set);return(0,l.useEffect)(()=>{if(r){if(null===u.current){u.current=t.length;return}if(n)for(let e=u.current;e<t.length;e++){let n=t[e];"assistant"===n.role&&n.content&&!n.error&&!n.cancelled&&(f.current.has(e)||(f.current.add(e),d(e)))}}},[r,n,t,d]),{notionState:s,saveToNotion:d}}({messages:n,autoSave:m,hydrated:s,onLocalSave:t}),E=(0,l.useRef)(!1),_=(0,l.useMemo)(()=>n.filter(e=>"user"===e.role).map(e=>e.content),[n]),R=o.isBackgrounded,I=function(e){let{history:t,setInput:n,busy:r}=e,a=(0,l.useRef)(-1),s=(0,l.useRef)("");return(0,l.useEffect)(()=>{a.current=-1,s.current=""},[t.length]),(0,l.useCallback)(e=>{let l=e.currentTarget;if("ArrowUp"===e.key){if(0===t.length||l.value.slice(0,l.selectionStart).includes("\n"))return;e.preventDefault(),-1===a.current?(s.current=l.value,a.current=t.length-1):a.current>0&&(a.current-=1),n(t[a.current]);return}if("ArrowDown"===e.key){if(-1===a.current||l.value.slice(l.selectionEnd).includes("\n"))return;e.preventDefault(),a.current<t.length-1?(a.current+=1,n(t[a.current])):(n(s.current),a.current=-1,s.current="");return}if("Escape"===e.key){if(r||-1===a.current)return;e.preventDefault(),n(s.current),a.current=-1,s.current=""}},[t,n,r])}({history:_,setInput:c,busy:R}),O=(0,l.useMemo)(()=>(o.jobId||"pending"===o.status)&&o.question?[{role:"user",content:o.question},{role:"assistant",content:o.assistantContent,error:o.error}]:null,[o.jobId,o.status,o.question,o.assistantContent,o.error]),D=(0,l.useMemo)(()=>O?[...n,...O]:n,[n,O]),z=(0,l.useCallback)(e=>{let t=i.trim();t&&!R&&(c(""),u(!1),E.current=!1,o.startJob({question:t,date:(0,b._)(),...e?{image_path:e}:{},...f?{search_history:!0}:{}}))},[R,o,i,f,c]),A=(0,l.useCallback)(()=>{if(!R)return;let e=o.jobId,t=o.question,n=o.assistantContent;e&&fetch("/api/chat/".concat(e),{method:"DELETE",cache:"no-store"}),t&&(a(e=>[...e,{role:"user",content:t},{role:"assistant",content:n,cancelled:!0}]),c(t)),o.reset()},[R,o,c,a]);return((0,l.useEffect)(()=>{if(o.sessionExpired||"done"!==o.status&&"failed"!==o.status||!o.question)return;if(o.staleSession&&!E.current){E.current=!0;let{question:e,date:t,searchHistory:n}=o;u(!0),o.reset(),o.startJob({question:e,date:t,...n?{search_history:!0}:{}}).finally(()=>{u(!1)});return}let e={role:"user",content:o.question},t={role:"assistant",content:o.assistantContent,error:o.error};a(n=>[...n,e,t]),o.reset()},[o.status,o.sessionExpired]),(0,l.useEffect)(()=>{if(R)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&(e.preventDefault(),A())}},[R,A]),o.sessionExpired)?(0,r.jsx)(N.v,{}):(0,r.jsxs)("div",{className:e?"flex h-full min-h-0 flex-col gap-4":"space-y-4",children:[(0,r.jsx)(y,{messages:D,busy:R,retrying:d,notionReady:m,notionState:j,onNotionSave:e=>void S(e),fill:e}),(0,r.jsx)(p,{input:i,setInput:c,busy:R,supportsMic:x,listening:g,onToggleMic:v,onSend:z,onCancel:A,onHistoryKeyDown:I,searchHistory:f,onToggleSearchHistory:h})]})}var E=n(6970),_=n(46915),R=n(12886);function I(){var e;let{files:t,selected:n,content:a,loadingContent:s,listError:o,contentError:c,fetchContent:d,refreshContent:u}=(0,_.N)(),{width:f,startResize:h}=(0,R.L)({storageKey:"ai-agent:chat-split-width:v1",defaultWidth:480,minWidth:320,maxWidth:880,edge:"left"}),[p,m]=(0,l.useState)(!1),x=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{x.current||null===t||0===t.length||(x.current=!0,d(t[0]))},[t,d]),(0,r.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,r.jsx)("div",{className:"flex justify-end pb-2 lg:hidden",children:(0,r.jsx)(i.z,{type:"button",variant:"outline",size:"sm","data-testid":"chat-doc-toggle",onClick:()=>m(e=>!e),children:p?"Back to Q&A":"Show document"})}),(0,r.jsxs)("div",{"data-testid":"chat-split-view",className:"flex min-h-0 flex-1",children:[(0,r.jsx)("div",{"data-testid":"chat-pane-qa",className:(0,b.cn)("flex min-h-0 min-w-0 flex-1 flex-col pr-0 lg:pr-4",p&&"hidden lg:flex"),children:(0,r.jsx)(S,{fill:!0,onLocalSave:e=>u((0,b.E)(e))})}),(0,r.jsxs)("div",{"data-testid":"chat-pane-doc",style:{"--doc-width":"".concat(f,"px")},className:(0,b.cn)("relative flex min-h-0 w-full min-w-0 flex-1 flex-col","lg:w-[length:var(--doc-width)] lg:flex-none",!p&&"hidden lg:flex"),children:[(0,r.jsx)(E.O,{onPointerDown:h,edge:"left",ariaLabel:"Resize document pane","data-testid":"chat-split-resizer",className:"hidden lg:block"}),(0,r.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border",children:[null!==t&&t.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[(0,r.jsx)("label",{htmlFor:"chat-doc-picker",className:"text-xs text-muted-foreground",children:"Document"}),(0,r.jsx)("select",{id:"chat-doc-picker","data-testid":"chat-doc-picker",value:null!==(e=null==n?void 0:n.name)&&void 0!==e?e:"",onChange:e=>{let n=t.find(t=>t.name===e.target.value);n&&d(n)},className:"min-w-0 flex-1 rounded border bg-background px-2 py-1 text-xs",children:t.map(e=>(0,r.jsx)("option",{value:e.name,children:e.name},e.name))})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:(0,r.jsx)(O,{listError:o,loadingList:null===t,selected:n,content:a,loadingContent:s,contentError:c})})]})]})]})]})}function O(e){let{listError:t,loadingList:n,selected:l,content:s,loadingContent:o,contentError:i}=e;return null!==t?(0,r.jsxs)("p",{"data-testid":"chat-doc-error",className:"p-4 text-sm text-destructive",children:["Failed to load documents: ",t]}):n?(0,r.jsx)("p",{"data-testid":"chat-doc-loading",className:"p-4 text-sm text-muted-foreground",children:"Loading documents…"}):null===l?(0,r.jsx)("p",{"data-testid":"chat-doc-empty",className:"p-4 text-sm text-muted-foreground",children:"No briefing document to show yet. Run a briefing, then pick it here to read it alongside the conversation."}):(0,r.jsx)(a.Y,{file:l,content:s,loading:o,error:i})}},52115:function(e,t,n){"use strict";n.d(t,{C:function(){return l}});let r={briefing:"Briefing",local:"Local","weekly-summary":"Weekly"};function l(e){var t;return null!==(t=r[e])&&void 0!==t?t:e?e[0].toUpperCase()+e.slice(1):e}},46915:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(2265);function l(e){return"/api/briefing/".concat(encodeURIComponent(e))}async function a(e){let t=await fetch(e,{cache:"no-store"});if(!t.ok)throw Error("HTTP ".concat(t.status));return t.json()}function s(){let[e,t]=(0,r.useState)(null),[n,s]=(0,r.useState)(null),[o,i]=(0,r.useState)(null),[c,d]=(0,r.useState)(!1),[u,f]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),m=(0,r.useRef)(new Map),x=(0,r.useRef)(null),g=(0,r.useCallback)(e=>{x.current=e.name,s(e);let t=m.current.get(e.name);if(void 0!==t){i(t),d(!1),p(null);return}d(!0),i(null),p(null),a(l(e.name)).then(t=>{m.current.set(e.name,t.content),x.current===e.name&&(i(t.content),d(!1))}).catch(t=>{x.current===e.name&&(p(String(t)),d(!1))})},[]),v=(0,r.useCallback)(e=>{m.current.has(e.name)||a(l(e.name)).then(t=>m.current.set(e.name,t.content)).catch(()=>{})},[]),b=(0,r.useCallback)(e=>{x.current===e&&(m.current.delete(e),a(l(e)).then(t=>{m.current.set(e,t.content),x.current===e&&(i(t.content),p(null))}).catch(t=>{console.warn("Failed to refresh briefing content:",e,t)}))},[]),y=(0,r.useCallback)(()=>{x.current=null,s(null),i(null),p(null)},[]);return(0,r.useEffect)(()=>{let e=!1;return a("/api/briefing").then(n=>{e||t(n.files)}).catch(t=>{e||f(String(t))}),()=>{e=!0}},[]),{files:e,selected:n,content:o,loadingContent:c,listError:u,contentError:h,fetchContent:g,prefetch:v,refreshContent:b,close:y}}},98575:function(e,t,n){"use strict";n.d(t,{F:function(){return a},e:function(){return s}});var r=n(2265);function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return t=>{let n=!1,r=e.map(e=>{let r=l(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():l(e[t],null)}}}}function s(...e){return r.useCallback(a(...e),e)}},37053:function(e,t,n){"use strict";n.d(t,{g7:function(){return d}});var r,l=n(2265),a=n(98575),s=n(57437),o=Symbol.for("react.lazy"),i=(r||(r=n.t(l,2)))[" use ".trim().toString()];function c(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===o&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var d=function(e){let t=function(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(c(n)&&"function"==typeof i&&(n=i(n._payload)),l.isValidElement(n)){var s;let e,o;let i=(s=n,(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?s.ref:(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?s.props.ref:s.props.ref||s.ref),c=function(e,t){let n={...t};for(let r in t){let l=e[r],a=t[r];/^on[A-Z]/.test(r)?l&&a?n[r]=(...e)=>{let t=a(...e);return l(...e),t}:l&&(n[r]=l):"style"===r?n[r]={...l,...a}:"className"===r&&(n[r]=[l,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==l.Fragment&&(c.ref=t?(0,a.F)(t,i):i),l.cloneElement(n,c)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=l.forwardRef((e,n)=>{let{children:r,...a}=e;c(r)&&"function"==typeof i&&(r=i(r._payload));let o=l.Children.toArray(r),d=o.find(f);if(d){let e=d.props.children,r=o.map(t=>t!==d?t:l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null);return(0,s.jsx)(t,{...a,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,s.jsx)(t,{...a,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}("Slot"),u=Symbol("radix.slottable");function f(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}},90535:function(e,t,n){"use strict";n.d(t,{j:function(){return s}});var r=n(61994);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=r.W,s=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return a(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(e=>{let t=null==n?void 0:n[e],r=null==o?void 0:o[e];if(null===t)return null;let a=l(t)||l(r);return s[e][a]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return a(e,i,null==t?void 0:null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...l}=t;return Object.entries(l).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...c}[t]):({...o,...c})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}}},function(e){e.O(0,[6137,6892,2941,8480,2971,2117,1744],function(){return e(e.s=97627)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[664],{39240:function(e,t,n){Promise.resolve().then(n.bind(n,2659))},2659:function(e,t,n){"use strict";n.d(t,{JournalScreen:function(){return N}});var r=n(57437),s=n(83922),a=n(67608),l=n(2265),o=n(20580),i=n(83379),d=n(53819),c=n(42648),u=n(37614),x=n(31583),m=n(90160),h=n(75408),p=n(5620),g=n(30641),f=n(14092),b=n(94508);function v(e){let t=e.match(/^\d{4}-\d{2}-\d{2}_(\d{2})(\d{2})(\d{2})/);return t?"".concat(t[1],":").concat(t[2],":").concat(t[3]):null}function j(e){let{question:t,answer:n}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("div",{className:"max-w-[85%] self-end rounded-2xl rounded-br-sm bg-muted px-4 py-2 text-foreground",children:(0,r.jsx)(c.O,{content:t,breaks:!0})}),null===n?(0,r.jsx)("div",{className:"self-start rounded-2xl rounded-bl-sm border bg-background px-4 py-2",children:(0,r.jsx)(d.x,{label:"Thinking…","data-testid":"journal-chat-thinking"})}):n&&(0,r.jsx)("div",{className:"max-w-[85%] self-start rounded-2xl rounded-bl-sm border bg-background px-4 py-2",children:(0,r.jsx)(c.O,{content:n})})]})}function y(e){let{md:t}=e,n=t.replace(/^\s*# [^\n]*\n+/,""),s=(0,g.ML)(n);return s?(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[s.preamble&&(0,r.jsx)(c.O,{content:s.preamble,breaks:!0}),s.turns.map((e,t)=>(0,r.jsx)(j,{question:e.question,answer:e.answer},t))]}):(0,r.jsx)(c.O,{content:n,breaks:!0})}function N(){var e,t;let{selected:n,composing:d,trashPreview:c,content:g,trashContent:N,panelOpen:w,selectedMeta:k,trashMeta:C,viewEpoch:E,closePanel:_,restoreEntry:S,purgeEntry:I}=(0,p.O)(),O=(0,l.useRef)(null),[L,P]=(0,l.useState)(null),{isDragging:R}=(0,u.H)(O,P),[D,T]=(0,l.useState)(""),{supportsMic:q,listening:z,toggle:K}=(0,f.x)({onTranscript:T}),Z=(0,h.l)(),F=(0,m.R)(),J="pending"===F.status||"running"===F.status,M=F.error,A=(0,l.useRef)(0),B=(0,l.useCallback)(async()=>{var e;let t=D.trim();t&&!J&&(T(""),A.current=E.current,await F.startJob({question:t,imagePath:null!==(e=null==L?void 0:L.path)&&void 0!==e?e:null,targetEntryId:Z.entryId}),P(null))},[D,J,L,F,Z.entryId]),H=(0,l.useCallback)(()=>{if("idle"===F.status)return;let e=F.question;F.cancelJob(),T(e)},[F]);(0,l.useEffect)(()=>{if(J)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&(e.preventDefault(),H())}},[J,H]);let U=null!==F.jobId&&A.current===E.current?[...Z.turns,{question:F.question,answer:F.assistantContent}]:Z.turns;if(!w)return(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Select an entry or click + New to get started."});let $=c?(null==C?void 0:C.item)||c:d&&!n?null:(null==k?void 0:k.item)||n;return(0,r.jsxs)("div",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border bg-background",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[!c&&!(d&&!n)&&(0,r.jsx)("span",{children:"Journal"}),c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"font-medium text-destructive",children:"Trash"}),(0,r.jsxs)("span",{children:[null!==(e=null==C?void 0:C.date)&&void 0!==e?e:c,v(c)&&" ".concat(v(c))]}),C&&(0,r.jsxs)("span",{children:[(C.size/1024).toFixed(1)," KB"]})]}):d&&!n?(0,r.jsx)("span",{className:"font-medium",children:"New entry"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{children:[null!==(t=null==k?void 0:k.date)&&void 0!==t?t:n,n&&v(n)&&" ".concat(v(n))]}),k&&(0,r.jsxs)("span",{children:[(k.size/1024).toFixed(1)," KB"]}),(null==k?void 0:k.notion_url)?(0,r.jsx)("a",{href:k.notion_url,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline dark:text-blue-400",children:"Synced to Notion ↗"}):k&&(0,r.jsx)("span",{title:"Syncs automatically once NOTION_DATABASE_ID_JOURNAL is configured",children:"Not synced to Notion"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>void S(c),className:"rounded-md border px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:"Restore"}),(0,r.jsx)("button",{type:"button",onClick:()=>void I(c),className:"rounded-md border px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-destructive",children:"Delete"})]}),(0,r.jsx)("button",{onClick:_,"aria-label":"Close panel",className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:(0,r.jsx)(o.Tw,{})})]})]}),$&&(0,r.jsx)("div",{className:"border-b px-4 py-3",children:(0,r.jsx)("h2",{className:"truncate text-sm font-semibold","data-testid":"journal-panel-title",children:$})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4 pr-6",children:c?N?(0,r.jsx)(y,{md:N}):(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}):(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[n&&g&&(0,r.jsx)("div",{"data-testid":"journal-content",children:(0,r.jsx)(y,{md:g})}),(0,r.jsxs)("section",{className:"flex flex-col gap-3 rounded-lg border bg-card p-4",children:[U.length>0&&(0,r.jsx)("div",{className:"flex flex-col gap-4",children:U.map((e,t)=>(0,r.jsx)(j,{question:e.question,answer:e.answer||null},t))}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("textarea",{ref:O,value:D,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),B())},placeholder:"e.g. What should I focus on next based on this week?",rows:3,className:"w-full resize-y rounded-md border bg-background p-3 text-sm".concat(R?" ring-2 ring-primary":"")}),(0,r.jsx)(i.J,{attachedImage:L,onAttach:P,onRemove:()=>P(null),isDragging:R,onInsertFile:e=>T((0,x.B)(O.current,D,e))}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void B(),disabled:J||""===D.trim(),className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:J?"Thinking…":"Brainstorm"}),q&&(0,r.jsx)("button",{type:"button",onClick:()=>K(D),"data-testid":"mic-button","aria-label":z?"音声入力停止":"音声入力開始","aria-pressed":z,title:z?"音声入力停止":"音声入力開始 (ja-JP)",className:(0,b.cn)("rounded-md border px-3 py-2 text-sm transition-colors",z?"border-destructive bg-destructive text-destructive-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:z?(0,r.jsx)(s.Z,{"aria-hidden":!0,className:"h-4 w-4"}):(0,r.jsx)(a.Z,{"aria-hidden":!0,className:"h-4 w-4"})}),J&&(0,r.jsx)("button",{type:"button",onClick:H,className:"rounded-md border px-4 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-destructive",title:"Cancel (Esc)",children:"Stop"}),M&&(0,r.jsx)("span",{className:"text-sm text-destructive",children:M})]}),!q&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"mic-unsupported",children:"Voice input is unavailable in this browser (Chrome / Edge supported)."})]})]})]})})]})}},42648:function(e,t,n){"use strict";let r;n.d(t,{O:function(){return g}});var s=n(57437),a=n(2265),l=n(20200),o=n(78537),i=n(90224),d=n(43713),c=n(69590);function u(){let{zoomIn:e,zoomOut:t,resetTransform:n}=(0,c.M4)();return(0,s.jsxs)("div",{className:"absolute bottom-4 right-4 z-10 flex flex-col gap-2",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:"rounded bg-gray-800 px-3 py-2 text-white",onClick:()=>e(),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Reset zoom",className:"rounded bg-gray-800 px-3 py-2 text-white",onClick:()=>n(),children:"⟳"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:"rounded bg-gray-800 px-3 py-2 text-white",onClick:()=>t(),children:"−"})]})}function x(e){let{svg:t,onClose:n}=e;return(0,a.useEffect)(()=>{let e=document.body.style.overflow;function t(e){"Escape"===e.key&&n()}return document.body.style.overflow="hidden",document.addEventListener("keydown",t),()=>{document.body.style.overflow=e,document.removeEventListener("keydown",t)}},[n]),(0,s.jsxs)("div",{"data-testid":"mermaid-modal-overlay",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:n,children:[(0,s.jsx)("button",{type:"button","aria-label":"Close",className:"absolute right-4 top-4 text-2xl text-white",onClick:e=>{e.stopPropagation(),n()},children:"\xd7"}),(0,s.jsx)("div",{className:"relative h-[80vh] w-[80vw] bg-gray-950",onClick:e=>e.stopPropagation(),children:(0,s.jsxs)(c.d$,{wheel:{disabled:!0},centerOnInit:!0,initialScale:1,children:[(0,s.jsx)(u,{}),(0,s.jsx)(c.Uv,{wrapperStyle:{width:"100%",height:"100%"},contentStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:t}})})]})})]})}let m=!1;function h(e){let{code:t}=e,l=(0,a.useId)(),o="mermaid-".concat(l.replace(/:/g,"")),[i,d]=(0,a.useState)({status:"loading"}),[c,u]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{let e=!1;return async function(){try{let{default:s}=await (r||(r=Promise.all([n.e(7853),n.e(4734),n.e(3045)]).then(n.bind(n,98284))),r);m||(s.initialize({startOnLoad:!1,securityLevel:"strict"}),m=!0);let{svg:a}=await s.render(o,t);e||d({status:"success",svg:a})}catch(t){e||d({status:"error",message:t instanceof Error?t.message:String(t)})}}(),()=>{e=!0}},[t,o]),"loading"===i.status)?(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"Rendering mermaid diagram..."}):"error"===i.status?(0,s.jsxs)("div",{className:"my-2",children:[(0,s.jsxs)("p",{className:"text-sm text-red-600 dark:text-red-400",children:["Mermaid render error: ",i.message]}),(0,s.jsxs)("details",{className:"mt-1",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-sm text-gray-500",children:"Show source"}),(0,s.jsx)("pre",{className:"whitespace-pre-wrap text-xs",children:(0,s.jsx)("code",{children:t})})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"my-2 cursor-zoom-in",onClick:()=>u(!0),dangerouslySetInnerHTML:{__html:i.svg}}),c&&(0,s.jsx)(x,{svg:i.svg,onClose:()=>u(!1)})]})}var p=n(54367);function g(e){let{content:t,onLinkClick:n,breaks:r=!1}=e,c=(0,a.useMemo)(()=>({a:e=>{let{children:t,href:r,...a}=e;return(0,s.jsx)("a",{...a,href:r,target:"_blank",rel:"noopener noreferrer",onClick:e=>{var t;0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||void 0===r||null===(t=null==n?void 0:n(r))||void 0===t||!t||e.preventDefault()},children:t})},code:e=>{let{className:t,children:n,...r}=e;return(null==t?void 0:t.split(/\s+/).includes("language-mermaid"))?(0,s.jsx)(h,{code:(function e(t){return"string"==typeof t?t:t.map(e).join("")})(n).replace(/\n$/,"")}):(0,s.jsx)("code",{className:t,...r,children:n})}}),[n]);return(0,s.jsx)("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline dark:prose-a:text-blue-400","data-testid":"markdown-view",children:(0,s.jsx)(l.UG,{remarkPlugins:r?[d.Z,i.Z]:[d.Z],rehypePlugins:[[o.Z,p.fO]],components:c,children:t})})}},99376:function(e,t,n){"use strict";var r=n(35475);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}})}},function(e){e.O(0,[6137,6892,7565,2941,6739,2971,2117,1744],function(){return e(e.s=39240)}),_N_E=e.O()}]);