@doocs/md-cli 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,658 @@
1
+ import{_ as __vitePreload,h as highlightActiveLineGutter,a as highlightSpecialChars,b as history,f as foldGutter,d as drawSelection,c as dropCursor,E as EditorState,i as indentOnInput,s as syntaxHighlighting,e as bracketMatching,g as closeBrackets,j as autocompletion,r as rectangularSelection,k as crosshairCursor,l as highlightActiveLine,m as highlightSelectionMatches,n as keymap,o as closeBracketsKeymap,p as defaultKeymap,q as searchKeymap,t as historyKeymap,u as foldKeymap,v as completionKeymap,w as lintKeymap,x as acceptCompletion,y as indentWithTab,z as defaultHighlightStyle,A as css$1,B as EditorView,C as undo,D as redo,F as javascript$1,G as markdown$1,P as Prec,H as placeholder,I as languages,J as markdownLanguage,K as vsCodeDark,L as vsCodeLight,M as Compartment,S as StateEffect,N as StateField,O as Decoration}from"./md-codemirror-DdsxNVJV.js";import{Q as k,R as DOMPurify,U as defineComponent,V as ref,W as onMounted,X as createBlock,Y as openBlock,Z as withCtx,_ as createElementBlock,$ as createCommentVNode,a0 as unref,a1 as createBaseVNode,a2 as Transition,a3 as mergeProps,a4 as Toaster_default,a5 as deflateSync,a6 as cloneDeep,a7 as toMerged,a8 as frontMatter,a9 as readingTime,aa as axios,ab as B,ac as juice,ad as defineStore,ae as useDark,af as useStorage,ag as computed,ah as v4,ai as onBeforeUnmount,aj as onBeforeMount,ak as watch,al as reactive,am as markRaw,an as useToggle,ao as toast,ap as toPng,aq as storeToRefs,ar as toDisplayString,as as Se,at as renderSlot,au as normalizeProps,av as guardReactiveProps,aw as Tv,ax as twMerge,ay as clsx,az as createVNode,aA as kv,aB as Ov,aC as Av,aD as normalizeClass,aE as O,aF as cva,aG as Nv,aH as Mv,aI as Fv,aJ as Vv,aK as nu,aL as $u,aM as Pu,aN as Xl,aO as X,aP as Iv,aQ as reactiveOmit,aR as useForwardPropsEmits,aS as RadioGroupRoot_default,aT as Vh,aU as useForwardProps,aV as RadioGroupItem_default,aW as RadioGroupIndicator_default,aX as Circle,aY as useVModel,aZ as withDirectives,a_ as vModelText,a$ as isRef,b0 as useAttrs,b1 as vModelDynamic,b2 as Ot,b3 as Bu,b4 as toTypedSchema,b5 as create$3,b6 as create$6,b7 as createTextVNode,b8 as Form,b9 as Field,ba as toRaw,bb as gy,bc as Cy,bd as Plus,be as by,bf as wy,bg as Minus,bh as Fragment,bi as renderList,bj as Cg,bk as useLocalStorage,bl as useTemplateRef,bm as onUnmounted,bn as _g,bo as Ay,bp as normalizeStyle,bq as Ry,br as gg,bs as bg,bt as Ky,bu as Xy,bv as qy,bw as Yy,bx as Check,by as Jy,bz as tg,bA as ChevronDown,bB as eg,bC as ChevronUp,bD as Hy,bE as ng,bF as ag,bG as Wy,bH as jy,bI as Qy,bJ as wg,bK as xg,bL as create$7,bM as useFileDialog,bN as withModifiers,bO as CloudUpload,bP as Re,bQ as Iu,bR as vShow,bS as PenLine,bT as List,bU as throttle,bV as ArrowUpFromLine,bW as rm,bX as um,bY as dm,bZ as vm,b_ as fm,b$ as im,c0 as Rv,c1 as ap,c2 as uh,c3 as fh,c4 as ch,c5 as vh,c6 as dh,c7 as resolveComponent,c8 as ChevronRight,c9 as Ellipsis,ca as SquarePlus,cb as History,cc as Trash2,cd as Ch,ce as hh,cf as gh,cg as wh,ch as ou,ci as Hg,cj as Wg,ck as Ug,cl as qg,cm as jg,cn as withKeys,co as ArrowUpNarrowWide,cp as ChevronsDownUp,cq as ChevronsUpDown,cr as nextTick,cs as customRef,ct as Eye,cu as EyeOff,cv as Info,cw as Image,cx as Settings,cy as MessageCircle,cz as LoaderCircle,cA as Download,cB as Copy,cC as RefreshCcw,cD as vModelCheckbox,cE as Expand,cF as Sun,cG as Moon,cH as Wv,cI as jv,cJ as Gh,cK as Yh,cL as Xh,cM as qh,cN as Uh,cO as sy,cP as ry,cQ as ty,cR as ay,cS as iy,cT as toRefs,cU as Rh,cV as Oh,cW as kh,cX as Ah,cY as ey,cZ as Jh,c_ as Undo2,c$ as Redo2,d0 as Table,d1 as ContactRound,d2 as ClipboardPaste,d3 as Upload,d4 as FileCode,d5 as FileText,d6 as FileCog,d7 as Cs,d8 as Ss,d9 as _s,da as ws,db as useClipboard,dc as Menu,dd as SlidersHorizontal,de as Palette,df as SquarePen,dg as resolveDynamicComponent,dh as Pause,di as Send,dj as WandSparkles,dk as Settings2,dl as Bot,dm as GripVertical,dn as SplitterResizeHandle_default,dp as SplitterGroup_default,dq as Replace,dr as ReplaceAll,ds as useDebounceFn,dt as qiniu,du as Buffer,dv as COS,dw as OSS,dx as CryptoJS,dy as S3Client,dz as getSignedUrl,dA as PutObjectCommand,dB as upload,dC as SplitterPanel_default,dD as Pen,dE as imageCompression,dF as createApp,dG as createPinia}from"./md-vendor_.pnpm-DJpmxyQl.js";import{y as yaml,x as xml,w as wasm,v as vbnet,t as typescript,s as swift,b as sql,d as shell,e as scss,r as rust,f as ruby,h as r,p as pythonRepl,i as python,j as plaintext,k as phpTemplate,l as php,m as perl,o as objectivec,n as markdown,q as makefile,u as lua,z as less,A as kotlin,B as json,C as javascript,D as java,E as ini,F as graphql,G as go,H as diff,I as css,J as csharp,K as cpp,L as c,M as bash,N as HighlightJS}from"./md-hljs-DWhwSlIE.js";import{s as standaloneExports,p as parserPostcss,a as parserBabel,b as parserMarkdown}from"./md-prettier-gENWrage.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function o(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(n){if(n.ep)return;n.ep=!0;const s=o(n);fetch(n.href,s)}})();function ucfirst(t){return t.slice(0,1).toUpperCase()+t.slice(1).toLowerCase()}async function initializeMermaid(){typeof window<"u"&&window.mermaid?window.mermaid.initialize({startOnLoad:!1}):(await __vitePreload(()=>import("mermaid"),[])).default.initialize({startOnLoad:!1})}const COMMON_LANGUAGES={bash,c,cpp,csharp,css,diff,go,graphql,ini,java,javascript,json,kotlin,less,lua,makefile,markdown,objectivec,perl,php,"php-template":phpTemplate,plaintext,python,"python-repl":pythonRepl,r,ruby,rust,scss,shell,sql,swift,typescript,vbnet,wasm,xml,yaml},HLJS_VERSION="11.11.1",HLJS_CDN_BASE=`https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/highlightjs/${HLJS_VERSION}`,loadingLanguages=new Map;function grammarUrlFor(t){return`${HLJS_CDN_BASE}/es/languages/${t}.min.js`}async function loadAndRegisterLanguage(t,e){if(e.getLanguage(t))return;if(loadingLanguages.has(t)){await loadingLanguages.get(t);return}const o=(async()=>{try{const a=await import(grammarUrlFor(t));e.registerLanguage(t,a.default)}catch(a){throw console.warn(`Failed to load language: ${t}`,a),a}finally{loadingLanguages.delete(t)}})();loadingLanguages.set(t,o),await o}function formatHighlightedCode(t,e=!1){let o=t;return o=o.replace(/(<span[^>]*>[^<]*<\/span>)(\s+)(<span[^>]*>[^<]*<\/span>)/g,(a,n,s,l)=>n+l.replace(/^(<span[^>]*>)/,`$1${s}`)),o=o.replace(/(\s+)(<span[^>]*>)/g,(a,n,s)=>s.replace(/^(<span[^>]*>)/,`$1${n}`)),o=o.replace(/\t/g," "),e?o=o.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>").replace(/(>[^<]+)|(^[^<]+)/g,a=>a.replace(/\s/g,"&nbsp;")):o=o.replace(/(>[^<]+)|(^[^<]+)/g,a=>a.replace(/\s/g,"&nbsp;")),o}function highlightAndFormatCode(t,e,o,a){let n="";if(a){const l=t.replace(/\r\n/g,`
2
+ `).split(`
3
+ `).map(p=>{const C=o.highlight(p,{language:e}).value,h=formatHighlightedCode(C,!1);return h===""?"&nbsp;":h}),d=l.map((p,C)=>`<section style="padding:0 10px 0 0;line-height:1.75">${C+1}</section>`).join(""),m=`<div style="white-space:pre;min-width:max-content;line-height:1.75">${l.join("<br/>")}</div>`;n=`
4
+ <section style="display:flex;align-items:flex-start;overflow-x:hidden;overflow-y:auto;width:100%;max-width:100%;padding:0;box-sizing:border-box">
5
+ <section class="line-numbers" style="text-align:right;padding:8px 0;border-right:1px solid rgba(0,0,0,0.04);user-select:none;background:var(--code-bg,transparent);">${d}</section>
6
+ <section class="code-scroll" style="flex:1 1 auto;overflow-x:auto;overflow-y:visible;padding:8px;min-width:0;box-sizing:border-box">${m}</section>
7
+ </section>
8
+ `}else{const s=o.highlight(t,{language:e}).value;n=formatHighlightedCode(s,!0)}return n}function highlightCodeBlock(t,e,o){const a=t.getAttribute("data-raw-code"),n=t.getAttribute("data-show-line-number")==="true";if(!a)return;const s=a.replace(/&quot;/g,'"'),l=highlightAndFormatCode(s,e,o,n);t.innerHTML=l,t.removeAttribute("data-language-pending"),t.removeAttribute("data-raw-code"),t.removeAttribute("data-show-line-number")}function highlightPendingBlocks(t,e=document){e.querySelectorAll("code[data-language-pending]").forEach(a=>{const n=a.getAttribute("data-language-pending");n&&(t.getLanguage(n)?highlightCodeBlock(a,n,t):loadAndRegisterLanguage(n,t).then(()=>{highlightCodeBlock(a,n,t)}).catch(()=>{a.removeAttribute("data-language-pending"),a.removeAttribute("data-raw-code"),a.removeAttribute("data-show-line-number")}))})}function renderMarkdown(t,e){const{markdownContent:o,readingTime:a}=e.parseFrontMatterAndContent(t);let n=k.parse(o);return n=DOMPurify.sanitize(n,{ADD_TAGS:["mp-common-profile"]}),{html:n,readingTime:a}}function postProcessHtml(t,e,o){let a=t;return a=o.buildReadingTime(e)+a,a=a.replace(/(style=".*?)"/,'$1;margin-top: 0"'),a+=o.buildFootnotes(),a+=o.buildAddition(),a+=`
9
+ <style>
10
+ .hljs.code__pre > .mac-sign {
11
+ display: ${o.getOpts().isMacCodeBlock?"flex":"none"};
12
+ }
13
+ </style>
14
+ `,a+=`
15
+ <style>
16
+ .code__pre {
17
+ padding: 0 !important;
18
+ }
19
+
20
+ .hljs.code__pre code {
21
+ display: -webkit-box;
22
+ padding: 0.5em 1em 1em;
23
+ overflow-x: auto;
24
+ text-indent: 0;
25
+ }
26
+ h2 strong {
27
+ color: inherit !important;
28
+ }
29
+ </style>
30
+ `,o.createContainer(a)}function customizeTheme(t,e){const o=JSON.parse(JSON.stringify(t)),{fontSize:a,color:n}=e;if(a)for(let s=1;s<=6;s++){const l=o.block[`h${s}`]["font-size"];o.block[`h${s}`]["font-size"]=`${a*Number.parseFloat(l)}px`}return n&&(o.base["--md-primary-color"]=n),o}function customCssWithTemplate(t,e,o){const a=customizeTheme(o,{color:e}),n=(d,u,m)=>{m.forEach(i=>{u[i]&&(d[i]=Object.assign(d[i]||{},u[i]))})},s=["container","h1","h2","h3","h4","h5","h6","code","code_pre","p","hr","blockquote","blockquote_note","blockquote_tip","blockquote_important","blockquote_warning","blockquote_caution","blockquote_p","blockquote_p_note","blockquote_p_tip","blockquote_p_important","blockquote_p_warning","blockquote_p_caution","blockquote_title","blockquote_title_note","blockquote_title_tip","blockquote_title_important","blockquote_title_warning","blockquote_title_caution","image","ul","ol","block_katex"],l=["listitem","codespan","link","wx_link","strong","table","thead","th","td","footnote","figcaption","em","inline_katex"];return n(a.block,t,s),n(a.inline,t,l),a}function getStyleString(t){return Object.entries(t??{}).map(([e,o])=>`${e}: ${o}`).join("; ")}const _hoisted_1$w={key:0,class:"loading"},_sfc_main$1U=defineComponent({__name:"AppSplash",setup(t){const e=ref(!0);return onMounted(()=>{setTimeout(()=>{e.value=!1},100)}),(o,a)=>(openBlock(),createBlock(Transition,{name:"fade"},{default:withCtx(()=>[unref(e)?(openBlock(),createElementBlock("div",_hoisted_1$w,[...a[0]||(a[0]=[createBaseVNode("strong",null,"致力于让 Markdown 编辑更简单",-1)])])):createCommentVNode("",!0)]),_:1}))}}),_export_sfc=(t,e)=>{const o=t.__vccOpts||t;for(const[a,n]of e)o[a]=n;return o},__unplugin_components_0$1=_export_sfc(_sfc_main$1U,[["__scopeId","data-v-8d32b142"]]),_sfc_main$1T=defineComponent({__name:"Sonner",props:{id:{},invert:{type:Boolean},theme:{},position:{},closeButtonPosition:{},hotkey:{},richColors:{type:Boolean},expand:{type:Boolean},duration:{},gap:{},visibleToasts:{},closeButton:{type:Boolean},toastOptions:{},class:{},style:{},offset:{},mobileOffset:{},dir:{},swipeDirections:{},icons:{},containerAriaLabel:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Toaster_default),mergeProps({class:"toaster group"},e),null,16))}});function markedAlert(t={}){const{className:e="markdown-alert",variants:o=[],withoutStyle:a=!1}=t,n=resolveVariants(o);function s(d,u,m=!1){const{styles:i}=t;return{className:e,variant:d,icon:u.icon,title:u.title??ucfirst(d),titleClassName:`${e}-title`,fromContainer:m,wrapperStyle:{...i?.blockquote,...i?.[`blockquote_${d}`]},titleStyle:{...i?.blockquote_title,...i?.[`blockquote_title_${d}`]},contentStyle:{...i?.blockquote_p,...i?.[`blockquote_p_${d}`]}}}function l(d){const{meta:u,tokens:m=[]}=d;let i=this.parser.parse(m);i=i.replace(/<p .*?>/g,`<p style="${getStyleString(u.contentStyle)}">`);let p=`<blockquote class="${u.className} ${u.className}-${u.variant}" style="${getStyleString(u.wrapperStyle)}">
31
+ `;return p+=`<p class="${u.titleClassName}" style="${getStyleString(u.titleStyle)}">`,a||(p+=u.icon.replace("<svg",`<svg style="fill: ${u.titleStyle?.color??"inherit"}"`)),p+=u.title,p+=`</p>
32
+ `,p+=i,p+=`</blockquote>
33
+ `,p}return{walkTokens(d){if(d.type!=="blockquote")return;const u=n.find(({type:m})=>new RegExp(createSyntaxPattern(m),"i").test(d.text));if(u){const{type:m}=u,i=new RegExp(createSyntaxPattern(m),"i");Object.assign(d,{type:"alert",meta:s(m,u)});const p=d.tokens?.[0];if(p.raw?.replace(i,"").trim()){const h=p.tokens[0];Object.assign(h,{raw:h.raw.replace(i,""),text:h.text.replace(i,"")}),p.tokens[1]?.type==="br"&&p.tokens.splice(1,1)}else d.tokens?.shift()}},extensions:[{name:"alert",level:"block",renderer:l},{name:"alertContainer",level:"block",start(d){return d.match(/^:::/)?.index},tokenizer(d,u){const m=/^:::\s*(\w+)\s*\n([\s\S]*?)\n:::/.exec(d);if(m){const[i,p,C]=m,h=n.find(T=>T.type===p);return h?{type:"alert",raw:i,text:C.trim(),tokens:this.lexer.blockTokens(C.trim()),meta:s(p,h,!0)}:void 0}},renderer:l}]}}const defaultAlertVariant=[{type:"note",icon:'<svg class="octicon octicon-info" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'},{type:"info",icon:'<svg class="octicon octicon-info" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'},{type:"tip",icon:'<svg class="octicon octicon-light-bulb" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>'},{type:"important",icon:'<svg class="octicon octicon-report" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>'},{type:"warning",icon:'<svg class="octicon octicon-alert" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>'},{type:"caution",icon:'<svg class="octicon octicon-stop" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'}];function resolveVariants(t){return t.length?Object.values([...defaultAlertVariant,...t].reduce((e,o)=>(e[o.type]=o,e),{})):defaultAlertVariant}function createSyntaxPattern(t){return`^(?:\\[!${t}])\\s*?
34
+ *`}const fnMap=new Map;function markedFootnotes(){return{extensions:[{name:"footnoteDef",level:"block",start(t){return fnMap.clear(),t.match(/^\[\^/)?.index},tokenizer(t){const e=t.match(/^\[\^(.*)\]:(.*)/);if(e){const[o,a,n]=e,s=fnMap.size+1;return fnMap.set(a,{index:s,text:n}),{type:"footnoteDef",raw:o,fnId:a,index:s,text:n}}},renderer(t){const{index:e,text:o,fnId:a}=t,n=`
35
+ <code>${e}.</code>
36
+ <span>${o}</span>
37
+ <a id="fnDef-${a}" href="#fnRef-${a}" style="color: var(--md-primary-color);">↩︎</a>
38
+ <br>`;return e===1?`
39
+ <p style="font-size: 80%;margin: 0.5em 8px;word-break:break-all;">${n}`:e===fnMap.size?`${n}</p>`:n}},{name:"footnoteRef",level:"inline",start(t){return t.match(/\[\^/)?.index},tokenizer(t){const e=t.match(/^\[\^(.*?)\]/);if(e){const[o,a]=e;if(fnMap.has(a))return{type:"footnoteRef",raw:o,fnId:a}}},renderer(t){const{fnId:e}=t,{index:o}=fnMap.get(e);return`<sup style="color: var(--md-primary-color);">
40
+ <a href="#fnDef-${e}" id="fnRef-${e}">[${o}]</a>
41
+ </sup>`}}]}}const inlineRule=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:?!。,:]|$)/,inlineRuleNonStandard=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1/,blockRule=/^\s{0,3}(\${1,2})[ \t]*\n([\s\S]+?)\n\s{0,3}\1[ \t]*(?:\n|$)/,inlineLatexRule=/^\\\(([^\\]*(?:\\.[^\\]*)*?)\\\)/,blockLatexRule=/^\\\[([^\\]*(?:\\.[^\\]*)*?)\\\]/;function createRenderer(t,e,o,a=!0){return n=>{window.MathJax.texReset();const l=window.MathJax.tex2svg(n.text,{display:t}).firstChild,d=l.style["min-width"]||l.getAttribute("width");return l.removeAttribute("width"),a&&(l.style.display="initial",l.style.setProperty("max-width","300vw","important"),l.style.flexShrink="0",l.style.width=d),t?`<section ${o}>${l.outerHTML}</section>`:`<span ${e}>${l.outerHTML}</span>`}}function inlineKatex(t,e){const o=t&&t.nonStandard,a=o?inlineRuleNonStandard:inlineRule;return{name:"inlineKatex",level:"inline",start(n){let s,l=n;for(;l;){if(s=l.indexOf("$"),s===-1)return;if((o?s>-1:s===0||l.charAt(s-1)===" ")&&l.substring(s).match(a))return s;l=l.substring(s+1).replace(/^\$+/,"")}},tokenizer(n){const s=n.match(a);if(s)return{type:"inlineKatex",raw:s[0],text:s[2].trim(),displayMode:s[1].length===2}},renderer:e}}function blockKatex(t,e){return{name:"blockKatex",level:"block",tokenizer(o){const a=o.match(blockRule);if(a)return{type:"blockKatex",raw:a[0],text:a[2].trim(),displayMode:a[1].length===2}},renderer:e}}function inlineLatexKatex(t,e){return{name:"inlineLatexKatex",level:"inline",start(o){const a=o.indexOf("\\(");return a!==-1?a:void 0},tokenizer(o){const a=o.match(inlineLatexRule);if(a)return{type:"inlineLatexKatex",raw:a[0],text:a[1].trim(),displayMode:!1}},renderer:e}}function blockLatexKatex(t,e){return{name:"blockLatexKatex",level:"block",start(o){const a=o.indexOf("\\[");return a!==-1?a:void 0},tokenizer(o){const a=o.match(blockLatexRule);if(a)return{type:"blockLatexKatex",raw:a[0],text:a[1].trim(),displayMode:!0}},renderer:e}}function MDKatex(t,e,o,a=!0){return{extensions:[inlineKatex(t,createRenderer(!1,e,o,a)),blockKatex(t,createRenderer(!0,e,o,a)),inlineLatexKatex(t,createRenderer(!1,e,o,a)),blockLatexKatex(t,createRenderer(!0,e,o,a))]}}function markedMarkup(t={}){const{styles:e}=t;return{extensions:[{name:"markup_highlight",level:"inline",start(o){return o.match(/==(?!=)/)?.index},tokenizer(o){const n=/^==((?:[^=]|=(?!=))+)==/.exec(o);if(n)return{type:"markup_highlight",raw:n[0],text:n[1]}},renderer(o){return`<span class="markup-highlight" style="${getStyleString(e?.markup_highlight??{})}">${o.text}</span>`}},{name:"markup_underline",level:"inline",start(o){return o.match(/\+\+(?!\+)/)?.index},tokenizer(o){const n=/^\+\+((?:[^+]|\+(?!\+))+)\+\+/.exec(o);if(n)return{type:"markup_underline",raw:n[0],text:n[1]}},renderer(o){return`<span class="markup-underline" style="${getStyleString(e?.markup_underline??{})}">${o.text}</span>`}},{name:"markup_wavyline",level:"inline",start(o){return o.match(/~(?!~)/)?.index},tokenizer(o){const n=/^~([^~\n]+)~(?!~)/.exec(o);if(n)return{type:"markup_wavyline",raw:n[0],text:n[1]}},renderer(o){return`<span class="markup-wavyline" style="${getStyleString(e?.markup_wavyline??{})}">${o.text}</span>`}}]}}function encode6bit(t){return t<10?String.fromCharCode(48+t):(t-=10,t<26?String.fromCharCode(65+t):(t-=26,t<26?String.fromCharCode(97+t):(t-=26,t===0?"-":t===1?"_":"?")))}function append3bytes(t,e,o){const a=t>>2,n=(t&3)<<4|e>>4,s=(e&15)<<2|o>>6,l=o&63;let d="";return d+=encode6bit(a&63),d+=encode6bit(n&63),d+=encode6bit(s&63),d+=encode6bit(l&63),d}function encode64(t){let e="";for(let o=0;o<t.length;o+=3)o+2===t.length?e+=append3bytes(t.charCodeAt(o),t.charCodeAt(o+1),0):o+1===t.length?e+=append3bytes(t.charCodeAt(o),0,0):e+=append3bytes(t.charCodeAt(o),t.charCodeAt(o+1),t.charCodeAt(o+2));return e}function performDeflate(t){try{const e=new TextEncoder().encode(t),o=deflateSync(e,{level:9});return String.fromCharCode(...o)}catch(e){return console.warn("Deflate compression failed:",e),t}}function encodePlantUML(t){try{const e=performDeflate(t);return encode64(e)}catch(e){console.warn("PlantUML encoding failed, using fallback:",e);const o=new TextEncoder().encode(t);return`~1${btoa(String.fromCharCode(...o)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}`}}function generatePlantUMLUrl(t,e){const o=encodePlantUML(t),a=e.format==="svg"?"svg":"png";return`${e.serverUrl}/${a}/${o}`}function renderPlantUMLDiagram(t,e){const{text:o}=t,a=!o.trim().includes("@start")||!o.trim().includes("@end")?`@startuml
42
+ ${o.trim()}
43
+ @enduml`:o,n=generatePlantUMLUrl(a,e);if(e.inlineSvg&&e.format==="svg"){const s=`plantuml-placeholder-${Math.random().toString(36).slice(2,11)}`;fetchSvgContent(n).then(d=>{const u=document.querySelector(`[data-placeholder="${s}"]`);u&&(u.outerHTML=createPlantUMLHTML(n,e,d))});const l=e.styles.container?Object.entries(e.styles.container).map(([d,u])=>`${d.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${u}`).join("; "):"";return`<div class="${e.className}" style="${l}" data-placeholder="${s}">
44
+ <div style="color: #666; font-style: italic;">正在加载PlantUML图表...</div>
45
+ </div>`}return createPlantUMLHTML(n,e)}async function fetchSvgContent(t){try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.text()).replace(/(<svg[^>]*)\swidth="[^"]*"/g,"$1").replace(/(<svg[^>]*)\sheight="[^"]*"/g,"$1").replace(/(<svg[^>]*style="[^"]*?)width:[^;]*;?/g,"$1").replace(/(<svg[^>]*style="[^"]*?)height:[^;]*;?/g,"$1")}catch(e){return console.warn(`Failed to fetch SVG content from ${t}:`,e),'<div style="color: #666; font-style: italic;">PlantUML图表加载失败</div>'}}function createPlantUMLHTML(t,e,o){const a=e.styles.container?Object.entries(e.styles.container).map(([n,s])=>`${n.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${s}`).join("; "):"";return o?`<div class="${e.className}" style="${a}">
46
+ ${o}
47
+ </div>`:`<div class="${e.className}" style="${a}">
48
+ <img src="${t}" alt="PlantUML Diagram" style="max-width: 100%; height: auto;" />
49
+ </div>`}function markedPlantUML(t={}){const e={serverUrl:t.serverUrl||"https://www.plantuml.com/plantuml",format:t.format||"svg",className:t.className||"plantuml-diagram",inlineSvg:t.inlineSvg||!1,styles:{container:{textAlign:"center",margin:"16px 8px",overflowX:"auto",...t.styles?.container}}};return{extensions:[{name:"plantuml",level:"block",start(o){return o.match(/^```plantuml/m)?.index},tokenizer(o){const a=/^```plantuml\r?\n([\s\S]*?)\r?\n```/.exec(o);if(a){const[n,s]=a;return{type:"plantuml",raw:n,text:s.trim()}}},renderer(o){return renderPlantUMLDiagram(o,e)}}],walkTokens(o){o.type==="code"&&o.lang==="plantuml"&&(o.type="plantuml")}}}function markedRuby(){return{extensions:[{name:"ruby",level:"inline",start(t){return t.match(/\[/)?.index},tokenizer(t){let o=/^\[([^\]]+)\]\{([^}]+)\}/.exec(t);if(o)return{type:"ruby",raw:o[0],text:o[1].trim(),ruby:o[2].trim(),format:"basic"};if(o=/^\[([^\]]+)\]\^\(([^)]+)\)/.exec(t),o)return{type:"ruby",raw:o[0],text:o[1].trim(),ruby:o[2].trim(),format:"basic-hat"}},renderer(t){const{text:e,ruby:o,format:a}=t,n=/[・.。-]/g;if(n.test(o)){const l=o.split(n).filter(m=>m.trim()!==""),d=e.split(""),u=[];if(d.length>=l.length){let m=0;for(let i=0;i<l.length;i++){const p=l[i],C=d.length-m,h=l.length-i;let T=1;h===1&&(T=C);const v=d.slice(m,m+T).join("");u.push(`<ruby data-text="${v}" data-ruby="${p}" data-format="${a}">${v}<rp>(</rp><rt>${p}</rt><rp>)</rp></ruby>`),m+=T}m<d.length&&u.push(d.slice(m).join(""))}else for(let m=0;m<d.length;m++){const i=d[m],p=l[m]||"";p?u.push(`<ruby data-text="${i}" data-ruby="${p}" data-format="${a}">${i}<rp>(</rp><rt>${p}</rt><rp>)</rp></ruby>`):u.push(i)}return u.join("")}return`<ruby data-text="${e}" data-ruby="${o}" data-format="${a}">${e}<rp>(</rp><rt>${o}</rt><rp>)</rp></ruby>`}}]}}function markedSlider(t={}){return{extensions:[{name:"horizontalSlider",level:"block",start(e){return e.match(/^<!\[/)?.index},tokenizer(e){const o=/^<(!\[.*?\]\(.*?\)(?:,!\[.*?\]\(.*?\))*)>/,a=e.match(o);if(a)return{type:"horizontalSlider",raw:a[0],text:a[1]}},renderer(e){const{text:o}=e,a=o.match(/!\[(.*?)\]\((.*?)\)/g)||[];return a.length===0?"":`
50
+ <section style="box-sizing: border-box; font-size: 16px;">
51
+ <section data-role="outer" style="font-family: 微软雅黑; font-size: 16px;">
52
+ <section data-role="paragraph" style="margin: 0px auto; box-sizing: border-box; width: 100%;">
53
+ <section style="margin: 0px auto; text-align: center;">
54
+ <section style="display: inline-block; width: 100%;">
55
+ <!-- 微信公众号支持的滑动图片容器 -->
56
+ <section style="overflow-x: scroll; -webkit-overflow-scrolling: touch; white-space: nowrap; width: 100%; text-align: center;">
57
+ ${a.map(s=>{const l=s.match(/!\[(.*?)\]/)||[],d=s.match(/\]\((.*?)\)/)||[],u=l[1]||"",m=d[1]||"",{styles:i}=t,p=i?getStyleString(i.image):"";return{src:m,alt:u,imgStyles:p}}).map((s,l)=>`<section style="display: inline-block; width: 100%; margin-right: 0; vertical-align: top;">
58
+ <img src="${s.src}" alt="${s.alt}" title="${s.alt}" style="${s.imgStyles}; width: 100%; height: auto; border-radius: 4px; vertical-align: top;"/>
59
+ <p style="margin-top: 5px; font-size: 14px; color: #666; text-align: center; white-space: normal;">${s.alt}</p>
60
+ </section>`).join("")}
61
+ </section>
62
+ </section>
63
+ </section>
64
+ </section>
65
+ </section>
66
+ <p style="font-size: 14px; color: #999; text-align: center; margin-top: 5px;"><<< 左右滑动看更多 >>></p>
67
+ </section>
68
+ `}}]}}function markedToc(){let t=[],e=!0;return{walkTokens(o){if(e&&(t=[],e=!1),o.type==="heading"){const a=o.text||"",n=o.depth||1,s=t.length;t.push({text:a,depth:n,index:s})}},extensions:[{name:"toc",level:"block",start(o){const a=o.match(/^\s*\[TOC\]\s*$/m);return a?a.index:void 0},tokenizer(o){const a=/^\[TOC\]/.exec(o);if(a)return{type:"toc",raw:a[0]}},renderer(){if(!t.length)return"";let o='<nav class="markdown-toc"><ul class="toc-ul toc-level-1 pl-4 border-l ml-2">',a=1;t.forEach(({text:n,depth:s,index:l})=>{if(s>a)for(let d=a+1;d<=s;d++)o+=`<ul class="toc-ul toc-level-${d} pl-4 border-l ml-2">`;else if(s<a)for(let d=a;d>s;d--)o+="</ul>";o+=`<li class="toc-li toc-level-${s} mb-1"><a class="text-gray-700 hover:text-blue-600 underline transition-colors" href="#${l}">${n}</a></li>`,a=s});for(let n=a;n>1;n--)o+="</ul>";return o+="</ul></nav>",e=!0,o}}]}}Object.entries(COMMON_LANGUAGES).forEach(([t,e])=>{HighlightJS.registerLanguage(t,e)});k.setOptions({breaks:!0});k.use(markedSlider());function buildTheme({theme:t,fonts:e,size:o,isUseIndent:a,isUseJustify:n}){const s=cloneDeep(t),l=toMerged(s.base,{"font-family":e,"font-size":o});a&&(s.block.p={"text-indent":"2em",...s.block.p}),n&&(s.block.p={"text-align":"justify",...s.block.p});const d=u=>Object.fromEntries(Object.entries(u).map(([m,i])=>[m,toMerged(l,i)]));return{...d(s.inline),...d(s.block)}}function escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/`/g,"&#96;")}function buildAddition(){return`
69
+ <style>
70
+ .preview-wrapper pre::before {
71
+ position: absolute;
72
+ top: 0;
73
+ right: 0;
74
+ color: #ccc;
75
+ text-align: center;
76
+ font-size: 0.8em;
77
+ padding: 5px 10px 0;
78
+ line-height: 15px;
79
+ height: 15px;
80
+ font-weight: 600;
81
+ }
82
+ </style>
83
+ `}function getStyles(t,e,o=""){const a=t[e];return a?`style="${getStyleString(a)}${o}"`:""}function buildFootnoteArray(t){return t.map(([e,o,a])=>a===o?`<code style="font-size: 90%; opacity: 0.6;">[${e}]</code>: <i style="word-break: break-all">${o}</i><br/>`:`<code style="font-size: 90%; opacity: 0.6;">[${e}]</code> ${o}: <i style="word-break: break-all">${a}</i><br/>`).join(`
84
+ `)}function transform(t,e,o){const a=t.split("-");for(const n of a){if(n==="alt"&&e)return e;if(n==="title"&&o)return o}return""}const macCodeSvg=`
85
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" width="45px" height="13px" viewBox="0 0 450 130">
86
+ <ellipse cx="50" cy="65" rx="50" ry="52" stroke="rgb(220,60,54)" stroke-width="2" fill="rgb(237,108,96)" />
87
+ <ellipse cx="225" cy="65" rx="50" ry="52" stroke="rgb(218,151,33)" stroke-width="2" fill="rgb(247,193,81)" />
88
+ <ellipse cx="400" cy="65" rx="50" ry="52" stroke="rgb(27,161,37)" stroke-width="2" fill="rgb(100,200,86)" />
89
+ </svg>
90
+ `.trim();function parseFrontMatterAndContent(t){try{const e=frontMatter(t),o=e.attributes,a=e.body,n=readingTime(a);return{yamlData:o,markdownContent:a,readingTime:n}}catch(e){return console.error("Error parsing front-matter:",e),{yamlData:{},markdownContent:t,readingTime:readingTime(t)}}}function initRenderer(t){const e=[];let o=0,a=buildTheme(t),n=0;const s=[],l=[];function d(){return t}function u(g,f=""){return getStyles(a,g,f)}function m(g,f,_){const b=_??g;return`<${b} ${/^h\d$/.test(b)?'data-heading="true"':""} ${u(g)}>${f}</${b}>`}function i(g,f){const _=e.find(([,,b])=>b===f);return _?_[0]:(e.push([++o,g,f]),o)}function p(g){e.length=0,o=0,C(g)}function C(g){t={...t,...g};const f=JSON.stringify(a);a=buildTheme(t);const _=JSON.stringify(a);f!==_&&(k.use(markedAlert({styles:a})),k.use(MDKatex({nonStandard:!0},u("inline_katex",";line-height: 1;"),u("block_katex",";text-align: center;"))),k.use(markedMarkup({styles:a})))}function h(g){return!t.countStatus||!g.words?"":`
91
+ <blockquote ${u("blockquote")}>
92
+ <p ${u("blockquote_p")}>字数 ${g?.words},阅读大约需 ${Math.ceil(g?.minutes)} 分钟</p>
93
+ </blockquote>
94
+ `}const T=()=>e.length?m("h4","引用链接")+m("footnotes",buildFootnoteArray(e),"p"):"",v={heading({tokens:g,depth:f}){const _=this.parser.parseInline(g),b=`h${f}`;return m(b,_)},paragraph({tokens:g}){const f=this.parser.parseInline(g),_=f.includes("<figure")&&f.includes("<img"),b=f.trim()==="";return _||b?f:m("p",f)},blockquote({tokens:g}){let f=this.parser.parse(g);return f=f.replace(/<p .*?>/g,`<p ${u("blockquote_p")}>`),m("blockquote",f)},code({text:g,lang:f=""}){if(f.startsWith("mermaid"))return clearTimeout(n),n=setTimeout(async()=>{typeof window<"u"&&window.mermaid?await window.mermaid.run():await(await __vitePreload(()=>import("mermaid"),[])).default.run()},0),`<pre class="mermaid">${g}</pre>`;const _=f.split(" ")[0],b=HighlightJS.getLanguage(_),N=highlightAndFormatCode(g,b?_:"plaintext",HighlightJS,!!t.isShowLineNumber),y=`<span class="mac-sign" style="padding: 10px 14px 0;">${macCodeSvg}</span>`;let E="";if(!b&&_!=="plaintext"){const j=g.replace(/"/g,"&quot;");E=` data-language-pending="${_}" data-raw-code="${j}" data-show-line-number="${t.isShowLineNumber}"`}const S=`<code class="language-${f}"${E} ${u("code")}>${N}</code>`;return`<pre class="hljs code__pre" ${u("code_pre")}>${y}${S}</pre>`},codespan({text:g}){const f=escapeHtml(g);return m("codespan",f,"code")},list({ordered:g,items:f,start:_=1}){s.push(g),l.push(Number(_));const b=f.map(R=>this.listitem(R)).join("");return s.pop(),l.pop(),m(g?"ol":"ul",b)},listitem(g){const f=s[s.length-1],_=l[l.length-1];l[l.length-1]=_+1;const b=f?`${_}. `:"• ";let R;try{R=this.parser.parseInline(g.tokens)}catch{R=this.parser.parse(g.tokens).replace(/^<p(?:\s[^>]*)?>([\s\S]*?)<\/p>/,"$1")}return m("listitem",`${b}${R}`,"li")},image({href:g,title:f,text:_}){const b=m("figcaption",transform(t.legend,_,f)),R=u("figure"),N=u("image");return`<figure ${R}><img ${N} src="${g}" title="${f}" alt="${_}"/>${b}</figure>`},link({href:g,title:f,text:_,tokens:b}){const R=this.parser.parseInline(b);if(/^https?:\/\/mp\.weixin\.qq\.com/.test(g))return`<a href="${g}" title="${f||_}" ${u("wx_link")}>${R}</a>`;if(g===_)return R;if(t.citeStatus){const N=i(f||_,g);return`<span ${u("link")}>${R}<sup>[${N}]</sup></span>`}return m("link",R,"span")},strong({tokens:g}){return m("strong",this.parser.parseInline(g))},em({tokens:g}){return m("em",this.parser.parseInline(g),"span")},table({header:g,rows:f}){const _=g.map(R=>{const N=this.parser.parseInline(R.tokens);return m("th",N)}).join(""),b=f.map(R=>{const N=R.map(y=>this.tablecell(y)).join("");return m("tr",N)}).join("");return`
95
+ <section style="max-width: 100%; overflow: auto">
96
+ <table class="preview-table" ${u("table")}>
97
+ <thead ${u("thead")}>${_}</thead>
98
+ <tbody>${b}</tbody>
99
+ </table>
100
+ </section>
101
+ `},tablecell(g){const f=this.parser.parseInline(g.tokens);return m("td",f)},hr(g){return m("hr","")}};return k.use({renderer:v}),k.use(markedMarkup({styles:a})),k.use(markedToc()),k.use(markedSlider({styles:a})),k.use(markedAlert({styles:a})),k.use(MDKatex({nonStandard:!0},u("inline_katex",";line-height: 1;"),u("block_katex",";text-align: center;"))),k.use(markedFootnotes()),k.use(markedPlantUML({inlineSvg:!0})),k.use(markedRuby()),{buildAddition,buildFootnotes:T,setOptions:C,reset:p,parseFrontMatterAndContent,buildReadingTime:h,createContainer(g){return m("container",g,"section")},getOpts:d}}const DEFAULT_SERVICE_ENDPOINT="https://proxy-ai.doocs.org/v1",DEFAULT_SERVICE_TEMPERATURE=1,DEFAULT_SERVICE_MAX_TOKEN=1024,DEFAULT_SERVICE_TYPE="default",DEFAULT_SERVICE_KEY="",serviceOptions=[{value:"default",label:"内置服务",endpoint:DEFAULT_SERVICE_ENDPOINT,models:["Qwen/Qwen2.5-7B-Instruct","Qwen/Qwen2.5-Coder-7B-Instruct","Qwen/Qwen2-7B-Instruct","deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","THUDM/GLM-Z1-9B-0414","THUDM/GLM-4-9B-0414","internlm/internlm2_5-7b-chat","qwen/qwen3-30b-a3b:free","qwen/qwen3-8b:free","qwen/qwen3-14b:free","qwen/qwen3-32b:free","qwen/qwen3-235b-a22b:free","tngtech/deepseek-r1t-chimera:free","thudm/glm-z1-9b:free","thudm/glm-z1-32b:free","thudm/glm-4-9b:free","thudm/glm-4-32b:free","microsoft/mai-ds-r1:free","arliai/qwq-32b-arliai-rpr-v1:free","nvidia/llama-3.3-nemotron-super-49b-v1:free","nvidia/llama-3.1-nemotron-ultra-253b-v1:free","meta-llama/llama-4-maverick:free","meta-llama/llama-4-scout:free","deepseek/deepseek-v3-base:free","qwen/qwen2.5-vl-3b-instruct:free","qwen/qwen2.5-vl-32b-instruct:free"]},{value:"deepseek",label:"DeepSeek",endpoint:"https://api.deepseek.com/v1",models:["deepseek-chat","deepseek-reasoner"]},{value:"openai",label:"OpenAI",endpoint:"https://api.openai.com/v1",models:["gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","gpt-4-turbo","gpt-4o","gpt-3.5-turbo"]},{value:"qwen",label:"通义千问",endpoint:"https://dashscope.aliyuncs.com/compatible-mode/v1",models:["qwen-vl-max-2025-04-02","deepseek-v3","deepseek-r1-distill-llama-70b","deepseek-r1-distill-qwen-32b","deepseek-r1-distill-qwen-14b","deepseek-r1-distill-llama-8b","deepseek-r1-distill-qwen-1.5b","deepseek-r1-distill-qwen-7b","deepseek-r1","qwen1.5-7b-chat","qwen-coder-plus-1106","qwen-coder-plus","qwen-coder-plus-latest","qwen2.5-coder-3b-instruct","qwen2.5-coder-0.5b-instruct","qwen2.5-coder-14b-instruct","qwen2.5-coder-32b-instruct","qwen-coder-turbo-0919","qwen2.5-0.5b-instruct","qwen2.5-1.5b-instruct","qwen2.5-3b-instruct","qwen2.5-7b-instruct","qwen2.5-14b-instruct","qwen2.5-32b-instruct","qwen2.5-72b-instruct","qwen2.5-coder-7b-instruct","qwen2.5-math-1.5b-instruct","qwen2.5-math-7b-instruct","qwen2.5-math-72b-instruct","qwen-turbo-0919","qwen-turbo-latest","qwen-plus-0919","qwen-plus-latest","qwen-max-0919","qwen-max-latest","qwen-coder-turbo","qwen-coder-turbo-latest","qwen-math-turbo-0919","qwen-math-turbo","qwen-math-turbo-latest","qwen-math-plus-0919","qwen-math-plus","qwen-math-plus-latest","qwen2-57b-a14b-instruct","qwen2-72b-instruct","qwen2-7b-instruct","qwen2-0.5b-instruct","qwen2-1.5b-instruct","qwen-long","qwen-vl-max","qwen-vl-plus","qwen-max-0428","qwen1.5-110b-chat","qwen-72b-chat","codeqwen1.5-7b-chat","qwen1.5-0.5b-chat","qwen-1.8b-chat","qwen-1.8b-longcontext-chat","qwen-7b-chat","qwen-14b-chat","qwen1.5-14b-chat","qwen1.5-1.8b-chat","qwen1.5-32b-chat","qwen1.5-72b-chat","qwen-max-1201","qwen-max-longcontext","qwen-max-0403","qwen-max-0107","qwen-turbo","qwen-max","qwen-plus"]},{value:"hunyuan",label:"腾讯混元",endpoint:"https://api.hunyuan.cloud.tencent.com/v1",models:["hunyuan-pro","hunyuan-vision","hunyuan-lite","hunyuan-standard","hunyuan-standard-32K","hunyuan-standard-256k","hunyuan-code","hunyuan-role","hunyuan-functioncall","hunyuan-turbo-vision","hunyuan-turbo"]},{value:"doubao",label:"火山方舟",endpoint:"https://ark.cn-beijing.volces.com/api/v3",models:["doubao-1-5-thinking-pro-250415","doubao-1-5-thinking-pro-m-250415","deepseek-r1-250120","deepseek-r1-distill-qwen-32b-250120","deepseek-r1-distill-qwen-7b-250120","deepseek-v3-250324","deepseek-v3-241226","doubao-1-5-vision-pro-250328","doubao-1-5-vision-lite-250315","doubao-1-5-vision-pro-32k-250115","doubao-1-5-ui-tars-250328","doubao-vision-pro-32k-241028","doubao-vision-lite-32k-241015","doubao-1-5-pro-32k-250115","doubao-1-5-pro-256k-250115","doubao-1-5-lite-32k-250115","doubao-pro-4k-240515","doubao-pro-32k-241215","doubao-pro-32k-240828","doubao-pro-32k-240615","doubao-pro-256k-241115","doubao-lite-4k-character-240828","doubao-lite-32k-240828","doubao-lite-32k-character-241015","doubao-lite-128k-240828","moonshot-v1-8k","moonshot-v1-32k","moonshot-v1-128k"]},{value:"siliconflow",label:"硅基流动",endpoint:"https://api.siliconflow.cn/v1",models:["Qwen/Qwen3-235B-A22B","Qwen/Qwen3-30B-A3B","Qwen/Qwen3-32B","Qwen/Qwen3-14B","Qwen/Qwen3-8B","THUDM/GLM-Z1-32B-0414","THUDM/GLM-4-32B-0414","THUDM/GLM-Z1-Rumination-32B-0414","THUDM/GLM-4-9B-0414","Qwen/QwQ-32B","Pro/deepseek-ai/DeepSeek-R1","Pro/deepseek-ai/DeepSeek-V3","deepseek-ai/DeepSeek-R1","deepseek-ai/DeepSeek-V3","deepseek-ai/DeepSeek-R1-Distill-Qwen-32B","deepseek-ai/DeepSeek-R1-Distill-Qwen-14B","deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B","deepseek-ai/DeepSeek-V2.5","Qwen/Qwen2.5-72B-Instruct-128K","Qwen/Qwen2.5-72B-Instruct","Qwen/Qwen2.5-32B-Instruct","Qwen/Qwen2.5-14B-Instruct","Qwen/Qwen2.5-7B-Instruct","Qwen/Qwen2.5-Coder-32B-Instruct","Qwen/Qwen2.5-Coder-7B-Instruct","Qwen/Qwen2-7B-Instruct","Qwen/QwQ-32B-Preview","TeleAI/TeleChat2","THUDM/glm-4-9b-chat","Vendor-A/Qwen/Qwen2.5-72B-Instruct","internlm/internlm2_5-7b-chat","internlm/internlm2_5-20b-chat","Pro/Qwen/Qwen2.5-7B-Instruct","Pro/Qwen/Qwen2-7B-Instruct","Pro/Qwen/Qwen2-1.5B-Instruct","Pro/THUDM/chatglm3-6b","Pro/THUDM/glm-4-9b-chat"]},{value:"302ai",label:"302.AI",endpoint:" https://api.302.ai/v1",models:["chatgpt-4o-latest","gpt-4o","gpt-4o-mini","gpt-4-turbo","o1-preview","o1-mini","claude-3-5-sonnet-latest","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","grok-beta"]},{value:"bigmodel",label:"智谱 AI",endpoint:"https://open.bigmodel.cn/api/paas/v4/",models:["glm-4-plus","glm-4-0520","glm-4","glm-4-air","glm-4-airx","glm-4-long","glm-4-flashx","glm-4-flash"]},{value:"baichuan",label:"百川智能",endpoint:"https://api.baichuan-ai.com/v1",models:["Baichuan4","Baichuan3-Turbo","Baichuan3-Turbo-128k","Baichuan2-Turbo"]},{value:"lingyiwanwu",label:"零一万物",endpoint:"https://api.lingyiwanwu.com/v1",models:["yi-lightning"]},{value:"moonshot",label:"月之暗面",endpoint:"https://api.moonshot.cn/v1",models:["moonshot-v1-8k","moonshot-v1-32k","moonshot-v1-128k"]},{value:"ernie",label:"百度千帆",endpoint:"https://qianfan.baidubce.com/v2",models:["ernie-4.5-turbo-128k","ernie-4.5-turbo-32k","ernie-4.5-8k-preview","ernie-4.0-8k","ernie-4.0-8k-latest","ernie-4.0-8k-preview","ernie-4.0-turbo-128k","ernie-4.0-turbo-8k","ernie-4.0-turbo-8k-latest","ernie-4.0-turbo-8k-preview","ernie-3.5-128k","ernie-3.5-8k","ernie-3.5-8k-preview","ernie-speed-128k","ernie-speed-8k","ernie-speed-pro-128k","ernie-lite-8k","ernie-lite-pro-128k","ernie-tiny-8k","ernie-novel-8k"]},{value:"custom",label:"自定义兼容 OpenAI API 的服务",endpoint:"",models:[]}];serviceOptions[0].models[0];const imageServiceOptions=[{value:"default",label:"内置服务",endpoint:DEFAULT_SERVICE_ENDPOINT,models:["Kwai-Kolors/Kolors"]},{value:"openai",label:"OpenAI",endpoint:"https://api.openai.com/v1",models:["gpt-image-1","dall-e-3"]},{value:"siliconflow",label:"硅基流动",endpoint:"https://api.siliconflow.cn/v1",models:["Kwai-Kolors/Kolors","Qwen/Qwen-Image"]},{value:"302ai",label:"302.AI",endpoint:"https://api.302.ai/302",models:["302ai-flux-1-srpo","bagel-image","baidu-irag-01","dall-e-3","dall-e-2","doubao-seedream-3-0-t2i-250415","doubao-v2","doubao-v2-l","doubao-v2.1","doubao-v3","doubao-seedream-4-0-250828","flux-kontext-max","flux-kontext-pro","google-v3","google-v3-fast","google-v4-preview","gemini-2.5-flash-image","302-gemini-2.5-flash-image","gpt-image-1","hidream-i1-full","hidream-i1-dev","hidream-i1-fast","higgsfield","ideogram-v1","ideogram-v1-turbo","ideogram-v2","ideogram-v2-turbo","ideogram-v2a","ideogram-v2a-turbo","ideogram-v3-turbo","ideogram-v3-quality","ideogram-v3","kling-v1","kling-v1-5","kling-v2","luma","luma-flash","midjourney-v6","midjourney-v6-1","midjourney-v7","nijijourney-v6","minimaxi-image-01","qwen","qwen-lora","official-qwen-image","official-qwen-image-plus","wan2.2-t2i-flash","wan2.2-t2i-plus","wanx2.1-t2i-turbo","wanx2.1-t2i-plus","wanx2.0-t2i-turbo","wan2.5-t2i-preview","recraft-v3","recraft-20b","stable-v1","stable-sd2","stable-sd3-ultra","stable-sd3","stable-sd3-medium","stable-sd3-large","stable-sd3-turbo","cogview-4-250304","cogview-4"]},{value:"custom",label:"自定义兼容 OpenAI API 的服务",endpoint:"",models:[]}];imageServiceOptions[0].models[0];const githubConfig={username:"bucketio",repoList:Array.from({length:20},(t,e)=>`img${e}`),branch:"main",accessTokenList:["ghp_sqQg5y7XC7Fy8XdoocsmdVEYRiRiTZPvbwzTL4MRjQc","ghp_jB5JXzBjpGbgzdoocsmdogWfSHhfCKGVstozw1cAsPv","ghp_zvy8wkHo259g7doocsmdJnUKOQd1WO1SPzZ9G0O9cJD","ghp_DnCJc2Ms0RVZ1doocsmdiWOAN78FurfSeD1Pv2Y28pO","ghp_EsMYDv9WVjXWP5doocsmd1nnDml2DEP95rOiz44bSo0","ghp_L4isHf01nllOOdoocsmdHBGoDG6jscCA09WV44QDvlg","ghp_qWciwYXHPakAUGdoocsmdBOBZdRcV08JThKey3mBZNJ","ghp_rxkvIO08wVL2DMdoocsmd2jDEhcatp2rfVyhd3A7RiS","ghp_1RvkWKboSxr0yVdoocsmd7OtBCpecYwoV6deh3utifJ","ghp_cduanDnAug60ngdoocsmdF1uDstXUi6S9RMhY1qdada","ghp_q6mxuJIkqAcsCXdoocsmdkkjWvzGlMVRuy5zI0IWNDx","ghp_Pv4npPeJpChKFMTdoocsmdCQneopUcqJrqrjl3vrt9A","ghp_gKMCFqMaQiLTqhjdoocsmd7BJE8RyK6AdRw4b42CutS","ghp_2oShgb33qFlqBmadoocsmdludmuLYxBFY5bao1XrsVo","ghp_eYyd3kxWTZmsV8doocsmdDFbAa7AEGQTJgmOd0GUmtY"]},giteeConfig={username:"filesss",repoList:Array.from({length:20},(t,e)=>`img${e}`),branch:"main",accessTokenList:["ed5fc9866bd6c2fdoocsmddd433f806fd2f399c","5448ffebbbf1151doocsmdc4e337cf814fc8a62","25b05efd2557ca2doocsmd75b5c0835e3395911","11628c7a5aef015doocsmd2eeff9fb9566f0458","cb2f5145ed938dedoocsmdbd063b4ed244eecf8","d8c0b57500672c1doocsmd55f48b866b5ebcd98","78c56eadb88e453doocsmd43ddd95753351771a","03e1a688003948fdoocsmda16fcf41e6f03f1f0","c49121cf4d191fbdoocsmdd6a7877ed537e474a","adfeb2fadcdc4aadoocsmdfe1ee869ac9c968ff","116c94549ca4a0ddoocsmd192653af5c0694616","ecf30ed7f2eb184doocsmd51ea4ec8300371d9e","5837cf2bd5afd93doocsmd73904bed31934949e","b5b7e1c7d57e01fdoocsmd5266f552574297d78","684d55564ffbd0bdoocsmd7d747e5cc23aed6d6","3fc04a9d272ab71doocsmd010c56cb57d88d2ba"]},prefix="MD",isMac=/Mac/i.test(navigator.userAgent),ctrlKey="Mod",ctrlSign=isMac?"⌘":"Ctrl",altSign=isMac?"⌥":"Alt",shiftSign=isMac?"⇧":"Shift",storeLabels={isDark:"深色模式",isEditOnLeft:"左侧编辑",isMacCodeBlock:"Mac 代码块",isShowLineNumber:"代码块行号",isCiteStatus:"微信外链接底部引用状态",isCountStatus:"字数统计状态",isUseIndent:"使用缩进",isUseJustify:"使用两端对齐",isOpenRightSlider:"开启右侧滑块",isOpenPostSlider:"开启右侧发布滑块",showAIToolbox:"AI 工具箱状态",theme:"主题",fontFamily:"字体",fontSize:"字体大小",primaryColor:"自定义主题色",codeBlockTheme:"代码块主题",legend:"图注格式",fontSizeNumber:"字体大小",currentPostId:"当前文章 ID",currentPostIndex:"当前文章索引",posts:"内容列表",cssContentConfig:"自定义 CSS",titleList:"文章标题列表",readingTime:"阅读时间",isShowCssEditor:"显示 CSS 编辑器",isShowInsertFormDialog:"显示插入表单对话框",isShowInsertMpCardDialog:"显示插入公众号名片对话框",isShowUploadImgDialog:"显示上传图片对话框",aiDialogVisible:"AI 对话框可见"},defaultTheme={base:{"--md-primary-color":"#000000","text-align":"left","line-height":"1.75"},block:{container:{},h1:{display:"table",padding:"0 1em","border-bottom":"2px solid var(--md-primary-color)",margin:"2em auto 1em",color:"hsl(var(--foreground))","font-size":"1.2em","font-weight":"bold","text-align":"center"},h2:{display:"table",padding:"0 0.2em",margin:"4em auto 2em",color:"#fff",background:"var(--md-primary-color)","font-size":"1.2em","font-weight":"bold","text-align":"center"},h3:{"padding-left":"8px","border-left":"3px solid var(--md-primary-color)",margin:"2em 8px 0.75em 0",color:"hsl(var(--foreground))","font-size":"1.1em","font-weight":"bold","line-height":"1.2"},h4:{margin:"2em 8px 0.5em",color:"var(--md-primary-color)","font-size":"1em","font-weight":"bold"},h5:{margin:"1.5em 8px 0.5em",color:"var(--md-primary-color)","font-size":"1em","font-weight":"bold"},h6:{margin:"1.5em 8px 0.5em","font-size":"1em",color:"var(--md-primary-color)"},p:{margin:"1.5em 8px","letter-spacing":"0.1em",color:"hsl(var(--foreground))"},blockquote:{"font-style":"normal",padding:"1em","border-left":"4px solid var(--md-primary-color)","border-radius":"6px",color:"rgba(0,0,0,0.5)",background:"var(--blockquote-background)","margin-bottom":"1em"},blockquote_p:{display:"block","font-size":"1em","letter-spacing":"0.1em",color:"hsl(var(--foreground))"},blockquote_note:{},blockquote_tip:{},blockquote_info:{},blockquote_important:{},blockquote_warning:{},blockquote_caution:{},blockquote_title:{display:"flex","align-items":"center",gap:"0.5em","margin-bottom":"0.5em"},blockquote_title_note:{color:"#478be6"},blockquote_title_tip:{color:"#57ab5a"},blockquote_title_info:{color:"#93c5fd"},blockquote_title_important:{color:"#986ee2"},blockquote_title_warning:{color:"#c69026"},blockquote_title_caution:{color:"#e5534b"},blockquote_p_note:{},blockquote_p_tip:{},blockquote_p_info:{},blockquote_p_important:{},blockquote_p_warning:{},blockquote_p_caution:{},code_pre:{"font-size":"90%","overflow-x":"auto","border-radius":"8px",padding:"1em","line-height":"1.5",margin:"10px 8px"},code:{margin:0,"white-space":"nowrap","font-size":"90%","font-family":"Menlo, Operator Mono, Consolas, Monaco, monospace"},image:{display:"block","max-width":"100%",margin:"0.1em auto 0.5em","border-radius":"4px"},ol:{"padding-left":"1em","margin-left":"0",color:"hsl(var(--foreground))"},ul:{"list-style":"circle","padding-left":"1em","margin-left":"0",color:"hsl(var(--foreground))"},footnotes:{margin:"0.5em 8px","font-size":"80%",color:"hsl(var(--foreground))"},figure:{margin:"1.5em 8px",color:"hsl(var(--foreground))"},hr:{"border-style":"solid","border-width":"2px 0 0","border-color":"rgba(0,0,0,0.1)","-webkit-transform-origin":"0 0","-webkit-transform":"scale(1, 0.5)","transform-origin":"0 0",transform:"scale(1, 0.5)",height:"0.4em",margin:"1.5em 0"},block_katex:{"max-width":"100%","overflow-x":"auto","-webkit-overflow-scrolling":"touch",padding:"0.5em 0"}},inline:{listitem:{display:"block",margin:"0.2em 8px",color:"hsl(var(--foreground))"},codespan:{"font-size":"90%",color:"#d14",background:"rgba(27,31,35,.05)",padding:"3px 5px","border-radius":"4px"},em:{"font-style":"italic","font-size":"inherit"},link:{color:"#576b95"},wx_link:{color:"#576b95","text-decoration":"none"},strong:{color:"var(--md-primary-color)","font-weight":"bold","font-size":"inherit"},table:{color:"hsl(var(--foreground))"},thead:{"font-weight":"bold",color:"hsl(var(--foreground))"},th:{border:"1px solid #dfdfdf",padding:"0.25em 0.5em",color:"hsl(var(--foreground))","word-break":"keep-all",background:"rgba(0, 0, 0, 0.05)"},td:{border:"1px solid #dfdfdf",padding:"0.25em 0.5em",color:"hsl(var(--foreground))","word-break":"keep-all"},footnote:{"font-size":"12px",color:"hsl(var(--foreground))"},figcaption:{"text-align":"center",color:"#888","font-size":"0.8em"},inline_katex:{"max-width":"100%","overflow-x":"auto"},markup_highlight:{"background-color":"var(--md-primary-color)",padding:"2px 4px","border-radius":"2px",color:"#fff"},markup_underline:{"text-decoration":"underline","text-decoration-color":"var(--md-primary-color)"},markup_wavyline:{"text-decoration":"underline wavy","text-decoration-color":"var(--md-primary-color)","text-decoration-thickness":"2px"}}},graceTheme=toMerged(defaultTheme,{base:{},block:{container:{},h1:{padding:"0.5em 1em","border-bottom":"2px solid var(--md-primary-color)","font-size":"1.4em","text-shadow":"2px 2px 4px rgba(0,0,0,0.1)"},h2:{padding:"0.3em 1em","border-radius":"8px","font-size":"1.3em","box-shadow":"0 4px 6px rgba(0,0,0,0.1)"},h3:{"padding-left":"12px","font-size":"1.2em","border-left":"4px solid var(--md-primary-color)","border-bottom":"1px dashed var(--md-primary-color)"},h4:{"font-size":"1.1em"},h5:{"font-size":"1em"},h6:{"font-size":"1em"},p:{},blockquote:{"font-style":"italic",padding:"1em 1em 1em 2em","border-left":"4px solid var(--md-primary-color)","border-radius":"6px",color:"rgba(0,0,0,0.6)","box-shadow":"0 4px 6px rgba(0,0,0,0.05)","margin-bottom":"1em"},blockquote_p:{},"markdown-alert":{"font-style":"italic"},code_pre:{"box-shadow":"inset 0 0 10px rgba(0,0,0,0.05)"},code:{"font-family":"'Fira Code', Menlo, Operator Mono, Consolas, Monaco, monospace"},image:{"border-radius":"8px","box-shadow":"0 4px 8px rgba(0,0,0,0.1)"},ol:{"padding-left":"1.5em"},ul:{"list-style":"none","padding-left":"1.5em"},footnotes:{},figure:{},hr:{height:"1px",border:"none",margin:"2em 0",background:"linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0))"}},inline:{listitem:{margin:"0.5em 8px"},codespan:{},em:{},link:{},wx_link:{},strong:{},table:{"border-collapse":"separate","border-spacing":"0","border-radius":"8px",margin:"1em 8px",color:"hsl(var(--foreground))","box-shadow":"0 4px 6px rgba(0,0,0,0.1)",overflow:"hidden"},thead:{color:"#fff"},td:{padding:"0.5em 1em"},footnote:{color:"rgba(0,0,0,0.5)"},figcaption:{}}}),simpleTheme=toMerged(defaultTheme,{base:{},block:{container:{},h1:{padding:"0.5em 1em","font-size":"1.4em","text-shadow":"1px 1px 3px rgba(0,0,0,0.05)"},h2:{padding:"0.3em 1.2em","font-size":"1.3em","border-radius":"8px 24px 8px 24px","box-shadow":"0 2px 6px rgba(0,0,0,0.06)"},h3:{"padding-left":"12px","font-size":"1.2em","border-radius":"6px","line-height":"2.4em","border-left":"4px solid var(--md-primary-color)","border-right":"1px solid color-mix(in srgb, var(--md-primary-color) 10%, transparent)","border-bottom":"1px solid color-mix(in srgb, var(--md-primary-color) 10%, transparent)","border-top":"1px solid color-mix(in srgb, var(--md-primary-color) 10%, transparent)",background:"color-mix(in srgb, var(--md-primary-color) 8%, transparent)"},h4:{"font-size":"1.1em","border-radius":"6px"},h5:{"border-radius":"6px"},h6:{"border-radius":"6px"},blockquote:{"font-style":"italic",padding:"1em 1em 1em 2em",color:"rgba(0,0,0,0.6)","border-bottom":"0.2px solid rgba(0, 0, 0, 0.04)","border-top":"0.2px solid rgba(0, 0, 0, 0.04)","border-right":"0.2px solid rgba(0, 0, 0, 0.04)"},blockquote_note:{"font-style":"italic"},blockquote_tip:{"font-style":"italic"},blockquote_info:{"font-style":"italic"},blockquote_important:{"font-style":"italic"},blockquote_warning:{"font-style":"italic"},blockquote_caution:{"font-style":"italic"},blockquote_title:{},blockquote_title_note:{},blockquote_title_tip:{},blockquote_title_info:{},blockquote_title_important:{},blockquote_title_warning:{},blockquote_title_caution:{},blockquote_p_note:{},blockquote_p_tip:{},blockquote_p_info:{},blockquote_p_important:{},blockquote_p_warning:{},blockquote_p_caution:{},code_pre:{border:"1px solid rgba(0, 0, 0, 0.04)"},code:{"font-family":"'Fira Code', Menlo, Operator Mono, Consolas, Monaco, monospace"},image:{"border-radius":"8px",border:"1px solid rgba(0, 0, 0, 0.04)"},ol:{"padding-left":"1.5em"},ul:{"list-style":"none","padding-left":"1.5em"},hr:{height:"1px",border:"none",margin:"2em 0",background:"linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0))"}},inline:{listitem:{margin:"0.5em 8px"}}}),themeMap={default:defaultTheme,grace:graceTheme,simple:simpleTheme},themeOptions=[{label:"经典",value:"default",desc:""},{label:"优雅",value:"grace",desc:"@brzhang"},{label:"简洁",value:"simple",desc:"@okooo5km"}],fontFamilyOptions=[{label:"无衬线",value:"-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif",desc:"字体123Abc"},{label:"衬线",value:"Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif",desc:"字体123Abc"},{label:"等宽",value:"Menlo, Monaco, 'Courier New', monospace",desc:"字体123Abc"}],fontSizeOptions=[{label:"14px",value:"14px",desc:"更小"},{label:"15px",value:"15px",desc:"稍小"},{label:"16px",value:"16px",desc:"推荐"},{label:"17px",value:"17px",desc:"稍大"},{label:"18px",value:"18px",desc:"更大"}],colorOptions=[{label:"经典蓝",value:"#0F4C81",desc:"稳重冷静"},{label:"翡翠绿",value:"#009874",desc:"自然平衡"},{label:"活力橘",value:"#FA5151",desc:"热情活力"},{label:"柠檬黄",value:"#FECE00",desc:"明亮温暖"},{label:"薰衣紫",value:"#92617E",desc:"优雅神秘"},{label:"天空蓝",value:"#55C9EA",desc:"清爽自由"},{label:"玫瑰金",value:"#B76E79",desc:"奢华现代"},{label:"橄榄绿",value:"#556B2F",desc:"沉稳自然"},{label:"石墨黑",value:"#333333",desc:"内敛极简"},{label:"雾烟灰",value:"#A9A9A9",desc:"柔和低调"},{label:"樱花粉",value:"#FFB7C5",desc:"浪漫甜美"}],widthOptions=[{label:"移动端",value:"w-[375px]",desc:"固定"},{label:"电脑端",value:"w-full",desc:"适应"}],codeBlockUrlPrefix="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/highlightjs/11.11.1/styles/",codeBlockThemeList=["1c-light","a11y-dark","a11y-light","agate","an-old-hope","androidstudio","arduino-light","arta","ascetic","atom-one-dark-reasonable","atom-one-dark","atom-one-light","brown-paper","codepen-embed","color-brewer","dark","default","devibeans","docco","far","felipec","foundation","github-dark-dimmed","github-dark","github","gml","googlecode","gradient-dark","gradient-light","grayscale","hybrid","idea","intellij-light","ir-black","isbl-editor-dark","isbl-editor-light","kimbie-dark","kimbie-light","lightfair","lioshi","magula","mono-blue","monokai-sublime","monokai","night-owl","nnfx-dark","nnfx-light","nord","obsidian","panda-syntax-dark","panda-syntax-light","paraiso-dark","paraiso-light","pojoaque","purebasic","qtcreator-dark","qtcreator-light","rainbow","routeros","school-book","shades-of-purple","srcery","stackoverflow-dark","stackoverflow-light","sunburst","tokyo-night-dark","tokyo-night-light","tomorrow-night-blue","tomorrow-night-bright","vs","vs2015","xcode","xt256"],codeBlockThemeOptions=codeBlockThemeList.map(t=>({label:t,value:`${codeBlockUrlPrefix}${t}.min.css`,desc:""})),legendOptions=[{label:"title 优先",value:"title-alt",desc:""},{label:"alt 优先",value:"alt-title",desc:""},{label:"只显示 title",value:"title",desc:""},{label:"只显示 alt",value:"alt",desc:""},{label:"不显示",value:"none",desc:""}],defaultStyleConfig={isCiteStatus:!1,isMacCodeBlock:!0,isShowLineNumber:!1,isCountStatus:!1,theme:themeOptions[0].value,fontFamily:fontFamilyOptions[0].value,fontSize:fontSizeOptions[2].value,primaryColor:colorOptions[0].value,codeBlockTheme:codeBlockThemeOptions[23].value,legend:legendOptions[3].value},basicSetup=[highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),keymap.of([...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap,{key:"Tab",run:acceptCompletion},indentWithTab])];[highlightSpecialChars(),history(),drawSelection(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),keymap.of([...defaultKeymap,...historyKeymap])];function downloadFile(t,e,o="text/plain"){if(typeof document>"u")throw new TypeError("downloadFile can only be used in browser environment");const a=document.createElement("a");if(a.download=e,a.style.display="none",t.startsWith("data:"))a.href=t;else if(o==="text/html")a.href=`data:text/html;charset=utf-8,${encodeURIComponent(t)}`;else{const n=new Blob([t],{type:o});a.href=URL.createObjectURL(n)}document.body.appendChild(a),a.click(),document.body.removeChild(a),!t.startsWith("data:")&&o!=="text/html"&&URL.revokeObjectURL(a.href)}function toBase64(t){return new Promise((e,o)=>{const a=new FileReader;a.readAsDataURL(t),a.onload=()=>e(a.result.split(",").pop()),a.onerror=n=>o(n)})}function createTable({data:t,rows:e,cols:o}){let a="";for(let n=0;n<e+2;++n){a+="| ";const s=[];for(let l=0;l<o;++l){const d=n>1?n-1:n;s.push(n===1?"---":t[`k_${d}_${l}`]||" ")}a+=s.join(" | "),a+=` |
102
+ `}return a}async function formatDoc(t,e="markdown"){const o=e==="css"?"css":e==="javascript"?"babel":"markdown",a=e==="css"?[parserPostcss]:e==="javascript"?[parserBabel]:[parserMarkdown,parserBabel];return await standaloneExports.format(t,{parser:o,plugins:a,printWidth:80,tabWidth:2,useTabs:!1,semi:!1,singleQuote:!0,quoteProps:"as-needed",trailingComma:"es5",bracketSpacing:!0,bracketSameLine:!1,arrowParens:"avoid",proseWrap:"preserve",htmlWhitespaceSensitivity:"css",endOfLine:"lf"})}async function formatCSS(t){const e=t.state.doc.toString(),o=await formatDoc(e,"css");t.dispatch({changes:{from:0,to:t.state.doc.length,insert:o}})}function cssSetup(){return[basicSetup,css$1(),EditorView.lineWrapping,keymap.of([{key:"Shift-Alt-f",run:t=>(formatCSS(t),!0)}])]}function toggleFormat(t,{prefix:e,suffix:o,check:a,afterInsertCursorOffset:n=0}){const s=t.state.selection.main,l=t.state.doc.sliceString(s.from,s.to),d=a?.(l)??!1;let u;if(d)u=l.slice(e.length,l.length-o.length),t.dispatch(t.state.replaceSelection(u));else if(u=`${e}${l}${o}`,t.dispatch(t.state.replaceSelection(u)),n!==0){const i=t.state.selection.main.head+n;t.dispatch({selection:{anchor:i}})}}function applyHeading(t,e){const o=t.state.selection.ranges,a=[],n=`${"#".repeat(e)} `;if(o.forEach(s=>{const l=t.state.doc.lineAt(s.from),d=t.state.doc.lineAt(s.to);for(let u=l.number;u<=d.number;u++){const m=t.state.doc.line(u),p=t.state.doc.sliceString(m.from,m.to).replace(/^#{1,6}\s+/,"").trimStart(),C=n+p;a.push({from:m.from,to:m.to,insert:C})}}),a.length>0){const l=t.state.doc.lineAt(o[0].from).from+n.length;t.dispatch({changes:a,selection:{anchor:l}})}}function formatBold(t){toggleFormat(t,{prefix:"**",suffix:"**",check:e=>e.startsWith("**")&&e.endsWith("**"),afterInsertCursorOffset:-2})}function formatItalic(t){toggleFormat(t,{prefix:"*",suffix:"*",check:e=>e.startsWith("*")&&e.endsWith("*"),afterInsertCursorOffset:-1})}function formatStrikethrough(t){toggleFormat(t,{prefix:"~~",suffix:"~~",check:e=>e.startsWith("~~")&&e.endsWith("~~"),afterInsertCursorOffset:-2})}function formatLink(t){toggleFormat(t,{prefix:"[",suffix:"]()",check:e=>e.startsWith("[")&&e.endsWith("]()"),afterInsertCursorOffset:-1})}function formatCode(t){toggleFormat(t,{prefix:"`",suffix:"`",check:e=>e.startsWith("`")&&e.endsWith("`"),afterInsertCursorOffset:-1})}function formatUnorderedList(t){const e=t.state.selection.main,a=t.state.doc.sliceString(e.from,e.to).split(`
103
+ `),s=a.every(l=>l.trim().startsWith("- "))?a.map(l=>l.replace(/^- +/,"")).join(`
104
+ `):a.map(l=>`- ${l}`).join(`
105
+ `);t.dispatch(t.state.replaceSelection(s))}function formatOrderedList(t){const e=t.state.selection.main,a=t.state.doc.sliceString(e.from,e.to).split(`
106
+ `),s=a.every(l=>/^\d+\.\s/.test(l.trim()))?a.map(l=>l.replace(/^\d+\.\s+/,"")).join(`
107
+ `):a.map((l,d)=>`${d+1}. ${l}`).join(`
108
+ `);t.dispatch(t.state.replaceSelection(s))}function undoAction(t){return undo(t)}function redoAction(t){return redo(t)}async function formatJavaScript(t){const e=t.state.doc.toString(),o=await formatDoc(e,"javascript");t.dispatch({changes:{from:0,to:t.state.doc.length,insert:o}})}function javascriptSetup(){return[basicSetup,javascript$1(),keymap.of([{key:"Shift-Alt-f",run:t=>(formatJavaScript(t),!0)}])]}async function formatMarkdown(t){const e=t.state.doc.toString(),o=await formatDoc(e,"markdown");t.dispatch({changes:{from:0,to:t.state.doc.length,insert:o}})}function markdownKeymap(t){const{onSearch:e}=t||{};return keymap.of([{key:"Mod-z",run:undoAction},{key:"Mod-y",run:redoAction},{key:"Mod-Shift-z",run:redoAction},{key:"Mod-b",run:o=>(formatBold(o),!0)},{key:"Mod-i",run:o=>(formatItalic(o),!0)},{key:"Mod-d",run:o=>(formatStrikethrough(o),!0)},{key:"Mod-k",run:o=>(formatLink(o),!0)},{key:"Mod-e",run:o=>(formatCode(o),!0)},{key:"Mod-h",run:o=>(applyHeading(o,1),!0)},{key:"Mod-1",run:o=>(applyHeading(o,1),!0)},{key:"Mod-2",run:o=>(applyHeading(o,2),!0)},{key:"Mod-3",run:o=>(applyHeading(o,3),!0)},{key:"Mod-4",run:o=>(applyHeading(o,4),!0)},{key:"Mod-5",run:o=>(applyHeading(o,5),!0)},{key:"Mod-6",run:o=>(applyHeading(o,6),!0)},{key:"Mod-u",run:o=>(formatUnorderedList(o),!0)},{key:"Mod-o",run:o=>(formatOrderedList(o),!0)},...e?[{key:"Mod-f",run:o=>(e(o),!0)}]:[],{key:"Shift-Alt-f",run:o=>(formatMarkdown(o),!0)},{key:"Mod-g",run:()=>!0}])}function markdownSetup(t){return[history(),highlightSelectionMatches(),closeBrackets(),markdown$1({base:markdownLanguage,codeLanguages:languages,addKeymap:!0}),Prec.high(markdownKeymap(t)),keymap.of([...defaultKeymap,...historyKeymap,...closeBracketsKeymap]),EditorView.lineWrapping,EditorState.allowMultipleSelections.of(!0),placeholder("开始写作...")]}const customStyles=EditorView.theme({".cm-gutterElement":{display:"flex",justifyContent:"right",alignItems:"center"}});function lightTheme(){return[vsCodeLight,customStyles]}function darkTheme(){return[vsCodeDark,customStyles]}function theme(t){return t?darkTheme():lightTheme()}const DEFAULT_CONTENT=`# 探索 Markdown 的奇妙世界
109
+
110
+ 欢迎来到 Markdown 的奇妙世界!无论你是写作爱好者、开发者、博主,还是想要简单记录点什么的人,Markdown 都能成为你新的好伙伴。它不仅让写作变得简单明了,还能轻松地将内容转化为漂亮的网页格式。今天,我们将全面探讨 Markdown 的基础和进阶语法,让你在这个过程中充分享受写作的乐趣!
111
+
112
+ Markdown 是一种轻量级标记语言,用于格式化纯文本。它以简单、直观的语法而著称,可以快速地生成 HTML。Markdown 是写作与代码的完美结合,既简单又强大。
113
+
114
+ ## Markdown 基础语法
115
+
116
+ ### 1. 标题:让你的内容层次分明
117
+
118
+ 用 \`#\` 号来创建标题。标题从 \`#\` 开始,\`#\` 的数量表示标题的级别。
119
+
120
+ \`\`\`markdown
121
+ # 一级标题
122
+
123
+ ## 二级标题
124
+
125
+ ### 三级标题
126
+
127
+ #### 四级标题
128
+ \`\`\`
129
+
130
+ 以上代码将渲染出一组层次分明的标题,使你的内容井井有条。
131
+
132
+ ### 2. 段落与换行:自然流畅
133
+
134
+ Markdown 中的段落就是一行接一行的文本。要创建新段落,只需在两行文本之间空一行。
135
+
136
+ ### 3. 字体样式:强调你的文字
137
+
138
+ - **粗体**:用两个星号或下划线包裹文字,如 \`**粗体**\` 或 \`__粗体__\`。
139
+ - _斜体_:用一个星号或下划线包裹文字,如 \`*斜体*\` 或 \`_斜体_\`。
140
+ - ~~删除线~~:用两个波浪线包裹文字,如 \`~~删除线~~\`。
141
+ - ==高亮==:用两个等号包裹文字,如 \`==高亮==\`。
142
+ - ++下划线++:用两个加号包裹文字,如 \`++下划线++\`。
143
+ - ~波浪线~:用一个波浪线包裹文字,如 \`~波浪线~\`。
144
+
145
+ 这些简单的标记可以让你的内容更有层次感和重点突出。
146
+
147
+ ### 4. 列表:整洁有序
148
+
149
+ - **无序列表**:用 \`-\`、\`*\` 或 \`+\` 加空格开始一行。
150
+ - **有序列表**:使用数字加点号(\`1.\`、\`2.\`)开始一行。
151
+
152
+ 在列表中嵌套其他内容?只需缩进即可实现嵌套效果。
153
+
154
+ - 无序列表项 1
155
+ 1. 嵌套有序列表项 1
156
+ 2. 嵌套有序列表项 2
157
+ - 无序列表项 2
158
+
159
+ 1. 有序列表项 1
160
+ 2. 有序列表项 2
161
+
162
+ ### 5. 链接与图片:丰富内容
163
+
164
+ - **链接**:用方括号和圆括号创建链接 \`[显示文本](链接地址)\`。
165
+ - **图片**:和链接类似,只需在前面加上 \`!\`,如 \`![描述文本](图片链接)\`。
166
+
167
+ [访问 Doocs](https://github.com/doocs)
168
+
169
+ ![doocs](https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/logo-2.png)
170
+
171
+ 轻松实现富媒体内容展示!
172
+
173
+ > 因微信公众号平台不支持除公众号内容以外的链接,故其他平台的链接,会呈现链接样式但无法点击跳转。
174
+
175
+ > 对于这些链接请注意明文书写,或点击左上角「格式->微信外链接转底部引用」开启引用,这样就可以在底部观察到链接指向。
176
+
177
+ 另外,使用 \`<![alt](url),![alt](url)>\` 语法可以创建横屏滑动幻灯片,支持微信公众号平台。建议使用相似尺寸的图片以获得最佳显示效果。
178
+
179
+ ### 6. 引用:引用名言或引人深思的句子
180
+
181
+ 使用 \`>\` 来创建引用,只需在文本前面加上它。多层引用?在前一层 \`>\` 后再加一个就行。
182
+
183
+ > 这是一个引用
184
+ >
185
+ > > 这是一个嵌套引用
186
+
187
+ 这让你的引用更加富有层次感。
188
+
189
+ ### 7. 代码块:展示你的代码
190
+
191
+ - **行内代码**:用反引号包裹,如 \`code\`。
192
+ - **代码块**:用三个反引号包裹,并指定语言,如:
193
+
194
+ \`\`\`js
195
+ console.log(\`Hello, Doocs!\`)
196
+ \`\`\`
197
+
198
+ 语法高亮让你的代码更易读。
199
+
200
+ ### 8. 分割线:分割内容
201
+
202
+ 用三个或更多的 \`-\`、\`*\` 或 \`_\` 来创建分割线。
203
+
204
+ ---
205
+
206
+ 为你的内容添加视觉分隔。
207
+
208
+ ### 9. 表格:清晰展示数据
209
+
210
+ Markdown 支持简单的表格,用 \`|\` 和 \`-\` 分隔单元格和表头。
211
+
212
+ | 项目人员 | 邮箱 | 微信号 |
213
+ | ------------------------------------------- | ---------------------- | ------------ |
214
+ | [yanglbme](https://github.com/yanglbme) | contact@yanglibin.info | YLB0109 |
215
+ | [YangFong](https://github.com/YangFong) | yangfong2022@gmail.com | yq2419731931 |
216
+ | [thinkasany](https://github.com/thinkasany) | thinkasany@gmail.com | thinkasany |
217
+
218
+ 这样的表格让数据展示更为清爽!
219
+
220
+ > 手动编写标记太麻烦?我们提供了便捷方式。左上方点击「编辑->插入表格」,即可快速实现表格渲染。
221
+
222
+ ## Markdown 进阶技巧
223
+
224
+ ### 1. LaTeX 公式:完美展示数学表达式
225
+
226
+ Markdown 允许嵌入 LaTeX 语法展示数学公式:
227
+
228
+ - **行内公式**:用 \`$\` 包裹公式,如 $E = mc^2$。
229
+ - **块级公式**:用 \`$$\` 包裹公式,如:
230
+
231
+ $$
232
+ \\begin{aligned}
233
+ d_{i, j} &\\leftarrow d_{i, j} + 1 \\\\
234
+ d_{i, y + 1} &\\leftarrow d_{i, y + 1} - 1 \\\\
235
+ d_{x + 1, j} &\\leftarrow d_{x + 1, j} - 1 \\\\
236
+ d_{x + 1, y + 1} &\\leftarrow d_{x + 1, y + 1} + 1
237
+ \\end{aligned}
238
+ $$
239
+
240
+ 现在还支持 **LaTeX 标准格式**:
241
+
242
+ - **行内公式**:用 \`\\(...\\)\` 包裹公式,如 \\(x^2 + y^2 = z^2\\)。
243
+ - **块级公式**:用 \`\\[...\\]\` 包裹公式,如:
244
+
245
+ \\[
246
+ \\int\\_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}
247
+ \\]
248
+
249
+ 混合使用示例:传统格式 $a + b = c$ 和 LaTeX 格式 \\(d + e = f\\) 可以在同一段落中共存。
250
+
251
+ 1. 列表内块公式 1
252
+
253
+ $$
254
+ \\chi^2 = \\sum \\frac{(O - E)^2}{E}
255
+ $$
256
+
257
+ 2. 列表内块公式 2
258
+
259
+ $$
260
+ \\chi^2 = \\sum \\frac{(|O - E| - 0.5)^2}{E}
261
+ $$
262
+
263
+ 这是展示复杂数学表达的利器!
264
+
265
+ ### 2. Mermaid 流程图:可视化流程
266
+
267
+ Mermaid 是强大的可视化工具,可以在 Markdown 中创建流程图、时序图等。
268
+
269
+ \`\`\`mermaid
270
+ graph LR
271
+ A[GraphCommand] --> B[update]
272
+ A --> C[goto]
273
+ A --> D[send]
274
+
275
+ B --> B1[更新状态]
276
+ C --> C1[流程控制]
277
+ D --> D1[消息传递]
278
+ \`\`\`
279
+
280
+ \`\`\`mermaid
281
+ graph TD;
282
+ A-->B;
283
+ A-->C;
284
+ B-->D;
285
+ C-->D;
286
+ \`\`\`
287
+
288
+ \`\`\`mermaid
289
+ pie
290
+ title Key elements in Product X
291
+ "Calcium" : 42.96
292
+ "Potassium" : 50.05
293
+ "Magnesium" : 10.01
294
+ "Iron" : 5
295
+ \`\`\`
296
+
297
+ \`\`\`mermaid
298
+ pie
299
+ title 为什么总是宅在家里?
300
+ "喜欢宅" : 45
301
+ "天气太热" : 70
302
+ "穷" : 500
303
+ "没人约" : 95
304
+ \`\`\`
305
+
306
+ 这种方式不仅能直观展示流程,还能提升文档的专业性。
307
+
308
+ > 更多用法,参见:[Mermaid User Guide](https://mermaid.js.org/intro/getting-started.html)。
309
+
310
+ ### 3. PlantUML 流程图:可视化流程
311
+
312
+ PlantUML 是强大的可视化工具,可以在 Markdown 中创建流程图、时序图等。
313
+
314
+ \`\`\`plantuml
315
+ @startuml
316
+ participant Participant as Foo
317
+ actor Actor as Foo1
318
+ boundary Boundary as Foo2
319
+ control Control as Foo3
320
+ entity Entity as Foo4
321
+ database Database as Foo5
322
+ collections Collections as Foo6
323
+ queue Queue as Foo7
324
+ Foo -> Foo1 : To actor
325
+ Foo -> Foo2 : To boundary
326
+ Foo -> Foo3 : To control
327
+ Foo -> Foo4 : To entity
328
+ Foo -> Foo5 : To database
329
+ Foo -> Foo6 : To collections
330
+ Foo -> Foo7: To queue
331
+ @enduml
332
+ \`\`\`
333
+
334
+ > 更多用法,参见:[PlantUML 主页](https://plantuml.com/zh/)。
335
+
336
+ ### 4. Ruby 注音:注音标注
337
+
338
+ 支持两种格式:
339
+
340
+ \`\`\`md
341
+ 1. [文字]{注音}
342
+ 2. [文字]^(注音)
343
+ \`\`\`
344
+
345
+ 渲染效果如下:
346
+
347
+ [你好]{nǐ hǎo} [世界]{shì jiè}
348
+
349
+ 支持四种分隔符: \`・\`(中点)、\`.\` (全角句点)、\`。\` (中文句号)、\`-\` (英文减号)
350
+
351
+ 示例:
352
+
353
+ \`\`\`md
354
+ [你好世界]{nǐ・hǎo・shì・jiè}
355
+ [小夜時雨]^(さ・よ・しぐれ)
356
+ \`\`\`
357
+
358
+ [你好世界]{nǐ・hǎo・shì・jiè}
359
+ [小夜時雨]^(さ・よ・しぐれ)
360
+
361
+ 当字符串数量与分隔符数量不匹配时,会自动匹配到最合适的分隔符。
362
+
363
+ \`\`\`md
364
+ [小夜時雨]{さ・よ・しぐれ}
365
+ [小夜時雨]{さ・よ}
366
+ [小夜]{さ・よ・しぐれ}
367
+ [小夜時雨]{さ・よ・しぐれ・extra}
368
+ \`\`\`
369
+
370
+ [小夜時雨]{さ・よ・しぐれ}
371
+ [小夜時雨]{さ・よ}
372
+ [小夜]{さ・よ・しぐれ}
373
+ [小夜時雨]{さ・よ・しぐれ・extra}
374
+
375
+ ## 结语
376
+
377
+ Markdown 是一种简单、强大且易于掌握的标记语言,通过学习基础和进阶语法,你可以快速创作内容并有效传达信息。无论是技术文档、个人博客还是项目说明,Markdown 都是你的得力助手。希望这篇内容能够带你全面了解 Markdown 的潜力,让你的写作更加丰富多彩!
378
+
379
+ 现在,拿起 Markdown 编辑器,开始创作吧!探索 Markdown 的世界,你会发现它远比想象中更精彩!
380
+
381
+ #### 推荐阅读
382
+
383
+ - [阿里又一个 20k+ stars 开源项目诞生,恭喜 fastjson!](https://mp.weixin.qq.com/s/RNKDCK2KoyeuMeEs6GUrow)
384
+ - [刷掉 90% 候选人的互联网大厂海量数据面试题(附题解 + 方法总结)](https://mp.weixin.qq.com/s/rjGqxUvrEqJNlo09GrT1Dw)
385
+ - [好用!期待已久的文本块功能究竟如何在 Java 13 中发挥作用?](https://mp.weixin.qq.com/s/kalGv5T8AZGxTnLHr2wDsA)
386
+ - [2019 GitHub 开源贡献排行榜新鲜出炉!微软谷歌领头,阿里跻身前 12!](https://mp.weixin.qq.com/s/_q812aGD1b9QvZ2WFI0Qgw)
387
+
388
+ ---
389
+
390
+ <center>
391
+ <img src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png" style="width: 100px;">
392
+ </center>
393
+ `,DEFAULT_CSS_CONTENT=`/**
394
+ * 按 Alt/Option + Shift + F 可格式化
395
+ * 如需使用主题色,请使用 var(--md-primary-color) 代替颜色值
396
+ * 如:color: var(--md-primary-color);
397
+ *
398
+ * 召集令:如果你有好看的主题样式,欢迎分享,让更多人能够使用到你的主题。
399
+ * 提交区:https://github.com/doocs/md/discussions/426
400
+ */
401
+ /* 顶层容器样式 */
402
+ container {
403
+ }
404
+ /* 一级标题样式 */
405
+ h1 {
406
+ }
407
+ /* 二级标题样式 */
408
+ h2 {
409
+ }
410
+ /* 三级标题样式 */
411
+ h3 {
412
+ }
413
+ /* 四级标题样式 */
414
+ h4 {
415
+ }
416
+ /* 五级标题样式 */
417
+ h5 {
418
+ }
419
+ /* 六级标题样式 */
420
+ h6 {
421
+ }
422
+ /* 图片样式 */
423
+ image {
424
+ }
425
+ /* 引用样式 */
426
+ blockquote {
427
+ }
428
+ /* 引用段落样式 */
429
+ blockquote_p {
430
+ }
431
+ /* 段落样式 */
432
+ p {
433
+ }
434
+ /* 分割线样式 */
435
+ hr {
436
+ }
437
+ /* 行内代码样式 */
438
+ codespan {
439
+ }
440
+ /* 斜体样式 */
441
+ em {
442
+ }
443
+ /* 粗体样式 */
444
+ strong {
445
+ }
446
+ /* 链接样式 */
447
+ link {
448
+ }
449
+ /* 微信链接样式 */
450
+ wx_link {
451
+ }
452
+ /* 有序列表样式 */
453
+ ol {
454
+ }
455
+ /* 无序列表样式 */
456
+ ul {
457
+ }
458
+ /* 列表项样式 */
459
+ listitem {
460
+ }
461
+ /* 代码块样式 */
462
+ code {
463
+ }
464
+ /* 代码块外层样式 */
465
+ code_pre {
466
+ }
467
+ /* 行内公式样式 */
468
+ inline_katex {
469
+ }
470
+ /* 公式块样式 */
471
+ block_katex {
472
+ }
473
+ /* 表格样式 */
474
+ table {
475
+ }
476
+ /* 表格头样式 */
477
+ thead{
478
+ }
479
+ /* 表格标题格样式 */
480
+ th {
481
+ }
482
+ /* 表格内容格样式 */
483
+ td {
484
+ }
485
+
486
+ /* GFM note 样式 */
487
+ blockquote_note {
488
+ }
489
+ /* GFM tip 样式 */
490
+ blockquote_tip {
491
+ }
492
+ /* GFM info 样式 */
493
+ blockquote_info {
494
+ }
495
+ /* GFM important 样式 */
496
+ blockquote_important {
497
+ }
498
+ /* GFM warning 样式 */
499
+ blockquote_warning {
500
+ }
501
+ /* GFM caution 样式 */
502
+ blockquote_caution {
503
+ }
504
+ /* GFM 通用标题 */
505
+ blockquote_title {
506
+ }
507
+ /* GFM note 标题 */
508
+ blockquote_title_note {
509
+ }
510
+ /* GFM tip 标题 */
511
+ blockquote_title_tip {
512
+ }
513
+ /* GFM info 标题 */
514
+ blockquote_title_info {
515
+ }
516
+ /* GFM important 标题 */
517
+ blockquote_title_important {
518
+ }
519
+ /* GFM warning 标题 */
520
+ blockquote_title_warning {
521
+ }
522
+ /* GFM caution 标题 */
523
+ blockquote_title_caution {
524
+ }
525
+ /* GFM note 段落样式 */
526
+ blockquote_p_note {
527
+ }
528
+ /* GFM tip 段落样式 */
529
+ blockquote_p_tip {
530
+ }
531
+ /* GFM info 段落样式 */
532
+ blockquote_p_info {
533
+ }
534
+ /* GFM important 段落样式 */
535
+ blockquote_p_important {
536
+ }
537
+ /* GFM warning 段落样式 */
538
+ blockquote_p_warning {
539
+ }
540
+ /* GFM caution 段落样式 */
541
+ blockquote_p_caution {
542
+ }
543
+ `;function sanitizeTitle(t){const o=/[\\/:*?"<>|]/g;if(!o.test(t)&&t.length<=100)return t.trim()||"untitled";const a=t.replace(o,"_").trim();return(a.length>100?a.slice(0,100):a)||"untitled"}function removeLeft(t){const e=t.split(`
544
+ `),o=e.filter(a=>a.trim()).map(a=>a.match(/(^\s+)?/)[0].length).sort((a,n)=>a-n)[0];return e.map(a=>a.slice(o)).join(`
545
+ `)}function checkImage(t){if(!/\.(?:gif|jpe?g|png)$/i.test(t.name))return{ok:!1,msg:"请上传 JPG/PNG/GIF 格式的图片"};const o=10;return t.size>o*1024*1024?{ok:!1,msg:`由于公众号限制,图片大小不能超过 ${o}M`}:{ok:!0,msg:""}}function css2json(t){t=t.replace(/\/\*[\s\S]*?\*\//g,"");const e={},o=a=>a.reduce((n,s)=>{const[l,...d]=s.split(":").map(u=>u.trim());return l&&(n[l]=d.join(":")),n},{});for(;t.includes("{")&&t.includes("}");){const a=t.indexOf("{"),n=t.indexOf("}"),s=t.substring(a+1,n).split(";").map(u=>u.trim()).filter(Boolean),l=t.substring(0,a).split(",").map(u=>u.trim()),d=o(s);l.forEach(u=>{e[u]={...e[u]||{},...d}}),t=t.slice(n+1).trim()}return e}const service=axios.create({baseURL:"",timeout:30*1e3});service.interceptors.request.use(t=>(/^(?:post|put|delete)$/i.test(`${t.method}`)&&t.data&&t.data.upload&&(t.headers["Content-Type"]="multipart/form-data"),t),t=>{Promise.reject(t)});service.interceptors.response.use(t=>t.data?t.data:Promise.reject(t),t=>Promise.reject(t));function utf16to8(t){let e="";const o=t.length;for(let a=0;a<o;a++){const n=t.charCodeAt(a);n>=1&&n<=127?e+=t.charAt(a):n>2047?(e+=String.fromCharCode(224|n>>12&15),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|n&63)):(e+=String.fromCharCode(192|n>>6&31),e+=String.fromCharCode(128|n&63))}return e}function utf8to16(t){let e="",o=0;const a=t.length;for(;o<a;){const n=t.charCodeAt(o++);let s,l;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=t.charAt(o-1);break;case 12:case 13:s=t.charCodeAt(o++),e+=String.fromCharCode((n&31)<<6|s&63);break;case 14:s=t.charCodeAt(o++),l=t.charCodeAt(o++),e+=String.fromCharCode((n&15)<<12|(s&63)<<6|l&63);break}}return e}const base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",base64DecodeChars=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];function base64encode(t){let e="",o=0;const a=t.length;for(;o<a;){const n=t.charCodeAt(o++)&255;if(o===a){e+=base64EncodeChars.charAt(n>>2),e+=base64EncodeChars.charAt((n&3)<<4),e+="==";break}const s=t.charCodeAt(o++);if(o===a){e+=base64EncodeChars.charAt(n>>2),e+=base64EncodeChars.charAt((n&3)<<4|(s&240)>>4),e+=base64EncodeChars.charAt((s&15)<<2),e+="=";break}const l=t.charCodeAt(o++);e+=base64EncodeChars.charAt(n>>2),e+=base64EncodeChars.charAt((n&3)<<4|(s&240)>>4),e+=base64EncodeChars.charAt((s&15)<<2|(l&192)>>6),e+=base64EncodeChars.charAt(l&63)}return e}function base64decode(t){let e,o,a,n,s=0;const l=t.length;let d="";for(;s<l;){do e=base64DecodeChars[t.charCodeAt(s++)&255];while(s<l&&e===-1);if(e===-1)break;do o=base64DecodeChars[t.charCodeAt(s++)&255];while(s<l&&o===-1);if(o===-1)break;d+=String.fromCharCode(e<<2|(o&48)>>4);do{if(a=t.charCodeAt(s++)&255,a===61)return d;a=base64DecodeChars[a]}while(s<l&&a===-1);if(a===-1)break;d+=String.fromCharCode((o&15)<<4|(a&60)>>2);do{if(n=t.charCodeAt(s++)&255,n===61)return d;n=base64DecodeChars[n]}while(s<l&&n===-1);if(n===-1)break;d+=String.fromCharCode((a&3)<<6|n)}return d}function safe64(t){return t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_"),t}const tokenTools=Object.freeze(Object.defineProperty({__proto__:null,base64decode,base64encode,safe64,utf16to8,utf8to16},Symbol.toStringTag,{value:"Module"}));function addPrefix(t){return`${prefix}__${t}`}function downloadMD(t,e="untitled"){const o=sanitizeTitle(e);downloadFile(t,`${o}.md`,"text/markdown;charset=utf-8")}function setStyles(t){function e(s,l=["width","height","inlineSize","webkitLogicalWidth","webkitLogicalHeight"]){const d=getComputedStyle(s,null);return Object.entries(d).filter(([u])=>{const m=u.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);return d.getPropertyValue(m)&&!l.includes(u)}).map(([u,m])=>`${u.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`)}:${m};`).join("")}switch(!0){case o(t):case a(t):case n(t):t.setAttribute("style",e(t))}t.children.length&&Array.from(t.children).forEach(s=>setStyles(s));function o(s){return s.tagName==="PRE"&&Array.from(s.classList).includes("code__pre")}function a(s){return s==null?!1:s.tagName==="CODE"}function n(s){return s.tagName==="SPAN"&&(a(s.parentElement)||a(s.parentElement.parentElement))}}function processHtmlContent(t){const e=document.querySelector("#output");return setStyles(e),e.innerHTML.replace(/var\(--md-primary-color\)/g,t).replace(/--md-primary-color:.+?;/g,"")}function exportHTML(t,e="untitled"){const a=`<html><head><meta charset="utf-8" /></head><body><div style="width: 750px; margin: auto;">${processHtmlContent(t)}</div></body></html>`;downloadFile(a,`${sanitizeTitle(e)}.html`,"text/html")}async function generatePureHTML(t){const e=new B;return e.use(markedAlert({withoutStyle:!0})),e.use(MDKatex({nonStandard:!0},"","",!1)),await e.parse(t)}async function exportPureHTML(t,e="untitled"){const o=sanitizeTitle(e),a=await generatePureHTML(t);downloadFile(a,`${o}.html`,"text/html")}function exportPDF(t,e="untitled"){const o=processHtmlContent(t),a=sanitizeTitle(e),n=window.open("","_blank");if(!n){console.error("无法打开打印窗口");return}n.document.write(`
546
+ <!DOCTYPE html>
547
+ <html>
548
+ <head>
549
+ <meta charset="utf-8">
550
+ <title>${a}</title>
551
+ <style>
552
+ @page {
553
+ @top-center {
554
+ content: "${a}";
555
+ font-size: 12px;
556
+ color: #666;
557
+ }
558
+ @bottom-left {
559
+ content: "微信 Markdown 编辑器";
560
+ font-size: 10px;
561
+ color: #999;
562
+ }
563
+ @bottom-right {
564
+ content: "第 " counter(page) " 页,共 " counter(pages) " 页";
565
+ font-size: 10px;
566
+ color: #999;
567
+ }
568
+ }
569
+
570
+ @media print {
571
+ body { margin: 0; }
572
+ }
573
+ </style>
574
+ </head>
575
+ <body>
576
+ <div style="width: 100%; max-width: 750px; margin: auto;">
577
+ ${o}
578
+ </div>
579
+ </body>
580
+ </html>
581
+ `),n.document.close(),n.onload=()=>{n.print(),n.onafterprint=()=>{n.close()}}}function solveWeChatImage(){const e=document.getElementById("output").getElementsByTagName("img");Array.from(e).forEach(o=>{const a=o.getAttribute("width"),n=o.getAttribute("height");o.removeAttribute("width"),o.removeAttribute("height"),o.style.width=a,o.style.height=n})}async function getHljsStyles(){const t=document.querySelector("#hljs");if(!t)return"";try{return`<style>${await(await fetch(t.href)).text()}</style>`}catch(e){return console.warn("Failed to fetch highlight.js styles:",e),""}}function mergeCss(t){return juice(t,{inlinePseudoElements:!0,preserveImportant:!0})}function modifyHtmlStructure(t){const e=document.createElement("div");return e.innerHTML=t,e.querySelectorAll("li > ul, li > ol").forEach(o=>{o.parentElement.insertAdjacentElement("afterend",o)}),e.innerHTML}function createEmptyNode(){const t=document.createElement("p");return t.style.fontSize="0",t.style.lineHeight="0",t.style.margin="0",t.innerHTML="&nbsp;",t}async function processClipboardContent(t){const e=document.getElementById("output"),o=await getHljsStyles();o&&(e.innerHTML=o+e.innerHTML),e.innerHTML=modifyHtmlStructure(mergeCss(e.innerHTML)),e.innerHTML=e.innerHTML.replace(/([^-])top:(.*?)em/g,"$1transform: translateY($2em)").replace(/hsl\(var\(--foreground\)\)/g,"#3f3f3f").replace(/var\(--blockquote-background\)/g,"#f7f7f7").replace(/var\(--md-primary-color\)/g,t).replace(/--md-primary-color:.+?;/g,"").replace(/<span class="nodeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g,'<span class="nodeLabel"$1>$2</span>').replace(/<span class="edgeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g,'<span class="edgeLabel"$1>$2</span>'),solveWeChatImage();const a=createEmptyNode(),n=createEmptyNode();e.insertBefore(a,e.firstChild),e.appendChild(n),e.querySelectorAll(".nodeLabel").forEach(l=>{const d=l.parentElement,u=d.getAttribute("xmlns"),m=d.getAttribute("style"),i=document.createElement("section");i.setAttribute("xmlns",u),i.setAttribute("style",m),i.innerHTML=d.innerHTML;const p=d.parentElement;p.innerHTML="",p.appendChild(i)}),e.innerHTML=e.innerHTML.replace(/<tspan([^>]*)>/g,'<tspan$1 style="fill: #333333 !important; color: #333333 !important; stroke: none !important;">')}function legacyCopy(t){return new Promise((e,o)=>{try{const a=document.createElement("textarea");a.value=t,a.setAttribute("readonly","true"),a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();const n=document.execCommand("copy");document.body.removeChild(a),n?e():o(new Error("execCommand failed"))}catch(a){o(a)}})}async function copyPlain(t){if(window.isSecureContext&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}await legacyCopy(t)}const useStore=defineStore("store",()=>{const t=useDark(),e=useToggle(t),o=useStorage("isMacCodeBlock",defaultStyleConfig.isMacCodeBlock),a=useToggle(o),n=useStorage("isShowLineNumber",defaultStyleConfig.isShowLineNumber),s=useToggle(n),l=useStorage("isEditOnLeft",!0),d=useToggle(l),u=useStorage("isCiteStatus",defaultStyleConfig.isCiteStatus),m=useToggle(u),i=useStorage("showAIToolbox",!0),p=useToggle(i),C=useStorage("isCountStatus",defaultStyleConfig.isCountStatus),h=useToggle(C),T=useStorage(addPrefix("use_indent"),!1),v=useToggle(T),g=useStorage(addPrefix("use_justify"),!1),f=useToggle(g),_=ref(""),b=useStorage(addPrefix("theme"),defaultStyleConfig.theme),R=useStorage("fonts",defaultStyleConfig.fontFamily),N=useStorage("size",defaultStyleConfig.fontSize),y=useStorage("color",defaultStyleConfig.primaryColor),E=useStorage("codeBlockTheme",defaultStyleConfig.codeBlockTheme),S=useStorage("legend",defaultStyleConfig.legend),j=useStorage("previewWidth",widthOptions[0].value),oe=computed(()=>Number(N.value.replace("px",""))),V=ref(null),ne=useStorage("__editor_content",DEFAULT_CONTENT),H=useStorage(addPrefix("is_open_right_slider"),!1),Y=useStorage(addPrefix("is_open_post_slider"),!1),$=useStorage(addPrefix("posts"),[{id:v4(),title:"内容1",content:DEFAULT_CONTENT,history:[{datetime:new Date().toLocaleString("zh-cn"),content:DEFAULT_CONTENT}],createDatetime:new Date,updateDatetime:new Date}]),x=useStorage(addPrefix("current_post_id"),""),J=useStorage("isMobile",!1);function W(){J.value=window.innerWidth<=768}onMounted(()=>{W(),window.addEventListener("resize",W)}),onBeforeUnmount(()=>{window.removeEventListener("resize",W)}),onBeforeMount(()=>{$.value=$.value.map((I,ue)=>{const we=Date.now();return{...I,id:I.id??v4(),createDatetime:I.createDatetime??new Date(we+ue),updateDatetime:I.updateDatetime??new Date(we+ue)}}),(!x.value||!$.value.some(I=>I.id===x.value))&&(x.value=$.value[0]?.id??"")});const de=I=>$.value.findIndex(ue=>ue.id===I),Z=computed({get:()=>de(x.value),set:I=>{I>=0&&I<$.value.length&&(x.value=$.value[I].id)}}),le=I=>$.value.find(ue=>ue.id===I),ge=(I,ue=null)=>{const we={id:v4(),title:I,content:`# ${I}`,history:[{datetime:new Date().toLocaleString("zh-cn"),content:`# ${I}`}],createDatetime:new Date,updateDatetime:new Date,parentId:ue};$.value.push(we),x.value=we.id},A=(I,ue)=>{const we=le(I);we&&(we.title=ue)},F=I=>{const ue=de(I);ue!==-1&&($.value.splice(ue,1),x.value=$.value[Math.min(ue,$.value.length-1)]?.id??"")},M=(I,ue)=>{const we=le(I);we&&(we.parentId=ue,we.updateDatetime=new Date)},z=()=>{$.value.forEach(I=>{I.collapsed=!0})},ae=()=>{$.value.forEach(I=>{I.collapsed=!1})};watch(x,()=>{const I=le(x.value);I&&V.value&&V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:I.content}})}),onMounted(()=>{if(ne.value!==DEFAULT_CONTENT){const I=le(x.value);I&&(I.content=ne.value),ne.value=DEFAULT_CONTENT}});const ee=()=>{V.value&&formatDoc(V.value.state.doc.toString()).then(I=>{$.value[Z.value].content=I,V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:I}})})},K=()=>{const I=E.value,ue=document.querySelector("#hljs");if(ue)ue.setAttribute("href",I);else{const we=document.createElement("link");we.setAttribute("type","text/css"),we.setAttribute("rel","stylesheet"),we.setAttribute("href",I),we.setAttribute("id","hljs"),document.head.appendChild(we)}},L=ref(null),G=ref(null),te=I=>{L.value&&L.value.dispatch({changes:{from:0,to:L.value.state.doc.length,insert:I}})},fe=useStorage("__css_content",DEFAULT_CSS_CONTENT),se=useStorage(addPrefix("css_content_config"),{active:"方案1",tabs:[{title:"方案1",name:"方案1",content:fe.value||DEFAULT_CSS_CONTENT}]});onMounted(()=>{fe.value=""});const re=()=>se.value.tabs.find(I=>I.name===se.value.active),ce=I=>{se.value.active=I;const ue=se.value.tabs.find(we=>we.name===I).content;te(ue)},q=I=>{const ue=re();ue.title=I,ue.name=I,se.value.active=I},P=I=>{se.value.tabs.push({name:I,title:I,content:DEFAULT_CSS_CONTENT}),se.value.active=I,te(DEFAULT_CSS_CONTENT)},_e=I=>se.value.tabs.every(({name:ue})=>ue!==I),me=initRenderer({theme:customCssWithTemplate(css2json(re().content),y.value,customizeTheme(themeMap[b.value],{fontSize:oe.value,color:y.value})),fonts:R.value,size:N.value,isUseIndent:T.value,isUseJustify:g.value,isMacCodeBlock:o.value,isShowLineNumber:n.value}),be=reactive({chars:0,words:0,minutes:0}),ke=ref([]),xe=()=>{K(),me.reset({citeStatus:u.value,legend:S.value,isUseIndent:T.value,isUseJustify:g.value,countStatus:C.value,isMacCodeBlock:o.value,isShowLineNumber:n.value});const I=V.value?V.value.state.doc.toString():"",{html:ue,readingTime:we}=renderMarkdown(I,me);be.chars=I.length,be.words=we.words,be.minutes=Math.ceil(we.minutes),_.value=postProcessHtml(ue,we,me);const Ee=document.createElement("div");Ee.innerHTML=_.value;const Xe=Ee.querySelectorAll("[data-heading]");ke.value=[];let De=0;for(const Ie of Xe)Ie.setAttribute("id",`${De}`),ke.value.push({url:`#${De}`,title:`${Ie.textContent}`,level:Number(Ie.tagName.slice(1))}),De++;_.value=Ee.innerHTML},ye=()=>{if(L.value){const I=css2json(L.value.state.doc.toString()),ue=customCssWithTemplate(I,y.value,customizeTheme(themeMap[b.value],{fontSize:oe.value,color:y.value}));me.setOptions({theme:ue}),xe()}};onMounted(()=>{const I=document.querySelector("#cssEditor");I.value=re().content;const ue=document.createElement("div");I.parentNode?.replaceChild(ue,I),G.value=new Compartment;const we=EditorState.create({doc:re().content,extensions:[cssSetup(),G.value.of(theme(t.value)),EditorView.updateListener.of(Ee=>{Ee.docChanged&&(ye(),re().content=Ee.state.doc.toString())})]});L.value=markRaw(new EditorView({state:we,parent:ue}))}),watch(t,()=>{L.value&&G.value&&L.value.dispatch({effects:G.value.reconfigure(theme(t.value))})});const Ce=()=>{u.value=defaultStyleConfig.isCiteStatus,o.value=defaultStyleConfig.isMacCodeBlock,n.value=defaultStyleConfig.isShowLineNumber,C.value=defaultStyleConfig.isCountStatus,b.value=defaultStyleConfig.theme,R.value=defaultStyleConfig.fontFamily,N.value=defaultStyleConfig.fontSize,y.value=defaultStyleConfig.primaryColor,E.value=defaultStyleConfig.codeBlockTheme,S.value=defaultStyleConfig.legend,se.value={active:"方案 1",tabs:[{title:"方案 1",name:"方案 1",content:fe.value||DEFAULT_CSS_CONTENT}]},L.value&&L.value.dispatch({changes:{from:0,to:L.value.state.doc.length,insert:DEFAULT_CSS_CONTENT}}),ye(),xe(),toast.success("样式已重置")},ve=I=>(...ue)=>{I(...ue),xe()},pe=(I,ue)=>{const we=themeMap[b.value],Ee=Number(I.replace("px",""));return customCssWithTemplate(css2json(re().content),ue,customizeTheme(we,{fontSize:Ee,color:ue}))},Ve=ve(I=>{me.setOptions({theme:customCssWithTemplate(css2json(re().content),y.value,customizeTheme(themeMap[I],{fontSize:oe.value}))}),b.value=I}),Be=ve(I=>{me.setOptions({fonts:I}),R.value=I}),$e=ve(I=>{const ue=pe(I,y.value);me.setOptions({size:I,theme:ue}),N.value=I}),Ne=ve(I=>{const ue=pe(N.value,I);me.setOptions({theme:ue}),y.value=I}),ie=ve(I=>{E.value=I}),Q=ve(I=>{j.value=I}),he=ve(I=>{S.value=I}),Te=ve(()=>{a()}),Ge=ve(()=>{s()}),Le=ve(()=>{m()}),Ae=ve(()=>{h()}),w=ve(()=>{v()}),D=ve(()=>{f()}),U=ve(()=>{p()}),Pe=()=>{const I=processHtmlContent(y.value);return document.querySelector("#output").innerHTML=_.value,I},Me=()=>{exportHTML(y.value,$.value[Z.value].title),document.querySelector("#output").innerHTML=_.value},Ue=()=>{V.value&&exportPureHTML(V.value.state.doc.toString(),$.value[Z.value].title)},ze=async()=>{const I=document.querySelector("#output-wrapper>.preview"),ue=await toPng(I,{backgroundColor:t.value?"":"#fff",skipFonts:!0,pixelRatio:Math.max(window.devicePixelRatio||1,2),style:{margin:"0"}});downloadFile(ue,`${sanitizeTitle($.value[Z.value].title)}.png`,"image/png")},Fe=()=>{exportPDF(y.value,$.value[Z.value].title),document.querySelector("#output").innerHTML=_.value},He=()=>{V.value&&downloadMD(V.value.state.doc.toString(),$.value[Z.value].title)},qe=()=>{V.value&&(V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:DEFAULT_CONTENT}}),toast.success("文档已重置"))},Ke=()=>{V.value&&(V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:""}}),toast.success("内容已清空"))},je=async()=>{if(V.value){const I=V.value.state.selection.main,ue=V.value.state.doc.sliceString(I.from,I.to);copyPlain(ue)}},Ye=async()=>{try{const I=await navigator.clipboard.readText();V.value&&V.value.dispatch(V.value.state.replaceSelection(I))}catch(I){console.log("粘贴失败",I)}},We=()=>{V.value&&console.log("Undo should be handled by keyboard shortcuts")},Je=()=>{V.value&&console.log("Redo should be handled by keyboard shortcuts")},Oe=ref(!1);return{isDark:t,toggleDark:e,isEditOnLeft:l,toggleEditOnLeft:d,isMacCodeBlock:o,isShowLineNumber:n,isCiteStatus:u,citeStatusChanged:Le,showAIToolbox:i,aiToolboxChanged:U,isUseIndent:T,useIndentChanged:w,isUseJustify:g,useJustifyChanged:D,isCountStatus:C,countStatusChanged:Ae,output:_,editor:V,cssEditor:L,theme:b,fontFamily:R,fontSize:N,primaryColor:y,codeBlockTheme:E,legend:S,readingTime:be,previewWidth:j,previewWidthChanged:Q,editorRefresh:xe,themeChanged:Ve,fontChanged:Be,sizeChanged:$e,colorChanged:Ne,codeBlockThemeChanged:ie,legendChanged:he,macCodeBlockChanged:Te,showLineNumberChanged:Ge,formatContent:ee,exportEditorContent2HTML:Me,exportEditorContent2PureHTML:Ue,exportEditorContent2MD:He,exportEditorContent2PDF:Fe,downloadAsCardImage:ze,importDefaultContent:qe,clearContent:Ke,copyToClipboard:je,pasteFromClipboard:Ye,undo:We,redo:Je,isOpenConfirmDialog:Oe,resetStyleConfirm:()=>{Oe.value=!0},resetStyle:Ce,cssContentConfig:se,addCssContentTab:P,validatorTabName:_e,setCssEditorValue:te,tabChanged:ce,renameTab:q,posts:$,currentPostId:x,currentPostIndex:Z,getPostById:le,addPost:ge,renamePost:A,delPost:F,isOpenPostSlider:Y,isOpenRightSlider:H,titleList:ke,isMobile:J,updatePostParentId:M,collapseAllPosts:z,expandAllPosts:ae,editorContent2HTML:Pe}}),useDisplayStore=defineStore("display",()=>{const t=useStorage("isShowCssEditor",!1),e=useToggle(t),o=ref(!1),a=useToggle(o),n=ref(!1),s=useToggle(n),l=ref(!1),d=useToggle(l),u=ref(!1),m=ref(!1);function i(C){u.value=C??!u.value}function p(C){m.value=C??!m.value}return{isShowCssEditor:t,toggleShowCssEditor:e,isShowInsertFormDialog:o,toggleShowInsertFormDialog:a,isShowInsertMpCardDialog:n,toggleShowInsertMpCardDialog:s,isShowUploadImgDialog:l,toggleShowUploadImgDialog:d,aiDialogVisible:u,toggleAIDialog:i,aiImageDialogVisible:m,toggleAIImageDialog:p}});function getAllStoreStates(){const t=useStore(),e=useDisplayStore();return{isDark:t.isDark,isEditOnLeft:t.isEditOnLeft,isMacCodeBlock:t.isMacCodeBlock,isShowLineNumber:t.isShowLineNumber,isCiteStatus:t.isCiteStatus,showAIToolbox:t.showAIToolbox,isCountStatus:t.isCountStatus,isUseIndent:t.isUseIndent,isUseJustify:t.isUseJustify,isOpenRightSlider:t.isOpenRightSlider,isOpenPostSlider:t.isOpenPostSlider,theme:t.theme,fontFamily:t.fontFamily,fontSize:t.fontSize,primaryColor:t.primaryColor,codeBlockTheme:t.codeBlockTheme,legend:t.legend,currentPostId:t.currentPostId,currentPostIndex:t.currentPostIndex,posts:t.posts,cssContentConfig:t.cssContentConfig,titleList:t.titleList,readingTime:t.readingTime,isShowCssEditor:e.isShowCssEditor,isShowInsertFormDialog:e.isShowInsertFormDialog,isShowUploadImgDialog:e.isShowUploadImgDialog,isShowInsertMpCardDialog:e.isShowInsertMpCardDialog,aiDialogVisible:e.aiDialogVisible,aiImageDialogVisible:e.aiImageDialogVisible}}const _hoisted_1$v={class:"flex select-none items-center justify-end px-5 py-2 text-xs"},_hoisted_2$o={class:"space-x-2"},_sfc_main$1S=defineComponent({__name:"Footer",setup(t){const e=useStore(),{readingTime:o}=storeToRefs(e);return(a,n)=>(openBlock(),createElementBlock("footer",_hoisted_1$v,[createBaseVNode("div",_hoisted_2$o,[createBaseVNode("span",null,toDisplayString(unref(o).words)+" 个词 ",1),createBaseVNode("span",null,toDisplayString(unref(o).chars)+" 个字符 ",1),createBaseVNode("span",null," 阅读大约需 "+toDisplayString(unref(o).minutes)+" 分钟 ",1)])]))}}),_sfc_main$1R=defineComponent({__name:"AlertDialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Tv),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}});function cn(...t){return twMerge(clsx(t))}const _sfc_main$1Q=defineComponent({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(Av),null,{default:withCtx(()=>[createVNode(unref(kv),{class:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80"}),createVNode(unref(Ov),mergeProps(unref(s),{class:unref(cn)("fixed left-1/2 top-1/2 z-200 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$1P=defineComponent({__name:"AlertDialogFooter",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1O=defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(O),{as:t.as,"as-child":t.asChild,class:normalizeClass(unref(cn)(unref(buttonVariants)({variant:t.variant,size:t.size}),e.class))},{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),buttonVariants=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),_sfc_main$1N=defineComponent({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Nv),mergeProps(o.value,{class:unref(cn)(unref(buttonVariants)(),e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1M=defineComponent({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Mv),mergeProps(o.value,{class:unref(cn)(unref(buttonVariants)({variant:"outline"}),"mt-2 sm:mt-0",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1L=defineComponent({__name:"AlertDialogHeader",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col gap-y-2 text-center sm:text-left",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1K=defineComponent({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Fv),mergeProps(o.value,{class:unref(cn)("text-sm text-muted-foreground",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1J=defineComponent({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Vv),mergeProps(o.value,{class:unref(cn)("text-lg font-semibold",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1I=defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(nu),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$1H=defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(Iv),null,{default:withCtx(()=>[createVNode(unref($u),{class:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-200 bg-black/80"}),createVNode(unref(Pu),mergeProps(unref(s),{class:unref(cn)("fixed left-1/2 top-1/2 z-200 grid w-[90vw] max-w-md sm:max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default"),createVNode(unref(Xl),{class:"data-[state=open]:bg-accent ring-offset-background data-[state=open]:text-muted-foreground focus:ring-ring absolute right-4 top-4 rounded-sm opacity-70 transition-opacity disabled:pointer-events-none hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-offset-2"},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"}),d[0]||(d[0]=createBaseVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),_sfc_main$1G=defineComponent({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const o=t,a=e,n=reactiveOmit(o,"class"),s=useForwardPropsEmits(n,a);return(l,d)=>(openBlock(),createBlock(unref(RadioGroupRoot_default),mergeProps({"data-slot":"radio-group",class:unref(cn)("grid gap-3",o.class)},unref(s)),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1F=defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Vh),mergeProps(o.value,{class:unref(cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1E=defineComponent({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},setup(t){const e=t,o=reactiveOmit(e,"class"),a=useForwardProps(o);return(n,s)=>(openBlock(),createBlock(unref(RadioGroupItem_default),mergeProps({"data-slot":"radio-group-item"},unref(a),{class:unref(cn)("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e.class)}),{default:withCtx(()=>[createVNode(unref(RadioGroupIndicator_default),{"data-slot":"radio-group-indicator",class:"relative flex items-center justify-center"},{default:withCtx(()=>[createVNode(unref(Circle),{class:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})]),_:1})]),_:1},16,["class"]))}}),_sfc_main$1D=defineComponent({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},setup(t,{emit:e}){const o=t,n=useVModel(o,"modelValue",e,{passive:!0,defaultValue:o.defaultValue});return(s,l)=>withDirectives((openBlock(),createElementBlock("textarea",{"onUpdate:modelValue":l[0]||(l[0]=d=>isRef(n)?n.value=d:null),class:normalizeClass(unref(cn)("flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[vModelText,unref(n)]])}}),_hoisted_1$u={class:"min-h-[auto] md:min-h-[64px]"},_hoisted_2$n={class:"flex flex-1 flex-col justify-between"},_hoisted_3$k={class:"min-h-[40px] flex items-center w-full"},_hoisted_4$i={key:0,class:"mt-1 min-h-[20px] md:min-h-[24px] flex items-center text-[12px] text-red-500"},_hoisted_5$g={key:1,class:"mb-[-12px] md:mb-[-24px]"},_sfc_main$1C=defineComponent({__name:"FormItem",props:{label:{},required:{type:Boolean},error:{},width:{}},setup(t){const e=t;return(o,a)=>{const n=_sfc_main$1F;return openBlock(),createElementBlock("div",_hoisted_1$u,[createVNode(n,{class:"mb-4 md:mb-[24px] flex flex-col md:flex-row md:items-center"},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(["mb-1 md:mb-0 md:mr-4 min-h-[auto] md:min-h-[40px] w-full md:w-[150px] flex shrink-0 items-center justify-start md:justify-end font-bold text-sm md:text-base",{required:e.required}])},toDisplayString(e.label),3),createBaseVNode("div",_hoisted_2$n,[createBaseVNode("div",_hoisted_3$k,[renderSlot(o.$slots,"default",{},void 0,!0)]),t.error?(openBlock(),createElementBlock("p",_hoisted_4$i,toDisplayString(t.error),1)):createCommentVNode("",!0),t.error?(openBlock(),createElementBlock("div",_hoisted_5$g)):createCommentVNode("",!0)])]),_:3})])}}}),__unplugin_components_14=_export_sfc(_sfc_main$1C,[["__scopeId","data-v-e65b7ec5"]]),_sfc_main$1B=defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{}},setup(t,{expose:e,emit:o}){const a=t,s=useVModel(a,"modelValue",o,{passive:!0,defaultValue:a.defaultValue}),l=useAttrs(),d=ref();return e({focus:()=>d.value?.focus(),blur:()=>d.value?.blur(),select:()=>d.value?.select(),setSelectionRange:(u,m)=>d.value?.setSelectionRange(u,m),inputElement:d}),(u,m)=>withDirectives((openBlock(),createElementBlock("input",mergeProps({ref_key:"inputRef",ref:d,"onUpdate:modelValue":m[0]||(m[0]=i=>isRef(s)?s.value=i:null)},unref(l),{class:unref(cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a.class)}),null,16)),[[vModelDynamic,unref(s)]])}}),_sfc_main$1A=defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1z=defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Bu),mergeProps(unref(a),{class:unref(cn)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$t={class:"inline-flex items-center space-x-2 w-20"},_hoisted_2$m={class:"inline-flex items-center space-x-2 w-20"},_hoisted_3$j={class:"inline-flex items-center space-x-2 w-20"},_hoisted_4$h={class:"inline-flex items-center space-x-2 w-20"},_hoisted_5$f={class:"inline-flex items-center space-x-2 w-20"},_sfc_main$1y=defineComponent({__name:"InsertMpCardDialog",setup(t){const e=useStore(),o=useDisplayStore(),{toggleShowInsertMpCardDialog:a}=o,n=useStorage(addPrefix("mp-profile"),{id:"",name:"",logo:"",desc:"",serviceType:"1",verify:"0"}),s=toTypedSchema(create$3({id:create$6().required("公众号 ID 不能为空"),name:create$6().required("公众号名称 不能为空"),logo:create$6().optional().url("公众号 Logo 必须是一个有效的 URL"),desc:create$6().optional(),serviceType:create$6().required(),verify:create$6().required()}));function l(u){const m=u.logo||"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/mp-logo.png";return`<section class="mp_profile_iframe_wrp custom_select_card_wrp" nodeleaf="">
582
+ <mp-common-profile class="mpprofile js_uneditable custom_select_card mp_profile_iframe" ${['data-pluginname="mpprofile"',`data-id="${u.id}"`,`data-nickname="${u.name}"`,`data-headimg="${m}"`,u.desc&&`data-signature="${u.desc}"`,`data-service_type="${u.serviceType||"1"}"`,`data-verify_status="${u.verify||"0"}"`].filter(Boolean).join(" ")}></mp-common-profile>
583
+ <br class="ProseMirror-trailingBreak">
584
+ </section>`}function d(u){n.value=u;const m=l(u),i=toRaw(e.editor),p=i.state.selection.main;i.dispatch({changes:{from:p.from,to:p.to,insert:`
585
+ ${m}
586
+ `}}),toast.success("公众号名片插入成功"),a(!1)}return(u,m)=>{const i=_sfc_main$1z,p=_sfc_main$1A,C=_sfc_main$1B,h=__unplugin_components_14,T=_sfc_main$1D,v=_sfc_main$1E,g=_sfc_main$1F,f=_sfc_main$1G,_=_sfc_main$1O,b=_sfc_main$1H,R=_sfc_main$1I;return openBlock(),createBlock(R,{open:unref(o).isShowInsertMpCardDialog,"onUpdate:open":m[0]||(m[0]=N=>unref(o).isShowInsertMpCardDialog=N)},{default:withCtx(()=>[createVNode(b,null,{default:withCtx(()=>[createVNode(p,null,{default:withCtx(()=>[createVNode(i,null,{default:withCtx(()=>[...m[1]||(m[1]=[createTextVNode("插入公众号名片",-1)])]),_:1})]),_:1}),createVNode(unref(Form),{"validation-schema":unref(s),"initial-values":unref(n),onSubmit:d},{default:withCtx(()=>[createVNode(unref(Field),{name:"id"},{default:withCtx(({field:N,errorMessage:y})=>[createVNode(h,{label:"公众号 ID",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(C,mergeProps(N,{modelValue:N.value,"onUpdate:modelValue":E=>N.value=E,modelModifiers:{trim:!0},placeholder:"例:MzIxNjA5ODQ0OQ=="}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"name"},{default:withCtx(({field:N,errorMessage:y})=>[createVNode(h,{label:"公众号名称",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(C,mergeProps(N,{modelValue:N.value,"onUpdate:modelValue":E=>N.value=E,modelModifiers:{trim:!0},placeholder:"例:Doocs"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"logo"},{default:withCtx(({field:N,errorMessage:y})=>[createVNode(h,{label:"公众号 Logo",error:y,width:90},{default:withCtx(()=>[createVNode(C,mergeProps(N,{modelValue:N.value,"onUpdate:modelValue":E=>N.value=E,modelModifiers:{trim:!0},placeholder:"例:https://doocs.com/mp-logo.png"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"desc"},{default:withCtx(({field:N,errorMessage:y})=>[createVNode(h,{label:"公众号描述",error:y,width:90},{default:withCtx(()=>[createVNode(T,mergeProps(N,{modelValue:N.value,"onUpdate:modelValue":E=>N.value=E,modelModifiers:{trim:!0},rows:"3",placeholder:"例:GitHub 开源组织 @Doocs 旗下唯一公众号,专注分享技术领域相关知识及行业最新资讯。"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"serviceType"},{default:withCtx(({field:N,errorMessage:y})=>[createVNode(h,{label:"公众号类型",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(f,mergeProps({class:"flex gap-5"},N,{"default-value":N.value}),{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$t,[createVNode(v,{id:"option-one",value:"1"}),createVNode(g,{for:"option-one"},{default:withCtx(()=>[...m[2]||(m[2]=[createTextVNode("公众号",-1)])]),_:1})]),createBaseVNode("div",_hoisted_2$m,[createVNode(v,{id:"option-two",value:"2"}),createVNode(g,{for:"option-two"},{default:withCtx(()=>[...m[3]||(m[3]=[createTextVNode("服务号",-1)])]),_:1})])]),_:1},16,["default-value"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"verify"},{default:withCtx(({field:N,errorMessage:y})=>[createVNode(h,{label:"认证",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(f,mergeProps({class:"flex gap-5"},N,{"default-value":N.value}),{default:withCtx(()=>[createBaseVNode("div",_hoisted_3$j,[createVNode(v,{id:"service-type-option-one",value:"0"}),createVNode(g,{for:"service-type-option-one"},{default:withCtx(()=>[...m[4]||(m[4]=[createTextVNode("无",-1)])]),_:1})]),createBaseVNode("div",_hoisted_4$h,[createVNode(v,{id:"service-type-option-two",value:"1"}),createVNode(g,{for:"service-type-option-two"},{default:withCtx(()=>[...m[5]||(m[5]=[createTextVNode("个人",-1)])]),_:1})]),createBaseVNode("div",_hoisted_5$f,[createVNode(v,{id:"service-type-option-three",value:"2"}),createVNode(g,{for:"service-type-option-three"},{default:withCtx(()=>[...m[6]||(m[6]=[createTextVNode("企业",-1)])]),_:1})])]),_:1},16,["default-value"])]),_:2},1032,["error"])]),_:1}),createVNode(h,null,{default:withCtx(()=>[createVNode(_,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://github.com/doocs/md/blob/main/docs/mp-card.md",target:"_blank"},{default:withCtx(()=>[...m[7]||(m[7]=[createTextVNode(" 如何获取公众号 ID? ",-1)])]),_:1})]),_:1}),createVNode(h,null,{default:withCtx(()=>[createVNode(_,{type:"submit"},{default:withCtx(()=>[...m[8]||(m[8]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1})]),_:1},8,["open"])}}}),_sfc_main$1x=defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1w=defineComponent({__name:"NumberField",props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},formatOptions:{},locale:{},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(gy),mergeProps(unref(s),{class:unref(cn)("grid gap-1.5",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1v=defineComponent({__name:"NumberFieldContent",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("relative has-data-[slot=increment]:*:data-[slot=input]:pr-5 has-data-[slot=decrement]:*:data-[slot=input]:pl-5",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1u=defineComponent({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Cy),mergeProps({"data-slot":"increment"},unref(a),{class:unref(cn)("absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(Plus),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_sfc_main$1t=defineComponent({__name:"NumberFieldInput",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(by),{"data-slot":"input",class:normalizeClass(unref(cn)("flex h-10 w-full rounded-md border border-input bg-background py-2 text-sm text-center ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class))},null,8,["class"]))}}),_sfc_main$1s=defineComponent({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(wy),mergeProps({"data-slot":"decrement"},unref(a),{class:unref(cn)("absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(Minus),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_hoisted_1$s={class:"space-x-2 flex justify-between"},_hoisted_2$l={class:"space-y-2 border rounded p-2"},_sfc_main$1r=defineComponent({__name:"InsertFormDialog",setup(t){const e=useStore(),o=useDisplayStore(),{toggleShowInsertFormDialog:a}=o,n=ref(3),s=ref(3),l=ref({});function d(){n.value=3,s.value=3,l.value={}}function u(){const i=createTable({rows:n.value,cols:s.value,data:l.value}),p=toRaw(e.editor),C=p.state.selection.main;p.dispatch({changes:{from:C.from,to:C.to,insert:`
587
+ ${i}
588
+ `}}),d(),a()}function m(i){i||a(!1)}return(i,p)=>{const C=_sfc_main$1z,h=_sfc_main$1A,T=_sfc_main$1F,v=_sfc_main$1s,g=_sfc_main$1t,f=_sfc_main$1u,_=_sfc_main$1v,b=_sfc_main$1w,R=_sfc_main$1B,N=_sfc_main$1O,y=_sfc_main$1x,E=_sfc_main$1H,S=_sfc_main$1I;return openBlock(),createBlock(S,{open:unref(o).isShowInsertFormDialog,"onUpdate:open":m},{default:withCtx(()=>[createVNode(E,null,{default:withCtx(()=>[createVNode(h,null,{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[...p[3]||(p[3]=[createTextVNode("插入表格",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$s,[createVNode(b,{modelValue:unref(n),"onUpdate:modelValue":p[0]||(p[0]=j=>isRef(n)?n.value=j:null),min:1,max:100},{default:withCtx(()=>[createVNode(T,null,{default:withCtx(()=>[...p[4]||(p[4]=[createTextVNode("行数",-1)])]),_:1}),createVNode(_,null,{default:withCtx(()=>[createVNode(v),createVNode(g),createVNode(f)]),_:1})]),_:1},8,["modelValue"]),createVNode(b,{modelValue:unref(s),"onUpdate:modelValue":p[1]||(p[1]=j=>isRef(s)?s.value=j:null),min:1,max:100},{default:withCtx(()=>[createVNode(T,null,{default:withCtx(()=>[...p[5]||(p[5]=[createTextVNode("列数",-1)])]),_:1}),createVNode(_,null,{default:withCtx(()=>[createVNode(v),createVNode(g),createVNode(f)]),_:1})]),_:1},8,["modelValue"])]),createBaseVNode("div",_hoisted_2$l,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(n)+1,j=>(openBlock(),createElementBlock("div",{key:j,class:normalizeClass([{"head-style":j===1},"space-x-2 flex"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(s),oe=>(openBlock(),createBlock(R,{key:oe,modelValue:unref(l)[`k_${j-1}_${oe-1}`],"onUpdate:modelValue":V=>unref(l)[`k_${j-1}_${oe-1}`]=V,class:normalizeClass({"bg-gray-100 dark:bg-gray-900":j===1}),placeholder:j===1?"表头":""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"]))),128))],2))),128))]),createVNode(y,null,{default:withCtx(()=>[createVNode(N,{variant:"outline",onClick:p[2]||(p[2]=j=>unref(a)(!1))},{default:withCtx(()=>[...p[6]||(p[6]=[createTextVNode(" 取 消 ",-1)])]),_:1}),createVNode(N,{onClick:u},{default:withCtx(()=>[...p[7]||(p[7]=[createTextVNode(" 确 定 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),_sfc_main$1q=defineComponent({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Cg),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_hoisted_1$r={class:"space-y-4 min-w-0"},_hoisted_2$k={class:"h-60 border border-gray-200 dark:border-gray-700 rounded-lg flex flex-col overflow-y-auto"},_sfc_main$1p=defineComponent({__name:"CustomUploadForm",setup(t){const e=useLocalStorage("formCustomConfig",removeLeft(`
589
+ const { file, util, okCb, errCb } = CUSTOM_ARG
590
+ const param = new FormData()
591
+ param.append('file', file)
592
+ util.axios.post('${window.location.origin}/upload', param, {
593
+ headers: { 'Content-Type': 'multipart/form-data' }
594
+ }).then(res => {
595
+ okCb(res.url)
596
+ }).catch(err => {
597
+ errCb(err)
598
+ })
599
+ `).trim()),o=useTemplateRef("formCustomTextarea"),a=useStore(),{isDark:n}=storeToRefs(a),s=ref(null),l=new Compartment;onMounted(()=>{const u=new EditorView({parent:o.value,extensions:[javascriptSetup(),l.of(theme(n.value))],doc:e.value});s.value=u}),watch(n,u=>{s.value?.dispatch({effects:l.reconfigure(theme(u))})}),onUnmounted(()=>{s.value&&s.value.destroy()});function d(){const u=s.value.state.doc.toString();localStorage.setItem("formCustomConfig",u),e.value=u,toast.success("保存成功")}return(u,m)=>{const i=_sfc_main$1O;return openBlock(),createElementBlock("div",_hoisted_1$r,[createBaseVNode("div",_hoisted_2$k,[createBaseVNode("div",{ref_key:"formCustomTextarea",ref:o,class:"flex-1 custom-codemirror"},null,512)]),createVNode(i,{variant:"link",class:"p-0",as:"a",href:"https://github.com/doocs/md/blob/main/docs/custom-upload.md",target:"_blank"},{default:withCtx(()=>[...m[0]||(m[0]=[createTextVNode(" 参数详情? ",-1)])]),_:1}),createVNode(i,{class:"block",onClick:d},{default:withCtx(()=>[...m[1]||(m[1]=[createTextVNode(" 保存配置 ",-1)])]),_:1})])}}}),__unplugin_components_16=_export_sfc(_sfc_main$1p,[["__scopeId","data-v-e62c3060"]]),_sfc_main$1o=defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(_g),mergeProps({class:unref(cn)("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e.class)},o.value),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1n=defineComponent({__name:"Progress",props:{modelValue:{},max:{},getValueLabel:{type:Function},asChild:{type:Boolean},as:{}},setup(t){const e=t,o=computed(()=>e.modelValue??0);return(a,n)=>(openBlock(),createBlock(unref(Ry),mergeProps(e,{"model-value":unref(o),class:"relative overflow-hidden bg-blackA9 rounded-full w-full h-4 sm:h-5",style:{transform:"translateZ(0)"}}),{default:withCtx(()=>[createVNode(unref(Ay),{class:"bg-primary rounded-full w-full h-full transition-transform duration-[660ms] ease-[cubic-bezier(0.65, 0, 0.35, 1)]",style:normalizeStyle({transform:`translateX(-${100-(Number(unref(o))||0)}%)`})},null,8,["style"])]),_:1},16,["model-value"]))}}),_sfc_main$1m=defineComponent({__name:"Switch",props:{defaultChecked:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},value:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(gg),mergeProps(unref(s),{class:unref(cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",o.class)}),{default:withCtx(()=>[createVNode(unref(bg),{class:normalizeClass(unref(cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5"))},{default:withCtx(()=>[renderSlot(l.$slots,"thumb")]),_:3},8,["class"])]),_:3},16,["class"]))}}),_sfc_main$1l=defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Ky),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$1k=defineComponent({__name:"SelectGroup",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Xy),mergeProps({class:unref(cn)("p-1 w-full",e.class)},o.value),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$q={class:"absolute left-2 h-3.5 w-3.5 flex items-center justify-center"},_sfc_main$1j=defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(qy),mergeProps(unref(a),{class:unref(cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",e.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$q,[createVNode(unref(Yy),null,{default:withCtx(()=>[createVNode(unref(Check),{class:"h-4 w-4"})]),_:1})]),createVNode(unref(Jy),null,{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),_sfc_main$1i=defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(tg),mergeProps(unref(a),{class:unref(cn)("flex cursor-default items-center justify-center py-1",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(ChevronDown),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_sfc_main$1h=defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(eg),mergeProps(unref(a),{class:unref(cn)("flex cursor-default items-center justify-center py-1",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(ChevronUp),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_sfc_main$1g=defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Hy),mergeProps(unref(a),{class:unref(cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default"),createVNode(unref(ng),{"as-child":""},{default:withCtx(()=>[createVNode(unref(ChevronDown),{class:"h-4 w-4 shrink-0 opacity-50"})]),_:1})]),_:3},16,["class"]))}}),_sfc_main$1f=defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(ag),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$1e=defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(Wy),null,{default:withCtx(()=>[createVNode(unref(jy),mergeProps({...unref(s),...l.$attrs},{class:unref(cn)("relative z-200 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:withCtx(()=>[createVNode(unref(_sfc_main$1h)),createVNode(unref(Qy),{class:normalizeClass(unref(cn)("p-1",t.position==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"))},{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},8,["class"]),createVNode(unref(_sfc_main$1i))]),_:3},16,["class"])]),_:3}))}}),_sfc_main$1d=defineComponent({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(wg),mergeProps(o.value,{class:unref(cn)("inline-flex items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$p={class:"truncate"},_sfc_main$1c=defineComponent({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(xg),mergeProps(unref(a),{class:unref(cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs",e.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$p,[renderSlot(n.$slots,"default")])]),_:3},16,["class"]))}}),_hoisted_1$o={key:0,class:"absolute left-0 right-0 h-full w-full flex items-center justify-center bg-white dark:bg-black"},_hoisted_2$j=["src"],_hoisted_3$i={class:"flex flex-col items-start"},_hoisted_4$g={class:"flex flex-col items-start"},_sfc_main$1b=defineComponent({__name:"UploadImgDialog",emits:["uploadImage"],setup(t,{emit:e}){const o=e,a=useDisplayStore(),n=toTypedSchema(create$3({repo:create$6().required("GitHub 仓库不能为空"),branch:create$6().optional(),accessToken:create$6().required("GitHub Token 不能为空")})),s=ref(localStorage.getItem("githubConfig")?JSON.parse(localStorage.getItem("githubConfig")):{repo:"",branch:"",accessToken:""});function l(q){localStorage.setItem("githubConfig",JSON.stringify(q)),s.value=q,toast.success("保存成功")}const d=toTypedSchema(create$3({accessKeyId:create$6().required("AccessKey ID 不能为空"),accessKeySecret:create$6().required("AccessKey Secret 不能为空"),bucket:create$6().required("Bucket 不能为空"),region:create$6().required("Region 不能为空"),useSSL:create$7().required(),cdnHost:create$6().optional(),path:create$6().optional()})),u=ref(localStorage.getItem("aliOSSConfig")?JSON.parse(localStorage.getItem("aliOSSConfig")):{accessKeyId:"",accessKeySecret:"",bucket:"",region:"",useSSL:!0,cdnHost:"",path:""});function m(q){localStorage.setItem("aliOSSConfig",JSON.stringify(q)),u.value=q,toast.success("保存成功")}const i=toTypedSchema(create$3({secretId:create$6().required("Secret ID 不能为空"),secretKey:create$6().required("Secret Key 不能为空"),bucket:create$6().required("Bucket 不能为空"),region:create$6().required("Region 不能为空"),cdnHost:create$6().optional(),path:create$6().optional()})),p=ref(localStorage.getItem("txCOSConfig")?JSON.parse(localStorage.getItem("txCOSConfig")):{secretId:"",secretKey:"",bucket:"",region:"",cdnHost:"",path:""});function C(q){localStorage.setItem("txCOSConfig",JSON.stringify(q)),p.value=q,toast.success("保存成功")}const h=toTypedSchema(create$3({accessKey:create$6().required("AccessKey 不能为空"),secretKey:create$6().required("SecretKey 不能为空"),bucket:create$6().required("Bucket 不能为空"),domain:create$6().required("Bucket 对应域名不能为空"),region:create$6().optional(),path:create$6().optional()})),T=ref(localStorage.getItem("qiniuConfig")?JSON.parse(localStorage.getItem("qiniuConfig")):{accessKey:"",secretKey:"",bucket:"",domain:"",region:"",path:""});function v(q){localStorage.setItem("qiniuConfig",JSON.stringify(q)),T.value=q,toast.success("保存成功")}const g=toTypedSchema(create$3({endpoint:create$6().required("Endpoint 不能为空"),port:create$6().optional(),useSSL:create$7().required(),bucket:create$6().required("Bucket 不能为空"),accessKey:create$6().required("AccessKey 不能为空"),secretKey:create$6().required("SecretKey 不能为空")})),f=ref(localStorage.getItem("minioConfig")?JSON.parse(localStorage.getItem("minioConfig")):{endpoint:"",port:"",useSSL:!0,bucket:"",accessKey:"",secretKey:""});function _(q){localStorage.setItem("minioConfig",JSON.stringify(q)),f.value=q,toast.success("保存成功")}const b=toTypedSchema(create$3({token:create$6().required("Bot Token 不能为空"),chatId:create$6().required("Chat ID 不能为空")})),R=ref(localStorage.getItem("telegramConfig")?JSON.parse(localStorage.getItem("telegramConfig")):{token:"",chatId:""});function N(q){localStorage.setItem("telegramConfig",JSON.stringify(q)),R.value=q,toast.success("保存成功")}const E=!window.location.protocol.startsWith("http"),S=computed(()=>!E&&!0),j=computed(()=>S.value?"如:http://proxy.example.com":"可不填"),oe=computed(()=>toTypedSchema(create$3({proxyOrigin:S.value?create$6().required("代理域名不能为空"):create$6().optional(),appID:create$6().required("AppID 不能为空"),appsecret:create$6().required("AppSecret 不能为空")}))),V=ref(localStorage.getItem("mpConfig")?JSON.parse(localStorage.getItem("mpConfig")):{proxyOrigin:"",appID:"",appsecret:""});function ne(q){localStorage.setItem("mpConfig",JSON.stringify(q)),V.value=q,toast.success("保存成功")}const H=toTypedSchema(create$3({accountId:create$6().required("Account ID 不能为空"),accessKey:create$6().required("AccessKey 不能为空"),secretKey:create$6().required("SecretKey 不能为空"),bucket:create$6().required("Bucket 不能为空"),domain:create$6().required("Bucket 对应域名不能为空"),path:create$6().optional()})),Y=ref(localStorage.getItem("r2Config")?JSON.parse(localStorage.getItem("r2Config")):{accountId:"",accessKey:"",secretKey:"",bucket:"",domain:"",path:""});function $(q){localStorage.setItem("r2Config",JSON.stringify(q)),Y.value=q,toast.success("保存成功")}const x=computed(()=>toTypedSchema(create$3({bucket:create$6().required("Bucket 不能为空"),operator:create$6().required("操作员 不能为空"),password:create$6().required("密码 不能为空"),domain:create$6().required("CDN 域名不能为空"),path:create$6().optional()}))),J=ref(localStorage.getItem("upyunConfig")?JSON.parse(localStorage.getItem("upyunConfig")):{bucket:"",operator:"",password:"",domain:"",path:""});function W(q){localStorage.setItem("upyunConfig",JSON.stringify(q)),J.value=q,toast.success("保存成功")}const de=toTypedSchema(create$3({cloudName:create$6().required("Cloud Name 不能为空"),apiKey:create$6().required("API Key 不能为空"),apiSecret:create$6().optional(),uploadPreset:create$6().when("apiSecret",{is:q=>!q||q.length===0,then:q=>q.required("未填写 apiSecret 时必须提供上传预设名"),otherwise:q=>q.optional()}),folder:create$6().optional(),domain:create$6().optional()})),Z=ref(localStorage.getItem("cloudinaryConfig")?JSON.parse(localStorage.getItem("cloudinaryConfig")):{cloudName:"",apiKey:"",apiSecret:"",uploadPreset:"",folder:"",domain:""});function le(q){localStorage.setItem("cloudinaryConfig",JSON.stringify(q)),Z.value=q,toast.success("保存成功")}const ge=[{value:"default",label:"默认"},{value:"github",label:"GitHub"},{value:"aliOSS",label:"阿里云"},{value:"txCOS",label:"腾讯云"},{value:"qiniu",label:"七牛云"},{value:"minio",label:"MinIO"},{value:"mp",label:"公众号图床"},{value:"r2",label:"Cloudflare R2"},{value:"upyun",label:"又拍云"},{value:"telegram",label:"Telegram"},{value:"cloudinary",label:"Cloudinary"},{value:"formCustom",label:"自定义代码"}],A=ref("default"),F=ref(!1),M=ref("upload");onBeforeMount(()=>{localStorage.getItem("imgHost")&&(A.value=localStorage.getItem("imgHost"));const q=localStorage.getItem("useCompression");q!==null&&(F.value=q==="true")});function z(){localStorage.setItem("imgHost",A.value),toast.success("图床已切换")}function ae(){localStorage.setItem("useCompression",F.value.toString())}function ee(q){const P=checkImage(q);if(!P.ok)return toast.error(P.msg),!1;let _e=localStorage.getItem("imgHost");_e=_e||"default",localStorage.setItem("imgHost",_e);const me=localStorage.getItem(`${_e}Config`);return _e==="default"||me?!0:(toast.error(`请先配置 ${_e} 图床参数`),!1)}const K=ref(!1),{open:L,reset:G,onChange:te}=useFileDialog({accept:"image/*"});te(q=>{if(q==null)return;const P=q[0];ee(P)&&ce(P),G()});function fe(q){K.value=!1,q.stopPropagation();const P=Array.from(q.dataTransfer.files)[0];ee(P)&&ce(P)}const se=ref(0),re=ref("");function ce(q){se.value=0;const P=setInterval(()=>{const me=se.value+1;me>=100||(se.value=me)},100);o("uploadImage",q,(me,be)=>{clearInterval(P),se.value=100,be&&(re.value=`data:image/png;base64,${be}`),setTimeout(()=>{se.value=0,re.value=""},1e3)},!0)}return(q,P)=>{const _e=_sfc_main$1z,me=_sfc_main$1A,be=_sfc_main$1c,ke=_sfc_main$1d,xe=_sfc_main$1f,ye=_sfc_main$1g,Ce=_sfc_main$1j,ve=_sfc_main$1e,pe=_sfc_main$1l,Ve=_sfc_main$1F,Be=_sfc_main$1m,$e=_sfc_main$1n,Ne=_sfc_main$1o,ie=_sfc_main$1B,Q=__unplugin_components_14,he=_sfc_main$1O,Te=__unplugin_components_16,Ge=_sfc_main$1q,Le=_sfc_main$1H,Ae=_sfc_main$1I;return openBlock(),createBlock(Ae,{open:unref(a).isShowUploadImgDialog,"onUpdate:open":P[8]||(P[8]=w=>unref(a).isShowUploadImgDialog=w)},{default:withCtx(()=>[createVNode(Le,{class:"md:max-w-max max-h-[90vh] overflow-y-auto",onPointerDownOutside:P[7]||(P[7]=w=>w.preventDefault())},{default:withCtx(()=>[createVNode(me,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[...P[9]||(P[9]=[createTextVNode("本地上传",-1)])]),_:1})]),_:1}),createVNode(Ge,{modelValue:unref(M),"onUpdate:modelValue":P[6]||(P[6]=w=>isRef(M)?M.value=w:null),class:"w-full md:w-max"},{default:withCtx(()=>[createVNode(ke,{class:"grid w-full overflow-x-auto grid-cols-3 md:grid-cols-none md:flex md:flex-wrap gap-1"},{default:withCtx(()=>[createVNode(be,{value:"upload",class:"text-xs md:text-sm whitespace-nowrap"},{default:withCtx(()=>[...P[10]||(P[10]=[createTextVNode(" 选择上传 ",-1)])]),_:1}),(openBlock(!0),createElementBlock(Fragment,null,renderList(ge.filter(w=>w.value!=="default"),w=>(openBlock(),createBlock(be,{key:w.value,value:w.value,class:"text-xs md:text-sm whitespace-nowrap"},{default:withCtx(()=>[createTextVNode(toDisplayString(w.label),1)]),_:2},1032,["value"]))),128))]),_:1}),createVNode(Ne,{value:"upload"},{default:withCtx(()=>[createVNode(Ve,null,{default:withCtx(()=>[P[11]||(P[11]=createBaseVNode("span",{class:"my-4 block"}," 图床 ",-1)),createVNode(pe,{modelValue:unref(A),"onUpdate:modelValue":[P[0]||(P[0]=w=>isRef(A)?A.value=w:null),z]},{default:withCtx(()=>[createVNode(ye,null,{default:withCtx(()=>[createVNode(xe,{placeholder:"请选择"})]),_:1}),createVNode(ve,{class:"max-h-64 md:max-h-96"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(ge,w=>createVNode(Ce,{key:w.value,label:w.label,value:w.value},{default:withCtx(()=>[createTextVNode(toDisplayString(w.label),1)]),_:2},1032,["label","value"])),64))]),_:1})]),_:1},8,["modelValue"])]),_:1}),createVNode(Ve,{label:"UseCompression"},{default:withCtx(()=>[P[12]||(P[12]=createBaseVNode("span",{class:"my-4 block"}," 开启图片压缩 ",-1)),createVNode(Be,{checked:unref(F),"onUpdate:checked":[P[1]||(P[1]=w=>isRef(F)?F.value=w:null),ae],name:"UseCompression"},null,8,["checked"])]),_:1}),createBaseVNode("div",{class:normalizeClass(["bg-clip-padding mt-4 h-50 relative flex flex-col cursor-pointer items-center justify-evenly border-2 rounded border-dashed transition-colors hover:border-gray-700 hover:bg-gray-400/50 dark:hover:border-gray-200 dark:hover:bg-gray-500/50",{"border-gray-700 bg-gray-400/50 dark:border-gray-200 dark:bg-gray-500/50":unref(K)}]),onClick:P[3]||(P[3]=w=>unref(L)()),onDrop:withModifiers(fe,["prevent"]),onDragover:P[4]||(P[4]=withModifiers(w=>K.value=!0,["prevent"])),onDragleave:P[5]||(P[5]=withModifiers(w=>K.value=!1,["prevent"]))},[createVNode($e,{modelValue:unref(se),"onUpdate:modelValue":P[2]||(P[2]=w=>isRef(se)?se.value=w:null),class:"absolute left-0 right-0 rounded-none",style:{top:"-24px",height:"2px"}},null,8,["modelValue"]),createVNode(unref(CloudUpload),{class:"size-16 md:size-20"}),P[13]||(P[13]=createBaseVNode("p",{class:"text-center text-sm md:text-base px-4"},[createTextVNode(" 将图片拖到此处,或 "),createBaseVNode("strong",null,"点击上传")],-1)),unref(re)?(openBlock(),createElementBlock("div",_hoisted_1$o,[createBaseVNode("img",{src:unref(re),class:"max-h-40 object-contain"},null,8,_hoisted_2$j)])):createCommentVNode("",!0)],34)]),_:1}),createVNode(Ne,{value:"github"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(n),"initial-values":unref(s),onSubmit:l},{default:withCtx(()=>[createVNode(unref(Field),{name:"repo"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"GitHub 仓库",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:github.com/yanglbme/resource"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"branch"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"分支",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:release,可不填,默认 master"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessToken"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Token",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"如:cc1d0c1426d0fd0902bd2d7184b14da61b8abc46"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token",target:"_blank"},{default:withCtx(()=>[...P[14]||(P[14]=[createTextVNode(" 如何获取 GitHub Token? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[15]||(P[15]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"aliOSS"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(d),"initial-values":unref(u),onSubmit:m},{default:withCtx(()=>[createVNode(unref(Field),{name:"accessKeyId"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"AccessKey ID",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:LTAI4GdoocsmdoxUf13ylbaNHk"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessKeySecret"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"AccessKey Secret",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"如:cc1d0c142doocs0902bd2d7md4b14da6ylbabc46"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:doocs"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"region"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket 所在区域",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:oss-cn-shenzhen"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"useSSL",type:"boolean"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"UseSSL",required:"",error:D},{default:withCtx(()=>[createVNode(Be,{checked:w.value,name:w.name,"onUpdate:checked":w.onChange,onBlur:w.onBlur},null,8,["checked","name","onUpdate:checked","onBlur"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"cdnHost"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"自定义 CDN 域名",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:https://imagecdn.alidaodao.com,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://help.aliyun.com/document_detail/31883.html",target:"_blank"},{default:withCtx(()=>[...P[16]||(P[16]=[createTextVNode(" 如何使用阿里云 OSS? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[17]||(P[17]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"txCOS"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(i),"initial-values":unref(p),onSubmit:C},{default:withCtx(()=>[createVNode(unref(Field),{name:"secretId"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"SecretId",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:AKIDnQp1w3DOOCSs8F5MDp9tdoocsmdUPonW3"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"如:ukLmdtEJ9271f3DOocsMDsCXdS3YlbW0"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:doocs-3212520134"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"region"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket 所在区域",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:ap-guangzhou"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"cdnHost"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"自定义 CDN 域名",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:https://imagecdn.alidaodao.com,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:img,可不填,默认根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://cloud.tencent.com/document/product/436/38484",target:"_blank"},{default:withCtx(()=>[...P[18]||(P[18]=[createTextVNode(" 如何使用腾讯云 COS? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[19]||(P[19]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"qiniu"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(h),"initial-values":unref(T),onSubmit:v},{default:withCtx(()=>[createVNode(unref(Field),{name:"accessKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"AccessKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:6DD3VaLJ_SQgOdoocsyTV_YWaDmdnL2n8EGx7kG"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"如:qgZa5qrvDOOcsmdKStD1oCjZ9nB7MDvJUs_34SIm"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:md"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket 对应域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:https://images.123ylb.cn"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"region"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"存储区域",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:z2,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developer.qiniu.com/kodo",target:"_blank"},{default:withCtx(()=>[...P[20]||(P[20]=[createTextVNode(" 如何使用七牛云 Kodo? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[21]||(P[21]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"minio"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(g),"initial-values":unref(f),onSubmit:_},{default:withCtx(()=>[createVNode(unref(Field),{name:"endpoint"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Endpoint",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:play.min.io"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"port"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Port",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"number",placeholder:"如:9000,可不填,http 默认为 80,https 默认为 443"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"useSSL",type:"boolean"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"UseSSL",required:"",error:D},{default:withCtx(()=>[createVNode(Be,{checked:w.value,name:w.name,"onUpdate:checked":w.onChange,onBlur:w.onBlur},null,8,["checked","name","onUpdate:checked","onBlur"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:doocs"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"AccessKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:zhangsan"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:asdasdasd"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"http://docs.minio.org.cn/docs/master/minio-client-complete-guide",target:"_blank"},{default:withCtx(()=>[...P[22]||(P[22]=[createTextVNode(" 如何使用 MinIO? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[23]||(P[23]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"mp"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(oe),"initial-values":unref(V),onSubmit:ne},{default:withCtx(()=>[unref(S)?(openBlock(),createBlock(unref(Field),{key:0,name:"proxyOrigin"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"代理域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:unref(j)}),null,16,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["error"])]),_:1})):createCommentVNode("",!0),createVNode(unref(Field),{name:"appID"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"appID",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:wx6e1234567890efa3"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"appsecret"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"appsecret",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:d9f1abcdef01234567890abcdef82397"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_3$i,[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Getting_Started_Guide.html",target:"_blank"},{default:withCtx(()=>[...P[24]||(P[24]=[createTextVNode(" 如何开启公众号开发者模式并获取应用账号密钥? ",-1)])]),_:1}),createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://md-pages.doocs.org/tutorial/",target:"_blank"},{default:withCtx(()=>[...P[25]||(P[25]=[createTextVNode(" 如何在浏览器插件中使用公众号图床? ",-1)])]),_:1})])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[26]||(P[26]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"r2"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(H),"initial-values":unref(Y),onSubmit:$},{default:withCtx(()=>[createVNode(unref(Field),{name:"accountId"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"AccountId",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如: 0030f123e55a57546f4c281c564e560",class:"w-full min-w-0 md:min-w-[350px]"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"AccessKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如: 358090b3a12824a6b0787gae7ad0fc72"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"如: c1c4dbcb0b6b785ac6633422a06dff3dac055fe74fe40xj1b5c5fcf1bf128010"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:md"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:https://oss.example.com"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_4$g,[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developers.cloudflare.com/r2/api/s3/api/",target:"_blank"},{default:withCtx(()=>[...P[27]||(P[27]=[createTextVNode(" 如何使用 S3 API 操作 Cloudflare R2? ",-1)])]),_:1}),createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developers.cloudflare.com/r2/buckets/cors/",target:"_blank"},{default:withCtx(()=>[...P[28]||(P[28]=[createTextVNode(" 如何设置跨域(CORS)? ",-1)])]),_:1})])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[29]||(P[29]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"upyun"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(x),"initial-values":unref(J),onSubmit:W},{default:withCtx(()=>[createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如: md",class:"w-full min-w-0 md:min-w-[350px]"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"operator"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"操作员",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如: operator"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"password"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"操作员密码",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"如: c1c4dbcb0b6b785ac6633422a06dff3dac055fe74fe40xj1b5c5fcf1bf128010"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:http://xxx.test.upcdn.net"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"https://help.upyun.com/",target:"_blank"},{default:withCtx(()=>[...P[30]||(P[30]=[createTextVNode(" 如何使用 又拍云? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[31]||(P[31]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"telegram"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(b),"initial-values":unref(R),onSubmit:N},{default:withCtx(()=>[createVNode(unref(Field),{name:"token"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Bot Token",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:123456789:ABCdefGHIjkl-MNOPqrSTUvwxYZ"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"chatId"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Chat ID",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:-1001234567890"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"https://github.com/doocs/md/blob/main/docs/telegram-usage.md",target:"_blank"},{default:withCtx(()=>[...P[32]||(P[32]=[createTextVNode(" 如何使用 Telegram? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[33]||(P[33]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"cloudinary"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(de),"initial-values":unref(Z),onSubmit:le},{default:withCtx(()=>[createVNode(unref(Field),{name:"cloudName"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Cloud Name",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:demo"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"apiKey"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"API Key",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:1234567890"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"apiSecret"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"API Secret",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,type:"password",placeholder:"用于签名上传,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"uploadPreset"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Upload Preset",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"unsigned 时必填,signed 时可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"folder"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"Folder",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:blog/image,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:w,errorMessage:D})=>[createVNode(Q,{label:"自定义域名 / CDN",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(w,{modelValue:w.value,"onUpdate:modelValue":U=>w.value=U,placeholder:"如:https://cdn.example.com,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"https://cloudinary.com/documentation/upload_images",target:"_blank"},{default:withCtx(()=>[...P[34]||(P[34]=[createTextVNode(" Cloudinary 使用文档 ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...P[35]||(P[35]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"formCustom",class:"grid"},{default:withCtx(()=>[createVNode(Te)]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["open"])}}}),_hoisted_1$n={key:0,class:"sticky top-0 z-10 flex items-center justify-between -mx-4 px-4 py-3 border-b mb-4 bg-background"},_hoisted_2$i={class:"space-y-2"},_hoisted_3$h={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_4$f={class:"space-y-2"},_hoisted_5$e={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_6$c={class:"space-y-2"},_hoisted_7$9={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_8$7={class:"space-y-2"},_hoisted_9$5={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_10$2={class:"space-y-2"},_hoisted_11$2={class:"space-y-2"},_hoisted_12$2={class:"space-y-2"},_hoisted_13$2={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_14$2={class:"space-y-2"},_hoisted_15$2={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_16$2={class:"space-y-2"},_hoisted_17$2={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_18$2={class:"space-y-2"},_hoisted_19$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_20$1={class:"space-y-2"},_hoisted_21$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_22$1={class:"space-y-2"},_hoisted_23$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_24$1={class:"space-y-2"},_sfc_main$1a=defineComponent({__name:"RightSlider",setup(t){const e=useStore(),o=ref(!1);watch(()=>e.isOpenRightSlider,()=>{e.isMobile&&(o.value=!0)}),watch(()=>e.isMobile,()=>{o.value=!1});const{primaryColor:a}=storeToRefs(e),n=ref(!1),s=ref("");watch(n,()=>{n.value&&(s.value="")});const l=useTemplateRef("pickColorsContainer"),d=ref("rgb"),u=ref(["rgb","hex","hsl","hsv"]);return(m,i)=>{const p=_sfc_main$1O,C=_sfc_main$1f,h=_sfc_main$1g,T=_sfc_main$1j,v=_sfc_main$1e,g=_sfc_main$1l;return openBlock(),createElementBlock(Fragment,null,[unref(e).isMobile&&unref(e).isOpenRightSlider?(openBlock(),createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/50 z-40",onClick:i[0]||(i[0]=f=>unref(e).isOpenRightSlider=!1)})):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["overflow-hidden mobile-right-drawer",{"fixed top-0 right-0 w-full h-full z-55 bg-background border-l shadow-lg":unref(e).isMobile,animate:unref(e).isMobile&&unref(o),"border-l-2 order-2 border-gray/20 bg-white transition-width duration-300 dark:bg-[#191919]":!unref(e).isMobile,"w-100":!unref(e).isMobile&&unref(e).isOpenRightSlider,"w-0 border-l-0":!unref(e).isMobile&&!unref(e).isOpenRightSlider}]),style:normalizeStyle({transform:unref(e).isMobile?unref(e).isOpenRightSlider?"translateX(0)":"translateX(100%)":"none"})},[createBaseVNode("div",{class:normalizeClass(["space-y-4 h-full overflow-auto p-4",{"pt-0":unref(e).isMobile,"transition-transform":!unref(e).isMobile,"translate-x-0":!unref(e).isMobile&&unref(e).isOpenRightSlider,"translate-x-full":!unref(e).isMobile&&!unref(e).isOpenRightSlider}])},[unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_1$n,[i[14]||(i[14]=createBaseVNode("h2",{class:"text-lg font-semibold"}," 样式设置 ",-1)),createVNode(p,{variant:"ghost",size:"sm",onClick:i[1]||(i[1]=f=>unref(e).isOpenRightSlider=!1)},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"})]),_:1})])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$i,[i[15]||(i[15]=createBaseVNode("h2",null,"主题",-1)),createBaseVNode("div",_hoisted_3$h,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(themeOptions),({label:f,value:_})=>(openBlock(),createBlock(p,{key:_,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).theme===_}]),variant:"outline",onClick:b=>unref(e).themeChanged(_)},{default:withCtx(()=>[createTextVNode(toDisplayString(f),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_4$f,[i[16]||(i[16]=createBaseVNode("h2",null,"字体",-1)),createBaseVNode("div",_hoisted_5$e,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(fontFamilyOptions),({label:f,value:_})=>(openBlock(),createBlock(p,{key:_,variant:"outline",class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).fontFamily===_}]),onClick:b=>unref(e).fontChanged(_)},{default:withCtx(()=>[createTextVNode(toDisplayString(f),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_6$c,[i[17]||(i[17]=createBaseVNode("h2",null,"字号",-1)),createBaseVNode("div",_hoisted_7$9,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(fontSizeOptions),({value:f,desc:_})=>(openBlock(),createBlock(p,{key:f,variant:"outline",class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).fontSize===f}]),onClick:b=>unref(e).sizeChanged(f)},{default:withCtx(()=>[createTextVNode(toDisplayString(_),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_8$7,[i[18]||(i[18]=createBaseVNode("h2",null,"主题色",-1)),createBaseVNode("div",_hoisted_9$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(colorOptions),({label:f,value:_})=>(openBlock(),createBlock(p,{key:_,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).primaryColor===_}]),variant:"outline",onClick:b=>unref(e).colorChanged(_)},{default:withCtx(()=>[createBaseVNode("span",{class:"mr-2 inline-block h-4 w-4 rounded-full",style:normalizeStyle({background:_})},null,4),createTextVNode(" "+toDisplayString(f),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_10$2,[i[19]||(i[19]=createBaseVNode("h2",null,"自定义主题色",-1)),createBaseVNode("div",{ref_key:"pickColorsContainer",ref:l},[unref(l)?(openBlock(),createBlock(unref(Re),{key:0,value:unref(a),"onUpdate:value":i[2]||(i[2]=f=>isRef(a)?a.value=f:null),"show-alpha":"",format:unref(d),"format-options":unref(u),theme:unref(e).isDark?"dark":"light","popup-container":unref(l),onChange:unref(e).colorChanged},null,8,["value","format","format-options","theme","popup-container","onChange"])):createCommentVNode("",!0)],512)]),createBaseVNode("div",_hoisted_11$2,[i[20]||(i[20]=createBaseVNode("h2",null,"代码块主题",-1)),createBaseVNode("div",null,[createVNode(g,{modelValue:unref(e).codeBlockTheme,"onUpdate:modelValue":[i[3]||(i[3]=f=>unref(e).codeBlockTheme=f),unref(e).codeBlockThemeChanged]},{default:withCtx(()=>[createVNode(h,null,{default:withCtx(()=>[createVNode(C,{placeholder:"Select a code block theme"})]),_:1}),createVNode(v,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(codeBlockThemeOptions),({label:f,value:_})=>(openBlock(),createBlock(T,{key:f,value:_},{default:withCtx(()=>[createTextVNode(toDisplayString(f),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","onUpdate:modelValue"])])]),createBaseVNode("div",_hoisted_12$2,[i[21]||(i[21]=createBaseVNode("h2",null,"图注格式",-1)),createBaseVNode("div",_hoisted_13$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(legendOptions),({label:f,value:_})=>(openBlock(),createBlock(p,{key:_,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).legend===_}]),variant:"outline",onClick:b=>unref(e).legendChanged(_)},{default:withCtx(()=>[createTextVNode(toDisplayString(f),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_14$2,[i[24]||(i[24]=createBaseVNode("h2",null,"Mac 代码块",-1)),createBaseVNode("div",_hoisted_15$2,[createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isMacCodeBlock}]),variant:"outline",onClick:i[4]||(i[4]=f=>!unref(e).isMacCodeBlock&&unref(e).macCodeBlockChanged())},{default:withCtx(()=>[...i[22]||(i[22]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isMacCodeBlock}]),variant:"outline",onClick:i[5]||(i[5]=f=>unref(e).isMacCodeBlock&&unref(e).macCodeBlockChanged())},{default:withCtx(()=>[...i[23]||(i[23]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_16$2,[i[27]||(i[27]=createBaseVNode("h2",null,"代码块行号",-1)),createBaseVNode("div",_hoisted_17$2,[createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isShowLineNumber}]),variant:"outline",onClick:i[6]||(i[6]=f=>!unref(e).isShowLineNumber&&unref(e).showLineNumberChanged())},{default:withCtx(()=>[...i[25]||(i[25]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isShowLineNumber}]),variant:"outline",onClick:i[7]||(i[7]=f=>unref(e).isShowLineNumber&&unref(e).showLineNumberChanged())},{default:withCtx(()=>[...i[26]||(i[26]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_18$2,[i[30]||(i[30]=createBaseVNode("h2",null,"微信外链转底部引用",-1)),createBaseVNode("div",_hoisted_19$1,[createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isCiteStatus}]),variant:"outline",onClick:i[8]||(i[8]=f=>!unref(e).isCiteStatus&&unref(e).citeStatusChanged())},{default:withCtx(()=>[...i[28]||(i[28]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isCiteStatus}]),variant:"outline",onClick:i[9]||(i[9]=f=>unref(e).isCiteStatus&&unref(e).citeStatusChanged())},{default:withCtx(()=>[...i[29]||(i[29]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_20$1,[i[33]||(i[33]=createBaseVNode("h2",null,"段落首行缩进",-1)),createBaseVNode("div",_hoisted_21$1,[createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isUseIndent}]),variant:"outline",onClick:i[10]||(i[10]=f=>!unref(e).isUseIndent&&unref(e).useIndentChanged())},{default:withCtx(()=>[...i[31]||(i[31]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isUseIndent}]),variant:"outline",onClick:i[11]||(i[11]=f=>unref(e).isUseIndent&&unref(e).useIndentChanged())},{default:withCtx(()=>[...i[32]||(i[32]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_22$1,[i[36]||(i[36]=createBaseVNode("h2",null,"段落两端对齐",-1)),createBaseVNode("div",_hoisted_23$1,[createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isUseJustify}]),variant:"outline",onClick:i[12]||(i[12]=f=>!unref(e).isUseJustify&&unref(e).useJustifyChanged())},{default:withCtx(()=>[...i[34]||(i[34]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(p,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isUseJustify}]),variant:"outline",onClick:i[13]||(i[13]=f=>unref(e).isUseJustify&&unref(e).useJustifyChanged())},{default:withCtx(()=>[...i[35]||(i[35]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_24$1,[i[38]||(i[38]=createBaseVNode("h2",null,"样式配置",-1)),createVNode(p,{variant:"destructive",onClick:unref(e).resetStyleConfirm},{default:withCtx(()=>[...i[37]||(i[37]=[createTextVNode(" 重置 ",-1)])]),_:1},8,["onClick"])])],2)],6)],64)}}}),__unplugin_components_7=_export_sfc(_sfc_main$1a,[["__scopeId","data-v-2c6465c9"]]),_sfc_main$19=defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Iu),mergeProps(unref(a),{class:unref(cn)("text-sm text-muted-foreground",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$m={key:0,class:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 border-b mb-2 bg-background"},_sfc_main$18=defineComponent({__name:"CssEditor",setup(t){const e=useStore(),o=useDisplayStore(),a=ref(!1);watch(()=>o.isShowCssEditor,()=>{e.isMobile&&(a.value=!0)}),watch(()=>e.isMobile,()=>{a.value=!1});const n=ref(!1),s=ref(""),l=ref(["",e.cssContentConfig.active]);function d(_){s.value=_,n.value=!0}function u(){if(!s.value.trim()){toast.error("新建失败,方案名不可为空");return}if(!e.validatorTabName(s.value)){toast.error("不能与现有方案重名");return}e.renameTab(s.value),n.value=!1,toast.success("修改成功")}const m=ref(!1),i=ref("");function p(){if(!i.value.trim()){toast.error("新建失败,方案名不可为空");return}if(!e.validatorTabName(i.value)){toast.error("不能与现有方案重名");return}e.addCssContentTab(i.value),m.value=!1,e.cssContentConfig.active=i.value,l.value=[l.value[1],i.value],toast.success("新建成功")}const C=ref(!1),h=ref("");function T(_){h.value=_,C.value=!0}function v(){const _=e.cssContentConfig.tabs;if(_.length===1){toast.warning("至少保留一个方案");return}let b=e.cssContentConfig.active;b===h.value&&_.forEach((R,N)=>{if(R.name===h.value){const y=_[N+1]||_[N-1];y&&(b=y.name)}}),e.tabChanged(b),e.cssContentConfig.tabs=_.filter(R=>R.name!==h.value),toast.success("删除成功")}function g(){i.value=`方案${e.cssContentConfig.tabs.length+1}`,m.value=!0}function f(_){if(_==="add"){e.cssContentConfig.active=l.value[1],g();return}l.value=[l.value[1],_],e.tabChanged(_)}return(_,b)=>{const R=_sfc_main$1O,N=_sfc_main$1c,y=_sfc_main$1d,E=_sfc_main$1q,S=_sfc_main$1z,j=_sfc_main$19,oe=_sfc_main$1A,V=_sfc_main$1B,ne=_sfc_main$1x,H=_sfc_main$1H,Y=_sfc_main$1I,$=_sfc_main$1J,x=_sfc_main$1K,J=_sfc_main$1L,W=_sfc_main$1M,de=_sfc_main$1N,Z=_sfc_main$1P,le=_sfc_main$1Q,ge=_sfc_main$1R;return openBlock(),createElementBlock(Fragment,null,[unref(e).isMobile&&unref(o).isShowCssEditor?(openBlock(),createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/50 z-40",onClick:b[0]||(b[0]=A=>unref(o).isShowCssEditor=!1)})):createCommentVNode("",!0),createVNode(Transition,{"enter-active-class":"bounceInRight"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{class:normalizeClass(["cssEditor-wrapper h-full flex flex-col mobile-css-editor overflow-y-auto",{"fixed top-0 right-0 w-full h-full z-100 bg-background border-l shadow-lg":unref(e).isMobile,animate:unref(e).isMobile&&unref(a),"border-l-2 flex-1 order-2 border-gray/50":!unref(e).isMobile}]),style:normalizeStyle({transform:unref(e).isMobile?unref(o).isShowCssEditor?"translateX(0)":"translateX(100%)":"none"})},[unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_1$m,[b[11]||(b[11]=createBaseVNode("h2",{class:"text-lg font-semibold"}," 自定义 CSS ",-1)),createVNode(R,{variant:"ghost",size:"sm",onClick:b[1]||(b[1]=A=>unref(o).isShowCssEditor=!1)},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"})]),_:1})])):createCommentVNode("",!0),createVNode(E,{modelValue:unref(e).cssContentConfig.active,"onUpdate:modelValue":[b[2]||(b[2]=A=>unref(e).cssContentConfig.active=A),f]},{default:withCtx(()=>[createVNode(y,{class:"w-full overflow-x-auto"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(e).cssContentConfig.tabs,A=>(openBlock(),createBlock(N,{key:A.name,value:A.name,class:"flex-1"},{default:withCtx(()=>[createTextVNode(toDisplayString(A.title)+" ",1),withDirectives(createVNode(unref(PenLine),{class:"inline size-4 rounded-full p-0.5 transition-color hover:bg-gray-200 dark:hover:bg-gray-600",onClick:F=>d(A.name)},null,8,["onClick"]),[[vShow,unref(e).cssContentConfig.active===A.name]]),withDirectives(createVNode(unref(X),{class:"inline size-4 rounded-full p-0.5 transition-color hover:bg-gray-200 dark:hover:bg-gray-600",onClick:withModifiers(F=>T(A.name),["self"])},null,8,["onClick"]),[[vShow,unref(e).cssContentConfig.active===A.name]])]),_:2},1032,["value"]))),128)),createVNode(N,{value:"add"},{default:withCtx(()=>[createVNode(unref(Plus),{class:"h-5 w-5"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),b[24]||(b[24]=createBaseVNode("textarea",{id:"cssEditor",type:"textarea",placeholder:"Your custom css here."},null,-1)),createVNode(Y,{open:unref(m),"onUpdate:open":b[6]||(b[6]=A=>isRef(m)?m.value=A:null)},{default:withCtx(()=>[createVNode(H,{class:"sm:max-w-[425px]"},{default:withCtx(()=>[createVNode(oe,null,{default:withCtx(()=>[createVNode(S,null,{default:withCtx(()=>[...b[12]||(b[12]=[createTextVNode("新建自定义 CSS",-1)])]),_:1}),createVNode(j,null,{default:withCtx(()=>[...b[13]||(b[13]=[createTextVNode(" 请输入方案名称 ",-1)])]),_:1})]),_:1}),createVNode(V,{modelValue:unref(i),"onUpdate:modelValue":b[3]||(b[3]=A=>isRef(i)?i.value=A:null)},null,8,["modelValue"]),createVNode(ne,null,{default:withCtx(()=>[createVNode(R,{variant:"outline",onClick:b[4]||(b[4]=A=>m.value=!1)},{default:withCtx(()=>[...b[14]||(b[14]=[createTextVNode(" 取消 ",-1)])]),_:1}),createVNode(R,{onClick:b[5]||(b[5]=A=>p())},{default:withCtx(()=>[...b[15]||(b[15]=[createTextVNode(" 保存 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(Y,{open:unref(n),"onUpdate:open":b[9]||(b[9]=A=>isRef(n)?n.value=A:null)},{default:withCtx(()=>[createVNode(H,{class:"sm:max-w-[425px]"},{default:withCtx(()=>[createVNode(oe,null,{default:withCtx(()=>[createVNode(S,null,{default:withCtx(()=>[...b[16]||(b[16]=[createTextVNode("编辑方案名称",-1)])]),_:1}),createVNode(j,null,{default:withCtx(()=>[...b[17]||(b[17]=[createTextVNode(" 请输入新的方案名称 ",-1)])]),_:1})]),_:1}),createVNode(V,{modelValue:unref(s),"onUpdate:modelValue":b[7]||(b[7]=A=>isRef(s)?s.value=A:null)},null,8,["modelValue"]),createVNode(ne,null,{default:withCtx(()=>[createVNode(R,{variant:"outline",onClick:b[8]||(b[8]=A=>n.value=!1)},{default:withCtx(()=>[...b[18]||(b[18]=[createTextVNode(" 取消 ",-1)])]),_:1}),createVNode(R,{onClick:u},{default:withCtx(()=>[...b[19]||(b[19]=[createTextVNode(" 保存 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(ge,{open:unref(C),"onUpdate:open":b[10]||(b[10]=A=>isRef(C)?C.value=A:null)},{default:withCtx(()=>[createVNode(le,null,{default:withCtx(()=>[createVNode(J,null,{default:withCtx(()=>[createVNode($,null,{default:withCtx(()=>[...b[20]||(b[20]=[createTextVNode("提示",-1)])]),_:1}),createVNode(x,null,{default:withCtx(()=>[...b[21]||(b[21]=[createTextVNode(" 此操作将删除该自定义方案,是否继续? ",-1)])]),_:1})]),_:1}),createVNode(Z,null,{default:withCtx(()=>[createVNode(W,null,{default:withCtx(()=>[...b[22]||(b[22]=[createTextVNode("取消",-1)])]),_:1}),createVNode(de,{onClick:v},{default:withCtx(()=>[...b[23]||(b[23]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])],6),[[vShow,unref(o).isShowCssEditor]])]),_:1})],64)}}}),__unplugin_components_6=_export_sfc(_sfc_main$18,[["__scopeId","data-v-06df6eb3"]]),_hoisted_1$l=["href"],_sfc_main$17=defineComponent({__name:"FloatingToc",setup(t){const e=useStore(),o=ref(!1);return(a,n)=>(openBlock(),createElementBlock("div",{class:"bg-background absolute left-0 top-0 border rounded-br-lg rounded-tr-lg rounded-bl-lg p-2 text-sm shadow-sm",onMouseenter:n[0]||(n[0]=()=>o.value=!0),onMouseleave:n[1]||(n[1]=()=>o.value=!1)},[createVNode(unref(List),{class:"size-6"}),createBaseVNode("ul",{class:normalizeClass(["overflow-auto transition-all",{"max-h-0 w-0":!unref(o),"max-h-100 w-60 mt-2":unref(o)}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(e).titleList,(s,l)=>(openBlock(),createElementBlock("li",{key:l,class:"line-clamp-1 py-1 leading-6 hover:bg-gray-300 dark:hover:bg-gray-600",style:normalizeStyle({paddingLeft:`${s.level-.5}em`})},[createBaseVNode("a",{href:s.url},toDisplayString(s.title),9,_hoisted_1$l)],4))),128))],2)],32))}}),_sfc_main$16=defineComponent({__name:"BackTop",props:{left:{},top:{},right:{},bottom:{},visibilityHeight:{},target:{},onClick:{type:Function}},setup(t){const e=t,o=ref(e.visibilityHeight??400),a=ref(!1),n=ref(null);function s(d){n.value?.scrollTo({top:0,left:0,behavior:"smooth"}),e.onClick?.(d)}const l=throttle(d=>{d instanceof HTMLElement?a.value=d.scrollTop>o.value:a.value=window.scrollY>o.value},200,{edges:["leading","trailing"]});return onMounted(()=>{e.target?n.value=document.getElementById(e.target):n.value=window,n.value.addEventListener("scroll",()=>{l(n.value)})}),onUnmounted(()=>{n.value.removeEventListener("scroll",()=>{l(n.value)})}),(d,u)=>{const m=_sfc_main$1O;return unref(a)?(openBlock(),createBlock(m,{key:0,variant:"outline",size:"icon",class:"absolute z-50 rounded-full",style:normalizeStyle({left:`${t.left}px`,top:`${t.top}px`,right:`${t.right}px`,bottom:`${t.bottom}px`}),onClick:s},{default:withCtx(()=>[createVNode(unref(ArrowUpFromLine))]),_:1},8,["style"])):createCommentVNode("",!0)}}}),_sfc_main$15=defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(rm),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$14=defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(um),null,{default:withCtx(()=>[createVNode(unref(dm),mergeProps(unref(s),{class:unref(cn)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$13=defineComponent({__name:"ContextMenuShortcut",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(cn)("ml-auto text-xs tracking-widest text-muted-foreground",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$12=defineComponent({__name:"ContextMenuSeparator",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(vm),mergeProps(o.value,{class:unref(cn)("-mx-1 my-1 h-px bg-border",e.class)}),null,16,["class"]))}}),_sfc_main$11=defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(fm),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",t.inset&&"pl-8",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$10=defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const o=Ot(t);return(a,n)=>(openBlock(),createBlock(unref(im),normalizeProps(guardReactiveProps(unref(o))),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16))}});function useImportMarkdownContent(){const t=useStore(),{open:e,reset:o,onChange:a}=useFileDialog({accept:".md"});return a(n=>{if(n==null||n.length===0)return;const s=n[0],l=new FileReader;l.readAsText(s),l.onload=d=>{t.editor.dispatch({changes:{from:0,to:t.editor.state.doc.length,insert:""}}),requestAnimationFrame(()=>{t.editor.dispatch({changes:{from:0,to:t.editor.state.doc.length,insert:d.target.result}})}),toast.success("文档导入成功")}}),()=>{o(),e()}}const _sfc_main$$=defineComponent({__name:"EditorContextMenu",setup(t){const{exportEditorContent2HTML:e,exportEditorContent2MD:o,formatContent:a,importDefaultContent:n,copyToClipboard:s,pasteFromClipboard:l,resetStyleConfirm:d,downloadAsCardImage:u,clearContent:m}=useStore(),{toggleShowInsertFormDialog:i,toggleShowInsertMpCardDialog:p,toggleShowUploadImgDialog:C}=useDisplayStore(),h=useImportMarkdownContent();return(T,v)=>{const g=_sfc_main$10,f=_sfc_main$11,_=_sfc_main$12,b=_sfc_main$13,R=_sfc_main$14,N=_sfc_main$15;return openBlock(),createBlock(N,null,{default:withCtx(()=>[createVNode(g,null,{default:withCtx(()=>[renderSlot(T.$slots,"default")]),_:3}),createVNode(R,{class:"w-64"},{default:withCtx(()=>[createVNode(f,{inset:"",onClick:v[0]||(v[0]=y=>unref(C)())},{default:withCtx(()=>[...v[12]||(v[12]=[createTextVNode(" 上传图片 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[1]||(v[1]=y=>unref(i)())},{default:withCtx(()=>[...v[13]||(v[13]=[createTextVNode(" 插入表格 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[2]||(v[2]=y=>unref(p)())},{default:withCtx(()=>[...v[14]||(v[14]=[createTextVNode(" 插入公众号名片 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[3]||(v[3]=y=>unref(d)())},{default:withCtx(()=>[...v[15]||(v[15]=[createTextVNode(" 重置样式 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[4]||(v[4]=y=>unref(n)())},{default:withCtx(()=>[...v[16]||(v[16]=[createTextVNode(" 重置文档 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[5]||(v[5]=y=>unref(m)())},{default:withCtx(()=>[...v[17]||(v[17]=[createTextVNode(" 清空内容 ",-1)])]),_:1}),createVNode(_),createVNode(f,{inset:"",onClick:v[6]||(v[6]=y=>unref(h)())},{default:withCtx(()=>[...v[18]||(v[18]=[createTextVNode(" 导入 .md 文档 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[7]||(v[7]=y=>unref(o)())},{default:withCtx(()=>[...v[19]||(v[19]=[createTextVNode(" 导出 .md 文档 ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[8]||(v[8]=y=>unref(e)())},{default:withCtx(()=>[...v[20]||(v[20]=[createTextVNode(" 导出 .html ",-1)])]),_:1}),createVNode(f,{inset:"",onClick:v[9]||(v[9]=y=>unref(u)())},{default:withCtx(()=>[...v[21]||(v[21]=[createTextVNode(" 导出 .png ",-1)])]),_:1}),createVNode(_),createVNode(f,{inset:"",onClick:v[10]||(v[10]=y=>unref(s)())},{default:withCtx(()=>[v[22]||(v[22]=createTextVNode(" 复制 ",-1)),createVNode(b,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(ctrlSign))+" + C ",1)]),_:1})]),_:1}),createVNode(f,{inset:"",onClick:unref(l)},{default:withCtx(()=>[v[23]||(v[23]=createTextVNode(" 粘贴 ",-1)),createVNode(b,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(ctrlSign))+" + V ",1)]),_:1})]),_:1},8,["onClick"]),createVNode(f,{inset:"",onClick:v[11]||(v[11]=y=>unref(a)())},{default:withCtx(()=>[v[24]||(v[24]=createTextVNode(" 格式化 ",-1)),createVNode(b,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(altSign))+" + "+toDisplayString(unref(shiftSign))+" + F ",1)]),_:1})]),_:1})]),_:1})]),_:3})}}}),_sfc_main$_=defineComponent({__name:"AlertDialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Rv),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$Z=defineComponent({__name:"Separator",props:{orientation:{},decorative:{type:Boolean},asChild:{type:Boolean},as:{},class:{},label:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(ap),mergeProps(o.value,{class:unref(cn)("shrink-0 bg-border relative",e.orientation==="vertical"?"w-px h-full":"h-px w-full",e.class)}),{default:withCtx(()=>[e.label?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(cn)("text-xs text-muted-foreground bg-background absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex justify-center items-center",e.orientation==="vertical"?"w-px px-1 py-2":"h-px py-1 px-2"))},toDisplayString(e.label),3)):createCommentVNode("",!0)]),_:1},16,["class"]))}}),_sfc_main$Y=defineComponent({__name:"DropdownMenu",props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(uh),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$X=defineComponent({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(ch),null,{default:withCtx(()=>[createVNode(unref(fh),mergeProps(unref(s),{class:unref(cn)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$W=defineComponent({__name:"DropdownMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(vh),mergeProps(unref(a),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",t.inset&&"pl-8",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$V=defineComponent({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const o=Ot(t);return(a,n)=>(openBlock(),createBlock(unref(dh),mergeProps({class:"outline-hidden"},unref(o)),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16))}}),_hoisted_1$k=["onDragstart","onDrop","onDragover","onClick"],_hoisted_2$h={class:"line-clamp-1"},_hoisted_3$g={key:0,class:"space-y-1 ml-4 mt-1 border-l-2 border-gray-300 pl-1 dark:border-gray-700"},_sfc_main$U=defineComponent({__name:"PostItem",props:{parentId:{},sortedPosts:{},startRenamePost:{type:Function},openHistoryDialog:{type:Function},startDelPost:{type:Function},dropTargetId:{},setDropTargetId:{type:Function},dragSourceId:{},setDragSourceId:{type:Function},handleDrop:{type:Function},handleDragEnd:{type:Function},openAddPostDialog:{type:Function}},setup(t){const e=t,o=useStore(),a=ref(!1),n=ref("");watch(a,u=>{u&&(n.value="")});function s(u,m){e.setDragSourceId(u),m.dataTransfer?.setData("text/plain",u),m.dataTransfer.effectAllowed="move"}function l(u){const m=o.posts.find(i=>i.id===u);m&&(m.collapsed=!m.collapsed)}function d(u){return e.sortedPosts.some(m=>m.parentId===u)}return(u,m)=>{const i=_sfc_main$1O,p=_sfc_main$V,C=_sfc_main$W,h=_sfc_main$X,T=_sfc_main$Y,v=resolveComponent("PostItem",!0);return openBlock(!0),createElementBlock(Fragment,null,renderList(e.sortedPosts.filter(g=>e.parentId==null&&g.parentId==null||g.parentId===e.parentId),g=>(openBlock(),createElementBlock("div",{key:g.id},[createBaseVNode("a",{class:normalizeClass(["w-full inline-flex cursor-pointer items-center gap-1 rounded p-2 text-sm transition-colors",["hover:text-primary-foreground hover:bg-primary",{"bg-primary text-primary-foreground shadow-sm":unref(o).currentPostId===g.id,"opacity-50":e.dragSourceId===g.id,"outline-2 outline-dashed outline-primary border-gray-200 bg-gray-400/50 dark:border-gray-200 dark:bg-gray-500/50":e.dropTargetId===g.id}]]),draggable:"true",onDragstart:f=>s(g.id,f),onDragend:m[0]||(m[0]=(...f)=>e.handleDragEnd&&e.handleDragEnd(...f)),onDrop:withModifiers(f=>e.handleDrop(g.id),["prevent"]),onDragover:withModifiers(f=>e.setDropTargetId(g.id),["stop","prevent"]),onDragleave:m[1]||(m[1]=withModifiers(f=>e.setDropTargetId(null),["prevent"])),onClick:f=>unref(o).currentPostId=g.id},[createVNode(i,{size:"xs",variant:"ghost",class:normalizeClass(["h-max p-0.5",d(g.id)?"opacity-100":"opacity-0"]),onClick:withModifiers(f=>d(g.id)&&l(g.id),["stop"])},{default:withCtx(()=>[createVNode(unref(ChevronRight),{class:normalizeClass(["size-4 transition-transform",{"rotate-90":!g.collapsed}])},null,8,["class"])]),_:2},1032,["class","onClick"]),createBaseVNode("span",_hoisted_2$h,toDisplayString(g.title),1),createVNode(T,null,{default:withCtx(()=>[createVNode(p,{"as-child":""},{default:withCtx(()=>[createVNode(i,{size:"xs",variant:"ghost",class:"ml-auto h-max p-0.5"},{default:withCtx(()=>[createVNode(unref(Ellipsis),{class:"size-4"})]),_:1})]),_:1}),createVNode(h,null,{default:withCtx(()=>[createVNode(C,{onClick:withModifiers(f=>e.openAddPostDialog(g.id),["stop"])},{default:withCtx(()=>[createVNode(unref(SquarePlus),{class:"mr-2 size-4"}),m[2]||(m[2]=createTextVNode(" 新增内容 ",-1))]),_:1},8,["onClick"]),createVNode(C,{onClick:withModifiers(f=>e.startRenamePost(g.id),["stop"])},{default:withCtx(()=>[createVNode(unref(PenLine),{class:"mr-2 size-4"}),m[3]||(m[3]=createTextVNode(" 重命名 ",-1))]),_:1},8,["onClick"]),createVNode(C,{onClick:withModifiers(f=>e.openHistoryDialog(g.id),["stop"])},{default:withCtx(()=>[createVNode(unref(History),{class:"mr-2 size-4"}),m[4]||(m[4]=createTextVNode(" 历史记录 ",-1))]),_:1},8,["onClick"]),unref(o).posts.length>1?(openBlock(),createBlock(C,{key:0,onClick:withModifiers(f=>e.startDelPost(g.id),["stop"])},{default:withCtx(()=>[createVNode(unref(Trash2),{class:"mr-2 size-4"}),m[5]||(m[5]=createTextVNode(" 删除 ",-1))]),_:1},8,["onClick"])):createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)],42,_hoisted_1$k),d(g.id)&&!g.collapsed?(openBlock(),createElementBlock("div",_hoisted_3$g,[createVNode(v,{"parent-id":g.id,"sorted-posts":e.sortedPosts,"start-rename-post":e.startRenamePost,"open-history-dialog":e.openHistoryDialog,"start-del-post":e.startDelPost,"drag-source-id":e.dragSourceId,"set-drag-source-id":e.setDragSourceId,"drop-target-id":e.dropTargetId,"set-drop-target-id":e.setDropTargetId,"handle-drag-end":e.handleDragEnd,"handle-drop":e.handleDrop,"open-add-post-dialog":e.openAddPostDialog},null,8,["parent-id","sorted-posts","start-rename-post","open-history-dialog","start-del-post","drag-source-id","set-drag-source-id","drop-target-id","set-drop-target-id","handle-drag-end","handle-drop","open-add-post-dialog"])])):createCommentVNode("",!0)]))),128)}}}),_sfc_main$T=defineComponent({__name:"DropdownMenuRadioGroup",props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Ch),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$S=defineComponent({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(hh),mergeProps(o.value,{class:unref(cn)("-mx-1 my-1 h-px bg-muted",e.class)}),null,16,["class"]))}}),_hoisted_1$j={class:"absolute left-2 h-3.5 w-3.5 flex items-center justify-center"},_sfc_main$R=defineComponent({__name:"DropdownMenuRadioItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},emits:["select"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(wh),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",o.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$j,[createVNode(unref(gh),null,{default:withCtx(()=>[createVNode(unref(Circle),{class:"h-2 w-2 fill-current"})]),_:1})]),renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$Q=defineComponent({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(ou),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$P=defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Hg),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$O=defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Wg),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$N=defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(qg),null,{default:withCtx(()=>[createVNode(unref(Ug),mergeProps({...unref(s),...l.$attrs},{class:unref(cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$M=defineComponent({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(jg),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_hoisted_1$i={key:0,class:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 border-b mb-2 bg-background"},_hoisted_2$g={class:"space-x-4 mb-2 flex justify-center shrink-0 py-2"},_hoisted_3$f={class:"flex-1 overflow-y-auto space-y-1 px-1"},_hoisted_4$e={class:"h-[50vh] flex"},_hoisted_5$d={class:"space-y-2 w-[150px]"},_hoisted_6$b=["onClick"],_hoisted_7$8={class:"space-y-2 max-h-full flex-1 overflow-y-auto"},_hoisted_8$6={class:"whitespace-pre-wrap p-2",style:{"word-wrap":"break-word","overflow-wrap":"break-word","word-break":"break-all",hyphens:"auto"}},_sfc_main$L=defineComponent({__name:"index",setup(t){const e=useStore(),o=ref(!1);watch(()=>e.isOpenPostSlider,()=>{e.isMobile&&(o.value=!0)}),watch(()=>e.isMobile,()=>{o.value=!1});const a=ref(null),n=ref(!1),s=ref("");watch(n,$=>{$&&(s.value="",a.value=null)});function l($){n.value=!0,nextTick(()=>{a.value=$})}function d(){if(!s.value.trim())return toast.error("内容标题不可为空");if(e.posts.some($=>$.title===s.value.trim()))return toast.error("内容标题已存在");e.addPost(s.value.trim(),a.value),n.value=!1,toast.success("内容新增成功")}const u=ref(null),m=ref(!1),i=ref("");function p($){u.value=$,i.value=e.getPostById($).title,m.value=!0}function C(){if(!i.value.trim())return toast.error("内容标题不可为空");if(e.posts.some($=>$.title===i.value.trim()&&$.id!==u.value))return toast.error("内容标题已存在");if(i.value===e.getPostById(u.value)?.title){m.value=!1;return}e.renamePost(u.value,i.value.trim()),toast.success("内容重命名成功"),m.value=!1}const h=ref(null),T=ref(!1),v=computed(()=>{const $=e.getPostById(h.value||"")?.title??"";return`此操作将删除「${$.length>20?`${$.slice(0,20)}…`:$}」,是否继续?`});function g($){h.value=$,T.value=!0}function f(){e.delPost(h.value),T.value=!1,toast.success("内容删除成功")}const _=ref(!1),b=ref(null),R=ref(0);function N($){b.value=$,R.value=0,_.value=!0}function y(){const $=e.getPostById(b.value);if(!$){_.value=!1;return}const x=$.history[R.value].content;$.content=x;const J=toRaw(e.editor);J.dispatch({changes:{from:0,to:J.state.doc.length,insert:x}}),toast.success("记录恢复成功"),_.value=!1}const E=useStorage(addPrefix("sort_mode"),"create-old-new"),S=computed(()=>[...e.posts].sort(($,x)=>{switch(E.value){case"A-Z":return $.title.localeCompare(x.title);case"Z-A":return x.title.localeCompare($.title);case"update-new-old":return+new Date(x.updateDatetime)-+new Date($.updateDatetime);case"update-old-new":return+new Date($.updateDatetime)-+new Date(x.updateDatetime);case"create-new-old":return+new Date(x.createDatetime)-+new Date($.createDatetime);default:return+new Date($.createDatetime)-+new Date(x.createDatetime)}})),j=ref(!1),oe=ref(null),V=ref(null);function ne($){const x=oe.value;if(!x)return;const J=W=>{if(!W)return!1;const de=e.getPostById(W);return de?de.parentId===x?!0:J(de.parentId):!1};J($)?toast.error("不能将内容拖拽到其子内容下面"):x!==$&&e.updatePostParentId(x,$||null),oe.value=null}function H($){$.preventDefault()}function Y(){oe.value=null,V.value=null,j.value=!1}return($,x)=>{const J=_sfc_main$1O,W=_sfc_main$M,de=_sfc_main$N,Z=_sfc_main$O,le=_sfc_main$P,ge=_sfc_main$Q,A=_sfc_main$1z,F=_sfc_main$19,M=_sfc_main$1A,z=_sfc_main$1B,ae=_sfc_main$1x,ee=_sfc_main$1H,K=_sfc_main$1I,L=_sfc_main$V,G=_sfc_main$R,te=_sfc_main$S,fe=_sfc_main$T,se=_sfc_main$X,re=_sfc_main$Y,ce=_sfc_main$U,q=_sfc_main$1J,P=_sfc_main$1K,_e=_sfc_main$1L,me=_sfc_main$1M,be=_sfc_main$1N,ke=_sfc_main$1P,xe=_sfc_main$1Q,ye=_sfc_main$1R,Ce=_sfc_main$Z,ve=_sfc_main$_;return openBlock(),createElementBlock(Fragment,null,[unref(e).isMobile&&unref(e).isOpenPostSlider?(openBlock(),createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/50 z-40",onClick:x[0]||(x[0]=pe=>unref(e).isOpenPostSlider=!1)})):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["h-full w-full overflow-hidden mobile-drawer",{"fixed top-0 left-0 z-55 bg-background border-r shadow-lg":unref(e).isMobile,animate:unref(e).isMobile&&unref(o),"border-2 border-[#0000] border-dashed bg-gray/20 transition-colors":!unref(e).isMobile,"border-gray-700 bg-gray-400/50 dark:border-gray-200 dark:bg-gray-500/50":!unref(e).isMobile&&unref(j)}]),style:normalizeStyle({transform:unref(e).isMobile&&unref(e).isOpenPostSlider?"translateX(0)":unref(e).isMobile&&!unref(e).isOpenPostSlider?"translateX(-100%)":void 0}),onDragover:x[6]||(x[6]=withModifiers(pe=>j.value=!0,["prevent"])),onDragleave:x[7]||(x[7]=withModifiers(pe=>j.value=!1,["prevent"])),onDragend:Y},[createBaseVNode("nav",{class:normalizeClass(["h-full flex flex-col transition-transform overflow-hidden",{"p-2":unref(e).isMobile}]),onDragover:H,onDrop:x[5]||(x[5]=withModifiers(pe=>ne(null),["prevent"]))},[unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_1$i,[x[13]||(x[13]=createBaseVNode("h2",{class:"text-lg font-semibold"}," 内容管理 ",-1)),createVNode(J,{variant:"ghost",size:"sm",onClick:x[1]||(x[1]=pe=>unref(e).isOpenPostSlider=!1)},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"})]),_:1})])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$g,[createVNode(K,{open:unref(n),"onUpdate:open":x[3]||(x[3]=pe=>isRef(n)?n.value=pe:null)},{default:withCtx(()=>[createVNode(ge,null,{default:withCtx(()=>[createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(J,{variant:"ghost",size:"xs",class:"h-max p-1"},{default:withCtx(()=>[createVNode(unref(SquarePlus),{class:"size-5"})]),_:1})]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...x[14]||(x[14]=[createTextVNode(" 新增内容 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(ee,null,{default:withCtx(()=>[createVNode(M,null,{default:withCtx(()=>[createVNode(A,null,{default:withCtx(()=>[...x[15]||(x[15]=[createTextVNode("新增内容",-1)])]),_:1}),createVNode(F,null,{default:withCtx(()=>[...x[16]||(x[16]=[createTextVNode("请输入内容名称",-1)])]),_:1})]),_:1}),createVNode(z,{modelValue:unref(s),"onUpdate:modelValue":x[2]||(x[2]=pe=>isRef(s)?s.value=pe:null),onKeyup:withKeys(d,["enter"])},null,8,["modelValue"]),createVNode(ae,null,{default:withCtx(()=>[createVNode(J,{onClick:d},{default:withCtx(()=>[...x[17]||(x[17]=[createTextVNode(" 确 定 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(re,null,{default:withCtx(()=>[createVNode(L,null,{default:withCtx(()=>[createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(J,{variant:"ghost",size:"xs",class:"h-max p-1"},{default:withCtx(()=>[createVNode(unref(ArrowUpNarrowWide),{class:"size-5"})]),_:1})]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...x[18]||(x[18]=[createTextVNode(" 排序模式 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(se,null,{default:withCtx(()=>[createVNode(fe,{modelValue:unref(E),"onUpdate:modelValue":x[4]||(x[4]=pe=>isRef(E)?E.value=pe:null)},{default:withCtx(()=>[createVNode(G,{value:"A-Z"},{default:withCtx(()=>[...x[19]||(x[19]=[createTextVNode(" 文件名(A-Z) ",-1)])]),_:1}),createVNode(G,{value:"Z-A"},{default:withCtx(()=>[...x[20]||(x[20]=[createTextVNode(" 文件名(Z-A) ",-1)])]),_:1}),createVNode(te),createVNode(G,{value:"update-new-old"},{default:withCtx(()=>[...x[21]||(x[21]=[createTextVNode(" 编辑时间(新→旧) ",-1)])]),_:1}),createVNode(G,{value:"update-old-new"},{default:withCtx(()=>[...x[22]||(x[22]=[createTextVNode(" 编辑时间(旧→新) ",-1)])]),_:1}),createVNode(te),createVNode(G,{value:"create-new-old"},{default:withCtx(()=>[...x[23]||(x[23]=[createTextVNode(" 创建时间(新→旧) ",-1)])]),_:1}),createVNode(G,{value:"create-old-new"},{default:withCtx(()=>[...x[24]||(x[24]=[createTextVNode(" 创建时间(旧→新) ",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(J,{variant:"ghost",size:"xs",class:"h-max p-1",onClick:unref(e).collapseAllPosts},{default:withCtx(()=>[createVNode(unref(ChevronsDownUp),{class:"size-5"})]),_:1},8,["onClick"])]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...x[25]||(x[25]=[createTextVNode(" 全部收起 ",-1)])]),_:1})]),_:1})]),_:1}),createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(J,{variant:"ghost",size:"xs",class:"h-max p-1",onClick:unref(e).expandAllPosts},{default:withCtx(()=>[createVNode(unref(ChevronsUpDown),{class:"size-5"})]),_:1},8,["onClick"])]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...x[26]||(x[26]=[createTextVNode(" 全部展开 ",-1)])]),_:1})]),_:1})]),_:1})]),createBaseVNode("div",_hoisted_3$f,[createVNode(ce,{"parent-id":null,"sorted-posts":unref(S),"start-rename-post":p,"open-history-dialog":N,"start-del-post":g,"drop-target-id":unref(V),"set-drop-target-id":pe=>V.value=pe,"drag-source-id":unref(oe),"set-drag-source-id":pe=>oe.value=pe,"handle-drop":ne,"handle-drag-end":Y,"open-add-post-dialog":l},null,8,["sorted-posts","drop-target-id","set-drop-target-id","drag-source-id","set-drag-source-id"])])],34)],38),createVNode(K,{open:unref(m),"onUpdate:open":x[10]||(x[10]=pe=>isRef(m)?m.value=pe:null)},{default:withCtx(()=>[createVNode(ee,{class:"sm:max-w-[425px]"},{default:withCtx(()=>[createVNode(M,null,{default:withCtx(()=>[createVNode(A,null,{default:withCtx(()=>[...x[27]||(x[27]=[createTextVNode("编辑内容名称",-1)])]),_:1}),createVNode(F,null,{default:withCtx(()=>[...x[28]||(x[28]=[createTextVNode("请输入新的内容名称",-1)])]),_:1})]),_:1}),createVNode(z,{modelValue:unref(i),"onUpdate:modelValue":x[8]||(x[8]=pe=>isRef(i)?i.value=pe:null),onKeyup:withKeys(C,["enter"])},null,8,["modelValue"]),createVNode(ae,null,{default:withCtx(()=>[createVNode(J,{variant:"outline",onClick:x[9]||(x[9]=pe=>m.value=!1)},{default:withCtx(()=>[...x[29]||(x[29]=[createTextVNode(" 取消 ",-1)])]),_:1}),createVNode(J,{onClick:C},{default:withCtx(()=>[...x[30]||(x[30]=[createTextVNode(" 保存 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(ye,{open:unref(T),"onUpdate:open":x[11]||(x[11]=pe=>isRef(T)?T.value=pe:null)},{default:withCtx(()=>[createVNode(xe,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[createVNode(q,null,{default:withCtx(()=>[...x[31]||(x[31]=[createTextVNode("提示",-1)])]),_:1}),createVNode(P,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(v)),1)]),_:1})]),_:1}),createVNode(ke,null,{default:withCtx(()=>[createVNode(me,null,{default:withCtx(()=>[...x[32]||(x[32]=[createTextVNode("取消",-1)])]),_:1}),createVNode(be,{onClick:f},{default:withCtx(()=>[...x[33]||(x[33]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(K,{open:unref(_),"onUpdate:open":x[12]||(x[12]=pe=>isRef(_)?_.value=pe:null)},{default:withCtx(()=>[createVNode(ee,{class:"sm:max-w-4xl"},{default:withCtx(()=>[createVNode(M,null,{default:withCtx(()=>[createVNode(A,null,{default:withCtx(()=>[...x[34]||(x[34]=[createTextVNode("历史记录",-1)])]),_:1}),createVNode(F,null,{default:withCtx(()=>[...x[35]||(x[35]=[createTextVNode("每隔 30 秒自动保存,最多保留 10 条",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_4$e,[createBaseVNode("ul",_hoisted_5$d,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(e).getPostById(unref(b))?.history,(pe,Ve)=>(openBlock(),createElementBlock("li",{key:pe.datetime,class:normalizeClass(["h-8 w-full inline-flex cursor-pointer items-center gap-2 rounded px-2 text-sm transition-colors",["hover:bg-primary/90 hover:text-primary-foreground",{"bg-primary text-primary-foreground shadow-lg dark:border dark:border-primary":unref(R)===Ve,"dark:bg-gray/30 dark:text-primary-foreground-dark dark:border-primary-dark":unref(R)===Ve}]]),onClick:Be=>R.value=Ve},toDisplayString(pe.datetime),11,_hoisted_6$b))),128))]),createVNode(Ce,{orientation:"vertical",class:"mx-2"}),createBaseVNode("div",_hoisted_7$8,[createBaseVNode("div",_hoisted_8$6,toDisplayString(unref(e).getPostById(unref(b))?.history[unref(R)].content??""),1)])]),createVNode(ae,null,{default:withCtx(()=>[createVNode(ye,null,{default:withCtx(()=>[createVNode(ve,null,{default:withCtx(()=>[createVNode(J,null,{default:withCtx(()=>[...x[36]||(x[36]=[createTextVNode("恢 复",-1)])]),_:1})]),_:1}),createVNode(xe,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[createVNode(q,null,{default:withCtx(()=>[...x[37]||(x[37]=[createTextVNode("提示",-1)])]),_:1}),createVNode(P,null,{default:withCtx(()=>[...x[38]||(x[38]=[createTextVNode(" 此操作将用该记录替换当前文章内容,是否继续? ",-1)])]),_:1})]),_:1}),createVNode(ke,null,{default:withCtx(()=>[createVNode(me,null,{default:withCtx(()=>[...x[39]||(x[39]=[createTextVNode("取消",-1)])]),_:1}),createVNode(be,{onClick:y},{default:withCtx(()=>[...x[40]||(x[40]=[createTextVNode(" 恢 复 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])],64)}}}),__unplugin_components_2=_export_sfc(_sfc_main$L,[["__scopeId","data-v-d1763e2d"]]),useAIImageConfigStore=defineStore("AIImageConfig",()=>{const t=useStorage("openai_image_type",DEFAULT_SERVICE_TYPE),e=useStorage("openai_image_size","1024x1024"),o=useStorage("openai_image_quality","standard"),a=useStorage("openai_image_style","natural"),n=customRef((u,m)=>({get(){return u(),t.value==="custom"?localStorage.getItem(`openai_image_endpoint_${t.value}`)||"":(imageServiceOptions.find(p=>p.value===t.value)??imageServiceOptions[0]).endpoint},set(i){t.value==="custom"&&localStorage.setItem(`openai_image_endpoint_${t.value}`,i),m()}})),s=ref(""),l=customRef((u,m)=>({get(){return u(),localStorage.getItem(`openai_image_key_${t.value}`)||DEFAULT_SERVICE_KEY},set(i){t.value!==DEFAULT_SERVICE_TYPE&&localStorage.setItem(`openai_image_key_${t.value}`,i),m()}}));watch(t,u=>{const m=imageServiceOptions.find(i=>i.value===u)??imageServiceOptions[0];if(u==="custom"){const i=localStorage.getItem(`openai_image_model_${u}`)||"";s.value=i}else{const i=localStorage.getItem(`openai_image_model_${u}`)||"";s.value=m.models.includes(i)?i:m.models[0],!m.models.includes(i)&&m.models[0]&&localStorage.setItem(`openai_image_model_${u}`,m.models[0])}},{immediate:!0}),watch(s,u=>{localStorage.setItem(`openai_image_model_${t.value}`,u)});function d(){t.value=DEFAULT_SERVICE_TYPE,e.value="1024x1024",o.value="standard",a.value="natural",imageServiceOptions.forEach(({value:u})=>{localStorage.removeItem(`openai_image_key_${u}`),localStorage.removeItem(`openai_image_model_${u}`),localStorage.removeItem(`openai_image_endpoint_${u}`)})}return{type:t,endpoint:n,model:s,size:e,quality:o,style:a,apiKey:l,reset:d}}),_hoisted_1$h={class:"relative"},_hoisted_2$f=["type","placeholder"],_sfc_main$K=defineComponent({__name:"PasswordInput",props:{defaultValue:{},modelValue:{},class:{},placeholder:{}},setup(t,{emit:e}){const o=t,n=useVModel(o,"modelValue",e,{passive:!0,defaultValue:o.defaultValue}),s=ref(!1);function l(){s.value=!s.value}return(d,u)=>(openBlock(),createElementBlock("div",_hoisted_1$h,[withDirectives(createBaseVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=m=>isRef(n)?n.value=m:null),type:unref(s)?"text":"password",placeholder:t.placeholder,class:normalizeClass(unref(cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,10,_hoisted_2$f),[[vModelDynamic,unref(n)]]),createBaseVNode("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"切换密码可见性",onClick:l},[unref(s)?(openBlock(),createBlock(unref(EyeOff),{key:1,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Eye),{key:0,class:"h-4 w-4"}))])]))}}),_hoisted_1$g={class:"space-y-4 max-w-full"},_hoisted_2$e=["readonly"],_hoisted_3$e={key:0},_hoisted_4$d={key:1},_hoisted_5$c={key:2},_hoisted_6$a={key:3,class:"flex items-start gap-2 p-3 bg-blue-50 dark:bg-blue-950/30 rounded-md text-sm"},_hoisted_7$7={key:4,class:"flex items-start gap-2 p-3 bg-orange-50 dark:bg-orange-950/30 rounded-md text-sm"},_hoisted_8$5={class:"flex flex-wrap gap-2"},_hoisted_9$4={key:5,class:"mt-1 text-xs text-gray-500"},_sfc_main$J=defineComponent({__name:"AIImageConfig",emits:["saved"],setup(t,{emit:e}){const o=e,a=useAIImageConfigStore(),{type:n,endpoint:s,model:l,apiKey:d,size:u,quality:m,style:i}=storeToRefs(a),p=ref(!1),C=ref(""),h=computed(()=>imageServiceOptions.find(R=>R.value===n.value)||imageServiceOptions[0]);watch(n,()=>{C.value=""}),watch(l,()=>{C.value=""}),watch(s,()=>{C.value=""});function T(){if(!s.value.trim()||!l.value.trim()){C.value="❌ 请检查配置项是否完整";return}if(n.value!==DEFAULT_SERVICE_TYPE&&!d.value.trim()){C.value="❌ 请输入 API Key";return}try{new URL(s.value)}catch{C.value="❌ 端点格式有误";return}C.value="✅ 配置已保存",o("saved")}function v(){a.reset(),C.value="🗑️ 当前 AI 图像配置已清除"}async function g(){C.value="",p.value=!0;const R={"Content-Type":"application/json"};d.value&&n.value!==DEFAULT_SERVICE_TYPE&&(R.Authorization=`Bearer ${d.value}`);try{const N=new URL(s.value);!N.pathname.includes("/images/")&&!N.pathname.endsWith("/images/generations")&&(N.pathname=N.pathname.replace(/\/?$/,"/images/generations"));const y={model:l.value,prompt:"test connection",size:u.value,quality:m.value,style:i.value,n:1},E=await window.fetch(N.toString(),{method:"POST",headers:R,body:JSON.stringify(y)});if(E.ok)C.value="✅ 连接成功";else{const S=await E.text();C.value=`❌ 连接失败:${E.status} ${S}`}}catch(N){C.value=`❌ 连接失败:${N.message}`}finally{p.value=!1}}const f=[{label:"正方形 (1024x1024)",value:"1024x1024"},{label:"横版 (1792x1024)",value:"1792x1024"},{label:"竖版 (1024x1792)",value:"1024x1792"}],_=[{label:"标准",value:"standard"},{label:"高清",value:"hd"}],b=[{label:"自然",value:"natural"},{label:"鲜明",value:"vivid"}];return(R,N)=>(openBlock(),createElementBlock("div",_hoisted_1$g,[N[19]||(N[19]=createBaseVNode("div",{class:"text-lg font-semibold border-b pb-2"}," AI 图像生成配置 ",-1)),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[8]||(N[8]=[createTextVNode("服务商",-1)])]),_:1}),createVNode(unref(_sfc_main$1l),{modelValue:unref(n),"onUpdate:modelValue":N[0]||(N[0]=y=>isRef(n)?n.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1f),null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(h).label),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1e),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(imageServiceOptions),y=>(openBlock(),createBlock(unref(_sfc_main$1j),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[9]||(N[9]=[createTextVNode("API 端点",-1)])]),_:1}),withDirectives(createBaseVNode("input",{"onUpdate:modelValue":N[1]||(N[1]=y=>isRef(s)?s.value=y:null),type:"url",class:"w-full mt-1 p-2 border rounded-md bg-background focus:ring-2 focus:ring-primary focus:border-primary transition-colors",placeholder:"https://api.openai.com/v1",readonly:unref(n)!=="custom"},null,8,_hoisted_2$e),[[vModelText,unref(s)]])]),unref(n)!=="default"?(openBlock(),createElementBlock("div",_hoisted_3$e,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[10]||(N[10]=[createTextVNode("API Key",-1)])]),_:1}),createVNode(unref(_sfc_main$K),{modelValue:unref(d),"onUpdate:modelValue":N[2]||(N[2]=y=>isRef(d)?d.value=y:null),class:"w-full mt-1 focus:ring-2 focus:ring-primary focus:border-primary transition-colors",placeholder:"sk-..."},null,8,["modelValue"])])):createCommentVNode("",!0),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[11]||(N[11]=[createTextVNode("模型",-1)])]),_:1}),unref(n)!=="custom"&&unref(h).models.length>0?(openBlock(),createBlock(unref(_sfc_main$1l),{key:0,modelValue:unref(l),"onUpdate:modelValue":N[3]||(N[3]=y=>isRef(l)?l.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1f),null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(l)||"请选择模型"),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1e),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(h).models,y=>(openBlock(),createBlock(unref(_sfc_main$1j),{key:y,value:y},{default:withCtx(()=>[createTextVNode(toDisplayString(y),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])):withDirectives((openBlock(),createElementBlock("input",{key:1,"onUpdate:modelValue":N[4]||(N[4]=y=>isRef(l)?l.value=y:null),type:"text",class:"w-full mt-1 p-2 border rounded-md bg-background focus:ring-2 focus:ring-primary focus:border-primary transition-colors",placeholder:"输入模型名称,如:dall-e-3"},null,512)),[[vModelText,unref(l)]])]),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[12]||(N[12]=[createTextVNode("图像尺寸",-1)])]),_:1}),createVNode(unref(_sfc_main$1l),{modelValue:unref(u),"onUpdate:modelValue":N[5]||(N[5]=y=>isRef(u)?u.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1f),null,{default:withCtx(()=>[createTextVNode(toDisplayString(f.find(y=>y.value===unref(u))?.label||unref(u)),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1e),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(f,y=>createVNode(unref(_sfc_main$1j),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])]),unref(l).includes("dall-e")?(openBlock(),createElementBlock("div",_hoisted_4$d,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[13]||(N[13]=[createTextVNode("图像质量",-1)])]),_:1}),createVNode(unref(_sfc_main$1l),{modelValue:unref(m),"onUpdate:modelValue":N[6]||(N[6]=y=>isRef(m)?m.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1f),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_.find(y=>y.value===unref(m))?.label||unref(m)),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1e),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(_,y=>createVNode(unref(_sfc_main$1j),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])])):createCommentVNode("",!0),unref(l).includes("dall-e")?(openBlock(),createElementBlock("div",_hoisted_5$c,[createVNode(unref(_sfc_main$1F),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...N[14]||(N[14]=[createTextVNode("图像风格",-1)])]),_:1}),createVNode(unref(_sfc_main$1l),{modelValue:unref(i),"onUpdate:modelValue":N[7]||(N[7]=y=>isRef(i)?i.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1f),null,{default:withCtx(()=>[createTextVNode(toDisplayString(b.find(y=>y.value===unref(i))?.label||unref(i)),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1e),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(b,y=>createVNode(unref(_sfc_main$1j),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])])):createCommentVNode("",!0),unref(n)==="default"?(openBlock(),createElementBlock("div",_hoisted_6$a,[createVNode(unref(Info),{class:"h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0"}),N[15]||(N[15]=createBaseVNode("div",{class:"text-blue-700 dark:text-blue-300"},[createBaseVNode("p",{class:"font-medium"}," 默认图像服务 "),createBaseVNode("p",null,"免费使用,无需配置 API Key,支持 Kwai-Kolors/Kolors 模型。")],-1))])):unref(n)==="custom"?(openBlock(),createElementBlock("div",_hoisted_7$7,[createVNode(unref(Info),{class:"h-4 w-4 text-orange-500 mt-0.5 flex-shrink-0"}),N[16]||(N[16]=createBaseVNode("div",{class:"text-orange-700 dark:text-orange-300"},[createBaseVNode("p",{class:"font-medium"}," 自定义服务 "),createBaseVNode("p",null,"可配置任何兼容 OpenAI 图像生成 API 的服务,如自建的 API 代理或其他第三方服务。"),createBaseVNode("p",{class:"mt-1 text-xs"}," 端点格式示例:https://your-api.com/v1 ")],-1))])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_8$5,[createVNode(unref(_sfc_main$1O),{type:"button",class:"flex-1 min-w-[100px]",onClick:T},{default:withCtx(()=>[...N[17]||(N[17]=[createTextVNode(" 保存配置 ",-1)])]),_:1}),createVNode(unref(_sfc_main$1O),{variant:"outline",type:"button",class:"flex-1 min-w-[80px]",onClick:v},{default:withCtx(()=>[...N[18]||(N[18]=[createTextVNode(" 清空 ",-1)])]),_:1}),createVNode(unref(_sfc_main$1O),{size:"sm",variant:"outline",class:"flex-1 min-w-[100px]",disabled:unref(p),onClick:g},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(p)?"测试中...":"测试连接"),1)]),_:1},8,["disabled"])]),unref(C)?(openBlock(),createElementBlock("div",_hoisted_9$4,toDisplayString(unref(C)),1)):createCommentVNode("",!0)]))}}),_hoisted_1$f={class:"space-x-1 flex items-center"},_hoisted_2$d={key:0,class:"mb-4 w-full border rounded-md p-4 max-h-[60vh] overflow-y-auto flex-shrink-0"},_hoisted_3$d={key:1,class:"flex flex-col space-y-4 flex-shrink-0"},_hoisted_4$c={class:"flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded-lg min-h-[250px] sm:min-h-[300px]"},_hoisted_5$b={key:0,class:"flex flex-col items-center gap-4"},_hoisted_6$9={key:1,class:"w-full flex flex-col space-y-3"},_hoisted_7$6={key:0,class:"flex items-center justify-between p-2 bg-muted/20 rounded"},_hoisted_8$4={class:"text-sm text-muted-foreground"},_hoisted_9$3={class:"flex items-center justify-center p-2 sm:p-4"},_hoisted_10$1=["src","alt"],_hoisted_11$1={class:"px-2 sm:px-4 py-2 bg-muted/10 rounded space-y-1"},_hoisted_12$1={class:"text-xs text-muted-foreground text-center"},_hoisted_13$1={class:"text-xs text-muted-foreground break-words text-center"},_hoisted_14$1={class:"ml-1"},_hoisted_15$1={class:"text-xs text-muted-foreground text-center"},_hoisted_16$1={class:"flex flex-wrap justify-center gap-2 p-2 sm:p-4 bg-muted/20 border-t border-border rounded-b-lg"},_hoisted_17$1={key:2,class:"relative flex-shrink-0 mt-auto"},_hoisted_18$1={class:"bg-background border-border flex flex-col items-baseline gap-2 border rounded-xl px-3 py-2 pr-12 shadow-inner"},_sfc_main$I=defineComponent({__name:"AIImageGeneratorPanel",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=useStore(),{editor:s}=storeToRefs(n),l=useDisplayStore(),{toggleAIDialog:d}=l,u=ref(o.open);watch(()=>o.open,L=>{u.value=L,L&&ne()}),watch(u,L=>a("update:open",L));const m=ref(!1),i=ref(!1),p=ref(""),C=ref(""),h=ref([]),T=ref([]),v=ref([]),g=ref(null),f=ref(0),_=ref(null),b=useAIImageConfigStore(),{apiKey:R,endpoint:N,model:y,type:E,size:S,quality:j,style:oe}=storeToRefs(b);function V(L){return Date.now()-L>36e5}function ne(){const L=localStorage.getItem("ai_generated_images"),G=localStorage.getItem("ai_image_prompts"),te=localStorage.getItem("ai_image_timestamps");if(!L)return;const fe=JSON.parse(L),se=G?JSON.parse(G):[],re=te?JSON.parse(te):[];if(!te||re.length===0){console.log("🧹 检测到旧版本数据,清除所有过期图片"),h.value=[],T.value=[],v.value=[],localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps");return}const ce=[];re.forEach((me,be)=>{V(me)||ce.push(be)});const q=ce.map(me=>fe[me]).filter(Boolean),P=ce.map(me=>se[me]||"").filter((me,be)=>q[be]),_e=ce.map(me=>re[me]).filter(Boolean);h.value=q,T.value=P,v.value=_e,q.length<fe.length&&(console.log(`🧹 清除了 ${fe.length-q.length} 张过期图片`),q.length>0?(localStorage.setItem("ai_generated_images",JSON.stringify(q)),localStorage.setItem("ai_image_prompts",JSON.stringify(P)),localStorage.setItem("ai_image_timestamps",JSON.stringify(_e))):(localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps"))),console.log("📊 过期检查完成,有效图片数量:",q.length)}onMounted(()=>{ne();const L=h.value.length,G=T.value.length,te=v.value.length,fe=Math.max(L,G,te);L<fe?(console.warn("⚠️ 数据不一致,清除所有数据"),h.value=[],T.value=[],v.value=[],localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps")):(G<L&&(T.value=[...T.value,...Array.from({length:L-G},()=>"")]),te<L&&(v.value=[...v.value,...Array.from({length:L-te},()=>Date.now())])),_.value=setInterval(()=>{h.value.length>0&&ne()},3e4)}),onBeforeUnmount(()=>{_.value&&(clearInterval(_.value),_.value=null)});function H(){m.value=!1}function Y(){a("update:open",!1),setTimeout(()=>{d(!0)},100)}function $(L){L.isComposing||L.keyCode===229||L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),x())}async function x(){if(!p.value.trim()||i.value)return;const L=p.value.trim();C.value=L,i.value=!0,g.value=new AbortController;const G={"Content-Type":"application/json"};R.value&&E.value!=="default"&&(G.Authorization=`Bearer ${R.value}`);try{const te=new URL(N.value);!te.pathname.includes("/images/")&&!te.pathname.endsWith("/images/generations")&&(te.pathname=te.pathname.replace(/\/?$/,"/images/generations"));const fe={model:y.value,prompt:L,size:S.value,n:1};y.value.includes("dall-e")&&(fe.quality=j.value,fe.style=oe.value);const se=await window.fetch(te.toString(),{method:"POST",headers:G,body:JSON.stringify(fe),signal:g.value.signal});if(!se.ok){const ce=await se.text();throw new Error(`${se.status}: ${ce}`)}const re=await se.json();if(re.data&&re.data.length>0){const ce=re.data[0].url||re.data[0].b64_json;if(ce){const q=ce.startsWith("data:")||ce.startsWith("http")?ce:`data:image/png;base64,${ce}`,P=Date.now();h.value.unshift(q),T.value.unshift(L),v.value.unshift(P),f.value=0,h.value.length>20&&(h.value=h.value.slice(0,20),T.value=T.value.slice(0,20),v.value=v.value.slice(0,20)),localStorage.setItem("ai_generated_images",JSON.stringify(h.value)),localStorage.setItem("ai_image_prompts",JSON.stringify(T.value)),localStorage.setItem("ai_image_timestamps",JSON.stringify(v.value)),p.value=""}}else throw new Error("未收到有效的图像数据")}catch(te){te.name==="AbortError"?console.log("图像生成请求中止"):console.error("图像生成失败:",te)}finally{i.value=!1,g.value=null}}function J(){g.value&&(g.value.abort(),g.value=null),i.value=!1}function W(){h.value=[],T.value=[],v.value=[],f.value=0,localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps")}async function de(L,G){try{const fe=await(await fetch(L)).blob(),se=window.URL.createObjectURL(fe),re=document.createElement("a");re.href=se;const ce=T.value[G]||"",q=ce?ce.substring(0,20).replace(/[^\w\s-]/g,"").replace(/\s+/g,"-"):"no-prompt";re.download=`ai-image-${G+1}-${q}.png`,document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(se)}catch(te){console.error("下载图像失败:",te)}}async function Z(L){try{await copyPlain(L),console.log("✅ 图片链接已复制到剪贴板"),typeof toast<"u"&&toast.success("图片链接已复制到剪贴板")}catch(G){console.error("❌ 复制失败:",G),typeof toast<"u"&&toast.error("复制失败,请重试")}}function le(){const L=T.value[f.value];L?(console.log("🔄 重新生成图像,使用当前图片的prompt:",L),ge(L)):console.warn("⚠️ 没有找到当前图片的prompt")}async function ge(L){if(!L.trim()||i.value)return;i.value=!0,g.value=new AbortController;const G={"Content-Type":"application/json"};R.value&&E.value!=="default"&&(G.Authorization=`Bearer ${R.value}`);try{const te=new URL(N.value);!te.pathname.includes("/images/")&&!te.pathname.endsWith("/images/generations")&&(te.pathname=te.pathname.replace(/\/?$/,"/images/generations"));const fe={model:y.value,prompt:L.trim(),size:S.value,n:1};y.value.includes("dall-e")&&(fe.quality=j.value,fe.style=oe.value);const se=await window.fetch(te.toString(),{method:"POST",headers:G,body:JSON.stringify(fe),signal:g.value.signal});if(!se.ok){const ce=await se.text();throw new Error(`${se.status}: ${ce}`)}const re=await se.json();if(re.data&&re.data.length>0){const ce=re.data[0].url||re.data[0].b64_json;if(ce){const q=ce.startsWith("data:")||ce.startsWith("http")?ce:`data:image/png;base64,${ce}`,P=Date.now();h.value.unshift(q),T.value.unshift(L.trim()),v.value.unshift(P),f.value=0,h.value.length>20&&(h.value=h.value.slice(0,20),T.value=T.value.slice(0,20),v.value=v.value.slice(0,20)),localStorage.setItem("ai_generated_images",JSON.stringify(h.value)),localStorage.setItem("ai_image_prompts",JSON.stringify(T.value)),localStorage.setItem("ai_image_timestamps",JSON.stringify(v.value))}}else throw new Error("未收到有效的图像数据")}catch(te){te.name==="AbortError"?console.log("图像生成请求中止"):console.error("图像生成失败:",te)}finally{i.value=!1,g.value=null}}function A(){f.value>0&&f.value--}function F(){f.value<h.value.length-1&&f.value++}function M(L){if(!s.value){console.warn("编辑器未初始化");return}try{const G=T.value[f.value]||"";console.log("🔗 插入图片,使用关联的prompt:",G);const fe=`![${G.trim()?G.trim().substring(0,30).replace(/\n/g," "):"AI生成的图像"}](${L})`,se=s.value.state.selection.main.head;s.value.dispatch({changes:{from:se,insert:fe},selection:{anchor:se+fe.length}}),s.value.focus(),u.value=!1,console.log("✅ 图像已成功插入到光标位置")}catch(G){console.error("❌ 插入图像到光标位置失败:",G)}}function z(L){if(console.log("🔍 点击查看大图:",L),!L){console.error("❌ 图片URL为空");return}try{window.open(L,"_blank","width=800,height=600,scrollbars=yes,resizable=yes")||(console.error("❌ 无法打开新窗口,可能被浏览器阻止"),window.open(L,"_blank"))}catch(G){console.error("❌ 打开图片失败:",G)}}const ae=ref(Date.now());onMounted(()=>{const G=setInterval(()=>{ae.value=Date.now()},1e3);onBeforeUnmount(()=>{clearInterval(G)})});function ee(L){if(!v.value[L])return"未知";const G=3600*1e3,te=v.value[L],fe=ae.value-te,se=G-fe;if(se<=0)return"已过期";const re=Math.floor(se/(60*1e3)),ce=Math.floor(se%(60*1e3)/1e3);return re>0?`${re}分${ce}秒`:`${ce}秒`}function K(L){if(!v.value[L])return"text-muted-foreground";const G=3600*1e3,te=v.value[L],fe=ae.value-te,se=G-fe;return se<=0?"text-red-500 font-medium":se<600*1e3?"text-orange-500 font-medium":se<1800*1e3?"text-yellow-600":"text-green-600"}return(L,G)=>(openBlock(),createBlock(unref(_sfc_main$1I),{open:u.value,"onUpdate:open":G[8]||(G[8]=te=>u.value=te)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1H),{class:"bg-card text-card-foreground flex flex-col w-[95vw] max-h-[90vh] sm:max-h-[85vh] sm:max-w-4xl overflow-y-auto"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1A),{class:"space-y-1 flex flex-col items-start"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$f,[createVNode(unref(_sfc_main$1z),null,{default:withCtx(()=>[...G[9]||(G[9]=[createTextVNode("AI 文生图",-1)])]),_:1}),createVNode(unref(_sfc_main$1O),{title:m.value?"AI 文生图":"配置参数","aria-label":m.value?"AI 文生图":"配置参数",variant:"ghost",size:"icon",onClick:G[0]||(G[0]=te=>m.value=!m.value)},{default:withCtx(()=>[m.value?(openBlock(),createBlock(unref(Image),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Settings),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"]),createVNode(unref(_sfc_main$1O),{title:"AI 对话","aria-label":"AI 对话",variant:"ghost",size:"icon",onClick:G[1]||(G[1]=te=>Y())},{default:withCtx(()=>[createVNode(unref(MessageCircle),{class:"h-4 w-4"})]),_:1}),createVNode(unref(_sfc_main$1O),{title:"清空图像","aria-label":"清空图像",variant:"ghost",size:"icon",onClick:W},{default:withCtx(()=>[createVNode(unref(Trash2),{class:"h-4 w-4"})]),_:1})]),createVNode(unref(_sfc_main$19),{class:"text-muted-foreground text-sm"},{default:withCtx(()=>[...G[10]||(G[10]=[createTextVNode(" 使用 AI 根据文字描述生成图像 ",-1)])]),_:1})]),_:1}),m.value?(openBlock(),createElementBlock("div",_hoisted_2$d,[createVNode(_sfc_main$J,{onSaved:H})])):createCommentVNode("",!0),!m.value&&(i.value||h.value.length>0)?(openBlock(),createElementBlock("div",_hoisted_3$d,[createBaseVNode("div",_hoisted_4$c,[i.value?(openBlock(),createElementBlock("div",_hoisted_5$b,[createVNode(unref(LoaderCircle),{class:"h-8 w-8 animate-spin text-primary"}),G[12]||(G[12]=createBaseVNode("p",{class:"text-sm text-muted-foreground"}," 正在生成图像... ",-1)),createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",onClick:J},{default:withCtx(()=>[...G[11]||(G[11]=[createTextVNode(" 取消生成 ",-1)])]),_:1})])):h.value.length>0?(openBlock(),createElementBlock("div",_hoisted_6$9,[h.value.length>1?(openBlock(),createElementBlock("div",_hoisted_7$6,[createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",disabled:f.value<=0,onClick:A},{default:withCtx(()=>[...G[13]||(G[13]=[createTextVNode(" 上一张 ",-1)])]),_:1},8,["disabled"]),createBaseVNode("span",_hoisted_8$4,toDisplayString(f.value+1)+" / "+toDisplayString(h.value.length),1),createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",disabled:f.value>=h.value.length-1,onClick:F},{default:withCtx(()=>[...G[14]||(G[14]=[createTextVNode(" 下一张 ",-1)])]),_:1},8,["disabled"])])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_9$3,[createBaseVNode("div",{class:"relative group cursor-pointer w-full max-w-sm",onClick:G[2]||(G[2]=te=>z(h.value[f.value]))},[createBaseVNode("img",{src:h.value[f.value],alt:`生成的图像 ${f.value+1}`,class:"w-full h-auto max-h-[300px] sm:max-h-[350px] object-contain rounded-lg shadow-lg border border-border transition-transform hover:scale-105"},null,8,_hoisted_10$1),G[15]||(G[15]=createBaseVNode("div",{class:"absolute inset-0 bg-black/0 group-hover:bg-black/10 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none"},[createBaseVNode("div",{class:"bg-black/70 text-white px-3 py-1 rounded-md text-sm"}," 点击查看大图 ")],-1))])]),createBaseVNode("div",_hoisted_11$1,[createBaseVNode("p",_hoisted_12$1," 尺寸: "+toDisplayString(unref(S)),1),createBaseVNode("div",_hoisted_13$1,[G[16]||(G[16]=createBaseVNode("span",{class:"font-medium"},"提示词:",-1)),createBaseVNode("span",_hoisted_14$1,toDisplayString(T.value[f.value]||"无关联提示词"),1)]),createBaseVNode("div",_hoisted_15$1,[G[17]||(G[17]=createBaseVNode("span",{class:"font-medium"},"剩余有效期:",-1)),createBaseVNode("span",{class:normalizeClass(["ml-1",K(f.value)])},toDisplayString(ee(f.value)),3),G[18]||(G[18]=createBaseVNode("span",{class:"font-medium"},",请及时下载保存",-1))])]),createBaseVNode("div",_hoisted_16$1,[createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:G[3]||(G[3]=te=>M(h.value[f.value]))},{default:withCtx(()=>[createVNode(unref(Image),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),G[19]||(G[19]=createTextVNode(" 插入 ",-1))]),_:1}),createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:G[4]||(G[4]=te=>de(h.value[f.value],f.value))},{default:withCtx(()=>[createVNode(unref(Download),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),G[20]||(G[20]=createTextVNode(" 下载 ",-1))]),_:1}),createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:G[5]||(G[5]=te=>Z(h.value[f.value]))},{default:withCtx(()=>[createVNode(unref(Copy),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),G[21]||(G[21]=createTextVNode(" 复制 ",-1))]),_:1}),createVNode(unref(_sfc_main$1O),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:le},{default:withCtx(()=>[createVNode(unref(RefreshCcw),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),G[22]||(G[22]=createTextVNode(" 重新生成 ",-1))]),_:1})])])):createCommentVNode("",!0)])])):createCommentVNode("",!0),m.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_17$1,[createBaseVNode("div",_hoisted_18$1,[createVNode(unref(_sfc_main$1D),{modelValue:p.value,"onUpdate:modelValue":G[6]||(G[6]=te=>p.value=te),placeholder:"描述你想要生成的图像... (Enter 生成,Shift+Enter 换行)",rows:"2",class:"custom-scroll min-h-16 w-full resize-none border-none bg-transparent p-0 focus-visible:outline-hidden focus:outline-hidden focus-visible:ring-0 focus:ring-0 focus-visible:ring-offset-0 focus:ring-offset-0 focus-visible:ring-transparent focus:ring-transparent",onKeydown:$},null,8,["modelValue"]),createVNode(unref(_sfc_main$1O),{disabled:!p.value.trim()&&!i.value,size:"icon",class:normalizeClass(["absolute bottom-3 right-3 rounded-full disabled:opacity-40","bg-primary hover:bg-primary/90 text-primary-foreground"]),"aria-label":i.value?"取消":"生成",onClick:G[7]||(G[7]=te=>i.value?J():x())},{default:withCtx(()=>[i.value?(openBlock(),createBlock(unref(LoaderCircle),{key:0,class:"h-4 w-4 animate-spin"})):(openBlock(),createBlock(unref(Image),{key:1,class:"h-4 w-4"}))]),_:1},8,["disabled","aria-label"])])]))]),_:1})]),_:1},8,["open"]))}}),AIImageGeneratorPanel=_export_sfc(_sfc_main$I,[["__scopeId","data-v-9ca1d0e0"]]),_hoisted_1$e={class:"grid grid-cols-1 lg:grid-cols-2 my-5 h-[60vh] lg:h-96 gap-4 text-center"},_hoisted_2$c={class:"flex flex-col overflow-hidden"},_hoisted_3$c={key:0,class:"space-y-2 overflow-auto"},_hoisted_4$b=["id","onUpdate:modelValue"],_hoisted_5$a=["for"],_hoisted_6$8={key:1},_hoisted_7$5={class:"flex flex-col overflow-hidden"},_hoisted_8$3={class:"relative bg-white p-2 dark:bg-gray-900"},_hoisted_9$2={class:"w-full overflow-auto border rounded-md bg-gray-50 p-2 dark:bg-gray-800"},_hoisted_10={class:"text-left text-sm text-gray-500 dark:text-gray-400"},_hoisted_11={class:"col-span-1 lg:col-span-2 flex justify-end"},_hoisted_12={class:"grid grid-cols-1 lg:grid-cols-2 my-5 h-[60vh] lg:h-96 gap-4 text-center"},_hoisted_13={class:"overflow-auto h-full flex flex-col"},_hoisted_14={class:"sticky top-0 z-10 bg-white p-2 dark:bg-gray-900"},_hoisted_15={key:0,class:"m-4 flex-1 flex flex-col items-center justify-center border-2 rounded-lg border-dashed"},_hoisted_16={for:"json-import-input",class:"flex-1 w-full flex flex-col cursor-pointer items-center justify-center rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800"},_hoisted_17={key:1,class:"mt-4 border rounded-md bg-gray-50 p-2 dark:bg-gray-800"},_hoisted_18={class:"text-left text-sm text-gray-500 dark:text-gray-400"},_hoisted_19={class:"overflow-auto h-full flex flex-col"},_hoisted_20={key:0},_hoisted_21={class:"space-y-2"},_hoisted_22=["id","onUpdate:modelValue"],_hoisted_23=["for"],_hoisted_24={key:1,class:"flex-1 flex items-center justify-center text-gray-500 dark:text-gray-400"},_hoisted_25={class:"flex-1 col-span-1 lg:col-span-2 flex justify-end"},_hoisted_26={class:"max-h-[70vh] overflow-hidden"},_hoisted_27={class:"h-full overflow-auto border rounded-md bg-gray-50 p-4 dark:bg-gray-800"},_hoisted_28={class:"break-all text-left text-sm text-gray-500 dark:text-gray-400"},_sfc_main$H=defineComponent({__name:"EditorStateDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const o=t,a=e;watch(()=>o.visible,E=>{E&&u()});function n(E){E||a("close")}const s=ref("import"),l=ref([{value:"import",label:"导入配置"},{value:"export",label:"导出配置"}]),d=ref({data:{},selected:{}});async function u(){try{const E=getAllStoreStates();d.value={data:E,selected:Object.keys(E).reduce((S,j)=>(S[j]=!0,S),{})}}catch{}}const m=computed(()=>d.value.data?Object.keys(d.value.data).reduce((E,S)=>(d.value.selected[S]&&(E[S]=d.value.data[S]),E),{}):{}),i=ref({data:{},selected:{}}),p=ref(null),C=computed(()=>i.value.data?Object.keys(i.value.data).reduce((E,S)=>(i.value.selected[S]&&(E[S]=i.value.data[S]),E),{}):{});function h(){const E=Object.keys(d.value.data).reduce((S,j)=>(d.value.selected[j]&&(S[j]=d.value.data[j]),S),{});downloadFile(JSON.stringify(E,null,2),"exported_config.json","application/json"),toast.success("配置文件导出成功"),a("close")}const T=ref(!1),v=computed(()=>s.value==="export"?m.value:s.value==="import"?C.value:{});function g(E){copyPlain(E),toast.success("复制成功")}const f=ref(null);function _(){f.value?.click()}function b(E){const S=E.target;if(!S.files?.length)return;const j=S.files[0],oe=new FileReader;oe.onload=V=>{try{const ne=V.target?.result,H=JSON.parse(ne);if(typeof H!="object"||Array.isArray(H)){toast.error("导入的文件格式不正确");return}const Y=Object.keys(d.value.data).concat(Object.keys(i.value.data)),$=Object.keys(H).reduce((x,J)=>(Y.includes(J)&&(x[J]=H[J]),x),{});if(Object.keys($).length===0){toast.error("导入的文件无可应用项目配置");return}p.value=H,i.value={data:H,selected:Object.keys(H).reduce((x,J)=>(x[J]=!0,x),{})},toast.success("配置文件导入成功")}catch{toast.error("文件解析失败,请检查JSON格式")}},oe.readAsText(j),S.value=""}const R=useStore(),N=useDisplayStore();function y(){C.value&&(Object.keys(i.value.selected).forEach(E=>{i.value.selected[E]&&i.value.data?.[E]!==void 0&&(E in R?R[E]=i.value.data[E]:E in N&&(N[E]=i.value.data[E]))}),toast.success("配置应用成功,请刷新页面查看效果"),a("close"))}return(E,S)=>{const j=_sfc_main$1z,oe=_sfc_main$19,V=_sfc_main$1A,ne=_sfc_main$1c,H=_sfc_main$1d,Y=_sfc_main$1O,$=_sfc_main$1o,x=_sfc_main$1q,J=_sfc_main$1H,W=_sfc_main$1I,de=_sfc_main$1x;return openBlock(),createElementBlock(Fragment,null,[createVNode(W,{open:o.visible,"onUpdate:open":n},{default:withCtx(()=>[createVNode(J,{class:"md:max-w-2/3"},{default:withCtx(()=>[createVNode(V,null,{default:withCtx(()=>[createVNode(j,null,{default:withCtx(()=>[...S[5]||(S[5]=[createTextVNode("导入/导出项目配置",-1)])]),_:1}),createVNode(oe,null,{default:withCtx(()=>[...S[6]||(S[6]=[createTextVNode(" 导入的配置将覆盖当前项目的配置,请谨慎操作。 ",-1)])]),_:1})]),_:1}),createVNode(x,{modelValue:unref(s),"onUpdate:modelValue":S[2]||(S[2]=Z=>isRef(s)?s.value=Z:null),class:"w-full"},{default:withCtx(()=>[createVNode(H,null,{default:withCtx(()=>[createVNode(ne,{value:"import"},{default:withCtx(()=>[...S[7]||(S[7]=[createTextVNode(" 导入配置 ",-1)])]),_:1}),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(l).filter(Z=>Z.value!=="import"),Z=>(openBlock(),createBlock(ne,{key:Z.value,value:Z.value},{default:withCtx(()=>[createTextVNode(toDisplayString(Z.label),1)]),_:2},1032,["value"]))),128))]),_:1}),createVNode($,{value:"export"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$e,[createBaseVNode("div",_hoisted_2$c,[S[9]||(S[9]=createBaseVNode("p",{class:"bg-white p-2 dark:bg-gray-900"}," 请选择需要导出的配置 ",-1)),unref(d).data?(openBlock(),createElementBlock("ul",_hoisted_3$c,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(d).data,(Z,le)=>(openBlock(),createElementBlock("li",{key:le,class:"space-x-2 flex items-center"},[withDirectives(createBaseVNode("input",{id:`export-${le}`,"onUpdate:modelValue":ge=>unref(d).selected[le]=ge,type:"checkbox",class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,_hoisted_4$b),[[vModelCheckbox,unref(d).selected[le]]]),createBaseVNode("label",{for:`export-${le}`,class:"text-sm text-gray-700 dark:text-gray-300"},toDisplayString(unref(storeLabels)[le]||le),9,_hoisted_5$a)]))),128))])):(openBlock(),createElementBlock("div",_hoisted_6$8,[...S[8]||(S[8]=[createBaseVNode("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," 加载中... ",-1)])]))]),createBaseVNode("div",_hoisted_7$5,[createBaseVNode("p",_hoisted_8$3,[S[10]||(S[10]=createBaseVNode("span",null,"当前 JSON 预览",-1)),createVNode(unref(Expand),{class:"absolute right-2 top-2 cursor-pointer p-1 text-gray-500 dark:text-gray-400",onClick:S[0]||(S[0]=Z=>T.value=!0)})]),createBaseVNode("div",_hoisted_9$2,[createBaseVNode("pre",_hoisted_10,toDisplayString(JSON.stringify(unref(m),null,2)),1)])]),createBaseVNode("div",_hoisted_11,[createVNode(Y,{type:"primary",disabled:Object.values(unref(d).selected).every(Z=>!Z),onClick:h},{default:withCtx(()=>[...S[11]||(S[11]=[createTextVNode(" 导出选中配置 ",-1)])]),_:1},8,["disabled"])])])]),_:1}),createVNode($,{value:"import"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_12,[createBaseVNode("div",_hoisted_13,[createBaseVNode("p",_hoisted_14,[S[12]||(S[12]=createBaseVNode("span",null,"导入 JSON 配置文件",-1)),createVNode(unref(Expand),{class:"absolute right-2 top-2 cursor-pointer p-1 text-gray-500 dark:text-gray-400",onClick:S[1]||(S[1]=Z=>T.value=!0)})]),unref(p)?(openBlock(),createElementBlock("div",_hoisted_17,[createBaseVNode("pre",_hoisted_18,toDisplayString(JSON.stringify(unref(C),null,2)),1)])):(openBlock(),createElementBlock("div",_hoisted_15,[createBaseVNode("input",{id:"json-import-input",ref_key:"fileInputRef",ref:f,type:"file",accept:".json",class:"hidden",onChange:b},null,544),createBaseVNode("label",_hoisted_16,[createVNode(unref(CloudUpload),{class:"mb-2 size-16 text-gray-500 dark:text-gray-400"}),S[13]||(S[13]=createBaseVNode("span",{class:"text-sm text-gray-500 dark:text-gray-400"}," 点击或拖拽 JSON 文件到此处 ",-1)),S[14]||(S[14]=createBaseVNode("span",{class:"mt-1 text-xs text-gray-400 dark:text-gray-500"}," 支持格式: .json ",-1))])]))]),createBaseVNode("div",_hoisted_19,[S[15]||(S[15]=createBaseVNode("p",{class:"sticky top-0 z-10 bg-white p-2 dark:bg-gray-900"}," 选择要导入的配置项 ",-1)),unref(p)?(openBlock(),createElementBlock("div",_hoisted_20,[createBaseVNode("ul",_hoisted_21,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(i).data,(Z,le)=>(openBlock(),createElementBlock("li",{key:le,class:"space-x-2 flex items-center"},[withDirectives(createBaseVNode("input",{id:`import-${le}`,"onUpdate:modelValue":ge=>unref(i).selected[le]=ge,type:"checkbox",class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,_hoisted_22),[[vModelCheckbox,unref(i).selected[le]]]),createBaseVNode("label",{for:`import-${le}`,class:"text-sm text-gray-700 dark:text-gray-300"},toDisplayString(unref(storeLabels)[le]||le),9,_hoisted_23)]))),128))])])):(openBlock(),createElementBlock("div",_hoisted_24," 请先导入JSON文件 "))]),createBaseVNode("div",_hoisted_25,[createBaseVNode("input",{id:"json-import-input",ref_key:"fileInputRef",ref:f,type:"file",accept:".json",class:"hidden",onChange:b},null,544),createVNode(Y,{variant:"ghost",class:"mr-2",onClick:_},{default:withCtx(()=>[...S[16]||(S[16]=[createTextVNode(" 重新导入 ",-1)])]),_:1}),createVNode(Y,{disabled:Object.values(unref(i).selected).every(Z=>!Z),onClick:y},{default:withCtx(()=>[...S[17]||(S[17]=[createTextVNode(" 应用选中配置 ",-1)])]),_:1},8,["disabled"])])])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["open"]),createVNode(W,{open:unref(T),"onUpdate:open":S[4]||(S[4]=Z=>T.value=Z)},{default:withCtx(()=>[createVNode(J,{class:"max-h-[90vh] max-w-[90vw] overflow-auto"},{default:withCtx(()=>[createVNode(V,null,{default:withCtx(()=>[createVNode(j,null,{default:withCtx(()=>[...S[18]||(S[18]=[createTextVNode("JSON 全屏预览",-1)])]),_:1}),createVNode(oe,null,{default:withCtx(()=>[...S[19]||(S[19]=[createTextVNode(" 当前配置的完整 JSON 数据 ",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_26,[createBaseVNode("div",_hoisted_27,[createBaseVNode("pre",_hoisted_28,toDisplayString(JSON.stringify(unref(v),null,2)),1)])]),createVNode(de,null,{default:withCtx(()=>[createVNode(Y,{variant:"outline",onClick:S[3]||(S[3]=Z=>g(JSON.stringify(unref(v),null,2)))},{default:withCtx(()=>[...S[20]||(S[20]=[createTextVNode(" 复制 JSON 到剪贴板 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])],64)}}}),_hoisted_1$d={class:"text-center"},_hoisted_2$b={class:"grid grid-cols-2 my-5 gap-4"},_hoisted_3$b=["src","alt"],_sfc_main$G=defineComponent({__name:"FundDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const o=t,a=e,n=[{name:"yanglbme",imageUrl:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/support1.jpg",altText:"赞赏二维码 1"},{name:"yangfong",imageUrl:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/support2.jpg",altText:"赞赏二维码 2"}];function s(l){l||a("close")}return(l,d)=>{const u=_sfc_main$1z,m=_sfc_main$1A,i=_sfc_main$1O,p=_sfc_main$1x,C=_sfc_main$1H,h=_sfc_main$1I;return openBlock(),createBlock(h,{open:o.visible,"onUpdate:open":s},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>[...d[1]||(d[1]=[createTextVNode("赞赏",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$d,[d[2]||(d[2]=createBaseVNode("p",null,"若觉得项目不错,可以通过以下方式支持我们~",-1)),createBaseVNode("div",_hoisted_2$b,[(openBlock(),createElementBlock(Fragment,null,renderList(n,T=>createBaseVNode("div",{key:T.name,class:"text-center"},[createBaseVNode("img",{src:T.imageUrl,alt:T.altText,class:"mx-auto",style:{width:"90%","max-width":"200px","border-radius":"10%"}},null,8,_hoisted_3$b)])),64))])]),createVNode(p,{class:"sm:justify-evenly"},{default:withCtx(()=>[createVNode(i,{onClick:d[0]||(d[0]=T=>a("close"))},{default:withCtx(()=>[...d[3]||(d[3]=[createTextVNode(" 关闭 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),_sfc_main$F=defineComponent({__name:"AboutDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const o=t,a=e;function n(d){d||a("close")}const s=[{label:"GitHub 仓库",url:"https://github.com/doocs/md"},{label:"Gitee 仓库",url:"https://gitee.com/doocs/md"},{label:"GitCode 仓库",url:"https://gitcode.com/doocs/md"}];function l(d){window.open(d,"_blank")}return(d,u)=>{const m=_sfc_main$1z,i=_sfc_main$1A,p=_sfc_main$1O,C=_sfc_main$1x,h=_sfc_main$1H,T=_sfc_main$1I;return openBlock(),createBlock(T,{open:o.visible,"onUpdate:open":n},{default:withCtx(()=>[createVNode(h,null,{default:withCtx(()=>[createVNode(i,null,{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[...u[0]||(u[0]=[createTextVNode("关于",-1)])]),_:1})]),_:1}),u[1]||(u[1]=createBaseVNode("div",{class:"text-center"},[createBaseVNode("h3",null,"一款高度简洁的微信 Markdown 编辑器"),createBaseVNode("p",null,"扫码关注公众号 Doocs,原创技术内容第一时间推送!"),createBaseVNode("img",{class:"mx-auto my-5",src:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png",alt:"Doocs Markdown 编辑器",style:{width:"40%"}})],-1)),createVNode(C,{class:"sm:justify-evenly flex flex-wrap gap-2"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(s,v=>createVNode(p,{key:v.url,onClick:g=>l(v.url)},{default:withCtx(()=>[createTextVNode(toDisplayString(v.label),1)]),_:2},1032,["onClick"])),64))]),_:1})]),_:1})]),_:1},8,["open"])}}}),_hoisted_1$c={class:"theme-customizer space-y-4"},_hoisted_2$a={class:"space-y-2 hidden sm:block"},_hoisted_3$a={class:"grid grid-cols-2 justify-items-center gap-2"},_hoisted_4$a={class:"space-y-2 hidden sm:block"},_hoisted_5$9={class:"grid grid-cols-2 justify-items-center gap-2"},_hoisted_6$7={class:"space-y-2"},_hoisted_7$4={class:"grid grid-cols-2 justify-items-center gap-2"},_hoisted_8$2={class:"space-y-2"},_hoisted_9$1={class:"grid grid-cols-2 justify-items-center gap-2"},_sfc_main$E=defineComponent({__name:"ThemeCustomizer",setup(t){const e=useStore(),o=useDisplayStore(),{isDark:a}=storeToRefs(e);function n(){o.toggleShowCssEditor()}return(s,l)=>{const d=_sfc_main$1O;return openBlock(),createElementBlock("div",_hoisted_1$c,[createBaseVNode("div",_hoisted_2$a,[l[8]||(l[8]=createBaseVNode("h2",{class:"text-sm font-medium"}," 编辑区位置 ",-1)),createBaseVNode("div",_hoisted_3$a,[createVNode(d,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isEditOnLeft}]),variant:"outline",onClick:l[0]||(l[0]=u=>!unref(e).isEditOnLeft&&unref(e).toggleEditOnLeft())},{default:withCtx(()=>[...l[6]||(l[6]=[createTextVNode(" 左侧 ",-1)])]),_:1},8,["class"]),createVNode(d,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isEditOnLeft}]),variant:"outline",onClick:l[1]||(l[1]=u=>unref(e).isEditOnLeft&&unref(e).toggleEditOnLeft())},{default:withCtx(()=>[...l[7]||(l[7]=[createTextVNode(" 右侧 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_4$a,[l[9]||(l[9]=createBaseVNode("h2",{class:"text-sm font-medium"}," 预览模式 ",-1)),createBaseVNode("div",_hoisted_5$9,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(widthOptions),({label:u,value:m})=>(openBlock(),createBlock(d,{key:m,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).previewWidth===m}]),variant:"outline",onClick:i=>unref(e).previewWidthChanged(m)},{default:withCtx(()=>[createTextVNode(toDisplayString(u),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_6$7,[l[12]||(l[12]=createBaseVNode("h2",{class:"text-sm font-medium"}," 自定义 CSS 面板 ",-1)),createBaseVNode("div",_hoisted_7$4,[createVNode(d,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(o).isShowCssEditor}]),variant:"outline",onClick:l[2]||(l[2]=u=>!unref(o).isShowCssEditor&&n())},{default:withCtx(()=>[...l[10]||(l[10]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(d,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(o).isShowCssEditor}]),variant:"outline",onClick:l[3]||(l[3]=u=>unref(o).isShowCssEditor&&n())},{default:withCtx(()=>[...l[11]||(l[11]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_8$2,[l[13]||(l[13]=createBaseVNode("h2",{class:"text-sm font-medium"}," 模式 ",-1)),createBaseVNode("div",_hoisted_9$1,[createVNode(d,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(a)}]),variant:"outline",onClick:l[4]||(l[4]=u=>unref(e).toggleDark(!1))},{default:withCtx(()=>[createVNode(unref(Sun),{class:"h-4 w-4"})]),_:1},8,["class"]),createVNode(d,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(a)}]),variant:"outline",onClick:l[5]||(l[5]=u=>unref(e).toggleDark(!0))},{default:withCtx(()=>[createVNode(unref(Moon),{class:"h-4 w-4"})]),_:1},8,["class"])])])])}}}),_hoisted_1$b={class:"mt-4"},_hoisted_2$9={key:0,class:"py-4 text-center"},_hoisted_3$9={key:1,class:"max-h-[400px] flex flex-col overflow-y-auto"},_hoisted_4$9={class:"mb-2 flex items-center gap-2"},_hoisted_5$8=["src"],_hoisted_6$6=["href"],_sfc_main$D=defineComponent({__name:"PostTaskDialog",props:{post:{},open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=computed({get:()=>o.open,set:u=>a("update:open",u)}),s=ref(null),l=ref(!1);async function d(){if(o.post)try{window.$syncer?.addTask({post:{title:o.post.title,content:o.post.content,markdown:o.post.markdown,thumb:o.post.thumb,desc:o.post.desc},accounts:o.post.accounts.filter(u=>u.checked)},u=>{s.value=u},()=>{l.value=!1})}catch(u){console.error("发布失败:",u)}}return watch(()=>o.open,u=>{u&&d()}),(u,m)=>(openBlock(),createBlock(unref(_sfc_main$1I),{open:unref(n),"onUpdate:open":m[0]||(m[0]=i=>isRef(n)?n.value=i:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1H),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1A),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1z),null,{default:withCtx(()=>[...m[1]||(m[1]=[createTextVNode("提交发布任务",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$b,[unref(s)?(openBlock(),createElementBlock("div",_hoisted_3$9,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(s)?.accounts,i=>(openBlock(),createElementBlock("div",{key:i.uid+i.displayName,class:"border-b py-4 last:border-b-0"},[createBaseVNode("div",_hoisted_4$9,[i.icon?(openBlock(),createElementBlock("img",{key:0,src:i.icon,class:"object-cover h-5 w-5",alt:""},null,8,_hoisted_5$8)):createCommentVNode("",!0),createBaseVNode("span",null,toDisplayString(i.title)+" - "+toDisplayString(i.displayName||i.home),1)]),createBaseVNode("div",{class:normalizeClass(["w-full flex-1 gap-2 overflow-auto pl-7 text-sm",{"text-yellow-600":i.status==="uploading","text-red-600":i.status==="failed","text-green-600":i.status==="done"}])},[i.status==="uploading"?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(i.msg||"发布中"),1)],64)):createCommentVNode("",!0),i.status==="failed"?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(" 同步失败, 错误内容:"+toDisplayString(i.error),1)],64)):createCommentVNode("",!0),i.status==="done"&&i.editResp?(openBlock(),createElementBlock(Fragment,{key:2},[m[2]||(m[2]=createTextVNode(" 同步成功 ",-1)),i.type!=="wordpress"&&i.editResp?(openBlock(),createElementBlock("a",{key:0,href:i.editResp.draftLink,class:"ml-2 text-blue-500 hover:underline",referrerPolicy:"no-referrer",target:"_blank"},"查看草稿",8,_hoisted_6$6)):createCommentVNode("",!0)],64)):createCommentVNode("",!0)],2)]))),128))])):(openBlock(),createElementBlock("div",_hoisted_2$9," 等待发布.. "))])]),_:1})]),_:1},8,["open"]))}}),__unplugin_components_13=_export_sfc(_sfc_main$D,[["__scopeId","data-v-4d169344"]]),_sfc_main$C=defineComponent({__name:"AlertDescription",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("text-sm [&_p]:leading-relaxed",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$B=defineComponent({__name:"AlertTitle",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("h5",{class:normalizeClass(unref(cn)("mb-1 font-medium leading-none tracking-tight",e.class))},[renderSlot(o.$slots,"default")],2))}}),alertVariants=cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),_sfc_main$A=defineComponent({__name:"Alert",props:{class:{},variant:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)(unref(alertVariants)({variant:t.variant}),e.class)),role:"alert"},[renderSlot(o.$slots,"default")],2))}}),_hoisted_1$a={class:"w-full flex items-center gap-4"},_hoisted_2$8={class:"w-full flex items-center gap-4"},_hoisted_3$8={class:"w-full flex items-start gap-4"},_hoisted_4$8={class:"w-full flex items-start gap-4"},_hoisted_5$7={class:"flex flex-1 flex-col gap-2"},_hoisted_6$5={class:"flex flex-row items-center gap-4"},_hoisted_7$3={class:"flex items-center gap-2 text-sm"},_hoisted_8$1=["src"],_sfc_main$z=defineComponent({inheritAttrs:!1,__name:"PostInfo",setup(t){const e=useStore(),{output:o,editor:a}=storeToRefs(e),n=ref(!1),s=ref(!1),l=ref([]),d=ref(!1),u=ref({title:"",desc:"",thumb:"",content:"",markdown:"",accounts:[]}),m=computed(()=>s.value&&u.value.accounts.some(v=>v.checked));async function i(){s.value&&l.value.length===0&&await p();let v={thumb:"",title:"",desc:"",content:"",markdown:"",accounts:[]};const g=l.value.filter(f=>!["ipfs"].includes(f.type));try{v={thumb:document.querySelector("#output img")?.src??"",title:[1,2,3,4,5,6].map(f=>document.querySelector(`#output h${f}`)).find(f=>f)?.textContent??"",desc:document.querySelector("#output p")?.textContent?.trim()??"",content:o.value,markdown:a.value?.state.doc.toString()??"",accounts:g}}catch(f){console.log("error",f)}finally{u.value={...v}}}async function p(){return new Promise(v=>{window.$syncer?.getAccounts(g=>{l.value=g.map(f=>({...f,checked:!0})),v()})})}function C(){u.value.accounts=u.value.accounts.filter(v=>v.checked),d.value=!0,n.value=!1}function h(v){v||(n.value=!1)}function T(){if(window.$syncer!==void 0){s.value=!0;return}let v=0;const g=setInterval(async()=>{if(window.$syncer!==void 0){s.value=!0,await p(),clearInterval(g);return}v++,v>10&&clearInterval(g)},500)}return onBeforeMount(()=>{T()}),(v,g)=>{const f=_sfc_main$1O,_=_sfc_main$Q,b=_sfc_main$1z,R=_sfc_main$1A,N=_sfc_main$B,y=_sfc_main$C,E=_sfc_main$A,S=_sfc_main$1F,j=_sfc_main$1B,oe=_sfc_main$1D,V=_sfc_main$1x,ne=_sfc_main$1H,H=_sfc_main$1I,Y=__unplugin_components_13;return openBlock(),createElementBlock("div",normalizeProps(guardReactiveProps(v.$attrs)),[createVNode(H,{open:unref(n),"onUpdate:open":[g[4]||(g[4]=$=>isRef(n)?n.value=$:null),h]},{default:withCtx(()=>[createVNode(_,null,{default:withCtx(()=>[unref(e).isMobile?createCommentVNode("",!0):(openBlock(),createBlock(f,{key:0,variant:"outline",onClick:i},{default:withCtx(()=>[...g[6]||(g[6]=[createTextVNode(" 发布 ",-1)])]),_:1}))]),_:1}),createVNode(ne,null,{default:withCtx(()=>[createVNode(R,null,{default:withCtx(()=>[createVNode(b,null,{default:withCtx(()=>[...g[7]||(g[7]=[createTextVNode("发布",-1)])]),_:1})]),_:1}),createVNode(E,null,{default:withCtx(()=>[createVNode(unref(Info),{class:"h-4 w-4"}),createVNode(N,null,{default:withCtx(()=>[...g[8]||(g[8]=[createTextVNode("提示",-1)])]),_:1}),createVNode(y,null,{default:withCtx(()=>[...g[9]||(g[9]=[createTextVNode(" 此功能由第三方浏览器插件支持,本平台不保证安全性及同步准确度。 ",-1)])]),_:1})]),_:1}),unref(s)?createCommentVNode("",!0):(openBlock(),createBlock(E,{key:0},{default:withCtx(()=>[createVNode(unref(Info),{class:"h-4 w-4"}),createVNode(N,null,{default:withCtx(()=>[...g[10]||(g[10]=[createTextVNode("未检测到插件",-1)])]),_:1}),createVNode(y,null,{default:withCtx(()=>[g[12]||(g[12]=createTextVNode(" 请安装 ",-1)),createVNode(unref(O),{as:"a",class:"text-blue-500",href:"https://www.wechatsync.com/?utm_source=syncicon#install",target:"_blank"},{default:withCtx(()=>[...g[11]||(g[11]=[createTextVNode(" 文章同步助手 ",-1)])]),_:1}),g[13]||(g[13]=createTextVNode(" 插件 ",-1))]),_:1})]),_:1})),createBaseVNode("div",_hoisted_1$a,[createVNode(S,{for:"thumb",class:"w-10 text-end"},{default:withCtx(()=>[...g[14]||(g[14]=[createTextVNode(" 封面 ",-1)])]),_:1}),createVNode(j,{id:"thumb",modelValue:unref(u).thumb,"onUpdate:modelValue":g[0]||(g[0]=$=>unref(u).thumb=$),placeholder:"自动提取第一张图"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_2$8,[createVNode(S,{for:"title",class:"w-10 text-end"},{default:withCtx(()=>[...g[15]||(g[15]=[createTextVNode(" 标题 ",-1)])]),_:1}),createVNode(j,{id:"title",modelValue:unref(u).title,"onUpdate:modelValue":g[1]||(g[1]=$=>unref(u).title=$),placeholder:"自动提取第一个标题"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_3$8,[createVNode(S,{for:"desc",class:"w-10 text-end"},{default:withCtx(()=>[...g[16]||(g[16]=[createTextVNode(" 描述 ",-1)])]),_:1}),createVNode(oe,{id:"desc",modelValue:unref(u).desc,"onUpdate:modelValue":g[2]||(g[2]=$=>unref(u).desc=$),placeholder:"自动提取第一个段落"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_4$8,[createVNode(S,{class:"w-10 text-end"},{default:withCtx(()=>[...g[17]||(g[17]=[createTextVNode(" 账号 ",-1)])]),_:1}),createBaseVNode("div",_hoisted_5$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(u).accounts,$=>(openBlock(),createElementBlock("div",{key:$.uid+$.displayName,class:"flex items-center gap-2"},[createBaseVNode("label",_hoisted_6$5,[createVNode(unref(Wv),{checked:$.checked,"onUpdate:checked":x=>$.checked=x,class:"bg-background hover:bg-muted h-[25px] w-[25px] flex appearance-none items-center justify-center border border-gray-200 rounded-[4px] outline-hidden"},{default:withCtx(()=>[createVNode(unref(jv),null,{default:withCtx(()=>[$.checked?(openBlock(),createBlock(unref(Check),{key:0,class:"h-4 w-4"})):createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["checked","onUpdate:checked"]),createBaseVNode("span",_hoisted_7$3,[createBaseVNode("img",{src:$.icon,alt:"",class:"inline-block h-[20px] w-[20px]"},null,8,_hoisted_8$1),createTextVNode(" "+toDisplayString($.title)+" - "+toDisplayString($.displayName??$.home),1)])])]))),128))])]),createVNode(V,null,{default:withCtx(()=>[createVNode(f,{variant:"outline",onClick:g[3]||(g[3]=$=>n.value=!1)},{default:withCtx(()=>[...g[18]||(g[18]=[createTextVNode(" 取 消 ",-1)])]),_:1}),createVNode(f,{disabled:!unref(m),onClick:C},{default:withCtx(()=>[...g[19]||(g[19]=[createTextVNode(" 确 定 ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(Y,{open:unref(d),"onUpdate:open":g[5]||(g[5]=$=>isRef(d)?d.value=$:null),post:unref(u)},null,8,["open","post"])],16)}}}),_sfc_main$y=defineComponent({__name:"MenubarMenu",props:{value:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Gh),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$x=defineComponent({__name:"MenubarContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:8},align:{default:"start"},alignOffset:{default:-4},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Yh),null,{default:withCtx(()=>[createVNode(unref(Xh),mergeProps(unref(a),{class:unref(cn)("z-50 min-w-48 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$w=defineComponent({__name:"MenubarTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(qh),mergeProps(unref(a),{class:unref(cn)("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-hidden hover:bg-accent focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$v=defineComponent({__name:"Menubar",props:{modelValue:{},defaultValue:{},dir:{},loop:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(Uh),mergeProps(unref(s),{class:unref(cn)("flex h-10 items-center gap-x-1 rounded-md border bg-background p-1",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$u=defineComponent({__name:"MenubarSub",props:{defaultOpen:{type:Boolean},open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(sy),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$t=defineComponent({__name:"MenubarSubContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(Yh),null,{default:withCtx(()=>[createVNode(unref(ry),mergeProps(unref(s),{class:unref(cn)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_hoisted_1$9={class:"absolute left-2 h-3.5 w-3.5 flex items-center justify-center"},_sfc_main$s=defineComponent({__name:"MenubarCheckboxItem",props:{checked:{type:[Boolean,String]},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},emits:["select","update:checked"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(ty),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",o.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$9,[createVNode(unref(ay),null,{default:withCtx(()=>[createVNode(unref(Check),{class:"h-4 w-4"})]),_:1})]),renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$r=defineComponent({__name:"MenubarSubTrigger",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(iy),mergeProps(unref(a),{class:unref(cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t.inset&&"pl-8",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default"),createVNode(unref(ChevronRight),{class:"ml-auto h-4 w-4"})]),_:3},16,["class"]))}}),_sfc_main$q=defineComponent({__name:"HelpDropdown",props:{asSub:{type:Boolean,default:!1}},emits:["openAbout","openFund"],setup(t,{emit:e}){const o=t,a=e,{asSub:n}=toRefs(o);function s(){a("openAbout")}function l(){a("openFund")}return(d,u)=>{const m=_sfc_main$r,i=_sfc_main$s,p=_sfc_main$t,C=_sfc_main$u,h=_sfc_main$w,T=_sfc_main$x,v=_sfc_main$y;return unref(n)?(openBlock(),createBlock(C,{key:0},{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[...u[4]||(u[4]=[createTextVNode(" 帮助 ",-1)])]),_:1}),createVNode(p,{align:"start"},{default:withCtx(()=>[createVNode(i,{onClick:u[0]||(u[0]=g=>s())},{default:withCtx(()=>[...u[5]||(u[5]=[createTextVNode(" 关于 ",-1)])]),_:1}),createVNode(i,{onClick:u[1]||(u[1]=g=>l())},{default:withCtx(()=>[...u[6]||(u[6]=[createTextVNode(" 赞赏 ",-1)])]),_:1})]),_:1})]),_:1})):(openBlock(),createBlock(v,{key:1},{default:withCtx(()=>[createVNode(h,null,{default:withCtx(()=>[...u[7]||(u[7]=[createTextVNode("帮助",-1)])]),_:1}),createVNode(T,{align:"start"},{default:withCtx(()=>[createVNode(i,{onClick:u[2]||(u[2]=g=>s())},{default:withCtx(()=>[...u[8]||(u[8]=[createBaseVNode("span",null,"关于",-1)])]),_:1}),createVNode(i,{onClick:u[3]||(u[3]=g=>l())},{default:withCtx(()=>[...u[9]||(u[9]=[createBaseVNode("span",null,"赞赏",-1)])]),_:1})]),_:1})]),_:1}))}}}),_sfc_main$p=defineComponent({__name:"HoverCard",props:{defaultOpen:{type:Boolean},open:{type:Boolean},openDelay:{},closeDelay:{}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Rh),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$o=defineComponent({__name:"HoverCardContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Oh),null,{default:withCtx(()=>[createVNode(unref(kh),mergeProps(unref(a),{class:unref(cn)("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$n=defineComponent({__name:"HoverCardTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Ah),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$m=defineComponent({__name:"MenubarSeparator",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(ey),mergeProps({class:unref(cn)("-mx-1 my-1 h-px bg-muted",e.class)},unref(a)),null,16,["class"]))}}),_sfc_main$l=defineComponent({__name:"DropdownMenuShortcut",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(cn)("ml-auto text-xs tracking-widest opacity-60",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$k=defineComponent({__name:"StyleOptionMenu",props:{title:{},options:{},current:{},change:{type:Function}},setup(t){const e=t;function o(a,n){switch(a){case"字体":return{fontFamily:n};case"字号":return{fontSize:n};case"主题色":return{color:n};default:return{}}}return(a,n)=>{const s=_sfc_main$r,l=_sfc_main$l,d=_sfc_main$s,u=_sfc_main$t,m=_sfc_main$u;return openBlock(),createBlock(m,null,{default:withCtx(()=>[createVNode(s,null,{default:withCtx(()=>[n[0]||(n[0]=createBaseVNode("span",{class:"mr-2 h-4 w-4"},null,-1)),createBaseVNode("span",null,toDisplayString(e.title),1)]),_:1}),createVNode(u,{class:"max-h-56 overflow-auto"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.options,({label:i,value:p,desc:C})=>(openBlock(),createBlock(d,{key:p,label:i,"model-value":p,class:"w-50",checked:t.current===p,onClick:h=>t.change(p)},{default:withCtx(()=>[createTextVNode(toDisplayString(i)+" ",1),createVNode(l,{style:normalizeStyle(o(t.title,p))},{default:withCtx(()=>[createTextVNode(toDisplayString(C),1)]),_:2},1032,["style"])]),_:2},1032,["label","model-value","checked","onClick"]))),128))]),_:1})]),_:1})}}}),_sfc_main$j=defineComponent({__name:"StyleDropdown",props:{asSub:{type:Boolean,default:!1}},setup(t){const e=t,{asSub:o}=toRefs(e),a=useStore(),{toggleShowCssEditor:n}=useDisplayStore(),{theme:s,fontFamily:l,fontSize:d,primaryColor:u,codeBlockTheme:m,legend:i,isMacCodeBlock:p}=storeToRefs(a),{resetStyleConfirm:C,themeChanged:h,fontChanged:T,sizeChanged:v,colorChanged:g,codeBlockThemeChanged:f,legendChanged:_,macCodeBlockChanged:b}=a,R=ref(null);function N(){R.value?.show()}function y(){n()}const E=useTemplateRef("pickColorsContainer"),S=ref("rgb"),j=ref(["rgb","hex","hsl","hsv"]);return(oe,V)=>{const ne=_sfc_main$r,H=_sfc_main$k,Y=_sfc_main$m,$=_sfc_main$n,x=_sfc_main$o,J=_sfc_main$p,W=_sfc_main$s,de=_sfc_main$t,Z=_sfc_main$u,le=_sfc_main$w,ge=_sfc_main$x,A=_sfc_main$y;return unref(o)?(openBlock(),createBlock(Z,{key:0},{default:withCtx(()=>[createVNode(ne,null,{default:withCtx(()=>[...V[2]||(V[2]=[createTextVNode(" 样式 ",-1)])]),_:1}),createVNode(de,{class:"w-56"},{default:withCtx(()=>[createVNode(H,{title:"主题",options:unref(themeOptions),current:unref(s),change:unref(h)},null,8,["options","current","change"]),createVNode(Y),createVNode(H,{title:"字体",options:unref(fontFamilyOptions),current:unref(l),change:unref(T)},null,8,["options","current","change"]),createVNode(H,{title:"字号",options:unref(fontSizeOptions),current:unref(d),change:unref(v)},null,8,["options","current","change"]),createVNode(H,{title:"主题色",options:unref(colorOptions),current:unref(u),change:unref(g)},null,8,["options","current","change"]),createVNode(H,{title:"代码块主题",options:unref(codeBlockThemeOptions),current:unref(m),change:unref(f)},null,8,["options","current","change"]),createVNode(H,{title:"图注格式",options:unref(legendOptions),current:unref(i),change:unref(_)},null,8,["options","current","change"]),createVNode(Y),createVNode(W,{onClick:withModifiers(N,["self","prevent"])},{default:withCtx(()=>[createVNode(J,{"open-delay":100},{default:withCtx(()=>[createVNode($,{class:"w-full flex"},{default:withCtx(()=>[...V[3]||(V[3]=[createTextVNode(" 自定义主题色 ",-1)])]),_:1}),createVNode(x,{side:"right",class:"w-min"},{default:withCtx(()=>[createBaseVNode("div",{ref_key:"pickColorsContainer",ref:E},[createVNode(unref(Re),{value:unref(u),"onUpdate:value":V[0]||(V[0]=F=>isRef(u)?u.value=F:null),"show-alpha":"",format:unref(S),"format-options":unref(j),theme:unref(a).isDark?"dark":"light","popup-container":unref(E),onChange:unref(a).colorChanged},null,8,["value","format","format-options","theme","popup-container","onChange"])],512)]),_:1})]),_:1})]),_:1}),createVNode(W,{onClick:y},{default:withCtx(()=>[...V[4]||(V[4]=[createTextVNode(" 自定义 CSS ",-1)])]),_:1}),createVNode(Y),createVNode(W,{checked:unref(p),onClick:unref(b)},{default:withCtx(()=>[...V[5]||(V[5]=[createTextVNode(" Mac 代码块 ",-1)])]),_:1},8,["checked","onClick"]),createVNode(Y),createVNode(W,{divided:"",onClick:unref(C)},{default:withCtx(()=>[...V[6]||(V[6]=[createTextVNode(" 重置 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})):(openBlock(),createBlock(A,{key:1},{default:withCtx(()=>[createVNode(le,null,{default:withCtx(()=>[...V[7]||(V[7]=[createTextVNode(" 样式 ",-1)])]),_:1}),createVNode(ge,{class:"w-56",align:"start"},{default:withCtx(()=>[createVNode(H,{title:"主题",options:unref(themeOptions),current:unref(s),change:unref(h)},null,8,["options","current","change"]),createVNode(Y),createVNode(H,{title:"字体",options:unref(fontFamilyOptions),current:unref(l),change:unref(T)},null,8,["options","current","change"]),createVNode(H,{title:"字号",options:unref(fontSizeOptions),current:unref(d),change:unref(v)},null,8,["options","current","change"]),createVNode(H,{title:"主题色",options:unref(colorOptions),current:unref(u),change:unref(g)},null,8,["options","current","change"]),createVNode(H,{title:"代码块主题",options:unref(codeBlockThemeOptions),current:unref(m),change:unref(f)},null,8,["options","current","change"]),createVNode(H,{title:"图注格式",options:unref(legendOptions),current:unref(i),change:unref(_)},null,8,["options","current","change"]),createVNode(Y),createVNode(W,{onClick:withModifiers(N,["self","prevent"])},{default:withCtx(()=>[createVNode(J,{"open-delay":100},{default:withCtx(()=>[createVNode($,{class:"w-full flex"},{default:withCtx(()=>[...V[8]||(V[8]=[createTextVNode(" 自定义主题色 ",-1)])]),_:1}),createVNode(x,{side:"right",class:"w-min"},{default:withCtx(()=>[createBaseVNode("div",{ref_key:"pickColorsContainer",ref:E},[createVNode(unref(Re),{value:unref(u),"onUpdate:value":V[1]||(V[1]=F=>isRef(u)?u.value=F:null),"show-alpha":"",format:unref(S),"format-options":unref(j),theme:unref(a).isDark?"dark":"light","popup-container":unref(E),onChange:unref(a).colorChanged},null,8,["value","format","format-options","theme","popup-container","onChange"])],512)]),_:1})]),_:1})]),_:1}),createVNode(W,{onClick:y},{default:withCtx(()=>[...V[9]||(V[9]=[createTextVNode(" 自定义 CSS ",-1)])]),_:1}),createVNode(Y),createVNode(W,{checked:unref(p),onClick:unref(b)},{default:withCtx(()=>[...V[10]||(V[10]=[createTextVNode(" Mac 代码块 ",-1)])]),_:1},8,["checked","onClick"]),createVNode(Y),createVNode(W,{divided:"",onClick:unref(C)},{default:withCtx(()=>[...V[11]||(V[11]=[createTextVNode(" 重置 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1}))}}}),_sfc_main$i=defineComponent({__name:"MenubarItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(Jh),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",t.inset&&"pl-8",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$h=defineComponent({__name:"EditDropdown",props:{asSub:{type:Boolean,default:!1}},setup(t){const e=t,{asSub:o}=toRefs(e),{toggleShowInsertFormDialog:a,toggleShowUploadImgDialog:n,toggleShowInsertMpCardDialog:s}=useDisplayStore(),{copyToClipboard:l,pasteFromClipboard:d,undo:u,redo:m}=useStore();return(i,p)=>{const C=_sfc_main$r,h=_sfc_main$i,T=_sfc_main$m,v=_sfc_main$t,g=_sfc_main$u,f=_sfc_main$w,_=_sfc_main$x,b=_sfc_main$y;return unref(o)?(openBlock(),createBlock(g,{key:0},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[...p[14]||(p[14]=[createTextVNode(" 编辑 ",-1)])]),_:1}),createVNode(v,null,{default:withCtx(()=>[createVNode(h,{onClick:p[0]||(p[0]=R=>unref(u)())},{default:withCtx(()=>[createVNode(unref(Undo2),{class:"mr-2 h-4 w-4"}),p[15]||(p[15]=createTextVNode(" 撤销 ",-1))]),_:1}),createVNode(h,{onClick:p[1]||(p[1]=R=>unref(m)())},{default:withCtx(()=>[createVNode(unref(Redo2),{class:"mr-2 h-4 w-4"}),p[16]||(p[16]=createTextVNode(" 重做 ",-1))]),_:1}),createVNode(T),createVNode(h,{onClick:p[2]||(p[2]=R=>unref(n)())},{default:withCtx(()=>[createVNode(unref(CloudUpload),{class:"mr-2 h-4 w-4"}),p[17]||(p[17]=createTextVNode(" 上传图片 ",-1))]),_:1}),createVNode(h,{onClick:p[3]||(p[3]=R=>unref(a)())},{default:withCtx(()=>[createVNode(unref(Table),{class:"mr-2 h-4 w-4"}),p[18]||(p[18]=createTextVNode(" 插入表格 ",-1))]),_:1}),createVNode(h,{onClick:p[4]||(p[4]=R=>unref(s)())},{default:withCtx(()=>[createVNode(unref(ContactRound),{class:"mr-2 h-4 w-4"}),p[19]||(p[19]=createTextVNode(" 插入公众号名片 ",-1))]),_:1}),createVNode(T),createVNode(h,{onClick:p[5]||(p[5]=R=>unref(l)())},{default:withCtx(()=>[createVNode(unref(Copy),{class:"mr-2 h-4 w-4"}),p[20]||(p[20]=createTextVNode(" 复制 ",-1))]),_:1}),createVNode(h,{onClick:p[6]||(p[6]=R=>unref(d)())},{default:withCtx(()=>[createVNode(unref(ClipboardPaste),{class:"mr-2 h-4 w-4"}),p[21]||(p[21]=createTextVNode(" 粘贴 ",-1))]),_:1})]),_:1})]),_:1})):(openBlock(),createBlock(b,{key:1},{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[...p[22]||(p[22]=[createTextVNode(" 编辑 ",-1)])]),_:1}),createVNode(_,{align:"start"},{default:withCtx(()=>[createVNode(h,{onClick:p[7]||(p[7]=R=>unref(u)())},{default:withCtx(()=>[createVNode(unref(Undo2),{class:"mr-2 h-4 w-4"}),p[23]||(p[23]=createTextVNode(" 撤销 ",-1))]),_:1}),createVNode(h,{onClick:p[8]||(p[8]=R=>unref(m)())},{default:withCtx(()=>[createVNode(unref(Redo2),{class:"mr-2 h-4 w-4"}),p[24]||(p[24]=createTextVNode(" 重做 ",-1))]),_:1}),createVNode(T),createVNode(h,{onClick:p[9]||(p[9]=R=>unref(n)())},{default:withCtx(()=>[createVNode(unref(CloudUpload),{class:"mr-2 h-4 w-4"}),p[25]||(p[25]=createTextVNode(" 上传图片 ",-1))]),_:1}),createVNode(h,{onClick:p[10]||(p[10]=R=>unref(a)())},{default:withCtx(()=>[createVNode(unref(Table),{class:"mr-2 h-4 w-4"}),p[26]||(p[26]=createTextVNode(" 插入表格 ",-1))]),_:1}),createVNode(h,{onClick:p[11]||(p[11]=R=>unref(s)())},{default:withCtx(()=>[createVNode(unref(ContactRound),{class:"mr-2 h-4 w-4"}),p[27]||(p[27]=createTextVNode(" 插入公众号名片 ",-1))]),_:1}),createVNode(T),createVNode(h,{onClick:p[12]||(p[12]=R=>unref(l)())},{default:withCtx(()=>[createVNode(unref(Copy),{class:"mr-2 h-4 w-4"}),p[28]||(p[28]=createTextVNode(" 复制 ",-1))]),_:1}),createVNode(h,{onClick:p[13]||(p[13]=R=>unref(d)())},{default:withCtx(()=>[createVNode(unref(ClipboardPaste),{class:"mr-2 h-4 w-4"}),p[29]||(p[29]=createTextVNode(" 粘贴 ",-1))]),_:1})]),_:1})]),_:1}))}}}),_sfc_main$g=defineComponent({__name:"FileDropdown",props:{asSub:{type:Boolean,default:!1}},emits:["openEditorState"],setup(t,{emit:e}){const o=t,a=e,{asSub:n}=toRefs(o),s=useStore(),{isDark:l,isEditOnLeft:d,isOpenPostSlider:u}=storeToRefs(s),{exportEditorContent2HTML:m,exportEditorContent2PureHTML:i,exportEditorContent2MD:p,downloadAsCardImage:C,exportEditorContent2PDF:h}=s,T=useImportMarkdownContent();function v(){a("openEditorState")}return(g,f)=>{const _=_sfc_main$r,b=_sfc_main$i,R=_sfc_main$m,N=_sfc_main$s,y=_sfc_main$t,E=_sfc_main$u,S=_sfc_main$w,j=_sfc_main$x,oe=_sfc_main$y;return unref(n)?(openBlock(),createBlock(E,{key:0},{default:withCtx(()=>[createVNode(_,null,{default:withCtx(()=>[...f[20]||(f[20]=[createTextVNode(" 文件 ",-1)])]),_:1}),createVNode(y,null,{default:withCtx(()=>[createVNode(b,{onClick:f[0]||(f[0]=V=>unref(T)())},{default:withCtx(()=>[createVNode(unref(Upload),{class:"mr-2 size-4"}),f[21]||(f[21]=createTextVNode(" 导入 .md ",-1))]),_:1}),createVNode(b,{onClick:f[1]||(f[1]=V=>unref(p)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),f[22]||(f[22]=createTextVNode(" 导出 .md ",-1))]),_:1}),createVNode(b,{onClick:f[2]||(f[2]=V=>unref(m)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),f[23]||(f[23]=createTextVNode(" 导出 .html ",-1))]),_:1}),createVNode(b,{onClick:f[3]||(f[3]=V=>unref(i)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),f[24]||(f[24]=createTextVNode(" 导出 .html(无样式) ",-1))]),_:1}),createVNode(b,{onClick:f[4]||(f[4]=V=>unref(h)())},{default:withCtx(()=>[createVNode(unref(FileText),{class:"mr-2 size-4"}),f[25]||(f[25]=createTextVNode(" 导出 .pdf ",-1))]),_:1}),createVNode(b,{onClick:f[5]||(f[5]=V=>unref(C)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),f[26]||(f[26]=createTextVNode(" 导出 .png ",-1))]),_:1}),createVNode(R),createVNode(b,{onClick:f[6]||(f[6]=V=>v())},{default:withCtx(()=>[createVNode(unref(FileCog),{class:"mr-2 size-4"}),f[27]||(f[27]=createTextVNode(" 导入/导出项目配置 ",-1))]),_:1}),createVNode(R),createVNode(N,{checked:unref(l),"onUpdate:checked":f[7]||(f[7]=V=>isRef(l)?l.value=V:null)},{default:withCtx(()=>[...f[28]||(f[28]=[createTextVNode(" 深色模式 ",-1)])]),_:1},8,["checked"]),createVNode(R),createVNode(N,{checked:unref(d),"onUpdate:checked":f[8]||(f[8]=V=>isRef(d)?d.value=V:null)},{default:withCtx(()=>[...f[29]||(f[29]=[createTextVNode(" 左侧编辑 ",-1)])]),_:1},8,["checked"]),createVNode(R),createVNode(N,{checked:unref(u),"onUpdate:checked":f[9]||(f[9]=V=>isRef(u)?u.value=V:null)},{default:withCtx(()=>[...f[30]||(f[30]=[createTextVNode(" 内容管理 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1})):(openBlock(),createBlock(oe,{key:1},{default:withCtx(()=>[createVNode(S,null,{default:withCtx(()=>[...f[31]||(f[31]=[createTextVNode(" 文件 ",-1)])]),_:1}),createVNode(j,{align:"start"},{default:withCtx(()=>[createVNode(b,{onClick:f[10]||(f[10]=V=>unref(T)())},{default:withCtx(()=>[createVNode(unref(Upload),{class:"mr-2 size-4"}),f[32]||(f[32]=createTextVNode(" 导入 .md ",-1))]),_:1}),createVNode(b,{onClick:f[11]||(f[11]=V=>unref(p)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),f[33]||(f[33]=createTextVNode(" 导出 .md ",-1))]),_:1}),createVNode(b,{onClick:f[12]||(f[12]=V=>unref(m)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),f[34]||(f[34]=createTextVNode(" 导出 .html ",-1))]),_:1}),createVNode(b,{onClick:f[13]||(f[13]=V=>unref(i)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),f[35]||(f[35]=createTextVNode(" 导出 .html(无样式) ",-1))]),_:1}),createVNode(b,{onClick:f[14]||(f[14]=V=>unref(h)())},{default:withCtx(()=>[createVNode(unref(FileText),{class:"mr-2 size-4"}),f[36]||(f[36]=createTextVNode(" 导出 .pdf ",-1))]),_:1}),createVNode(b,{onClick:f[15]||(f[15]=V=>unref(C)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),f[37]||(f[37]=createTextVNode(" 导出 .png ",-1))]),_:1}),createVNode(R),createVNode(b,{onClick:f[16]||(f[16]=V=>v())},{default:withCtx(()=>[createVNode(unref(FileCog),{class:"mr-2 size-4"}),f[38]||(f[38]=createTextVNode(" 导入/导出项目配置 ",-1))]),_:1}),createVNode(R),createVNode(N,{checked:unref(l),"onUpdate:checked":f[17]||(f[17]=V=>isRef(l)?l.value=V:null)},{default:withCtx(()=>[...f[39]||(f[39]=[createTextVNode(" 深色模式 ",-1)])]),_:1},8,["checked"]),createVNode(R),createVNode(N,{checked:unref(d),"onUpdate:checked":f[18]||(f[18]=V=>isRef(d)?d.value=V:null)},{default:withCtx(()=>[...f[40]||(f[40]=[createTextVNode(" 左侧编辑 ",-1)])]),_:1},8,["checked"]),createVNode(R),createVNode(N,{checked:unref(u),"onUpdate:checked":f[19]||(f[19]=V=>isRef(u)?u.value=V:null)},{default:withCtx(()=>[...f[41]||(f[41]=[createTextVNode(" 内容管理 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1}))}}}),_sfc_main$f=defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Cs),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$e=defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{default:4},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...d}=o;return d}),s=Se(n,a);return(l,d)=>(openBlock(),createBlock(unref(_s),null,{default:withCtx(()=>[createVNode(unref(Ss),mergeProps({...unref(s),...l.$attrs},{class:unref(cn)("z-200 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$d=defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(ws),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$c=defineComponent({__name:"MenubarShortcut",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(cn)("ml-auto text-xs tracking-widest text-muted-foreground",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$b=defineComponent({__name:"FormatDropdown",props:{asSub:{type:Boolean,default:!1}},setup(t){const e=t,{asSub:o}=toRefs(e),a=useStore(),{isCiteStatus:n,isCountStatus:s,editor:l}=storeToRefs(a),{citeStatusChanged:d,countStatusChanged:u,formatContent:m}=a;function i(C){const h=l.value;if(l.value)switch(C){case`${ctrlKey}-B`:formatBold(h);break;case`${ctrlKey}-I`:formatItalic(h);break;case`${ctrlKey}-D`:formatStrikethrough(h);break;case`${ctrlKey}-K`:formatLink(h);break;case`${ctrlKey}-E`:formatCode(h);break;case`${ctrlKey}-H`:applyHeading(h,1);break;case`${ctrlKey}-U`:formatUnorderedList(h);break;case`${ctrlKey}-O`:formatOrderedList(h);break;case`${ctrlKey}-1`:applyHeading(h,1);break;case`${ctrlKey}-2`:applyHeading(h,2);break;case`${ctrlKey}-3`:applyHeading(h,3);break;case`${ctrlKey}-4`:applyHeading(h,4);break;case`${ctrlKey}-5`:applyHeading(h,5);break;case`${ctrlKey}-6`:applyHeading(h,6);break}}const p=[{label:"加粗",kbd:[ctrlSign,"B"],cmd:`${ctrlKey}-B`},{label:"斜体",kbd:[ctrlSign,"I"],cmd:`${ctrlKey}-I`},{label:"删除线",kbd:[ctrlSign,"D"],cmd:`${ctrlKey}-D`},{label:"超链接",kbd:[ctrlSign,"K"],cmd:`${ctrlKey}-K`},{label:"行内代码",kbd:[ctrlSign,"E"],cmd:`${ctrlKey}-E`},{label:"标题",kbd:[ctrlSign,"H"],cmd:`${ctrlKey}-H`},{label:"无序列表",kbd:[ctrlSign,"U"],cmd:`${ctrlKey}-U`},{label:"有序列表",kbd:[ctrlSign,"O"],cmd:`${ctrlKey}-O`},{label:"格式化",kbd:[altSign,shiftSign,"F"],cmd:"formatContent"}];return(C,h)=>{const T=_sfc_main$r,v=_sfc_main$c,g=_sfc_main$s,f=_sfc_main$m,_=_sfc_main$t,b=_sfc_main$u,R=_sfc_main$w,N=_sfc_main$x,y=_sfc_main$y;return unref(o)?(openBlock(),createBlock(b,{key:0},{default:withCtx(()=>[createVNode(T,null,{default:withCtx(()=>[...h[4]||(h[4]=[createTextVNode(" 格式 ",-1)])]),_:1}),createVNode(_,{class:"w-60"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(p,({label:E,kbd:S,cmd:j})=>createVNode(g,{key:E,onClick:oe=>j==="formatContent"?unref(m)():i(j)},{default:withCtx(()=>[createTextVNode(toDisplayString(E)+" ",1),createVNode(v,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(S,oe=>(openBlock(),createElementBlock("kbd",{key:oe,class:"mx-1 bg-gray-2 dark:bg-stone-9"},toDisplayString(oe),1))),128))]),_:2},1024)]),_:2},1032,["onClick"])),64)),createVNode(f),createVNode(g,{checked:unref(n),onClick:h[0]||(h[0]=E=>unref(d)())},{default:withCtx(()=>[...h[5]||(h[5]=[createTextVNode(" 微信外链转底部引用 ",-1)])]),_:1},8,["checked"]),createVNode(f),createVNode(g,{checked:unref(s),onClick:h[1]||(h[1]=E=>unref(u)())},{default:withCtx(()=>[...h[6]||(h[6]=[createTextVNode(" 统计字数和阅读时间 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1})):(openBlock(),createBlock(y,{key:1},{default:withCtx(()=>[createVNode(R,null,{default:withCtx(()=>[...h[7]||(h[7]=[createTextVNode(" 格式",-1)])]),_:1}),createVNode(N,{class:"w-60",align:"start"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(p,({label:E,kbd:S,cmd:j})=>createVNode(g,{key:E,onClick:oe=>j==="formatContent"?unref(m)():i(j)},{default:withCtx(()=>[createTextVNode(toDisplayString(E)+" ",1),createVNode(v,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(S,oe=>(openBlock(),createElementBlock("kbd",{key:oe,class:"mx-1 bg-gray-2 dark:bg-stone-9"},toDisplayString(oe),1))),128))]),_:2},1024)]),_:2},1032,["onClick"])),64)),createVNode(f),createVNode(g,{checked:unref(n),onClick:h[2]||(h[2]=E=>unref(d)())},{default:withCtx(()=>[...h[8]||(h[8]=[createTextVNode(" 微信外链转底部引用 ",-1)])]),_:1},8,["checked"]),createVNode(f),createVNode(g,{checked:unref(s),onClick:h[3]||(h[3]=E=>unref(u)())},{default:withCtx(()=>[...h[9]||(h[9]=[createTextVNode(" 统计字数和阅读时间 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1}))}}}),_hoisted_1$8={class:"header-container h-15 flex flex-wrap items-center justify-between px-5 relative"},_hoisted_2$7={class:"space-x-2 hidden md:flex"},_hoisted_3$7={class:"md:hidden"},_hoisted_4$7={class:"space-x-2 flex flex-wrap items-center"},_hoisted_5$6={class:"bg-background space-x-1 text-background-foreground flex items-center border rounded-md"},_sfc_main$a=defineComponent({__name:"index",emits:["startCopy","endCopy"],setup(t,{emit:e}){const o=e,a=useStore(),n=useDisplayStore(),{output:s,primaryColor:l,editor:d}=storeToRefs(a),{editorRefresh:u}=a,m=ref(!1),i=ref(!1),p=ref(!1);function C(){m.value=!0}function h(){i.value=!0}function T(){p.value=!0}const v=useStorage(addPrefix("copyMode"),"txt"),{copy:g}=useClipboard({legacy:!0}),f=y=>new Promise(E=>window.setTimeout(E,y)),_=y=>y instanceof Error?y.message:String(y);async function b(y){if(!navigator.clipboard?.write)throw new Error("Clipboard API not available.");await f(0),await navigator.clipboard.write(y)}function R(y){const E=window.getSelection();if(!E)return!1;const S=document.createElement("div");S.innerHTML=y,S.style.position="fixed",S.style.left="-9999px",S.style.top="0",S.style.opacity="0",S.style.pointerEvents="none",S.style.setProperty("background-color","#ffffff","important"),S.style.setProperty("color","#000000","important"),document.body.appendChild(S);const j=document.documentElement,oe=j.classList.contains("dark");let V=!1;try{oe&&j.classList.remove("dark");const ne=document.createRange();ne.selectNodeContents(S),E.removeAllRanges(),E.addRange(ne),V=document.execCommand("copy")}catch{V=!1}finally{E.removeAllRanges(),S.remove(),oe&&j.classList.add("dark")}return V}async function N(){if(v.value==="md"){const y=d.value?.state.doc.toString()||"";await g(y),toast.success("已复制 Markdown 源码到剪贴板。");return}o("startCopy"),setTimeout(()=>{nextTick(async()=>{await processClipboardContent(l.value);const y=document.getElementById("output");if(!y){toast.error("未找到复制输出区域,请刷新页面后重试。"),u(),o("endCopy");return}y.focus(),window.getSelection()?.removeAllRanges();const E=y.innerHTML;if(v.value==="txt")try{if(typeof ClipboardItem>"u")throw new TypeError("ClipboardItem is not supported in this browser.");const S=y.textContent||"",j=new ClipboardItem({"text/html":new Blob([E],{type:"text/html"}),"text/plain":new Blob([S],{type:"text/plain"})});await b([j])}catch(S){if(!R(E)){y.innerHTML=s.value,window.getSelection()?.removeAllRanges(),u(),toast.error(`复制失败,请联系开发者。${_(S)}`),o("endCopy");return}}y.innerHTML=s.value,v.value==="html"?await g(E):v.value==="html-without-style"?await g(await generatePureHTML(d.value.state.doc.toString())):v.value==="html-and-style"&&await g(a.editorContent2HTML()),toast.success(v.value==="html"?"已复制 HTML 源码,请进行下一步操作。":"已复制渲染后的内容到剪贴板,可直接到公众号后台粘贴。"),window.dispatchEvent(new CustomEvent("copyToMp",{detail:{content:s.value}})),u(),o("endCopy")})},350)}return(y,E)=>{const S=_sfc_main$g,j=_sfc_main$h,oe=_sfc_main$j,V=_sfc_main$q,ne=_sfc_main$v,H=_sfc_main$1O,Y=_sfc_main$w,$=_sfc_main$x,x=_sfc_main$y,J=_sfc_main$Z,W=_sfc_main$V,de=_sfc_main$R,Z=_sfc_main$T,le=_sfc_main$X,ge=_sfc_main$Y,A=_sfc_main$z,F=_sfc_main$E,M=_sfc_main$F,z=_sfc_main$G,ae=_sfc_main$H,ee=AIImageGeneratorPanel;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("header",_hoisted_1$8,[createBaseVNode("div",_hoisted_2$7,[createVNode(ne,{class:"menubar border-0"},{default:withCtx(()=>[createVNode(S,{onOpenEditorState:T}),createVNode(_sfc_main$b),createVNode(j),createVNode(oe),createVNode(V,{onOpenAbout:C,onOpenFund:h})]),_:1})]),createBaseVNode("div",_hoisted_3$7,[createVNode(ne,{class:"menubar border-0 p-0"},{default:withCtx(()=>[createVNode(x,null,{default:withCtx(()=>[createVNode(Y,{class:"p-0"},{default:withCtx(()=>[createVNode(H,{variant:"outline",size:"icon"},{default:withCtx(()=>[createVNode(unref(Menu),{class:"size-4"})]),_:1})]),_:1}),createVNode($,{align:"start"},{default:withCtx(()=>[createVNode(S,{"as-sub":!0,onOpenEditorState:T}),createVNode(_sfc_main$b,{"as-sub":!0}),createVNode(j,{"as-sub":!0}),createVNode(oe,{"as-sub":!0}),createVNode(V,{"as-sub":!0,onOpenAbout:C,onOpenFund:h})]),_:1})]),_:1})]),_:1})]),createBaseVNode("div",_hoisted_4$7,[createBaseVNode("div",_hoisted_5$6,[createVNode(H,{variant:"ghost",class:"shadow-none text-sm px-2 md:px-4",onClick:N},{default:withCtx(()=>[...E[7]||(E[7]=[createTextVNode(" 复制 ",-1)])]),_:1}),createVNode(J,{orientation:"vertical",class:"h-5"}),createVNode(ge,{modelValue:unref(v),"onUpdate:modelValue":E[1]||(E[1]=K=>isRef(v)?v.value=K:null)},{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(H,{variant:"ghost",class:"px-2 shadow-none"},{default:withCtx(()=>[createVNode(unref(ChevronDown),{class:"text-secondary-foreground h-4 w-4"})]),_:1})]),_:1}),createVNode(le,{align:"end","align-offset":-5,class:"w-[220px]"},{default:withCtx(()=>[createVNode(Z,{modelValue:unref(v),"onUpdate:modelValue":E[0]||(E[0]=K=>isRef(v)?v.value=K:null)},{default:withCtx(()=>[createVNode(de,{value:"txt"},{default:withCtx(()=>[...E[8]||(E[8]=[createTextVNode(" 公众号格式 ",-1)])]),_:1}),createVNode(de,{value:"html"},{default:withCtx(()=>[...E[9]||(E[9]=[createTextVNode(" HTML 格式 ",-1)])]),_:1}),createVNode(de,{value:"html-without-style"},{default:withCtx(()=>[...E[10]||(E[10]=[createBaseVNode("span",{class:"whitespace-nowrap"},"HTML 格式(无样式)",-1)])]),_:1}),createVNode(de,{value:"html-and-style"},{default:withCtx(()=>[...E[11]||(E[11]=[createBaseVNode("span",{class:"whitespace-nowrap"},"HTML 格式(兼容样式)",-1)])]),_:1}),createVNode(de,{value:"md"},{default:withCtx(()=>[...E[12]||(E[12]=[createTextVNode(" MD 格式 ",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["modelValue"])]),createVNode(A,{class:"hidden md:inline-flex"}),createVNode(unref(_sfc_main$f),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$d),{"as-child":""},{default:withCtx(()=>[createVNode(H,{variant:"outline",size:"icon",class:"mr-1"},{default:withCtx(()=>[createVNode(unref(SlidersHorizontal),{class:"size-4"})]),_:1})]),_:1}),createVNode(unref(_sfc_main$e),{align:"end"},{default:withCtx(()=>[createVNode(F)]),_:1})]),_:1}),createVNode(H,{variant:"outline",size:"icon",onClick:E[2]||(E[2]=K=>unref(a).isOpenRightSlider=!unref(a).isOpenRightSlider)},{default:withCtx(()=>[createVNode(unref(Palette),{class:"size-4"})]),_:1})])]),createVNode(M,{visible:unref(m),onClose:E[3]||(E[3]=K=>m.value=!1)},null,8,["visible"]),createVNode(z,{visible:unref(i),onClose:E[4]||(E[4]=K=>i.value=!1)},null,8,["visible"]),createVNode(ae,{visible:unref(p),onClose:E[5]||(E[5]=K=>p.value=!1)},null,8,["visible"]),createVNode(ee,{open:unref(n).aiImageDialogVisible,"onUpdate:open":E[6]||(E[6]=K=>unref(n).aiImageDialogVisible=K)},null,8,["open"])],64)}}}),__unplugin_components_1=_export_sfc(_sfc_main$a,[["__scopeId","data-v-48d994a3"]]),useAIConfigStore=defineStore("AIConfig",()=>{const t=useStorage("openai_type",DEFAULT_SERVICE_TYPE),e=useStorage("openai_temperature",DEFAULT_SERVICE_TEMPERATURE),o=useStorage("openai_max_token",DEFAULT_SERVICE_MAX_TOKEN),a=ref(""),n=ref(""),s=customRef((d,u)=>({get(){return d(),localStorage.getItem(`openai_key_${t.value}`)||DEFAULT_SERVICE_KEY},set(m){t.value!==DEFAULT_SERVICE_TYPE&&localStorage.setItem(`openai_key_${t.value}`,m),u()}}));watch(t,d=>{const u=serviceOptions.find(i=>i.value===d)??serviceOptions[0];a.value=u.endpoint;const m=localStorage.getItem(`openai_model_${d}`)||"";n.value=u.models.includes(m)?m:u.models[0],localStorage.setItem(`openai_model_${d}`,n.value)},{immediate:!0}),watch(n,d=>{localStorage.setItem(`openai_model_${t.value}`,d)});function l(){t.value=DEFAULT_SERVICE_TYPE,e.value=DEFAULT_SERVICE_TEMPERATURE,o.value=DEFAULT_SERVICE_MAX_TOKEN,serviceOptions.forEach(({value:d})=>{localStorage.removeItem(`openai_key_${d}`),localStorage.removeItem(`openai_model_${d}`)})}return{type:t,endpoint:a,model:n,temperature:e,maxToken:o,apiKey:s,reset:l}}),_hoisted_1$7={class:"custom-scroll space-y-4 max-h-[calc(100dvh-10rem)] overflow-y-auto pr-1 text-xs sm:max-h-none sm:text-sm"},_hoisted_2$6={key:0},_hoisted_3$6={key:1},_hoisted_4$6={class:"mt-2 flex flex-col gap-2 sm:flex-row"},_hoisted_5$5={key:2,class:"mt-1 text-xs text-gray-500"},_sfc_main$9=defineComponent({__name:"AIConfig",emits:["saved"],setup(t,{emit:e}){const o=e,a=useAIConfigStore(),{type:n,endpoint:s,model:l,apiKey:d,temperature:u,maxToken:m}=storeToRefs(a),i=ref(!1),p=ref(""),C=computed(()=>serviceOptions.find(g=>g.value===n.value)||serviceOptions[0]);watch(n,()=>{p.value=""}),watch(l,()=>{p.value=""});function h(g=!0){g&&(p.value="✅ 配置已保存",o("saved"))}function T(){a.reset(),p.value="🗑️ 当前 AI 配置已清除"}async function v(){p.value="",i.value=!0;const g={"Content-Type":"application/json"};d.value&&n.value!==DEFAULT_SERVICE_TYPE&&(g.Authorization=`Bearer ${d.value}`);try{const f=new URL(s.value);f.pathname.endsWith("/chat/completions")||(f.pathname=f.pathname.replace(/\/?$/,"/chat/completions"));const _={model:l.value,messages:[{role:"user",content:"ping"}],temperature:0,max_tokens:1,stream:!1},b=await window.fetch(f.toString(),{method:"POST",headers:g,body:JSON.stringify(_)});if(b.ok)p.value="✅ 测试成功,/chat/completions 可用",h(!1);else{const R=await b.text();try{const{error:N}=JSON.parse(R);if(b.status===404&&(N?.code==="ModelNotOpen"||/not activated|未开通/i.test(N?.message))){p.value=`⚠️ 测试成功,但当前模型未开通:${l.value}`,h(!1);return}}catch{}p.value=`❌ 测试失败:${b.status} ${b.statusText},${R}`}}catch(f){p.value=`❌ 测试失败:${f.message}`}finally{i.value=!1}}return(g,f)=>{const _=_sfc_main$1F,b=_sfc_main$1f,R=_sfc_main$1g,N=_sfc_main$1j,y=_sfc_main$1e,E=_sfc_main$1l,S=_sfc_main$1B,j=_sfc_main$M,oe=_sfc_main$N,V=_sfc_main$O,ne=_sfc_main$P,H=_sfc_main$1O;return openBlock(),createElementBlock("div",_hoisted_1$7,[f[16]||(f[16]=createBaseVNode("div",{class:"font-medium"}," AI 配置 ",-1)),createBaseVNode("div",null,[createVNode(_,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...f[7]||(f[7]=[createTextVNode("服务类型",-1)])]),_:1}),createVNode(E,{modelValue:unref(n),"onUpdate:modelValue":f[0]||(f[0]=Y=>isRef(n)?n.value=Y:null)},{default:withCtx(()=>[createVNode(R,{class:"w-full"},{default:withCtx(()=>[createVNode(b,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(C).label),1)]),_:1})]),_:1}),createVNode(y,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(serviceOptions),Y=>(openBlock(),createBlock(N,{key:Y.value,value:Y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(Y.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),unref(n)!==unref(DEFAULT_SERVICE_TYPE)?(openBlock(),createElementBlock("div",_hoisted_2$6,[createVNode(_,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...f[8]||(f[8]=[createTextVNode("API 端点",-1)])]),_:1}),createVNode(S,{modelValue:unref(s),"onUpdate:modelValue":f[1]||(f[1]=Y=>isRef(s)?s.value=Y:null),placeholder:"输入 API 端点 URL",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])])):createCommentVNode("",!0),unref(n)!==unref(DEFAULT_SERVICE_TYPE)?(openBlock(),createElementBlock("div",_hoisted_3$6,[createVNode(_,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...f[9]||(f[9]=[createTextVNode("API 密钥",-1)])]),_:1}),createVNode(unref(_sfc_main$K),{modelValue:unref(d),"onUpdate:modelValue":f[2]||(f[2]=Y=>isRef(d)?d.value=Y:null),placeholder:"sk-...",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])])):createCommentVNode("",!0),createBaseVNode("div",null,[createVNode(_,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...f[10]||(f[10]=[createTextVNode("模型名称",-1)])]),_:1}),unref(C).models.length>0?(openBlock(),createBlock(E,{key:0,modelValue:unref(l),"onUpdate:modelValue":f[3]||(f[3]=Y=>isRef(l)?l.value=Y:null)},{default:withCtx(()=>[createVNode(R,{class:"w-full"},{default:withCtx(()=>[createVNode(b,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(l)||"请选择模型"),1)]),_:1})]),_:1}),createVNode(y,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(C).models,Y=>(openBlock(),createBlock(N,{key:Y,value:Y},{default:withCtx(()=>[createTextVNode(toDisplayString(Y),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])):(openBlock(),createBlock(S,{key:1,modelValue:unref(l),"onUpdate:modelValue":f[4]||(f[4]=Y=>isRef(l)?l.value=Y:null),placeholder:"输入模型名称",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"]))]),createBaseVNode("div",null,[createVNode(_,{class:"mb-1 flex items-center gap-1 text-sm font-medium"},{default:withCtx(()=>[f[12]||(f[12]=createTextVNode(" 温度 ",-1)),createVNode(ne,null,{default:withCtx(()=>[createVNode(V,null,{default:withCtx(()=>[createVNode(j,{"as-child":""},{default:withCtx(()=>[createVNode(unref(Info),{class:"text-gray-500",size:16})]),_:1}),createVNode(oe,null,{default:withCtx(()=>[...f[11]||(f[11]=[createBaseVNode("div",null,"控制输出的随机性:较低的值使输出更确定,较高的值使其更随机。",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(S,{modelValue:unref(u),"onUpdate:modelValue":f[5]||(f[5]=Y=>isRef(u)?u.value=Y:null),modelModifiers:{number:!0},type:"number",step:"0.1",min:"0",max:"2",placeholder:"0 ~ 2,默认 1",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])]),createBaseVNode("div",null,[createVNode(_,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...f[13]||(f[13]=[createTextVNode("最大 Token 数",-1)])]),_:1}),createVNode(S,{modelValue:unref(m),"onUpdate:modelValue":f[6]||(f[6]=Y=>isRef(m)?m.value=Y:null),modelModifiers:{number:!0},type:"number",min:"1",max:"32768",placeholder:"比如 1024",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_4$6,[createVNode(H,{size:"sm",onClick:h},{default:withCtx(()=>[...f[14]||(f[14]=[createTextVNode(" 保存 ",-1)])]),_:1}),createVNode(H,{size:"sm",variant:"ghost",onClick:T},{default:withCtx(()=>[...f[15]||(f[15]=[createTextVNode(" 清空 ",-1)])]),_:1}),createVNode(H,{size:"sm",variant:"outline",disabled:unref(i),onClick:v},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(i)?"测试中...":"测试连接"),1)]),_:1},8,["disabled"])]),unref(p)?(openBlock(),createElementBlock("div",_hoisted_5$5,toDisplayString(unref(p)),1)):createCommentVNode("",!0)])}}}),__unplugin_components_0=_export_sfc(_sfc_main$9,[["__scopeId","data-v-c27df4a6"]]),STORAGE_KEY="quick_commands";function hydrate(t){return{...t,buildPrompt:(e="")=>t.template.replace(/\{\{\s*sel\s*\}\}/gi,e)}}const DEFAULT_COMMANDS=[{id:"polish",label:"润色",template:`请润色以下内容:
600
+
601
+ {{sel}}`},{id:"to-en",label:"翻译成英文",template:`请将以下内容翻译为英文:
602
+
603
+ {{sel}}`},{id:"to-zh",label:"翻译成中文",template:`Please translate the following content into Chinese:
604
+
605
+ {{sel}}`},{id:"summary",label:"总结",template:`请对以下内容进行总结:
606
+
607
+ {{sel}}`}],useQuickCommands=defineStore("quickCommands",()=>{const t=ref([]);function e(){const l=t.value.map(({id:d,label:u,template:m})=>({id:d,label:u,template:m}));localStorage.setItem(STORAGE_KEY,JSON.stringify(l))}function o(){const l=localStorage.getItem(STORAGE_KEY);if(l)try{const d=JSON.parse(l);t.value=d.map(hydrate)}catch(d){console.warn("解析快捷指令失败,已恢复默认值",d),t.value=DEFAULT_COMMANDS.map(hydrate),e()}else t.value=DEFAULT_COMMANDS.map(hydrate),e()}function a(l,d){const u=crypto.randomUUID();t.value.push(hydrate({id:u,label:l,template:d}))}function n(l,d,u){const m=t.value.findIndex(i=>i.id===l);m!==-1&&(t.value[m]=hydrate({id:l,label:d,template:u}))}function s(l){t.value=t.value.filter(d=>d.id!==l)}return o(),watch(t,e,{deep:!0}),{commands:t,add:a,update:n,remove:s}}),_hoisted_1$6={class:"space-y-4 flex-1 overflow-y-auto pr-1"},_hoisted_2$5={class:"flex justify-end gap-2"},_hoisted_3$5={key:1,class:"flex items-center justify-between"},_hoisted_4$5={class:"break-all text-sm"},_hoisted_5$4={class:"flex gap-1"},_hoisted_6$4={class:"space-y-2 mt-4 border rounded-md p-3"},_sfc_main$8=defineComponent({__name:"QuickCommandManager",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=ref(o.open);watch(()=>o.open,v=>n.value=v),watch(n,v=>a("update:open",v));const s=useQuickCommands(),l=ref(""),d=ref("");function u(){!l.value.trim()||!d.value.trim()||(s.add(l.value.trim(),d.value.trim()),l.value="",d.value="")}const m=ref(null),i=ref(""),p=ref("");function C(v){m.value=v.id,i.value=v.label,p.value=v.template}function h(){m.value=null}function T(){!i.value.trim()||!p.value.trim()||(s.update(m.value,i.value.trim(),p.value.trim()),m.value=null)}return(v,g)=>(openBlock(),createBlock(unref(_sfc_main$1I),{open:n.value,"onUpdate:open":g[4]||(g[4]=f=>n.value=f)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1H),{class:"max-h-[90vh] w-[92vw] flex flex-col sm:max-w-lg"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1A),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1z),null,{default:withCtx(()=>[...g[5]||(g[5]=[createTextVNode("管理快捷指令",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$6,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(s).commands,f=>(openBlock(),createElementBlock("div",{key:f.id,class:"flex flex-col gap-2 border rounded-md p-3"},[m.value===f.id?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(_sfc_main$1B),{modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=_=>i.value=_),placeholder:"指令名称"},null,8,["modelValue"]),createVNode(unref(_sfc_main$1D),{modelValue:p.value,"onUpdate:modelValue":g[1]||(g[1]=_=>p.value=_),rows:"2",placeholder:"模板内容,支持 {{sel}} 占位"},null,8,["modelValue"]),createBaseVNode("div",_hoisted_2$5,[createVNode(unref(_sfc_main$1O),{size:"xs",onClick:T},{default:withCtx(()=>[...g[6]||(g[6]=[createTextVNode(" 保存 ",-1)])]),_:1}),createVNode(unref(_sfc_main$1O),{variant:"ghost",size:"xs",onClick:h},{default:withCtx(()=>[...g[7]||(g[7]=[createTextVNode(" 取消 ",-1)])]),_:1})])],64)):(openBlock(),createElementBlock("div",_hoisted_3$5,[createBaseVNode("span",_hoisted_4$5,toDisplayString(f.label),1),createBaseVNode("div",_hoisted_5$4,[createVNode(unref(_sfc_main$1O),{variant:"ghost",size:"xs",onClick:_=>C(f)},{default:withCtx(()=>[...g[8]||(g[8]=[createTextVNode(" 编辑 ",-1)])]),_:1},8,["onClick"]),createVNode(unref(_sfc_main$1O),{variant:"outline",size:"xs",onClick:_=>unref(s).remove(f.id)},{default:withCtx(()=>[...g[9]||(g[9]=[createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])])]))]))),128))]),createBaseVNode("div",_hoisted_6$4,[createVNode(unref(_sfc_main$1B),{modelValue:l.value,"onUpdate:modelValue":g[2]||(g[2]=f=>l.value=f),placeholder:"指令名称 (如:改写为 SEO 文案)"},null,8,["modelValue"]),createVNode(unref(_sfc_main$1D),{modelValue:d.value,"onUpdate:modelValue":g[3]||(g[3]=f=>d.value=f),rows:"2",placeholder:"模板,可用 {{sel}} 占位,例如:\\n请把以下文字改写为 SEO 友好的标题:\\n\\n{{sel}}"},null,8,["modelValue"]),createVNode(unref(_sfc_main$1O),{class:"w-full",onClick:u},{default:withCtx(()=>[...g[10]||(g[10]=[createTextVNode(" 添加 ",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),_hoisted_1$5={class:"space-x-1 flex items-center"},_hoisted_2$4={key:0,class:"mb-3 flex flex-wrap gap-2 overflow-x-auto pb-1"},_hoisted_3$4={key:1,class:"text-muted-foreground flex items-center gap-2 border rounded-md border-dashed px-3 py-1 text-xs"},_hoisted_4$4={key:2,class:"custom-scroll space-y-3 chat-container mb-4 flex-1 overflow-y-auto pr-2"},_hoisted_5$3={key:0,class:"text-muted-foreground mb-1 italic"},_hoisted_6$3={key:3,class:"relative mt-2"},_hoisted_7$2={class:"bg-background border-border flex flex-col items-baseline gap-2 border rounded-xl px-3 py-2 pr-12 shadow-inner"},memoryKey="ai_memory_context",_sfc_main$7=defineComponent({__name:"AIAssistantPanel",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=useStore(),{editor:s}=storeToRefs(n),l=useDisplayStore(),{toggleAIImageDialog:d}=l,u=ref(o.open);watch(()=>o.open,M=>u.value=M),watch(u,M=>{a("update:open",M),M&&le(!0)});const m=ref(""),i=ref([]),p=ref(null),C=ref(!1),h=ref(!1),T=ref(null),v=ref(null),g=ref(!1),f=ref(!1),_=ref([]),b=useAIConfigStore(),{apiKey:R,endpoint:N,model:y,temperature:E,maxToken:S,type:j}=storeToRefs(b),oe=useQuickCommands();function V(){try{const M=s.value;return M&&typeof M.getSelection=="function"&&M.getSelection()||""}catch(M){return console.warn("获取选中文本失败",M),""}}function ne(M){const z=V();m.value=M.buildPrompt(z),p.value=null,nextTick(()=>{const ae=document.querySelector('textarea[placeholder*="说些什么" ]');ae?.focus(),ae&&ae.setSelectionRange(ae.value.length,ae.value.length)})}onMounted(async()=>{const M=localStorage.getItem(memoryKey);_.value=M?JSON.parse(M):H(),await le(!0)});function H(){return[{role:"assistant",content:"你好,我是 AI 助手,有什么可以帮你的?"}]}function Y(){C.value=!1,le(!0)}function $(){a("update:open",!1),setTimeout(()=>{d(!0)},100)}function x(M){if(!(M.isComposing||M.keyCode===229)){if(M.key==="Enter"&&!M.shiftKey)M.preventDefault(),F();else if(M.key==="ArrowUp"){if(M.preventDefault(),i.value.length===0)return;p.value===null?p.value=i.value.length-1:p.value>0&&p.value--,m.value=i.value[p.value]||""}else if(M.key==="ArrowDown"){if(M.preventDefault(),p.value===null)return;p.value<i.value.length-1?(p.value++,m.value=i.value[p.value]||""):(p.value=null,m.value="")}}}async function J(M,z){copyPlain(M),v.value=z,setTimeout(()=>v.value=null,1500)}function W(M){m.value=M,p.value=null,nextTick(()=>{const z=document.querySelector('textarea[placeholder*="说些什么" ]');if(z?.focus(),z){const ae=z.value.length;z.setSelectionRange(ae,ae)}})}function de(){T.value&&(T.value.abort(),T.value=null),_.value=H(),localStorage.setItem(memoryKey,JSON.stringify(_.value)),le(!0)}function Z(){T.value&&(T.value.abort(),T.value=null),h.value=!1;const M=_.value[_.value.length-1];M?.role==="assistant"&&(M.done=!0),le(!0)}async function le(M=!1){await nextTick();const z=document.querySelector(".chat-container");if(z){const ae=z.scrollTop+z.clientHeight>=z.scrollHeight-50;(M||ae)&&(z.scrollTop=z.scrollHeight,await new Promise(ee=>setTimeout(ee,50)))}}function ge(){g.value=!g.value}async function A(){const M=[..._.value].reverse().find(ae=>ae.role==="user");if(!M)return;const z=_.value.findIndex((ae,ee,K)=>ee>0&&K[ee-1]===M&&ae.role==="assistant");z!==-1&&_.value.splice(z,1),m.value=M.content,await nextTick(),F()}async function F(){if(!m.value.trim()||h.value)return;i.value.push(m.value.trim()),p.value=null,h.value=!0;const M=m.value.trim();_.value.push({role:"user",content:M}),m.value="";const z={role:"assistant",content:"",reasoning:"",done:!1};_.value.push(z);const ae=_.value[_.value.length-1];await le(!0);const ee=_.value.slice(-12).filter((re,ce,q)=>!(ce===q.length-1&&re.role==="assistant"&&!re.done)&&!(ce===0&&re.role==="assistant"));let K;if(g.value){const re=[];for(let ce=ee.length-1;ce>=0&&re.length<2;ce--){const q=ee[ce];(re.length===0||q.role==="user"||q.role==="assistant")&&re.unshift(q)}K=re}else K=ee.slice(-10);const L=g.value?[{role:"system",content:`下面是一篇 Markdown 文章全文,请严格以此为主完成后续指令:
608
+
609
+ ${s.value?.state.doc.toString()}`}]:[],G=[{role:"system",content:"你是一个专业的 Markdown 编辑器助手,请用简洁中文回答。"},...L,...K],te={model:y.value,messages:G,temperature:E.value,max_tokens:S.value,stream:!0},fe={"Content-Type":"application/json"};R.value&&j.value!=="default"&&(fe.Authorization=`Bearer ${R.value}`),T.value=new AbortController;const se=T.value.signal;try{const re=new URL(N.value);re.pathname.endsWith("/chat/completions")||(re.pathname=re.pathname.replace(/\/?$/,"/chat/completions"));const ce=await window.fetch(re.toString(),{method:"POST",headers:fe,body:JSON.stringify(te),signal:se});if(!ce.ok||!ce.body)throw new Error(`响应错误:${ce.status} ${ce.statusText}`);const q=ce.body.getReader(),P=new TextDecoder("utf-8");let _e="";for(;;){const{value:me,done:be}=await q.read();if(be){const xe=_.value[_.value.length-1];xe.role==="assistant"&&(xe.done=!0,await le(!0));break}_e+=P.decode(me,{stream:!0});const ke=_e.split(`
610
+ `);_e=ke.pop()||"";for(const xe of ke)if(!(!xe.trim()||xe.trim()==="data: [DONE]"))try{const Ce=JSON.parse(xe.replace(/^data: /,"")).choices?.[0]?.delta||{},ve=_.value[_.value.length-1];if(ve!==ae)return;Ce.content?ve.content+=Ce.content:Ce.reasoning_content&&(ve.reasoning=(ve.reasoning||"")+Ce.reasoning_content),await le()}catch(ye){console.error("解析失败:",ye)}}}catch(re){re.name==="AbortError"?console.log("请求中止"):(console.error("请求失败:",re),_.value[_.value.length-1].content=`❌ 请求失败: ${re.message}`),await le(!0)}finally{localStorage.setItem(memoryKey,JSON.stringify(_.value)),h.value=!1,T.value=null}}return(M,z)=>{const ae=_sfc_main$8,ee=__unplugin_components_0;return openBlock(),createBlock(unref(_sfc_main$1I),{open:unref(u),"onUpdate:open":z[6]||(z[6]=K=>isRef(u)?u.value=K:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1H),{class:"bg-card text-card-foreground h-dvh max-h-dvh w-full flex flex-col rounded-none shadow-xl sm:max-h-[80vh] sm:max-w-2xl sm:rounded-xl"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1A),{class:"space-y-1 flex flex-col items-start"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$5,[createVNode(unref(_sfc_main$1z),null,{default:withCtx(()=>[...z[7]||(z[7]=[createTextVNode("AI 对话",-1)])]),_:1}),createVNode(unref(_sfc_main$1O),{title:unref(C)?"AI 对话":"配置参数","aria-label":unref(C)?"AI 对话":"配置参数",variant:"ghost",size:"icon",onClick:z[0]||(z[0]=K=>C.value=!unref(C))},{default:withCtx(()=>[unref(C)?(openBlock(),createBlock(unref(MessageCircle),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Settings),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"]),createVNode(unref(_sfc_main$1O),{title:"AI 文生图","aria-label":"AI 文生图",variant:"ghost",size:"icon",onClick:z[1]||(z[1]=K=>$())},{default:withCtx(()=>[createVNode(unref(Image),{class:"h-4 w-4"})]),_:1}),createVNode(unref(_sfc_main$1O),{title:"清空对话内容","aria-label":"清空对话内容",variant:"ghost",size:"icon",onClick:de},{default:withCtx(()=>[createVNode(unref(Trash2),{class:"h-4 w-4"})]),_:1})]),createVNode(unref(_sfc_main$19),{class:"text-muted-foreground text-sm"},{default:withCtx(()=>[...z[8]||(z[8]=[createTextVNode(" 使用 AI 助手帮助您编写和优化内容 ",-1)])]),_:1})]),_:1}),unref(C)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_2$4,[unref(oe).commands.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(unref(oe).commands,K=>(openBlock(),createBlock(unref(_sfc_main$1O),{key:K.id,variant:"secondary",size:"sm",class:"text-xs",onClick:L=>ne(K)},{default:withCtx(()=>[createTextVNode(toDisplayString(K.label),1)]),_:2},1032,["onClick"]))),128)):(openBlock(),createElementBlock("div",_hoisted_3$4," 还没有任何快捷指令,点击右侧添加 ")),createVNode(unref(_sfc_main$1O),{variant:"ghost",size:"icon",title:"管理指令",onClick:z[2]||(z[2]=K=>f.value=!0)},{default:withCtx(()=>[createVNode(unref(Plus),{class:"h-4 w-4"})]),_:1}),createVNode(ae,{open:unref(f),"onUpdate:open":z[3]||(z[3]=K=>isRef(f)?f.value=K:null)},null,8,["open"])])),unref(C)?(openBlock(),createBlock(ee,{key:1,class:"mb-4 w-full border rounded-md p-4",onSaved:Y})):createCommentVNode("",!0),unref(C)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_4$4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(_),(K,L)=>(openBlock(),createElementBlock("div",{key:L,class:normalizeClass(["relative flex",K.role==="user"?"justify-end":"justify-start"])},[createBaseVNode("div",{class:normalizeClass(["ring-border/20 max-w-[75%] rounded-2xl px-4 py-2 text-sm leading-relaxed shadow-xs ring-1",K.role==="user"?"bg-black text-white dark:bg-primary dark:text-primary-foreground":"bg-gray-100 text-gray-800 dark:bg-muted/60 dark:text-muted-foreground"])},[K.reasoning?(openBlock(),createElementBlock("div",_hoisted_5$3,toDisplayString(K.reasoning),1)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["whitespace-pre-wrap",K.content?"":"animate-pulse text-muted-foreground"])},toDisplayString(K.content||(K.role==="assistant"&&!K.done?"思考中…":"")),3),createBaseVNode("div",{class:normalizeClass(["mt-1 flex",K.role==="user"?"justify-end":"justify-start"])},[L>0&&!(K.role==="assistant"&&L===unref(_).length-1&&!K.done)?(openBlock(),createBlock(unref(_sfc_main$1O),{key:0,variant:"ghost",size:"icon",class:"ml-0 h-5 w-5 p-1","aria-label":"复制内容",onClick:G=>J(K.content,L)},{default:withCtx(()=>[unref(v)===L?(openBlock(),createBlock(unref(Check),{key:0,class:"h-3 w-3 text-green-600"})):(openBlock(),createBlock(unref(Copy),{key:1,class:"text-muted-foreground h-3 w-3"}))]),_:2},1032,["onClick"])):createCommentVNode("",!0),L>0&&!(K.role==="assistant"&&L===unref(_).length-1&&!K.done)?(openBlock(),createBlock(unref(_sfc_main$1O),{key:1,variant:"ghost",size:"icon",class:"ml-1 h-5 w-5 p-1","aria-label":"编辑内容",onClick:G=>W(K.content)},{default:withCtx(()=>[createVNode(unref(SquarePen),{class:"text-muted-foreground h-3 w-3"})]),_:1},8,["onClick"])):createCommentVNode("",!0),K.role==="assistant"&&K.done&&L===unref(_).length-1?(openBlock(),createBlock(unref(_sfc_main$1O),{key:2,variant:"ghost",size:"icon",class:"ml-1 h-5 w-5 p-1","aria-label":"重新生成",onClick:A},{default:withCtx(()=>[createVNode(unref(RefreshCcw),{class:"text-muted-foreground h-3 w-3"})]),_:1})):createCommentVNode("",!0)],2)],2)],2))),128))])),unref(C)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_6$3,[createBaseVNode("div",_hoisted_7$2,[createVNode(unref(_sfc_main$1D),{modelValue:unref(m),"onUpdate:modelValue":z[4]||(z[4]=K=>isRef(m)?m.value=K:null),placeholder:"说些什么… (Enter 发送,Shift+Enter 换行)",rows:"2",class:"custom-scroll min-h-16 w-full resize-none border-none bg-transparent p-0 focus-visible:outline-hidden focus:outline-hidden focus-visible:ring-0 focus:ring-0 focus-visible:ring-offset-0 focus:ring-offset-0 focus-visible:ring-transparent focus:ring-transparent",onKeydown:x},null,8,["modelValue"]),createVNode(unref(_sfc_main$1O),{size:"sm",variant:"outline",class:normalizeClass(["h-8 flex items-center gap-1 rounded-md px-3 font-medium transition-colors duration-150",[unref(g)?"bg-primary text-white border-primary dark:bg-white dark:text-black dark:border-white":"bg-background text-muted-foreground border-border hover:text-foreground hover:border-foreground dark:bg-muted dark:text-gray-400 dark:hover:text-white dark:hover:border-white/60"]]),"aria-label":"引用全文",onClick:ge},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(g)?unref(Check):unref(Copy)),{class:"h-4 w-4"})),z[9]||(z[9]=createBaseVNode("span",{class:"text-xs"},"引用全文",-1))]),_:1},8,["class"]),createVNode(unref(_sfc_main$1O),{disabled:!unref(m).trim()&&!unref(h),size:"icon",class:normalizeClass(["absolute bottom-3 right-3 rounded-full disabled:opacity-40","bg-primary hover:bg-primary/90 text-primary-foreground"]),"aria-label":unref(h)?"暂停":"发送",onClick:z[5]||(z[5]=K=>unref(h)?Z():F())},{default:withCtx(()=>[unref(h)?(openBlock(),createBlock(unref(Pause),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Send),{key:1,class:"h-4 w-4"}))]),_:1},8,["disabled","aria-label"])])]))]),_:1})]),_:1},8,["open"])}}}),AIAssistantPanel=_export_sfc(_sfc_main$7,[["__scopeId","data-v-e03ce6ad"]]),_hoisted_1$4={class:"space-x-1 flex items-center"},_hoisted_2$3={key:1,class:"custom-scroll space-y-4 flex-1 overflow-y-auto px-4 pb-4 pt-3 sm:px-6"},_hoisted_3$3={class:"border-border custom-scroll bg-muted/20 text-muted-foreground max-h-32 overflow-y-auto whitespace-pre-line border rounded px-3 py-2 text-sm"},_hoisted_4$3={key:0},_hoisted_5$2={class:"custom-scroll border-border max-h-24 min-h-[40px] flex flex-wrap gap-2 overflow-y-auto border rounded px-2 py-1"},_hoisted_6$2=["onClick"],_hoisted_7$1={key:1,class:"min-h-[24px] flex items-center text-[12px] text-red-500"},_hoisted_8={key:2},_hoisted_9={key:2,class:"border-border flex justify-end gap-2 border-t px-4 py-3 sm:px-6"},_sfc_main$6=defineComponent({__name:"ToolBoxPopover",props:{open:{type:Boolean},selectedText:{},isMobile:{type:Boolean}},emits:["update:open"],setup(t,{expose:e,emit:o}){const a=t,n=o,s=ref(!1),l=ref(a.open),d=ref(""),u=ref(!1),m=ref(null),i=ref([]),p=ref(!1),C=ref("optimize"),h=ref(""),T=ref(""),v=useStore(),g=ref(null);watch(()=>a.open,J=>{l.value=J,J&&a.selectedText.trim()&&(h.value=a.selectedText,V())}),watch(l,J=>n("update:open",J));const f=useAIConfigStore(),{apiKey:_,endpoint:b,model:R,temperature:N,maxToken:y,type:E}=storeToRefs(f),S=[{value:"optimize",label:"优化文本",defaultPrompt:"请优化文本,使其更通顺易读。"},{value:"summarize",label:"文章总结",defaultPrompt:"请对文本进行摘要,输出主要观点和结论。"},{value:"spellcheck",label:"错别字纠正",defaultPrompt:"请找出并纠正文本中的错别字、标点和语法错误。"},{value:"translate-zh",label:"翻译为中文",defaultPrompt:"请将文本翻译为地道的中文。"},{value:"translate-en",label:"翻译为英文",defaultPrompt:"请将文本翻译为自然流畅的英文。"},{value:"custom",label:"自定义",defaultPrompt:""}];watch(d,async()=>{await nextTick(),g.value?.scrollTo({top:g.value.scrollHeight})}),watch(C,J=>{J!=="custom"&&(i.value=[])}),watch(()=>a.selectedText,J=>{l.value&&(h.value=J,V())});function j(J){const W=J.target,de=W.value.trim();de&&!i.value.includes(de)&&i.value.push(de),W.value=""}function oe(J){i.value.splice(J,1)}function V(){d.value="",u.value=!1,p.value=!1,T.value="",m.value?.abort(),m.value=null}async function ne(){const J=h.value.trim();if(!J||u.value)return;V(),u.value=!0,m.value=new AbortController;const W="你是一名专业的多语言文本助手,请根据用户的指令处理下列内容。在输出时,不要输出任何额外的信息,只输出处理后的文本。",de=S.find(M=>M.value===C.value),Z=[];de.defaultPrompt&&Z.push(de.defaultPrompt),i.value.length&&Z.push(`请同时满足以下要求:${i.value.join("、")}。`),Z.length||Z.push("请根据最佳实践优化文本。");const le=Z.join(" "),ge=[{role:"system",content:W},{role:"user",content:`${le}
611
+
612
+ 待处理文本:
613
+ ${J}`}],A={model:R.value,messages:ge,temperature:N.value,max_tokens:y.value,stream:!0},F={"Content-Type":"application/json"};_.value&&E.value!=="default"&&(F.Authorization=`Bearer ${_.value}`);try{const M=new URL(b.value);M.pathname.endsWith("/chat/completions")||(M.pathname=M.pathname.replace(/\/?$/,"/chat/completions"));const z=await window.fetch(M.toString(),{method:"POST",headers:F,body:JSON.stringify(A),signal:m.value.signal});if(!z.ok||!z.body)throw new Error(`响应错误:${z.status}`);const ae=z.body.getReader(),ee=new TextDecoder("utf-8");let K="";for(;;){const{value:L,done:G}=await ae.read();if(G)break;K+=ee.decode(L,{stream:!0});const te=K.split(`
614
+ `);K=te.pop()||"";for(const fe of te)if(!(!fe.trim()||fe.trim()==="data: [DONE]"))try{const re=JSON.parse(fe.replace(/^data: /,"")).choices?.[0]?.delta?.content;re?.trim()&&(d.value+=re,p.value=!0)}catch{}}}catch(M){M.name==="AbortError"?console.log("Request aborted by user."):(console.error("请求失败:",M),T.value=M.message||"请求失败")}finally{u.value=!1}}function H(){u.value&&m.value&&(m.value.abort(),u.value=!1)}function Y(){const J=toRaw(v.editor),W=J.state.selection.main;J.dispatch(J.state.replaceSelection(d.value));const de=J.state.selection.main;J.dispatch({selection:{anchor:W.from,head:de.head}}),J.focus(),h.value=d.value,V()}function $(){l.value=!0}function x(){l.value=!1,i.value=[],C.value="optimize",V()}return e({dialogVisible:l,runAIAction:ne,replaceText:Y,show:$,close:x,stopAI:H}),(J,W)=>{const de=__unplugin_components_0;return openBlock(),createBlock(unref(_sfc_main$1I),{open:unref(l),"onUpdate:open":W[3]||(W[3]=Z=>isRef(l)?l.value=Z:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1H),{class:"bg-card text-card-foreground flex flex-col w-[95vw] max-h-[90vh] sm:max-h-[85vh] sm:max-w-2xl overflow-y-auto"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1A),{class:"space-y-1 flex flex-col items-start"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$4,[createVNode(unref(_sfc_main$1z),null,{default:withCtx(()=>[...W[4]||(W[4]=[createTextVNode("AI 工具箱",-1)])]),_:1}),createVNode(unref(_sfc_main$1O),{title:unref(s)?"AI 工具箱":"配置参数","aria-label":unref(s)?"AI 工具箱":"配置参数",variant:"ghost",size:"icon",onClick:W[0]||(W[0]=Z=>s.value=!unref(s))},{default:withCtx(()=>[unref(s)?(openBlock(),createBlock(unref(WandSparkles),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Settings),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"])])]),_:1}),unref(s)?(openBlock(),createBlock(de,{key:0,class:"border-border mb-4 w-full border rounded-md p-4",onSaved:W[1]||(W[1]=()=>s.value=!1)})):(openBlock(),createElementBlock("div",_hoisted_2$3,[createBaseVNode("div",null,[W[5]||(W[5]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 选择操作 ",-1)),createVNode(unref(_sfc_main$1l),{modelValue:unref(C),"onUpdate:modelValue":W[2]||(W[2]=Z=>isRef(C)?C.value=Z:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1f),{placeholder:"请选择要执行的操作"})]),_:1}),createVNode(unref(_sfc_main$1e),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1k),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(S,Z=>createVNode(unref(_sfc_main$1j),{key:Z.value,value:Z.value},{default:withCtx(()=>[createTextVNode(toDisplayString(Z.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),createBaseVNode("div",null,[W[6]||(W[6]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 原文 ",-1)),createBaseVNode("div",_hoisted_3$3,toDisplayString(unref(h)),1)]),unref(C)==="custom"?(openBlock(),createElementBlock("div",_hoisted_4$3,[W[7]||(W[7]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 自定义提示词(可选) ",-1)),createBaseVNode("div",_hoisted_5$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(i),(Z,le)=>(openBlock(),createElementBlock("div",{key:le,class:"text-muted-foreground bg-muted flex items-center gap-1 rounded-full px-2 py-1 text-sm"},[createBaseVNode("span",null,toDisplayString(Z),1),createBaseVNode("button",{class:"hover:bg-muted/60 h-4 w-4 flex items-center justify-center rounded-full",onClick:ge=>oe(le)},[createVNode(unref(X),{class:"h-3 w-3"})],8,_hoisted_6$2)]))),128)),createBaseVNode("input",{class:"min-w-[100px] flex-1 bg-transparent py-1 text-sm focus:outline-hidden",placeholder:"输入提示词后按回车",onKeydown:withKeys(j,["enter"])},null,32)])])):createCommentVNode("",!0),unref(T)?(openBlock(),createElementBlock("div",_hoisted_7$1,toDisplayString(unref(T)),1)):createCommentVNode("",!0),unref(d)?(openBlock(),createElementBlock("div",_hoisted_8,[W[8]||(W[8]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 处理结果 ",-1)),createBaseVNode("div",{ref_key:"resultContainer",ref:g,class:"custom-scroll border-border bg-background max-h-40 min-h-[60px] overflow-y-auto whitespace-pre-line border rounded px-3 py-2 text-sm"},toDisplayString(unref(d)),513)])):createCommentVNode("",!0)])),unref(s)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_9,[unref(u)?(openBlock(),createBlock(unref(_sfc_main$1O),{key:0,variant:"secondary",onClick:H},{default:withCtx(()=>[createVNode(unref(Pause),{class:"mr-1 h-4 w-4"}),W[9]||(W[9]=createTextVNode(" 终止 ",-1))]),_:1})):createCommentVNode("",!0),unref(p)&&!unref(u)?(openBlock(),createBlock(unref(_sfc_main$1O),{key:1,variant:"default",onClick:Y},{default:withCtx(()=>[...W[10]||(W[10]=[createTextVNode(" 接受 ",-1)])]),_:1})):createCommentVNode("",!0),unref(u)?createCommentVNode("",!0):(openBlock(),createBlock(unref(_sfc_main$1O),{key:2,variant:"outline",disabled:!unref(p)&&!!unref(d),onClick:ne},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(p)?"重试":"AI 处理"),1)]),_:1},8,["disabled"]))]))]),_:1})]),_:1},8,["open"])}}}),AIPolishPopover=_export_sfc(_sfc_main$6,[["__scopeId","data-v-7616f84b"]]),_hoisted_1$3={key:0,class:"editor-ai-toolbar absolute top-1/2 -translate-y-1/2 right-0 z-30 transition-all duration-300 ease-out"},_hoisted_2$2={key:1,class:"bg-white/95 dark:bg-gray-900/95 backdrop-blur-lg border-l border-gray-200/50 dark:border-gray-700/50 shadow-lg overflow-hidden transition-all duration-300 w-12 rounded-l-md",style:{height:"auto"}},_hoisted_3$2={class:"flex flex-col py-2 gap-2"},_hoisted_4$2={class:"flex flex-col items-center gap-1 px-1"},_hoisted_5$1={class:"flex flex-col items-center gap-1 px-1"},_hoisted_6$1={key:0,class:"mx-1.5"},_hoisted_7={key:1,class:"flex flex-col items-center gap-1 px-1"},_sfc_main$5=defineComponent({__name:"SidebarAIToolbar",props:{isMobile:{type:Boolean},showEditor:{type:Boolean}},setup(t){const e=useDisplayStore(),{aiDialogVisible:o,aiImageDialogVisible:a}=storeToRefs(e),{toggleAIDialog:n,toggleAIImageDialog:s}=e,l=useStore(),{editor:d}=storeToRefs(l),u=ref(!1),m=ref(!1);function i(){try{if(!d.value)return"";const f=d.value.state.selection.main;return d.value.state.doc.sliceString(f.from,f.to).trim()}catch{return""}}const p=computed(()=>!d.value||!u.value?!1:i().length>0),C=computed(()=>m.value?i():"");function h(){u.value=!u.value}function T(){n(!0)}function v(){s(!0)}function g(){m.value=!0}return onMounted(()=>{const f=_=>{if(!u.value)return;const b=_.target;if(!b)return;const R=document.querySelector(".editor-ai-toolbar");if(R&&R.contains(b))return;["dialog",".popover",".modal",'[role="dialog"]',"nav",".menu",".dropdown",".tooltip",".floating",".ai-assistant-panel",".ai-image-generator-panel"].some(E=>b.closest(E))||(console.log(`Interaction outside excluded areas, collapsing toolbar. Event type: ${_.type}`),u.value=!1)};document.addEventListener("click",f,!0),document.addEventListener("touchstart",f,!0),onUnmounted(()=>{document.removeEventListener("click",f,!0),document.removeEventListener("touchstart",f,!0)})}),(f,_)=>!t.isMobile||t.isMobile&&t.showEditor?(openBlock(),createElementBlock("div",_hoisted_1$3,[unref(u)?(openBlock(),createElementBlock("div",_hoisted_2$2,[createBaseVNode("div",_hoisted_3$2,[createBaseVNode("div",_hoisted_4$2,[createBaseVNode("button",{class:"group relative w-7 h-7 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 active:scale-95 transition-all duration-200 flex items-center justify-center utools-ai-button",title:"AI助手",onClick:T},[createVNode(unref(Bot),{class:"h-4 w-4"})]),_[3]||(_[3]=createBaseVNode("span",{class:"text-[9px] text-gray-500 dark:text-gray-400 font-medium text-center leading-tight"}," 助手 ",-1))]),_[7]||(_[7]=createBaseVNode("div",{class:"mx-1.5"},[createBaseVNode("div",{class:"h-px bg-gray-200/50 dark:bg-gray-700/50"})],-1)),createBaseVNode("div",_hoisted_5$1,[createBaseVNode("button",{class:"group relative w-7 h-7 rounded-lg bg-gradient-to-br from-purple-500 to-purple-600 hover:from-purple-600 hover:to-purple-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 active:scale-95 transition-all duration-200 flex items-center justify-center utools-ai-button",title:"AI文生图",onClick:v},[createVNode(unref(Image),{class:"h-4 w-4"})]),_[4]||(_[4]=createBaseVNode("span",{class:"text-[9px] text-gray-500 dark:text-gray-400 font-medium text-center leading-tight"}," 文生图 ",-1))]),unref(p)&&unref(u)?(openBlock(),createElementBlock("div",_hoisted_6$1,[..._[5]||(_[5]=[createBaseVNode("div",{class:"h-px bg-gray-200/50 dark:bg-gray-700/50"},null,-1)])])):createCommentVNode("",!0),unref(p)&&unref(u)?(openBlock(),createElementBlock("div",_hoisted_7,[createBaseVNode("button",{class:"group relative w-7 h-7 rounded-lg bg-gradient-to-br from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 active:scale-95 transition-all duration-200 flex items-center justify-center utools-ai-button",title:"AI工具箱",onClick:g},[createVNode(unref(WandSparkles),{class:"h-4 w-4"})]),_[6]||(_[6]=createBaseVNode("span",{class:"text-[9px] text-gray-500 dark:text-gray-400 font-medium text-center leading-tight"}," 工具箱 ",-1))])):createCommentVNode("",!0)])])):(openBlock(),createElementBlock("div",{key:0,class:"w-5 h-16 bg-gradient-to-b from-blue-500/90 to-purple-500/90 hover:from-blue-600/95 hover:to-purple-600/95 dark:from-blue-400/90 dark:to-purple-400/90 dark:hover:from-blue-500/95 dark:hover:to-purple-500/95 backdrop-blur-lg border-l border-y border-blue-300/50 dark:border-blue-600/50 cursor-pointer transition-all duration-200 flex items-center justify-center rounded-l-lg shadow-lg group utools-sidebar-edge",title:"展开AI工具栏",onClick:h},[createVNode(unref(Settings2),{class:"h-4 w-4 text-white drop-shadow-sm group-hover:scale-110 transition-transform duration-200"})])),createVNode(AIAssistantPanel,{open:unref(o),"onUpdate:open":_[0]||(_[0]=b=>isRef(o)?o.value=b:null)},null,8,["open"]),createVNode(AIImageGeneratorPanel,{open:unref(a),"onUpdate:open":_[1]||(_[1]=b=>isRef(a)?a.value=b:null)},null,8,["open"]),createVNode(unref(AIPolishPopover),{open:unref(m),"onUpdate:open":_[2]||(_[2]=b=>isRef(m)?m.value=b:null),"selected-text":unref(C),"is-mobile":t.isMobile},null,8,["open","selected-text","is-mobile"])])):createCommentVNode("",!0)}}),SidebarAIToolbar=_export_sfc(_sfc_main$5,[["__scopeId","data-v-aacd7056"]]),_hoisted_1$2={key:0,class:"bg-border z-10 h-4 w-3 flex items-center justify-center border rounded-sm"},_sfc_main$4=defineComponent({__name:"ResizableHandle",props:{id:{},hitAreaMargins:{},tabindex:{},disabled:{type:Boolean},nonce:{},asChild:{type:Boolean},as:{},class:{},withHandle:{type:Boolean}},emits:["dragging"],setup(t,{emit:e}){const o=t,a=e,n=reactiveOmit(o,"class"),s=useForwardPropsEmits(n,a);return(l,d)=>(openBlock(),createBlock(unref(SplitterResizeHandle_default),mergeProps(unref(s),{class:unref(cn)("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:-translate-y-1/2 data-[orientation=vertical]:after:translate-x-0 [&[data-orientation=vertical]>div]:rotate-90",o.class)}),{default:withCtx(()=>[o.withHandle?(openBlock(),createElementBlock("div",_hoisted_1$2,[createVNode(unref(GripVertical),{class:"h-2.5 w-2.5"})])):createCommentVNode("",!0)]),_:1},16,["class"]))}}),_sfc_main$3=defineComponent({__name:"ResizablePanelGroup",props:{id:{},autoSaveId:{},direction:{},keyboardResizeBy:{},storage:{},asChild:{type:Boolean},as:{},class:{}},emits:["layout"],setup(t,{emit:e}){const o=t,a=e,n=reactiveOmit(o,"class"),s=useForwardPropsEmits(n,a);return(l,d)=>(openBlock(),createBlock(unref(SplitterGroup_default),mergeProps(unref(s),{class:unref(cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$1={class:"flex flex-col gap-0.5"},_hoisted_2$1={class:"flex items-center gap-1"},_hoisted_3$1={class:"w-10 select-none text-center text-xs"},_hoisted_4$1={key:0,class:"flex items-center gap-1"},_sfc_main$2=defineComponent({__name:"SearchTab",props:{editorView:{}},setup(t,{expose:e}){const o=t,a=ref(!1),n=ref(null),s=ref(""),l=ref(0),d=ref(!1),u=ref(""),m=ref([]),i=computed(()=>m.value.length),p=computed(()=>oe()?m.value[l.value]:null),C=StateEffect.define(),h=StateField.define({create(){return Decoration.none},update(V,ne){for(const H of ne.effects)if(H.is(C))return H.value;return V},provide:V=>EditorView.decorations.from(V)});onMounted(()=>{o.editorView.state.field(h,!1)||o.editorView.dispatch({effects:StateEffect.appendConfig.of(h)})}),watch(s,()=>{useDebounceFn(()=>{m.value=[],s.value===""?T():(l.value=0,g())},300)()}),watch([l,m],()=>{v()}),watch(a,async()=>{a.value?(v(),await nextTick(),n.value?.focus(),n.value?.select()):T()});function T(){o.editorView.dispatch({effects:C.of(Decoration.none)})}function v(){const V=[];m.value.forEach((H,Y)=>{const $=H[0],x=H[1],J=o.editorView.state.doc.line($.line+1),W=o.editorView.state.doc.line(x.line+1),de=J.from+$.ch,Z=W.from+x.ch,le=Y===l.value,ge=Decoration.mark({class:le?"cm-searchMatch-selected":"cm-searchMatch"});V.push(ge.range(de,Z))});const ne=Decoration.set(V,!0);if(o.editorView.dispatch({effects:C.of(ne)}),m.value[l.value]?.[0]){const H=m.value[l.value][0],$=o.editorView.state.doc.line(H.line+1).from+H.ch;o.editorView.dispatch({selection:{anchor:$,head:$},scrollIntoView:!0})}}function g(){if(!s.value||!a.value)return;const V=o.editorView.state.doc.toString(),ne=s.value,H=[];ne&&V.split(`
615
+ `).forEach(($,x)=>{let J=0,W=$.toLowerCase().indexOf(ne.toLowerCase(),J);for(;W!==-1;)H.push([{line:x,ch:W},{line:x,ch:W+ne.length}]),J=W+1,W=$.toLowerCase().indexOf(ne.toLowerCase(),J)}),m.value=H,m.value.length>0&&l.value>=m.value.length&&(l.value=m.value.length-1)}function f(){oe()&&(l.value=(l.value+1)%i.value)}function _(){oe()&&(l.value=(l.value-1+i.value)%i.value)}function b(){d.value=!d.value}function R(){a.value=!1}function N(V){switch(V.key){case"Enter":f(),V.preventDefault()}}function y(V){switch(V.key){case"Enter":E(),V.preventDefault()}}function E(){if(!oe()||!p.value)return;const V=p.value[0],ne=p.value[1],H=o.editorView.state.doc.line(V.line+1),Y=o.editorView.state.doc.line(ne.line+1),$=H.from+V.ch,x=Y.from+ne.ch;o.editorView.dispatch({changes:{from:$,to:x,insert:u.value},selection:{anchor:$+u.value.length}}),g()}function S(){if(!oe()||!p.value)return;const ne=[...m.value].sort((H,Y)=>H[0].line!==Y[0].line?Y[0].line-H[0].line:Y[0].ch-H[0].ch).map(H=>{const Y=H[0],$=H[1],x=o.editorView.state.doc.line(Y.line+1),J=o.editorView.state.doc.line($.line+1),W=x.from+Y.ch,de=J.from+$.ch;return{from:W,to:de,insert:u.value}});o.editorView.dispatch({changes:ne}),g()}function j(V){s.value=V,a.value?nextTick(()=>{n.value?.focus(),n.value?.select()}):a.value=!0}onUnmounted(()=>{T()});function oe(){return i.value>0}return e({showSearchTab:a,searchWord:s,setSearchWord:j}),(V,ne)=>{const H=_sfc_main$1O,Y=_sfc_main$1B;return openBlock(),createBlock(Transition,{name:"slide-down"},{default:withCtx(()=>[unref(a)?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["bg-background absolute right-0 top-0 z-50 min-w-[300px] w-fit flex gap-1 border rounded-lg px-2 py-1 shadow-md transition-all",unref(d)?"items-start":"items-center"])},[createVNode(H,{variant:"ghost",title:"切换替换","aria-label":"切换替换",class:"h-7 w-5 flex items-center justify-center p-0",onClick:b},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(d)?unref(ChevronDown):unref(ChevronRight)),{class:"h-3.5 w-3.5"}))]),_:1}),createBaseVNode("div",_hoisted_1$1,[createBaseVNode("div",_hoisted_2$1,[createVNode(Y,{ref_key:"searchInputRef",ref:n,modelValue:unref(s),"onUpdate:modelValue":ne[0]||(ne[0]=$=>isRef(s)?s.value=$:null),placeholder:"查找",class:"h-7 w-40 text-sm",onKeydown:N},null,8,["modelValue"]),createBaseVNode("span",_hoisted_3$1,toDisplayString(unref(i)?unref(l)+1:0)+"/"+toDisplayString(unref(i)),1),createVNode(H,{variant:"ghost",size:"xs",title:"上一处","aria-label":"上一处",class:"h-6 w-6 p-0",onClick:_},{default:withCtx(()=>[createVNode(unref(ChevronUp),{class:"h-3 w-3"})]),_:1}),createVNode(H,{variant:"ghost",size:"xs",title:"下一处","aria-label":"下一处",class:"h-6 w-6 p-0",onClick:f},{default:withCtx(()=>[createVNode(unref(ChevronDown),{class:"h-3 w-3"})]),_:1}),createVNode(H,{variant:"ghost",size:"xs",title:"关闭","aria-label":"关闭",class:"h-6 w-6 p-0",onClick:R},{default:withCtx(()=>[createVNode(unref(X),{class:"h-3 w-3"})]),_:1})]),unref(d)?(openBlock(),createElementBlock("div",_hoisted_4$1,[createVNode(Y,{modelValue:unref(u),"onUpdate:modelValue":ne[1]||(ne[1]=$=>isRef(u)?u.value=$:null),placeholder:"替换",class:"h-7 w-40 text-sm",onKeydown:y},null,8,["modelValue"]),createVNode(H,{variant:"ghost",size:"xs",title:"替换","aria-label":"替换",class:"h-6 w-6 p-0",onClick:E},{default:withCtx(()=>[createVNode(unref(Replace),{class:"h-3 w-3"})]),_:1}),createVNode(H,{variant:"ghost",size:"xs",title:"全部替换","aria-label":"全部替换",class:"h-6 w-6 p-0",onClick:S},{default:withCtx(()=>[createVNode(unref(ReplaceAll),{class:"h-3 w-3"})]),_:1})])):createCommentVNode("",!0)])],2)):createCommentVNode("",!0)]),_:1})}}}),SearchTab=_export_sfc(_sfc_main$2,[["__scopeId","data-v-8222ccb5"]]);function getConfig(t,e){if(t){const n=e==="github"?githubConfig:giteeConfig,{username:s,repoList:l,branch:d,accessTokenList:u}=n,m=Math.floor(Math.random()*u.length),i=u[m].replace("doocsmd",""),p=Math.floor(Math.random()*l.length),C=l[p];return{username:s,repo:C,branch:d,accessToken:i}}const o=JSON.parse(localStorage.getItem(`${e}Config`)),a=o.repo.replace(`https://${e}.com/`,"").replace(`http://${e}.com/`,"").replace(`${e}.com/`,"").split("/");return{username:a[0],repo:a[1],branch:o.branch||"master",accessToken:o.accessToken}}function getDir(){const t=new Date,e=t.getFullYear(),o=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return`${e}/${o}/${a}`}function getDateFilename(t){const e=new Date().getTime(),o=t.split(".").pop();return`${e}-${v4()}.${o}`}async function ghFileUpload(t,e){const o=localStorage.getItem("imgHost")==="default",{username:a,repo:n,branch:s,accessToken:l}=getConfig(o,"github"),d=getDir(),u=`https://api.github.com/repos/${a}/${n}/contents/${d}/`,m=getDateFilename(e),i=await service({url:u+m,method:"put",headers:{Authorization:`token ${l}`},data:{content:t,branch:s,message:`Upload by ${window.location.href}`}}),p=`raw.githubusercontent.com/${a}/${n}/${s}/`,C=`fastly.jsdelivr.net/gh/${a}/${n}@${s}/`;return i.content=i.data?.content||i.content,o?i.content.download_url.replace(p,C):i.content.download_url}async function giteeUpload(t,e){const o=localStorage.getItem("imgHost")==="default",{username:a,repo:n,branch:s,accessToken:l}=getConfig(o,"gitee"),d=getDir(),u=getDateFilename(e),m=`https://gitee.com/api/v5/repos/${a}/${n}/contents/${d}/${u}`,i=await service({url:m,method:"POST",data:{content:t,branch:s,access_token:l,message:`Upload by ${window.location.href}`}});return i.content=i.data?.content||i.content,encodeURI(i.content.download_url)}function getQiniuToken(t,e,o){const a=JSON.stringify(o),n=base64encode(utf16to8(a)),l=CryptoJS.HmacSHA1(n,e).toString(CryptoJS.enc.Base64);return`${t}:${safe64(l)}:${n}`}async function qiniuUpload(t){const{accessKey:e,secretKey:o,bucket:a,region:n,path:s,domain:l}=JSON.parse(localStorage.getItem("qiniuConfig")),d=getQiniuToken(e,o,{scope:a,deadline:Math.trunc(new Date().getTime()/1e3)+3600}),m=(s?`${s}/`:"")+getDateFilename(t.name),i=upload(t,m,d,{},{region:n});return new Promise((p,C)=>{i.subscribe({next:h=>{console.log(h)},error:h=>{C(h.message)},complete:h=>{p(`${l}/${h.key}`)}})})}async function aliOSSFileUpload(t){const e=getDateFilename(t.name),{region:o,bucket:a,accessKeyId:n,accessKeySecret:s,useSSL:l,cdnHost:d,path:u}=JSON.parse(localStorage.getItem("aliOSSConfig")),m=u?`${u}/${e}`:e,i=l===void 0||l,p=i?"https":"http",C=new OSS({region:o,bucket:a,accessKeyId:n,accessKeySecret:s,secure:i});try{return await C.put(m,t),d?`${d}/${m}`:`${p}://${a}.${o}.aliyuncs.com/${m}`}catch(h){return Promise.reject(h)}}async function txCOSFileUpload(t){const e=getDateFilename(t.name),{secretId:o,secretKey:a,bucket:n,region:s,path:l,cdnHost:d}=JSON.parse(localStorage.getItem("txCOSConfig")),u=new COS({SecretId:o,SecretKey:a});return new Promise((m,i)=>{u.putObject({Bucket:n,Region:s,Key:`${l}/${e}`,Body:t},(p,C)=>{p?i(p):m(d?l===""?`${d}/${e}`:`${d}/${l}/${e}`:`https://${C.Location}`)})})}async function minioFileUpload(t){const e=getDateFilename(t.name),{endpoint:o,port:a,useSSL:n,bucket:s,accessKey:l,secretKey:d}=JSON.parse(localStorage.getItem("minioConfig")),u=new S3Client({endpoint:`${n?"https":"http"}://${o}${a?`:${a}`:""}`,credentials:{accessKeyId:l,secretAccessKey:d},region:"auto",forcePathStyle:!0}),m=new PutObjectCommand({Bucket:s,Key:e,ContentType:t.type}),i=await getSignedUrl(u,m,{expiresIn:300});return await service(i,{method:"PUT",headers:{"Content-Type":t.type},data:t}).catch(p=>{console.log(p)}),`${n?"https":"http"}://${o}${a?`:${a}`:""}/${s}/${e}`}async function getMpToken(t,e,o){const a=localStorage.getItem(`mpToken:${t}`);if(a){const d=JSON.parse(a);if(d.expire&&d.expire>new Date().getTime())return d.access_token}const n={method:"POST",data:{grant_type:"client_credential",appid:t,secret:e}};let s="https://api.weixin.qq.com/cgi-bin/stable_token";o&&(s=`${o}/cgi-bin/stable_token`);const l=await service(s,n);if(l.access_token){const d={...l,expire:new Date().getTime()+l.expires_in*1e3};return localStorage.setItem(`mpToken:${t}`,JSON.stringify(d)),l.access_token}return""}async function mpFileUpload(t){let{appID:e,appsecret:o,proxyOrigin:a}=JSON.parse(localStorage.getItem("mpConfig"));const n=await getMpToken(e,o,a);if(!n)throw new Error("获取 access_token 失败");const s=new FormData;s.append("media",t,t.name);const l={method:"POST",data:s};let d=`https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=${n}&type=image`;const u=t.size/(1024*1024),m=t.type.toLowerCase();u<1&&(m==="image/jpeg"||m==="image/png")&&(d=`https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=${n}`),a&&(d=d.replace("https://api.weixin.qq.com",a));const i=await service(d,l);if(!i.url)throw new Error("上传失败,未获取到URL");let p=i.url;return a&&window.location.href.startsWith("http")&&(p=`https://wsrv.nl?url=${encodeURIComponent(p)}`),p}async function r2Upload(t){const{accountId:e,accessKey:o,secretKey:a,bucket:n,path:s,domain:l}=JSON.parse(localStorage.getItem("r2Config")),u=(s?`${s}/`:"")+getDateFilename(t.name),m=new S3Client({region:"auto",endpoint:`https://${e}.r2.cloudflarestorage.com`,credentials:{accessKeyId:o,secretAccessKey:a}}),i=await getSignedUrl(m,new PutObjectCommand({Bucket:n,Key:u,ContentType:t.type}),{expiresIn:300});return await service(i,{method:"PUT",headers:{"Content-Type":t.type},data:t}).catch(p=>{console.log(p)}),`${l}/${u}`}async function upyunUpload(t){const{bucket:e,operator:o,password:a,path:n,domain:s}=JSON.parse(localStorage.getItem("upyunConfig")),l=`${n}/${getDateFilename(t.name)}`,d=`/${e}/${l}`,u=await t.arrayBuffer(),m=new Date().toUTCString(),p=["PUT",d,m].join("&"),C=CryptoJS.MD5(a).toString(),h=CryptoJS.HmacSHA1(p,C).toString(CryptoJS.enc.Base64),T=`UPYUN ${o}:${h}`,v=`https://v0.api.upyun.com${d}`,g=await window.fetch(v,{method:"PUT",headers:{Authorization:T,"X-Date":m,"Content-Type":t.type},body:u});if(!g.ok)throw new Error(`上传失败: ${await g.text()}`);return`${s}/${l}`}async function telegramUpload(t){const{token:e,chatId:o}=JSON.parse(localStorage.getItem("telegramConfig")),a=new FormData;a.append("chat_id",o),a.append("photo",t,t.name);const n=await service({url:`https://api.telegram.org/bot${e}/sendPhoto`,method:"POST",data:a});if(!n.ok||!n.result.photo.length)throw new Error("Telegram sendPhoto 失败");const s=n.result.photo[n.result.photo.length-1].file_id,l=await service({url:`https://api.telegram.org/bot${e}/getFile?file_id=${s}`,method:"GET"});if(!l.ok)throw new Error("Telegram getFile 失败");const d=l.result.file_path;return`https://api.telegram.org/file/bot${e}/${d}`}async function cloudinaryUpload(t){const{cloudName:e,apiKey:o,apiSecret:a,uploadPreset:n,folder:s="",domain:l}=JSON.parse(localStorage.getItem("cloudinaryConfig"));if(!e||!o)throw new Error("Cloudinary 配置缺少 cloudName / apiKey");const d=Math.floor(Date.now()/1e3),u=new FormData;if(u.append("file",t),u.append("api_key",o),u.append("timestamp",`${d}`),a){const C=[];s&&C.push(`folder=${s}`),n&&C.push(`upload_preset=${n}`),C.push(`timestamp=${d}`);const h=C.sort().join("&"),T=CryptoJS.SHA1(h+a).toString();u.append("signature",T)}else if(n)u.append("upload_preset",n);else throw new Error("未配置 apiSecret 时必须提供 uploadPreset");s&&u.append("folder",s);const m=`https://api.cloudinary.com/v1_1/${e}/image/upload`,i=await service(m,{method:"POST",data:u}),p=i.secure_url||i.url;if(!p)throw new Error("Cloudinary 返回缺少 url 字段");if(l){const{pathname:C,search:h}=new URL(p);return`${l}${C}${h}`}return p}async function formCustomUpload(content,file){const str=`
616
+ async (CUSTOM_ARG) => {
617
+ ${localStorage.getItem("formCustomConfig")}
618
+ }
619
+ `;return new Promise((resolve,reject)=>{const exportObj={content,file,util:{axios:service,CryptoJS,OSS,COS,Buffer,uuidv4:v4,qiniu,tokenTools,getDir,getDateFilename},okCb:resolve,errCb:reject};eval(str)(exportObj).catch(t=>{console.error(t),reject(t)})})}function fileUpload(t,e){const o=localStorage.getItem("imgHost");switch(o||localStorage.setItem("imgHost","default"),o){case"aliOSS":return aliOSSFileUpload(e);case"minio":return minioFileUpload(e);case"txCOS":return txCOSFileUpload(e);case"qiniu":return qiniuUpload(e);case"gitee":return giteeUpload(t,e.name);case"github":return ghFileUpload(t,e.name);case"mp":return mpFileUpload(e);case"r2":return r2Upload(e);case"upyun":return upyunUpload(e);case"telegram":return telegramUpload(e);case"cloudinary":return cloudinaryUpload(e);case"formCustom":return formCustomUpload(t,e);default:return ghFileUpload(t,e.name)}}const _hoisted_1={class:"container flex flex-col"},_hoisted_2={class:"container-main flex flex-1 flex-col"},_hoisted_3={class:"container-main-section border-radius-10 relative flex flex-1 overflow-hidden border"},_hoisted_4=["innerHTML"],_hoisted_5={key:0,class:"loading-mask"},_hoisted_6={key:0,class:"fixed bottom-16 right-6 z-50 flex flex-col gap-2"},_sfc_main$1=defineComponent({__name:"CodemirrorEditor",setup(t){const e=useStore(),o=useDisplayStore(),{isDark:a,output:n,editor:s}=storeToRefs(e),{editorRefresh:l}=e,{toggleShowUploadImgDialog:d}=o;watch(n,()=>{nextTick(()=>{const A=document.getElementById("output");A&&highlightPendingBlocks(HighlightJS,A)})});const u=ref(!1),m=ref(!1);function i(){return document.querySelector(".cm-scroller")||document.querySelector(".CodeMirror-scroll")}function p(){u.value=!0,m.value=!0}function C(){u.value=!1,setTimeout(()=>{m.value=!1},800)}const h=ref(!0);function T(){h.value=!h.value}const v=useTemplateRef("previewRef"),g=ref(),f=ref(null),_=new Compartment;function b(){const A=ae=>{let ee,K;if(clearTimeout(g.value),ae==="preview"){if(ee=v.value,K=i(),!K){console.warn("Cannot find CodeMirror scroll container");return}const se=i();se&&(se.removeEventListener("scroll",F),g.value=setTimeout(()=>{se.addEventListener("scroll",F)},300))}else{if(ee=i(),K=v.value,!ee){console.warn("Cannot find CodeMirror scroll container");return}K.removeEventListener("scroll",M,!1),g.value=setTimeout(()=>{K.addEventListener("scroll",M,!1)},300)}if(!ee||!K)return;const L=ee.scrollHeight-ee.offsetHeight,G=K.scrollHeight-K.offsetHeight;if(L<=0||G<=0)return;const fe=ee.scrollTop/L*G;K.scrollTo(0,fe)};function F(){A("editor")}function M(){A("preview")}v.value&&v.value.addEventListener("scroll",M,!1);const z=i();z&&z.addEventListener("scroll",F)}onMounted(()=>{setTimeout(()=>{b()},300)});const R=useTemplateRef("searchTabRef"),N=ref(null);function y(A){const F=A.state.selection.main,M=A.state.doc.sliceString(F.from,F.to).trim();R.value?M?R.value.setSearchWord(M):R.value.showSearchTab=!0:N.value={selected:M}}watch(R,A=>{if(A&&N.value){const{selected:F}=N.value;F?A.setSearchWord(F):A.showSearchTab=!0,N.value=null}});function E(A){const F=f.value;A.key==="Escape"&&R.value?.showSearchTab&&(R.value.showSearchTab=!1,A.preventDefault(),F?.focus())}onMounted(()=>{document.addEventListener("keydown",E,{passive:!1,capture:!1})});function S(A){const F=checkImage(A);if(!F.ok)return toast.error(F.msg),!1;const M=localStorage.getItem("imgHost")||"default";localStorage.setItem("imgHost",M);const z=localStorage.getItem(`${M}Config`);return M==="default"||z?!0:(toast.error(`请先配置 ${M} 图床参数`),!1)}function j(A){if(!A){toast.error("上传图片未知异常");return}setTimeout(()=>{d(!1)},1e3);const F=`![](${A})`;f.value&&f.value.dispatch(f.value.state.replaceSelection(`
620
+ ${F}
621
+ `)),toast.success("图片上传成功")}const oe=ref(!1);async function V(A){return await imageCompression(A,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0})}async function ne(A,F,M){try{oe.value=!0,localStorage.getItem("useCompression")==="true"&&(A=await V(A));const ae=await toBase64(A),ee=await fileUpload(ae,A);if(F?F(ee,ae):j(ee),M)return j(ee)}catch(z){toast.error(z.message)}finally{oe.value=!1}}async function H({list:A}){return new Promise(F=>{const{path:M,file:z}=A.find(ee=>ee.path.match(/\.md$/)),ae=new FileReader;ae.readAsText(z,"UTF-8"),ae.onload=ee=>{F({str:ee.target.result,file:z,path:M})}})}async function Y(A){const F=[];let M="";try{const z=[A];for(const ae of z){M+=`${ae.name}/`;for await(const[,ee]of ae)ee.kind==="file"?F.push({path:M+ee.name,file:await ee.getFile()}):(F.push({path:`${M+ee.name}/`}),z.push(ee))}}catch(z){console.error(z)}return F}async function $({md:A,list:F}){const M=[...A.str.matchAll(/!\[(.*?)\]\((.*?)\)/g)||[]].filter(ee=>ee),z=A.path.match(/.+?\//)[0];(await Promise.all(M.map(ee=>new Promise(K=>{let[,,L]=ee;L=L.replace(/^.\//,"");const{file:G}=F.find(te=>te.path===`${z}${L}`)||{};ne(G,te=>K({matchStr:L,url:te}))})))).forEach(ee=>{A.str=A.str.replace(`](./${ee.matchStr})`,`](${ee.url})`).replace(`](${ee.matchStr})`,`](${ee.url})`)}),f.value&&f.value.dispatch({changes:{from:0,to:f.value.state.doc.length,insert:A.str}})}const x=useTemplateRef("codeMirrorWrapper");function J(){const A=x.value;A.ondragover=F=>F.preventDefault(),A.ondrop=async F=>{if(F.preventDefault(),!(F.dataTransfer==null||!Array.isArray(F.dataTransfer.items)))for(const M of F.dataTransfer.items.filter(z=>z.kind==="file"))M.getAsFileSystemHandle().then(async z=>{if(z.kind==="directory"){const ae=await Y(z),ee=await H({list:ae});$({md:ee,list:ae})}else{const ae=await z.getFile();console.log("file",ae),S(ae)&&ne(ae)}})}}const W=ref(),de=useTemplateRef("editorRef"),Z=ref(0);function le(A){const F=EditorState.create({doc:e.posts[e.currentPostIndex].content,extensions:[markdownSetup({onSearch:y}),_.of(theme(a.value)),EditorView.updateListener.of(z=>{if(z.docChanged){const ae=z.state.doc.toString();clearTimeout(W.value),W.value=setTimeout(()=>{l();const ee=e.posts[e.currentPostIndex];ae!==ee.content&&(ee.updateDatetime=new Date,ee.content=ae)},300)}})]}),M=new EditorView({state:F,parent:A});return f.value=M,M.dom.addEventListener("paste",async z=>{if(!z.clipboardData?.items||oe.value)return;const ae=[...z.clipboardData.items].map(L=>L.getAsFile()).filter(L=>L!=null&&S(L));if(ae.length===0)return;const ee=setInterval(()=>{const L=Z.value+1;L>=100||(Z.value=L)},100);for(const L of ae)z.preventDefault(),await ne(L);(()=>{clearInterval(ee),Z.value=100,setTimeout(()=>{Z.value=0},1e3)})()}),M}onMounted(()=>{const A=de.value;A!=null&&nextTick(()=>{const F=le(A);s.value=F,l(),J()})}),watch(a,()=>{f.value&&f.value.dispatch({effects:_.reconfigure(theme(a.value))})});const ge=ref();return onMounted(()=>{ge.value=setInterval(()=>{const A=e.posts[e.currentPostIndex];(A.history||[])[0]?.content!==A.content&&(A.history??=[],A.history.unshift({content:A.content,datetime:new Date().toLocaleString("zh-CN")}),A.history.length=Math.min(A.history.length,10))},30*1e3)}),onUnmounted(()=>{clearTimeout(ge.value),clearTimeout(g.value),clearTimeout(W.value),document.removeEventListener("keydown",E)}),(A,F)=>{const M=_sfc_main$1n,z=__unplugin_components_1,ae=__unplugin_components_2,ee=_sfc_main$$,K=_sfc_main$16,L=_sfc_main$17,G=__unplugin_components_6,te=__unplugin_components_7,fe=_sfc_main$1b,se=_sfc_main$1r,re=_sfc_main$1y,ce=_sfc_main$1J,q=_sfc_main$1K,P=_sfc_main$1L,_e=_sfc_main$1M,me=_sfc_main$1N,be=_sfc_main$1P,ke=_sfc_main$1Q,xe=_sfc_main$1R,ye=_sfc_main$1S;return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(M,{modelValue:unref(Z),"onUpdate:modelValue":F[0]||(F[0]=Ce=>isRef(Z)?Z.value=Ce:null),class:"absolute left-0 right-0 rounded-none",style:{height:"2px"}},null,8,["modelValue"]),createVNode(z,{onStartCopy:p,onEndCopy:C}),createBaseVNode("main",_hoisted_2,[createBaseVNode("div",_hoisted_3,[createVNode(unref(_sfc_main$3),{direction:"horizontal"},{default:withCtx(()=>[createVNode(unref(SplitterPanel_default),{"default-size":15,"max-size":unref(e).isOpenPostSlider?30:0,"min-size":unref(e).isOpenPostSlider?10:0},{default:withCtx(()=>[createVNode(ae)]),_:1},8,["max-size","min-size"]),createVNode(unref(_sfc_main$4),{class:"hidden md:block"}),createVNode(unref(SplitterPanel_default),{class:"flex"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{ref_key:"codeMirrorWrapper",ref:x,class:normalizeClass(["codeMirror-wrapper relative flex-1",{"order-1 border-l":!unref(e).isEditOnLeft,"border-r":unref(e).isEditOnLeft}])},[unref(f)?(openBlock(),createBlock(unref(SearchTab),{key:0,ref_key:"searchTabRef",ref:R,"editor-view":unref(f)},null,8,["editor-view"])):createCommentVNode("",!0),createVNode(unref(SidebarAIToolbar),{"is-mobile":unref(e).isMobile,"show-editor":unref(h)},null,8,["is-mobile","show-editor"]),createVNode(ee,null,{default:withCtx(()=>[createBaseVNode("div",{id:"editor",ref_key:"editorRef",ref:de,class:"codemirror-container"},null,512)]),_:1})],2),[[vShow,!unref(e).isMobile||unref(e).isMobile&&unref(h)]]),withDirectives(createBaseVNode("div",{class:normalizeClass(["relative flex-1 overflow-x-hidden transition-width",[unref(e).isOpenRightSlider?"w-0":"w-100"]])},[createBaseVNode("div",{id:"preview",ref_key:"previewRef",ref:v,class:"preview-wrapper w-full p-5"},[createBaseVNode("div",{id:"output-wrapper",class:normalizeClass(["w-full",{output_night:!unref(u)}])},[createBaseVNode("div",{class:normalizeClass(["preview border-x shadow-xl",[unref(e).isMobile?"w-[100%]":unref(e).previewWidth]])},[createBaseVNode("section",{id:"output",class:"w-full",innerHTML:unref(n)},null,8,_hoisted_4),unref(m)?(openBlock(),createElementBlock("div",_hoisted_5,[...F[3]||(F[3]=[createBaseVNode("div",{class:"loading-mask-box"},[createBaseVNode("div",{class:"loading__img"}),createBaseVNode("span",null,"正在生成")],-1)])])):createCommentVNode("",!0)],2)],2),createVNode(K,{target:"preview",right:unref(e).isMobile?24:20,bottom:unref(e).isMobile?90:20},null,8,["right","bottom"])],512),createVNode(L)],2),[[vShow,!unref(e).isMobile||unref(e).isMobile&&!unref(h)]]),createVNode(G),createVNode(te)]),_:1})]),_:1})]),unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_6,[createBaseVNode("button",{class:"bg-primary flex items-center justify-center rounded-full p-3 text-white shadow-lg transition active:scale-95 hover:scale-105 dark:bg-gray-700 dark:text-white dark:ring-2 dark:ring-white/30","aria-label":"切换编辑/预览",onClick:T},[(openBlock(),createBlock(resolveDynamicComponent(unref(h)?unref(Eye):unref(Pen)),{class:"h-5 w-5"}))])])):createCommentVNode("",!0),createVNode(fe,{onUploadImage:ne}),createVNode(se),createVNode(re),createVNode(xe,{open:unref(e).isOpenConfirmDialog,"onUpdate:open":F[2]||(F[2]=Ce=>unref(e).isOpenConfirmDialog=Ce)},{default:withCtx(()=>[createVNode(ke,null,{default:withCtx(()=>[createVNode(P,null,{default:withCtx(()=>[createVNode(ce,null,{default:withCtx(()=>[...F[4]||(F[4]=[createTextVNode("提示",-1)])]),_:1}),createVNode(q,null,{default:withCtx(()=>[...F[5]||(F[5]=[createTextVNode(" 此操作将丢失本地自定义样式,是否继续? ",-1)])]),_:1})]),_:1}),createVNode(be,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[...F[6]||(F[6]=[createTextVNode("取消",-1)])]),_:1}),createVNode(me,{onClick:F[1]||(F[1]=Ce=>unref(e).resetStyle())},{default:withCtx(()=>[...F[7]||(F[7]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])]),createVNode(ye)])}}}),CodemirrorEditor=_export_sfc(_sfc_main$1,[["__scopeId","data-v-2b70853d"]]),_sfc_main=defineComponent({__name:"App",setup(t){const e=useStore(),o=ref(!1);return onMounted(()=>{o.value=!!window.__MD_UTOOLS__,o.value&&document.documentElement.classList.add("is-utools")}),(a,n)=>{const s=__unplugin_components_0$1;return openBlock(),createElementBlock(Fragment,null,[createVNode(s),createVNode(CodemirrorEditor),createVNode(unref(_sfc_main$1T),{"rich-colors":"",position:"top-center",theme:unref(e).isDark?"dark":"light"},null,8,["theme"])],64)}}});class MpCommonProfile extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=this.dataset.nickname||"",o=this.dataset.headimg||"",a=this.dataset.signature||"",n=this.dataset.service_type||"1",s=this.dataset.verify_status||"0";this.shadowRoot.innerHTML=`
622
+ <style>
623
+ :host {
624
+ all: initial;
625
+ -webkit-text-size-adjust: inherit;
626
+
627
+ }
628
+ </style>
629
+ <style>@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.8);--weui-FG-0_5:hsla(0,0%,100%,0.6);--weui-FG-1:hsla(0,0%,100%,0.5);--weui-FG-2:hsla(0,0%,100%,0.3);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.8);--weui-GLYPH-1:hsla(0,0%,100%,0.5);--weui-GLYPH-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:rgba(95,95,95,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.1);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.6);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG:#fff;--weui-BG:#000;--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6)}}@media (prefers-color-scheme:dark){.wx-root[data-weui-mode=care]:not([data-weui-theme=light]),body[data-weui-mode=care]:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.85);--weui-FG-0_5:hsla(0,0%,100%,0.65);--weui-FG-1:hsla(0,0%,100%,0.55);--weui-FG-2:hsla(0,0%,100%,0.35);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.85);--weui-GLYPH-1:hsla(0,0%,100%,0.55);--weui-GLYPH-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:hsla(0,0%,96.1%,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.15);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.65);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-FG:#fff;--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-BG:#000;--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5)}}.wx-root,body,page{--weui-BTN-HEIGHT:48;--weui-BTN-HEIGHT-MEDIUM:40;--weui-BTN-HEIGHT-SMALL:32}.wx-root,body{--weui-BTN-ACTIVE-MASK:rgba(0,0,0,0.1)}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BTN-ACTIVE-MASK:hsla(0,0%,100%,0.1)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BTN-ACTIVE-MASK:hsla(0,0%,100%,0.1)}}.wx-root,body{--weui-BTN-DEFAULT-ACTIVE-BG:#e6e6e6}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BTN-DEFAULT-ACTIVE-BG:hsla(0,0%,100%,0.126)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BTN-DEFAULT-ACTIVE-BG:hsla(0,0%,100%,0.126)}}.wx-root,body{--weui-DIALOG-LINE-COLOR:rgba(0,0,0,0.1)}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-DIALOG-LINE-COLOR:hsla(0,0%,100%,0.1)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-DIALOG-LINE-COLOR:hsla(0,0%,100%,0.1)}}.weui-flex{display:flex}.weui-flex__item{flex:1}.wx-root,body{--weui-BG-COLOR-ACTIVE:#ececec}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BG-COLOR-ACTIVE:#373737}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BG-COLOR-ACTIVE:#373737}}[class*=" weui-icon-"][class*=" weui-icon-"],[class*=" weui-icon-"][class^=weui-icon-],[class^=weui-icon-][class*=" weui-icon-"],[class^=weui-icon-][class^=weui-icon-]{display:inline-block;vertical-align:middle;font-size:10px;width:2.4em;height:2.4em;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor}.weui-icon-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='1000' height='1000' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M500 916.667C269.881 916.667 83.333 730.119 83.333 500 83.333 269.881 269.881 83.333 500 83.333c230.119 0 416.667 186.548 416.667 416.667 0 230.119-186.548 416.667-416.667 416.667zm0-50c202.504 0 366.667-164.163 366.667-366.667 0-202.504-164.163-366.667-366.667-366.667-202.504 0-366.667 164.163-366.667 366.667 0 202.504 164.163 366.667 366.667 366.667z' fill-rule='evenodd' fill-opacity='.9'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='1000' height='1000' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M500 916.667C269.881 916.667 83.333 730.119 83.333 500 83.333 269.881 269.881 83.333 500 83.333c230.119 0 416.667 186.548 416.667 416.667 0 230.119-186.548 416.667-416.667 416.667zm0-50c202.504 0 366.667-164.163 366.667-366.667 0-202.504-164.163-366.667-366.667-366.667-202.504 0-366.667 164.163-366.667 366.667 0 202.504 164.163 366.667 366.667 366.667z' fill-rule='evenodd' fill-opacity='.9'/%3E%3C/svg%3E")}.weui-icon-download{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.25 12.04l-1.72-1.72-1.06 1.06 2.828 2.83a1 1 0 001.414-.001l2.828-2.828-1.06-1.061-1.73 1.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55 0 .999.446.999.996v13.008a.998.998 0 01-.996.996H4.996A.998.998 0 014 21.004V7.996A1 1 0 014.999 7h6.251z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.25 12.04l-1.72-1.72-1.06 1.06 2.828 2.83a1 1 0 001.414-.001l2.828-2.828-1.06-1.061-1.73 1.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55 0 .999.446.999.996v13.008a.998.998 0 01-.996.996H4.996A.998.998 0 014 21.004V7.996A1 1 0 014.999 7h6.251z'/%3E%3C/svg%3E")}.weui-icon-info{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.75-12v7h1.5v-7h-1.5zM12 9a1 1 0 100-2 1 1 0 000 2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.75-12v7h1.5v-7h-1.5zM12 9a1 1 0 100-2 1 1 0 000 2z'/%3E%3C/svg%3E")}.weui-icon-safe-success{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.6C315.5 46.7 180.4 93.1 57.6 132c0 129.3.2 231.7.2 339.7 0 304.2 248.3 471.6 443.1 523.7C695.7 943.3 944 775.9 944 471.7c0-108 .2-210.4.2-339.7C821.4 93.1 686.3 46.7 500.9 4.6zm248.3 349.1l-299.7 295c-2.1 2-5.3 2-7.4-.1L304.4 506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3 5-2.8 7.2-1l112.2 86c2.3 1.8 6 1.7 8.1-.1l274.7-228.9c2.2-1.8 5.7-1.7 7.7.3l17 16.8c2.2 2.1 2.2 5.3.2 7.4z' fill-rule='evenodd' clip-rule='evenodd' fill='%23070202'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.6C315.5 46.7 180.4 93.1 57.6 132c0 129.3.2 231.7.2 339.7 0 304.2 248.3 471.6 443.1 523.7C695.7 943.3 944 775.9 944 471.7c0-108 .2-210.4.2-339.7C821.4 93.1 686.3 46.7 500.9 4.6zm248.3 349.1l-299.7 295c-2.1 2-5.3 2-7.4-.1L304.4 506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3 5-2.8 7.2-1l112.2 86c2.3 1.8 6 1.7 8.1-.1l274.7-228.9c2.2-1.8 5.7-1.7 7.7.3l17 16.8c2.2 2.1 2.2 5.3.2 7.4z' fill-rule='evenodd' clip-rule='evenodd' fill='%23070202'/%3E%3C/svg%3E")}.weui-icon-safe-warn{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.5c-185.4 42-320.4 88.4-443.2 127.3 0 129.3.2 231.7.2 339.6 0 304.1 248.2 471.4 443 523.6 194.7-52.2 443-219.5 443-523.6 0-107.9.2-210.3.2-339.6C821.3 92.9 686.2 46.5 500.9 4.5zm-26.1 271.1h52.1c5.8 0 10.3 4.7 10.1 10.4l-11.6 313.8c-.1 2.8-2.5 5.2-5.4 5.2h-38.2c-2.9 0-5.3-2.3-5.4-5.2L464.8 286c-.2-5.8 4.3-10.4 10-10.4zm26.1 448.3c-20.2 0-36.5-16.3-36.5-36.5s16.3-36.5 36.5-36.5 36.5 16.3 36.5 36.5-16.4 36.5-36.5 36.5z' fill-rule='evenodd' clip-rule='evenodd' fill='%23020202'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.5c-185.4 42-320.4 88.4-443.2 127.3 0 129.3.2 231.7.2 339.6 0 304.1 248.2 471.4 443 523.6 194.7-52.2 443-219.5 443-523.6 0-107.9.2-210.3.2-339.6C821.3 92.9 686.2 46.5 500.9 4.5zm-26.1 271.1h52.1c5.8 0 10.3 4.7 10.1 10.4l-11.6 313.8c-.1 2.8-2.5 5.2-5.4 5.2h-38.2c-2.9 0-5.3-2.3-5.4-5.2L464.8 286c-.2-5.8 4.3-10.4 10-10.4zm26.1 448.3c-20.2 0-36.5-16.3-36.5-36.5s16.3-36.5 36.5-36.5 36.5 16.3 36.5 36.5-16.4 36.5-36.5 36.5z' fill-rule='evenodd' clip-rule='evenodd' fill='%23020202'/%3E%3C/svg%3E")}.weui-icon-success{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1.177-7.86l-2.765-2.767L7 12.431l3.119 3.121a1 1 0 001.414 0l5.952-5.95-1.062-1.062-5.6 5.6z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1.177-7.86l-2.765-2.767L7 12.431l3.119 3.121a1 1 0 001.414 0l5.952-5.95-1.062-1.062-5.6 5.6z'/%3E%3C/svg%3E")}.weui-icon-success-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm-1.172-6.242l5.809-5.808.848.849-5.95 5.95a1 1 0 01-1.414 0L7 12.426l.849-.849 2.98 2.98z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm-1.172-6.242l5.809-5.808.848.849-5.95 5.95a1 1 0 01-1.414 0L7 12.426l.849-.849 2.98 2.98z'/%3E%3C/svg%3E")}.weui-icon-success-no-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.657 18.435L3 12.778l1.414-1.414 4.95 4.95L20.678 5l1.414 1.414-12.02 12.021a1 1 0 01-1.415 0z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.657 18.435L3 12.778l1.414-1.414 4.95 4.95L20.678 5l1.414 1.414-12.02 12.021a1 1 0 01-1.415 0z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-waiting{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.75 11.38V6h-1.5v6l4.243 4.243 1.06-1.06-3.803-3.804zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.75 11.38V6h-1.5v6l4.243 4.243 1.06-1.06-3.803-3.804zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-waiting-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.6 11.503l3.891 3.891-.848.849L11.4 12V6h1.2v5.503zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.6 11.503l3.891 3.891-.848.849L11.4 12V6h1.2v5.503zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z'/%3E%3C/svg%3E")}.weui-icon-warn{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.763-15.864l.11 7.596h1.305l.11-7.596h-1.525zm.759 10.967c.512 0 .902-.383.902-.882 0-.5-.39-.882-.902-.882a.878.878 0 00-.896.882c0 .499.396.882.896.882z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.763-15.864l.11 7.596h1.305l.11-7.596h-1.525zm.759 10.967c.512 0 .902-.383.902-.882 0-.5-.39-.882-.902-.882a.878.878 0 00-.896.882c0 .499.396.882.896.882z'/%3E%3C/svg%3E")}.weui-icon-outlined-warn{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2 2 6.477 2 12zm18.8 0a8.8 8.8 0 11-17.6 0 8.8 8.8 0 0117.6 0zm-8.14-5.569l-.089 7.06H11.43l-.088-7.06h1.318zm-1.495 9.807c0 .469.366.835.835.835a.82.82 0 00.835-.835.817.817 0 00-.835-.835.821.821 0 00-.835.835z' fill='%23000'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2 2 6.477 2 12zm18.8 0a8.8 8.8 0 11-17.6 0 8.8 8.8 0 0117.6 0zm-8.14-5.569l-.089 7.06H11.43l-.088-7.06h1.318zm-1.495 9.807c0 .469.366.835.835.835a.82.82 0 00.835-.835.817.817 0 00-.835-.835.821.821 0 00-.835.835z' fill='%23000'/%3E%3C/svg%3E")}.weui-icon-info-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zM11.4 10h1.2v7h-1.2v-7zm.6-1a1 1 0 110-2 1 1 0 010 2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zM11.4 10h1.2v7h-1.2v-7zm.6-1a1 1 0 110-2 1 1 0 010 2z'/%3E%3C/svg%3E")}.weui-icon-cancel{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z' fill-rule='nonzero'/%3E%3Cpath d='M12.849 12l3.11 3.111-.848.849L12 12.849l-3.111 3.11-.849-.848L11.151 12l-3.11-3.111.848-.849L12 11.151l3.111-3.11.849.848L12.849 12z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z' fill-rule='nonzero'/%3E%3Cpath d='M12.849 12l3.11 3.111-.848.849L12 12.849l-3.111 3.11-.849-.848L11.151 12l-3.11-3.111.848-.849L12 11.151l3.111-3.11.849.848L12.849 12z'/%3E%3C/g%3E%3C/svg%3E")}.weui-icon-search{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.31 15.561l4.114 4.115-.848.848-4.123-4.123a7 7 0 11.857-.84zM16.8 11a5.8 5.8 0 10-11.6 0 5.8 5.8 0 0011.6 0z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.31 15.561l4.114 4.115-.848.848-4.123-4.123a7 7 0 11.857-.84zM16.8 11a5.8 5.8 0 10-11.6 0 5.8 5.8 0 0011.6 0z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-clear{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.06 12l3.006-3.005-1.06-1.06L12 10.938 8.995 7.934l-1.06 1.06L10.938 12l-3.005 3.005 1.06 1.06L12 13.062l3.005 3.005 1.06-1.06L13.062 12zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.06 12l3.006-3.005-1.06-1.06L12 10.938 8.995 7.934l-1.06 1.06L10.938 12l-3.005 3.005 1.06 1.06L12 13.062l3.005 3.005 1.06-1.06L13.062 12zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z'/%3E%3C/svg%3E")}.weui-icon-back{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm1.999-6.563L10.68 12 14 8.562 12.953 7.5 9.29 11.277a1.045 1.045 0 000 1.446l3.663 3.777L14 15.437z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm1.999-6.563L10.68 12 14 8.562 12.953 7.5 9.29 11.277a1.045 1.045 0 000 1.446l3.663 3.777L14 15.437z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-delete{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.774 6.4l.812 13.648a.8.8 0 00.798.752h7.232a.8.8 0 00.798-.752L17.226 6.4H6.774zm11.655 0l-.817 13.719A2 2 0 0115.616 22H8.384a2 2 0 01-1.996-1.881L5.571 6.4H3.5v-.7a.5.5 0 01.5-.5h16a.5.5 0 01.5.5v.7h-2.071zM14 3a.5.5 0 01.5.5v.7h-5v-.7A.5.5 0 0110 3h4zM9.5 9h1.2l.5 9H10l-.5-9zm3.8 0h1.2l-.5 9h-1.2l.5-9z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.774 6.4l.812 13.648a.8.8 0 00.798.752h7.232a.8.8 0 00.798-.752L17.226 6.4H6.774zm11.655 0l-.817 13.719A2 2 0 0115.616 22H8.384a2 2 0 01-1.996-1.881L5.571 6.4H3.5v-.7a.5.5 0 01.5-.5h16a.5.5 0 01.5.5v.7h-2.071zM14 3a.5.5 0 01.5.5v.7h-5v-.7A.5.5 0 0110 3h4zM9.5 9h1.2l.5 9H10l-.5-9zm3.8 0h1.2l-.5 9h-1.2l.5-9z'/%3E%3C/svg%3E")}.weui-icon-success-no-circle-thin{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.864 16.617l-5.303-5.303-1.061 1.06 5.657 5.657a1 1 0 001.414 0L21.238 6.364l-1.06-1.06L8.864 16.616z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.864 16.617l-5.303-5.303-1.061 1.06 5.657 5.657a1 1 0 001.414 0L21.238 6.364l-1.06-1.06L8.864 16.616z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-arrow{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.454 6.58l1.06-1.06 5.78 5.779a.996.996 0 010 1.413l-5.78 5.779-1.06-1.061 5.425-5.425-5.425-5.424z' fill='%23B2B2B2' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.454 6.58l1.06-1.06 5.78 5.779a.996.996 0 010 1.413l-5.78 5.779-1.06-1.061 5.425-5.425-5.425-5.424z' fill='%23B2B2B2' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-arrow-bold{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg height='24' width='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.157 12.711L4.5 18.368l-1.414-1.414 4.95-4.95-4.95-4.95L4.5 5.64l5.657 5.657a1 1 0 010 1.414z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg height='24' width='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.157 12.711L4.5 18.368l-1.414-1.414 4.95-4.95-4.95-4.95L4.5 5.64l5.657 5.657a1 1 0 010 1.414z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-back-arrow{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.343 12l7.071 7.071L9 20.485l-7.778-7.778a1 1 0 010-1.414L9 3.515l1.414 1.414L3.344 12z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.343 12l7.071 7.071L9 20.485l-7.778-7.778a1 1 0 010-1.414L9 3.515l1.414 1.414L3.344 12z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-back-arrow-thin{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 010-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 010-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-close{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5l-6.193 6.193z' fill='%23000'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5l-6.193 6.193z' fill='%23000'/%3E%3C/svg%3E")}.weui-icon-close-thin{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-back-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm1.999-5.363L12.953 16.5 9.29 12.723a1.045 1.045 0 010-1.446L12.953 7.5 14 8.563 10.68 12 14 15.438z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm1.999-5.363L12.953 16.5 9.29 12.723a1.045 1.045 0 010-1.446L12.953 7.5 14 8.563 10.68 12 14 15.438z'/%3E%3C/svg%3E")}.weui-icon-success{color:var(--weui-BRAND)}.weui-icon-waiting{color:var(--weui-BLUE)}.weui-icon-warn{color:var(--weui-RED)}.weui-icon-info{color:var(--weui-BLUE)}.weui-icon-success-circle,.weui-icon-success-no-circle,.weui-icon-success-no-circle-thin{color:var(--weui-BRAND)}.weui-icon-waiting-circle{color:var(--weui-BLUE)}.weui-icon-circle{color:var(--weui-FG-2)}.weui-icon-download{color:var(--weui-BRAND)}.weui-icon-info-circle{color:var(--weui-FG-2)}.weui-icon-safe-success{color:var(--weui-BRAND)}.weui-icon-safe-warn{color:var(--weui-YELLOW)}.weui-icon-cancel{color:var(--weui-RED)}.weui-icon-search{color:var(--weui-FG-1)}.weui-icon-clear{color:var(--weui-FG-2)}.weui-icon-clear:active{color:var(--weui-FG-1)}.weui-icon-delete.weui-icon_gallery-delete{color:var(--weui-WHITE)}.weui-icon-arrow-bold.weui-icon-arrow,.weui-icon-arrow-bold.weui-icon-arrow-bold,.weui-icon-arrow-bold.weui-icon-back-arrow,.weui-icon-arrow-bold.weui-icon-back-arrow-thin,.weui-icon-arrow.weui-icon-arrow,.weui-icon-arrow.weui-icon-arrow-bold,.weui-icon-arrow.weui-icon-back-arrow,.weui-icon-arrow.weui-icon-back-arrow-thin,.weui-icon-back-arrow-thin.weui-icon-arrow,.weui-icon-back-arrow-thin.weui-icon-arrow-bold,.weui-icon-back-arrow-thin.weui-icon-back-arrow,.weui-icon-back-arrow-thin.weui-icon-back-arrow-thin,.weui-icon-back-arrow.weui-icon-arrow,.weui-icon-back-arrow.weui-icon-arrow-bold,.weui-icon-back-arrow.weui-icon-back-arrow,.weui-icon-back-arrow.weui-icon-back-arrow-thin{width:1.2em}.weui-icon-arrow,.weui-icon-arrow-bold{color:var(--weui-FG-2)}.weui-icon-back,.weui-icon-back-arrow,.weui-icon-back-arrow-thin,.weui-icon-back-circle{color:var(--weui-FG-0)}.weui-icon_msg.weui-icon_msg{width:6.4em;height:6.4em}.weui-icon_msg.weui-icon_msg.weui-icon-warn{color:var(--weui-RED)}.weui-icon_msg.weui-icon_msg.weui-icon-info-circle{color:var(--weui-BLUE)}.weui-icon_msg-primary.weui-icon_msg-primary{width:6.4em;height:6.4em}.weui-icon_msg-primary.weui-icon_msg-primary.weui-icon-warn{color:var(--weui-YELLOW)}.wx-root,body{--weui-BG-0:#ededed;--weui-BG-1:#f7f7f7;--weui-BG-2:#fff;--weui-BG-3:#f7f7f7;--weui-BG-4:#4c4c4c;--weui-BG-5:#fff;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#3fbeff;--weui-BLUE-170:#b7e6ff;--weui-BLUE-80:#0c8bcc;--weui-BLUE-90:#0e9ce6;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#5aafe4;--weui-BLUE-BG-130:#7fc0ea;--weui-BLUE-BG-90:#4095cb;--weui-BRAND-100:#07c160;--weui-BRAND-120:#38cd7f;--weui-BRAND-170:#b4ecce;--weui-BRAND-80:#059a4c;--weui-BRAND-90:#06ae56;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#3eb575;--weui-BRAND-BG-130:#69c694;--weui-BRAND-BG-90:#259c5c;--weui-FG-0:rgba(0,0,0,0.9);--weui-FG-0_5:rgba(0,0,0,0.9);--weui-FG-1:rgba(0,0,0,0.55);--weui-FG-2:rgba(0,0,0,0.3);--weui-FG-3:rgba(0,0,0,0.1);--weui-FG-4:rgba(0,0,0,0.15);--weui-GLYPH-0:rgba(0,0,0,0.9);--weui-GLYPH-1:rgba(0,0,0,0.55);--weui-GLYPH-2:rgba(0,0,0,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#91d300;--weui-GREEN-120:#a7db33;--weui-GREEN-170:#def1b3;--weui-GREEN-80:#74a800;--weui-GREEN-90:#82bd00;--weui-GREEN-BG-100:#96be40;--weui-GREEN-BG-110:#a0c452;--weui-GREEN-BG-130:#b5d179;--weui-GREEN-BG-90:#86aa39;--weui-INDIGO-100:#1485ee;--weui-INDIGO-120:#439df1;--weui-INDIGO-170:#b8daf9;--weui-INDIGO-80:#106abe;--weui-INDIGO-90:#1277d6;--weui-INDIGO-BG-100:#2b77bf;--weui-INDIGO-BG-110:#3f84c5;--weui-INDIGO-BG-130:#6ba0d2;--weui-INDIGO-BG-90:#266aab;--weui-LIGHTGREEN-100:#95ec69;--weui-LIGHTGREEN-120:#aaef87;--weui-LIGHTGREEN-170:#def9d1;--weui-LIGHTGREEN-80:#77bc54;--weui-LIGHTGREEN-90:#85d35e;--weui-LIGHTGREEN-BG-100:#72cf60;--weui-LIGHTGREEN-BG-110:#80d370;--weui-LIGHTGREEN-BG-130:#9cdd90;--weui-LIGHTGREEN-BG-90:#66b956;--weui-LINK-100:#576b95;--weui-LINK-120:#7888aa;--weui-LINK-170:#ccd2de;--weui-LINK-80:#455577;--weui-LINK-90:#4e6085;--weui-LINKFINDER-100:#002666;--weui-MATERIAL-ATTACHMENTCOLUMN:hsla(0,0%,96.1%,0.95);--weui-MATERIAL-NAVIGATIONBAR:hsla(0,0%,92.9%,0.94);--weui-MATERIAL-REGULAR:hsla(0,0%,96.9%,0.3);--weui-MATERIAL-THICK:hsla(0,0%,96.9%,0.8);--weui-MATERIAL-THIN:hsla(0,0%,100%,0.2);--weui-MATERIAL-TOOLBAR:hsla(0,0%,96.5%,0.82);--weui-ORANGE-100:#fa9d3b;--weui-ORANGE-120:#fbb062;--weui-ORANGE-170:#fde1c3;--weui-ORANGE-80:#c87d2f;--weui-ORANGE-90:#e08c34;--weui-ORANGE-BG-100:#ea7800;--weui-ORANGE-BG-110:#ec8519;--weui-ORANGE-BG-130:#f0a04d;--weui-ORANGE-BG-90:#d26b00;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.5);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#6467f0;--weui-PURPLE-120:#8385f3;--weui-PURPLE-170:#d0d1fa;--weui-PURPLE-80:#5052c0;--weui-PURPLE-90:#595cd7;--weui-PURPLE-BG-100:#6769ba;--weui-PURPLE-BG-110:#7678c1;--weui-PURPLE-BG-130:#9496ce;--weui-PURPLE-BG-90:#5c5ea7;--weui-RED-100:#fa5151;--weui-RED-120:#fb7373;--weui-RED-170:#fdcaca;--weui-RED-80:#c84040;--weui-RED-90:#e14949;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#d3625a;--weui-RED-BG-130:#dd847e;--weui-RED-BG-90:#b94840;--weui-SECONDARY-BG:rgba(0,0,0,0.05);--weui-SEPARATOR-0:rgba(0,0,0,0.1);--weui-SEPARATOR-1:rgba(0,0,0,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:rgba(0,0,0,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:rgba(0,0,0,0.2);--weui-YELLOW-100:#ffc300;--weui-YELLOW-120:#ffcf33;--weui-YELLOW-170:#ffecb2;--weui-YELLOW-80:#cc9c00;--weui-YELLOW-90:#e6af00;--weui-YELLOW-BG-100:#efb600;--weui-YELLOW-BG-110:#f0bd19;--weui-YELLOW-BG-130:#f3cc4d;--weui-YELLOW-BG-90:#d7a400;--weui-FG-HALF:rgba(0,0,0,0.9);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#fa9d3b;--weui-YELLOW:#ffc300;--weui-GREEN:#91d300;--weui-LIGHTGREEN:#95ec69;--weui-TEXTGREEN:#06ae56;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1485ee;--weui-PURPLE:#6467f0;--weui-LINK:#576b95;--weui-TAG-TEXT-ORANGE:#fa9d3b;--weui-TAG-TEXT-GREEN:#06ae56;--weui-TAG-TEXT-BLUE:#10aeff;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:rgba(0,0,0,0.5);--weui-TAG-BACKGROUND-BLACK:rgba(0,0,0,0.05);--weui-WHITE:#fff;--weui-BG:#fff;--weui-FG:#000;--weui-FG-5:rgba(0,0,0,0.05);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.8);--weui-FG-0_5:hsla(0,0%,100%,0.6);--weui-FG-1:hsla(0,0%,100%,0.5);--weui-FG-2:hsla(0,0%,100%,0.3);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.8);--weui-GLYPH-1:hsla(0,0%,100%,0.5);--weui-GLYPH-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:rgba(95,95,95,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.1);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.6);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG:#fff;--weui-BG:#000;--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6)}}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.8);--weui-FG-0_5:hsla(0,0%,100%,0.6);--weui-FG-1:hsla(0,0%,100%,0.5);--weui-FG-2:hsla(0,0%,100%,0.3);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.8);--weui-GLYPH-1:hsla(0,0%,100%,0.5);--weui-GLYPH-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:rgba(95,95,95,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.1);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.6);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG:#fff;--weui-BG:#000;--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6)}.wx-root[data-weui-mode=care],body[data-weui-mode=care]{--weui-BG-0:#ededed;--weui-BG-1:#f7f7f7;--weui-BG-2:#fff;--weui-BG-3:#f7f7f7;--weui-BG-4:#4c4c4c;--weui-BG-5:#fff;--weui-BLUE-100:#007dbb;--weui-BLUE-120:#3fbeff;--weui-BLUE-170:#b7e6ff;--weui-BLUE-80:#0c8bcc;--weui-BLUE-90:#0e9ce6;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#5aafe4;--weui-BLUE-BG-130:#7fc0ea;--weui-BLUE-BG-90:#4095cb;--weui-BRAND-100:#018942;--weui-BRAND-120:#38cd7f;--weui-BRAND-170:#b4ecce;--weui-BRAND-80:#059a4c;--weui-BRAND-90:#06ae56;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#3eb575;--weui-BRAND-BG-130:#69c694;--weui-BRAND-BG-90:#259c5c;--weui-FG-0:#000;--weui-FG-0_5:#000;--weui-FG-1:rgba(0,0,0,0.6);--weui-FG-2:rgba(0,0,0,0.42);--weui-FG-3:rgba(0,0,0,0.1);--weui-FG-4:rgba(0,0,0,0.15);--weui-GLYPH-0:#000;--weui-GLYPH-1:rgba(0,0,0,0.6);--weui-GLYPH-2:rgba(0,0,0,0.42);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#4f8400;--weui-GREEN-120:#a7db33;--weui-GREEN-170:#def1b3;--weui-GREEN-80:#74a800;--weui-GREEN-90:#82bd00;--weui-GREEN-BG-100:#96be40;--weui-GREEN-BG-110:#a0c452;--weui-GREEN-BG-130:#b5d179;--weui-GREEN-BG-90:#86aa39;--weui-INDIGO-100:#0075e2;--weui-INDIGO-120:#439df1;--weui-INDIGO-170:#b8daf9;--weui-INDIGO-80:#106abe;--weui-INDIGO-90:#1277d6;--weui-INDIGO-BG-100:#2b77bf;--weui-INDIGO-BG-110:#3f84c5;--weui-INDIGO-BG-130:#6ba0d2;--weui-INDIGO-BG-90:#266aab;--weui-LIGHTGREEN-100:#2e8800;--weui-LIGHTGREEN-120:#aaef87;--weui-LIGHTGREEN-170:#def9d1;--weui-LIGHTGREEN-80:#77bc54;--weui-LIGHTGREEN-90:#85d35e;--weui-LIGHTGREEN-BG-100:#72cf60;--weui-LIGHTGREEN-BG-110:#80d370;--weui-LIGHTGREEN-BG-130:#9cdd90;--weui-LIGHTGREEN-BG-90:#66b956;--weui-LINK-100:#576b95;--weui-LINK-120:#7888aa;--weui-LINK-170:#ccd2de;--weui-LINK-80:#455577;--weui-LINK-90:#4e6085;--weui-LINKFINDER-100:#002666;--weui-MATERIAL-ATTACHMENTCOLUMN:hsla(0,0%,96.1%,0.95);--weui-MATERIAL-NAVIGATIONBAR:hsla(0,0%,92.9%,0.94);--weui-MATERIAL-REGULAR:hsla(0,0%,96.9%,0.3);--weui-MATERIAL-THICK:hsla(0,0%,96.9%,0.8);--weui-MATERIAL-THIN:hsla(0,0%,100%,0.2);--weui-MATERIAL-TOOLBAR:hsla(0,0%,96.5%,0.82);--weui-ORANGE-100:#e17719;--weui-ORANGE-120:#fbb062;--weui-ORANGE-170:#fde1c3;--weui-ORANGE-80:#c87d2f;--weui-ORANGE-90:#e08c34;--weui-ORANGE-BG-100:#ea7800;--weui-ORANGE-BG-110:#ec8519;--weui-ORANGE-BG-130:#f0a04d;--weui-ORANGE-BG-90:#d26b00;--weui-ORANGERED-100:#d14730;--weui-OVERLAY:rgba(0,0,0,0.5);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#6265f1;--weui-PURPLE-120:#8385f3;--weui-PURPLE-170:#d0d1fa;--weui-PURPLE-80:#5052c0;--weui-PURPLE-90:#595cd7;--weui-PURPLE-BG-100:#6769ba;--weui-PURPLE-BG-110:#7678c1;--weui-PURPLE-BG-130:#9496ce;--weui-PURPLE-BG-90:#5c5ea7;--weui-RED-100:#dc3636;--weui-RED-120:#fb7373;--weui-RED-170:#fdcaca;--weui-RED-80:#c84040;--weui-RED-90:#e14949;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#d3625a;--weui-RED-BG-130:#dd847e;--weui-RED-BG-90:#b94840;--weui-SECONDARY-BG:rgba(0,0,0,0.1);--weui-SEPARATOR-0:rgba(0,0,0,0.1);--weui-SEPARATOR-1:rgba(0,0,0,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:rgba(0,0,0,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:rgba(0,0,0,0.2);--weui-YELLOW-100:#bb8e00;--weui-YELLOW-120:#ffcf33;--weui-YELLOW-170:#ffecb2;--weui-YELLOW-80:#cc9c00;--weui-YELLOW-90:#e6af00;--weui-YELLOW-BG-100:#efb600;--weui-YELLOW-BG-110:#f0bd19;--weui-YELLOW-BG-130:#f3cc4d;--weui-YELLOW-BG-90:#d7a400;--weui-FG-HALF:#000;--weui-RED:#dc3636;--weui-ORANGERED:#d14730;--weui-ORANGE:#e17719;--weui-YELLOW:#bb8e00;--weui-GREEN:#4f8400;--weui-LIGHTGREEN:#2e8800;--weui-TEXTGREEN:#06ae56;--weui-BRAND:#018942;--weui-BLUE:#007dbb;--weui-INDIGO:#0075e2;--weui-PURPLE:#6265f1;--weui-LINK:#576b95;--weui-TAG-TEXT-ORANGE:#e17719;--weui-TAG-TEXT-GREEN:#06ae56;--weui-TAG-TEXT-BLUE:#007dbb;--weui-REDORANGE:#d14730;--weui-TAG-TEXT-BLACK:rgba(0,0,0,0.5);--weui-WHITE:#fff;--weui-BG:#fff;--weui-FG:#000;--weui-FG-5:rgba(0,0,0,0.05);--weui-TAG-BACKGROUND-ORANGE:rgba(225,119,25,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(0,125,187,0.1);--weui-TAG-BACKGROUND-BLACK:rgba(0,0,0,0.05)}@media (prefers-color-scheme:dark){.wx-root[data-weui-mode=care]:not([data-weui-theme=light]),body[data-weui-mode=care]:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.85);--weui-FG-0_5:hsla(0,0%,100%,0.65);--weui-FG-1:hsla(0,0%,100%,0.55);--weui-FG-2:hsla(0,0%,100%,0.35);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.85);--weui-GLYPH-1:hsla(0,0%,100%,0.55);--weui-GLYPH-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:hsla(0,0%,96.1%,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.15);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.65);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-FG:#fff;--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-BG:#000;--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5)}}.wx-root[data-weui-mode=care][data-weui-theme=dark],body[data-weui-mode=care][data-weui-theme=dark]{--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.85);--weui-FG-0_5:hsla(0,0%,100%,0.65);--weui-FG-1:hsla(0,0%,100%,0.55);--weui-FG-2:hsla(0,0%,100%,0.35);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.85);--weui-GLYPH-1:hsla(0,0%,100%,0.55);--weui-GLYPH-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:hsla(0,0%,96.1%,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.15);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.65);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-FG:#fff;--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-BG:#000;--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5)}.wx-root{pointer-events:auto;font-family:system-ui,-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Hiragino Sans GB,Microsoft YaHei UI,Microsoft YaHei,Arial,sans-serif}.wx-root,.wx_card_root{position:relative}.wxw_hide{display:none!important}.wx_uninteractive{pointer-events:none}.wx-root,body{--APPMSGCARD-BG:#fafafa}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--APPMSGCARD-BG:#1e1e1e}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--APPMSGCARD-BG:#1e1e1e}}.wx-root,body{--APPMSGCARD-LINE-BG:rgba(0,0,0,0.07)}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--APPMSGCARD-LINE-BG:hsla(0,0%,100%,0.07)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--APPMSGCARD-LINE-BG:hsla(0,0%,100%,0.07)}}.appmsg_card_context{position:relative;background-color:var(--APPMSGCARD-BG);border-radius:8px;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}:host(.wx_tap_highlight_active) .wx_tap_link{opacity:.5}:host(.wx_tap_highlight_active) .wx_tap_card{background-color:#f3f3f3}:host(.wx_tap_highlight_active) .wx_tap_cell{background-color:rgba(0,0,0,.05)}@media (prefers-color-scheme:dark){:host(.wx_tap_highlight_active) .wx_tap_card{background-color:#252525}:host(.wx_tap_highlight_active) .wx_tap_cell{background-color:hsla(0,0%,100%,.1)}}.wx_css_active :active{opacity:.5}.weui-flex__item{min-width:0}.weui-flex_align-center{align-items:center}[tabindex]{outline:0}.wx_hover_card:before{border-radius:8px;border:1px solid rgba(7,193,96,.3)}.wx_hover_card:before,.wx_selected_card:before{content:" ";position:absolute;top:0;left:0;right:0;bottom:0;box-sizing:border-box;pointer-events:none;z-index:9}.wx_selected_card:before{border-radius:8px;border:1.5px solid #07c160;background:rgba(7,193,96,.1)}img{pointer-events:none}.wx_profile_card{line-height:1.4;text-align:left;text-decoration:none;clear:both;position:relative}.wx_profile_card_ft{padding:8px 16px;align-items:center;position:relative;color:var(--weui-FG-2);font-size:14px}.wx_profile_card_ft:before{content:"";content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--APPMSGCARD-LINE-BG);color:var(--APPMSGCARD-LINE-BG);transform-origin:0 0;transform:scaleY(.5);left:16px;right:16px}.wx_profile_msg{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;z-index:1;background:hsla(0,0%,100%,.5);font-size:14px;font-weight:400}.common-web{margin:0 auto;max-width:350px}.wx_card_disabled .wx_profile_card_bd{filter:blur(2px)}.wx_profile{padding:20px 16px}.wx_profile .weui-icon-arrow{width:1em;height:2em}.wx_profile_hd{display:flex;padding-right:10px}.wx_profile_hd .wx_profile_avatar{width:44px;height:44px!important;border-radius:100%}.wx_profile_ft{padding-left:10px}.wx_profile_bd{align-items:center}.wx_profile_bd>.weui-flex__item{padding-right:16px}.wx_profile_nickname{display:inline-block;flex-shrink:1;color:var(--weui-FG-0);font-weight:500}.wx_profile_desc{width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.wx_profile_desc,.wx_profile_tips{color:var(--weui-FG-1);font-size:14px;margin-top:4px}.wx_profile_tips{display:flex;min-height:1.4em}.wx_profile_tips:empty{display:none}.wx_profile_nickname_wrp{position:relative;display:flex;flex-direction:row;align-items:center;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;font-size:17px;line-height:1.2;font-weight:500}.wx_follow_verify{flex-shrink:0;height:14px;width:14px;margin-left:2px;background-size:cover;background-position:50%;background-repeat:no-repeat}.wx_follow_verify.show-verify-personal{display:block;background-image:url(https://res.wx.qq.com/op_res/nLnAiLrrETuU96Aym1ZDNuddJ2beY0iOs-D3h-7MPQeIIoXE5kLrgfPY_Vr_hrKamxAjISc12pBthrd7Ja4S4w)}.wx_follow_verify.show-verify-company{display:block;background-image:url(https://res.wx.qq.com/op_res/nLnAiLrrETuU96Aym1ZDNjhMga6Fe1hiYp332DlZsT_u4THJyu8XegVlG723G5FblhAwxLO31iFVMkzq62jS3w)}.wx_follow_verify.show-verify-media{display:block;background-image:url(https://res.wx.qq.com/op_res/n1-Xym4hWn0AbVImOFGmT9sRdHV1rjoe3lnMHwxRdfbguJjDQH16CE7AIfDZy1KVMHWCPJIoAC4jrMEFqmqR4A)}</style>
630
+ <div role="option" tabindex="0"
631
+ aria-labelledby="js_a11y_wx_profile_nickname js_a11y_comma js_a11y_wx_profile_desc js_a11y_comma0 js_a11y_wx_profile_tips js_a11y_comma1 js_a11y_wx_profile_logo"
632
+ class="appmsg_card_context wx_profile_card wx-root wx_tap_card wx_card_root common-web"
633
+ data-weui-theme="light">
634
+ <div class="wx_profile_card_inner">
635
+ <div class="wx_profile_card_bd" aria-hidden="true">
636
+ <div class="wx_profile weui-flex">
637
+ <div class="wx_profile_hd">
638
+ <img src="${o}" alt="" class="wx_profile_avatar">
639
+ </div>
640
+ <div class="wx_profile_bd weui-flex weui-flex__item">
641
+ <div class="weui-flex__item">
642
+ <div class="wx_profile_nickname_wrp">
643
+ <strong id="js_a11y_wx_profile_nickname" class="wx_profile_nickname">${e}</strong>
644
+ <span class="wx_follow_verify ${s==="1"?"show-verify-personal":s==="2"?"show-verify-company":""}"></span>
645
+ </div>
646
+ <div id="js_a11y_wx_profile_desc" class="wx_profile_desc">${a}</div>
647
+ </div>
648
+ <i class="weui-icon-arrow"></i>
649
+ </div>
650
+ </div>
651
+ </div>
652
+ <div id="js_a11y_wx_profile_logo" aria-hidden="true" class="wx_profile_card_ft">
653
+ ${n==="1"?"公众号":"服务号"}
654
+ </div>
655
+ </div>
656
+ <span aria-hidden="true" id="js_a11y_comma" class="weui-a11y_ref" style="display: none;">,</span>
657
+ </div>
658
+ `}}function setupComponents(){customElements.define("mp-common-profile",MpCommonProfile)}initializeMermaid().catch(console.error);setupComponents();const app=createApp(_sfc_main);app.use(createPinia());app.mount("#app");const isInExtension=typeof chrome<"u"&&chrome.runtime&&chrome.runtime.id;async function getCurrentTab(){const t={active:!0,lastFocusedWindow:!0};if(typeof browser<"u"&&browser.tabs&&browser.tabs.query){const[o]=await browser.tabs.query(t);return o}const[e]=await chrome.tabs.query(t);return e}window.addEventListener("copyToMp",t=>{const e=t;isInExtension&&getCurrentTab().then(o=>{chrome.tabs.sendMessage(o.id,{type:"copyToMp",content:e.detail.content})})});