modernleft-docs/.obsidian/plugins/editing-toolbar/main.js

12 lines
No EOL
172 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";var e=require("obsidian");function t(e,t,o,n){return new(o||(o=Promise))((function(i,a){function l(e){try{s(n.next(e))}catch(e){a(e)}}function r(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,r)}s((n=n.apply(e,t||[])).next())}))}function o(e){return t(this,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))}))}function n(e){let t=Date.now().toString(36);return t+=Math.random().toString(36).substr(3,e),t}function i(e,t,o){let n,i={index:-1,subindex:-1},a=e.settings.menuCommands;return o?a.forEach(((e,o)=>{if("SubmenuCommands"in e&&(n=e.SubmenuCommands.findIndex((e=>e.id==t.id)),n>=0))return i={index:o,subindex:n},i})):(n=a.findIndex((e=>e.id==t.id)),i={index:n,subindex:-1}),i}"function"==typeof SuppressedError&&SuppressedError;const a=["Custom","cMenuToolbar","cMenuToolbarSub","cMenuToolbarAdd","cMenuToolbarDelete","cMenuToolbarReload","codeblock-glyph","underline-glyph","superscript-glyph","subscript-glyph","bot-glyph","header-1","header-2","header-3","header-4","header-5","header-6","header-n","obsidian","accessibility","activity","air-vent","airplay","alarm-check","alarm-clock-off","alarm-clock","alarm-minus","alarm-plus","album","alert-circle","alert-octagon","alert-triangle","align-center-horizontal","align-center-vertical","align-center","align-end-horizontal","align-end-vertical","align-horizontal-distribute-center","align-horizontal-distribute-end","align-horizontal-distribute-start","align-horizontal-justify-center","align-horizontal-justify-end","align-horizontal-justify-start","align-horizontal-space-around","align-horizontal-space-between","align-justify","align-left","align-right","align-start-horizontal","align-start-vertical","align-vertical-distribute-center","align-vertical-distribute-end","align-vertical-distribute-start","align-vertical-justify-center","align-vertical-justify-end","align-vertical-justify-start","align-vertical-space-around","align-vertical-space-between","anchor","angry","annoyed","aperture","apple","archive-restore","archive","armchair","arrow-big-down","arrow-big-left","arrow-big-right","arrow-big-up","arrow-down-circle","arrow-down-left","arrow-down-right","arrow-down","arrow-left-circle","arrow-left-right","arrow-left","arrow-right-circle","arrow-right","arrow-up-circle","arrow-up-left","arrow-up-right","arrow-up","asterisk","at-sign","award","axe","axis-3d","baby","backpack","baggage-claim","banana","banknote","bar-chart-2","bar-chart-3","bar-chart-4","bar-chart-horizontal","bar-chart","baseline","bath","battery-charging","battery-full","battery-low","battery-medium","battery","beaker","bed-double","bed-single","bed","beer","bell-minus","bell-off","bell-plus","bell-ring","bell","bike","binary","bitcoin","bluetooth-connected","bluetooth-off","bluetooth-searching","bluetooth","bold","bomb","bone","book-open","book","bookmark-minus","bookmark-plus","bookmark","bot","box-select","box","boxes","briefcase","brush","bug","building-2","building","bus","cake","calculator","calendar-check-2","calendar-check","calendar-clock","calendar-days","calendar-heart","calendar-minus","calendar-off","calendar-plus","calendar-range","calendar-search","calendar-x2","calendar-x","calendar","camera-off","camera","car","carrot","cast","check-circle-2","check-circle","check-square","check","chef-hat","cherry","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","chevrons-down-up","chevrons-down","chevrons-left-right","chevrons-left","chevrons-right-left","chevrons-right","chevrons-up-down","chevrons-up","chrome","cigarette-off","cigarette","circle-dot","circle-ellipsis","circle-slashed","circle","citrus","clapperboard","clipboard-check","clipboard-copy","clipboard-edit","clipboard-list","clipboard-signature","clipboard-type","clipboard-x","clipboard","clock-1","clock-10","clock-11","clock-12","clock-2","clock-3","clock-4","clock-5","clock-6","clock-7","clock-8","clock-9","clock","cloud-cog","cloud-drizzle","cloud-fog","cloud-hail","cloud-lightning","cloud-moon-rain","cloud-moon","cloud-off","cloud-rain-wind","cloud-rain","cloud-snow","cloud-sun-rain","cloud-sun","cloud","cloudy","clover","code-2","code","codepen","codesandbox","coffee","cog","coins","columns","command","compass","component","contact","contrast","cookie","copy","copyleft","copyright","corner-down-left","corner-down-right","corner-left-down","corner-left-up","corner-right-down","corner-right-up","corner-up-left","corner-up-right","cpu","credit-card","croissant","crop","cross","crosshair","crown","cup-soda","curly-braces","currency","database","delete","diamond","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","dices","diff","disc","divide-circle","divide-square","divide","dollar-sign","download-cloud","download","dribbble","droplet","droplets","drumstick","edit-2","edit-3","edit","egg-fried","egg","equal-not","equal","eraser","euro","expand","external-link","eye-off","eye","facebook","factory","fast-forward","feather","figma","file-archive","file-audio-2","file-audio","file-axis-3d","file-badge-2","file-badge","file-bar-chart-2","file-bar-chart","file-box","file-check-2","file-check","file-clock","file-code","file-cog-2","file-cog","file-diff","file-digit","file-down","file-edit","file-heart","file-image","file-input","file-json-2","file-json","file-key-2","file-key","file-line-chart","file-lock-2","file-lock","file-minus-2","file-minus","file-output","file-pie-chart","file-plus-2","file-plus","file-question","file-scan","file-search-2","file-search","file-signature","file-spreadsheet","file-symlink","file-terminal","file-text","file-type-2","file-type","file-up","file-video-2","file-video","file-volume-2","file-volume","file-warning","file-x2","file-x","file","files","film","filter","fingerprint","flag-off","flag-triangle-left","flag-triangle-right","flag","flame","flashlight-off","flashlight","flask-conical","flask-round","flip-horizontal-2","flip-horizontal","flip-vertical-2","flip-vertical","flower-2","flower","focus","folder-archive","folder-check","folder-clock","folder-closed","folder-cog-2","folder-cog","folder-down","folder-edit","folder-heart","folder-input","folder-key","folder-lock","folder-minus","folder-open","folder-output","folder-plus","folder-search-2","folder-search","folder-symlink","folder-tree","folder-up","folder-x","folder","folders","form-input","forward","frame","framer","frown","fuel","function-square","gamepad-2","gamepad","gauge","gavel","gem","ghost","gift","git-branch-plus","git-branch","git-commit","git-compare","git-fork","git-merge","git-pull-request-closed","git-pull-request-draft","git-pull-request","github","gitlab","glass-water","glasses","globe-2","globe","grab","graduation-cap","grape","grid","grip-horizontal","grip-vertical","hammer","hand-metal","hand","hard-drive","hard-hat","hash","haze","headphones","heart-crack","heart-handshake","heart-off","heart-pulse","heart","help-circle","hexagon","highlighter","history","home","hourglass","ice-cream","image-minus","image-off","image-plus","image","import","inbox","indent","indian-rupee","infinity","info","inspect","instagram","italic","japanese-yen","joystick","key","keyboard","lamp-ceiling","lamp-desk","lamp-floor","lamp-wall-down","lamp-wall-up","lamp","landmark","languages","laptop-2","laptop","lasso-select","lasso","laugh","layers","layout-dashboard","layout-grid","layout-list","layout-template","layout","leaf","library","life-buoy","lightbulb-off","lightbulb","line-chart","link-2off","link-2","link","linkedin","list-checks","list-end","list-minus","list-music","list-ordered","list-plus","list-start","list-video","list-x","list","loader-2","loader","locate-fixed","locate-off","locate","lock","log-in","log-out","luggage","magnet","mail-check","mail-minus","mail-open","mail-plus","mail-question","mail-search","mail-warning","mail-x","mail","mails","map-pin-off","map-pin","map","martini","maximize-2","maximize","medal","megaphone-off","megaphone","meh","menu","message-circle","message-square","mic-2","mic-off","mic","microscope","milestone","minimize-2","minimize","minus-circle","minus-square","minus","monitor-off","monitor-speaker","monitor","moon","more-horizontal","more-vertical","mountain-snow","mountain","mouse-pointer-2","mouse-pointer-click","mouse-pointer","mouse","move-3d","move-diagonal-2","move-diagonal","move-horizontal","move-vertical","move","music-2","music-3","music-4","music","navigation-2off","navigation-2","navigation-off","navigation","network","newspaper","octagon","option","outdent","package-2","package-check","package-minus","package-open","package-plus","package-search","package-x","package","paint-bucket","paintbrush-2","paintbrush","palette","palmtree","paperclip","party-popper","pause-circle","pause-octagon","pause","pen-tool","pencil","percent","person-standing","phone-call","phone-forwarded","phone-incoming","phone-missed","phone-off","phone-outgoing","phone","pie-chart","piggy-bank","pin-off","pin","pipette","pizza","plane","play-circle","play","plug-zap","plus-circle","plus-square","plus","pocket","podcast","pointer","pound-sterling","power-off","power","printer","puzzle","qr-code","quote","radio-receiver","radio","recycle","redo-2","redo","refresh-ccw","refresh-cw","regex","repeat-1","repeat","reply-all","reply","rewind","rocket","rocking-chair","rotate-3d","rotate-ccw","rotate-cw","rss","ruler","russian-ruble","save","scale-3d","scale","scaling","scan-face","scan-line","scan","scissors","screen-share-off","screen-share","scroll","search","send","separator-horizontal","separator-vertical","server-cog","server-crash","server-off","server","settings-2","settings","share-2","share","sheet","shield-alert","shield-check","shield-close","shield-off","shield","shirt","shopping-bag","shopping-cart","shovel","shrink","shrub","shuffle","sidebar-close","sidebar-open","sidebar","sigma","signal-high","signal-low","signal-medium","signal-zero","signal","siren","skip-back","skip-forward","skull","slack","slash","slice","sliders-horizontal","sliders","smartphone-charging","smartphone","smile-plus","smile","snowflake","sofa","sort-asc","sort-desc","speaker","sprout","square","star-half","star-off","star","stethoscope","sticker","sticky-note","stop-circle","stretch-horizontal","stretch-vertical","strikethrough","subscript","sun-dim","sun-medium","sun-moon","sun-snow","sun","sunrise","sunset","superscript","swiss-franc","switch-camera","sword","swords","syringe","table-2","table","tablet","tag","tags","target","tent","terminal-square","terminal","text-cursor-input","text-cursor","thermometer-snowflake","thermometer-sun","thermometer","thumbs-down","thumbs-up","ticket","timer-off","timer-reset","timer","toggle-left","toggle-right","tornado","toy-brick","train","trash-2","trash","tree-deciduous","tree-pine","trees","trello","trending-down","trending-up","triangle","trophy","truck","tv-2","tv","twitch","twitter","type","umbrella","underline","undo-2","undo","unlink-2","unlink","unlock","upload-cloud","upload","usb","user-check","user-cog","user-minus","user-plus","user-x","user","users","utensils-crossed","utensils","venetian-mask","verified","vibrate-off","vibrate","video-off","video","view","voicemail","volume-1","volume-2","volume-x","volume","wallet","wand-2","wand","watch","waves","webcam","webhook","wifi-off","wifi","wind","wine","wrap-text","wrench","x-circle","x-octagon","x-square","x","youtube","zap-off","zap","zoom-in","zoom-out","create-new","trash","search","right-triangle","document","folder","pencil","left-arrow","right-arrow","three-horizontal-bars","dot-network","audio-file","image-file","pdf-file","gear","documents","blocks","go-to-file","presentation","cross-in-box","microphone","microphone-filled","two-columns","link","popup-open","checkmark","hashtag","left-arrow-with-tail","right-arrow-with-tail","up-arrow-with-tail","down-arrow-with-tail","lines-of-text","vertical-three-dots","pin","magnifying-glass","info","horizontal-split","vertical-split","calendar-with-checkmark","folder-minus","sheets-in-box","up-and-down-arrows","broken-link","cross","any-key","reset","star","crossed-star","dice","filled-pin","enter","help","vault","open-vault","paper-plane","bullet-list","uppercase-lowercase-a","star-list","expand-vertically","languages","switch","pane-layout","install","sync","check-in-circle","sync-small","check-small","paused","forward-arrow","stacked-levels","bracket-glyph","note-glyph","tag-glyph","price-tag-glyph","heading-glyph","bold-glyph","italic-glyph","strikethrough-glyph","highlight-glyph","code-glyph","quote-glyph","link-glyph","bullet-list-glyph","number-list-glyph","checkbox-glyph","undo-glyph","redo-glyph","up-chevron-glyph","down-chevron-glyph","left-chevron-glyph","right-chevron-glyph","percent-sign-glyph","keyboard-glyph","double-up-arrow-glyph","double-down-arrow-glyph","image-glyph","wrench-screwdriver-glyph","clock","plus-with-circle","minus-with-circle","indent-glyph","unindent-glyph","fullscreen","exit-fullscreen","cloud","run-command","compress-glyph","enlarge-glyph","scissors-glyph","up-curly-arrow-glyph","down-curly-arrow-glyph","plus-minus-glyph","links-going-out","links-coming-in","add-note-glyph","duplicate-glyph","clock-glyph","calendar-glyph","command-glyph","dice-glyph","file-explorer-glyph","graph-glyph","import-glyph","navigate-glyph","open-elsewhere-glyph","presentation-glyph","paper-plane-glyph","question-mark-glyph","restore-file-glyph","search-glyph","star-glyph","play-audio-glyph","stop-audio-glyph","tomorrow-glyph","wand-glyph","workspace-glyph","yesterday-glyph","box-glyph","merge-files-glyph","merge-files","two-blank-pages","scissors","paste","paste-text","split","select-all-text","wand","github-glyph","reading-glasses","user-manual-filled","discord-filled","chat-bubbles-filled","experiment-filled","bracket-glyph","box-glyph","check-small","dice-glyph","dice","discord","right-triangle","heading-glyph","help","keyboard-toggle","broken-link","experiment","left-arrow","link","link-glyph","links-coming-in","links-going-out","open-vault","paused","question-mark-glyph","right-arrow","sidebar-left","sidebar-right","sheets-in-box","star-list","sync-small","tabs","uppercase-lowercase-a","vault","stack-horizontal","stack-vertical","stretch-horizontal","stretch-vertical","distribute-space-horizontal","distribute-space-vertical"];let l;const r=t=>{l=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let o=l.getElementById("cMenuToolbarModalBar");o&&(o.style.visibility=0==t?"hidden":"visible")},s=t=>{l=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let o=l.getElementById("cMenuToolbarModalBar");o&&("following"!=t.positionStyle||(o.style.visibility="hidden"),"fixed"==t.positionStyle&&o.setAttribute("style",`left: calc(50% - calc(${o.offsetWidth}px / 2)); bottom: ${t.cMenuBottomValue}em; grid-template-columns: ${"1fr ".repeat(t.cMenuNumRows)}`))};var c={"Editing Toolbar append method":"Editing Toolbar append method","Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.":"Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.","Editing Toolbar aesthetic":"Editing Toolbar aesthetic","Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.":"Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.","Editing Toolbar position":"Editing Toolbar position","Choose between fixed position or cursor following mode.":"Choose between fixed position , cursor following or Top mode .","Editing Toolbar columns":"Editing Toolbar columns","Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.":"Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.","Editing Toolbar refresh":"Editing Toolbar refresh","Editing Toolbar commands":"Editing Toolbar commands","Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.":"Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.","Format Brush Off!":"Format Brush Off!","Hide & Show":"Hide & Show","Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.":"Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.","Font-Color formatting brush ON!":"Font-Color formatting brush ON!",More:"More","Font Colors":"Font Colors","Format Brush":"Format Brush","Background color":"Background color",Refresh:"Refresh",Add:"Add",Delete:"Delete","Change Command name":"Change Command name","Add submenu":"Add submenu","add hr":"add hr","Enter the icon code, it looks like <svg>.... </svg> format":"Enter the icon code, it looks like <svg>.... </svg> format","Please enter a new name":"Please enter a new name","Drag the slider to move the position":"Drag the slider to move the position","Plugin Settings":"Plugin Settings","Background-color formatting brush ON!":"Background-color formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush","Clear formatting brush ON!":"Clear formatting brush ON!","Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush":"Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush","The toolbar is displayed when the mouse moves over it, otherwise it is automatically hidden":"The toolbar is displayed when the mouse moves over it, otherwise it is automatically hidden","Editing Toolbar Auto-hide":"Editing Toolbar Auto-hide","Custom Backgroud Color":"Custom Backgroud Color","Custom Font Color":"Custom Font Color","🎨 Set custom background":"🎨 Set custom background","🖌️ Set custom font color":"🖌️ Set custom font color","Click on the picker to adjust the colour":"Click on the picker to adjust the colour","Mobile enabled or not":"Mobile enabled or not","Whether to enable the plugin for the mobile client, the default is enabled.":"Whether to enable the plugin for the mobile client, the default is enabled.","Whether to enable on mobile devices with device width less than 768px, the default is disable.":"Whether to enable on mobile devices with device width less than 768px, the default is disable."};const d={ar:{},cs:{},da:{},de:{},en:c,"en-gb":{},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},nl:{},nn:{},pl:{},pt:{},"pt-br":{},ro:{},ru:{},tr:{},"zh-cn":{"Editing Toolbar append method":"工具栏的附加方法。","Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.":"工具栏在Obsidian中的追加的位置只对固定和跟随模式有效。如果你遇到工具栏显示问题可以选择body试试。请点击下面或者状态栏菜单中的刷新按钮生效。","Editing Toolbar aesthetic":"工具栏样式","Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.":"样式有毛玻璃,简约和默认风格选择。请点击下面或者状态栏菜单中的刷新按钮生效。","Editing Toolbar position":"工具栏位置","Choose between fixed position or cursor following mode.":"在固定位置,光标跟随模式或者置顶模式之间进行选择。","Editing Toolbar columns":"工具栏栏目数","Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.":"选择在Editing Toolbar上显示的每行的列数。","Editing Toolbar refresh":"刷新工具栏","Editing Toolbar commands":"在工具栏中添加命令","Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.":"从Obsidian的命令库中添加一个命令到工具栏。要重新排列命令可以拖放命令项。要删除它们请使用命令项右边的删除按钮。图标选择Custom可以自定义图标","Format Brush Off!":"关闭格式刷!","Hide & Show":"隐藏 & 显示","Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.":"对外观的更改生效需要使用刷新按钮。如果你忘记在设置中刷新,在状态栏菜单中也有一个刷新按钮。","Font-Color formatting brush ON!":"字体颜色格式刷开启\n点击鼠标中键或者右键关闭格式刷",More:"更多","Font Colors":"字体颜色","Format Brush":"格式刷","Background color":"背景颜色",Refresh:"刷新",Add:"添加",Delete:"删除","Change Command name":"更改命令名称","Add submenu":"添加子菜单","add hr":"添加分割线","Enter the icon code, it looks like <svg>.... </svg> format":"输入图标代码,类似<svg>.... </svg>格式","Please enter a new name":"请输入新名称:","Drag the slider to move the position":"拖动滑块来移动位置","Plugin Settings":"插件设置","Background-color formatting brush ON!":"开启背景色格式刷","Clear formatting brush ON!":"清除格式刷已开启","Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush":"清除格式刷已开启\n点击鼠标中键或者右键关闭格式刷","The toolbar is displayed when the mouse moves over it, otherwise it is automatically hidden":"当鼠标移到工具栏上方时,工具栏显示,否则自动隐藏","Editing Toolbar Auto-hide":"工具栏是否自动隐藏","Custom Backgroud Color":"设置自定义背景色","Custom Font Color":"设置自定义字体颜色","🎨 Set custom background":"🎨 设置自定义背景","🖌️ Set custom font color":"🖌️ 设置自定义字体颜色","Click on the picker to adjust the colour":"点击选取器来调整颜色","Mobile enabled or not":"是否在移动端启用","Whether to enable on mobile devices with device width less than 768px, the default is disable.":"是否在设备宽度小于768的移动设备启用。默认不启用"},"zh-tw":{}}[e.moment.locale()];function u(e){return d&&d[e]||c[e]}class h extends e.FuzzySuggestModal{constructor(e,t,o=!1){super(e.app),this.plugin=e,this.command=t,this.issub=o,this.setPlaceholder("Choose an icon")}capitalJoin(e){return e.split(" ").map((e=>e[0].toUpperCase()+e.substring(1))).join(" ")}getItems(){return a}getItemText(e){return this.capitalJoin(e.replace("feather-","").replace("remix-","").replace("bx-","").replace(/([A-Z])/g," $1").trim().replace(/-/gi," "))}renderSuggestion(t,o){const n=createSpan({cls:"cMenuToolbarIconPick"});o.appendChild(n),e.setIcon(n,t.item),super.renderSuggestion(t,o)}onChooseItem(e){return t(this,void 0,void 0,(function*(){if("Custom"===e)new g(this.app,this.plugin,this.command,this.issub).open();else{if(this.command.icon){let t=i(this.plugin,this.command,this.issub);this.issub?this.plugin.settings.menuCommands[t.index].SubmenuCommands[t.subindex].icon=e:this.plugin.settings.menuCommands[t.index].icon=e}else this.command.icon=e,this.plugin.settings.menuCommands.push(this.command);yield this.plugin.saveSettings(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log(`%cCommand '${this.command.name}' was added to cMenuToolbar`,"color: Violet")}}))}}class p extends e.FuzzySuggestModal{constructor(e){super(e.app),this.plugin=e,this.app,this.setPlaceholder("Choose a command")}getItems(){return app.commands.listCommands()}getItemText(e){return e.name}onChooseItem(o){return t(this,void 0,void 0,(function*(){this.plugin.settings.menuCommands.findIndex((e=>e.id==o.id))>-1?new e.Notice("The command"+o.name+"already exists",3e3):o.icon?(this.plugin.settings.menuCommands.push(o),yield this.plugin.saveSettings(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log(`%cCommand '${o.name}' was added to cMenuToolbar`,"color: Violet")):new h(this.plugin,o,!1).open()}))}}class g extends e.Modal{constructor(e,t,o,n){super(t.app),this.plugin=t,this.item=o,this.issub=n,this.containerEl.addClass("cMenuToolbar-Modal"),this.containerEl.addClass("customicon")}onOpen(){var o;const{contentEl:n}=this;n.createEl("b",{text:u("Enter the icon code, it looks like <svg>.... </svg> format")});const a=new e.TextAreaComponent(n);a.inputEl.classList.add("wideInputPromptInputEl"),a.setPlaceholder("").setValue(null!==(o=this.item.icon)&&void 0!==o?o:"").onChange(e.debounce((e=>t(this,void 0,void 0,(function*(){this.item.icon=e;let t=i(this.plugin,this.item,this.issub);if(this.issub){let o=t.subindex;-1===o?this.plugin.settings.menuCommands[t.index].SubmenuCommands.push(this.item):this.plugin.settings.menuCommands[t.index].SubmenuCommands[o].icon=e}else{let e=t.index;-1===e?this.plugin.settings.menuCommands.push(this.item):this.plugin.settings.menuCommands[e].icon=this.item.icon}yield this.plugin.saveSettings()}))),100,!0)).inputEl.addEventListener("keydown",this.submitEnterCallback)}onClose(){const{contentEl:e}=this;e.empty(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}}class m extends e.Modal{constructor(e,t,o,n){super(t.app),this.plugin=t,this.item=o,this.issub=n,this.containerEl.addClass("cMenuToolbar-Modal"),this.containerEl.addClass("changename")}onOpen(){var o;const{contentEl:n}=this;n.createEl("b",{text:u("Please enter a new name")});const a=new e.TextComponent(n);a.inputEl.classList.add("InputPromptInputEl"),a.setPlaceholder("").setValue(null!==(o=this.item.name)&&void 0!==o?o:"").onChange(e.debounce((e=>t(this,void 0,void 0,(function*(){let t=i(this.plugin,this.item,this.issub);if(this.item.name=e,this.issub){let o=t.subindex;-1===o?this.plugin.settings.menuCommands[t.index].SubmenuCommands.push(this.item):this.plugin.settings.menuCommands[t.index].SubmenuCommands[o].name=e}else{let e=t.index;-1===e?this.plugin.settings.menuCommands.push(this.item):this.plugin.settings.menuCommands[e].name=this.item.name}yield this.plugin.saveSettings()}))),100,!0)).inputEl.addEventListener("keydown",this.submitEnterCallback)}onClose(){const{contentEl:e}=this;e.empty(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}}class f extends e.Modal{constructor(e,t){super(t.app),this.plugin=t,this.containerEl.addClass("cMenuToolbar-Modal")}onOpen(){const{contentEl:o}=this;if(o.createEl("p",{text:u("Drag the slider to move the position")}),"top"==this.plugin.settings.positionStyle){let n=5*(this.plugin.settings.cMenuBottomValue-4.25);new e.SliderComponent(o).setLimits(0,80,.5).setValue(n).onChange(e.debounce((e=>t(this,void 0,void 0,(function*(){console.log(`%c${e}px`,"color: Violet"),this.plugin.settings.cMenuBottomValue=e/5+4.25,s(this.plugin.settings),yield this.plugin.saveSettings(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))),100,!0)).setDynamicTooltip()}else new e.SliderComponent(o).setLimits(2,18,.25).setValue(this.plugin.settings.cMenuBottomValue).onChange(e.debounce((e=>t(this,void 0,void 0,(function*(){console.log(`%c${e}em`,"color: Violet"),this.plugin.settings.cMenuBottomValue=e,s(this.plugin.settings),yield this.plugin.saveSettings(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))),100,!0)).setDynamicTooltip()}onClose(){const{contentEl:e}=this;e.empty()}}const b=["body","workspace"],v=["glass","default","tiny"],y=["fixed","following","top"],w={aestheticStyle:"default",positionStyle:"top",menuCommands:[{id:"editing-toolbar:editor-undo",name:"undo editor",icon:"undo-glyph"},{id:"editing-toolbar:editor-redo",name:"redo editor",icon:"redo-glyph"},{id:"editing-toolbar:format-eraser",name:"Clear text formatting",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M889 512 l-211 211 q-26 27 -61 36 q-35 9 -70 0 q-35 -9 -61 -36 l-351 -350 q-26 -27 -35.5 -62 q-9.5 -35 0 -70 q9.5 -35 35.5 -61 l170 -170 q12 -12 29 -12 l215 0 q17 0 29 12 l311 310 q26 26 35.5 61 q9.5 35 0 70 q-9.5 35 -35.5 61 ZM831 453 q15 -15 15.5 -36.5 q0.5 -21.5 -14.5 -37.5 l-300 -298 l-181 0 l-158 158 q-15 15 -15 37 q0 22 15 38 l351 351 q16 16 38 16 q22 0 37 -16 l212 -212 ZM686 217 l-59 -59 l-317 315 l58 59 l318 -315 ZM883 81 q18 0 30.5 -12 q12.5 -12 12.5 -29 q0 -17 -12.5 -29 q-12.5 -12 -29.5 -13 l-456 0 q-17 0 -29.5 12 q-12.5 12 -12.5 29 q0 17 12 29 q12 12 29 13 l456 0 Z"></path></g></svg>'},{id:"editing-toolbar:header2-text",name:"Header 2",icon:"header-2"},{id:"editing-toolbar:header3-text",name:"Header 3",icon:"header-3"},{id:"SubmenuCommands-header",name:"submenu",icon:"header-n",SubmenuCommands:[{id:"editing-toolbar:header1-text",name:"Header 1",icon:"header-1"},{id:"editing-toolbar:header4-text",name:"Header 4",icon:"header-4"},{id:"editing-toolbar:header5-text",name:"Header 5",icon:"header-5"},{id:"editing-toolbar:header6-text",name:"Header 6",icon:"header-6"}]},{id:"editing-toolbar:editor:toggle-bold",name:"Toggle bold",icon:"bold-glyph"},{id:"editing-toolbar:editor:toggle-italics",name:"Toggle italics",icon:"italic-glyph"},{id:"editing-toolbar:editor:toggle-strikethrough",name:"Toggle strikethrough",icon:"strikethrough-glyph"},{id:"editing-toolbar:underline",name:"Toggle underline",icon:"underline-glyph"},{id:"editor:toggle-highlight",name:"==Toggle highlight ==",icon:"highlight-glyph"},{id:"SubmenuCommands-lucdf3en5",name:"submenu",icon:"edit",SubmenuCommands:[{id:"editing-toolbar:editor-copy",name:" copy ",icon:"lucide-copy"},{id:"editing-toolbar:editor-cut",name:" cut ",icon:"lucide-scissors"},{id:"editing-toolbar:editor-paste",name:"paste ",icon:"lucide-clipboard-type"},{id:"editing-toolbar:editor:swap-line-down",name:"swap line down",icon:"lucide-corner-right-down"},{id:"editing-toolbar:editor:swap-line-up",name:"swap line up",icon:"lucide-corner-right-up"}]},{id:"editing-toolbar:editor:attach-file",name:"upload attach file",icon:"lucide-paperclip"},{id:"editing-toolbar:editor:insert-table",name:"Toggle table",icon:"lucide-table"},{id:"editing-toolbar:editor:cycle-list-checklist",name:"Toggle cycle list checklist",icon:"check-circle"},{id:"SubmenuCommands-luc8efull",name:"submenu",icon:"message-square",SubmenuCommands:[{id:"editing-toolbar:editor:toggle-blockquote",name:"Toggle blockquote",icon:"lucide-text-quote"},{id:"editing-toolbar:editor:insert-callout",name:"Toggle Callout ",icon:"lucide-quote"}]},{id:"SubmenuCommands-mdcmder",name:"submenu",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M464 608 l0 -568 q0 -3 -2.5 -5.5 q-2.5 -2.5 -5.5 -2.5 l-80 0 q-3 0 -5.5 2.5 q-2.5 2.5 -2.5 5.5 l0 568 l-232 0 q-3 0 -5.5 2.5 q-2.5 2.5 -2.5 5.5 l0 80 q0 3 2.5 5.5 q2.5 2.5 5.5 2.5 l560 0 q3 0 5.5 -2.5 q2.5 -2.5 2.5 -5.5 l0 -80 q0 -3 -2.5 -5.5 q-2.5 -2.5 -5.5 -2.5 l-232 0 ZM864 696 q17 0 28.5 11.5 q11.5 11.5 11.5 28.5 q0 17 -11.5 28.5 q-11.5 11.5 -28.5 11.5 q-17 0 -28.5 -11.5 q-11.5 -11.5 -11.5 -28.5 q0 -17 11.5 -28.5 q11.5 -11.5 28.5 -11.5 ZM864 640 q-40 0 -68 28 q-28 28 -28 68 q0 40 28 68 q28 28 68 28 q40 0 68 -28 q28 -28 28 -68 q0 -40 -28 -68 q-28 -28 -68 -28 ZM576 322 l0 -63 q0 -3 2 -5 l89 -70 l-89 -70 q-2 -2 -2 -5 l0 -63 q0 -4 3.5 -5.5 q3.5 -1.5 6.5 0.5 l170 133 q4 3 4.5 8.5 q0.5 5.5 -2.5 9.5 l-2 2 l-170 133 q-3 2 -6.5 0.5 q-3.5 -1.5 -3.5 -5.5 ZM256 322 l0 -63 q0 -3 -2 -5 l-89 -70 l89 -70 q2 -2 2 -5 l0 -63 q0 -4 -3.5 -5.5 q-3.5 -1.5 -6.5 0.5 l-170 133 q-4 3 -4.5 8.5 q-0.5 5.5 2.5 9.5 l2 2 l170 133 q3 2 6.5 0.5 q3.5 -1.5 3.5 -5.5 Z"></path></g></svg>',SubmenuCommands:[{id:"editing-toolbar:superscript",name:"Toggle superscript",icon:"superscript-glyph"},{id:"editing-toolbar:subscript",name:"Toggle subscript",icon:"subscript-glyph"},{id:"editing-toolbar:editor:toggle-code",name:"inline code",icon:"code-glyph"},{id:"editing-toolbar:codeblock",name:"Toggle codeblock",icon:"codeblock-glyph"},{id:"editing-toolbar:editor:insert-wikilink",name:"insert wikilink [[]]",icon:'<svg width="15" height="15" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M306 134 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 7 q0 -8 -5 -8 l-45 0 q-5 0 -5 8 l0 784 q0 8 5 8 l45 0 q5 0 5 -8 q0 8 1 8 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 -623 q0 8 1 8 ZM139 134 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 7 q0 -8 -5 -8 l-45 0 q-5 0 -5 8 l0 784 q0 8 5 8 l45 0 q5 0 5 -8 q0 8 1 8 l91 0 q1 0 1 -8 l0 -80 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 -623 q0 8 1 8 ZM711 134 q1 0 1 -8 l0 623 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 q1 0 1 -8 q0 8 4 8 l46 0 q4 0 4 -8 l0 -784 q0 -8 -4 -8 l-46 0 q-4 0 -4 8 q0 -7 -1 -7 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 ZM878 134 q1 0 1 -8 l0 623 q0 -8 -1 -8 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 q1 0 1 -8 q0 8 5 8 l45 0 q4 0 4 -8 l0 -784 q0 -8 -4 -8 l-45 0 q-5 0 -5 8 q0 -7 -1 -7 l-91 0 q-1 0 -1 8 l0 80 q0 8 1 8 l91 0 Z"></path></g></svg>'},{id:"editing-toolbar:editor:insert-embed",name:"insert embed ![[]]",icon:"note-glyph"},{id:"editing-toolbar:editor:insert-link",name:"insert link []()",icon:"link-glyph"},{id:"editing-toolbar:hrline",name:"Horizontal divider",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M912 424 l0 -80 q0 -3 -2.5 -5.5 q-2.5 -2.5 -5.5 -2.5 l-784 0 q-3 0 -5.5 2.5 q-2.5 2.5 -2.5 5.5 l0 80 q0 3 2.5 5.5 q2.5 2.5 5.5 2.5 l784 0 q3 0 5.5 -2.5 q2.5 -2.5 2.5 -5.5 Z"></path></g></svg>'},{id:"editing-toolbar:editor:toggle-inline-math",name:"Toggle inline math",icon:"lucide-sigma"},{id:"editing-toolbar:editor:insert-mathblock",name:"Toggle MathBlock",icon:"lucide-sigma-square"}]},{id:"SubmenuCommands-list",name:"submenu-list",icon:"bullet-list-glyph",SubmenuCommands:[{id:"editing-toolbar:editor:toggle-checklist-status",name:"checklist",icon:"checkbox-glyph"},{id:"editor:toggle-numbered-list",name:"numbered list",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M860 424 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-457 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l457 0 ZM860 756 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-457 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l457 0 ZM860 92 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-457 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l457 0 ZM264 136 l-3 -3 l-51 -57 l56 0 q14 0 24.5 -10 q10.5 -10 11.5 -25 l0 -1 q0 -15 -10.5 -25.5 q-10.5 -10.5 -24.5 -10.5 l-137 0 q-15 0 -25 10 q-10 10 -11 24.5 q-1 14.5 9 25.5 l63 70 l49 54 q7 7 7 16.5 q0 9.5 -7.5 16.5 q-7.5 7 -18.5 7 q-11 0 -18.5 -6.5 q-7.5 -6.5 -8.5 -16.5 l0 0 q0 -15 -10.5 -25.5 q-10.5 -10.5 -25.5 -10.5 q-15 0 -25.5 10.5 q-10.5 10.5 -10.5 25.5 q0 26 13.5 47.5 q13.5 21.5 36 34.5 q22.5 13 49 13 q26.5 0 49.5 -13 q23 -13 36 -34.5 q13 -21.5 13 -47.5 q0 -20 -7.5 -37.5 q-7.5 -17.5 -21.5 -30.5 l-1 -1 ZM173 794 q11 11 25 10.5 q14 -0.5 24.5 -10.5 q10.5 -10 10.5 -25 l0 -293 q0 -15 -10 -25.5 q-10 -10.5 -25 -10.5 q-15 0 -25.5 10 q-10.5 10 -11.5 25 l0 211 q-10 -8 -23.5 -7 q-13.5 1 -22.5 11 l-1 0 q-10 11 -9.5 25.5 q0.5 14.5 10.5 24.5 l58 54 Z"></path></g></svg>'},{id:"editor:toggle-bullet-list",name:"bullet list",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M860 424 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-477 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l477 0 ZM860 756 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-477 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l477 0 ZM860 92 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-477 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l477 0 ZM176 716 l0 0 ZM112 716 q0 -27 18.5 -45.5 q18.5 -18.5 45.5 -18.5 q27 0 45.5 18.5 q18.5 18.5 18.5 45.5 q0 27 -18.5 45.5 q-18.5 18.5 -45.5 18.5 q-27 0 -45.5 -18.5 q-18.5 -18.5 -18.5 -45.5 ZM176 384 l0 0 ZM112 384 q0 -27 18.5 -45.5 q18.5 -18.5 45.5 -18.5 q27 0 45.5 18.5 q18.5 18.5 18.5 45.5 q0 27 -18.5 45.5 q-18.5 18.5 -45.5 18.5 q-27 0 -45.5 -18.5 q-18.5 -18.5 -18.5 -45.5 ZM176 52 l0 0 ZM112 52 q0 -27 18.5 -45.5 q18.5 -18.5 45.5 -18.5 q27 0 45.5 18.5 q18.5 18.5 18.5 45.5 q0 27 -18.5 45.5 q-18.5 18.5 -45.5 18.5 q-27 0 -45.5 -18.5 q-18.5 -18.5 -18.5 -45.5 Z"></path></g></svg>'},{id:"editing-toolbar:undent-list",name:"unindent-list",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M872 302 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 542 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 784 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM872 62 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM244 534 l-123 -122 q-8 -7 -8 -18 q0 -11 8 -18 l123 -122 q8 -7 19 -7 q11 0 18.5 7.5 q7.5 7.5 7.5 18.5 l0 242 q0 11 -7.5 18.5 q-7.5 7.5 -18.5 7.5 q-11 0 -19 -7 Z"></path></g></svg>'},{id:"editing-toolbar:indent-list",name:"indent list",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M872 302 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 542 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-429 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l429 0 ZM872 784 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM872 62 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM158 534 l124 -122 q7 -7 7 -18 q0 -11 -7 -18 l-124 -122 q-7 -7 -18 -7 q-11 0 -19 7.5 q-8 7.5 -8 18.5 l0 242 q0 11 8 18.5 q8 7.5 19 7.5 q11 0 18 -7 Z"></path></g></svg>'}]},{id:"SubmenuCommands-aligin",name:"submenu-aligin",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M724 304 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 540 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM724 776 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 68 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 Z"></path></g></svg>',SubmenuCommands:[{id:"editing-toolbar:justify",name:'<p aligin="justify"></p>',icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M112 736 l0 0 ZM120 736 l784 0 q8 0 8 -8 l0 -80 q0 -8 -8 -8 l-784 0 q-8 0 -8 8 l0 80 q0 8 8 8 ZM112 331 l0 0 ZM120 331 l784 0 q8 0 8 -8 l0 -80 q0 -8 -8 -8 l-784 0 q-8 0 -8 8 l0 80 q0 8 8 8 ZM112 128 l0 0 ZM120 128 l784 0 q8 0 8 -8 l0 -80 q0 -8 -8 -8 l-784 0 q-8 0 -8 8 l0 80 q0 8 8 8 ZM112 533 l0 0 ZM120 533 l784 0 q8 0 8 -8 l0 -80 q0 -8 -8 -8 l-784 0 q-8 0 -8 8 l0 80 q0 8 8 8 Z"></path></g></svg>'},{id:"editing-toolbar:left",name:'<p aligin="left"></p>',icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M572 304 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 540 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM572 776 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 68 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 Z"></path></g></svg>'},{id:"editing-toolbar:center",name:"<center>",icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M724 304 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 540 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM724 776 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 68 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 Z"></path></g></svg>'},{id:"editing-toolbar:right",name:'<p aligin="right"></p>',icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M872 304 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 540 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 ZM872 776 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-421 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l421 0 ZM872 68 q17 0 28.5 -11.5 q11.5 -11.5 11.5 -28 q0 -16.5 -11.5 -28.5 q-11.5 -12 -27.5 -12 l-721 0 q-17 0 -28.5 11.5 q-11.5 11.5 -11.5 28 q0 16.5 11.5 28.5 q11.5 12 27.5 12 l721 0 Z"></path></g></svg>'}]},{id:"editing-toolbar:change-font-color",name:"Change font color[html]",icon:'<svg width="24" height="24" focusable="false" fill="currentColor"><g fill-rule="evenodd"><path id="change-font-color-icon" d="M3 18h18v3H3z" style="fill:#2DC26B"></path><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"></path></g></svg>'},{id:"editing-toolbar:change-background-color",name:"Change Backgroundcolor[html]",icon:'<svg width="18" height="24" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd"><g ><g fill="currentColor"><g transform="translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)" ><path d="M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z" fill-rule="nonzero"></path><path d="M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z" fill-rule="evenodd"></path><path d="M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z" fill-rule="nonzero"></path></g></g><path d="M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z" id="change-background-color-icon" style="fill:#FA541C"></path></g></g></svg>'},{id:"editing-toolbar:fullscreen-focus",name:"Fullscreen focus mode",icon:"fullscreen"},{id:"editing-toolbar:workplace-fullscreen-focus",name:"workplace-Fullscreen ",icon:"exit-fullscreen"}],appendMethod:"workspace",shouldShowMenuOnSelect:!1,cMenuVisibility:!0,cMenuBottomValue:4.25,cMenuNumRows:12,cMenuWidth:610,cMenuFontColor:"#2DC26B",cMenuBackgroundColor:"#d3f8b6",autohide:!1,custom_bg1:"#FFB78B8C",custom_bg2:"#CDF4698C",custom_bg3:"#A0CCF68C",custom_bg4:"#F0A7D88C",custom_bg5:"#ADEFEF8C",custom_fc1:"#D83931",custom_fc2:"#DE7802",custom_fc3:"#245BDB",custom_fc4:"#6425D0",custom_fc5:"#646A73",isLoadOnMobile:!1};let C;function k(){C=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;const t=C.getElementById("cMenuToolbarModalBar");t&&t.remove();const o=function(){const t=[];t.push(app.workspace.rootSplit);const o=app.workspace.floatingSplit;return null==o||o.children.forEach((o=>{o instanceof e.WorkspaceWindow&&t.push(o)})),t}();o&&o.forEach((e=>{(null==e?void 0:e.containerEl)&&(e=>{let t=e.querySelectorAll("#cMenuToolbarModalBar"),o=e.querySelectorAll("#cMenuToolbarPopoverBar");t.forEach((e=>{e&&(e.firstChild&&e.removeChild(e.firstChild),e.remove())})),o.forEach((e=>{e&&(e.firstChild&&e.removeChild(e.firstChild),e.remove())}))})(null==e?void 0:e.containerEl)}))}function q(t,o){var n,i;C=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let a="top"==o.positionStyle?null===(i=null===(n=t.workspace.activeLeaf)||void 0===n?void 0:n.view.containerEl)||void 0===i?void 0:i.querySelector("#cMenuToolbarModalBar"):C.getElementById("cMenuToolbarModalBar");return a||null}const T=(e,t)=>t.reduce(((e,t)=>e&&"undefined"!==e[t]?e[t]:void 0),e);function M(e,t){return e&&void 0!==e[1][0]?t+e.flat(2).join("+").replace("Mod","Ctrl")+t:t+""+t}function E(e,t,o=!0){let n=e.commands.findCommand(t),i=o?"*":"";if(n){let t=n.hotkeys?[[T(n.hotkeys,[0,"modifiers"])],[T(n.hotkeys,[0,"key"])]]:void 0,o=e.hotkeyManager.customKeys[n.id];var a=o?[[T(o,[0,"modifiers"])],[T(o,[0,"key"])]]:void 0;return a?M(a,i):M(t,"")}return""}function _(t){const o=t.workspace.getActiveViewOfType(e.ItemView);if("markdown"===(null==o?void 0:o.getViewType())||"thino_view"===(null==o?void 0:o.getViewType())){const e=t.workspace.activeLeaf;if(e){const t=e.view;if(t)return"source"===t.getMode()}}return!1}function S(e){return/<[^>]+>/g.test(e)}function x(t,o,n){C=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let i=q(t,o.settings),a=null==i?void 0:i.querySelector("#"+n);if(a){let e=a.rows,i=e.length;for(let a=1;a<i;a++){let i=e[a].cells;for(let e=0;e<i.length;e++)i[e].onclick=function(){let e=this.style.backgroundColor;if(""!=e){if(e=D(e),"x-color-picker-table"==n){o.settings.cMenuFontColor=e,B(t,e),C.querySelectorAll("#change-font-color-icon").forEach((t=>{t.style.fill=e}))}else if("x-backgroundcolor-picker-table"==n){o.settings.cMenuBackgroundColor=e,A(t,e),C.querySelectorAll("#change-background-color-icon").forEach((t=>{t.style.fill=e}))}o.saveSettings()}}}}}function B(e,t){var o;const n=null===(o=e.workspace.activeLeaf.view)||void 0===o?void 0:o.editor;let i=n.getSelection(),a=/^\<font color=[0-9a-zA-Z#]+[^\<\>]*\>([^\<\>]+)\<\/font\>$/,l='<font color="'+t+'">$1</font>';/\<font color=[^\<]*$|^[^\>]*font\>/g.test(i)||(/\<font color=[0-9a-zA-Z#]+[^\<\>]*\>[^\<\>]+\<\/font\>/g.test(i)?a.test(i)?(i=i.replace(/<font color="[^"]+">|<\/font>/g,""),i=i.replace(a,l)):i=i.replace(/\<font color=[0-9a-zA-Z#]+[^\<\>]*?\>|\<\/font\>/g,""):(i=i.replace(/<font color=["'#0-9a-zA-Z]+>[^<]+<\/font>/g,""),i=i.replace(/^(.+)$/gm,l)),n.replaceSelection(i),n.exec("goRight"),e.commands.executeCommandById("editor:focus"))}function A(e,t){var o;const n=null===(o=e.workspace.activeLeaf.view)||void 0===o?void 0:o.editor;let i=n.getSelection(),a=/^\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>([^\<\>]+)\<\/span\>$/,l='<span style="background:'+t+'">$1</span>';/\<span style=[^\<]*$|^[^\>]*span\>/g.test(i)||(i=/\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>[^\<\>]+\<\/span\>/g.test(i)?a.test(i)?i.replace(a,l):i.replace(/\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>|\<\/span\>/g,""):i.replace(/^(.+)$/gm,l),n.replaceSelection(i),n.exec("goRight"),e.commands.executeCommandById("editor:focus"))}const D=function(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(","),o="#";for(let t=0;t<e.length;t++){let n=Number(e[t]).toString(16);"0"===n&&(n+=n),1==n.length&&(n="0"+n),o+=n}return 7!==o.length&&(o=t),o}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;{let e=t.replace(/#/,"").split("");if(6===e.length)return t;if(3===e.length){let t="#";for(let o=0;o<e.length;o+=1)t+=e[o]+e[o];return t}}};function L(e){e.Temp_Notice&&e.Temp_Notice.hide(),e.setEN_BG_Format_Brush(!1),e.setEN_FontColor_Format_Brush(!1),e.setEN_Text_Format_Brush(!1)}function N(e){var t;const o=null===(t=app.workspace.activeLeaf.view)||void 0===t?void 0:t.editor;let n,i=o.getLine(o.getCursor().line),a="";const l=/^(\>*(\[[!\w]+\])?\s*)#+\s/;let r;const s=i.match(l);s&&(r=s[0].trim()),e==r||""==e?n=i.replace(l,"$1"):(n=i.replace(/^\s*(#*|\>|\-|\d+\.)\s*/m,""),n=e+" "+n),a=""!=n?o.getRange(o.getCursor(),{line:o.getCursor().line,ch:i.length}):o.getRange(o.getCursor(),{line:o.getCursor().line,ch:0}),o.setLine(o.getCursor().line,n),o.setCursor({line:o.getCursor().line,ch:Number(n.length-a.length)})}function I(t,o){var n;const i=null===(n=t.workspace.activeLeaf.view)||void 0===n?void 0:n.editor;let a=i.getSelection();if(null==a||""==a)L(o),o.setEN_Text_Format_Brush(!0),o.Temp_Notice?o.Temp_Notice.noticeEl.innerText!=u("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush")&&(o.Temp_Notice=new e.Notice(u("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"),0)):o.Temp_Notice=new e.Notice(u("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"),0);else{let e=/(^#+\s|^#(?=\s)|^\>|^\- \[( |x)\]|^\+ |\<[^\<\>]+?\>|^1\. |^\s*\- |^\-+$|^\*+$)/gm;a=a.replace(e,""),a=a.replace(/^[ ]+|[ ]+$/gm,""),a=a.replace(/\!?\[\[([^\[\]\|]*\|)*([^\(\)\[\]]+)\]\]/g,"$2"),a=a.replace(/\!?\[+([^\[\]\(\)]+)\]+\(([^\(\)]+)\)/g,"$1"),a=a.replace(/`([^`]+)`/g,"$1"),a=a.replace(/_([^_]+)_/g,"$1"),a=a.replace(/==([^=]+)==/g,"$1"),a=a.replace(/\*\*\*([^\*]+)\*\*\*/g,"$1"),a=a.replace(/\*\*?([^\*]+)\*\*?/g,"$1"),a=a.replace(/~~([^~]+)~~/g,"$1"),i.replaceSelection(a),t.commands.executeCommandById("editor:focus")}}const O=(e,t)=>{var o,n,i,a,l;let r=q(e,t);if(_(e)){if(r){const s=null===(o=e.workspace.activeLeaf.view)||void 0===o?void 0:o.editor;if(r.style.visibility=s.somethingSelected()?"visible":"hidden",r.style.height="tiny"===t.aestheticStyle?"30px":"40px",r.addClass("cMenuToolbarFlex"),r.removeClass("cMenuToolbarGrid"),"visible"===r.style.visibility){const e=s.containerEl.getBoundingClientRect(),t=r.offsetWidth,o=r.offsetHeight,c=(e=>{var t,o,n;let i,a=e.getCursor("head");if(e.getCursor("head").ch!==e.getCursor("from").ch&&(a.ch=Math.max(0,a.ch-1)),e.cursorCoords)i=e.cursorCoords(!0,"window");else{if(!e.coordsAtPos)return;{const l=e.posToOffset(a);i=null!==(n=null===(o=(t=e.cm).coordsAtPos)||void 0===o?void 0:o.call(t,l))&&void 0!==n?n:e.coordsAtPos(l)}}return i})(s),d=s.getCursor("head").ch==s.getCursor("from").ch,u=12,h=(null!==(i=null===(n=C.getElementsByClassName("mod-left-split")[0])||void 0===n?void 0:n.clientWidth)&&void 0!==i?i:0)+(null!==(l=null===(a=C.getElementsByClassName("side-dock-ribbon mod-left")[0])||void 0===a?void 0:a.clientWidth)&&void 0!==l?l:0);let p=c.left-h;p+t+u>=e.right&&(p=Math.max(0,e.right-t-h-u));let g=0;d?(g=c.top-o-10,g<=e.top&&(g=e.top+o)):(g=c.top+25,g>=e.bottom-o&&(g=e.bottom-2*o)),r.style.left=p+"px",r.style.top=g+"px"}}}else r.style.visibility="hidden"};function F(t,o){let n=o.settings;C=e.requireApiVersion("0.15.0")?activeWindow.document:window.document,function(){const i=()=>{var i,a;let l=0,r=0,s=createEl("div");if(s)if("top"==n.positionStyle){let e=5*(n.cMenuBottomValue-4.25);s.setAttribute("style",`position: relative; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));top: ${e}px;`),s.className+=" top",n.autohide&&(s.className+=" autohide")}else s.setAttribute("style",`left: calc(50% - calc(${s.offsetWidth}px / 2)); bottom: ${n.cMenuBottomValue}em; grid-template-columns: ${"1fr ".repeat(n.cMenuNumRows)}`);s.setAttribute("id","cMenuToolbarModalBar");let c=createEl("div");if(c.addClass("cMenuToolbarpopover"),c.addClass("cMenuToolbarTinyAesthetic"),c.setAttribute("id","cMenuToolbarPopoverBar"),c.style.visibility="hidden",c.style.height="0","default"==n.aestheticStyle?(s.addClass("cMenuToolbarDefaultAesthetic"),s.removeClass("cMenuToolbarTinyAesthetic"),s.removeClass("cMenuToolbarGlassAesthetic")):"tiny"==n.aestheticStyle?(s.addClass("cMenuToolbarTinyAesthetic"),s.removeClass("cMenuToolbarDefaultAesthetic"),s.removeClass("cMenuToolbarGlassAesthetic")):(s.addClass("cMenuToolbarGlassAesthetic"),s.removeClass("cMenuToolbarTinyAesthetic"),s.removeClass("cMenuToolbarDefaultAesthetic")),"top"==n.positionStyle){let e=t.workspace.activeLeaf.view.containerEl;if(!(null==e?void 0:e.querySelector("#cMenuToolbarPopoverBar"))){const t=null==e?void 0:e.querySelector(".markdown-source-view");if(!t)return;t.insertAdjacentElement("afterbegin",c)}const o=null==e?void 0:e.querySelector(".markdown-source-view");if(!o)return;o.insertAdjacentElement("afterbegin",s),r=null==e?void 0:e.querySelector(".markdown-source-view").offsetWidth}else"body"==n.appendMethod?C.body.appendChild(s):"workspace"==n.appendMethod&&(null===(i=C.body)||void 0===i||i.querySelector(".mod-vertical.mod-root").insertAdjacentElement("afterbegin",s));let d=null===(a=t.workspace.activeLeaf.view.containerEl)||void 0===a?void 0:a.querySelector("#cMenuToolbarPopoverBar");n.menuCommands.forEach(((i,a)=>{let c;if("SubmenuCommands"in i){let u;l>=r-104&&r>100?(o.setIS_MORE_Button(!0),u=new e.ButtonComponent(d)):u=new e.ButtonComponent(s),u.setClass("cMenuToolbarCommandsubItem"+a),a>=n.cMenuNumRows?u.setClass("cMenuToolbarSecond"):"top"!=n.positionStyle&&u.buttonEl.setAttribute("aria-label-position","top"),S(i.icon)?u.buttonEl.innerHTML=i.icon:u.setIcon(i.icon),l+=28;let h=function(e){let t=createEl("div");return t.addClass(e),t}("subitem");h&&i.SubmenuCommands.forEach((o=>{let i=E(t,o.id);c=""==i?o.name:o.name+"("+i+")";let l=new e.ButtonComponent(h).setTooltip(c).setClass("menu-item").onClick((()=>{t.commands.executeCommandById(o.id),0==n.cMenuVisibility||"following"==n.positionStyle?s.style.visibility="hidden":s.style.visibility="visible"}));a<n.cMenuNumRows&&"top"!=n.positionStyle&&l.buttonEl.setAttribute("aria-label-position","top"),"cMenuToolbar-Divider-Line"==o.id&&l.setClass("cMenuToolbar-Divider-Line"),S(o.icon)?l.buttonEl.innerHTML=o.icon:l.setIcon(o.icon),u.buttonEl.insertAdjacentElement("afterbegin",h)}))}else if("editing-toolbar:change-font-color"==i.id){let a=new e.ButtonComponent(s);a.setClass("cMenuToolbarCommandsubItem-font-color").setTooltip(u("Font Colors")).onClick((()=>{t.commands.executeCommandById(i.id),0==n.cMenuVisibility||"following"==n.positionStyle?s.style.visibility="hidden":s.style.visibility="visible"})),S(i.icon)?a.buttonEl.innerHTML=i.icon:a.setIcon(i.icon),l+=26;let r=createEl("div");if(r.addClass("subitem"),r){r.innerHTML=function(e){return`<div class='x-color-picker-wrapper'>\n<div class='x-color-picker' >\n <table class="x-color-picker-table" id='x-color-picker-table'>\n <tbody>\n <tr>\n <th colspan="10" class="ui-widget-content">Theme Colors</th>\n </tr>\n <tr>\n <td style="background-color:#ffffff"><span></span></td>\n <td style="background-color:#000000"><span></span></td>\n <td style="background-color:#eeece1"><span></span></td>\n <td style="background-color:#1f497d"><span></span></td>\n <td style="background-color:#4f81bd"><span></span></td>\n <td style="background-color:#c0504d"><span></span></td>\n <td style="background-color:#9bbb59"><span></span></td>\n <td style="background-color:#8064a2"><span></span></td>\n <td style="background-color:#4bacc6"><span></span></td>\n <td style="background-color:#f79646"><span></span></td>\n </tr>\n <tr>\n <th colspan="10"></th>\n </tr>\n <tr class="top">\n <td style="background-color:#f2f2f2"><span></span></td>\n <td style="background-color:#7f7f7f"><span></span></td>\n <td style="background-color:#ddd9c3"><span></span></td>\n <td style="background-color:#c6d9f0"><span></span></td>\n <td style="background-color:#dbe5f1"><span></span></td>\n <td style="background-color:#f2dcdb"><span></span></td>\n <td style="background-color:#ebf1dd"><span></span></td>\n <td style="background-color:#e5e0ec"><span></span></td>\n <td style="background-color:#dbeef3"><span></span></td>\n <td style="background-color:#fdeada"><span></span></td>\n </tr>\n <tr class="in">\n <td style="background-color:#d8d8d8"><span></span></td>\n <td style="background-color:#595959"><span></span></td>\n <td style="background-color:#c4bd97"><span></span></td>\n <td style="background-color:#8db3e2"><span></span></td>\n <td style="background-color:#b8cce4"><span></span></td>\n <td style="background-color:#e5b9b7"><span></span></td>\n <td style="background-color:#d7e3bc"><span></span></td>\n <td style="background-color:#ccc1d9"><span></span></td>\n <td style="background-color:#b7dde8"><span></span></td>\n <td style="background-color:#fbd5b5"><span></span></td>\n </tr>\n <tr class="in">\n <td style="background-color:#bfbfbf"><span></span></td>\n <td style="background-color:#3f3f3f"><span></span></td>\n <td style="background-color:#938953"><span></span></td>\n <td style="background-color:#548dd4"><span></span></td>\n <td style="background-color:#95b3d7"><span></span></td>\n <td style="background-color:#d99694"><span></span></td>\n <td style="background-color:#c3d69b"><span></span></td>\n <td style="background-color:#b2a2c7"><span></span></td>\n <td style="background-color:#92cddc"><span></span></td>\n <td style="background-color:#fac08f"><span></span></td>\n </tr>\n <tr class="in">\n <td style="background-color:#a5a5a5"><span></span></td>\n <td style="background-color:#262626"><span></span></td>\n <td style="background-color:#494429"><span></span></td>\n <td style="background-color:#17365d"><span></span></td>\n <td style="background-color:#366092"><span></span></td>\n <td style="background-color:#953734"><span></span></td>\n <td style="background-color:#76923c"><span></span></td>\n <td style="background-color:#5f497a"><span></span></td>\n <td style="background-color:#31859b"><span></span></td>\n <td style="background-color:#e36c09"><span></span></td>\n </tr>\n <tr class="bottom">\n <td style="background-color:#7f7f7f"><span></span></td>\n <td style="background-color:#0c0c0c"><span></span></td>\n <td style="background-color:#1d1b10"><span></span></td>\n <td style="background-color:#0f243e"><span></span></td>\n <td style="background-color:#244061"><span></span></td>\n <td style="background-color:#632423"><span></span></td>\n <td style="background-color:#4f6128"><span></span></td>\n <td style="background-color:#3f3151"><span></span></td>\n <td style="background-color:#205867"><span></span></td>\n <td style="background-color:#974806"><span></span></td>\n </tr>\n <tr>\n <th colspan="10"></th>\n </tr>\n <tr>\n <th colspan="10" class="ui-widget-content">Standard Colors</th>\n </tr>\n <tr>\n <td style="background-color:#c00000"><span></span></td>\n <td style="background-color:#ff0000"><span></span></td>\n <td style="background-color:#ffc000"><span></span></td>\n <td style="background-color:#ffff00"><span></span></td>\n <td style="background-color:#92d050"><span></span></td>\n <td style="background-color:#00b050"><span></span></td>\n <td style="background-color:#00b0f0"><span></span></td>\n <td style="background-color:#0070c0"><span></span></td>\n <td style="background-color:#002060"><span></span></td>\n <td style="background-color:#7030a0"><span></span></td>\n </tr>\n <tr>\n <th colspan="10" class="ui-widget-content">Custom Font Colors</th>\n </tr>\n <tr>\n <td style="background-color:${e.settings.custom_fc1}"><span></span></td>\n <td style="background-color:${e.settings.custom_fc2}"><span></span></td>\n <td style="background-color:${e.settings.custom_fc3}"><span></span></td>\n <td style="background-color:${e.settings.custom_fc4}"><span></span></td>\n <td style="background-color:${e.settings.custom_fc5}"><span></span></td>\n </tr>\n </tbody>\n </table>\n</div>\n</div>`}(o),a.buttonEl.insertAdjacentElement("afterbegin",r),x(t,o,"x-color-picker-table");let n=r.querySelector(".x-color-picker-wrapper");new e.ButtonComponent(n).setIcon("paintbrush").setTooltip(u("Format Brush")).onClick((()=>{L(o),o.setEN_FontColor_Format_Brush(!0),o.Temp_Notice=new e.Notice(u("Font-Color formatting brush ON!"),0)})),new e.ButtonComponent(n).setIcon("palette").setTooltip(u("Custom Font Color")).onClick((()=>{t.setting.open(),t.setting.openTabById("editing-toolbar"),setTimeout((()=>{var e;let o=t.setting.activeTab.containerEl.querySelector(".custom_font");o&&(null===(e=o.addClass)||void 0===e||e.call(o,"toolbar-cta"))}),200)}))}}else if("editing-toolbar:change-background-color"==i.id){let a=new e.ButtonComponent(s);a.setClass("cMenuToolbarCommandsubItem-font-color").setTooltip(u("Background color")).onClick((()=>{t.commands.executeCommandById(i.id),0==n.cMenuVisibility||"following"==n.positionStyle?s.style.visibility="hidden":s.style.visibility="visible"})),S(i.icon)?a.buttonEl.innerHTML=i.icon:a.setIcon(i.icon),l+=26;let r=createEl("div");if(r.addClass("subitem"),r){r.innerHTML=function(e){return`<div class='x-color-picker-wrapper'>\n<div class='x-color-picker' >\n <table class="x-color-picker-table" id='x-backgroundcolor-picker-table'>\n <tbody>\n <tr>\n <th colspan="5" class="ui-widget-content">Translucent Colors</th>\n </tr>\n <tr class="top">\n <td style="background-color:rgba(140, 140, 140, 0.12)"><span></span></td>\n <td style="background-color:rgba(92, 92, 92, 0.2)"><span></span></td>\n <td style="background-color:rgba(163, 67, 31, 0.2)"><span></span></td>\n <td style="background-color:rgba(240, 107, 5, 0.2)"><span></span></td>\n <td style="background-color:rgba(240, 200, 0, 0.2)"><span></span></td>\n </tr>\n <tr class="bottom">\n <td style="background-color:rgba(3, 135, 102, 0.2)"><span></span></td>\n <td style="background-color:rgba(3, 135, 102, 0.2)"><span></span></td>\n <td style="background-color:rgba(5, 117, 197, 0.2)"><span></span></td>\n <td style="background-color:rgba(74, 82, 199, 0.2)"><span></span></td>\n <td style="background-color:rgba(136, 49, 204, 0.2)"><span></span></td>\n </tr>\n\n <tr>\n <th colspan="5" class="ui-widget-content">Highlighter Colors</th>\n </tr>\n \n <tr class="top">\n <td style="background-color:rgb(255, 248, 143)"><span></span></td>\n <td style="background-color:rgb(211, 248, 182)"><span></span></td>\n <td style="background-color:rgb(175, 250, 209)"><span></span></td>\n <td style="background-color:rgb(177, 255, 255)"><span></span></td>\n <td style="background-color:rgb(253, 191, 255)"><span></span></td>\n </tr>\n <tr class="bottom">\n <td style="background-color:rgb(210, 203, 255);"><span></span></td>\n <td style="background-color:rgb(64, 169, 255);"><span></span></td>\n <td style="background-color:rgb(255, 77, 79);"><span></span></td>\n <td style="background-color:rgb(212, 177, 6);"><span></span></td>\n <td style="background-color:rgb(146, 84, 222);"><span></span></td>\n </tr>\n <tr>\n <th colspan="5" class="ui-widget-content">Custom Colors</th>\n </tr>\n <tr class="bottom">\n <td style="background-color: ${e.settings.custom_bg1};"><span></span></td>\n <td style="background-color:${e.settings.custom_bg2};"><span></span></td>\n <td style="background-color:${e.settings.custom_bg3};"><span></span></td>\n <td style="background-color:${e.settings.custom_bg4};"><span></span></td>\n <td style="background-color:${e.settings.custom_bg5};"><span></span></td>\n </tr>\n </tbody>\n </table>\n</div>\n</div>`}(o),a.buttonEl.insertAdjacentElement("afterbegin",r),x(t,o,"x-backgroundcolor-picker-table");let n=r.querySelector(".x-color-picker-wrapper");new e.ButtonComponent(n).setIcon("paintbrush").setTooltip(u("Format Brush")).onClick((()=>{L(o),o.setEN_BG_Format_Brush(!0),o.Temp_Notice=new e.Notice(u("Font-Color formatting brush ON!"),0)})),new e.ButtonComponent(n).setIcon("palette").setTooltip(u("Custom Backgroud Color")).onClick((()=>{t.setting.open(),t.setting.openTabById("editing-toolbar"),setTimeout((()=>{var e;let o=t.setting.activeTab.containerEl.querySelector(".custom_bg");o&&(null===(e=o.addClass)||void 0===e||e.call(o,"toolbar-cta"))}),200)}))}}else{let u;l>=r-104&&r>100?(o.setIS_MORE_Button(!0),u=new e.ButtonComponent(d)):u=new e.ButtonComponent(s);let h=E(t,i.id);c=""==h?i.name:i.name+"("+h+")",u.setTooltip(c).onClick((()=>{t.commands.executeCommandById(i.id),0==n.cMenuVisibility||"following"==n.positionStyle?s.style.visibility="hidden":s.style.visibility="visible"})),u.setClass("cMenuToolbarCommandItem"),a>=n.cMenuNumRows?u.setClass("cMenuToolbarSecond"):"top"!=n.positionStyle&&u.buttonEl.setAttribute("aria-label-position","top"),"cMenuToolbar-Divider-Line"==i.id&&u.setClass("cMenuToolbar-Divider-Line"),S(i.icon)?u.buttonEl.innerHTML=i.icon:u.setIcon(i.icon),l+=26}})),function(t,o,n){const i=t.workspace.getActiveViewOfType(e.ItemView);if("markdown"===(null==i?void 0:i.getViewType())||"thino_view"===(null==i?void 0:i.getViewType())){let t=i.containerEl.querySelector("#cMenuToolbarPopoverBar");if(!o.IS_MORE_Button)return;let a=n.createEl("span");a.addClass("more-menu");let l=new e.ButtonComponent(a);l.setClass("cMenuToolbarCommandItem").setTooltip(u("More")).onClick((()=>{"hidden"==t.style.visibility?(t.style.visibility="visible",t.style.height="32px"):(t.style.visibility="hidden",t.style.height="0")})),l.buttonEl.innerHTML='<svg width="14" height="14" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" enable-background="new 0 0 1024 1024" xml:space="preserve"><path fill="#666" d="M510.29 14.13 q17.09 -15.07 40.2 -14.07 q23.12 1 39.2 18.08 l334.66 385.92 q25.12 30.15 34.16 66.83 q9.04 36.68 0.5 73.87 q-8.54 37.19 -32.66 67.34 l-335.67 390.94 q-15.07 18.09 -38.69 20.1 q-23.62 2.01 -41.71 -13.07 q-18.08 -15.08 -20.09 -38.19 q-2.01 -23.12 13.06 -41.21 l334.66 -390.94 q11.06 -13.06 11.56 -29.65 q0.5 -16.58 -10.55 -29.64 l-334.67 -386.92 q-15.07 -17.09 -13.56 -40.7 q1.51 -23.62 19.59 -38.7 ZM81.17 14.13 q17.08 -15.07 40.19 -14.07 q23.11 1 39.2 18.08 l334.66 385.92 q25.12 30.15 34.16 66.83 q9.04 36.68 0.5 73.87 q-8.54 37.19 -32.66 67.34 l-335.67 390.94 q-15.07 18.09 -38.69 20.6 q-23.61 2.51 -41.7 -12.57 q-18.09 -15.08 -20.1 -38.69 q-2.01 -23.62 13.06 -41.71 l334.66 -390.94 q11.06 -13.06 11.56 -29.65 q0.5 -16.58 -10.55 -29.64 l-334.66 -386.92 q-15.08 -17.09 -13.57 -40.7 q1.51 -23.62 19.6 -38.7 Z"/></svg>',o.setIS_MORE_Button(!1)}}(t,o,s),Math.abs(o.settings.cMenuWidth-Number(l))>30&&(o.settings.cMenuWidth=Number(l),setTimeout((()=>{o.saveSettings()}),100))};if(!o.isLoadMobile())return;const a=t.workspace.getActiveViewOfType(e.ItemView);"markdown"!==(null==a?void 0:a.getViewType())&&"thino_view"!==(null==a?void 0:a.getViewType())||q(t,o.settings)||(i(),s(n),function(t,o){C=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let n=C.querySelectorAll("#change-font-color-icon");n&&n.forEach((e=>{e.style.fill=t}));let i=C.querySelectorAll("#change-background-color-icon");i&&i.forEach((e=>{e.style.fill=o}))}
/**!
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/(n.cMenuFontColor,n.cMenuBackgroundColor))}()}function $(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function z(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$(Object(o),!0).forEach((function(t){P(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):$(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function V(e){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(e)}function P(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},H.apply(this,arguments)}function R(e,t){if(null==e)return{};var o,n,i=function(e,t){if(null==e)return{};var o,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function Z(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var j=Z(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),W=Z(/Edge/i),X=Z(/firefox/i),Y=Z(/safari/i)&&!Z(/chrome/i)&&!Z(/android/i),G=Z(/iP(ad|od|hone)/i),U=Z(/chrome/i)&&Z(/android/i),K={capture:!1,passive:!1};function J(e,t,o){e.addEventListener(t,o,!j&&K)}function Q(e,t,o){e.removeEventListener(t,o,!j&&K)}function ee(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function te(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function oe(e,t,o,n){if(e){o=o||document;do{if(null!=t&&(">"===t[0]?e.parentNode===o&&ee(e,t):ee(e,t))||n&&e===o)return e;if(e===o)break}while(e=te(e))}return null}var ne,ie=/\s+/g;function ae(e,t,o){if(e&&t)if(e.classList)e.classList[o?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(ie," ").replace(" "+t+" "," ");e.className=(n+(o?" "+t:"")).replace(ie," ")}}function le(e,t,o){var n=e&&e.style;if(n){if(void 0===o)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(o=e.currentStyle),void 0===t?o:o[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=o+("string"==typeof o?"":"px")}}function re(e,t){var o="";if("string"==typeof e)o=e;else do{var n=le(e,"transform");n&&"none"!==n&&(o=n+" "+o)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(o)}function se(e,t,o){if(e){var n=e.getElementsByTagName(t),i=0,a=n.length;if(o)for(;i<a;i++)o(n[i],i);return n}return[]}function ce(){var e=document.scrollingElement;return e||document.documentElement}function de(e,t,o,n,i){if(e.getBoundingClientRect||e===window){var a,l,r,s,c,d,u;if(e!==window&&e.parentNode&&e!==ce()?(l=(a=e.getBoundingClientRect()).top,r=a.left,s=a.bottom,c=a.right,d=a.height,u=a.width):(l=0,r=0,s=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||o)&&e!==window&&(i=i||e.parentNode,!j))do{if(i&&i.getBoundingClientRect&&("none"!==le(i,"transform")||o&&"static"!==le(i,"position"))){var h=i.getBoundingClientRect();l-=h.top+parseInt(le(i,"border-top-width")),r-=h.left+parseInt(le(i,"border-left-width")),s=l+a.height,c=r+a.width;break}}while(i=i.parentNode);if(n&&e!==window){var p=re(i||e),g=p&&p.a,m=p&&p.d;p&&(s=(l/=m)+(d/=m),c=(r/=g)+(u/=g))}return{top:l,left:r,bottom:s,right:c,width:u,height:d}}}function ue(e,t,o){for(var n=fe(e,!0),i=de(e)[t];n;){var a=de(n)[o];if(!("top"===o||"left"===o?i>=a:i<=a))return n;if(n===ce())break;n=fe(n,!1)}return!1}function he(e,t,o,n){for(var i=0,a=0,l=e.children;a<l.length;){if("none"!==l[a].style.display&&l[a]!==wt.ghost&&(n||l[a]!==wt.dragged)&&oe(l[a],o.draggable,e,!1)){if(i===t)return l[a];i++}a++}return null}function pe(e,t){for(var o=e.lastElementChild;o&&(o===wt.ghost||"none"===le(o,"display")||t&&!ee(o,t));)o=o.previousElementSibling;return o||null}function ge(e,t){var o=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===wt.clone||t&&!ee(e,t)||o++;return o}function me(e){var t=0,o=0,n=ce();if(e)do{var i=re(e),a=i.a,l=i.d;t+=e.scrollLeft*a,o+=e.scrollTop*l}while(e!==n&&(e=e.parentNode));return[t,o]}function fe(e,t){if(!e||!e.getBoundingClientRect)return ce();var o=e,n=!1;do{if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var i=le(o);if(o.clientWidth<o.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||o.clientHeight<o.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!o.getBoundingClientRect||o===document.body)return ce();if(n||t)return o;n=!0}}}while(o=o.parentNode);return ce()}function be(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function ve(e,t){return function(){if(!ne){var o=arguments,n=this;1===o.length?e.call(n,o[0]):e.apply(n,o),ne=setTimeout((function(){ne=void 0}),t)}}}function ye(e,t,o){e.scrollLeft+=t,e.scrollTop+=o}function we(e){var t=window.Polymer,o=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):o?o(e).clone(!0)[0]:e.cloneNode(!0)}function Ce(e,t,o){var n={};return Array.from(e.children).forEach((function(i){var a,l,r,s;if(oe(i,t.draggable,e,!1)&&!i.animated&&i!==o){var c=de(i);n.left=Math.min(null!==(a=n.left)&&void 0!==a?a:1/0,c.left),n.top=Math.min(null!==(l=n.top)&&void 0!==l?l:1/0,c.top),n.right=Math.max(null!==(r=n.right)&&void 0!==r?r:-1/0,c.right),n.bottom=Math.max(null!==(s=n.bottom)&&void 0!==s?s:-1/0,c.bottom)}})),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var ke="Sortable"+(new Date).getTime();function qe(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(e){if("none"!==le(e,"display")&&e!==wt.ghost){t.push({target:e,rect:de(e)});var o=z({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=re(e,!0);n&&(o.top-=n.f,o.left-=n.e)}e.fromRect=o}}))},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var o in e)if(e.hasOwnProperty(o))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[o][n])return Number(o);return-1}(t,{target:e}),1)},animateAll:function(o){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof o&&o());var i=!1,a=0;t.forEach((function(e){var t=0,o=e.target,l=o.fromRect,r=de(o),s=o.prevFromRect,c=o.prevToRect,d=e.rect,u=re(o,!0);u&&(r.top-=u.f,r.left-=u.e),o.toRect=r,o.thisAnimationDuration&&be(s,r)&&!be(l,r)&&(d.top-r.top)/(d.left-r.left)==(l.top-r.top)/(l.left-r.left)&&(t=function(e,t,o,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-o.top,2)+Math.pow(t.left-o.left,2))*n.animation}(d,s,c,n.options)),be(r,l)||(o.prevFromRect=l,o.prevToRect=r,t||(t=n.options.animation),n.animate(o,d,r,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),t),o.thisAnimationDuration=t)})),clearTimeout(e),i?e=setTimeout((function(){"function"==typeof o&&o()}),a):"function"==typeof o&&o(),t=[]},animate:function(e,t,o,n){if(n){le(e,"transition",""),le(e,"transform","");var i=re(this.el),a=i&&i.a,l=i&&i.d,r=(t.left-o.left)/(a||1),s=(t.top-o.top)/(l||1);e.animatingX=!!r,e.animatingY=!!s,le(e,"transform","translate3d("+r+"px,"+s+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),le(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),le(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){le(e,"transition",""),le(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),n)}}}}var Te=[],Me={initializeByDefault:!0},Ee={mount:function(e){for(var t in Me)Me.hasOwnProperty(t)&&!(t in e)&&(e[t]=Me[t]);Te.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),Te.push(e)},pluginEvent:function(e,t,o){var n=this;this.eventCanceled=!1,o.cancel=function(){n.eventCanceled=!0};var i=e+"Global";Te.forEach((function(n){t[n.pluginName]&&(t[n.pluginName][i]&&t[n.pluginName][i](z({sortable:t},o)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](z({sortable:t},o)))}))},initializePlugins:function(e,t,o,n){for(var i in Te.forEach((function(n){var i=n.pluginName;if(e.options[i]||n.initializeByDefault){var a=new n(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,H(o,a.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);void 0!==a&&(e.options[i]=a)}},getEventProperties:function(e,t){var o={};return Te.forEach((function(n){"function"==typeof n.eventProperties&&H(o,n.eventProperties.call(t[n.pluginName],e))})),o},modifyOption:function(e,t,o){var n;return Te.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(n=i.optionListeners[t].call(e[i.pluginName],o))})),n}};var _e=["evt"],Se=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=o.evt,i=R(o,_e);Ee.pluginEvent.bind(wt)(e,t,z({dragEl:Be,parentEl:Ae,ghostEl:De,rootEl:Le,nextEl:Ne,lastDownEl:Ie,cloneEl:Oe,cloneHidden:Fe,dragStarted:Ue,putSortable:Re,activeSortable:wt.active,originalEvent:n,oldIndex:$e,oldDraggableIndex:Ve,newIndex:ze,newDraggableIndex:Pe,hideGhostForTarget:ft,unhideGhostForTarget:bt,cloneNowHidden:function(){Fe=!0},cloneNowShown:function(){Fe=!1},dispatchSortableEvent:function(e){xe({sortable:t,name:e,originalEvent:n})}},i))};function xe(e){!function(e){var t=e.sortable,o=e.rootEl,n=e.name,i=e.targetEl,a=e.cloneEl,l=e.toEl,r=e.fromEl,s=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,g=e.extraEventProperties;if(t=t||o&&o[ke]){var m,f=t.options,b="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||j||W?(m=document.createEvent("Event")).initEvent(n,!0,!0):m=new CustomEvent(n,{bubbles:!0,cancelable:!0}),m.to=l||o,m.from=r||o,m.item=i||o,m.clone=a,m.oldIndex=s,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var v=z(z({},g),Ee.getEventProperties(n,t));for(var y in v)m[y]=v[y];o&&o.dispatchEvent(m),f[b]&&f[b].call(t,m)}}(z({putSortable:Re,cloneEl:Oe,targetEl:Be,rootEl:Le,oldIndex:$e,oldDraggableIndex:Ve,newIndex:ze,newDraggableIndex:Pe},e))}var Be,Ae,De,Le,Ne,Ie,Oe,Fe,$e,ze,Ve,Pe,He,Re,Ze,je,We,Xe,Ye,Ge,Ue,Ke,Je,Qe,et,tt=!1,ot=!1,nt=[],it=!1,at=!1,lt=[],rt=!1,st=[],ct="undefined"!=typeof document,dt=G,ut=W||j?"cssFloat":"float",ht=ct&&!U&&!G&&"draggable"in document.createElement("div"),pt=function(){if(ct){if(j)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),gt=function(e,t){var o=le(e),n=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=he(e,0,t),a=he(e,1,t),l=i&&le(i),r=a&&le(a),s=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+de(i).width,c=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+de(a).width;if("flex"===o.display)return"column"===o.flexDirection||"column-reverse"===o.flexDirection?"vertical":"horizontal";if("grid"===o.display)return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&l.float&&"none"!==l.float){var d="left"===l.float?"left":"right";return!a||"both"!==r.clear&&r.clear!==d?"horizontal":"vertical"}return i&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||s>=n&&"none"===o[ut]||a&&"none"===o[ut]&&s+c>n)?"vertical":"horizontal"},mt=function(e){function t(e,o){return function(n,i,a,l){var r=n.options.group.name&&i.options.group.name&&n.options.group.name===i.options.group.name;if(null==e&&(o||r))return!0;if(null==e||!1===e)return!1;if(o&&"clone"===e)return e;if("function"==typeof e)return t(e(n,i,a,l),o)(n,i,a,l);var s=(o?n:i).options.group.name;return!0===e||"string"==typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var o={},n=e.group;n&&"object"==V(n)||(n={name:n}),o.name=n.name,o.checkPull=t(n.pull,!0),o.checkPut=t(n.put),o.revertClone=n.revertClone,e.group=o},ft=function(){!pt&&De&&le(De,"display","none")},bt=function(){!pt&&De&&le(De,"display","")};ct&&!U&&document.addEventListener("click",(function(e){if(ot)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ot=!1,!1}),!0);var vt=function(e){if(Be){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,a=e.clientY,nt.some((function(e){var t=e[ke].options.emptyInsertThreshold;if(t&&!pe(e)){var o=de(e),n=i>=o.left-t&&i<=o.right+t,r=a>=o.top-t&&a<=o.bottom+t;return n&&r?l=e:void 0}})),l);if(t){var o={};for(var n in e)e.hasOwnProperty(n)&&(o[n]=e[n]);o.target=o.rootEl=t,o.preventDefault=void 0,o.stopPropagation=void 0,t[ke]._onDragOver(o)}}var i,a,l},yt=function(e){Be&&Be.parentNode[ke]._isOutsideThisEl(e.target)};function wt(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=H({},t),e[ke]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return gt(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==wt.supportPointer&&"PointerEvent"in window&&!Y,emptyInsertThreshold:5};for(var n in Ee.initializePlugins(this,e,o),o)!(n in t)&&(t[n]=o[n]);for(var i in mt(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&ht,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?J(e,"pointerdown",this._onTapStart):(J(e,"mousedown",this._onTapStart),J(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(J(e,"dragover",this),J(e,"dragenter",this)),nt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),H(this,qe())}function Ct(e,t,o,n,i,a,l,r){var s,c,d=e[ke],u=d.options.onMove;return!window.CustomEvent||j||W?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=o,s.draggedRect=n,s.related=i||t,s.relatedRect=a||de(t),s.willInsertAfter=r,s.originalEvent=l,e.dispatchEvent(s),u&&(c=u.call(d,s,l)),c}function kt(e){e.draggable=!1}function qt(){rt=!1}function Tt(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,o=t.length,n=0;o--;)n+=t.charCodeAt(o);return n.toString(36)}function Mt(e){return setTimeout(e,0)}function Et(e){return clearTimeout(e)}wt.prototype={constructor:wt,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ke=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Be):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,o=this.el,n=this.options,i=n.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,r=(l||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||r,c=n.filter;if(function(e){st.length=0;var t=e.getElementsByTagName("input"),o=t.length;for(;o--;){var n=t[o];n.checked&&st.push(n)}}(o),!Be&&!(/mousedown|pointerdown/.test(a)&&0!==e.button||n.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!Y||!r||"SELECT"!==r.tagName.toUpperCase())&&!((r=oe(r,n.draggable,o,!1))&&r.animated||Ie===r)){if($e=ge(r),Ve=ge(r,n.draggable),"function"==typeof c){if(c.call(this,e,r,this))return xe({sortable:t,rootEl:s,name:"filter",targetEl:r,toEl:o,fromEl:o}),Se("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=oe(s,n.trim(),o,!1))return xe({sortable:t,rootEl:n,name:"filter",targetEl:r,fromEl:o,toEl:o}),Se("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());n.handle&&!oe(s,n.handle,o,!1)||this._prepareDragStart(e,l,r)}}},_prepareDragStart:function(e,t,o){var n,i=this,a=i.el,l=i.options,r=a.ownerDocument;if(o&&!Be&&o.parentNode===a){var s=de(o);if(Le=a,Ae=(Be=o).parentNode,Ne=Be.nextSibling,Ie=o,He=l.group,wt.dragged=Be,Ze={target:Be,clientX:(t||e).clientX,clientY:(t||e).clientY},Ye=Ze.clientX-s.left,Ge=Ze.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Be.style["will-change"]="all",n=function(){Se("delayEnded",i,{evt:e}),wt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!X&&i.nativeDraggable&&(Be.draggable=!0),i._triggerDragStart(e,t),xe({sortable:i,name:"choose",originalEvent:e}),ae(Be,l.chosenClass,!0))},l.ignore.split(",").forEach((function(e){se(Be,e.trim(),kt)})),J(r,"dragover",vt),J(r,"mousemove",vt),J(r,"touchmove",vt),J(r,"mouseup",i._onDrop),J(r,"touchend",i._onDrop),J(r,"touchcancel",i._onDrop),X&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Be.draggable=!0),Se("delayStart",this,{evt:e}),!l.delay||l.delayOnTouchOnly&&!t||this.nativeDraggable&&(W||j))n();else{if(wt.eventCanceled)return void this._onDrop();J(r,"mouseup",i._disableDelayedDrag),J(r,"touchend",i._disableDelayedDrag),J(r,"touchcancel",i._disableDelayedDrag),J(r,"mousemove",i._delayedDragTouchMoveHandler),J(r,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&J(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(n,l.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Be&&kt(Be),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Q(e,"mouseup",this._disableDelayedDrag),Q(e,"touchend",this._disableDelayedDrag),Q(e,"touchcancel",this._disableDelayedDrag),Q(e,"mousemove",this._delayedDragTouchMoveHandler),Q(e,"touchmove",this._delayedDragTouchMoveHandler),Q(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?J(document,"pointermove",this._onTouchMove):J(document,t?"touchmove":"mousemove",this._onTouchMove):(J(Be,"dragend",this),J(Le,"dragstart",this._onDragStart));try{document.selection?Mt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(tt=!1,Le&&Be){Se("dragStarted",this,{evt:t}),this.nativeDraggable&&J(document,"dragover",yt);var o=this.options;!e&&ae(Be,o.dragClass,!1),ae(Be,o.ghostClass,!0),wt.active=this,e&&this._appendGhost(),xe({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(je){this._lastX=je.clientX,this._lastY=je.clientY,ft();for(var e=document.elementFromPoint(je.clientX,je.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(je.clientX,je.clientY))!==t;)t=e;if(Be.parentNode[ke]._isOutsideThisEl(e),t)do{if(t[ke]){if(t[ke]._onDragOver({clientX:je.clientX,clientY:je.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);bt()}},_onTouchMove:function(e){if(Ze){var t=this.options,o=t.fallbackTolerance,n=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=De&&re(De,!0),l=De&&a&&a.a,r=De&&a&&a.d,s=dt&&et&&me(et),c=(i.clientX-Ze.clientX+n.x)/(l||1)+(s?s[0]-lt[0]:0)/(l||1),d=(i.clientY-Ze.clientY+n.y)/(r||1)+(s?s[1]-lt[1]:0)/(r||1);if(!wt.active&&!tt){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(De){a?(a.e+=c-(We||0),a.f+=d-(Xe||0)):a={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");le(De,"webkitTransform",u),le(De,"mozTransform",u),le(De,"msTransform",u),le(De,"transform",u),We=c,Xe=d,je=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!De){var e=this.options.fallbackOnBody?document.body:Le,t=de(Be,!0,dt,!0,e),o=this.options;if(dt){for(et=e;"static"===le(et,"position")&&"none"===le(et,"transform")&&et!==document;)et=et.parentNode;et!==document.body&&et!==document.documentElement?(et===document&&(et=ce()),t.top+=et.scrollTop,t.left+=et.scrollLeft):et=ce(),lt=me(et)}ae(De=Be.cloneNode(!0),o.ghostClass,!1),ae(De,o.fallbackClass,!0),ae(De,o.dragClass,!0),le(De,"transition",""),le(De,"transform",""),le(De,"box-sizing","border-box"),le(De,"margin",0),le(De,"top",t.top),le(De,"left",t.left),le(De,"width",t.width),le(De,"height",t.height),le(De,"opacity","0.8"),le(De,"position",dt?"absolute":"fixed"),le(De,"zIndex","100000"),le(De,"pointerEvents","none"),wt.ghost=De,e.appendChild(De),le(De,"transform-origin",Ye/parseInt(De.style.width)*100+"% "+Ge/parseInt(De.style.height)*100+"%")}},_onDragStart:function(e,t){var o=this,n=e.dataTransfer,i=o.options;Se("dragStart",this,{evt:e}),wt.eventCanceled?this._onDrop():(Se("setupClone",this),wt.eventCanceled||((Oe=we(Be)).removeAttribute("id"),Oe.draggable=!1,Oe.style["will-change"]="",this._hideClone(),ae(Oe,this.options.chosenClass,!1),wt.clone=Oe),o.cloneId=Mt((function(){Se("clone",o),wt.eventCanceled||(o.options.removeCloneOnHide||Le.insertBefore(Oe,Be),o._hideClone(),xe({sortable:o,name:"clone"}))})),!t&&ae(Be,i.dragClass,!0),t?(ot=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Q(document,"mouseup",o._onDrop),Q(document,"touchend",o._onDrop),Q(document,"touchcancel",o._onDrop),n&&(n.effectAllowed="move",i.setData&&i.setData.call(o,n,Be)),J(document,"drop",o),le(Be,"transform","translateZ(0)")),tt=!0,o._dragStartId=Mt(o._dragStarted.bind(o,t,e)),J(document,"selectstart",o),Ue=!0,Y&&le(document.body,"user-select","none"))},_onDragOver:function(e){var t,o,n,i,a=this.el,l=e.target,r=this.options,s=r.group,c=wt.active,d=He===s,u=r.sort,h=Re||c,p=this,g=!1;if(!rt){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),l=oe(l,r.draggable,a,!0),x("dragOver"),wt.eventCanceled)return g;if(Be.contains(e.target)||l.animated&&l.animatingX&&l.animatingY||p._ignoreWhileAnimating===l)return A(!1);if(ot=!1,c&&!r.disabled&&(d?u||(n=Ae!==Le):Re===this||(this.lastPutMode=He.checkPull(this,c,Be,e))&&s.checkPut(this,c,Be,e))){if(i="vertical"===this._getDirection(e,l),t=de(Be),x("dragOverValid"),wt.eventCanceled)return g;if(n)return Ae=Le,B(),this._hideClone(),x("revert"),wt.eventCanceled||(Ne?Le.insertBefore(Be,Ne):Le.appendChild(Be)),A(!0);var m=pe(a,r.draggable);if(!m||function(e,t,o){var n=de(pe(o.el,o.options.draggable)),i=Ce(o.el,o.options,De),a=10;return t?e.clientX>i.right+a||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+a||e.clientX>n.right&&e.clientY>n.top}(e,i,this)&&!m.animated){if(m===Be)return A(!1);if(m&&a===e.target&&(l=m),l&&(o=de(l)),!1!==Ct(Le,a,Be,t,l,o,e,!!l))return B(),m&&m.nextSibling?a.insertBefore(Be,m.nextSibling):a.appendChild(Be),Ae=a,D(),A(!0)}else if(m&&function(e,t,o){var n=de(he(o.el,0,o.options,!0)),i=Ce(o.el,o.options,De),a=10;return t?e.clientX<i.left-a||e.clientY<n.top&&e.clientX<n.right:e.clientY<i.top-a||e.clientY<n.bottom&&e.clientX<n.left}(e,i,this)){var f=he(a,0,r,!0);if(f===Be)return A(!1);if(o=de(l=f),!1!==Ct(Le,a,Be,t,l,o,e,!1))return B(),a.insertBefore(Be,f),Ae=a,D(),A(!0)}else if(l.parentNode===a){o=de(l);var b,v,y,w=Be.parentNode!==a,C=!function(e,t,o){var n=o?e.left:e.top,i=o?e.right:e.bottom,a=o?e.width:e.height,l=o?t.left:t.top,r=o?t.right:t.bottom,s=o?t.width:t.height;return n===l||i===r||n+a/2===l+s/2}(Be.animated&&Be.toRect||t,l.animated&&l.toRect||o,i),k=i?"top":"left",q=ue(l,"top","top")||ue(Be,"top","top"),T=q?q.scrollTop:void 0;if(Ke!==l&&(v=o[k],it=!1,at=!C&&r.invertSwap||w),b=function(e,t,o,n,i,a,l,r){var s=n?e.clientY:e.clientX,c=n?o.height:o.width,d=n?o.top:o.left,u=n?o.bottom:o.right,h=!1;if(!l)if(r&&Qe<c*i){if(!it&&(1===Je?s>d+c*a/2:s<u-c*a/2)&&(it=!0),it)h=!0;else if(1===Je?s<d+Qe:s>u-Qe)return-Je}else if(s>d+c*(1-i)/2&&s<u-c*(1-i)/2)return function(e){return ge(Be)<ge(e)?1:-1}(t);if((h=h||l)&&(s<d+c*a/2||s>u-c*a/2))return s>d+c/2?1:-1;return 0}(e,l,o,i,C?1:r.swapThreshold,null==r.invertedSwapThreshold?r.swapThreshold:r.invertedSwapThreshold,at,Ke===l),0!==b){var M=ge(Be);do{M-=b,y=Ae.children[M]}while(y&&("none"===le(y,"display")||y===De))}if(0===b||y===l)return A(!1);Ke=l,Je=b;var E=l.nextElementSibling,_=!1,S=Ct(Le,a,Be,t,l,o,e,_=1===b);if(!1!==S)return 1!==S&&-1!==S||(_=1===S),rt=!0,setTimeout(qt,30),B(),_&&!E?a.appendChild(Be):l.parentNode.insertBefore(Be,_?E:l),q&&ye(q,0,T-q.scrollTop),Ae=Be.parentNode,void 0===v||at||(Qe=Math.abs(v-de(l)[k])),D(),A(!0)}if(a.contains(Be))return A(!1)}return!1}function x(r,s){Se(r,p,z({evt:e,isOwner:d,axis:i?"vertical":"horizontal",revert:n,dragRect:t,targetRect:o,canSort:u,fromSortable:h,target:l,completed:A,onMove:function(o,n){return Ct(Le,a,Be,t,o,de(o),e,n)},changed:D},s))}function B(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function A(t){return x("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==h&&(ae(Be,Re?Re.options.ghostClass:c.options.ghostClass,!1),ae(Be,r.ghostClass,!0)),Re!==p&&p!==wt.active?Re=p:p===wt.active&&Re&&(Re=null),h===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(l===Be&&!Be.animated||l===a&&!l.animated)&&(Ke=null),r.dragoverBubble||e.rootEl||l===document||(Be.parentNode[ke]._isOutsideThisEl(e.target),!t&&vt(e)),!r.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),g=!0}function D(){ze=ge(Be),Pe=ge(Be,r.draggable),xe({sortable:p,name:"change",toEl:a,newIndex:ze,newDraggableIndex:Pe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Q(document,"mousemove",this._onTouchMove),Q(document,"touchmove",this._onTouchMove),Q(document,"pointermove",this._onTouchMove),Q(document,"dragover",vt),Q(document,"mousemove",vt),Q(document,"touchmove",vt)},_offUpEvents:function(){var e=this.el.ownerDocument;Q(e,"mouseup",this._onDrop),Q(e,"touchend",this._onDrop),Q(e,"pointerup",this._onDrop),Q(e,"touchcancel",this._onDrop),Q(document,"selectstart",this)},_onDrop:function(e){var t=this.el,o=this.options;ze=ge(Be),Pe=ge(Be,o.draggable),Se("drop",this,{evt:e}),Ae=Be&&Be.parentNode,ze=ge(Be),Pe=ge(Be,o.draggable),wt.eventCanceled||(tt=!1,at=!1,it=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Et(this.cloneId),Et(this._dragStartId),this.nativeDraggable&&(Q(document,"drop",this),Q(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Y&&le(document.body,"user-select",""),le(Be,"transform",""),e&&(Ue&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),De&&De.parentNode&&De.parentNode.removeChild(De),(Le===Ae||Re&&"clone"!==Re.lastPutMode)&&Oe&&Oe.parentNode&&Oe.parentNode.removeChild(Oe),Be&&(this.nativeDraggable&&Q(Be,"dragend",this),kt(Be),Be.style["will-change"]="",Ue&&!tt&&ae(Be,Re?Re.options.ghostClass:this.options.ghostClass,!1),ae(Be,this.options.chosenClass,!1),xe({sortable:this,name:"unchoose",toEl:Ae,newIndex:null,newDraggableIndex:null,originalEvent:e}),Le!==Ae?(ze>=0&&(xe({rootEl:Ae,name:"add",toEl:Ae,fromEl:Le,originalEvent:e}),xe({sortable:this,name:"remove",toEl:Ae,originalEvent:e}),xe({rootEl:Ae,name:"sort",toEl:Ae,fromEl:Le,originalEvent:e}),xe({sortable:this,name:"sort",toEl:Ae,originalEvent:e})),Re&&Re.save()):ze!==$e&&ze>=0&&(xe({sortable:this,name:"update",toEl:Ae,originalEvent:e}),xe({sortable:this,name:"sort",toEl:Ae,originalEvent:e})),wt.active&&(null!=ze&&-1!==ze||(ze=$e,Pe=Ve),xe({sortable:this,name:"end",toEl:Ae,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Se("nulling",this),Le=Be=Ae=De=Ne=Oe=Ie=Fe=Ze=je=Ue=ze=Pe=$e=Ve=Ke=Je=Re=He=wt.dragged=wt.ghost=wt.clone=wt.active=null,st.forEach((function(e){e.checked=!0})),st.length=We=Xe=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Be&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],o=this.el.children,n=0,i=o.length,a=this.options;n<i;n++)oe(e=o[n],a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||Tt(e));return t},sort:function(e,t){var o={},n=this.el;this.toArray().forEach((function(e,t){var i=n.children[t];oe(i,this.options.draggable,n,!1)&&(o[e]=i)}),this),t&&this.captureAnimationState(),e.forEach((function(e){o[e]&&(n.removeChild(o[e]),n.appendChild(o[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return oe(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var o=this.options;if(void 0===t)return o[e];var n=Ee.modifyOption(this,e,t);o[e]=void 0!==n?n:t,"group"===e&&mt(o)},destroy:function(){Se("destroy",this);var e=this.el;e[ke]=null,Q(e,"mousedown",this._onTapStart),Q(e,"touchstart",this._onTapStart),Q(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Q(e,"dragover",this),Q(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),nt.splice(nt.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Fe){if(Se("hideClone",this),wt.eventCanceled)return;le(Oe,"display","none"),this.options.removeCloneOnHide&&Oe.parentNode&&Oe.parentNode.removeChild(Oe),Fe=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Fe){if(Se("showClone",this),wt.eventCanceled)return;Be.parentNode!=Le||this.options.group.revertClone?Ne?Le.insertBefore(Oe,Ne):Le.appendChild(Oe):Le.insertBefore(Oe,Be),this.options.group.revertClone&&this.animate(Be,Oe),le(Oe,"display",""),Fe=!1}}else this._hideClone()}},ct&&J(document,"touchmove",(function(e){(wt.active||tt)&&e.cancelable&&e.preventDefault()})),wt.utils={on:J,off:Q,css:le,find:se,is:function(e,t){return!!oe(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e},throttle:ve,closest:oe,toggleClass:ae,clone:we,index:ge,nextTick:Mt,cancelNextTick:Et,detectDirection:gt,getChild:he},wt.get=function(e){return e[ke]},wt.mount=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(wt.utils=z(z({},wt.utils),e.utils)),Ee.mount(e)}))},wt.create=function(e,t){return new wt(e,t)},wt.version="1.15.2";var _t,St,xt,Bt,At,Dt,Lt=[],Nt=!1;function It(){Lt.forEach((function(e){clearInterval(e.pid)})),Lt=[]}function Ot(){clearInterval(Dt)}var Ft=ve((function(e,t,o,n){if(t.scroll){var i,a=(e.touches?e.touches[0]:e).clientX,l=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,s=t.scrollSpeed,c=ce(),d=!1;St!==o&&(St=o,It(),_t=t.scroll,i=t.scrollFn,!0===_t&&(_t=fe(o,!0)));var u=0,h=_t;do{var p=h,g=de(p),m=g.top,f=g.bottom,b=g.left,v=g.right,y=g.width,w=g.height,C=void 0,k=void 0,q=p.scrollWidth,T=p.scrollHeight,M=le(p),E=p.scrollLeft,_=p.scrollTop;p===c?(C=y<q&&("auto"===M.overflowX||"scroll"===M.overflowX||"visible"===M.overflowX),k=w<T&&("auto"===M.overflowY||"scroll"===M.overflowY||"visible"===M.overflowY)):(C=y<q&&("auto"===M.overflowX||"scroll"===M.overflowX),k=w<T&&("auto"===M.overflowY||"scroll"===M.overflowY));var S=C&&(Math.abs(v-a)<=r&&E+y<q)-(Math.abs(b-a)<=r&&!!E),x=k&&(Math.abs(f-l)<=r&&_+w<T)-(Math.abs(m-l)<=r&&!!_);if(!Lt[u])for(var B=0;B<=u;B++)Lt[B]||(Lt[B]={});Lt[u].vx==S&&Lt[u].vy==x&&Lt[u].el===p||(Lt[u].el=p,Lt[u].vx=S,Lt[u].vy=x,clearInterval(Lt[u].pid),0==S&&0==x||(d=!0,Lt[u].pid=setInterval(function(){n&&0===this.layer&&wt.active._onTouchMove(At);var t=Lt[this.layer].vy?Lt[this.layer].vy*s:0,o=Lt[this.layer].vx?Lt[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(wt.dragged.parentNode[ke],o,t,e,At,Lt[this.layer].el)||ye(Lt[this.layer].el,o,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&h!==c&&(h=fe(h,!1)));Nt=d}}),30),$t=function(e){var t=e.originalEvent,o=e.putSortable,n=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,r=e.unhideGhostForTarget;if(t){var s=o||i;l();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);r(),s&&!s.el.contains(d)&&(a("spill"),this.onSpill({dragEl:n,putSortable:o}))}};function zt(){}function Vt(){}function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}zt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var n=he(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),o&&o.animateAll()},drop:$t},H(zt,{pluginName:"revertOnSpill"}),Vt.prototype={onSpill:function(e){var t=e.dragEl,o=e.putSortable||this.sortable;o.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),o.animateAll()},drop:$t},H(Vt,{pluginName:"removeOnSpill"}),wt.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?J(document,"dragover",this._handleAutoScroll):this.options.supportPointer?J(document,"pointermove",this._handleFallbackAutoScroll):t.touches?J(document,"touchmove",this._handleFallbackAutoScroll):J(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?Q(document,"dragover",this._handleAutoScroll):(Q(document,"pointermove",this._handleFallbackAutoScroll),Q(document,"touchmove",this._handleFallbackAutoScroll),Q(document,"mousemove",this._handleFallbackAutoScroll)),Ot(),It(),clearTimeout(ne),ne=void 0},nulling:function(){At=St=_t=Nt=Dt=xt=Bt=null,Lt.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var o=this,n=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(n,i);if(At=e,t||this.options.forceAutoScrollFallback||W||j||Y){Ft(e,this.options,a,t);var l=fe(a,!0);!Nt||Dt&&n===xt&&i===Bt||(Dt&&Ot(),Dt=setInterval((function(){var a=fe(document.elementFromPoint(n,i),!0);a!==l&&(l=a,It()),Ft(e,o.options,a,t)}),10),xt=n,Bt=i)}else{if(!this.options.bubbleScroll||fe(a,!0)===ce())return void It();Ft(e,this.options,fe(a,!1),!1)}}},H(e,{pluginName:"scroll",initializeByDefault:!0})}),wt.mount(Vt,zt);
/*! Pickr 1.9.0 MIT | https://github.com/Simonwep/pickr */
var Ht=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){var o;self,o=()=>(()=>{var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>E});var o={};function n(e,t,o,n,i={}){t instanceof HTMLCollection||t instanceof NodeList?t=Array.from(t):Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);for(const a of t)for(const t of o)a[e](t,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}e.r(o),e.d(o,{adjustableInputNumbers:()=>d,createElementFromString:()=>l,createFromTemplate:()=>r,eventPath:()=>s,off:()=>a,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),a=n.bind(null,"removeEventListener");function l(e){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild}function r(e){const t=(e,t)=>{const o=e.getAttribute(t);return e.removeAttribute(t),o},o=(e,n={})=>{const i=t(e,":obj"),a=t(e,":ref"),l=i?n[i]={}:n;a&&(n[a]=e);for(const n of Array.from(e.children)){const e=t(n,":arr"),i=o(n,e?{}:l);e&&(l[e]||(l[e]=[])).push(Object.keys(i).length?i:n)}return n};return o(l(e))}function s(e){let t=e.path||e.composedPath&&e.composedPath();if(t)return t;let o=e.target.parentElement;for(t=[e.target,o];o=o.parentElement;)t.push(o);return t.push(document,window),t}function c(e){return e instanceof Element?e:"string"==typeof e?e.split(/>>/g).reduce(((e,t,o,n)=>(e=e.querySelector(t),o<n.length-1?e.shadowRoot:e)),document):null}function d(e,t=(e=>e)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,a=e.selectionStart;e.value=e.value.replace(/[\d.]+/g,((e,o)=>o<=a&&o+e.length>=a?(a=o,t(Number(e),n,i)):(i++,e))),e.focus(),e.setSelectionRange(a,a),o.preventDefault(),e.dispatchEvent(new Event("input"))}i(e,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(e,"blur",(()=>a(window,"wheel",o)))}const{min:u,max:h,floor:p,round:g}=Math;function m(e,t,o){t/=100,o/=100;const n=p(e=e/360*6),i=e-n,a=o*(1-t),l=o*(1-i*t),r=o*(1-(1-i)*t),s=n%6;return[255*[o,l,a,a,r,o][s],255*[r,o,o,l,a,a][s],255*[a,a,r,o,o,l][s]]}function f(e,t,o){const n=(2-(t/=100))*(o/=100)/2;return 0!==n&&(t=1===n?0:n<.5?t*o/(2*n):t*o/(2-2*n)),[e,100*t,100*n]}function b(e,t,o){const n=u(e/=255,t/=255,o/=255),i=h(e,t,o),a=i-n;let l,r;if(0===a)l=r=0;else{r=a/i;const n=((i-e)/6+a/2)/a,s=((i-t)/6+a/2)/a,c=((i-o)/6+a/2)/a;e===i?l=c-s:t===i?l=1/3+n-c:o===i&&(l=2/3+s-n),l<0?l+=1:l>1&&(l-=1)}return[360*l,100*r,100*i]}function v(e,t,o,n){return t/=100,o/=100,[...b(255*(1-u(1,(e/=100)*(1-(n/=100))+n)),255*(1-u(1,t*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function y(e,t,o){t/=100;const n=2*(t*=(o/=100)<.5?o:1-o)/(o+t)*100,i=100*(o+t);return[e,isNaN(n)?0:n,i]}function w(e){return b(...e.match(/.{2}/g).map((e=>parseInt(e,16))))}function C(e=0,t=0,o=0,n=1){const i=(e,t)=>(o=-1)=>t(~o?e.map((e=>Number(e.toFixed(o)))):e),a={h:e,s:t,v:o,a:n,toHSVA(){const e=[a.h,a.s,a.v,a.a];return e.toString=i(e,(e=>`hsva(${e[0]}, ${e[1]}%, ${e[2]}%, ${a.a})`)),e},toHSLA(){const e=[...f(a.h,a.s,a.v),a.a];return e.toString=i(e,(e=>`hsla(${e[0]}, ${e[1]}%, ${e[2]}%, ${a.a})`)),e},toRGBA(){const e=[...m(a.h,a.s,a.v),a.a];return e.toString=i(e,(e=>`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${a.a})`)),e},toCMYK(){const e=function(e,t,o){const n=m(e,t,o),i=n[0]/255,a=n[1]/255,l=n[2]/255,r=u(1-i,1-a,1-l);return[100*(1===r?0:(1-i-r)/(1-r)),100*(1===r?0:(1-a-r)/(1-r)),100*(1===r?0:(1-l-r)/(1-r)),100*r]}(a.h,a.s,a.v);return e.toString=i(e,(e=>`cmyk(${e[0]}%, ${e[1]}%, ${e[2]}%, ${e[3]}%)`)),e},toHEXA(){const e=function(e,t,o){return m(e,t,o).map((e=>g(e).toString(16).padStart(2,"0")))}(a.h,a.s,a.v),t=a.a>=1?"":Number((255*a.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return t&&e.push(t),e.toString=()=>`#${e.join("").toUpperCase()}`,e},clone:()=>C(a.h,a.s,a.v,a.a)};return a}const k=e=>Math.max(Math.min(e,1),0);function q(e){const t={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},e),_keyboard(e){const{options:o}=t,{type:n,key:i}=e;if(document.activeElement===o.wrapper){const{lock:o}=t.options,a="ArrowUp"===i,l="ArrowRight"===i,r="ArrowDown"===i,s="ArrowLeft"===i;if("keydown"===n&&(a||l||r||s)){let n=0,i=0;"v"===o?n=a||l?1:-1:"h"===o?n=a||l?-1:1:(i=a?-1:r?1:0,n=s?-1:l?1:0),t.update(k(t.cache.x+.01*n),k(t.cache.y+.01*i)),e.preventDefault()}else i.startsWith("Arrow")&&(t.options.onstop(),e.preventDefault())}},_tapstart(e){i(document,["mouseup","touchend","touchcancel"],t._tapstop),i(document,["mousemove","touchmove"],t._tapmove),e.cancelable&&e.preventDefault(),t._tapmove(e)},_tapmove(e){const{options:o,cache:n}=t,{lock:i,element:a,wrapper:l}=o,r=l.getBoundingClientRect();let s=0,c=0;if(e){const t=e&&e.touches&&e.touches[0];s=e?(t||e).clientX:0,c=e?(t||e).clientY:0,s<r.left?s=r.left:s>r.left+r.width&&(s=r.left+r.width),c<r.top?c=r.top:c>r.top+r.height&&(c=r.top+r.height),s-=r.left,c-=r.top}else n&&(s=n.x*r.width,c=n.y*r.height);"h"!==i&&(a.style.left=`calc(${s/r.width*100}% - ${a.offsetWidth/2}px)`),"v"!==i&&(a.style.top=`calc(${c/r.height*100}% - ${a.offsetHeight/2}px)`),t.cache={x:s/r.width,y:c/r.height};const d=k(s/r.width),u=k(c/r.height);switch(i){case"v":return o.onchange(d);case"h":return o.onchange(u);default:return o.onchange(d,u)}},_tapstop(){t.options.onstop(),a(document,["mouseup","touchend","touchcancel"],t._tapstop),a(document,["mousemove","touchmove"],t._tapmove)},trigger(){t._tapmove()},update(e=0,o=0){const{left:n,top:i,width:a,height:l}=t.options.wrapper.getBoundingClientRect();"h"===t.options.lock&&(o=e),t._tapmove({clientX:n+a*e,clientY:i+l*o})},destroy(){const{options:e,_tapstart:o,_keyboard:n}=t;a(document,["keydown","keyup"],n),a([e.wrapper,e.element],"mousedown",o),a([e.wrapper,e.element],"touchstart",o,{passive:!1})}},{options:o,_tapstart:n,_keyboard:l}=t;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],l),t}function T(e={}){e=Object.assign({onchange:()=>0,className:"",elements:[]},e);const t=i(e.elements,"click",(t=>{e.elements.forEach((o=>o.classList[t.target===o?"add":"remove"](e.className))),e.onchange(t),t.stopPropagation()}));return{destroy:()=>a(...t)}}const M={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0};class E{static utils=o;static version="1.9.0";static I18N_DEFAULTS={"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"};static DEFAULT_OPTIONS={appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=C();_lastColor=C();_swatchColors=[];_setupAnimationFrame=null;_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(e){this.options=e=Object.assign({...E.DEFAULT_OPTIONS},e);const{swatches:t,components:o,theme:n,sliders:i,lockOpacity:a,padding:l}=e;["nano","monolith"].includes(n)&&!i&&(e.sliders="h"),o.interaction||(o.interaction={});const{preview:r,opacity:s,hue:c,palette:d}=o;o.opacity=!a&&s,o.palette=d||r||s||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),t&&t.length&&t.forEach((e=>this.addSwatch(e)));const{button:u,app:h}=this._root;this._nanopop=((e,t,o)=>{const n="object"!=typeof e||e instanceof HTMLElement?{reference:e,popper:t,...o}:e;return{update(e=n){const{reference:t,popper:o}=Object.assign(n,e);if(!o||!t)throw new Error("Popper- or reference-element missing.");return((e,t,o)=>{const{container:n,arrow:i,margin:a,padding:l,position:r,variantFlipOrder:s,positionFlipOrder:c}={container:document.documentElement.getBoundingClientRect(),...M,...o},{left:d,top:u}=t.style;t.style.left="0",t.style.top="0";const h=e.getBoundingClientRect(),p=t.getBoundingClientRect(),g={t:h.top-p.height-a,b:h.bottom+a,r:h.right+a,l:h.left-p.width-a},m={vs:h.left,vm:h.left+h.width/2-p.width/2,ve:h.left+h.width-p.width,hs:h.top,hm:h.bottom-h.height/2-p.height/2,he:h.bottom-p.height},[f,b="middle"]=r.split("-"),v=c[f],y=s[b],{top:w,left:C,bottom:k,right:q}=n;for(const e of v){const o="t"===e||"b"===e;let n=g[e];const[a,r]=o?["top","left"]:["left","top"],[s,c]=o?[p.height,p.width]:[p.width,p.height],[d,u]=o?[k,q]:[q,k],[f,b]=o?[w,C]:[C,w];if(!(n<f||n+s+l>d))for(const d of y){let g=m[(o?"v":"h")+d];if(!(g<b||g+c+l>u)){if(g-=p[r],n-=p[a],t.style[r]=`${g}px`,t.style[a]=`${n}px`,i){const e=o?h.width/2:h.height/2,t=2*e<c?h[r]+e:g+c/2;n<h[a]&&(n+=s),i.style[r]=`${t}px`,i.style[a]=`${n}px`}return e+d}}}return t.style.left=d,t.style.top=u,null})(t,o,n)}}})(u,h,{margin:l}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const p=this;this._setupAnimationFrame=requestAnimationFrame((function t(){if(!h.offsetWidth)return requestAnimationFrame(t);p.setColor(e.default),p._rePositioningPicker(),e.defaultRepresentation&&(p._representation=e.defaultRepresentation,p.setColorRepresentation(p._representation)),e.showAlways&&p.show(),p._initializingActive=!1,p._emit("init")}))}static create=e=>new E(e);_preBuild(){const{options:e}=this;for(const t of["el","container"])e[t]=c(e[t]);this._root=(e=>{const{components:t,useAsButton:o,inline:n,appClass:i,theme:a,lockOpacity:l}=e.options,s=e=>e?"":'style="display:none" hidden',c=t=>e._t(t),d=r(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${a}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${s(t.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${s(t.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${s(t.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${s(t.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${t.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${s(Object.keys(t.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${s(t.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${l?"HEX":"HEXA"}" type="button" ${s(t.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${l?"RGB":"RGBA"}" type="button" ${s(t.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${l?"HSL":"HSLA"}" type="button" ${s(t.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${l?"HSV":"HSVA"}" type="button" ${s(t.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${s(t.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${s(t.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${s(t.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${s(t.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=d.interaction;return u.options.find((e=>!e.hidden&&!e.classList.add("active"))),u.type=()=>u.options.find((e=>e.classList.contains("active"))),d})(this),e.useAsButton&&(this._root.button=e.el),e.container.appendChild(this._root.root)}_finalBuild(){const e=this.options,t=this._root;if(e.container.removeChild(t.root),e.inline){const o=e.el.parentElement;e.el.nextSibling?o.insertBefore(t.app,e.el.nextSibling):o.appendChild(t.app)}else e.container.appendChild(t.app);e.useAsButton?e.inline&&e.el.remove():e.el.parentNode.replaceChild(t.root,e.el),e.disabled&&this.disable(),e.comparison||(t.button.style.transition="none",e.useAsButton||(t.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const e=this,t=this.options.components,o=(e.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],a=()=>this._color||(this._color=this._lastColor.clone()),l={palette:q({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:()=>e._emit("changestop","slider",e),onchange(o,n){if(!t.palette)return;const i=a(),{_root:l,options:r}=e,{lastColor:s,currentColor:c}=l.preview;e._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),e._updateOutput("slider"));const d=i.toRGBA().toString(0);this.element.style.background=d,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,r.comparison?r.useAsButton||e._lastColor||s.style.setProperty("--pcr-color",d):(l.button.style.setProperty("--pcr-color",d),l.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:t,color:o}of e._swatchColors)t.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",d)}}),hue:q({lock:"v"===i?"h":"v",element:e._root.hue.picker,wrapper:e._root.hue.slider,onstop:()=>e._emit("changestop","slider",e),onchange(o){if(!t.hue||!t.palette)return;const n=a();e._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,l.palette.trigger()}}),opacity:q({lock:"v"===n?"h":"v",element:e._root.opacity.picker,wrapper:e._root.opacity.slider,onstop:()=>e._emit("changestop","slider",e),onchange(o){if(!t.opacity||!t.palette)return;const n=a();e._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,l.palette.trigger()}}),selectable:T({elements:e._root.interaction.options,className:"active",onchange(t){e._representation=t.target.getAttribute("data-type").toUpperCase(),e._recalc&&e._updateOutput("swatch")}})};this._components=l}_bindEvents(){const{_root:e,options:t}=this,o=[i(e.interaction.clear,"click",(()=>this._clearColor())),i([e.interaction.cancel,e.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(e.interaction.save,"click",(()=>{!this.applyColor()&&!t.showAlways&&this.hide()})),i(e.interaction.result,["keyup","input"],(e=>{this.setColor(e.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),e.stopImmediatePropagation()})),i(e.interaction.result,["focus","blur"],(e=>{this._recalc="blur"===e.type,this._recalc&&this._updateOutput(null)})),i([e.palette.palette,e.palette.picker,e.hue.slider,e.hue.picker,e.opacity.slider,e.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!t.showAlways){const n=t.closeWithKey;o.push(i(e.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(e=>this.isOpen()&&(e.key===n||e.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(t=>{this.isOpen()&&!s(t).some((t=>t===e.app||t===e.button))&&this.hide()}),{capture:!0}))}if(t.adjustableNumbers){const t={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};d(e.interaction.result,((e,o,n)=>{const i=t[this.getColorRepresentation().toLowerCase()];if(i){const t=i[n],a=e+(t>=100?1e3*o:o);return a<=0?0:Number((a<t?a:t).toPrecision(3))}return e}))}if(t.autoReposition&&!t.inline){let e=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(t.closeOnScroll&&n.hide(),null===e?(e=setTimeout((()=>e=null),100),requestAnimationFrame((function t(){n._rePositioningPicker(),null!==e&&requestAnimationFrame(t)}))):(clearTimeout(e),e=setTimeout((()=>e=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:e}=this;if(!e.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:e.position})){const e=this._root.app,t=e.getBoundingClientRect();e.style.top=(window.innerHeight-t.height)/2+"px",e.style.left=(window.innerWidth-t.width)/2+"px"}}_updateOutput(e){const{_root:t,_color:o,options:n}=this;if(t.interaction.type()){const e=`to${t.interaction.type().getAttribute("data-type")}`;t.interaction.result.value="function"==typeof o[e]?o[e]().toString(n.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,e,this)}_clearColor(e=!1){const{_root:t,options:o}=this;o.useAsButton||t.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),t.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||e||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(e){const{values:t,type:o,a:n}=function(e){e=e.match(/^[a-zA-Z]+$/)?function(e){if("black"===e.toLowerCase())return"#000";const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,"#000"===t.fillStyle?null:t.fillStyle}(e):e;const t={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=e=>e.map((e=>/^(|\d+)\.\d+|\d+$/.test(e)?Number(e):void 0));let n;e:for(const i in t)if(n=t[i].exec(e))switch(i){case"cmyk":{const[,e,t,a,l]=o(n);if(e>100||t>100||a>100||l>100)break e;return{values:v(e,t,a,l),type:i}}case"rgba":{let[,e,,t,,a,,,l]=o(n);if(e="%"===n[2]?e/100*255:e,t="%"===n[4]?t/100*255:t,a="%"===n[6]?a/100*255:a,l="%"===n[9]?l/100:l,e>255||t>255||a>255||l<0||l>1)break e;return{values:[...b(e,t,a),l],a:l,type:i}}case"hexa":{let[,e]=n;4!==e.length&&3!==e.length||(e=e.split("").map((e=>e+e)).join(""));const t=e.substring(0,6);let o=e.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(t),o],a:o,type:i}}case"hsla":{let[,e,t,a,,l]=o(n);if(l="%"===n[6]?l/100:l,e>360||t>100||a>100||l<0||l>1)break e;return{values:[...y(e,t,a),l],a:l,type:i}}case"hsva":{let[,e,t,a,,l]=o(n);if(l="%"===n[6]?l/100:l,e>360||t>100||a>100||l<0||l>1)break e;return{values:[e,t,a,l],a:l,type:i}}}return{values:null,type:null}}(e),{lockOpacity:i}=this.options,a=void 0!==n&&1!==n;return t&&3===t.length&&(t[3]=void 0),{values:!t||i&&a?null:t,type:o}}_t(e){return this.options.i18n[e]||E.I18N_DEFAULTS[e]}_emit(e,...t){this._eventListener[e].forEach((e=>e(...t,this)))}on(e,t){return this._eventListener[e].push(t),this}off(e,t){const o=this._eventListener[e]||[],n=o.indexOf(t);return~n&&o.splice(n,1),this}addSwatch(e){const{values:t}=this._parseLocalColor(e);if(t){const{_swatchColors:e,_root:o}=this,n=C(...t),a=l(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(a),e.push({el:a,color:n}),this._eventBindings.push(i(a,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this)}))),!0}return!1}removeSwatch(e){const t=this._swatchColors[e];if(t){const{el:o}=t;return this._root.swatches.removeChild(o),this._swatchColors.splice(e,1),!0}return!1}applyColor(e=!1){const{preview:t,button:o}=this._root,n=this._color.toRGBA().toString(0);return t.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||e||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((e=>a(...e))),Object.keys(this._components).forEach((e=>this._components[e].destroy()))}destroyAndRemove(){this.destroy();const{root:e,app:t}=this._root;e.parentElement&&e.parentElement.removeChild(e),t.parentElement.removeChild(t),Object.keys(this).forEach((e=>this[e]=null))}hide(){return!!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return!this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(e=360,t=0,o=0,n=1,i=!1){const a=this._recalc;if(this._recalc=!1,e<0||e>360||t<0||t>100||o<0||o>100||n<0||n>1)return!1;this._color=C(e,t,o,n);const{hue:l,opacity:r,palette:s}=this._components;return l.update(e/360),r.update(n),s.update(t/100,1-o/100),i||this.applyColor(),a&&this._updateOutput(),this._recalc=a,!0}setColor(e,t=!1){if(null===e)return this._clearColor(t),!0;const{values:o,type:n}=this._parseLocalColor(e);if(o){const e=n.toUpperCase(),{options:i}=this._root.interaction,a=i.find((t=>t.getAttribute("data-type")===e));if(a&&!a.hidden)for(const e of i)e.classList[e===a?"add":"remove"]("active");return!!this.setHSVA(...o,t)&&this.setColorRepresentation(e)}return!1}setColorRepresentation(e){return e=e.toUpperCase(),!!this._root.interaction.options.find((t=>t.getAttribute("data-type").startsWith(e)&&!t.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return t.default})(),e.exports=o()})),Rt=Pt(Ht);function Zt(e){const{el:t,isView:o,containerEl:n,swatches:i,opacity:a,defaultColor:l}=e;return{el:t,container:o?document.body:n,theme:"nano",appClass:"toolbar-pickr",swatches:i,lockOpacity:!a,default:l,position:"left-middle",components:{preview:!0,hue:!0,opacity:!!a,interaction:{hex:!0,rgba:!0,hsla:!0,input:!0,cancel:!0,save:!0}}}}function jt(e){e.hide()}function Wt(e,t){let o;return t.forEach(((t,n)=>{t.id===e&&(o=n)})),o}class Xt extends e.PluginSettingTab{constructor(e,t){super(e,t),this.plugin=t,addEventListener("cMenuToolbar-NewCommand",(()=>{k(),F(e,this.plugin),this.display()}))}display(){const{containerEl:o}=this;let i;o.empty(),o.createEl("h1",{text:"Obsidian Editing Toolbar"}),o.createEl("span",{text:" 作者: "}).createEl("a",{text:"Cuman ✨",href:"https://github.com/cumany"}),o.createEl("span",{text:" 教程: "}).createEl("a",{text:"pkmer.cn",href:"https://pkmer.cn/show/20230329145815"}),o.createEl("h2",{text:u("Plugin Settings")}),new e.Setting(o).setName(u("Editing Toolbar append method")).setDesc(u("Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.")).addDropdown((e=>{let t={};b.map((e=>t[e]=e)),e.addOptions(t),e.setValue(this.plugin.settings.appendMethod).onChange((e=>{this.plugin.settings.appendMethod=e,this.plugin.saveSettings()}))})),new e.Setting(o).setName(u("Editing Toolbar aesthetic")).setDesc(u("Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.")).addDropdown((e=>{let t={};v.map((e=>t[e]=e)),e.addOptions(t),e.setValue(this.plugin.settings.aestheticStyle).onChange((e=>{this.plugin.settings.aestheticStyle=e,this.plugin.saveSettings(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))})),new e.Setting(o).setName(u("Editing Toolbar position")).setDesc(u("Choose between fixed position or cursor following mode.")).addDropdown((e=>{let t={};y.map((e=>t[e]=e)),e.addOptions(t),e.setValue(this.plugin.settings.positionStyle).onChange((e=>{this.plugin.settings.positionStyle=e,this.plugin.saveSettings(),dispatchEvent(new Event("cMenuToolbar-NewCommand"))}))})),"top"==this.plugin.settings.positionStyle&&new e.Setting(o).setName(u("Editing Toolbar Auto-hide")).setDesc(u("The toolbar is displayed when the mouse moves over it, otherwise it is automatically hidden")).addToggle((e=>{var t;return e.setValue(null===(t=this.plugin.settings)||void 0===t?void 0:t.autohide).onChange((e=>{this.plugin.settings.autohide=e,this.plugin.saveSettings(),setTimeout((()=>{this.display(),dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))})),"fixed"==this.plugin.settings.positionStyle&&new e.Setting(o).setName(u("Editing Toolbar columns")).setDesc(u("Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.")).addSlider((o=>{o.setLimits(1,32,1).setValue(this.plugin.settings.cMenuNumRows).onChange(e.debounce((e=>t(this,void 0,void 0,(function*(){this.plugin.settings.cMenuNumRows=e,yield this.plugin.saveSettings()}))),100,!0)).setDynamicTooltip()})),new e.Setting(o).setName(u("Mobile enabled or not")).setDesc(u("Whether to enable on mobile devices with device width less than 768px, the default is disable.")).addToggle((e=>{var t,o;return e.setValue(null!==(o=null===(t=this.plugin.settings)||void 0===t?void 0:t.isLoadOnMobile)&&void 0!==o&&o).onChange((e=>{this.plugin.settings.isLoadOnMobile=e,this.plugin.saveSettings(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))})),new e.Setting(o).setName(u("Editing Toolbar refresh")).setDesc(u("Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.")).addButton((e=>{e.setIcon("cMenuToolbarReload").setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonRefresh").setTooltip(u("Refresh")).onClick((()=>{setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log("%ccMenuToolbar refreshed","color: Violet")}))})),new e.Setting(o).setName(u("🎨 Set custom background")).setDesc(u("Click on the picker to adjust the colour")).setClass("custom_bg").then((e=>{for(let n=0;n<5;n++)this.pickr=Rt.create(Zt({isView:i,el:e.controlEl.createDiv({cls:"picker"}),containerEl:o,swatches:null,opacity:!0,defaultColor:this.plugin.settings[`custom_bg${n+1}`]})).on("save",((e,o)=>t(this,void 0,void 0,(function*(){e&&(this.plugin.settings[`custom_bg${n+1}`]=e.toHEXA().toString(),yield this.plugin.saveSettings(),o.hide(),o.addSwatch(e.toHEXA().toString()))})))).on("show",(()=>{const{result:e}=this.pickr.getRoot().interaction;requestAnimationFrame((()=>requestAnimationFrame((()=>e.select()))))})).on("cancel",jt)})),new e.Setting(o).setName(u("🖌️ Set custom font color")).setDesc(u("Click on the picker to adjust the colour")).setClass("custom_font").then((e=>{for(let n=0;n<5;n++)this.pickr=Rt.create(Zt({isView:i,el:e.controlEl.createDiv({cls:"picker"}),containerEl:o,swatches:null,opacity:!0,defaultColor:this.plugin.settings[`custom_fc${n+1}`]})).on("save",((e,o)=>t(this,void 0,void 0,(function*(){e&&(this.plugin.settings[`custom_fc${n+1}`]=e.toHEXA().toString(),yield this.plugin.saveSettings(),o.hide(),o.addSwatch(e.toHEXA().toString()))})))).on("show",(()=>{const{result:e}=this.pickr.getRoot().interaction;requestAnimationFrame((()=>requestAnimationFrame((()=>e.select()))))})).on("cancel",jt)})),new e.Setting(o).setName(u("Editing Toolbar commands")).setDesc(u("Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.")).addButton((e=>{e.setIcon("cMenuToolbarAdd").setTooltip(u("Add")).setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonAdd").onClick((()=>{new p(this.plugin).open(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))}));const a=o.createEl("div",{cls:"cMenuToolbarSettingsTabsContainer"});let l="";wt.create(a,{group:"item",animation:500,draggable:".setting-item",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",dragoverBubble:!1,forceFallback:!0,fallbackOnBody:!0,swapThreshold:.7,fallbackClass:"sortable-fallback",easing:"cubic-bezier(1, 0, 0, 1)",onSort:e=>{if(e.from.className===e.to.className){const t=this.plugin.settings.menuCommands,[o]=t.splice(e.oldIndex,1);t.splice(e.newIndex,0,o),this.plugin.saveSettings()}setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),300)},onStart:function(e){l=e.item.className}}),this.plugin.settings.menuCommands.forEach(((o,i)=>{const r=new e.Setting(a);if("SubmenuCommands"in o){if(r.settingEl.setAttribute("data-id",o.id),r.setClass("cMenuToolbarCommandItem").setClass("cMenuToolbarCommandsubItem").setName(o.name).addButton((e=>{e.setClass("cMenuToolbarSettingsIcon").onClick((()=>t(this,void 0,void 0,(function*(){new h(this.plugin,o,!1).open()})))),S(o.icon)?e.buttonEl.innerHTML=o.icon:e.setIcon(o.icon)})).addButton((e=>{e.setIcon("cMenuToolbarDelete").setTooltip(u("Delete")).setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonDelete").onClick((()=>t(this,void 0,void 0,(function*(){this.plugin.settings.menuCommands.remove(o),yield this.plugin.saveSettings(),this.display(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log(`%cCommand '${o.name}' was removed from cMenuToolbar`,"color: #989cab")}))))})),"cMenuToolbar-plugin:change-font-color"==o.id)return;if("cMenuToolbar-plugin:change-background-color"==o.id)return;const n=r.settingEl.createEl("div",{cls:"cMenuToolbarSettingsTabsContainer_sub"});wt.create(n,{group:{name:"item",pull:!0,put:function(){return!l.includes("cMenuToolbarCommandsubItem")}},draggable:".setting-item",animation:150,ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",dragoverBubble:!1,fallbackOnBody:!0,swapThreshold:.7,forceFallback:!0,fallbackClass:"sortable-fallback",easing:"cubic-bezier(1, 0, 0, 1)",onStart:function(){},onSort:e=>{var t,o,n;if(e.from.className===e.to.className){const o=null===(t=this.plugin.settings.menuCommands[i])||void 0===t?void 0:t.SubmenuCommands;if(o){const[t]=o.splice(e.oldIndex,1);o.splice(e.newIndex,0,t),this.plugin.saveSettings()}}else if("cMenuToolbarSettingsTabsContainer"===e.to.className){const t=this.plugin.settings.menuCommands;const n=null===(o=t[Wt(e.target.parentElement.dataset.id,t)])||void 0===o?void 0:o.SubmenuCommands;if(n){const[o]=n.splice(e.oldIndex,1);t.splice(e.newIndex,0,o),this.plugin.saveSettings()}else console.error("Subresult is undefined.")}else if("cMenuToolbarSettingsTabsContainer"===e.from.className){const t=this.plugin.settings.menuCommands,o=null===(n=t[Wt(e.target.parentElement.dataset.id,t)])||void 0===n?void 0:n.SubmenuCommands;if(o){const[n]=t.splice(e.oldIndex,1);o.splice(e.newIndex,0,n),this.plugin.saveSettings()}else console.error("Subresult is undefined.")}setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),300)}}),o.SubmenuCommands.forEach((i=>{const a=new e.Setting(n);a.setClass("cMenuToolbarCommandItem").addButton((e=>{e.setClass("cMenuToolbarSettingsIcon").onClick((()=>t(this,void 0,void 0,(function*(){new h(this.plugin,i,!0).open()})))),S(null==i?void 0:i.icon)?e.buttonEl.innerHTML=i.icon:e.setIcon(i.icon)})).setName(i.name).addButton((e=>{e.setIcon("pencil").setTooltip(u("Change Command name")).setClass("cMenuToolbarSettingsButton").onClick((()=>t(this,void 0,void 0,(function*(){new m(this.app,this.plugin,i,!0).open()}))))})).addButton((e=>{e.setIcon("cMenuToolbarDelete").setTooltip(u("Delete")).setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonDelete").onClick((()=>t(this,void 0,void 0,(function*(){o.SubmenuCommands.remove(i),yield this.plugin.saveSettings(),this.display(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log(`%cCommand '${o.name}' was removed from cMenuToolbar`,"color: #989cab")}))))})),a.nameEl}))}else r.addButton((e=>{e.setClass("cMenuToolbarSettingsIcon").onClick((()=>t(this,void 0,void 0,(function*(){new h(this.plugin,o,!1).open()})))),S(o.icon)?e.buttonEl.innerHTML=o.icon:e.setIcon(o.icon)})),"cMenuToolbar-Divider-Line"==o.id&&r.setClass("cMenuToolbar-Divider-Line"),r.setClass("cMenuToolbarCommandItem").setName(o.name).addButton((e=>{e.setIcon("pencil").setTooltip(u("Change Command name")).setClass("cMenuToolbarSettingsButton").onClick((()=>t(this,void 0,void 0,(function*(){new m(this.app,this.plugin,o,!1).open()}))))})).addButton((e=>{e.setIcon("cMenuToolbarSub").setTooltip(u("Add submenu")).setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonaddsub").onClick((()=>t(this,void 0,void 0,(function*(){const e={id:"SubmenuCommands-"+n(1),name:"submenu",icon:"remix-Filter3Line",SubmenuCommands:[]};this.plugin.settings.menuCommands.splice(i+1,0,e),yield this.plugin.saveSettings(),this.display(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log(`%cCommand '${e.id}' add `,"color: #989cab")}))))})).addButton((e=>{e.setIcon("vertical-split").setTooltip(u("add hr")).setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonaddsub").onClick((()=>t(this,void 0,void 0,(function*(){this.plugin.settings.menuCommands.splice(i+1,0,{id:"cMenuToolbar-Divider-Line",name:"HR",icon:"vertical-split"}),yield this.plugin.saveSettings(),this.display(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))))})).addButton((e=>{e.setIcon("cMenuToolbarDelete").setTooltip(u("Delete")).setClass("cMenuToolbarSettingsButton").setClass("cMenuToolbarSettingsButtonDelete").onClick((()=>t(this,void 0,void 0,(function*(){this.plugin.settings.menuCommands.remove(o),yield this.plugin.saveSettings(),this.display(),setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log(`%cCommand '${o.name}' was removed from cMenuToolbar`,"color: #989cab")}))))}))}))}hide(){setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),this.pickr.destroyAndRemove()}}const Yt={cMenuToolbar:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M19 10H5c-1.103 0-2 .897-2 2v8c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-8c0-1.103-.897-2-2-2zM5 20v-8h14l.002 8H5zM5 6h14v2H5zm2-4h10v2H7z" fill="currentColor"/></svg>',cMenuToolbarSub:'<svg t="1661526346488" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16880" ><path d="M597.333333 85.333333h-341.333333C187.733333 85.333333 128 140.8 128 213.333333v597.333334c0 72.533333 59.733333 128 128 128h426.666667c72.533333 0 128-55.466667 128-128V298.666667l-213.333334-213.333334z m170.666667 725.333334c0 46.933333-38.4 85.333333-85.333333 85.333333H256c-46.933333 0-85.333333-38.4-85.333333-85.333333V213.333333c0-46.933333 38.4-85.333333 85.333333-85.333333h298.666667v213.333333h213.333333v469.333334z m-320-234.666667h128c12.8 0 21.333333 8.533333 21.333333 21.333333s-8.533333 21.333333-21.333333 21.333334h-128v128c0 12.8-8.533333 21.333333-21.333333 21.333333s-21.333333-8.533333-21.333334-21.333333v-128h-128c-12.8 0-21.333333-8.533333-21.333333-21.333334s8.533333-21.333333 21.333333-21.333333h128v-128c0-12.8 8.533333-21.333333 21.333334-21.333333s21.333333 8.533333 21.333333 21.333333v128z" fill="#8a8a8a" p-id="16881"></path></svg>',cMenuToolbarAdd:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z" fill="white"/><path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10s10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8s8 3.589 8 8s-3.589 8-8 8z" fill="white"/></svg>',cMenuToolbarDelete:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z" fill="white"/><path d="M9 10h2v8H9zm4 0h2v8h-2z" fill="white"/></svg>',cMenuToolbarReload:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M19 10H5c-1.103 0-2 .897-2 2v8c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-8c0-1.103-.897-2-2-2zM5 20v-8h14l.002 8H5zM5 6h14v2H5zm2-4h10v2H7z" fill="white"/></svg>',"codeblock-glyph":'<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zM4 19V7h16l.002 12H4z" fill="currentColor"/><path d="M9.293 9.293L5.586 13l3.707 3.707l1.414-1.414L8.414 13l2.293-2.293zm5.414 0l-1.414 1.414L15.586 13l-2.293 2.293l1.414 1.414L18.414 13z"/></svg>',"underline-glyph":'<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 1024 1024"><path fill="currentColor" d="M824 804H200c-4.4 0-8 3.4-8 7.6v60.8c0 4.2 3.6 7.6 8 7.6h624c4.4 0 8-3.4 8-7.6v-60.8c0-4.2-3.6-7.6-8-7.6zm-312-76c69.4 0 134.6-27.1 183.8-76.2C745 602.7 772 537.4 772 468V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 97-79 176-176 176s-176-79-176-176V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 69.4 27.1 134.6 76.2 183.8C377.3 701 442.6 728 512 728z"/></svg>',"superscript-glyph":'<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor"d="M16 7.41L11.41 12L16 16.59L14.59 18L10 13.41L5.41 18L4 16.59L8.59 12L4 7.41L5.41 6L10 10.59L14.59 6L16 7.41M21.85 9h-4.88V8l.89-.82c.76-.64 1.32-1.18 1.7-1.63c.37-.44.56-.85.57-1.23a.884.884 0 0 0-.27-.7c-.18-.19-.47-.28-.86-.29c-.31.01-.58.07-.84.17l-.66.39l-.45-1.17c.27-.22.59-.39.98-.53S18.85 2 19.32 2c.78 0 1.38.2 1.78.61c.4.39.62.93.62 1.57c-.01.56-.19 1.08-.54 1.55c-.34.48-.76.93-1.27 1.36l-.64.52v.02h2.58V9z"/></svg>',"subscript-glyph":'<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M16 7.41L11.41 12L16 16.59L14.59 18L10 13.41L5.41 18L4 16.59L8.59 12L4 7.41L5.41 6L10 10.59L14.59 6L16 7.41m5.85 13.62h-4.88v-1l.89-.8c.76-.65 1.32-1.19 1.7-1.63c.37-.44.56-.85.57-1.24a.898.898 0 0 0-.27-.7c-.18-.16-.47-.28-.86-.28c-.31 0-.58.06-.84.18l-.66.38l-.45-1.17c.27-.21.59-.39.98-.53s.82-.24 1.29-.24c.78.04 1.38.25 1.78.66c.4.41.62.93.62 1.57c-.01.56-.19 1.08-.54 1.55c-.34.47-.76.92-1.27 1.36l-.64.52v.02h2.58v1.35z"/></svg>',"bot-glyph":'<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M21.928 11.607c-.202-.488-.635-.605-.928-.633V8c0-1.103-.897-2-2-2h-6V4.61c.305-.274.5-.668.5-1.11a1.5 1.5 0 0 0-3 0c0 .442.195.836.5 1.11V6H5c-1.103 0-2 .897-2 2v2.997l-.082.006A1 1 0 0 0 1.99 12v2a1 1 0 0 0 1 1H3v5c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5a1 1 0 0 0 1-1v-1.938a1.006 1.006 0 0 0-.072-.455zM5 20V8h14l.001 3.996L19 12v2l.001.005l.001 5.995H5z" fill="currentColor"/><ellipse cx="8.5" cy="12" rx="1.5" ry="2" fill="currentColor"/><ellipse cx="15.5" cy="12" rx="1.5" ry="2" fill="currentColor"/><path d="M8 16h8v2H8z" fill="currentColor"/></svg>',"header-1":'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill="currentColor" d="M835.626667 349.397333A42.666667 42.666667 0 0 1 853.333333 384v426.666667a42.666667 42.666667 0 0 1-85.333333 0v-367.488l-71.850667 23.978666a42.666667 42.666667 0 0 1-26.965333-80.981333l128-42.666667a42.666667 42.666667 0 0 1 38.4 5.888zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1635"></path></svg>',"header-2":'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M768 426.666667a85.333333 85.333333 0 0 0-85.333333 85.333333v21.333333a42.666667 42.666667 0 1 1-85.333334 0V512a170.666667 170.666667 0 0 1 170.666667-170.666667h7.338667a163.328 163.328 0 0 1 115.498666 278.869334L742.997333 768H896a42.666667 42.666667 0 1 1 0 85.333333h-256a42.666667 42.666667 0 0 1-30.165333-72.832l220.672-220.672A77.994667 77.994667 0 0 0 775.338667 426.666667H768zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1791"></path></svg>',"header-3":'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M597.333333 384a42.666667 42.666667 0 0 1 42.666667-42.666667h256a42.666667 42.666667 0 0 1 30.165333 72.832l-105.941333 105.984A170.752 170.752 0 0 1 768 853.333333a170.666667 170.666667 0 0 1-160.938667-113.877333 42.666667 42.666667 0 0 1 80.469334-28.373333A85.333333 85.333333 0 1 0 768 597.333333h-42.666667a42.666667 42.666667 0 0 1-30.165333-72.832L793.002667 426.666667H640a42.666667 42.666667 0 0 1-42.666667-42.666667zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1949"></path></svg>',"header-4":'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M780.714667 343.296a42.666667 42.666667 0 0 1 28.032 53.418667L719.36 682.666667H896a42.666667 42.666667 0 1 1 0 85.333333h-234.666667a42.666667 42.666667 0 0 1-40.704-55.381333l106.666667-341.333334a42.666667 42.666667 0 0 1 53.418667-27.989333z" p-id="2107"></path><path d="M853.333333 554.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v213.333334a42.666667 42.666667 0 1 1-85.333333 0v-213.333334a42.666667 42.666667 0 0 1 42.666666-42.666666zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2108"></path></svg>',"header-5":'\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M683.946667 373.674667A42.666667 42.666667 0 0 1 725.333333 341.333333h170.666667a42.666667 42.666667 0 1 1 0 85.333334h-137.301333l-22.016 88.234666A170.666667 170.666667 0 1 1 640 795.562667a42.666667 42.666667 0 1 1 64-56.448 85.333333 85.333333 0 1 0 0-112.896 42.666667 42.666667 0 0 1-73.386667-38.528l53.333334-214.016zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2264"></path></svg>',"header-6":'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M831.274667 303.957333a42.666667 42.666667 0 0 1 16.725333 57.984l-83.498667 151.466667a170.453333 170.453333 0 0 1 88.746667 22.741333 169.557333 169.557333 0 0 1 62.506667 232.277334 171.093333 171.093333 0 0 1-232.96 62.165333 169.557333 169.557333 0 0 1-62.805334-231.850667l153.301334-278.016a42.666667 42.666667 0 0 1 57.984-16.768z m-20.48 306.176a85.76 85.76 0 0 0-116.736 31.018667 84.224 84.224 0 0 0 31.189333 115.456 85.76 85.76 0 0 0 116.736-31.018667 84.224 84.224 0 0 0-31.232-115.456zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2422"></path></svg>',"header-n":'<svg viewBox="0 0 24 24" ><path d="M2 3a1 1 0 0 0-1 1v16a1 1 0 1 0 2 0v-7h9v7a1 1 0 1 0 2 0V4a1 1 0 1 0-2 0v7H3V4a1 1 0 0 0-1-1Zm14 9a1 1 0 0 1 1.984-.177 4.099 4.099 0 0 1 1.757-.576 3.447 3.447 0 0 1 3.759 3.432V20a1 1 0 1 1-2 0v-5.32c0-.851-.73-1.519-1.578-1.442A2.114 2.114 0 0 0 18 15.344V20a1 1 0 1 1-2 0v-8Z" fill="currentColor"></path></svg>',obsidian:'<svg viewBox="0 0 100 100" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="logo-wireframe"><path d="M 30.91 17.52 L 34.43 35.7 M 61.44 14.41 L 62.61 0 M 34.43 35.7 L 37.57 90.47 M 81 26.39 L 61.44 14.41 L 34.43 35.7 L 65.35 100 M 62.61 0 L 30.91 17.52 L 18 45.45 L 37.57 90.47 L 65.35 100 L 70.44 89.8 L 81 26.39 L 62.61 0 Z"></path></svg>'};function Gt(){Object.keys(Yt).forEach((t=>{e.addIcon(t,Yt[t])}))}let Ut,Kt;class Jt extends e.Plugin{constructor(){super(...arguments),this.modCommands=[{id:"editor:insert-embed",name:"Add embed",icon:"note-glyph"},{id:"editor:insert-link",name:"Insert markdown link",icon:"link-glyph"},{id:"editor:insert-tag",name:"Add tag",icon:"price-tag-glyph"},{id:"editor:insert-wikilink",name:"Add internal link",icon:"bracket-glyph"},{id:"editor:toggle-bold",name:"Toggle bold",icon:"bold-glyph"},{id:"editor:toggle-italics",name:"Toggle italics",icon:"italic-glyph"},{id:"editor:toggle-strikethrough",name:"Toggle strikethrough",icon:"strikethrough-glyph"},{id:"editor:toggle-code",name:"Toggle code",icon:"code-glyph"},{id:"editor:toggle-blockquote",name:"Toggle blockquote",icon:"lucide-text-quote"},{id:"editor:toggle-bullet-list",name:"Toggle bullet",icon:"bullet-list-glyph"},{id:"editor:toggle-checklist-status",name:"Toggle checklist status",icon:"checkbox-glyph"},{id:"editor:toggle-comments",name:"Toggle comment",icon:"percent-sign-glyph"},{id:"editor:toggle-highlight",name:"Toggle highlight",icon:"highlight-glyph"},{id:"editor:toggle-numbered-list",name:"Toggle numbered list",icon:"number-list-glyph"},{id:"editor:insert-callout",name:"Toggle Callout ",icon:"lucide-quote"},{id:"editor:insert-mathblock",name:"Toggle MathBlock",icon:"lucide-sigma-square"},{id:"editor:toggle-inline-math",name:"Toggle inline math",icon:"lucide-sigma"},{id:"editor:insert-table",name:"Toggle table",icon:"lucide-table"},{id:"editor:swap-line-up",name:"Toggle swap line up",icon:"lucide-corner-right-up"},{id:"editor:swap-line-down",name:"Toggle swap line down",icon:"lucide-corner-right-down"},{id:"editor:attach-file",name:"Toggle upload attach file",icon:"lucide-paperclip"},{id:"editor:clear-formatting",name:"Toggle clear formatting",icon:"lucide-eraser"},{id:"editor:cycle-list-checklist",name:"Toggle cycle list checklist",icon:"lucide-check-square"}],this.handlecMenuToolbar=()=>{if(1==this.settings.cMenuVisibility){let e=q(this.app,this.settings);if(e)if("following"!=this.settings.positionStyle)try{e.style.visibility="visible"}catch(t){console.log(e,"toolbar_error")}else try{e.style.visibility="hidden"}catch(t){console.log(e,"toolbar_error")}else setTimeout((()=>{F(this.app,this)}),100)}},this.handlecMenuToolbar_layout=()=>{if(1!=this.settings.cMenuVisibility)return!1;{let e=q(this.app,this.settings),t=!0;_(app)&&t?_(app)&&(e?"following"==this.settings.positionStyle?e.style.visibility="hidden":e.style.visibility="visible":setTimeout((()=>{F(this.app,this)}),100)):e&&(e.style.visibility="hidden")}},this.handlecMenuToolbar_resize=()=>{var t;if(1!=this.settings.cMenuVisibility||"top"!=this.settings.positionStyle)return!1;if(_(app)){let o=null!==(t=this.app.workspace.activeLeaf.view.leaf.width)&&void 0!==t?t:0;if(this.Leaf_Width==o)return!1;if(o>0&&(this.Leaf_Width=o,this.settings.cMenuWidth&&o)){if(o-this.settings.cMenuWidth<78&&o>this.settings.cMenuWidth)return;setTimeout((()=>{(function(){C=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let t=C,o=t.querySelectorAll("#cMenuToolbarModalBar"),n=t.querySelectorAll("#cMenuToolbarPopoverBar");o.forEach((e=>{e&&(e.firstChild&&e.removeChild(e.firstChild),e.remove())})),n.forEach((e=>{e&&(e.firstChild&&e.removeChild(e.firstChild),e.remove())}))})(),F(app,this)}),200)}}}}onload(){return t(this,void 0,void 0,(function*(){console.log("cMenuToolbar v"+this.manifest.version+" loaded"),Kt=e.requireApiVersion("0.15.0")?activeWindow.document:window.document,yield this.loadSettings(),this.addSettingTab(new Xt(this.app,this)),Gt(),this.generateCommands(),this.app.workspace.onLayoutReady((()=>{setTimeout((()=>{this.setupStatusBar()}))})),this.init_evt(Kt),e.requireApiVersion("0.15.0")&&this.app.workspace.on("window-open",(e=>{this.init_evt(e.doc)}));app.plugins.enabledPlugins.has("obsidian-memos")&&this.registerEvent(this.app.workspace.on("thino-editor-created",this.handlecMenuToolbar)),this.registerEvent(this.app.workspace.on("active-leaf-change",this.handlecMenuToolbar)),this.registerEvent(this.app.workspace.on("layout-change",this.handlecMenuToolbar_layout)),this.registerEvent(this.app.workspace.on("resize",this.handlecMenuToolbar_resize)),1==this.settings.cMenuVisibility&&setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100)}))}isLoadMobile(){var t;let o=window.innerWidth>0?window.innerWidth:screen.width,n=!!(null===(t=this.settings)||void 0===t?void 0:t.isLoadOnMobile)&&this.settings.isLoadOnMobile;return!(e.Platform.isMobileApp&&!n&&o<=768)||(console.log("editing toolbar disable loading on mobile"),!1)}init_evt(e){this.EN_FontColor_Format_Brush=!1,this.EN_BG_Format_Brush=!1,this.EN_Text_Format_Brush=!1,this.registerDomEvent(e,"mouseup",(e=>t(this,void 0,void 0,(function*(){var t;if(e.button&&(this.EN_FontColor_Format_Brush||this.EN_BG_Format_Brush||this.EN_Text_Format_Brush)&&L(this),!this.isView())return;let o=null===(t=app.workspace.activeLeaf.view)||void 0===t?void 0:t.editor;if(o.hasFocus()){let e=q(this.app,this.settings);if(null==o.getSelection()||""==o.getSelection())return void(e&&"following"==this.settings.positionStyle&&(e.style.visibility="hidden"));this.EN_FontColor_Format_Brush?B(this.app,this.settings.cMenuFontColor):this.EN_BG_Format_Brush?A(this.app,this.settings.cMenuBackgroundColor):this.EN_Text_Format_Brush?I(this.app,this):"following"==this.settings.positionStyle&&O(this.app,this.settings)}else(this.EN_FontColor_Format_Brush||this.EN_BG_Format_Brush||this.EN_Text_Format_Brush)&&L(this)})))),this.registerDomEvent(Kt,"keydown",(e=>{if("following"!==this.settings.positionStyle)return;const t=q(this.app,this.settings);!e.shiftKey&&t&&(t.style.visibility="hidden")})),this.registerDomEvent(Kt,"wheel",(()=>{if("following"!==this.settings.positionStyle)return;const e=q(this.app,this.settings);e&&(e.style.visibility="hidden")}))}generateCommands(){this.addCommand({id:"hide-show-menu",name:"Hide/show ",icon:"cMenuToolbar",callback:()=>t(this,void 0,void 0,(function*(){this.settings.cMenuVisibility=!this.settings.cMenuVisibility,1==this.settings.cMenuVisibility?setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100):r(this.settings.cMenuVisibility),k(),yield this.saveSettings()}))}),this.addCommand({id:"format-eraser",name:"Format Eraser",callback:()=>I(this.app,this),icon:'<svg width="18" height="18" focusable="false" fill="currentColor" viewBox="0 0 1024 1024"><g transform="scale(1, -1) translate(0, -896) scale(0.9, 0.9) "><path class="path" d="M889 512 l-211 211 q-26 27 -61 36 q-35 9 -70 0 q-35 -9 -61 -36 l-351 -350 q-26 -27 -35.5 -62 q-9.5 -35 0 -70 q9.5 -35 35.5 -61 l170 -170 q12 -12 29 -12 l215 0 q17 0 29 12 l311 310 q26 26 35.5 61 q9.5 35 0 70 q-9.5 35 -35.5 61 ZM831 453 q15 -15 15.5 -36.5 q0.5 -21.5 -14.5 -37.5 l-300 -298 l-181 0 l-158 158 q-15 15 -15 37 q0 22 15 38 l351 351 q16 16 38 16 q22 0 37 -16 l212 -212 ZM686 217 l-59 -59 l-317 315 l58 59 l318 -315 ZM883 81 q18 0 30.5 -12 q12.5 -12 12.5 -29 q0 -17 -12.5 -29 q-12.5 -12 -29.5 -13 l-456 0 q-17 0 -29.5 12 q-12.5 12 -12.5 29 q0 17 12 29 q12 12 29 13 l456 0 Z"></path></g></svg>'}),this.addCommand({id:"off-Format-Brush",name:"OFF Format Brush",callback:()=>L(this)}),this.addCommand({id:"change-font-color",name:"Change font color[html]",callback:()=>{var e;return B(app,null!==(e=this.settings.cMenuFontColor)&&void 0!==e?e:"#2DC26B")},icon:'<svg width="24" height="24" focusable="false" fill="currentColor"><g fill-rule="evenodd"><path id="change-font-color-icon" d="M3 18h18v3H3z" style="fill:#2DC26B"></path><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"></path></g></svg>'}),this.addCommand({id:"change-background-color",name:"Change Backgroundcolor[html]",callback:()=>{var e;return A(app,null!==(e=this.settings.cMenuBackgroundColor)&&void 0!==e?e:"#FA541C")},icon:'<svg width="18" height="24" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd"><g ><g fill="currentColor"><g transform="translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)" ><path d="M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z" fill-rule="nonzero"></path><path d="M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z" fill-rule="evenodd"></path><path d="M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z" fill-rule="nonzero"></path></g></g><path d="M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z" id="change-background-color-icon" style="fill:#FA541C"></path></g></g></svg>'}),this.addCommand({id:"indent-list",name:"indent list",callback:()=>{var e;return(null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor).indentList()},icon:"indent-glyph"}),this.addCommand({id:"undent-list",name:"unindent-list",callback:()=>{var e;return(null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor).unindentList()},icon:"unindent-glyph"}),this.addCommand({id:"editor-undo",name:"undo editor",callback:()=>{var e;return(null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor).undo()},icon:"undo-glyph"}),this.addCommand({id:"editor-redo",name:"redo editor",callback:()=>{var e;return(null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor).redo()},icon:"redo-glyph"}),this.addCommand({id:"editor-copy",name:"copy editor",callback:()=>t(this,void 0,void 0,(function*(){var e;const t=null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor;try{yield window.navigator.clipboard.writeText(t.getSelection()),app.commands.executeCommandById("editor:focus")}catch(e){console.error("Copy failed:",e)}})),icon:"lucide-copy"}),this.addCommand({id:"editor-paste",name:"paste editor",callback:()=>t(this,void 0,void 0,(function*(){var e;const t=null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor;try{var o=t.replaceSelection,n=yield window.navigator.clipboard.readText();n&&o.apply(t,[n]),app.commands.executeCommandById("editor:focus")}catch(e){console.error("Paste failed:",e)}})),icon:"lucide-clipboard-type"}),this.addCommand({id:"editor-cut",name:"cut editor",callback:()=>t(this,void 0,void 0,(function*(){var e;const t=null===(e=app.workspace.activeLeaf.view)||void 0===e?void 0:e.editor;try{yield window.navigator.clipboard.writeText(t.getSelection()),t.replaceSelection(""),app.commands.executeCommandById("editor:focus")}catch(e){console.error("Cut failed:",e)}})),icon:"lucide-scissors"}),this.addCommand({id:"fullscreen-focus",name:"Fullscreen focus mode",hotkeys:[{modifiers:["Mod","Shift"],key:"F11"}],callback:()=>function(t){var o;Object.defineProperty(exports,"__esModule",{value:!0}),exports.toggleFull=exports.isFull=exports.exitFull=exports.beFull=void 0;let n=document.documentElement,i=n.querySelector("head"),a=document.createElement("style"),l="requestFullscreen",r="exitFullscreen",s="fullscreenElement";"webkitRequestFullScreen"in n?(l="webkitRequestFullScreen",r="webkitExitFullscreen",s="webkitFullscreenElement"):"msRequestFullscreen"in n?(l="msRequestFullscreen",r="msExitFullscreen",s="msFullscreenElement"):"mozRequestFullScreen"in n?(l="mozRequestFullScreen",r="mozCancelFullScreen",s="mozFullScreenElement"):"requestFullscreen"in n||console.log("当前浏览器不支持Fullscreen API !");const c=t.workspace.getActiveViewOfType(e.MarkdownView);if(!c)return;let d,u=c.containerEl,h=null===(o=document.body)||void 0===o?void 0:o.querySelector(".mod-vertical.mod-root .workspace-tab-container");function p(e){return e instanceof HTMLElement?e:n}function g(e){return p(e)[l]()}function m(){return n.contains(a)&&(null==i||i.removeChild(a)),document[r]()}function f(e){return p(e)===document[s]}d=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){if(f(h))try{document.body.removeChild(e),u.appendChild(e)}catch(e){console.log(e.message)}}))}))})),h.addEventListener("fullscreenchange",(function(){f(h)||d.disconnect()})),f(h)?(d.disconnect(),m()):(g(h),d.observe(document.body,{childList:!0})),exports.beFull=g,exports.exitFull=m,exports.isFull=f,exports.toggleFull=function(e){return f(e)?(m(),!1):(g(e),!0)}}(app),icon:"fullscreen"}),this.addCommand({id:"workplace-fullscreen-focus",name:"workplace-Fullscreen ",callback:()=>function(t){Ut=e.requireApiVersion("0.15.0")?activeWindow.document:window.document;let o=Ut;t.workspace.leftSplit.collapsed&&t.workspace.rightSplit.collapsed?(t.commands.executeCommandById("app:toggle-right-sidebar"),t.commands.executeCommandById("app:toggle-left-sidebar"),t.workspace.leftRibbon.show(),o.body.classList.contains("auto-hide-header")&&o.body.classList.remove("auto-hide-header")):(o.body.classList.contains("auto-hide-header")||o.body.classList.add("auto-hide-header"),t.workspace.leftRibbon.hide(),t.workspace.leftSplit.collapsed||t.commands.executeCommandById("app:toggle-left-sidebar"),t.workspace.rightSplit.collapsed||t.commands.executeCommandById("app:toggle-right-sidebar"))}(app),hotkeys:[{modifiers:["Mod"],key:"F11"}],icon:"remix-SplitCellsHorizontal"}),this.addCommand({id:"header0-text",name:"Remove header level",callback:()=>N(""),hotkeys:[{modifiers:["Mod"],key:"`"}],icon:"heading-glyph"}),this.addCommand({id:"header1-text",name:"Header 1",callback:()=>N("#"),icon:"header-1"}),this.addCommand({id:"header2-text",name:"Header 2",callback:()=>N("##"),icon:"header-2"}),this.addCommand({id:"header3-text",name:"Header 3",callback:()=>N("###"),icon:"header-3"}),this.addCommand({id:"header4-text",name:"Header 4",callback:()=>N("####"),icon:"header-4"}),this.addCommand({id:"header5-text",name:"Header 5",callback:()=>N("#####"),icon:"header-5"}),this.addCommand({id:"header6-text",name:"Header 6",callback:()=>N("######"),icon:"header-6"});const n={hrline:{char:5,line:1,prefix:"\n---",suffix:"\n",islinehead:!0},justify:{char:17,line:0,prefix:'<p align="justify">',suffix:"</p>",islinehead:!1},left:{char:17,line:0,prefix:'<p align="left">',suffix:"</p>",islinehead:!1},right:{char:17,line:0,prefix:'<p align="right">',suffix:"</p>",islinehead:!1},center:{char:8,line:0,prefix:"<center>",suffix:"</center>",islinehead:!1},underline:{char:3,line:0,prefix:"<u>",suffix:"</u>",islinehead:!1},superscript:{char:5,line:0,prefix:"<sup>",suffix:"</sup>",islinehead:!1},subscript:{char:5,line:0,prefix:"<sub>",suffix:"</sub>",islinehead:!1},codeblock:{char:4,line:0,prefix:"\n```\n",suffix:"\n```\n",islinehead:!1}};Object.keys(n).forEach((e=>{this.addCommand({id:`${e}`,name:`Toggle ${e}`,icon:`${e}-glyph`,callback:()=>t(this,void 0,void 0,(function*(){var t;const i=null===(t=app.workspace.activeLeaf.view)||void 0===t?void 0:t.editor;((e,t)=>{const o=t.getSelection(),n=t.getCursor("from"),i=t.getCursor("to");let a=e.prefix;e.islinehead&&n.ch>0&&(a="\n"+a);const l=e.suffix||a,r=o=>{t.setCursor(n.line+e.line*o,i.ch+e.char*o)},s={line:n.line-e.line,ch:n.ch-a.length};if(t.getRange(s,n)==a.trimStart()){const a={line:n.line+e.line,ch:i.ch+l.length};if(t.getRange(i,a)==l.trimEnd())return t.replaceRange(o,s,a),r(-1)}t.replaceSelection(`${a}${o}${l}`),r(1)})(n[e],i),yield o(10),app.commands.executeCommandById("editor:focus")}))})})),this.modCommands.forEach((e=>{this.addCommand({id:`${e.id}`,name:`${e.name}`,icon:`${e.icon}`,callback:()=>t(this,void 0,void 0,(function*(){var t;const n=null===(t=app.workspace.activeLeaf.view)||void 0===t?void 0:t.editor;n.getCursor("from");const i=n.getCursor("to");let a;a="editor:insert-embed"==`${e.id}`?3:"editor:insert-link"==`${e.id}`||"editor:insert-tag"==`${e.id}`?1:"editor:insert-wikilink"==`${e.id}`||"editor:toggle-bold"==`${e.id}`?2:"editor:toggle-italics"==`${e.id}`?1:"editor:toggle-strikethrough"==`${e.id}`?2:"editor:toggle-code"==`${e.id}`?1:"editor:toggle-blockquote"==`${e.id}`||"editor:toggle-bullet-list"==`${e.id}`?2:"editor:toggle-checklist-status"==`${e.id}`?4:"editor:toggle-comments"==`${e.id}`||"editor:toggle-highlight"==`${e.id}`?2:"editor:toggle-numbered-list"==`${e.id}`?3:2,app.commands.executeCommandById(`${e.id}`),"editor:insert-link"!==e.id&&n.setCursor(i.line,i.ch+a),yield o(10),app.commands.executeCommandById("editor:focus")}))})}))}setupStatusBar(){Gt(),this.statusBarIcon=this.addStatusBarItem(),this.statusBarIcon.addClass("cMenuToolbar-statusbar-button"),e.setIcon(this.statusBarIcon,"cMenuToolbar"),this.registerDomEvent(this.statusBarIcon,"click",(()=>{const o=this.statusBarIcon.parentElement.getBoundingClientRect(),n=this.statusBarIcon.getBoundingClientRect(),i=(new e.Menu).addItem((o=>{o.setTitle(u("Hide & Show")),!e.requireApiVersion("0.15.0")||o.setSection("settings");const n=o.dom,i=new e.ToggleComponent(n).setValue(this.settings.cMenuVisibility).setDisabled(!0),a=()=>t(this,void 0,void 0,(function*(){this.settings.cMenuVisibility=!this.settings.cMenuVisibility,i.setValue(this.settings.cMenuVisibility),1==this.settings.cMenuVisibility?setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100):r(this.settings.cMenuVisibility),k(),yield this.saveSettings()}));o.onClick((e=>{e.preventDefault(),e.stopImmediatePropagation(),a()}))}));i.dom.addClass("cMenuToolbar-statusbar-menu"),i.addItem((t=>{t.setIcon("cMenuToolbarAdd"),!e.requireApiVersion("0.15.0")||t.setSection("ButtonAdd"),t.onClick((()=>{new p(this).open()}))})),i.addItem((t=>{t.setIcon("cMenuToolbarReload"),!e.requireApiVersion("0.15.0")||t.setSection("ButtonAdd"),t.onClick((()=>{setTimeout((()=>{dispatchEvent(new Event("cMenuToolbar-NewCommand"))}),100),console.log("%ccMenuToolbar refreshed","color: Violet")}))})),i.addItem((t=>{t.setIcon("sliders"),!e.requireApiVersion("0.15.0")||t.setSection("ButtonAdd"),t.onClick((()=>{new f(this.app,this).open()}))})),i.showAtPosition({x:n.right+5,y:o.top-5})}))}onunload(){k(),console.log("cMenuToolbar unloaded"),this.app.workspace.off("active-leaf-change",this.handlecMenuToolbar),this.app.workspace.off("layout-change",this.handlecMenuToolbar_layout),this.app.workspace.off("resize",this.handlecMenuToolbar_resize)}isView(){const t=app.workspace.getActiveViewOfType(e.ItemView);return"markdown"===(null==t?void 0:t.getViewType())||"thino_view"===(null==t?void 0:t.getViewType())}setIS_MORE_Button(e){this.IS_MORE_Button=e}setEN_BG_Format_Brush(e){this.EN_BG_Format_Brush=e}setEN_FontColor_Format_Brush(e){this.EN_FontColor_Format_Brush=e}setEN_Text_Format_Brush(e){this.EN_Text_Format_Brush=e}setTemp_Notice(e){this.Temp_Notice=e}loadSettings(){return t(this,void 0,void 0,(function*(){this.settings=Object.assign({},w,yield this.loadData())}))}saveSettings(){return t(this,void 0,void 0,(function*(){yield this.saveData(this.settings)}))}}module.exports=Jt;
/* nosourcemap */