bto-md-editor 0.1.3 → 0.1.4

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.
@@ -1,8 +1,8 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-8b180ffc]{position:relative;display:inline-block}.tooltip[data-v-8b180ffc]{position:absolute;left:50%;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-8b180ffc]{opacity:1;visibility:visible}.tooltip.bottom[data-v-8b180ffc]{top:calc(100% + 6px)}.tooltip.top[data-v-8b180ffc]{bottom:calc(100% + 6px)}.shortcut[data-v-8b180ffc]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-6882ea42]{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:#fff}.icon[data-v-6882ea42]:hover{background:#0000000d}.font-size[data-v-6882ea42]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-6882ea42]{font-size:15px;color:#333}.dropdown[data-v-6882ea42]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;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-6882ea42],.dropdown-slide-leave-to[data-v-6882ea42]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-6882ea42],.dropdown-slide-leave-active[data-v-6882ea42]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-6882ea42]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-6882ea42]:hover{background:#0000000d}.text[data-v-6882ea42]{flex:1}.icon[data-v-570f2a96]{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-570f2a96]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-570f2a96]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-570f2a96]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-570f2a96]:hover{background:#0000000d}.underline[data-v-570f2a96]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-570f2a96]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-570f2a96]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-570f2a96],.dropdown-slide-leave-to[data-v-570f2a96]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-570f2a96],.dropdown-slide-leave-active[data-v-570f2a96]{transition:opacity .18s ease,transform .18s ease}.section[data-v-570f2a96]{margin-bottom:8px}.section-title[data-v-570f2a96]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-570f2a96]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-570f2a96]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-570f2a96]{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-570f2a96]{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-570f2a96]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-570f2a96]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-570f2a96]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-570f2a96]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-570f2a96]{justify-self:end;flex-shrink:1}.svg-icon[data-v-c83ef2e3]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-c83ef2e3]{width:1em;height:1em;display:block}.icon[data-v-5ec8a99f]{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-5ec8a99f]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-5ec8a99f]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-5ec8a99f]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-5ec8a99f]:hover{background:#0000000d}.underline[data-v-5ec8a99f]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-5ec8a99f]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-5ec8a99f]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-5ec8a99f]{margin-bottom:8px}.section-title[data-v-5ec8a99f]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-5ec8a99f]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-5ec8a99f]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-5ec8a99f]{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-5ec8a99f]{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-5ec8a99f]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-5ec8a99f]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-5ec8a99f]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-5ec8a99f]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-5ec8a99f]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-5ec8a99f],.dropdown-slide-leave-to[data-v-5ec8a99f]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-5ec8a99f],.dropdown-slide-leave-active[data-v-5ec8a99f]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-3208357f]{position:relative}.image-input-panel[data-v-3208357f]{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}.image-input[data-v-3208357f]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.image-actions[data-v-3208357f]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-3208357f]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-3208357f]:hover{background:#0000000d}.btn-primary[data-v-3208357f]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-3208357f]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-3208357f],.img-panel-leave-active[data-v-3208357f]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-3208357f],.img-panel-leave-to[data-v-3208357f]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-3208357f],.img-panel-leave-from[data-v-3208357f]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-eef6665b]{position:relative}.video-input-panel[data-v-eef6665b]{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}.video-input[data-v-eef6665b]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.video-actions[data-v-eef6665b]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-eef6665b]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-eef6665b]:hover{background:#0000000d}.btn-primary[data-v-eef6665b]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-eef6665b]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-eef6665b],.video-panel-leave-active[data-v-eef6665b]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-eef6665b],.video-panel-leave-to[data-v-eef6665b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-eef6665b],.video-panel-leave-from[data-v-eef6665b]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-b5bf35e2]{position:relative}.link-input-panel[data-v-b5bf35e2]{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-b5bf35e2]{margin-bottom:8px}.label[data-v-b5bf35e2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-b5bf35e2]{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-b5bf35e2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-b5bf35e2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-b5bf35e2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-b5bf35e2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-b5bf35e2],.link-panel-leave-active[data-v-b5bf35e2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-b5bf35e2],.link-panel-leave-to[data-v-b5bf35e2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-b5bf35e2],.link-panel-leave-from[data-v-b5bf35e2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-ad6f66b7]{position:relative}.table-panel[data-v-ad6f66b7]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-ad6f66b7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-ad6f66b7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-ad6f66b7]{display:flex;gap:4px}.cell[data-v-ad6f66b7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-ad6f66b7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-ad6f66b7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-89ddb4db]{position:relative}.tools-panel[data-v-89ddb4db]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.tools-grid[data-v-89ddb4db]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-89ddb4db]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-0b74c17c]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-0b74c17c]:hover{background:#0000000d}.icon[data-v-bf6f40c3]{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;color:#404040;position:relative}.icon[data-v-bf6f40c3]:hover{background:#0000000d}.heading-select[data-v-3d649d22]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-3d649d22]{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:70px;justify-content:space-between;background:#fff}.icon[data-v-3d649d22]:hover{background:#0000000d}.label[data-v-3d649d22]{font-size:15px;color:#333}.dropdown[data-v-3d649d22]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;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-3d649d22],.dropdown-slide-leave-to[data-v-3d649d22]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-3d649d22],.dropdown-slide-leave-active[data-v-3d649d22]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-3d649d22]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-3d649d22]:hover{background:#0000000d}.item-label[data-v-3d649d22]{flex:1;color:#222}.item-label.paragraph[data-v-3d649d22]{font-size:15px}.item-label.level-1[data-v-3d649d22]{font-size:22px;font-weight:600}.item-label.level-2[data-v-3d649d22]{font-size:20px;font-weight:600}.item-label.level-3[data-v-3d649d22]{font-size:18px;font-weight:600}.item-label.level-4[data-v-3d649d22]{font-size:16px}.item-label.level-5[data-v-3d649d22]{font-size:15px}.item-label.level-6[data-v-3d649d22]{font-size:14px}.shortcut[data-v-3d649d22]{color:#999;font-size:12px}.align-select[data-v-4fc1bd06]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-4fc1bd06]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:#fff;gap:2px}.icon[data-v-4fc1bd06]:hover{background:#0000000d}.dropdown[data-v-4fc1bd06]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;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-4fc1bd06],.dropdown-slide-leave-to[data-v-4fc1bd06]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-4fc1bd06],.dropdown-slide-leave-active[data-v-4fc1bd06]{transition:opacity .18s ease,transform .18s ease}.options[data-v-4fc1bd06]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-4fc1bd06]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-4fc1bd06]:hover{background:#0000000d}.option.active[data-v-4fc1bd06]{background:#0000001a}.header_box[data-v-cab28555]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box .icon[data-v-cab28555]{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}.header_box .icon[data-v-cab28555]:hover{background:#0000000d}.header_box .icon.active[data-v-cab28555]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-cab28555]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-b5f802fc]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-b5f802fc]{border-left:1px solid #e5e7eb;padding:8px;font-size:14px;position:sticky;top:0;align-self:start;max-height:100%;background:#fff;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-b5f802fc]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid #e5e7eb}.outline__listWrap[data-v-b5f802fc]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-b5f802fc]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-b5f802fc]>*{display:inline-flex;gap:6px}.outline__list[data-v-b5f802fc]{list-style:none;padding:0;margin:0}.outline__item[data-v-b5f802fc]{cursor:pointer;padding:4px 0;color:#333}.outline__caret[data-v-b5f802fc]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline__caret.collapsed[data-v-b5f802fc]{transform:rotate(0)}.outline__caret.expanded[data-v-b5f802fc]{transform:rotate(90deg)}.outline__item[data-v-b5f802fc]:hover{color:#6366f1}.outline__item.lv-1[data-v-b5f802fc]{padding-left:0}.outline__item.lv-2[data-v-b5f802fc]{padding-left:8px}.outline__item.lv-3[data-v-b5f802fc]{padding-left:16px}.outline__item.lv-4[data-v-b5f802fc]{padding-left:24px}.outline__item.lv-5[data-v-b5f802fc]{padding-left:32px}.outline__item.lv-6[data-v-b5f802fc]{padding-left:40px}.outline__text[data-v-b5f802fc]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-b5f802fc]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline__close[data-v-b5f802fc]:hover{color:#6366f1}.outline__title[data-v-b5f802fc]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-b5f802fc]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-b5f802fc]{display:none}@media (max-width: 900px){.outline[data-v-b5f802fc]{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-b5f802fc]{width:min(85vw,280px)}.outline-drawer-mask[data-v-b5f802fc]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-b5f802fc],.outline-slide-leave-active[data-v-b5f802fc]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{transform:translate(100%)}}.outline-mask-enter-active[data-v-b5f802fc],.outline-mask-leave-active[data-v-b5f802fc]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-b5f802fc],.outline-mask-leave-to[data-v-b5f802fc]{opacity:0}.simple-editor[data-v-744df7d2]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:8px;background:#fff;box-sizing:border-box;border:1px solid #e5e7eb}.editor_wrapper[data-v-744df7d2]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-744df7d2]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-744df7d2]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-744df7d2]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-744df7d2]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-744df7d2]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-744df7d2]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-744df7d2]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-744df7d2]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-744df7d2]{background:#22c55e}.content[data-v-744df7d2]{padding:12px 24px}.content[data-v-744df7d2] img{max-width:100%;height:auto;display:inline-block}.content[data-v-744df7d2] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-744df7d2] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-744df7d2] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;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-744df7d2] 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-744df7d2 .18s ease both}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-744df7d2] 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-744df7d2 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-744df7d2{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-744df7d2{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-744df7d2] 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 #e5e7eb;margin-top:2px}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-744df7d2] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-744df7d2] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-744df7d2] [data-resize-wrapper]{display:inline-block}.content[data-v-744df7d2] .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-744df7d2] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-744df7d2] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-744df7d2] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-744df7d2] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-744df7d2] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-744df7d2] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-744df7d2] .tiptap-resize-wrapper:hover>img,.content[data-v-744df7d2] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-744df7d2] .tiptap-resize-wrapper{position:relative}.content[data-v-744df7d2] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-744df7d2] .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-744df7d2] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-744df7d2] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-744df7d2] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-744df7d2 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-744df7d2{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-744df7d2] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-744df7d2] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-744df7d2] .ProseMirror table th,.content[data-v-744df7d2] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-744df7d2] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-744df7d2] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-744df7d2] .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-744df7d2] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-744df7d2] .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-744df7d2] code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f2f4f7;padding:2px 4px;border-radius:4px}.content[data-v-744df7d2] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-744df7d2] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f6f8fa;padding:12px;border-radius:6px;border:1px solid #e5e7eb;overflow:auto}.content[data-v-744df7d2] p{margin:12px 0}[data-v-744df7d2] .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 #e5e7eb;cursor:grab;z-index:5}[data-v-744df7d2] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-744df7d2]{grid-template-columns:1fr}.outline-markers[data-v-744df7d2]{display:none}}.link-modal-backdrop[data-v-744df7d2]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-744df7d2]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-744df7d2]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.link-modal__title[data-v-744df7d2]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-744df7d2]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-744df7d2]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-744df7d2]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-744df7d2]{display:block;width:640px;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(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(j,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):(j=typeof globalThis<"u"?globalThis:j||self,e(j.MdEditor={},j.Vue,j.tiptapVue3,j.StarterKit,j.tiptapMarkdown,j.tiptapImage,j.tiptapCore,j.tiptapPlaceholder,j.tiptapLink,j.tiptapTextAlign,j.tiptapTextStyle,j.tiptapColor,j.tiptapUnderline,j.tiptapTable,j.extensions,j.extensionList))})(this,function(j,e,ve,Te,De,Fe,me,Ae,Ue,He,ue,Ie,Oe,be,je,Ve){"use strict";var ze;function Re(t){const s=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(s,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const he=Re(me),We=Fe.Image.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:s=>s.getAttribute("data-uploading")?!0:null,renderHTML:s=>s.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:s=>{const n=s.getAttribute("width")||s.style.width||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:s=>s.width?{width:s.width}:{}},height:{default:null,parseHTML:s=>{const n=s.getAttribute("height")||s.style.height||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:s=>s.height?{height:s.height}:{}}}},addNodeView(){return({node:t,getPos:s,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 c=new me.ResizableNodeView({element:o,node:t,getPos:s,onResize:(E,V)=>{o.style.width=`${E}px`,o.style.height=`${V}px`},onCommit:(E,V)=>{try{const f=n,y=s();if(y!==void 0){const{state:g}=f,h=g.schema.nodes.image,r=g.doc.nodeAt(y);if(h&&r){const a={...r.attrs||{},width:E,height:V},l=g.tr.setNodeMarkup(y,h,a,r.marks);f.view.dispatch(l)}}}catch{}},onUpdate:E=>{const V=E.attrs;return typeof V.src=="string"&&V.src&&o.src!==V.src&&(o.src=V.src),typeof V.width=="number"&&(o.style.width=`${V.width}px`),typeof V.height=="number"&&(o.style.height=`${V.height}px`),V.uploading?c.wrapper.setAttribute("data-uploading","true"):c.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"}}});try{c.container.style.display="inline-block",c.wrapper.style.display="inline-block"}catch{}const M=document.createElement("div");M.className="tiptap-upload-mask";const d=document.createElement("div");return d.className="tiptap-upload-progress",M.appendChild(d),c.wrapper.appendChild(M),i.uploading&&c.wrapper.setAttribute("data-uploading","true"),c}}}),Pe=be.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:s=>s.getAttribute("data-background-color"),renderHTML:s=>{const n=s.backgroundColor;return n?{"data-background-color":n,style:`background-color: ${n}`}:{}}}}}}),Ge=(((ze=he==null?void 0:he.Node)==null?void 0:ze.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!0,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 s=t.getAttribute("width")||t.style.width||"",n=String(s).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const s=t.getAttribute("height")||t.style.height||"",n=String(s).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 s=(t==null?void 0:t.attrs)||{},n=typeof s.src=="string"?s.src:"";return n?`[video](${n})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const s=/^\[video\]\(([^)]+)\)/.exec(t);if(s)return{type:"video",raw:s[0],href:s[1]}}},parseMarkdown(t){const s=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return s?{type:"video",attrs:{src:s,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:s,editor:n})=>{var E;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 c=new me.ResizableNodeView({element:o,node:t,getPos:s,onResize:(V,f)=>{o.style.width=`${V}px`,o.style.height=`${f}px`},onCommit:(V,f)=>{try{const y=n,g=s();if(g!==void 0){const{state:h}=y,r=h.schema.nodes.video,a=h.doc.nodeAt(g);if(r&&a){const l={...a.attrs||{},width:V,height:f},b=h.tr.setNodeMarkup(g,r,l,a.marks);y.view.dispatch(b)}}}catch{}},onUpdate:V=>{const f=V.attrs||{};if(typeof f.src=="string"&&f.src&&o.src!==f.src&&(o.src=f.src),typeof f.width=="number"&&(o.style.width=`${f.width}px`),typeof f.height=="number"&&(o.style.height=`${f.height}px`),f.uploading){c.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}else c.wrapper.removeAttribute("data-uploading"),o.controls=f.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"}}});try{c.container.style.display="inline-block",c.wrapper.style.display="inline-block"}catch{}const M=document.createElement("div");M.className="tiptap-upload-mask";const d=document.createElement("div");if(d.className="tiptap-upload-progress",M.appendChild(d),c.wrapper.appendChild(M),(E=t.attrs)!=null&&E.uploading){c.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}return c}},addCommands(){return{setVideo:t=>({chain:s})=>{const{src:n,HTMLAttributes:o={}}=t||{};return s().insertContent({type:this.name,attrs:{src:n,...o}}).run()}}}}),qe=Ve.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:s,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",d=>d.preventDefault());const c=()=>{const d=typeof n=="function"?n():null;if(d==null)return{pos:null,n:null};const E=s.view.state.doc.nodeAt(d);return{pos:d,n:E}};i.addEventListener("click",()=>{var h;const{pos:d,n:E}=c();if(d==null||!E)return;const V=s.view.state,f=V.schema.nodes.taskItem,y=!!((h=E.attrs)!=null&&h.checked),g=V.tr.setNodeMarkup(d,f,{...E.attrs||{},checked:!y});s.view.dispatch(g)}),i.addEventListener("keydown",d=>{var E;if(d.key==="Enter"||d.key===" "){d.preventDefault();const{pos:V,n:f}=c();if(V==null||!f)return;const y=s.view.state,g=y.schema.nodes.taskItem,h=!!((E=f.attrs)!=null&&E.checked),r=y.tr.setNodeMarkup(V,g,{...f.attrs||{},checked:!h});s.view.dispatch(r)}});const M=document.createElement("div");return M.className="task-content",o.appendChild(i),o.appendChild(M),{dom:o,contentDOM:M,update(d){return d.type!==t.type?!1:(o.setAttribute("data-checked",d.attrs.checked?"true":"false"),i.setAttribute("aria-checked",d.attrs.checked?"true":"false"),!0)}}}}});var Ye={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 Ke(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Je(t,s,n){var o=typeof s.fill=="string"?[s.fill]:s.fill||[],i=[],c=s.theme||n.theme;switch(c){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:s.size||n.size,strokeWidth:s.strokeWidth||n.strokeWidth,strokeLinecap:s.strokeLinecap||n.strokeLinecap,strokeLinejoin:s.strokeLinejoin||n.strokeLinejoin,colors:i,id:t}}var Ze=Symbol("icon-context");function oe(t,s,n){var o={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(c){var M=Ke(),d=e.inject(Ze,Ye);return function(){var E=c.size,V=c.strokeWidth,f=c.strokeLinecap,y=c.strokeLinejoin,g=c.theme,h=c.fill,r=c.spin,a=Je(M,{size:E,strokeWidth:V,strokeLinecap:f,strokeLinejoin:y,theme:g,fill:h},d),l=[d.prefix+"-icon"];return l.push(d.prefix+"-icon-"+t),s&&d.rtl&&l.push(d.prefix+"-icon-rtl"),r&&l.push(d.prefix+"-icon-spin"),e.createVNode("span",{class:l.join(" ")},[n(a)])}}};return o}const le=oe("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)])}),pe=oe("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)])}),Xe=oe("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)])}),Qe=oe("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)])}),et=oe("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)])}),tt=oe("pushpin",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M32 4H16L20 7L16 20C16 20 10 24 10 28H20L24 44L28 28H38C38 24 34 21.1667 32 20L28 7L32 4Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ot=oe("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)])}),nt=oe("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)])}),it=oe("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)])}),rt=oe("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)])}),st=oe("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)])}),lt={class:"label"},at={key:0,class:"shortcut"},ct=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 s=t,n=e.ref(null),o=e.ref(null),i=e.ref(!1),c=e.ref(s.placement);function M(){const V=n.value,f=o.value;if(!V||!f)return;let y=s.placement;const g=f.getBoundingClientRect(),h=g.top,r=window.innerHeight-g.bottom,a=V.offsetHeight+s.offset;y==="bottom"?r<a&&h>=a&&(y="top"):h<a&&r>=a&&(y="bottom"),c.value=y}function d(){i.value=!0,e.nextTick(M)}function E(){i.value=!1}return e.onMounted(()=>{window.addEventListener("resize",M)}),e.watch(()=>s.text,()=>e.nextTick(M)),(V,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:o,class:"tooltip-wrapper",onMouseenter:d,onMouseleave:E,onFocusin:d,onFocusout:E},[e.renderSlot(V.$slots,"default",{},void 0,!0),e.createElementVNode("div",{ref_key:"tipRef",ref:n,class:e.normalizeClass(["tooltip",[c.value,{visible:i.value}]])},[e.createElementVNode("div",lt,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",at,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],2)],544))}}),G=(t,s)=>{const n=t.__vccOpts||t;for(const[o,i]of s)n[o]=i;return n},se=G(ct,[["__scopeId","data-v-8b180ffc"]]),dt=["aria-expanded"],pt={class:"label"},ft={key:0,class:"dropdown",role:"listbox"},mt=["aria-selected","onClick"],ut={class:"text"},ge="md-toolbar-dropdown-open",_e="font-size-select",ht=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],o=e.computed(()=>{var g,h;const y=(h=(g=s.editor)==null?void 0:g.getAttributes("textStyle"))==null?void 0:h.fontSize;return typeof y=="string"&&y?y:"15px"}),i=e.ref(!1),c=e.ref(null);function M(){i.value||window.dispatchEvent(new CustomEvent(ge,{detail:{id:_e}})),i.value=!i.value}function d(){i.value=!1}function E(y){var g;(g=s.editor)==null||g.chain().focus().setMark("textStyle",{fontSize:y}).run(),d()}function V(y){const g=y.target,h=c.value;h&&!h.contains(g)&&d()}e.onMounted(()=>{document.addEventListener("click",V),window.addEventListener(ge,f)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",V),window.removeEventListener(ge,f)});function f(y){var h;((h=y.detail)==null?void 0:h.id)!==_e&&(i.value=!1)}return(y,g)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(M,["stop"]),"aria-expanded":i.value},[e.createElementVNode("div",pt,e.toDisplayString(o.value),1),e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3})],8,dt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",ft,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,h=>e.createElementVNode("div",{key:h,class:"dropdown-item","aria-selected":h===o.value,onClick:e.withModifiers(r=>E(h),["stop"])},[h===o.value?(e.openBlock(),e.createBlock(e.unref(le),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",ut,e.toDisplayString(h),1)],8,mt)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-6882ea42"]]),gt=["aria-expanded"],kt={key:0,class:"dropdown"},wt={class:"section"},Ct={class:"swatches"},yt=["onClick"],xt={class:"section"},vt={class:"swatches grid"},bt=["onClick"],Vt={key:0,class:"section"},_t={class:"swatches"},Et=["onClick"],Nt={class:"section inline-actions"},Mt={key:1,class:"advanced"},ke="md-toolbar-dropdown-open",Ee="color-select",Bt=G(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const s=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),c=e.ref(null),M=e.ref(s.currentColor||"#000000"),d=e.ref(l()),E=e.ref("#F5222D");function V(){o.value||window.dispatchEvent(new CustomEvent(ke,{detail:{id:Ee}})),o.value=!o.value}function f(){o.value=!1}function y(){i.value=!i.value}function g(x){var u;(u=s.editor)==null||u.chain().focus().setColor(x).run(),E.value=x,b(x),f()}function h(){var x;(x=s.editor)==null||x.chain().focus().unsetColor().run(),f()}function r(x){const u=x.target,k=c.value;k&&!k.contains(u)&&f()}function a(){}function l(){try{const x=localStorage.getItem("md_color_recent");if(!x)return[];const u=JSON.parse(x);return Array.isArray(u)?u.slice(0,12):[]}catch{return[]}}function b(x){const u=[x,...d.value.filter(k=>k!==x)];d.value=u.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(d.value))}catch{}}let C=[];function B(){const x=s.editor;x&&(C=[{event:"selectionUpdate",handler:a},{event:"transaction",handler:a},{event:"update",handler:a}],C.forEach(({event:u,handler:k})=>{x.on(u,k)}))}e.onMounted(()=>{document.addEventListener("click",r),window.addEventListener(ke,L),B()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",r),window.removeEventListener(ke,L);const x=s.editor;x&&C.forEach(({event:u,handler:k})=>{x.off(u,k)}),C=[]}),e.watch(()=>s.editor,(x,u)=>{u&&C.forEach(({event:k,handler:S})=>{u.off(k,S)}),C=[],B()});function L(x){var k;((k=x.detail)==null?void 0:k.id)!==Ee&&(o.value=!1)}return(x,u)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:u[0]||(u[0]=e.withModifiers(k=>g(E.value),["stop"]))},[e.createVNode(e.unref(Xe),{theme:"filled",size:"14",fill:"#000",strokeWidth:3}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:E.value})},null,4)]),e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(V,["stop"])},[e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3,size:"12"})])],8,gt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("div",wt,[u[4]||(u[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(S=>g(k),["stop"])},[k===E.value?(e.openBlock(),e.createBlock(e.unref(le),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,yt))),128))])]),e.createElementVNode("div",xt,[u[5]||(u[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(S=>g(k),["stop"])},[k===E.value?(e.openBlock(),e.createBlock(e.unref(le),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,bt))),128))])]),d.value.length?(e.openBlock(),e.createElementBlock("div",Vt,[u[6]||(u[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",_t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(S=>g(k),["stop"])},null,12,Et))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Nt,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(h,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"更多颜色")]),i.value?(e.openBlock(),e.createElementBlock("div",Mt,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":u[1]||(u[1]=k=>M.value=k)},null,512),[[e.vModelText,M.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":u[2]||(u[2]=k=>M.value=k)},null,512),[[e.vModelText,M.value]]),e.createElementVNode("button",{class:"btn apply",onClick:u[3]||(u[3]=e.withModifiers(k=>g(M.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-570f2a96"]]),Lt='<?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>',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="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>',St='<?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>',$t='<?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>',Tt='<?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>',Dt='<?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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',Kt=["innerHTML"],R=G(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{},size:{}},setup(t){const s=t,n=e.useAttrs(),o=Object.assign({"/src/svg/alignCenter.svg":Lt,"/src/svg/alignJustify.svg":zt,"/src/svg/alignLeft.svg":St,"/src/svg/alignRight.svg":$t,"/src/svg/bulletList.svg":Tt,"/src/svg/caretDown.svg":Dt,"/src/svg/clearFormat.svg":Ft,"/src/svg/code.svg":At,"/src/svg/codeBlock.svg":Ut,"/src/svg/formatBrush.svg":Ht,"/src/svg/highBg.svg":It,"/src/svg/img.svg":Ot,"/src/svg/link.svg":jt,"/src/svg/orderedList.svg":Rt,"/src/svg/quote.svg":Wt,"/src/svg/table.svg":Pt,"/src/svg/tableTools.svg":Gt,"/src/svg/task.svg":qt,"/src/svg/video.svg":Yt}),i=(()=>{const f={};return Object.entries(o).forEach(([y,g])=>{const r=(y.split("/src/svg/")[1]||y).replace(/\.svg$/i,"");f[r]=g;const a=r.split("/").pop();a&&(f[a]=g)}),f})(),c=e.computed(()=>{const f=s.name.replace(/\.svg$/i,"");return i[f]||""});function M(f){if(!f)return"";let y=f.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return y=y.replace(/<svg([^>]*)>/i,(g,h)=>`<svg${h.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`),y=y.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),y=y.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),y}const d=e.computed(()=>M(c.value));function E(f){if(f!=null)return typeof f=="number"?`${f}px`:f}const V=e.computed(()=>{const f={},y=E(s.size);y&&(f.fontSize=y),s.color&&(f.color=s.color);const g=n.style??void 0;return[f,g].filter(Boolean)});return(f,y)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(n).class]),style:e.normalizeStyle(V.value),innerHTML:d.value},null,14,Kt))}}),[["__scopeId","data-v-c83ef2e3"]]),Jt=["aria-expanded"],Zt={key:0,class:"dropdown"},Xt={class:"section"},Qt={class:"swatches"},eo={class:"section"},to={class:"swatches"},oo=["onClick"],no={key:0,class:"check"},io={class:"section"},ro={class:"swatches grid"},so=["onClick"],lo={key:0,class:"section"},ao={class:"swatches"},co=["onClick"],po={class:"section inline-actions"},fo={key:1,class:"advanced"},we="md-toolbar-dropdown-open",Ne="bg-color-select",mo=G(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const s=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),c=e.ref(null),M=e.ref(s.currentBg||"#ffffff"),d=e.ref(l()),E=e.ref("#FADB14");function V(){o.value||window.dispatchEvent(new CustomEvent(we,{detail:{id:Ne}})),o.value=!o.value}function f(){o.value=!1}function y(){i.value=!i.value}function g(x){var u;(u=s.editor)==null||u.chain().focus().setMark("textStyle",{backgroundColor:x}).run(),E.value=x,b(x),f()}function h(){var x;(x=s.editor)==null||x.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),f()}function r(x){const u=x.target,k=c.value;k&&!k.contains(u)&&f()}function a(){}function l(){try{const x=localStorage.getItem("md_bg_recent");if(!x)return[];const u=JSON.parse(x);return Array.isArray(u)?u.slice(0,12):[]}catch{return[]}}function b(x){const u=[x,...d.value.filter(k=>k!==x)];d.value=u.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(d.value))}catch{}}let C=[];function B(){const x=s.editor;x&&(C=[{event:"selectionUpdate",handler:a},{event:"transaction",handler:a},{event:"update",handler:a}],C.forEach(({event:u,handler:k})=>{x.on(u,k)}))}e.onMounted(()=>{document.addEventListener("click",r),window.addEventListener(we,L),B()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",r),window.removeEventListener(we,L);const x=s.editor;x&&C.forEach(({event:u,handler:k})=>{x.off(u,k)}),C=[]}),e.watch(()=>s.editor,(x,u)=>{u&&C.forEach(({event:k,handler:S})=>{u.off(k,S)}),C=[],B()});function L(x){var k;((k=x.detail)==null?void 0:k.id)!==Ne&&(o.value=!1)}return(x,u)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:u[0]||(u[0]=e.withModifiers(k=>g(E.value),["stop"]))},[e.createVNode(R,{name:"highBg",size:18}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:E.value})},null,4)]),e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(V,["stop"])},[e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3,size:"12"})])],8,Jt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",Xt,[u[4]||(u[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",Qt,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.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}.icon[data-v-8ea77a66]{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:#fff}.icon[data-v-8ea77a66]:hover{background:#0000000d}.font-size[data-v-8ea77a66]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-8ea77a66]{font-size:15px;color:#333}.dropdown[data-v-8ea77a66]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;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-8ea77a66],.dropdown-slide-leave-to[data-v-8ea77a66]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-8ea77a66],.dropdown-slide-leave-active[data-v-8ea77a66]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-8ea77a66]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-8ea77a66]:hover{background:#0000000d}.text[data-v-8ea77a66]{flex:1}.icon[data-v-0f5572cb]{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-0f5572cb]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-0f5572cb]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-0f5572cb]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-0f5572cb]:hover{background:#0000000d}.underline[data-v-0f5572cb]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-0f5572cb]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-0f5572cb]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-0f5572cb],.dropdown-slide-leave-to[data-v-0f5572cb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-0f5572cb],.dropdown-slide-leave-active[data-v-0f5572cb]{transition:opacity .18s ease,transform .18s ease}.section[data-v-0f5572cb]{margin-bottom:8px}.section-title[data-v-0f5572cb]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-0f5572cb]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-0f5572cb]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-0f5572cb]{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-0f5572cb]{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-0f5572cb]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-0f5572cb]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-0f5572cb]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-0f5572cb]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-0f5572cb]{justify-self:end;flex-shrink:1}.svg-icon[data-v-c83ef2e3]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-c83ef2e3]{width:1em;height:1em;display:block}.icon[data-v-620c7aa3]{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-620c7aa3]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-620c7aa3]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-620c7aa3]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-620c7aa3]:hover{background:#0000000d}.underline[data-v-620c7aa3]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-620c7aa3]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-620c7aa3]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-620c7aa3]{margin-bottom:8px}.section-title[data-v-620c7aa3]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-620c7aa3]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-620c7aa3]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-620c7aa3]{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-620c7aa3]{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-620c7aa3]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-620c7aa3]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-620c7aa3]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-620c7aa3]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-620c7aa3]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-620c7aa3],.dropdown-slide-leave-to[data-v-620c7aa3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-620c7aa3],.dropdown-slide-leave-active[data-v-620c7aa3]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-e1c5f3df]{position:relative}.image-input-panel[data-v-e1c5f3df]{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}.image-input[data-v-e1c5f3df]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.image-actions[data-v-e1c5f3df]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-e1c5f3df]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-e1c5f3df]:hover{background:#0000000d}.btn-primary[data-v-e1c5f3df]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-e1c5f3df]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-e1c5f3df],.img-panel-leave-active[data-v-e1c5f3df]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-e1c5f3df],.img-panel-leave-to[data-v-e1c5f3df]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-e1c5f3df],.img-panel-leave-from[data-v-e1c5f3df]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-35a7027c]{position:relative}.video-input-panel[data-v-35a7027c]{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}.video-input[data-v-35a7027c]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.video-actions[data-v-35a7027c]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-35a7027c]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-35a7027c]:hover{background:#0000000d}.btn-primary[data-v-35a7027c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-35a7027c]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-35a7027c],.video-panel-leave-active[data-v-35a7027c]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-35a7027c],.video-panel-leave-to[data-v-35a7027c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-35a7027c],.video-panel-leave-from[data-v-35a7027c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-47847dc2]{position:relative}.link-input-panel[data-v-47847dc2]{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-47847dc2]{margin-bottom:8px}.label[data-v-47847dc2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-47847dc2]{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-47847dc2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-47847dc2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-47847dc2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-47847dc2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-47847dc2],.link-panel-leave-active[data-v-47847dc2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-47847dc2],.link-panel-leave-to[data-v-47847dc2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-47847dc2],.link-panel-leave-from[data-v-47847dc2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-8a3a35f7]{position:relative}.table-panel[data-v-8a3a35f7]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-8a3a35f7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-8a3a35f7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-8a3a35f7]{display:flex;gap:4px}.cell[data-v-8a3a35f7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-8a3a35f7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-8a3a35f7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-bbf06816]{position:relative}.tools-panel[data-v-bbf06816]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.tools-grid[data-v-bbf06816]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-bbf06816]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-693f2c14]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-693f2c14]:hover{background:#0000000d}.icon[data-v-587fb9a8]{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;color:#404040;position:relative}.icon[data-v-587fb9a8]:hover{background:#0000000d}.heading-select[data-v-aeb74f7c]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-aeb74f7c]{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:70px;justify-content:space-between;background:#fff}.icon[data-v-aeb74f7c]:hover{background:#0000000d}.label[data-v-aeb74f7c]{font-size:15px;color:#333}.dropdown[data-v-aeb74f7c]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;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-aeb74f7c],.dropdown-slide-leave-to[data-v-aeb74f7c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-aeb74f7c],.dropdown-slide-leave-active[data-v-aeb74f7c]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-aeb74f7c]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-aeb74f7c]:hover{background:#0000000d}.item-label[data-v-aeb74f7c]{flex:1;color:#222}.item-label.paragraph[data-v-aeb74f7c]{font-size:15px}.item-label.level-1[data-v-aeb74f7c]{font-size:22px;font-weight:600}.item-label.level-2[data-v-aeb74f7c]{font-size:20px;font-weight:600}.item-label.level-3[data-v-aeb74f7c]{font-size:18px;font-weight:600}.item-label.level-4[data-v-aeb74f7c]{font-size:16px}.item-label.level-5[data-v-aeb74f7c]{font-size:15px}.item-label.level-6[data-v-aeb74f7c]{font-size:14px}.shortcut[data-v-aeb74f7c]{color:#999;font-size:12px}.align-select[data-v-f2f793f3]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-f2f793f3]{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:#fff;gap:3px}.icon_box[data-v-f2f793f3]:hover{background:#0000000d}.dropdown[data-v-f2f793f3]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;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-f2f793f3],.dropdown-slide-leave-to[data-v-f2f793f3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f2f793f3],.dropdown-slide-leave-active[data-v-f2f793f3]{transition:opacity .18s ease,transform .18s ease}.options[data-v-f2f793f3]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-f2f793f3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-f2f793f3]:hover{background:#0000000d}.option.active[data-v-f2f793f3]{background:#0000001a}.header_box[data-v-e9f73372]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box .icon[data-v-e9f73372]{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}.header_box .icon[data-v-e9f73372]:hover{background:#0000000d}.header_box .icon.active[data-v-e9f73372]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-e9f73372]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-b5f802fc]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-b5f802fc]{border-left:1px solid #e5e7eb;padding:8px;font-size:14px;position:sticky;top:0;align-self:start;max-height:100%;background:#fff;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-b5f802fc]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid #e5e7eb}.outline__listWrap[data-v-b5f802fc]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-b5f802fc]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-b5f802fc]>*{display:inline-flex;gap:6px}.outline__list[data-v-b5f802fc]{list-style:none;padding:0;margin:0}.outline__item[data-v-b5f802fc]{cursor:pointer;padding:4px 0;color:#333}.outline__caret[data-v-b5f802fc]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline__caret.collapsed[data-v-b5f802fc]{transform:rotate(0)}.outline__caret.expanded[data-v-b5f802fc]{transform:rotate(90deg)}.outline__item[data-v-b5f802fc]:hover{color:#6366f1}.outline__item.lv-1[data-v-b5f802fc]{padding-left:0}.outline__item.lv-2[data-v-b5f802fc]{padding-left:8px}.outline__item.lv-3[data-v-b5f802fc]{padding-left:16px}.outline__item.lv-4[data-v-b5f802fc]{padding-left:24px}.outline__item.lv-5[data-v-b5f802fc]{padding-left:32px}.outline__item.lv-6[data-v-b5f802fc]{padding-left:40px}.outline__text[data-v-b5f802fc]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-b5f802fc]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline__close[data-v-b5f802fc]:hover{color:#6366f1}.outline__title[data-v-b5f802fc]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-b5f802fc]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-b5f802fc]{display:none}@media (max-width: 900px){.outline[data-v-b5f802fc]{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-b5f802fc]{width:min(85vw,280px)}.outline-drawer-mask[data-v-b5f802fc]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-b5f802fc],.outline-slide-leave-active[data-v-b5f802fc]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{transform:translate(100%)}}.outline-mask-enter-active[data-v-b5f802fc],.outline-mask-leave-active[data-v-b5f802fc]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-b5f802fc],.outline-mask-leave-to[data-v-b5f802fc]{opacity:0}.simple-editor[data-v-64eed710]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:8px;background:#fff;box-sizing:border-box;border:1px solid #e5e7eb}.simple-editor.fullscreen[data-v-64eed710]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.editor_wrapper[data-v-64eed710]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-64eed710]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-64eed710]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-64eed710]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-64eed710]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-64eed710]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-64eed710]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-64eed710]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-64eed710]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-64eed710]{background:#22c55e}.content[data-v-64eed710]{padding:12px 24px}.content[data-v-64eed710] img{max-width:100%;height:auto;display:inline-block}.content[data-v-64eed710] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-64eed710] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-64eed710] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;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-64eed710] 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-64eed710 .18s ease both}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-64eed710] 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-64eed710 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-64eed710{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-64eed710{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-64eed710] 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 #e5e7eb;margin-top:2px}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-64eed710] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-64eed710] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-64eed710] [data-resize-wrapper]{display:inline-block}.content[data-v-64eed710] .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-64eed710] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-64eed710] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-64eed710] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-64eed710] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-64eed710] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-64eed710] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-64eed710] .tiptap-resize-wrapper:hover>img,.content[data-v-64eed710] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-64eed710] .tiptap-resize-wrapper{position:relative}.content[data-v-64eed710] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-64eed710] .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-64eed710] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-64eed710] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-64eed710] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-64eed710 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-64eed710{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-64eed710] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-64eed710] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-64eed710] .ProseMirror table th,.content[data-v-64eed710] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-64eed710] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-64eed710] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-64eed710] .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-64eed710] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-64eed710] .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-64eed710] code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f2f4f7;padding:2px 4px;border-radius:4px}.content[data-v-64eed710] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-64eed710] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f6f8fa;padding:12px;border-radius:6px;border:1px solid #e5e7eb;overflow:auto}.content[data-v-64eed710] p{margin:12px 0}[data-v-64eed710] .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 #e5e7eb;cursor:grab;z-index:5}[data-v-64eed710] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-64eed710]{grid-template-columns:1fr}.outline-markers[data-v-64eed710]{display:none}}.link-modal-backdrop[data-v-64eed710]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-64eed710]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-64eed710]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.link-modal__title[data-v-64eed710]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-64eed710]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-64eed710]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-64eed710]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-64eed710]{display:block;width:640px;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(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
+ (function(I,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):(I=typeof globalThis<"u"?globalThis:I||self,e(I.MdEditor={},I.Vue,I.tiptapVue3,I.StarterKit,I.tiptapMarkdown,I.tiptapImage,I.tiptapCore,I.tiptapPlaceholder,I.tiptapLink,I.tiptapTextAlign,I.tiptapTextStyle,I.tiptapColor,I.tiptapUnderline,I.tiptapTable,I.extensions,I.extensionList))})(this,function(I,e,Ne,Fe,Ae,He,he,Ue,je,Ie,ge,Oe,We,Ee,Re,ve){"use strict";var Te;function Pe(t){const i=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(i,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const ke=Pe(he),Ge=He.Image.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:i=>i.getAttribute("data-uploading")?!0:null,renderHTML:i=>i.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:i=>{const r=i.getAttribute("width")||i.style.width||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:i=>i.width?{width:i.width}:{}},height:{default:null,parseHTML:i=>{const r=i.getAttribute("height")||i.style.height||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:i=>i.height?{height:i.height}:{}}}},addNodeView(){return({node:t,getPos:i,editor:r})=>{const n=document.createElement("img"),s=t.attrs;n.src=s.src||"",s.alt&&(n.alt=s.alt),s.title&&(n.title=s.title),typeof s.width=="number"&&(n.style.width=`${s.width}px`),typeof s.height=="number"&&(n.style.height=`${s.height}px`),n.style.maxWidth="100%",n.style.height=n.style.height||"auto",n.style.display="inline-block";const c=new he.ResizableNodeView({element:n,node:t,getPos:i,onResize:(_,E)=>{n.style.width=`${_}px`,n.style.height=`${E}px`},onCommit:(_,E)=>{try{const f=r,b=i();if(b!==void 0){const{state:C}=f,y=C.schema.nodes.image,a=C.doc.nodeAt(b);if(y&&a){const p={...a.attrs||{},width:_,height:E},d=C.tr.setNodeMarkup(b,y,p,a.marks);f.view.dispatch(d)}}}catch{}},onUpdate:_=>{const E=_.attrs;return typeof E.src=="string"&&E.src&&n.src!==E.src&&(n.src=E.src),typeof E.width=="number"&&(n.style.width=`${E.width}px`),typeof E.height=="number"&&(n.style.height=`${E.height}px`),E.uploading?c.wrapper.setAttribute("data-uploading","true"):c.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"}}});try{c.container.style.display="inline-block",c.wrapper.style.display="inline-block"}catch{}const M=document.createElement("div");M.className="tiptap-upload-mask";const l=document.createElement("div");return l.className="tiptap-upload-progress",M.appendChild(l),c.wrapper.appendChild(M),s.uploading&&c.wrapper.setAttribute("data-uploading","true"),c}}}),qe=Ee.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:i=>i.getAttribute("data-background-color"),renderHTML:i=>{const r=i.backgroundColor;return r?{"data-background-color":r,style:`background-color: ${r}`}:{}}}}}}),Ye=(((Te=ke==null?void 0:ke.Node)==null?void 0:Te.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!0,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 i=t.getAttribute("width")||t.style.width||"",r=String(i).match(/^(\d+)(px)?$/);return r?Number(r[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const i=t.getAttribute("height")||t.style.height||"",r=String(i).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 i=(t==null?void 0:t.attrs)||{},r=typeof i.src=="string"?i.src:"";return r?`[video](${r})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const i=/^\[video\]\(([^)]+)\)/.exec(t);if(i)return{type:"video",raw:i[0],href:i[1]}}},parseMarkdown(t){const i=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return i?{type:"video",attrs:{src:i,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:i,editor:r})=>{var _;const n=document.createElement("video"),s=t.attrs;n.src=s.src||"",n.controls=s.controls!==!1,n.autoplay=!1,n.loop=!!s.loop,n.muted=!!s.muted,s.poster&&(n.poster=s.poster),n.setAttribute("playsinline","true"),s.class&&(n.className=String(s.class)),typeof s.width=="number"&&(n.style.width=`${s.width}px`),typeof s.height=="number"&&(n.style.height=`${s.height}px`),n.style.display="inline-block";const c=new he.ResizableNodeView({element:n,node:t,getPos:i,onResize:(E,f)=>{n.style.width=`${E}px`,n.style.height=`${f}px`},onCommit:(E,f)=>{try{const b=r,C=i();if(C!==void 0){const{state:y}=b,a=y.schema.nodes.video,p=y.doc.nodeAt(C);if(a&&p){const d={...p.attrs||{},width:E,height:f},k=y.tr.setNodeMarkup(C,a,d,p.marks);b.view.dispatch(k)}}}catch{}},onUpdate:E=>{const f=E.attrs||{};if(typeof f.src=="string"&&f.src&&n.src!==f.src&&(n.src=f.src),typeof f.width=="number"&&(n.style.width=`${f.width}px`),typeof f.height=="number"&&(n.style.height=`${f.height}px`),f.uploading){c.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}else c.wrapper.removeAttribute("data-uploading"),n.controls=f.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"}}});try{c.container.style.display="inline-block",c.wrapper.style.display="inline-block"}catch{}const M=document.createElement("div");M.className="tiptap-upload-mask";const l=document.createElement("div");if(l.className="tiptap-upload-progress",M.appendChild(l),c.wrapper.appendChild(M),(_=t.attrs)!=null&&_.uploading){c.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}return c}},addCommands(){return{setVideo:t=>({chain:i})=>{const{src:r,HTMLAttributes:n={}}=t||{};return i().insertContent({type:this.name,attrs:{src:r,...n}}).run()}}}}),Ke=ve.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:i,getPos:r})=>{const n=document.createElement("li");n.setAttribute("data-type","taskItem"),n.setAttribute("data-checked",t.attrs.checked?"true":"false");const s=document.createElement("span");s.className="todo-box",s.tabIndex=0,s.setAttribute("role","checkbox"),s.setAttribute("aria-checked",t.attrs.checked?"true":"false"),s.addEventListener("mousedown",l=>l.preventDefault());const c=()=>{const l=typeof r=="function"?r():null;if(l==null)return{pos:null,n:null};const _=i.view.state.doc.nodeAt(l);return{pos:l,n:_}};s.addEventListener("click",()=>{var y;const{pos:l,n:_}=c();if(l==null||!_)return;const E=i.view.state,f=E.schema.nodes.taskItem,b=!!((y=_.attrs)!=null&&y.checked),C=E.tr.setNodeMarkup(l,f,{..._.attrs||{},checked:!b});i.view.dispatch(C)}),s.addEventListener("keydown",l=>{var _;if(l.key==="Enter"||l.key===" "){l.preventDefault();const{pos:E,n:f}=c();if(E==null||!f)return;const b=i.view.state,C=b.schema.nodes.taskItem,y=!!((_=f.attrs)!=null&&_.checked),a=b.tr.setNodeMarkup(E,C,{...f.attrs||{},checked:!y});i.view.dispatch(a)}});const M=document.createElement("div");return M.className="task-content",n.appendChild(s),n.appendChild(M),{dom:n,contentDOM:M,update(l){return l.type!==t.type?!1:(n.setAttribute("data-checked",l.attrs.checked?"true":"false"),s.setAttribute("aria-checked",l.attrs.checked?"true":"false"),!0)}}}}});var Je={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 Ze(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Xe(t,i,r){var n=typeof i.fill=="string"?[i.fill]:i.fill||[],s=[],c=i.theme||r.theme;switch(c){case"outline":s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push("none"),s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push("none");break;case"filled":s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push("#FFF"),s.push("#FFF");break;case"two-tone":s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone),s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone);break;case"multi-color":s.push(typeof n[0]=="string"?n[0]:"currentColor"),s.push(typeof n[1]=="string"?n[1]:r.colors.multiColor.outFillColor),s.push(typeof n[2]=="string"?n[2]:r.colors.multiColor.innerStrokeColor),s.push(typeof n[3]=="string"?n[3]:r.colors.multiColor.innerFillColor);break}return{size:i.size||r.size,strokeWidth:i.strokeWidth||r.strokeWidth,strokeLinecap:i.strokeLinecap||r.strokeLinecap,strokeLinejoin:i.strokeLinejoin||r.strokeLinejoin,colors:s,id:t}}var Qe=Symbol("icon-context");function J(t,i,r){var n={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(c){var M=Ze(),l=e.inject(Qe,Je);return function(){var _=c.size,E=c.strokeWidth,f=c.strokeLinecap,b=c.strokeLinejoin,C=c.theme,y=c.fill,a=c.spin,p=Xe(M,{size:_,strokeWidth:E,strokeLinecap:f,strokeLinejoin:b,theme:C,fill:y},l),d=[l.prefix+"-icon"];return d.push(l.prefix+"-icon-"+t),i&&l.rtl&&d.push(l.prefix+"-icon-rtl"),a&&d.push(l.prefix+"-icon-spin"),e.createVNode("span",{class:d.join(" ")},[r(p)])}}};return n}const ae=J("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)])}),pe=J("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)])}),et=J("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)])}),tt=J("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)])}),ot=J("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)])}),nt=J("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)])}),rt=J("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)])}),it=J("pushpin",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M32 4H16L20 7L16 20C16 20 10 24 10 28H20L24 44L28 28H38C38 24 34 21.1667 32 20L28 7L32 4Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),st=J("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)])}),lt=J("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)])}),at=J("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)])}),ct=J("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)])}),dt=J("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)])}),ft={class:"label"},pt={key:0,class:"shortcut"},mt=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 i=t,r=e.ref(null),n=e.ref(null),s=e.ref(!1),c=e.ref(i.placement),M=e.ref({top:0,left:0});function l(){const f=r.value,b=n.value;if(!f||!b)return;let C=i.placement;const y=b.getBoundingClientRect(),a=y.top,p=window.innerHeight-y.bottom,d=f.offsetHeight+i.offset;C==="bottom"?p<d&&a>=d&&(C="top"):a<d&&p>=d&&(C="bottom"),c.value=C;const k=y.left+y.width/2,u=C==="bottom"?y.bottom+i.offset:y.top-i.offset-f.offsetHeight;M.value={top:u,left:k}}function _(){s.value=!0,e.nextTick(l)}function E(){s.value=!1}return e.onMounted(()=>{window.addEventListener("resize",l),window.addEventListener("scroll",l,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}),e.watch(()=>i.text,()=>e.nextTick(l)),(f,b)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n,class:"tooltip-wrapper",onMouseenter:_,onMouseleave:E,onFocusin:_,onFocusout:E},[e.renderSlot(f.$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",[c.value,{visible:s.value}]]),style:e.normalizeStyle({top:M.value.top+"px",left:M.value.left+"px"})},[e.createElementVNode("div",ft,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",pt,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],6)]))],544))}}),P=(t,i)=>{const r=t.__vccOpts||t;for(const[n,s]of i)r[n]=s;return r},D=P(mt,[["__scopeId","data-v-2e4633d5"]]),ut=["aria-expanded"],ht={class:"label"},gt={key:0,class:"dropdown",role:"listbox"},kt=["aria-selected","onClick"],wt={class:"text"},we="md-toolbar-dropdown-open",Me="font-size-select",Ct=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t,r=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],n=e.computed(()=>{var C,y;const b=(y=(C=i.editor)==null?void 0:C.getAttributes("textStyle"))==null?void 0:y.fontSize;return typeof b=="string"&&b?b:"15px"}),s=e.ref(!1),c=e.ref(null);function M(){s.value||window.dispatchEvent(new CustomEvent(we,{detail:{id:Me}})),s.value=!s.value}function l(){s.value=!1}function _(b){var C;(C=i.editor)==null||C.chain().focus().setMark("textStyle",{fontSize:b}).run(),l()}function E(b){const C=b.target,y=c.value;y&&!y.contains(C)&&l()}e.onMounted(()=>{document.addEventListener("click",E),window.addEventListener(we,f)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E),window.removeEventListener(we,f)});function f(b){var y;((y=b.detail)==null?void 0:y.id)!==Me&&(s.value=!1)}return(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size",ref_key:"rootRef",ref:c},[e.createVNode(e.unref(D),{text:"字体大小",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(M,["stop"]),"aria-expanded":s.value},[e.createElementVNode("div",ht,e.toDisplayString(n.value),1),e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3})],8,ut)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",gt,[(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(a=>_(y),["stop"])},[y===n.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",wt,e.toDisplayString(y),1)],8,kt)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-8ea77a66"]]),xt=["aria-expanded"],yt={key:0,class:"dropdown"},bt={class:"section"},Vt={class:"swatches"},_t=["onClick"],Nt={class:"section"},Et={class:"swatches grid"},vt=["onClick"],Mt={key:0,class:"section"},Bt={class:"swatches"},Lt=["onClick"],zt={class:"section inline-actions"},St={key:1,class:"advanced"},Ce="md-toolbar-dropdown-open",Be="color-select",$t=P(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const i=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),s=e.ref(!1),c=e.ref(null),M=e.ref(i.currentColor||"#000000"),l=e.ref(d()),_=e.ref("#F5222D");function E(){n.value||window.dispatchEvent(new CustomEvent(Ce,{detail:{id:Be}})),n.value=!n.value}function f(){n.value=!1}function b(){s.value=!s.value}function C(w){var g;(g=i.editor)==null||g.chain().focus().setColor(w).run(),_.value=w,k(w),f()}function y(){var w;(w=i.editor)==null||w.chain().focus().unsetColor().run(),f()}function a(w){const g=w.target,h=c.value;h&&!h.contains(g)&&f()}function p(){}function d(){try{const w=localStorage.getItem("md_color_recent");if(!w)return[];const g=JSON.parse(w);return Array.isArray(g)?g.slice(0,12):[]}catch{return[]}}function k(w){const g=[w,...l.value.filter(h=>h!==w)];l.value=g.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(l.value))}catch{}}let u=[];function v(){const w=i.editor;w&&(u=[{event:"selectionUpdate",handler:p},{event:"transaction",handler:p},{event:"update",handler:p}],u.forEach(({event:g,handler:h})=>{w.on(g,h)}))}e.onMounted(()=>{document.addEventListener("click",a),window.addEventListener(Ce,S),v()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",a),window.removeEventListener(Ce,S);const w=i.editor;w&&u.forEach(({event:g,handler:h})=>{w.off(g,h)}),u=[]}),e.watch(()=>i.editor,(w,g)=>{g&&u.forEach(({event:h,handler:$})=>{g.off(h,$)}),u=[],v()});function S(w){var h;((h=w.detail)==null?void 0:h.id)!==Be&&(n.value=!1)}return(w,g)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(D),{text:"文字颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:g[0]||(g[0]=e.withModifiers(h=>C(_.value),["stop"]))},[e.createVNode(e.unref(et),{theme:"filled",size:"14",fill:"#000",strokeWidth:3}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:_.value})},null,4)])]),_:1}),e.createVNode(e.unref(D),{text:"更多颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(E,["stop"])},[e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,xt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("div",bt,[g[4]||(g[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),h=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"swatch",style:e.normalizeStyle({background:h}),onClick:e.withModifiers($=>C(h),["stop"])},[h===_.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,_t))),128))])]),e.createElementVNode("div",Nt,[g[5]||(g[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),h=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"swatch",style:e.normalizeStyle({background:h}),onClick:e.withModifiers($=>C(h),["stop"])},[h===_.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,vt))),128))])]),l.value.length?(e.openBlock(),e.createElementBlock("div",Mt,[g[6]||(g[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",Bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"swatch",style:e.normalizeStyle({background:h}),onClick:e.withModifiers($=>C(h),["stop"])},null,12,Lt))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",zt,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(b,["stop"])},"更多颜色")]),s.value?(e.openBlock(),e.createElementBlock("div",St,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":g[1]||(g[1]=h=>M.value=h)},null,512),[[e.vModelText,M.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":g[2]||(g[2]=h=>M.value=h)},null,512),[[e.vModelText,M.value]]),e.createElementVNode("button",{class:"btn apply",onClick:g[3]||(g[3]=e.withModifiers(h=>C(M.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-0f5572cb"]]),Tt='<?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>',Dt='<?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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',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="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>',Qt=["innerHTML"],O=P(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{},size:{}},setup(t){const i=t,r=e.useAttrs(),n=Object.assign({"/src/svg/alignCenter.svg":Tt,"/src/svg/alignJustify.svg":Dt,"/src/svg/alignLeft.svg":Ft,"/src/svg/alignRight.svg":At,"/src/svg/bulletList.svg":Ht,"/src/svg/caretDown.svg":Ut,"/src/svg/clearFormat.svg":jt,"/src/svg/code.svg":It,"/src/svg/codeBlock.svg":Ot,"/src/svg/formatBrush.svg":Wt,"/src/svg/highBg.svg":Rt,"/src/svg/img.svg":Pt,"/src/svg/link.svg":Gt,"/src/svg/orderedList.svg":qt,"/src/svg/quote.svg":Yt,"/src/svg/table.svg":Kt,"/src/svg/tableTools.svg":Jt,"/src/svg/task.svg":Zt,"/src/svg/video.svg":Xt}),s=(()=>{const f={};return Object.entries(n).forEach(([b,C])=>{const a=(b.split("/src/svg/")[1]||b).replace(/\.svg$/i,"");f[a]=C;const p=a.split("/").pop();p&&(f[p]=C)}),f})(),c=e.computed(()=>{const f=i.name.replace(/\.svg$/i,"");return s[f]||""});function M(f){if(!f)return"";let b=f.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return b=b.replace(/<svg([^>]*)>/i,(C,y)=>`<svg${y.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`),b=b.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),b=b.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),b}const l=e.computed(()=>M(c.value));function _(f){if(f!=null)return typeof f=="number"?`${f}px`:f}const E=e.computed(()=>{const f={},b=_(i.size);b&&(f.fontSize=b),i.color&&(f.color=i.color);const C=r.style??void 0;return[f,C].filter(Boolean)});return(f,b)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(r).class]),style:e.normalizeStyle(E.value),innerHTML:l.value},null,14,Qt))}}),[["__scopeId","data-v-c83ef2e3"]]),eo=["aria-expanded"],to={key:0,class:"dropdown"},oo={class:"section"},no={class:"swatches"},ro={class:"section"},io={class:"swatches"},so=["onClick"],lo={key:0,class:"check"},ao={class:"section"},co={class:"swatches grid"},fo=["onClick"],po={key:0,class:"section"},mo={class:"swatches"},uo=["onClick"],ho={class:"section inline-actions"},go={key:1,class:"advanced"},xe="md-toolbar-dropdown-open",Le="bg-color-select",ko=P(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const i=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),s=e.ref(!1),c=e.ref(null),M=e.ref(i.currentBg||"#ffffff"),l=e.ref(d()),_=e.ref("#FADB14");function E(){n.value||window.dispatchEvent(new CustomEvent(xe,{detail:{id:Le}})),n.value=!n.value}function f(){n.value=!1}function b(){s.value=!s.value}function C(w){var g;(g=i.editor)==null||g.chain().focus().setMark("textStyle",{backgroundColor:w}).run(),_.value=w,k(w),f()}function y(){var w;(w=i.editor)==null||w.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),f()}function a(w){const g=w.target,h=c.value;h&&!h.contains(g)&&f()}function p(){}function d(){try{const w=localStorage.getItem("md_bg_recent");if(!w)return[];const g=JSON.parse(w);return Array.isArray(g)?g.slice(0,12):[]}catch{return[]}}function k(w){const g=[w,...l.value.filter(h=>h!==w)];l.value=g.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(l.value))}catch{}}let u=[];function v(){const w=i.editor;w&&(u=[{event:"selectionUpdate",handler:p},{event:"transaction",handler:p},{event:"update",handler:p}],u.forEach(({event:g,handler:h})=>{w.on(g,h)}))}e.onMounted(()=>{document.addEventListener("click",a),window.addEventListener(xe,S),v()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",a),window.removeEventListener(xe,S);const w=i.editor;w&&u.forEach(({event:g,handler:h})=>{w.off(g,h)}),u=[]}),e.watch(()=>i.editor,(w,g)=>{g&&u.forEach(({event:h,handler:$})=>{g.off(h,$)}),u=[],v()});function S(w){var h;((h=w.detail)==null?void 0:h.id)!==Le&&(n.value=!1)}return(w,g)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(D),{text:"背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:g[0]||(g[0]=e.withModifiers(h=>C(_.value),["stop"]))},[e.createVNode(O,{name:"highBg",size:18}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:_.value})},null,4)])]),_:1}),e.createVNode(e.unref(D),{text:"更多背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(E,["stop"])},[e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,eo),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",oo,[g[4]||(g[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",no,[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(h,["stop"])})])]),e.createElementVNode("div",eo,[u[5]||(u[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",to,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(S=>g(k),["stop"])},[k===E.value?(e.openBlock(),e.createElementBlock("span",no,"✓")):e.createCommentVNode("",!0)],12,oo))),128))])]),e.createElementVNode("div",io,[u[6]||(u[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(S=>g(k),["stop"])},[k===E.value?(e.openBlock(),e.createBlock(e.unref(le),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,so))),128))])]),d.value.length?(e.openBlock(),e.createElementBlock("div",lo,[u[7]||(u[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(S=>g(k),["stop"])},null,12,co))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",po,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(h,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"更多颜色")]),i.value?(e.openBlock(),e.createElementBlock("div",fo,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":u[1]||(u[1]=k=>M.value=k)},null,512),[[e.vModelText,M.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":u[2]||(u[2]=k=>M.value=k)},null,512),[[e.vModelText,M.value]]),e.createElementVNode("button",{class:"btn apply",onClick:u[3]||(u[3]=e.withModifiers(k=>g(M.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-5ec8a99f"]]),uo={class:"image-actions"},ho=["aria-disabled","disabled"],go=G(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(""),i=e.ref(!1),c=e.ref(null),M=()=>{n.value=!n.value},d=()=>{var r,a,l,b,C,B;const h=o.value.trim();h&&((B=(C=((b=(a=(r=s.editor)==null?void 0:r.chain)==null?void 0:(l=a.call(r)).focus)==null?void 0:b.call(l)).setImage({src:h})).run)==null||B.call(C),n.value=!1,o.value="")},E=h=>{h.key==="Enter"&&d(),h.key==="Escape"&&(n.value=!1,o.value="")},V=()=>{var h;s.imageUploader&&((h=c.value)==null||h.click())},f=async h=>{var b,C,B,L,x,u,k,S;const r=h.target,a=(b=r.files)==null?void 0:b[0];if(r.value="",!a||!s.imageUploader)return;const l=(C=s.uploadSizeLimit)==null?void 0:C.image;if(typeof l=="number"&&l>0){const A=Math.max(1,l)*1024*1024;if(a.size>A){try{window.alert(`图片文件大小超限(${(a.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}try{i.value=!0;let A=null;A=URL.createObjectURL(a),(S=(k=((u=(L=(B=s.editor)==null?void 0:B.chain)==null?void 0:(x=L.call(B)).focus)==null?void 0:u.call(x)).setImage({src:A,uploading:!0})).run)==null||S.call(k);const H=await s.imageUploader(a);if(typeof H=="string"&&H){const K=s.editor,{state:J}=K,{doc:Z}=J;let te=null;if(Z.descendants((P,_)=>{var w,m;return((w=P==null?void 0:P.type)==null?void 0:w.name)==="image"&&((m=P==null?void 0:P.attrs)==null?void 0:m.src)===A?(te=_,!1):!0}),te!=null){const P=Z.nodeAt(te),_=J.schema.nodes.image;if(P&&_){const w={...P.attrs||{},src:H,uploading:null},m=J.tr.setNodeMarkup(te,_,w,P.marks);K.view.dispatch(m)}}n.value=!1,o.value=""}}finally{i.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},y=e.ref(null);let g=null;return e.onMounted(()=>{g=h=>{if(!n.value)return;const r=y.value,a=h.target;r&&a&&!r.contains(a)&&(n.value=!1)},document.addEventListener("mousedown",g,!0)}),e.onBeforeUnmount(()=>{g&&(document.removeEventListener("mousedown",g,!0),g=null)}),(h,r)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:M,ref_key:"rootRef",ref:y},[e.createVNode(R,{name:"img",size:18}),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:r[1]||(r[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":r[0]||(r[0]=a=>o.value=a),onKeydown:E},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:f},null,544),e.createElementVNode("div",uo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(d,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!s.imageUploader||i.value,disabled:!s.imageUploader||i.value,onClick:e.withModifiers(V,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,ho)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-3208357f"]]),ko={class:"video-actions"},wo=["aria-disabled","disabled"],Co=G(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(""),i=e.ref(!1),c=e.ref(null),M=()=>{n.value=!n.value},d=()=>{const r=o.value.trim();if(!r)return;const a=s.editor,l=a==null?void 0:a.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(r)){const C=String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");try{a.chain().focus().insertContent(`<p><a href="${C}" target="_blank" rel="noopener noreferrer">${C}</a></p>`).run()}catch{a.chain().focus().insertContent(C).run()}}else if(typeof(l==null?void 0:l.setVideo)=="function")a.chain().focus().setVideo({src:r,HTMLAttributes:{controls:!0,width:640}}).run();else{const C=String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");try{a.chain().focus().insertContent(`<p><a href="${C}" target="_blank" rel="noopener noreferrer">${C}</a></p>`).run()}catch{a.chain().focus().insertContent(C).run()}}n.value=!1,o.value=""},E=r=>{r.key==="Enter"&&d(),r.key==="Escape"&&(n.value=!1,o.value="")},V=()=>{var r;s.videoUploader&&((r=c.value)==null||r.click())},f=async r=>{var B,L;const a=r.target,l=(B=a.files)==null?void 0:B[0];if(a.value="",!l||!s.videoUploader)return;const b=(L=s.uploadSizeLimit)==null?void 0:L.video;if(typeof b=="number"&&b>0){const x=Math.max(1,b)*1024*1024;if(l.size>x){try{window.alert(`视频文件大小超限(${(l.size/1024/1024).toFixed(2)}MB > ${b}MB)`)}catch{}return}}let C=null;try{i.value=!0;const x=s.editor,u=x==null?void 0:x.commands;C=URL.createObjectURL(l);try{if(typeof(u==null?void 0:u.setVideo)=="function")x.chain().focus().setVideo({src:C,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const S=String(C).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");try{x.chain().focus().insertContent(`<p><a href="${S}" target="_blank" rel="noopener noreferrer">${S}</a></p>`).run()}catch{x.chain().focus().insertContent(S).run()}}}catch{}const k=await s.videoUploader(l);C&&y(C,k),n.value=!1,o.value=""}finally{i.value=!1;try{C&&URL.revokeObjectURL(C)}catch{}}};function y(r,a){const l=s.editor;if(!l)return;const{state:b}=l,{doc:C}=b;let B=null;if(C.descendants((L,x)=>{var u,k;return((u=L.type)==null?void 0:u.name)==="video"&&((k=L.attrs)==null?void 0:k.src)===r?(B=x,!1):!0}),B!=null){const L=C.nodeAt(B),x=b.schema.nodes.video;if(!L||!x)return;const u={...L.attrs||{},src:a,uploading:null},k=b.tr.setNodeMarkup(B,x,u,L.marks);l.view.dispatch(k)}}const g=e.ref(null);let h=null;return e.onMounted(()=>{h=r=>{if(!n.value)return;const a=g.value,l=r.target;a&&l&&!a.contains(l)&&(n.value=!1)},document.addEventListener("mousedown",h,!0)}),e.onBeforeUnmount(()=>{h&&(document.removeEventListener("mousedown",h,!0),h=null)}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:M,ref_key:"rootRef",ref:g},[e.createVNode(R,{name:"video",size:16}),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:a[1]||(a[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),onKeydown:E},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:c,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:f},null,544),e.createElementVNode("div",ko,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(d,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!s.videoUploader||i.value,disabled:!s.videoUploader||i.value,onClick:e.withModifiers(V,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,wo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-eef6665b"]]),yo={class:"field"},xo={class:"field"},vo={class:"actions"},bo=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(""),i=e.ref("");e.ref(!1);const c=e.ref(null);function M(){const r=s.editor;if(!n.value&&r)try{const a=r.state.selection,l=a.from;a.to>l?E():(o.value="链接",r.chain().focus().insertContent("链接").setTextSelection({from:l,to:l+2}).run())}catch{}n.value=!n.value,n.value&&d()}function d(){setTimeout(()=>{var a;const r=(a=c.value)==null?void 0:a.querySelector('input[name="link-text"]');r==null||r.focus(),r==null||r.select()},0)}function E(){const r=s.editor;if(r)try{const a=r.state.selection,l=a.from,b=a.to,B=b>l?r.state.doc.textBetween(l,b):"";o.value=B||"";const L=r.getAttributes("link")||{};i.value=typeof L.href=="string"?L.href:""}catch{}}function V(){const r=s.editor;if(!r)return;const a=o.value.trim(),l=i.value.trim();if(l)try{const b=r.state.selection,C=b.from,B=b.to;if(B>C){const x=f(a||r.state.doc.textBetween(C,B)),u=f(l);r.chain().focus().insertContent(`<a href="${u}" target="_blank" rel="noopener noreferrer">${x}</a>`,{from:C,to:B}).run()}else{const x=f(l),u=f(a||l);r.chain().focus().insertContent(`<a href="${x}" target="_blank" rel="noopener noreferrer">${u}</a>`).run()}}finally{n.value=!1,o.value="",i.value=""}}function f(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function y(r){r.key==="Enter"&&V(),r.key==="Escape"&&(n.value=!1)}let g=null;e.onMounted(()=>{g=r=>{if(!n.value)return;const a=c.value,l=r.target;a&&l&&!a.contains(l)&&(n.value=!1)},document.addEventListener("mousedown",g,!0)}),e.onBeforeUnmount(()=>{g&&(document.removeEventListener("mousedown",g,!0),g=null)});const h=e.ref({});return e.watch(n,async r=>{var l;if(!r)return;const a=s.editor;if(a){await e.nextTick();try{const b=a.state.selection,C=b.from,B=b.to;if(!(B>C)){h.value={};return}const x=a.view.coordsAtPos(C),u=a.view.coordsAtPos(B),k=(x.left+u.right)/2,S=Math.max(x.bottom,u.bottom)+8,A=(l=c.value)==null?void 0:l.querySelector(".link-input-panel"),H=A?A.getBoundingClientRect():{width:320,height:120},K=window.innerWidth,J=window.innerHeight,Z=12,te=Math.max(Z+H.width/2,Math.min(K-Z-H.width/2,k)),P=S,_=Math.min(x.top,u.top)-H.height-8;let w=P;P+H.height+Z>J&&_-Z>=0&&(w=_),w=Math.max(Z,Math.min(J-Z-H.height,w)),h.value={position:"fixed",left:Math.round(te)+"px",top:Math.round(w)+"px"}}catch{}}}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:M,ref_key:"rootRef",ref:c},[e.createVNode(R,{name:"link",size:16}),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(h.value),onClick:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",yo,[a[3]||(a[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),onKeydown:y},null,544),[[e.vModelText,o.value]])]),e.createElementVNode("div",xo,[a[4]||(a[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":a[1]||(a[1]=l=>i.value=l),placeholder:"链接地址",onKeydown:y},null,544),[[e.vModelText,i.value]])]),e.createElementVNode("div",vo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(V,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b5bf35e2"]]),Vo={class:"grid"},_o=["onMouseenter"],Eo={class:"size"},No=10,Mo=10,Bo=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(0),i=e.ref(0),c=e.computed(()=>{const V=Math.max(o.value,1),f=Math.max(i.value,1);return`${V} x ${f}`}),M=()=>{n.value=!n.value,n.value||(o.value=0,i.value=0)},d=(V,f)=>{o.value=V,i.value=f},E=()=>{var y,g,h,r,a,l,b,C;const V=Math.max(o.value,1),f=Math.max(i.value,1);(C=(l=(r=(g=(y=s.editor)==null?void 0:y.chain)==null?void 0:(h=g.call(y)).focus)==null?void 0:(a=r.call(h)).insertTable)==null?void 0:(b=l.call(a,{rows:V,cols:f,withHeaderRow:!0})).run)==null||C.call(b),n.value=!1,o.value=0,i.value=0};return(V,f)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:M},[e.createVNode(R,{name:"table",size:16}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:f[0]||(f[0]=e.withModifiers(()=>{},["stop"]))},[f[1]||(f[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Vo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(No,y=>e.createElementVNode("div",{key:"r-"+y,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Mo,g=>e.createElementVNode("span",{key:"c-"+y+"-"+g,class:e.normalizeClass(["cell",{active:y<=o.value&&g<=i.value}]),onMouseenter:h=>d(y,g),onClick:e.withModifiers(E,["stop"])},null,42,_o)),64))])),64))]),e.createElementVNode("div",Eo,e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ad6f66b7"]]),Lo=["aria-disabled"],zo={class:"tools-grid"},So=["disabled"],$o=["disabled"],To=["disabled"],Do=["disabled"],Fo=["disabled"],Ao=["disabled"],Uo=["disabled"],Ho=["disabled"],Io=["disabled"],Oo=["disabled"],jo=["disabled"],Ro=["disabled"],Wo=["disabled"],Po=["disabled"],Go=["disabled"],qo=["disabled"],Yo=["disabled"],Ko=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.ref(!1),o=()=>n.value=!n.value,i=(M,...d)=>{var V,f,y;const E=s.editor;return!!((y=(V=E==null?void 0:E.can)==null?void 0:(f=V.call(E))[M])!=null&&y.call(f,...d))},c=(M,...d)=>{var V,f,y,g,h,r,a;const E=s.editor;(a=(r=(h=(g=(y=(V=E==null?void 0:E.chain)==null?void 0:(f=V.call(E)).focus)==null?void 0:y.call(f))[M])==null?void 0:h.call(g,...d))==null?void 0:r.run)==null||a.call(r),n.value=!1};return(M,d)=>{var E,V;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:o,"aria-disabled":!((V=(E=s.editor)==null?void 0:E.isActive)!=null&&V.call(E,"table"))},[e.createVNode(R,{name:"tableTools",size:15}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:d[17]||(d[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",zo,[e.createElementVNode("button",{class:"btn",onClick:d[0]||(d[0]=e.withModifiers(f=>c("addColumnBefore"),["stop"])),disabled:!i("addColumnBefore")}," 前插列 ",8,So),e.createElementVNode("button",{class:"btn",onClick:d[1]||(d[1]=e.withModifiers(f=>c("addColumnAfter"),["stop"])),disabled:!i("addColumnAfter")}," 后插列 ",8,$o),e.createElementVNode("button",{class:"btn",onClick:d[2]||(d[2]=e.withModifiers(f=>c("deleteColumn"),["stop"])),disabled:!i("deleteColumn")}," 删除列 ",8,To),e.createElementVNode("button",{class:"btn",onClick:d[3]||(d[3]=e.withModifiers(f=>c("addRowBefore"),["stop"])),disabled:!i("addRowBefore")}," 前插行 ",8,Do),e.createElementVNode("button",{class:"btn",onClick:d[4]||(d[4]=e.withModifiers(f=>c("addRowAfter"),["stop"])),disabled:!i("addRowAfter")}," 后插行 ",8,Fo),e.createElementVNode("button",{class:"btn",onClick:d[5]||(d[5]=e.withModifiers(f=>c("deleteRow"),["stop"])),disabled:!i("deleteRow")}," 删除行 ",8,Ao),e.createElementVNode("button",{class:"btn",onClick:d[6]||(d[6]=e.withModifiers(f=>c("deleteTable"),["stop"])),disabled:!i("deleteTable")}," 删除表 ",8,Uo),e.createElementVNode("button",{class:"btn",onClick:d[7]||(d[7]=e.withModifiers(f=>c("mergeCells"),["stop"])),disabled:!i("mergeCells")}," 合并单元格 ",8,Ho),e.createElementVNode("button",{class:"btn",onClick:d[8]||(d[8]=e.withModifiers(f=>c("splitCell"),["stop"])),disabled:!i("splitCell")}," 拆分单元格 ",8,Io),e.createElementVNode("button",{class:"btn",onClick:d[9]||(d[9]=e.withModifiers(f=>c("mergeOrSplit"),["stop"])),disabled:!i("mergeOrSplit")}," 合并/拆分 ",8,Oo),e.createElementVNode("button",{class:"btn",onClick:d[10]||(d[10]=e.withModifiers(f=>c("toggleHeaderRow"),["stop"])),disabled:!i("toggleHeaderRow")}," 切换表头行 ",8,jo),e.createElementVNode("button",{class:"btn",onClick:d[11]||(d[11]=e.withModifiers(f=>c("toggleHeaderColumn"),["stop"])),disabled:!i("toggleHeaderColumn")}," 切换表头列 ",8,Ro),e.createElementVNode("button",{class:"btn",onClick:d[12]||(d[12]=e.withModifiers(f=>c("toggleHeaderCell"),["stop"])),disabled:!i("toggleHeaderCell")}," 切换表头单元 ",8,Wo),e.createElementVNode("button",{class:"btn",onClick:d[13]||(d[13]=e.withModifiers(f=>c("fixTables"),["stop"])),disabled:!i("fixTables")}," 修复表格 ",8,Po),e.createElementVNode("button",{class:"btn",onClick:d[14]||(d[14]=e.withModifiers(f=>c("goToNextCell"),["stop"])),disabled:!i("goToNextCell")}," 下个单元格 ",8,Go),e.createElementVNode("button",{class:"btn",onClick:d[15]||(d[15]=e.withModifiers(f=>c("goToPreviousCell"),["stop"])),disabled:!i("goToPreviousCell")}," 上个单元格 ",8,qo),e.createElementVNode("button",{class:"btn",onClick:d[16]||(d[16]=e.withModifiers(f=>c("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!i("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,Yo)])])):e.createCommentVNode("",!0)],8,Lo)}}}),[["__scopeId","data-v-89ddb4db"]]),Jo=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t;typeof navigator<"u"&&navigator.platform.includes("Mac");function n(){const o=s.editor;if(o){o.chain().focus().toggleTaskList().run();try{const{state:i}=o,c=i.selection;let M=null;i.doc.nodesBetween(Math.max(0,c.from-5),Math.min(i.doc.content.size,c.to+5),(d,E)=>{var V;return((V=d==null?void 0:d.type)==null?void 0:V.name)==="taskItem"&&M==null?(M=E,!1):!0}),M!=null&&o.commands.setTextSelection(M+1)}catch{}}}return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(R,{name:"task",size:17})]))}}),[["__scopeId","data-v-0b74c17c"]]),Zo=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t;function n(){const o=s.editor;o&&o.chain().focus().toggleBlockquote().run()}return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(R,{name:"quote",size:18})]))}}),[["__scopeId","data-v-bf6f40c3"]]),Xo=["aria-expanded"],Qo={class:"label"},en={key:0,class:"dropdown",role:"listbox"},tn=["aria-selected","onClick"],on={class:"shortcut"},Ce="md-toolbar-dropdown-open",Me="heading-select",nn=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=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]}],c=e.computed(()=>{var a,l;const r=s.editor;if(!r)return null;for(let b=1;b<=6;b++)if((a=r.isActive)!=null&&a.call(r,"heading",{level:b}))return b;return(l=r.isActive)!=null&&l.call(r,"paragraph"),null}),M=e.computed(()=>{const r=c.value;return r?`标题${r}`:"正文"}),d=e.ref(!1),E=e.ref(null);function V(){d.value||window.dispatchEvent(new CustomEvent(Ce,{detail:{id:Me}})),d.value=!d.value}function f(){d.value=!1}function y(r){var l,b,C,B,L,x,u,k,S,A;const a=(B=(b=(l=s.editor)==null?void 0:l.chain)==null?void 0:(C=b.call(l)).focus)==null?void 0:B.call(C);a&&(r.level===null?(u=(L=a.setParagraph)==null?void 0:(x=L.call(a)).run)==null||u.call(x):(A=(S=(k=a.toggleHeading)==null?void 0:k.call(a,{level:r.level}))==null?void 0:S.run)==null||A.call(S),f())}function g(r){const a=r.target,l=E.value;l&&!l.contains(a)&&f()}function h(r){var l;((l=r.detail)==null?void 0:l.id)!==Me&&(d.value=!1)}return e.onMounted(()=>{document.addEventListener("click",g),window.addEventListener(Ce,h)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",g),window.removeEventListener(Ce,h)}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:E},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(V,["stop"]),"aria-expanded":d.value},[e.createElementVNode("div",Qo,e.toDisplayString(M.value),1),e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3})],8,Xo),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",en,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,l=>e.createElementVNode("div",{key:l.label,class:"dropdown-item","aria-selected":l.level===c.value,onClick:e.withModifiers(b=>y(l),["stop"])},[l.level===c.value?(e.openBlock(),e.createBlock(e.unref(le),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:l.level===null,"level-1":l.level===1,"level-2":l.level===2,"level-3":l.level===3,"level-4":l.level===4,"level-5":l.level===5,"level-6":l.level===6}])},e.toDisplayString(l.label),3),e.createElementVNode("span",on,e.toDisplayString(l.shortcut),1)],8,tn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-3d649d22"]]),rn=["aria-expanded"],sn={key:0,class:"dropdown",role:"menu"},ln={class:"options"},ye="md-toolbar-dropdown-open",Be="align-select",an=G(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.computed(()=>{var h,r,a,l;const g=s.editor;return!g||(h=g.isActive)!=null&&h.call(g,{textAlign:"left"})?"left":(r=g.isActive)!=null&&r.call(g,{textAlign:"center"})?"center":(a=g.isActive)!=null&&a.call(g,{textAlign:"right"})?"right":(l=g.isActive)!=null&&l.call(g,{textAlign:"justify"})?"justify":"left"}),o=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[n.value]);function i(g){var h,r,a,l,b,C,B,L;(L=(C=(l=(r=(h=s.editor)==null?void 0:h.chain)==null?void 0:(a=r.call(h)).focus)==null?void 0:(b=l.call(a)).setTextAlign)==null?void 0:(B=C.call(b,g)).run)==null||L.call(B)}const c=e.ref(!1),M=e.ref(null);function d(){c.value||window.dispatchEvent(new CustomEvent(ye,{detail:{id:Be}})),c.value=!c.value}function E(){c.value=!1}function V(g){i(g),E()}function f(g){const h=M.value,r=g.target;h&&!h.contains(r)&&E()}function y(g){var r;((r=g.detail)==null?void 0:r.id)!==Be&&(c.value=!1)}return e.onMounted(()=>{document.addEventListener("click",f),window.addEventListener(ye,y)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",f),window.removeEventListener(ye,y)}),(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:M},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(d,["stop"]),"aria-expanded":c.value},[e.createVNode(R,{name:o.value,size:18},null,8,["name"]),e.createVNode(R,{name:"caretDown",size:12})],8,rn),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",sn,[e.createElementVNode("div",ln,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="left"}]),role:"menuitem",onClick:h[0]||(h[0]=e.withModifiers(r=>V("left"),["stop"]))},[e.createVNode(R,{name:"alignLeft",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="center"}]),role:"menuitem",onClick:h[1]||(h[1]=e.withModifiers(r=>V("center"),["stop"]))},[e.createVNode(R,{name:"alignCenter",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="right"}]),role:"menuitem",onClick:h[2]||(h[2]=e.withModifiers(r=>V("right"),["stop"]))},[e.createVNode(R,{name:"alignRight",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="justify"}]),role:"menuitem",onClick:h[3]||(h[3]=e.withModifiers(r=>V("justify"),["stop"]))},[e.createVNode(R,{name:"alignJustify",size:16})],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-4fc1bd06"]]),cn={class:"header_box"},dn=["aria-disabled"],pn=["aria-disabled"],fn=G(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{}},emits:["openLinkModal"],setup(t,{emit:s}){const n=t,o=(_,w)=>{var m,F;return(F=(m=n.editor)==null?void 0:m.isActive)==null?void 0:F.call(m,_,w)},i=(_,w)=>{var W,Q,Y,p,v,N;const m=n.editor;if(!m)return;const F=(Y=(W=m.chain)==null?void 0:(Q=W.call(m)).focus)==null?void 0:Y.call(Q);return(N=(v=(p=F==null?void 0:F[_])==null?void 0:p.call(F))==null?void 0:v.run)==null?void 0:N.call(v)},c=()=>{var _,w,m,F;try{return!!((F=(w=(_=n.editor)==null?void 0:_.can)==null?void 0:(m=w.call(_)).undo)!=null&&F.call(m))}catch{return!1}},M=()=>{var _,w,m,F;try{return!!((F=(w=(_=n.editor)==null?void 0:_.can)==null?void 0:(m=w.call(_)).redo)!=null&&F.call(m))}catch{return!1}},d=()=>{var _,w,m;c()&&((m=(w=(_=n.editor)==null?void 0:_.commands)==null?void 0:w.undo)==null||m.call(w))},E=()=>{var _,w,m;return(m=(w=(_=n.editor)==null?void 0:_.commands)==null?void 0:w.redo)==null?void 0:m.call(w)},V=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",f=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",y=typeof navigator<"u"&&navigator.platform.includes("Mac"),g=y?"⌘ B":"Ctrl B",h=y?"⌘ I":"Ctrl I",r=y?"⌘ U":"Ctrl U",a=y?"⇧ ⌘ X":"Ctrl Shift X",l=()=>{var w,m,F,W,Q,Y,p;const _=n.editor;_&&((p=(Y=(Q=(W=(F=(m=(w=_.chain())==null?void 0:w.focus())==null?void 0:m.unsetAllMarks)==null?void 0:F.call(m))==null?void 0:W.removeEmptyTextStyle)==null?void 0:Q.call(W))==null?void 0:Y.run)==null||p.call(Y))},b=e.ref(!1),C=e.ref(!1),B=e.ref({}),L=e.ref(null),x=()=>{var m,F,W,Q,Y,p;const _=n.editor;if(!_)return;const w=((m=_.getAttributes)==null?void 0:m.call(_,"textStyle"))||{};B.value={bold:!!((F=_.isActive)!=null&&F.call(_,"bold")),italic:!!((W=_.isActive)!=null&&W.call(_,"italic")),strike:!!((Q=_.isActive)!=null&&Q.call(_,"strike")),underline:!!((Y=_.isActive)!=null&&Y.call(_,"underline")),code:!!((p=_.isActive)!=null&&p.call(_,"code")),textStyle:{...w!=null&&w.color?{color:w.color}:{},...w!=null&&w.backgroundColor?{backgroundColor:w.backgroundColor}:{},...w!=null&&w.fontSize?{fontSize:w.fontSize}:{}}}},u=()=>{var Q,Y,p,v,N,$,z,T,D,U,O,I;const _=n.editor;if(!_)return;const w=B.value;let m=(p=(Q=_.chain)==null?void 0:(Y=Q.call(_)).focus)==null?void 0:p.call(Y);const F=w.textStyle||{},W=(v=_.state)==null?void 0:v.selection;W&&W.from===W.to||(m=((N=m==null?void 0:m.unsetAllMarks)==null?void 0:N.call(m))||m,Object.keys(F).length&&(m=(($=m==null?void 0:m.setMark)==null?void 0:$.call(m,"textStyle",F))||m),w.bold&&(m=((z=m==null?void 0:m.toggleBold)==null?void 0:z.call(m))||m),w.italic&&(m=((T=m==null?void 0:m.toggleItalic)==null?void 0:T.call(m))||m),w.strike&&(m=((D=m==null?void 0:m.toggleStrike)==null?void 0:D.call(m))||m),w.underline&&(m=((U=m==null?void 0:m.toggleUnderline)==null?void 0:U.call(m))||m),w.code&&(m=((O=m==null?void 0:m.toggleCode)==null?void 0:O.call(m))||m),(I=m==null?void 0:m.run)==null||I.call(m))},k=_=>{var F;const w=n.editor;if(!w)return;x(),b.value=!0,C.value=!!_;const m=(F=w.state)==null?void 0:F.selection;L.value=m?{from:m.from,to:m.to}:null},S=()=>{b.value=!1,C.value=!1},A=()=>{te()},H=_=>{!((_.metaKey||_.ctrlKey)&&_.shiftKey&&(_.key==="s"||_.key==="S"))||!n.editor||(_.preventDefault(),k(!1))};let K=!1;const J=()=>{var w;const _=n.editor;!_||K||(K=!0,(w=_.on)==null||w.call(_,"selectionUpdate",A),window.addEventListener("keydown",H),window.addEventListener("mouseup",P,!0))},Z=()=>{var w;const _=n.editor;_&&((w=_.off)==null||w.call(_,"selectionUpdate",A),window.removeEventListener("keydown",H),window.removeEventListener("mouseup",P,!0),K=!1)};e.onMounted(()=>{J()}),e.onBeforeUnmount(()=>{Z()}),e.watch(()=>n.editor,(_,w)=>{var m;w&&((m=w.off)==null||m.call(w,"selectionUpdate",A)),K=!1,J()});const te=()=>{try{b.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(b,te),e.onMounted(te),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const P=()=>{var F;if(!b.value)return;const _=n.editor;if(!_)return;const w=(F=_.state)==null?void 0:F.selection;if(!w||w.from===w.to)return;const m=L.value;m&&m.from===w.from&&m.to===w.to||(u(),L.value={from:w.from,to:w.to},C.value||S())};return(_,w)=>(e.openBlock(),e.createElementBlock("div",cn,[e.createElementVNode("div",{class:"icon","aria-disabled":!c(),onClick:d},[e.createVNode(e.unref(se),{text:"撤销",shortcut:e.unref(V),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ot),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,dn),e.createElementVNode("div",{class:"icon","aria-disabled":!M(),onClick:E},[e.createVNode(e.unref(se),{text:"重做",shortcut:e.unref(f),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(Qe),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,pn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:b.value}]),onClick:w[0]||(w[0]=m=>k(!1)),onDblclick:w[1]||(w[1]=m=>k(!0))},[e.createVNode(R,{name:"formatBrush",size:18})],34),e.createElementVNode("div",{class:"icon",onClick:l},[e.createVNode(R,{name:"clearFormat",size:18})]),e.createVNode(e.unref(nn),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(ht),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("bold")}]),onClick:w[2]||(w[2]=m=>i("toggleBold"))},[e.createVNode(e.unref(se),{text:"加粗",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(it),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("italic")}]),onClick:w[3]||(w[3]=m=>i("toggleItalic"))},[e.createVNode(e.unref(se),{text:"斜体",shortcut:e.unref(h),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(rt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("strike")}]),onClick:w[4]||(w[4]=m=>i("toggleStrike"))},[e.createVNode(e.unref(se),{text:"删除线",shortcut:e.unref(a),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(nt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("underline")}]),onClick:w[5]||(w[5]=m=>i("toggleUnderline"))},[e.createVNode(e.unref(se),{text:"下划线",shortcut:e.unref(r),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Bt),{editor:n.editor,currentColor:n.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(mo),{editor:n.editor,style:{"margin-left":"-6px"}},null,8,["editor"]),e.createVNode(e.unref(an),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("bulletList")}]),onClick:w[6]||(w[6]=m=>i("toggleBulletList"))},[e.createVNode(R,{name:"bulletList",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("orderedList")}]),onClick:w[7]||(w[7]=m=>i("toggleOrderedList"))},[e.createVNode(R,{name:"orderedList",size:16})],2),e.createVNode(e.unref(Jo),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("code")}]),onClick:w[8]||(w[8]=m=>i("toggleCode"))},[e.createVNode(R,{name:"code",size:18})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("codeBlock")}]),onClick:w[9]||(w[9]=m=>i("toggleCodeBlock"))},[e.createVNode(R,{name:"codeBlock",size:16})],2),e.createVNode(e.unref(Zo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(bo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(go),{editor:n.editor,imageUploader:n.imageUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(Co),{editor:n.editor,videoUploader:n.videoUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(Bo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Ko),{editor:n.editor},null,8,["editor"])]))}}),[["__scopeId","data-v-cab28555"]]),mn={class:"outline__header"},un={style:{cursor:"pointer","margin-top":"5px"}},hn={class:"outline__listWrap"},gn={class:"outline__list"},kn=["onClick"],wn=["onClick"],Cn=G(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:s}){const n=t,o=s;function i(l){h(l),o("select",l)}function c(){o("update:open",!1),o("update:pinned",!1)}function M(){n.pinned||c()}function d(l){const b=[],C=[];for(const B of l){const L={...B,children:[]};for(;C.length&&C[C.length-1].level>=L.level;)C.pop();C.length?C[C.length-1].children.push(L):b.push(L),C.push(L)}return b}const E=e.ref(new Set);function V(l){return E.value.has(l.pos)}function f(l){const b=E.value;b.has(l.pos)?b.delete(l.pos):b.add(l.pos),E.value=new Set(b)}const y=e.computed(()=>d(n.items||[])),g=e.computed(()=>{const l=[],b=C=>{for(const B of C)l.push({node:B,level:B.level,hasChildren:B.children.length>0}),E.value.has(B.pos)||b(B.children)};return b(y.value),l});function h(l){const b=e.unref(n.editor);if(!b)return;const{doc:C}=b.state,B=C.nodeAt(l.pos),L=Math.max(1,C.content.size-1);let x=l.pos+1;B&&B.type.name==="heading"&&(x=l.pos+B.nodeSize-1),x=Math.min(Math.max(1,x),L),b.chain().focus().setTextSelection(x).run();const u=e.unref(n.container)??null,k=b.view.coordsAtPos(x),S=n.offset??8,A=n.duration??700;if(u){const H=u.getBoundingClientRect(),K=u.scrollTop+k.top-H.top-S;r(u,K,A)}else{const H=(window.scrollY||window.pageYOffset)+k.top-S;a(H,A)}}function r(l,b,C=600){const B=l.scrollTop,L=b-B,x=performance.now(),u=S=>S<.5?4*S*S*S:1-Math.pow(-2*S+2,3)/2;function k(S){const A=S-x,H=Math.min(1,A/C);l.scrollTop=B+L*u(H),H<1&&requestAnimationFrame(k)}requestAnimationFrame(k)}function a(l,b=600){const C=window.scrollY||window.pageYOffset,B=l-C,L=performance.now(),x=k=>k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2;function u(k){const S=k-L,A=Math.min(1,S/b),H=C+B*x(A);window.scrollTo(0,H),A<1&&requestAnimationFrame(u)}requestAnimationFrame(u)}return(l,b)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:b[1]||(b[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:M},[e.createElementVNode("div",mn,[b[2]||(b[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),e.createElementVNode("div",un,[n.open&&!n.pinned?(e.openBlock(),e.createBlock(e.unref(tt),{key:0,onClick:b[0]||(b[0]=C=>l.$emit("update:pinned",!0)),theme:"outline",size:16,strokeWidth:3})):e.createCommentVNode("",!0),n.pinned?(e.openBlock(),e.createBlock(e.unref(et),{key:1,onClick:c,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",hn,[e.createElementVNode("ul",gn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(C,B)=>(e.openBlock(),e.createElementBlock("li",{key:C.node.pos+"-"+B,class:e.normalizeClass(["outline__item","lv-"+C.level])},[C.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:V(C.node),expanded:!V(C.node)}]),onClick:e.withModifiers(L=>f(C.node),["stop"]),title:"展开/收起"},[...b[3]||(b[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,kn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:L=>i(C.node)},e.toDisplayString(C.node.text||"(无标题)"),9,wn)],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:c})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-b5f802fc"]]),yn=["onClick"],Le=G(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:s,emit:n}){const o=t,i=n,c=e.ref(null);let M=!1;const d=e.ref(!1),E=e.ref(""),V=e.ref([]),f=e.ref("#000000"),y=e.ref(!0),g=e.ref(!0),h=e.ref(null),r=e.ref(void 0),a=e.ref([]),l=e.ref(null),b=()=>{const p=h.value;r.value=p?p.clientHeight:void 0};let C=null;e.onMounted(()=>{b(),C=()=>b(),window.addEventListener("resize",C),e.nextTick(()=>{const p=h.value;p&&p.addEventListener("scroll",W,{passive:!0})})}),e.onBeforeUnmount(()=>{C&&(window.removeEventListener("resize",C),C=null);const p=h.value;p&&p.removeEventListener("scroll",W)}),e.watch([()=>o.height,y],async()=>{await e.nextTick(),b(),W()});const B=e.computed(()=>{const v=(N=>N==null?void 0:typeof N=="number"?`${N}px`:N)(o.height);return{height:v,"--editor-height":v,"--editor-caret-color":o.caretColor||"#000"}}),L=ue.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:p=>p.style.fontSize||null,renderHTML:p=>p.fontSize?{style:`font-size: ${p.fontSize}`}:{}}}},addCommands(){return{setFontSize:p=>({chain:v})=>v().setMark("textStyle",{fontSize:p}).run(),unsetFontSize:()=>({chain:p})=>p().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),x=ue.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:p=>p.style.backgroundColor||null,renderHTML:p=>p.backgroundColor?{style:`background-color: ${p.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:p=>({chain:v})=>v().setMark("textStyle",{backgroundColor:p}).run(),unsetBackgroundColor:()=>({chain:p})=>p().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{c.value=new ve.Editor({extensions:[Te.StarterKit.configure({dropcursor:!1}),je.Dropcursor.configure({color:"#22c55e",width:2}),Ve.TaskList,qe,We.configure({inline:!0,allowBase64:!0}),Ge.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),De.Markdown,be.TableKit.configure({table:{resizable:!0},tableCell:!1}),Pe,ue.TextStyle,L,x,Ie.Color,Oe.Underline,Ue.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),He.TextAlign.configure({types:["heading","paragraph"]}),Ae.Placeholder.configure({placeholder:o.placeholder??"输入 / 以插入块"})],content:o.markdown!=null?String(o.markdown||""):String(o.modelValue||""),contentType:o.markdown!=null?"markdown":/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(o.modelValue||""))?"html":"markdown",editable:!0,autofocus:!0,editorProps:{handlePaste(p,v){var ne,ae,Se;const N=v.clipboardData;if(!N)return!1;const $=N.files&&N.files.length?Array.from(N.files):[],z=$.find(q=>{var X;return(X=q.type)==null?void 0:X.startsWith("image/")});if(z){if(v.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return A(z),!0}const T=$.find(q=>{var X;return(X=q.type)==null?void 0:X.startsWith("video/")});if(T)return v.preventDefault(),_(T),!0;const U=(N.items?Array.from(N.items):[]).find(q=>q.kind==="file"),O=U?U.getAsFile():null;if(O&&O.type.startsWith("image/")){if(v.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return A(O),!0}if(O&&O.type.startsWith("video/"))return v.preventDefault(),_(O),!0;const I=N.getData("text/html");if(I){const q=I.match(/<img[^>]+src=["']([^"']+)["']/i),X=I.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(q&&X&&X[1]){v.preventDefault();const de=X[1];if(o.imageUploader&&/^data:image\//i.test(de)){const fe=J(de,"clipboard.png");A(fe)}else{if(/^data:image\//i.test(de)){const fe=J(de,"clipboard.png"),xe=(ne=o.uploadSizeLimit)==null?void 0:ne.image;if(xe){const vn=Math.max(1,xe)*1024*1024;if(fe.size>vn){try{window.alert(`图片文件大小超限(${(fe.size/1024/1024).toFixed(2)}MB > ${xe}MB)`)}catch{}return!0}}}u(de)}return!0}const re=I.match(/<video[^>]+src=["']([^"']+)["']/i),ie=I.match(/<source[^>]+src=["']([^"']+)["']/i),ce=I.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),$e=re&&re[1]||ie&&ie[1];if($e&&ce)return v.preventDefault(),S($e),!0}const ee=N.getData("text/plain");if(ee){const q=ee.trim(),X=P(q);if(Z(q)&&q===ee.trim()){if(v.preventDefault(),/^data:image\//i.test(q)){const re=J(q,"clipboard.png"),ie=(ae=o.uploadSizeLimit)==null?void 0:ae.image;if(ie){const ce=Math.max(1,ie)*1024*1024;if(re.size>ce){try{window.alert(`图片文件大小超限(${(re.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return u(q),!0}if(X){if(v.preventDefault(),/^data:image\//i.test(X)){const re=J(X,"clipboard.png"),ie=(Se=o.uploadSizeLimit)==null?void 0:Se.image;if(ie){const ce=Math.max(1,ie)*1024*1024;if(re.size>ce){try{window.alert(`图片文件大小超限(${(re.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return u(X),!0}if(te(q)&&q===ee.trim())return v.preventDefault(),S(q),!0}return!1},handleDrop(p,v){const N=v.dataTransfer;if(!N)return!1;const z=(N.files?Array.from(N.files):[]).find(T=>{var D;return(D=T.type)==null?void 0:D.startsWith("image/")});if(z){if(v.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return A(z),!0}return!1},handleClick(p,v,N){const $=N,z=$.target,T=z?z.closest("a[href]"):null;if(T&&($.ctrlKey||$.metaKey)){const D=T.getAttribute("href")||"";if(D){$.preventDefault();try{window.open(D,"_blank","noopener,noreferrer")}catch(U){console.warn("打开链接失败:",U)}return!0}}return!1}},onSelectionUpdate:p=>{var $;const N=(($=p.editor.getAttributes("textStyle"))==null?void 0:$.color)||"#000000";f.value=typeof N=="string"?N:"#000000"},onUpdate:()=>{const p=c.value;M=!0,i("update:modelValue",p.getHTML()),i("update:markdown",p.getMarkdown()),F()},onTransaction:()=>{F()}}),e.nextTick(()=>{var p;F();try{(p=c.value)==null||p.chain().focus().run()}catch{}})}),e.onBeforeUnmount(()=>{var p;(p=c.value)==null||p.destroy()}),e.watch(()=>o.modelValue,p=>{if(M){M=!1;return}p!=null&&c.value&&e.nextTick(()=>{try{const v=/<\s*(video|iframe)\b|data-youtube-video/i.test(p),N=p.match(/\[video\]\(([^)]+)\)/i);if(!v&&N){const $=N[1],z=p.replace(/\[video\]\(([^)]+)\)/gi,(T,D)=>`<video data-tiptap-video src="${D}" controls></video>`);c.value.commands.setContent(z,{contentType:"html"})}else c.value.commands.setContent(p,{contentType:v?"html":"markdown"})}catch(v){console.warn("setContent 失败,内容更新被忽略:",v)}})}),e.watch(()=>o.markdown,p=>{if(M){M=!1;return}p!=null&&c.value&&e.nextTick(()=>{try{c.value.commands.setContent(p,{contentType:"markdown"})}catch(v){console.warn("setContent 失败,内容更新被忽略:",v)}})});function u(p){var v;(v=c.value)==null||v.chain().focus().setImage({src:p}).run()}function k(p){return String(p).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function S(p){const v=c.value;if(!v)return;if(typeof v.commands.setVideo=="function"){v.chain().focus().setVideo({src:p,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const $=k(p);try{v.chain().focus().insertContent(`<p><a href="${$}" target="_blank" rel="noopener noreferrer">${$}</a></p>`).run()}catch{v.chain().focus().insertContent($).run()}}async function A(p){var N,$;const v=(N=o.uploadSizeLimit)==null?void 0:N.image;if(v){const z=Math.max(1,v)*1024*1024;if(p.size>z){try{window.alert(`图片文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${v}MB)`)}catch{}return}}if(o.imageUploader){const z=URL.createObjectURL(p);($=c.value)==null||$.chain().focus().setImage({src:z,uploading:!0}).run();try{const T=await o.imageUploader(p);if(typeof T=="string"&&T){H(z,T);return}K(p,D=>H(z,D))}catch(T){console.warn("图片上传失败,回退为 base64",T),K(p,D=>H(z,D))}finally{try{URL.revokeObjectURL(z)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function H(p,v){var D,U;const N=c.value;if(!N)return;const{state:$}=N,{doc:z}=$;let T=null;if(z.descendants((O,I)=>{var ee,ne;return((ee=O.type)==null?void 0:ee.name)==="image"&&((ne=O.attrs)==null?void 0:ne.src)===p?(T=I,!1):!0}),T!=null){const O=z.nodeAt(T),I=$.schema.nodes.image;if(!O||!I)return;const ee={...O.attrs||{},src:v,uploading:null},ne=$.tr.setNodeMarkup(T,I,ee,O.marks);N.view.dispatch(ne);try{(U=(D=N.options)==null?void 0:D.onUpdate)==null||U.call(D,{editor:N})}catch{}}else u(v)}function K(p,v){const N=new FileReader;N.onload=()=>v(String(N.result||"")),N.readAsDataURL(p)}function J(p,v="image.png"){var U;const N=p.split(","),$=((U=N[0].match(/:(.*?);/))==null?void 0:U[1])||"image/png",z=atob(N[1]);let T=z.length;const D=new Uint8Array(T);for(;T--;)D[T]=z.charCodeAt(T);return new File([D],v,{type:$})}function Z(p){return/^data:image\//i.test(p)||/^https?:\/\//i.test(p)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(p)}function te(p){return/^https?:\/\//i.test(p)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(p)}function P(p){const v=p.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!v)return null;const N=v[1].trim().replace(/^<|>$/g,"");return Z(N)?N:null}async function _(p){var $;const v=($=o.uploadSizeLimit)==null?void 0:$.video;if(v){const z=Math.max(1,v)*1024*1024;if(p.size>z){try{window.alert(`视频文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${v}MB)`)}catch{}return}}if(o.videoUploader){const z=URL.createObjectURL(p),T=c.value,D=T==null?void 0:T.commands;try{typeof(D==null?void 0:D.setVideo)=="function"?T==null||T.chain().focus().setVideo({src:z,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():S(z)}catch{S(z)}try{const U=await o.videoUploader(p);w(z,U)}catch(U){console.warn("视频上传失败,保留本地对象 URL 作为预览",U)}finally{try{URL.revokeObjectURL(z)}catch{}}return}const N=URL.createObjectURL(p);S(N)}function w(p,v){const N=c.value;if(!N)return;const{state:$}=N,{doc:z}=$;let T=null;if(z.descendants((D,U)=>{var O,I;return((O=D.type)==null?void 0:O.name)==="video"&&((I=D.attrs)==null?void 0:I.src)===p?(T=U,!1):!0}),T!=null){const D=z.nodeAt(T),U=$.schema.nodes.video;if(!D||!U)return;const O={...D.attrs||{},src:v,uploading:null},I=$.tr.setNodeMarkup(T,U,O,D.marks);N.view.dispatch(I)}}function m(){var p,v;E.value=((v=(p=c.value)==null?void 0:p.getAttributes("link"))==null?void 0:v.href)||"",d.value=!0}function F(){const p=c.value;if(!p)return;const v=[];p.state.doc.descendants((N,$)=>{if(N.type.name==="heading"){const z=N.attrs.level||1,T=N.textContent||"";v.push({text:T,level:z,pos:$})}}),V.value=v,W()}function W(){const p=c.value,v=h.value,N=V.value;if(!p||!v||!N.length){a.value=[],l.value=null;return}const $=v.getBoundingClientRect(),z=v.scrollHeight||v.clientHeight,T=v.clientHeight||1,D=N.map(I=>{const ne=p.view.coordsAtPos(Math.min(I.pos+1,p.state.doc.content.size)).top-$.top+v.scrollTop,ae=z?Math.max(0,Math.min(1,ne/z)):0;return Math.round(ae*T)});a.value=D;const U=v.scrollTop+8;let O=null;for(let I=0;I<N.length;I++){const ee=N[I];if(p.view.coordsAtPos(Math.min(ee.pos+1,p.state.doc.content.size)).top-$.top+v.scrollTop<=U)O=ee.pos;else break}l.value=O}function Q(p){const v=p.target;v.closest(".outline")||v.closest(".outline-toggle")||c.value&&c.value.chain().focus().run()}function Y(){const p=c.value;return p?p.getMarkdown():""}return s({getMarkdown:Y}),(p,v)=>(e.openBlock(),e.createElementBlock("div",{class:"simple-editor",style:e.normalizeStyle(B.value)},[e.createVNode(e.unref(fn),{editor:c.value,currentColor:f.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":o.uploadSizeLimit,onOpenLinkModal:m},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:y.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:h,class:"editor_wrapper",onClick:Q},[e.createVNode(e.unref(ve.EditorContent),{editor:c.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Cn),{open:y.value,"onUpdate:open":v[0]||(v[0]=N=>y.value=N),items:V.value,editor:c.value,container:h.value,maxHeight:r.value,pinned:g.value,"onUpdate:pinned":v[1]||(v[1]=N=>g.value=N)},null,8,["open","items","editor","container","maxHeight","pinned"]),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:v[2]||(v[2]=N=>(y.value=!0,g.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(N,$)=>{var z;return e.openBlock(),e.createElementBlock("span",{key:$,class:e.normalizeClass(["outline-marker",{active:((z=V.value[$])==null?void 0:z.pos)===l.value}]),style:e.normalizeStyle({top:(N||0)+"px"}),onClick:e.withModifiers(T=>{var D,U;return(U=c.value)==null?void 0:U.chain().focus().setTextSelection((((D=V.value[$])==null?void 0:D.pos)||1)+1).run()},["stop"])},null,14,yn)}),128))],32))],2)],4))}}),[["__scopeId","data-v-744df7d2"]]),xn={install(t){t.component("Editor",Le)}};j.Editor=Le,j.default=xn,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
8
+ )`,border:"1px dashed #ccc"},onClick:e.withModifiers(y,["stop"])})])]),e.createElementVNode("div",ro,[g[5]||(g[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),h=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"swatch",style:e.normalizeStyle({background:h}),onClick:e.withModifiers($=>C(h),["stop"])},[h===_.value?(e.openBlock(),e.createElementBlock("span",lo,"✓")):e.createCommentVNode("",!0)],12,so))),128))])]),e.createElementVNode("div",ao,[g[6]||(g[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),h=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"swatch",style:e.normalizeStyle({background:h}),onClick:e.withModifiers($=>C(h),["stop"])},[h===_.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,fo))),128))])]),l.value.length?(e.openBlock(),e.createElementBlock("div",po,[g[7]||(g[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"swatch",style:e.normalizeStyle({background:h}),onClick:e.withModifiers($=>C(h),["stop"])},null,12,uo))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",ho,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(b,["stop"])},"更多颜色")]),s.value?(e.openBlock(),e.createElementBlock("div",go,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":g[1]||(g[1]=h=>M.value=h)},null,512),[[e.vModelText,M.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":g[2]||(g[2]=h=>M.value=h)},null,512),[[e.vModelText,M.value]]),e.createElementVNode("button",{class:"btn apply",onClick:g[3]||(g[3]=e.withModifiers(h=>C(M.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-620c7aa3"]]),wo={class:"image-actions"},Co=["aria-disabled","disabled"],xo=P(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const i=t,r=e.ref(!1),n=e.ref(""),s=e.ref(!1),c=e.ref(null),M=()=>{r.value=!r.value},l=()=>{var a,p,d,k,u,v;const y=n.value.trim();y&&((v=(u=((k=(p=(a=i.editor)==null?void 0:a.chain)==null?void 0:(d=p.call(a)).focus)==null?void 0:k.call(d)).setImage({src:y})).run)==null||v.call(u),r.value=!1,n.value="")},_=y=>{y.key==="Enter"&&l(),y.key==="Escape"&&(r.value=!1,n.value="")},E=()=>{var y;i.imageUploader&&((y=c.value)==null||y.click())},f=async y=>{var k,u,v,S,w,g,h,$;const a=y.target,p=(k=a.files)==null?void 0:k[0];if(a.value="",!p||!i.imageUploader)return;const d=(u=i.uploadSizeLimit)==null?void 0:u.image;if(typeof d=="number"&&d>0){const H=Math.max(1,d)*1024*1024;if(p.size>H){try{window.alert(`图片文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${d}MB)`)}catch{}return}}try{s.value=!0;let H=null;H=URL.createObjectURL(p),($=(h=((g=(S=(v=i.editor)==null?void 0:v.chain)==null?void 0:(w=S.call(v)).focus)==null?void 0:g.call(w)).setImage({src:H,uploading:!0})).run)==null||$.call(h);const A=await i.imageUploader(p);if(typeof A=="string"&&A){const Z=i.editor,{state:ee}=Z,{doc:G}=ee;let X=null;if(G.descendants((W,te)=>{var Y,oe;return((Y=W==null?void 0:W.type)==null?void 0:Y.name)==="image"&&((oe=W==null?void 0:W.attrs)==null?void 0:oe.src)===H?(X=te,!1):!0}),X!=null){const W=G.nodeAt(X),te=ee.schema.nodes.image;if(W&&te){const Y={...W.attrs||{},src:A,uploading:null},oe=ee.tr.setNodeMarkup(X,te,Y,W.marks);Z.view.dispatch(oe)}}r.value=!1,n.value=""}}finally{s.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},b=e.ref(null);let C=null;return e.onMounted(()=>{C=y=>{if(!r.value)return;const a=b.value,p=y.target;a&&p&&!a.contains(p)&&(r.value=!1)},document.addEventListener("mousedown",C,!0)}),e.onBeforeUnmount(()=>{C&&(document.removeEventListener("mousedown",C,!0),C=null)}),(y,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:M,ref_key:"rootRef",ref:b},[e.createVNode(e.unref(D),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"img",size:18})]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":a[0]||(a[0]=p=>n.value=p),onKeydown:_},null,544),[[e.vModelText,n.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:f},null,544),e.createElementVNode("div",wo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(l,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!i.imageUploader||s.value,disabled:!i.imageUploader||s.value,onClick:e.withModifiers(E,["stop"])},e.toDisplayString(s.value?"上传中…":"上传文件"),9,Co)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-e1c5f3df"]]),yo={class:"video-actions"},bo=["aria-disabled","disabled"],Vo=P(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const i=t,r=e.ref(!1),n=e.ref(""),s=e.ref(!1),c=e.ref(null),M=()=>{r.value=!r.value},l=()=>{const a=n.value.trim();if(!a)return;const p=i.editor,d=p==null?void 0:p.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(a)){const u=String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");try{p.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{p.chain().focus().insertContent(u).run()}}else if(typeof(d==null?void 0:d.setVideo)=="function")p.chain().focus().setVideo({src:a,HTMLAttributes:{controls:!0,width:640}}).run();else{const u=String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");try{p.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{p.chain().focus().insertContent(u).run()}}r.value=!1,n.value=""},_=a=>{a.key==="Enter"&&l(),a.key==="Escape"&&(r.value=!1,n.value="")},E=()=>{var a;i.videoUploader&&((a=c.value)==null||a.click())},f=async a=>{var v,S;const p=a.target,d=(v=p.files)==null?void 0:v[0];if(p.value="",!d||!i.videoUploader)return;const k=(S=i.uploadSizeLimit)==null?void 0:S.video;if(typeof k=="number"&&k>0){const w=Math.max(1,k)*1024*1024;if(d.size>w){try{window.alert(`视频文件大小超限(${(d.size/1024/1024).toFixed(2)}MB > ${k}MB)`)}catch{}return}}let u=null;try{s.value=!0;const w=i.editor,g=w==null?void 0:w.commands;u=URL.createObjectURL(d);try{if(typeof(g==null?void 0:g.setVideo)=="function")w.chain().focus().setVideo({src:u,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const $=String(u).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");try{w.chain().focus().insertContent(`<p><a href="${$}" target="_blank" rel="noopener noreferrer">${$}</a></p>`).run()}catch{w.chain().focus().insertContent($).run()}}}catch{}const h=await i.videoUploader(d);u&&b(u,h),r.value=!1,n.value=""}finally{s.value=!1;try{u&&URL.revokeObjectURL(u)}catch{}}};function b(a,p){const d=i.editor;if(!d)return;const{state:k}=d,{doc:u}=k;let v=null;if(u.descendants((S,w)=>{var g,h;return((g=S.type)==null?void 0:g.name)==="video"&&((h=S.attrs)==null?void 0:h.src)===a?(v=w,!1):!0}),v!=null){const S=u.nodeAt(v),w=k.schema.nodes.video;if(!S||!w)return;const g={...S.attrs||{},src:p,uploading:null},h=k.tr.setNodeMarkup(v,w,g,S.marks);d.view.dispatch(h)}}const C=e.ref(null);let y=null;return e.onMounted(()=>{y=a=>{if(!r.value)return;const p=C.value,d=a.target;p&&d&&!p.contains(d)&&(r.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)}),(a,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:M,ref_key:"rootRef",ref:C},[e.createVNode(e.unref(D),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"video",size:16})]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":p[0]||(p[0]=d=>n.value=d),onKeydown:_},null,544),[[e.vModelText,n.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:c,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:f},null,544),e.createElementVNode("div",yo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(l,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!i.videoUploader||s.value,disabled:!i.videoUploader||s.value,onClick:e.withModifiers(E,["stop"])},e.toDisplayString(s.value?"上传中…":"上传文件"),9,bo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-35a7027c"]]),_o={class:"field"},No={class:"field"},Eo={class:"actions"},vo=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t,r=e.ref(!1),n=e.ref(""),s=e.ref("");e.ref(!1);const c=e.ref(null);function M(){const a=i.editor;if(!r.value&&a)try{const p=a.state.selection,d=p.from;p.to>d?_():(n.value="链接",a.chain().focus().insertContent("链接").setTextSelection({from:d,to:d+2}).run())}catch{}r.value=!r.value,r.value&&l()}function l(){setTimeout(()=>{var p;const a=(p=c.value)==null?void 0:p.querySelector('input[name="link-text"]');a==null||a.focus(),a==null||a.select()},0)}function _(){const a=i.editor;if(a)try{const p=a.state.selection,d=p.from,k=p.to,v=k>d?a.state.doc.textBetween(d,k):"";n.value=v||"";const S=a.getAttributes("link")||{};s.value=typeof S.href=="string"?S.href:""}catch{}}function E(){const a=i.editor;if(!a)return;const p=n.value.trim(),d=s.value.trim();if(d)try{const k=a.state.selection,u=k.from,v=k.to;if(v>u){const w=f(p||a.state.doc.textBetween(u,v)),g=f(d);a.chain().focus().insertContent(`<a href="${g}" target="_blank" rel="noopener noreferrer">${w}</a>`,{from:u,to:v}).run()}else{const w=f(d),g=f(p||d);a.chain().focus().insertContent(`<a href="${w}" target="_blank" rel="noopener noreferrer">${g}</a>`).run()}}finally{r.value=!1,n.value="",s.value=""}}function f(a){return String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function b(a){a.key==="Enter"&&E(),a.key==="Escape"&&(r.value=!1)}let C=null;e.onMounted(()=>{C=a=>{if(!r.value)return;const p=c.value,d=a.target;p&&d&&!p.contains(d)&&(r.value=!1)},document.addEventListener("mousedown",C,!0)}),e.onBeforeUnmount(()=>{C&&(document.removeEventListener("mousedown",C,!0),C=null)});const y=e.ref({});return e.watch(r,async a=>{var d;if(!a)return;const p=i.editor;if(p){await e.nextTick();try{const k=p.state.selection,u=k.from,v=k.to;if(!(v>u)){y.value={};return}const w=p.view.coordsAtPos(u),g=p.view.coordsAtPos(v),h=(w.left+g.right)/2,$=Math.max(w.bottom,g.bottom)+8,H=(d=c.value)==null?void 0:d.querySelector(".link-input-panel"),A=H?H.getBoundingClientRect():{width:320,height:120},Z=window.innerWidth,ee=window.innerHeight,G=12,X=Math.max(G+A.width/2,Math.min(Z-G-A.width/2,h)),W=$,te=Math.min(w.top,g.top)-A.height-8;let Y=W;W+A.height+G>ee&&te-G>=0&&(Y=te),Y=Math.max(G,Math.min(ee-G-A.height,Y)),y.value={position:"fixed",left:Math.round(X)+"px",top:Math.round(Y)+"px"}}catch{}}}),(a,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:M,ref_key:"rootRef",ref:c},[e.createVNode(e.unref(D),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"link",size:16})]),_: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(y.value),onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_o,[p[3]||(p[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":p[0]||(p[0]=d=>n.value=d),onKeydown:b},null,544),[[e.vModelText,n.value]])]),e.createElementVNode("div",No,[p[4]||(p[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":p[1]||(p[1]=d=>s.value=d),placeholder:"链接地址",onKeydown:b},null,544),[[e.vModelText,s.value]])]),e.createElementVNode("div",Eo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(E,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-47847dc2"]]),Mo={class:"grid"},Bo=["onMouseenter"],Lo={class:"size"},zo=10,So=10,$o=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t,r=e.ref(!1),n=e.ref(0),s=e.ref(0),c=e.computed(()=>{const E=Math.max(n.value,1),f=Math.max(s.value,1);return`${E} x ${f}`}),M=()=>{r.value=!r.value,r.value||(n.value=0,s.value=0)},l=(E,f)=>{n.value=E,s.value=f},_=()=>{var b,C,y,a,p,d,k,u;const E=Math.max(n.value,1),f=Math.max(s.value,1);(u=(d=(a=(C=(b=i.editor)==null?void 0:b.chain)==null?void 0:(y=C.call(b)).focus)==null?void 0:(p=a.call(y)).insertTable)==null?void 0:(k=d.call(p,{rows:E,cols:f,withHeaderRow:!0})).run)==null||u.call(k),r.value=!1,n.value=0,s.value=0};return(E,f)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:M},[e.createVNode(e.unref(D),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"table",size:16})]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:f[0]||(f[0]=e.withModifiers(()=>{},["stop"]))},[f[1]||(f[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Mo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(zo,b=>e.createElementVNode("div",{key:"r-"+b,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(So,C=>e.createElementVNode("span",{key:"c-"+b+"-"+C,class:e.normalizeClass(["cell",{active:b<=n.value&&C<=s.value}]),onMouseenter:y=>l(b,C),onClick:e.withModifiers(_,["stop"])},null,42,Bo)),64))])),64))]),e.createElementVNode("div",Lo,e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8a3a35f7"]]),To=["aria-disabled"],Do={class:"tools-grid"},Fo=["disabled"],Ao=["disabled"],Ho=["disabled"],Uo=["disabled"],jo=["disabled"],Io=["disabled"],Oo=["disabled"],Wo=["disabled"],Ro=["disabled"],Po=["disabled"],Go=["disabled"],qo=["disabled"],Yo=["disabled"],Ko=["disabled"],Jo=["disabled"],Zo=["disabled"],Xo=["disabled"],Qo=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t,r=e.ref(!1),n=()=>r.value=!r.value,s=(M,...l)=>{var E,f,b;const _=i.editor;return!!((b=(E=_==null?void 0:_.can)==null?void 0:(f=E.call(_))[M])!=null&&b.call(f,...l))},c=(M,...l)=>{var E,f,b,C,y,a,p;const _=i.editor;(p=(a=(y=(C=(b=(E=_==null?void 0:_.chain)==null?void 0:(f=E.call(_)).focus)==null?void 0:b.call(f))[M])==null?void 0:y.call(C,...l))==null?void 0:a.run)==null||p.call(a),r.value=!1};return(M,l)=>{var _,E;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:n,"aria-disabled":!((E=(_=i.editor)==null?void 0:_.isActive)!=null&&E.call(_,"table"))},[e.createVNode(e.unref(D),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"tableTools",size:15})]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:l[17]||(l[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Do,[e.createElementVNode("button",{class:"btn",onClick:l[0]||(l[0]=e.withModifiers(f=>c("addColumnBefore"),["stop"])),disabled:!s("addColumnBefore")}," 前插列 ",8,Fo),e.createElementVNode("button",{class:"btn",onClick:l[1]||(l[1]=e.withModifiers(f=>c("addColumnAfter"),["stop"])),disabled:!s("addColumnAfter")}," 后插列 ",8,Ao),e.createElementVNode("button",{class:"btn",onClick:l[2]||(l[2]=e.withModifiers(f=>c("deleteColumn"),["stop"])),disabled:!s("deleteColumn")}," 删除列 ",8,Ho),e.createElementVNode("button",{class:"btn",onClick:l[3]||(l[3]=e.withModifiers(f=>c("addRowBefore"),["stop"])),disabled:!s("addRowBefore")}," 前插行 ",8,Uo),e.createElementVNode("button",{class:"btn",onClick:l[4]||(l[4]=e.withModifiers(f=>c("addRowAfter"),["stop"])),disabled:!s("addRowAfter")}," 后插行 ",8,jo),e.createElementVNode("button",{class:"btn",onClick:l[5]||(l[5]=e.withModifiers(f=>c("deleteRow"),["stop"])),disabled:!s("deleteRow")}," 删除行 ",8,Io),e.createElementVNode("button",{class:"btn",onClick:l[6]||(l[6]=e.withModifiers(f=>c("deleteTable"),["stop"])),disabled:!s("deleteTable")}," 删除表 ",8,Oo),e.createElementVNode("button",{class:"btn",onClick:l[7]||(l[7]=e.withModifiers(f=>c("mergeCells"),["stop"])),disabled:!s("mergeCells")}," 合并单元格 ",8,Wo),e.createElementVNode("button",{class:"btn",onClick:l[8]||(l[8]=e.withModifiers(f=>c("splitCell"),["stop"])),disabled:!s("splitCell")}," 拆分单元格 ",8,Ro),e.createElementVNode("button",{class:"btn",onClick:l[9]||(l[9]=e.withModifiers(f=>c("mergeOrSplit"),["stop"])),disabled:!s("mergeOrSplit")}," 合并/拆分 ",8,Po),e.createElementVNode("button",{class:"btn",onClick:l[10]||(l[10]=e.withModifiers(f=>c("toggleHeaderRow"),["stop"])),disabled:!s("toggleHeaderRow")}," 切换表头行 ",8,Go),e.createElementVNode("button",{class:"btn",onClick:l[11]||(l[11]=e.withModifiers(f=>c("toggleHeaderColumn"),["stop"])),disabled:!s("toggleHeaderColumn")}," 切换表头列 ",8,qo),e.createElementVNode("button",{class:"btn",onClick:l[12]||(l[12]=e.withModifiers(f=>c("toggleHeaderCell"),["stop"])),disabled:!s("toggleHeaderCell")}," 切换表头单元 ",8,Yo),e.createElementVNode("button",{class:"btn",onClick:l[13]||(l[13]=e.withModifiers(f=>c("fixTables"),["stop"])),disabled:!s("fixTables")}," 修复表格 ",8,Ko),e.createElementVNode("button",{class:"btn",onClick:l[14]||(l[14]=e.withModifiers(f=>c("goToNextCell"),["stop"])),disabled:!s("goToNextCell")}," 下个单元格 ",8,Jo),e.createElementVNode("button",{class:"btn",onClick:l[15]||(l[15]=e.withModifiers(f=>c("goToPreviousCell"),["stop"])),disabled:!s("goToPreviousCell")}," 上个单元格 ",8,Zo),e.createElementVNode("button",{class:"btn",onClick:l[16]||(l[16]=e.withModifiers(f=>c("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!s("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,Xo)])])):e.createCommentVNode("",!0)],8,To)}}}),[["__scopeId","data-v-bbf06816"]]),en=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t,n=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function s(){const c=i.editor;if(c){c.chain().focus().toggleTaskList().run();try{const{state:M}=c,l=M.selection;let _=null;M.doc.nodesBetween(Math.max(0,l.from-5),Math.min(M.doc.content.size,l.to+5),(E,f)=>{var b;return((b=E==null?void 0:E.type)==null?void 0:b.name)==="taskItem"&&_==null?(_=f,!1):!0}),_!=null&&c.commands.setTextSelection(_+1)}catch{}}}return(c,M)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:s},[e.createVNode(e.unref(D),{text:"任务列表",shortcut:e.unref(n),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"task",size:17})]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-693f2c14"]]),tn=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t;function r(){const n=i.editor;n&&n.chain().focus().toggleBlockquote().run()}return(n,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:r},[e.createVNode(e.unref(D),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"quote",size:18})]),_:1})]))}}),[["__scopeId","data-v-587fb9a8"]]),on=["aria-expanded"],nn={class:"label"},rn={key:0,class:"dropdown",role:"listbox"},sn=["aria-selected","onClick"],ln={class:"shortcut"},ye="md-toolbar-dropdown-open",ze="heading-select",an=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=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"},s=[{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]}],c=e.computed(()=>{var p,d;const a=i.editor;if(!a)return null;for(let k=1;k<=6;k++)if((p=a.isActive)!=null&&p.call(a,"heading",{level:k}))return k;return(d=a.isActive)!=null&&d.call(a,"paragraph"),null}),M=e.computed(()=>{const a=c.value;return a?`标题${a}`:"正文"}),l=e.ref(!1),_=e.ref(null);function E(){l.value||window.dispatchEvent(new CustomEvent(ye,{detail:{id:ze}})),l.value=!l.value}function f(){l.value=!1}function b(a){var d,k,u,v,S,w,g,h,$,H;const p=(v=(k=(d=i.editor)==null?void 0:d.chain)==null?void 0:(u=k.call(d)).focus)==null?void 0:v.call(u);p&&(a.level===null?(g=(S=p.setParagraph)==null?void 0:(w=S.call(p)).run)==null||g.call(w):(H=($=(h=p.toggleHeading)==null?void 0:h.call(p,{level:a.level}))==null?void 0:$.run)==null||H.call($),f())}function C(a){const p=a.target,d=_.value;d&&!d.contains(p)&&f()}function y(a){var d;((d=a.detail)==null?void 0:d.id)!==ze&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",C),window.addEventListener(ye,y)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",C),window.removeEventListener(ye,y)}),(a,p)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:_},[e.createVNode(e.unref(D),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(E,["stop"]),"aria-expanded":l.value},[e.createElementVNode("div",nn,e.toDisplayString(M.value),1),e.createVNode(e.unref(pe),{theme:"filled",strokeWidth:3})],8,on)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",rn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,d=>e.createElementVNode("div",{key:d.label,class:"dropdown-item","aria-selected":d.level===c.value,onClick:e.withModifiers(k=>b(d),["stop"])},[d.level===c.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:d.level===null,"level-1":d.level===1,"level-2":d.level===2,"level-3":d.level===3,"level-4":d.level===4,"level-5":d.level===5,"level-6":d.level===6}])},e.toDisplayString(d.label),3),e.createElementVNode("span",ln,e.toDisplayString(d.shortcut),1)],8,sn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-aeb74f7c"]]),cn=["aria-expanded"],dn={key:0,class:"dropdown",role:"menu"},fn={class:"options"},be="md-toolbar-dropdown-open",Se="align-select",pn=P(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const i=t,r=e.computed(()=>{var u,v,S,w;const k=i.editor;return!k||(u=k.isActive)!=null&&u.call(k,{textAlign:"left"})?"left":(v=k.isActive)!=null&&v.call(k,{textAlign:"center"})?"center":(S=k.isActive)!=null&&S.call(k,{textAlign:"right"})?"right":(w=k.isActive)!=null&&w.call(k,{textAlign:"justify"})?"justify":"left"}),n=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[r.value]);function s(k){var u,v,S,w,g,h,$,H;(H=(h=(w=(v=(u=i.editor)==null?void 0:u.chain)==null?void 0:(S=v.call(u)).focus)==null?void 0:(g=w.call(S)).setTextAlign)==null?void 0:($=h.call(g,k)).run)==null||H.call($)}const c=e.ref(!1),M=e.ref(null),l=typeof navigator<"u"&&navigator.platform.includes("Mac"),_=l?"⇧ ⌘ L":"Ctrl Shift L",E=l?"⇧ ⌘ E":"Ctrl Shift E",f=l?"⇧ ⌘ R":"Ctrl Shift R",b=l?"⇧ ⌘ J":"Ctrl Shift J";function C(){c.value||window.dispatchEvent(new CustomEvent(be,{detail:{id:Se}})),c.value=!c.value}function y(){c.value=!1}function a(k){s(k),y()}function p(k){const u=M.value,v=k.target;u&&!u.contains(v)&&y()}function d(k){var v;((v=k.detail)==null?void 0:v.id)!==Se&&(c.value=!1)}return e.onMounted(()=>{document.addEventListener("click",p),window.addEventListener(be,d)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",p),window.removeEventListener(be,d)}),(k,u)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:M},[e.createVNode(e.unref(D),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(C,["stop"]),"aria-expanded":c.value},[e.createVNode(O,{name:n.value,size:18},null,8,["name"]),e.createVNode(O,{name:"caretDown",size:12})],8,cn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("div",fn,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="left"}]),role:"menuitem",onClick:u[0]||(u[0]=e.withModifiers(v=>a("left"),["stop"]))},[e.createVNode(e.unref(D),{text:"左对齐",shortcut:e.unref(_),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"alignLeft",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="center"}]),role:"menuitem",onClick:u[1]||(u[1]=e.withModifiers(v=>a("center"),["stop"]))},[e.createVNode(e.unref(D),{text:"居中对齐",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"alignCenter",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="right"}]),role:"menuitem",onClick:u[2]||(u[2]=e.withModifiers(v=>a("right"),["stop"]))},[e.createVNode(e.unref(D),{text:"右对齐",shortcut:e.unref(f),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"alignRight",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="justify"}]),role:"menuitem",onClick:u[3]||(u[3]=e.withModifiers(v=>a("justify"),["stop"]))},[e.createVNode(e.unref(D),{text:"两端对齐",shortcut:e.unref(b),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"alignJustify",size:16})]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-f2f793f3"]]),mn={class:"header_box"},un=["aria-disabled"],hn=["aria-disabled"],gn=P(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:i}){const r=t,n=i,s=(N,x)=>{var o,m;return(m=(o=r.editor)==null?void 0:o.isActive)==null?void 0:m.call(o,N,x)},c=(N,x)=>{var V,L,B,z,T,F;const o=r.editor;if(!o)return;const m=(B=(V=o.chain)==null?void 0:(L=V.call(o)).focus)==null?void 0:B.call(L);return(F=(T=(z=m==null?void 0:m[N])==null?void 0:z.call(m))==null?void 0:T.run)==null?void 0:F.call(T)},M=()=>{var N,x,o,m;try{return!!((m=(x=(N=r.editor)==null?void 0:N.can)==null?void 0:(o=x.call(N)).undo)!=null&&m.call(o))}catch{return!1}},l=()=>{var N,x,o,m;try{return!!((m=(x=(N=r.editor)==null?void 0:N.can)==null?void 0:(o=x.call(N)).redo)!=null&&m.call(o))}catch{return!1}},_=()=>{var N,x,o;M()&&((o=(x=(N=r.editor)==null?void 0:N.commands)==null?void 0:x.undo)==null||o.call(x))},E=()=>{var N,x,o;return(o=(x=(N=r.editor)==null?void 0:N.commands)==null?void 0:x.redo)==null?void 0:o.call(x)},f=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",b=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",C=typeof navigator<"u"&&navigator.platform.includes("Mac"),y=C?"⌘ B":"Ctrl B",a=C?"⌘ I":"Ctrl I",p=C?"⌘ U":"Ctrl U",d=C?"⇧ ⌘ X":"Ctrl Shift X",k=C?"⌘ \\":"Ctrl \\",u=C?"⇧ ⌘ S":"Ctrl Shift S",v=C?"⇧ ⌘ 8":"Ctrl Shift 8",S=C?"⇧ ⌘ 7":"Ctrl Shift 7",w=C?"⇧ ⌘ C":"Ctrl Shift C",g=()=>{var x,o,m,V,L,B,z;const N=r.editor;N&&((z=(B=(L=(V=(m=(o=(x=N.chain())==null?void 0:x.focus())==null?void 0:o.unsetAllMarks)==null?void 0:m.call(o))==null?void 0:V.removeEmptyTextStyle)==null?void 0:L.call(V))==null?void 0:B.run)==null||z.call(B))},h=e.ref(!1),$=e.ref(!1),H=e.ref({}),A=e.ref(null),Z=()=>{var o,m,V,L,B,z;const N=r.editor;if(!N)return;const x=((o=N.getAttributes)==null?void 0:o.call(N,"textStyle"))||{};H.value={bold:!!((m=N.isActive)!=null&&m.call(N,"bold")),italic:!!((V=N.isActive)!=null&&V.call(N,"italic")),strike:!!((L=N.isActive)!=null&&L.call(N,"strike")),underline:!!((B=N.isActive)!=null&&B.call(N,"underline")),code:!!((z=N.isActive)!=null&&z.call(N,"code")),textStyle:{...x!=null&&x.color?{color:x.color}:{},...x!=null&&x.backgroundColor?{backgroundColor:x.backgroundColor}:{},...x!=null&&x.fontSize?{fontSize:x.fontSize}:{}}}},ee=()=>{var L,B,z,T,F,j,U,q,Q,re,ce,R;const N=r.editor;if(!N)return;const x=H.value;let o=(z=(L=N.chain)==null?void 0:(B=L.call(N)).focus)==null?void 0:z.call(B);const m=x.textStyle||{},V=(T=N.state)==null?void 0:T.selection;V&&V.from===V.to||(o=((F=o==null?void 0:o.unsetAllMarks)==null?void 0:F.call(o))||o,Object.keys(m).length&&(o=((j=o==null?void 0:o.setMark)==null?void 0:j.call(o,"textStyle",m))||o),x.bold&&(o=((U=o==null?void 0:o.toggleBold)==null?void 0:U.call(o))||o),x.italic&&(o=((q=o==null?void 0:o.toggleItalic)==null?void 0:q.call(o))||o),x.strike&&(o=((Q=o==null?void 0:o.toggleStrike)==null?void 0:Q.call(o))||o),x.underline&&(o=((re=o==null?void 0:o.toggleUnderline)==null?void 0:re.call(o))||o),x.code&&(o=((ce=o==null?void 0:o.toggleCode)==null?void 0:ce.call(o))||o),(R=o==null?void 0:o.run)==null||R.call(o))},G=N=>{var m;const x=r.editor;if(!x)return;Z(),h.value=!0,$.value=!!N;const o=(m=x.state)==null?void 0:m.selection;A.value=o?{from:o.from,to:o.to}:null},X=()=>{h.value=!1,$.value=!1},W=()=>{se()},te=N=>{!((N.metaKey||N.ctrlKey)&&N.shiftKey&&(N.key==="s"||N.key==="S"))||!r.editor||(N.preventDefault(),G(!1))},Y=N=>{const x=N.metaKey||N.ctrlKey,o=N.key==="c"||N.key==="C";if(x&&N.shiftKey&&o){N.preventDefault(),c("toggleCodeBlock");return}};let oe=!1;const me=()=>{var x;const N=r.editor;!N||oe||(oe=!0,(x=N.on)==null||x.call(N,"selectionUpdate",W),window.addEventListener("keydown",te),window.addEventListener("keydown",Y),window.addEventListener("mouseup",le,!0))},Ve=()=>{var x;const N=r.editor;N&&((x=N.off)==null||x.call(N,"selectionUpdate",W),window.removeEventListener("keydown",te),window.removeEventListener("keydown",Y),window.removeEventListener("mouseup",le,!0),oe=!1)};e.onMounted(()=>{me()}),e.onBeforeUnmount(()=>{Ve()}),e.watch(()=>r.editor,(N,x)=>{var o;x&&((o=x.off)==null||o.call(x,"selectionUpdate",W)),oe=!1,me()});const se=()=>{try{h.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(h,se),e.onMounted(se),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const le=()=>{var m;if(!h.value)return;const N=r.editor;if(!N)return;const x=(m=N.state)==null?void 0:m.selection;if(!x||x.from===x.to)return;const o=A.value;o&&o.from===x.from&&o.to===x.to||(ee(),A.value={from:x.from,to:x.to},$.value||X())};return(N,x)=>(e.openBlock(),e.createElementBlock("div",mn,[e.createElementVNode("div",{class:"icon","aria-disabled":!M(),onClick:_},[e.createVNode(e.unref(D),{text:"撤销",shortcut:e.unref(f),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,un),e.createElementVNode("div",{class:"icon","aria-disabled":!l(),onClick:E},[e.createVNode(e.unref(D),{text:"重做",shortcut:e.unref(b),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ot),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,hn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:h.value}]),onClick:x[0]||(x[0]=o=>G(!1)),onDblclick:x[1]||(x[1]=o=>G(!0))},[e.createVNode(e.unref(D),{text:"格式刷",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"formatBrush",size:18})]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:g},[e.createVNode(e.unref(D),{text:"清除格式",shortcut:e.unref(k),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"clearFormat",size:18})]),_:1},8,["shortcut"])]),e.createVNode(e.unref(an),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Ct),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("bold")}]),onClick:x[2]||(x[2]=o=>c("toggleBold"))},[e.createVNode(e.unref(D),{text:"加粗",shortcut:e.unref(y),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("italic")}]),onClick:x[3]||(x[3]=o=>c("toggleItalic"))},[e.createVNode(e.unref(D),{text:"斜体",shortcut:e.unref(a),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:s("strike")}]),onClick:x[4]||(x[4]=o=>c("toggleStrike"))},[e.createVNode(e.unref(D),{text:"删除线",shortcut:e.unref(d),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(lt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("underline")}]),onClick:x[5]||(x[5]=o=>c("toggleUnderline"))},[e.createVNode(e.unref(D),{text:"下划线",shortcut:e.unref(p),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref($t),{editor:r.editor,currentColor:r.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(ko),{editor:r.editor,style:{"margin-left":"-6px"}},null,8,["editor"]),e.createVNode(e.unref(pn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("bulletList")}]),onClick:x[6]||(x[6]=o=>c("toggleBulletList"))},[e.createVNode(e.unref(D),{text:"无序列表",shortcut:e.unref(v),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"bulletList",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("orderedList")}]),onClick:x[7]||(x[7]=o=>c("toggleOrderedList"))},[e.createVNode(e.unref(D),{text:"有序列表",shortcut:e.unref(S),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"orderedList",size:16})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(en),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("code")}]),onClick:x[8]||(x[8]=o=>c("toggleCode"))},[e.createVNode(e.unref(D),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"code",size:18})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("codeBlock")}]),onClick:x[9]||(x[9]=o=>c("toggleCodeBlock"))},[e.createVNode(e.unref(D),{text:"代码块",shortcut:e.unref(w),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(O,{name:"codeBlock",size:16})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(tn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(vo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(xo),{editor:r.editor,imageUploader:r.imageUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(Vo),{editor:r.editor,videoUploader:r.videoUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref($o),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Qo),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:x[10]||(x[10]=o=>n("toggleFullscreen"))},[e.createVNode(e.unref(D),{text:r.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.fullscreen?e.unref(nt):e.unref(tt)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])])]))}}),[["__scopeId","data-v-e9f73372"]]),kn={class:"outline__header"},wn={style:{cursor:"pointer","margin-top":"5px"}},Cn={class:"outline__listWrap"},xn={class:"outline__list"},yn=["onClick"],bn=["onClick"],Vn=P(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:i}){const r=t,n=i;function s(d){y(d),n("select",d)}function c(){n("update:open",!1),n("update:pinned",!1)}function M(){r.pinned||c()}function l(d){const k=[],u=[];for(const v of d){const S={...v,children:[]};for(;u.length&&u[u.length-1].level>=S.level;)u.pop();u.length?u[u.length-1].children.push(S):k.push(S),u.push(S)}return k}const _=e.ref(new Set);function E(d){return _.value.has(d.pos)}function f(d){const k=_.value;k.has(d.pos)?k.delete(d.pos):k.add(d.pos),_.value=new Set(k)}const b=e.computed(()=>l(r.items||[])),C=e.computed(()=>{const d=[],k=u=>{for(const v of u)d.push({node:v,level:v.level,hasChildren:v.children.length>0}),_.value.has(v.pos)||k(v.children)};return k(b.value),d});function y(d){const k=e.unref(r.editor);if(!k)return;const{doc:u}=k.state,v=u.nodeAt(d.pos),S=Math.max(1,u.content.size-1);let w=d.pos+1;v&&v.type.name==="heading"&&(w=d.pos+v.nodeSize-1),w=Math.min(Math.max(1,w),S),k.chain().focus().setTextSelection(w).run();const g=e.unref(r.container)??null,h=k.view.coordsAtPos(w),$=r.offset??8,H=r.duration??700;if(g){const A=g.getBoundingClientRect(),Z=g.scrollTop+h.top-A.top-$;a(g,Z,H)}else{const A=(window.scrollY||window.pageYOffset)+h.top-$;p(A,H)}}function a(d,k,u=600){const v=d.scrollTop,S=k-v,w=performance.now(),g=$=>$<.5?4*$*$*$:1-Math.pow(-2*$+2,3)/2;function h($){const H=$-w,A=Math.min(1,H/u);d.scrollTop=v+S*g(A),A<1&&requestAnimationFrame(h)}requestAnimationFrame(h)}function p(d,k=600){const u=window.scrollY||window.pageYOffset,v=d-u,S=performance.now(),w=h=>h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;function g(h){const $=h-S,H=Math.min(1,$/k),A=u+v*w(H);window.scrollTo(0,A),H<1&&requestAnimationFrame(g)}requestAnimationFrame(g)}return(d,k)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:r.open}]),style:e.normalizeStyle({maxHeight:typeof r.maxHeight=="number"?r.maxHeight+"px":r.maxHeight}),onMouseleave:M},[e.createElementVNode("div",kn,[k[2]||(k[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),e.createElementVNode("div",wn,[r.open&&!r.pinned?(e.openBlock(),e.createBlock(e.unref(it),{key:0,onClick:k[0]||(k[0]=u=>d.$emit("update:pinned",!0)),theme:"outline",size:16,strokeWidth:3})):e.createCommentVNode("",!0),r.pinned?(e.openBlock(),e.createBlock(e.unref(rt),{key:1,onClick:c,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Cn,[e.createElementVNode("ul",xn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(u,v)=>(e.openBlock(),e.createElementBlock("li",{key:u.node.pos+"-"+v,class:e.normalizeClass(["outline__item","lv-"+u.level])},[u.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:E(u.node),expanded:!E(u.node)}]),onClick:e.withModifiers(S=>f(u.node),["stop"]),title:"展开/收起"},[...k[3]||(k[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,yn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:S=>s(u.node)},e.toDisplayString(u.node.text||"(无标题)"),9,bn)],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-b5f802fc"]]),_n=["onClick"],$e=P(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:i,emit:r}){const n=t,s=r,c=e.ref(null);let M=!1;const l=e.ref(!1),_=e.ref(!1),E=e.ref(""),f=e.ref([]),b=e.ref("#000000"),C=e.ref(!0),y=e.ref(!0),a=e.ref(null),p=e.ref(void 0),d=e.ref([]),k=e.ref(null),u=()=>{const o=a.value;p.value=o?o.clientHeight:void 0};let v=null;e.onMounted(()=>{u(),v=()=>u(),window.addEventListener("resize",v),e.nextTick(()=>{const o=a.value;o&&o.addEventListener("scroll",le,{passive:!0})})}),e.onBeforeUnmount(()=>{v&&(window.removeEventListener("resize",v),v=null);const o=a.value;o&&o.removeEventListener("scroll",le)}),e.watch([()=>n.height,C,l],async()=>{await e.nextTick(),u(),le()}),e.watch(l,o=>{try{document.body.style.overflow=o?"hidden":""}catch{}try{o?window.addEventListener("keydown",S):window.removeEventListener("keydown",S)}catch{}});function S(o){o.key==="Escape"&&l.value&&(o.preventDefault(),l.value=!1)}const w=e.computed(()=>{const o=V=>V==null?void 0:typeof V=="number"?`${V}px`:V,m=l.value?"100vh":o(n.height);return{height:m,"--editor-height":m,"--editor-caret-color":n.caretColor||"#000"}}),g=ge.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:m})=>m().setMark("textStyle",{fontSize:o}).run(),unsetFontSize:()=>({chain:o})=>o().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),h=ge.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:m})=>m().setMark("textStyle",{backgroundColor:o}).run(),unsetBackgroundColor:()=>({chain:o})=>o().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{c.value=new Ne.Editor({extensions:[Fe.StarterKit.configure({dropcursor:!1}),Re.Dropcursor.configure({color:"#22c55e",width:2}),ve.TaskList,Ke,Ge.configure({inline:!0,allowBase64:!0}),Ye.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ae.Markdown,Ee.TableKit.configure({table:{resizable:!0},tableCell:!1}),qe,ge.TextStyle,g,h,Oe.Color,We.Underline,je.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),Ie.TextAlign.configure({types:["heading","paragraph"]}),Ue.Placeholder.configure({placeholder:n.placeholder??"输入 / 以插入块"})],content:n.markdown!=null?String(n.markdown||""):String(n.modelValue||""),contentType:n.markdown!=null?"markdown":/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(n.modelValue||""))?"html":"markdown",editable:!0,autofocus:!0,editorProps:{handlePaste(o,m){var Q,re,ce;const V=m.clipboardData;if(!V)return!1;const L=V.files&&V.files.length?Array.from(V.files):[],B=L.find(R=>{var K;return(K=R.type)==null?void 0:K.startsWith("image/")});if(B){if(m.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return Z(B),!0}const z=L.find(R=>{var K;return(K=R.type)==null?void 0:K.startsWith("video/")});if(z)return m.preventDefault(),oe(z),!0;const F=(V.items?Array.from(V.items):[]).find(R=>R.kind==="file"),j=F?F.getAsFile():null;if(j&&j.type.startsWith("image/")){if(m.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return Z(j),!0}if(j&&j.type.startsWith("video/"))return m.preventDefault(),oe(j),!0;const U=V.getData("text/html");if(U){const R=U.match(/<img[^>]+src=["']([^"']+)["']/i),K=U.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(R&&K&&K[1]){m.preventDefault();const fe=K[1];if(n.imageUploader&&/^data:image\//i.test(fe)){const ue=X(fe,"clipboard.png");Z(ue)}else{if(/^data:image\//i.test(fe)){const ue=X(fe,"clipboard.png"),_e=(Q=n.uploadSizeLimit)==null?void 0:Q.image;if(_e){const En=Math.max(1,_e)*1024*1024;if(ue.size>En){try{window.alert(`图片文件大小超限(${(ue.size/1024/1024).toFixed(2)}MB > ${_e}MB)`)}catch{}return!0}}}$(fe)}return!0}const ie=U.match(/<video[^>]+src=["']([^"']+)["']/i),ne=U.match(/<source[^>]+src=["']([^"']+)["']/i),de=U.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),De=ie&&ie[1]||ne&&ne[1];if(De&&de)return m.preventDefault(),A(De),!0}const q=V.getData("text/plain");if(q){const R=q.trim(),K=Y(R);if(W(R)&&R===q.trim()){if(m.preventDefault(),/^data:image\//i.test(R)){const ie=X(R,"clipboard.png"),ne=(re=n.uploadSizeLimit)==null?void 0:re.image;if(ne){const de=Math.max(1,ne)*1024*1024;if(ie.size>de){try{window.alert(`图片文件大小超限(${(ie.size/1024/1024).toFixed(2)}MB > ${ne}MB)`)}catch{}return!0}}}return $(R),!0}if(K){if(m.preventDefault(),/^data:image\//i.test(K)){const ie=X(K,"clipboard.png"),ne=(ce=n.uploadSizeLimit)==null?void 0:ce.image;if(ne){const de=Math.max(1,ne)*1024*1024;if(ie.size>de){try{window.alert(`图片文件大小超限(${(ie.size/1024/1024).toFixed(2)}MB > ${ne}MB)`)}catch{}return!0}}}return $(K),!0}if(te(R)&&R===q.trim())return m.preventDefault(),A(R),!0}return!1},handleDrop(o,m){const V=m.dataTransfer;if(!V)return!1;const B=(V.files?Array.from(V.files):[]).find(z=>{var T;return(T=z.type)==null?void 0:T.startsWith("image/")});if(B){if(m.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return Z(B),!0}return!1},handleClick(o,m,V){const L=V,B=L.target,z=B?B.closest("a[href]"):null;if(z&&(L.ctrlKey||L.metaKey)){const T=z.getAttribute("href")||"";if(T){L.preventDefault();try{window.open(T,"_blank","noopener,noreferrer")}catch(F){console.warn("打开链接失败:",F)}return!0}}return!1}},onSelectionUpdate:o=>{var L;const V=((L=o.editor.getAttributes("textStyle"))==null?void 0:L.color)||"#000000";b.value=typeof V=="string"?V:"#000000"},onUpdate:()=>{const o=c.value;M=!0,s("update:modelValue",o.getHTML()),s("update:markdown",o.getMarkdown()),se()},onTransaction:()=>{se()}}),e.nextTick(()=>{var o;se();try{(o=c.value)==null||o.chain().focus().run()}catch{}})}),e.onBeforeUnmount(()=>{var o;(o=c.value)==null||o.destroy()}),e.watch(()=>n.modelValue,o=>{if(M){M=!1;return}o!=null&&c.value&&e.nextTick(()=>{try{const m=/<\s*(video|iframe)\b|data-youtube-video/i.test(o),V=o.match(/\[video\]\(([^)]+)\)/i);if(!m&&V){const L=V[1],B=o.replace(/\[video\]\(([^)]+)\)/gi,(z,T)=>`<video data-tiptap-video src="${T}" controls></video>`);c.value.commands.setContent(B,{contentType:"html"})}else c.value.commands.setContent(o,{contentType:m?"html":"markdown"})}catch(m){console.warn("setContent 失败,内容更新被忽略:",m)}})}),e.watch(()=>n.markdown,o=>{if(M){M=!1;return}o!=null&&c.value&&e.nextTick(()=>{try{c.value.commands.setContent(o,{contentType:"markdown"})}catch(m){console.warn("setContent 失败,内容更新被忽略:",m)}})});function $(o){var m;(m=c.value)==null||m.chain().focus().setImage({src:o}).run()}function H(o){return String(o).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function A(o){const m=c.value;if(!m)return;if(typeof m.commands.setVideo=="function"){m.chain().focus().setVideo({src:o,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const L=H(o);try{m.chain().focus().insertContent(`<p><a href="${L}" target="_blank" rel="noopener noreferrer">${L}</a></p>`).run()}catch{m.chain().focus().insertContent(L).run()}}async function Z(o){var V,L;const m=(V=n.uploadSizeLimit)==null?void 0:V.image;if(m){const B=Math.max(1,m)*1024*1024;if(o.size>B){try{window.alert(`图片文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${m}MB)`)}catch{}return}}if(n.imageUploader){const B=URL.createObjectURL(o);(L=c.value)==null||L.chain().focus().setImage({src:B,uploading:!0}).run();try{const z=await n.imageUploader(o);if(typeof z=="string"&&z){ee(B,z);return}G(o,T=>ee(B,T))}catch(z){console.warn("图片上传失败,回退为 base64",z),G(o,T=>ee(B,T))}finally{try{URL.revokeObjectURL(B)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function ee(o,m){var T,F;const V=c.value;if(!V)return;const{state:L}=V,{doc:B}=L;let z=null;if(B.descendants((j,U)=>{var q,Q;return((q=j.type)==null?void 0:q.name)==="image"&&((Q=j.attrs)==null?void 0:Q.src)===o?(z=U,!1):!0}),z!=null){const j=B.nodeAt(z),U=L.schema.nodes.image;if(!j||!U)return;const q={...j.attrs||{},src:m,uploading:null},Q=L.tr.setNodeMarkup(z,U,q,j.marks);V.view.dispatch(Q);try{(F=(T=V.options)==null?void 0:T.onUpdate)==null||F.call(T,{editor:V})}catch{}}else $(m)}function G(o,m){const V=new FileReader;V.onload=()=>m(String(V.result||"")),V.readAsDataURL(o)}function X(o,m="image.png"){var F;const V=o.split(","),L=((F=V[0].match(/:(.*?);/))==null?void 0:F[1])||"image/png",B=atob(V[1]);let z=B.length;const T=new Uint8Array(z);for(;z--;)T[z]=B.charCodeAt(z);return new File([T],m,{type:L})}function W(o){return/^data:image\//i.test(o)||/^https?:\/\//i.test(o)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(o)}function te(o){return/^https?:\/\//i.test(o)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(o)}function Y(o){const m=o.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!m)return null;const V=m[1].trim().replace(/^<|>$/g,"");return W(V)?V:null}async function oe(o){var L;const m=(L=n.uploadSizeLimit)==null?void 0:L.video;if(m){const B=Math.max(1,m)*1024*1024;if(o.size>B){try{window.alert(`视频文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${m}MB)`)}catch{}return}}if(n.videoUploader){const B=URL.createObjectURL(o),z=c.value,T=z==null?void 0:z.commands;try{typeof(T==null?void 0:T.setVideo)=="function"?z==null||z.chain().focus().setVideo({src:B,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():A(B)}catch{A(B)}try{const F=await n.videoUploader(o);me(B,F)}catch(F){console.warn("视频上传失败,保留本地对象 URL 作为预览",F)}finally{try{URL.revokeObjectURL(B)}catch{}}return}const V=URL.createObjectURL(o);A(V)}function me(o,m){const V=c.value;if(!V)return;const{state:L}=V,{doc:B}=L;let z=null;if(B.descendants((T,F)=>{var j,U;return((j=T.type)==null?void 0:j.name)==="video"&&((U=T.attrs)==null?void 0:U.src)===o?(z=F,!1):!0}),z!=null){const T=B.nodeAt(z),F=L.schema.nodes.video;if(!T||!F)return;const j={...T.attrs||{},src:m,uploading:null},U=L.tr.setNodeMarkup(z,F,j,T.marks);V.view.dispatch(U)}}function Ve(){var o,m;E.value=((m=(o=c.value)==null?void 0:o.getAttributes("link"))==null?void 0:m.href)||"",_.value=!0}function se(){const o=c.value;if(!o)return;const m=[];o.state.doc.descendants((V,L)=>{if(V.type.name==="heading"){const B=V.attrs.level||1,z=V.textContent||"";m.push({text:z,level:B,pos:L})}}),f.value=m,le()}function le(){const o=c.value,m=a.value,V=f.value;if(!o||!m||!V.length){d.value=[],k.value=null;return}const L=m.getBoundingClientRect(),B=m.scrollHeight||m.clientHeight,z=m.clientHeight||1,T=V.map(U=>{const Q=o.view.coordsAtPos(Math.min(U.pos+1,o.state.doc.content.size)).top-L.top+m.scrollTop,re=B?Math.max(0,Math.min(1,Q/B)):0;return Math.round(re*z)});d.value=T;const F=m.scrollTop+8;let j=null;for(let U=0;U<V.length;U++){const q=V[U];if(o.view.coordsAtPos(Math.min(q.pos+1,o.state.doc.content.size)).top-L.top+m.scrollTop<=F)j=q.pos;else break}k.value=j}function N(o){const m=o.target;m.closest(".outline")||m.closest(".outline-toggle")||c.value&&c.value.chain().focus().run()}function x(){const o=c.value;return o?o.getMarkdown():""}return i({getMarkdown:x}),(o,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-editor",{fullscreen:l.value}]),style:e.normalizeStyle(w.value)},[e.createVNode(e.unref(gn),{editor:c.value,currentColor:b.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":n.uploadSizeLimit,fullscreen:l.value,onToggleFullscreen:m[0]||(m[0]=V=>l.value=!l.value),onOpenLinkModal:Ve},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:C.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:a,class:"editor_wrapper",onClick:N},[e.createVNode(e.unref(Ne.EditorContent),{editor:c.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Vn),{open:C.value,"onUpdate:open":m[1]||(m[1]=V=>C.value=V),items:f.value,editor:c.value,container:a.value,maxHeight:p.value,pinned:y.value,"onUpdate:pinned":m[2]||(m[2]=V=>y.value=V)},null,8,["open","items","editor","container","maxHeight","pinned"]),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:m[3]||(m[3]=V=>(C.value=!0,y.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(V,L)=>{var B;return e.openBlock(),e.createElementBlock("span",{key:L,class:e.normalizeClass(["outline-marker",{active:((B=f.value[L])==null?void 0:B.pos)===k.value}]),style:e.normalizeStyle({top:(V||0)+"px"}),onClick:e.withModifiers(z=>{var T,F;return(F=c.value)==null?void 0:F.chain().focus().setTextSelection((((T=f.value[L])==null?void 0:T.pos)||1)+1).run()},["stop"])},null,14,_n)}),128))],32))],2)],6))}}),[["__scopeId","data-v-64eed710"]]),Nn={install(t){t.component("Editor",$e)}};I.Editor=$e,I.default=Nn,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});