cc-viewer 1.6.270 → 1.6.272
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.
- package/README.md +3 -17
- package/cli.js +13 -2
- package/dist/assets/App-KL1CbE6B.js +1 -0
- package/dist/assets/App-TGGslOeT.css +1 -0
- package/dist/assets/{MdxEditorPanel-DxMKSSN2.js → MdxEditorPanel-B9-2mx30.js} +1 -1
- package/dist/assets/Mobile-BzYULksa.js +1 -0
- package/dist/assets/{_baseUniq-Dgkw4IXM.js → _baseUniq-CPJrFyUF.js} +1 -1
- package/dist/assets/{arc-AiHQLijx.js → arc-BLBrFElt.js} +1 -1
- package/dist/assets/{architectureDiagram-Q4EWVU46-CPRvAIHK.js → architectureDiagram-Q4EWVU46-CbnBsMiQ.js} +1 -1
- package/dist/assets/{blockDiagram-DXYQGD6D-CK2cwrfX.js → blockDiagram-DXYQGD6D-0mYr6-Fl.js} +1 -1
- package/dist/assets/{c4Diagram-AHTNJAMY-BP-UBbgv.js → c4Diagram-AHTNJAMY-CS7vcr0z.js} +1 -1
- package/dist/assets/{channel-Ny3Nm_-t.js → channel-CF3zZzSR.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-DdsULqPZ.js → chunk-4BX2VUAB-1FZYtnJ7.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-BDSjQHh0.js → chunk-4TB4RGXK-COs1qui5.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DrKr3wBa.js → chunk-55IACEB6-p77Qw3wN.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-o_0SUbAB.js → chunk-EDXVE4YY-5qaIrQKg.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Ca_AgqWi.js → chunk-FMBD7UC4-DmCR8mDZ.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-CyWWbq5o.js → chunk-OYMX7WX6-D6xDfgW3.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-5rXHErSL.js → chunk-QZHKN3VN-B6cmUU0N.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-DznXBadU.js → chunk-YZCP3GAM-l-OyOqnn.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-BiCYgTHO.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-BiCYgTHO.js +1 -0
- package/dist/assets/clone-ChTCnPsO.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BhGyix0v.js → cose-bilkent-S5V4N54A-CEzaS8XS.js} +1 -1
- package/dist/assets/{dagre-KV5264BT-CzzHxIvc.js → dagre-KV5264BT-B3U2njWW.js} +1 -1
- package/dist/assets/{diagram-5BDNPKRD-tu3BXl0c.js → diagram-5BDNPKRD-BRSDbyBr.js} +1 -1
- package/dist/assets/{diagram-G4DWMVQ6-C6WkK7sj.js → diagram-G4DWMVQ6-BZfOi9B7.js} +1 -1
- package/dist/assets/{diagram-MMDJMWI5-DBeD_WW-.js → diagram-MMDJMWI5-CWpb3Cg0.js} +1 -1
- package/dist/assets/{diagram-TYMM5635-BXUyHHJ4.js → diagram-TYMM5635-CTJyBSVj.js} +1 -1
- package/dist/assets/{erDiagram-SMLLAGMA-Bye5tnW2.js → erDiagram-SMLLAGMA-CHtTRd5S.js} +1 -1
- package/dist/assets/{flowDiagram-DWJPFMVM-C3pYOs38.js → flowDiagram-DWJPFMVM-Bda8X-WJ.js} +1 -1
- package/dist/assets/{ganttDiagram-T4ZO3ILL-DxXkI_FW.js → ganttDiagram-T4ZO3ILL-CPfnGu5V.js} +1 -1
- package/dist/assets/{gitGraphDiagram-UUTBAWPF-nsxsXsGX.js → gitGraphDiagram-UUTBAWPF-B5QxesQg.js} +1 -1
- package/dist/assets/{graph-Da-Z9hB7.js → graph-ChltdhTU.js} +1 -1
- package/dist/assets/{index-4gmR7Eun.js → index-B7lK5fJz.js} +1 -1
- package/dist/assets/{index-C8w5Sxw3.js → index-BK4sui_O.js} +1 -1
- package/dist/assets/{index-CA8JGh5J.js → index-C2fhupP6.js} +1 -1
- package/dist/assets/{index-D7XF7UJ8.js → index-C5PA4OJg.js} +1 -1
- package/dist/assets/{index-C0PhJcXG.js → index-CfEkC3bc.js} +1 -1
- package/dist/assets/{index-Brh2V8V0.js → index-DyGa-jNv.js} +1 -1
- package/dist/assets/{index-CCAOHnbk.js → index-Yhf-Rgbr.js} +2 -2
- package/dist/assets/{index-CsuhosSl.js → index-yClPXlMf.js} +1 -1
- package/dist/assets/{infoDiagram-42DDH7IO-Ca9j90t5.js → infoDiagram-42DDH7IO-CD4TS4O2.js} +1 -1
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-DhjV0XPD.js → ishikawaDiagram-UXIWVN3A-jhiYabQ7.js} +1 -1
- package/dist/assets/{journeyDiagram-VCZTEJTY-CRSHLZPV.js → journeyDiagram-VCZTEJTY-BDzIXxxt.js} +1 -1
- package/dist/assets/{jszip.min-CcCCdMNW.js → jszip.min-CuGGBMI4.js} +1 -1
- package/dist/assets/{kanban-definition-6JOO6SKY-Bg0CUwgc.js → kanban-definition-6JOO6SKY-D34MYATQ.js} +1 -1
- package/dist/assets/{layout-CWNu13XT.js → layout-D6sLAapX.js} +1 -1
- package/dist/assets/{linear-Dcmw1639.js → linear-CFV4P-wn.js} +1 -1
- package/dist/assets/{mermaid.core-1heNIJ5f.js → mermaid.core-YmJi7T-s.js} +2 -2
- package/dist/assets/{min-CC9CkAxn.js → min-akJQqRMn.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-Gr0ex_Ny.js → mindmap-definition-QFDTVHPH-w5zaJyrN.js} +1 -1
- package/dist/assets/{pieDiagram-DEJITSTG-D7P3sUJY.js → pieDiagram-DEJITSTG-B6EM4Ow6.js} +1 -1
- package/dist/assets/{quadrantDiagram-34T5L4WZ-Bov3lcpV.js → quadrantDiagram-34T5L4WZ-2TmBxFy-.js} +1 -1
- package/dist/assets/{requirementDiagram-MS252O5E-BcLptaOU.js → requirementDiagram-MS252O5E-EOjvbxUy.js} +1 -1
- package/dist/assets/{sankeyDiagram-XADWPNL6-B2qAUsON.js → sankeyDiagram-XADWPNL6-BmTQD5eT.js} +1 -1
- package/dist/assets/seqResourceLoaders-B2bHcUzO.js +2 -0
- package/dist/assets/{seqResourceLoaders-N07Gfom9.css → seqResourceLoaders-CaZOVtSc.css} +1 -1
- package/dist/assets/{sequenceDiagram-FGHM5R23-Do62Uz-a.js → sequenceDiagram-FGHM5R23-CLjtqA1D.js} +1 -1
- package/dist/assets/{stateDiagram-FHFEXIEX-Wu8aqa8C.js → stateDiagram-FHFEXIEX-Cbq90iZ8.js} +1 -1
- package/dist/assets/{stateDiagram-v2-QKLJ7IA2-BfYq7Jgo.js → stateDiagram-v2-QKLJ7IA2-BKDg-3t_.js} +1 -1
- package/dist/assets/{timeline-definition-GMOUNBTQ-DYfz5xD6.js → timeline-definition-GMOUNBTQ-f3kEDay0.js} +1 -1
- package/dist/assets/{vendor-antd-BG1SvzuN.js → vendor-antd-5xE7sz6B.js} +1 -1
- package/dist/assets/{vendor-codemirror-8NDhydlF.js → vendor-codemirror-ib-jPbXC.js} +1 -1
- package/dist/assets/{vendor-mdxeditor-BB4hhpxM.js → vendor-mdxeditor-BdKMdw6O.js} +2 -2
- package/dist/assets/{vendor-qrcode-DMsNGQ10.js → vendor-qrcode-vKlE-WYu.js} +1 -1
- package/dist/assets/{vendor-virtuoso-BUT96ALa.js → vendor-virtuoso-DOIfjLfU.js} +1 -1
- package/dist/assets/{vennDiagram-DHZGUBPP-CGr-cc7e.js → vennDiagram-DHZGUBPP-0GDSFVnH.js} +1 -1
- package/dist/assets/{wardley-RL74JXVD-BN899vMf.js → wardley-RL74JXVD-B2rj5j7G.js} +1 -1
- package/dist/assets/{wardleyDiagram-NUSXRM2D-xUsI1E7h.js → wardleyDiagram-NUSXRM2D-COVTciJP.js} +1 -1
- package/dist/assets/{xychartDiagram-5P7HB3ND-woQrslzB.js → xychartDiagram-5P7HB3ND-DXoLnGxX.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/voice-packs/default/A_choice_for_your_consideration_sir.MP3 +0 -0
- package/dist/voice-packs/default/It_is_done_sir.MP3 +0 -0
- package/dist/voice-packs/default/The_plan_awaits_your_approval_sir.MP3 +0 -0
- package/dist/voice-packs/default/pack.json +13 -13
- package/dist/voice-packs/sanguo/ask.MP3 +0 -0
- package/dist/voice-packs/sanguo/end.MP3 +0 -0
- package/dist/voice-packs/sanguo/pack.json +24 -0
- package/dist/voice-packs/sanguo/plan.MP3 +0 -0
- package/lib/voice-pack-events.js +47 -1
- package/lib/voice-pack-manager.js +135 -38
- package/package.json +1 -1
- package/pty-manager.js +2 -2
- package/server.js +227 -29
- package/dist/assets/App-BlL1FIJJ.js +0 -1
- package/dist/assets/App-DOYmReD4.css +0 -1
- package/dist/assets/Mobile-CXv8o6bc.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-CLYcbnwx.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-CLYcbnwx.js +0 -1
- package/dist/assets/clone-5GFhU8Pv.js +0 -1
- package/dist/assets/seqResourceLoaders-ZhPI6y_m.js +0 -2
- package/dist/voice-packs/default/askQuestion.wav +0 -0
- package/dist/voice-packs/default/planApproval.wav +0 -0
- package/dist/voice-packs/default/turnEnd.wav +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as jsxRuntimeExports}from"./vendor-codemirror-8NDhydlF.js";import{a as reactExports,s as staticMethods}from"./vendor-antd-BG1SvzuN.js";import{M as MDXEditor,h as headingsPlugin,l as listsPlugin,q as quotePlugin,a as linkPlugin,b as linkDialogPlugin,i as imagePlugin,t as tablePlugin,c as codeBlockPlugin,d as codeMirrorPlugin,e as thematicBreakPlugin,m as markdownShortcutPlugin,f as diffSourcePlugin,g as toolbarPlugin,D as DiffSourceToggleWrapper,U as UndoRedo,S as Separator,B as BoldItalicUnderlineToggles,C as CodeToggle,j as BlockTypeSelect,L as ListsToggle,k as CreateLink,I as InsertImage,n as InsertTable,o as InsertCodeBlock,p as InsertThematicBreak}from"./vendor-mdxeditor-BB4hhpxM.js";import{g as getLang,t}from"./index-CCAOHnbk.js";const styles={container:"_container_3d9hl_25",light:"_light_3d9hl_3",contentEditable:"_contentEditable_3d9hl_16"},PASSTHROUGH_TYPES=new Set(["image/png","image/gif","image/webp","image/svg+xml"]);function readAsDataURL(file){return new Promise((resolve,reject)=>{const reader=new FileReader;reader.onload=()=>resolve(reader.result),reader.onerror=()=>reject(new Error("FileReader failed")),reader.readAsDataURL(file)})}async function compressImageToDataURL(file,opts={}){if(!(file instanceof Blob))throw new Error("compressImageToDataURL: input must be a File or Blob");if(!file.type||!file.type.startsWith("image/"))throw new Error(`Unsupported file type: ${file.type||"unknown"}`);if(file.size>10485760)throw new Error(`Image too large: ${(file.size/1024/1024).toFixed(1)}MB > 10MB limit`);const maxEdge=opts.maxEdge??2e3,quality=opts.quality??.85;if(PASSTHROUGH_TYPES.has(file.type))return await readAsDataURL(file);const originalDataURL=await readAsDataURL(file),img=await(src=originalDataURL,new Promise((resolve,reject)=>{const img=new Image;img.onload=()=>resolve(img),img.onerror=()=>reject(new Error("Image decode failed")),img.src=src}));var src;const longestEdge=Math.max(img.naturalWidth,img.naturalHeight),scale=longestEdge>maxEdge?maxEdge/longestEdge:1,targetW=Math.max(1,Math.round(img.naturalWidth*scale)),targetH=Math.max(1,Math.round(img.naturalHeight*scale)),canvas=document.createElement("canvas");canvas.width=targetW,canvas.height=targetH;const ctx=canvas.getContext("2d");if(!ctx)return originalDataURL;let compressed;ctx.drawImage(img,0,0,targetW,targetH);try{compressed=canvas.toDataURL("image/jpeg",quality)}catch{return originalDataURL}return!compressed||"data:,"===compressed||compressed.length>=originalDataURL.length?originalDataURL:compressed}const TRANSLATIONS={zh:{contentArea:{editableMarkdown:"可编辑 Markdown"},dialog:{close:"关闭"},dialogControls:{cancel:"取消",save:"保存"},createLink:{text:"链接文字",textTooltip:"链接显示的文字",title:"标题",titleTooltip:"链接的 title 属性(鼠标悬停时显示)",url:"链接地址",urlPlaceholder:"请输入链接地址",saveTooltip:"保存链接",cancelTooltip:"取消编辑"},linkPreview:{open:"在新窗口打开 {{url}}",edit:"编辑链接",copyToClipboard:"复制链接到剪贴板",copied:"已复制",remove:"移除链接"},uploadImage:{dialogTitle:"插入图片",uploadInstructions:"从本地选择图片上传",addViaUrlInstructions:"或输入图片地址",addViaUrlInstructionsNoUpload:"请输入图片地址",autoCompletePlaceholder:"搜索已有图片",alt:"替代文字",title:"标题",width:"宽度",height:"高度"},imageEditor:{editImage:"编辑图片",deleteImage:"删除图片"},table:{columnMenu:"列菜单",rowMenu:"行菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",insertColumnLeft:"在左侧插入列",insertColumnRight:"在右侧插入列",insertRowAbove:"在上方插入行",insertRowBelow:"在下方插入行",deleteColumn:"删除列",deleteRow:"删除行",deleteTable:"删除表格"},codeBlock:{language:"语言",inlineLanguage:"行内语言",selectLanguage:"选择语言"},codeblock:{delete:"删除代码块"},toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",bold:"加粗",italic:"斜体",underline:"下划线",removeBold:"取消加粗",removeItalic:"取消斜体",removeUnderline:"取消下划线",inlineCode:"行内代码",removeInlineCode:"取消行内代码",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",toggleGroup:"列表样式",link:"插入链接",image:"插入图片",table:"插入表格",codeBlock:"插入代码块",thematicBreak:"插入分隔线",richText:"富文本",diffMode:"对比视图",source:"源代码",blockTypeSelect:{placeholder:"块类型",selectBlockTypeTooltip:"选择块类型"},blockTypes:{paragraph:"段落",heading:"标题 {{level}}",quote:"引用"}}},"zh-TW":{contentArea:{editableMarkdown:"可編輯 Markdown"},dialog:{close:"關閉"},dialogControls:{cancel:"取消",save:"儲存"},createLink:{text:"連結文字",textTooltip:"連結顯示的文字",title:"標題",titleTooltip:"連結的 title 屬性(滑鼠懸停時顯示)",url:"連結網址",urlPlaceholder:"請輸入連結網址",saveTooltip:"儲存連結",cancelTooltip:"取消編輯"},linkPreview:{open:"在新視窗開啟 {{url}}",edit:"編輯連結",copyToClipboard:"複製連結至剪貼簿",copied:"已複製",remove:"移除連結"},uploadImage:{dialogTitle:"插入圖片",uploadInstructions:"從本地選擇圖片上傳",addViaUrlInstructions:"或輸入圖片網址",addViaUrlInstructionsNoUpload:"請輸入圖片網址",autoCompletePlaceholder:"搜尋現有圖片",alt:"替代文字",title:"標題",width:"寬度",height:"高度"},imageEditor:{editImage:"編輯圖片",deleteImage:"刪除圖片"},table:{columnMenu:"欄選單",rowMenu:"列選單",textAlignment:"文字對齊",alignLeft:"靠左",alignCenter:"置中",alignRight:"靠右",insertColumnLeft:"在左側插入欄",insertColumnRight:"在右側插入欄",insertRowAbove:"在上方插入列",insertRowBelow:"在下方插入列",deleteColumn:"刪除欄",deleteRow:"刪除列",deleteTable:"刪除表格"},codeBlock:{language:"語言",inlineLanguage:"行內語言",selectLanguage:"選擇語言"},codeblock:{delete:"刪除程式碼區塊"},toolbar:{undo:"復原 {{shortcut}}",redo:"重做 {{shortcut}}",bold:"粗體",italic:"斜體",underline:"底線",removeBold:"取消粗體",removeItalic:"取消斜體",removeUnderline:"取消底線",inlineCode:"行內程式碼",removeInlineCode:"取消行內程式碼",bulletedList:"項目符號清單",numberedList:"編號清單",checkList:"工作清單",toggleGroup:"清單樣式",link:"插入連結",image:"插入圖片",table:"插入表格",codeBlock:"插入程式碼區塊",thematicBreak:"插入分隔線",richText:"所見即所得",diffMode:"比對檢視",source:"原始碼",blockTypeSelect:{placeholder:"區塊類型",selectBlockTypeTooltip:"選擇區塊類型"},blockTypes:{paragraph:"段落",heading:"標題 {{level}}",quote:"引用"}}},ja:{toolbar:{undo:"元に戻す {{shortcut}}",redo:"やり直し {{shortcut}}",bold:"太字",italic:"イタリック",underline:"下線",removeBold:"太字を解除",removeItalic:"イタリックを解除",removeUnderline:"下線を解除",inlineCode:"インラインコード",removeInlineCode:"インラインコードを解除",bulletedList:"箇条書き",numberedList:"番号付きリスト",checkList:"チェックリスト",toggleGroup:"リストスタイル",link:"リンクを挿入",image:"画像を挿入",table:"表を挿入",codeBlock:"コードブロックを挿入",thematicBreak:"区切り線を挿入",richText:"リッチテキスト",diffMode:"差分表示",source:"ソース",blockTypeSelect:{placeholder:"ブロック種別",selectBlockTypeTooltip:"ブロック種別を選択"},blockTypes:{paragraph:"段落",heading:"見出し {{level}}",quote:"引用"}}},ko:{toolbar:{undo:"실행 취소 {{shortcut}}",redo:"다시 실행 {{shortcut}}",bold:"굵게",italic:"기울임",underline:"밑줄",removeBold:"굵게 해제",removeItalic:"기울임 해제",removeUnderline:"밑줄 해제",inlineCode:"인라인 코드",removeInlineCode:"인라인 코드 해제",bulletedList:"글머리 기호 목록",numberedList:"번호 매기기 목록",checkList:"체크리스트",toggleGroup:"목록 스타일",link:"링크 삽입",image:"이미지 삽입",table:"표 삽입",codeBlock:"코드 블록 삽입",thematicBreak:"구분선 삽입",richText:"서식있는 텍스트",diffMode:"비교 보기",source:"소스",blockTypeSelect:{placeholder:"블록 유형",selectBlockTypeTooltip:"블록 유형 선택"},blockTypes:{paragraph:"단락",heading:"제목 {{level}}",quote:"인용"}}},de:{toolbar:{undo:"Rückgängig {{shortcut}}",redo:"Wiederherstellen {{shortcut}}",bold:"Fett",italic:"Kursiv",underline:"Unterstrichen",removeBold:"Fett entfernen",removeItalic:"Kursiv entfernen",removeUnderline:"Unterstrichen entfernen",inlineCode:"Inline-Code",removeInlineCode:"Inline-Code entfernen",bulletedList:"Aufzählungsliste",numberedList:"Nummerierte Liste",checkList:"Aufgabenliste",toggleGroup:"Listenstil",link:"Link einfügen",image:"Bild einfügen",table:"Tabelle einfügen",codeBlock:"Codeblock einfügen",thematicBreak:"Trennlinie einfügen",richText:"Rich-Text",diffMode:"Diff-Ansicht",source:"Quelltext",blockTypeSelect:{placeholder:"Blocktyp",selectBlockTypeTooltip:"Blocktyp auswählen"},blockTypes:{paragraph:"Absatz",heading:"Überschrift {{level}}",quote:"Zitat"}}},es:{toolbar:{undo:"Deshacer {{shortcut}}",redo:"Rehacer {{shortcut}}",bold:"Negrita",italic:"Cursiva",underline:"Subrayado",removeBold:"Quitar negrita",removeItalic:"Quitar cursiva",removeUnderline:"Quitar subrayado",inlineCode:"Código en línea",removeInlineCode:"Quitar código en línea",bulletedList:"Lista con viñetas",numberedList:"Lista numerada",checkList:"Lista de tareas",toggleGroup:"Estilo de lista",link:"Insertar enlace",image:"Insertar imagen",table:"Insertar tabla",codeBlock:"Insertar bloque de código",thematicBreak:"Insertar separador",richText:"Texto enriquecido",diffMode:"Vista comparativa",source:"Código fuente",blockTypeSelect:{placeholder:"Tipo de bloque",selectBlockTypeTooltip:"Seleccionar tipo de bloque"},blockTypes:{paragraph:"Párrafo",heading:"Encabezado {{level}}",quote:"Cita"}}},fr:{toolbar:{undo:"Annuler {{shortcut}}",redo:"Rétablir {{shortcut}}",bold:"Gras",italic:"Italique",underline:"Souligné",removeBold:"Retirer le gras",removeItalic:"Retirer l’italique",removeUnderline:"Retirer le soulignement",inlineCode:"Code en ligne",removeInlineCode:"Retirer le code en ligne",bulletedList:"Liste à puces",numberedList:"Liste numérotée",checkList:"Liste de tâches",toggleGroup:"Style de liste",link:"Insérer un lien",image:"Insérer une image",table:"Insérer un tableau",codeBlock:"Insérer un bloc de code",thematicBreak:"Insérer un séparateur",richText:"Texte enrichi",diffMode:"Vue comparative",source:"Source",blockTypeSelect:{placeholder:"Type de bloc",selectBlockTypeTooltip:"Choisir le type de bloc"},blockTypes:{paragraph:"Paragraphe",heading:"Titre {{level}}",quote:"Citation"}}},it:{toolbar:{undo:"Annulla {{shortcut}}",redo:"Ripristina {{shortcut}}",bold:"Grassetto",italic:"Corsivo",underline:"Sottolineato",removeBold:"Rimuovi grassetto",removeItalic:"Rimuovi corsivo",removeUnderline:"Rimuovi sottolineato",inlineCode:"Codice in linea",removeInlineCode:"Rimuovi codice in linea",bulletedList:"Elenco puntato",numberedList:"Elenco numerato",checkList:"Elenco di attività",toggleGroup:"Stile elenco",link:"Inserisci link",image:"Inserisci immagine",table:"Inserisci tabella",codeBlock:"Inserisci blocco di codice",thematicBreak:"Inserisci separatore",richText:"Testo formattato",diffMode:"Vista differenze",source:"Sorgente",blockTypeSelect:{placeholder:"Tipo di blocco",selectBlockTypeTooltip:"Seleziona tipo di blocco"},blockTypes:{paragraph:"Paragrafo",heading:"Titolo {{level}}",quote:"Citazione"}}},da:{toolbar:{undo:"Fortryd {{shortcut}}",redo:"Gentag {{shortcut}}",bold:"Fed",italic:"Kursiv",underline:"Understreget",removeBold:"Fjern fed",removeItalic:"Fjern kursiv",removeUnderline:"Fjern understregning",inlineCode:"Indlejret kode",removeInlineCode:"Fjern indlejret kode",bulletedList:"Punktopstilling",numberedList:"Nummereret liste",checkList:"Tjekliste",toggleGroup:"Listestil",link:"Indsæt link",image:"Indsæt billede",table:"Indsæt tabel",codeBlock:"Indsæt kodeblok",thematicBreak:"Indsæt skillelinje",richText:"Formateret tekst",diffMode:"Diff-visning",source:"Kilde",blockTypeSelect:{placeholder:"Bloktype",selectBlockTypeTooltip:"Vælg bloktype"},blockTypes:{paragraph:"Afsnit",heading:"Overskrift {{level}}",quote:"Citat"}}},pl:{toolbar:{undo:"Cofnij {{shortcut}}",redo:"Ponów {{shortcut}}",bold:"Pogrubienie",italic:"Kursywa",underline:"Podkreślenie",removeBold:"Usuń pogrubienie",removeItalic:"Usuń kursywę",removeUnderline:"Usuń podkreślenie",inlineCode:"Kod w linii",removeInlineCode:"Usuń kod w linii",bulletedList:"Lista punktowana",numberedList:"Lista numerowana",checkList:"Lista zadań",toggleGroup:"Styl listy",link:"Wstaw link",image:"Wstaw obraz",table:"Wstaw tabelę",codeBlock:"Wstaw blok kodu",thematicBreak:"Wstaw separator",richText:"Tekst sformatowany",diffMode:"Widok porównania",source:"Źródło",blockTypeSelect:{placeholder:"Typ bloku",selectBlockTypeTooltip:"Wybierz typ bloku"},blockTypes:{paragraph:"Akapit",heading:"Nagłówek {{level}}",quote:"Cytat"}}},ru:{toolbar:{undo:"Отменить {{shortcut}}",redo:"Повторить {{shortcut}}",bold:"Полужирный",italic:"Курсив",underline:"Подчёркнутый",removeBold:"Убрать полужирный",removeItalic:"Убрать курсив",removeUnderline:"Убрать подчёркивание",inlineCode:"Встроенный код",removeInlineCode:"Убрать встроенный код",bulletedList:"Маркированный список",numberedList:"Нумерованный список",checkList:"Список задач",toggleGroup:"Стиль списка",link:"Вставить ссылку",image:"Вставить изображение",table:"Вставить таблицу",codeBlock:"Вставить блок кода",thematicBreak:"Вставить разделитель",richText:"Форматированный текст",diffMode:"Вид сравнения",source:"Исходный код",blockTypeSelect:{placeholder:"Тип блока",selectBlockTypeTooltip:"Выбрать тип блока"},blockTypes:{paragraph:"Абзац",heading:"Заголовок {{level}}",quote:"Цитата"}}},ar:{toolbar:{undo:"تراجع {{shortcut}}",redo:"إعادة {{shortcut}}",bold:"عريض",italic:"مائل",underline:"تسطير",removeBold:"إزالة العريض",removeItalic:"إزالة المائل",removeUnderline:"إزالة التسطير",inlineCode:"كود مضمن",removeInlineCode:"إزالة الكود المضمن",bulletedList:"قائمة نقطية",numberedList:"قائمة مرقمة",checkList:"قائمة مهام",toggleGroup:"نمط القائمة",link:"إدراج رابط",image:"إدراج صورة",table:"إدراج جدول",codeBlock:"إدراج كتلة كود",thematicBreak:"إدراج فاصل",richText:"نص منسق",diffMode:"عرض المقارنة",source:"المصدر",blockTypeSelect:{placeholder:"نوع الكتلة",selectBlockTypeTooltip:"اختر نوع الكتلة"},blockTypes:{paragraph:"فقرة",heading:"عنوان {{level}}",quote:"اقتباس"}}},no:{toolbar:{undo:"Angre {{shortcut}}",redo:"Gjør om {{shortcut}}",bold:"Fet",italic:"Kursiv",underline:"Understreket",removeBold:"Fjern fet",removeItalic:"Fjern kursiv",removeUnderline:"Fjern understreking",inlineCode:"Inline-kode",removeInlineCode:"Fjern inline-kode",bulletedList:"Punktliste",numberedList:"Nummerert liste",checkList:"Sjekkliste",toggleGroup:"Listestil",link:"Sett inn lenke",image:"Sett inn bilde",table:"Sett inn tabell",codeBlock:"Sett inn kodeblokk",thematicBreak:"Sett inn skillelinje",richText:"Formatert tekst",diffMode:"Diff-visning",source:"Kilde",blockTypeSelect:{placeholder:"Blokktype",selectBlockTypeTooltip:"Velg blokktype"},blockTypes:{paragraph:"Avsnitt",heading:"Overskrift {{level}}",quote:"Sitat"}}},"pt-BR":{toolbar:{undo:"Desfazer {{shortcut}}",redo:"Refazer {{shortcut}}",bold:"Negrito",italic:"Itálico",underline:"Sublinhado",removeBold:"Remover negrito",removeItalic:"Remover itálico",removeUnderline:"Remover sublinhado",inlineCode:"Código em linha",removeInlineCode:"Remover código em linha",bulletedList:"Lista com marcadores",numberedList:"Lista numerada",checkList:"Lista de tarefas",toggleGroup:"Estilo da lista",link:"Inserir link",image:"Inserir imagem",table:"Inserir tabela",codeBlock:"Inserir bloco de código",thematicBreak:"Inserir separador",richText:"Texto formatado",diffMode:"Visualização de diferenças",source:"Código-fonte",blockTypeSelect:{placeholder:"Tipo de bloco",selectBlockTypeTooltip:"Selecionar tipo de bloco"},blockTypes:{paragraph:"Parágrafo",heading:"Título {{level}}",quote:"Citação"}}},th:{toolbar:{undo:"เลิกทำ {{shortcut}}",redo:"ทำซ้ำ {{shortcut}}",bold:"ตัวหนา",italic:"ตัวเอียง",underline:"ขีดเส้นใต้",removeBold:"ยกเลิกตัวหนา",removeItalic:"ยกเลิกตัวเอียง",removeUnderline:"ยกเลิกขีดเส้นใต้",inlineCode:"โค้ดในบรรทัด",removeInlineCode:"ยกเลิกโค้ดในบรรทัด",bulletedList:"รายการแบบจุด",numberedList:"รายการตัวเลข",checkList:"รายการตรวจสอบ",toggleGroup:"รูปแบบรายการ",link:"แทรกลิงก์",image:"แทรกรูปภาพ",table:"แทรกตาราง",codeBlock:"แทรกบล็อกโค้ด",thematicBreak:"แทรกเส้นคั่น",richText:"ข้อความรูปแบบ",diffMode:"มุมมองเปรียบเทียบ",source:"ซอร์ส",blockTypeSelect:{placeholder:"ประเภทบล็อก",selectBlockTypeTooltip:"เลือกประเภทบล็อก"},blockTypes:{paragraph:"ย่อหน้า",heading:"หัวข้อ {{level}}",quote:"คำพูดอ้างอิง"}}},tr:{toolbar:{undo:"Geri al {{shortcut}}",redo:"Yinele {{shortcut}}",bold:"Kalın",italic:"İtalik",underline:"Altı çizili",removeBold:"Kalını kaldır",removeItalic:"İtaliği kaldır",removeUnderline:"Altı çiziliyi kaldır",inlineCode:"Satır içi kod",removeInlineCode:"Satır içi kodu kaldır",bulletedList:"Madde işaretli liste",numberedList:"Numaralı liste",checkList:"Kontrol listesi",toggleGroup:"Liste stili",link:"Bağlantı ekle",image:"Resim ekle",table:"Tablo ekle",codeBlock:"Kod bloğu ekle",thematicBreak:"Ayraç ekle",richText:"Zengin metin",diffMode:"Karşılaştırma görünümü",source:"Kaynak",blockTypeSelect:{placeholder:"Blok türü",selectBlockTypeTooltip:"Blok türü seç"},blockTypes:{paragraph:"Paragraf",heading:"Başlık {{level}}",quote:"Alıntı"}}},uk:{toolbar:{undo:"Скасувати {{shortcut}}",redo:"Повторити {{shortcut}}",bold:"Жирний",italic:"Курсив",underline:"Підкреслений",removeBold:"Прибрати жирний",removeItalic:"Прибрати курсив",removeUnderline:"Прибрати підкреслення",inlineCode:"Вбудований код",removeInlineCode:"Прибрати вбудований код",bulletedList:"Маркований список",numberedList:"Нумерований список",checkList:"Список завдань",toggleGroup:"Стиль списку",link:"Вставити посилання",image:"Вставити зображення",table:"Вставити таблицю",codeBlock:"Вставити блок коду",thematicBreak:"Вставити роздільник",richText:"Форматований текст",diffMode:"Перегляд порівняння",source:"Джерело",blockTypeSelect:{placeholder:"Тип блоку",selectBlockTypeTooltip:"Виберіть тип блоку"},blockTypes:{paragraph:"Абзац",heading:"Заголовок {{level}}",quote:"Цитата"}}}};function mdxTranslation(key,defaultValue,interpolations){const lang=("function"==typeof getLang?getLang():"en")||"en",langTable=TRANSLATIONS[lang]||TRANSLATIONS[lang.split("-")[0]];return function(template,values){if(!values)return template;let out=template.replace(/\{\{\s*(\w+)\s*\}\}/g,(_,k)=>k in values?String(values[k]):`{{${k}}}`);return out=out.replace(/\{(\w+)\}/g,(_,k)=>k in values?String(values[k]):`{${k}}`),out}((langTable&&function(obj,path){const parts=path.split(".");let cur=obj;for(const p of parts){if(!cur||"object"!=typeof cur||!(p in cur))return;cur=cur[p]}return"string"==typeof cur?cur:void 0}(langTable,key))??defaultValue??key,interpolations)}function getDocTheme(){return"undefined"==typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}const CODE_BLOCK_LANGUAGES={"":"Plain text",js:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",py:"Python",sh:"Shell",bash:"Bash",json:"JSON",yaml:"YAML",md:"Markdown",html:"HTML",css:"CSS",sql:"SQL",go:"Go",rust:"Rust",java:"Java",cpp:"C++"},MdxEditorPanel=reactExports.forwardRef(function({initialMarkdown:initialMarkdown,onChange:onChange,onError:onError,onParseError:onParseError},ref){const editorRef=reactExports.useRef(null),[theme,setTheme]=reactExports.useState(getDocTheme),lang="function"==typeof getLang?getLang():"en";reactExports.useEffect(()=>{const target=document.documentElement,obs=new MutationObserver(()=>setTheme(getDocTheme()));return obs.observe(target,{attributes:!0,attributeFilter:["data-theme"]}),()=>obs.disconnect()},[]);const imageUploadHandler=reactExports.useCallback(async file=>{try{return await compressImageToDataURL(file,{maxEdge:2e3,quality:.85})}catch(err){const msg=`${t("ui.mdEditor.uploadFailed")}: ${err.message??err}`;try{staticMethods.error(msg)}catch{}throw"function"==typeof onError&&onError(err),err}},[onError]),wrapperRef=reactExports.useRef(null);return reactExports.useImperativeHandle(ref,()=>({getMarkdown:()=>{var _a,_b;return(null==(_b=null==(_a=editorRef.current)?void 0:_a.getMarkdown)?void 0:_b.call(_a))??""},setMarkdown:md=>{var _a,_b;return null==(_b=null==(_a=editorRef.current)?void 0:_a.setMarkdown)?void 0:_b.call(_a,md??"")},focus:()=>{var _a,_b;return null==(_b=null==(_a=editorRef.current)?void 0:_a.focus)?void 0:_b.call(_a)},getScrollEl:()=>{var _a;return(null==(_a=wrapperRef.current)?void 0:_a.querySelector(".mdxeditor-root-contenteditable"))||wrapperRef.current||null}}),[]),jsxRuntimeExports.jsx("div",{ref:wrapperRef,className:`${styles.container} ${"dark"===theme?`dark-theme ${styles.dark}`:styles.light}`,children:jsxRuntimeExports.jsx(MDXEditor,{ref:editorRef,markdown:initialMarkdown??"",onChange:onChange,onError:payload=>{if("function"==typeof onParseError)try{onParseError(payload)}catch{}},translation:mdxTranslation,contentEditableClassName:styles.contentEditable,plugins:[headingsPlugin(),listsPlugin(),quotePlugin(),linkPlugin(),linkDialogPlugin(),imagePlugin({imageUploadHandler:imageUploadHandler}),tablePlugin(),codeBlockPlugin({defaultCodeBlockLanguage:""}),codeMirrorPlugin({codeBlockLanguages:CODE_BLOCK_LANGUAGES}),thematicBreakPlugin(),markdownShortcutPlugin(),diffSourcePlugin({viewMode:"rich-text",diffMarkdown:initialMarkdown??""}),toolbarPlugin({toolbarContents:()=>jsxRuntimeExports.jsxs(DiffSourceToggleWrapper,{children:[jsxRuntimeExports.jsx(UndoRedo,{}),jsxRuntimeExports.jsx(Separator,{}),jsxRuntimeExports.jsx(BoldItalicUnderlineToggles,{}),jsxRuntimeExports.jsx(CodeToggle,{}),jsxRuntimeExports.jsx(Separator,{}),jsxRuntimeExports.jsx(BlockTypeSelect,{}),jsxRuntimeExports.jsx(ListsToggle,{}),jsxRuntimeExports.jsx(Separator,{}),jsxRuntimeExports.jsx(CreateLink,{}),jsxRuntimeExports.jsx(InsertImage,{}),jsxRuntimeExports.jsx(InsertTable,{}),jsxRuntimeExports.jsx(InsertCodeBlock,{}),jsxRuntimeExports.jsx(InsertThematicBreak,{})]})})]},lang)})});export{MdxEditorPanel as default};
|
|
1
|
+
import{j as jsxRuntimeExports}from"./vendor-codemirror-ib-jPbXC.js";import{a as reactExports,s as staticMethods}from"./vendor-antd-5xE7sz6B.js";import{M as MDXEditor,h as headingsPlugin,l as listsPlugin,q as quotePlugin,a as linkPlugin,b as linkDialogPlugin,i as imagePlugin,t as tablePlugin,c as codeBlockPlugin,d as codeMirrorPlugin,e as thematicBreakPlugin,m as markdownShortcutPlugin,f as diffSourcePlugin,g as toolbarPlugin,D as DiffSourceToggleWrapper,U as UndoRedo,S as Separator,B as BoldItalicUnderlineToggles,C as CodeToggle,j as BlockTypeSelect,L as ListsToggle,k as CreateLink,I as InsertImage,n as InsertTable,o as InsertCodeBlock,p as InsertThematicBreak}from"./vendor-mdxeditor-BdKMdw6O.js";import{g as getLang,t}from"./index-Yhf-Rgbr.js";const styles={container:"_container_3d9hl_25",light:"_light_3d9hl_3",contentEditable:"_contentEditable_3d9hl_16"},PASSTHROUGH_TYPES=new Set(["image/png","image/gif","image/webp","image/svg+xml"]);function readAsDataURL(file){return new Promise((resolve,reject)=>{const reader=new FileReader;reader.onload=()=>resolve(reader.result),reader.onerror=()=>reject(new Error("FileReader failed")),reader.readAsDataURL(file)})}async function compressImageToDataURL(file,opts={}){if(!(file instanceof Blob))throw new Error("compressImageToDataURL: input must be a File or Blob");if(!file.type||!file.type.startsWith("image/"))throw new Error(`Unsupported file type: ${file.type||"unknown"}`);if(file.size>10485760)throw new Error(`Image too large: ${(file.size/1024/1024).toFixed(1)}MB > 10MB limit`);const maxEdge=opts.maxEdge??2e3,quality=opts.quality??.85;if(PASSTHROUGH_TYPES.has(file.type))return await readAsDataURL(file);const originalDataURL=await readAsDataURL(file),img=await(src=originalDataURL,new Promise((resolve,reject)=>{const img=new Image;img.onload=()=>resolve(img),img.onerror=()=>reject(new Error("Image decode failed")),img.src=src}));var src;const longestEdge=Math.max(img.naturalWidth,img.naturalHeight),scale=longestEdge>maxEdge?maxEdge/longestEdge:1,targetW=Math.max(1,Math.round(img.naturalWidth*scale)),targetH=Math.max(1,Math.round(img.naturalHeight*scale)),canvas=document.createElement("canvas");canvas.width=targetW,canvas.height=targetH;const ctx=canvas.getContext("2d");if(!ctx)return originalDataURL;let compressed;ctx.drawImage(img,0,0,targetW,targetH);try{compressed=canvas.toDataURL("image/jpeg",quality)}catch{return originalDataURL}return!compressed||"data:,"===compressed||compressed.length>=originalDataURL.length?originalDataURL:compressed}const TRANSLATIONS={zh:{contentArea:{editableMarkdown:"可编辑 Markdown"},dialog:{close:"关闭"},dialogControls:{cancel:"取消",save:"保存"},createLink:{text:"链接文字",textTooltip:"链接显示的文字",title:"标题",titleTooltip:"链接的 title 属性(鼠标悬停时显示)",url:"链接地址",urlPlaceholder:"请输入链接地址",saveTooltip:"保存链接",cancelTooltip:"取消编辑"},linkPreview:{open:"在新窗口打开 {{url}}",edit:"编辑链接",copyToClipboard:"复制链接到剪贴板",copied:"已复制",remove:"移除链接"},uploadImage:{dialogTitle:"插入图片",uploadInstructions:"从本地选择图片上传",addViaUrlInstructions:"或输入图片地址",addViaUrlInstructionsNoUpload:"请输入图片地址",autoCompletePlaceholder:"搜索已有图片",alt:"替代文字",title:"标题",width:"宽度",height:"高度"},imageEditor:{editImage:"编辑图片",deleteImage:"删除图片"},table:{columnMenu:"列菜单",rowMenu:"行菜单",textAlignment:"文字对齐",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",insertColumnLeft:"在左侧插入列",insertColumnRight:"在右侧插入列",insertRowAbove:"在上方插入行",insertRowBelow:"在下方插入行",deleteColumn:"删除列",deleteRow:"删除行",deleteTable:"删除表格"},codeBlock:{language:"语言",inlineLanguage:"行内语言",selectLanguage:"选择语言"},codeblock:{delete:"删除代码块"},toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",bold:"加粗",italic:"斜体",underline:"下划线",removeBold:"取消加粗",removeItalic:"取消斜体",removeUnderline:"取消下划线",inlineCode:"行内代码",removeInlineCode:"取消行内代码",bulletedList:"无序列表",numberedList:"有序列表",checkList:"任务列表",toggleGroup:"列表样式",link:"插入链接",image:"插入图片",table:"插入表格",codeBlock:"插入代码块",thematicBreak:"插入分隔线",richText:"富文本",diffMode:"对比视图",source:"源代码",blockTypeSelect:{placeholder:"块类型",selectBlockTypeTooltip:"选择块类型"},blockTypes:{paragraph:"段落",heading:"标题 {{level}}",quote:"引用"}}},"zh-TW":{contentArea:{editableMarkdown:"可編輯 Markdown"},dialog:{close:"關閉"},dialogControls:{cancel:"取消",save:"儲存"},createLink:{text:"連結文字",textTooltip:"連結顯示的文字",title:"標題",titleTooltip:"連結的 title 屬性(滑鼠懸停時顯示)",url:"連結網址",urlPlaceholder:"請輸入連結網址",saveTooltip:"儲存連結",cancelTooltip:"取消編輯"},linkPreview:{open:"在新視窗開啟 {{url}}",edit:"編輯連結",copyToClipboard:"複製連結至剪貼簿",copied:"已複製",remove:"移除連結"},uploadImage:{dialogTitle:"插入圖片",uploadInstructions:"從本地選擇圖片上傳",addViaUrlInstructions:"或輸入圖片網址",addViaUrlInstructionsNoUpload:"請輸入圖片網址",autoCompletePlaceholder:"搜尋現有圖片",alt:"替代文字",title:"標題",width:"寬度",height:"高度"},imageEditor:{editImage:"編輯圖片",deleteImage:"刪除圖片"},table:{columnMenu:"欄選單",rowMenu:"列選單",textAlignment:"文字對齊",alignLeft:"靠左",alignCenter:"置中",alignRight:"靠右",insertColumnLeft:"在左側插入欄",insertColumnRight:"在右側插入欄",insertRowAbove:"在上方插入列",insertRowBelow:"在下方插入列",deleteColumn:"刪除欄",deleteRow:"刪除列",deleteTable:"刪除表格"},codeBlock:{language:"語言",inlineLanguage:"行內語言",selectLanguage:"選擇語言"},codeblock:{delete:"刪除程式碼區塊"},toolbar:{undo:"復原 {{shortcut}}",redo:"重做 {{shortcut}}",bold:"粗體",italic:"斜體",underline:"底線",removeBold:"取消粗體",removeItalic:"取消斜體",removeUnderline:"取消底線",inlineCode:"行內程式碼",removeInlineCode:"取消行內程式碼",bulletedList:"項目符號清單",numberedList:"編號清單",checkList:"工作清單",toggleGroup:"清單樣式",link:"插入連結",image:"插入圖片",table:"插入表格",codeBlock:"插入程式碼區塊",thematicBreak:"插入分隔線",richText:"所見即所得",diffMode:"比對檢視",source:"原始碼",blockTypeSelect:{placeholder:"區塊類型",selectBlockTypeTooltip:"選擇區塊類型"},blockTypes:{paragraph:"段落",heading:"標題 {{level}}",quote:"引用"}}},ja:{toolbar:{undo:"元に戻す {{shortcut}}",redo:"やり直し {{shortcut}}",bold:"太字",italic:"イタリック",underline:"下線",removeBold:"太字を解除",removeItalic:"イタリックを解除",removeUnderline:"下線を解除",inlineCode:"インラインコード",removeInlineCode:"インラインコードを解除",bulletedList:"箇条書き",numberedList:"番号付きリスト",checkList:"チェックリスト",toggleGroup:"リストスタイル",link:"リンクを挿入",image:"画像を挿入",table:"表を挿入",codeBlock:"コードブロックを挿入",thematicBreak:"区切り線を挿入",richText:"リッチテキスト",diffMode:"差分表示",source:"ソース",blockTypeSelect:{placeholder:"ブロック種別",selectBlockTypeTooltip:"ブロック種別を選択"},blockTypes:{paragraph:"段落",heading:"見出し {{level}}",quote:"引用"}}},ko:{toolbar:{undo:"실행 취소 {{shortcut}}",redo:"다시 실행 {{shortcut}}",bold:"굵게",italic:"기울임",underline:"밑줄",removeBold:"굵게 해제",removeItalic:"기울임 해제",removeUnderline:"밑줄 해제",inlineCode:"인라인 코드",removeInlineCode:"인라인 코드 해제",bulletedList:"글머리 기호 목록",numberedList:"번호 매기기 목록",checkList:"체크리스트",toggleGroup:"목록 스타일",link:"링크 삽입",image:"이미지 삽입",table:"표 삽입",codeBlock:"코드 블록 삽입",thematicBreak:"구분선 삽입",richText:"서식있는 텍스트",diffMode:"비교 보기",source:"소스",blockTypeSelect:{placeholder:"블록 유형",selectBlockTypeTooltip:"블록 유형 선택"},blockTypes:{paragraph:"단락",heading:"제목 {{level}}",quote:"인용"}}},de:{toolbar:{undo:"Rückgängig {{shortcut}}",redo:"Wiederherstellen {{shortcut}}",bold:"Fett",italic:"Kursiv",underline:"Unterstrichen",removeBold:"Fett entfernen",removeItalic:"Kursiv entfernen",removeUnderline:"Unterstrichen entfernen",inlineCode:"Inline-Code",removeInlineCode:"Inline-Code entfernen",bulletedList:"Aufzählungsliste",numberedList:"Nummerierte Liste",checkList:"Aufgabenliste",toggleGroup:"Listenstil",link:"Link einfügen",image:"Bild einfügen",table:"Tabelle einfügen",codeBlock:"Codeblock einfügen",thematicBreak:"Trennlinie einfügen",richText:"Rich-Text",diffMode:"Diff-Ansicht",source:"Quelltext",blockTypeSelect:{placeholder:"Blocktyp",selectBlockTypeTooltip:"Blocktyp auswählen"},blockTypes:{paragraph:"Absatz",heading:"Überschrift {{level}}",quote:"Zitat"}}},es:{toolbar:{undo:"Deshacer {{shortcut}}",redo:"Rehacer {{shortcut}}",bold:"Negrita",italic:"Cursiva",underline:"Subrayado",removeBold:"Quitar negrita",removeItalic:"Quitar cursiva",removeUnderline:"Quitar subrayado",inlineCode:"Código en línea",removeInlineCode:"Quitar código en línea",bulletedList:"Lista con viñetas",numberedList:"Lista numerada",checkList:"Lista de tareas",toggleGroup:"Estilo de lista",link:"Insertar enlace",image:"Insertar imagen",table:"Insertar tabla",codeBlock:"Insertar bloque de código",thematicBreak:"Insertar separador",richText:"Texto enriquecido",diffMode:"Vista comparativa",source:"Código fuente",blockTypeSelect:{placeholder:"Tipo de bloque",selectBlockTypeTooltip:"Seleccionar tipo de bloque"},blockTypes:{paragraph:"Párrafo",heading:"Encabezado {{level}}",quote:"Cita"}}},fr:{toolbar:{undo:"Annuler {{shortcut}}",redo:"Rétablir {{shortcut}}",bold:"Gras",italic:"Italique",underline:"Souligné",removeBold:"Retirer le gras",removeItalic:"Retirer l’italique",removeUnderline:"Retirer le soulignement",inlineCode:"Code en ligne",removeInlineCode:"Retirer le code en ligne",bulletedList:"Liste à puces",numberedList:"Liste numérotée",checkList:"Liste de tâches",toggleGroup:"Style de liste",link:"Insérer un lien",image:"Insérer une image",table:"Insérer un tableau",codeBlock:"Insérer un bloc de code",thematicBreak:"Insérer un séparateur",richText:"Texte enrichi",diffMode:"Vue comparative",source:"Source",blockTypeSelect:{placeholder:"Type de bloc",selectBlockTypeTooltip:"Choisir le type de bloc"},blockTypes:{paragraph:"Paragraphe",heading:"Titre {{level}}",quote:"Citation"}}},it:{toolbar:{undo:"Annulla {{shortcut}}",redo:"Ripristina {{shortcut}}",bold:"Grassetto",italic:"Corsivo",underline:"Sottolineato",removeBold:"Rimuovi grassetto",removeItalic:"Rimuovi corsivo",removeUnderline:"Rimuovi sottolineato",inlineCode:"Codice in linea",removeInlineCode:"Rimuovi codice in linea",bulletedList:"Elenco puntato",numberedList:"Elenco numerato",checkList:"Elenco di attività",toggleGroup:"Stile elenco",link:"Inserisci link",image:"Inserisci immagine",table:"Inserisci tabella",codeBlock:"Inserisci blocco di codice",thematicBreak:"Inserisci separatore",richText:"Testo formattato",diffMode:"Vista differenze",source:"Sorgente",blockTypeSelect:{placeholder:"Tipo di blocco",selectBlockTypeTooltip:"Seleziona tipo di blocco"},blockTypes:{paragraph:"Paragrafo",heading:"Titolo {{level}}",quote:"Citazione"}}},da:{toolbar:{undo:"Fortryd {{shortcut}}",redo:"Gentag {{shortcut}}",bold:"Fed",italic:"Kursiv",underline:"Understreget",removeBold:"Fjern fed",removeItalic:"Fjern kursiv",removeUnderline:"Fjern understregning",inlineCode:"Indlejret kode",removeInlineCode:"Fjern indlejret kode",bulletedList:"Punktopstilling",numberedList:"Nummereret liste",checkList:"Tjekliste",toggleGroup:"Listestil",link:"Indsæt link",image:"Indsæt billede",table:"Indsæt tabel",codeBlock:"Indsæt kodeblok",thematicBreak:"Indsæt skillelinje",richText:"Formateret tekst",diffMode:"Diff-visning",source:"Kilde",blockTypeSelect:{placeholder:"Bloktype",selectBlockTypeTooltip:"Vælg bloktype"},blockTypes:{paragraph:"Afsnit",heading:"Overskrift {{level}}",quote:"Citat"}}},pl:{toolbar:{undo:"Cofnij {{shortcut}}",redo:"Ponów {{shortcut}}",bold:"Pogrubienie",italic:"Kursywa",underline:"Podkreślenie",removeBold:"Usuń pogrubienie",removeItalic:"Usuń kursywę",removeUnderline:"Usuń podkreślenie",inlineCode:"Kod w linii",removeInlineCode:"Usuń kod w linii",bulletedList:"Lista punktowana",numberedList:"Lista numerowana",checkList:"Lista zadań",toggleGroup:"Styl listy",link:"Wstaw link",image:"Wstaw obraz",table:"Wstaw tabelę",codeBlock:"Wstaw blok kodu",thematicBreak:"Wstaw separator",richText:"Tekst sformatowany",diffMode:"Widok porównania",source:"Źródło",blockTypeSelect:{placeholder:"Typ bloku",selectBlockTypeTooltip:"Wybierz typ bloku"},blockTypes:{paragraph:"Akapit",heading:"Nagłówek {{level}}",quote:"Cytat"}}},ru:{toolbar:{undo:"Отменить {{shortcut}}",redo:"Повторить {{shortcut}}",bold:"Полужирный",italic:"Курсив",underline:"Подчёркнутый",removeBold:"Убрать полужирный",removeItalic:"Убрать курсив",removeUnderline:"Убрать подчёркивание",inlineCode:"Встроенный код",removeInlineCode:"Убрать встроенный код",bulletedList:"Маркированный список",numberedList:"Нумерованный список",checkList:"Список задач",toggleGroup:"Стиль списка",link:"Вставить ссылку",image:"Вставить изображение",table:"Вставить таблицу",codeBlock:"Вставить блок кода",thematicBreak:"Вставить разделитель",richText:"Форматированный текст",diffMode:"Вид сравнения",source:"Исходный код",blockTypeSelect:{placeholder:"Тип блока",selectBlockTypeTooltip:"Выбрать тип блока"},blockTypes:{paragraph:"Абзац",heading:"Заголовок {{level}}",quote:"Цитата"}}},ar:{toolbar:{undo:"تراجع {{shortcut}}",redo:"إعادة {{shortcut}}",bold:"عريض",italic:"مائل",underline:"تسطير",removeBold:"إزالة العريض",removeItalic:"إزالة المائل",removeUnderline:"إزالة التسطير",inlineCode:"كود مضمن",removeInlineCode:"إزالة الكود المضمن",bulletedList:"قائمة نقطية",numberedList:"قائمة مرقمة",checkList:"قائمة مهام",toggleGroup:"نمط القائمة",link:"إدراج رابط",image:"إدراج صورة",table:"إدراج جدول",codeBlock:"إدراج كتلة كود",thematicBreak:"إدراج فاصل",richText:"نص منسق",diffMode:"عرض المقارنة",source:"المصدر",blockTypeSelect:{placeholder:"نوع الكتلة",selectBlockTypeTooltip:"اختر نوع الكتلة"},blockTypes:{paragraph:"فقرة",heading:"عنوان {{level}}",quote:"اقتباس"}}},no:{toolbar:{undo:"Angre {{shortcut}}",redo:"Gjør om {{shortcut}}",bold:"Fet",italic:"Kursiv",underline:"Understreket",removeBold:"Fjern fet",removeItalic:"Fjern kursiv",removeUnderline:"Fjern understreking",inlineCode:"Inline-kode",removeInlineCode:"Fjern inline-kode",bulletedList:"Punktliste",numberedList:"Nummerert liste",checkList:"Sjekkliste",toggleGroup:"Listestil",link:"Sett inn lenke",image:"Sett inn bilde",table:"Sett inn tabell",codeBlock:"Sett inn kodeblokk",thematicBreak:"Sett inn skillelinje",richText:"Formatert tekst",diffMode:"Diff-visning",source:"Kilde",blockTypeSelect:{placeholder:"Blokktype",selectBlockTypeTooltip:"Velg blokktype"},blockTypes:{paragraph:"Avsnitt",heading:"Overskrift {{level}}",quote:"Sitat"}}},"pt-BR":{toolbar:{undo:"Desfazer {{shortcut}}",redo:"Refazer {{shortcut}}",bold:"Negrito",italic:"Itálico",underline:"Sublinhado",removeBold:"Remover negrito",removeItalic:"Remover itálico",removeUnderline:"Remover sublinhado",inlineCode:"Código em linha",removeInlineCode:"Remover código em linha",bulletedList:"Lista com marcadores",numberedList:"Lista numerada",checkList:"Lista de tarefas",toggleGroup:"Estilo da lista",link:"Inserir link",image:"Inserir imagem",table:"Inserir tabela",codeBlock:"Inserir bloco de código",thematicBreak:"Inserir separador",richText:"Texto formatado",diffMode:"Visualização de diferenças",source:"Código-fonte",blockTypeSelect:{placeholder:"Tipo de bloco",selectBlockTypeTooltip:"Selecionar tipo de bloco"},blockTypes:{paragraph:"Parágrafo",heading:"Título {{level}}",quote:"Citação"}}},th:{toolbar:{undo:"เลิกทำ {{shortcut}}",redo:"ทำซ้ำ {{shortcut}}",bold:"ตัวหนา",italic:"ตัวเอียง",underline:"ขีดเส้นใต้",removeBold:"ยกเลิกตัวหนา",removeItalic:"ยกเลิกตัวเอียง",removeUnderline:"ยกเลิกขีดเส้นใต้",inlineCode:"โค้ดในบรรทัด",removeInlineCode:"ยกเลิกโค้ดในบรรทัด",bulletedList:"รายการแบบจุด",numberedList:"รายการตัวเลข",checkList:"รายการตรวจสอบ",toggleGroup:"รูปแบบรายการ",link:"แทรกลิงก์",image:"แทรกรูปภาพ",table:"แทรกตาราง",codeBlock:"แทรกบล็อกโค้ด",thematicBreak:"แทรกเส้นคั่น",richText:"ข้อความรูปแบบ",diffMode:"มุมมองเปรียบเทียบ",source:"ซอร์ส",blockTypeSelect:{placeholder:"ประเภทบล็อก",selectBlockTypeTooltip:"เลือกประเภทบล็อก"},blockTypes:{paragraph:"ย่อหน้า",heading:"หัวข้อ {{level}}",quote:"คำพูดอ้างอิง"}}},tr:{toolbar:{undo:"Geri al {{shortcut}}",redo:"Yinele {{shortcut}}",bold:"Kalın",italic:"İtalik",underline:"Altı çizili",removeBold:"Kalını kaldır",removeItalic:"İtaliği kaldır",removeUnderline:"Altı çiziliyi kaldır",inlineCode:"Satır içi kod",removeInlineCode:"Satır içi kodu kaldır",bulletedList:"Madde işaretli liste",numberedList:"Numaralı liste",checkList:"Kontrol listesi",toggleGroup:"Liste stili",link:"Bağlantı ekle",image:"Resim ekle",table:"Tablo ekle",codeBlock:"Kod bloğu ekle",thematicBreak:"Ayraç ekle",richText:"Zengin metin",diffMode:"Karşılaştırma görünümü",source:"Kaynak",blockTypeSelect:{placeholder:"Blok türü",selectBlockTypeTooltip:"Blok türü seç"},blockTypes:{paragraph:"Paragraf",heading:"Başlık {{level}}",quote:"Alıntı"}}},uk:{toolbar:{undo:"Скасувати {{shortcut}}",redo:"Повторити {{shortcut}}",bold:"Жирний",italic:"Курсив",underline:"Підкреслений",removeBold:"Прибрати жирний",removeItalic:"Прибрати курсив",removeUnderline:"Прибрати підкреслення",inlineCode:"Вбудований код",removeInlineCode:"Прибрати вбудований код",bulletedList:"Маркований список",numberedList:"Нумерований список",checkList:"Список завдань",toggleGroup:"Стиль списку",link:"Вставити посилання",image:"Вставити зображення",table:"Вставити таблицю",codeBlock:"Вставити блок коду",thematicBreak:"Вставити роздільник",richText:"Форматований текст",diffMode:"Перегляд порівняння",source:"Джерело",blockTypeSelect:{placeholder:"Тип блоку",selectBlockTypeTooltip:"Виберіть тип блоку"},blockTypes:{paragraph:"Абзац",heading:"Заголовок {{level}}",quote:"Цитата"}}}};function mdxTranslation(key,defaultValue,interpolations){const lang=("function"==typeof getLang?getLang():"en")||"en",langTable=TRANSLATIONS[lang]||TRANSLATIONS[lang.split("-")[0]];return function(template,values){if(!values)return template;let out=template.replace(/\{\{\s*(\w+)\s*\}\}/g,(_,k)=>k in values?String(values[k]):`{{${k}}}`);return out=out.replace(/\{(\w+)\}/g,(_,k)=>k in values?String(values[k]):`{${k}}`),out}((langTable&&function(obj,path){const parts=path.split(".");let cur=obj;for(const p of parts){if(!cur||"object"!=typeof cur||!(p in cur))return;cur=cur[p]}return"string"==typeof cur?cur:void 0}(langTable,key))??defaultValue??key,interpolations)}function getDocTheme(){return"undefined"==typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}const CODE_BLOCK_LANGUAGES={"":"Plain text",js:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",py:"Python",sh:"Shell",bash:"Bash",json:"JSON",yaml:"YAML",md:"Markdown",html:"HTML",css:"CSS",sql:"SQL",go:"Go",rust:"Rust",java:"Java",cpp:"C++"},MdxEditorPanel=reactExports.forwardRef(function({initialMarkdown:initialMarkdown,onChange:onChange,onError:onError,onParseError:onParseError},ref){const editorRef=reactExports.useRef(null),[theme,setTheme]=reactExports.useState(getDocTheme),lang="function"==typeof getLang?getLang():"en";reactExports.useEffect(()=>{const target=document.documentElement,obs=new MutationObserver(()=>setTheme(getDocTheme()));return obs.observe(target,{attributes:!0,attributeFilter:["data-theme"]}),()=>obs.disconnect()},[]);const imageUploadHandler=reactExports.useCallback(async file=>{try{return await compressImageToDataURL(file,{maxEdge:2e3,quality:.85})}catch(err){const msg=`${t("ui.mdEditor.uploadFailed")}: ${err.message??err}`;try{staticMethods.error(msg)}catch{}throw"function"==typeof onError&&onError(err),err}},[onError]),wrapperRef=reactExports.useRef(null);return reactExports.useImperativeHandle(ref,()=>({getMarkdown:()=>{var _a,_b;return(null==(_b=null==(_a=editorRef.current)?void 0:_a.getMarkdown)?void 0:_b.call(_a))??""},setMarkdown:md=>{var _a,_b;return null==(_b=null==(_a=editorRef.current)?void 0:_a.setMarkdown)?void 0:_b.call(_a,md??"")},focus:()=>{var _a,_b;return null==(_b=null==(_a=editorRef.current)?void 0:_a.focus)?void 0:_b.call(_a)},getScrollEl:()=>{var _a;return(null==(_a=wrapperRef.current)?void 0:_a.querySelector(".mdxeditor-root-contenteditable"))||wrapperRef.current||null}}),[]),jsxRuntimeExports.jsx("div",{ref:wrapperRef,className:`${styles.container} ${"dark"===theme?`dark-theme ${styles.dark}`:styles.light}`,children:jsxRuntimeExports.jsx(MDXEditor,{ref:editorRef,markdown:initialMarkdown??"",onChange:onChange,onError:payload=>{if("function"==typeof onParseError)try{onParseError(payload)}catch{}},translation:mdxTranslation,contentEditableClassName:styles.contentEditable,plugins:[headingsPlugin(),listsPlugin(),quotePlugin(),linkPlugin(),linkDialogPlugin(),imagePlugin({imageUploadHandler:imageUploadHandler}),tablePlugin(),codeBlockPlugin({defaultCodeBlockLanguage:""}),codeMirrorPlugin({codeBlockLanguages:CODE_BLOCK_LANGUAGES}),thematicBreakPlugin(),markdownShortcutPlugin(),diffSourcePlugin({viewMode:"rich-text",diffMarkdown:initialMarkdown??""}),toolbarPlugin({toolbarContents:()=>jsxRuntimeExports.jsxs(DiffSourceToggleWrapper,{children:[jsxRuntimeExports.jsx(UndoRedo,{}),jsxRuntimeExports.jsx(Separator,{}),jsxRuntimeExports.jsx(BoldItalicUnderlineToggles,{}),jsxRuntimeExports.jsx(CodeToggle,{}),jsxRuntimeExports.jsx(Separator,{}),jsxRuntimeExports.jsx(BlockTypeSelect,{}),jsxRuntimeExports.jsx(ListsToggle,{}),jsxRuntimeExports.jsx(Separator,{}),jsxRuntimeExports.jsx(CreateLink,{}),jsxRuntimeExports.jsx(InsertImage,{}),jsxRuntimeExports.jsx(InsertTable,{}),jsxRuntimeExports.jsx(InsertCodeBlock,{}),jsxRuntimeExports.jsx(InsertThematicBreak,{})]})})]},lang)})});export{MdxEditorPanel as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __defProp=Object.defineProperty,__publicField=(obj,key,value)=>((obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value)(obj,"symbol"!=typeof key?key+"":key,value);import{j as jsxRuntimeExports}from"./vendor-codemirror-ib-jPbXC.js";import{a as reactExports,I as Icon,b as _extends,R as React__default,s as staticMethods,M as Modal,C as ConfigProvider,B as Badge,i as Button,j as RefIcon$4,k as RefIcon$5,S as Spin,l as Select,m as Switch,n as Radio,o as RefIcon$6}from"./vendor-antd-5xE7sz6B.js";import{f as fetchAllRepos,b as buildGitTree,i as isImageFile,I as ImageLightbox,F as FullFileDiffView,u as useSessionStoragePersistedSet,a as ImageViewer,c as FileContentView,l as loadExpandedPaths,s as saveExpandedPaths,d as computeTokenStats,e as computeToolUsageStats,g as computeSkillUsageStats,h as computeCacheRebuildStats,j as classifyRequest,k as styles$3,C as ConceptHelp,m as formatTokenCount,A as AppBase,n as appConfig,o as loadFsSkills,p as loadProjectMemory,q as loadClaudeMdList,r as isSystemText,t as classifyUserContent,v as isMainAgent,w as styles$4,x as uploadFileAndGetPath,y as getEffectiveModel,z as AUTO_COMPACT_USABLE_RATIO,B as getModelMaxTokens,O as OPTIMISTIC_CLEAR_PERCENT,T as TerminalWsProvider,D as ApprovalModal,R as RefIcon$1,E as RefIcon$2,G as ChatView,H as TerminalPanel,J as CachePopoverContent,M as MemoryDetailModal,S as SkillsManagerModal,P as PluginModal,K as ProcessModal,L as ProxyModal,N as OpenFolderIcon,Q as RefIcon$3,V as VoicePackSettings,U as ToolApprovalPanel,W as useProjectAlias}from"./seqResourceLoaders-B2bHcUzO.js";import{a as apiUrl,t,i as isIOS,b as isPad,s as setViewMode,L as LANG_OPTIONS,c as setLang,g as getLang}from"./index-Yhf-Rgbr.js";import"./vendor-mdxeditor-BdKMdw6O.js";import"./vendor-xterm-DckPrCx1.js";import"./vendor-markdown-BFrYfpb0.js";import"./vendor-highlight-IFTJ9nxW.js";import"./vendor-virtuoso-DOIfjLfU.js";var RollbackOutlined$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z"}}]},name:"rollback",theme:"outlined"},RollbackOutlined=function(props,ref){return reactExports.createElement(Icon,_extends({},props,{ref:ref,icon:RollbackOutlined$1}))},RefIcon=reactExports.forwardRef(RollbackOutlined);const styles$2_container="_container_tjqxo_1",styles$2_fileListSection="_fileListSection_tjqxo_10",styles$2_header="_header_tjqxo_19",styles$2_headerLeft="_headerLeft_tjqxo_28",styles$2_headerTitle="_headerTitle_tjqxo_34",styles$2_fileCount="_fileCount_tjqxo_42",styles$2_closeBtn="_closeBtn_tjqxo_50",styles$2_changesContainer="_changesContainer_tjqxo_66",styles$2_changeItem="_changeItem_tjqxo_73",styles$2_changeItemActive="_changeItemActive_tjqxo_90",styles$2_dirItem="_dirItem_tjqxo_99",styles$2_dirArrow="_dirArrow_tjqxo_110",styles$2_dirName="_dirName_tjqxo_119",styles$2_status="_status_tjqxo_124",styles$2_icon="_icon_tjqxo_133",styles$2_fileName="_fileName_tjqxo_142",styles$2_diffSection="_diffSection_tjqxo_149",styles$2_diffHeader="_diffHeader_tjqxo_157",styles$2_diffFilePath="_diffFilePath_tjqxo_167",styles$2_diffBadge="_diffBadge_tjqxo_177",styles$2_diffContent="_diffContent_tjqxo_189",styles$2_diffPlaceholder="_diffPlaceholder_tjqxo_195",styles$2_statusText="_statusText_tjqxo_206",styles$2_errorText="_errorText_tjqxo_213",styles$2_emptyText="_emptyText_tjqxo_220",styles$2_warningText="_warningText_tjqxo_227",styles$2_fileSizeNote="_fileSizeNote_tjqxo_239",styles$2_statusTextItalic="_statusTextItalic_tjqxo_244",styles$2_imagePreviewWrap="_imagePreviewWrap_tjqxo_248",styles$2_imagePreview="_imagePreview_tjqxo_248",styles$2_rotated90="_rotated90_tjqxo_264",styles$2_repoHeader="_repoHeader_tjqxo_269",styles$2_repoArrow="_repoArrow_tjqxo_288",styles$2_repoArrowExpanded="_repoArrowExpanded_tjqxo_299",styles$2_repoName="_repoName_tjqxo_303",styles$2_repoBadge="_repoBadge_tjqxo_310",STATUS_COLORS={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991","??":"#73c991"},STATUS_LABELS={"??":"U"},EXT_COLORS$1={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function getFileIcon$1(name){const ext=name.includes(".")?name.split(".").pop().toLowerCase():"",color=EXT_COLORS$1[ext]||"#888";return jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:color,strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function TreeDir({name:name,node:node,depth:depth,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repoPath,onFileClick:onFileClick}){const dirNames=Object.keys(node.dirs).sort(),files=[...node.files].sort((a,b)=>a.name.localeCompare(b.name));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[name&&jsxRuntimeExports.jsxs("div",{className:styles$2_dirItem,style:{paddingLeft:8+16*depth},children:[jsxRuntimeExports.jsx("span",{className:styles$2_dirArrow,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:styles$2_rotated90,children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}),jsxRuntimeExports.jsx("span",{className:styles$2_icon,children:jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:jsxRuntimeExports.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}),jsxRuntimeExports.jsx("span",{className:styles$2_dirName,children:name})]}),dirNames.map(dir=>jsxRuntimeExports.jsx(TreeDir,{name:dir,node:node.dirs[dir],depth:name?depth+1:depth,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repoPath,onFileClick:onFileClick},dir)),files.map(file=>jsxRuntimeExports.jsxs("div",{className:`${styles$2_changeItem} ${selectedFile===file.fullPath&&selectedRepo===repoPath?styles$2_changeItemActive:""}`,style:{paddingLeft:8+16*(name?depth+1:depth)},onClick:()=>onFileClick&&onFileClick(repoPath,file.fullPath),children:[jsxRuntimeExports.jsx("span",{className:styles$2_icon,children:getFileIcon$1(file.name)}),jsxRuntimeExports.jsx("span",{className:styles$2_fileName,children:file.name}),jsxRuntimeExports.jsx("span",{className:styles$2_status,style:{color:STATUS_COLORS[file.status]||"#888"},children:STATUS_LABELS[file.status]||file.status})]},file.fullPath))]})}function MobileGitDiff({visible:visible,onClose:onClose}){const[repos,setRepos]=reactExports.useState(null),[error,setError]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!0),[selectedFile,setSelectedFile]=reactExports.useState(null),[selectedRepo,setSelectedRepo]=reactExports.useState(null),[collapsedRepos,setCollapsedRepos]=reactExports.useState(new Set),[diffData,setDiffData]=reactExports.useState(null),[diffError,setDiffError]=reactExports.useState(null),[diffLoading,setDiffLoading]=reactExports.useState(!1),[lightboxOpen,setLightboxOpen]=reactExports.useState(!1),mounted=reactExports.useRef(!0);reactExports.useEffect(()=>{if(mounted.current=!0,visible)return setLoading(!0),setError(null),fetchAllRepos().then(results=>{mounted.current&&(setRepos(results),setLoading(!1))}).catch(()=>{mounted.current&&(setError("Failed to load git status"),setLoading(!1))}),()=>{mounted.current=!1}},[visible]),reactExports.useEffect(()=>{if(!selectedFile||!selectedRepo)return setDiffData(null),void setDiffError(null);setDiffLoading(!0),setDiffData(null),setDiffError(null);const repoParam=selectedRepo&&"."!==selectedRepo?`&repo=${encodeURIComponent(selectedRepo)}`:"";fetch(apiUrl(`/api/git-diff?files=${encodeURIComponent(selectedFile)}${repoParam}`)).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}).then(data=>{mounted.current&&(data.diffs&&data.diffs[0]?setDiffData(data.diffs[0]):setDiffError("No diff data available"),setDiffLoading(!1))}).catch(err=>{mounted.current&&(setDiffError(`${t("ui.fileLoadError")}: ${err.message}`),setDiffLoading(!1))})},[selectedFile,selectedRepo]);const totalChanges=reactExports.useMemo(()=>repos?repos.reduce((sum,r)=>sum+r.changes.length,0):0,[repos]),isSingleRepo=!repos||repos.length<=1,handleFileClick=(repoPath,filePath)=>{setSelectedFile(filePath),setSelectedRepo(repoPath)},diffDisplayPath=selectedFile&&selectedRepo&&"."!==selectedRepo?`${selectedRepo}/${selectedFile}`:selectedFile;return jsxRuntimeExports.jsxs("div",{className:styles$2_container,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_fileListSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_header,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_headerLeft,children:[jsxRuntimeExports.jsx("span",{className:styles$2_headerTitle,children:t("ui.gitChanges")}),jsxRuntimeExports.jsx("span",{className:styles$2_fileCount,children:totalChanges})]}),onClose&&jsxRuntimeExports.jsx("button",{className:styles$2_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$2_changesContainer,children:[loading&&jsxRuntimeExports.jsx("div",{className:styles$2_statusText,children:"Loading..."}),error&&jsxRuntimeExports.jsx("div",{className:styles$2_errorText,children:error}),!loading&&!error&&(!repos||0===repos.length)&&jsxRuntimeExports.jsx("div",{className:styles$2_emptyText,children:"No changes"}),!loading&&!error&&repos&&repos.map(repo=>{const collapsed=collapsedRepos.has(repo.path);return isSingleRepo?jsxRuntimeExports.jsx(TreeDir,{name:"",node:buildGitTree(repo.changes),depth:0,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repo.path,onFileClick:handleFileClick},repo.path):jsxRuntimeExports.jsxs(React__default.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$2_repoHeader,onClick:()=>setCollapsedRepos(prev=>{const next=new Set(prev);return collapsed?next.delete(repo.path):next.add(repo.path),next}),children:[jsxRuntimeExports.jsx("span",{className:`${styles$2_repoArrow} ${collapsed?"":styles$2_repoArrowExpanded}`,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}),jsxRuntimeExports.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[jsxRuntimeExports.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),jsxRuntimeExports.jsx("circle",{cx:"18",cy:"6",r:"3"}),jsxRuntimeExports.jsx("circle",{cx:"6",cy:"18",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),jsxRuntimeExports.jsx("span",{className:styles$2_repoName,children:repo.name}),jsxRuntimeExports.jsx("span",{className:styles$2_repoBadge,children:repo.changes.length})]}),!collapsed&&jsxRuntimeExports.jsx(TreeDir,{name:"",node:buildGitTree(repo.changes),depth:1,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repo.path,onFileClick:handleFileClick})]},repo.path)})]})]}),jsxRuntimeExports.jsx("div",{className:styles$2_diffSection,children:selectedFile?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$2_diffHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$2_diffFilePath,children:diffDisplayPath}),jsxRuntimeExports.jsx("span",{className:styles$2_diffBadge,children:"DIFF"})]}),jsxRuntimeExports.jsxs("div",{className:styles$2_diffContent,children:[diffLoading&&jsxRuntimeExports.jsx("div",{className:styles$2_statusText,children:t("ui.loading")}),diffError&&jsxRuntimeExports.jsx("div",{className:styles$2_errorText,children:diffError}),!diffLoading&&!diffError&&diffData&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:diffData.is_large?jsxRuntimeExports.jsxs("div",{className:styles$2_warningText,children:[jsxRuntimeExports.jsx("p",{children:t("ui.largeFileWarning")}),jsxRuntimeExports.jsxs("p",{className:styles$2_fileSizeNote,children:[t("ui.fileSize"),": ",(diffData.size/1048576).toFixed(2)," MB"]})]}):isImageFile(selectedFile)&&!diffData.is_deleted?jsxRuntimeExports.jsxs("div",{className:styles$2_imagePreviewWrap,children:[jsxRuntimeExports.jsx("img",{className:styles$2_imagePreview,src:apiUrl(`/api/file-raw?path=${encodeURIComponent(diffDisplayPath)}`),alt:selectedFile,onClick:()=>setLightboxOpen(!0)}),lightboxOpen&&jsxRuntimeExports.jsx(ImageLightbox,{src:apiUrl(`/api/file-raw?path=${encodeURIComponent(diffDisplayPath)}`),alt:selectedFile,onClose:()=>setLightboxOpen(!1)})]}):diffData.is_binary?jsxRuntimeExports.jsx("div",{className:`${styles$2_statusText} ${styles$2_statusTextItalic}`,children:t("ui.binaryFileNotice")}):jsxRuntimeExports.jsx(FullFileDiffView,{file_path:selectedFile,old_string:diffData.old_content,new_string:diffData.new_content})})]})]}):jsxRuntimeExports.jsxs("div",{className:styles$2_diffPlaceholder,children:[jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#333",strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),jsxRuntimeExports.jsx("circle",{cx:"18",cy:"6",r:"3"}),jsxRuntimeExports.jsx("circle",{cx:"6",cy:"18",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),jsxRuntimeExports.jsx("span",{children:t("ui.mobileGitDiffHint")})]})})]})}const styles$1_container="_container_1hzyt_1",styles$1_fileListSection="_fileListSection_1hzyt_10",styles$1_header="_header_1hzyt_19",styles$1_headerLeft="_headerLeft_1hzyt_28",styles$1_headerTitle="_headerTitle_1hzyt_34",styles$1_fileCount="_fileCount_1hzyt_42",styles$1_closeBtn="_closeBtn_1hzyt_50",styles$1_treeContainer="_treeContainer_1hzyt_66",styles$1_treeItem="_treeItem_1hzyt_73",styles$1_treeItemActive="_treeItemActive_1hzyt_90",styles$1_treeItemIgnored="_treeItemIgnored_1hzyt_99",styles$1_arrow="_arrow_1hzyt_103",styles$1_arrowExpanded="_arrowExpanded_1hzyt_113",styles$1_icon="_icon_1hzyt_117",styles$1_fileName="_fileName_1hzyt_126",styles$1_contentSection="_contentSection_1hzyt_133",styles$1_contentPlaceholder="_contentPlaceholder_1hzyt_141",styles$1_statusText="_statusText_1hzyt_152",styles$1_errorText="_errorText_1hzyt_159",styles$1_emptyText="_emptyText_1hzyt_166",EXT_COLORS={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function getFileIcon(name){const ext=name.includes(".")?name.split(".").pop().toLowerCase():"",color=EXT_COLORS[ext]||"#888";return jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:color,strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function MobileTreeNode({item:item,path:path,depth:depth,expandedPaths:expandedPaths,onToggleExpand:onToggleExpand,currentFile:currentFile,onFileClick:onFileClick}){const[children,setChildren]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!1),childPath=path?`${path}/${item.name}`:item.name,expanded=expandedPaths.has(childPath),isDir="directory"===item.type,isSelected=!isDir&¤tFile===childPath,isGitIgnored=item.gitIgnored||!1;reactExports.useEffect(()=>{isDir&&expanded&&null===children&&!loading&&(setLoading(!0),fetch(apiUrl(`/api/files?path=${encodeURIComponent(childPath)}`)).then(r=>r.ok?r.json():Promise.reject()).then(data=>{setChildren(data),setLoading(!1)}).catch(()=>{setLoading(!1)}))},[expanded]);const handleClick=reactExports.useCallback(()=>{isDir?onToggleExpand(childPath):onFileClick(childPath)},[isDir,childPath,onToggleExpand,onFileClick]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:`${styles$1_treeItem} ${isSelected?styles$1_treeItemActive:""} ${isGitIgnored?styles$1_treeItemIgnored:""}`,style:{paddingLeft:8+16*depth},onClick:handleClick,children:[isDir?jsxRuntimeExports.jsx("span",{className:`${styles$1_arrow} ${expanded?styles$1_arrowExpanded:""}`,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}):jsxRuntimeExports.jsx("span",{style:{width:16,flexShrink:0}}),jsxRuntimeExports.jsx("span",{className:styles$1_icon,children:isDir?jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:jsxRuntimeExports.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})}):getFileIcon(item.name)}),jsxRuntimeExports.jsx("span",{className:styles$1_fileName,children:item.name}),loading&&jsxRuntimeExports.jsx("span",{style:{fontSize:10,color:"var(--text-disabled)"},children:"..."})]}),isDir&&expanded&&children&&children.map(child=>jsxRuntimeExports.jsx(MobileTreeNode,{item:child,path:childPath,depth:depth+1,expandedPaths:expandedPaths,onToggleExpand:onToggleExpand,currentFile:currentFile,onFileClick:onFileClick},child.name))]})}function MobileFileExplorer({visible:visible,onClose:onClose,targetFile:targetFile,projectName:projectName}){const[items,setItems]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!0),[error,setError]=reactExports.useState(null),[expandedPaths,setExpandedPaths]=useSessionStoragePersistedSet({projectName:projectName,load:loadExpandedPaths,save:saveExpandedPaths}),[currentFile,setCurrentFile]=reactExports.useState(null),mounted=reactExports.useRef(!0),lastTargetRef=reactExports.useRef(null);reactExports.useEffect(()=>(mounted.current=!0,visible?(setLoading(!0),setError(null),fetch(apiUrl("/api/files?path=")).then(r=>r.ok?r.json():Promise.reject()).then(data=>{mounted.current&&(setItems(data),setLoading(!1))}).catch(()=>{mounted.current&&(setError(t("ui.fileLoadError")),setLoading(!1))}),()=>{mounted.current=!1}):(setCurrentFile(null),void(lastTargetRef.current=null))),[visible]),reactExports.useEffect(()=>{targetFile&&visible&&lastTargetRef.current!==targetFile.file&&(lastTargetRef.current=targetFile.file,setCurrentFile(targetFile.file),targetFile.ancestors&&targetFile.ancestors.length>0&&setExpandedPaths(prev=>{const next=new Set(prev);return targetFile.ancestors.forEach(p=>next.add(p)),next}))},[targetFile,visible]);const handleToggleExpand=reactExports.useCallback(path=>{setExpandedPaths(prev=>{const next=new Set(prev);return next.has(path)?next.delete(path):next.add(path),next})},[]),handleFileClick=reactExports.useCallback(path=>{setCurrentFile(path)},[]),handleFileClose=reactExports.useCallback(()=>{setCurrentFile(null)},[]),itemCount=items?items.length:0;return jsxRuntimeExports.jsxs("div",{className:styles$1_container,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_fileListSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_header,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_headerLeft,children:[jsxRuntimeExports.jsx("span",{className:styles$1_headerTitle,children:t("ui.projectFolder")}),jsxRuntimeExports.jsx("span",{className:styles$1_fileCount,children:itemCount})]}),onClose&&jsxRuntimeExports.jsx("button",{className:styles$1_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$1_treeContainer,children:[loading&&jsxRuntimeExports.jsx("div",{className:styles$1_statusText,children:t("ui.loading")}),error&&jsxRuntimeExports.jsx("div",{className:styles$1_errorText,children:t("ui.fileLoadError")}),!loading&&!error&&(!items||0===items.length)&&jsxRuntimeExports.jsx("div",{className:styles$1_emptyText,children:t("ui.mobileFileExplorerHint")}),!loading&&!error&&items&&items.map(item=>jsxRuntimeExports.jsx(MobileTreeNode,{item:item,path:"",depth:0,expandedPaths:expandedPaths,onToggleExpand:handleToggleExpand,currentFile:currentFile,onFileClick:handleFileClick},item.name))]})]}),jsxRuntimeExports.jsx("div",{className:styles$1_contentSection,children:currentFile?isImageFile(currentFile)?jsxRuntimeExports.jsx(ImageViewer,{filePath:currentFile,onClose:handleFileClose}):jsxRuntimeExports.jsx(FileContentView,{filePath:currentFile,onClose:handleFileClose}):jsxRuntimeExports.jsxs("div",{className:styles$1_contentPlaceholder,children:[jsxRuntimeExports.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntimeExports.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})}),jsxRuntimeExports.jsx("span",{children:t("ui.mobileFileExplorerHint")})]})})]})}const styles_container="_container_1bb9n_1",styles_header="_header_1bb9n_9",styles_headerTitle="_headerTitle_1bb9n_18",styles_closeBtn="_closeBtn_1bb9n_24",styles_content="_content_1bb9n_38",styles_empty="_empty_1bb9n_47",styles_fixedTable="_fixedTable_1bb9n_54",styles_ellipsisCell="_ellipsisCell_1bb9n_58",styles_thLeft="_thLeft_1bb9n_65",styles_colWide="_colWide_1bb9n_69",styles_colNarrow="_colNarrow_1bb9n_73",REASON_KEYS=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],I18N_MAP={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"};function MobileStats({requests:requests=[],visible:visible,onClose:onClose}){const{byModel:byModel,models:models,toolStats:toolStats,skillStats:skillStats,cacheStats:cacheStats,activeReasons:activeReasons,totalCount:totalCount,totalCache:totalCache,hasCacheStats:hasCacheStats,subAgentEntries:subAgentEntries,hasSubAgentStats:hasSubAgentStats,teammateEntries:teammateEntries,hasTeammateStats:hasTeammateStats,isEmpty:isEmpty}=reactExports.useMemo(()=>{const byModel2=computeTokenStats(requests),models2=Object.keys(byModel2),toolStats2=computeToolUsageStats(requests),skillStats2=computeSkillUsageStats(requests),cacheStats2=computeCacheRebuildStats(requests),activeReasons2=REASON_KEYS.filter(k=>cacheStats2[k].count>0),totalCount2=activeReasons2.reduce((sum,k)=>sum+cacheStats2[k].count,0),totalCache2=activeReasons2.reduce((sum,k)=>sum+cacheStats2[k].cacheCreate,0),hasCacheStats2=activeReasons2.length>0,subAgentCounts={},teammateCounts={};for(let i=0;i<requests.length;i++){const cls=classifyRequest(requests[i],requests[i+1]);if("SubAgent"===cls.type){const label=cls.subType||"Other";subAgentCounts[label]=(subAgentCounts[label]||0)+1}else if("Teammate"===cls.type){const label=cls.subType||"Teammate";teammateCounts[label]=(teammateCounts[label]||0)+1}}const subAgentEntries2=Object.entries(subAgentCounts).sort((a,b)=>b[1]-a[1]),hasSubAgentStats2=subAgentEntries2.length>0,teammateEntries2=Object.entries(teammateCounts).sort((a,b)=>b[1]-a[1]),hasTeammateStats2=teammateEntries2.length>0,isEmpty2=0===models2.length&&0===toolStats2.length&&!hasCacheStats2&&!hasSubAgentStats2&&!hasTeammateStats2&&0===skillStats2.length;return{byModel:byModel2,models:models2,toolStats:toolStats2,skillStats:skillStats2,cacheStats:cacheStats2,activeReasons:activeReasons2,totalCount:totalCount2,totalCache:totalCache2,hasCacheStats:hasCacheStats2,subAgentEntries:subAgentEntries2,hasSubAgentStats:hasSubAgentStats2,teammateEntries:teammateEntries2,hasTeammateStats:hasTeammateStats2,isEmpty:isEmpty2}},[requests]);return visible?jsxRuntimeExports.jsxs("div",{className:styles_container,children:[jsxRuntimeExports.jsxs("div",{className:styles_header,children:[jsxRuntimeExports.jsx("span",{className:styles_headerTitle,children:t("ui.tokenStats")}),jsxRuntimeExports.jsx("button",{className:styles_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles_content,children:isEmpty?jsxRuntimeExports.jsx("div",{className:styles_empty,children:"—"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[skillStats.length>0&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.skillUsageStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Skill"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[skillStats.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:name}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),skillStats.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:skillStats.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasSubAgentStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.subAgentStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"SubAgent"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[subAgentEntries.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsxs("td",{className:styles$3.label,children:[name," ",jsxRuntimeExports.jsx(ConceptHelp,{doc:`SubAgent-${name}`})]}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),subAgentEntries.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:subAgentEntries.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasTeammateStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:"Teammate"}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Name"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[teammateEntries.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:name}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),teammateEntries.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:teammateEntries.reduce((s,e)=>s+e[1],0)})]})]})]})]}),toolStats.length>0&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.toolUsageStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Tool"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[toolStats.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsxs("td",{className:styles$3.label,children:[name," ",jsxRuntimeExports.jsx(ConceptHelp,{doc:`Tool-${name}`})]}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),toolStats.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:toolStats.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasCacheStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.modelName,children:["MainAgent",jsxRuntimeExports.jsx(ConceptHelp,{doc:"MainAgent"})," ",t("ui.cacheRebuildStats"),jsxRuntimeExports.jsx(ConceptHelp,{doc:"CacheRebuild"})]}),jsxRuntimeExports.jsxs("table",{className:`${styles$3.statsTable} ${styles_fixedTable}`,children:[jsxRuntimeExports.jsxs("colgroup",{children:[jsxRuntimeExports.jsx("col",{className:styles_colWide}),jsxRuntimeExports.jsx("col",{className:styles_colNarrow}),jsxRuntimeExports.jsx("col",{className:styles_colNarrow})]}),jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:t("ui.cacheRebuild.reason")}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.cacheCreate")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[activeReasons.map(k=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.label} ${styles_ellipsisCell}`,title:t(`ui.${I18N_MAP[k]}`),children:t(`ui.${I18N_MAP[k]}`)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:cacheStats[k].count}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(cacheStats[k].cacheCreate)})]},k)),activeReasons.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:totalCount}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(totalCache)})]})]})]})]}),models.map(model=>{const s=byModel[model],totalInput=s.input+s.cacheCreation+s.cacheRead,cacheHitRate=totalInput>0?(s.cacheRead/totalInput*100).toFixed(1):"0.0";return jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:model}),jsxRuntimeExports.jsx("table",{className:styles$3.statsTable,children:jsxRuntimeExports.jsxs("tbody",{children:[jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Token"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"input"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"output"})]}),jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(totalInput)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.output)})]}),jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Cache"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"create"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"read"})]}),jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.cacheCreation)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.cacheRead)})]}),jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:t("ui.hitRate")}),jsxRuntimeExports.jsxs("td",{colSpan:2,className:styles$3.td,children:[cacheHitRate,"%"]})]})]})})]},model)})]})})]}):null}const CALIBRATION_MODELS=appConfig.calibrationModels;function MobileCtxLabelText({projectName:projectName}){const alias=useProjectAlias(projectName),base=`${t("ui.liveMonitoring")}${projectName?`: ${projectName}`:""}`;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[base,alias?` (${alias})`:""]})}const _Mobile=class _Mobile extends AppBase{constructor(props){var v;super(props),__publicField(this,"handleCalibrationModelChange",value=>{this.setState({calibrationModel:value}),localStorage.setItem("ccv_calibrationModel",value)}),__publicField(this,"reloadFsSkills",async()=>loadFsSkills(this,{isLocalLog:this._isLocalLog})),__publicField(this,"handleOpenSkillsModal",async()=>{const cached=this.state._fsSkills,needFetch=!Array.isArray(cached);if(this.setState(prev=>{var _a;return{_skillsModal:{open:!0,loading:needFetch,skills:Array.isArray(cached)?cached:[],error:null,toggling:(null==(_a=prev._skillsModal)?void 0:_a.toggling)||new Set},mobileCachePanelVisible:!1}},()=>this._onCachePanelOpenChange(!1)),needFetch){const result=await this.reloadFsSkills();this.setState(prev=>({_skillsModal:{...prev._skillsModal,loading:!1,skills:result.ok?result.skills:[],error:result.ok?null:result.reason}}))}}),__publicField(this,"handleToggleSkill",async skill=>{var _a,_b;const key=`${skill.source}-${skill.name}`;if(null==(_b=null==(_a=this.state._skillsModal)?void 0:_a.toggling)?void 0:_b.has(key))return;const enable=!skill.enabled,flipEnabled=target=>s=>s.source===skill.source&&s.name===skill.name?{...s,enabled:target}:s;this.setState(prev=>{const next=new Set(prev._skillsModal.toggling);return next.add(key),{_skillsModal:{...prev._skillsModal,toggling:next,skills:prev._skillsModal.skills.map(flipEnabled(enable))}}});try{const r=await fetch(apiUrl("/api/skills/toggle"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:skill.source,name:skill.name,enable:enable})}),data=await r.json();if(!r.ok)return this.setState(prev=>({_skillsModal:{...prev._skillsModal,skills:prev._skillsModal.skills.map(flipEnabled(!enable))}})),void("DEST_CONFLICT"===data.code?staticMethods.error(t("ui.skillToggleConflict",{name:skill.name})):staticMethods.error(t("ui.skillToggleFailed",{reason:data.error||"unknown"})));this.setState(prev=>({_fsSkills:Array.isArray(prev._fsSkills)?prev._fsSkills.map(s=>s.source===skill.source&&s.name===skill.name?{...s,enabled:enable}:s):prev._fsSkills}));const result=await this.reloadFsSkills();result.ok&&this.setState(prev=>{const orderMap=new Map(prev._skillsModal.skills.map((s,i)=>[`${s.source}-${s.name}`,i])),merged=[...result.skills].sort((a,b)=>{const ai=orderMap.get(`${a.source}-${a.name}`),bi=orderMap.get(`${b.source}-${b.name}`);return void 0===ai&&void 0===bi?0:void 0===ai?1:void 0===bi?-1:ai-bi});return{_skillsModal:{...prev._skillsModal,skills:merged}}})}catch(e){this.setState(prev=>({_skillsModal:{...prev._skillsModal,skills:prev._skillsModal.skills.map(flipEnabled(!enable))}})),staticMethods.error(t("ui.skillToggleFailed",{reason:e.message}))}finally{this.setState(prev=>{const next=new Set(prev._skillsModal.toggling);return next.delete(key),{_skillsModal:{...prev._skillsModal,toggling:next}}})}}),__publicField(this,"loadMemory",async()=>loadProjectMemory(this)),__publicField(this,"handleRefreshMemory",async()=>{if(this.state._memoryRefreshing)return;this.setState({_memoryRefreshing:!0});const seq=++this._memorySeq;let ok=!1,stale=!1;try{const r=await fetch(apiUrl("/api/project-memory")),data=await r.json();seq!==this._memorySeq?stale=!0:r.ok?(this.setState({_memory:data}),ok=!0):this.setState({_memory:!1})}catch{seq!==this._memorySeq?stale=!0:this.setState({_memory:!1})}finally{stale||this.setState({_memoryRefreshing:!1})}stale||(ok?staticMethods.success(t("ui.memoryRefreshSuccess")):staticMethods.error(t("ui.memoryRefreshFailed"),5))}),__publicField(this,"loadMemoryDetail",async name=>{const seq=++this._memoryDetailSeq;this.setState({_memoryDetail:{name:name,loading:!0}});try{const r=await fetch(apiUrl(`/api/project-memory?file=${encodeURIComponent(name)}`)),data=await r.json();if(seq!==this._memoryDetailSeq)return;if(!r.ok)return void this.setState({_memoryDetail:{name:name,error:data.error||`http:${r.status}`}});this.setState({_memoryDetail:{name:name,content:data.content||""}})}catch(e){seq===this._memoryDetailSeq&&this.setState({_memoryDetail:{name:name,error:e.message||"network"}})}}),__publicField(this,"_onCachePanelOpenChange",open=>{open&&null===this.state._fsSkills&&!this._isLocalLog&&this.reloadFsSkills(),open&&null===this.state._memory&&this.loadMemory(),open&&null===this.state._claudeMd&&this.loadClaudeMdList()}),__publicField(this,"loadClaudeMdList",async()=>loadClaudeMdList(this)),__publicField(this,"loadClaudeMdDetail",async(id,tail,scope)=>{const seq=++this._claudeMdDetailSeq,title=`${t("global"===scope?"ui.claudeMdScopeGlobal":"ui.claudeMdScopeProject")} · ${tail}`;this.setState({_claudeMdDetail:{name:title,loading:!0}});try{const r=await fetch(apiUrl(`/api/claude-md?id=${encodeURIComponent(id)}`)),data=await r.json();if(seq!==this._claudeMdDetailSeq)return;if(!r.ok)return void this.setState({_claudeMdDetail:{name:title,error:data.error||`http:${r.status}`}});this.setState({_claudeMdDetail:{name:title,content:data.content||""}})}catch(e){seq===this._claudeMdDetailSeq&&this.setState({_claudeMdDetail:{name:title,error:e.message||"network"}})}}),__publicField(this,"_handleMobileOpenFile",(filePath,ancestors)=>{this.state.localLogFile||this.setState({...this._closeAllMobileOverlays(),mobileFileExplorerVisible:!0,mobileFileExplorerTarget:{file:filePath,ancestors:ancestors||[]}})}),__publicField(this,"handleExportPromptsTxt",prompts=>{if(!prompts||0===prompts.length)return;const blocks=[];for(const p of prompts){const lines=[],ts=p.timestamp?new Date(p.timestamp).toLocaleString():"";ts&&lines.push(`${ts}:\n`);const textParts=(p.segments||[]).filter(seg=>"text"===seg.type).map(seg=>seg.content);textParts.length>0&&lines.push(textParts.join("\n")),blocks.push(lines.join("\n"))}if(0===blocks.length)return;const blob=new Blob([blocks.join("\n\n\n\n")],{type:"text/plain;charset=utf-8"}),url=URL.createObjectURL(blob),a=document.createElement("a");a.href=url,a.download=`user-prompts-${(new Date).toISOString().slice(0,10)}.txt`,a.click(),URL.revokeObjectURL(url)}),__publicField(this,"handlePendingPermission",data=>{this.setState({globalPermission:data})}),__publicField(this,"handlePendingPlanApproval",data=>{this.setState({globalPlanApproval:data})}),__publicField(this,"handleAutoApproveChange",seconds=>{this.setState({autoApproveSeconds:seconds}),this.context.updatePreferences({autoApproveSeconds:seconds})}),__publicField(this,"_isInternalDrag",e=>e.dataTransfer.types.includes("text/x-preset-reorder")),__publicField(this,"_onDragOver",e=>{if(e.preventDefault(),this._isInternalDrag(e))return;e.target.closest&&e.target.closest("[data-file-explorer]")?this.state.isDragging&&this.setState({isDragging:!1}):this.state.isDragging||this.setState({isDragging:!0})}),__publicField(this,"_onDragLeave",e=>{const layout=this._layoutRef.current;layout&&!layout.contains(e.relatedTarget)&&this.setState({isDragging:!1})}),__publicField(this,"_onDrop",e=>{if(e.preventDefault(),this._isInternalDrag(e))return;this.setState({isDragging:!1});const files=Array.from(e.dataTransfer.files);if(!files.length)return;const toTerminal=this.state.mobileTerminalVisible;Promise.all(files.map(file=>uploadFileAndGetPath(file).then(path=>({name:file.name,path:path})).catch(err=>(staticMethods.error(`${file.name}: ${err.message}`),null)))).then(results=>{const uploaded=results.filter(Boolean);uploaded.length&&(toTerminal?this.setState(prev=>({terminalPendingImages:[...prev.terminalPendingImages,...uploaded.map(r=>({path:r.path,source:"drop"}))]})):this.setState(prev=>({pendingUploadPaths:[...prev.pendingUploadPaths||[],...uploaded.map(r=>`"${r.path}"`)]})))})}),__publicField(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})}),__publicField(this,"_handleTerminalFilePath",path=>{this.setState(prev=>({terminalPendingImages:[...prev.terminalPendingImages,{path:path,source:"terminal"}]}))}),__publicField(this,"_handleRemoveTerminalImage",idx=>{this.setState(prev=>({terminalPendingImages:prev.terminalPendingImages.filter((_,i)=>i!==idx)}))}),__publicField(this,"_handleClearTerminalImages",()=>{this.setState({terminalPendingImages:[]})}),Object.assign(this.state,{mobileMenuVisible:!1,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileTerminalVisible:!1,mobileFileExplorerVisible:!1,mobileCachePanelVisible:!1,globalPermission:null,globalPlanApproval:null,autoApproveSeconds:0,hasGit:!0,terminalPendingImages:[],_fsSkills:null,_memory:null,_memoryRefreshing:!1,_memoryDetail:null,_claudeMd:null,_claudeMdDetail:null,pluginModalVisible:!1,processModalVisible:!1,proxyModalVisible:!1,_skillsModal:{open:!1,loading:!1,skills:[],error:null,toggling:new Set},calibrationModel:(v=localStorage.getItem("ccv_calibrationModel")||"auto",CALIBRATION_MODELS.some(m=>m.value===v)?v:"auto")}),this._lastContextPercent=0,this._fsSkillsSeq=0,this._memorySeq=0,this._memoryDetailSeq=0,this._claudeMdSeq=0,this._claudeMdDetailSeq=0}_closeAllMobileOverlays(){return{mobileMenuVisible:!1,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileTerminalVisible:!1,mobileFileExplorerVisible:!1,mobileCachePanelVisible:!1,pluginModalVisible:!1,processModalVisible:!1,proxyModalVisible:!1}}componentDidMount(){super.componentDidMount(),fetch(apiUrl("/api/git-repos")).then(r=>r.ok?r.json():Promise.reject()).then(data=>{var _a;(null==(_a=data.repos)?void 0:_a.length)||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>{fetch(apiUrl("/api/git-status")).then(r=>{r.ok||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>this.setState({hasGit:!1,mobileGitDiffVisible:!1}))}),isIOS&&!isPad&&window.visualViewport&&(this._onVisualViewportChange=()=>{const el=this._layoutRef.current;if(!el)return;const vv=window.visualViewport;el.style.position="fixed",el.style.top=`${vv.offsetTop}px`,el.style.height=`${vv.height}px`,el.style.width="100%",el.style.left="0"},window.visualViewport.addEventListener("resize",this._onVisualViewportChange),window.visualViewport.addEventListener("scroll",this._onVisualViewportChange),this._onVisualViewportChange()),isPad&&(this._mqlWide=window.matchMedia("(min-width: 1400px)"),this._modeSwitchDialog=null,this._onWideChange=e=>{e.matches?this._modeSwitchDialog=Modal.confirm({title:t("ui.modeSwitchTitle"),content:t("ui.modeSwitchToFullView"),okText:t("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,setViewMode("pc")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlWide.addEventListener("change",this._onWideChange))}componentWillUnmount(){this._onVisualViewportChange&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",this._onVisualViewportChange),window.visualViewport.removeEventListener("scroll",this._onVisualViewportChange)),this._mqlWide&&this._mqlWide.removeEventListener("change",this._onWideChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),this._fsSkillsSeq++,this._memorySeq++,this._memoryDetailSeq++,this._claudeMdSeq++,this._claudeMdDetailSeq++,super.componentWillUnmount()}componentDidUpdate(prevProps,prevState){super.componentDidUpdate&&super.componentDidUpdate(prevProps,prevState),prevState.projectName!==this.state.projectName&&(this._fsSkillsSeq++,this._memorySeq++,this._claudeMdSeq++,this._claudeMdDetailSeq++,this.setState({_fsSkills:null,_memory:null,_memoryDetail:null,_memoryRefreshing:!1,_claudeMd:null,_claudeMdDetail:null}))}static parseSegments(text){const segments=[],regex=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let match,lastIndex=0;for(;null!==(match=regex.exec(text));){const before=text.slice(lastIndex,match.index).trim();before&&segments.push({type:"text",content:before});const tagName=match[1];if(lastIndex=match.index+match[0].length,_Mobile.COMMAND_TAGS.has(tagName))continue;const innerRegex=new RegExp(`^<${tagName}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${tagName}>$`),innerMatch=match[0].match(innerRegex),content2=innerMatch?innerMatch[1].trim():match[0].trim();segments.push({type:"system",content:content2,label:tagName})}const after=text.slice(lastIndex).trim();return after&&segments.push({type:"text",content:after}),segments}static extractUserTexts(messages){const userMsgs=[],fullTexts=[];let slashCmd=null;for(const msg of messages)if("user"===msg.role)if("string"==typeof msg.content){const text=msg.content.trim();if(!text)continue;if(!isSystemText(text)){if(/Implement the following plan:/i.test(text))continue;userMsgs.push(text),fullTexts.push(text)}}else if(Array.isArray(msg.content)){const{commands:commands,textBlocks:textBlocks}=classifyUserContent(msg.content);commands.length>0&&(slashCmd=commands[commands.length-1]);const userParts=[];for(const b of textBlocks)/Implement the following plan:/i.test((b.text||"").trim())||userParts.push(b.text.trim());const allParts=msg.content.filter(b=>{var _a;return"text"===b.type&&(null==(_a=b.text)?void 0:_a.trim())}).map(b=>b.text.trim());userParts.length>0&&(userMsgs.push(userParts.join("\n")),fullTexts.push(allParts.join("\n")))}return{userMsgs:userMsgs,fullTexts:fullTexts,slashCmd:slashCmd}}extractUserPrompts(requests){var _a;const prompts=[],seen=new Set;let prevSlashCmd=null;const mainAgentRequests=requests.filter(r=>isMainAgent(r));for(let ri=0;ri<mainAgentRequests.length;ri++){const req=mainAgentRequests[ri],messages=(null==(_a=req.body)?void 0:_a.messages)||[],timestamp=req.timestamp||"",{userMsgs:userMsgs,fullTexts:fullTexts,slashCmd:slashCmd}=_Mobile.extractUserTexts(messages);slashCmd&&"/compact"!==slashCmd&&slashCmd!==prevSlashCmd&&prompts.push({type:"prompt",segments:[{type:"text",content:slashCmd}],timestamp:timestamp}),prevSlashCmd=slashCmd;for(let i=0;i<userMsgs.length;i++){const key=userMsgs[i];if(seen.has(key))continue;seen.add(key);const raw=fullTexts[i]||key;prompts.push({type:"prompt",segments:_Mobile.parseSegments(raw),timestamp:timestamp})}}return prompts}renderOriginalPrompt(p){const textSegments=p.segments.filter(seg=>"text"===seg.type);return 0===textSegments.length?null:jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptCard,children:textSegments.map((seg,j)=>jsxRuntimeExports.jsx("pre",{className:styles$4.mobilePromptPreText,children:seg.content},j))})}render(){var _a,_b,_c,_d,_e,_f,_g;const{filteredRequests:filteredRequests,fileLoading:fileLoading,fileLoadingCount:fileLoadingCount,mainAgentSessions:mainAgentSessions}=this.renderPrepare();if(this.state.workspaceMode)return this.renderWorkspaceMode();const mobileIsLocalLog=!!this._isLocalLog;let mobileModelName=null;for(let i=filteredRequests.length-1;i>=0;i--){const effective=getEffectiveModel(filteredRequests[i]);if(isMainAgent(filteredRequests[i])&&effective){mobileModelName=effective;break}}let mobileContextPercent=0,mobileContextTokens=0;if(!mobileIsLocalLog){const contextWindow=this.state.contextWindow;let lastMainAgent=null;if(filteredRequests.length>0)for(let i=filteredRequests.length-1;i>=0;i--)if(isMainAgent(filteredRequests[i])&&(null==(_b=null==(_a=filteredRequests[i].response)?void 0:_a.body)?void 0:_b.usage)){lastMainAgent=filteredRequests[i];const u=lastMainAgent.response.body.usage;mobileContextTokens=(u.input_tokens||0)+(u.cache_creation_input_tokens||0)+(u.cache_read_input_tokens||0);break}if(null!=(null==contextWindow?void 0:contextWindow.used_percentage))mobileContextPercent=Math.min(100,Math.max(0,Math.round(contextWindow.used_percentage/AUTO_COMPACT_USABLE_RATIO)));else if(lastMainAgent){const usable=((null==contextWindow?void 0:contextWindow.context_window_size)||getModelMaxTokens(getEffectiveModel(lastMainAgent)||this.state.settingsModel))*AUTO_COMPACT_USABLE_RATIO;usable>0&&mobileContextTokens>0&&(mobileContextPercent=Math.min(100,Math.max(0,Math.round(mobileContextTokens/usable*100))))}this.state.contextBarLocked?(this._lastContextPercent=0,mobileContextPercent=0,mobileContextTokens=0):(0===mobileContextPercent&&this._lastContextPercent>0?mobileContextPercent=this._lastContextPercent:this._lastContextPercent=mobileContextPercent,this.state.contextBarOptimistic&&(mobileContextPercent=OPTIMISTIC_CLEAR_PERCENT))}const wsOpen=!mobileIsLocalLog&&!this.state.sdkMode;return jsxRuntimeExports.jsx(TerminalWsProvider,{open:wsOpen,children:jsxRuntimeExports.jsx(ApprovalModal,{enabled:isPad&&this.state.approvalPrefs.modalEnabled,soundEnabled:this.state.approvalPrefs.soundEnabled,voicePackPrefs:this.state.approvalPrefs.voicePack,approvalGlobal:this.state.approvalGlobal,dismissedIds:this.state.approvalDismissedIds,onDismiss:this.handleApprovalDismiss,onJumpTab:this.handleApprovalJumpTab,otherTabs:this.state.approvalOtherTabs,children:jsxRuntimeExports.jsx(ConfigProvider,{theme:this.themeConfig,children:jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIRoot,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[this.state.isDragging&&jsxRuntimeExports.jsx("div",{className:styles$4.dragOverlay,children:jsxRuntimeExports.jsxs("div",{className:styles$4.dragOverlayContent,children:[jsxRuntimeExports.jsx(RefIcon$1,{className:styles$4.dragIcon}),jsxRuntimeExports.jsx("p",{children:t("ui.dragDropHint")})]})}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeader,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeaderLeft,children:[jsxRuntimeExports.jsx("button",{className:styles$4.mobileMenuBtn,onClick:()=>this.setState(prev=>({mobileMenuVisible:!prev.mobileMenuVisible})),"aria-label":t("ui.mobileMenu"),"aria-expanded":this.state.mobileMenuVisible,"aria-haspopup":"menu",children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),mobileIsLocalLog?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Badge,{status:"processing",color:"green"}),jsxRuntimeExports.jsx("span",{className:styles$4.mobileCLIStatusLabel,children:t("ui.historyLog",{file:this._localLogFile})})]}):(()=>{const contextPercent=mobileContextPercent,ctxColor=contextPercent>=80?"var(--color-error-light)":contextPercent>=60?"var(--color-warning-light)":"var(--color-success)",ctxLabel=`${t("ui.liveMonitoring")}${this.state.projectName?`: ${this.state.projectName}`:""}`;return jsxRuntimeExports.jsxs("span",{className:styles$4.mobileCtxTag,style:{borderColor:ctxColor,color:ctxColor,cursor:"pointer"},title:ctxLabel,role:"button",tabIndex:0,"aria-label":t("ui.openCachePanel"),onClick:()=>this.setState(prev=>({...this._closeAllMobileOverlays(),mobileCachePanelVisible:!prev.mobileCachePanelVisible}),()=>this._onCachePanelOpenChange(this.state.mobileCachePanelVisible)),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.setState(prev=>({...this._closeAllMobileOverlays(),mobileCachePanelVisible:!prev.mobileCachePanelVisible}),()=>this._onCachePanelOpenChange(this.state.mobileCachePanelVisible)))},children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileCtxTagFill,style:{width:`${contextPercent}%`,backgroundColor:ctxColor}}),jsxRuntimeExports.jsx("span",{className:styles$4.mobileCtxTagContent,children:jsxRuntimeExports.jsx(MobileCtxLabelText,{projectName:this.state.projectName})})]})})()]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeaderRight,children:[mobileIsLocalLog?jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsx(RefIcon,{}),onClick:()=>history.back(),className:styles$4.mobileNavBtn,children:t("ui.mobileGoBack")}):this.state.hasGit?jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsx(RefIcon$2,{}),onClick:()=>this.setState(prev=>({...this._closeAllMobileOverlays(),mobileGitDiffVisible:!prev.mobileGitDiffVisible})),style:{color:this.state.mobileGitDiffVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileGitDiffVisible?t("ui.mobileGitDiffExit"):t("ui.mobileGitDiffBrowse")}):null,!mobileIsLocalLog&&jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"4 17 10 11 4 5"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),onClick:()=>this.setState(prev=>({...this._closeAllMobileOverlays(),mobileTerminalVisible:!prev.mobileTerminalVisible})),style:{color:this.state.mobileTerminalVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileTerminalVisible?t("ui.mobileTerminalExit"):t("ui.mobileTerminalBrowse")})]}),this.state.mobileMenuVisible&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileMenuOverlay,onClick:()=>this.setState({mobileMenuVisible:!1})}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileMenuDropdown,children:[!mobileIsLocalLog&&jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),mobileFileExplorerVisible:!0})},children:[jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),t("ui.projectFolder")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),mobileLogMgmtVisible:!0}),this.handleImportLocalLogs()},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),t("ui.logManagement")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),mobilePromptVisible:!0})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"12",x2:"9",y2:"15"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"12",x2:"15",y2:"15"})]}),t("ui.userPrompt")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),pluginModalVisible:!0})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"9",y:"2",width:"6",height:"6",rx:"1"}),jsxRuntimeExports.jsx("rect",{x:"2",y:"9",width:"6",height:"6",rx:"1"}),jsxRuntimeExports.jsx("rect",{x:"16",y:"9",width:"6",height:"6",rx:"1"}),jsxRuntimeExports.jsx("rect",{x:"9",y:"16",width:"6",height:"6",rx:"1"})]}),t("ui.pluginManagement")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),processModalVisible:!0})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2v4"}),jsxRuntimeExports.jsx("path",{d:"M12 18v4"}),jsxRuntimeExports.jsx("path",{d:"m4.93 4.93 2.83 2.83"}),jsxRuntimeExports.jsx("path",{d:"m16.24 16.24 2.83 2.83"}),jsxRuntimeExports.jsx("path",{d:"M2 12h4"}),jsxRuntimeExports.jsx("path",{d:"M18 12h4"}),jsxRuntimeExports.jsx("path",{d:"m4.93 19.07 2.83-2.83"}),jsxRuntimeExports.jsx("path",{d:"m16.24 7.76 2.83-2.83"})]}),t("ui.processManagement")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),proxyModalVisible:!0})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"17 1 21 5 17 9"}),jsxRuntimeExports.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),jsxRuntimeExports.jsx("polyline",{points:"7 23 3 19 7 15"}),jsxRuntimeExports.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]}),t("ui.proxySwitch")]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileMenuDivider}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),mobileStatsVisible:!0})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"3",y:"14",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"14",y:"14",width:"7",height:"7"})]}),t("ui.tokenStats")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({...this._closeAllMobileOverlays(),mobileSettingsVisible:!0})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),t("ui.settings")]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIBody,children:[!mobileIsLocalLog&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[fileLoading&&jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLoadingOverlay,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileLoadingSpinner}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLoadingLabel,children:[t("ui.loadingChat"),fileLoadingCount>0?` (${fileLoadingCount})`:""]})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileChatInner,children:jsxRuntimeExports.jsx(ChatView,{...this._settingsProps(),requests:filteredRequests,mainAgentSessions:mainAgentSessions,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:null,scrollToTimestamp:null,onScrollTsDone:()=>{},cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.mobileTerminalVisible,mobileChatVisible:!0,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:sid=>this.loadSession(sid),onPendingPermission:this.handlePendingPermission,onPendingPlanApproval:this.handlePendingPlanApproval,onPendingAsk:this.handleApprovalAsk,onPendingPtyPlan:this.handleApprovalPtyPlan,ownTabId:this.state.ownTabId,projectName:this.state.projectName,suppressInlineApprovalPanels:!0,pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,onMobileOpenFile:this._handleMobileOpenFile,onClearContextOptimistic:this.handleClearContextOptimistic,onUserMessageSent:this.handleUserMessageSent})})]}),!mobileIsLocalLog&&jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileChatOverlay} ${this.state.mobileTerminalVisible?styles$4.mobileChatOverlayVisible:""}`,children:jsxRuntimeExports.jsx(TerminalPanel,{...this._settingsProps(),modelName:mobileModelName,onFilePath:this._handleTerminalFilePath,pendingImages:this.state.terminalPendingImages,onRemovePendingImage:this._handleRemoveTerminalImage,onClearPendingImages:this._handleClearTerminalImages,onClearContextOptimistic:this.handleClearContextOptimistic})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileGitDiffOverlay} ${this.state.mobileGitDiffVisible?styles$4.mobileGitDiffOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileGitDiffInner,children:jsxRuntimeExports.jsx(MobileGitDiff,{visible:this.state.mobileGitDiffVisible,onClose:()=>this.setState({mobileGitDiffVisible:!1})})})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileCachePanelOverlay} ${this.state.mobileCachePanelVisible?styles$4.mobileCachePanelOverlayVisible:""}`,children:jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCachePanelInner,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCachePanelHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileCachePanelTitle,children:t("ui.contextManagement")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileCachePanelClose,onClick:()=>this.setState({mobileCachePanelVisible:!1},()=>this._onCachePanelOpenChange(!1)),"aria-label":t("ui.closeCachePanel"),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileCachePanelBody,children:this.state.mobileCachePanelVisible&&jsxRuntimeExports.jsx(CachePopoverContent,{requests:filteredRequests,serverCachedContent:this.state.serverCachedContent,contextPercent:mobileContextPercent,contextTokens:mobileContextTokens,fsSkills:this.state._fsSkills,onSkillImported:this.reloadFsSkills,onOpenSkillsModal:this.handleOpenSkillsModal,memory:this.state._memory,memoryRefreshing:this.state._memoryRefreshing,claudeMd:this.state._claudeMd,calibrationModel:this.state.calibrationModel,onCalibrationModelChange:this.handleCalibrationModelChange,onOpenMemoryDetail:this.loadMemoryDetail,onOpenClaudeMd:this.loadClaudeMdDetail,onRefreshMemory:this.handleRefreshMemory})})]})}),jsxRuntimeExports.jsx(MemoryDetailModal,{detail:this.state._memoryDetail,onClose:()=>this.setState({_memoryDetail:null}),onOpenMemoryDetail:this.loadMemoryDetail}),jsxRuntimeExports.jsx(MemoryDetailModal,{detail:this.state._claudeMdDetail,onClose:()=>this.setState({_claudeMdDetail:null}),linkMode:"passthrough"}),jsxRuntimeExports.jsx(SkillsManagerModal,{open:(null==(_c=this.state._skillsModal)?void 0:_c.open)||!1,loading:(null==(_d=this.state._skillsModal)?void 0:_d.loading)||!1,error:(null==(_e=this.state._skillsModal)?void 0:_e.error)||null,skills:(null==(_f=this.state._skillsModal)?void 0:_f.skills)||[],toggling:null==(_g=this.state._skillsModal)?void 0:_g.toggling,onToggle:s=>this.handleToggleSkill(s),onClose:()=>this.setState(prev=>({_skillsModal:{...prev._skillsModal,open:!1}}))}),jsxRuntimeExports.jsx(PluginModal,{open:this.state.pluginModalVisible,onClose:()=>this.setState({pluginModalVisible:!1})}),jsxRuntimeExports.jsx(ProcessModal,{open:this.state.processModalVisible,onClose:()=>this.setState({processModalVisible:!1})}),jsxRuntimeExports.jsx(ProxyModal,{open:this.state.proxyModalVisible,onClose:()=>this.setState({proxyModalVisible:!1}),proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileFileExplorerOverlay} ${this.state.mobileFileExplorerVisible?styles$4.mobileFileExplorerOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileFileExplorerInner,children:jsxRuntimeExports.jsx(MobileFileExplorer,{visible:this.state.mobileFileExplorerVisible,onClose:()=>this.setState({mobileFileExplorerVisible:!1,mobileFileExplorerTarget:null}),targetFile:this.state.mobileFileExplorerTarget,projectName:this.state.projectName})})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileStatsOverlay} ${this.state.mobileStatsVisible?styles$4.mobileStatsOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileStatsInner,children:jsxRuntimeExports.jsx(MobileStats,{requests:filteredRequests,visible:this.state.mobileStatsVisible,onClose:()=>this.setState({mobileStatsVisible:!1})})})}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobileLogMgmtOverlay} ${this.state.mobileLogMgmtVisible?styles$4.mobileLogMgmtOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsxs("span",{className:styles$4.mobileLogMgmtTitle,children:[jsxRuntimeExports.jsx(OpenFolderIcon,{apiEndpoint:apiUrl("/api/open-log-dir"),title:t("ui.openLogDir"),size:14}),t("ui.importLocalLogs")]}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobileLogMgmtVisible:!1,selectedLogs:new Set}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtActions,children:[jsxRuntimeExports.jsx(Button,{size:"small",type:this.state.selectedLogs.size>=2&&![...this.state.selectedLogs].some(f=>f.endsWith(".jsonl.zip"))?"primary":"default",disabled:this.state.selectedLogs.size<2||[...this.state.selectedLogs].some(f=>f.endsWith(".jsonl.zip")),onClick:this.handleMergeLogs,style:this.state.selectedLogs.size<2||[...this.state.selectedLogs].some(f=>f.endsWith(".jsonl.zip"))?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:void 0,children:t("ui.mergeLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$3,{}),disabled:![...this.state.selectedLogs].some(f=>f.endsWith(".jsonl")),onClick:this.handleArchiveLogs,style:[...this.state.selectedLogs].some(f=>f.endsWith(".jsonl"))?void 0:{color:"var(--text-muted)",borderColor:"var(--border-light)"},children:t("ui.archiveLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$4,{}),disabled:0===this.state.selectedLogs.size,onClick:this.handleDeleteLogs,style:0===this.state.selectedLogs.size?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:{color:"var(--color-error-light)",borderColor:"var(--color-error-light)"},children:t("ui.deleteLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$5,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,children:t("ui.refreshStats")})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileLogMgmtBody,children:this.state.localLogsLoading?jsxRuntimeExports.jsx("div",{className:styles$4.spinCenter,children:jsxRuntimeExports.jsx(Spin,{})}):(()=>{const currentLogs=this.state.localLogs[this.state.currentProject];return currentLogs&&0!==currentLogs.length?jsxRuntimeExports.jsx("div",{className:styles$4.logListContainer,children:this.renderLogTable(currentLogs,!0)}):jsxRuntimeExports.jsx("div",{className:styles$4.emptyCenter,children:t("ui.noLogs")})})()})]}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobileSettingsOverlay} ${this.state.mobileSettingsVisible?styles$4.mobileSettingsOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileLogMgmtTitle,children:t("ui.settings")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobileSettingsVisible:!1}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsBody,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsGroup,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.chatDisplay")}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.permission.autoApprove.setting")}),jsxRuntimeExports.jsx(Select,{size:"small",value:this.state.autoApproveSeconds||0,onChange:this.handleAutoApproveChange,options:[{label:t("ui.permission.autoApprove.off"),value:0},{label:"3s",value:3},{label:"5s",value:5},{label:"10s",value:10},{label:"15s",value:15},{label:"20s",value:20},{label:"30s",value:30},{label:"60s",value:60}],style:{width:100}})]}),isPad&&this.state.approvalPrefs&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.approval.settings.modalEnabled")}),jsxRuntimeExports.jsx(Switch,{checked:!1!==this.state.approvalPrefs.modalEnabled,onChange:checked=>this.handleApprovalPrefsChange({modalEnabled:checked})})]}),"undefined"!=typeof window&&window.tabBridge&&jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.approval.settings.notifyOnlyWhenHidden")}),jsxRuntimeExports.jsx(Switch,{checked:!1!==this.state.approvalPrefs.notifyOnlyWhenHidden,onChange:checked=>this.handleApprovalPrefsChange({notifyOnlyWhenHidden:checked})})]})]}),this.state.approvalPrefs&&jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.approval.settings.soundEnabled")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.approvalPrefs.soundEnabled,onChange:checked=>this.handleApprovalSoundToggle(checked)})]}),this.state.approvalPrefs&&this.state.approvalPrefs.soundEnabled&&jsxRuntimeExports.jsx(VoicePackSettings,{prefs:this.state.approvalPrefs.voicePack,onChange:this.handleVoicePackChange,embedded:!0}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.expandThinking")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.expandThinking,onChange:this.handleExpandThinkingChange})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.showFullToolContent")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.showFullToolContent,onChange:this.handleShowFullToolContentChange})]}),this.state.showFullToolContent&&jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.collapseToolResults")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.collapseToolResults,onChange:this.handleCollapseToolResultsChange})]})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsGroup,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.logSettings")}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.resumeAutoChoice")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.resumeAutoChoice,onChange:this.handleResumeAutoChoiceToggle})]}),this.state.resumeAutoChoice&&jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsRow,children:jsxRuntimeExports.jsxs(Radio.Group,{value:this.state.resumeAutoChoice,onChange:e=>this.handleResumeAutoChoiceChange(e.target.value),size:"small",children:[jsxRuntimeExports.jsx(Radio,{value:"continue",children:t("ui.resumeAutoChoice.continue")}),jsxRuntimeExports.jsx(Radio,{value:"new",children:t("ui.resumeAutoChoice.new")})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsGroup,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.themeStyle")}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.themeColor")}),jsxRuntimeExports.jsx(Select,{size:"small",value:this.state.themeColor||"light",onChange:this.handleThemeColorChange,options:[{label:t("ui.themeColor.dark"),value:"dark"},{label:t("ui.themeColor.light"),value:"light"}],style:{width:140}})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.languageSettings")}),jsxRuntimeExports.jsx(Select,{size:"small",value:getLang(),onChange:value=>{setLang(value),this.handleLangChange()},options:LANG_OPTIONS.map(o=>({label:o.label,value:o.value})),style:{width:140}})]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobilePromptOverlay} ${this.state.mobilePromptVisible?styles$4.mobilePromptOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileLogMgmtTitle,children:t("ui.userPrompt")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobilePromptVisible:!1}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptBody,children:(()=>{const prompts=this.extractUserPrompts(filteredRequests);return 0===prompts.length?jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptEmpty,children:t("ui.noPrompt")}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobilePromptHeader,children:[jsxRuntimeExports.jsxs("span",{className:styles$4.mobilePromptCount,children:[prompts.length," ",t("ui.promptCountUnit")]}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$6,{}),onClick:()=>this.handleExportPromptsTxt(prompts),children:t("ui.exportPromptsTxt")})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptList,children:prompts.map((p,i)=>jsxRuntimeExports.jsxs("div",{className:styles$4.mobilePromptItem,children:[p.timestamp&&jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptTimestamp,children:new Date(p.timestamp).toLocaleString()}),this.renderOriginalPrompt(p)]},i))})]})})()})]})]}),this.state.globalPermission&&jsxRuntimeExports.jsx(ToolApprovalPanel,{toolName:this.state.globalPermission.permission.toolName,toolInput:this.state.globalPermission.permission.input,requestId:this.state.globalPermission.permission.id,onAllow:this.state.globalPermission.handlers.allow,onAllowSession:this.state.globalPermission.handlers.allowSession,onDeny:this.state.globalPermission.handlers.deny,visible:!0,global:!0,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,modelName:this.state.globalPermission.modelName}),this.state.globalPlanApproval&&jsxRuntimeExports.jsx(ToolApprovalPanel,{toolName:"ExitPlanMode",toolInput:this.state.globalPlanApproval.plan.input,requestId:this.state.globalPlanApproval.plan.id,onAllow:this.state.globalPlanApproval.handlers.approve,onDeny:id=>this.state.globalPlanApproval.handlers.reject(id,""),visible:!0,global:!0})]})})})})}};__publicField(_Mobile,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Mobile=_Mobile;export{Mobile as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aW as isObjectLike,bj as baseGetTag,aG as isArray,aU as Symbol$1,aF as isArrayLike,bk as arrayLikeKeys,bl as baseKeys,bm as memoize,bn as isArguments,bo as MapCache,bp as eq,bq as Uint8Array,aX as getTag,b0 as isBuffer,b3 as Stack,br as isTypedArray,a_ as isObject,bs as isLength,bt as isIndex,aH as identity,bu as baseFor,bv as Set}from"./mermaid.core-1heNIJ5f.js";function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+-1;++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIsNaN(value){return value!=value}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&function(array,value,fromIndex){return value==value?function(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}(array,value,0)>-1}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}var func,result,cache,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=(func=function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result},result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache,result);function toString(value){return null==value?"":baseToString(value)}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];predicate(value)?arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function stubArray(){return[]}var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function cacheHas(cache,key){return cache.has(key)}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$1=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}function baseMatches(source){var matchData=function(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||function(object,source,matchData,customizer){var index=matchData.length,length=index;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(data[2]){if(void 0===objValue&&!(key in object))return!1}else if(!baseIsEqual(srcValue,objValue,3,customizer,new Stack))return!1}return!0}(object,0,matchData)}}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=function(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}(object,path);return void 0===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function property(path){return isKey(path)?(key=toKey(path),function(object){return null==object?void 0:object[key]}):function(path){return function(object){return baseGet(object,path)}}(path);var key}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}var eachFunc,baseEach=(eachFunc=baseForOwn,function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=-1,iterable=Object(collection);++index<length&&!1!==iteratee(iterable[index],index,iterable););return collection});function castFunction(value){return"function"==typeof value?value:identity}function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,castFunction(iteratee))}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection2){predicate(value,index,collection2)&&result.push(value)}),result}function filter(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,baseIteratee(predicate))}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,function(value,index,collection2){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection2)}),accumulator}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee),accumulator,initAccum,baseEach)}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:function(){};function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(length>=200){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}export{baseEach as a,baseFlatten as b,baseIteratee as c,arrayMap as d,arrayPush as e,baseGetAllKeys as f,getSymbols as g,arrayEach as h,isSymbol as i,getAllKeys as j,keys as k,baseUniq as l,filter as m,forEach as n,baseFindIndex as o,castFunction as p,baseForOwn as q,reduce as r,stubArray as s,hasPath as t,castPath as u,toKey as v,baseGet as w,hasIn as x,toString as y};
|
|
1
|
+
import{aW as isObjectLike,bj as baseGetTag,aG as isArray,aU as Symbol$1,aF as isArrayLike,bk as arrayLikeKeys,bl as baseKeys,bm as memoize,bn as isArguments,bo as MapCache,bp as eq,bq as Uint8Array,aX as getTag,b0 as isBuffer,b3 as Stack,br as isTypedArray,a_ as isObject,bs as isLength,bt as isIndex,aH as identity,bu as baseFor,bv as Set}from"./mermaid.core-YmJi7T-s.js";function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+-1;++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIsNaN(value){return value!=value}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&function(array,value,fromIndex){return value==value?function(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}(array,value,0)>-1}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}var func,result,cache,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=(func=function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result},result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache,result);function toString(value){return null==value?"":baseToString(value)}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];predicate(value)?arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function stubArray(){return[]}var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function cacheHas(cache,key){return cache.has(key)}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$1=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}function baseMatches(source){var matchData=function(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||function(object,source,matchData,customizer){var index=matchData.length,length=index;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(data[2]){if(void 0===objValue&&!(key in object))return!1}else if(!baseIsEqual(srcValue,objValue,3,customizer,new Stack))return!1}return!0}(object,0,matchData)}}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=function(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}(object,path);return void 0===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function property(path){return isKey(path)?(key=toKey(path),function(object){return null==object?void 0:object[key]}):function(path){return function(object){return baseGet(object,path)}}(path);var key}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}var eachFunc,baseEach=(eachFunc=baseForOwn,function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=-1,iterable=Object(collection);++index<length&&!1!==iteratee(iterable[index],index,iterable););return collection});function castFunction(value){return"function"==typeof value?value:identity}function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,castFunction(iteratee))}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection2){predicate(value,index,collection2)&&result.push(value)}),result}function filter(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,baseIteratee(predicate))}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,function(value,index,collection2){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection2)}),accumulator}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee),accumulator,initAccum,baseEach)}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:function(){};function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(length>=200){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}export{baseEach as a,baseFlatten as b,baseIteratee as c,arrayMap as d,arrayPush as e,baseGetAllKeys as f,getSymbols as g,arrayEach as h,isSymbol as i,getAllKeys as j,keys as k,baseUniq as l,filter as m,forEach as n,baseFindIndex as o,castFunction as p,baseForOwn as q,reduce as r,stubArray as s,hasPath as t,castPath as u,toKey as v,baseGet as w,hasIn as x,toString as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as withPath,a0 as pi,a1 as cos,a2 as sin,a3 as constant,a4 as halfPi,a5 as epsilon,a6 as tau,a7 as sqrt,a8 as min,a9 as abs,aa as atan2,ab as max,ac as asin,ad as acos}from"./mermaid.core-
|
|
1
|
+
import{$ as withPath,a0 as pi,a1 as cos,a2 as sin,a3 as constant,a4 as halfPi,a5 as epsilon,a6 as tau,a7 as sqrt,a8 as min,a9 as abs,aa as atan2,ab as max,ac as asin,ad as acos}from"./mermaid.core-YmJi7T-s.js";function arcInnerRadius(d){return d.innerRadius}function arcOuterRadius(d){return d.outerRadius}function arcStartAngle(d){return d.startAngle}function arcEndAngle(d){return d.endAngle}function arcPadAngle(d){return d&&d.padAngle}function cornerTangents(x0,y0,x1,y1,r1,rc,cw){var x01=x0-x1,y01=y0-y1,lo=(cw?rc:-rc)/sqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=r1-rc,D=x11*y10-x10*y11,d=(dy<0?-1:1)*sqrt(max(0,r*r*d2-D*D)),cx0=(D*dy-dx*d)/d2,cy0=(-D*dx-dy*d)/d2,cx1=(D*dy+dx*d)/d2,cy1=(-D*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x01:-ox,y01:-oy,x11:cx0*(r1/r-1),y11:cy0*(r1/r-1)}}function d3arc(){var innerRadius=arcInnerRadius,outerRadius=arcOuterRadius,cornerRadius=constant(0),padRadius=null,startAngle=arcStartAngle,endAngle=arcEndAngle,padAngle=arcPadAngle,context=null,path=withPath(arc);function arc(){var buffer,r,r0=+innerRadius.apply(this,arguments),r1=+outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)-halfPi,a1=endAngle.apply(this,arguments)-halfPi,da=abs(a1-a0),cw=a1>a0;if(context||(context=buffer=path()),r1<r0&&(r=r1,r1=r0,r0=r),r1>epsilon)if(da>tau-epsilon)context.moveTo(r1*cos(a0),r1*sin(a0)),context.arc(0,0,r1,a0,a1,!cw),r0>epsilon&&(context.moveTo(r0*cos(a1),r0*sin(a1)),context.arc(0,0,r0,a1,a0,cw));else{var t0,t1,a01=a0,a11=a1,a00=a0,a10=a1,da0=da,da1=da,ap=padAngle.apply(this,arguments)/2,rp=ap>epsilon&&(padRadius?+padRadius.apply(this,arguments):sqrt(r0*r0+r1*r1)),rc=min(abs(r1-r0)/2,+cornerRadius.apply(this,arguments)),rc0=rc,rc1=rc;if(rp>epsilon){var p0=asin(rp/r0*sin(ap)),p1=asin(rp/r1*sin(ap));(da0-=2*p0)>epsilon?(a00+=p0*=cw?1:-1,a10-=p0):(da0=0,a00=a10=(a0+a1)/2),(da1-=2*p1)>epsilon?(a01+=p1*=cw?1:-1,a11-=p1):(da1=0,a01=a11=(a0+a1)/2)}var x01=r1*cos(a01),y01=r1*sin(a01),x10=r0*cos(a10),y10=r0*sin(a10);if(rc>epsilon){var oc,x11=r1*cos(a11),y11=r1*sin(a11),x00=r0*cos(a00),y00=r0*sin(a00);if(da<pi)if(oc=function(x0,y0,x1,y1,x2,y2,x3,y3){var x10=x1-x0,y10=y1-y0,x32=x3-x2,y32=y3-y2,t=y32*x10-x32*y10;if(!(t*t<epsilon))return[x0+(t=(x32*(y0-y2)-y32*(x0-x2))/t)*x10,y0+t*y10]}(x01,y01,x00,y00,x11,y11,x10,y10)){var ax=x01-oc[0],ay=y01-oc[1],bx=x11-oc[0],by=y11-oc[1],kc=1/sin(acos((ax*bx+ay*by)/(sqrt(ax*ax+ay*ay)*sqrt(bx*bx+by*by)))/2),lc=sqrt(oc[0]*oc[0]+oc[1]*oc[1]);rc0=min(rc,(r0-lc)/(kc-1)),rc1=min(rc,(r1-lc)/(kc+1))}else rc0=rc1=0}da1>epsilon?rc1>epsilon?(t0=cornerTangents(x00,y00,x01,y01,r1,rc1,cw),t1=cornerTangents(x11,y11,x10,y10,r1,rc1,cw),context.moveTo(t0.cx+t0.x01,t0.cy+t0.y01),rc1<rc?context.arc(t0.cx,t0.cy,rc1,atan2(t0.y01,t0.x01),atan2(t1.y01,t1.x01),!cw):(context.arc(t0.cx,t0.cy,rc1,atan2(t0.y01,t0.x01),atan2(t0.y11,t0.x11),!cw),context.arc(0,0,r1,atan2(t0.cy+t0.y11,t0.cx+t0.x11),atan2(t1.cy+t1.y11,t1.cx+t1.x11),!cw),context.arc(t1.cx,t1.cy,rc1,atan2(t1.y11,t1.x11),atan2(t1.y01,t1.x01),!cw))):(context.moveTo(x01,y01),context.arc(0,0,r1,a01,a11,!cw)):context.moveTo(x01,y01),r0>epsilon&&da0>epsilon?rc0>epsilon?(t0=cornerTangents(x10,y10,x11,y11,r0,-rc0,cw),t1=cornerTangents(x01,y01,x00,y00,r0,-rc0,cw),context.lineTo(t0.cx+t0.x01,t0.cy+t0.y01),rc0<rc?context.arc(t0.cx,t0.cy,rc0,atan2(t0.y01,t0.x01),atan2(t1.y01,t1.x01),!cw):(context.arc(t0.cx,t0.cy,rc0,atan2(t0.y01,t0.x01),atan2(t0.y11,t0.x11),!cw),context.arc(0,0,r0,atan2(t0.cy+t0.y11,t0.cx+t0.x11),atan2(t1.cy+t1.y11,t1.cx+t1.x11),cw),context.arc(t1.cx,t1.cy,rc0,atan2(t1.y11,t1.x11),atan2(t1.y01,t1.x01),!cw))):context.arc(0,0,r0,a10,a00,cw):context.lineTo(x10,y10)}else context.moveTo(0,0);if(context.closePath(),buffer)return context=null,buffer+""||null}return arc.centroid=function(){var r=(+innerRadius.apply(this,arguments)+ +outerRadius.apply(this,arguments))/2,a=(+startAngle.apply(this,arguments)+ +endAngle.apply(this,arguments))/2-pi/2;return[cos(a)*r,sin(a)*r]},arc.innerRadius=function(_){return arguments.length?(innerRadius="function"==typeof _?_:constant(+_),arc):innerRadius},arc.outerRadius=function(_){return arguments.length?(outerRadius="function"==typeof _?_:constant(+_),arc):outerRadius},arc.cornerRadius=function(_){return arguments.length?(cornerRadius="function"==typeof _?_:constant(+_),arc):cornerRadius},arc.padRadius=function(_){return arguments.length?(padRadius=null==_?null:"function"==typeof _?_:constant(+_),arc):padRadius},arc.startAngle=function(_){return arguments.length?(startAngle="function"==typeof _?_:constant(+_),arc):startAngle},arc.endAngle=function(_){return arguments.length?(endAngle="function"==typeof _?_:constant(+_),arc):endAngle},arc.padAngle=function(_){return arguments.length?(padAngle="function"==typeof _?_:constant(+_),arc):padAngle},arc.context=function(_){return arguments.length?(context=null==_?null:_,arc):context},arc}export{d3arc as d};
|