omni-context-cli 0.0.98 → 0.0.100

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 (77) hide show
  1. package/README.md +4 -4
  2. package/README.zh-CN.md +5 -5
  3. package/dist/cli.js +7 -7
  4. package/dist/clients/extension.vsix +0 -0
  5. package/dist/clients/web/assets/App-C65Yk43U.js +2 -0
  6. package/dist/clients/web/assets/History-Df9LKwvu.js +1 -0
  7. package/dist/clients/web/assets/ImageWorkshop-De8taMDD.js +1 -0
  8. package/dist/clients/web/assets/Search-Csylmgs6.js +1 -0
  9. package/dist/clients/web/assets/ToggleOption-CpicAnfb.js +1 -0
  10. package/dist/clients/web/assets/{_baseUniq-B7aCoho4.js → _baseUniq-Be2_ZylX.js} +1 -1
  11. package/dist/clients/web/assets/{arc-Cr6Qz7J4.js → arc-8Xl11K18.js} +1 -1
  12. package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-CS6eT7JZ.js → architectureDiagram-VXUJARFQ-BvdpmuBY.js} +1 -1
  13. package/dist/clients/web/assets/{blockDiagram-VD42YOAC-BVhAlpfw.js → blockDiagram-VD42YOAC-B_w2Zw9c.js} +1 -1
  14. package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-CfapaTYu.js → c4Diagram-YG6GDRKO-B1-r9dJF.js} +1 -1
  15. package/dist/clients/web/assets/channel-C0T-xGuZ.js +1 -0
  16. package/dist/clients/web/assets/{chunk-4BX2VUAB-CykDGDtf.js → chunk-4BX2VUAB-W4gpstBK.js} +1 -1
  17. package/dist/clients/web/assets/{chunk-55IACEB6-H0-NjUu3.js → chunk-55IACEB6-BKWt677O.js} +1 -1
  18. package/dist/clients/web/assets/{chunk-B4BG7PRW-B26dkZKM.js → chunk-B4BG7PRW-Blvt2_wf.js} +1 -1
  19. package/dist/clients/web/assets/{chunk-DI55MBZ5-CxPj2PHh.js → chunk-DI55MBZ5-CnTQoMrp.js} +1 -1
  20. package/dist/clients/web/assets/{chunk-FMBD7UC4-DB6M-r48.js → chunk-FMBD7UC4-DezeNSm3.js} +1 -1
  21. package/dist/clients/web/assets/{chunk-QN33PNHL-dWgPBJyJ.js → chunk-QN33PNHL-CY5uaZ9m.js} +1 -1
  22. package/dist/clients/web/assets/{chunk-QZHKN3VN-DRjdoHp7.js → chunk-QZHKN3VN-CAA4PcOl.js} +1 -1
  23. package/dist/clients/web/assets/{chunk-TZMSLE5B-DvrITfg3.js → chunk-TZMSLE5B-t4xO48Vz.js} +1 -1
  24. package/dist/clients/web/assets/classDiagram-2ON5EDUG-C3AsfMmz.js +1 -0
  25. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-C3AsfMmz.js +1 -0
  26. package/dist/clients/web/assets/clone-Bejd4bOm.js +1 -0
  27. package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-D--t7taP.js → cose-bilkent-S5V4N54A-AvytdDIh.js} +1 -1
  28. package/dist/clients/web/assets/{dagre-6UL2VRFP-DRSHy3Yp.js → dagre-6UL2VRFP-BON6GmJV.js} +1 -1
  29. package/dist/clients/web/assets/{diagram-PSM6KHXK-BPTmO_x7.js → diagram-PSM6KHXK-BXx-qw1k.js} +1 -1
  30. package/dist/clients/web/assets/{diagram-QEK2KX5R-2Pj8JMCp.js → diagram-QEK2KX5R-BbpsLyQ5.js} +1 -1
  31. package/dist/clients/web/assets/{diagram-S2PKOQOG-JHUdCspR.js → diagram-S2PKOQOG-D3zxVt3m.js} +1 -1
  32. package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-Dy-mgJDl.js → erDiagram-Q2GNP2WA-MJ3hkrB1.js} +1 -1
  33. package/dist/clients/web/assets/{flowDiagram-NV44I4VS-MIbAory3.js → flowDiagram-NV44I4VS-CzFiPG1v.js} +1 -1
  34. package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-epMhE7bX.js → ganttDiagram-JELNMOA3-DAfbUXcj.js} +1 -1
  35. package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-C2DwL0rF.js → gitGraphDiagram-NY62KEGX-PmUO4yy8.js} +1 -1
  36. package/dist/clients/web/assets/{graph-B_cXarik.js → graph-DN-uvA3V.js} +1 -1
  37. package/dist/clients/web/assets/{index-BhbpVvH6.js → index-Dfky620n.js} +2 -2
  38. package/dist/clients/web/assets/index-PqXjPLc3.css +1 -0
  39. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-BRWe9VmO.js +1 -0
  40. package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-DE_vTQLi.js → journeyDiagram-XKPGCS4Q-7wy4t1LU.js} +1 -1
  41. package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-CtVotnQj.js → kanban-definition-3W4ZIXB7-De6YRu2m.js} +1 -1
  42. package/dist/clients/web/assets/{layout-DlKTD_Q2.js → layout-Be4gDcTC.js} +1 -1
  43. package/dist/clients/web/assets/linear-7woo3y_Q.js +1 -0
  44. package/dist/clients/web/assets/{min-DBCe67Ga.js → min-GhP75aKU.js} +1 -1
  45. package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-BEZSRzt2.js → mindmap-definition-VGOIOE7T-BmWEhLlV.js} +1 -1
  46. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-DBvLAIyz.js +1 -0
  47. package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-CT58RvpV.js → quadrantDiagram-AYHSOK5B-BY9-89FM.js} +1 -1
  48. package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-B3PavuSM.js → requirementDiagram-UZGBJVZJ-0-YSMQz-.js} +1 -1
  49. package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-CuCeS6a-.js → sankeyDiagram-TZEHDZUN-Cgl5Ivvp.js} +1 -1
  50. package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-CYGUBZyh.js → sequenceDiagram-WL72ISMW-BlsO3rKu.js} +1 -1
  51. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-BjBl1uc6.js +1 -0
  52. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-DSzooTA3.js +1 -0
  53. package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-CaB2JJ-T.js → timeline-definition-IT6M3QCI-BD0BuX9j.js} +1 -1
  54. package/dist/clients/web/assets/{treemap-KMMF4GRG-BW7EQ5mP.js → treemap-KMMF4GRG-QL1jgETh.js} +1 -1
  55. package/dist/clients/web/assets/useAppearance-C72BSRMs.js +1 -0
  56. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-CoDE6tVK.js +1 -0
  57. package/dist/clients/web/index.html +2 -2
  58. package/dist/model-prompts/glm-5.2.md +5 -0
  59. package/package.json +1 -1
  60. package/dist/clients/web/assets/App-ClEyOIsd.js +0 -2
  61. package/dist/clients/web/assets/ImageWorkshop-C8SKenrA.js +0 -1
  62. package/dist/clients/web/assets/channel-2ckWZJ8t.js +0 -1
  63. package/dist/clients/web/assets/classDiagram-2ON5EDUG-Da9paIBg.js +0 -1
  64. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-Da9paIBg.js +0 -1
  65. package/dist/clients/web/assets/clone-Br3pq0at.js +0 -1
  66. package/dist/clients/web/assets/consola-loRzlqa9.ttf +0 -0
  67. package/dist/clients/web/assets/consolab-D3-APfo_.ttf +0 -0
  68. package/dist/clients/web/assets/consolai-DyE9HZ1G.ttf +0 -0
  69. package/dist/clients/web/assets/consolaz-DwEiAd5o.ttf +0 -0
  70. package/dist/clients/web/assets/index-5d2Zh2Cu.css +0 -1
  71. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-DRXrT4kO.js +0 -1
  72. package/dist/clients/web/assets/linear-Bp6bodbQ.js +0 -1
  73. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-CmX8krXH.js +0 -1
  74. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-YMZHsiIh.js +0 -1
  75. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-D6VBSDSs.js +0 -1
  76. package/dist/clients/web/assets/useAppearance-ropGPNve.js +0 -1
  77. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-Cv3n2hw8.js +0 -1
@@ -0,0 +1 @@
1
+ import{R as e,r as t,j as s,u as r,a as o,f as a,d as n}from"./index-Dfky620n.js";import{B as i,S as c,D as l}from"./Search-Csylmgs6.js";import{C as d,a as h,u as v}from"./useAppearance-C72BSRMs.js";const m=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7z"}));function u({options:e,value:r,onChange:o,disabled:a=!1}){const[n,i]=t.useState(!1),c=t.useRef(null),l=e.find(e=>e.id===r)??e[0],v=l.icon;return t.useEffect(()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&i(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),s.jsxs("div",{className:"relative flex-1 min-w-0",ref:c,children:[s.jsxs("button",{type:"button",onClick:()=>!a&&i(e=>!e),disabled:a,className:"group w-full flex items-center gap-2 px-3 py-2 transition-all duration-200 border border-dashed border-vscode-border bg-vscode-sidebar focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(a?"opacity-50 cursor-not-allowed":"hover:bg-vscode-element hover:border-vscode-border-active cursor-pointer"),children:[s.jsx(v,{width:16,height:16,className:"text-vscode-accent shrink-0"}),s.jsx("span",{className:"truncate text-sm font-medium text-vscode-text group-hover:text-vscode-text-header transition-colors",children:l.label}),s.jsx(d,{width:14,height:14,className:"text-vscode-text-muted transition-transform duration-200 shrink-0 ml-auto "+(n?"rotate-180":"")})]}),n&&s.jsx("div",{className:"absolute top-full left-0 z-50 w-full mt-2 bg-vscode-sidebar border border-dashed border-vscode-border overflow-hidden animate-fade-in",children:s.jsx("ul",{className:"py-1",children:e.map(e=>{const t=e.icon;return s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>{o(e.id),i(!1)},className:"w-full text-left px-4 py-2.5 text-sm transition-colors border-l-2 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent flex items-center gap-2 "+(e.id===r?"border-vscode-accent bg-vscode-accent/10 text-vscode-text-header":"border-transparent text-vscode-text hover:bg-vscode-element hover:text-vscode-text-header"),children:[s.jsx(t,{width:15,height:15,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:e.label}),e.id===r&&s.jsx(h,{width:14,height:14,className:"ml-auto shrink-0"})]})},e.id)})})})]})}function x(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}function b(){const e=r(),[d,h]=t.useState([]),[b,p]=t.useState(""),[f,g]=t.useState("last30Days"),[w,N]=t.useState(!0),[y,k]=t.useState(null),[z,C]=t.useState(null),D=o(e=>e.getConfig);v(),t.useEffect(()=>{Promise.all([D(),a().then(e=>{e.data?h(e.data):k(e.error)})]).finally(()=>N(!1))},[D]),t.useEffect(()=>{document.title=e.history.title},[e.history.title]);const j=t.useMemo(()=>[{id:"all",label:e.history.all,icon:m},{id:"today",label:e.history.today,icon:m},{id:"yesterday",label:e.history.yesterday,icon:m},{id:"last7Days",label:e.history.last7Days,icon:m},{id:"last30Days",label:e.history.last30Days,icon:m},{id:"favorites",label:e.history.favorites,icon:i}],[e]),H=t.useMemo(()=>{const e=b.trim().toLowerCase(),t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(Date.now()),s=864e5;return d.filter(r=>!("favorites"===f&&!r.favorite)&&(!("today"===f&&r.updatedAt<t)&&(("yesterday"!==f||!(r.updatedAt<t-s||r.updatedAt>=t))&&(!("last7Days"===f&&r.updatedAt<t-6*s)&&(!("last30Days"===f&&r.updatedAt<t-29*s)&&(!e||(r.title.toLowerCase().includes(e)||r.provider.toLowerCase().includes(e))))))))},[f,b,d]),M=t.useMemo(()=>{const e=new Map;for(const t of H){const s=x(t.updatedAt),r=e.get(s);r?r.push(t):e.set(s,[t])}return Array.from(e,([e,t])=>({day:e,sessions:t}))},[H]);return s.jsx("div",{className:"flex h-full bg-vscode-bg text-vscode-text text-sm overflow-hidden",children:s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx("header",{className:"safe-area-top flex-none pb-2 bg-vscode-bg z-10 px-4 border-b border-dashed border-vscode-border",children:s.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[s.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1 max-w-[min(48rem,60vw)]",children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(u,{options:j,value:f,onChange:g}),s.jsx("div",{className:"p-2.5 border border-transparent shrink-0 pointer-events-none","aria-hidden":!0,children:s.jsx("div",{className:"w-4 h-4"})})]})}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsxs("div",{className:"hidden lg:flex items-center gap-2 w-72 px-3 py-2 bg-vscode-sidebar border border-dashed border-vscode-border focus-within:border-vscode-border-active focus-within:ring-1 focus-within:ring-vscode-accent",children:[s.jsx(c,{width:15,height:15,className:"text-vscode-text-muted shrink-0"}),s.jsx("input",{value:b,onChange:e=>p(e.target.value),placeholder:e.history.searchPlaceholder,className:"w-full bg-transparent text-vscode-text placeholder:text-vscode-text-muted focus:outline-none"})]})})]})}),s.jsx("main",{className:"flex-1 flex flex-col min-h-0 relative",children:s.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain px-4 [scrollbar-gutter:stable_both-edges]",children:s.jsxs("div",{className:"w-full max-w-6xl mx-auto py-6 space-y-6",children:[(y||z)&&s.jsx("div",{className:"text-sm text-vscode-error",children:y||z}),w?s.jsx("div",{className:"py-16 text-center text-vscode-text-muted",children:e.history.loading}):y?null:0===M.length?s.jsx("div",{className:"py-16 text-center text-vscode-text-muted",children:e.history.empty}):M.map(t=>s.jsxs("section",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-vscode-text-muted uppercase tracking-wide",children:[s.jsx(m,{width:14,height:14}),s.jsx("span",{children:t.day})]}),s.jsx("div",{className:"space-y-2",children:t.sessions.map(t=>{return s.jsxs("div",{className:"group relative w-full px-4 py-3 flex items-center gap-4 border border-dashed border-vscode-border bg-vscode-sidebar hover:bg-vscode-element transition-colors",children:[s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-vscode-accent opacity-0 group-hover:opacity-100 transition-opacity"}),s.jsxs("button",{type:"button",onClick:()=>(e=>{window.open(`/?session=${encodeURIComponent(e.id)}`,"_blank")})(t),className:"min-w-0 flex-1 text-left flex items-center gap-4 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent",children:[s.jsx("div",{className:"w-16 shrink-0 text-xs font-mono text-vscode-text-muted",children:(r=t.updatedAt,new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}))}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-sm text-vscode-text-header group-hover:text-vscode-accent transition-colors",children:[t.favorite&&s.jsx(i,{width:14,height:14,className:"text-vscode-accent shrink-0","aria-label":e.history.favorites}),s.jsx("span",{className:"truncate",children:t.title||e.history.untitled})]}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-vscode-text-muted",children:[s.jsx("span",{className:"px-2 py-0.5 border border-dashed border-vscode-border",children:t.provider}),s.jsx("span",{children:e.history.created(x(t.createdAt))})]})]})]}),s.jsx("button",{type:"button",onClick:()=>(async e=>{const{data:t,error:s}=await n(e.id);t?(C(null),h(e=>e.filter(e=>e.id!==t.id))):C(s)})(t),className:"p-2 text-vscode-text-muted hover:text-vscode-error hover:bg-vscode-element transition-colors shrink-0 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent",title:e.history.delete,"aria-label":e.history.delete,children:s.jsx(l,{width:15,height:15})})]},t.id);var r})})]},t.day))]})})})]})})}export{b as default};
@@ -0,0 +1 @@
1
+ import{R as e,b as o,c as t,e as n,h as a,j as i,u as l,r as s,a as r}from"./index-Dfky620n.js";import{c as d,n as c,I as u,C as v,P as m,a as h,s as g,L as p,E as b,W as f,S as x,A as w,b as y,d as N,e as k,f as C,g as I,h as z,T as M,i as S,j as A,k as R}from"./ToggleOption-CpicAnfb.js";import{a as H,u as P}from"./useAppearance-C72BSRMs.js";const V=o=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{d:"M7 2h10v2H7zM5 4h2v10H5zm12-2h2v12h-2z"}),e.createElement("path",{d:"M13 2h2v6h-2zM9 2h2v4H9zm-4 8h14v2H5zm2 4h10v2H7zm2 2h2v4H9zm4 0h2v4h-2zm-4 4h6v2H9z"})),T=o=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{d:"M21 15v4h-2v-4zm-2 4v2H5v-2zM5 15v4H3v-4zm8-12v14h-2V3z"}),e.createElement("path",{d:"M7 11v2h10v-2zm2 2v2h2v-2zm4 0v2h2v-2z"}),e.createElement("path",{d:"M15 11v2h2v-2z"})),j=o=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{d:"M0 10h2v4H0zm24 0h-2v4h2zm-8 0h-2v2h2zm-6 0H8v4h2zM2 8h2v2H2zm0 8h2v-2H2zm20-8h-2v2h2zm0 8h-2v-2h2zM4 6h4v2H4zm0 12h4v-2H4zM20 6h-4v2h4zM10 4h6v2h-6zM8 20h8v-2H8zm4-12h2v2h-2zm-2 6h4v2h-4zM8 8h2v2H8zm2 2h2v4h-2zm2 2h2v2h-2z"}),e.createElement("path",{d:"M6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm12 12h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"})),O=o=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{d:"M4 4h6v2H4zm0 14h16v2H4zM20 8h2v10h-2zM2 6h2v12H2zm8 0h10v2H10z"})),F=o=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{d:"M7 2h4v2H7zM2 5h14v2H2zm9 2h2v2h-2zM9 9h2v2H9zm-2 2h2v2H7zM5 9h2v2H5zm4 4h2v2H9zm-4 0h2v2H5zm8 2h2v7h-2zm2-2h5v2h-5zm5 2h2v7h-2zm-5 2h5v2h-5z"}));function $(e){return{base64:e.base64,mediaType:e.mediaType,fileName:e.fileName}}async function D(){try{const e=await o(t("imageWorkshop/session"));return e.ok?{data:await e.json(),error:null}:{data:null,error:"Failed to load workshop session"}}catch{return{data:null,error:"Failed to load workshop session"}}}function E(e,o){if(!e||"auto"===e)return null;const t=e.match(/^(\d+)x(\d+)$/);if(!t)return"Use WIDTHxHEIGHT, for example 1536x1024.";const n=Number(t[1]),a=Number(t[2]),i=Math.max(n,a),l=Math.min(n,a),s=n*a;return n%o.multipleOf!==0||a%o.multipleOf!==0?`Both edges must be multiples of ${o.multipleOf}.`:i>o.maxLongEdge?`The longest edge must be ${o.maxLongEdge}px or less.`:i/l>o.maxRatio?`The aspect ratio must not exceed ${o.maxRatio}:1.`:s<o.minPixels||s>o.maxPixels?`Total pixels must be between ${o.minPixels.toLocaleString()} and ${o.maxPixels.toLocaleString()}.`:null}function G(e){return"image/jpeg"===e?".jpg":"image/webp"===e?".webp":"video/mp4"===e?".mp4":"video/webm"===e?".webm":"video/quicktime"===e?".mov":".png"}function W(e){const o=e.match(/^data:([^;]+);base64,(.+)$/s);return o?{mediaType:o[1],base64:o[2]}:null}function U(e){return new Promise((o,t)=>{const n=new Image;n.onload=()=>o(n),n.onerror=()=>t(new Error("Failed to load image")),n.src=e})}function B(e=null){var o;return{privacyMode:!1,openaiImageCount:1,openaiImageSize:"auto",openaiImageCustomSize:(null==(o=null==e?void 0:e.openaiImageSizeConstraints)?void 0:o.presets[0])??"",openaiImageQuality:"auto",openaiImageOutputFormat:"png",openaiImageOutputCompression:100,openaiImageBackground:"auto",openaiImageModeration:"auto",googleImageAspectRatio:"auto",googleImageSize:"auto",googleVideoDuration:8,googleVideoAspectRatio:"auto",googleVideoResolution:"auto",googleVideoGenerateAudio:!1,googleVideoEnhancePrompt:!1,googleVideoPersonGeneration:"auto",googleVideoFps:24,xaiImageCount:1,xaiImageAspectRatio:"auto",xaiImageResolution:"auto",xaiVideoMode:"image-to-video",xaiVideoDuration:8,xaiVideoAspectRatio:"auto",xaiVideoResolution:"auto"}}const L=(e,n)=>({workshopConfig:null,imageModelId:"",options:B(),error:null,getConfig:async()=>{const{data:n,error:a}=await async function(){try{const e=await o(t("imageWorkshop/config"));return e.ok?{data:await e.json(),error:null}:{data:null,error:"Failed to load image workshop config"}}catch{return{data:null,error:"Failed to load image workshop config"}}}();if(a)e({error:a});else if(n){const o=n.imageModels.find(e=>e.id===n.defaultImageModelId)??null;e({error:null,workshopConfig:n,imageModelId:n.defaultImageModelId||"",options:B((null==o?void 0:o.capabilities)??null)})}},getDerived:()=>{var e;const o=n(),t=(null==(e=o.workshopConfig)?void 0:e.imageModels.find(e=>e.id===o.imageModelId))??null,a=(null==t?void 0:t.capabilities)??null,i=(null==a?void 0:a.maxReferenceImages)??10,l=!!(null==a?void 0:a.supportsMask),s=!!(null==a?void 0:a.supportsEditing),r=!!(null==a?void 0:a.supportsGenerationReferences),d=l?o.assets.find(e=>o.paintedMasks.has(e.id)):void 0,c=d?o.paintedMasks.get(d.id).mask:null,u=d?[d,...o.assets.filter(e=>e.id!==d.id)]:o.assets,v="custom"===o.options.openaiImageSize?o.options.openaiImageCustomSize:o.options.openaiImageSize,m=(null==a?void 0:a.openaiImageSizeConstraints)?E(v,a.openaiImageSizeConstraints):null,h=!!a&&i>0&&(s||r),g=!(o.isLoading||o.isTranslating||!t||!o.currentSession||!o.prompt.trim()||m),p=!o.isLoading&&!o.isTranslating&&!!o.prompt.trim(),b=o.paintingAssetId?o.assets.find(e=>e.id===o.paintingAssetId)??null:null,f=b?o.paintedMasks.get(b.id):void 0;return{selectedModel:t,capabilities:a,maxReferenceImages:i,supportsMask:l,canEdit:s,canUseReferencesInGenerate:r,canAttach:h,canRun:g,canTranslatePrompt:p,paintingAsset:b,paintingMask:l&&f?f.mask:null,paintingOverlayUrl:(null==f?void 0:f.overlayUrl)??null,editAssets:u,mask:c}},saveSettings:(o,t)=>{var a,i,l,s;const r=n();if(o!==r.imageModelId){const n=(null==(a=r.workshopConfig)?void 0:a.imageModels.find(e=>e.id===o))??null,d=(null==n?void 0:n.capabilities)??null,c=!(!d||!d.supportsEditing&&!d.supportsGenerationReferences)?d.maxReferenceImages??10:0,u=r.assets.slice(0,c),v=new Set(u.map(e=>e.id)),m=(null==(i=r.workshopConfig)?void 0:i.imageModels.find(e=>e.id===r.imageModelId))??null,h=(null==(l=null==m?void 0:m.capabilities.openaiImageSizeConstraints)?void 0:l.presets[0])??"",g=(null==(s=null==d?void 0:d.openaiImageSizeConstraints)?void 0:s.presets[0])??"",p=[...r.paintedMasks.keys()].every(e=>v.has(e))?r.paintedMasks:new Map([...r.paintedMasks].filter(([e])=>v.has(e)));return void e({imageModelId:o,assets:u,paintingAssetId:r.paintingAssetId&&v.has(r.paintingAssetId)?r.paintingAssetId:null,paintedMasks:(null==d?void 0:d.supportsMask)?p:new Map,options:{...t,openaiImageCustomSize:t.openaiImageCustomSize&&t.openaiImageCustomSize!==h?t.openaiImageCustomSize:g||t.openaiImageCustomSize}})}e({options:t})}});function J(){return{prompt:"",assets:[],paintingAssetId:null,paintedMasks:new Map}}const q=(e,n)=>({currentSession:null,sessions:[],getSession:async()=>{const{data:o,error:t}=await D();t?e({error:t}):o&&e({error:null,currentSession:o})},getSessions:async()=>{const{data:n}=await async function(){try{const e=await o(t("imageWorkshop/sessions"));return e.ok?{data:await e.json(),error:null}:{data:[],error:null}}catch{return{data:null,error:"Failed to load sessions"}}}();n&&e({sessions:n})},loadSession:async n=>{e({currentSession:null,...J()});const{data:a,error:i}=await async function(e){try{const n=await o(t("imageWorkshop/session/load"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});return n.ok?{data:await n.json(),error:null}:{data:null,error:"Session not found"}}catch{return{data:null,error:"Session not found"}}}(n.id);i?e({error:i}):a&&e({error:null,currentSession:a})},newSession:async()=>{const{data:n,error:a}=await async function(){try{const e=await o(t("imageWorkshop/session/new"),{method:"POST"});return e.ok?{data:await e.json(),error:null}:{data:null,error:"Failed to create session"}}catch{return{data:null,error:"Failed to create session"}}}();e(a?{error:a}:{error:null,currentSession:n,isTranslating:!1,...J()})},removeItem:async a=>{const{currentSession:i}=n();if(!i)return;const l=i.items.find(e=>e.id===a);if(e({error:null,currentSession:{...i,items:i.items.filter(e=>e.id!==a)}}),null==l?void 0:l.transient)return;const{error:s}=await async function(e){try{return(await o(t("imageWorkshop/item/remove"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})})).ok?{data:void 0,error:null}:{data:null,error:"Failed to remove item"}}catch{return{data:null,error:"Failed to remove item"}}}(a);if(s){const{data:o}=await D();o&&e({currentSession:o}),e({error:s})}}}),Q=(e,a)=>({prompt:"",assets:[],isLoading:!1,isTranslating:!1,setPrompt:o=>e({prompt:o}),addAssets:o=>{const{canAttach:t,maxReferenceImages:n}=a().getDerived();t&&0!==o.length&&e(e=>({assets:[...e.assets,...o].slice(0,n)}))},generate:async()=>{const i=a(),l=i.getDerived();if(!l.canRun||!l.capabilities)return;e({paintingAssetId:null,isLoading:!0,error:null});const s=l.canEdit&&i.assets.length>0?"edit":"generate";try{const a=[];await async function(e,a,i,l){var s;const r={modelId:a.modelId,prompt:a.prompt,...(d=a.options,c=a.capabilities,{privacyMode:d.privacyMode,openaiImageCount:c.openaiImageSupportsMultipleOutputs?d.openaiImageCount:void 0,openaiImageSize:c.openaiImageSizeConstraints?"custom"===d.openaiImageSize?d.openaiImageCustomSize:d.openaiImageSize:void 0,openaiImageQuality:c.openaiImageSupportsQuality?d.openaiImageQuality:void 0,openaiImageOutputFormat:c.openaiImageSupportsOutputFormat?d.openaiImageOutputFormat:void 0,openaiImageOutputCompression:c.openaiImageSupportsCompression?d.openaiImageOutputCompression:void 0,openaiImageBackground:c.openaiImageSupportsBackground?d.openaiImageBackground:void 0,openaiImageModeration:c.openaiImageSupportsModeration?d.openaiImageModeration:void 0,googleImageAspectRatio:c.googleImageAspectRatios?d.googleImageAspectRatio:void 0,googleImageSize:c.googleImageSizes?d.googleImageSize:void 0,googleVideoDuration:c.googleVideoSupportsDuration?d.googleVideoDuration:void 0,googleVideoAspectRatio:c.googleVideoAspectRatios?d.googleVideoAspectRatio:void 0,googleVideoResolution:c.googleVideoResolutions?d.googleVideoResolution:void 0,googleVideoGenerateAudio:c.googleVideoSupportsAudio?d.googleVideoGenerateAudio:void 0,googleVideoEnhancePrompt:c.googleVideoSupportsEnhancePrompt?d.googleVideoEnhancePrompt:void 0,googleVideoPersonGeneration:c.googleVideoPersonGenerations?d.googleVideoPersonGeneration:void 0,googleVideoFps:c.googleVideoSupportsFps?d.googleVideoFps:void 0,xaiImageCount:c.xaiImageSupportsMultipleOutputs?d.xaiImageCount:void 0,xaiImageAspectRatio:c.xaiImageAspectRatios?d.xaiImageAspectRatio:void 0,xaiImageResolution:c.xaiImageResolutions?d.xaiImageResolution:void 0,xaiVideoMode:c.xaiVideoSupportsMode?d.xaiVideoMode:void 0,xaiVideoDuration:c.xaiVideoSupportsDuration?d.xaiVideoDuration:void 0,xaiVideoAspectRatio:c.xaiVideoAspectRatios?d.xaiVideoAspectRatio:void 0,xaiVideoResolution:c.xaiVideoResolutions?d.xaiVideoResolution:void 0}),images:null==(s=a.images)?void 0:s.map($),mask:a.mask?$(a.mask):void 0};var d,c;const u=await o(t(`imageWorkshop/${e}`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!u.ok){const e=await u.json().catch(()=>null);throw new Error((null==e?void 0:e.error)||(e?JSON.stringify(e):"Request failed"))}await n(u,(e,o)=>{if("image"===e)i(o);else if("session"===e)null==l||l(o);else if("error"===e)throw new Error(o.error||"Request failed")})}(s,{modelId:i.imageModelId,prompt:i.prompt,options:i.options,capabilities:l.capabilities,images:"generate"===s&&l.canUseReferencesInGenerate?i.assets:"edit"===s?l.editAssets:[],mask:"edit"===s?l.mask:null},e=>a.push(e),o=>{e(e=>{const t=e.sessions.some(e=>e.id===o.id);return{currentSession:e.currentSession?{...e.currentSession,...o}:e.currentSession,sessions:t?e.sessions.map(e=>e.id===o.id?o:e):[o,...e.sessions]}})}),e(e=>({currentSession:e.currentSession?{...e.currentSession,items:[...e.currentSession.items,...a]}:e.currentSession,...J()}))}catch(r){r instanceof Error&&e({error:r.message})}finally{e({isLoading:!1})}},stopGeneration:async()=>{await async function(){try{return await o(t("imageWorkshop/stop"),{method:"POST"}),{data:void 0,error:null}}catch{return{data:null,error:"Failed to stop generation"}}}()},translatePrompt:async()=>{if(!a().getDerived().canTranslatePrompt)return;e({isTranslating:!0,error:null});const{data:n,error:i}=await async function(e){try{const n=await o(t("imageWorkshop/translatePrompt"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})}),a=await n.json().catch(()=>null);return n.ok?{data:a.prompt,error:null}:{data:null,error:(null==a?void 0:a.error)||"Failed to translate prompt"}}catch{return{data:null,error:"Failed to translate prompt"}}}(a().prompt);i?e({error:i}):n&&e({prompt:n}),e({isTranslating:!1})},reuse:async o=>{const{canEdit:t,canUseReferencesInGenerate:n,maxReferenceImages:i}=a().getDerived();if(t||n){e({error:null});try{const t=await async function(e){try{const o=await fetch(e.url),t=await o.blob(),n=await new Promise(e=>{const o=new FileReader;o.onloadend=()=>e(o.result),o.readAsDataURL(t)}),a=W(n);if(!a)return null;const i=await U(n);return{id:d(),base64:a.base64,mediaType:a.mediaType,fileName:`${e.id}${G(a.mediaType)}`,url:n,width:i.naturalWidth,height:i.naturalHeight}}catch{return null}}(o);if(!t)return;e(e=>({assets:[t,...e.assets].slice(0,i)}))}catch(l){l instanceof Error&&e({error:l.message})}}}}),K=(e,o)=>({paintingAssetId:null,paintedMasks:new Map,setMask:(t,n)=>{const{paintingAsset:a}=o().getDerived();e({paintedMasks:t&&n&&a?new Map([[a.id,{mask:t,overlayUrl:n}]]):new Map})},donePainting:()=>e({paintingAssetId:null}),paintMask:o=>e({paintingAssetId:o}),removeAsset:o=>{e(e=>{const t=new Map(e.paintedMasks);return t.delete(o),{assets:e.assets.filter(e=>e.id!==o),paintingAssetId:e.paintingAssetId===o?null:e.paintingAssetId,paintedMasks:t}})}}),_=a()((...e)=>({...L(...e),...q(...e),...Q(...e),...K(...e)}));function X({children:e,onClick:o,disabled:t,variant:n="secondary",className:a="",href:l,download:s}){const r=`inline-flex items-center justify-center gap-2 px-3 py-2.5 border border-dashed text-xs font-bold uppercase tracking-wider transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent ${"primary"===n?"bg-vscode-accent text-white border-vscode-accent hover:opacity-90":"danger"===n?"text-vscode-error border-vscode-error/60 hover:bg-vscode-error/10":"text-vscode-text border-vscode-border hover:bg-vscode-element"} ${t?"bg-vscode-element text-vscode-text-muted border-vscode-border cursor-not-allowed":"cursor-pointer"} ${a}`;return l&&!t?i.jsx("a",{href:l,download:s,className:r,children:e}):i.jsx("button",{type:"button",onClick:o,disabled:t,className:r,children:e})}function Y({item:e,onReuse:o,onRemove:t}){const n=l(),a=e.revisedPrompt||e.prompt,s=!!a.trim(),r=e.mimeType.startsWith("video/");return i.jsxs("article",{className:"relative group border border-dashed border-vscode-border bg-vscode-sidebar min-w-0",children:[i.jsx("div",{className:"bg-vscode-bg p-2 flex items-center justify-center",children:r?i.jsx("video",{src:e.url,controls:!0,playsInline:!0,preload:"auto",className:"block w-full max-h-[70vh]"}):i.jsx("img",{src:e.url,alt:s?a:n.workshop.resultImageAlt,className:"block w-full max-h-[70vh] object-contain"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 transition-opacity",children:i.jsx(u,{icon:v,title:n.workshop.removeFromResults,onClick:()=>t(e.id),className:"p-1 bg-vscode-bg/80 hover:text-vscode-error"})}),i.jsxs("div",{className:"p-3 space-y-3 min-w-0",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs text-vscode-text-muted min-w-0",children:[i.jsx("span",{className:"uppercase shrink-0",children:e.kind}),i.jsx("span",{className:"truncate",children:e.model})]}),s&&i.jsx("p",{className:"text-xs text-vscode-text-muted line-clamp-2",children:a}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[i.jsxs(X,{href:e.url,download:`${r?"video":"image"}-${e.id}${G(e.mimeType)}`,className:"min-w-0",children:[i.jsx(T,{width:14,height:14}),n.workshop.download]}),!r&&i.jsxs(X,{onClick:()=>o(e),children:[i.jsx(m,{width:14,height:14}),n.workshop.reuse]}),s&&i.jsxs(X,{onClick:async function(){try{await navigator.clipboard.writeText(a)}catch{return void g(n.actions.copyFailed,"error")}g(n.workshop.promptCopied,"success")},children:[i.jsx(h,{width:14,height:14}),n.workshop.copyPrompt]})]})]})]})}function Z({src:e,alt:o="",overlayUrl:t,className:n="",imageClassName:a="w-full",children:l}){const s=`${a} block object-contain select-none pointer-events-none`;return i.jsxs("div",{className:`relative overflow-hidden ${n}`,children:[i.jsx("img",{src:e,alt:o,className:s}),t&&i.jsx("img",{src:t,alt:"",className:`absolute inset-0 h-full ${s}`}),l]})}function ee({baseImage:e,mask:o,paintOverlayUrl:t,onMaskChange:n,onDone:a}){const r=l(),c=s.useRef(null),u=s.useRef(void 0),v=s.useRef(null),[m,h]=s.useState(48),[g,p]=s.useState(!1),[b,f]=s.useState(!1);function x(o){if(!e)return;const t=o.currentTarget,n=t.getContext("2d");if(!n)return;const{x:a,y:i}=function(e,o){const t=o.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*o.width,y:(e.clientY-t.top)/t.height*o.height}}(o,t),l=t.width/t.getBoundingClientRect().width;n.fillStyle="rgba(255,255,255,0.55)",n.beginPath(),n.arc(a,i,m*l/2,0,2*Math.PI),n.fill(),f(!0)}function w(){const o=c.current;if(!o||!e||!b)return void n(null,null);const t=o.toDataURL("image/png");v.current=t;const a=document.createElement("canvas");a.width=o.width,a.height=o.height;const i=a.getContext("2d"),l=o.getContext("2d");if(!i||!l)return;const s=l.getImageData(0,0,o.width,o.height),r=i.createImageData(o.width,o.height);for(let e=0;e<s.data.length;e+=4){const o=s.data[e+3]>0;r.data[e]=255,r.data[e+1]=255,r.data[e+2]=255,r.data[e+3]=o?0:255}i.putImageData(r,0,0);const u=a.toDataURL("image/png"),m=W(u);m&&n({id:d(),base64:m.base64,mediaType:m.mediaType,fileName:"mask.png",url:u,width:o.width,height:o.height},t)}return s.useEffect(()=>{const o=c.current;if(!o||!(null==e?void 0:e.width)||!(null==e?void 0:e.height))return;if(u.current===e.id)return;u.current=e.id,o.width=e.width,o.height=e.height;const t=o.getContext("2d");t&&(t.clearRect(0,0,o.width,o.height),f(!1))},[null==e?void 0:e.id]),s.useEffect(()=>{const o=c.current;if(!o||!e||!t)return;if(t===v.current)return;const n=o.getContext("2d");if(!n)return;const a=new Image;a.onload=()=>{n.clearRect(0,0,o.width,o.height),n.drawImage(a,0,0,o.width,o.height),f(!0)},a.src=t},[e,t]),e?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"bg-vscode-bg p-2",children:i.jsx(Z,{src:e.url,alt:e.fileName||r.workshop.referenceImageAlt,children:i.jsx("canvas",{ref:c,className:"absolute inset-0 w-full h-full cursor-crosshair touch-none",onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),p(!0),x(e)},onPointerMove:e=>{g&&x(e)},onPointerUp:e=>{p(!1),e.currentTarget.releasePointerCapture(e.pointerId),w()},onPointerCancel:()=>{p(!1),w()}})})}),i.jsxs("div",{className:"p-3 space-y-3",children:[i.jsxs("label",{className:"block space-y-2",children:[i.jsx("span",{className:"block text-sm font-medium text-vscode-text",children:r.workshop.brushSize}),i.jsx("input",{type:"range",min:8,max:160,value:m,onChange:e=>h(Number(e.target.value)),className:"pixel-range w-full"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(X,{onClick:a,children:r.workshop.done}),i.jsx(X,{onClick:function(){const e=c.current,o=null==e?void 0:e.getContext("2d");e&&o&&o.clearRect(0,0,e.width,e.height),f(!1),n(null,null)},disabled:!b&&!o,children:r.workshop.clear})]})]})]}):null}function oe(){const e=l();return i.jsxs("div",{className:"border border-dashed border-vscode-border bg-vscode-sidebar p-6 flex items-center gap-3",children:[i.jsx(p,{width:24,height:24,className:"animate-spin text-vscode-accent"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-mono text-sm uppercase tracking-wider text-vscode-text-header",children:e.workshop.generating}),i.jsx("p",{className:"mt-1 text-xs text-vscode-text-muted",children:e.workshop.generatingHint})]})]})}function te(){const e=l(),{currentSession:o,isLoading:t,paintingAssetId:n,error:a,getDerived:r,reuse:d,removeItem:c,setMask:u,donePainting:v}=_(),{paintingAsset:m,paintingMask:h,paintingOverlayUrl:g,supportsMask:p}=r(),x=(null==o?void 0:o.items)??[],w=(null==o?void 0:o.id)??null,y=s.useRef(null),N=s.useRef(!0),k=s.useRef(w),C=s.useCallback(()=>{const e=y.current;if(!e)return!0;const{scrollTop:o,scrollHeight:t,clientHeight:n}=e;return t-o-n<150},[]),I=s.useCallback(()=>{N.current=C()},[C]);return s.useEffect(()=>{if(t){N.current=!0;const e=y.current;e&&(e.scrollTop=e.scrollHeight)}},[t]),s.useEffect(()=>{const e=k.current!==w;k.current=w;const o=y.current;if(o)return e?(N.current=!0,void(o.scrollTop=o.scrollHeight)):void(N.current&&(o.scrollTop=o.scrollHeight))},[x,n,w]),0!==x.length||m||t||a?i.jsx("div",{ref:y,onScroll:I,className:"flex-1 overflow-y-auto overscroll-contain px-4 [scrollbar-gutter:stable_both-edges]",children:i.jsxs("div",{className:"w-full max-w-6xl mx-auto py-6 space-y-4",children:[x.map(e=>i.jsx(Y,{item:e,onReuse:d,onRemove:c},e.id)),t&&i.jsx(oe,{}),m&&p&&i.jsxs("article",{className:"border border-dashed border-vscode-accent/50 bg-vscode-sidebar min-w-0",children:[i.jsx("div",{className:"p-3 min-w-0",children:i.jsxs("h2",{className:"text-sm font-medium text-vscode-text",children:[e.workshop.maskPainter," — ",m.fileName]})}),i.jsx(ee,{baseImage:m,mask:h,paintOverlayUrl:g,onMaskChange:u,onDone:v})]}),a&&i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-vscode-error/10 border border-dashed border-vscode-error/50 text-vscode-text",children:[i.jsx(f,{width:14,height:14,className:"shrink-0 text-vscode-error"}),i.jsx("div",{className:"text-sm",children:a})]}),i.jsx("div",{className:"h-4"})]})}):i.jsx(b,{})}function ne(e){return e.type.startsWith("image/")||/\.(avif|gif|heic|heif|jpe?g|png|webp)$/i.test(e.name)}function ae({disabled:e=!1}){const o=l(),[t,n]=s.useState(!1),a=s.useRef(null),u=s.useRef(null),m=s.useRef(!1),h=r(e=>{var o;return null==(o=e.config)?void 0:o.workLanguage}),{prompt:g,assets:b,paintedMasks:f,paintingAssetId:k,isLoading:C,isTranslating:I,options:z,setPrompt:M,addAssets:S,generate:A,stopGeneration:R,translatePrompt:H,paintMask:P,removeAsset:T,getDerived:O}=_(),{selectedModel:$,supportsMask:D,canAttach:E,canRun:G,canTranslatePrompt:B}=O(),L=!!h&&"disabled"!==h,J=(null==$?void 0:$.nickname)||(null==$?void 0:$.name)||o.workshop.noModelsPlaceholder,q=g.length>4e3,Q=e||I,K=Q||!E,X=e?o.input.configureModel:o.workshop.promptPlaceholder;s.useEffect(()=>{const e=a.current;if(!e)return;if(q)return void(e.style.height="200px");e.style.height="auto";const o=Math.max(24,Math.min(e.scrollHeight,200));e.style.height=`${o}px`},[q,g]),s.useEffect(()=>{!e&&a.current&&a.current.focus()},[C,e]);const Y=async e=>{if(!E)return;const o=Array.from(e).filter(ne);if(0===o.length)return;const t=(await Promise.allSettled(o.map(e=>async function(e){const o=await new Promise((o,t)=>{const n=new FileReader;n.onload=e=>{var t;return o(String(null==(t=e.target)?void 0:t.result))},n.onerror=()=>t(n.error),n.readAsDataURL(e)}),t=W(o);if(!t)throw new Error("Invalid image file");const n=await c(o,t.mediaType,e.name),a=(null==n?void 0:n.dataUrl)??o,i=await U(a);return{id:d(),base64:(null==n?void 0:n.base64)??t.base64,mediaType:(null==n?void 0:n.mediaType)??t.mediaType,fileName:(null==n?void 0:n.fileName)??e.name,url:a,width:i.naturalWidth,height:i.naturalHeight}}(e)))).filter(e=>"fulfilled"===e.status).map(e=>e.value);S(t)};return i.jsx("div",{className:"bg-vscode-bg pb-6 pt-4",children:i.jsxs("div",{className:"w-full max-w-6xl mx-auto space-y-3",children:[b.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2 animate-fade-in",children:b.map(e=>{var t;return i.jsxs("div",{className:"relative group overflow-hidden border border-dashed border-vscode-border bg-vscode-element",children:[i.jsx("div",{className:"h-28 w-28 bg-vscode-bg",children:i.jsx(Z,{src:e.url,alt:e.fileName||o.workshop.referenceImageAlt,overlayUrl:(null==(t=f.get(e.id))?void 0:t.overlayUrl)??null,className:"h-full w-full flex items-center justify-center",imageClassName:"max-h-full max-w-full"})}),i.jsxs("div",{className:"absolute top-1 right-1 flex items-center gap-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 transition-opacity",children:[D&&i.jsx("button",{type:"button",onClick:()=>P(e.id),disabled:Q,className:"p-1 bg-vscode-bg/80 transition-colors cursor-pointer disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(k===e.id?"text-vscode-accent":"text-vscode-text-muted hover:text-vscode-accent"),title:o.workshop.paintMask,"aria-label":o.workshop.paintMask,children:i.jsx(V,{width:14,height:14})}),i.jsx("button",{type:"button",onClick:()=>T(e.id),className:"p-1 bg-vscode-bg/80 text-vscode-text-muted hover:text-vscode-error transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent",title:o.workshop.removeImage,"aria-label":o.workshop.removeImage,children:i.jsx(v,{width:14,height:14})})]})]},e.id)})}),i.jsxs("div",{className:"relative bg-vscode-sidebar border border-dashed transition-colors "+(t?"border-vscode-accent bg-vscode-accent/5":"border-vscode-border focus-within:border-vscode-accent"),onDragOver:e=>{e.preventDefault(),e.dataTransfer.types.includes("Files")&&n(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||n(!1)},onDrop:async e=>{e.preventDefault(),n(!1);const o=e.dataTransfer.files;o&&0!==o.length&&await Y(o)},children:[t&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-vscode-sidebar/90 z-20 pointer-events-none",children:i.jsx("span",{className:"text-sm text-vscode-accent",children:o.workshop.dropImages})}),i.jsx("textarea",{ref:a,value:g,onChange:e=>M(e.target.value),onCompositionStart:()=>m.current=!0,onCompositionEnd:()=>m.current=!1,onPaste:async e=>{var o;const t=null==(o=e.clipboardData)?void 0:o.items;if(!t)return;const n=[];for(let a=0;a<t.length;a++){const o=t[a];if(o.type.startsWith("image/")){e.preventDefault();const t=o.getAsFile();t&&n.push(t)}}n.length>0&&await Y(n)},onKeyDown:e=>{m.current||e.nativeEvent.isComposing||229===e.keyCode||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),A())},placeholder:X,disabled:Q,rows:1,className:"w-full px-4 py-3 bg-transparent text-sm text-vscode-text placeholder-vscode-text-muted resize-none focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed"}),i.jsxs("div",{className:"flex items-center justify-between px-3 pb-2 pt-1",children:[i.jsxs("div",{className:"flex items-center gap-3 text-xs text-vscode-text-muted select-none overflow-hidden",children:[i.jsx("div",{className:"hidden min-[640px]:flex items-center gap-1.5 px-1.5 py-0.5 hover:bg-white/5 light:hover:bg-black/5 transition-colors cursor-default min-w-0 max-w-64",title:J,children:i.jsx("span",{className:"text-vscode-text font-medium truncate",children:J})}),i.jsx("div",{className:"hidden min-[640px]:block w-px h-3 bg-vscode-border shrink-0"}),i.jsx("div",{className:"hidden min-[360px]:flex items-center gap-0.5 shrink-0",children:i.jsx(x,{icon:j,active:z.privacyMode,title:z.privacyMode?o.workshop.privacyModeOn:o.workshop.privacyModeOff})})]}),i.jsxs("div",{className:"flex items-center gap-1 pl-12",children:[i.jsx("input",{ref:u,type:"file",accept:"image/*",multiple:!0,onChange:async e=>{const o=e.target.files;o&&0!==o.length&&(await Y(o),e.target.value="")},className:"hidden"}),L&&i.jsx("button",{type:"button",onClick:H,disabled:!B,className:"p-1.5 transition-all "+(B?"text-vscode-text-muted hover:text-vscode-text hover:bg-white/5 light:hover:bg-black/5 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent":"text-vscode-border-active cursor-not-allowed"),title:o.workshop.translatePrompt,tabIndex:-1,children:I?i.jsx(p,{width:14,height:14,className:"animate-spin"}):i.jsx(F,{width:14,height:14})}),i.jsx("button",{type:"button",onClick:()=>{var e;return null==(e=u.current)?void 0:e.click()},disabled:K,className:"p-1.5 transition-all "+(K?"text-vscode-border-active cursor-not-allowed":"text-vscode-text-muted hover:text-vscode-text hover:bg-white/5 light:hover:bg-black/5 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent"),title:o.input.attachFile,tabIndex:-1,children:i.jsx(w,{width:14,height:14})}),C?i.jsx("button",{type:"button",onClick:R,className:"p-1.5 bg-vscode-error hover:brightness-90 text-white transition-all cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent",title:o.input.stopGeneration,children:i.jsx(y,{width:14,height:14,fill:"currentColor"})}):i.jsx("button",{type:"button",onClick:()=>A(),disabled:!G,className:"p-1.5 transition-all "+(G?"bg-vscode-accent text-white hover:brightness-110 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent":"text-vscode-border-active cursor-not-allowed"),title:o.workshop.run,children:i.jsx(N,{width:14,height:14})})]})]})]})]})})}function ie({label:e,children:o,hint:t}){return i.jsxs("label",{className:"block space-y-2",children:[i.jsx("span",{className:"block text-sm font-medium text-vscode-text",children:e}),o,t&&i.jsx("span",{className:"block text-xs text-vscode-text-muted leading-relaxed",children:t})]})}function le({onClose:e}){const{workshopConfig:o,imageModelId:t,options:n,saveSettings:a}=_(),r=(null==o?void 0:o.imageModels)??[],d=l(),c=d.workshop,[u,m]=s.useState("model"),[h,g]=s.useState(t),[p,b]=s.useState(n),f=r.find(e=>e.id===h)??null,x=(null==f?void 0:f.capabilities)??null,w=s.useMemo(()=>(null==x?void 0:x.openaiImageSizeConstraints)?function(e,o){return[{value:"auto",label:o.auto},...e.presets.map(e=>({value:e,label:e.replace("x"," x ")})),{value:"custom",label:o.custom}]}(x.openaiImageSizeConstraints,c):[{value:"auto",label:c.auto}],[null==x?void 0:x.openaiImageSizeConstraints,c]),y=null==x?void 0:x.openaiImageSizeConstraints,N="custom"===p.openaiImageSize?p.openaiImageCustomSize:p.openaiImageSize,S=y?E(N,y):null,A=!!y&&function(e,o){const t=e.match(/^(\d+)x(\d+)$/);return!!t&&Number(t[1])*Number(t[2])>o.experimentalAbove}(N,y),R=S||(A?c.experimentalSize:void 0),P=(null==x?void 0:x.googleImageAspectRatios)??(null==x?void 0:x.googleVideoAspectRatios)??(null==x?void 0:x.xaiVideoAspectRatios)??(null==x?void 0:x.xaiImageAspectRatios),V=(null==x?void 0:x.googleImageSizes)??(null==x?void 0:x.googleVideoResolutions)??(null==x?void 0:x.xaiVideoResolutions)??(null==x?void 0:x.xaiImageResolutions),T=(null==x?void 0:x.googleImageAspectRatios)?p.googleImageAspectRatio:(null==x?void 0:x.googleVideoAspectRatios)?p.googleVideoAspectRatio:(null==x?void 0:x.xaiVideoAspectRatios)?p.xaiVideoAspectRatio:p.xaiImageAspectRatio,j=(null==x?void 0:x.googleImageSizes)?p.googleImageSize:(null==x?void 0:x.googleVideoResolutions)?p.googleVideoResolution:(null==x?void 0:x.xaiVideoResolutions)?p.xaiVideoResolution:p.xaiImageResolution,O=(null==x?void 0:x.googleImageAspectRatios)?"googleImageAspectRatio":(null==x?void 0:x.googleVideoAspectRatios)?"googleVideoAspectRatio":(null==x?void 0:x.xaiVideoAspectRatios)?"xaiVideoAspectRatio":"xaiImageAspectRatio",F=(null==x?void 0:x.googleImageSizes)?"googleImageSize":(null==x?void 0:x.googleVideoResolutions)?"googleVideoResolution":(null==x?void 0:x.xaiVideoResolutions)?"xaiVideoResolution":"xaiImageResolution",$=[{id:"model",label:c.model,icon:k},{id:"output",label:c.output,icon:C},{id:"preferences",label:d.settings.tabs.preferences,icon:I}];function D(e,o){b(t=>({...t,[e]:o}))}return i.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 animate-fade-in",children:i.jsxs("div",{className:"bg-vscode-sidebar border border-dashed border-vscode-border w-full max-w-lg overflow-hidden m-4",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-dashed border-vscode-border bg-vscode-element/50",children:[i.jsx("h2",{className:"text-sm font-bold text-vscode-text-header uppercase tracking-widest",children:d.settings.title}),i.jsx("button",{type:"button",onClick:e,className:"text-vscode-text-muted hover:text-vscode-text p-1 hover:bg-vscode-border transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent",children:i.jsx(v,{width:18,height:18})})]}),i.jsx("div",{className:"flex border-b border-dashed border-vscode-border",children:$.map(e=>i.jsxs("button",{type:"button",onClick:()=>m(e.id),className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(u===e.id?"text-vscode-accent border-b-2 border-vscode-accent":"text-vscode-text-muted hover:text-vscode-text"),children:[i.jsx(e.icon,{width:16,height:16}),i.jsx("span",{children:e.label})]},e.id))}),i.jsxs("div",{className:"p-6 space-y-5 max-h-[60vh] overflow-y-auto",children:["model"===u&&i.jsxs(i.Fragment,{children:[i.jsx(z,{label:c.imageModel,value:h,onChange:g,options:r.map(e=>({value:e.id,label:e.nickname||e.name})),placeholder:c.noModelsPlaceholder,disabled:0===r.length}),0===r.length&&i.jsx("p",{className:"text-xs text-vscode-warning",children:c.addModelHint})]}),"output"===u&&i.jsxs(i.Fragment,{children:[y&&i.jsx(z,{label:c.size,value:p.openaiImageSize,onChange:e=>D("openaiImageSize",e),options:w,description:"custom"!==p.openaiImageSize?R:void 0}),y&&"custom"===p.openaiImageSize&&i.jsx(ie,{label:c.customSize,hint:R||c.sizeMultipleHint(y.multipleOf),children:i.jsx("input",{value:p.openaiImageCustomSize,onChange:e=>D("openaiImageCustomSize",e.target.value),placeholder:"1536x1024",className:"w-full px-4 py-2.5 bg-vscode-bg border border-dashed border-vscode-border text-sm text-vscode-text focus:outline-none focus:border-vscode-accent focus-visible:ring-1 focus-visible:ring-vscode-accent disabled:opacity-60 disabled:cursor-not-allowed","aria-invalid":!!S})}),(null==x?void 0:x.xaiVideoSupportsMode)&&i.jsx(z,{label:c.videoMode,value:p.xaiVideoMode,onChange:e=>D("xaiVideoMode",e),options:[{value:"image-to-video",label:c.imageToVideo},{value:"reference-to-video",label:c.referenceToVideo}]}),P&&i.jsx(z,{label:c.aspectRatio,value:T,onChange:e=>D(O,e),options:P.map(e=>({value:e,label:"auto"===e?c.auto:e}))}),V&&i.jsx(z,{label:c.resolution,value:j,onChange:e=>D(F,e),options:V.map(e=>({value:e,label:"auto"===e?c.auto:e}))}),((null==x?void 0:x.googleVideoSupportsDuration)||(null==x?void 0:x.xaiVideoSupportsDuration))&&i.jsx(z,{label:c.duration,value:String(x.googleVideoSupportsDuration?p.googleVideoDuration:p.xaiVideoDuration),onChange:e=>D(x.googleVideoSupportsDuration?"googleVideoDuration":"xaiVideoDuration",Number(e)),options:Array.from({length:15},(e,o)=>{const t=String(o+1);return{value:t,label:t}})}),(null==x?void 0:x.googleVideoSupportsAudio)&&i.jsx(M,{label:c.audio,description:c.audioDescription,enabled:p.googleVideoGenerateAudio,onChange:e=>D("googleVideoGenerateAudio",e)}),(null==x?void 0:x.googleVideoSupportsEnhancePrompt)&&i.jsx(M,{label:c.enhancePrompt,description:c.enhancePromptDescription,enabled:p.googleVideoEnhancePrompt,onChange:e=>D("googleVideoEnhancePrompt",e)}),(null==x?void 0:x.googleVideoPersonGenerations)&&i.jsx(z,{label:c.personGeneration,value:p.googleVideoPersonGeneration,onChange:e=>D("googleVideoPersonGeneration",e),options:x.googleVideoPersonGenerations.map(e=>({value:e,label:"auto"===e?c.auto:e}))}),(null==x?void 0:x.googleVideoSupportsFps)&&i.jsx(z,{label:c.fps,value:String(p.googleVideoFps),onChange:e=>D("googleVideoFps",Number(e)),options:[12,15,24,25,30,48,50,60,120,240].map(e=>({value:String(e),label:String(e)}))}),(null==x?void 0:x.openaiImageSupportsQuality)&&i.jsx(z,{label:c.quality,value:p.openaiImageQuality,onChange:e=>D("openaiImageQuality",e),options:[{value:"auto",label:c.auto},{value:"low",label:c.qualityLow},{value:"medium",label:c.qualityMedium},{value:"high",label:c.qualityHigh}]}),(null==x?void 0:x.openaiImageSupportsOutputFormat)&&i.jsx(z,{label:c.format,value:p.openaiImageOutputFormat,onChange:e=>D("openaiImageOutputFormat",e),options:[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}]}),(null==x?void 0:x.openaiImageSupportsCompression)&&"png"!==p.openaiImageOutputFormat&&i.jsx(z,{label:c.compression,value:String(p.openaiImageOutputCompression),onChange:e=>D("openaiImageOutputCompression",Number(e)),options:Array.from({length:21},(e,o)=>{const t=String(5*o);return{value:t,label:t}})}),(null==x?void 0:x.openaiImageSupportsBackground)&&i.jsx(z,{label:c.background,value:p.openaiImageBackground,onChange:e=>D("openaiImageBackground",e),options:[{value:"auto",label:c.auto},{value:"opaque",label:c.opaque}]}),(null==x?void 0:x.openaiImageSupportsModeration)&&i.jsx(z,{label:c.moderation,value:p.openaiImageModeration,onChange:e=>D("openaiImageModeration",e),options:[{value:"auto",label:c.auto},{value:"low",label:c.low}]}),((null==x?void 0:x.openaiImageSupportsMultipleOutputs)||(null==x?void 0:x.xaiImageSupportsMultipleOutputs))&&i.jsx(z,{label:c.images,value:String(x.xaiImageSupportsMultipleOutputs?p.xaiImageCount:p.openaiImageCount),onChange:e=>D(x.xaiImageSupportsMultipleOutputs?"xaiImageCount":"openaiImageCount",Number(e)),options:Array.from({length:10},(e,o)=>{const t=String(o+1);return{value:t,label:t}})})]}),"preferences"===u&&i.jsx(M,{label:c.privacyMode,description:c.privacyModeDescription,enabled:p.privacyMode,onChange:e=>D("privacyMode",e)})]}),i.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-dashed border-vscode-border bg-vscode-element/30",children:[i.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-xs font-bold text-vscode-text hover:bg-vscode-border transition-colors uppercase tracking-wider",children:d.settings.cancel}),i.jsxs("button",{type:"button",onClick:function(){a(h,p),e()},disabled:!!S,className:"px-6 py-2 text-xs font-bold bg-vscode-accent text-white hover:brightness-110 transition-colors uppercase tracking-wider border border-dashed border-vscode-accent/50 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[i.jsx(H,{width:16,height:16}),i.jsx("span",{children:d.settings.save})]})]})]})})}function se(){const e=l(),[n,a]=s.useState(!1),{config:d,getConfig:c}=r(),{currentSession:v,sessions:m,isLoading:h,options:g,getConfig:p,getSession:b,getSessions:f,loadSession:x,newSession:w,getDerived:y}=_(),{selectedModel:N}=y();return P(),s.useEffect(()=>{Promise.all([p(),b(),f(),c()])},[]),s.useEffect(()=>{document.title=(null==d?void 0:d.projectName)||"OmniContext CLI"},[null==d?void 0:d.projectName]),i.jsxs("div",{className:"flex h-full bg-vscode-bg text-vscode-text text-sm overflow-hidden",children:[i.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[i.jsx("header",{className:"safe-area-top flex-none pb-2 bg-vscode-bg z-10 px-4 border-b border-dashed border-vscode-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[i.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1 max-w-[min(48rem,60vw)]",children:i.jsx(S,{icon:C,title:g.privacyMode?e.workshop.privateSession:(null==v?void 0:v.title)||e.workshop.newSession,sessions:m,currentId:(null==v?void 0:v.id)??null,emptyText:e.workshop.noSessions,newTitle:e.workshop.newSession,onSelect:x,onNew:w,disabled:h})}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[i.jsx(u,{icon:O,title:e.workshop.folder,onClick:()=>async function(){try{return await o(t("imageWorkshop/openFolder"),{method:"POST"}),{data:void 0,error:null}}catch{return{data:null,error:"Failed to open folder"}}}(),className:"hidden md:block"}),i.jsx(u,{icon:A,title:e.app.settings,onClick:()=>a(!0),disabled:h})]})]})}),i.jsx("main",{className:"flex-1 flex flex-col min-h-0 relative",children:i.jsx(te,{})}),i.jsx("div",{className:"safe-area-bottom flex-none bg-vscode-bg px-4 border-t border-dashed border-vscode-border",children:i.jsx(ae,{disabled:!N})})]}),n&&i.jsx(le,{onClose:()=>a(!1)}),i.jsx(R,{})]})}export{se as default};
@@ -0,0 +1 @@
1
+ import{R as h}from"./index-Dfky620n.js";const v=v=>h.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},v),h.createElement("path",{d:"M6 2h12v2H6zM4 4h2v18H4zm14 0h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm-8 2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4z"})),m=v=>h.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},v),h.createElement("path",{d:"M6 7h2v2H6zm14 0h2v10h-2zM8 5h12v2H8zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h12v2H8zm6-6h2v2h-2zm2 2h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm0-4h2v2h-2z"})),t=v=>h.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},v),h.createElement("path",{d:"M22 22h-2v-2h2v2Zm-2-2h-2v-2h2v2Zm-6-2H6v-2h8v2Zm4 0h-2v-2h2v2ZM6 16H4v-2h2v2Zm10 0h-2v-2h2v2ZM4 14H2V6h2v8Zm14 0h-2V6h2v8ZM6 6H4V4h2v2Zm10 0h-2V4h2v2Zm-2-2H6V2h8v2Z"}));export{v as B,m as D,t as S};
@@ -0,0 +1 @@
1
+ import{R as e,r as t,j as h,h as s}from"./index-Dfky620n.js";import{a as o,C as r}from"./useAppearance-C72BSRMs.js";const v=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7 7v10H5V7zm12 0v12h-2V7zm-8 2v10H9V9zm4 0v8h-2V9zm0-6v2H9V3zm-2 4v2h-2V7zm4 12v2h-6v-2zm0-14v2h-2V5zM9 5v2H7V5z"})),i=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"})),n=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4z"})),c=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5 3h14v2H5zm0 16h14v2H5zM3 5h2v14H3zm16 0h2v14h-2zM9 7h6v2H9zm0 8h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-8h2v2h-2zm0 20h2v2h-2zM1 11h2v2H1zm20 0h2v2h-2zm0-4h2v2h-2zm0 8h2v2h-2zM1 15h2v2H1zm0-8h2v2H1zm6-6h2v2H7zm8 0h2v2h-2zm0 20h2v2h-2zm-8 0h2v2H7z"})),a=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"}),e.createElement("path",{d:"M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"})),d=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 22h-2v-6h2v6Zm-6-3H5v-2h2v2Zm12 0h-2v-2h2v2ZM9 17H7v-2h2v2Zm8 0h-2v-2h2v2Zm-9-4H2v-2h6v2Zm14 0h-6v-2h6v2ZM9 9H7V7h2v2Zm8 0h-2V7h2v2Zm-4-1h-2V2h2v6ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Z"})),l=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 11h7v2h-7v7h-2v-7H4v-2h7V4h2v7Z"})),m=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 19h4v2H2v-8h2v6Zm8 0H8v-2h4v2Zm4-2h-4v-2h4v2Zm4-2h-4v-2h4v2Zm-10-2H4v-2h6v2Zm12 0h-2v-2h2v2ZM8 5H4v6H2V3h6v2Zm12 6h-4V9h4v2Zm-4-2h-4V7h4v2Zm-4-2H8V5h4v2Z"})),z=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 14h2v6H4zm6 0h2v6h-2zm-4-2h4v2H6zm0 8h4v2H6zm-4-4h2v2H2zm20-8h-4V6h4z"}),e.createElement("path",{d:"M10 16h12v2H10zm4-8H2V6h12zm6-4v2h-2V4zm0 6V8h-2v2zm-6-8h4v2h-4zm0 10h4v-2h-4zm-2-8h2v2h-2zm0 6h2V8h-2z"})),u=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M18 2h2v2h-2zM4 2h2v2H4zm16 20h-2v-2h2zM4 22h2v-2H4zM20 4h2v2h-2zM6 4h4v2H6zm12 16h-4v-2h4zM6 20h4v-2H6zM18 6h2v4h-2zM4 6h2v4H4zm16 12h-2v-4h2zM4 18h2v-4H4zM14 4h4v2h-4zM2 4h2v2H2zm20 16h-2v-2h2zM2 20h2v-2H2z"}),e.createElement("path",{d:"M8 2h2v4H8zm0 20h2v-4H8z"}),e.createElement("path",{d:"M8 2h8v2H8zm0 20h8v-2H8zM2 8h2v8H2zm20 8h-2V8h2z"}),e.createElement("path",{d:"M20 8h2v4h-2zM10 8h4v2h-4zm-2 2h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2z"})),b=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2 4h2v16H2zm2 16h16v2H4zM20 4h2v16h-2zM4 2h16v2H4z"})),x=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm-3-5h2v-2h-2zm0-4h2V7h-2z"})),g=t.memo(function({icon:e,title:t,onClick:s,disabled:o=!1,tone:r="default",className:v=""}){return h.jsx("button",{type:"button",onClick:s,disabled:o,className:`p-2.5 transition-all duration-200 shrink-0 border border-transparent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent ${o?"text-vscode-text-muted cursor-not-allowed opacity-50":"accent"===r?"text-vscode-accent hover:bg-vscode-element cursor-pointer":"text-vscode-text-muted hover:text-vscode-text hover:bg-vscode-element cursor-pointer"} ${v}`,title:t,"aria-label":t,children:h.jsx(e,{width:16,height:16})})});async function w(e,t,h){if(!t.startsWith("image/"))return null;const s="image/png"===t,o=await function(e,t){return new Promise(h=>{const s=new Image;s.onload=()=>{const e=document.createElement("canvas");e.width=s.naturalWidth,e.height=s.naturalHeight,e.getContext("2d").drawImage(s,0,0),h(t?e.toDataURL("image/png"):e.toDataURL("image/jpeg",.92))},s.onerror=()=>h(null),s.src=e})}(e,s);if(!o)return null;const r=s?"image/png":"image/jpeg",v=s?".png":".jpg";return{dataUrl:o,base64:o.split(",")[1],mediaType:r,fileName:h.replace(/\.[^.]+$/,v)}}function p({icon:e,active:t,title:s}){return h.jsx("div",{className:"p-1 transition-colors "+(t?"text-vscode-text":"text-vscode-border-active"),title:s,children:h.jsx(e,{width:14,height:14})})}function f(){return h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-vscode-text-muted p-8",children:[h.jsx("pre",{className:"text-vscode-text-header text-xs mb-4 text-center leading-tight",children:" ____ __ ____ __\n / __ \\/ |/ / |/ /\n / / / / /|_/ /| /\n / /_/ / / / // |\n \\____/_/ /_//_/|_|"}),h.jsxs("p",{className:"text-center text-xs uppercase tracking-widest text-vscode-text-muted",children:["// ","system ready"," // ","awaiting input..."]})]})}let H=0;const M=s(e=>({toasts:[],dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function N(e,t="info"){const h=H++;M.setState(s=>({toasts:[...s.toasts,{id:h,message:e,type:t}]}))}const y={info:t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"})),success:o,error:x},V={info:"bg-vscode-sidebar border-vscode-border text-vscode-text",success:"bg-vscode-sidebar border-vscode-info/70 text-vscode-text",error:"bg-vscode-sidebar border-vscode-error/70 text-vscode-text"};function C({toast:e,onDismiss:s}){const o=y[e.type];return t.useEffect(()=>{if("error"!==e.type){const t=setTimeout(()=>s(e.id),3e3);return()=>clearTimeout(t)}},[s,e.id,e.type]),h.jsxs("div",{className:`flex items-center gap-3 pl-4 pr-2 py-2.5 border border-dashed animate-fade-in ${V[e.type]}`,children:[h.jsx(o,{width:16,height:16,className:"shrink-0"}),h.jsx("span",{className:"text-sm flex-1 min-w-0 break-words",children:e.message}),h.jsx("button",{type:"button","aria-label":"Dismiss toast",onClick:()=>s(e.id),className:"p-1 hover:bg-white/10 opacity-75 hover:opacity-100 transition-opacity",children:h.jsx(i,{width:14,height:14})})]})}function _(){const{toasts:e,dismiss:t}=M();return 0===e.length?null:h.jsx("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 flex flex-col gap-2 max-w-lg w-full px-4",children:e.map(e=>h.jsx(C,{toast:e,onDismiss:t},e.id))})}function Z(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=[...e].map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function j({icon:e,title:s,sessions:o,currentId:v,emptyText:i,newTitle:n,onSelect:c,onNew:a,disabled:d=!1}){const[m,z]=t.useState(!1),u=t.useRef(null);return t.useEffect(()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&z(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),h.jsxs("div",{className:"flex items-center gap-2 w-full",ref:u,children:[h.jsxs("div",{className:"relative flex-1 min-w-0",children:[h.jsxs("button",{type:"button",onClick:()=>!d&&z(e=>!e),disabled:d,className:"group w-full flex items-center gap-2 px-3 py-2 transition-all duration-200 border border-dashed border-vscode-border bg-vscode-sidebar focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(d?"opacity-50 cursor-not-allowed":"hover:bg-vscode-element hover:border-vscode-border-active cursor-pointer"),children:[h.jsx(e,{width:16,height:16,className:"text-vscode-accent shrink-0"}),h.jsx("span",{className:"truncate text-sm font-medium text-vscode-text group-hover:text-vscode-text-header transition-colors",children:s}),h.jsx(r,{width:14,height:14,className:"text-vscode-text-muted transition-transform duration-200 shrink-0 ml-auto "+(m?"rotate-180":"")})]}),m&&h.jsx("div",{className:"absolute top-full left-0 z-50 w-full mt-2 bg-vscode-sidebar border border-dashed border-vscode-border overflow-hidden animate-fade-in",children:0===o.length?h.jsx("div",{className:"px-4 py-3 text-sm text-vscode-text-muted text-center",children:i}):h.jsx("ul",{className:"max-h-80 overflow-y-auto py-1",children:o.map(e=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>{c(e),z(!1)},className:"w-full text-left px-4 py-2.5 text-sm transition-colors border-l-2 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(e.id===v?"border-vscode-accent bg-vscode-accent/10 text-vscode-text-header":"border-transparent text-vscode-text hover:bg-vscode-element hover:text-vscode-text-header"),children:[h.jsx("div",{className:"truncate",children:e.title}),h.jsx("div",{className:"text-xs text-vscode-text-muted mt-0.5 font-mono",children:new Date(e.updatedAt).toLocaleDateString()})]})},e.id))})})]}),h.jsx("button",{type:"button",onClick:()=>{a(),z(!1)},disabled:d,className:"p-2.5 bg-vscode-element hover:brightness-110 text-vscode-text-header transition-all shrink-0 border border-dashed border-vscode-border hover:border-vscode-border-active focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(d?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:n,children:h.jsx(l,{width:16,height:16})})]})}const k=t.memo(function({label:e,description:s,value:o,onChange:v,options:i,placeholder:n,disabled:c}){const a=t.useId();return h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{htmlFor:a,className:"block text-sm font-medium text-vscode-text",children:e}),h.jsxs("div",{className:"relative",children:[h.jsxs("select",{id:a,value:o,onChange:e=>v(e.target.value),disabled:c,className:"w-full px-4 py-2.5 bg-vscode-bg border border-dashed border-vscode-border text-sm text-vscode-text focus:outline-none focus:border-vscode-accent focus-visible:ring-1 focus-visible:ring-vscode-accent appearance-none "+(c?"opacity-60 cursor-not-allowed":"cursor-pointer"),children:[n&&h.jsx("option",{value:"",children:n}),i.map(e=>h.jsx("option",{value:e.value,children:e.label},e.value))]}),h.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-vscode-text-muted",children:h.jsx(r,{width:14,height:14})})]}),s&&h.jsx("p",{className:"text-xs text-vscode-text-muted",children:s})]})});function B({label:e,description:t,enabled:s,onChange:o}){return h.jsxs("div",{className:"flex items-center justify-between p-4 bg-vscode-bg border border-dashed border-vscode-border",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-vscode-text",children:e}),h.jsx("div",{className:"text-xs text-vscode-text-muted mt-1",children:t})]}),h.jsx("button",{onClick:()=>o(!s),className:"w-12 h-6 transition-colors relative shrink-0 ml-4 "+(s?"bg-vscode-accent":"bg-vscode-border"),children:h.jsx("div",{className:"absolute top-1 w-4 h-4 bg-white transition-all "+(s?"left-7":"left-1")})})]})}export{v as A,i as C,f as E,g as I,d as L,l as P,p as S,B as T,x as W,n as a,b,Z as c,m as d,c as e,a as f,z as g,k as h,j as i,u as j,_ as k,w as n,N as s};
@@ -1 +1 @@
1
- import{aU as r,bq as n,aE as t,aS as u,aD as e,br as o,bs as i,bt as f,bu as a,bv as c,bl as v,bw as s,aV as l,a_ as b,b1 as j,bx as d,aY as p,by as y,bo as w,aF as _,bm as m,bz as O}from"./App-ClEyOIsd.js";function h(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}function g(r,n){for(var t=-1,u=null==r?0:r.length,e=Array(u);++t<u;)e[t]=n(r[t],t,r);return e}var A=u?u.prototype:void 0,k=A?A.toString:void 0;function S(r){if("string"==typeof r)return r;if(t(r))return g(r,S)+"";if(h(r))return k?k.call(r):"";var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function x(r,n){for(var t=-1,u=null==r?0:r.length;++t<u&&!1!==n(r[t],t,r););return r}function D(r,n,t,u){for(var e=r.length,o=t+-1;++o<e;)if(n(r[o],o,r))return o;return-1}function E(r){return r!=r}function $(r,n){return!!(null==r?0:r.length)&&function(r,n,t){return n==n?function(r,n,t){for(var u=t-1,e=r.length;++u<e;)if(r[u]===n)return u;return-1}(r,n,t):D(r,E,t)}(r,n,0)>-1}function q(r){return e(r)?o(r):i(r)}var B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/;function z(r,n){if(t(r))return!1;var u=typeof r;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=r&&!h(r))||(V.test(r)||!B.test(r)||null!=n&&r in Object(n))}var F,M,N,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,U=/\\(\\)?/g,Y=(F=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(R,function(r,t,u,e){n.push(u?e.replace(U,"$1"):t||r)}),n},M=f(F,function(r){return 500===N.size&&N.clear(),r}),N=M.cache,M);function C(r){return null==r?"":S(r)}function G(r,n){return t(r)?r:z(r,n)?[r]:Y(C(r))}function H(r){if("string"==typeof r||h(r))return r;var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function I(r,n){for(var t=0,u=(n=G(n,r)).length;null!=r&&t<u;)r=r[H(n[t++])];return t&&t==u?r:void 0}function J(r,n){for(var t=-1,u=n.length,e=r.length;++t<u;)r[e+t]=n[t];return r}var K=u?u.isConcatSpreadable:void 0;function L(r){return t(r)||a(r)||!!(K&&r&&r[K])}function P(r,n,t,u,e){var o=-1,i=r.length;for(t||(t=L),e||(e=[]);++o<i;){var f=r[o];t(f)?J(e,f):u||(e[e.length]=f)}return e}function Q(r,n,t,u){var e=-1,o=null==r?0:r.length;for(u&&o&&(t=r[++e]);++e<o;)t=n(t,r[e],e,r);return t}function T(r,n){for(var t=-1,u=null==r?0:r.length,e=0,o=[];++t<u;){var i=r[t];n(i,t,r)&&(o[e++]=i)}return o}function W(){return[]}var X=Object.prototype.propertyIsEnumerable,Z=Object.getOwnPropertySymbols,rr=Z?function(r){return null==r?[]:(r=Object(r),T(Z(r),function(n){return X.call(r,n)}))}:W;function nr(r,n,u){var e=n(r);return t(r)?e:J(e,u(r))}function tr(r){return nr(r,q,rr)}function ur(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new c;++n<t;)this.add(r[n])}function er(r,n){for(var t=-1,u=null==r?0:r.length;++t<u;)if(n(r[t],t,r))return!0;return!1}function or(r,n){return r.has(n)}ur.prototype.add=ur.prototype.push=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},ur.prototype.has=function(r){return this.__data__.has(r)};function ir(r,n,t,u,e,o){var i=1&t,f=r.length,a=n.length;if(f!=a&&!(i&&a>f))return!1;var c=o.get(r),v=o.get(n);if(c&&v)return c==n&&v==r;var s=-1,l=!0,b=2&t?new ur:void 0;for(o.set(r,n),o.set(n,r);++s<f;){var j=r[s],d=n[s];if(u)var p=i?u(d,j,s,n,r,o):u(j,d,s,r,n,o);if(void 0!==p){if(p)continue;l=!1;break}if(b){if(!er(n,function(r,n){if(!or(b,n)&&(j===r||e(j,r,t,u,o)))return b.push(n)})){l=!1;break}}else if(j!==d&&!e(j,d,t,u,o)){l=!1;break}}return o.delete(r),o.delete(n),l}function fr(r){var n=-1,t=Array(r.size);return r.forEach(function(r,u){t[++n]=[u,r]}),t}function ar(r){var n=-1,t=Array(r.size);return r.forEach(function(r){t[++n]=r}),t}var cr=u?u.prototype:void 0,vr=cr?cr.valueOf:void 0;var sr=Object.prototype.hasOwnProperty;var lr="[object Arguments]",br="[object Array]",jr="[object Object]",dr=Object.prototype.hasOwnProperty;function pr(r,n,u,e,o,i){var f=t(r),a=t(n),c=f?br:l(r),p=a?br:l(n),y=(c=c==lr?jr:c)==jr,w=(p=p==lr?jr:p)==jr,_=c==p;if(_&&b(r)){if(!b(n))return!1;f=!0,y=!1}if(_&&!y)return i||(i=new j),f||d(r)?ir(r,n,u,e,o,i):function(r,n,t,u,e,o,i){switch(t){case"[object DataView]":if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=n.byteLength||!o(new s(r),new s(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return v(+r,+n);case"[object Error]":return r.name==n.name&&r.message==n.message;case"[object RegExp]":case"[object String]":return r==n+"";case"[object Map]":var f=fr;case"[object Set]":var a=1&u;if(f||(f=ar),r.size!=n.size&&!a)return!1;var c=i.get(r);if(c)return c==n;u|=2,i.set(r,n);var l=ir(f(r),f(n),u,e,o,i);return i.delete(r),l;case"[object Symbol]":if(vr)return vr.call(r)==vr.call(n)}return!1}(r,n,c,u,e,o,i);if(!(1&u)){var m=y&&dr.call(r,"__wrapped__"),O=w&&dr.call(n,"__wrapped__");if(m||O){var h=m?r.value():r,g=O?n.value():n;return i||(i=new j),o(h,g,u,e,i)}}return!!_&&(i||(i=new j),function(r,n,t,u,e,o){var i=1&t,f=tr(r),a=f.length;if(a!=tr(n).length&&!i)return!1;for(var c=a;c--;){var v=f[c];if(!(i?v in n:sr.call(n,v)))return!1}var s=o.get(r),l=o.get(n);if(s&&l)return s==n&&l==r;var b=!0;o.set(r,n),o.set(n,r);for(var j=i;++c<a;){var d=r[v=f[c]],p=n[v];if(u)var y=i?u(p,d,v,n,r,o):u(d,p,v,r,n,o);if(!(void 0===y?d===p||e(d,p,t,u,o):y)){b=!1;break}j||(j="constructor"==v)}if(b&&!j){var w=r.constructor,_=n.constructor;w==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(b=!1)}return o.delete(r),o.delete(n),b}(r,n,u,e,o,i))}function yr(n,t,u,e,o){return n===t||(null==n||null==t||!r(n)&&!r(t)?n!=n&&t!=t:pr(n,t,u,e,yr,o))}function wr(r){return r==r&&!p(r)}function _r(r,n){return function(t){return null!=t&&(t[r]===n&&(void 0!==n||r in Object(t)))}}function mr(r){var n=function(r){for(var n=q(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,wr(e)]}return n}(r);return 1==n.length&&n[0][2]?_r(n[0][0],n[0][1]):function(t){return t===r||function(r,n,t,u){var e=t.length,o=e;if(null==r)return!o;for(r=Object(r);e--;){var i=t[e];if(i[2]?i[1]!==r[i[0]]:!(i[0]in r))return!1}for(;++e<o;){var f=(i=t[e])[0],a=r[f],c=i[1];if(i[2]){if(void 0===a&&!(f in r))return!1}else if(!yr(c,a,3,u,new j))return!1}return!0}(t,0,n)}}function Or(r,n){return null!=r&&n in Object(r)}function hr(r,n,u){for(var e=-1,o=(n=G(n,r)).length,i=!1;++e<o;){var f=H(n[e]);if(!(i=null!=r&&u(r,f)))break;r=r[f]}return i||++e!=o?i:!!(o=null==r?0:r.length)&&y(o)&&w(f,o)&&(t(r)||a(r))}function gr(r,n){return null!=r&&hr(r,n,Or)}function Ar(r,n){return z(r)&&wr(n)?_r(H(r),n):function(t){var u=function(r,n,t){var u=null==r?void 0:I(r,n);return void 0===u?t:u}(t,r);return void 0===u&&u===n?gr(t,r):yr(n,u,3)}}function kr(r){return z(r)?(n=H(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return I(n,r)}}(r);var n}function Sr(r){return"function"==typeof r?r:null==r?_:"object"==typeof r?t(r)?Ar(r[0],r[1]):mr(r):kr(r)}function xr(r,n){return r&&m(r,n,q)}var Dr,Er=(Dr=xr,function(r,n){if(null==r)return r;if(!e(r))return Dr(r,n);for(var t=r.length,u=-1,o=Object(r);++u<t&&!1!==n(o[u],u,o););return r});function $r(r){return"function"==typeof r?r:_}function qr(r,n){return(t(r)?x:Er)(r,$r(n))}function Br(r,n){var t=[];return Er(r,function(r,u,e){n(r,u,e)&&t.push(r)}),t}function Vr(r,n){return(t(r)?T:Br)(r,Sr(n))}function zr(r,n,t,u,e){return e(r,function(r,e,o){t=u?(u=!1,r):n(t,r,e,o)}),t}function Fr(r,n,u){var e=t(r)?Q:zr,o=arguments.length<3;return e(r,Sr(n),u,o,Er)}var Mr=O&&1/ar(new O([,-0]))[1]==1/0?function(r){return new O(r)}:function(){};function Nr(r,n,t){var u=-1,e=$,o=r.length,i=!0,f=[],a=f;if(o>=200){var c=n?null:Mr(r);if(c)return ar(c);i=!1,e=or,a=new ur}else a=n?[]:f;r:for(;++u<o;){var v=r[u],s=n?n(v):v;if(v=0!==v?v:0,i&&s==s){for(var l=a.length;l--;)if(a[l]===s)continue r;n&&a.push(s),f.push(v)}else e(a,s,t)||(a!==f&&a.push(s),f.push(v))}return f}export{Er as a,P as b,Sr as c,g as d,J as e,nr as f,rr as g,x as h,h as i,tr as j,q as k,Nr as l,Vr as m,qr as n,D as o,$r as p,xr as q,Fr as r,W as s,hr as t,G as u,H as v,I as w,gr as x,C as y};
1
+ import{aU as r,bq as n,aE as t,aS as u,aD as e,br as o,bs as i,bt as f,bu as a,bv as c,bl as v,bw as s,aV as l,a_ as b,b1 as j,bx as d,aY as p,by as y,bo as w,aF as _,bm as m,bz as O}from"./App-C65Yk43U.js";function h(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}function g(r,n){for(var t=-1,u=null==r?0:r.length,e=Array(u);++t<u;)e[t]=n(r[t],t,r);return e}var A=u?u.prototype:void 0,k=A?A.toString:void 0;function S(r){if("string"==typeof r)return r;if(t(r))return g(r,S)+"";if(h(r))return k?k.call(r):"";var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function x(r,n){for(var t=-1,u=null==r?0:r.length;++t<u&&!1!==n(r[t],t,r););return r}function D(r,n,t,u){for(var e=r.length,o=t+-1;++o<e;)if(n(r[o],o,r))return o;return-1}function E(r){return r!=r}function $(r,n){return!!(null==r?0:r.length)&&function(r,n,t){return n==n?function(r,n,t){for(var u=t-1,e=r.length;++u<e;)if(r[u]===n)return u;return-1}(r,n,t):D(r,E,t)}(r,n,0)>-1}function q(r){return e(r)?o(r):i(r)}var B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/;function z(r,n){if(t(r))return!1;var u=typeof r;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=r&&!h(r))||(V.test(r)||!B.test(r)||null!=n&&r in Object(n))}var F,M,N,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,U=/\\(\\)?/g,Y=(F=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(R,function(r,t,u,e){n.push(u?e.replace(U,"$1"):t||r)}),n},M=f(F,function(r){return 500===N.size&&N.clear(),r}),N=M.cache,M);function C(r){return null==r?"":S(r)}function G(r,n){return t(r)?r:z(r,n)?[r]:Y(C(r))}function H(r){if("string"==typeof r||h(r))return r;var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function I(r,n){for(var t=0,u=(n=G(n,r)).length;null!=r&&t<u;)r=r[H(n[t++])];return t&&t==u?r:void 0}function J(r,n){for(var t=-1,u=n.length,e=r.length;++t<u;)r[e+t]=n[t];return r}var K=u?u.isConcatSpreadable:void 0;function L(r){return t(r)||a(r)||!!(K&&r&&r[K])}function P(r,n,t,u,e){var o=-1,i=r.length;for(t||(t=L),e||(e=[]);++o<i;){var f=r[o];t(f)?J(e,f):u||(e[e.length]=f)}return e}function Q(r,n,t,u){var e=-1,o=null==r?0:r.length;for(u&&o&&(t=r[++e]);++e<o;)t=n(t,r[e],e,r);return t}function T(r,n){for(var t=-1,u=null==r?0:r.length,e=0,o=[];++t<u;){var i=r[t];n(i,t,r)&&(o[e++]=i)}return o}function W(){return[]}var X=Object.prototype.propertyIsEnumerable,Z=Object.getOwnPropertySymbols,rr=Z?function(r){return null==r?[]:(r=Object(r),T(Z(r),function(n){return X.call(r,n)}))}:W;function nr(r,n,u){var e=n(r);return t(r)?e:J(e,u(r))}function tr(r){return nr(r,q,rr)}function ur(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new c;++n<t;)this.add(r[n])}function er(r,n){for(var t=-1,u=null==r?0:r.length;++t<u;)if(n(r[t],t,r))return!0;return!1}function or(r,n){return r.has(n)}ur.prototype.add=ur.prototype.push=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},ur.prototype.has=function(r){return this.__data__.has(r)};function ir(r,n,t,u,e,o){var i=1&t,f=r.length,a=n.length;if(f!=a&&!(i&&a>f))return!1;var c=o.get(r),v=o.get(n);if(c&&v)return c==n&&v==r;var s=-1,l=!0,b=2&t?new ur:void 0;for(o.set(r,n),o.set(n,r);++s<f;){var j=r[s],d=n[s];if(u)var p=i?u(d,j,s,n,r,o):u(j,d,s,r,n,o);if(void 0!==p){if(p)continue;l=!1;break}if(b){if(!er(n,function(r,n){if(!or(b,n)&&(j===r||e(j,r,t,u,o)))return b.push(n)})){l=!1;break}}else if(j!==d&&!e(j,d,t,u,o)){l=!1;break}}return o.delete(r),o.delete(n),l}function fr(r){var n=-1,t=Array(r.size);return r.forEach(function(r,u){t[++n]=[u,r]}),t}function ar(r){var n=-1,t=Array(r.size);return r.forEach(function(r){t[++n]=r}),t}var cr=u?u.prototype:void 0,vr=cr?cr.valueOf:void 0;var sr=Object.prototype.hasOwnProperty;var lr="[object Arguments]",br="[object Array]",jr="[object Object]",dr=Object.prototype.hasOwnProperty;function pr(r,n,u,e,o,i){var f=t(r),a=t(n),c=f?br:l(r),p=a?br:l(n),y=(c=c==lr?jr:c)==jr,w=(p=p==lr?jr:p)==jr,_=c==p;if(_&&b(r)){if(!b(n))return!1;f=!0,y=!1}if(_&&!y)return i||(i=new j),f||d(r)?ir(r,n,u,e,o,i):function(r,n,t,u,e,o,i){switch(t){case"[object DataView]":if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=n.byteLength||!o(new s(r),new s(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return v(+r,+n);case"[object Error]":return r.name==n.name&&r.message==n.message;case"[object RegExp]":case"[object String]":return r==n+"";case"[object Map]":var f=fr;case"[object Set]":var a=1&u;if(f||(f=ar),r.size!=n.size&&!a)return!1;var c=i.get(r);if(c)return c==n;u|=2,i.set(r,n);var l=ir(f(r),f(n),u,e,o,i);return i.delete(r),l;case"[object Symbol]":if(vr)return vr.call(r)==vr.call(n)}return!1}(r,n,c,u,e,o,i);if(!(1&u)){var m=y&&dr.call(r,"__wrapped__"),O=w&&dr.call(n,"__wrapped__");if(m||O){var h=m?r.value():r,g=O?n.value():n;return i||(i=new j),o(h,g,u,e,i)}}return!!_&&(i||(i=new j),function(r,n,t,u,e,o){var i=1&t,f=tr(r),a=f.length;if(a!=tr(n).length&&!i)return!1;for(var c=a;c--;){var v=f[c];if(!(i?v in n:sr.call(n,v)))return!1}var s=o.get(r),l=o.get(n);if(s&&l)return s==n&&l==r;var b=!0;o.set(r,n),o.set(n,r);for(var j=i;++c<a;){var d=r[v=f[c]],p=n[v];if(u)var y=i?u(p,d,v,n,r,o):u(d,p,v,r,n,o);if(!(void 0===y?d===p||e(d,p,t,u,o):y)){b=!1;break}j||(j="constructor"==v)}if(b&&!j){var w=r.constructor,_=n.constructor;w==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(b=!1)}return o.delete(r),o.delete(n),b}(r,n,u,e,o,i))}function yr(n,t,u,e,o){return n===t||(null==n||null==t||!r(n)&&!r(t)?n!=n&&t!=t:pr(n,t,u,e,yr,o))}function wr(r){return r==r&&!p(r)}function _r(r,n){return function(t){return null!=t&&(t[r]===n&&(void 0!==n||r in Object(t)))}}function mr(r){var n=function(r){for(var n=q(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,wr(e)]}return n}(r);return 1==n.length&&n[0][2]?_r(n[0][0],n[0][1]):function(t){return t===r||function(r,n,t,u){var e=t.length,o=e;if(null==r)return!o;for(r=Object(r);e--;){var i=t[e];if(i[2]?i[1]!==r[i[0]]:!(i[0]in r))return!1}for(;++e<o;){var f=(i=t[e])[0],a=r[f],c=i[1];if(i[2]){if(void 0===a&&!(f in r))return!1}else if(!yr(c,a,3,u,new j))return!1}return!0}(t,0,n)}}function Or(r,n){return null!=r&&n in Object(r)}function hr(r,n,u){for(var e=-1,o=(n=G(n,r)).length,i=!1;++e<o;){var f=H(n[e]);if(!(i=null!=r&&u(r,f)))break;r=r[f]}return i||++e!=o?i:!!(o=null==r?0:r.length)&&y(o)&&w(f,o)&&(t(r)||a(r))}function gr(r,n){return null!=r&&hr(r,n,Or)}function Ar(r,n){return z(r)&&wr(n)?_r(H(r),n):function(t){var u=function(r,n,t){var u=null==r?void 0:I(r,n);return void 0===u?t:u}(t,r);return void 0===u&&u===n?gr(t,r):yr(n,u,3)}}function kr(r){return z(r)?(n=H(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return I(n,r)}}(r);var n}function Sr(r){return"function"==typeof r?r:null==r?_:"object"==typeof r?t(r)?Ar(r[0],r[1]):mr(r):kr(r)}function xr(r,n){return r&&m(r,n,q)}var Dr,Er=(Dr=xr,function(r,n){if(null==r)return r;if(!e(r))return Dr(r,n);for(var t=r.length,u=-1,o=Object(r);++u<t&&!1!==n(o[u],u,o););return r});function $r(r){return"function"==typeof r?r:_}function qr(r,n){return(t(r)?x:Er)(r,$r(n))}function Br(r,n){var t=[];return Er(r,function(r,u,e){n(r,u,e)&&t.push(r)}),t}function Vr(r,n){return(t(r)?T:Br)(r,Sr(n))}function zr(r,n,t,u,e){return e(r,function(r,e,o){t=u?(u=!1,r):n(t,r,e,o)}),t}function Fr(r,n,u){var e=t(r)?Q:zr,o=arguments.length<3;return e(r,Sr(n),u,o,Er)}var Mr=O&&1/ar(new O([,-0]))[1]==1/0?function(r){return new O(r)}:function(){};function Nr(r,n,t){var u=-1,e=$,o=r.length,i=!0,f=[],a=f;if(o>=200){var c=n?null:Mr(r);if(c)return ar(c);i=!1,e=or,a=new ur}else a=n?[]:f;r:for(;++u<o;){var v=r[u],s=n?n(v):v;if(v=0!==v?v:0,i&&s==s){for(var l=a.length;l--;)if(a[l]===s)continue r;n&&a.push(s),f.push(v)}else e(a,s,t)||(a!==f&&a.push(s),f.push(v))}return f}export{Er as a,P as b,Sr as c,g as d,J as e,nr as f,rr as g,x as h,h as i,tr as j,q as k,Nr as l,Vr as m,qr as n,D as o,$r as p,xr as q,Fr as r,W as s,hr as t,G as u,H as v,I as w,gr as x,C as y};
@@ -1 +1 @@
1
- import{a0 as n,a1 as t,a2 as u,a3 as r,a4 as i,a5 as a,a6 as f,a7 as o,a8 as e,a9 as s,aa as c,ab as l,ac as h,ad as p,ae as v}from"./App-ClEyOIsd.js";function y(n){return n.innerRadius}function x(n){return n.outerRadius}function d(n){return n.startAngle}function m(n){return n.endAngle}function b(n){return n&&n.padAngle}function j(n,t,u,r,i,a,f){var o=n-u,s=t-r,c=(f?a:-a)/e(o*o+s*s),l=c*s,p=-c*o,v=n+l,y=t+p,x=u+l,d=r+p,m=(v+x)/2,b=(y+d)/2,j=x-v,A=d-y,g=j*j+A*A,k=i-a,q=v*d-x*y,w=(A<0?-1:1)*e(h(0,k*k*g-q*q)),z=(q*A-j*w)/g,B=(-q*j-A*w)/g,C=(q*A+j*w)/g,D=(-q*j+A*w)/g,E=z-m,F=B-b,G=C-m,H=D-b;return E*E+F*F>G*G+H*H&&(z=C,B=D),{cx:z,cy:B,x01:-l,y01:-p,x11:z*(i/k-1),y11:B*(i/k-1)}}function A(){var h=y,A=x,g=i(0),k=null,q=d,w=m,z=b,B=null,C=n(D);function D(){var n,i,y=+h.apply(this,arguments),x=+A.apply(this,arguments),d=q.apply(this,arguments)-a,m=w.apply(this,arguments)-a,b=c(m-d),D=m>d;if(B||(B=n=C()),x<y&&(i=x,x=y,y=i),x>f)if(b>o-f)B.moveTo(x*u(d),x*r(d)),B.arc(0,0,x,d,m,!D),y>f&&(B.moveTo(y*u(m),y*r(m)),B.arc(0,0,y,m,d,D));else{var E,F,G=d,H=m,I=d,J=m,K=b,L=b,M=z.apply(this,arguments)/2,N=M>f&&(k?+k.apply(this,arguments):e(y*y+x*x)),O=s(c(x-y)/2,+g.apply(this,arguments)),P=O,Q=O;if(N>f){var R=p(N/y*r(M)),S=p(N/x*r(M));(K-=2*R)>f?(I+=R*=D?1:-1,J-=R):(K=0,I=J=(d+m)/2),(L-=2*S)>f?(G+=S*=D?1:-1,H-=S):(L=0,G=H=(d+m)/2)}var T=x*u(G),U=x*r(G),V=y*u(J),W=y*r(J);if(O>f){var X,Y=x*u(H),Z=x*r(H),$=y*u(I),_=y*r(I);if(b<t)if(X=function(n,t,u,r,i,a,o,e){var s=u-n,c=r-t,l=o-i,h=e-a,p=h*s-l*c;if(!(p*p<f))return[n+(p=(l*(t-a)-h*(n-i))/p)*s,t+p*c]}(T,U,$,_,Y,Z,V,W)){var nn=T-X[0],tn=U-X[1],un=Y-X[0],rn=Z-X[1],an=1/r(v((nn*un+tn*rn)/(e(nn*nn+tn*tn)*e(un*un+rn*rn)))/2),fn=e(X[0]*X[0]+X[1]*X[1]);P=s(O,(y-fn)/(an-1)),Q=s(O,(x-fn)/(an+1))}else P=Q=0}L>f?Q>f?(E=j($,_,T,U,x,Q,D),F=j(Y,Z,V,W,x,Q,D),B.moveTo(E.cx+E.x01,E.cy+E.y01),Q<O?B.arc(E.cx,E.cy,Q,l(E.y01,E.x01),l(F.y01,F.x01),!D):(B.arc(E.cx,E.cy,Q,l(E.y01,E.x01),l(E.y11,E.x11),!D),B.arc(0,0,x,l(E.cy+E.y11,E.cx+E.x11),l(F.cy+F.y11,F.cx+F.x11),!D),B.arc(F.cx,F.cy,Q,l(F.y11,F.x11),l(F.y01,F.x01),!D))):(B.moveTo(T,U),B.arc(0,0,x,G,H,!D)):B.moveTo(T,U),y>f&&K>f?P>f?(E=j(V,W,Y,Z,y,-P,D),F=j(T,U,$,_,y,-P,D),B.lineTo(E.cx+E.x01,E.cy+E.y01),P<O?B.arc(E.cx,E.cy,P,l(E.y01,E.x01),l(F.y01,F.x01),!D):(B.arc(E.cx,E.cy,P,l(E.y01,E.x01),l(E.y11,E.x11),!D),B.arc(0,0,y,l(E.cy+E.y11,E.cx+E.x11),l(F.cy+F.y11,F.cx+F.x11),D),B.arc(F.cx,F.cy,P,l(F.y11,F.x11),l(F.y01,F.x01),!D))):B.arc(0,0,y,J,I,D):B.lineTo(V,W)}else B.moveTo(0,0);if(B.closePath(),n)return B=null,n+""||null}return D.centroid=function(){var n=(+h.apply(this,arguments)+ +A.apply(this,arguments))/2,i=(+q.apply(this,arguments)+ +w.apply(this,arguments))/2-t/2;return[u(i)*n,r(i)*n]},D.innerRadius=function(n){return arguments.length?(h="function"==typeof n?n:i(+n),D):h},D.outerRadius=function(n){return arguments.length?(A="function"==typeof n?n:i(+n),D):A},D.cornerRadius=function(n){return arguments.length?(g="function"==typeof n?n:i(+n),D):g},D.padRadius=function(n){return arguments.length?(k=null==n?null:"function"==typeof n?n:i(+n),D):k},D.startAngle=function(n){return arguments.length?(q="function"==typeof n?n:i(+n),D):q},D.endAngle=function(n){return arguments.length?(w="function"==typeof n?n:i(+n),D):w},D.padAngle=function(n){return arguments.length?(z="function"==typeof n?n:i(+n),D):z},D.context=function(n){return arguments.length?(B=null==n?null:n,D):B},D}export{A as d};
1
+ import{a0 as n,a1 as t,a2 as u,a3 as r,a4 as i,a5 as a,a6 as f,a7 as o,a8 as e,a9 as s,aa as c,ab as l,ac as h,ad as p,ae as v}from"./App-C65Yk43U.js";function y(n){return n.innerRadius}function x(n){return n.outerRadius}function d(n){return n.startAngle}function m(n){return n.endAngle}function b(n){return n&&n.padAngle}function j(n,t,u,r,i,a,f){var o=n-u,s=t-r,c=(f?a:-a)/e(o*o+s*s),l=c*s,p=-c*o,v=n+l,y=t+p,x=u+l,d=r+p,m=(v+x)/2,b=(y+d)/2,j=x-v,A=d-y,g=j*j+A*A,k=i-a,q=v*d-x*y,w=(A<0?-1:1)*e(h(0,k*k*g-q*q)),z=(q*A-j*w)/g,B=(-q*j-A*w)/g,C=(q*A+j*w)/g,D=(-q*j+A*w)/g,E=z-m,F=B-b,G=C-m,H=D-b;return E*E+F*F>G*G+H*H&&(z=C,B=D),{cx:z,cy:B,x01:-l,y01:-p,x11:z*(i/k-1),y11:B*(i/k-1)}}function A(){var h=y,A=x,g=i(0),k=null,q=d,w=m,z=b,B=null,C=n(D);function D(){var n,i,y=+h.apply(this,arguments),x=+A.apply(this,arguments),d=q.apply(this,arguments)-a,m=w.apply(this,arguments)-a,b=c(m-d),D=m>d;if(B||(B=n=C()),x<y&&(i=x,x=y,y=i),x>f)if(b>o-f)B.moveTo(x*u(d),x*r(d)),B.arc(0,0,x,d,m,!D),y>f&&(B.moveTo(y*u(m),y*r(m)),B.arc(0,0,y,m,d,D));else{var E,F,G=d,H=m,I=d,J=m,K=b,L=b,M=z.apply(this,arguments)/2,N=M>f&&(k?+k.apply(this,arguments):e(y*y+x*x)),O=s(c(x-y)/2,+g.apply(this,arguments)),P=O,Q=O;if(N>f){var R=p(N/y*r(M)),S=p(N/x*r(M));(K-=2*R)>f?(I+=R*=D?1:-1,J-=R):(K=0,I=J=(d+m)/2),(L-=2*S)>f?(G+=S*=D?1:-1,H-=S):(L=0,G=H=(d+m)/2)}var T=x*u(G),U=x*r(G),V=y*u(J),W=y*r(J);if(O>f){var X,Y=x*u(H),Z=x*r(H),$=y*u(I),_=y*r(I);if(b<t)if(X=function(n,t,u,r,i,a,o,e){var s=u-n,c=r-t,l=o-i,h=e-a,p=h*s-l*c;if(!(p*p<f))return[n+(p=(l*(t-a)-h*(n-i))/p)*s,t+p*c]}(T,U,$,_,Y,Z,V,W)){var nn=T-X[0],tn=U-X[1],un=Y-X[0],rn=Z-X[1],an=1/r(v((nn*un+tn*rn)/(e(nn*nn+tn*tn)*e(un*un+rn*rn)))/2),fn=e(X[0]*X[0]+X[1]*X[1]);P=s(O,(y-fn)/(an-1)),Q=s(O,(x-fn)/(an+1))}else P=Q=0}L>f?Q>f?(E=j($,_,T,U,x,Q,D),F=j(Y,Z,V,W,x,Q,D),B.moveTo(E.cx+E.x01,E.cy+E.y01),Q<O?B.arc(E.cx,E.cy,Q,l(E.y01,E.x01),l(F.y01,F.x01),!D):(B.arc(E.cx,E.cy,Q,l(E.y01,E.x01),l(E.y11,E.x11),!D),B.arc(0,0,x,l(E.cy+E.y11,E.cx+E.x11),l(F.cy+F.y11,F.cx+F.x11),!D),B.arc(F.cx,F.cy,Q,l(F.y11,F.x11),l(F.y01,F.x01),!D))):(B.moveTo(T,U),B.arc(0,0,x,G,H,!D)):B.moveTo(T,U),y>f&&K>f?P>f?(E=j(V,W,Y,Z,y,-P,D),F=j(T,U,$,_,y,-P,D),B.lineTo(E.cx+E.x01,E.cy+E.y01),P<O?B.arc(E.cx,E.cy,P,l(E.y01,E.x01),l(F.y01,F.x01),!D):(B.arc(E.cx,E.cy,P,l(E.y01,E.x01),l(E.y11,E.x11),!D),B.arc(0,0,y,l(E.cy+E.y11,E.cx+E.x11),l(F.cy+F.y11,F.cx+F.x11),D),B.arc(F.cx,F.cy,P,l(F.y11,F.x11),l(F.y01,F.x01),!D))):B.arc(0,0,y,J,I,D):B.lineTo(V,W)}else B.moveTo(0,0);if(B.closePath(),n)return B=null,n+""||null}return D.centroid=function(){var n=(+h.apply(this,arguments)+ +A.apply(this,arguments))/2,i=(+q.apply(this,arguments)+ +w.apply(this,arguments))/2-t/2;return[u(i)*n,r(i)*n]},D.innerRadius=function(n){return arguments.length?(h="function"==typeof n?n:i(+n),D):h},D.outerRadius=function(n){return arguments.length?(A="function"==typeof n?n:i(+n),D):A},D.cornerRadius=function(n){return arguments.length?(g="function"==typeof n?n:i(+n),D):g},D.padRadius=function(n){return arguments.length?(k=null==n?null:"function"==typeof n?n:i(+n),D):k},D.startAngle=function(n){return arguments.length?(q="function"==typeof n?n:i(+n),D):q},D.endAngle=function(n){return arguments.length?(w="function"==typeof n?n:i(+n),D):w},D.padAngle=function(n){return arguments.length?(z="function"==typeof n?n:i(+n),D):z},D.context=function(n){return arguments.length?(B=null==n?null:n,D):B},D}export{A as d};