bto-md-editor 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/Editor/components/Header/components/Theme/index.vue.d.ts +2 -0
- package/dist/lib/Editor/components/Header/components/index.d.ts +1 -0
- package/dist/lib/Editor/components/Outline/index.vue.d.ts +0 -1
- package/dist/lib/theme.d.ts +4 -0
- package/dist/md-editor.es.js +2246 -2116
- package/dist/md-editor.umd.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/md-editor.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.font-size-wrapper[data-v-87f86dca]{position:relative;-webkit-user-select:none;user-select:none}.font-size-wrapper .icon[data-v-87f86dca]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:var(--bg-base)}.font-size-wrapper .icon[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.font-size-wrapper .label[data-v-87f86dca]{font-size:15px}.dropdown[data-v-87f86dca]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-87f86dca],.dropdown-slide-leave-to[data-v-87f86dca]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-87f86dca],.dropdown-slide-leave-active[data-v-87f86dca]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-87f86dca]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.text[data-v-87f86dca]{flex:1}.color-select-wrapper[data-v-1656be6b]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.icon[data-v-1656be6b]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-1656be6b]{width:auto;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-1656be6b]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-1656be6b]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:2px;cursor:pointer}.hoverable[data-v-1656be6b]:hover{background:var(--hover-bg-color)}.underline[data-v-1656be6b]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-1656be6b]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform;border:1px solid var(--border-color)}.dropdown-slide-enter-from[data-v-1656be6b],.dropdown-slide-leave-to[data-v-1656be6b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-1656be6b],.dropdown-slide-leave-active[data-v-1656be6b]{transition:opacity .18s ease,transform .18s ease}.section[data-v-1656be6b]{margin-bottom:8px}.section-title[data-v-1656be6b]{font-size:12px;margin-bottom:6px}.swatches[data-v-1656be6b]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-1656be6b]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-1656be6b]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid var(--border-color);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-1656be6b]{position:absolute;top:0;right:2px;font-size:12px;color:var(--text-base);text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-1656be6b]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-1656be6b]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px;color:var(--text-base)}.advanced[data-v-1656be6b]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-1656be6b]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-1656be6b]{justify-self:end;flex-shrink:1}.svg-icon[data-v-ee8563cd]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-ee8563cd]{width:1em;height:1em;display:block}.bg-color-select-wrapper[data-v-f414a9de]{position:relative;-webkit-user-select:none;user-select:none}.icon[data-v-f414a9de]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-f414a9de]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-f414a9de]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-f414a9de]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-f414a9de]:hover{background:var(--hover-bg-color)}.underline[data-v-f414a9de]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-f414a9de]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-f414a9de]{margin-bottom:8px}.section-title[data-v-f414a9de]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-f414a9de]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-f414a9de]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-f414a9de]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-f414a9de]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-f414a9de]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-f414a9de]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px}.advanced[data-v-f414a9de]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-f414a9de]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-f414a9de]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-f414a9de],.dropdown-slide-leave-to[data-v-f414a9de]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f414a9de],.dropdown-slide-leave-active[data-v-f414a9de]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-dad55a02]{position:relative}.image-input-panel[data-v-dad55a02]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-dad55a02]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:4px;outline:none;font-size:14px;background-color:var(--bg-input-bg);color:var(--text-base)}.image-actions[data-v-dad55a02]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-dad55a02]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-dad55a02]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-dad55a02]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-dad55a02]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-dad55a02],.img-panel-leave-active[data-v-dad55a02]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-dad55a02],.img-panel-leave-to[data-v-dad55a02]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-dad55a02],.img-panel-leave-from[data-v-dad55a02]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-582dbd57]{position:relative}.video-input-panel[data-v-582dbd57]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-582dbd57]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:2px;outline:none;font-size:14px;background-color:var(--bg-input-bg);color:var(--text-base)}.video-actions[data-v-582dbd57]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-582dbd57]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-582dbd57]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-582dbd57]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-582dbd57]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-582dbd57],.video-panel-leave-active[data-v-582dbd57]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-582dbd57],.video-panel-leave-to[data-v-582dbd57]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-582dbd57],.video-panel-leave-from[data-v-582dbd57]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-8c079e6d]{position:relative}.find-input-panel[data-v-8c079e6d]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.fr-header[data-v-8c079e6d]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-8c079e6d]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent;color:var(--text-base)}.fr-tab.active[data-v-8c079e6d]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-8c079e6d]{display:block;font-size:12px;margin:6px 0 4px}.fr-input-row[data-v-8c079e6d]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-8c079e6d]{flex:1;padding:8px;border:1px solid var(--border-color);border-radius:2px;background-color:var(--bg-input-bg);color:var(--text-base);outline:none}.fr-count[data-v-8c079e6d]{font-size:12px}.fr-actions[data-v-8c079e6d]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-8c079e6d]{padding:6px 10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;color:var(--text-base)}.fr-btn.primary[data-v-8c079e6d]{color:var(--text-base);background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-8c079e6d],.find-panel-leave-active[data-v-8c079e6d]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-8c079e6d],.find-panel-leave-to[data-v-8c079e6d]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-8c079e6d],.find-panel-leave-from[data-v-8c079e6d]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-84f547ec]{position:relative}.link-input-panel[data-v-84f547ec]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-84f547ec]{margin-bottom:8px}.label[data-v-84f547ec]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-84f547ec]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-84f547ec]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-84f547ec]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-84f547ec]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-84f547ec]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-84f547ec],.link-panel-leave-active[data-v-84f547ec]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-84f547ec],.link-panel-leave-to[data-v-84f547ec]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-84f547ec],.link-panel-leave-from[data-v-84f547ec]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-d0d98332]{position:relative}.table-panel[data-v-d0d98332]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-d0d98332]{font-size:12px;margin-bottom:6px}.grid[data-v-d0d98332]{display:flex;flex-direction:column;gap:4px;background:var(--bg-base);border-radius:2px}.row[data-v-d0d98332]{display:flex;gap:4px}.cell[data-v-d0d98332]{width:18px;height:18px;background:var(--bg-base);border:1px solid var(--border-color);border-radius:3px;cursor:pointer}.cell.active[data-v-d0d98332]{background:#e8f1ff;border-color:#1677ff}.size[data-v-d0d98332]{margin-top:6px;font-size:12px}.table-tools[data-v-1aa3a259]{position:relative}.tools-panel[data-v-1aa3a259]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;border:1px solid var(--border-color)}.tools-grid[data-v-1aa3a259]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-1aa3a259]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.icon[data-v-0a1c80da]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-0a1c80da]:hover{background:#0000000d}.icon[data-v-dcd9c3cd]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon[data-v-dcd9c3cd]:hover{background:#0000000d}.heading-select[data-v-b93823aa]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-b93823aa]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:52px;justify-content:space-between;background:var(--bg-base)}.icon[data-v-b93823aa]:hover{background:var(--hover-bg-color)}.label[data-v-b93823aa]{font-size:15px;color:var(--text-base)}.dropdown[data-v-b93823aa]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-b93823aa],.dropdown-slide-leave-to[data-v-b93823aa]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b93823aa],.dropdown-slide-leave-active[data-v-b93823aa]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-b93823aa]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-b93823aa]:hover{background:#0000000d}.item-label[data-v-b93823aa]{flex:1}.item-label.paragraph[data-v-b93823aa]{font-size:15px}.item-label.level-1[data-v-b93823aa]{font-size:22px;font-weight:600}.item-label.level-2[data-v-b93823aa]{font-size:20px;font-weight:600}.item-label.level-3[data-v-b93823aa]{font-size:18px;font-weight:600}.item-label.level-4[data-v-b93823aa]{font-size:16px}.item-label.level-5[data-v-b93823aa]{font-size:15px}.item-label.level-6[data-v-b93823aa]{font-size:14px}.shortcut[data-v-b93823aa]{font-size:12px}.align-select[data-v-b321e2b4]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-b321e2b4]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:var(--bg-base);gap:3px}.icon_box[data-v-b321e2b4]:hover{background:var(--hover-bg-color)}.dropdown[data-v-b321e2b4]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-b321e2b4],.dropdown-slide-leave-to[data-v-b321e2b4]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b321e2b4],.dropdown-slide-leave-active[data-v-b321e2b4]{transition:opacity .18s ease,transform .18s ease}.options[data-v-b321e2b4]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-b321e2b4]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-b321e2b4]:hover,.option.active[data-v-b321e2b4]{background:var(--hover-bg-color)}.header_box[data-v-8a946786]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid var(--border-color)}.header_box.disabled[data-v-8a946786]{pointer-events:none;opacity:.5}.header_box .icon[data-v-8a946786]{position:relative;cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out}.header_box .icon[data-v-8a946786]:hover,.header_box .icon.active[data-v-8a946786]{background:var(--hover-bg-color)}.header_box .icon[aria-disabled=true][data-v-8a946786]{cursor:not-allowed;opacity:.5}.header_box.dark[data-v-8a946786] .heading-select .label,.header_box.dark[data-v-8a946786] .font-size .label{color:#e5e7eb}.header_box.dark[data-v-8a946786] .heading-select .dropdown,.header_box.dark[data-v-8a946786] .font-size .dropdown{background:#1f1f21;border-color:#334155;box-shadow:none}.header_box.dark[data-v-8a946786] .dropdown-item:hover{background:#ffffff0f}.header_box.dark[data-v-8a946786] .heading-select .item-label,.header_box.dark[data-v-8a946786] .font-size .text,.header_box.dark[data-v-8a946786] .heading-select .shortcut{color:#e5e7eb}.header_box.dark[data-v-8a946786] .color-select .icon-dropdown,.header_box.dark[data-v-8a946786] .bg-color-select .icon-dropdown,.header_box.dark[data-v-8a946786] .align-select .icon_box,.header_box.dark[data-v-8a946786] .bg-color-select .underline{background:#1f1f21;border:1px solid #334155}.header_box.dark[data-v-8a946786] .bg-color-select .dropdown .swatch[style*=dashed]{border-color:#334155!important}.header_box.dark[data-v-8a946786] .color-select .hoverable:hover,.header_box.dark[data-v-8a946786] .bg-color-select .hoverable:hover,.header_box.dark[data-v-8a946786] .align-select .icon_box:hover{background:#ffffff0f}.header_box.dark[data-v-8a946786] .color-select .dropdown,.header_box.dark[data-v-8a946786] .bg-color-select .dropdown,.header_box.dark[data-v-8a946786] .align-select .dropdown{background:#1f1f21;border:1px solid #334155;box-shadow:none}.header_box.dark[data-v-8a946786] .align-select .option:hover{background:#ffffff0f}.header_box.dark[data-v-8a946786] .align-select .option.active{background:#ffffff1a}.header_box.dark[data-v-8a946786] .color-select .section-title,.header_box.dark[data-v-8a946786] .bg-color-select .section-title{color:#94a3b8}.header_box.dark[data-v-8a946786] .color-select .btn,.header_box.dark[data-v-8a946786] .bg-color-select .btn,.header_box.dark[data-v-8a946786] .color-select .hex,.header_box.dark[data-v-8a946786] .bg-color-select .hex{background:#1f1f21;border-color:#334155;color:#e5e7eb}.header_box.dark[data-v-8a946786] .color-select .swatch,.header_box.dark[data-v-8a946786] .bg-color-select .swatch{border-color:#ffffff14}.header_box.dark[data-v-8a946786] .color-select .swatch .check,.header_box.dark[data-v-8a946786] .bg-color-select .swatch .check{color:#fff;text-shadow:none}.outline-wrapper[data-v-64d05f68]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-64d05f68]{border-left:1px solid var(--border-color);padding:8px;box-sizing:border-box;font-size:14px;position:sticky;top:0;align-self:start;height:100%;background:var(--bg-base);display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-64d05f68]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid var(--border-color)}.outline__listWrap[data-v-64d05f68]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-64d05f68]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-64d05f68]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-64d05f68]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-64d05f68]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-64d05f68]>*{display:inline-flex;gap:6px}.outline__list[data-v-64d05f68]{list-style:none;padding:0;margin:0}.outline__item[data-v-64d05f68]{cursor:pointer;padding:4px 0;color:#333}.outline.dark .outline__item[data-v-64d05f68]{color:#e5e7eb}.outline__caret[data-v-64d05f68]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline.dark .outline__caret[data-v-64d05f68]{color:#94a3b8}.outline__caret.collapsed[data-v-64d05f68]{transform:rotate(0)}.outline__caret.expanded[data-v-64d05f68]{transform:rotate(90deg)}.outline__item[data-v-64d05f68]:hover{color:#1a69f8}.outline.dark .outline__item[data-v-64d05f68]:hover{color:#22c55e}.outline__item.lv-1[data-v-64d05f68]{padding-left:0}.outline__item.lv-2[data-v-64d05f68]{padding-left:8px}.outline__item.lv-3[data-v-64d05f68]{padding-left:16px}.outline__item.lv-4[data-v-64d05f68]{padding-left:24px}.outline__item.lv-5[data-v-64d05f68]{padding-left:32px}.outline__item.lv-6[data-v-64d05f68]{padding-left:40px}.outline__text[data-v-64d05f68]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-64d05f68]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline.dark .outline__close[data-v-64d05f68]{background:#1f1f21;border-color:#334155;color:#94a3b8;box-shadow:none}.outline__close[data-v-64d05f68]:hover{color:var(--hover-text-color)}.outline__title[data-v-64d05f68]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-64d05f68]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-64d05f68]{display:none}@media (max-width: 900px){.outline[data-v-64d05f68]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-64d05f68]{width:min(85vw,280px)}.outline-drawer-mask[data-v-64d05f68]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-64d05f68],.outline-slide-leave-active[data-v-64d05f68]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-64d05f68],.outline-slide-leave-to[data-v-64d05f68]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-64d05f68],.outline-slide-leave-to[data-v-64d05f68]{transform:translate(100%)}}.outline-mask-enter-active[data-v-64d05f68],.outline-mask-leave-active[data-v-64d05f68]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-64d05f68],.outline-mask-leave-to[data-v-64d05f68]{opacity:0}.simple-editor[data-v-0dda272d]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:2px;background:var(--bg-base);box-sizing:border-box;border:1px solid var(--border-color)}.simple-editor .fullscreen[data-v-0dda272d]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-handle{pointer-events:none;display:none}.simple-editor.readonly[data-v-0dda272d] img,.simple-editor.readonly[data-v-0dda272d] video{-webkit-user-drag:none}.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-wrapper,.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-container{outline:none!important;border:none!important;width:100%!important;max-width:100%!important}.simple-editor.readonly[data-v-0dda272d] .tiptap-video{width:100%!important;max-width:100%!important}.editor_wrapper[data-v-0dda272d]{position:relative;overflow-y:auto;overflow-x:hidden;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-0dda272d]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-0dda272d]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-0dda272d]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-0dda272d]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-0dda272d]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-0dda272d]{background:#22c55e}.content[data-v-0dda272d]{padding:12px 24px;color:var(--text-base)}.content[data-v-0dda272d] img{max-width:100%;height:auto;display:inline-block}.content[data-v-0dda272d] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-0dda272d] .tiptap-resize-container,.content[data-v-0dda272d] .tiptap-resize-wrapper{max-width:100%!important;box-sizing:border-box}.content[data-v-0dda272d] .tiptap-video{max-width:100%!important;height:auto!important;display:block}.content[data-v-0dda272d] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-0dda272d] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-0dda272d .18s ease both}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-0dda272d .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-0dda272d{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-0dda272d{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);margin-top:2px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-0dda272d] img.ProseMirror-selectednode{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-0dda272d] [data-resize-wrapper]{display:inline-block}.content[data-v-0dda272d] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-0dda272d] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-0dda272d] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-0dda272d] .tiptap-resize-wrapper:hover>img,.content[data-v-0dda272d] .tiptap-resize-wrapper:hover>video{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-0dda272d] .tiptap-resize-wrapper{position:relative}.content[data-v-0dda272d] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-0dda272d] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-0dda272d] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-0dda272d] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-0dda272d] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-0dda272d 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-0dda272d{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-0dda272d] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-0dda272d] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-0dda272d] .ProseMirror table th,.content[data-v-0dda272d] .ProseMirror table td{border:1px solid var(--border-color);padding:8px;text-align:left;position:relative}.content[data-v-0dda272d] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content .simple-editor.dark[data-v-0dda272d] .ProseMirror table thead th{background:#111827}.content[data-v-0dda272d] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-0dda272d] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-0dda272d] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-0dda272d] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-0dda272d] code{background:var(--code-bg);padding:2px 4px;border-radius:4px}.content[data-v-0dda272d] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-0dda272d] pre{background:var(--code-bg);padding:12px;border-radius:6px;border:1px solid var(--border-color);overflow:auto}.content[data-v-0dda272d] p{margin:12px 0}[data-v-0dda272d] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid var(--border-color);cursor:grab;z-index:5}[data-v-0dda272d] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-0dda272d]{grid-template-columns:1fr}.outline-markers[data-v-0dda272d]{display:none}}.link-modal-backdrop[data-v-0dda272d]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-0dda272d]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-0dda272d]{background:#fff;border:1px solid var(--border-color);border-radius:2px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.simple-editor.dark .link-modal__content[data-v-0dda272d]{background:#1f1f21;border-color:#334155;box-shadow:none;color:#e5e7eb}.link-modal__title[data-v-0dda272d]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-0dda272d]{width:100%;padding:8px;border:1px solid var(--border-color);border-radius:2px;margin-bottom:10px}.simple-editor.dark .link-modal__input[data-v-0dda272d]{background:#0b1220;border-color:#334155;color:#e5e7eb}.link-modal__actions[data-v-0dda272d]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-0dda272d]{padding:6px 10px;border:1px solid var(--border-color);background:#fff;border-radius:2px;cursor:pointer}.simple-editor.dark .link-modal__actions button[data-v-0dda272d]{background:#1f1f21;border-color:#334155;color:#e5e7eb}.tiptap-video[data-v-0dda272d]{display:block;max-width:100%;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(P,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tiptap/vue-3"),require("@tiptap/starter-kit"),require("@tiptap/markdown"),require("@tiptap/extension-image"),require("@tiptap/core"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-link"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/extension-color"),require("@tiptap/extension-underline"),require("@tiptap/extension-table"),require("@tiptap/extensions"),require("@tiptap/extension-list")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/vue-3","@tiptap/starter-kit","@tiptap/markdown","@tiptap/extension-image","@tiptap/core","@tiptap/extension-placeholder","@tiptap/extension-link","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/extension-color","@tiptap/extension-underline","@tiptap/extension-table","@tiptap/extensions","@tiptap/extension-list"],e):(P=typeof globalThis<"u"?globalThis:P||self,e(P.MdEditor={},P.Vue,P.tiptapVue3,P.StarterKit,P.tiptapMarkdown,P.tiptapImage,P.tiptapCore,P.tiptapPlaceholder,P.tiptapLink,P.tiptapTextAlign,P.tiptapTextStyle,P.tiptapColor,P.tiptapUnderline,P.tiptapTable,P.extensions,P.extensionList))})(this,function(P,e,ve,He,Ue,je,ke,Ie,Oe,We,we,Re,Pe,Me,Ge,Be){"use strict";var Fe;function qe(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(c,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return c.default=t,Object.freeze(c)}const Ce=qe(ke),Ye=je.Image.extend({draggable:!1,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:c=>c.getAttribute("data-uploading")?!0:null,renderHTML:c=>c.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:c=>{const r=c.getAttribute("width")||c.style.width||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:c=>c.width?{width:c.width}:{}},height:{default:null,parseHTML:c=>{const r=c.getAttribute("height")||c.style.height||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:c=>c.height?{height:c.height}:{}}}},addNodeView(){return({node:t,getPos:c,editor:r})=>{const n=document.createElement("img"),a=t.attrs;n.src=a.src||"",a.alt&&(n.alt=a.alt),a.title&&(n.title=a.title),typeof a.width=="number"&&(n.style.width=`${a.width}px`),typeof a.height=="number"&&(n.style.height=`${a.height}px`),n.style.maxWidth="100%",n.style.height=n.style.height||"auto",n.style.display="inline-block";const i=new ke.ResizableNodeView({element:n,node:t,getPos:c,onResize:(f,N)=>{n.style.width=`${f}px`,n.style.height=`${N}px`},onCommit:(f,N)=>{try{const x=r,m=c();if(m!==void 0){const{state:E}=x,y=E.schema.nodes.image,k=E.doc.nodeAt(m);if(y&&k){const d={...k.attrs||{},width:f,height:N},s=E.tr.setNodeMarkup(m,y,d,k.marks);x.view.dispatch(s)}}}catch{}},onUpdate:f=>{const N=f.attrs;return typeof N.src=="string"&&N.src&&n.src!==N.src&&(n.src=N.src),typeof N.width=="number"&&(n.style.width=`${N.width}px`),typeof N.height=="number"&&(n.style.height=`${N.height}px`),N.uploading?i.wrapper.setAttribute("data-uploading","true"):i.wrapper.removeAttribute("data-uploading"),!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:32,height:32},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});n.addEventListener("dragstart",f=>{const N=r;if(!(N!=null&&N.isEditable))try{f.preventDefault()}catch{}});try{n.setAttribute("draggable","false"),i.wrapper.setAttribute("draggable","false"),i.container.setAttribute("draggable","false"),i.container.style.display="inline-block",i.wrapper.style.display="inline-block"}catch{}const C=document.createElement("div");C.className="tiptap-upload-mask";const p=document.createElement("div");return p.className="tiptap-upload-progress",C.appendChild(p),i.wrapper.appendChild(C),a.uploading&&i.wrapper.setAttribute("data-uploading","true"),i}}}),Ke=Me.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:c=>c.getAttribute("data-background-color"),renderHTML:c=>{const r=c.backgroundColor;return r?{"data-background-color":r,style:`background-color: ${r}`}:{}}}}}}),Je=(((Fe=Ce==null?void 0:Ce.Node)==null?void 0:Fe.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!1,selectable:!0,addAttributes(){return{src:{default:null},controls:{default:!0},autoplay:{default:!1},loop:{default:!1},muted:{default:!1},poster:{default:null},playsinline:{default:!0},uploading:{default:null,parseHTML:t=>t.getAttribute("data-uploading")?!0:null,renderHTML:t=>t.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:t=>{const c=t.getAttribute("width")||t.style.width||"",r=String(c).match(/^(\d+)(px)?$/);return r?Number(r[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const c=t.getAttribute("height")||t.style.height||"",r=String(c).match(/^(\d+)(px)?$/);return r?Number(r[1]):null},renderHTML:t=>t.height?{height:t.height}:{}},class:{default:"tiptap-video"}}},parseHTML(){return[{tag:"video[data-tiptap-video]"},{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",{"data-tiptap-video":"",...t}]},renderMarkdown(t){const c=(t==null?void 0:t.attrs)||{},r=typeof c.src=="string"?c.src:"";return r?`[video](${r})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const c=/^\[video\]\(([^)]+)\)/.exec(t);if(c)return{type:"video",raw:c[0],href:c[1]}}},parseMarkdown(t){const c=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return c?{type:"video",attrs:{src:c,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:c,editor:r})=>{var f,N,x,m,E;const n=document.createElement("video"),a=t.attrs;n.src=a.src||"",n.controls=a.controls!==!1,n.autoplay=!1,n.loop=!!a.loop,n.muted=!!a.muted,a.poster&&(n.poster=a.poster),n.setAttribute("playsinline","true"),a.class&&(n.className=String(a.class)),typeof a.width=="number"&&(n.style.width=`${a.width}px`),typeof a.height=="number"&&(n.style.height=`${a.height}px`),n.style.display="inline-block";const i=new ke.ResizableNodeView({element:n,node:t,getPos:c,onResize:(y,k)=>{n.style.width=`${y}px`,n.style.height=`${k}px`},onCommit:(y,k)=>{try{const d=r,s=c();if(s!==void 0){const{state:g}=d,h=g.schema.nodes.video,u=g.doc.nodeAt(s);if(h&&u){const B={...u.attrs||{},width:y,height:k},z=g.tr.setNodeMarkup(s,h,B,u.marks);d.view.dispatch(z)}}}catch{}},onUpdate:y=>{const k=y.attrs||{};if(typeof k.src=="string"&&k.src&&n.src!==k.src&&(n.src=k.src),typeof k.width=="number"&&(n.style.width=`${k.width}px`),typeof k.height=="number"&&(n.style.height=`${k.height}px`),k.uploading){i.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}else i.wrapper.removeAttribute("data-uploading"),n.controls=k.controls!==!1,n.style.pointerEvents="";return!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:120,height:80},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});n.addEventListener("dragstart",y=>{const k=r;if(!(k!=null&&k.isEditable))try{y.preventDefault()}catch{}});try{n.setAttribute("draggable","false"),(N=(f=i==null?void 0:i.wrapper)==null?void 0:f.setAttribute)==null||N.call(f,"draggable","false"),(m=(x=i==null?void 0:i.container)==null?void 0:x.setAttribute)==null||m.call(x,"draggable","false")}catch{}try{i.container.style.display="inline-block",i.wrapper.style.display="inline-block"}catch{}const C=document.createElement("div");C.className="tiptap-upload-mask";const p=document.createElement("div");if(p.className="tiptap-upload-progress",C.appendChild(p),i.wrapper.appendChild(C),(E=t.attrs)!=null&&E.uploading){i.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}return i}},addCommands(){return{setVideo:t=>({chain:c})=>{const{src:r,HTMLAttributes:n={}}=t||{};return c().insertContent({type:this.name,attrs:{src:r,...n}}).run()}}}}),Ze=Be.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:c,getPos:r})=>{const n=document.createElement("li");n.setAttribute("data-type","taskItem"),n.setAttribute("data-checked",t.attrs.checked?"true":"false");const a=document.createElement("span");a.className="todo-box",a.tabIndex=0,a.setAttribute("role","checkbox"),a.setAttribute("aria-checked",t.attrs.checked?"true":"false"),a.addEventListener("mousedown",p=>p.preventDefault());const i=()=>{const p=typeof r=="function"?r():null;if(p==null)return{pos:null,n:null};const f=c.view.state.doc.nodeAt(p);return{pos:p,n:f}};a.addEventListener("click",()=>{var y;const{pos:p,n:f}=i();if(p==null||!f)return;const N=c.view.state,x=N.schema.nodes.taskItem,m=!!((y=f.attrs)!=null&&y.checked),E=N.tr.setNodeMarkup(p,x,{...f.attrs||{},checked:!m});c.view.dispatch(E)}),a.addEventListener("keydown",p=>{var f;if(p.key==="Enter"||p.key===" "){p.preventDefault();const{pos:N,n:x}=i();if(N==null||!x)return;const m=c.view.state,E=m.schema.nodes.taskItem,y=!!((f=x.attrs)!=null&&f.checked),k=m.tr.setNodeMarkup(N,E,{...x.attrs||{},checked:!y});c.view.dispatch(k)}});const C=document.createElement("div");return C.className="task-content",n.appendChild(a),n.appendChild(C),{dom:n,contentDOM:C,update(p){return p.type!==t.type?!1:(n.setAttribute("data-checked",p.attrs.checked?"true":"false"),a.setAttribute("aria-checked",p.attrs.checked?"true":"false"),!0)}}}}});var Xe={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function Qe(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function et(t,c,r){var n=typeof c.fill=="string"?[c.fill]:c.fill||[],a=[],i=c.theme||r.theme;switch(i){case"outline":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("none"),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("none");break;case"filled":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("#FFF"),a.push("#FFF");break;case"two-tone":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone);break;case"multi-color":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.multiColor.outFillColor),a.push(typeof n[2]=="string"?n[2]:r.colors.multiColor.innerStrokeColor),a.push(typeof n[3]=="string"?n[3]:r.colors.multiColor.innerFillColor);break}return{size:c.size||r.size,strokeWidth:c.strokeWidth||r.strokeWidth,strokeLinecap:c.strokeLinecap||r.strokeLinecap,strokeLinejoin:c.strokeLinejoin||r.strokeLinejoin,colors:a,id:t}}var tt=Symbol("icon-context");function te(t,c,r){var n={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(i){var C=Qe(),p=e.inject(tt,Xe);return function(){var f=i.size,N=i.strokeWidth,x=i.strokeLinecap,m=i.strokeLinejoin,E=i.theme,y=i.fill,k=i.spin,d=et(C,{size:f,strokeWidth:N,strokeLinecap:x,strokeLinejoin:m,theme:E,fill:y},p),s=[p.prefix+"-icon"];return s.push(p.prefix+"-icon-"+t),c&&p.rtl&&s.push(p.prefix+"-icon-rtl"),k&&s.push(p.prefix+"-icon-spin"),e.createVNode("span",{class:s.join(" ")},[r(d)])}}};return n}const de=te("check",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M43 11L16.875 37L5 25.1818",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ue=te("down-one",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19L24 31L12 19H36Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null)])}),ot=te("font-size-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M4 44L24 4L44 44",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 28H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),nt=te("full-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6H42V15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 33V42H33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42H6V33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 15V6H15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),rt=te("go-on",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 7L43 13.4615L36 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M40 14H17.0062C10.1232 14 4.27787 19.6204 4.00964 26.5C3.72612 33.7696 9.73291 40 17.0062 40H34.0016",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),it=te("off-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6V15H42",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 6V15H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42V33H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33 42V33H41.8995",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),lt=te("preview-close-one",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 42L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),st=te("return",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),at=te("search",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M21 38C30.3888 38 38 30.3888 38 21C38 11.6112 30.3888 4 21 4C11.6112 4 4 11.6112 4 21C4 30.3888 11.6112 38 21 38Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M26.657 14.3431C25.2093 12.8954 23.2093 12 21.0001 12C18.791 12 16.791 12.8954 15.3433 14.3431",stroke:t.colors[2],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33.2216 33.2217L41.7069 41.707",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ct=te("strikethrough",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M5 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M24 24C40 30 34 44 24 44C13.9999 44 12 36 12 36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M35.9999 12C35.9999 12 33 4 23.9999 4C14.9999 4 11.4359 11.5995 15.6096 18",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 36C12 36 15.9999 44 24 44C32 44 36.564 36.4005 32.3903 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),dt=te("text-bold",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 24C29.5056 24 33.9688 19.5228 33.9688 14C33.9688 8.47715 29.5056 4 24 4H11V24H24Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.0312 44C33.5368 44 38 39.5228 38 34C38 28.4772 33.5368 24 28.0312 24H11V44H28.0312Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ft=te("text-italic",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M20 6H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 42H28",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M29 5.95215L19 41.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),pt=te("text-underline",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M8 44H40",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M37 6.09717C37 12.7638 37 15.3335 37 22.0002C37 29.1799 31.1797 35.0002 24 35.0002C16.8203 35.0002 11 29.1799 11 22.0002C11 15.3335 11 12.7638 11 6.09717",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap},null)])}),mt={class:"label"},ut={key:0,class:"shortcut"},ht=e.defineComponent({__name:"Tooltip",props:{text:{type:String,required:!0},shortcut:{type:String,default:""},placement:{type:String,default:"bottom"},offset:{type:Number,default:6}},setup(t){const c=t,r=e.ref(null),n=e.ref(null),a=e.ref(!1),i=e.ref(c.placement),C=e.ref({top:0,left:0});function p(){const x=r.value,m=n.value;if(!x||!m)return;let E=c.placement;const y=m.getBoundingClientRect(),k=y.top,d=window.innerHeight-y.bottom,s=x.offsetHeight+c.offset;E==="bottom"?d<s&&k>=s&&(E="top"):k<s&&d>=s&&(E="bottom"),i.value=E;const g=y.left+y.width/2,h=E==="bottom"?y.bottom+c.offset:y.top-c.offset-x.offsetHeight;C.value={top:h,left:g}}function f(){a.value=!0,e.nextTick(p)}function N(){a.value=!1}return e.onMounted(()=>{window.addEventListener("resize",p),window.addEventListener("scroll",p,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,!0)}),e.watch(()=>c.text,()=>e.nextTick(p)),(x,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n,class:"tooltip-wrapper",onMouseenter:f,onMouseleave:N,onFocusin:f,onFocusout:N},[e.renderSlot(x.$slots,"default",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"tipRef",ref:r,class:e.normalizeClass(["tooltip",[i.value,{visible:a.value}]]),style:e.normalizeStyle({top:C.value.top+"px",left:C.value.left+"px"})},[e.createElementVNode("div",mt,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],6)]))],544))}}),J=(t,c)=>{const r=t.__vccOpts||t;for(const[n,a]of c)r[n]=a;return r},U=J(ht,[["__scopeId","data-v-2e4633d5"]]),gt=["aria-expanded"],kt={class:"label"},wt={key:0,class:"dropdown",role:"listbox"},Ct=["aria-selected","onClick"],yt={class:"text"},ye="md-toolbar-dropdown-open",Le="font-size-select",xt=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],n=e.computed(()=>{var E,y;const m=(y=(E=c.editor)==null?void 0:E.getAttributes("textStyle"))==null?void 0:y.fontSize;return typeof m=="string"&&m?m:"15px"}),a=e.ref(!1),i=e.ref(null);function C(){a.value||window.dispatchEvent(new CustomEvent(ye,{detail:{id:Le}})),a.value=!a.value}function p(){a.value=!1}function f(m){var E;(E=c.editor)==null||E.chain().focus().setMark("textStyle",{fontSize:m}).run(),p()}function N(m){const E=m.target,y=i.value;y&&!y.contains(E)&&p()}e.onMounted(()=>{document.addEventListener("click",N),window.addEventListener(ye,x)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",N),window.removeEventListener(ye,x)});function x(m){var y;((y=m.detail)==null?void 0:y.id)!==Le&&(a.value=!1)}return(m,E)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size-wrapper",ref_key:"rootRef",ref:i},[e.createVNode(e.unref(U),{text:"字体大小",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(C,["stop"]),"aria-expanded":a.value},[e.createElementVNode("div",kt,e.toDisplayString(n.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,gt)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",wt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,y=>e.createElementVNode("div",{key:y,class:"dropdown-item","aria-selected":y===n.value,onClick:e.withModifiers(k=>f(y),["stop"])},[y===n.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",yt,e.toDisplayString(y),1)],8,Ct)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-87f86dca"]]),bt=["aria-expanded"],Vt={key:0,class:"dropdown"},_t={class:"section"},Et={class:"swatches"},Nt=["onClick"],vt={class:"section"},Mt={class:"swatches grid"},Bt=["onClick"],Lt={key:0,class:"section"},zt={class:"swatches"},St=["onClick"],$t={class:"section inline-actions"},Tt={key:1,class:"advanced"},xe="md-toolbar-dropdown-open",ze="color-select",Dt=J(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const c=t,r=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],n=e.ref(!1),a=e.ref(!1),i=e.ref(null),C=e.ref(c.currentColor||"#000000"),p=e.ref(s()),f=e.ref("#F5222D");function N(){n.value||window.dispatchEvent(new CustomEvent(xe,{detail:{id:ze}})),n.value=!n.value}function x(){n.value=!1}function m(){a.value=!a.value}function E(z){var v;(v=c.editor)==null||v.chain().focus().setColor(z).run(),f.value=z,g(z),x()}function y(){var z;(z=c.editor)==null||z.chain().focus().unsetColor().run(),x()}function k(z){const v=z.target,w=i.value;w&&!w.contains(v)&&x()}function d(){}function s(){try{const z=localStorage.getItem("md_color_recent");if(!z)return[];const v=JSON.parse(z);return Array.isArray(v)?v.slice(0,12):[]}catch{return[]}}function g(z){const v=[z,...p.value.filter(w=>w!==z)];p.value=v.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(p.value))}catch{}}let h=[];function u(){const z=c.editor;z&&(h=[{event:"selectionUpdate",handler:d},{event:"transaction",handler:d},{event:"update",handler:d}],h.forEach(({event:v,handler:w})=>{z.on(v,w)}))}e.onMounted(()=>{document.addEventListener("click",k),window.addEventListener(xe,B),u()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",k),window.removeEventListener(xe,B);const z=c.editor;z&&h.forEach(({event:v,handler:w})=>{z.off(v,w)}),h=[]}),e.watch(()=>c.editor,(z,v)=>{v&&h.forEach(({event:w,handler:M})=>{v.off(w,M)}),h=[],u()});function B(z){var w;((w=z.detail)==null?void 0:w.id)!==ze&&(n.value=!1)}return(z,v)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select-wrapper",ref_key:"rootRef",ref:i},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(U),{text:"文字颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:v[0]||(v[0]=e.withModifiers(w=>E(f.value),["stop"]))},[e.createVNode(e.unref(ot),{theme:"filled",size:"14",fill:f.value,strokeWidth:3},null,8,["fill"]),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:f.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(N,["stop"])},[e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,bt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("div",_t,[v[4]||(v[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>E(w),["stop"])},[w===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Nt))),128))])]),e.createElementVNode("div",vt,[v[5]||(v[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>E(w),["stop"])},[w===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Bt))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",Lt,[v[6]||(v[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>E(w),["stop"])},null,12,St))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(m,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",Tt,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":v[1]||(v[1]=w=>C.value=w)},null,512),[[e.vModelText,C.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":v[2]||(v[2]=w=>C.value=w)},null,512),[[e.vModelText,C.value]]),e.createElementVNode("button",{class:"btn apply",onClick:v[3]||(v[3]=e.withModifiers(w=>E(C.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-1656be6b"]]),Ft='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565315763" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81778" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM224 352h576v96H224zM224 800h576v96H224z" p-id="81779"></path></svg>',At='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565310640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81615" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h832v96H96zM96 800h832v96H96z" p-id="81616"></path></svg>',Ht='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565296828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h576v96H96zM96 800h576v96H96z" p-id="81290"></path></svg>',Ut='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565306218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81452" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM352 352h576v96H352zM352 800h576v96H352z" p-id="81453"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763562183158" class="icon" viewBox="0 0 1102 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="79129" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.37109375" height="18"><path d="M93.105231 187.943385a78.769231 78.769231 0 1 1 0-157.538462 78.769231 78.769231 0 0 1 0 157.538462z m0 393.846153a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461z m0 393.846154a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461zM276.243692 161.792v-118.153846h787.692308v118.153846h-787.692308z m0.472616 397.233231v-118.153846h788.007384v118.153846H276.716308z m-3.308308 397.154461v-118.153846h789.267692v118.153846H273.329231z" fill="#333333" p-id="79130"></path></svg>',It='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763566846467" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="83576" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M477.098667 709.717333a46.805333 46.805333 0 0 0 69.802666 0l296.021334-340.736c24.32-28.032 3.328-70.314667-34.944-70.314666H216.021333c-38.272 0-59.306667 42.282667-34.944 70.314666l296.021334 340.736z" fill="#000000" p-id="83577"></path></svg>',Ot='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763568214776" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="84748" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M682.666667 772.266667l332.8-247.466667-324.266667-435.2-409.6 307.2-256 192L260.266667 896h691.2v-85.333333h-324.266667l55.466667-38.4zM674.133333 213.333333l221.866667 294.4-260.266667 196.266667-38.4 25.6-230.4-285.866667L674.133333 213.333333zM145.066667 605.866667l149.333333-110.933334 230.4 285.866667-34.133333 29.866667H298.666667l-153.6-204.8z" fill="#333333" p-id="84749"></path></svg>',Wt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763479929532" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="52528" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M621.568 208.299a38.101 38.101 0 0 0-73.941-18.518L386.773 833.28a38.101 38.101 0 0 0 73.899 18.475l160.853-643.456zM325.632 294.4a38.101 38.101 0 0 1 0 53.888L162.347 511.573 325.632 674.86a38.101 38.101 0 0 1-53.845 53.888L81.493 538.539a38.101 38.101 0 0 1 0-53.931L271.787 294.4a38.101 38.101 0 0 1 53.888 0z m372.736 0a38.101 38.101 0 0 0 0 53.888l163.285 163.285L698.368 674.86a38.101 38.101 0 0 0 53.888 53.888l190.25-190.208a38.101 38.101 0 0 0 0-53.931L752.257 294.4a38.101 38.101 0 0 0-53.888 0z" fill="#333333" p-id="52529"></path></svg>',Rt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480012496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="54461" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M338.986667 59.413333h52.586666a21.333333 21.333333 0 0 1 21.333334 21.333334V115.84a21.333333 21.333333 0 0 1-21.333334 21.333333H356.266667c-36.48 0-53.76 20.16-53.76 62.4v188.16c0 59.52-27.84 99.84-82.56 120 54.72 23.04 82.56 62.4 82.56 120v189.12c0 40.32 17.28 61.44 53.76 61.44h35.306666a21.333333 21.333333 0 0 1 21.333334 21.333334v35.093333a21.333333 21.333333 0 0 1-21.333334 21.333333H338.986667c-42.24 0-74.88-14.4-97.92-41.28-21.12-24.96-31.68-59.52-31.68-101.76v-180.48c0-27.84-5.76-48-17.28-60.48-11.178667-12.778667-29.653333-20.245333-55.466667-23.488a18.901333 18.901333 0 0 1-16.533333-18.773333v-43.221333c0-10.005333 7.381333-18.474667 17.28-19.84 25.408-3.498667 43.648-11.456 54.72-23.317334 11.52-13.44 17.28-33.6 17.28-60.48V203.413333c0-43.2 10.56-77.76 31.68-102.72 23.04-27.84 55.68-41.28 97.92-41.28z m292.48 0h52.586666c42.24 0 74.88 13.44 97.92 41.28 21.12 24.96 31.68 59.52 31.68 102.72v179.52c0 26.88 5.76 48 18.24 61.44 10.24 11.029333 28.224 18.816 53.418667 22.314667 10.112 1.408 17.621333 10.026667 17.621333 20.245333v40.746667a21.333333 21.333333 0 0 1-18.88 21.184c-24.576 3.413333-42.282667 10.794667-53.12 23.189333-11.52 12.48-17.28 32.64-17.28 60.48v180.48c0 42.24-10.56 76.8-31.68 101.76-23.04 26.88-55.68 41.28-97.92 41.28H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V899.626667a21.333333 21.333333 0 0 1 21.333334-21.333334h35.306666c35.52 0 53.76-21.12 53.76-61.44v-189.12c0-57.6 26.88-96.96 82.56-120-55.68-20.16-82.56-60.48-82.56-120v-188.16c0-42.24-18.24-62.4-53.76-62.4H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V80.746667a21.333333 21.333333 0 0 1 21.333334-21.333334z" fill="#000000" p-id="54462"></path></svg>',Pt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1768469045840" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6989" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M393.846154 64.174932l117.454119 0.399843H512.499805l117.454119-0.399843-10.395939 10.395939c-18.89262 18.89262-28.488872 44.982429-26.28973 71.472081l20.292073 250.502148c2.998829 36.68567 18.092932 72.171808 42.483405 99.661069l34.186646 38.684889-122.252245-0.899648-55.478329-0.399844h-0.99961l-55.478329 0.399844-122.452167 0.799687 34.186646-38.684888c24.390472-27.589223 39.484576-62.9754 42.483405-99.66107l20.292074-250.402187c2.199141-26.589613-7.397111-52.679422-26.289731-71.472081l-10.395939-10.395939m281.889887-64.174932h-0.199922L512.399844 0.599766h-0.799688L348.36392 0h-0.199922c-20.891839 0-39.684498 13.494729-45.582194 33.58688-4.098399 13.994533-1.899258 30.887934 17.79305 47.581414l38.584927 38.584927c5.597813 5.597813 8.39672 13.294807 7.796955 21.091761L346.464662 391.247169c-1.899258 23.190941-11.195627 45.08239-26.589613 62.475596l-61.87583 69.872706c-8.696603 9.796173-13.894572 22.291292-14.394377 35.386177-0.299883 8.996486 1.599375 18.89262 8.596642 27.28934 6.897306 8.296759 17.293245 12.894963 27.989067 12.894963h0.299882l175.931277-1.199532 55.178446 422.834831 0.399844 3.098789 0.399844-3.098789 55.178446-422.834831 175.931277 1.199532h0.299882c10.795783 0 21.191722-4.598204 27.989067-12.894963 6.897306-8.39672 8.796564-18.292854 8.596642-27.28934-0.399844-13.094885-5.697774-25.590004-14.394377-35.386177l-61.87583-69.872706c-15.393987-17.393206-24.690355-39.284654-26.589613-62.475596l-20.292074-250.402187c-0.599766-7.796954 2.199141-15.593909 7.796955-21.091761l38.584927-38.584927c19.692308-16.693479 21.891449-33.58688 17.79305-47.581414-5.997657-19.992191-24.790316-33.58688-45.682155-33.58688z" p-id="6990"></path></svg>',Gt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763569611105" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="87406" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 0.6 0.1 1.3 0.2 1.9-0.1 2-0.2 4.1-0.2 6.1 0 46.4 37.6 84 84 84s84-37.6 84-84c0-2.1-0.1-4.1-0.2-6.1 0.1-0.6 0.2-1.2 0.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z" p-id="87407"></path></svg>',qt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763473363174" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28322" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M957.610667 507.434667L603.221333 158.293333a7.893333 7.893333 0 0 0-11.221333 0L353.28 393.386667a8.021333 8.021333 0 0 0-0.085333 11.306666l0.085333 0.128 40.021333 39.381334-117.205333 115.285333a8.021333 8.021333 0 0 0-0.085333 11.306667l0.085333 0.128 39.509333 38.869333-189.098666 187.008H72.106667a8.106667 8.106667 0 0 0-8.106667 8.021333v55.168c0 4.394667 3.584 8.021333 8.021333 8.021334H416.853333c2.133333 0 4.096-0.810667 5.589334-2.304l76.117333-75.605334 40.405333 39.808a7.936 7.936 0 0 0 11.178667 0l117.12-115.626666 40.106667 39.509333a7.893333 7.893333 0 0 0 11.178666 0l238.72-235.178667a7.68 7.68 0 0 0 0.298667-11.221333z m-567.808 288.853333H229.546667l134.4-133.034667 80.128 78.933334-54.314667 54.058666z m154.794666-62.122667l-171.392-168.917333 68.608-67.584 171.392 168.874667-68.608 67.626666z m168.533334-76.117333l-262.826667-258.901333 147.285333-145.066667 262.826667 258.986667-147.328 144.981333z" fill="#999999" p-id="28323"></path></svg>',Yt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480451042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="58395" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M938.666667 553.92V768c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V256c0-64.8 52.533333-117.333333 117.333334-117.333333h618.666666c64.8 0 117.333333 52.533333 117.333334 117.333333v297.92z m-64-74.624V256a53.333333 53.333333 0 0 0-53.333334-53.333333H202.666667a53.333333 53.333333 0 0 0-53.333334 53.333333v344.48A290.090667 290.090667 0 0 1 192 597.333333a286.88 286.88 0 0 1 183.296 65.845334C427.029333 528.384 556.906667 437.333333 704 437.333333c65.706667 0 126.997333 16.778667 170.666667 41.962667z m0 82.24c-5.333333-8.32-21.130667-21.653333-43.648-32.917333C796.768 511.488 753.045333 501.333333 704 501.333333c-121.770667 0-229.130667 76.266667-270.432 188.693334-2.730667 7.445333-7.402667 20.32-13.994667 38.581333-7.68 21.301333-34.453333 28.106667-51.370666 13.056-16.437333-14.634667-28.554667-25.066667-36.138667-31.146667A222.890667 222.890667 0 0 0 192 661.333333c-14.464 0-28.725333 1.365333-42.666667 4.053334V768a53.333333 53.333333 0 0 0 53.333334 53.333333h618.666666a53.333333 53.333333 0 0 0 53.333334-53.333333V561.525333zM320 480a96 96 0 1 1 0-192 96 96 0 0 1 0 192z m0-64a32 32 0 1 0 0-64 32 32 0 0 0 0 64z" fill="#000000" p-id="58396"></path></svg>',Kt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480387136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="57289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M213.972 214.906l0.934-0.934c27.606-27.606 68.674-30.581 92.168-7.087l225.23 225.23c29.72-40.254 30.733-93.311-0.599-124.643L345.639 121.406c-35.132-35.132-97.076-30.148-138.356 11.132l-74.744 74.744c-41.28 41.28-46.264 103.224-11.132 138.356l186.065 186.065c31.332 31.332 84.389 30.319 124.643 0.599l-225.23-225.23c-23.494-23.492-20.519-64.56 7.087-92.166zM808.745 809.679l0.934-0.934c27.606-27.606 31.18-68.074 7.686-91.568l-225.23-225.23c40.254-29.72 93.311-30.733 124.643 0.599l186.065 186.065c35.132 35.132 29.548 96.477-11.732 137.757l-74.744 74.744c-41.28 41.28-102.625 46.863-137.757 11.732L492.546 716.779c-31.332-31.332-31.909-82.799-0.599-124.643l225.23 225.23c23.494 23.494 63.962 19.92 91.568-7.687z" fill="#666666" p-id="57290"></path><path d="M627.123 628.713c-12.296 12.296-32.232 12.296-44.528 0L394.938 441.057c-12.296-12.296-12.296-32.232 0-44.528s32.232-12.296 44.528 0l187.656 187.656c12.297 12.296 12.297 32.232 0.001 44.528z" fill="#666666" p-id="57291"></path></svg>',Jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763562537529" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="80294" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M107.5 736c28.6 0 52.2 7.1 70.2 21.4 18.5 15.1 27.9 36 27.9 61.7 0 22.9-8.4 41.3-24.7 54.1 16 12 29.6 32.8 29.6 57.3 0 27-9.7 49.7-28.8 67.2-19.6 17.5-45 26.3-75.6 26.3-29.2 0-53.4-7.8-71.7-23.3C14 983.6 2.4 958.4 0 926.1v-14.5h69.7V925c0.6 12.9 4.2 21.8 10.9 27.8 6.2 5.7 14.4 8.6 25.2 8.6 12.1 0 21.3-3.2 27.6-9.2 5.6-5.6 8.2-11.9 8.2-19.9 0-10-2.7-16.6-7.9-20.8-5.4-4.5-14.5-6.9-27.8-6.9H74.3v-58.9h31.5c11.6 0 19.8-2.2 24.5-6.1 4.1-3.5 6.3-9.2 6.3-17.4 0-8.3-2-13.9-5.3-17-4.6-3.9-12.3-6.1-23.5-6.1-11.5 0-19.3 2.5-24.8 7.4-5.5 4.8-8.9 12.8-10 23.7v13.4H5.1l-0.2-7v-8.2c2.4-29.1 13.4-52.1 32.7-68.2C55.8 744 79.3 736 107.5 736z m916.5 96v128H384V832h640zM106.9 368c28 0 51.7 8.4 70.5 25.1 18.8 17.1 28.2 39.1 28.2 65.8 0 25.4-9.7 48.8-28.8 70-10.4 11.1-27.9 24.8-55.3 43.2-10.1 6.6-18.5 12.9-25.2 18.7h109.3V656l-7.1 0.1-185.2-0.1c-4.5-0.6-7.5-1.6-9.8-3.8-2.4-2.4-3.2-5.6-3.5-10.4 0-29.7 9.6-55.5 28.8-77.1 10.3-11.8 30.6-28.1 61.1-49.1 14.4-10 25.7-19.2 32.4-26.3 8.9-10 13.2-20.3 13.2-30.8 0-9.8-2.3-16.6-6.4-20.4-4.5-4.1-12.2-6.3-23.6-6.3-11.3 0-18.8 3.4-24.1 10.6-5.7 7.3-9.2 19.8-9.9 37.7-0.5 3.9-1.6 6.8-3.8 9-2.1 2-4.8 3-10.4 4l-43-0.1c-4.2-0.8-7.1-1.9-9.2-4-2.2-2.3-3.2-5.3-3.7-10.3 0.4-32.1 9.9-58.3 28.6-78.2 19.6-21.6 45.5-32.5 76.9-32.5z m917.1 80v128H384V448h640zM146.6 0v288H75.1V94.2c-16.7 10.2-35.9 18.3-50.9 20.3l-8.2 1.6V46l4.8-2C39.3 37.3 52.5 31.7 60 27.6 71 20.9 82.1 11.7 96.3 0.1h50.3zM1024 64v128H384V64h640z" fill="#333333" p-id="80295"></path></svg>',Zt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480239307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="56277" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M849.6 231v109.5c-46.4 14.9-84.6 41.5-114.4 81.3-29.9 36.5-44.8 76.3-43.1 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 91.2 36.5 23.2 24.9 36.5 56.4 36.5 94.5S848 732 821.5 756.8C795 780 761.8 793.3 722 793.3c-46.4 0-82.9-19.9-112.8-56.4s-43.1-84.6-43.1-141c0-89.6 24.9-165.8 76.3-230.5C692 299 761.7 254.2 849.6 231z m-403 0v109.5c-46.4 14.9-82.9 41.5-112.8 81.3-31.5 36.5-46.4 76.3-44.8 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 89.6 36.5 24.9 24.9 38.1 56.4 38.1 94.5s-13.3 69.7-38.1 94.5c-26.5 23.2-61.4 36.5-101.2 36.5-46.4 0-82.9-19.9-111.1-56.4-29.9-36.5-44.8-84.6-44.8-141 0-89.6 24.9-165.8 76.3-230.5C289 299 358.7 254.2 446.6 231z" p-id="56278"></path></svg>',Xt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480808376" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="61532" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M959.825 384.002V191.94c0-70.692-57.308-128-128-128H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V384.002z m-813.16-237.337a63.738 63.738 0 0 1 45.336-18.785H832a63.962 63.962 0 0 1 63.886 64.121v128.061H127.88v-128.06a63.738 63.738 0 0 1 18.785-45.337z m269.127 461.308v-223.97h192.181v223.97H415.792z m192.181 63.94v223.972H415.792V671.914h192.181z m-256.121-63.94H127.88v-223.97h223.972v223.97zM146.665 877.21a63.467 63.467 0 0 1-18.785-45.21V671.914h223.972v223.97h-159.85a63.626 63.626 0 0 1-45.337-18.675z m749.22-45.21a63.763 63.763 0 0 1-63.886 63.886H671.914V671.914h223.97v160.085z m0-224.026H671.914v-223.97h223.97v223.97z" p-id="61533"></path></svg>',Qt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480994147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="73821" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M933.529779 1022.701142H87.673207c-48.357498 0-87.523075-39.165577-87.523075-87.523076V1.798419h729.259049c48.357498 0 87.523075 39.165577 87.523076 87.523076v320.818031h204.220509V935.178066c-0.099912 48.357498-39.265489 87.523075-87.622987 87.523076z m-175.046151-904.205289c0-32.171724-26.077081-58.348717-58.348717-58.348717H58.498849v845.856572c0 32.171724 26.077081 58.348717 58.348717 58.348717h583.387257c32.171724 0 58.348717-26.077081 58.348717-58.348717V118.495853zM962.704137 468.588155h-145.871792v495.864182h87.523075c32.171724 0 58.348717-26.077081 58.348717-58.348717V468.588155z m-729.25905 0h379.166748v58.348717H233.445087V468.588155z m0-233.394868h379.166748v58.348717H233.445087v-58.348717z m262.569227 525.03854H233.445087v-58.348716h262.469314v58.348716z m0 0" p-id="73822"></path></svg>',eo='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763477549677" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31202" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M828.6 75C889.572 75 939 124.428 939 185.4v676.2c0 60.972-49.428 110.4-110.4 110.4H152.4C91.428 972 42 922.572 42 861.6V185.4C42 124.428 91.428 75 152.4 75z m0 59.8H152.4c-27.946 0-50.6 22.654-50.6 50.6v676.2c0 27.946 22.654 50.6 50.6 50.6h676.2c27.946 0 50.6-22.654 50.6-50.6V185.4c0-27.946-22.654-50.6-50.6-50.6z m-20.56 167.48c11.48 11.504 11.641 30.022 0.502 41.725l-0.548 0.56L477.473 674.37c-11.251 11.227-29.274 11.663-41.05 1.123l-0.574-0.527L260.695 509.93c-12.018-11.325-12.581-30.248-1.257-42.266 11.145-11.828 29.65-12.56 41.69-1.788l0.577 0.53L455.756 611.56l310-309.325c11.689-11.664 30.62-11.644 42.284 0.045z" fill="#333333" p-id="31203"></path></svg>',to='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480631673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="60480" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M960 192h-28.384c-16.8 0-32.928 6.624-44.928 18.432L800 295.936V256a96 96 0 0 0-96-96H96C43.072 160 0 203.04 0 256v512a96 96 0 0 0 96 96h608c52.992 0 96-43.008 96-96v-39.072l86.688 85.504c12 11.808 28.128 18.432 44.928 18.432H960a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64zM96 800c-17.664 0-32-14.368-32-32V256a32 32 0 0 1 32-32h608c17.632 0 32 14.336 32 32v512c0 17.632-14.368 32-32 32H96z m864-31.136h-32l-128-128V640l-32-32v-192l160-160h32v512.864z" fill="#333333" p-id="60481"></path></svg>',oo=["innerHTML"],q=J(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{default:"#000"},size:{}},setup(t){const c=t,r=e.useAttrs(),n=Object.assign({"/src/svg/alignCenter.svg":Ft,"/src/svg/alignJustify.svg":At,"/src/svg/alignLeft.svg":Ht,"/src/svg/alignRight.svg":Ut,"/src/svg/bulletList.svg":jt,"/src/svg/caretDown.svg":It,"/src/svg/clearFormat.svg":Ot,"/src/svg/code.svg":Wt,"/src/svg/codeBlock.svg":Rt,"/src/svg/fixed.svg":Pt,"/src/svg/formatBrush.svg":Gt,"/src/svg/highBg.svg":qt,"/src/svg/img.svg":Yt,"/src/svg/link.svg":Kt,"/src/svg/orderedList.svg":Jt,"/src/svg/quote.svg":Zt,"/src/svg/table.svg":Xt,"/src/svg/tableTools.svg":Qt,"/src/svg/task.svg":eo,"/src/svg/video.svg":to}),a=(()=>{const x={};return Object.entries(n).forEach(([m,E])=>{const k=(m.split("/src/svg/")[1]||m).replace(/\.svg$/i,"");x[k]=E;const d=k.split("/").pop();d&&(x[d]=E)}),x})(),i=e.computed(()=>{const x=c.name.replace(/\.svg$/i,"");return a[x]||""});function C(x){if(!x)return"";let m=x.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return m=m.replace(/<svg([^>]*)>/i,(E,y)=>`<svg${y.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet" fill="currentColor" stroke="currentColor">`),m=m.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),m=m.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),m=m.replace(/fill='(?!none)[^']*'/gi,'fill="currentColor"'),m=m.replace(/stroke='(?!none)[^']*'/gi,'stroke="currentColor"'),m}const p=e.computed(()=>C(i.value));function f(x){if(x!=null)return typeof x=="number"?`${x}px`:x}const N=e.computed(()=>{const x={},m=f(c.size);m&&(x.fontSize=m),c.color&&(x.color=c.color);const E=r.style??void 0;return[x,E].filter(Boolean)});return(x,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(r).class]),style:e.normalizeStyle(N.value),innerHTML:p.value},null,14,oo))}}),[["__scopeId","data-v-ee8563cd"]]),no=["aria-expanded"],ro={key:0,class:"dropdown"},io={class:"section"},lo={class:"swatches"},so={class:"section"},ao={class:"swatches"},co=["onClick"],fo={key:0,class:"check"},po={class:"section"},mo={class:"swatches grid"},uo=["onClick"],ho={key:0,class:"section"},go={class:"swatches"},ko=["onClick"],wo={class:"section inline-actions"},Co={key:1,class:"advanced"},be="md-toolbar-dropdown-open",Se="bg-color-select",yo=J(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const c=t,r=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],n=e.ref(!1),a=e.ref(!1),i=e.ref(null),C=e.ref(c.currentBg||"#ffffff"),p=e.ref(g()),f=e.ref("#FADB14"),N=e.inject("theme");function x(){n.value||window.dispatchEvent(new CustomEvent(be,{detail:{id:Se}})),n.value=!n.value}function m(){n.value=!1}function E(){a.value=!a.value}function y(w){var M;(M=c.editor)==null||M.chain().focus().setMark("textStyle",{backgroundColor:w}).run(),f.value=w,h(w),m()}function k(){var w;(w=c.editor)==null||w.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),m()}function d(w){const M=w.target,S=i.value;S&&!S.contains(M)&&m()}function s(){}function g(){try{const w=localStorage.getItem("md_bg_recent");if(!w)return[];const M=JSON.parse(w);return Array.isArray(M)?M.slice(0,12):[]}catch{return[]}}function h(w){const M=[w,...p.value.filter(S=>S!==w)];p.value=M.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(p.value))}catch{}}let u=[];function B(){const w=c.editor;w&&(u=[{event:"selectionUpdate",handler:s},{event:"transaction",handler:s},{event:"update",handler:s}],u.forEach(({event:M,handler:S})=>{w.on(M,S)}))}e.onMounted(()=>{document.addEventListener("click",d),window.addEventListener(be,z),B()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",d),window.removeEventListener(be,z);const w=c.editor;w&&u.forEach(({event:M,handler:S})=>{w.off(M,S)}),u=[]}),e.watch(()=>c.editor,(w,M)=>{M&&u.forEach(({event:S,handler:$})=>{M.off(S,$)}),u=[],B()});function z(w){var S;((S=w.detail)==null?void 0:S.id)!==Se&&(n.value=!1)}const v=e.computed(()=>f.value?f.value:N==="dark"?"#fff":"#000");return(w,M)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select-wrapper",ref_key:"rootRef",ref:i},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(U),{text:"背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:M[0]||(M[0]=e.withModifiers(S=>y(f.value),["stop"]))},[e.createVNode(q,{name:"highBg",size:17,color:v.value},null,8,["color"]),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:f.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(x,["stop"])},[e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,no),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",ro,[e.createElementVNode("div",io,[M[4]||(M[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",lo,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.font-size-wrapper[data-v-87f86dca]{position:relative;-webkit-user-select:none;user-select:none}.font-size-wrapper .icon[data-v-87f86dca]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:var(--bg-base)}.font-size-wrapper .icon[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.font-size-wrapper .label[data-v-87f86dca]{font-size:15px}.dropdown[data-v-87f86dca]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-87f86dca],.dropdown-slide-leave-to[data-v-87f86dca]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-87f86dca],.dropdown-slide-leave-active[data-v-87f86dca]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-87f86dca]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.text[data-v-87f86dca]{flex:1}.color-select-wrapper[data-v-1656be6b]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.icon[data-v-1656be6b]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-1656be6b]{width:auto;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-1656be6b]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-1656be6b]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:2px;cursor:pointer}.hoverable[data-v-1656be6b]:hover{background:var(--hover-bg-color)}.underline[data-v-1656be6b]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-1656be6b]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform;border:1px solid var(--border-color)}.dropdown-slide-enter-from[data-v-1656be6b],.dropdown-slide-leave-to[data-v-1656be6b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-1656be6b],.dropdown-slide-leave-active[data-v-1656be6b]{transition:opacity .18s ease,transform .18s ease}.section[data-v-1656be6b]{margin-bottom:8px}.section-title[data-v-1656be6b]{font-size:12px;margin-bottom:6px}.swatches[data-v-1656be6b]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-1656be6b]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-1656be6b]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid var(--border-color);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-1656be6b]{position:absolute;top:0;right:2px;font-size:12px;color:var(--text-base);text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-1656be6b]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-1656be6b]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px;color:var(--text-base)}.advanced[data-v-1656be6b]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-1656be6b]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-1656be6b]{justify-self:end;flex-shrink:1}.svg-icon[data-v-ee8563cd]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-ee8563cd]{width:1em;height:1em;display:block}.bg-color-select-wrapper[data-v-cb31218d]{position:relative;-webkit-user-select:none;user-select:none}.icon[data-v-cb31218d]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-cb31218d]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-cb31218d]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-cb31218d]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-cb31218d]:hover{background:var(--hover-bg-color)}.underline[data-v-cb31218d]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-cb31218d]{position:absolute;top:calc(100% + 12px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform;border:1px solid var(--border-color)}.section[data-v-cb31218d]{margin-bottom:8px}.section-title[data-v-cb31218d]{font-size:12px;margin-bottom:6px}.swatches[data-v-cb31218d]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-cb31218d]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-cb31218d]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-cb31218d]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-cb31218d]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-cb31218d]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px;color:var(--text-base)}.advanced[data-v-cb31218d]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-cb31218d]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-cb31218d]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-cb31218d],.dropdown-slide-leave-to[data-v-cb31218d]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-cb31218d],.dropdown-slide-leave-active[data-v-cb31218d]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-ea99876b]{position:relative}.image-input-panel[data-v-ea99876b]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-ea99876b]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:4px;outline:none;font-size:14px;background-color:var(--bg-input);color:var(--text-base)}.image-actions[data-v-ea99876b]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-ea99876b]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-ea99876b]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-ea99876b]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-ea99876b]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-ea99876b],.img-panel-leave-active[data-v-ea99876b]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-ea99876b],.img-panel-leave-to[data-v-ea99876b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-ea99876b],.img-panel-leave-from[data-v-ea99876b]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-77dd3e96]{position:relative}.video-input-panel[data-v-77dd3e96]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-77dd3e96]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:2px;outline:none;font-size:14px;background-color:var(--bg-input);color:var(--text-base)}.video-actions[data-v-77dd3e96]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-77dd3e96]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-77dd3e96]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-77dd3e96]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-77dd3e96]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-77dd3e96],.video-panel-leave-active[data-v-77dd3e96]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-77dd3e96],.video-panel-leave-to[data-v-77dd3e96]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-77dd3e96],.video-panel-leave-from[data-v-77dd3e96]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-5433b285]{position:relative}.find-input-panel[data-v-5433b285]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.fr-header[data-v-5433b285]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-5433b285]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent;color:var(--text-base)}.fr-tab.active[data-v-5433b285]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-5433b285]{display:block;font-size:12px;margin:6px 0 4px}.fr-input-row[data-v-5433b285]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-5433b285]{flex:1;padding:8px;border:1px solid var(--border-color);border-radius:2px;background-color:var(--bg-input);color:var(--text-base);outline:none}.fr-count[data-v-5433b285]{font-size:12px}.fr-actions[data-v-5433b285]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-5433b285]{padding:6px 10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;color:var(--text-base)}.fr-btn.primary[data-v-5433b285]{color:var(--text-base);background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-5433b285],.find-panel-leave-active[data-v-5433b285]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-5433b285],.find-panel-leave-to[data-v-5433b285]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-5433b285],.find-panel-leave-from[data-v-5433b285]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-db61d34c]{position:relative}.link-input-panel[data-v-db61d34c]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-db61d34c]{margin-bottom:8px}.label[data-v-db61d34c]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-db61d34c]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:2px;outline:none;font-size:14px;background-color:var(--bg-input);color:var(--text-base)}.actions[data-v-db61d34c]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-db61d34c]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-db61d34c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-db61d34c]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-db61d34c],.link-panel-leave-active[data-v-db61d34c]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-db61d34c],.link-panel-leave-to[data-v-db61d34c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-db61d34c],.link-panel-leave-from[data-v-db61d34c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-d0d98332]{position:relative}.table-panel[data-v-d0d98332]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-d0d98332]{font-size:12px;margin-bottom:6px}.grid[data-v-d0d98332]{display:flex;flex-direction:column;gap:4px;background:var(--bg-base);border-radius:2px}.row[data-v-d0d98332]{display:flex;gap:4px}.cell[data-v-d0d98332]{width:18px;height:18px;background:var(--bg-base);border:1px solid var(--border-color);border-radius:3px;cursor:pointer}.cell.active[data-v-d0d98332]{background:#e8f1ff;border-color:#1677ff}.size[data-v-d0d98332]{margin-top:6px;font-size:12px}.table-tools[data-v-1aa3a259]{position:relative}.tools-panel[data-v-1aa3a259]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;border:1px solid var(--border-color)}.tools-grid[data-v-1aa3a259]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-1aa3a259]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.icon[data-v-0a1c80da]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-0a1c80da]:hover{background:#0000000d}.icon[data-v-dcd9c3cd]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon[data-v-dcd9c3cd]:hover{background:#0000000d}.heading-select[data-v-b93823aa]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-b93823aa]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:52px;justify-content:space-between;background:var(--bg-base)}.icon[data-v-b93823aa]:hover{background:var(--hover-bg-color)}.label[data-v-b93823aa]{font-size:15px;color:var(--text-base)}.dropdown[data-v-b93823aa]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-b93823aa],.dropdown-slide-leave-to[data-v-b93823aa]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b93823aa],.dropdown-slide-leave-active[data-v-b93823aa]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-b93823aa]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-b93823aa]:hover{background:#0000000d}.item-label[data-v-b93823aa]{flex:1}.item-label.paragraph[data-v-b93823aa]{font-size:15px}.item-label.level-1[data-v-b93823aa]{font-size:22px;font-weight:600}.item-label.level-2[data-v-b93823aa]{font-size:20px;font-weight:600}.item-label.level-3[data-v-b93823aa]{font-size:18px;font-weight:600}.item-label.level-4[data-v-b93823aa]{font-size:16px}.item-label.level-5[data-v-b93823aa]{font-size:15px}.item-label.level-6[data-v-b93823aa]{font-size:14px}.shortcut[data-v-b93823aa]{font-size:12px}.align-select[data-v-b321e2b4]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-b321e2b4]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:var(--bg-base);gap:3px}.icon_box[data-v-b321e2b4]:hover{background:var(--hover-bg-color)}.dropdown[data-v-b321e2b4]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-b321e2b4],.dropdown-slide-leave-to[data-v-b321e2b4]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b321e2b4],.dropdown-slide-leave-active[data-v-b321e2b4]{transition:opacity .18s ease,transform .18s ease}.options[data-v-b321e2b4]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-b321e2b4]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-b321e2b4]:hover,.option.active[data-v-b321e2b4]{background:var(--hover-bg-color)}.theme-wrapper[data-v-e09fa6a6]{margin-right:4px;display:flex;align-items:center;justify-content:center;border-radius:50%;width:28px;height:28px;cursor:pointer}.theme-wrapper[data-v-e09fa6a6]:hover{background-color:var(--hover-bg-color)}.theme-wrapper .icon-box[data-v-e09fa6a6]{display:flex;align-items:center;justify-content:center;cursor:pointer}.theme-wrapper .icon-box:hover svg[data-v-e09fa6a6]{opacity:.8}.theme-wrapper .icon-box svg[data-v-e09fa6a6]{width:18px;height:18px}.theme-icon-enter-active[data-v-e09fa6a6],.theme-icon-leave-active[data-v-e09fa6a6]{transition:opacity .16s ease,transform .16s ease}.theme-icon-enter-from[data-v-e09fa6a6],.theme-icon-leave-to[data-v-e09fa6a6]{opacity:.4;transform:scale(.85) rotate(-8deg)}.theme-icon-enter-to[data-v-e09fa6a6],.theme-icon-leave-from[data-v-e09fa6a6]{opacity:1;transform:scale(1) rotate(0)}.header_box[data-v-1d764638]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid var(--border-color);color:var(--text-base)}.header_box.disabled[data-v-1d764638]{pointer-events:none;opacity:.5}.header_box .icon[data-v-1d764638]{position:relative;cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;color:var(--text-base);transition:all .2s ease-in-out}.header_box .icon[data-v-1d764638]:hover,.header_box .icon.active[data-v-1d764638]{background:var(--hover-bg-color)}.header_box .icon[aria-disabled=true][data-v-1d764638]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-06818a86]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-06818a86]{border-left:1px solid var(--border-color);padding:8px;box-sizing:border-box;font-size:14px;position:sticky;top:0;align-self:start;height:100%;background:var(--bg-base);display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-06818a86]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid var(--border-color)}.outline__listWrap[data-v-06818a86]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-06818a86]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-06818a86]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-06818a86]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-06818a86]{display:flex;align-items:center;font-weight:600;margin-bottom:8px;color:var(--text-base)}.outline__header[data-v-06818a86]>*{display:inline-flex;gap:6px}.outline__list[data-v-06818a86]{list-style:none;padding:0;margin:0}.outline__item[data-v-06818a86]{cursor:pointer;padding:4px 0;color:var(--text-base)}.outline__caret[data-v-06818a86]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline.dark .outline__caret[data-v-06818a86]{color:#94a3b8}.outline__caret.collapsed[data-v-06818a86]{transform:rotate(0)}.outline__caret.expanded[data-v-06818a86]{transform:rotate(90deg)}.outline__item[data-v-06818a86]:hover{color:#1a69f8}.outline.dark .outline__item[data-v-06818a86]:hover{color:#22c55e}.outline__item.lv-1[data-v-06818a86]{padding-left:0}.outline__item.lv-2[data-v-06818a86]{padding-left:8px}.outline__item.lv-3[data-v-06818a86]{padding-left:16px}.outline__item.lv-4[data-v-06818a86]{padding-left:24px}.outline__item.lv-5[data-v-06818a86]{padding-left:32px}.outline__item.lv-6[data-v-06818a86]{padding-left:40px}.outline__text[data-v-06818a86]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-06818a86]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline.dark .outline__close[data-v-06818a86]{background:#1f1f21;border-color:#334155;color:#94a3b8;box-shadow:none}.outline__close[data-v-06818a86]:hover{color:var(--hover-text-color)}.outline__title[data-v-06818a86]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-06818a86]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-06818a86]{display:none}@media (max-width: 900px){.outline[data-v-06818a86]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-06818a86]{width:min(85vw,280px)}.outline-drawer-mask[data-v-06818a86]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-06818a86],.outline-slide-leave-active[data-v-06818a86]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-06818a86],.outline-slide-leave-to[data-v-06818a86]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-06818a86],.outline-slide-leave-to[data-v-06818a86]{transform:translate(100%)}}.outline-mask-enter-active[data-v-06818a86],.outline-mask-leave-active[data-v-06818a86]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-06818a86],.outline-mask-leave-to[data-v-06818a86]{opacity:0}.v-md-editor-wrapper[data-v-39599b71]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:2px;background:var(--bg-base);box-sizing:border-box;border:1px solid var(--border-color)}.v-md-editor-wrapper .fullscreen[data-v-39599b71]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.v-md-editor-wrapper.readonly[data-v-39599b71] .tiptap-resize-handle{pointer-events:none;display:none}.v-md-editor-wrapper.readonly[data-v-39599b71] img,.v-md-editor-wrapper.readonly[data-v-39599b71] video{-webkit-user-drag:none}.v-md-editor-wrapper.readonly[data-v-39599b71] .tiptap-resize-wrapper,.v-md-editor-wrapper.readonly[data-v-39599b71] .tiptap-resize-container{outline:none!important;border:none!important;width:100%!important;max-width:100%!important}.v-md-editor-wrapper.readonly[data-v-39599b71] .tiptap-video{width:100%!important;max-width:100%!important}.editor_wrapper[data-v-39599b71]{position:relative;overflow-y:auto;overflow-x:hidden;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-39599b71]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-39599b71]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-39599b71]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-39599b71]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-39599b71]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-39599b71]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-39599b71]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-39599b71]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-39599b71]{background:#22c55e}.content[data-v-39599b71]{padding:12px 24px;color:var(--text-base)}.content[data-v-39599b71] img{max-width:100%;height:auto;display:inline-block}.content[data-v-39599b71] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-39599b71] .tiptap-resize-container,.content[data-v-39599b71] .tiptap-resize-wrapper{max-width:100%!important;box-sizing:border-box}.content[data-v-39599b71] .tiptap-video{max-width:100%!important;height:auto!important;display:block}.content[data-v-39599b71] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-39599b71] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-39599b71 .18s ease both}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-39599b71 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-39599b71{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-39599b71{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);margin-top:2px}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-39599b71] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-39599b71] img.ProseMirror-selectednode{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-39599b71] [data-resize-wrapper]{display:inline-block}.content[data-v-39599b71] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-39599b71] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-39599b71] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-39599b71] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-39599b71] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-39599b71] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-39599b71] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-39599b71] .tiptap-resize-wrapper:hover>img,.content[data-v-39599b71] .tiptap-resize-wrapper:hover>video{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-39599b71] .tiptap-resize-wrapper{position:relative}.content[data-v-39599b71] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-39599b71] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-39599b71] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-39599b71] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-39599b71] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-39599b71 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-39599b71{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-39599b71] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-39599b71] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-39599b71] .ProseMirror table th,.content[data-v-39599b71] .ProseMirror table td{border:1px solid var(--border-color);padding:8px;text-align:left;position:relative}.content[data-v-39599b71] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content .v-md-editor-wrapper.dark[data-v-39599b71] .ProseMirror table thead th{background:#111827}.content[data-v-39599b71] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-39599b71] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-39599b71] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-39599b71] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-39599b71] code{background:var(--code-bg);padding:2px 4px;border-radius:4px}.content[data-v-39599b71] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-39599b71] pre{background:var(--code-bg);padding:12px;border-radius:6px;border:1px solid var(--border-color);overflow:auto}.content[data-v-39599b71] p{margin:12px 0}[data-v-39599b71] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid var(--border-color);cursor:grab;z-index:5}[data-v-39599b71] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-39599b71]{grid-template-columns:1fr}.outline-markers[data-v-39599b71]{display:none}}.link-modal-backdrop[data-v-39599b71]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-39599b71]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-39599b71]{background:#fff;border:1px solid var(--border-color);border-radius:2px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.v-md-editor-wrapper.dark .link-modal__content[data-v-39599b71]{background:#1f1f21;border-color:#334155;box-shadow:none;color:#e5e7eb}.link-modal__title[data-v-39599b71]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-39599b71]{width:100%;padding:8px;border:1px solid var(--border-color);border-radius:2px;margin-bottom:10px}.v-md-editor-wrapper.dark .link-modal__input[data-v-39599b71]{background:#0b1220;border-color:#334155;color:#e5e7eb}.link-modal__actions[data-v-39599b71]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-39599b71]{padding:6px 10px;border:1px solid var(--border-color);background:#fff;border-radius:2px;cursor:pointer}.v-md-editor-wrapper.dark .link-modal__actions button[data-v-39599b71]{background:#1f1f21;border-color:#334155;color:#e5e7eb}.tiptap-video[data-v-39599b71]{display:block;max-width:100%;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(q,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tiptap/vue-3"),require("@tiptap/starter-kit"),require("@tiptap/markdown"),require("@tiptap/extension-image"),require("@tiptap/core"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-link"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/extension-color"),require("@tiptap/extension-underline"),require("@tiptap/extension-table"),require("@tiptap/extensions"),require("@tiptap/extension-list")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/vue-3","@tiptap/starter-kit","@tiptap/markdown","@tiptap/extension-image","@tiptap/core","@tiptap/extension-placeholder","@tiptap/extension-link","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/extension-color","@tiptap/extension-underline","@tiptap/extension-table","@tiptap/extensions","@tiptap/extension-list"],e):(q=typeof globalThis<"u"?globalThis:q||self,e(q.MdEditor={},q.Vue,q.tiptapVue3,q.StarterKit,q.tiptapMarkdown,q.tiptapImage,q.tiptapCore,q.tiptapPlaceholder,q.tiptapLink,q.tiptapTextAlign,q.tiptapTextStyle,q.tiptapColor,q.tiptapUnderline,q.tiptapTable,q.extensions,q.extensionList))})(this,function(q,e,Be,je,Ie,Oe,we,We,Re,Pe,Ce,Ge,qe,Le,Ye,ze){"use strict";var He;function Ke(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const ye=Ke(we),Ze=Oe.Image.extend({draggable:!1,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:a=>a.getAttribute("data-uploading")?!0:null,renderHTML:a=>a.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:a=>{const n=a.getAttribute("width")||a.style.width||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:a=>a.width?{width:a.width}:{}},height:{default:null,parseHTML:a=>{const n=a.getAttribute("height")||a.style.height||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:a=>a.height?{height:a.height}:{}}}},addNodeView(){return({node:t,getPos:a,editor:n})=>{const o=document.createElement("img"),i=t.attrs;o.src=i.src||"",i.alt&&(o.alt=i.alt),i.title&&(o.title=i.title),typeof i.width=="number"&&(o.style.width=`${i.width}px`),typeof i.height=="number"&&(o.style.height=`${i.height}px`),o.style.maxWidth="100%",o.style.height=o.style.height||"auto",o.style.display="inline-block";const r=new we.ResizableNodeView({element:o,node:t,getPos:a,onResize:(f,_)=>{o.style.width=`${f}px`,o.style.height=`${_}px`},onCommit:(f,_)=>{try{const b=n,m=a();if(m!==void 0){const{state:x}=b,N=x.schema.nodes.image,w=x.doc.nodeAt(m);if(N&&w){const c={...w.attrs||{},width:f,height:_},s=x.tr.setNodeMarkup(m,N,c,w.marks);b.view.dispatch(s)}}}catch{}},onUpdate:f=>{const _=f.attrs;return typeof _.src=="string"&&_.src&&o.src!==_.src&&(o.src=_.src),typeof _.width=="number"&&(o.style.width=`${_.width}px`),typeof _.height=="number"&&(o.style.height=`${_.height}px`),_.uploading?r.wrapper.setAttribute("data-uploading","true"):r.wrapper.removeAttribute("data-uploading"),!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:32,height:32},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});o.addEventListener("dragstart",f=>{const _=n;if(!(_!=null&&_.isEditable))try{f.preventDefault()}catch{}});try{o.setAttribute("draggable","false"),r.wrapper.setAttribute("draggable","false"),r.container.setAttribute("draggable","false"),r.container.style.display="inline-block",r.wrapper.style.display="inline-block"}catch{}const y=document.createElement("div");y.className="tiptap-upload-mask";const p=document.createElement("div");return p.className="tiptap-upload-progress",y.appendChild(p),r.wrapper.appendChild(y),i.uploading&&r.wrapper.setAttribute("data-uploading","true"),r}}}),Je=Le.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:a=>a.getAttribute("data-background-color"),renderHTML:a=>{const n=a.backgroundColor;return n?{"data-background-color":n,style:`background-color: ${n}`}:{}}}}}}),Xe=(((He=ye==null?void 0:ye.Node)==null?void 0:He.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!1,selectable:!0,addAttributes(){return{src:{default:null},controls:{default:!0},autoplay:{default:!1},loop:{default:!1},muted:{default:!1},poster:{default:null},playsinline:{default:!0},uploading:{default:null,parseHTML:t=>t.getAttribute("data-uploading")?!0:null,renderHTML:t=>t.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:t=>{const a=t.getAttribute("width")||t.style.width||"",n=String(a).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const a=t.getAttribute("height")||t.style.height||"",n=String(a).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.height?{height:t.height}:{}},class:{default:"tiptap-video"}}},parseHTML(){return[{tag:"video[data-tiptap-video]"},{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",{"data-tiptap-video":"",...t}]},renderMarkdown(t){const a=(t==null?void 0:t.attrs)||{},n=typeof a.src=="string"?a.src:"";return n?`[video](${n})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const a=/^\[video\]\(([^)]+)\)/.exec(t);if(a)return{type:"video",raw:a[0],href:a[1]}}},parseMarkdown(t){const a=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return a?{type:"video",attrs:{src:a,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:a,editor:n})=>{var f,_,b,m,x;const o=document.createElement("video"),i=t.attrs;o.src=i.src||"",o.controls=i.controls!==!1,o.autoplay=!1,o.loop=!!i.loop,o.muted=!!i.muted,i.poster&&(o.poster=i.poster),o.setAttribute("playsinline","true"),i.class&&(o.className=String(i.class)),typeof i.width=="number"&&(o.style.width=`${i.width}px`),typeof i.height=="number"&&(o.style.height=`${i.height}px`),o.style.display="inline-block";const r=new we.ResizableNodeView({element:o,node:t,getPos:a,onResize:(N,w)=>{o.style.width=`${N}px`,o.style.height=`${w}px`},onCommit:(N,w)=>{try{const c=n,s=a();if(s!==void 0){const{state:k}=c,g=k.schema.nodes.video,u=k.doc.nodeAt(s);if(g&&u){const L={...u.attrs||{},width:N,height:w},S=k.tr.setNodeMarkup(s,g,L,u.marks);c.view.dispatch(S)}}}catch{}},onUpdate:N=>{const w=N.attrs||{};if(typeof w.src=="string"&&w.src&&o.src!==w.src&&(o.src=w.src),typeof w.width=="number"&&(o.style.width=`${w.width}px`),typeof w.height=="number"&&(o.style.height=`${w.height}px`),w.uploading){r.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}else r.wrapper.removeAttribute("data-uploading"),o.controls=w.controls!==!1,o.style.pointerEvents="";return!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:120,height:80},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});o.addEventListener("dragstart",N=>{const w=n;if(!(w!=null&&w.isEditable))try{N.preventDefault()}catch{}});try{o.setAttribute("draggable","false"),(_=(f=r==null?void 0:r.wrapper)==null?void 0:f.setAttribute)==null||_.call(f,"draggable","false"),(m=(b=r==null?void 0:r.container)==null?void 0:b.setAttribute)==null||m.call(b,"draggable","false")}catch{}try{r.container.style.display="inline-block",r.wrapper.style.display="inline-block"}catch{}const y=document.createElement("div");y.className="tiptap-upload-mask";const p=document.createElement("div");if(p.className="tiptap-upload-progress",y.appendChild(p),r.wrapper.appendChild(y),(x=t.attrs)!=null&&x.uploading){r.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}return r}},addCommands(){return{setVideo:t=>({chain:a})=>{const{src:n,HTMLAttributes:o={}}=t||{};return a().insertContent({type:this.name,attrs:{src:n,...o}}).run()}}}}),Qe=ze.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:a,getPos:n})=>{const o=document.createElement("li");o.setAttribute("data-type","taskItem"),o.setAttribute("data-checked",t.attrs.checked?"true":"false");const i=document.createElement("span");i.className="todo-box",i.tabIndex=0,i.setAttribute("role","checkbox"),i.setAttribute("aria-checked",t.attrs.checked?"true":"false"),i.addEventListener("mousedown",p=>p.preventDefault());const r=()=>{const p=typeof n=="function"?n():null;if(p==null)return{pos:null,n:null};const f=a.view.state.doc.nodeAt(p);return{pos:p,n:f}};i.addEventListener("click",()=>{var N;const{pos:p,n:f}=r();if(p==null||!f)return;const _=a.view.state,b=_.schema.nodes.taskItem,m=!!((N=f.attrs)!=null&&N.checked),x=_.tr.setNodeMarkup(p,b,{...f.attrs||{},checked:!m});a.view.dispatch(x)}),i.addEventListener("keydown",p=>{var f;if(p.key==="Enter"||p.key===" "){p.preventDefault();const{pos:_,n:b}=r();if(_==null||!b)return;const m=a.view.state,x=m.schema.nodes.taskItem,N=!!((f=b.attrs)!=null&&f.checked),w=m.tr.setNodeMarkup(_,x,{...b.attrs||{},checked:!N});a.view.dispatch(w)}});const y=document.createElement("div");return y.className="task-content",o.appendChild(i),o.appendChild(y),{dom:o,contentDOM:y,update(p){return p.type!==t.type?!1:(o.setAttribute("data-checked",p.attrs.checked?"true":"false"),i.setAttribute("aria-checked",p.attrs.checked?"true":"false"),!0)}}}}});var et={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function tt(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function ot(t,a,n){var o=typeof a.fill=="string"?[a.fill]:a.fill||[],i=[],r=a.theme||n.theme;switch(r){case"outline":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("none"),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("none");break;case"filled":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("#FFF"),i.push("#FFF");break;case"two-tone":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone);break;case"multi-color":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.multiColor.outFillColor),i.push(typeof o[2]=="string"?o[2]:n.colors.multiColor.innerStrokeColor),i.push(typeof o[3]=="string"?o[3]:n.colors.multiColor.innerFillColor);break}return{size:a.size||n.size,strokeWidth:a.strokeWidth||n.strokeWidth,strokeLinecap:a.strokeLinecap||n.strokeLinecap,strokeLinejoin:a.strokeLinejoin||n.strokeLinejoin,colors:i,id:t}}var nt=Symbol("icon-context");function re(t,a,n){var o={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(r){var y=tt(),p=e.inject(nt,et);return function(){var f=r.size,_=r.strokeWidth,b=r.strokeLinecap,m=r.strokeLinejoin,x=r.theme,N=r.fill,w=r.spin,c=ot(y,{size:f,strokeWidth:_,strokeLinecap:b,strokeLinejoin:m,theme:x,fill:N},p),s=[p.prefix+"-icon"];return s.push(p.prefix+"-icon-"+t),a&&p.rtl&&s.push(p.prefix+"-icon-rtl"),w&&s.push(p.prefix+"-icon-spin"),e.createVNode("span",{class:s.join(" ")},[n(c)])}}};return o}const fe=re("check",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M43 11L16.875 37L5 25.1818",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ge=re("down-one",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19L24 31L12 19H36Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null)])}),rt=re("font-size-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M4 44L24 4L44 44",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 28H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),lt=re("full-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6H42V15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 33V42H33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42H6V33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 15V6H15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),it=re("go-on",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 7L43 13.4615L36 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M40 14H17.0062C10.1232 14 4.27787 19.6204 4.00964 26.5C3.72612 33.7696 9.73291 40 17.0062 40H34.0016",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),st=re("off-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6V15H42",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 6V15H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42V33H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33 42V33H41.8995",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),at=re("preview-close-one",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 42L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ct=re("return",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),dt=re("search",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M21 38C30.3888 38 38 30.3888 38 21C38 11.6112 30.3888 4 21 4C11.6112 4 4 11.6112 4 21C4 30.3888 11.6112 38 21 38Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M26.657 14.3431C25.2093 12.8954 23.2093 12 21.0001 12C18.791 12 16.791 12.8954 15.3433 14.3431",stroke:t.colors[2],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33.2216 33.2217L41.7069 41.707",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ft=re("strikethrough",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M5 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M24 24C40 30 34 44 24 44C13.9999 44 12 36 12 36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M35.9999 12C35.9999 12 33 4 23.9999 4C14.9999 4 11.4359 11.5995 15.6096 18",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 36C12 36 15.9999 44 24 44C32 44 36.564 36.4005 32.3903 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),pt=re("text-bold",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 24C29.5056 24 33.9688 19.5228 33.9688 14C33.9688 8.47715 29.5056 4 24 4H11V24H24Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.0312 44C33.5368 44 38 39.5228 38 34C38 28.4772 33.5368 24 28.0312 24H11V44H28.0312Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),mt=re("text-italic",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M20 6H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 42H28",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M29 5.95215L19 41.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ut=re("text-underline",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M8 44H40",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M37 6.09717C37 12.7638 37 15.3335 37 22.0002C37 29.1799 31.1797 35.0002 24 35.0002C16.8203 35.0002 11 29.1799 11 22.0002C11 15.3335 11 12.7638 11 6.09717",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap},null)])}),ht={class:"label"},gt={key:0,class:"shortcut"},kt=e.defineComponent({__name:"Tooltip",props:{text:{type:String,required:!0},shortcut:{type:String,default:""},placement:{type:String,default:"bottom"},offset:{type:Number,default:6}},setup(t){const a=t,n=e.ref(null),o=e.ref(null),i=e.ref(!1),r=e.ref(a.placement),y=e.ref({top:0,left:0});function p(){const b=n.value,m=o.value;if(!b||!m)return;let x=a.placement;const N=m.getBoundingClientRect(),w=N.top,c=window.innerHeight-N.bottom,s=b.offsetHeight+a.offset;x==="bottom"?c<s&&w>=s&&(x="top"):w<s&&c>=s&&(x="bottom"),r.value=x;const k=N.left+N.width/2,g=x==="bottom"?N.bottom+a.offset:N.top-a.offset-b.offsetHeight;y.value={top:g,left:k}}function f(){i.value=!0,e.nextTick(p)}function _(){i.value=!1}return e.onMounted(()=>{window.addEventListener("resize",p),window.addEventListener("scroll",p,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,!0)}),e.watch(()=>a.text,()=>e.nextTick(p)),(b,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:o,class:"tooltip-wrapper",onMouseenter:f,onMouseleave:_,onFocusin:f,onFocusout:_},[e.renderSlot(b.$slots,"default",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"tipRef",ref:n,class:e.normalizeClass(["tooltip",[r.value,{visible:i.value}]]),style:e.normalizeStyle({top:y.value.top+"px",left:y.value.left+"px"})},[e.createElementVNode("div",ht,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",gt,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],6)]))],544))}}),K=(t,a)=>{const n=t.__vccOpts||t;for(const[o,i]of a)n[o]=i;return n},U=K(kt,[["__scopeId","data-v-2e4633d5"]]),wt=["aria-expanded"],Ct={class:"label"},yt={key:0,class:"dropdown",role:"listbox"},xt=["aria-selected","onClick"],bt={class:"text"},xe="md-toolbar-dropdown-open",Se="font-size-select",Vt=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],o=e.computed(()=>{var x,N;const m=(N=(x=a.editor)==null?void 0:x.getAttributes("textStyle"))==null?void 0:N.fontSize;return typeof m=="string"&&m?m:"15px"}),i=e.ref(!1),r=e.ref(null);function y(){i.value||window.dispatchEvent(new CustomEvent(xe,{detail:{id:Se}})),i.value=!i.value}function p(){i.value=!1}function f(m){var x;(x=a.editor)==null||x.chain().focus().setMark("textStyle",{fontSize:m}).run(),p()}function _(m){const x=m.target,N=r.value;N&&!N.contains(x)&&p()}e.onMounted(()=>{document.addEventListener("click",_),window.addEventListener(xe,b)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",_),window.removeEventListener(xe,b)});function b(m){var N;((N=m.detail)==null?void 0:N.id)!==Se&&(i.value=!1)}return(m,x)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size-wrapper",ref_key:"rootRef",ref:r},[e.createVNode(e.unref(U),{text:"字体大小",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(y,["stop"]),"aria-expanded":i.value},[e.createElementVNode("div",Ct,e.toDisplayString(o.value),1),e.createVNode(e.unref(ge),{theme:"filled",strokeWidth:3})],8,wt)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",yt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,N=>e.createElementVNode("div",{key:N,class:"dropdown-item","aria-selected":N===o.value,onClick:e.withModifiers(w=>f(N),["stop"])},[N===o.value?(e.openBlock(),e.createBlock(e.unref(fe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",bt,e.toDisplayString(N),1)],8,xt)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-87f86dca"]]),_t=["aria-expanded"],Et={key:0,class:"dropdown"},Nt={class:"section"},vt={class:"swatches"},Mt=["onClick"],Bt={class:"section"},Lt={class:"swatches grid"},zt=["onClick"],St={key:0,class:"section"},$t={class:"swatches"},Tt=["onClick"],Dt={class:"section inline-actions"},Ft={key:1,class:"advanced"},be="md-toolbar-dropdown-open",$e="color-select",At=K(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const a=t,n=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],o=e.ref(!1),i=e.ref(!1),r=e.ref(null),y=e.ref(a.currentColor||"#000000"),p=e.ref(s()),f=e.ref("#F5222D");function _(){o.value||window.dispatchEvent(new CustomEvent(be,{detail:{id:$e}})),o.value=!o.value}function b(){o.value=!1}function m(){i.value=!i.value}function x(S){var B;(B=a.editor)==null||B.chain().focus().setColor(S).run(),f.value=S,k(S),b()}function N(){var S;(S=a.editor)==null||S.chain().focus().unsetColor().run(),b()}function w(S){const B=S.target,C=r.value;C&&!C.contains(B)&&b()}function c(){}function s(){try{const S=localStorage.getItem("md_color_recent");if(!S)return[];const B=JSON.parse(S);return Array.isArray(B)?B.slice(0,12):[]}catch{return[]}}function k(S){const B=[S,...p.value.filter(C=>C!==S)];p.value=B.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(p.value))}catch{}}let g=[];function u(){const S=a.editor;S&&(g=[{event:"selectionUpdate",handler:c},{event:"transaction",handler:c},{event:"update",handler:c}],g.forEach(({event:B,handler:C})=>{S.on(B,C)}))}e.onMounted(()=>{document.addEventListener("click",w),window.addEventListener(be,L),u()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",w),window.removeEventListener(be,L);const S=a.editor;S&&g.forEach(({event:B,handler:C})=>{S.off(B,C)}),g=[]}),e.watch(()=>a.editor,(S,B)=>{B&&g.forEach(({event:C,handler:M})=>{B.off(C,M)}),g=[],u()});function L(S){var C;((C=S.detail)==null?void 0:C.id)!==$e&&(o.value=!1)}return(S,B)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select-wrapper",ref_key:"rootRef",ref:r},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createVNode(e.unref(U),{text:"文字颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:B[0]||(B[0]=e.withModifiers(C=>x(f.value),["stop"]))},[e.createVNode(e.unref(rt),{theme:"filled",size:"14",fill:f.value,strokeWidth:3},null,8,["fill"]),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:f.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(_,["stop"])},[e.createVNode(e.unref(ge),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,_t),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",Et,[e.createElementVNode("div",Nt,[B[4]||(B[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),C=>(e.openBlock(),e.createElementBlock("div",{key:C,class:"swatch",style:e.normalizeStyle({background:C}),onClick:e.withModifiers(M=>x(C),["stop"])},[C===f.value?(e.openBlock(),e.createBlock(e.unref(fe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Mt))),128))])]),e.createElementVNode("div",Bt,[B[5]||(B[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),C=>(e.openBlock(),e.createElementBlock("div",{key:C,class:"swatch",style:e.normalizeStyle({background:C}),onClick:e.withModifiers(M=>x(C),["stop"])},[C===f.value?(e.openBlock(),e.createBlock(e.unref(fe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,zt))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",St,[B[6]||(B[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,C=>(e.openBlock(),e.createElementBlock("div",{key:C,class:"swatch",style:e.normalizeStyle({background:C}),onClick:e.withModifiers(M=>x(C),["stop"])},null,12,Tt))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Dt,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(N,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(m,["stop"])},"更多颜色")]),i.value?(e.openBlock(),e.createElementBlock("div",Ft,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":B[1]||(B[1]=C=>y.value=C)},null,512),[[e.vModelText,y.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":B[2]||(B[2]=C=>y.value=C)},null,512),[[e.vModelText,y.value]]),e.createElementVNode("button",{class:"btn apply",onClick:B[3]||(B[3]=e.withModifiers(C=>x(y.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-1656be6b"]]),Ht='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565315763" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81778" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM224 352h576v96H224zM224 800h576v96H224z" p-id="81779"></path></svg>',Ut='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565310640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81615" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h832v96H96zM96 800h832v96H96z" p-id="81616"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565296828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h576v96H96zM96 800h576v96H96z" p-id="81290"></path></svg>',It='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565306218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81452" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM352 352h576v96H352zM352 800h576v96H352z" p-id="81453"></path></svg>',Ot='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763562183158" class="icon" viewBox="0 0 1102 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="79129" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.37109375" height="18"><path d="M93.105231 187.943385a78.769231 78.769231 0 1 1 0-157.538462 78.769231 78.769231 0 0 1 0 157.538462z m0 393.846153a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461z m0 393.846154a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461zM276.243692 161.792v-118.153846h787.692308v118.153846h-787.692308z m0.472616 397.233231v-118.153846h788.007384v118.153846H276.716308z m-3.308308 397.154461v-118.153846h789.267692v118.153846H273.329231z" fill="#333333" p-id="79130"></path></svg>',Wt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763566846467" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="83576" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M477.098667 709.717333a46.805333 46.805333 0 0 0 69.802666 0l296.021334-340.736c24.32-28.032 3.328-70.314667-34.944-70.314666H216.021333c-38.272 0-59.306667 42.282667-34.944 70.314666l296.021334 340.736z" fill="#000000" p-id="83577"></path></svg>',Rt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763568214776" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="84748" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M682.666667 772.266667l332.8-247.466667-324.266667-435.2-409.6 307.2-256 192L260.266667 896h691.2v-85.333333h-324.266667l55.466667-38.4zM674.133333 213.333333l221.866667 294.4-260.266667 196.266667-38.4 25.6-230.4-285.866667L674.133333 213.333333zM145.066667 605.866667l149.333333-110.933334 230.4 285.866667-34.133333 29.866667H298.666667l-153.6-204.8z" fill="#333333" p-id="84749"></path></svg>',Pt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763479929532" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="52528" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M621.568 208.299a38.101 38.101 0 0 0-73.941-18.518L386.773 833.28a38.101 38.101 0 0 0 73.899 18.475l160.853-643.456zM325.632 294.4a38.101 38.101 0 0 1 0 53.888L162.347 511.573 325.632 674.86a38.101 38.101 0 0 1-53.845 53.888L81.493 538.539a38.101 38.101 0 0 1 0-53.931L271.787 294.4a38.101 38.101 0 0 1 53.888 0z m372.736 0a38.101 38.101 0 0 0 0 53.888l163.285 163.285L698.368 674.86a38.101 38.101 0 0 0 53.888 53.888l190.25-190.208a38.101 38.101 0 0 0 0-53.931L752.257 294.4a38.101 38.101 0 0 0-53.888 0z" fill="#333333" p-id="52529"></path></svg>',Gt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480012496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="54461" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M338.986667 59.413333h52.586666a21.333333 21.333333 0 0 1 21.333334 21.333334V115.84a21.333333 21.333333 0 0 1-21.333334 21.333333H356.266667c-36.48 0-53.76 20.16-53.76 62.4v188.16c0 59.52-27.84 99.84-82.56 120 54.72 23.04 82.56 62.4 82.56 120v189.12c0 40.32 17.28 61.44 53.76 61.44h35.306666a21.333333 21.333333 0 0 1 21.333334 21.333334v35.093333a21.333333 21.333333 0 0 1-21.333334 21.333333H338.986667c-42.24 0-74.88-14.4-97.92-41.28-21.12-24.96-31.68-59.52-31.68-101.76v-180.48c0-27.84-5.76-48-17.28-60.48-11.178667-12.778667-29.653333-20.245333-55.466667-23.488a18.901333 18.901333 0 0 1-16.533333-18.773333v-43.221333c0-10.005333 7.381333-18.474667 17.28-19.84 25.408-3.498667 43.648-11.456 54.72-23.317334 11.52-13.44 17.28-33.6 17.28-60.48V203.413333c0-43.2 10.56-77.76 31.68-102.72 23.04-27.84 55.68-41.28 97.92-41.28z m292.48 0h52.586666c42.24 0 74.88 13.44 97.92 41.28 21.12 24.96 31.68 59.52 31.68 102.72v179.52c0 26.88 5.76 48 18.24 61.44 10.24 11.029333 28.224 18.816 53.418667 22.314667 10.112 1.408 17.621333 10.026667 17.621333 20.245333v40.746667a21.333333 21.333333 0 0 1-18.88 21.184c-24.576 3.413333-42.282667 10.794667-53.12 23.189333-11.52 12.48-17.28 32.64-17.28 60.48v180.48c0 42.24-10.56 76.8-31.68 101.76-23.04 26.88-55.68 41.28-97.92 41.28H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V899.626667a21.333333 21.333333 0 0 1 21.333334-21.333334h35.306666c35.52 0 53.76-21.12 53.76-61.44v-189.12c0-57.6 26.88-96.96 82.56-120-55.68-20.16-82.56-60.48-82.56-120v-188.16c0-42.24-18.24-62.4-53.76-62.4H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V80.746667a21.333333 21.333333 0 0 1 21.333334-21.333334z" fill="#000000" p-id="54462"></path></svg>',qt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1768469045840" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6989" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M393.846154 64.174932l117.454119 0.399843H512.499805l117.454119-0.399843-10.395939 10.395939c-18.89262 18.89262-28.488872 44.982429-26.28973 71.472081l20.292073 250.502148c2.998829 36.68567 18.092932 72.171808 42.483405 99.661069l34.186646 38.684889-122.252245-0.899648-55.478329-0.399844h-0.99961l-55.478329 0.399844-122.452167 0.799687 34.186646-38.684888c24.390472-27.589223 39.484576-62.9754 42.483405-99.66107l20.292074-250.402187c2.199141-26.589613-7.397111-52.679422-26.289731-71.472081l-10.395939-10.395939m281.889887-64.174932h-0.199922L512.399844 0.599766h-0.799688L348.36392 0h-0.199922c-20.891839 0-39.684498 13.494729-45.582194 33.58688-4.098399 13.994533-1.899258 30.887934 17.79305 47.581414l38.584927 38.584927c5.597813 5.597813 8.39672 13.294807 7.796955 21.091761L346.464662 391.247169c-1.899258 23.190941-11.195627 45.08239-26.589613 62.475596l-61.87583 69.872706c-8.696603 9.796173-13.894572 22.291292-14.394377 35.386177-0.299883 8.996486 1.599375 18.89262 8.596642 27.28934 6.897306 8.296759 17.293245 12.894963 27.989067 12.894963h0.299882l175.931277-1.199532 55.178446 422.834831 0.399844 3.098789 0.399844-3.098789 55.178446-422.834831 175.931277 1.199532h0.299882c10.795783 0 21.191722-4.598204 27.989067-12.894963 6.897306-8.39672 8.796564-18.292854 8.596642-27.28934-0.399844-13.094885-5.697774-25.590004-14.394377-35.386177l-61.87583-69.872706c-15.393987-17.393206-24.690355-39.284654-26.589613-62.475596l-20.292074-250.402187c-0.599766-7.796954 2.199141-15.593909 7.796955-21.091761l38.584927-38.584927c19.692308-16.693479 21.891449-33.58688 17.79305-47.581414-5.997657-19.992191-24.790316-33.58688-45.682155-33.58688z" p-id="6990"></path></svg>',Yt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763569611105" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="87406" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 0.6 0.1 1.3 0.2 1.9-0.1 2-0.2 4.1-0.2 6.1 0 46.4 37.6 84 84 84s84-37.6 84-84c0-2.1-0.1-4.1-0.2-6.1 0.1-0.6 0.2-1.2 0.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z" p-id="87407"></path></svg>',Kt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763473363174" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28322" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M957.610667 507.434667L603.221333 158.293333a7.893333 7.893333 0 0 0-11.221333 0L353.28 393.386667a8.021333 8.021333 0 0 0-0.085333 11.306666l0.085333 0.128 40.021333 39.381334-117.205333 115.285333a8.021333 8.021333 0 0 0-0.085333 11.306667l0.085333 0.128 39.509333 38.869333-189.098666 187.008H72.106667a8.106667 8.106667 0 0 0-8.106667 8.021333v55.168c0 4.394667 3.584 8.021333 8.021333 8.021334H416.853333c2.133333 0 4.096-0.810667 5.589334-2.304l76.117333-75.605334 40.405333 39.808a7.936 7.936 0 0 0 11.178667 0l117.12-115.626666 40.106667 39.509333a7.893333 7.893333 0 0 0 11.178666 0l238.72-235.178667a7.68 7.68 0 0 0 0.298667-11.221333z m-567.808 288.853333H229.546667l134.4-133.034667 80.128 78.933334-54.314667 54.058666z m154.794666-62.122667l-171.392-168.917333 68.608-67.584 171.392 168.874667-68.608 67.626666z m168.533334-76.117333l-262.826667-258.901333 147.285333-145.066667 262.826667 258.986667-147.328 144.981333z" fill="#999999" p-id="28323"></path></svg>',Zt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480451042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="58395" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M938.666667 553.92V768c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V256c0-64.8 52.533333-117.333333 117.333334-117.333333h618.666666c64.8 0 117.333333 52.533333 117.333334 117.333333v297.92z m-64-74.624V256a53.333333 53.333333 0 0 0-53.333334-53.333333H202.666667a53.333333 53.333333 0 0 0-53.333334 53.333333v344.48A290.090667 290.090667 0 0 1 192 597.333333a286.88 286.88 0 0 1 183.296 65.845334C427.029333 528.384 556.906667 437.333333 704 437.333333c65.706667 0 126.997333 16.778667 170.666667 41.962667z m0 82.24c-5.333333-8.32-21.130667-21.653333-43.648-32.917333C796.768 511.488 753.045333 501.333333 704 501.333333c-121.770667 0-229.130667 76.266667-270.432 188.693334-2.730667 7.445333-7.402667 20.32-13.994667 38.581333-7.68 21.301333-34.453333 28.106667-51.370666 13.056-16.437333-14.634667-28.554667-25.066667-36.138667-31.146667A222.890667 222.890667 0 0 0 192 661.333333c-14.464 0-28.725333 1.365333-42.666667 4.053334V768a53.333333 53.333333 0 0 0 53.333334 53.333333h618.666666a53.333333 53.333333 0 0 0 53.333334-53.333333V561.525333zM320 480a96 96 0 1 1 0-192 96 96 0 0 1 0 192z m0-64a32 32 0 1 0 0-64 32 32 0 0 0 0 64z" fill="#000000" p-id="58396"></path></svg>',Jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480387136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="57289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M213.972 214.906l0.934-0.934c27.606-27.606 68.674-30.581 92.168-7.087l225.23 225.23c29.72-40.254 30.733-93.311-0.599-124.643L345.639 121.406c-35.132-35.132-97.076-30.148-138.356 11.132l-74.744 74.744c-41.28 41.28-46.264 103.224-11.132 138.356l186.065 186.065c31.332 31.332 84.389 30.319 124.643 0.599l-225.23-225.23c-23.494-23.492-20.519-64.56 7.087-92.166zM808.745 809.679l0.934-0.934c27.606-27.606 31.18-68.074 7.686-91.568l-225.23-225.23c40.254-29.72 93.311-30.733 124.643 0.599l186.065 186.065c35.132 35.132 29.548 96.477-11.732 137.757l-74.744 74.744c-41.28 41.28-102.625 46.863-137.757 11.732L492.546 716.779c-31.332-31.332-31.909-82.799-0.599-124.643l225.23 225.23c23.494 23.494 63.962 19.92 91.568-7.687z" fill="#666666" p-id="57290"></path><path d="M627.123 628.713c-12.296 12.296-32.232 12.296-44.528 0L394.938 441.057c-12.296-12.296-12.296-32.232 0-44.528s32.232-12.296 44.528 0l187.656 187.656c12.297 12.296 12.297 32.232 0.001 44.528z" fill="#666666" p-id="57291"></path></svg>',Xt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763562537529" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="80294" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M107.5 736c28.6 0 52.2 7.1 70.2 21.4 18.5 15.1 27.9 36 27.9 61.7 0 22.9-8.4 41.3-24.7 54.1 16 12 29.6 32.8 29.6 57.3 0 27-9.7 49.7-28.8 67.2-19.6 17.5-45 26.3-75.6 26.3-29.2 0-53.4-7.8-71.7-23.3C14 983.6 2.4 958.4 0 926.1v-14.5h69.7V925c0.6 12.9 4.2 21.8 10.9 27.8 6.2 5.7 14.4 8.6 25.2 8.6 12.1 0 21.3-3.2 27.6-9.2 5.6-5.6 8.2-11.9 8.2-19.9 0-10-2.7-16.6-7.9-20.8-5.4-4.5-14.5-6.9-27.8-6.9H74.3v-58.9h31.5c11.6 0 19.8-2.2 24.5-6.1 4.1-3.5 6.3-9.2 6.3-17.4 0-8.3-2-13.9-5.3-17-4.6-3.9-12.3-6.1-23.5-6.1-11.5 0-19.3 2.5-24.8 7.4-5.5 4.8-8.9 12.8-10 23.7v13.4H5.1l-0.2-7v-8.2c2.4-29.1 13.4-52.1 32.7-68.2C55.8 744 79.3 736 107.5 736z m916.5 96v128H384V832h640zM106.9 368c28 0 51.7 8.4 70.5 25.1 18.8 17.1 28.2 39.1 28.2 65.8 0 25.4-9.7 48.8-28.8 70-10.4 11.1-27.9 24.8-55.3 43.2-10.1 6.6-18.5 12.9-25.2 18.7h109.3V656l-7.1 0.1-185.2-0.1c-4.5-0.6-7.5-1.6-9.8-3.8-2.4-2.4-3.2-5.6-3.5-10.4 0-29.7 9.6-55.5 28.8-77.1 10.3-11.8 30.6-28.1 61.1-49.1 14.4-10 25.7-19.2 32.4-26.3 8.9-10 13.2-20.3 13.2-30.8 0-9.8-2.3-16.6-6.4-20.4-4.5-4.1-12.2-6.3-23.6-6.3-11.3 0-18.8 3.4-24.1 10.6-5.7 7.3-9.2 19.8-9.9 37.7-0.5 3.9-1.6 6.8-3.8 9-2.1 2-4.8 3-10.4 4l-43-0.1c-4.2-0.8-7.1-1.9-9.2-4-2.2-2.3-3.2-5.3-3.7-10.3 0.4-32.1 9.9-58.3 28.6-78.2 19.6-21.6 45.5-32.5 76.9-32.5z m917.1 80v128H384V448h640zM146.6 0v288H75.1V94.2c-16.7 10.2-35.9 18.3-50.9 20.3l-8.2 1.6V46l4.8-2C39.3 37.3 52.5 31.7 60 27.6 71 20.9 82.1 11.7 96.3 0.1h50.3zM1024 64v128H384V64h640z" fill="#333333" p-id="80295"></path></svg>',Qt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480239307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="56277" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M849.6 231v109.5c-46.4 14.9-84.6 41.5-114.4 81.3-29.9 36.5-44.8 76.3-43.1 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 91.2 36.5 23.2 24.9 36.5 56.4 36.5 94.5S848 732 821.5 756.8C795 780 761.8 793.3 722 793.3c-46.4 0-82.9-19.9-112.8-56.4s-43.1-84.6-43.1-141c0-89.6 24.9-165.8 76.3-230.5C692 299 761.7 254.2 849.6 231z m-403 0v109.5c-46.4 14.9-82.9 41.5-112.8 81.3-31.5 36.5-46.4 76.3-44.8 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 89.6 36.5 24.9 24.9 38.1 56.4 38.1 94.5s-13.3 69.7-38.1 94.5c-26.5 23.2-61.4 36.5-101.2 36.5-46.4 0-82.9-19.9-111.1-56.4-29.9-36.5-44.8-84.6-44.8-141 0-89.6 24.9-165.8 76.3-230.5C289 299 358.7 254.2 446.6 231z" p-id="56278"></path></svg>',eo='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480808376" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="61532" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M959.825 384.002V191.94c0-70.692-57.308-128-128-128H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V384.002z m-813.16-237.337a63.738 63.738 0 0 1 45.336-18.785H832a63.962 63.962 0 0 1 63.886 64.121v128.061H127.88v-128.06a63.738 63.738 0 0 1 18.785-45.337z m269.127 461.308v-223.97h192.181v223.97H415.792z m192.181 63.94v223.972H415.792V671.914h192.181z m-256.121-63.94H127.88v-223.97h223.972v223.97zM146.665 877.21a63.467 63.467 0 0 1-18.785-45.21V671.914h223.972v223.97h-159.85a63.626 63.626 0 0 1-45.337-18.675z m749.22-45.21a63.763 63.763 0 0 1-63.886 63.886H671.914V671.914h223.97v160.085z m0-224.026H671.914v-223.97h223.97v223.97z" p-id="61533"></path></svg>',to='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480994147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="73821" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M933.529779 1022.701142H87.673207c-48.357498 0-87.523075-39.165577-87.523075-87.523076V1.798419h729.259049c48.357498 0 87.523075 39.165577 87.523076 87.523076v320.818031h204.220509V935.178066c-0.099912 48.357498-39.265489 87.523075-87.622987 87.523076z m-175.046151-904.205289c0-32.171724-26.077081-58.348717-58.348717-58.348717H58.498849v845.856572c0 32.171724 26.077081 58.348717 58.348717 58.348717h583.387257c32.171724 0 58.348717-26.077081 58.348717-58.348717V118.495853zM962.704137 468.588155h-145.871792v495.864182h87.523075c32.171724 0 58.348717-26.077081 58.348717-58.348717V468.588155z m-729.25905 0h379.166748v58.348717H233.445087V468.588155z m0-233.394868h379.166748v58.348717H233.445087v-58.348717z m262.569227 525.03854H233.445087v-58.348716h262.469314v58.348716z m0 0" p-id="73822"></path></svg>',oo='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763477549677" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31202" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M828.6 75C889.572 75 939 124.428 939 185.4v676.2c0 60.972-49.428 110.4-110.4 110.4H152.4C91.428 972 42 922.572 42 861.6V185.4C42 124.428 91.428 75 152.4 75z m0 59.8H152.4c-27.946 0-50.6 22.654-50.6 50.6v676.2c0 27.946 22.654 50.6 50.6 50.6h676.2c27.946 0 50.6-22.654 50.6-50.6V185.4c0-27.946-22.654-50.6-50.6-50.6z m-20.56 167.48c11.48 11.504 11.641 30.022 0.502 41.725l-0.548 0.56L477.473 674.37c-11.251 11.227-29.274 11.663-41.05 1.123l-0.574-0.527L260.695 509.93c-12.018-11.325-12.581-30.248-1.257-42.266 11.145-11.828 29.65-12.56 41.69-1.788l0.577 0.53L455.756 611.56l310-309.325c11.689-11.664 30.62-11.644 42.284 0.045z" fill="#333333" p-id="31203"></path></svg>',no='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480631673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="60480" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M960 192h-28.384c-16.8 0-32.928 6.624-44.928 18.432L800 295.936V256a96 96 0 0 0-96-96H96C43.072 160 0 203.04 0 256v512a96 96 0 0 0 96 96h608c52.992 0 96-43.008 96-96v-39.072l86.688 85.504c12 11.808 28.128 18.432 44.928 18.432H960a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64zM96 800c-17.664 0-32-14.368-32-32V256a32 32 0 0 1 32-32h608c17.632 0 32 14.336 32 32v512c0 17.632-14.368 32-32 32H96z m864-31.136h-32l-128-128V640l-32-32v-192l160-160h32v512.864z" fill="#333333" p-id="60481"></path></svg>',ro=["innerHTML"],Y=K(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{default:"#000"},size:{}},setup(t){const a=t,n=e.useAttrs(),o=Object.assign({"/src/svg/alignCenter.svg":Ht,"/src/svg/alignJustify.svg":Ut,"/src/svg/alignLeft.svg":jt,"/src/svg/alignRight.svg":It,"/src/svg/bulletList.svg":Ot,"/src/svg/caretDown.svg":Wt,"/src/svg/clearFormat.svg":Rt,"/src/svg/code.svg":Pt,"/src/svg/codeBlock.svg":Gt,"/src/svg/fixed.svg":qt,"/src/svg/formatBrush.svg":Yt,"/src/svg/highBg.svg":Kt,"/src/svg/img.svg":Zt,"/src/svg/link.svg":Jt,"/src/svg/orderedList.svg":Xt,"/src/svg/quote.svg":Qt,"/src/svg/table.svg":eo,"/src/svg/tableTools.svg":to,"/src/svg/task.svg":oo,"/src/svg/video.svg":no}),i=(()=>{const b={};return Object.entries(o).forEach(([m,x])=>{const w=(m.split("/src/svg/")[1]||m).replace(/\.svg$/i,"");b[w]=x;const c=w.split("/").pop();c&&(b[c]=x)}),b})(),r=e.computed(()=>{const b=a.name.replace(/\.svg$/i,"");return i[b]||""});function y(b){if(!b)return"";let m=b.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return m=m.replace(/<svg([^>]*)>/i,(x,N)=>`<svg${N.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet" fill="currentColor" stroke="currentColor">`),m=m.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),m=m.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),m=m.replace(/fill='(?!none)[^']*'/gi,'fill="currentColor"'),m=m.replace(/stroke='(?!none)[^']*'/gi,'stroke="currentColor"'),m}const p=e.computed(()=>y(r.value));function f(b){if(b!=null)return typeof b=="number"?`${b}px`:b}const _=e.computed(()=>{const b={},m=f(a.size);m&&(b.fontSize=m),a.color&&(b.color=a.color);const x=n.style??void 0;return[b,x].filter(Boolean)});return(b,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(n).class]),style:e.normalizeStyle(_.value),innerHTML:p.value},null,14,ro))}}),[["__scopeId","data-v-ee8563cd"]]),lo=["aria-expanded"],io={key:0,class:"dropdown"},so={class:"section"},ao={class:"swatches"},co={class:"section"},fo={class:"swatches"},po=["onClick"],mo={key:0,class:"check"},uo={class:"section"},ho={class:"swatches grid"},go=["onClick"],ko={key:0,class:"section"},wo={class:"swatches"},Co=["onClick"],yo={class:"section inline-actions"},xo={key:1,class:"advanced"},Ve="md-toolbar-dropdown-open",Te="bg-color-select",bo=K(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const a=t,n=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],o=e.ref(!1),i=e.ref(!1),r=e.ref(null),y=e.ref(a.currentBg||"#ffffff"),p=e.ref(k()),f=e.ref("#FADB14"),_=e.inject("theme");function b(){o.value||window.dispatchEvent(new CustomEvent(Ve,{detail:{id:Te}})),o.value=!o.value}function m(){o.value=!1}function x(){i.value=!i.value}function N(C){var M;(M=a.editor)==null||M.chain().focus().setMark("textStyle",{backgroundColor:C}).run(),f.value=C,g(C),m()}function w(){var C;(C=a.editor)==null||C.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),m()}function c(C){const M=C.target,$=r.value;$&&!$.contains(M)&&m()}function s(){}function k(){try{const C=localStorage.getItem("md_bg_recent");if(!C)return[];const M=JSON.parse(C);return Array.isArray(M)?M.slice(0,12):[]}catch{return[]}}function g(C){const M=[C,...p.value.filter($=>$!==C)];p.value=M.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(p.value))}catch{}}let u=[];function L(){const C=a.editor;C&&(u=[{event:"selectionUpdate",handler:s},{event:"transaction",handler:s},{event:"update",handler:s}],u.forEach(({event:M,handler:$})=>{C.on(M,$)}))}e.onMounted(()=>{document.addEventListener("click",c),window.addEventListener(Ve,S),L()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",c),window.removeEventListener(Ve,S);const C=a.editor;C&&u.forEach(({event:M,handler:$})=>{C.off(M,$)}),u=[]}),e.watch(()=>a.editor,(C,M)=>{M&&u.forEach(({event:$,handler:D})=>{M.off($,D)}),u=[],L()});function S(C){var $;(($=C.detail)==null?void 0:$.id)!==Te&&(o.value=!1)}const B=e.computed(()=>f.value?f.value:_==="dark"?"#fff":"#000");return(C,M)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select-wrapper",ref_key:"rootRef",ref:r},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createVNode(e.unref(U),{text:"背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:M[0]||(M[0]=e.withModifiers($=>N(f.value),["stop"]))},[e.createVNode(Y,{name:"highBg",size:17,color:B.value},null,8,["color"]),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:f.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref(ge),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,lo),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("div",so,[M[4]||(M[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",ao,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
|
|
3
3
|
45deg,
|
|
4
4
|
#fff 45%,
|
|
5
5
|
transparent 45%,
|
|
6
6
|
transparent 55%,
|
|
7
7
|
#fff 55%
|
|
8
|
-
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(k,["stop"])})])]),e.createElementVNode("div",so,[M[5]||(M[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},[S===f.value?(e.openBlock(),e.createElementBlock("span",fo,"✓")):e.createCommentVNode("",!0)],12,co))),128))])]),e.createElementVNode("div",po,[M[6]||(M[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},[S===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,uo))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",ho,[M[7]||(M[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},null,12,ko))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",wo,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(k,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(E,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",Co,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":M[1]||(M[1]=S=>C.value=S)},null,512),[[e.vModelText,C.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":M[2]||(M[2]=S=>C.value=S)},null,512),[[e.vModelText,C.value]]),e.createElementVNode("button",{class:"btn apply",onClick:M[3]||(M[3]=e.withModifiers(S=>y(C.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-f414a9de"]]),xo={class:"image-actions"},bo=["aria-disabled","disabled"],Vo=J(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=e.inject("theme"),r=t,n=e.ref(!1),a=e.ref(""),i=e.ref(!1),C=e.ref(null),p=()=>{n.value=!n.value},f=()=>{var d,s,g,h,u,B;const k=a.value.trim();k&&((B=(u=((h=(s=(d=r.editor)==null?void 0:d.chain)==null?void 0:(g=s.call(d)).focus)==null?void 0:h.call(g)).setImage({src:k})).run)==null||B.call(u),n.value=!1,a.value="")},N=k=>{k.key==="Enter"&&f(),k.key==="Escape"&&(n.value=!1,a.value="")},x=()=>{var k;r.imageUploader&&((k=C.value)==null||k.click())},m=async k=>{var h,u,B,z,v,w,M,S;const d=k.target,s=(h=d.files)==null?void 0:h[0];if(d.value="",!s||!r.imageUploader)return;const g=(u=r.uploadSizeLimit)==null?void 0:u.image;if(typeof g=="number"&&g>0){const $=Math.max(1,g)*1024*1024;if(s.size>$){try{window.alert(`图片文件大小超限(${(s.size/1024/1024).toFixed(2)}MB > ${g}MB)`)}catch{}return}}try{i.value=!0;let $=null;$=URL.createObjectURL(s),(S=(M=((w=(z=(B=r.editor)==null?void 0:B.chain)==null?void 0:(v=z.call(B)).focus)==null?void 0:w.call(v)).setImage({src:$,uploading:!0})).run)==null||S.call(M);const A=await r.imageUploader(s);if(typeof A=="string"&&A){const j=r.editor,{state:R}=j,{doc:W}=R;let Z=null;if(W.descendants((G,X)=>{var K,ne;return((K=G==null?void 0:G.type)==null?void 0:K.name)==="image"&&((ne=G==null?void 0:G.attrs)==null?void 0:ne.src)===$?(Z=X,!1):!0}),Z!=null){const G=W.nodeAt(Z),X=R.schema.nodes.image;if(G&&X){const K={...G.attrs||{},src:A,uploading:null},ne=R.tr.setNodeMarkup(Z,X,K,G.marks);j.view.dispatch(ne)}}n.value=!1,a.value=""}}finally{i.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},E=e.ref(null);let y=null;return e.onMounted(()=>{y=k=>{if(!n.value)return;const d=E.value,s=k.target;d&&s&&!d.contains(s)&&(n.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)}),(k,d)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:p,ref_key:"rootRef",ref:E},[e.createVNode(e.unref(U),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"img",size:18,color:e.unref(c)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":d[0]||(d[0]=s=>a.value=s),onKeydown:N},null,544),[[e.vModelText,a.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:C,type:"file",accept:"image/*",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",xo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.imageUploader||i.value,disabled:!r.imageUploader||i.value,onClick:e.withModifiers(x,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,bo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-dad55a02"]]),_o={class:"video-actions"},Eo=["aria-disabled","disabled"],No=J(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=e.inject("theme"),r=t,n=e.ref(!1),a=e.ref(""),i=e.ref(!1),C=e.ref(null),p=()=>{n.value=!n.value},f=()=>{const d=a.value.trim();if(!d)return;const s=r.editor,g=s==null?void 0:s.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(d)){const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}else if(typeof(g==null?void 0:g.setVideo)=="function")s.chain().focus().setVideo({src:d,HTMLAttributes:{controls:!0,width:640}}).run();else{const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}n.value=!1,a.value=""},N=d=>{d.key==="Enter"&&f(),d.key==="Escape"&&(n.value=!1,a.value="")},x=()=>{var d;r.videoUploader&&((d=C.value)==null||d.click())},m=async d=>{var B,z;const s=d.target,g=(B=s.files)==null?void 0:B[0];if(s.value="",!g||!r.videoUploader)return;const h=(z=r.uploadSizeLimit)==null?void 0:z.video;if(typeof h=="number"&&h>0){const v=Math.max(1,h)*1024*1024;if(g.size>v){try{window.alert(`视频文件大小超限(${(g.size/1024/1024).toFixed(2)}MB > ${h}MB)`)}catch{}return}}let u=null;try{i.value=!0;const v=r.editor,w=v==null?void 0:v.commands;u=URL.createObjectURL(g);try{if(typeof(w==null?void 0:w.setVideo)=="function")v.chain().focus().setVideo({src:u,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const S=String(u).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{v.chain().focus().insertContent(`<p><a href="${S}" target="_blank" rel="noopener noreferrer">${S}</a></p>`).run()}catch{v.chain().focus().insertContent(S).run()}}}catch{}const M=await r.videoUploader(g);u&&E(u,M),n.value=!1,a.value=""}finally{i.value=!1;try{u&&URL.revokeObjectURL(u)}catch{}}};function E(d,s){const g=r.editor;if(!g)return;const{state:h}=g,{doc:u}=h;let B=null;if(u.descendants((z,v)=>{var w,M;return((w=z.type)==null?void 0:w.name)==="video"&&((M=z.attrs)==null?void 0:M.src)===d?(B=v,!1):!0}),B!=null){const z=u.nodeAt(B),v=h.schema.nodes.video;if(!z||!v)return;const w={...z.attrs||{},src:s,uploading:null},M=h.tr.setNodeMarkup(B,v,w,z.marks);g.view.dispatch(M)}}const y=e.ref(null);let k=null;return e.onMounted(()=>{k=d=>{if(!n.value)return;const s=y.value,g=d.target;s&&g&&!s.contains(g)&&(n.value=!1)},document.addEventListener("mousedown",k,!0)}),e.onBeforeUnmount(()=>{k&&(document.removeEventListener("mousedown",k,!0),k=null)}),(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:p,ref_key:"rootRef",ref:y},[e.createVNode(e.unref(U),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"video",size:16,color:e.unref(c)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:s[1]||(s[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":s[0]||(s[0]=g=>a.value=g),onKeydown:N},null,544),[[e.vModelText,a.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:C,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",_o,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.videoUploader||i.value,disabled:!r.videoUploader||i.value,onClick:e.withModifiers(x,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,Eo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-582dbd57"]]),vo={class:"fr-header"},Mo={key:0,class:"fr-body"},Bo={class:"fr-input-row"},Lo=["value"],zo={key:0,class:"fr-count"},So={class:"fr-actions"},$o={key:1,class:"fr-body"},To={class:"fr-input-row"},Do=["value"],Fo={key:0,class:"fr-count"},Ao={class:"fr-actions"},Ho=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t,{expose:c}){const r=t,n=e.ref(!1),a=e.ref("find"),i=e.ref(""),C=e.ref(""),p=e.ref([]),f=e.ref(0),N=e.computed(()=>{const $=p.value.length;return!i.value||!$?"0/0":`${Math.min(Math.max(f.value+1,1),$)}/${$}`}),x=typeof navigator<"u"&&navigator.platform.includes("Mac"),m=e.computed(()=>x?"⌘ F / ⌥ ⌘ F":"Ctrl F / Ctrl H"),E=()=>n.value=!n.value,y=()=>n.value=!1;function k(){var $;return(($=r.editor)==null?void 0:$.view)||null}function d(){const $=k(),A=i.value;if(p.value=[],f.value=0,!$||!A)return;const j=$.dom,R=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,null);let W;for(;W=R.nextNode();){const Z=W,G=Z.data||"";let X=0;for(;;){const K=G.indexOf(A,X);if(K===-1)break;const ne=$.posAtDOM(Z,K),re=$.posAtDOM(Z,K+A.length);typeof ne=="number"&&typeof re=="number"&&p.value.push({from:ne,to:re}),X=K+A.length}}e.nextTick(()=>{p.value.length&&s(0)})}function s($){const A=r.editor,j=k();if(!A||!j||!p.value.length)return;const R=p.value.length;f.value=($%R+R)%R;const W=p.value[f.value];A.chain().focus().setTextSelection({from:W.from,to:W.to}).run()}const g=()=>p.value.length&&s(f.value+1),h=()=>p.value.length&&s(f.value-1);function u(){const $=r.editor;if(!$||!p.value.length)return;const A=p.value[f.value],j=$.state.tr.insertText(C.value,A.from,A.to);$.view.dispatch(j),d()}function B(){const $=r.editor;if(!$||!p.value.length)return;const A=[...p.value],j=$.state.tr;for(let R=A.length-1;R>=0;R--){const W=A[R];j.insertText(C.value,W.from,W.to)}$.view.dispatch(j),d()}function z($){i.value=$.target.value,d()}function v($){$.key==="Enter"&&g(),$.key==="Escape"&&y()}const w=e.ref(null);let M=null;e.onMounted(()=>{M=$=>{if(!n.value)return;const A=w.value,j=$.target;A&&j&&!A.contains(j)&&y()},document.addEventListener("mousedown",M,!0)}),e.onBeforeUnmount(()=>{M&&(document.removeEventListener("mousedown",M,!0),M=null)});function S($){$&&(a.value=$),n.value=!0,e.nextTick(d)}return c({openPanel:S}),($,A)=>(e.openBlock(),e.createElementBlock("div",{class:"icon find-icon",ref_key:"rootRef",ref:w,onClick:E},[e.createVNode(e.unref(U),{text:"查找替换",shortcut:m.value,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"]),e.createVNode(e.Transition,{name:"find-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"find-input-panel",onClick:A[3]||(A[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vo,[e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="find"}]),onClick:A[0]||(A[0]=e.withModifiers(j=>a.value="find",["stop"]))}," 查找 ",2),e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="replace"}]),onClick:A[1]||(A[1]=e.withModifiers(j=>a.value="replace",["stop"]))}," 替换 ",2)]),a.value==="find"?(e.openBlock(),e.createElementBlock("div",Mo,[A[4]||(A[4]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",Bo,[e.createElementVNode("input",{class:"fr-input",value:i.value,placeholder:"输入关键字",onInput:z,onKeydown:v},null,40,Lo),i.value?(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",So,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(h,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])])):(e.openBlock(),e.createElementBlock("div",$o,[A[5]||(A[5]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",To,[e.createElementVNode("input",{class:"fr-input",value:i.value,placeholder:"输入关键字",onInput:z},null,40,Do),i.value?(e.openBlock(),e.createElementBlock("span",Fo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),A[6]||(A[6]=e.createElementVNode("label",{class:"fr-label"},"替换为",-1)),e.withDirectives(e.createElementVNode("input",{class:"fr-input",style:{width:"95%"},"onUpdate:modelValue":A[2]||(A[2]=j=>C.value=j),placeholder:"请输入"},null,512),[[e.vModelText,C.value]]),e.createElementVNode("div",Ao,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(B,["stop"])},"全部替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(u,["stop"])},"替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(h,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])]))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-8c079e6d"]]),Uo={class:"field"},jo={class:"field"},Io={class:"actions"},Oo=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(""),a=e.ref("");e.ref(!1);const i=e.ref(null),C=e.inject("theme");function p(){const d=c.editor;if(!r.value&&d)try{const s=d.state.selection,g=s.from;s.to>g?N():(n.value="链接",d.chain().focus().insertContent("链接").setTextSelection({from:g,to:g+2}).run())}catch{}r.value=!r.value,r.value&&f()}function f(){setTimeout(()=>{var s;const d=(s=i.value)==null?void 0:s.querySelector('input[name="link-text"]');d==null||d.focus(),d==null||d.select()},0)}function N(){const d=c.editor;if(d)try{const s=d.state.selection,g=s.from,h=s.to,B=h>g?d.state.doc.textBetween(g,h):"";n.value=B||"";const z=d.getAttributes("link")||{};a.value=typeof z.href=="string"?z.href:""}catch{}}function x(){const d=c.editor;if(!d)return;const s=n.value.trim(),g=a.value.trim();if(g)try{const h=d.state.selection,u=h.from,B=h.to;if(B>u){const v=m(s||d.state.doc.textBetween(u,B)),w=m(g);d.chain().focus().insertContent(`<a href="${w}" target="_blank" rel="noopener noreferrer">${v}</a>`,{from:u,to:B}).run()}else{const v=m(g),w=m(s||g);d.chain().focus().insertContent(`<a href="${v}" target="_blank" rel="noopener noreferrer">${w}</a>`).run()}}finally{r.value=!1,n.value="",a.value=""}}function m(d){return String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(d){d.key==="Enter"&&x(),d.key==="Escape"&&(r.value=!1)}let y=null;e.onMounted(()=>{y=d=>{if(!r.value)return;const s=i.value,g=d.target;s&&g&&!s.contains(g)&&(r.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)});const k=e.ref({});return e.watch(r,async d=>{var g;if(!d)return;const s=c.editor;if(s){await e.nextTick();try{const h=s.state.selection,u=h.from,B=h.to;if(!(B>u)){k.value={};return}const v=s.view.coordsAtPos(u),w=s.view.coordsAtPos(B),M=(v.left+w.right)/2,S=Math.max(v.bottom,w.bottom)+8,$=(g=i.value)==null?void 0:g.querySelector(".link-input-panel"),A=$?$.getBoundingClientRect():{width:320,height:120},j=window.innerWidth,R=window.innerHeight,W=12,Z=Math.max(W+A.width/2,Math.min(j-W-A.width/2,M)),G=S,X=Math.min(v.top,w.top)-A.height-8;let K=G;G+A.height+W>R&&X-W>=0&&(K=X),K=Math.max(W,Math.min(R-W-A.height,K)),k.value={position:"fixed",left:Math.round(Z)+"px",top:Math.round(K)+"px"}}catch{}}}),(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:p,ref_key:"rootRef",ref:i},[e.createVNode(e.unref(U),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"link",size:16,color:e.unref(C)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(k.value),onClick:s[2]||(s[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Uo,[s[3]||(s[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),onKeydown:E},null,544),[[e.vModelText,n.value]])]),e.createElementVNode("div",jo,[s[4]||(s[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":s[1]||(s[1]=g=>a.value=g),placeholder:"链接地址",onKeydown:E},null,544),[[e.vModelText,a.value]])]),e.createElementVNode("div",Io,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(x,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-84f547ec"]]),Wo={class:"grid"},Ro=["onMouseenter"],Po={class:"size"},Go=10,qo=10,Yo=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),n=e.ref(!1),a=e.ref(0),i=e.ref(0),C=e.computed(()=>{const x=Math.max(a.value,1),m=Math.max(i.value,1);return`${x} x ${m}`}),p=()=>{n.value=!n.value,n.value||(a.value=0,i.value=0)},f=(x,m)=>{a.value=x,i.value=m},N=()=>{var E,y,k,d,s,g,h,u;const x=Math.max(a.value,1),m=Math.max(i.value,1);(u=(g=(d=(y=(E=c.editor)==null?void 0:E.chain)==null?void 0:(k=y.call(E)).focus)==null?void 0:(s=d.call(k)).insertTable)==null?void 0:(h=g.call(s,{rows:x,cols:m,withHeaderRow:!0})).run)==null||u.call(h),n.value=!1,a.value=0,i.value=0};return(x,m)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:p},[e.createVNode(e.unref(U),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"table",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[m[1]||(m[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Wo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Go,E=>e.createElementVNode("div",{key:"r-"+E,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(qo,y=>e.createElementVNode("span",{key:"c-"+E+"-"+y,class:e.normalizeClass(["cell",{active:E<=a.value&&y<=i.value}]),onMouseenter:k=>f(E,y),onClick:e.withModifiers(N,["stop"])},null,42,Ro)),64))])),64))]),e.createElementVNode("div",Po,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-d0d98332"]]),Ko=["aria-disabled"],Jo={class:"tools-grid"},Zo=["disabled"],Xo=["disabled"],Qo=["disabled"],en=["disabled"],tn=["disabled"],on=["disabled"],nn=["disabled"],rn=["disabled"],ln=["disabled"],sn=["disabled"],an=["disabled"],cn=["disabled"],dn=["disabled"],fn=["disabled"],pn=["disabled"],mn=["disabled"],un=["disabled"],hn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.inject("theme"),a=()=>r.value=!r.value,i=(p,...f)=>{var x,m,E;const N=c.editor;return!!((E=(x=N==null?void 0:N.can)==null?void 0:(m=x.call(N))[p])!=null&&E.call(m,...f))},C=(p,...f)=>{var x,m,E,y,k,d,s;const N=c.editor;(s=(d=(k=(y=(E=(x=N==null?void 0:N.chain)==null?void 0:(m=x.call(N)).focus)==null?void 0:E.call(m))[p])==null?void 0:k.call(y,...f))==null?void 0:d.run)==null||s.call(d),r.value=!1};return(p,f)=>{var N,x;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:a,"aria-disabled":!((x=(N=c.editor)==null?void 0:N.isActive)!=null&&x.call(N,"table"))},[e.createVNode(e.unref(U),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"tableTools",size:15,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:f[17]||(f[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Jo,[e.createElementVNode("button",{class:"btn",onClick:f[0]||(f[0]=e.withModifiers(m=>C("addColumnBefore"),["stop"])),disabled:!i("addColumnBefore")}," 前插列 ",8,Zo),e.createElementVNode("button",{class:"btn",onClick:f[1]||(f[1]=e.withModifiers(m=>C("addColumnAfter"),["stop"])),disabled:!i("addColumnAfter")}," 后插列 ",8,Xo),e.createElementVNode("button",{class:"btn",onClick:f[2]||(f[2]=e.withModifiers(m=>C("deleteColumn"),["stop"])),disabled:!i("deleteColumn")}," 删除列 ",8,Qo),e.createElementVNode("button",{class:"btn",onClick:f[3]||(f[3]=e.withModifiers(m=>C("addRowBefore"),["stop"])),disabled:!i("addRowBefore")}," 前插行 ",8,en),e.createElementVNode("button",{class:"btn",onClick:f[4]||(f[4]=e.withModifiers(m=>C("addRowAfter"),["stop"])),disabled:!i("addRowAfter")}," 后插行 ",8,tn),e.createElementVNode("button",{class:"btn",onClick:f[5]||(f[5]=e.withModifiers(m=>C("deleteRow"),["stop"])),disabled:!i("deleteRow")}," 删除行 ",8,on),e.createElementVNode("button",{class:"btn",onClick:f[6]||(f[6]=e.withModifiers(m=>C("deleteTable"),["stop"])),disabled:!i("deleteTable")}," 删除表 ",8,nn),e.createElementVNode("button",{class:"btn",onClick:f[7]||(f[7]=e.withModifiers(m=>C("mergeCells"),["stop"])),disabled:!i("mergeCells")}," 合并单元格 ",8,rn),e.createElementVNode("button",{class:"btn",onClick:f[8]||(f[8]=e.withModifiers(m=>C("splitCell"),["stop"])),disabled:!i("splitCell")}," 拆分单元格 ",8,ln),e.createElementVNode("button",{class:"btn",onClick:f[9]||(f[9]=e.withModifiers(m=>C("mergeOrSplit"),["stop"])),disabled:!i("mergeOrSplit")}," 合并/拆分 ",8,sn),e.createElementVNode("button",{class:"btn",onClick:f[10]||(f[10]=e.withModifiers(m=>C("toggleHeaderRow"),["stop"])),disabled:!i("toggleHeaderRow")}," 切换表头行 ",8,an),e.createElementVNode("button",{class:"btn",onClick:f[11]||(f[11]=e.withModifiers(m=>C("toggleHeaderColumn"),["stop"])),disabled:!i("toggleHeaderColumn")}," 切换表头列 ",8,cn),e.createElementVNode("button",{class:"btn",onClick:f[12]||(f[12]=e.withModifiers(m=>C("toggleHeaderCell"),["stop"])),disabled:!i("toggleHeaderCell")}," 切换表头单元 ",8,dn),e.createElementVNode("button",{class:"btn",onClick:f[13]||(f[13]=e.withModifiers(m=>C("fixTables"),["stop"])),disabled:!i("fixTables")}," 修复表格 ",8,fn),e.createElementVNode("button",{class:"btn",onClick:f[14]||(f[14]=e.withModifiers(m=>C("goToNextCell"),["stop"])),disabled:!i("goToNextCell")}," 下个单元格 ",8,pn),e.createElementVNode("button",{class:"btn",onClick:f[15]||(f[15]=e.withModifiers(m=>C("goToPreviousCell"),["stop"])),disabled:!i("goToPreviousCell")}," 上个单元格 ",8,mn),e.createElementVNode("button",{class:"btn",onClick:f[16]||(f[16]=e.withModifiers(m=>C("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!i("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,un)])])):e.createCommentVNode("",!0)],8,Ko)}}}),[["__scopeId","data-v-1aa3a259"]]),gn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),a=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function i(){const C=c.editor;if(C){C.chain().focus().toggleTaskList().run();try{const{state:p}=C,f=p.selection;let N=null;p.doc.nodesBetween(Math.max(0,f.from-5),Math.min(p.doc.content.size,f.to+5),(x,m)=>{var E;return((E=x==null?void 0:x.type)==null?void 0:E.name)==="taskItem"&&N==null?(N=m,!1):!0}),N!=null&&C.commands.setTextSelection(N+1)}catch{}}}return(C,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:i},[e.createVNode(e.unref(U),{text:"任务列表",shortcut:e.unref(a),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"task",size:17,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-0a1c80da"]]),kn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme");function n(){const a=c.editor;a&&a.chain().focus().toggleBlockquote().run()}return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(e.unref(U),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"quote",size:18,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1})]))}}),[["__scopeId","data-v-dcd9c3cd"]]),wn=["aria-expanded"],Cn={class:"label"},yn={key:0,class:"dropdown",role:"listbox"},xn=["aria-selected","onClick"],bn={class:"shortcut"},Ve="md-toolbar-dropdown-open",$e="heading-select",Vn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=typeof navigator<"u"&&navigator.platform.includes("Mac"),n={0:r?"⌥ ⌘ 0":"Ctrl Alt 0",1:r?"⌥ ⌘ 1":"Ctrl Alt 1",2:r?"⌥ ⌘ 2":"Ctrl Alt 2",3:r?"⌥ ⌘ 3":"Ctrl Alt 3",4:r?"⌥ ⌘ 4":"Ctrl Alt 4",5:r?"⌥ ⌘ 5":"Ctrl Alt 5",6:r?"⌥ ⌘ 6":"Ctrl Alt 6"},a=[{label:"正文",level:null,shortcut:n[0]},{label:"标题1",level:1,shortcut:n[1]},{label:"标题2",level:2,shortcut:n[2]},{label:"标题3",level:3,shortcut:n[3]},{label:"标题4",level:4,shortcut:n[4]},{label:"标题5",level:5,shortcut:n[5]},{label:"标题6",level:6,shortcut:n[6]}],i=e.computed(()=>{var d,s;const k=c.editor;if(!k)return null;for(let g=1;g<=6;g++)if((d=k.isActive)!=null&&d.call(k,"heading",{level:g}))return g;return(s=k.isActive)!=null&&s.call(k,"paragraph"),null}),C=e.computed(()=>{const k=i.value;return k?`标题${k}`:"正文"}),p=e.ref(!1),f=e.ref(null);function N(){p.value||window.dispatchEvent(new CustomEvent(Ve,{detail:{id:$e}})),p.value=!p.value}function x(){p.value=!1}function m(k){var s,g,h,u,B,z,v,w,M,S;const d=(u=(g=(s=c.editor)==null?void 0:s.chain)==null?void 0:(h=g.call(s)).focus)==null?void 0:u.call(h);d&&(k.level===null?(v=(B=d.setParagraph)==null?void 0:(z=B.call(d)).run)==null||v.call(z):(S=(M=(w=d.toggleHeading)==null?void 0:w.call(d,{level:k.level}))==null?void 0:M.run)==null||S.call(M),x())}function E(k){const d=k.target,s=f.value;s&&!s.contains(d)&&x()}function y(k){var s;((s=k.detail)==null?void 0:s.id)!==$e&&(p.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E),window.addEventListener(Ve,y)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E),window.removeEventListener(Ve,y)}),(k,d)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:f},[e.createVNode(e.unref(U),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(N,["stop"]),"aria-expanded":p.value},[e.createElementVNode("div",Cn,e.toDisplayString(C.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,wn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",yn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,s=>e.createElementVNode("div",{key:s.label,class:"dropdown-item","aria-selected":s.level===i.value,onClick:e.withModifiers(g=>m(s),["stop"])},[s.level===i.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:s.level===null,"level-1":s.level===1,"level-2":s.level===2,"level-3":s.level===3,"level-4":s.level===4,"level-5":s.level===5,"level-6":s.level===6}])},e.toDisplayString(s.label),3),e.createElementVNode("span",bn,e.toDisplayString(s.shortcut),1)],8,xn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b93823aa"]]),_n=["aria-expanded"],En={key:0,class:"dropdown",role:"menu"},Nn={class:"options"},_e="md-toolbar-dropdown-open",Te="align-select",vn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),n=e.computed(()=>{var u,B,z,v;const h=c.editor;return!h||(u=h.isActive)!=null&&u.call(h,{textAlign:"left"})?"left":(B=h.isActive)!=null&&B.call(h,{textAlign:"center"})?"center":(z=h.isActive)!=null&&z.call(h,{textAlign:"right"})?"right":(v=h.isActive)!=null&&v.call(h,{textAlign:"justify"})?"justify":"left"}),a=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[n.value]);function i(h){var u,B,z,v,w,M,S,$;($=(M=(v=(B=(u=c.editor)==null?void 0:u.chain)==null?void 0:(z=B.call(u)).focus)==null?void 0:(w=v.call(z)).setTextAlign)==null?void 0:(S=M.call(w,h)).run)==null||$.call(S)}const C=e.ref(!1),p=e.ref(null),f=typeof navigator<"u"&&navigator.platform.includes("Mac"),N=f?"⇧ ⌘ L":"Ctrl Shift L",x=f?"⇧ ⌘ E":"Ctrl Shift E",m=f?"⇧ ⌘ R":"Ctrl Shift R",E=f?"⇧ ⌘ J":"Ctrl Shift J";function y(){C.value||window.dispatchEvent(new CustomEvent(_e,{detail:{id:Te}})),C.value=!C.value}function k(){C.value=!1}function d(h){i(h),k()}function s(h){const u=p.value,B=h.target;u&&!u.contains(B)&&k()}function g(h){var B;((B=h.detail)==null?void 0:B.id)!==Te&&(C.value=!1)}return e.onMounted(()=>{document.addEventListener("click",s),window.addEventListener(_e,g)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",s),window.removeEventListener(_e,g)}),(h,u)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:p},[e.createVNode(e.unref(U),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(y,["stop"]),"aria-expanded":C.value},[e.createVNode(q,{name:a.value,size:18,color:e.unref(r)==="dark"&&"#fff"},null,8,["name","color"]),e.createVNode(q,{name:"caretDown",size:12,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])],8,_n)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[C.value?(e.openBlock(),e.createElementBlock("div",En,[e.createElementVNode("div",Nn,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="left"}]),role:"menuitem",onClick:u[0]||(u[0]=e.withModifiers(B=>d("left"),["stop"]))},[e.createVNode(e.unref(U),{text:"左对齐",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignLeft",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="center"}]),role:"menuitem",onClick:u[1]||(u[1]=e.withModifiers(B=>d("center"),["stop"]))},[e.createVNode(e.unref(U),{text:"居中对齐",shortcut:e.unref(x),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignCenter",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="right"}]),role:"menuitem",onClick:u[2]||(u[2]=e.withModifiers(B=>d("right"),["stop"]))},[e.createVNode(e.unref(U),{text:"右对齐",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignRight",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="justify"}]),role:"menuitem",onClick:u[3]||(u[3]=e.withModifiers(B=>d("justify"),["stop"]))},[e.createVNode(e.unref(U),{text:"两端对齐",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignJustify",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b321e2b4"]]),Mn=["aria-disabled"],Bn=["aria-disabled"],Ln=J(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean},disabled:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:c}){const r=t,n=e.inject("theme"),a=c,i=(_,V)=>{var o,l;return(l=(o=r.editor)==null?void 0:o.isActive)==null?void 0:l.call(o,_,V)},C=(_,V)=>{var b,F,T,D,L,H;const o=r.editor;if(!o)return;const l=(T=(b=o.chain)==null?void 0:(F=b.call(o)).focus)==null?void 0:T.call(F);return(H=(L=(D=l==null?void 0:l[_])==null?void 0:D.call(l))==null?void 0:L.run)==null?void 0:H.call(L)},p=()=>{var _,V,o,l;try{return!!((l=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).undo)!=null&&l.call(o))}catch{return!1}},f=()=>{var _,V,o,l;try{return!!((l=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).redo)!=null&&l.call(o))}catch{return!1}},N=()=>{var _,V,o;p()&&((o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.undo)==null||o.call(V))},x=()=>{var _,V,o;return(o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.redo)==null?void 0:o.call(V)},m=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",E=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",y=typeof navigator<"u"&&navigator.platform.includes("Mac"),k=y?"⌘ B":"Ctrl B",d=y?"⌘ I":"Ctrl I",s=y?"⌘ U":"Ctrl U",g=y?"⇧ ⌘ X":"Ctrl Shift X",h=y?"⌘ \\":"Ctrl \\",u=y?"⇧ ⌘ S":"Ctrl Shift S",B=y?"⇧ ⌘ 8":"Ctrl Shift 8",z=y?"⇧ ⌘ 7":"Ctrl Shift 7",v=y?"⇧ ⌘ C":"Ctrl Shift C",w=e.ref(null),M=()=>{var V,o,l,b,F,T,D;const _=r.editor;_&&((D=(T=(F=(b=(l=(o=(V=_.chain())==null?void 0:V.focus())==null?void 0:o.unsetAllMarks)==null?void 0:l.call(o))==null?void 0:b.removeEmptyTextStyle)==null?void 0:F.call(b))==null?void 0:T.run)==null||D.call(T))},S=e.ref(!1),$=e.ref(!1),A=e.ref({}),j=e.ref(null),R=()=>{var o,l,b,F,T,D;const _=r.editor;if(!_)return;const V=((o=_.getAttributes)==null?void 0:o.call(_,"textStyle"))||{};A.value={bold:!!((l=_.isActive)!=null&&l.call(_,"bold")),italic:!!((b=_.isActive)!=null&&b.call(_,"italic")),strike:!!((F=_.isActive)!=null&&F.call(_,"strike")),underline:!!((T=_.isActive)!=null&&T.call(_,"underline")),code:!!((D=_.isActive)!=null&&D.call(_,"code")),textStyle:{...V!=null&&V.color?{color:V.color}:{},...V!=null&&V.backgroundColor?{backgroundColor:V.backgroundColor}:{},...V!=null&&V.fontSize?{fontSize:V.fontSize}:{}}}},W=()=>{var F,T,D,L,H,I,O,Q,oe,le,fe,Y;const _=r.editor;if(!_)return;const V=A.value;let o=(D=(F=_.chain)==null?void 0:(T=F.call(_)).focus)==null?void 0:D.call(T);const l=V.textStyle||{},b=(L=_.state)==null?void 0:L.selection;b&&b.from===b.to||(o=((H=o==null?void 0:o.unsetAllMarks)==null?void 0:H.call(o))||o,Object.keys(l).length&&(o=((I=o==null?void 0:o.setMark)==null?void 0:I.call(o,"textStyle",l))||o),V.bold&&(o=((O=o==null?void 0:o.toggleBold)==null?void 0:O.call(o))||o),V.italic&&(o=((Q=o==null?void 0:o.toggleItalic)==null?void 0:Q.call(o))||o),V.strike&&(o=((oe=o==null?void 0:o.toggleStrike)==null?void 0:oe.call(o))||o),V.underline&&(o=((le=o==null?void 0:o.toggleUnderline)==null?void 0:le.call(o))||o),V.code&&(o=((fe=o==null?void 0:o.toggleCode)==null?void 0:fe.call(o))||o),(Y=o==null?void 0:o.run)==null||Y.call(o))},Z=_=>{var l;const V=r.editor;if(!V)return;R(),S.value=!0,$.value=!!_;const o=(l=V.state)==null?void 0:l.selection;j.value=o?{from:o.from,to:o.to}:null},G=()=>{S.value=!1,$.value=!1},X=()=>{ae()},K=_=>{r.disabled||!((_.metaKey||_.ctrlKey)&&_.shiftKey&&(_.key==="s"||_.key==="S"))||!r.editor||(_.preventDefault(),Z(!1))},ne=_=>{var D,L,H,I;if(r.disabled)return;const V=_.metaKey||_.ctrlKey,o=_.key==="c"||_.key==="C";if(V&&_.shiftKey&&o){_.preventDefault(),C("toggleCodeBlock");return}const l=_.key==="f"||_.key==="F";if(V&&l){_.preventDefault();try{(L=(D=w.value)==null?void 0:D.openPanel)==null||L.call(D,"find")}catch{}return}const b=_.key==="h"||_.key==="H",F=_.metaKey&&_.altKey&&l,T=_.ctrlKey&&b;if(F||T){_.preventDefault();try{(I=(H=w.value)==null?void 0:H.openPanel)==null||I.call(H,"replace")}catch{}return}};let re=!1;const he=()=>{var V;const _=r.editor;!_||re||(re=!0,(V=_.on)==null||V.call(_,"selectionUpdate",X),window.addEventListener("keydown",K),window.addEventListener("keydown",ne),window.addEventListener("mouseup",ce,!0))},Ee=()=>{var V;const _=r.editor;_&&((V=_.off)==null||V.call(_,"selectionUpdate",X),window.removeEventListener("keydown",K),window.removeEventListener("keydown",ne),window.removeEventListener("mouseup",ce,!0),re=!1)};e.onMounted(()=>{he()}),e.onBeforeUnmount(()=>{Ee()}),e.watch(()=>r.editor,(_,V)=>{var o;V&&((o=V.off)==null||o.call(V,"selectionUpdate",X)),re=!1,he()});const ae=()=>{try{S.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(S,ae),e.onMounted(ae),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const ce=()=>{var l;if(r.disabled||!S.value)return;const _=r.editor;if(!_)return;const V=(l=_.state)==null?void 0:l.selection;if(!V||V.from===V.to)return;const o=j.value;o&&o.from===V.from&&o.to===V.to||(W(),j.value={from:V.from,to:V.to},$.value||G())};return(_,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["header_box",{disabled:!!r.disabled}])},[e.createElementVNode("div",{class:"icon","aria-disabled":!p(),onClick:N},[e.createVNode(e.unref(U),{text:"撤销",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Mn),e.createElementVNode("div",{class:"icon","aria-disabled":!f(),onClick:x},[e.createVNode(e.unref(U),{text:"重做",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(rt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Bn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:S.value}]),onClick:V[0]||(V[0]=o=>Z(!1)),onDblclick:V[1]||(V[1]=o=>Z(!0))},[e.createVNode(e.unref(U),{text:"格式刷",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"formatBrush",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:M},[e.createVNode(e.unref(U),{text:"清除格式",shortcut:e.unref(h),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"clearFormat",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]),e.createVNode(e.unref(Vn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(xt),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bold")}]),onClick:V[2]||(V[2]=o=>C("toggleBold"))},[e.createVNode(e.unref(U),{text:"加粗",shortcut:e.unref(k),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("italic")}]),onClick:V[3]||(V[3]=o=>C("toggleItalic"))},[e.createVNode(e.unref(U),{text:"斜体",shortcut:e.unref(d),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("strike")}]),onClick:V[4]||(V[4]=o=>C("toggleStrike"))},[e.createVNode(e.unref(U),{text:"删除线",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("underline")}]),onClick:V[5]||(V[5]=o=>C("toggleUnderline"))},[e.createVNode(e.unref(U),{text:"下划线",shortcut:e.unref(s),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(pt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Dt),{editor:r.editor,currentColor:r.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(yo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(vn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bulletList")}]),onClick:V[6]||(V[6]=o=>C("toggleBulletList"))},[e.createVNode(e.unref(U),{text:"无序列表",shortcut:e.unref(B),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"bulletList",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("orderedList")}]),onClick:V[7]||(V[7]=o=>C("toggleOrderedList"))},[e.createVNode(e.unref(U),{text:"有序列表",shortcut:e.unref(z),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"orderedList",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(gn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("code")}]),onClick:V[8]||(V[8]=o=>C("toggleCode"))},[e.createVNode(e.unref(U),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"code",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("codeBlock")}]),onClick:V[9]||(V[9]=o=>C("toggleCodeBlock"))},[e.createVNode(e.unref(U),{text:"代码块",shortcut:e.unref(v),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"codeBlock",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(kn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Oo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Vo),{editor:r.editor,imageUploader:r.imageUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(No),{editor:r.editor,videoUploader:r.videoUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(Ho),{ref_key:"findRef",ref:w,editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Yo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(hn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:V[10]||(V[10]=o=>a("toggleFullscreen"))},[e.createVNode(e.unref(U),{text:r.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.fullscreen?e.unref(it):e.unref(nt)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])])],2))}}),[["__scopeId","data-v-8a946786"]]),zn={class:"outline__header"},Sn={class:"outline__listWrap"},$n={class:"outline__list"},Tn=["onClick"],Dn=["onClick"],Fn=J(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean},theme:{}},emits:["select","update:open"],setup(t,{emit:c}){const r=t,n=c,a=e.inject("theme");function i(g){k(g),n("select",g)}function C(){n("update:open",!1),n("update:pinned",!1)}function p(){r.pinned||C()}function f(g){const h=[],u=[];for(const B of g){const z={...B,children:[]};for(;u.length&&u[u.length-1].level>=z.level;)u.pop();u.length?u[u.length-1].children.push(z):h.push(z),u.push(z)}return h}const N=e.ref(new Set);function x(g){return N.value.has(g.pos)}function m(g){const h=N.value;h.has(g.pos)?h.delete(g.pos):h.add(g.pos),N.value=new Set(h)}const E=e.computed(()=>f(r.items||[])),y=e.computed(()=>{const g=[],h=u=>{for(const B of u)g.push({node:B,level:B.level,hasChildren:B.children.length>0}),N.value.has(B.pos)||h(B.children)};return h(E.value),g});function k(g){const h=e.unref(r.editor);if(!h)return;const{doc:u}=h.state,B=u.nodeAt(g.pos),z=Math.max(1,u.content.size-1);let v=g.pos+1;B&&B.type.name==="heading"&&(v=g.pos+B.nodeSize-1),v=Math.min(Math.max(1,v),z),h.chain().focus().setTextSelection(v).run();const w=e.unref(r.container)??null,M=h.view.coordsAtPos(v),S=r.offset??8,$=r.duration??700;if(w){const A=w.getBoundingClientRect(),j=w.scrollTop+M.top-A.top-S;d(w,j,$)}else{const A=(window.scrollY||window.pageYOffset)+M.top-S;s(A,$)}}function d(g,h,u=600){const B=g.scrollTop,z=h-B,v=performance.now(),w=S=>S<.5?4*S*S*S:1-Math.pow(-2*S+2,3)/2;function M(S){const $=S-v,A=Math.min(1,$/u);g.scrollTop=B+z*w(A),A<1&&requestAnimationFrame(M)}requestAnimationFrame(M)}function s(g,h=600){const u=window.scrollY||window.pageYOffset,B=g-u,z=performance.now(),v=M=>M<.5?4*M*M*M:1-Math.pow(-2*M+2,3)/2;function w(M){const S=M-z,$=Math.min(1,S/h),A=u+B*v($);window.scrollTo(0,A),$<1&&requestAnimationFrame(w)}requestAnimationFrame(w)}return(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:h[1]||(h[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:r.open,dark:r.theme==="dark"}]),style:e.normalizeStyle({maxHeight:typeof r.maxHeight=="number"?r.maxHeight+"px":r.maxHeight}),onMouseleave:p},[e.createElementVNode("div",zn,[h[2]||(h[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),r.open&&!r.pinned?(e.openBlock(),e.createBlock(q,{key:0,style:{"margin-top":"2px"},name:"fixed",size:16,color:e.unref(a)==="dark"&&"#fff",onClick:h[0]||(h[0]=u=>g.$emit("update:pinned",!0))},null,8,["color"])):e.createCommentVNode("",!0),r.pinned?(e.openBlock(),e.createBlock(e.unref(lt),{key:1,onClick:C,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Sn,[e.createElementVNode("ul",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(u,B)=>(e.openBlock(),e.createElementBlock("li",{key:u.node.pos+"-"+B,class:e.normalizeClass(["outline__item","lv-"+u.level])},[u.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:x(u.node),expanded:!x(u.node)}]),onClick:e.withModifiers(z=>m(u.node),["stop"]),title:"展开/收起"},[...h[3]||(h[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8 5l8 7-8 7V5z",fill:"currentColor"})],-1)])],10,Tn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:z=>i(u.node)},e.toDisplayString(u.node.text||"(无标题)"),9,Dn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[r.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:C})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-64d05f68"]]),An=["onClick"],De=J(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{},readonly:{type:Boolean},theme:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:c,emit:r}){const n=t,a=r;e.provide("theme",n.theme),e.watch(()=>n.theme,o=>{document.documentElement.classList.toggle("dark",o==="dark")});const i=e.ref(null);let C=!1;const p=e.ref(!1),f=e.ref(!1),N=e.ref(""),x=e.ref([]),m=e.ref("#000000"),E=e.ref(!0),y=e.ref(!0),k=e.ref(null),d=e.ref(void 0),s=e.ref([]),g=e.ref(null),h=o=>{var l;if(n.readonly)try{o.preventDefault(),(l=o.stopPropagation)==null||l.call(o)}catch{}},u=()=>{const o=k.value;d.value=o?o.clientHeight:void 0};let B=null;e.onMounted(()=>{u(),B=()=>u(),window.addEventListener("resize",B),e.nextTick(()=>{const o=k.value;o&&o.addEventListener("scroll",ce,{passive:!0})})}),e.onBeforeUnmount(()=>{B&&(window.removeEventListener("resize",B),B=null);const o=k.value;o&&o.removeEventListener("scroll",ce)}),e.watch([()=>n.height,E,p],async()=>{await e.nextTick(),u(),ce()}),e.watch(p,o=>{try{document.body.style.overflow=o?"hidden":""}catch{}try{o?window.addEventListener("keydown",z):window.removeEventListener("keydown",z)}catch{}});function z(o){o.key==="Escape"&&p.value&&(o.preventDefault(),p.value=!1)}const v=()=>n.theme==="dark"?"#fff":n.caretColor||"#000",w=e.computed(()=>{const o=b=>b==null?void 0:typeof b=="number"?`${b}px`:b,l=p.value?"100vh":o(n.height);return{height:l,"--editor-height":l,"--editor-caret-color":v}}),M=we.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:o=>o.style.fontSize||null,renderHTML:o=>o.fontSize?{style:`font-size: ${o.fontSize}`}:{}}}},addCommands(){return{setFontSize:o=>({chain:l})=>l().setMark("textStyle",{fontSize:o}).run(),unsetFontSize:()=>({chain:o})=>o().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),S=we.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:o=>o.style.backgroundColor||null,renderHTML:o=>o.backgroundColor?{style:`background-color: ${o.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:o=>({chain:l})=>l().setMark("textStyle",{backgroundColor:o}).run(),unsetBackgroundColor:()=>({chain:o})=>o().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{i.value=new ve.Editor({extensions:[He.StarterKit.configure({dropcursor:!1}),Ge.Dropcursor.configure({color:"#22c55e",width:2}),Be.TaskList,Ze,Ye.configure({inline:!0,allowBase64:!0}),Je.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ue.Markdown,Me.TableKit.configure({table:{resizable:!0},tableCell:{HTMLAttributes:{class:"list-item"}}}),Ke,we.TextStyle,M,S,Re.Color,Pe.Underline,Oe.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),We.TextAlign.configure({types:["heading","paragraph"]}),Ie.Placeholder.configure({placeholder:n.placeholder??"输入 / 以插入块"})],content:n.modelValue!=null?String(n.modelValue||""):String(n.markdown||""),contentType:n.modelValue!=null&&/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(n.modelValue||""))?"html":"markdown",editable:!n.readonly,autofocus:!n.readonly,editorProps:{handlePaste(o,l){var oe,le,fe;if(n.readonly){try{l.preventDefault()}catch{}return!0}const b=l.clipboardData;if(!b)return!1;const F=b.files&&b.files.length?Array.from(b.files):[],T=F.find(Y=>{var ee;return(ee=Y.type)==null?void 0:ee.startsWith("image/")});if(T){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(T),!0}const D=F.find(Y=>{var ee;return(ee=Y.type)==null?void 0:ee.startsWith("video/")});if(D)return l.preventDefault(),re(D),!0;const H=(b.items?Array.from(b.items):[]).find(Y=>Y.kind==="file"),I=H?H.getAsFile():null;if(I&&I.type.startsWith("image/")){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(I),!0}if(I&&I.type.startsWith("video/"))return l.preventDefault(),re(I),!0;const O=b.getData("text/html");if(O){const Y=O.match(/<img[^>]+src=["']([^"']+)["']/i),ee=O.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(Y&&ee&&ee[1]){l.preventDefault();const me=ee[1];if(n.imageUploader&&/^data:image\//i.test(me)){const ge=G(me,"clipboard.png");R(ge)}else{if(/^data:image\//i.test(me)){const ge=G(me,"clipboard.png"),Ne=(oe=n.uploadSizeLimit)==null?void 0:oe.image;if(Ne){const Un=Math.max(1,Ne)*1024*1024;if(ge.size>Un){try{window.alert(`图片文件大小超限(${(ge.size/1024/1024).toFixed(2)}MB > ${Ne}MB)`)}catch{}return!0}}}$(me)}return!0}const se=O.match(/<video[^>]+src=["']([^"']+)["']/i),ie=O.match(/<source[^>]+src=["']([^"']+)["']/i),pe=O.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Ae=se&&se[1]||ie&&ie[1];if(Ae&&pe)return l.preventDefault(),j(Ae),!0}const Q=b.getData("text/plain");if(Q){const Y=Q.trim(),ee=ne(Y);if(X(Y)&&Y===Q.trim()){if(l.preventDefault(),/^data:image\//i.test(Y)){const se=G(Y,"clipboard.png"),ie=(le=n.uploadSizeLimit)==null?void 0:le.image;if(ie){const pe=Math.max(1,ie)*1024*1024;if(se.size>pe){try{window.alert(`图片文件大小超限(${(se.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return $(Y),!0}if(ee){if(l.preventDefault(),/^data:image\//i.test(ee)){const se=G(ee,"clipboard.png"),ie=(fe=n.uploadSizeLimit)==null?void 0:fe.image;if(ie){const pe=Math.max(1,ie)*1024*1024;if(se.size>pe){try{window.alert(`图片文件大小超限(${(se.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return $(ee),!0}if(K(Y)&&Y===Q.trim())return l.preventDefault(),j(Y),!0}return!1},handleDrop(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}const b=l.dataTransfer;if(!b)return!1;const T=(b.files?Array.from(b.files):[]).find(D=>{var L;return(L=D.type)==null?void 0:L.startsWith("image/")});if(T){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(T),!0}return!1},handleClick(o,l,b){const F=b,T=F.target,D=T?T.closest("a[href]"):null;if(D&&(F.ctrlKey||F.metaKey)){const L=D.getAttribute("href")||"";if(L){F.preventDefault();try{window.open(L,"_blank","noopener,noreferrer")}catch(H){console.warn("打开链接失败:",H)}return!0}}return!1},handleDOMEvents:{dragstart(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1},dragover(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1},drop(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1}}},onSelectionUpdate:o=>{var F;const b=((F=o.editor.getAttributes("textStyle"))==null?void 0:F.color)||"#000000";m.value=typeof b=="string"?b:"#000000"},onUpdate:()=>{const o=i.value;C=!0,a("update:modelValue",o.getHTML()),a("update:markdown",o.getMarkdown()),ae()},onTransaction:()=>{ae()},theme:e.computed(()=>n.theme?"dark":"light")}),e.nextTick(()=>{var o,l,b,F,T,D;ae();try{n.readonly||(o=i.value)==null||o.chain().focus().run()}catch{}try{const L=((b=(l=i.value)==null?void 0:l.view)==null?void 0:b.dom)||null;(F=L==null?void 0:L.addEventListener)==null||F.call(L,"dragstart",h,!0),(T=L==null?void 0:L.addEventListener)==null||T.call(L,"dragover",h,!0),(D=L==null?void 0:L.addEventListener)==null||D.call(L,"drop",h,!0)}catch{}})}),e.onBeforeUnmount(()=>{var o,l,b,F,T,D;try{const L=((l=(o=i.value)==null?void 0:o.view)==null?void 0:l.dom)||null;(b=L==null?void 0:L.removeEventListener)==null||b.call(L,"dragstart",h,!0),(F=L==null?void 0:L.removeEventListener)==null||F.call(L,"dragover",h,!0),(T=L==null?void 0:L.removeEventListener)==null||T.call(L,"drop",h,!0)}catch{}(D=i.value)==null||D.destroy()}),e.watch(()=>n.modelValue,o=>{if(C){C=!1;return}o!=null&&i.value&&e.nextTick(()=>{try{const l=/<\s*(video|iframe)\b|data-youtube-video/i.test(o),b=o.match(/\[video\]\(([^)]+)\)/i);if(!l&&b){const F=b[1],T=o.replace(/\[video\]\(([^)]+)\)/gi,(D,L)=>`<video data-tiptap-video src="${L}" controls></video>`);i.value.commands.setContent(T,{contentType:"html"})}else i.value.commands.setContent(o,{contentType:l?"html":"markdown"})}catch(l){console.warn("setContent 失败,内容更新被忽略:",l)}})}),e.watch(()=>n.readonly,o=>{var l,b;try{(b=(l=i.value)==null?void 0:l.setEditable)==null||b.call(l,!o)}catch{}}),e.watch(()=>n.markdown,o=>{if(C){C=!1;return}n.modelValue==null&&o!=null&&i.value&&e.nextTick(()=>{try{i.value.commands.setContent(o,{contentType:"markdown"})}catch(l){console.warn("setContent 失败,内容更新被忽略:",l)}})});function $(o){var l;(l=i.value)==null||l.chain().focus().setImage({src:o}).run()}function A(o){return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(o){const l=i.value;if(!l)return;if(typeof l.commands.setVideo=="function"){l.chain().focus().setVideo({src:o,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const F=A(o);try{l.chain().focus().insertContent(`<p><a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a></p>`).run()}catch{l.chain().focus().insertContent(F).run()}}async function R(o){var b,F;const l=(b=n.uploadSizeLimit)==null?void 0:b.image;if(l){const T=Math.max(1,l)*1024*1024;if(o.size>T){try{window.alert(`图片文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}if(n.imageUploader){const T=URL.createObjectURL(o);(F=i.value)==null||F.chain().focus().setImage({src:T,uploading:!0}).run();try{const D=await n.imageUploader(o);if(typeof D=="string"&&D){W(T,D);return}Z(o,L=>W(T,L))}catch(D){console.warn("图片上传失败,回退为 base64",D),Z(o,L=>W(T,L))}finally{try{URL.revokeObjectURL(T)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function W(o,l){var L,H;const b=i.value;if(!b)return;const{state:F}=b,{doc:T}=F;let D=null;if(T.descendants((I,O)=>{var Q,oe;return((Q=I.type)==null?void 0:Q.name)==="image"&&((oe=I.attrs)==null?void 0:oe.src)===o?(D=O,!1):!0}),D!=null){const I=T.nodeAt(D),O=F.schema.nodes.image;if(!I||!O)return;const Q={...I.attrs||{},src:l,uploading:null},oe=F.tr.setNodeMarkup(D,O,Q,I.marks);b.view.dispatch(oe);try{(H=(L=b.options)==null?void 0:L.onUpdate)==null||H.call(L,{editor:b})}catch{}}else $(l)}function Z(o,l){const b=new FileReader;b.onload=()=>l(String(b.result||"")),b.readAsDataURL(o)}function G(o,l="image.png"){var H;const b=o.split(","),F=((H=b[0].match(/:(.*?);/))==null?void 0:H[1])||"image/png",T=atob(b[1]);let D=T.length;const L=new Uint8Array(D);for(;D--;)L[D]=T.charCodeAt(D);return new File([L],l,{type:F})}function X(o){return/^data:image\//i.test(o)||/^https?:\/\//i.test(o)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(o)}function K(o){return/^https?:\/\//i.test(o)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(o)}function ne(o){const l=o.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!l)return null;const b=l[1].trim().replace(/^<|>$/g,"");return X(b)?b:null}async function re(o){var F;const l=(F=n.uploadSizeLimit)==null?void 0:F.video;if(l){const T=Math.max(1,l)*1024*1024;if(o.size>T){try{window.alert(`视频文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}if(n.videoUploader){const T=URL.createObjectURL(o),D=i.value,L=D==null?void 0:D.commands;try{typeof(L==null?void 0:L.setVideo)=="function"?D==null||D.chain().focus().setVideo({src:T,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():j(T)}catch{j(T)}try{const H=await n.videoUploader(o);he(T,H)}catch(H){console.warn("视频上传失败,保留本地对象 URL 作为预览",H)}finally{try{URL.revokeObjectURL(T)}catch{}}return}const b=URL.createObjectURL(o);j(b)}function he(o,l){const b=i.value;if(!b)return;const{state:F}=b,{doc:T}=F;let D=null;if(T.descendants((L,H)=>{var I,O;return((I=L.type)==null?void 0:I.name)==="video"&&((O=L.attrs)==null?void 0:O.src)===o?(D=H,!1):!0}),D!=null){const L=T.nodeAt(D),H=F.schema.nodes.video;if(!L||!H)return;const I={...L.attrs||{},src:l,uploading:null},O=F.tr.setNodeMarkup(D,H,I,L.marks);b.view.dispatch(O)}}function Ee(){var o,l;N.value=((l=(o=i.value)==null?void 0:o.getAttributes("link"))==null?void 0:l.href)||"",f.value=!0}function ae(){const o=i.value;if(!o)return;const l=[];o.state.doc.descendants((b,F)=>{if(b.type.name==="heading"){const T=b.attrs.level||1,D=b.textContent||"";l.push({text:D,level:T,pos:F})}}),x.value=l,ce()}function ce(){const o=i.value,l=k.value,b=x.value;if(!o||!l||!b.length){s.value=[],g.value=null;return}const F=l.getBoundingClientRect(),T=l.scrollHeight||l.clientHeight,D=l.clientHeight||1,L=b.map(O=>{const oe=o.view.coordsAtPos(Math.min(O.pos+1,o.state.doc.content.size)).top-F.top+l.scrollTop,le=T?Math.max(0,Math.min(1,oe/T)):0;return Math.round(le*D)});s.value=L;const H=l.scrollTop+8;let I=null;for(let O=0;O<b.length;O++){const Q=b[O];if(o.view.coordsAtPos(Math.min(Q.pos+1,o.state.doc.content.size)).top-F.top+l.scrollTop<=H)I=Q.pos;else break}g.value=I}function _(o){const l=o.target;l.closest(".outline")||l.closest(".outline-toggle")||i.value&&i.value.chain().focus().run()}function V(){const o=i.value;return o?o.getMarkdown():""}return c({getMarkdown:V}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-editor",{fullscreen:p.value,readonly:!!n.readonly,dark:n.theme==="dark"}]),style:e.normalizeStyle(w.value)},[e.createVNode(e.unref(Ln),{editor:i.value,currentColor:m.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":n.uploadSizeLimit,fullscreen:p.value,disabled:!!n.readonly,onToggleFullscreen:l[0]||(l[0]=b=>p.value=!p.value),onOpenLinkModal:Ee},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen","disabled"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:E.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:k,class:"editor_wrapper",onClick:_},[e.createVNode(e.unref(ve.EditorContent),{editor:i.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Fn),{open:E.value,"onUpdate:open":l[1]||(l[1]=b=>E.value=b),items:x.value,editor:i.value,container:k.value,maxHeight:d.value,pinned:y.value,theme:n.theme,"onUpdate:pinned":l[2]||(l[2]=b=>y.value=b)},null,8,["open","items","editor","container","maxHeight","pinned","theme"]),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:l[3]||(l[3]=b=>(E.value=!0,y.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(b,F)=>{var T;return e.openBlock(),e.createElementBlock("span",{key:F,class:e.normalizeClass(["outline-marker",{active:((T=x.value[F])==null?void 0:T.pos)===g.value}]),style:e.normalizeStyle({top:(b||0)+"px"}),onClick:e.withModifiers(D=>{var L,H;return(H=i.value)==null?void 0:H.chain().focus().setTextSelection((((L=x.value[F])==null?void 0:L.pos)||1)+1).run()},["stop"])},null,14,An)}),128))],32))],2)],6))}}),[["__scopeId","data-v-0dda272d"]]),Hn={install(t){t.component("Editor",De)}};P.Editor=De,P.default=Hn,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
8
|
+
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(w,["stop"])})])]),e.createElementVNode("div",co,[M[5]||(M[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",fo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),$=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"swatch",style:e.normalizeStyle({background:$}),onClick:e.withModifiers(D=>N($),["stop"])},[$===f.value?(e.openBlock(),e.createElementBlock("span",mo,"✓")):e.createCommentVNode("",!0)],12,po))),128))])]),e.createElementVNode("div",uo,[M[6]||(M[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),$=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"swatch",style:e.normalizeStyle({background:$}),onClick:e.withModifiers(D=>N($),["stop"])},[$===f.value?(e.openBlock(),e.createBlock(e.unref(fe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,go))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",ko,[M[7]||(M[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",wo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,$=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"swatch",style:e.normalizeStyle({background:$}),onClick:e.withModifiers(D=>N($),["stop"])},null,12,Co))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",yo,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(w,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(x,["stop"])},"更多颜色")]),i.value?(e.openBlock(),e.createElementBlock("div",xo,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":M[1]||(M[1]=$=>y.value=$)},null,512),[[e.vModelText,y.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":M[2]||(M[2]=$=>y.value=$)},null,512),[[e.vModelText,y.value]]),e.createElementVNode("button",{class:"btn apply",onClick:M[3]||(M[3]=e.withModifiers($=>N(y.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-cb31218d"]]),Vo={class:"image-actions"},_o=["aria-disabled","disabled"],Eo=K(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const a=e.inject("theme"),n=t,o=e.ref(!1),i=e.ref(""),r=e.ref(!1),y=e.ref(null),p=()=>{o.value=!o.value},f=()=>{var c,s,k,g,u,L;const w=i.value.trim();w&&((L=(u=((g=(s=(c=n.editor)==null?void 0:c.chain)==null?void 0:(k=s.call(c)).focus)==null?void 0:g.call(k)).setImage({src:w})).run)==null||L.call(u),o.value=!1,i.value="")},_=w=>{w.key==="Enter"&&f(),w.key==="Escape"&&(o.value=!1,i.value="")},b=()=>{var w;n.imageUploader&&((w=y.value)==null||w.click())},m=async w=>{var g,u,L,S,B,C,M,$;const c=w.target,s=(g=c.files)==null?void 0:g[0];if(c.value="",!s||!n.imageUploader)return;const k=(u=n.uploadSizeLimit)==null?void 0:u.image;if(typeof k=="number"&&k>0){const D=Math.max(1,k)*1024*1024;if(s.size>D){try{window.alert(`图片文件大小超限(${(s.size/1024/1024).toFixed(2)}MB > ${k}MB)`)}catch{}return}}try{r.value=!0;let D=null;D=URL.createObjectURL(s),($=(M=((C=(S=(L=n.editor)==null?void 0:L.chain)==null?void 0:(B=S.call(L)).focus)==null?void 0:C.call(B)).setImage({src:D,uploading:!0})).run)==null||$.call(M);const H=await n.imageUploader(s);if(typeof H=="string"&&H){const j=n.editor,{state:G}=j,{doc:O}=G;let ee=null;if(O.descendants((R,X)=>{var Z,oe;return((Z=R==null?void 0:R.type)==null?void 0:Z.name)==="image"&&((oe=R==null?void 0:R.attrs)==null?void 0:oe.src)===D?(ee=X,!1):!0}),ee!=null){const R=O.nodeAt(ee),X=G.schema.nodes.image;if(R&&X){const Z={...R.attrs||{},src:H,uploading:null},oe=G.tr.setNodeMarkup(ee,X,Z,R.marks);j.view.dispatch(oe)}}o.value=!1,i.value=""}}finally{r.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},x=e.ref(null);let N=null;return e.onMounted(()=>{N=w=>{if(!o.value)return;const c=x.value,s=w.target;c&&s&&!c.contains(s)&&(o.value=!1)},document.addEventListener("mousedown",N,!0)}),e.onBeforeUnmount(()=>{N&&(document.removeEventListener("mousedown",N,!0),N=null)}),(w,c)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:p,ref_key:"rootRef",ref:x},[e.createVNode(e.unref(U),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"img",size:18,color:e.unref(a)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":c[0]||(c[0]=s=>i.value=s),onKeydown:_},null,544),[[e.vModelText,i.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:y,type:"file",accept:"image/*",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",Vo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!n.imageUploader||r.value,disabled:!n.imageUploader||r.value,onClick:e.withModifiers(b,["stop"])},e.toDisplayString(r.value?"上传中…":"上传文件"),9,_o)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-ea99876b"]]),No={class:"video-actions"},vo=["aria-disabled","disabled"],Mo=K(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const a=e.inject("theme"),n=t,o=e.ref(!1),i=e.ref(""),r=e.ref(!1),y=e.ref(null),p=()=>{o.value=!o.value},f=()=>{const c=i.value.trim();if(!c)return;const s=n.editor,k=s==null?void 0:s.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(c)){const u=String(c).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}else if(typeof(k==null?void 0:k.setVideo)=="function")s.chain().focus().setVideo({src:c,HTMLAttributes:{controls:!0,width:640}}).run();else{const u=String(c).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}o.value=!1,i.value=""},_=c=>{c.key==="Enter"&&f(),c.key==="Escape"&&(o.value=!1,i.value="")},b=()=>{var c;n.videoUploader&&((c=y.value)==null||c.click())},m=async c=>{var L,S;const s=c.target,k=(L=s.files)==null?void 0:L[0];if(s.value="",!k||!n.videoUploader)return;const g=(S=n.uploadSizeLimit)==null?void 0:S.video;if(typeof g=="number"&&g>0){const B=Math.max(1,g)*1024*1024;if(k.size>B){try{window.alert(`视频文件大小超限(${(k.size/1024/1024).toFixed(2)}MB > ${g}MB)`)}catch{}return}}let u=null;try{r.value=!0;const B=n.editor,C=B==null?void 0:B.commands;u=URL.createObjectURL(k);try{if(typeof(C==null?void 0:C.setVideo)=="function")B.chain().focus().setVideo({src:u,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const $=String(u).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{B.chain().focus().insertContent(`<p><a href="${$}" target="_blank" rel="noopener noreferrer">${$}</a></p>`).run()}catch{B.chain().focus().insertContent($).run()}}}catch{}const M=await n.videoUploader(k);u&&x(u,M),o.value=!1,i.value=""}finally{r.value=!1;try{u&&URL.revokeObjectURL(u)}catch{}}};function x(c,s){const k=n.editor;if(!k)return;const{state:g}=k,{doc:u}=g;let L=null;if(u.descendants((S,B)=>{var C,M;return((C=S.type)==null?void 0:C.name)==="video"&&((M=S.attrs)==null?void 0:M.src)===c?(L=B,!1):!0}),L!=null){const S=u.nodeAt(L),B=g.schema.nodes.video;if(!S||!B)return;const C={...S.attrs||{},src:s,uploading:null},M=g.tr.setNodeMarkup(L,B,C,S.marks);k.view.dispatch(M)}}const N=e.ref(null);let w=null;return e.onMounted(()=>{w=c=>{if(!o.value)return;const s=N.value,k=c.target;s&&k&&!s.contains(k)&&(o.value=!1)},document.addEventListener("mousedown",w,!0)}),e.onBeforeUnmount(()=>{w&&(document.removeEventListener("mousedown",w,!0),w=null)}),(c,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:p,ref_key:"rootRef",ref:N},[e.createVNode(e.unref(U),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"video",size:16,color:e.unref(a)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:s[1]||(s[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":s[0]||(s[0]=k=>i.value=k),onKeydown:_},null,544),[[e.vModelText,i.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:y,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",No,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!n.videoUploader||r.value,disabled:!n.videoUploader||r.value,onClick:e.withModifiers(b,["stop"])},e.toDisplayString(r.value?"上传中…":"上传文件"),9,vo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-77dd3e96"]]),Bo={class:"fr-header"},Lo={key:0,class:"fr-body"},zo={class:"fr-input-row"},So=["value"],$o={key:0,class:"fr-count"},To={class:"fr-actions"},Do={key:1,class:"fr-body"},Fo={class:"fr-input-row"},Ao=["value"],Ho={key:0,class:"fr-count"},Uo={class:"fr-actions"},jo=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t,{expose:a}){const n=t,o=e.ref(!1),i=e.ref("find"),r=e.ref(""),y=e.ref(""),p=e.ref([]),f=e.ref(0),_=e.computed(()=>{const D=p.value.length;return!r.value||!D?"0/0":`${Math.min(Math.max(f.value+1,1),D)}/${D}`}),b=typeof navigator<"u"&&navigator.platform.includes("Mac"),m=e.computed(()=>b?"⌘ F / ⌥ ⌘ F":"Ctrl F / Ctrl H"),x=()=>o.value=!o.value,N=()=>o.value=!1;function w(){var D;return((D=n.editor)==null?void 0:D.view)||null}function c(){const D=w(),H=r.value;if(p.value=[],f.value=0,!D||!H)return;const j=D.dom,G=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,null);let O;for(;O=G.nextNode();){const ee=O,R=ee.data||"";let X=0;for(;;){const Z=R.indexOf(H,X);if(Z===-1)break;const oe=D.posAtDOM(ee,Z),se=D.posAtDOM(ee,Z+H.length);typeof oe=="number"&&typeof se=="number"&&p.value.push({from:oe,to:se}),X=Z+H.length}}e.nextTick(()=>{p.value.length&&s(0)})}function s(D){const H=n.editor,j=w();if(!H||!j||!p.value.length)return;const G=p.value.length;f.value=(D%G+G)%G;const O=p.value[f.value];H.chain().focus().setTextSelection({from:O.from,to:O.to}).run()}const k=()=>p.value.length&&s(f.value+1),g=()=>p.value.length&&s(f.value-1);function u(){const D=n.editor;if(!D||!p.value.length)return;const H=p.value[f.value],j=D.state.tr.insertText(y.value,H.from,H.to);D.view.dispatch(j),c()}function L(){const D=n.editor;if(!D||!p.value.length)return;const H=[...p.value],j=D.state.tr;for(let G=H.length-1;G>=0;G--){const O=H[G];j.insertText(y.value,O.from,O.to)}D.view.dispatch(j),c()}function S(D){r.value=D.target.value,c()}function B(D){D.key==="Enter"&&k(),D.key==="Escape"&&N()}const C=e.ref(null);let M=null;e.onMounted(()=>{M=D=>{if(!o.value)return;const H=C.value,j=D.target;H&&j&&!H.contains(j)&&N()},document.addEventListener("mousedown",M,!0)}),e.onBeforeUnmount(()=>{M&&(document.removeEventListener("mousedown",M,!0),M=null)});function $(D){D&&(i.value=D),o.value=!0,e.nextTick(c)}return a({openPanel:$}),(D,H)=>(e.openBlock(),e.createElementBlock("div",{class:"icon find-icon",ref_key:"rootRef",ref:C,onClick:x},[e.createVNode(e.unref(U),{text:"查找替换",shortcut:m.value,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"]),e.createVNode(e.Transition,{name:"find-panel",appear:""},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"find-input-panel",onClick:H[3]||(H[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bo,[e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:i.value==="find"}]),onClick:H[0]||(H[0]=e.withModifiers(j=>i.value="find",["stop"]))}," 查找 ",2),e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:i.value==="replace"}]),onClick:H[1]||(H[1]=e.withModifiers(j=>i.value="replace",["stop"]))}," 替换 ",2)]),i.value==="find"?(e.openBlock(),e.createElementBlock("div",Lo,[H[4]||(H[4]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",zo,[e.createElementVNode("input",{class:"fr-input",value:r.value,placeholder:"输入关键字",onInput:S,onKeydown:B},null,40,So),r.value?(e.openBlock(),e.createElementBlock("span",$o,e.toDisplayString(_.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",To,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(g,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(k,["stop"])},"下一个")])])):(e.openBlock(),e.createElementBlock("div",Do,[H[5]||(H[5]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",Fo,[e.createElementVNode("input",{class:"fr-input",value:r.value,placeholder:"输入关键字",onInput:S},null,40,Ao),r.value?(e.openBlock(),e.createElementBlock("span",Ho,e.toDisplayString(_.value),1)):e.createCommentVNode("",!0)]),H[6]||(H[6]=e.createElementVNode("label",{class:"fr-label"},"替换为",-1)),e.withDirectives(e.createElementVNode("input",{class:"fr-input",style:{width:"95%"},"onUpdate:modelValue":H[2]||(H[2]=j=>y.value=j),placeholder:"请输入"},null,512),[[e.vModelText,y.value]]),e.createElementVNode("div",Uo,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(L,["stop"])},"全部替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(u,["stop"])},"替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(g,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(k,["stop"])},"下一个")])]))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-5433b285"]]),Io={class:"field"},Oo={class:"field"},Wo={class:"actions"},Ro=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=e.ref(!1),o=e.ref(""),i=e.ref("");e.ref(!1);const r=e.ref(null),y=e.inject("theme");function p(){const c=a.editor;if(!n.value&&c)try{const s=c.state.selection,k=s.from;s.to>k?_():(o.value="链接",c.chain().focus().insertContent("链接").setTextSelection({from:k,to:k+2}).run())}catch{}n.value=!n.value,n.value&&f()}function f(){setTimeout(()=>{var s;const c=(s=r.value)==null?void 0:s.querySelector('input[name="link-text"]');c==null||c.focus(),c==null||c.select()},0)}function _(){const c=a.editor;if(c)try{const s=c.state.selection,k=s.from,g=s.to,L=g>k?c.state.doc.textBetween(k,g):"";o.value=L||"";const S=c.getAttributes("link")||{};i.value=typeof S.href=="string"?S.href:""}catch{}}function b(){const c=a.editor;if(!c)return;const s=o.value.trim(),k=i.value.trim();if(k)try{const g=c.state.selection,u=g.from,L=g.to;if(L>u){const B=m(s||c.state.doc.textBetween(u,L)),C=m(k);c.chain().focus().insertContent(`<a href="${C}" target="_blank" rel="noopener noreferrer">${B}</a>`,{from:u,to:L}).run()}else{const B=m(k),C=m(s||k);c.chain().focus().insertContent(`<a href="${B}" target="_blank" rel="noopener noreferrer">${C}</a>`).run()}}finally{n.value=!1,o.value="",i.value=""}}function m(c){return String(c).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function x(c){c.key==="Enter"&&b(),c.key==="Escape"&&(n.value=!1)}let N=null;e.onMounted(()=>{N=c=>{if(!n.value)return;const s=r.value,k=c.target;s&&k&&!s.contains(k)&&(n.value=!1)},document.addEventListener("mousedown",N,!0)}),e.onBeforeUnmount(()=>{N&&(document.removeEventListener("mousedown",N,!0),N=null)});const w=e.ref({});return e.watch(n,async c=>{var k;if(!c)return;const s=a.editor;if(s){await e.nextTick();try{const g=s.state.selection,u=g.from,L=g.to;if(!(L>u)){w.value={};return}const B=s.view.coordsAtPos(u),C=s.view.coordsAtPos(L),M=(B.left+C.right)/2,$=Math.max(B.bottom,C.bottom)+8,D=(k=r.value)==null?void 0:k.querySelector(".link-input-panel"),H=D?D.getBoundingClientRect():{width:320,height:120},j=window.innerWidth,G=window.innerHeight,O=12,ee=Math.max(O+H.width/2,Math.min(j-O-H.width/2,M)),R=$,X=Math.min(B.top,C.top)-H.height-8;let Z=R;R+H.height+O>G&&X-O>=0&&(Z=X),Z=Math.max(O,Math.min(G-O-H.height,Z)),w.value={position:"fixed",left:Math.round(ee)+"px",top:Math.round(Z)+"px"}}catch{}}}),(c,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:p,ref_key:"rootRef",ref:r},[e.createVNode(e.unref(U),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"link",size:16,color:e.unref(y)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(w.value),onClick:s[2]||(s[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Io,[s[3]||(s[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":s[0]||(s[0]=k=>o.value=k),onKeydown:x},null,544),[[e.vModelText,o.value]])]),e.createElementVNode("div",Oo,[s[4]||(s[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":s[1]||(s[1]=k=>i.value=k),placeholder:"链接地址",onKeydown:x},null,544),[[e.vModelText,i.value]])]),e.createElementVNode("div",Wo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(b,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-db61d34c"]]),Po={class:"grid"},Go=["onMouseenter"],qo={class:"size"},Yo=10,Ko=10,Zo=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=e.inject("theme"),o=e.ref(!1),i=e.ref(0),r=e.ref(0),y=e.computed(()=>{const b=Math.max(i.value,1),m=Math.max(r.value,1);return`${b} x ${m}`}),p=()=>{o.value=!o.value,o.value||(i.value=0,r.value=0)},f=(b,m)=>{i.value=b,r.value=m},_=()=>{var x,N,w,c,s,k,g,u;const b=Math.max(i.value,1),m=Math.max(r.value,1);(u=(k=(c=(N=(x=a.editor)==null?void 0:x.chain)==null?void 0:(w=N.call(x)).focus)==null?void 0:(s=c.call(w)).insertTable)==null?void 0:(g=k.call(s,{rows:b,cols:m,withHeaderRow:!0})).run)==null||u.call(g),o.value=!1,i.value=0,r.value=0};return(b,m)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:p},[e.createVNode(e.unref(U),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"table",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1}),o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[m[1]||(m[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Po,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Yo,x=>e.createElementVNode("div",{key:"r-"+x,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Ko,N=>e.createElementVNode("span",{key:"c-"+x+"-"+N,class:e.normalizeClass(["cell",{active:x<=i.value&&N<=r.value}]),onMouseenter:w=>f(x,N),onClick:e.withModifiers(_,["stop"])},null,42,Go)),64))])),64))]),e.createElementVNode("div",qo,e.toDisplayString(y.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-d0d98332"]]),Jo=["aria-disabled"],Xo={class:"tools-grid"},Qo=["disabled"],en=["disabled"],tn=["disabled"],on=["disabled"],nn=["disabled"],rn=["disabled"],ln=["disabled"],sn=["disabled"],an=["disabled"],cn=["disabled"],dn=["disabled"],fn=["disabled"],pn=["disabled"],mn=["disabled"],un=["disabled"],hn=["disabled"],gn=["disabled"],kn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=e.ref(!1),o=e.inject("theme"),i=()=>n.value=!n.value,r=(p,...f)=>{var b,m,x;const _=a.editor;return!!((x=(b=_==null?void 0:_.can)==null?void 0:(m=b.call(_))[p])!=null&&x.call(m,...f))},y=(p,...f)=>{var b,m,x,N,w,c,s;const _=a.editor;(s=(c=(w=(N=(x=(b=_==null?void 0:_.chain)==null?void 0:(m=b.call(_)).focus)==null?void 0:x.call(m))[p])==null?void 0:w.call(N,...f))==null?void 0:c.run)==null||s.call(c),n.value=!1};return(p,f)=>{var _,b;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:i,"aria-disabled":!((b=(_=a.editor)==null?void 0:_.isActive)!=null&&b.call(_,"table"))},[e.createVNode(e.unref(U),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"tableTools",size:15,color:e.unref(o)==="dark"&&"#fff"},null,8,["color"])]),_:1}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:f[17]||(f[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Xo,[e.createElementVNode("button",{class:"btn",onClick:f[0]||(f[0]=e.withModifiers(m=>y("addColumnBefore"),["stop"])),disabled:!r("addColumnBefore")}," 前插列 ",8,Qo),e.createElementVNode("button",{class:"btn",onClick:f[1]||(f[1]=e.withModifiers(m=>y("addColumnAfter"),["stop"])),disabled:!r("addColumnAfter")}," 后插列 ",8,en),e.createElementVNode("button",{class:"btn",onClick:f[2]||(f[2]=e.withModifiers(m=>y("deleteColumn"),["stop"])),disabled:!r("deleteColumn")}," 删除列 ",8,tn),e.createElementVNode("button",{class:"btn",onClick:f[3]||(f[3]=e.withModifiers(m=>y("addRowBefore"),["stop"])),disabled:!r("addRowBefore")}," 前插行 ",8,on),e.createElementVNode("button",{class:"btn",onClick:f[4]||(f[4]=e.withModifiers(m=>y("addRowAfter"),["stop"])),disabled:!r("addRowAfter")}," 后插行 ",8,nn),e.createElementVNode("button",{class:"btn",onClick:f[5]||(f[5]=e.withModifiers(m=>y("deleteRow"),["stop"])),disabled:!r("deleteRow")}," 删除行 ",8,rn),e.createElementVNode("button",{class:"btn",onClick:f[6]||(f[6]=e.withModifiers(m=>y("deleteTable"),["stop"])),disabled:!r("deleteTable")}," 删除表 ",8,ln),e.createElementVNode("button",{class:"btn",onClick:f[7]||(f[7]=e.withModifiers(m=>y("mergeCells"),["stop"])),disabled:!r("mergeCells")}," 合并单元格 ",8,sn),e.createElementVNode("button",{class:"btn",onClick:f[8]||(f[8]=e.withModifiers(m=>y("splitCell"),["stop"])),disabled:!r("splitCell")}," 拆分单元格 ",8,an),e.createElementVNode("button",{class:"btn",onClick:f[9]||(f[9]=e.withModifiers(m=>y("mergeOrSplit"),["stop"])),disabled:!r("mergeOrSplit")}," 合并/拆分 ",8,cn),e.createElementVNode("button",{class:"btn",onClick:f[10]||(f[10]=e.withModifiers(m=>y("toggleHeaderRow"),["stop"])),disabled:!r("toggleHeaderRow")}," 切换表头行 ",8,dn),e.createElementVNode("button",{class:"btn",onClick:f[11]||(f[11]=e.withModifiers(m=>y("toggleHeaderColumn"),["stop"])),disabled:!r("toggleHeaderColumn")}," 切换表头列 ",8,fn),e.createElementVNode("button",{class:"btn",onClick:f[12]||(f[12]=e.withModifiers(m=>y("toggleHeaderCell"),["stop"])),disabled:!r("toggleHeaderCell")}," 切换表头单元 ",8,pn),e.createElementVNode("button",{class:"btn",onClick:f[13]||(f[13]=e.withModifiers(m=>y("fixTables"),["stop"])),disabled:!r("fixTables")}," 修复表格 ",8,mn),e.createElementVNode("button",{class:"btn",onClick:f[14]||(f[14]=e.withModifiers(m=>y("goToNextCell"),["stop"])),disabled:!r("goToNextCell")}," 下个单元格 ",8,un),e.createElementVNode("button",{class:"btn",onClick:f[15]||(f[15]=e.withModifiers(m=>y("goToPreviousCell"),["stop"])),disabled:!r("goToPreviousCell")}," 上个单元格 ",8,hn),e.createElementVNode("button",{class:"btn",onClick:f[16]||(f[16]=e.withModifiers(m=>y("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!r("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,gn)])])):e.createCommentVNode("",!0)],8,Jo)}}}),[["__scopeId","data-v-1aa3a259"]]),wn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=e.inject("theme"),i=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function r(){const y=a.editor;if(y){y.chain().focus().toggleTaskList().run();try{const{state:p}=y,f=p.selection;let _=null;p.doc.nodesBetween(Math.max(0,f.from-5),Math.min(p.doc.content.size,f.to+5),(b,m)=>{var x;return((x=b==null?void 0:b.type)==null?void 0:x.name)==="taskItem"&&_==null?(_=m,!1):!0}),_!=null&&y.commands.setTextSelection(_+1)}catch{}}}return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:r},[e.createVNode(e.unref(U),{text:"任务列表",shortcut:e.unref(i),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"task",size:17,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-0a1c80da"]]),Cn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=e.inject("theme");function o(){const i=a.editor;i&&i.chain().focus().toggleBlockquote().run()}return(i,r)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:o},[e.createVNode(e.unref(U),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"quote",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1})]))}}),[["__scopeId","data-v-dcd9c3cd"]]),yn=["aria-expanded"],xn={class:"label"},bn={key:0,class:"dropdown",role:"listbox"},Vn=["aria-selected","onClick"],_n={class:"shortcut"},_e="md-toolbar-dropdown-open",De="heading-select",En=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=typeof navigator<"u"&&navigator.platform.includes("Mac"),o={0:n?"⌥ ⌘ 0":"Ctrl Alt 0",1:n?"⌥ ⌘ 1":"Ctrl Alt 1",2:n?"⌥ ⌘ 2":"Ctrl Alt 2",3:n?"⌥ ⌘ 3":"Ctrl Alt 3",4:n?"⌥ ⌘ 4":"Ctrl Alt 4",5:n?"⌥ ⌘ 5":"Ctrl Alt 5",6:n?"⌥ ⌘ 6":"Ctrl Alt 6"},i=[{label:"正文",level:null,shortcut:o[0]},{label:"标题1",level:1,shortcut:o[1]},{label:"标题2",level:2,shortcut:o[2]},{label:"标题3",level:3,shortcut:o[3]},{label:"标题4",level:4,shortcut:o[4]},{label:"标题5",level:5,shortcut:o[5]},{label:"标题6",level:6,shortcut:o[6]}],r=e.computed(()=>{var c,s;const w=a.editor;if(!w)return null;for(let k=1;k<=6;k++)if((c=w.isActive)!=null&&c.call(w,"heading",{level:k}))return k;return(s=w.isActive)!=null&&s.call(w,"paragraph"),null}),y=e.computed(()=>{const w=r.value;return w?`标题${w}`:"正文"}),p=e.ref(!1),f=e.ref(null);function _(){p.value||window.dispatchEvent(new CustomEvent(_e,{detail:{id:De}})),p.value=!p.value}function b(){p.value=!1}function m(w){var s,k,g,u,L,S,B,C,M,$;const c=(u=(k=(s=a.editor)==null?void 0:s.chain)==null?void 0:(g=k.call(s)).focus)==null?void 0:u.call(g);c&&(w.level===null?(B=(L=c.setParagraph)==null?void 0:(S=L.call(c)).run)==null||B.call(S):($=(M=(C=c.toggleHeading)==null?void 0:C.call(c,{level:w.level}))==null?void 0:M.run)==null||$.call(M),b())}function x(w){const c=w.target,s=f.value;s&&!s.contains(c)&&b()}function N(w){var s;((s=w.detail)==null?void 0:s.id)!==De&&(p.value=!1)}return e.onMounted(()=>{document.addEventListener("click",x),window.addEventListener(_e,N)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",x),window.removeEventListener(_e,N)}),(w,c)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:f},[e.createVNode(e.unref(U),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(_,["stop"]),"aria-expanded":p.value},[e.createElementVNode("div",xn,e.toDisplayString(y.value),1),e.createVNode(e.unref(ge),{theme:"filled",strokeWidth:3})],8,yn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",bn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,s=>e.createElementVNode("div",{key:s.label,class:"dropdown-item","aria-selected":s.level===r.value,onClick:e.withModifiers(k=>m(s),["stop"])},[s.level===r.value?(e.openBlock(),e.createBlock(e.unref(fe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:s.level===null,"level-1":s.level===1,"level-2":s.level===2,"level-3":s.level===3,"level-4":s.level===4,"level-5":s.level===5,"level-6":s.level===6}])},e.toDisplayString(s.label),3),e.createElementVNode("span",_n,e.toDisplayString(s.shortcut),1)],8,Vn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b93823aa"]]),Nn=["aria-expanded"],vn={key:0,class:"dropdown",role:"menu"},Mn={class:"options"},Ee="md-toolbar-dropdown-open",Fe="align-select",Bn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,n=e.inject("theme"),o=e.computed(()=>{var u,L,S,B;const g=a.editor;return!g||(u=g.isActive)!=null&&u.call(g,{textAlign:"left"})?"left":(L=g.isActive)!=null&&L.call(g,{textAlign:"center"})?"center":(S=g.isActive)!=null&&S.call(g,{textAlign:"right"})?"right":(B=g.isActive)!=null&&B.call(g,{textAlign:"justify"})?"justify":"left"}),i=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[o.value]);function r(g){var u,L,S,B,C,M,$,D;(D=(M=(B=(L=(u=a.editor)==null?void 0:u.chain)==null?void 0:(S=L.call(u)).focus)==null?void 0:(C=B.call(S)).setTextAlign)==null?void 0:($=M.call(C,g)).run)==null||D.call($)}const y=e.ref(!1),p=e.ref(null),f=typeof navigator<"u"&&navigator.platform.includes("Mac"),_=f?"⇧ ⌘ L":"Ctrl Shift L",b=f?"⇧ ⌘ E":"Ctrl Shift E",m=f?"⇧ ⌘ R":"Ctrl Shift R",x=f?"⇧ ⌘ J":"Ctrl Shift J";function N(){y.value||window.dispatchEvent(new CustomEvent(Ee,{detail:{id:Fe}})),y.value=!y.value}function w(){y.value=!1}function c(g){r(g),w()}function s(g){const u=p.value,L=g.target;u&&!u.contains(L)&&w()}function k(g){var L;((L=g.detail)==null?void 0:L.id)!==Fe&&(y.value=!1)}return e.onMounted(()=>{document.addEventListener("click",s),window.addEventListener(Ee,k)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",s),window.removeEventListener(Ee,k)}),(g,u)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:p},[e.createVNode(e.unref(U),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(N,["stop"]),"aria-expanded":y.value},[e.createVNode(Y,{name:i.value,size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["name","color"]),e.createVNode(Y,{name:"caretDown",size:12,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])],8,Nn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[y.value?(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",Mn,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:o.value==="left"}]),role:"menuitem",onClick:u[0]||(u[0]=e.withModifiers(L=>c("left"),["stop"]))},[e.createVNode(e.unref(U),{text:"左对齐",shortcut:e.unref(_),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"alignLeft",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:o.value==="center"}]),role:"menuitem",onClick:u[1]||(u[1]=e.withModifiers(L=>c("center"),["stop"]))},[e.createVNode(e.unref(U),{text:"居中对齐",shortcut:e.unref(b),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"alignCenter",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:o.value==="right"}]),role:"menuitem",onClick:u[2]||(u[2]=e.withModifiers(L=>c("right"),["stop"]))},[e.createVNode(e.unref(U),{text:"右对齐",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"alignRight",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:o.value==="justify"}]),role:"menuitem",onClick:u[3]||(u[3]=e.withModifiers(L=>c("justify"),["stop"]))},[e.createVNode(e.unref(U),{text:"两端对齐",shortcut:e.unref(x),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"alignJustify",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b321e2b4"]]),Ln=()=>{try{return(localStorage.getItem("v-md-theme")||null)==="dark"?"dark":"light"}catch{return"light"}},te=e.ref(Ln());e.watch(te,t=>{try{localStorage.setItem("v-md-theme",t)}catch{}},{immediate:!0});const Ne=t=>{te.value=t},zn={class:"theme-wrapper"},Sn=K(e.defineComponent({__name:"index",setup(t){const a=te,n=i=>{const r=document.startViewTransition;if(typeof r!="function"){Ne(i?"dark":"light");return}const y=window.innerWidth,p=0,f=Math.hypot(window.innerWidth,window.innerHeight),_=document.documentElement;_.style.setProperty("--vt-x",`${y}px`),_.style.setProperty("--vt-y",`${p}px`),_.style.setProperty("--vt-r",`${f}px`),r.call(document,()=>{Ne(i?"dark":"light")}).finished.finally(()=>{_.style.removeProperty("--vt-x"),_.style.removeProperty("--vt-y"),_.style.removeProperty("--vt-r")})},o=()=>{const i=a.value!=="dark";n(i)};return(i,r)=>(e.openBlock(),e.createElementBlock("div",zn,[e.createVNode(e.Transition,{name:"theme-icon",mode:"out-in"},{default:e.withCtx(()=>[e.unref(a)==="dark"?(e.openBlock(),e.createElementBlock("div",{class:"icon-box",key:"dark",onClick:o},[...r[0]||(r[0]=[e.createElementVNode("svg",{width:"24",height:"24",class:"tiptap-button-icon",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 1C12.5523 1 13 1.44772 13 2V4C13 4.55228 12.5523 5 12 5C11.4477 5 11 4.55228 11 4V2C11 1.44772 11.4477 1 12 1Z",fill:"currentColor"}),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12ZM12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M13 20C13 19.4477 12.5523 19 12 19C11.4477 19 11 19.4477 11 20V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V20Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M4.22282 4.22289C4.61335 3.83236 5.24651 3.83236 5.63704 4.22289L7.04704 5.63289C7.43756 6.02341 7.43756 6.65658 7.04704 7.0471C6.65651 7.43762 6.02335 7.43762 5.63283 7.0471L4.22282 5.6371C3.8323 5.24658 3.8323 4.61341 4.22282 4.22289Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M18.367 16.9529C17.9765 16.5623 17.3433 16.5623 16.9528 16.9529C16.5623 17.3434 16.5623 17.9766 16.9528 18.3671L18.3628 19.7771C18.7533 20.1676 19.3865 20.1676 19.777 19.7771C20.1675 19.3866 20.1675 18.7534 19.777 18.3629L18.367 16.9529Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M1 12C1 11.4477 1.44772 11 2 11H4C4.55228 11 5 11.4477 5 12C5 12.5523 4.55228 13 4 13H2C1.44772 13 1 12.5523 1 12Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M20 11C19.4477 11 19 11.4477 19 12C19 12.5523 19.4477 13 20 13H22C22.5523 13 23 12.5523 23 12C23 11.4477 22.5523 11 22 11H20Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M7.04704 16.9529C7.43756 17.3434 7.43756 17.9766 7.04704 18.3671L5.63704 19.7771C5.24651 20.1676 4.61335 20.1676 4.22282 19.7771C3.8323 19.3866 3.8323 18.7534 4.22283 18.3629L5.63283 16.9529C6.02335 16.5623 6.65651 16.5623 7.04704 16.9529Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M19.777 5.6371C20.1675 5.24657 20.1675 4.61341 19.777 4.22289C19.3865 3.83236 18.7533 3.83236 18.3628 4.22289L16.9528 5.63289C16.5623 6.02341 16.5623 6.65658 16.9528 7.0471C17.3433 7.43762 17.9765 7.43762 18.367 7.0471L19.777 5.6371Z",fill:"currentColor"})],-1)])])):(e.openBlock(),e.createElementBlock("div",{class:"icon-box",key:"light",onClick:o},[...r[1]||(r[1]=[e.createElementVNode("svg",{width:"24",height:"24",class:"tiptap-button-icon",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 11.5955 21.7564 11.2309 21.3827 11.0761C21.009 10.9213 20.5789 11.0069 20.2929 11.2929C19.287 12.2988 17.9226 12.864 16.5 12.864C15.0774 12.864 13.713 12.2988 12.7071 11.2929C11.7012 10.287 11.136 8.92261 11.136 7.5C11.136 6.07739 11.7012 4.71304 12.7071 3.70711C12.9931 3.42111 13.0787 2.99099 12.9239 2.61732C12.7691 2.24364 12.4045 2 12 2ZM7.55544 5.34824C8.27036 4.87055 9.05353 4.51389 9.87357 4.28778C9.39271 5.27979 9.13604 6.37666 9.13604 7.5C9.13604 9.45304 9.91189 11.3261 11.2929 12.7071C12.6739 14.0881 14.547 14.864 16.5 14.864C17.6233 14.864 18.7202 14.6073 19.7122 14.1264C19.4861 14.9465 19.1295 15.7296 18.6518 16.4446C17.7727 17.7602 16.5233 18.7855 15.0615 19.391C13.5997 19.9965 11.9911 20.155 10.4393 19.8463C8.88743 19.5376 7.46197 18.7757 6.34315 17.6569C5.22433 16.538 4.4624 15.1126 4.15372 13.5607C3.84504 12.0089 4.00347 10.4003 4.60897 8.93853C5.21447 7.47672 6.23985 6.22729 7.55544 5.34824Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M19 2C19.5523 2 20 2.44772 20 3V4H21C21.5523 4 22 4.44772 22 5C22 5.55228 21.5523 6 21 6H20V7C20 7.55228 19.5523 8 19 8C18.4477 8 18 7.55228 18 7V6H17C16.4477 6 16 5.55228 16 5C16 4.44772 16.4477 4 17 4H18V3C18 2.44772 18.4477 2 19 2Z",fill:"currentColor"})],-1)])]))]),_:1})]))}}),[["__scopeId","data-v-e09fa6a6"]]),$n=["aria-disabled"],Tn=["aria-disabled"],Dn=K(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean},disabled:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:a}){const n=t,o=a,i=(E,V)=>{var h,l;return(l=(h=n.editor)==null?void 0:h.isActive)==null?void 0:l.call(h,E,V)},r=(E,V)=>{var d,v,F,T,A,z;const h=n.editor;if(!h)return;const l=(F=(d=h.chain)==null?void 0:(v=d.call(h)).focus)==null?void 0:F.call(v);return(z=(A=(T=l==null?void 0:l[E])==null?void 0:T.call(l))==null?void 0:A.run)==null?void 0:z.call(A)},y=()=>{var E,V,h,l;try{return!!((l=(V=(E=n.editor)==null?void 0:E.can)==null?void 0:(h=V.call(E)).undo)!=null&&l.call(h))}catch{return!1}},p=()=>{var E,V,h,l;try{return!!((l=(V=(E=n.editor)==null?void 0:E.can)==null?void 0:(h=V.call(E)).redo)!=null&&l.call(h))}catch{return!1}},f=()=>{var E,V,h;y()&&((h=(V=(E=n.editor)==null?void 0:E.commands)==null?void 0:V.undo)==null||h.call(V))},_=()=>{var E,V,h;return(h=(V=(E=n.editor)==null?void 0:E.commands)==null?void 0:V.redo)==null?void 0:h.call(V)},b=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",m=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",x=typeof navigator<"u"&&navigator.platform.includes("Mac"),N=x?"⌘ B":"Ctrl B",w=x?"⌘ I":"Ctrl I",c=x?"⌘ U":"Ctrl U",s=x?"⇧ ⌘ X":"Ctrl Shift X",k=x?"⌘ \\":"Ctrl \\",g=x?"⇧ ⌘ S":"Ctrl Shift S",u=x?"⇧ ⌘ 8":"Ctrl Shift 8",L=x?"⇧ ⌘ 7":"Ctrl Shift 7",S=x?"⇧ ⌘ C":"Ctrl Shift C",B=e.ref(null),C=()=>{var V,h,l,d,v,F,T;const E=n.editor;E&&((T=(F=(v=(d=(l=(h=(V=E.chain())==null?void 0:V.focus())==null?void 0:h.unsetAllMarks)==null?void 0:l.call(h))==null?void 0:d.removeEmptyTextStyle)==null?void 0:v.call(d))==null?void 0:F.run)==null||T.call(F))},M=e.ref(!1),$=e.ref(!1),D=e.ref({}),H=e.ref(null),j=()=>{var h,l,d,v,F,T;const E=n.editor;if(!E)return;const V=((h=E.getAttributes)==null?void 0:h.call(E,"textStyle"))||{};D.value={bold:!!((l=E.isActive)!=null&&l.call(E,"bold")),italic:!!((d=E.isActive)!=null&&d.call(E,"italic")),strike:!!((v=E.isActive)!=null&&v.call(E,"strike")),underline:!!((F=E.isActive)!=null&&F.call(E,"underline")),code:!!((T=E.isActive)!=null&&T.call(E,"code")),textStyle:{...V!=null&&V.color?{color:V.color}:{},...V!=null&&V.backgroundColor?{backgroundColor:V.backgroundColor}:{},...V!=null&&V.fontSize?{fontSize:V.fontSize}:{}}}},G=()=>{var v,F,T,A,z,I,P,W,Q,le,ae,me;const E=n.editor;if(!E)return;const V=D.value;let h=(T=(v=E.chain)==null?void 0:(F=v.call(E)).focus)==null?void 0:T.call(F);const l=V.textStyle||{},d=(A=E.state)==null?void 0:A.selection;d&&d.from===d.to||(h=((z=h==null?void 0:h.unsetAllMarks)==null?void 0:z.call(h))||h,Object.keys(l).length&&(h=((I=h==null?void 0:h.setMark)==null?void 0:I.call(h,"textStyle",l))||h),V.bold&&(h=((P=h==null?void 0:h.toggleBold)==null?void 0:P.call(h))||h),V.italic&&(h=((W=h==null?void 0:h.toggleItalic)==null?void 0:W.call(h))||h),V.strike&&(h=((Q=h==null?void 0:h.toggleStrike)==null?void 0:Q.call(h))||h),V.underline&&(h=((le=h==null?void 0:h.toggleUnderline)==null?void 0:le.call(h))||h),V.code&&(h=((ae=h==null?void 0:h.toggleCode)==null?void 0:ae.call(h))||h),(me=h==null?void 0:h.run)==null||me.call(h))},O=E=>{var l;const V=n.editor;if(!V)return;j(),M.value=!0,$.value=!!E;const h=(l=V.state)==null?void 0:l.selection;H.value=h?{from:h.from,to:h.to}:null},ee=()=>{M.value=!1,$.value=!1},R=()=>{pe()},X=E=>{n.disabled||!((E.metaKey||E.ctrlKey)&&E.shiftKey&&(E.key==="s"||E.key==="S"))||!n.editor||(E.preventDefault(),O(!1))},Z=E=>{var T,A,z,I;if(n.disabled)return;const V=E.metaKey||E.ctrlKey,h=E.key==="c"||E.key==="C";if(V&&E.shiftKey&&h){E.preventDefault(),r("toggleCodeBlock");return}const l=E.key==="f"||E.key==="F";if(V&&l){E.preventDefault();try{(A=(T=B.value)==null?void 0:T.openPanel)==null||A.call(T,"find")}catch{}return}const d=E.key==="h"||E.key==="H",v=E.metaKey&&E.altKey&&l,F=E.ctrlKey&&d;if(v||F){E.preventDefault();try{(I=(z=B.value)==null?void 0:z.openPanel)==null||I.call(z,"replace")}catch{}return}};let oe=!1;const se=()=>{var V;const E=n.editor;!E||oe||(oe=!0,(V=E.on)==null||V.call(E,"selectionUpdate",R),window.addEventListener("keydown",X),window.addEventListener("keydown",Z),window.addEventListener("mouseup",de,!0))},ve=()=>{var V;const E=n.editor;E&&((V=E.off)==null||V.call(E,"selectionUpdate",R),window.removeEventListener("keydown",X),window.removeEventListener("keydown",Z),window.removeEventListener("mouseup",de,!0),oe=!1)};e.onMounted(()=>{se()}),e.onBeforeUnmount(()=>{ve()}),e.watch(()=>n.editor,(E,V)=>{var h;V&&((h=V.off)==null||h.call(V,"selectionUpdate",R)),oe=!1,se()});const pe=()=>{try{M.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(M,pe),e.onMounted(pe),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const de=()=>{var l;if(n.disabled||!M.value)return;const E=n.editor;if(!E)return;const V=(l=E.state)==null?void 0:l.selection;if(!V||V.from===V.to)return;const h=H.value;h&&h.from===V.from&&h.to===V.to||(G(),H.value={from:V.from,to:V.to},$.value||ee())};return(E,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["header_box",{disabled:n.disabled,dark:e.unref(te)==="dark"}])},[e.createElementVNode("div",{class:"icon","aria-disabled":!y(),onClick:f},[e.createVNode(e.unref(U),{text:"撤销",shortcut:e.unref(b),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,$n),e.createElementVNode("div",{class:"icon","aria-disabled":!p(),onClick:_},[e.createVNode(e.unref(U),{text:"重做",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(it),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Tn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:M.value}]),onClick:V[0]||(V[0]=h=>O(!1)),onDblclick:V[1]||(V[1]=h=>O(!0))},[e.createVNode(e.unref(U),{text:"格式刷",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"formatBrush",size:18,color:e.unref(te)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:C},[e.createVNode(e.unref(U),{text:"清除格式",shortcut:e.unref(k),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"clearFormat",size:18,color:e.unref(te)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]),e.createVNode(e.unref(En),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Vt),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bold")}]),onClick:V[2]||(V[2]=h=>r("toggleBold"))},[e.createVNode(e.unref(U),{text:"加粗",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(pt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("italic")}]),onClick:V[3]||(V[3]=h=>r("toggleItalic"))},[e.createVNode(e.unref(U),{text:"斜体",shortcut:e.unref(w),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(mt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("strike")}]),onClick:V[4]||(V[4]=h=>r("toggleStrike"))},[e.createVNode(e.unref(U),{text:"删除线",shortcut:e.unref(s),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("underline")}]),onClick:V[5]||(V[5]=h=>r("toggleUnderline"))},[e.createVNode(e.unref(U),{text:"下划线",shortcut:e.unref(c),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ut),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(At),{editor:n.editor,currentColor:n.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(bo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Bn),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bulletList")}]),onClick:V[6]||(V[6]=h=>r("toggleBulletList"))},[e.createVNode(e.unref(U),{text:"无序列表",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"bulletList",size:16,color:e.unref(te)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("orderedList")}]),onClick:V[7]||(V[7]=h=>r("toggleOrderedList"))},[e.createVNode(e.unref(U),{text:"有序列表",shortcut:e.unref(L),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"orderedList",size:16,color:e.unref(te)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(wn),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("code")}]),onClick:V[8]||(V[8]=h=>r("toggleCode"))},[e.createVNode(e.unref(U),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"code",size:18,color:e.unref(te)==="dark"&&"#fff"},null,8,["color"])]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("codeBlock")}]),onClick:V[9]||(V[9]=h=>r("toggleCodeBlock"))},[e.createVNode(e.unref(U),{text:"代码块",shortcut:e.unref(S),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(Y,{name:"codeBlock",size:16,color:e.unref(te)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Cn),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Ro),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Eo),{editor:n.editor,imageUploader:n.imageUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(Mo),{editor:n.editor,videoUploader:n.videoUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(jo),{ref_key:"findRef",ref:B,editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Zo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(kn),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:V[10]||(V[10]=h=>o("toggleFullscreen"))},[e.createVNode(e.unref(U),{text:n.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.fullscreen?e.unref(st):e.unref(lt)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])]),V[11]||(V[11]=e.createElementVNode("div",{style:{flex:"1"}},null,-1)),e.createVNode(e.unref(Sn))],2))}}),[["__scopeId","data-v-1d764638"]]),Fn={class:"outline__header"},An={class:"outline__listWrap"},Hn={class:"outline__list"},Un=["onClick"],jn=["onClick"],In=K(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:a}){const n=t,o=a,i=e.inject("theme");function r(k){w(k),o("select",k)}function y(){o("update:open",!1),o("update:pinned",!1)}function p(){n.pinned||y()}function f(k){const g=[],u=[];for(const L of k){const S={...L,children:[]};for(;u.length&&u[u.length-1].level>=S.level;)u.pop();u.length?u[u.length-1].children.push(S):g.push(S),u.push(S)}return g}const _=e.ref(new Set);function b(k){return _.value.has(k.pos)}function m(k){const g=_.value;g.has(k.pos)?g.delete(k.pos):g.add(k.pos),_.value=new Set(g)}const x=e.computed(()=>f(n.items||[])),N=e.computed(()=>{const k=[],g=u=>{for(const L of u)k.push({node:L,level:L.level,hasChildren:L.children.length>0}),_.value.has(L.pos)||g(L.children)};return g(x.value),k});function w(k){const g=e.unref(n.editor);if(!g)return;const{doc:u}=g.state,L=u.nodeAt(k.pos),S=Math.max(1,u.content.size-1);let B=k.pos+1;L&&L.type.name==="heading"&&(B=k.pos+L.nodeSize-1),B=Math.min(Math.max(1,B),S),g.chain().focus().setTextSelection(B).run();const C=e.unref(n.container)??null,M=g.view.coordsAtPos(B),$=n.offset??8,D=n.duration??700;if(C){const H=C.getBoundingClientRect(),j=C.scrollTop+M.top-H.top-$;c(C,j,D)}else{const H=(window.scrollY||window.pageYOffset)+M.top-$;s(H,D)}}function c(k,g,u=600){const L=k.scrollTop,S=g-L,B=performance.now(),C=$=>$<.5?4*$*$*$:1-Math.pow(-2*$+2,3)/2;function M($){const D=$-B,H=Math.min(1,D/u);k.scrollTop=L+S*C(H),H<1&&requestAnimationFrame(M)}requestAnimationFrame(M)}function s(k,g=600){const u=window.scrollY||window.pageYOffset,L=k-u,S=performance.now(),B=M=>M<.5?4*M*M*M:1-Math.pow(-2*M+2,3)/2;function C(M){const $=M-S,D=Math.min(1,$/g),H=u+L*B(D);window.scrollTo(0,H),D<1&&requestAnimationFrame(C)}requestAnimationFrame(C)}return(k,g)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:g[1]||(g[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:n.open}]),style:e.normalizeStyle({maxHeight:typeof n.maxHeight=="number"?n.maxHeight+"px":n.maxHeight}),onMouseleave:p},[e.createElementVNode("div",Fn,[g[2]||(g[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),n.open&&!n.pinned?(e.openBlock(),e.createBlock(Y,{key:0,style:{"margin-top":"2px"},name:"fixed",size:16,color:e.unref(i)==="dark"&&"#fff",onClick:g[0]||(g[0]=u=>k.$emit("update:pinned",!0))},null,8,["color"])):e.createCommentVNode("",!0),n.pinned?(e.openBlock(),e.createBlock(e.unref(at),{key:1,onClick:y,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)]),e.createElementVNode("div",An,[e.createElementVNode("ul",Hn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(u,L)=>(e.openBlock(),e.createElementBlock("li",{key:u.node.pos+"-"+L,class:e.normalizeClass(["outline__item","lv-"+u.level])},[u.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:b(u.node),expanded:!b(u.node)}]),onClick:e.withModifiers(S=>m(u.node),["stop"]),title:"展开/收起"},[...g[3]||(g[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8 5l8 7-8 7V5z",fill:"currentColor"})],-1)])],10,Un)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:S=>r(u.node)},e.toDisplayString(u.node.text||"(无标题)"),9,jn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[n.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:y})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-06818a86"]]),On=["onClick"],Ae=K(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{},readonly:{type:Boolean},theme:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:a,emit:n}){const o=t,i=n;e.watch(()=>o.theme,l=>{l&&Ne(l)},{immediate:!0});const r=e.ref(null);let y=!1;const p=e.ref(!1),f=e.ref(!1),_=e.ref(""),b=e.ref([]),m=e.ref("#000000"),x=e.ref(!0),N=e.ref(!0),w=e.ref(null),c=e.ref(void 0),s=e.ref([]),k=e.ref(null),g=l=>{var d;if(o.readonly)try{l.preventDefault(),(d=l.stopPropagation)==null||d.call(l)}catch{}},u=()=>{const l=w.value;c.value=l?l.clientHeight:void 0};let L=null;e.onMounted(()=>{u(),L=()=>u(),window.addEventListener("resize",L),e.nextTick(()=>{const l=w.value;l&&l.addEventListener("scroll",E,{passive:!0})})}),e.onBeforeUnmount(()=>{L&&(window.removeEventListener("resize",L),L=null);const l=w.value;l&&l.removeEventListener("scroll",E)}),e.watch([()=>o.height,x,p],async()=>{await e.nextTick(),u(),E()}),e.watch(p,l=>{try{document.body.style.overflow=l?"hidden":""}catch{}try{l?window.addEventListener("keydown",S):window.removeEventListener("keydown",S)}catch{}});function S(l){l.key==="Escape"&&p.value&&(l.preventDefault(),p.value=!1)}const B=()=>te.value==="dark"?"#fff":o.caretColor||"#000",C=e.computed(()=>{const l=v=>v==null?void 0:typeof v=="number"?`${v}px`:v,d=p.value?"100vh":l(o.height);return{height:d,"--editor-height":d,"--editor-caret-color":B()}}),M=Ce.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:l=>l.style.fontSize||null,renderHTML:l=>l.fontSize?{style:`font-size: ${l.fontSize}`}:{}}}},addCommands(){return{setFontSize:l=>({chain:d})=>d().setMark("textStyle",{fontSize:l}).run(),unsetFontSize:()=>({chain:l})=>l().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),$=Ce.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:l=>l.style.backgroundColor||null,renderHTML:l=>l.backgroundColor?{style:`background-color: ${l.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:l=>({chain:d})=>d().setMark("textStyle",{backgroundColor:l}).run(),unsetBackgroundColor:()=>({chain:l})=>l().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{r.value=new Be.Editor({extensions:[je.StarterKit.configure({dropcursor:!1}),Ye.Dropcursor.configure({color:"#22c55e",width:2}),ze.TaskList,Qe,Ze.configure({inline:!0,allowBase64:!0}),Xe.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ie.Markdown,Le.TableKit.configure({table:{resizable:!0},tableCell:{HTMLAttributes:{class:"list-item"}}}),Je,Ce.TextStyle,M,$,Ge.Color,qe.Underline,Re.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),Pe.TextAlign.configure({types:["heading","paragraph"]}),We.Placeholder.configure({placeholder:o.placeholder??"输入 / 以插入块"})],content:o.modelValue!=null?String(o.modelValue||""):String(o.markdown||""),contentType:o.modelValue!=null&&/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(o.modelValue||""))?"html":"markdown",editable:!o.readonly,autofocus:!o.readonly,editorProps:{handlePaste(l,d){var le,ae,me;if(o.readonly){try{d.preventDefault()}catch{}return!0}const v=d.clipboardData;if(!v)return!1;const F=v.files&&v.files.length?Array.from(v.files):[],T=F.find(J=>{var ne;return(ne=J.type)==null?void 0:ne.startsWith("image/")});if(T){if(d.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return G(T),!0}const A=F.find(J=>{var ne;return(ne=J.type)==null?void 0:ne.startsWith("video/")});if(A)return d.preventDefault(),se(A),!0;const I=(v.items?Array.from(v.items):[]).find(J=>J.kind==="file"),P=I?I.getAsFile():null;if(P&&P.type.startsWith("image/")){if(d.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return G(P),!0}if(P&&P.type.startsWith("video/"))return d.preventDefault(),se(P),!0;const W=v.getData("text/html");if(W){const J=W.match(/<img[^>]+src=["']([^"']+)["']/i),ne=W.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(J&&ne&&ne[1]){d.preventDefault();const he=ne[1];if(o.imageUploader&&/^data:image\//i.test(he)){const ke=R(he,"clipboard.png");G(ke)}else{if(/^data:image\//i.test(he)){const ke=R(he,"clipboard.png"),Me=(le=o.uploadSizeLimit)==null?void 0:le.image;if(Me){const Rn=Math.max(1,Me)*1024*1024;if(ke.size>Rn){try{window.alert(`图片文件大小超限(${(ke.size/1024/1024).toFixed(2)}MB > ${Me}MB)`)}catch{}return!0}}}D(he)}return!0}const ce=W.match(/<video[^>]+src=["']([^"']+)["']/i),ie=W.match(/<source[^>]+src=["']([^"']+)["']/i),ue=W.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Ue=ce&&ce[1]||ie&&ie[1];if(Ue&&ue)return d.preventDefault(),j(Ue),!0}const Q=v.getData("text/plain");if(Q){const J=Q.trim(),ne=oe(J);if(X(J)&&J===Q.trim()){if(d.preventDefault(),/^data:image\//i.test(J)){const ce=R(J,"clipboard.png"),ie=(ae=o.uploadSizeLimit)==null?void 0:ae.image;if(ie){const ue=Math.max(1,ie)*1024*1024;if(ce.size>ue){try{window.alert(`图片文件大小超限(${(ce.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return D(J),!0}if(ne){if(d.preventDefault(),/^data:image\//i.test(ne)){const ce=R(ne,"clipboard.png"),ie=(me=o.uploadSizeLimit)==null?void 0:me.image;if(ie){const ue=Math.max(1,ie)*1024*1024;if(ce.size>ue){try{window.alert(`图片文件大小超限(${(ce.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return D(ne),!0}if(Z(J)&&J===Q.trim())return d.preventDefault(),j(J),!0}return!1},handleDrop(l,d){if(o.readonly){try{d.preventDefault()}catch{}return!0}const v=d.dataTransfer;if(!v)return!1;const T=(v.files?Array.from(v.files):[]).find(A=>{var z;return(z=A.type)==null?void 0:z.startsWith("image/")});if(T){if(d.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return G(T),!0}return!1},handleClick(l,d,v){const F=v,T=F.target,A=T?T.closest("a[href]"):null;if(A&&(F.ctrlKey||F.metaKey)){const z=A.getAttribute("href")||"";if(z){F.preventDefault();try{window.open(z,"_blank","noopener,noreferrer")}catch(I){console.warn("打开链接失败:",I)}return!0}}return!1},handleDOMEvents:{dragstart(l,d){if(o.readonly){try{d.preventDefault()}catch{}return!0}return!1},dragover(l,d){if(o.readonly){try{d.preventDefault()}catch{}return!0}return!1},drop(l,d){if(o.readonly){try{d.preventDefault()}catch{}return!0}return!1}}},onSelectionUpdate:l=>{var F;const v=((F=l.editor.getAttributes("textStyle"))==null?void 0:F.color)||"#000000";m.value=typeof v=="string"?v:"#000000"},onUpdate:()=>{const l=r.value;y=!0,i("update:modelValue",l.getHTML()),i("update:markdown",l.getMarkdown()),de()},onTransaction:()=>{de()},theme:e.computed(()=>te.value)}),e.nextTick(()=>{var l,d,v,F,T,A;de();try{o.readonly||(l=r.value)==null||l.chain().focus().run()}catch{}try{const z=((v=(d=r.value)==null?void 0:d.view)==null?void 0:v.dom)||null;(F=z==null?void 0:z.addEventListener)==null||F.call(z,"dragstart",g,!0),(T=z==null?void 0:z.addEventListener)==null||T.call(z,"dragover",g,!0),(A=z==null?void 0:z.addEventListener)==null||A.call(z,"drop",g,!0)}catch{}})}),e.onBeforeUnmount(()=>{var l,d,v,F,T,A;try{const z=((d=(l=r.value)==null?void 0:l.view)==null?void 0:d.dom)||null;(v=z==null?void 0:z.removeEventListener)==null||v.call(z,"dragstart",g,!0),(F=z==null?void 0:z.removeEventListener)==null||F.call(z,"dragover",g,!0),(T=z==null?void 0:z.removeEventListener)==null||T.call(z,"drop",g,!0)}catch{}(A=r.value)==null||A.destroy()}),e.watch(()=>o.modelValue,l=>{if(y){y=!1;return}l!=null&&r.value&&e.nextTick(()=>{try{const d=/<\s*(video|iframe)\b|data-youtube-video/i.test(l),v=l.match(/\[video\]\(([^)]+)\)/i);if(!d&&v){const F=v[1],T=l.replace(/\[video\]\(([^)]+)\)/gi,(A,z)=>`<video data-tiptap-video src="${z}" controls></video>`);r.value.commands.setContent(T,{contentType:"html"})}else r.value.commands.setContent(l,{contentType:d?"html":"markdown"})}catch(d){console.warn("setContent 失败,内容更新被忽略:",d)}})}),e.watch(()=>o.readonly,l=>{var d,v;try{(v=(d=r.value)==null?void 0:d.setEditable)==null||v.call(d,!l)}catch{}}),e.watch(()=>o.markdown,l=>{if(y){y=!1;return}o.modelValue==null&&l!=null&&r.value&&e.nextTick(()=>{try{r.value.commands.setContent(l,{contentType:"markdown"})}catch(d){console.warn("setContent 失败,内容更新被忽略:",d)}})});function D(l){var d;(d=r.value)==null||d.chain().focus().setImage({src:l}).run()}function H(l){return String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(l){const d=r.value;if(!d)return;if(typeof d.commands.setVideo=="function"){d.chain().focus().setVideo({src:l,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const F=H(l);try{d.chain().focus().insertContent(`<p><a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a></p>`).run()}catch{d.chain().focus().insertContent(F).run()}}async function G(l){var v,F;const d=(v=o.uploadSizeLimit)==null?void 0:v.image;if(d){const T=Math.max(1,d)*1024*1024;if(l.size>T){try{window.alert(`图片文件大小超限(${(l.size/1024/1024).toFixed(2)}MB > ${d}MB)`)}catch{}return}}if(o.imageUploader){const T=URL.createObjectURL(l);(F=r.value)==null||F.chain().focus().setImage({src:T,uploading:!0}).run();try{const A=await o.imageUploader(l);if(typeof A=="string"&&A){O(T,A);return}ee(l,z=>O(T,z))}catch(A){console.warn("图片上传失败,回退为 base64",A),ee(l,z=>O(T,z))}finally{try{URL.revokeObjectURL(T)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function O(l,d){var z,I;const v=r.value;if(!v)return;const{state:F}=v,{doc:T}=F;let A=null;if(T.descendants((P,W)=>{var Q,le;return((Q=P.type)==null?void 0:Q.name)==="image"&&((le=P.attrs)==null?void 0:le.src)===l?(A=W,!1):!0}),A!=null){const P=T.nodeAt(A),W=F.schema.nodes.image;if(!P||!W)return;const Q={...P.attrs||{},src:d,uploading:null},le=F.tr.setNodeMarkup(A,W,Q,P.marks);v.view.dispatch(le);try{(I=(z=v.options)==null?void 0:z.onUpdate)==null||I.call(z,{editor:v})}catch{}}else D(d)}function ee(l,d){const v=new FileReader;v.onload=()=>d(String(v.result||"")),v.readAsDataURL(l)}function R(l,d="image.png"){var I;const v=l.split(","),F=((I=v[0].match(/:(.*?);/))==null?void 0:I[1])||"image/png",T=atob(v[1]);let A=T.length;const z=new Uint8Array(A);for(;A--;)z[A]=T.charCodeAt(A);return new File([z],d,{type:F})}function X(l){return/^data:image\//i.test(l)||/^https?:\/\//i.test(l)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(l)}function Z(l){return/^https?:\/\//i.test(l)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(l)}function oe(l){const d=l.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!d)return null;const v=d[1].trim().replace(/^<|>$/g,"");return X(v)?v:null}async function se(l){var F;const d=(F=o.uploadSizeLimit)==null?void 0:F.video;if(d){const T=Math.max(1,d)*1024*1024;if(l.size>T){try{window.alert(`视频文件大小超限(${(l.size/1024/1024).toFixed(2)}MB > ${d}MB)`)}catch{}return}}if(o.videoUploader){const T=URL.createObjectURL(l),A=r.value,z=A==null?void 0:A.commands;try{typeof(z==null?void 0:z.setVideo)=="function"?A==null||A.chain().focus().setVideo({src:T,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():j(T)}catch{j(T)}try{const I=await o.videoUploader(l);ve(T,I)}catch(I){console.warn("视频上传失败,保留本地对象 URL 作为预览",I)}finally{try{URL.revokeObjectURL(T)}catch{}}return}const v=URL.createObjectURL(l);j(v)}function ve(l,d){const v=r.value;if(!v)return;const{state:F}=v,{doc:T}=F;let A=null;if(T.descendants((z,I)=>{var P,W;return((P=z.type)==null?void 0:P.name)==="video"&&((W=z.attrs)==null?void 0:W.src)===l?(A=I,!1):!0}),A!=null){const z=T.nodeAt(A),I=F.schema.nodes.video;if(!z||!I)return;const P={...z.attrs||{},src:d,uploading:null},W=F.tr.setNodeMarkup(A,I,P,z.marks);v.view.dispatch(W)}}function pe(){var l,d;_.value=((d=(l=r.value)==null?void 0:l.getAttributes("link"))==null?void 0:d.href)||"",f.value=!0}function de(){const l=r.value;if(!l)return;const d=[];l.state.doc.descendants((v,F)=>{if(v.type.name==="heading"){const T=v.attrs.level||1,A=v.textContent||"";d.push({text:A,level:T,pos:F})}}),b.value=d,E()}function E(){const l=r.value,d=w.value,v=b.value;if(!l||!d||!v.length){s.value=[],k.value=null;return}const F=d.getBoundingClientRect(),T=d.scrollHeight||d.clientHeight,A=d.clientHeight||1,z=v.map(W=>{const le=l.view.coordsAtPos(Math.min(W.pos+1,l.state.doc.content.size)).top-F.top+d.scrollTop,ae=T?Math.max(0,Math.min(1,le/T)):0;return Math.round(ae*A)});s.value=z;const I=d.scrollTop+8;let P=null;for(let W=0;W<v.length;W++){const Q=v[W];if(l.view.coordsAtPos(Math.min(Q.pos+1,l.state.doc.content.size)).top-F.top+d.scrollTop<=I)P=Q.pos;else break}k.value=P}function V(l){const d=l.target;d.closest(".outline")||d.closest(".outline-toggle")||r.value&&r.value.chain().focus().run()}function h(){const l=r.value;return l?l.getMarkdown():""}return a({getMarkdown:h}),(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["v-md-editor-wrapper",{fullscreen:p.value,readonly:o.readonly,dark:e.unref(te)==="dark"}]),style:e.normalizeStyle(C.value)},[e.createVNode(e.unref(Dn),{editor:r.value,currentColor:m.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":o.uploadSizeLimit,fullscreen:p.value,disabled:o.readonly,onToggleFullscreen:d[0]||(d[0]=v=>p.value=!p.value),onOpenLinkModal:pe},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen","disabled"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:x.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:w,class:"editor_wrapper",onClick:V},[e.createVNode(e.unref(Be.EditorContent),{editor:r.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(In),{open:x.value,"onUpdate:open":d[1]||(d[1]=v=>x.value=v),items:b.value,editor:r.value,container:w.value,maxHeight:c.value,pinned:N.value,theme:e.unref(te),"onUpdate:pinned":d[2]||(d[2]=v=>N.value=v)},null,8,["open","items","editor","container","maxHeight","pinned","theme"]),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:d[3]||(d[3]=v=>(x.value=!0,N.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(v,F)=>{var T;return e.openBlock(),e.createElementBlock("span",{key:F,class:e.normalizeClass(["outline-marker",{active:((T=b.value[F])==null?void 0:T.pos)===k.value}]),style:e.normalizeStyle({top:(v||0)+"px"}),onClick:e.withModifiers(A=>{var z,I;return(I=r.value)==null?void 0:I.chain().focus().setTextSelection((((z=b.value[F])==null?void 0:z.pos)||1)+1).run()},["stop"])},null,14,On)}),128))],32))],2)],6))}}),[["__scopeId","data-v-39599b71"]]),Wn={install(t){t.component("Editor",Ae)}};q.Editor=Ae,q.default=Wn,Object.defineProperties(q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|