lakelib 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lake.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Lake=function(e){"use strict";class t extends HTMLElement{}void 0!==customElements.get("lake-box")&&customElements.define("lake-box",t);class i extends HTMLElement{}void 0!==customElements.get("lake-bookmark")&&customElements.define("lake-bookmark",i);const n=new Map([["plus",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"></path></svg>'],["question",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"></path></svg>'],["more",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path></svg>'],["left",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"></path></svg>'],["right",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path></svg>'],["down",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"></path></svg>'],["check",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"></path></svg>'],["checkCircle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"></path></svg>'],["warningCircle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"></path></svg>'],["open",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.25 4.5A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .966.783 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75v-4a.75.75 0 0 1 1.5 0v4A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h4a.75.75 0 0 1 0 1.5h-4ZM13 3.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-1.5 0V5.56l-5.22 5.22a.75.75 0 0 1-1.06-1.06l5.22-5.22h-4.69a.75.75 0 0 1-.75-.75Z"/></svg>'],["download",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"></path></svg>'],["copy",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"></path></svg>'],["remove",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"></path></svg>'],["maximize",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"></path></svg>'],["close",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path></svg>'],["resize",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M136,112H48a8,8,0,0,0-8,8v88a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V120A8,8,0,0,0,136,112Zm-8,88H56V128h72Zm88-16v16a16,16,0,0,1-16,16H176a8,8,0,0,1,0-16h24V184a8,8,0,0,1,16,0Zm0-72v32a8,8,0,0,1-16,0V112a8,8,0,0,1,16,0Zm0-56V72a8,8,0,0,1-16,0V56H184a8,8,0,0,1,0-16h16A16,16,0,0,1,216,56Zm-64-8a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,48ZM40,80V56A16,16,0,0,1,56,40H72a8,8,0,0,1,0,16H56V80a8,8,0,0,1-16,0Z"></path></svg>'],["expand",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M237.66,133.66l-32,32a8,8,0,0,1-11.32-11.32L212.69,136H43.31l18.35,18.34a8,8,0,0,1-11.32,11.32l-32-32a8,8,0,0,1,0-11.32l32-32a8,8,0,0,1,11.32,11.32L43.31,120H212.69l-18.35-18.34a8,8,0,0,1,11.32-11.32l32,32A8,8,0,0,1,237.66,133.66Z"></path></svg>'],["circleNotch",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg>'],["selectAll",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M104,40a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,40Zm40,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM40,80a8,8,0,0,0,8-8V48H72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,48V72A8,8,0,0,0,40,80ZM176,184H80a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8h96a8,8,0,0,1,8,8v96A8,8,0,0,1,176,184Zm-8-96H88v80h80Z"></path></svg>'],["undo",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,144a64.07,64.07,0,0,1-64,64H80a8,8,0,0,1,0-16h88a48,48,0,0,0,0-96H51.31l34.35,34.34a8,8,0,0,1-11.32,11.32l-48-48a8,8,0,0,1,0-11.32l48-48A8,8,0,0,1,85.66,45.66L51.31,80H168A64.07,64.07,0,0,1,232,144Z"></path></svg>'],["redo",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M170.34,130.34,204.69,96H88a48,48,0,0,0,0,96h88a8,8,0,0,1,0,16H88A64,64,0,0,1,88,80H204.69L170.34,45.66a8,8,0,0,1,11.32-11.32l48,48a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32-11.32Z"></path></svg>'],["heading",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,56V200a8,8,0,0,1-16,0V136H64v64a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v64H192V56a8,8,0,0,1,16,0Z"></path></svg>'],["heading1",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm75.77,49a8,8,0,0,0-8.21.39l-24,16a8,8,0,1,0,8.88,13.32L216,127V208a8,8,0,0,0,16,0V112A8,8,0,0,0,227.77,105Z"></path></svg>'],["heading2",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm88,144H208l33.55-44.74a32,32,0,1,0-55.73-29.93,8,8,0,1,0,15.08,5.34,16.28,16.28,0,0,1,2.32-4.3,16,16,0,1,1,25.54,19.27L185.6,203.2A8,8,0,0,0,192,216h48a8,8,0,0,0,0-16Z"></path></svg>'],["heading3",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm73.52,90.63,21-30A8,8,0,0,0,240,104H192a8,8,0,0,0,0,16h32.63l-19.18,27.41A8,8,0,0,0,212,160a20,20,0,1,1-14.29,34,8,8,0,1,0-11.42,11.19A36,36,0,0,0,248,180,36.07,36.07,0,0,0,225.52,146.63Z"></path></svg>'],["heading4",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm96,112h-8V144a8,8,0,0,0-16,0v24H195.1l20.49-61.47a8,8,0,0,0-15.18-5.06l-24,72A8,8,0,0,0,184,184h40v24a8,8,0,0,0,16,0V184h8a8,8,0,0,0,0-16Z"></path></svg>'],["heading5",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm60,88a38.8,38.8,0,0,0-9.41,1.14L206.78,120H240a8,8,0,0,0,0-16H200a8,8,0,0,0-7.89,6.68l-8,48a8,8,0,0,0,13.6,6.92A19.73,19.73,0,0,1,212,160a20,20,0,0,1,0,40,19.73,19.73,0,0,1-14.29-5.6,8,8,0,1,0-11.42,11.2A35.54,35.54,0,0,0,212,216a36,36,0,0,0,0-72Z"></path></svg>'],["heading6",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,56V176a8,8,0,0,1-16,0V124H48v52a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0v52h88V56a8,8,0,0,1,16,0Zm96,124a36,36,0,1,1-67.34-17.68c.07-.14.14-.28.22-.42l32.25-54a8,8,0,0,1,13.74,8.2l-16.69,28c.6,0,1.21-.05,1.82-.05A36,36,0,0,1,248,180Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,232,180Z"></path></svg>'],["paragraph",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,40H96a64,64,0,0,0,0,128h40v40a8,8,0,0,0,16,0V56h24V208a8,8,0,0,0,16,0V56h16a8,8,0,0,0,0-16ZM136,152H96a48,48,0,0,1,0-96h40Z"></path></svg>'],["blockQuote",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M100,56H40A16,16,0,0,0,24,72v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,100,56Zm0,80H40V72h60ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Zm0,80H156V72h60Z"></path></svg>'],["list",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M88,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Zm128,56H96a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H96a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM56,56H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Zm0,64H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Zm0,64H40a8,8,0,0,0,0,16H56a8,8,0,0,0,0-16Z"></path></svg>'],["numberedList",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM104,72H216a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16ZM216,184H104a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM43.58,55.16,48,52.94V104a8,8,0,0,0,16,0V40a8,8,0,0,0-11.58-7.16l-16,8a8,8,0,0,0,7.16,14.32ZM79.77,156.72a23.73,23.73,0,0,0-9.6-15.95,24.86,24.86,0,0,0-34.11,4.7,23.63,23.63,0,0,0-3.57,6.46,8,8,0,1,0,15,5.47,7.84,7.84,0,0,1,1.18-2.13,8.76,8.76,0,0,1,12-1.59A7.91,7.91,0,0,1,63.93,159a7.64,7.64,0,0,1-1.57,5.78,1,1,0,0,0-.08.11L33.59,203.21A8,8,0,0,0,40,216H72a8,8,0,0,0,0-16H56l19.08-25.53A23.47,23.47,0,0,0,79.77,156.72Z"></path></svg>'],["bulletedList",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"></path></svg>'],["checklist",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H128a8,8,0,0,1,0-16h88A8,8,0,0,1,224,128ZM128,72h88a8,8,0,0,0,0-16H128a8,8,0,0,0,0,16Zm88,112H128a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16ZM82.34,42.34,56,68.69,45.66,58.34A8,8,0,0,0,34.34,69.66l16,16a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,82.34,42.34Zm0,64L56,132.69,45.66,122.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm0,64L56,196.69,45.66,186.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z"></path></svg>'],["table",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,48H40A16,16,0,0,0,24,64V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM104,144V112h48v32Zm48,16v32H104V160ZM40,112H88v32H40Zm64-16V64h48V96Zm64,16h48v32H168Zm48-16H168V64h48ZM88,64V96H40V64ZM40,160H88v32H40Zm176,32H168V160h48v32Z"></path></svg>'],["alignLeft",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,48H168a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm176,24H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-48,40H40a8,8,0,0,0,0,16H168a8,8,0,0,0,0-16Z"></path></svg>'],["alignCenter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM64,96a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Zm152,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-24,40H64a8,8,0,0,0,0,16H192a8,8,0,0,0,0-16Z"></path></svg>'],["alignRight",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM216,96H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>'],["alignJustify",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64ZM216,96H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,40H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>'],["increaseIndent",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM34.34,141.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0,0-11.32l-40-40A8,8,0,0,0,34.34,61.66L68.69,96,34.34,130.34A8,8,0,0,0,34.34,141.66Z"></path></svg>'],["decreaseIndent",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM72,144a8,8,0,0,0,5.66-13.66L43.31,96,77.66,61.66A8,8,0,0,0,66.34,50.34l-40,40a8,8,0,0,0,0,11.32l40,40A8,8,0,0,0,72,144Z"></path></svg>'],["formatPainter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M232,88H216V64a16,16,0,0,0-16-16H48A16,16,0,0,0,32,64V88H16a8,8,0,0,0,0,16H32v24a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V104h16v50L131.6,182.65A16.07,16.07,0,0,0,120,198v34a8,8,0,0,0,16,0V198l100.4-28.68A16.07,16.07,0,0,0,248,154V104A16,16,0,0,0,232,88Zm-32,40H48V64H200v64Z"></path></svg>'],["bold",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M170.48,115.7A44,44,0,0,0,140,40H72a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8h80a48,48,0,0,0,18.48-92.3ZM80,56h60a28,28,0,0,1,0,56H80Zm72,136H80V128h72a32,32,0,0,1,0,64Z"></path></svg>'],["italic",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,56a8,8,0,0,1-8,8H157.77L115.1,192H144a8,8,0,0,1,0,16H64a8,8,0,0,1,0-16H98.23L140.9,64H112a8,8,0,0,1,0-16h80A8,8,0,0,1,200,56Z"></path></svg>'],["underline",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,224a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,224Zm-72-24a64.07,64.07,0,0,0,64-64V56a8,8,0,0,0-16,0v80a48,48,0,0,1-96,0V56a8,8,0,0,0-16,0v80A64.07,64.07,0,0,0,128,200Z"></path></svg>'],["strikethrough",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"></path></svg>'],["superscript",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.736 3.5c-.543 0-.986.495-.986 1.023a.75.75 0 0 1-1.5 0C16.25 3.278 17.258 2 18.736 2c.855 0 1.684.4 2.15 1.117.49.751.5 1.724-.057 2.672-.285.484-.673.847-1.045 1.141-.187.148-.379.284-.557.41l-.078.056a17.45 17.45 0 0 0-.432.311c-.356.268-.619.511-.78.793h2.514a.75.75 0 0 1 0 1.5H17a.75.75 0 0 1-.75-.75c0-1.396.821-2.182 1.565-2.741.157-.119.32-.234.472-.341l.074-.052c.177-.126.34-.243.493-.363.306-.242.532-.47.682-.724.31-.53.229-.886.093-1.094-.158-.244-.486-.435-.893-.435Z"/><path d="M15.26 4.71c.06.562.385 1.043.847 1.318L10.987 12l5.583 6.512a.75.75 0 1 1-1.14.976L10 13.152l-5.43 6.336a.75.75 0 0 1-1.14-.976L9.013 12 3.431 5.488a.75.75 0 1 1 1.139-.976L10 10.848l5.26-6.137Z"/></svg>'],["subscript",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.488 4.43a.75.75 0 0 1 .082 1.058L10.988 12l5.032 5.871c-.302.41-.555.906-.682 1.51L10 13.151l-5.43 6.336a.75.75 0 0 1-1.14-.976L9.013 12 3.431 5.488a.75.75 0 0 1 1.139-.976L10 10.848l5.43-6.336a.75.75 0 0 1 1.058-.081ZM17.75 15.523c0-.528.444-1.023.986-1.023.407 0 .735.19.893.434.136.21.218.566-.093 1.095-.15.255-.376.482-.682.724-.152.12-.316.237-.493.363l-.074.052c-.152.107-.315.222-.472.34-.744.56-1.565 1.346-1.565 2.742 0 .414.336.75.75.75h3.451a.75.75 0 0 0 0-1.5h-2.513c.16-.282.423-.525.779-.793.137-.103.279-.203.432-.312l.078-.054c.178-.127.37-.264.557-.41.372-.295.76-.658 1.045-1.142.557-.948.546-1.921.058-2.672C20.42 13.4 19.59 13 18.736 13c-1.478 0-2.486 1.278-2.486 2.523a.75.75 0 0 0 1.5 0Z"/></svg>'],["code",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M93.31,70,28,128l65.27,58a8,8,0,1,1-10.62,12l-72-64a8,8,0,0,1,0-12l72-64A8,8,0,1,1,93.31,70Zm152,52-72-64a8,8,0,0,0-10.62,12L228,128l-65.27,58a8,8,0,1,0,10.62,12l72-64a8,8,0,0,0,0-12Z"></path></svg>'],["removeFormat",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M225,80.4,183.6,39a24,24,0,0,0-33.94,0L31,157.66a24,24,0,0,0,0,33.94l30.06,30.06A8,8,0,0,0,66.74,224H216a8,8,0,0,0,0-16h-84.7L225,114.34A24,24,0,0,0,225,80.4ZM108.68,208H70.05L42.33,180.28a8,8,0,0,1,0-11.31L96,115.31,148.69,168Zm105-105L160,156.69,107.31,104,161,50.34a8,8,0,0,1,11.32,0l41.38,41.38a8,8,0,0,1,0,11.31Z"></path></svg>'],["moreStyle",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path></svg>'],["fontColor",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><polyline points="192 168 128 32 64 168" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="173.18" y1="128" x2="82.82" y2="128" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["fontColorAccent",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="40" y1="216" x2="216" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["highlight",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.38 14.003A2.5 2.5 0 0 0 2 16.5v3A2.5 2.5 0 0 0 4.5 22h15a2.5 2.5 0 0 0 2.5-2.5v-3a2.5 2.5 0 0 0-2.5-2.5h-5.954l-1.316 1.314a3.237 3.237 0 0 1-.203.186H19.5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3a1 1 0 0 1 .504-.869 2 2 0 0 1 .092-.744l.285-.884Z"/><path d="M18.648 2.944a3.218 3.218 0 0 1-.002 4.551l-7.123 7.111a2.25 2.25 0 0 1-.942.563l-4.294 1.289a1 1 0 0 1-1.239-1.265l1.362-4.228c.11-.34.298-.65.552-.902l7.132-7.122a3.22 3.22 0 0 1 4.554.003Zm-3.494 1.059-7.133 7.121a.75.75 0 0 0-.184.301l-1.07 3.322 3.382-1.015a.75.75 0 0 0 .315-.187l7.121-7.11a1.718 1.718 0 1 0-2.43-2.432Z"/></svg>'],["highlightAccent",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.004 15.631a2 2 0 0 0 2.571 1.784l4.293-1.288a3.25 3.25 0 0 0 1.159-.627H19.5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3a1 1 0 0 1 .504-.869Z"/></svg>'],["backgroundColor",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 12.414V17.5A2.5 2.5 0 0 0 4.5 20h15a2.5 2.5 0 0 0 2.5-2.5v-11A2.5 2.5 0 0 0 19.5 4h-8.944l1.5 1.5H19.5a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-3.586l-1.5-1.5Z"/><path d="M6 1.75a.75.75 0 1 1 1.5 0v1.265c.45.04.89.233 1.235.578l3.536 3.536a2 2 0 0 1 0 2.828L8.027 14.2a2 2 0 0 1-2.829 0l-3.535-3.536a2 2 0 0 1 0-2.828l4.243-4.243c.03-.03.061-.06.093-.087V1.75Zm0 4.5v-.629l-2.89 2.89h8.245a.498.498 0 0 0-.145-.322L7.674 4.654A.498.498 0 0 0 7.5 4.54v1.71a.75.75 0 0 1-1.5 0Zm-2.868 3.76 3.128 3.13a.5.5 0 0 0 .707 0l3.129-3.13H3.132ZM11 13.375c0-.493.154-.972.342-1.381.19-.416.438-.806.673-1.134.238-.331.474-.613.65-.812.085-.097.24-.261.299-.323l.005-.005a.75.75 0 0 1 1.061 0l.305.328c.176.199.412.48.649.812.236.328.483.718.674 1.134.188.409.342.888.342 1.381C16 14.765 14.97 16 13.5 16c-1.471 0-2.5-1.235-2.5-2.625Zm2.234-1.64c-.202.28-.392.585-.53.885-.14.305-.204.56-.204.755 0 .691.48 1.125 1 1.125.519 0 1-.434 1-1.125 0-.194-.065-.45-.205-.755a5.494 5.494 0 0 0-.53-.886 8.417 8.417 0 0 0-.265-.35 8.33 8.33 0 0 0-.266.35Z"/></svg>'],["backgroundColorAccent",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.978 6.422a2.99 2.99 0 0 1 .878 2.115c.323.066.63.225.881.476l.013.013.326.35.008.01c.192.216.45.525.712.89.26.36.545.808.77 1.3.22.478.434 1.106.434 1.799C17 15.232 15.606 17 13.5 17c-2.008 0-3.37-1.608-3.491-3.367l-1.274 1.274a3 3 0 0 1-4.243 0L3 13.415V17.5A1.5 1.5 0 0 0 4.5 19h15a1.5 1.5 0 0 0 1.5-1.5v-11A1.5 1.5 0 0 0 19.5 5h-7.944l1.422 1.422Z"/></svg>'],["link",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"></path></svg>'],["specialCharacter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 32 32"><path d="M22.7373,25A14.3093,14.3093,0,0,0,27,15C27,8.42,22.58,4,16,4S5,8.42,5,15A14.3093,14.3093,0,0,0,9.2627,25H4v2h8V24.7617A12.5683,12.5683,0,0,1,7,15c0-5.4673,3.5327-9,9-9s9,3.5327,9,9a12.5683,12.5683,0,0,1-5,9.7617V27h8V25Z"/></svg>'],["hr",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path></svg>'],["image",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"></path></svg>'],["media",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"></path></svg>'],["attachment",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"></path></svg>'],["codeBlock",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"></path></svg>'],["emoji",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM80,108a12,12,0,1,1,12,12A12,12,0,0,1,80,108Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,176,108Zm-1.07,48c-10.29,17.79-27.4,28-46.93,28s-36.63-10.2-46.92-28a8,8,0,1,1,13.84-8c7.47,12.91,19.21,20,33.08,20s25.61-7.1,33.07-20a8,8,0,0,1,13.86,8Z"></path></svg>'],["equation",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M184,72V56H80.65l53.6,67a8,8,0,0,1,0,10l-53.6,67H184V184a8,8,0,0,1,16,0v24a8,8,0,0,1-8,8H64a8,8,0,0,1-6.25-13l60-75-60-75A8,8,0,0,1,64,40H192a8,8,0,0,1,8,8V72a8,8,0,0,1-16,0Z"></path></svg>'],["video",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M164.44,121.34l-48-32A8,8,0,0,0,104,96v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,145.05V111l25.58,17ZM234.33,69.52a24,24,0,0,0-14.49-16.4C185.56,39.88,131,40,128,40s-57.56-.12-91.84,13.12a24,24,0,0,0-14.49,16.4C19.08,79.5,16,97.74,16,128s3.08,48.5,5.67,58.48a24,24,0,0,0,14.49,16.41C69,215.56,120.4,216,127.34,216h1.32c6.94,0,58.37-.44,91.18-13.11a24,24,0,0,0,14.49-16.41c2.59-10,5.67-28.22,5.67-58.48S236.92,79.5,234.33,69.52Zm-15.49,113a8,8,0,0,1-4.77,5.49c-31.65,12.22-85.48,12-86,12H128c-.54,0-54.33.2-86-12a8,8,0,0,1-4.77-5.49C34.8,173.39,32,156.57,32,128s2.8-45.39,5.16-54.47A8,8,0,0,1,41.93,68c30.52-11.79,81.66-12,85.85-12h.27c.54,0,54.38-.18,86,12a8,8,0,0,1,4.77,5.49C221.2,82.61,224,99.43,224,128S221.2,173.39,218.84,182.47Z"></path></svg>'],["twitter",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"></path></svg>'],["tableColumn",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z"></path></svg>'],["tableRow",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z"></path></svg>'],["tableMerge",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.25 3A3.25 3.25 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h11.5A3.25 3.25 0 0 0 21 17.75V6.25A3.25 3.25 0 0 0 17.75 3H6.25ZM4.5 6.25c0-.966.784-1.75 1.75-1.75H11v3H4.5V6.25Zm8 10.25h7v1.25a1.75 1.75 0 0 1-1.75 1.75H12.5v-3Zm7-9h-7v-3h5.25c.966 0 1.75.784 1.75 1.75V7.5Zm-8.5 9v3H6.25a1.75 1.75 0 0 1-1.75-1.75V16.5H11ZM4.5 9h15v6h-15V9Z"/></svg>'],["tableSplit",'<svg width="24" height="24" fill="#000000" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 10H11v4h1.5v-4Z" fill="#212121"/><path d="M3 6.25A3.25 3.25 0 0 1 6.25 3h11.5A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25ZM6.25 4.5A1.75 1.75 0 0 0 4.5 6.25V7.5H11v-3H6.25Zm13.25 12h-7v3h5.25a1.75 1.75 0 0 0 1.75-1.75V16.5Zm0-10.25a1.75 1.75 0 0 0-1.75-1.75H12.5v3h7V6.25ZM4.5 16.5v1.25c0 .966.784 1.75 1.75 1.75H11v-3H4.5Zm0-1.5h15V9h-15v6Z"/></svg>'],["unlink",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M190.63,65.37a32,32,0,0,0-45.19-.06L133.79,77.52a8,8,0,0,1-11.58-11l11.72-12.29a1.59,1.59,0,0,1,.13-.13,48,48,0,0,1,67.88,67.88,1.59,1.59,0,0,1-.13.13l-12.29,11.72a8,8,0,0,1-11-11.58l12.21-11.65A32,32,0,0,0,190.63,65.37ZM122.21,178.48l-11.65,12.21a32,32,0,0,1-45.25-45.25l12.21-11.65a8,8,0,0,0-11-11.58L54.19,133.93a1.59,1.59,0,0,0-.13.13,48,48,0,0,0,67.88,67.88,1.59,1.59,0,0,0,.13-.13l11.72-12.29a8,8,0,1,0-11.58-11ZM208,152H184a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16ZM48,104H72a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm112,72a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V184A8,8,0,0,0,160,176ZM96,80a8,8,0,0,0,8-8V48a8,8,0,0,0-16,0V72A8,8,0,0,0,96,80Z"></path></svg>'],["imageBroken",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16h64a8,8,0,0,0,7.59-5.47l14.83-44.48L163,151.43a8.07,8.07,0,0,0,4.46-4.46l14.62-36.55,44.48-14.83A8,8,0,0,0,232,88V56A16,16,0,0,0,216,40ZM112.41,157.47,98.23,200H40V172l52-52,30.42,30.42L117,152.57A8,8,0,0,0,112.41,157.47ZM216,82.23,173.47,96.41a8,8,0,0,0-4.9,4.62l-14.72,36.82L138.58,144l-35.27-35.27a16,16,0,0,0-22.62,0L40,149.37V56H216Zm12.68,33a8,8,0,0,0-7.21-1.1l-23.8,7.94a8,8,0,0,0-4.9,4.61l-14.31,35.77-35.77,14.31a8,8,0,0,0-4.61,4.9l-7.94,23.8A8,8,0,0,0,137.73,216H216a16,16,0,0,0,16-16V121.73A8,8,0,0,0,228.68,115.24ZM216,200H148.83l3.25-9.75,35.51-14.2a8.07,8.07,0,0,0,4.46-4.46l14.2-35.51,9.75-3.25Z"></path></svg>'],["zoomIn",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,112a8,8,0,0,1-8,8H120v24a8,8,0,0,1-16,0V120H80a8,8,0,0,1,0-16h24V80a8,8,0,0,1,16,0v24h24A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"></path></svg>'],["zoomOut",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"></path></svg>'],["caption",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="56" y1="232" x2="200" y2="232" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><rect x="32" y="48" width="192" height="136" rx="8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>'],["file",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"></path></svg>'],["info",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"></path></svg>'],["tip",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"></path></svg>'],["warning",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"></path></svg>'],["danger",'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M120,136V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0ZM232,91.55v72.9a15.86,15.86,0,0,1-4.69,11.31l-51.55,51.55A15.86,15.86,0,0,1,164.45,232H91.55a15.86,15.86,0,0,1-11.31-4.69L28.69,175.76A15.86,15.86,0,0,1,24,164.45V91.55a15.86,15.86,0,0,1,4.69-11.31L80.24,28.69A15.86,15.86,0,0,1,91.55,24h72.9a15.86,15.86,0,0,1,11.31,4.69l51.55,51.55A15.86,15.86,0,0,1,232,91.55Zm-16,0L164.45,40H91.55L40,91.55v72.9L91.55,216h72.9L216,164.45ZM128,160a12,12,0,1,0,12,12A12,12,0,0,0,128,160Z"></path></svg>']]),o={id:/^[\w-]+$/,class:/^[\w\- ]+$/,style:{"text-align":["left","center","right","justify","start","end"],"margin-left":/^-?\d+px$/i,"text-indent":/^-?\d+em$/i}};function s(){return{h1:Object.assign({},o),h2:Object.assign({},o),h3:Object.assign({},o),h4:Object.assign({},o),h5:Object.assign({},o),h6:Object.assign({},o),p:Object.assign({},o),blockquote:Object.assign(Object.assign({},o),{type:["info","tip","success","warning","error","danger"]}),ul:Object.assign(Object.assign({},o),{type:"checklist",indent:/^\d+$/}),ol:Object.assign(Object.assign({},o),{start:/^\d+$/,indent:/^\d+$/}),li:{value:["true","false"]},table:{style:{width:/^-?\d+(px|%)$/i,height:/^-?\d+(px|%)$/i,border:/^[^"]+$/,"border-width":/^-?\d+px$/i,"border-style":/^[\w-]+$/,"border-color":/^[^"]+$/,"background-color":/^[^"]+$/}},tr:{style:{height:/^-?\d+(px|%)$/i}},th:"td",td:{colspan:/^\d+$/,rowspan:/^\d+$/,style:{width:/^-?\d+(px|%)$/i,height:/^-?\d+(px|%)$/i,border:/^[^"]+$/,"border-width":/^-?\d+px$/i,"border-style":/^[\w-]+$/,"border-color":/^[^"]+$/,"background-color":/^[^"]+$/,"text-align":["left","center","right","justify"]}},"lake-box":{type:["inline","block"],name:/^[\w-]+$/,value:/^[^"]+$/,focus:["start","center","end"]},br:{},hr:{},img:{src:/^[^"]+$/,width:/^-?\d+px$/i,height:/^-?\d+px$/i,"data-lake-value":/^[^"]+$/,alt:/^[^"]+$/,style:{width:/^-?\d+px$/i,height:/^-?\d+px$/i}},span:{class:/^[\w\- ]+$/,style:{color:/^[^"]+$/,"background-color":/^[^"]+$/,"font-family":/^[^;]+$/,"font-size":/^[^"]+$/}},b:"strong",strong:{},em:"i",i:{},u:{},s:{},sub:{},sup:{},code:{},a:{class:/^[\w\- ]+$/,name:/^[\w-]+$/,href:/^[^"]+$/,target:/^[\w-]+$/,rel:/^[^"]+$/,download:/^[^"]+$/},"lake-bookmark":{type:["anchor","focus"]}}}function r(e,t){const i=[];if("string"!=typeof e)return i.push(e),i;if(""===e)return i;if(/<.+>/.test(e)){const t=document.createElement("div");t.innerHTML=e;for(const e of t.childNodes)i.push(e);return i}const n=document.querySelectorAll(e);for(const e of n)i.push(e);return i}const a=new Set(["h1","h2","h3","h4","h5","h6","div","p","blockquote","ul","ol","li","table","tr","th","td"]),l=new Set(["span","strong","em","i","u","s","sup","sub","code"]),c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),d=new Set(["h1","h2","h3","h4","h5","h6"]),h=new Set(["ol","ul","li"]),p=new Set(["table","tr","td"]);function u(e,t,i){return(i+e+i).indexOf(i+t+i)>=0}function m(e){const t=e.split("-");let i="";for(let e=0;e<t.length;e++){const n=t[e];i+=e>0?n.charAt(0).toUpperCase()+n.substring(1):n}return i}function g(e){const t=Number.parseInt(e,10).toString(16).toLowerCase();return t.length>1?t:`0${t}`}function f(e){return e.replace(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/gi,(e,t,i,n,o)=>void 0===o?`#${g(t)}${g(i)}${g(n)}`:`#${g(t)}${g(i)}${g(n)}${function(e){const t=Math.round(255*Number.parseFloat(e)).toString(16);return t.length>1?t:`0${t}`}(o)}`)}function v(...e){window.LAKE_DEBUG&&console.log.apply(console.log,e)}const w={};let y=0;class x{constructor(e){e=null!=e?e:[],this.nodeList=Array.isArray(e)?e:[e];for(let e=0;e<this.nodeList.length;e++)this.nodeList[e].lakeId||(this.nodeList[e].lakeId=++y);this.length=this.nodeList.length}get id(){return this.get(0).lakeId}get name(){if(0===this.length)return"";return this.get(0).nodeName.toLowerCase()}get isElement(){if(0===this.length)return!1;return this.get(0).nodeType===Node.ELEMENT_NODE}get isText(){if(0===this.length)return!1;return this.get(0).nodeType===Node.TEXT_NODE}get isBlock(){return 0!==this.length&&a.has(this.name)}get isMark(){return 0!==this.length&&l.has(this.name)}get isVoid(){return 0!==this.length&&c.has(this.name)}get isHeading(){return 0!==this.length&&d.has(this.name)}get isList(){return 0!==this.length&&h.has(this.name)}get isTable(){return 0!==this.length&&p.has(this.name)}get isBookmark(){return"lake-bookmark"===this.name}get isBox(){return"lake-box"===this.name}get isInlineBox(){return this.isBox&&"inline"===this.attr("type")}get isBlockBox(){return this.isBox&&"block"===this.attr("type")}get isContainer(){if(0===this.length)return!1;const e=this.get(0);return this.isElement&&"true"===e.getAttribute("contenteditable")}get isOutside(){return 0===this.closest('[contenteditable="true"]').length}get isInside(){return!this.isOutside&&!this.isContainer}get isTopInside(){if(0===this.length)return!1;const e=this.parent();return 0!==e.length&&(this.isInside&&e.isContainer)}get isContentEditable(){if(0===this.length)return!1;if(this.isText){const e=this.get(0).parentNode;return!!e&&e.isContentEditable}if(!this.isElement)return!1;return this.get(0).isContentEditable}get isIndivisible(){return this.isContainer||this.isTable}get isEmpty(){if(this.isBox)return!1;const e=this.text();if(!(""===e||/^[\r\n\u200B\u2060]+$/.test(e)))return!1;if(this.isElement){if(this.find("lake-box").length>0)return!1;if(this.find("br").length>1)return!1}return!0}get(e){return this.nodeList[e]}getAll(){return this.nodeList}eq(e){const t=this.get(e);return new x(t)}each(e){const t=this.getAll();for(let i=0;i<t.length;i++)if(!1===e(t[i],i))return this;return this}eachElement(e){const t=this.getAll();for(let i=0;i<t.length;i++)if(t[i].nodeType===Node.ELEMENT_NODE&&!1===e(t[i],i))return this;return this}reverse(){const e=this.getAll().reverse();return new x(e)}matches(e){if(!this.isElement)return!1;return this.get(0).matches(e)}contains(e){return this.get(0).contains(e.get(0))}isSibling(e){if(0===this.length)return!1;const t=this.get(0).parentNode;return t&&t===e.parent().get(0)}find(e){if("string"==typeof e){const t=this.get(0).querySelectorAll(e);return new x(Array.from(t))}let t=this.eq(0);for(const i of e)if(t=t.children()[i],!t)return new x;return t}closest(e){if(this.isText){const t=this.get(0).parentNode;return t?new x(t.closest(e)):new x}if(!this.isElement)return new x;const t=this.get(0);return new x(t.closest(e))}closestBlock(){let e=this.eq(0);for(;e.length>0&&!e.isTopInside&&!e.isBlock;)e=e.parent();return e.isBlock?e:new x}closestOperableBlock(){const e=this.closest("lake-box"),t=e.length>0?e.closestBlock():this.closestBlock();if(0===t.length)return t;if(t.isTable)return new x;const i=t.parent();return"li"===t.name&&i.isList?i:t}closestContainer(){return this.closest('div[contenteditable="true"]')}closestScroller(){let e=this.eq(0);for(;e.length>0;){if(e.isElement&&["scroll","auto"].indexOf(e.computedCSS("overflow-y"))>=0)return e;e=e.parent()}return new x}parent(){const e=this.get(0);return new x(e.parentNode)}prev(){const e=this.get(0);return new x(e.previousSibling)}next(){const e=this.get(0);return new x(e.nextSibling)}first(){const e=this.get(0);return new x(e.firstChild)}last(){const e=this.get(0);return new x(e.lastChild)}index(){let e=-1,t=this.get(0);for(;t;)e++,t=t.previousSibling;return e}path(){const e=[];let t=this.eq(0);if(t.isContainer)return e;for(;t.length>0;){const i=t.parent();if(0===i.length)break;if(e.push(t.index()),i.isContainer)break;t=i}return e.reverse()}children(){const e=[];let t=this.first();for(;t.length>0;)e.push(t),t=t.next();return e}*getWalker(){for(const e of function*e(t){if(t.isBox)return;let i=t.first();for(;i.length>0;){const t=i.next();yield i,yield*e(i),i=t}}(this.eq(0)))yield e}on(e,t){return this.eachElement(i=>{i.addEventListener(e,t,!1);const n=i.lakeId;w[n]||(w[n]=[]),w[n].push({type:e,listener:t})})}off(e,t){return this.eachElement(i=>{var n;const o=i.lakeId,s=null!==(n=w[o])&&void 0!==n?n:[];for(let n=0;n<s.length;n++){const o=s[n];e&&(e!==o.type||t&&t!==o.listener)||(i.removeEventListener(o.type,o.listener,!1),s[n]={type:"",listener:()=>{}})}w[o]=s.filter(e=>""!==e.type)})}emit(e,t){return this.eachElement(i=>{const n=i.lakeId,o=w[n];for(const i of o)i.type===e&&i.listener(null!=t?t:new Event(e))})}getEventListeners(e){const t=this.get(e).lakeId;return w[t]}focus(){return this.get(0).focus(),this}blur(){return this.get(0).blur(),this}clone(e=!1){const t=this.get(0);return new x(t.cloneNode(e))}hasAttr(e){return this.get(0).hasAttribute(e)}attr(e,t){var i;if("object"==typeof e){for(const t of Object.keys(e))this.attr(t,e[t]);return this}if(void 0===t){return null!==(i=this.get(0).getAttribute(e))&&void 0!==i?i:""}return this.eachElement(i=>{i.setAttribute(e,t)})}removeAttr(e){return this.eachElement(t=>{t.removeAttribute(e)})}hasClass(e){return u(this.get(0).className,e," ")}addClass(e){if(Array.isArray(e)){for(const t of e)this.addClass(t);return this}return this.eachElement(t=>{u(t.className,e," ")||t.classList.add(e)})}removeClass(e){if(Array.isArray(e)){for(const t of e)this.removeClass(t);return this}return this.eachElement(t=>{u(t.className,e," ")&&(t.classList.remove(e),""===t.className&&t.removeAttribute("class"))})}computedCSS(e){return function(e,t){const i=m(t),n=window.getComputedStyle(e,null);return f(e.style[i]||n.getPropertyValue(t)||"")}(this.get(0),e)}css(e,t){if("object"==typeof e){for(const t of Object.keys(e))this.css(t,e[t]);return this}if(void 0===t){return f(this.get(0).style[m(e)])}return this.eachElement(i=>{i.style[m(e)]=t,""===i.getAttribute("style")&&i.removeAttribute("style")})}width(){return this.get(0).offsetWidth}innerWidth(){const e=Number.parseInt(this.computedCSS("padding-left"),10)||0,t=Number.parseInt(this.computedCSS("padding-right"),10)||0;return this.width()-e-t}height(){return this.get(0).offsetHeight}show(e="block"){return this.css("display",e),this}hide(){return this.css("display","none"),this}html(e){if(void 0===e){return this.get(0).innerHTML}return this.eachElement(t=>{t.innerHTML=e})}text(e){var t;if(void 0===e){return null!==(t=this.get(0).textContent)&&void 0!==t?t:""}return this.eachElement(t=>{t.textContent=e})}value(e){if(void 0===e){return this.get(0).value}return this.eachElement(t=>{t.value=e})}outerHTML(){return this.get(0).outerHTML}empty(){return this.html(""),this}prepend(e){const t=this.get(0);if("string"==typeof e){const i=r(e).reverse();for(const e of i)t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);return this}return e instanceof x&&(e=e.get(0)),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),this}append(e){const t=this.get(0);if("string"==typeof e){const i=r(e);for(const e of i)t.appendChild(e);return this}return e instanceof x&&(e=e.get(0)),t.appendChild(e),this}before(e){const t=this.get(0);if(!t.parentNode)return this;if("string"==typeof e){const i=r(e);for(const e of i)t.parentNode.insertBefore(e,t);return this}return e instanceof x&&(e=e.get(0)),t.parentNode.insertBefore(e,t),this}after(e){const t=this.get(0);if(!t.parentNode)return this;if("string"==typeof e){const i=r(e).reverse();for(const e of i)t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e);return this}return e instanceof x&&(e=e.get(0)),t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),this}replaceWith(e){const t=this.get(0);if(!t.parentNode)return this;let i;return i=e instanceof x?e.get(0):r(e)[0],t.parentNode.replaceChild(i,t),this}remove(e=!1){return this.each(t=>{if(t.parentNode){if(e){let e=t.firstChild;for(;e;){const i=e.nextSibling;t.parentNode.insertBefore(e,t),e=i}}t.parentNode.removeChild(t)}}),this}splitText(e){if(!this.isText)return new x;const t=this.get(0).splitText(e);return new x(t)}toString(){if(0===this.length)return"";const e=this.get(0);let t=this.isText?e.nodeValue:this.outerHTML();return t&&t.length>50&&(t=`${t.substring(0,50)} ...`),`node (${e.lakeId}): ${t}`}info(){v(this.toString())}}function b(e){if(e instanceof x)return e;const t=r(e);return new x(t)}const k=new Map([["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],[" ","&nbsp;"]]);function C(e){return e.replace(/[&<>"\xA0]/g,e=>{var t;return null!==(t=k.get(e))&&void 0!==t?t:""})}function S(e,...t){let i=e[0];for(let n=0;n<t.length;n++){i+=C(String(t[n])),i+=e[n+1]}return i.replace(/^\s+|\s+$|[\r\n]/gm,"")}const B=new Map;function A(e){let t=B.get(e);return t||(t=new Map,B.set(e,t),t)}function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L,T={exports:{}};var E=(L||(L=1,function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,s||e,r),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function r(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,r=new Array(s);o<s;o++)r[o]=n[o].fn;return r},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,s,r){var a=i?i+e:e;if(!this._events[a])return!1;var l,c,d=this._events[a],h=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),h){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,o),!0;case 5:return d.fn.call(d.context,t,n,o,s),!0;case 6:return d.fn.call(d.context,t,n,o,s,r),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var p,u=d.length;for(c=0;c<u;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),h){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,n);break;case 4:d[c].fn.call(d[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(h-1);p<h;p++)l[p-1]=arguments[p];d[c].fn.apply(d[c].context,l)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,o){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return r(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||r(this,s);else{for(var l=0,c=[],d=a.length;l<d;l++)(a[l].fn!==t||o&&!a[l].once||n&&a[l].context!==n)&&c.push(a[l]);c.length?this._events[s]=1===c.length?c[0]:c:r(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&r(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}(T)),T.exports),M=_(E);const I=new Map,P=new Map;function H(e){const t=(new TextEncoder).encode(e);let i="";return t.forEach(e=>{i+=String.fromCharCode(e)}),window.btoa(i)}function D(e){const t=window.atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(new TextDecoder).decode(i)}function Z(e){let t,i;if(e instanceof x){t=e.get(0).getBoundingClientRect(),i=e.closestScroller()}else t=e.get().getBoundingClientRect(),i=e.commonAncestor.closestScroller();let n=t.left,o=t.right,s=t.top,r=t.bottom,a=window.innerWidth,l=window.innerHeight;if(i.length>0){const e=i.get(0).getBoundingClientRect(),t=e.x,c=e.y;n-=t,o-=t,s-=c,r-=c,a=e.width,l=e.height}let c=0;n<0?c=-1:a-n<0&&(c=1);let d=0;o<0?d=-1:a-o<0&&(d=1);let h=0;s<0?h=-1:l-s<0&&(h=1);let p=0;return r<0?p=-1:l-r<0&&(p=1),{left:c,right:d,top:h,bottom:p}}class N{constructor(e){this.range=null!=e?e:document.createRange()}get startNode(){return new x(this.range.startContainer)}get startOffset(){return this.range.startOffset}get endNode(){return new x(this.range.endContainer)}get endOffset(){return this.range.endOffset}get commonAncestor(){return new x(this.range.commonAncestorContainer)}get isCollapsed(){return this.range.collapsed}get isBox(){return this.commonAncestor.closest("lake-box").length>0}get isBoxStart(){const e=this.commonAncestor.closest("lake-box");if(0===e.length)return!1;const t=e.find(".lake-box-container");return this.compareBeforeNode(t)>=0}get isBoxCenter(){const e=this.commonAncestor.closest("lake-box");if(0===e.length)return!1;const t=e.find(".lake-box-container");return this.isCollapsed&&this.startNode.get(0)===t.get(0)&&0===this.startOffset}get isBoxEnd(){const e=this.commonAncestor.closest("lake-box");if(0===e.length)return!1;const t=e.find(".lake-box-container");return this.compareAfterNode(t)<=0}get isInsideBox(){const e=this.commonAncestor.closest("lake-box");if(0===e.length)return!1;const t=e.find(".lake-box-container");return(!this.isCollapsed||this.startNode.get(0)!==t.get(0)||0!==this.startOffset)&&(this.compareBeforeNode(t)<0&&this.compareAfterNode(t)>0)}get isInoperative(){if(this.commonAncestor.isOutside)return!0;const e=this.startNode.closest("td"),t=this.endNode.closest("td");return e.length>0&&t.length>0&&e.get(0)!==t.get(0)}get(){return this.range}getRect(){const e=this.clone();let t,i,n;if(e.isCollapsed){let o="left";if(e.startNode.isElement){const t=e.startNode.children();0===t.length?e.selectNode(e.startNode):e.startOffset<t.length?e.setEnd(e.startNode,e.startOffset+1):(e.setStart(e.startNode,e.startOffset-1),o="right")}else if(e.startNode.isText){const t=e.startNode.text();e.startOffset<t.length?e.setEnd(e.startNode,e.startOffset+1):e.startOffset>0&&(e.setStart(e.startNode,e.startOffset-1),o="right")}t=e.get().getBoundingClientRect(),i="left"===o?t.x:t.right,n=1}else t=e.get().getBoundingClientRect(),i=t.x,n=t.width;const o=t.height;return DOMRect.fromRect({x:i,y:o>0?t.y:0,width:n>0?n:1,height:o>0?o:1})}comparePoint(e,t){return this.range.comparePoint(e.get(0),t)}compareBeforeNode(e){const t=new N;return e.isText?t.setStart(e,0):t.setStartBefore(e),t.collapseToStart(),this.comparePoint(t.startNode,t.startOffset)}compareAfterNode(e){var t;const i=new N;if(e.isText){const n=null!==(t=e.get(0).nodeValue)&&void 0!==t?t:"";i.setStart(e,n.length)}else i.setStartAfter(e);return i.collapseToStart(),this.comparePoint(i.startNode,i.startOffset)}intersectsNode(e){return this.range.intersectsNode(e.get(0))}setStart(e,t){this.range.setStart(e.get(0),t)}setStartBefore(e){this.range.setStartBefore(e.get(0))}setStartAfter(e){this.range.setStartAfter(e.get(0))}setEnd(e,t){this.range.setEnd(e.get(0),t)}setEndBefore(e){this.range.setEndBefore(e.get(0))}setEndAfter(e){this.range.setEndAfter(e.get(0))}collapseToStart(){this.range.collapse(!0)}collapseToEnd(){this.range.collapse(!1)}selectNode(e){this.range.selectNode(e.get(0))}selectNodeContents(e){this.range.selectNodeContents(e.get(0))}selectBox(e){const t=e.find(".lake-box-container");if(0===t.length)throw new Error(`Box "${e.attr("name")}" (id=${e.id}) cannot be selected because it has not been rendered yet.`);this.setStart(t,0),this.collapseToStart()}selectBoxStart(e){const t=e.find(".lake-box-strip");if(0===t.length)throw new Error(`Box "${e.attr("name")}" (id=${e.id}) cannot be selected because it has not been rendered yet.`);this.selectNodeContents(t.eq(0)),this.collapseToStart()}selectBoxEnd(e){const t=e.find(".lake-box-strip");if(0===t.length)throw new Error(`Box "${e.attr("name")}" (id=${e.id}) cannot be selected because it has not been rendered yet.`);this.selectNodeContents(t.eq(1)),this.collapseToStart()}shrinkBefore(e){if(e.isBox)return void this.selectBoxStart(e);if(e.isText)return this.setStartBefore(e),void this.collapseToStart();let t;for(this.setStart(e,0);this.startNode.isElement&&(t=this.startNode.children()[0])&&t.isElement&&!t.isVoid;){if(t.isBox)return void this.selectBoxStart(t);this.setStart(t,0)}this.collapseToStart()}shrinkAfter(e){if(e.isBox)return void this.selectBoxEnd(e);if(e.isText)return this.setEndAfter(e),void this.collapseToEnd();let t;for(this.setEnd(e,e.children().length);this.endNode.isElement&&this.endOffset>0&&(t=this.endNode.children()[this.endOffset-1])&&t.isElement&&!t.isVoid;){if(t.isBox)return void this.selectBoxEnd(t);this.setEnd(t,t.children().length)}this.collapseToEnd(),this.adjustBr()}shrink(){const e=this.isCollapsed;let t;for(;this.startNode.isElement&&(t=this.startNode.children()[this.startOffset])&&t.isElement&&!t.isVoid&&!t.isBox;)this.setStart(t,0);if(e)this.collapseToStart();else for(;this.endNode.isElement&&this.endOffset>0&&(t=this.endNode.children()[this.endOffset-1])&&t.isElement&&!t.isVoid&&!t.isBox;)this.setEnd(t,t.children().length)}adjustBox(){const e=this.startNode.closest("lake-box");if(e.length>0){const t=this.clone();t.collapseToStart(),t.isBoxEnd?this.setStartAfter(e):this.setStartBefore(e)}const t=this.endNode.closest("lake-box");if(t.length>0){const e=this.clone();e.collapseToEnd(),e.isBoxStart?this.setEndBefore(t):this.setEndAfter(t)}}adjustTable(){const e=this.startNode.closest("table"),t=this.endNode.closest("table");if(0===e.length&&t.length>0&&t.isInside)return this.setEndBefore(t),void this.shrink();0===t.length&&e.length>0&&e.isInside&&(this.setStartAfter(e),this.shrink())}adjustBlock(){if(!this.isCollapsed){if(this.endNode.isElement&&0===this.endOffset){let e=this.endNode;for(;0===e.prev().length;)e=e.parent();this.setEndBefore(e)}return void this.shrink()}if(this.startNode.isText)return;const e=this.startNode.children()[this.startOffset];e&&(e.isBlockBox||e.isBlock)&&this.shrinkBefore(e)}adjust(){this.adjustBox(),this.adjustTable(),this.adjustBlock()}adjustBr(){if(!this.isCollapsed)return;const e=this.getPrevNode(),t=this.getNextNode();"br"===e.name&&0===t.length&&(this.setStartBefore(e),this.collapseToStart())}getPrevNode(){let e;return e=this.startNode.isText?0===this.startOffset?this.startNode.prev():this.startNode:this.startNode.children()[this.startOffset-1],null!=e?e:new x}getNextNode(){let e;return e=this.endNode.isText?this.endOffset===this.endNode.text().length?this.endNode.next():this.endNode:this.endNode.children()[this.endOffset],null!=e?e:new x}getBoxes(){if(this.isCollapsed){const e=this.startNode.closest("lake-box");return e.length>0?[e]:[]}const e=[],t=this.clone();t.adjustBox();for(const i of t.commonAncestor.getWalker())i.isBox&&t.intersectsNode(i)&&e.push(i);return e}getBlocks(){if(this.isCollapsed){const e=this.startNode.closestOperableBlock();return e.isTable?[]:e.isInside?[e]:[]}const e=this.startNode.closestOperableBlock(),t=this.endNode.closestOperableBlock();if(e.isInside&&e.get(0)&&e.get(0)===t.get(0))return e.isTable?[]:[e];const i=[],n=this.clone();n.collapseToEnd();for(const e of this.commonAncestor.getWalker())e.isBlock&&!e.isTable&&e.isTopInside&&0!==n.comparePoint(e,0)&&this.intersectsNode(e)&&i.push(e);if(i.length>0)return i;for(const n of this.commonAncestor.getWalker())n.isBlock&&!n.isTable&&(e.isSibling(n)||t.isSibling(n))&&this.intersectsNode(n)&&i.push(n);return i}getMarks(e=!1){const t=[];if(this.commonAncestor.isText&&e&&0===this.startOffset&&this.endOffset===this.commonAncestor.text().length)return t.push(this.commonAncestor),t;const i=this.clone();i.collapseToStart();const n=this.clone();n.collapseToEnd();for(const o of this.commonAncestor.getWalker()){const s=document.createRange();if(s.setStartAfter(o.get(0)),s.collapse(!0),n.compareBeforeNode(o)>=0)break;i.compareAfterNode(o)>0&&(o.isMark||o.isText&&e)&&t.push(o)}return t}getStartText(){const e=this.startNode,t=this.startOffset;let i=e.closestBlock();if(i.isOutside&&(i=e.closestContainer()),0===i.length)return"";const n=new N;n.setStartBefore(i),n.setEnd(e,t);const o=b("<div />");o.append(n.cloneContents());const s=o.text();return""===s&&o.find("lake-box").length>0?"​":s}getEndText(){const e=this.endNode,t=this.endOffset;let i=e.closestBlock();if(i.isOutside&&(i=e.closestContainer()),0===i.length)return"";const n=new N;n.setStart(e,t),n.setEndAfter(i);const o=b("<div />");o.append(n.cloneContents());const s=o.text();return""===s&&o.find("lake-box").length>0?"​":s}getCharacterRange(e){const t=this.clone();if(t.shrink(),0===t.startOffset)return null;if(t.startNode.isElement){const e=t.startNode.children()[t.startOffset-1];if(!e.isText)return null;t.setEnd(e,e.text().length),t.collapseToEnd()}const i=t.startNode,n=i.text().slice(0,t.startOffset),o=n.lastIndexOf(` ${e}`),s=n.lastIndexOf(` ${e}`),r=n.lastIndexOf(`​${e}`);if(o>=0)t.setStart(i,o+1);else if(s>=0)t.setStart(i,s+1);else if(r>=0)t.setStart(i,r+1);else{if(0!==n.indexOf(e))return null;t.setStart(i,0)}return t}clone(){return new N(this.range.cloneRange())}cloneContents(){return this.range.cloneContents()}info(){v("--- range information ---"),v("start node:",this.startNode.toString(),", offset:",this.startOffset),v("end node:",this.endNode.toString(),", offset:",this.endOffset)}}const O=[{icon:n.get("numberedList"),value:"numbered",text:e=>e.toolbar.numberedList()},{icon:n.get("bulletedList"),value:"bulleted",text:e=>e.toolbar.bulletedList()},{icon:n.get("checklist"),value:"checklist",text:e=>e.toolbar.checklist()}],z=[{icon:n.get("alignLeft"),value:"left",text:e=>e.toolbar.alignLeft()},{icon:n.get("alignCenter"),value:"center",text:e=>e.toolbar.alignCenter()},{icon:n.get("alignRight"),value:"right",text:e=>e.toolbar.alignRight()},{icon:n.get("alignJustify"),value:"justify",text:e=>e.toolbar.alignJustify()}],$=[{icon:n.get("increaseIndent"),value:"increase",text:e=>e.toolbar.increaseIndent()},{icon:n.get("decreaseIndent"),value:"decrease",text:e=>e.toolbar.decreaseIndent()}],V=[{icon:n.get("italic"),value:"italic",text:e=>e.toolbar.italic()},{icon:n.get("underline"),value:"underline",text:e=>e.toolbar.underline()},{icon:n.get("strikethrough"),value:"strikethrough",text:e=>e.toolbar.strikethrough()},{icon:n.get("superscript"),value:"superscript",text:e=>e.toolbar.superscript()},{icon:n.get("subscript"),value:"subscript",text:e=>e.toolbar.subscript()},{icon:n.get("code"),value:"code",text:e=>e.toolbar.code()}],R=["#f5222d","#fa541c","#fa8c16","#faad14","#fadb14","#a0d911","#52c41a","#13c2c2","#1677ff","#2f54eb","#722ed1","#eb2f96","#fff1f0","#fff2e8","#fff7e6","#fffbe6","#feffe6","#fcffe6","#f6ffed","#e6fffb","#e6f4ff","#f0f5ff","#f9f0ff","#fff0f6","#ffccc7","#ffd8bf","#ffe7ba","#fff1b8","#ffffb8","#f4ffb8","#d9f7be","#b5f5ec","#bae0ff","#d6e4ff","#efdbff","#ffd6e7","#ffa39e","#ffbb96","#ffd591","#ffe58f","#fffb8f","#eaff8f","#b7eb8f","#87e8de","#91caff","#adc6ff","#d3adf7","#ffadd2","#ff7875","#ff9c6e","#ffc069","#ffd666","#fff566","#d3f261","#95de64","#5cdbd3","#69b1ff","#85a5ff","#b37feb","#ff85c0","#ff4d4f","#ff7a45","#ffa940","#ffc53d","#ffec3d","#bae637","#73d13d","#36cfc9","#4096ff","#597ef7","#9254de","#f759ab","#cf1322","#d4380d","#d46b08","#d48806","#d4b106","#7cb305","#389e0d","#08979c","#0958d9","#1d39c4","#531dab","#c41d7f","#a8071a","#ad2102","#ad4e00","#ad6800","#ad8b00","#5b8c00","#237804","#006d75","#003eb3","#10239e","#391085","#9e1068","#820014","#871400","#873800","#874d00","#876800","#3f6600","#135200","#00474f","#002c8c","#061178","#22075e","#780650","#5c0011","#610b00","#612500","#613400","#614700","#254000","#092b00","#002329","#001d66","#030852","#120338","#520339","#000000","#1f1f1f","#262626","#434343","#595959","#8c8c8c","#bfbfbf","#d9d9d9","#f0f0f0","#f5f5f5","#fafafa","#ffffff"],F=[{icon:n.get("removeFormat"),value:"",text:e=>e.toolbar.removeColor()}];for(const e of R)F.push({value:e.toLowerCase(),text:e.toUpperCase()});const q=new Map([["strong","bold"],["em","italic"],["i","italic"],["u","underline"],["s","strikethrough"],["sup","superscript"],["sub","subscript"],["code","code"]]),W=[{name:"undo",type:"button",icon:n.get("undo"),tooltip:e=>e.toolbar.undo(),onClick:(e,t)=>{e.command.execute(t)}},{name:"redo",type:"button",icon:n.get("redo"),tooltip:e=>e.toolbar.redo(),onClick:(e,t)=>{e.command.execute(t)}},{name:"selectAll",type:"button",icon:n.get("selectAll"),tooltip:e=>e.toolbar.selectAll(),onClick:(e,t)=>{e.command.execute(t)}},{name:"paragraph",type:"button",icon:n.get("paragraph"),tooltip:e=>e.toolbar.paragraph(),isSelected:e=>!!e.find(e=>"p"===e.name),onClick:e=>{e.command.execute("heading","p")}},{name:"blockQuote",type:"button",icon:n.get("blockQuote"),tooltip:e=>e.toolbar.blockQuote(),onClick:(e,t)=>{e.command.execute(t)}},{name:"numberedList",type:"button",icon:n.get("numberedList"),tooltip:e=>e.toolbar.numberedList(),isSelected:e=>!!e.find(e=>"ol"===e.name),onClick:e=>{e.command.execute("list","numbered")}},{name:"bulletedList",type:"button",icon:n.get("bulletedList"),tooltip:e=>e.toolbar.bulletedList(),isSelected:e=>!!e.find(e=>"ul"===e.name&&!e.node.hasAttr("type")),onClick:e=>{e.command.execute("list","bulleted")}},{name:"checklist",type:"button",icon:n.get("checklist"),tooltip:e=>e.toolbar.checklist(),isSelected:e=>!!e.find(e=>"ul"===e.name&&"checklist"===e.node.attr("type")),onClick:e=>{e.command.execute("list","checklist")}},{name:"alignLeft",type:"button",icon:n.get("alignLeft"),tooltip:e=>e.toolbar.alignLeft(),isSelected:e=>!!e.find(e=>e.node.isBlock&&"left"===e.node.css("text-align")),onClick:e=>{e.command.execute("align","left")}},{name:"alignCenter",type:"button",icon:n.get("alignCenter"),tooltip:e=>e.toolbar.alignCenter(),isSelected:e=>!!e.find(e=>e.node.isBlock&&"center"===e.node.css("text-align")),onClick:e=>{e.command.execute("align","center")}},{name:"alignRight",type:"button",icon:n.get("alignRight"),tooltip:e=>e.toolbar.alignRight(),isSelected:e=>!!e.find(e=>e.node.isBlock&&"right"===e.node.css("text-align")),onClick:e=>{e.command.execute("align","right")}},{name:"alignJustify",type:"button",icon:n.get("alignJustify"),tooltip:e=>e.toolbar.alignJustify(),isSelected:e=>!!e.find(e=>e.node.isBlock&&"justify"===e.node.css("text-align")),onClick:e=>{e.command.execute("align","justify")}},{name:"increaseIndent",type:"button",icon:n.get("increaseIndent"),tooltip:e=>e.toolbar.increaseIndent(),onClick:e=>{e.command.execute("indent","increase")}},{name:"decreaseIndent",type:"button",icon:n.get("decreaseIndent"),tooltip:e=>e.toolbar.decreaseIndent(),onClick:e=>{e.command.execute("indent","decrease")}},{name:"bold",type:"button",icon:n.get("bold"),tooltip:e=>e.toolbar.bold(),onClick:(e,t)=>{e.command.execute(t)}},{name:"italic",type:"button",icon:n.get("italic"),tooltip:e=>e.toolbar.italic(),onClick:(e,t)=>{e.command.execute(t)}},{name:"underline",type:"button",icon:n.get("underline"),tooltip:e=>e.toolbar.underline(),onClick:(e,t)=>{e.command.execute(t)}},{name:"strikethrough",type:"button",icon:n.get("strikethrough"),tooltip:e=>e.toolbar.strikethrough(),onClick:(e,t)=>{e.command.execute(t)}},{name:"superscript",type:"button",icon:n.get("superscript"),tooltip:e=>e.toolbar.superscript(),onClick:(e,t)=>{e.command.execute(t)}},{name:"subscript",type:"button",icon:n.get("subscript"),tooltip:e=>e.toolbar.subscript(),onClick:(e,t)=>{e.command.execute(t)}},{name:"code",type:"button",icon:n.get("code"),tooltip:e=>e.toolbar.code(),onClick:(e,t)=>{e.command.execute(t)}},{name:"removeFormat",type:"button",icon:n.get("removeFormat"),tooltip:e=>e.toolbar.removeFormat(),onClick:(e,t)=>{e.command.execute(t)}},{name:"formatPainter",type:"button",icon:n.get("formatPainter"),tooltip:e=>e.toolbar.formatPainter(),onClick:(e,t)=>{e.command.execute(t)}},{name:"link",type:"button",icon:n.get("link"),tooltip:e=>e.toolbar.link(),onClick:(e,t)=>{e.command.execute(t)}},{name:"hr",type:"button",icon:n.get("hr"),tooltip:e=>e.toolbar.hr(),onClick:(e,t)=>{e.command.execute(t)}},{name:"codeBlock",type:"button",icon:n.get("codeBlock"),tooltip:e=>e.toolbar.codeBlock(),onClick:(e,t)=>{e.command.execute(t)}},{name:"equation",type:"button",icon:n.get("equation"),tooltip:e=>e.toolbar.equation(),onClick:(e,t)=>{e.command.execute(t)}},{name:"video",type:"button",icon:n.get("video"),tooltip:e=>e.toolbar.video(),onClick:(e,t)=>{e.command.execute(t)}},{name:"twitter",type:"button",icon:n.get("twitter"),tooltip:e=>e.toolbar.twitter(),onClick:(e,t)=>{e.command.execute(t)}},{name:"heading",type:"dropdown",downIcon:n.get("down"),defaultValue:"p",tooltip:e=>e.toolbar.heading(),width:"100px",menuType:"list",menuItems:[{value:"h1",text:e=>`<span style="font-weight: bold; font-size: 26px;">${e.toolbar.heading1()}</span>`},{value:"h2",text:e=>`<span style="font-weight: bold; font-size: 24px;">${e.toolbar.heading2()}</span>`},{value:"h3",text:e=>`<span style="font-weight: bold; font-size: 22px;">${e.toolbar.heading3()}</span>`},{value:"h4",text:e=>`<span style="font-weight: bold; font-size: 20px;">${e.toolbar.heading4()}</span>`},{value:"h5",text:e=>`<span style="font-weight: bold; font-size: 18px;">${e.toolbar.heading5()}</span>`},{value:"h6",text:e=>`<span style="font-weight: bold; font-size: 16px;">${e.toolbar.heading6()}</span>`},{value:"p",text:e=>e.toolbar.paragraph()}],onSelect:(e,t)=>{e.command.execute("heading",t)}},{name:"list",type:"dropdown",downIcon:n.get("down"),icon:n.get("list"),tooltip:e=>e.toolbar.list(),menuType:"list",menuItems:O,onSelect:(e,t)=>{e.command.execute("list",t)}},{name:"table",type:"button",icon:n.get("table"),tooltip:e=>e.toolbar.table(),onClick:(e,t)=>{e.command.execute(t)}},{name:"align",type:"dropdown",downIcon:n.get("down"),icon:n.get("alignLeft"),tooltip:e=>e.toolbar.align(),menuType:"list",menuItems:z,onSelect:(e,t)=>{e.command.execute("align",t)}},{name:"indent",type:"dropdown",downIcon:n.get("down"),icon:n.get("increaseIndent"),tooltip:e=>e.toolbar.indent(),menuType:"list",menuItems:$,onSelect:(e,t)=>{e.command.execute("indent",t)}},{name:"fontFamily",type:"dropdown",downIcon:n.get("down"),defaultValue:"Segoe UI",tooltip:e=>e.toolbar.fontFamily(),width:"100px",menuType:"list",menuItems:[{value:"Arial",text:'<span style="font-family: Arial;">Arial</span>'},{value:"Arial Black",text:"<span style=\"font-family: 'Arial Black';\">Arial Black</span>"},{value:"Comic Sans MS",text:"<span style=\"font-family: 'Comic Sans MS';\">Comic Sans MS</span>"},{value:"Courier New",text:"<span style=\"font-family: 'Courier New';\">Courier New</span>"},{value:"Georgia",text:'<span style="font-family: Georgia;">Georgia</span>'},{value:"Helvetica",text:'<span style="font-family: Helvetica;">Helvetica</span>'},{value:"Impact",text:'<span style="font-family: Impact;">Impact</span>'},{value:"Segoe UI",text:"<span style=\"font-family: 'Segoe UI';\">Segoe UI</span>"},{value:"Tahoma",text:'<span style="font-family: Tahoma;">Tahoma</span>'},{value:"Times New Roman",text:"<span style=\"font-family: 'Times New Roman';\">Times New Roman</span>"},{value:"Trebuchet MS",text:"<span style=\"font-family: 'Trebuchet MS';\">Trebuchet MS</span>"},{value:"Verdana",text:'<span style="font-family: Verdana;">Verdana</span>'}],onSelect:(e,t)=>{e.command.execute("fontFamily",t)}},{name:"fontSize",type:"dropdown",downIcon:n.get("down"),defaultValue:"16px",tooltip:e=>e.toolbar.fontSize(),width:"65px",menuType:"list",menuItems:[{value:"12px",text:"12px"},{value:"14px",text:"14px"},{value:"16px",text:"16px"},{value:"18px",text:"18px"},{value:"22px",text:"22px"},{value:"24px",text:"24px"},{value:"32px",text:"32px"}],onSelect:(e,t)=>{e.command.execute("fontSize",t)}},{name:"moreStyle",type:"dropdown",icon:n.get("more"),tooltip:e=>e.toolbar.moreStyle(),menuType:"list",menuItems:V,selectedValues:e=>{var t;const i=[];for(const n of e)if(n.node.isMark){const e=null!==(t=q.get(n.name))&&void 0!==t?t:n.name;i.push(e)}return i},onSelect:(e,t)=>{e.command.execute(t)}},{name:"fontColor",type:"dropdown",downIcon:n.get("down"),icon:n.get("fontColor"),accentIcon:n.get("fontColorAccent"),defaultValue:"#f5222d",tooltip:e=>e.toolbar.fontColor(),menuType:"color",menuItems:F,menuWidth:"296px",onSelect:(e,t)=>{e.command.execute("fontColor",t)}},{name:"highlight",type:"dropdown",downIcon:n.get("down"),icon:n.get("highlight"),accentIcon:n.get("highlightAccent"),defaultValue:"#fadb14",tooltip:e=>e.toolbar.highlight(),menuType:"color",menuItems:F,menuWidth:"296px",onSelect:(e,t)=>{e.command.execute("highlight",t)}},{name:"image",type:"upload",icon:n.get("image"),tooltip:e=>e.toolbar.image(),accept:"image/*",multiple:!0},{name:"media",type:"upload",icon:n.get("media"),tooltip:e=>e.toolbar.media(),accept:"video/*",multiple:!0},{name:"file",type:"upload",icon:n.get("attachment"),tooltip:e=>e.toolbar.file(),accept:"*",multiple:!0}];function j(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function U(e){const t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=t=>{t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress&&e.onProgress(t)});const i=new FormData,n=e.data||{};if(Object.keys(n).forEach(e=>{const t=n[e];Array.isArray(t)?t.forEach(t=>{i.append(`${e}[]`,t)}):i.append(e,t)}),e.file){const t=e.fieldName||"file";e.file instanceof Blob?i.append(t,e.file,e.file.name):i.append(t,e.file)}t.onerror=t=>{e.onError&&e.onError(t)},t.onload=()=>{if(t.status<200||t.status>=300){if(!e.onError)return;return e.onError(function(e,t){const i=`Cannot ${e.method} ${e.action} ${t.status}'`,n=new Error(i);return n.status=t.status,n.method=e.method,n.url=e.action,n}(e,t),j(t))}if(e.onSuccess)return e.onSuccess(j(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const o=e.headers||{};return null!==o["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(o).forEach(e=>{null!==o[e]&&t.setRequestHeader(e,o[e])}),t.send(i),t}function K(e){const{selection:t,boxName:i,file:n,requestTypes:o,requestMethod:s,requestAction:r,requestFieldName:a,requestWithCredentials:l,requestHeaders:c,transformResponse:d,onError:h,onSuccess:p}=e;if(o.indexOf(n.type)<0)throw h&&h(`File "${n.name}" is not allowed for uploading.`),new Error(`Cannot upload file "${n.name}" because its type "${n.type}" is not found in ['${o.join("', '")}'].`);const u=t.insertBox(i,{url:0===n.type.indexOf("image/")?URL.createObjectURL(n):"",status:"uploading",name:n.name,size:n.size,type:n.type,lastModified:n.lastModified});let m=U({onProgress:e=>{const t=u.node.find(".lake-percent"),i=Math.round(e.percent);t.text(`${i<100?i:99} %`)},onError:(e,t)=>{m=null,v(e.toString(),t),u.updateValue("status","error"),u.render(),h&&h(e.toString())},onSuccess:e=>{if(m=null,d&&(e=d(e)),!e.url)return u.updateValue("status","error"),u.render(),void(h&&h("Cannot find the url field."));u.updateValue({status:"done",url:e.url}),u.render(),p&&p()},file:n,action:r,method:s,fieldName:a,withCredentials:l,headers:c});return u.event.on("beforeunmount",()=>{m&&(m.abort(),v("Upload canceled"))}),u}class X{constructor(e){this.config=e,this.root=b(e.root),this.node=b(S`
2
2
  <button type="button" name="${e.name}" class="lake-button" />
3
- `),e.type&&this.node.addClass(`lake-${e.type}-button`),void 0!==e.tabIndex&&this.node.attr("tabindex",e.tabIndex.toString())}render(){const e=this.config,t=this.node;t.addClass(`lake-${e.text?"text":"icon"}-button`),e.tooltip&&t.attr("title",e.tooltip),e.icon&&t.append(e.icon),e.text&&t.append(`<span>${e.text}</span>`),this.root.append(t),this.root.get(0).appendChild(t.get(0)),t.on("mouseenter",()=>{t.attr("disabled")||t.hasClass("lake-button-selected")||t.addClass("lake-button-hovered")}),t.on("mouseleave",()=>{t.attr("disabled")||t.removeClass("lake-button-hovered")}),t.on("click",t=>{t.preventDefault(),e.onClick()})}}function G(e,...t){let i=e[0];for(let n=0;n<t.length;n++){i+=String(t[n]),i+=e[n+1]}return i.replace(/^\s+|\s+$|[\r\n]/gm,"")}const Y=/^\{.*\}$/,Q=/(\{(?:[^{}]+|\{(?:[^{}]+)*\})*\})/g,J=e=>e.substring(1,e.length-1),ee=(e,t=!0,i="",n="")=>e.split(Q).map(e=>{if(!e.match(Q))return e;const t=J(e);if(t.startsWith("{"))return((e,t)=>{let[i,n]=e.split(":");n||(n=i,i=t);const o=n.split("|"),[s,r,a,l,c,d]=o,h=o.filter(e=>void 0!==e).length;return 1===h?{k:i,r:s}:2===h?{k:i,o:s,r:r}:3===h?{k:i,z:s,o:r,r:a}:{k:i,z:s,o:r,t:a,f:l,m:c,r:d}})(J(t),n);const o=(e=>{const[t="",...i]=e.split("|"),[n="",o]=t.split(":"),[s,r]=n.split("?");return{k:s,i:o,n:""===r,f:i}})(t);return n=o.k||n,!i&&(i=n),o}).map(e=>{if("string"==typeof e)return e;e.k||(e.k=i||"0");const n=(e=>Object.fromEntries(Object.keys(e).map(t=>{const i=e[t];return[t,Array.isArray(i)?i.map(e=>null==e?void 0:e.trim()):i===!!i?i:null==i?void 0:i.trim()]})))(e);return t?(o=n,Object.fromEntries(Object.entries(o).map(([e,t])=>"i"!==e&&t&&"0"!=t&&[e,t]).filter(Boolean))):n;var o}),te=(e,t,i)=>t.reduce((t,i)=>{var n,o,s;return null!==(o=i.match(Y)?(e=>{var i;return null!==(i=e[t])&&void 0!==i?i:e["*"]})((s=i,Object.fromEntries(J(s).split(",").map(e=>e.split(":")).reduce((e,t)=>2===t.length?[...e,t.map(e=>e.trim())]:(e[e.length-1][1]+=","+t[0],e),[])))):null===(n=e[i])||void 0===n?void 0:n.call(e,t))&&void 0!==o?o:t},i),ie=/\?\?/g,ne=(e,t,i,n)=>{const o=n[0],s=o&&"object"==typeof o&&o.constructor===Object;return((e,t,i,n)=>e.map(e=>{if("string"==typeof e)return e;const{k:o="0",f:s=[]}=e,r=n[o];if((e=>!(!e.o&&!e.r))(e))return(("boolean"==typeof r?r?e.o:e.r:((e,{z:t,o:i,t:n,f:o,m:s,r:r},a)=>{switch(t&&0==a?"zero":e.select(a)){case"zero":return t;case"one":return i;case"two":return n;case"few":return null!=o?o:r;case"many":return null!=s?s:r;default:return r}})(t,e,r))||"").replace(ie,r);const a=s.length?te(i,s,r):r;return(""+(null!=a?a:"")).trim()}).join(""))(e,t,i,1===n.length&&s?o:n)},oe=(e,t)=>{const i={},n=new Intl.PluralRules(e);return(e,...o)=>ne(((e,t)=>e[t]||(e[t]=ee(t)))(i,e),n,t,o)};const se=(e={},t)=>"string"==typeof e?t.bind(null,e):Object.assign(Object.defineProperty(()=>"","name",{writable:!0}),e),re=(e,t)=>new Proxy(se(e,t),{get:(e,i)=>i===Symbol.iterator?[][Symbol.iterator].bind(Object.values(e).map(e=>se(e,t))):re(e[i],t)});function ae(e,t){if("undefined"==typeof window)return e;const i=(t=null!=t?t:navigator.userAgent).indexOf("Mac OS X")>=0?"⌘":"Ctrl";return e.replace(/(^|\+|\s)mod(\+|\s|$)/g,`$1${i}$2`)}const le={"en-US":{toolbar:{undo:`Undo (${ae("mod+Z")})`,redo:`Redo (${ae("mod+Y")})`,selectAll:`Select all (${ae("mod+A")})`,paragraph:"Paragraph",blockQuote:"Block quotation",numberedList:"Numbered list",bulletedList:"Bulleted list",checklist:"Checklist",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Justify",increaseIndent:"Increase indent",decreaseIndent:"Decrease indent",bold:`Bold (${ae("mod+B")})`,italic:`Italic (${ae("mod+I")})`,underline:`Underline (${ae("mod+U")})`,strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",code:"Inline code",removeFormat:"Remove format",formatPainter:"Format painter",link:"Link",hr:"Horizontal line",video:"YouTube",codeBlock:"Code block",heading:"Heading",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",list:"List",table:"Table",align:"Alignment",indent:"Indent",fontFamily:"Font family",fontSize:"Font size",moreStyle:"More style",fontColor:"Font color",highlight:"Highlight",image:"Image",media:"Video",file:"File",emoji:"Emoji",equation:"Mathematical formula",twitter:"X (Tweet)",removeColor:"Remove color"},slash:{heading1:"Heading 1",heading1Desc:"Create a heading level 1",heading2:"Heading 2",heading2Desc:"Create a heading level 2",heading3:"Heading 3",heading3Desc:"Create a heading level 3",heading4:"Heading 4",heading4Desc:"Create a heading level 4",heading5:"Heading 5",heading5Desc:"Create a heading level 5",heading6:"Heading 6",heading6Desc:"Create a heading level 6",paragraph:"Paragraph",paragraphDesc:"Create a paragraph",blockQuote:"Block quotation",blockQuoteDesc:"Create a block quotation",numberedList:"Numbered list",numberedListDesc:"Create a numbered list",bulletedList:"Bulleted list",bulletedListDesc:"Create a bulleted list",checklist:"Checklist",checklistDesc:"Create a checklist",table:"Table",tableDesc:"Insert a table",infoAlert:"Info alert",infoAlertDesc:"Create an info alert",tipAlert:"Tip alert",tipAlertDesc:"Create a tip alert",warningAlert:"Warning alert",warningAlertDesc:"Create a warning alert",dangerAlert:"Danger alert",dangerAlertDesc:"Create a danger alert",hr:"Horizontal line",hrDesc:"Insert a horizontal line",codeBlock:"Code block",codeBlockDesc:"Insert a code block",video:"YouTube",videoDesc:"Insert a YouTube video",equation:"Mathematical formula",equationDesc:"Insert a TeX expression",twitter:"Tweet",twitterDesc:"Insert an X (Tweet)",image:"Image",imageDesc:"Upload an image",file:"File",fileDesc:"Upload a file"},link:{newLink:"New link",url:"Link URL",title:"Text to display",copy:"Copy link to clipboard",open:"Open link in new tab",save:"Save",unlink:"Remove link"},table:{fitTable:"Fit table to page width",cellBackground:"Cell background color",column:"Column",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:"Delete column",row:"Row",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",merge:"Merge cells",mergeUp:"Merge cell up",mergeRight:"Merge cell right",mergeDown:"Merge cell down",mergeLeft:"Merge cell left",split:"Split cell",splitLeftRight:"Split cell left and right",splitTopBottom:"Split cell top and bottom",remove:"Remove table"},image:{view:"Full screen",remove:"Delete",previous:"Previous",next:"Next",close:"Close (Esc)",loadingError:"Unable to load image.",zoomOut:"Zoom out",zoomIn:"Zoom in",align:"Alignment",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",resize:"Resize image",pageWidth:"Page width",originalWidth:"Original image width",imageWidth:"{0} image width",open:"Open image in new tab",caption:"Caption",captionPlaceholder:"Write a caption..."},media:{download:"Download",remove:"Delete"},file:{download:"Download",remove:"Delete"},video:{embed:"Embed video",remove:"Delete",description:"Paste your YouTube link below.",url:"Link",urlError:"Please enter a valid link."},codeBlock:{langType:"Select language"},equation:{save:"Done",help:"Supported functions",placeholder:"Type a TeX expression..."},twitter:{embed:"Embed Tweet",remove:"Delete",description:"Paste your X (Twitter) link below.",url:"Link",urlError:"Please enter a valid link."}},"zh-CN":{toolbar:{undo:`撤消 (${ae("mod+Z")})`,redo:`重做 (${ae("mod+Y")})`,selectAll:`全选 (${ae("mod+A")})`,paragraph:"正文",blockQuote:"引用",numberedList:"编号",bulletedList:"项目符号",checklist:"任务列表",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignJustify:"两端对齐",increaseIndent:"增加缩进",decreaseIndent:"减少缩进",bold:`粗体 (${ae("mod+B")})`,italic:`斜体 (${ae("mod+I")})`,underline:`下划线 (${ae("mod+U")})`,strikethrough:"删除线",superscript:"上标",subscript:"下标",code:"行内代码",removeFormat:"清除格式",formatPainter:"格式刷",link:"链接",hr:"分割线",video:"YouTube",codeBlock:"代码块",heading:"标题",heading1:"标题 1",heading2:"标题 2",heading3:"标题 3",heading4:"标题 4",heading5:"标题 5",heading6:"标题 6",list:"列表",table:"表格",align:"对齐方式",indent:"缩进",fontFamily:"字体",fontSize:"文字大小",moreStyle:"更多样式",fontColor:"文字颜色",highlight:"文字背景",image:"图片",media:"视频",file:"文件",emoji:"表情",equation:"数学公式",twitter:"X (Tweet)",removeColor:"默认"},slash:{heading1:"标题 1",heading1Desc:"创建标题 1",heading2:"标题 2",heading2Desc:"创建标题 2",heading3:"标题 3",heading3Desc:"创建标题 3",heading4:"标题 4",heading4Desc:"创建标题 4",heading5:"标题 5",heading5Desc:"创建标题 5",heading6:"标题 6",heading6Desc:"创建标题 6",paragraph:"正文",paragraphDesc:"把当前段落改成正文",blockQuote:"引用",blockQuoteDesc:"创建引用",numberedList:"编号",numberedListDesc:"创建编号列表",bulletedList:"项目符号",bulletedListDesc:"创建项目符号列表",checklist:"任务列表",checklistDesc:"创建任务列表",table:"表格",tableDesc:"插入表格",infoAlert:"信息块",infoAlertDesc:"创建信息块",tipAlert:"提示块",tipAlertDesc:"创建提示块",warningAlert:"警告块",warningAlertDesc:"创建警告块",dangerAlert:"危险警告块",dangerAlertDesc:"创建危险警告块",hr:"分割线",hrDesc:"插入分割线",codeBlock:"代码块",codeBlockDesc:"插入代码块",video:"YouTube",videoDesc:"插入 YouTube 视频",equation:"数学公式",equationDesc:"支持 TeX 语法",twitter:"Tweet",twitterDesc:"插入 Tweet",image:"图片",imageDesc:"上传图片",file:"文件",fileDesc:"上传文件"},link:{newLink:"新链接",url:"链接 URL",title:"链接文本",copy:"复制到剪贴板",open:"打开链接",save:"确定",unlink:"取消链接"},table:{fitTable:"自适应宽度",cellBackground:"单元格背景颜色",column:"列",insertColumnLeft:"左侧插入列",insertColumnRight:"右侧插入列",deleteColumn:"删除列",row:"行",insertRowAbove:"上方插入行",insertRowBelow:"下方插入行",deleteRow:"删除行",merge:"合并单元格",mergeUp:"向上合并单元格",mergeRight:"向右合并单元格",mergeDown:"向下合并单元格",mergeLeft:"向左合并单元格",split:"拆分单元格",splitLeftRight:"左右拆分单元格",splitTopBottom:"上下拆分单元格",remove:"删除表格"},image:{view:"查看大图",remove:"删除",previous:"上一张",next:"下一张",close:"关闭 (Esc)",loadingError:"图片加载失败",zoomOut:"缩小",zoomIn:"放大",align:"对齐方式",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",resize:"调整图片大小",pageWidth:"图片适应页面大小",originalWidth:"图片原始大小",imageWidth:"{0} 图片大小",open:"在新标签页中打开图片",caption:"图片描述",captionPlaceholder:"请输入图片描述"},media:{download:"下载",remove:"删除"},file:{download:"下载",remove:"删除"},video:{embed:"嵌入视频",remove:"删除",description:"在下面的输入框里,粘贴 YouTube 链接。",url:"链接",urlError:"请输入有效的链接。"},codeBlock:{langType:"选择代码语言"},equation:{save:"确定",help:"支持的功能",placeholder:"请输入 TeX 表达式"},twitter:{embed:"嵌入 Tweet",remove:"删除",description:"在下面的输入框里,粘贴 X (Twitter) 链接。",url:"链接",urlError:"请输入有效的链接。"}},ja:{toolbar:{undo:`元に戻す (${ae("mod+Z")})`,redo:`やり直し (${ae("mod+Y")})`,selectAll:`すべて選択 (${ae("mod+A")})`,paragraph:"本文",blockQuote:"引用",numberedList:"番号付きリスト",bulletedList:"箇条書きリスト",checklist:"チェックリスト",alignLeft:"左揃え",alignCenter:"中央揃え",alignRight:"右揃え",alignJustify:"両端揃え",increaseIndent:"インデントを増やす",decreaseIndent:"インデントを減らす",bold:`太字 (${ae("mod+B")})`,italic:`斜体 (${ae("mod+I")})`,underline:`下線 (${ae("mod+U")})`,strikethrough:"取り消し線",superscript:"上付き文字",subscript:"下付き文字",code:"インラインコード",removeFormat:"形式を削除",formatPainter:"形式ペインタ",link:"リンク",hr:"区切り線",video:"YouTube",codeBlock:"コードブロック",heading:"見出し",heading1:"見出し 1",heading2:"見出し 2",heading3:"見出し 3",heading4:"見出し 4",heading5:"見出し 5",heading6:"見出し 6",list:"リスト",table:"テーブル",align:"整列",indent:"インデント",fontFamily:"フォント",fontSize:"フォントサイズ",moreStyle:"その他のスタイル",fontColor:"文字色",highlight:"ハイライト",image:"画像",media:"動画",file:"ファイル",emoji:"絵文字",equation:"数式",twitter:"ツイート",removeColor:"デフォルト"},slash:{heading1:"見出し 1",heading1Desc:"レベル 1 の見出しを作成",heading2:"見出し 2",heading2Desc:"レベル 2 の見出しを作成",heading3:"見出し 3",heading3Desc:"レベル 3 の見出しを作成",heading4:"見出し 4",heading4Desc:"レベル 4 の見出しを作成",heading5:"見出し 5",heading5Desc:"レベル 5 の見出しを作成",heading6:"見出し 6",heading6Desc:"レベル 6 の見出しを作成",paragraph:"本文",paragraphDesc:"段落を作成",blockQuote:"引用",blockQuoteDesc:"引用を作成",numberedList:"番号付きリスト",numberedListDesc:"番号付きリストを作成",bulletedList:"箇条書きリスト",bulletedListDesc:"箇条書きリストを作成",checklist:"チェックリスト",checklistDesc:"チェックリストを作成",table:"テーブル",tableDesc:"テーブルを挿入",infoAlert:"情報ブロック",infoAlertDesc:"情報ブロックを作成",tipAlert:"ヒントブロック",tipAlertDesc:"ヒントブロックを作成",warningAlert:"警告ブロック",warningAlertDesc:"警告ブロックを作成",dangerAlert:"危険ブロック",dangerAlertDesc:"危険ブロックを作成",hr:"区切り線",hrDesc:"水平線を挿入",codeBlock:"コードブロック",codeBlockDesc:"コードブロックを挿入",video:"YouTube",videoDesc:"YouTube から動画を挿入",equation:"数式",equationDesc:"TeX 数式を挿入",twitter:"ツイート",twitterDesc:"ツイートを挿入",image:"画像",imageDesc:"画像をアップロード",file:"ファイル",fileDesc:"ファイルをアップロード"},link:{newLink:"新しいリンク",url:"リンク URL",title:"リンクテキスト",copy:"クリップボードにコピー",open:"リンクを開く",save:"保存",unlink:"リンクを削除"},table:{fitTable:"ページ幅に合わせる",cellBackground:"セルの背景色",column:"列",insertColumnLeft:"左に列を挿入",insertColumnRight:"右に列を挿入",deleteColumn:"列を削除",row:"行",insertRowAbove:"上に行を挿入",insertRowBelow:"下に行を挿入",deleteRow:"行を削除",merge:"セルを結合",mergeUp:"上方向にセルを結合",mergeRight:"右方向にセルを結合",mergeDown:"下方向にセルを結合",mergeLeft:"左方向にセルを結合",split:"セルを分割",splitLeftRight:"セルを左右に分割",splitTopBottom:"セルを上下に分割",remove:"テーブルを削除"},image:{view:"大きな画像を見る",remove:"削除",previous:"前の画像",next:"次の画像",close:"閉じる (Esc)",loadingError:"画像を読み込めません",zoomOut:"縮小",zoomIn:"拡大",align:"整列",alignLeft:"左揃え",alignCenter:"中央揃え",alignRight:"右揃え",resize:"画像サイズを調整",pageWidth:"ページ幅",originalWidth:"画像の元のサイズ",imageWidth:"{0} 画像サイズ",open:"新しいタブで画像を開く",caption:"キャプション",captionPlaceholder:"キャプションを入力してください"},media:{download:"ダウンロード",remove:"削除"},file:{download:"ダウンロード",remove:"削除"},video:{embed:"動画を埋め込む",remove:"削除",description:"下の入力欄に YouTube リンクを貼り付けてください。",url:"リンク",urlError:"有効なリンクを入力してください。"},codeBlock:{langType:"コード言語を選択"},equation:{save:"保存",help:"サポートされている機能",placeholder:"TeX 数式を入力してください"},twitter:{embed:"ツイートを埋め込む",remove:"削除",description:"下の入力欄に X (Twitter) リンクを貼り付けてください。",url:"リンク",urlError:"有効なリンクを入力してください。"}},ko:{toolbar:{undo:`작업취소 (${ae("mod+Z")})`,redo:`다시 실행 (${ae("mod+Y")})`,selectAll:`전체 선택 (${ae("mod+A")})`,paragraph:"텍스트",blockQuote:"인용문",numberedList:"순서 목록",bulletedList:"비순서 목록",checklist:"체크리스트",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",alignJustify:"좌우로 정렬",increaseIndent:"들여쓰기 증가",decreaseIndent:"들여쓰기 줄이기",bold:`굵게 (${ae("mod+B")})`,italic:`기울임꼴 (${ae("mod+I")})`,underline:`밑줄 (${ae("mod+U")})`,strikethrough:"취소선",superscript:"위첨자",subscript:"아래 첨자",code:"인라인 코드",removeFormat:"형식 지우기",formatPainter:"형식 복사기",link:"링크",hr:"구분선",video:"유튜브",codeBlock:"코드 블록",heading:"제목",heading1:"제목 1",heading2:"제목 2",heading3:"제목 3",heading4:"제목 4",heading5:"제목 5",heading6:"제목 6",list:"목록",table:"표",align:"정렬",indent:"들여쓰기",fontFamily:"글꼴",fontSize:"글자 크기",moreStyle:"더 많은 스타일",fontColor:"글자 색상",highlight:"글자 배경",image:"이미지",media:"동영상",file:"파일",emoji:"이모지",equation:"수학 공식",twitter:"트윗",removeColor:"기본 색상"},slash:{heading1:"제목 1",heading1Desc:"1 단계 제목을 작성",heading2:"제목 2",heading2Desc:"2 단계 제목을 작성",heading3:"제목 3",heading3Desc:"3 단계 제목을 작성",heading4:"제목 4",heading4Desc:"4 단계 제목을 작성",heading5:"제목 5",heading5Desc:"5 단계 제목을 작성",heading6:"제목 6",heading6Desc:"6 단계 제목을 작성",paragraph:"텍스트",paragraphDesc:"단락을 작성",blockQuote:"인용문",blockQuoteDesc:"인용문을 작성",numberedList:"순서 목록",numberedListDesc:"순서 목록을 작성",bulletedList:"비순서 목록",bulletedListDesc:"비순서 목록을 작성",checklist:"체크리스트",checklistDesc:"체크리스트를 작성",table:"표",tableDesc:"표를 추가",infoAlert:"정보 블록",infoAlertDesc:"정보 블록을 작성",tipAlert:"팁 블록",tipAlertDesc:"팁 블록을 작성",warningAlert:"경고 블록",warningAlertDesc:"경고 블록을 작성",dangerAlert:"위험 블록",dangerAlertDesc:"위험 블록을 작성",hr:"구분선",hrDesc:"구분선을 추가",codeBlock:"코드 블록",codeBlockDesc:"코드 블록을 추가",video:"유튜브",videoDesc:"유튜브 동영상을 추가",equation:"수학 공식",equationDesc:"TeX 수식을 추가",twitter:"트윗",twitterDesc:"트윗을 추가",image:"이미지",imageDesc:"이미지를 업로드",file:"파일",fileDesc:"파일을 업로드"},link:{newLink:"새 링크",url:"링크 URL",title:"링크 텍스트",copy:"클립보드에 복사",open:"링크 열기",save:"저장",unlink:"링크 제거"},table:{fitTable:"페이지 너비에 맞게 조정",cellBackground:"셀 배경 색상",column:"열",insertColumnLeft:"왼쪽에 열을 추가",insertColumnRight:"오른쪽에 열을 추가",deleteColumn:"열을 삭제",row:"행",insertRowAbove:"위에 행을 추가",insertRowBelow:"아래에 행을 추가",deleteRow:"행을 삭제",merge:"셀을 병합",mergeUp:"위쪽으로 셀을 병합",mergeRight:"오른쪽으로 셀을 병합",mergeDown:"아래쪽으로 셀을 병합",mergeLeft:"왼쪽으로 셀을 병합",split:"셀을 분할",splitLeftRight:"셀을 좌우로 분할",splitTopBottom:"셀을 상하로 분할",remove:"표를 삭제"},image:{view:"큰 이미지 보기",remove:"삭제",previous:"이전 이미지",next:"다음 이미지",close:"닫기 (Esc)",loadingError:"이미지를 로드할 수 없습니다",zoomOut:"축소",zoomIn:"확대",align:"정렬",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",resize:"이미지 크기 조정",pageWidth:"페이지 너비",originalWidth:"원본 이미지 크기",imageWidth:"{0} 이미지 크기",open:"새 탭에서 이미지 열기",caption:"캡션",captionPlaceholder:"캡션을 입력하세요"},media:{download:"다운로드",remove:"삭제"},file:{download:"다운로드",remove:"삭제"},video:{embed:"동영상을 추가",remove:"삭제",description:"아래 입력란에 유튜브 링크를 붙여넣으세요.",url:"링크",urlError:"유효한 링크를 입력하세요."},codeBlock:{langType:"코드 언어 선택"},equation:{save:"저장",help:"지원되는 기능",placeholder:"TeX 수식을 입력하세요"},twitter:{embed:"트윗을 추가",remove:"삭제",description:"아래 입력란에 X (Twitter) 링크를 붙여넣으세요.",url:"링크",urlError:"유효한 링크를 입력하세요."}}},ce={},de={};function he(e){ce[e]||(ce[e]=le[e],function(e){de[e]={}}(e))}function pe(e){return function(e,t,i={}){return re(t,oe(e,i))}(e,ce[e],de[e])}Object.keys(le).forEach(he);class ue{constructor(e){if(this.clickListener=e=>{const t=new x(e.target),i=this.node.find(".lake-dropdown-title");t.closest(".lake-dropdown-title").get(0)!==i.get(0)&&this.hideMenu()},this.scrollListener=()=>this.updatePosition(),this.resizeListener=()=>this.updatePosition(),this.config=e,this.root=b(e.root),this.locale=e.locale||pe("en-US"),this.location=e.location||"local",this.direction=e.direction||"auto",this.node=b(S`
3
+ `),e.type&&this.node.addClass(`lake-${e.type}-button`),void 0!==e.tabIndex&&this.node.attr("tabindex",e.tabIndex.toString())}render(){const e=this.config,t=this.node;t.addClass(`lake-${e.text?"text":"icon"}-button`),e.tooltip&&t.attr("title",e.tooltip),e.icon&&t.append(e.icon),e.text&&t.append(`<span>${e.text}</span>`),this.root.append(t),this.root.get(0).appendChild(t.get(0)),t.on("mouseenter",()=>{t.attr("disabled")||t.hasClass("lake-button-selected")||t.addClass("lake-button-hovered")}),t.on("mouseleave",()=>{t.attr("disabled")||t.removeClass("lake-button-hovered")}),t.on("click",t=>{t.preventDefault(),e.onClick()})}}function G(e,...t){let i=e[0];for(let n=0;n<t.length;n++){i+=String(t[n]),i+=e[n+1]}return i.replace(/^\s+|\s+$|[\r\n]/gm,"")}const Y=/^\{.*\}$/,Q=/(\{(?:[^{}]+|\{(?:[^{}]+)*\})*\})/g,J=e=>e.substring(1,e.length-1),ee=(e,t=!0,i="",n="")=>e.split(Q).map(e=>{if(!e.match(Q))return e;const t=J(e);if(t.startsWith("{"))return((e,t)=>{let[i,n]=e.split(":");n||(n=i,i=t);const o=n.split("|"),[s,r,a,l,c,d]=o,h=o.filter(e=>void 0!==e).length;return 1===h?{k:i,r:s}:2===h?{k:i,o:s,r:r}:3===h?{k:i,z:s,o:r,r:a}:{k:i,z:s,o:r,t:a,f:l,m:c,r:d}})(J(t),n);const o=(e=>{const[t="",...i]=e.split("|"),[n="",o]=t.split(":"),[s,r]=n.split("?");return{k:s,i:o,n:""===r,f:i}})(t);return n=o.k||n,!i&&(i=n),o}).map(e=>{if("string"==typeof e)return e;e.k||(e.k=i||"0");const n=(e=>Object.fromEntries(Object.keys(e).map(t=>{const i=e[t];return[t,Array.isArray(i)?i.map(e=>null==e?void 0:e.trim()):i===!!i?i:null==i?void 0:i.trim()]})))(e);return t?(o=n,Object.fromEntries(Object.entries(o).map(([e,t])=>"i"!==e&&t&&"0"!=t&&[e,t]).filter(Boolean))):n;var o}),te=(e,t,i)=>t.reduce((t,i)=>{var n,o,s;return null!==(o=i.match(Y)?(e=>{var i;return null!==(i=e[t])&&void 0!==i?i:e["*"]})((s=i,Object.fromEntries(J(s).split(",").map(e=>e.split(":")).reduce((e,t)=>2===t.length?[...e,t.map(e=>e.trim())]:(e[e.length-1][1]+=","+t[0],e),[])))):null===(n=e[i])||void 0===n?void 0:n.call(e,t))&&void 0!==o?o:t},i),ie=/\?\?/g,ne=(e,t,i,n)=>{const o=n[0],s=o&&"object"==typeof o&&o.constructor===Object;return((e,t,i,n)=>e.map(e=>{if("string"==typeof e)return e;const{k:o="0",f:s=[]}=e,r=n[o];if((e=>!(!e.o&&!e.r))(e))return(("boolean"==typeof r?r?e.o:e.r:((e,{z:t,o:i,t:n,f:o,m:s,r:r},a)=>{switch(t&&0==a?"zero":e.select(a)){case"zero":return t;case"one":return i;case"two":return n;case"few":return null!=o?o:r;case"many":return null!=s?s:r;default:return r}})(t,e,r))||"").replace(ie,r);const a=s.length?te(i,s,r):r;return(""+(null!=a?a:"")).trim()}).join(""))(e,t,i,1===n.length&&s?o:n)},oe=(e,t)=>{const i={},n=new Intl.PluralRules(e);return(e,...o)=>ne(((e,t)=>e[t]||(e[t]=ee(t)))(i,e),n,t,o)};const se=(e={},t)=>"string"==typeof e?t.bind(null,e):Object.assign(Object.defineProperty(()=>"","name",{writable:!0}),e),re=(e,t)=>new Proxy(se(e,t),{get:(e,i)=>i===Symbol.iterator?[][Symbol.iterator].bind(Object.values(e).map(e=>se(e,t))):re(e[i],t)});function ae(e,t){if("undefined"==typeof window)return e;const i=(t=null!=t?t:navigator.userAgent).indexOf("Mac OS X")>=0?"⌘":"Ctrl";return e.replace(/(^|\+|\s)mod(\+|\s|$)/g,`$1${i}$2`)}const le={"en-US":{toolbar:{undo:`Undo (${ae("mod+Z")})`,redo:`Redo (${ae("mod+Y")})`,selectAll:`Select all (${ae("mod+A")})`,paragraph:"Paragraph",blockQuote:"Block quotation",numberedList:"Numbered list",bulletedList:"Bulleted list",checklist:"Checklist",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Justify",increaseIndent:"Increase indent",decreaseIndent:"Decrease indent",bold:`Bold (${ae("mod+B")})`,italic:`Italic (${ae("mod+I")})`,underline:`Underline (${ae("mod+U")})`,strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",code:"Inline code",removeFormat:"Remove format",formatPainter:"Format painter",link:"Link",hr:"Horizontal line",video:"YouTube",codeBlock:"Code block",heading:"Heading",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",list:"List",table:"Table",align:"Alignment",indent:"Indent",fontFamily:"Font family",fontSize:"Font size",moreStyle:"More style",fontColor:"Font color",highlight:"Highlight",image:"Image",media:"Video",file:"File",emoji:"Emoji",equation:"Mathematical formula",twitter:"X (Tweet)",removeColor:"Remove color"},slash:{heading1:"Heading 1",heading1Desc:"Create a heading level 1",heading2:"Heading 2",heading2Desc:"Create a heading level 2",heading3:"Heading 3",heading3Desc:"Create a heading level 3",heading4:"Heading 4",heading4Desc:"Create a heading level 4",heading5:"Heading 5",heading5Desc:"Create a heading level 5",heading6:"Heading 6",heading6Desc:"Create a heading level 6",paragraph:"Paragraph",paragraphDesc:"Create a paragraph",blockQuote:"Block quotation",blockQuoteDesc:"Create a block quotation",numberedList:"Numbered list",numberedListDesc:"Create a numbered list",bulletedList:"Bulleted list",bulletedListDesc:"Create a bulleted list",checklist:"Checklist",checklistDesc:"Create a checklist",table:"Table",tableDesc:"Insert a table",infoAlert:"Info alert",infoAlertDesc:"Create an info alert",tipAlert:"Tip alert",tipAlertDesc:"Create a tip alert",warningAlert:"Warning alert",warningAlertDesc:"Create a warning alert",dangerAlert:"Danger alert",dangerAlertDesc:"Create a danger alert",hr:"Horizontal line",hrDesc:"Insert a horizontal line",codeBlock:"Code block",codeBlockDesc:"Insert a code block",video:"YouTube",videoDesc:"Insert a YouTube video",equation:"Mathematical formula",equationDesc:"Insert a TeX expression",twitter:"Tweet",twitterDesc:"Insert an X (Tweet)",image:"Image",imageDesc:"Upload an image",media:"Video",mediaDesc:"Upload a video",file:"File",fileDesc:"Upload a file"},link:{newLink:"New link",url:"Link URL",title:"Text to display",copy:"Copy link to clipboard",open:"Open link in new tab",save:"Save",unlink:"Remove link"},table:{fitTable:"Fit table to page width",cellBackground:"Cell background color",column:"Column",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:"Delete column",row:"Row",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",merge:"Merge cells",mergeUp:"Merge cell up",mergeRight:"Merge cell right",mergeDown:"Merge cell down",mergeLeft:"Merge cell left",split:"Split cell",splitLeftRight:"Split cell left and right",splitTopBottom:"Split cell top and bottom",remove:"Remove table"},image:{view:"Full screen",remove:"Delete",previous:"Previous",next:"Next",close:"Close (Esc)",loadingError:"Unable to load image.",zoomOut:"Zoom out",zoomIn:"Zoom in",align:"Alignment",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",resize:"Resize image",pageWidth:"Page width",originalWidth:"Original image width",imageWidth:"{0} image width",open:"Open image in new tab",caption:"Caption",captionPlaceholder:"Write a caption..."},media:{download:"Download",remove:"Delete"},file:{download:"Download",remove:"Delete"},video:{embed:"Embed video",remove:"Delete",description:"Paste your YouTube link below.",url:"Link",urlError:"Please enter a valid link."},codeBlock:{langType:"Select language"},equation:{save:"Done",help:"Supported functions",placeholder:"Type a TeX expression..."},twitter:{embed:"Embed Tweet",remove:"Delete",description:"Paste your X (Twitter) link below.",url:"Link",urlError:"Please enter a valid link."}},"zh-CN":{toolbar:{undo:`撤消 (${ae("mod+Z")})`,redo:`重做 (${ae("mod+Y")})`,selectAll:`全选 (${ae("mod+A")})`,paragraph:"正文",blockQuote:"引用",numberedList:"编号",bulletedList:"项目符号",checklist:"任务列表",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignJustify:"两端对齐",increaseIndent:"增加缩进",decreaseIndent:"减少缩进",bold:`粗体 (${ae("mod+B")})`,italic:`斜体 (${ae("mod+I")})`,underline:`下划线 (${ae("mod+U")})`,strikethrough:"删除线",superscript:"上标",subscript:"下标",code:"行内代码",removeFormat:"清除格式",formatPainter:"格式刷",link:"链接",hr:"分割线",video:"YouTube",codeBlock:"代码块",heading:"标题",heading1:"标题 1",heading2:"标题 2",heading3:"标题 3",heading4:"标题 4",heading5:"标题 5",heading6:"标题 6",list:"列表",table:"表格",align:"对齐方式",indent:"缩进",fontFamily:"字体",fontSize:"文字大小",moreStyle:"更多样式",fontColor:"文字颜色",highlight:"文字背景",image:"图片",media:"视频",file:"文件",emoji:"表情",equation:"数学公式",twitter:"X (Tweet)",removeColor:"默认"},slash:{heading1:"标题 1",heading1Desc:"创建标题 1",heading2:"标题 2",heading2Desc:"创建标题 2",heading3:"标题 3",heading3Desc:"创建标题 3",heading4:"标题 4",heading4Desc:"创建标题 4",heading5:"标题 5",heading5Desc:"创建标题 5",heading6:"标题 6",heading6Desc:"创建标题 6",paragraph:"正文",paragraphDesc:"把当前段落改成正文",blockQuote:"引用",blockQuoteDesc:"创建引用",numberedList:"编号",numberedListDesc:"创建编号列表",bulletedList:"项目符号",bulletedListDesc:"创建项目符号列表",checklist:"任务列表",checklistDesc:"创建任务列表",table:"表格",tableDesc:"插入表格",infoAlert:"信息块",infoAlertDesc:"创建信息块",tipAlert:"提示块",tipAlertDesc:"创建提示块",warningAlert:"警告块",warningAlertDesc:"创建警告块",dangerAlert:"危险警告块",dangerAlertDesc:"创建危险警告块",hr:"分割线",hrDesc:"插入分割线",codeBlock:"代码块",codeBlockDesc:"插入代码块",video:"YouTube",videoDesc:"插入 YouTube 视频",equation:"数学公式",equationDesc:"支持 TeX 语法",twitter:"Tweet",twitterDesc:"插入 Tweet",image:"图片",imageDesc:"上传图片",media:"视频",mediaDesc:"上传视频",file:"文件",fileDesc:"上传文件"},link:{newLink:"新链接",url:"链接 URL",title:"链接文本",copy:"复制到剪贴板",open:"打开链接",save:"确定",unlink:"取消链接"},table:{fitTable:"自适应宽度",cellBackground:"单元格背景颜色",column:"列",insertColumnLeft:"左侧插入列",insertColumnRight:"右侧插入列",deleteColumn:"删除列",row:"行",insertRowAbove:"上方插入行",insertRowBelow:"下方插入行",deleteRow:"删除行",merge:"合并单元格",mergeUp:"向上合并单元格",mergeRight:"向右合并单元格",mergeDown:"向下合并单元格",mergeLeft:"向左合并单元格",split:"拆分单元格",splitLeftRight:"左右拆分单元格",splitTopBottom:"上下拆分单元格",remove:"删除表格"},image:{view:"查看大图",remove:"删除",previous:"上一张",next:"下一张",close:"关闭 (Esc)",loadingError:"图片加载失败",zoomOut:"缩小",zoomIn:"放大",align:"对齐方式",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",resize:"调整图片大小",pageWidth:"图片适应页面大小",originalWidth:"图片原始大小",imageWidth:"{0} 图片大小",open:"在新标签页中打开图片",caption:"图片描述",captionPlaceholder:"请输入图片描述"},media:{download:"下载",remove:"删除"},file:{download:"下载",remove:"删除"},video:{embed:"嵌入视频",remove:"删除",description:"在下面的输入框里,粘贴 YouTube 链接。",url:"链接",urlError:"请输入有效的链接。"},codeBlock:{langType:"选择代码语言"},equation:{save:"确定",help:"支持的功能",placeholder:"请输入 TeX 表达式"},twitter:{embed:"嵌入 Tweet",remove:"删除",description:"在下面的输入框里,粘贴 X (Twitter) 链接。",url:"链接",urlError:"请输入有效的链接。"}},ja:{toolbar:{undo:`元に戻す (${ae("mod+Z")})`,redo:`やり直し (${ae("mod+Y")})`,selectAll:`すべて選択 (${ae("mod+A")})`,paragraph:"本文",blockQuote:"引用",numberedList:"番号付きリスト",bulletedList:"箇条書きリスト",checklist:"チェックリスト",alignLeft:"左揃え",alignCenter:"中央揃え",alignRight:"右揃え",alignJustify:"両端揃え",increaseIndent:"インデントを増やす",decreaseIndent:"インデントを減らす",bold:`太字 (${ae("mod+B")})`,italic:`斜体 (${ae("mod+I")})`,underline:`下線 (${ae("mod+U")})`,strikethrough:"取り消し線",superscript:"上付き文字",subscript:"下付き文字",code:"インラインコード",removeFormat:"形式を削除",formatPainter:"形式ペインタ",link:"リンク",hr:"区切り線",video:"YouTube",codeBlock:"コードブロック",heading:"見出し",heading1:"見出し 1",heading2:"見出し 2",heading3:"見出し 3",heading4:"見出し 4",heading5:"見出し 5",heading6:"見出し 6",list:"リスト",table:"テーブル",align:"整列",indent:"インデント",fontFamily:"フォント",fontSize:"フォントサイズ",moreStyle:"その他のスタイル",fontColor:"文字色",highlight:"ハイライト",image:"画像",media:"動画",file:"ファイル",emoji:"絵文字",equation:"数式",twitter:"ツイート",removeColor:"デフォルト"},slash:{heading1:"見出し 1",heading1Desc:"レベル 1 の見出しを作成",heading2:"見出し 2",heading2Desc:"レベル 2 の見出しを作成",heading3:"見出し 3",heading3Desc:"レベル 3 の見出しを作成",heading4:"見出し 4",heading4Desc:"レベル 4 の見出しを作成",heading5:"見出し 5",heading5Desc:"レベル 5 の見出しを作成",heading6:"見出し 6",heading6Desc:"レベル 6 の見出しを作成",paragraph:"本文",paragraphDesc:"段落を作成",blockQuote:"引用",blockQuoteDesc:"引用を作成",numberedList:"番号付きリスト",numberedListDesc:"番号付きリストを作成",bulletedList:"箇条書きリスト",bulletedListDesc:"箇条書きリストを作成",checklist:"チェックリスト",checklistDesc:"チェックリストを作成",table:"テーブル",tableDesc:"テーブルを挿入",infoAlert:"情報ブロック",infoAlertDesc:"情報ブロックを作成",tipAlert:"ヒントブロック",tipAlertDesc:"ヒントブロックを作成",warningAlert:"警告ブロック",warningAlertDesc:"警告ブロックを作成",dangerAlert:"危険ブロック",dangerAlertDesc:"危険ブロックを作成",hr:"区切り線",hrDesc:"水平線を挿入",codeBlock:"コードブロック",codeBlockDesc:"コードブロックを挿入",video:"YouTube",videoDesc:"YouTube から動画を挿入",equation:"数式",equationDesc:"TeX 数式を挿入",twitter:"ツイート",twitterDesc:"ツイートを挿入",image:"画像",imageDesc:"画像をアップロード",media:"動画",mediaDesc:"動画をアップロード",file:"ファイル",fileDesc:"ファイルをアップロード"},link:{newLink:"新しいリンク",url:"リンク URL",title:"リンクテキスト",copy:"クリップボードにコピー",open:"リンクを開く",save:"保存",unlink:"リンクを削除"},table:{fitTable:"ページ幅に合わせる",cellBackground:"セルの背景色",column:"列",insertColumnLeft:"左に列を挿入",insertColumnRight:"右に列を挿入",deleteColumn:"列を削除",row:"行",insertRowAbove:"上に行を挿入",insertRowBelow:"下に行を挿入",deleteRow:"行を削除",merge:"セルを結合",mergeUp:"上方向にセルを結合",mergeRight:"右方向にセルを結合",mergeDown:"下方向にセルを結合",mergeLeft:"左方向にセルを結合",split:"セルを分割",splitLeftRight:"セルを左右に分割",splitTopBottom:"セルを上下に分割",remove:"テーブルを削除"},image:{view:"大きな画像を見る",remove:"削除",previous:"前の画像",next:"次の画像",close:"閉じる (Esc)",loadingError:"画像を読み込めません",zoomOut:"縮小",zoomIn:"拡大",align:"整列",alignLeft:"左揃え",alignCenter:"中央揃え",alignRight:"右揃え",resize:"画像サイズを調整",pageWidth:"ページ幅",originalWidth:"画像の元のサイズ",imageWidth:"{0} 画像サイズ",open:"新しいタブで画像を開く",caption:"キャプション",captionPlaceholder:"キャプションを入力してください"},media:{download:"ダウンロード",remove:"削除"},file:{download:"ダウンロード",remove:"削除"},video:{embed:"動画を埋め込む",remove:"削除",description:"下の入力欄に YouTube リンクを貼り付けてください。",url:"リンク",urlError:"有効なリンクを入力してください。"},codeBlock:{langType:"コード言語を選択"},equation:{save:"保存",help:"サポートされている機能",placeholder:"TeX 数式を入力してください"},twitter:{embed:"ツイートを埋め込む",remove:"削除",description:"下の入力欄に X (Twitter) リンクを貼り付けてください。",url:"リンク",urlError:"有効なリンクを入力してください。"}},ko:{toolbar:{undo:`작업취소 (${ae("mod+Z")})`,redo:`다시 실행 (${ae("mod+Y")})`,selectAll:`전체 선택 (${ae("mod+A")})`,paragraph:"텍스트",blockQuote:"인용문",numberedList:"순서 목록",bulletedList:"비순서 목록",checklist:"체크리스트",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",alignJustify:"좌우로 정렬",increaseIndent:"들여쓰기 증가",decreaseIndent:"들여쓰기 줄이기",bold:`굵게 (${ae("mod+B")})`,italic:`기울임꼴 (${ae("mod+I")})`,underline:`밑줄 (${ae("mod+U")})`,strikethrough:"취소선",superscript:"위첨자",subscript:"아래 첨자",code:"인라인 코드",removeFormat:"형식 지우기",formatPainter:"형식 복사기",link:"링크",hr:"구분선",video:"유튜브",codeBlock:"코드 블록",heading:"제목",heading1:"제목 1",heading2:"제목 2",heading3:"제목 3",heading4:"제목 4",heading5:"제목 5",heading6:"제목 6",list:"목록",table:"표",align:"정렬",indent:"들여쓰기",fontFamily:"글꼴",fontSize:"글자 크기",moreStyle:"더 많은 스타일",fontColor:"글자 색상",highlight:"글자 배경",image:"이미지",media:"동영상",file:"파일",emoji:"이모지",equation:"수학 공식",twitter:"트윗",removeColor:"기본 색상"},slash:{heading1:"제목 1",heading1Desc:"1 단계 제목을 작성",heading2:"제목 2",heading2Desc:"2 단계 제목을 작성",heading3:"제목 3",heading3Desc:"3 단계 제목을 작성",heading4:"제목 4",heading4Desc:"4 단계 제목을 작성",heading5:"제목 5",heading5Desc:"5 단계 제목을 작성",heading6:"제목 6",heading6Desc:"6 단계 제목을 작성",paragraph:"텍스트",paragraphDesc:"단락을 작성",blockQuote:"인용문",blockQuoteDesc:"인용문을 작성",numberedList:"순서 목록",numberedListDesc:"순서 목록을 작성",bulletedList:"비순서 목록",bulletedListDesc:"비순서 목록을 작성",checklist:"체크리스트",checklistDesc:"체크리스트를 작성",table:"표",tableDesc:"표를 추가",infoAlert:"정보 블록",infoAlertDesc:"정보 블록을 작성",tipAlert:"팁 블록",tipAlertDesc:"팁 블록을 작성",warningAlert:"경고 블록",warningAlertDesc:"경고 블록을 작성",dangerAlert:"위험 블록",dangerAlertDesc:"위험 블록을 작성",hr:"구분선",hrDesc:"구분선을 추가",codeBlock:"코드 블록",codeBlockDesc:"코드 블록을 추가",video:"유튜브",videoDesc:"유튜브 동영상을 추가",equation:"수학 공식",equationDesc:"TeX 수식을 추가",twitter:"트윗",twitterDesc:"트윗을 추가",image:"이미지",imageDesc:"이미지를 업로드",media:"이미지",mediaDesc:"동영상를 업로드",file:"파일",fileDesc:"파일을 업로드"},link:{newLink:"새 링크",url:"링크 URL",title:"링크 텍스트",copy:"클립보드에 복사",open:"링크 열기",save:"저장",unlink:"링크 제거"},table:{fitTable:"페이지 너비에 맞게 조정",cellBackground:"셀 배경 색상",column:"열",insertColumnLeft:"왼쪽에 열을 추가",insertColumnRight:"오른쪽에 열을 추가",deleteColumn:"열을 삭제",row:"행",insertRowAbove:"위에 행을 추가",insertRowBelow:"아래에 행을 추가",deleteRow:"행을 삭제",merge:"셀을 병합",mergeUp:"위쪽으로 셀을 병합",mergeRight:"오른쪽으로 셀을 병합",mergeDown:"아래쪽으로 셀을 병합",mergeLeft:"왼쪽으로 셀을 병합",split:"셀을 분할",splitLeftRight:"셀을 좌우로 분할",splitTopBottom:"셀을 상하로 분할",remove:"표를 삭제"},image:{view:"큰 이미지 보기",remove:"삭제",previous:"이전 이미지",next:"다음 이미지",close:"닫기 (Esc)",loadingError:"이미지를 로드할 수 없습니다",zoomOut:"축소",zoomIn:"확대",align:"정렬",alignLeft:"왼쪽 정렬",alignCenter:"가운데 정렬",alignRight:"오른쪽 정렬",resize:"이미지 크기 조정",pageWidth:"페이지 너비",originalWidth:"원본 이미지 크기",imageWidth:"{0} 이미지 크기",open:"새 탭에서 이미지 열기",caption:"캡션",captionPlaceholder:"캡션을 입력하세요"},media:{download:"다운로드",remove:"삭제"},file:{download:"다운로드",remove:"삭제"},video:{embed:"동영상을 추가",remove:"삭제",description:"아래 입력란에 유튜브 링크를 붙여넣으세요.",url:"링크",urlError:"유효한 링크를 입력하세요."},codeBlock:{langType:"코드 언어 선택"},equation:{save:"저장",help:"지원되는 기능",placeholder:"TeX 수식을 입력하세요"},twitter:{embed:"트윗을 추가",remove:"삭제",description:"아래 입력란에 X (Twitter) 링크를 붙여넣으세요.",url:"링크",urlError:"유효한 링크를 입력하세요."}}},ce={},de={};function he(e){ce[e]||(ce[e]=le[e],function(e){de[e]={}}(e))}function pe(e){return function(e,t,i={}){return re(t,oe(e,i))}(e,ce[e],de[e])}Object.keys(le).forEach(he);class ue{constructor(e){if(this.clickListener=e=>{const t=new x(e.target),i=this.node.find(".lake-dropdown-title");t.closest(".lake-dropdown-title").get(0)!==i.get(0)&&this.hideMenu()},this.scrollListener=()=>this.updatePosition(),this.resizeListener=()=>this.updatePosition(),this.config=e,this.root=b(e.root),this.locale=e.locale||pe("en-US"),this.location=e.location||"local",this.direction=e.direction||"auto",this.node=b(S`
4
4
  <div class="lake-dropdown lake-${e.menuType}-dropdown" name="${e.name}">
5
5
  <button type="button" name="${e.name}" class="lake-dropdown-title">
6
6
  <div class="lake-dropdown-${e.icon?"icon":"text"}"></div>
@@ -37,7 +37,7 @@ var Lake=function(e){"use strict";class t extends HTMLElement{}void 0!==customEl
37
37
  <input type="text" name="url" placeholder="${e.urlPlaceholder}" />
38
38
  </div>
39
39
  </div>
40
- `),s=new X({root:n.find(".lake-input-field"),name:"embed",type:"primary",text:Ae(o,e.embedButtonText),onClick:()=>{const s=n.find('input[name="url"]').value();e.validUrl(s)?(t.updateValue("url",s),i.history.save(),n.remove(),_e(e,t)):i.config.showMessage("error",Ae(o,e.urlError))}});n.find('input[name="url"]').on("keydown",e=>{Ce.isKeyHotkey("enter",e)&&(e.preventDefault(),s.node.emit("click"))}),s.render(),a.append(n)}else _e(e,t);i.readonly||function(e,t){const i=t.getEditor(),o=t.getContainer().find(".lake-iframe");o.find(".lake-corner-toolbar").length>0||new Se({locale:i.locale,root:o,items:[{name:"remove",icon:n.get("remove"),tooltip:e.deleteButtonText,onClick:e=>{e.stopPropagation(),i.selection.removeBox(t),i.history.save()}}]}).render()}(e,t)}}}class Te{constructor(e){this.fragment=null!=e?e:document.createDocumentFragment()}get(){return this.fragment}find(e){const t=[];let i=new x(this.fragment.firstChild);for(;i.length>0;)i.matches(e)?t.push(i.get(0)):i.isElement&&i.find(e).each(e=>{t.push(e)}),i=i.next();return new x(t)}append(e){b(e).each(e=>{this.fragment.appendChild(e)})}}function Ee(e){e=e.replace(/&quot;/gi,'"');const t={},i=/\s*([\w-]+)\s*:([^;]*)(?:;|$)/g;let n;for(;null!==(n=i.exec(e));){const e=n[1].toLowerCase().trim(),i=f(n[2]).trim();t[e]=i}return t}class Me{constructor(e,t=s()){this.rules=t,this.source="string"==typeof e?this.parseHTML(e):e}parseHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");return new x(t.querySelector("body"))}static matchRule(e,t){return"string"==typeof e?e===t:Array.isArray(e)?e.indexOf(t)>=0:e instanceof RegExp&&e.test(t)}static getOpenTagString(e,t){let i=e.name,n=t[i];if(!n)return"";"string"==typeof n&&(i=n,n=t[i]);const o=e.get(0);if(!o.hasAttributes())return i;const s=new Map;for(const e of o.attributes)if(n[e.name]&&("style"!==e.name&&Me.matchRule(n[e.name],e.value)&&s.set(e.name,e.value),"style"===e.name)){const t=n.style,i=new Map,o=Ee(e.value);for(const e of Object.keys(o)){const n=o[e];t[e]&&Me.matchRule(t[e],n)&&i.set(e,n)}s.set("style",i)}let r=i;for(const[e,t]of s)if("style"===e){let e="";for(const[i,n]of t)e+=`${i}: ${n.replace(/"/g,"&quot;")}; `;""!==e&&(r+=` style="${e.trim()}"`)}else r+=` ${e}="${t}"`;return r}static getClosedTagString(e,t){let i=e.name;const n=t[i];return n?("string"==typeof n&&(i=n),i):""}static getTrimmedText(e){const t=e.parent(),i=e.prev(),n=e.next();let o=e.text();return(i.isBlock||i.isBlockBox)&&(n.isBlock||n.isBlockBox)||0===i.length&&0===n.length&&t.isBlock?o=o.replace(/^[\u0020\t\r\n]+|[\u0020\t\r\n]+$/g,""):i.isBlock||i.isBlockBox||0===i.length&&t.isBlock?o=o.replace(/^[\u0020\t\r\n]+/,""):(n.isBlock||n.isBlockBox||0===n.length&&t.isBlock)&&(o=o.replace(/[\u0020\t\r\n]+$/,"")),o}getHTML(){const e=this.rules;let t="";for(const i of function*t(i){let n=i.first();for(;n.length>0;){const i=n.next();if(n.isText)yield C(Me.getTrimmedText(n));else if(n.isVoid){const t=Me.getOpenTagString(n,e);""!==t&&(yield`<${t} />`)}else if(n.isElement){const i=Me.getOpenTagString(n,e),o=Me.getClosedTagString(n,e);""!==i&&(yield`<${i}>`),n.isBox||(yield*t(n)),""!==o&&(yield`</${o}>`)}n=i}}(this.source))t+=i;return t.trim()}getFragment(){const e=this.getHTML(),t=this.parseHTML(e),i=document.createDocumentFragment();let n=t.first();for(;n.length>0;){const e=n.next();i.appendChild(n.get(0)),n=e}return i}}class Ie{constructor(e){this.content=e}getHTML(){let e=this.content;return e=e.replace(/ {2}/g,"  "),e=C(e.trim()),e=`<p>${e}</p>`,e=e.replace(/(\r\n){2,}/g,"</p><p><br /></p><p>"),e=e.replace(/\r\n/g,"</p><p>"),e=e.replace(/[\r\n]{2,}/g,"</p><p><br /></p><p>"),e=e.replace(/[\r\n]/g,"</p><p>"),e}getFragment(){return new Me(this.getHTML()).getFragment()}}function Pe(e,t){const i=e.get(),n=t.get(0);i.insertNode(n),i.setEndAfter(n),i.collapse(!1)}function He(e){if(e.commonAncestor.isOutside)return{anchor:new x,focus:new x};const t=e.startNode.closest("lake-box");if(t.length>0)return e.isBoxStart?t.attr("focus","start"):e.isBoxEnd?t.attr("focus","end"):t.attr("focus","center"),{anchor:new x,focus:t};if(e.isCollapsed){const t=e.clone();t.collapseToEnd();const i=b('<lake-bookmark type="focus" />');return Pe(t,i),{anchor:new x,focus:i}}const i=e.clone();i.collapseToStart();const n=b('<lake-bookmark type="anchor" />');Pe(i,n);const o=e.clone();o.collapseToEnd();const s=b('<lake-bookmark type="focus" />');return Pe(o,s),{anchor:n,focus:s}}function De(e,t){const i=e.prev(),n=e.next();if(i.isText||n.isText){const t=e.parent();e.remove(),t.get(0).normalize()}else if(0===i.length&&0===n.length){if(e.parent().isMark&&t){const i=new x(document.createTextNode("​"));e.before(i),t.setStartAfter(i),t.collapseToStart()}e.remove()}else e.remove()}function Ze(e,t){const i=t.anchor,n=t.focus;if(i.length>0&&0===n.length)De(i);else{if(n.length>0&&0===i.length){if(n.isBox){const t=we(n);0===t.getContainer().length&&t.render();const i=n.attr("focus");return"start"===i?e.selectBoxStart(n):"center"===i?e.selectBox(n):e.selectBoxEnd(n),void n.removeAttr("focus")}return e.setStartBefore(n),e.collapseToStart(),void De(n,e)}if(i.length>0&&n.length>0){const t=new N;t.selectNode(i),t.collapseToEnd(),-1===t.compareAfterNode(n)?(e.setStartBefore(n),De(n),e.setEndBefore(i),De(i)):(e.setStartBefore(i),De(i),e.setEndBefore(n),De(n))}}}function Ne(e){if(0===e.length)return;const t=[];let i=e.first();for(;i.length>0;){const e=i.next();i.isText&&""===i.text()||t.push(i),i=e}(1===t.length&&"br"===t[0].name||2===t.length&&"br"===t[0].name&&t[1].isBookmark)&&t[0].remove(),2===t.length&&t[0].isBookmark&&"br"===t[1].name&&t[1].remove()}function Oe(e){const t=b("<br />");let i=e;for(;i.isBlock;){let e=i.last();for(;e.isText&&e.isEmpty;)e=e.prev();if(!e.isBlock&&"br"!==e.name){i.append(t);break}i=e}return t}function ze(e){if(e.isText)return{node:e,offset:e.text().length};const t=new N;return t.setEndAfter(e),{node:t.endNode,offset:t.endOffset}}function $e(e,t){const i=t;if(["ul","ol"].indexOf(e.name)>=0){const t=e.find("li");e=t.eq(t.length-1)}if(["ul","ol"].indexOf(t.name)>=0){const e=t.find("li");t=e.eq(0)}if(e.isText||t.isText||e.isVoid||t.isVoid)return ze(e);Ne(e),Ne(t),e.isBlock&&e.isEmpty&&t.isEmpty&&Oe(e);const n=e.last(),o=t.first();let s=o;for(;s.length>0;){const t=s.next();e.append(s),s=t}return i.remove(),n.length>0&&o.length>0&&n.isElement&&!n.isBox&&n.clone(!1).get(0).isEqualNode(o.clone(!1).get(0))?$e(n,o):0===n.length?{node:e,offset:0}:ze(n)}function Ve(e){if(0===e.length)return;const t=e[0],i=e[e.length-1],n=[];let o=t.prev();for(;o.length>0&&"ol"===o.name;)n.push(o),o=o.prev();n.reverse(),n.push(...e);let s=i.next();for(;s.length>0&&"ol"===s.name;)n.push(s),s=s.next();let r=1;for(const e of n){const t=e.prev();if(0!==t.length&&"ol"===t.name||(r=1),"ol"===e.name){"ol"===t.name&&t.attr("indent")!==e.attr("indent")&&(r=1);const i=e.attr("start"),n=r.toString(10);i!==n&&e.attr("start",n),r++}}}function Re(e){if(e.isCollapsed)return;if(e.adjustBox(),e.adjustTable(),e.isInoperative)return;const t=e.startNode.closestBlock(),i=e.endNode.closestBlock(),n=t.get(0)===i.get(0);if(e.get().deleteContents(),e.adjustBlock(),n){const t=e.getBlocks()[0];if(t&&t.isEmpty){const i=Oe(t);e.setStartBefore(i),e.collapseToStart()}return}const o=e.getBlocks()[0];if(!o)return;const s=o.prev();if(0===s.length)return;const r=He(e);$e(s,o),Ve([s]),Ze(e,r)}function Fe(e,t){if(e.commonAncestor.isOutside)return;let i;t instanceof Te?i=t:t instanceof DocumentFragment?i=new Te(t):(i=new Te,i.append(t)),e.isCollapsed?e.adjustBox():Re(e);Ne(e.startNode.closestBlock());const n=e.get();n.insertNode(i.get()),n.collapse(!1),e.adjustBlock()}function qe(e){let t=e;for(;t.length>0;){let e=t.first();if(e.isText&&e.isEmpty&&(e=e.next()),t.isElement&&!t.isVoid&&0===e.length)break;t=e}return t}function We(e,t){if(t=null!=t?t:b("<p />"),0===e.length)return t;const i=qe(t=t.clone(!0));e[0].before(t);for(const t of e)i.append(t);return t}function je(e,t){if(e.commonAncestor.isOutside)return;if(e.isCollapsed){if(e.commonAncestor.closest("lake-box").isBlockBox)return}if("string"!=typeof t){const i=e.getBlocks();for(const e of i)e.css(t);return}const i=b(t),n=i.name,o=i.get(0).attributes,s=e.getBlocks();if(s.length>0){const t=He(e);for(const e of s)if(e.name===n&&0===i.first().length)for(const t of o)e.attr(t.name,t.value);else{const t=i.clone(!0);t.isList&&e.isList&&""!==e.attr("indent")&&t.attr("indent",e.attr("indent"));const n=qe(t);let o=e.first();for(;o.length>0;){const e=o.next();n.append(o),n.name!==o.name&&"li"!==o.name||o.remove(!0),o=e}e.replaceWith(t)}return Ze(e,t),void Ve(e.getBlocks())}if(e.isCollapsed){const t=e.getNextNode();if("br"===t.name){const i=b("<p><br /></p>");return t.replaceWith(i),void e.shrinkBefore(i)}const i=e.getPrevNode();if("br"===i.name){const t=b("<p><br /></p>");return i.replaceWith(t),void e.shrinkBefore(t)}}const r=He(e),a=function(e){const t=e.commonAncestor.closest('div[contenteditable="true"],td');let i=[];if(0===t.length)return i;let n=t.first(),o=!0;for(;n.length>0;){if(n.isMark||n.isText||n.isBookmark||n.isInlineBox)i.push(n);else{if(!o)break;i=[]}e.intersectsNode(n)&&(o=!1),n=n.next()}return i}(e),l=We(a,i);if(Ze(e,r),Ve(e.getBlocks()),l.isEmpty){const t=Oe(l);e.setStartBefore(t),e.collapseToStart()}}function Ue(e,t,i){const n=new N;let o;if(e.isText){o=e.parent();const i=e.splitText(t);n.setStartAfter(e),""===e.text()&&e.remove(),""===i.text()&&i.remove()}else n.setStart(e,t),o=e;if("body"===o.name||"html"===o.name)return null;if(o.get(0)===i.get(0))return null;n.collapseToStart();const s=o.clone();let r=o.first();for(;r.length>0&&!(n.compareBeforeNode(r)>=0);){const e=r.next();s.append(r),r=e}return o.before(s),o.parent().length>0&&o.parent().get(0)!==i.get(0)?Ue(o.parent(),o.index(),i):{start:s,end:o}}function Ke(e){if(e.isMark&&e.isEmpty)e.remove();else for(const t of e.getWalker())t.isMark&&t.isEmpty&&t.remove()}function Xe(e){if(e.commonAncestor.isOutside)return{start:null,end:null};e.isCollapsed?e.adjustBox():Re(e);const t=e.startNode,i=t.closestOperableBlock();if(0===i.length)return{start:null,end:null};let n=i.parent();n.isOutside&&(n=t.closestContainer());const o=Ue(t,e.startOffset,n);let s=null,r=null;return o&&(s=o.start,r=o.end),!o&&t.isBlock&&(e.startOffset>0&&(s=t.children()[e.startOffset-1]),r=t.children()[e.startOffset],r&&!r.isBlock&&(r=null)),s&&s.isEmpty&&(Ke(s),Oe(s)),r&&(r.isEmpty&&(Ke(r),Oe(r)),e.shrinkBefore(r)),Ve(e.getBlocks()),{start:s,end:r}}function Ge(e,t){if(e.commonAncestor.isOutside)return null;const i=b(t),n=Xe(e);return n.start&&(Ke(n.start),e.setEndAfter(n.start),e.collapseToEnd()),n.end&&(Ke(n.end),n.end.isEmpty&&n.end.remove()),Fe(e,i),i.isBox||e.shrinkAfter(i),n.start&&n.start.isEmpty&&n.start.remove(),i}function Ye(e,t,i){let n=null,o=null,s=e.closestBlock();0===s.length&&(s=e.closestContainer());const r=Ue(e,t,s);return r&&(i?(Ke(r.start),Ke(r.end),r.start.isEmpty||(n=r.start),r.end.isEmpty||(o=r.end)):(n=r.start,o=r.end)),{start:n,end:o}}function Qe(e,t=!0){if(e.commonAncestor.isOutside)return{start:null,center:null,end:null};if(e.adjustBox(),e.isCollapsed){const i=Ye(e.startNode,e.startOffset,t);return i.start?(e.setStartAfter(i.start),e.collapseToStart()):i.end&&(e.setStartBefore(i.end),e.collapseToStart()),{start:i.start,center:null,end:i.end}}const i=Ye(e.startNode,e.startOffset,t);i.start?e.setStartAfter(i.start):i.end&&e.setStartBefore(i.end);const n=Ye(e.endNode,e.endOffset,t);return n.start?e.setEndAfter(n.start):n.end&&e.setEndBefore(n.end),{start:i.start,center:n.start,end:n.end}}function Je(e,t){const i=e.text();let n=e;for(;n.length>0;){const e=n.parent();if(!e.isMark||i!==e.text()||!n.isText&&n.name===t&&""!==n.attr("style"))break;n=e}return n}function et(e,t){if(e.commonAncestor.isOutside)return;let i=b(t);const n=i.name,o=Ee(i.attr("style"));if(e.isCollapsed){if(e.isBox){const t=e.startNode.closest("lake-box");if("block"===we(t).type){const i=b("<p><br /></p>");e.isBoxStart?t.before(i):t.after(i),e.shrinkAfter(i)}else e.adjustBox()}Ne(e.startNode.closestBlock());const t=new x(document.createTextNode("​")),s=function(e){let t=e;t.isText&&(t=t.parent());let i=null;for(;t.length>0&&t.isMark;){if(i){const e=t.clone();e.append(i),i=e}else i=t.clone();t=t.parent()}return i}(e.startNode);if(Qe(e),s){let e=s;for(;e.length>0;)e.name===n&&e.css(o),e=e.first();s.name===n?i=s:i.append(s)}if(""===i.text()){qe(i).append(t)}return Fe(e,i),function(e){const t=e.prev();t.length>0&&t.isText&&t.isEmpty&&t.remove();const i=e.next();i.length>0&&i.isText&&i.isEmpty&&i.remove()}(i),void e.shrinkAfter(i)}Qe(e);const s=e.getMarks(!0),r=He(e);for(const e of s)if(!e.isEmpty&&e.isText){const t=Je(e,n);if(t.isMark&&t.name===n)t.css(o);else{const e=i.clone();t.before(e),e.append(t)}}Ze(e,r)}function tt(e,t){if(e.commonAncestor.isOutside)return;let i;if(t){i=b(t).name}if(e.isCollapsed){if(e.isBox)return;if(i&&0===e.commonAncestor.closest(i).length)return;const t=Qe(e,!1);if(!t.start)return;t.end&&Ke(t.end);const n=new x(document.createTextNode("​")),o=function(e,t){if(!e.isMark||!t)return null;let i=null,n=null,o=e;for(;o.length>0&&o.isMark;){if(o.name!==t)if(n){const e=o.clone();n.append(e),n=e}else i=o.clone(),n=i;o=o.last()}return i}(t.start,i);if(!o)return t.start.after(n),Ke(t.start),n.prev().isText?(e.setStartAfter(n.prev()),e.collapseToStart(),void n.remove()):(e.setStartAfter(n),void e.collapseToStart());return qe(o).append(n),t.start.after(o),Ke(t.start),void e.shrinkAfter(o)}Qe(e);const n=e.getMarks(),o=He(e);for(const e of n)if(!i||e.name===i){const t=e.parent();e.remove(!e.isEmpty),t.length>0&&t.get(0).normalize()}!function(e){for(const t of e.getWalker())if(t.isText){const e=t.text();""===e?t.remove():e.length>1&&/\u200B/.test(e)&&(t.get(0).nodeValue=e.replace(/\u200B/g,""))}}(e.commonAncestor),Ze(e,o)}function it(e,t,i){if(e.commonAncestor.isOutside)return null;const n=we(t);if(i&&(n.value=i),"inline"===n.type){if(Qe(e),Fe(e,n.node),n.render(),n.node.isTopInside){const e=b("<p />");n.node.before(e),e.append(n.node)}return e.selectBoxEnd(n.node),we(n.node)}return Ge(e,n.node),n.render(),e.selectBoxEnd(n.node),we(n.node)}function nt(e){const t=e.node.closestContainer();if(e.unmount(),e.node.remove(),t.length>0){A(t.id).delete(e.node.id);A(0).set(e.node.id,e)}return e}function ot(e){if(e.commonAncestor.isOutside)return null;const t=e.commonAncestor.closest("lake-box");if(0===t.length)return null;const i=we(t);if("block"===i.type){const n=b("<p><br /></p>");return t.before(n),e.shrinkAfter(n),nt(i)}e.setStartBefore(t),e.collapseToStart();const n=t.parent();if(nt(i),n.isEmpty){const t=Oe(n);e.setStartBefore(t),e.collapseToStart()}return i}function st(e,t=100,i={}){if("function"!=typeof e)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");if("boolean"==typeof i)throw new TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");const{immediate:n}=i;let o,s,r,a,l;function c(){const t=o,i=s;return o=void 0,s=void 0,l=e.apply(t,i),l}function d(){const e=Date.now()-a;e<t&&e>=0?r=setTimeout(d,t-e):(r=void 0,n||(l=c()))}const h=function(...e){if(o&&this!==o&&Object.getPrototypeOf(this)===Object.getPrototypeOf(o))throw new Error("Debounced method called with different contexts of the same prototype.");o=this,s=e,a=Date.now();const i=n&&!r;if(r||(r=setTimeout(d,t)),i)return l=c(),l};return Object.defineProperty(h,"isPending",{get:()=>void 0!==r}),h.clear=()=>{r&&(clearTimeout(r),r=void 0,o=void 0,s=void 0)},h.flush=()=>{r&&h.trigger()},h.trigger=()=>{l=c(),h.clear()},h}var rt=_(ke?be:(ke=1,be=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,o,s;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(o=n;0!==o--;)if(!e(t[o],i[o]))return!1;return!0}if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],i.get(o[0])))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if((n=t.length)!=i.length)return!1;for(o=n;0!==o--;)if(t[o]!==i[o])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(s=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(i,s[o]))return!1;for(o=n;0!==o--;){var r=s[o];if(!e(t[r],i[r]))return!1}return!0}return t!=t&&i!=i})),at=Object.defineProperty,lt=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,ut=(e,t,i)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,mt=(e,t)=>{for(var i in t||(t={}))ht.call(t,i)&&ut(e,i,t[i]);if(dt)for(var i of dt(t))pt.call(t,i)&&ut(e,i,t[i]);return e},gt=(e,t)=>lt(e,ct(t));function ft(e){const t=/[\w\-]+$/.exec(e);return t?t[0]:""}var vt=new Map([["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],[" ","&nbsp;"]]);function wt(e){return e.replace(/[&<>"\xA0]/g,e=>vt.get(e))}function yt(e){var t;let i=`<${e.tagName}`;return e.attributes&&(i+=` ${function(e){const t=[];for(const i of Object.keys(e)){const n=String(e[i]);t.push(`${i}="${wt(n)}"`)}return t.join(" ")}(e.attributes)}`),!0===e.isVoid?i+=" />":i+=`>${null!=(t=e.innerHTML)?t:""}</${e.tagName}>`,i}function xt(e,t){t=null!=t?t:{hr:()=>({tagName:"div",attributes:{class:"lake-box-block lake-hr"},innerHTML:"<hr />"}),image:e=>({tagName:"img",attributes:gt(mt(mt(mt({src:e.url},e.width&&{width:e.width}),e.height&&{height:e.height}),e.caption&&{alt:e.caption}),{border:"0"}),isVoid:!0}),file:(e,t)=>({tagName:"a",attributes:{href:e.url,target:"_blank"},innerHTML:t(e.name)}),codeBlock:(e,t)=>({tagName:"pre",attributes:{class:`lang-${e.lang}`},innerHTML:`<code>${t(e.code)}</code>`}),emoji:e=>({tagName:"img",attributes:{src:e.url,width:"32",height:"32",border:"0"},isVoid:!0}),equation:e=>({tagName:"code",innerHTML:e.code}),mention:(e,t)=>{var i;return{tagName:"a",attributes:{href:`/${e.name}`,target:"_blank"},innerHTML:t(null!=(i=e.nickname)?i:e.name)}},video:e=>({tagName:"iframe",attributes:gt(mt({},e.url&&{src:`https://www.youtube.com/embed/${ft(e.url)}`}),{title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowfullscreen:"true",style:"width: 560px; height: 315px;"})}),twitter:e=>({tagName:"iframe",attributes:gt(mt({},e.url&&{src:`https://platform.twitter.com/embed/Tweet.html?id=${ft(e.url)}`}),{title:"Twitter tweet",scrolling:"no",frameborder:"0",allowtransparency:"true",allowfullscreen:"true",style:"width: 550px; height: 300px;"})})};return e.replace(/(<lake-box[^>]+>)[\s\S]*?(?:<\/lake-box>|$)|(<anchor\s*\/>)|(<focus\s*\/>)/gi,(e,i)=>{if(i){const e=function(e){const t={},i=/\s+(?:([\w\-:]+)=([^\s"'<>]+)|([\w\-:"]+)="([^"]*)"|([\w\-:"]+)='([^']*)')(?=[\s/>])/g;let n;for(;n=i.exec(e);){const e=(n[1]||n[3]||n[5]).toLowerCase(),i=n[1]?n[2]:n[3]?n[4]:n[6];t[e]=i}return t}(i),n=t[e.name];if(n)try{const t=e.value?JSON.parse(function(e){const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(new TextDecoder).decode(i)}(e.value)):{};return yt(n(t,wt))}catch(e){console.error("Failed to parse lake-box value:",e)}}return""})}function bt(e){return e.replace(/(<lake-box[^>]+>)[\s\S]*?<\/lake-box>|<lake-bookmark\s+type="(anchor|focus)">\s*<\/lake-bookmark>/gi,(e,t,i)=>t?`${t}</lake-box>`:"anchor"===i?"<anchor />":"focus"===i?"<focus />":e)}function kt(e){return e.replace(/(<lake-box[^>]+>)[\s\S]*?(?:<\/lake-box>|$)|(<anchor\s*\/>)|(<focus\s*\/>)/gi,(e,t,i,n)=>t?`${t}</lake-box>`:i?'<lake-bookmark type="anchor"></lake-bookmark>':n?'<lake-bookmark type="focus"></lake-bookmark>':e)}function Ct(e){const t=e.get(0),i={};if(t.hasAttributes())for(const e of t.attributes)i[e.name]=e.value;return i}class St{constructor(e){const t=window.getSelection();if(!t)throw new Error("Selection object is null.");this.selection=t,this.container=e,this.range=this.getCurrentRange()}getCurrentRange(){if(this.selection.rangeCount>0){const e=this.selection.getRangeAt(0);return new N(e)}return new N}sync(){this.container.contains(this.range.commonAncestor)&&(this.selection.removeAllRanges(),this.selection.addRange(this.range.get()))}updateByRange(){const e=this.getCurrentRange();this.container.contains(e.commonAncestor)&&(this.range.startNode.get(0)===e.startNode.get(0)&&this.range.startOffset===e.startOffset&&this.range.endNode.get(0)===e.endNode.get(0)&&this.range.endOffset===e.endOffset||(this.range=e))}updateByBookmark(){const e=this.range,t=this.container,i=t.find("lake-box[focus]");if(i.length>0)return Ze(e,{anchor:new x,focus:i}),void this.sync();Ze(e,{anchor:t.find('lake-bookmark[type="anchor"]'),focus:t.find('lake-bookmark[type="focus"]')}),this.sync()}getActiveItems(){const e=[];return function(e,t){let i=t.startNode;for(i.isText&&(i=i.parent());i.length>0&&i.isContentEditable&&!i.isContainer;)e.push({node:i,name:i.name,attributes:Ct(i),styles:Ee(i.attr("style"))}),i=i.parent()}(e,this.range),function(e,t){const i=t.startNode;let n;if(i.isText&&i.text().length===t.startOffset){const e=i.next();e.length>0&&e.isElement&&(n=e)}if(i.isElement){const e=i.children();if(e.length>0){const i=e[t.startOffset];i&&i.isElement&&(n=i)}}if(n){let t=n;for(;t.length>0;)t.isElement&&e.push({node:t,name:t.name,attributes:Ct(t),styles:Ee(t.attr("style"))}),t=t.first()}}(e,this.range),e}cloneContainer(){const e=this.range,t=this.container.clone(!0);if(t.find("lake-box").each(e=>{we(e).getContainer().empty()}),!this.container.contains(e.commonAncestor))return t;if(e.isInsideBox){const i=e.commonAncestor.closest("lake-box").path(),n=t.find(i),o=e.clone();return o.selectBox(n),He(o),t}const i=e.startNode.path(),n=e.endNode.path(),o=t.find(i),s=t.find(n),r=e.clone();return r.setStart(o,e.startOffset),r.setEnd(s,e.endOffset),He(r),t}insertBookmark(){return He(this.range)}toBookmark(e){return Ze(this.range,e)}insertContents(e){return Fe(this.range,e)}deleteContents(){return Re(this.range)}setBlocks(e){return je(this.range,e)}splitBlock(){return Xe(this.range)}insertBlock(e){return Ge(this.range,e)}splitMarks(e){return Qe(this.range,e)}addMark(e){return et(this.range,e)}removeMark(e){return tt(this.range,e)}selectBox(e){let t=e;t=e instanceof ve?e.node:e,this.range.selectBox(t),this.sync()}insertBox(e,t){const i=it(this.range,e,t);if(!i)throw new Error(`Box "${e}" cannot be inserted into the outside of the editor.`);return i}removeBox(e=null){return e&&this.selectBox(e),ot(this.range)}}class Bt{constructor(e){this.commandMap=new Map,this.selection=e}add(e,t){this.commandMap.set(e,t)}delete(e){this.commandMap.delete(e)}getNames(){return Array.from(this.commandMap.keys())}has(e){return void 0!==this.commandMap.get(e)}getItem(e){const t=this.commandMap.get(e);if(void 0===t)throw new Error(`Command "${e}" has not been defined yet.`);return t}isDisabled(e){const t=this.getItem(e);if(!t.isDisabled)return!1;const i=this.selection.getActiveItems();return t.isDisabled(i)}isSelected(e){const t=this.getItem(e);if(!t.isSelected)return!1;const i=this.selection.getActiveItems();return t.isSelected(i)}selectedValues(e){const t=this.getItem(e);if(!t.selectedValues)return[];const i=this.selection.getActiveItems();return t.selectedValues(i)}execute(e,...t){const i=this.selection.container,n=this.selection.range;i.contains(n.commonAncestor)||n.shrinkAfter(i);this.getItem(e).execute.apply(this,t),v(`Command "${e}" executed`)}}const At=new Set;function _t(){}const Lt={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:_t,afterNodeAdded:_t,beforeNodeMorphed:_t,afterNodeMorphed:_t,beforeNodeRemoved:_t,afterNodeRemoved:_t,beforeAttributeUpdated:_t,afterAttributeUpdated:_t,beforeChildrenUpdated:_t},head:{style:"merge",shouldPreserve:e=>"true"===e.getAttribute("im-preserve"),shouldReAppend:e=>"true"===e.getAttribute("im-re-append"),shouldRemove:_t,afterHeadMorphed:_t}};function Tt(e,t){return!e.deadIds.has(t)}function Et(e,t,i){return(e.idMap.get(i)||At).has(t)}function Mt(e,t){const i=e.idMap.get(t)||At;for(const t of i)e.deadIds.add(t)}function It(e,t,i){const n=e.idMap.get(t)||At;let o=0;for(const t of n)Tt(e,t)&&Et(e,t,i)&&++o;return o}function Pt(e,t){const i=e.parentElement,n=e.querySelectorAll("[id]");for(const e of n){let n=e;for(;n!==i&&null!=n;){let i=t.get(n);null==i&&(i=new Set,t.set(n,i)),i.add(e.id),n=n.parentElement}}}function Ht(e,t){const i=new Map;return Pt(e,i),Pt(t,i),i}function Dt(e,t,i){return{target:e,newContent:t,config:i=function(e){const t={};return Object.assign(t,Lt),Object.assign(t,e),t.callbacks={},Object.assign(t.callbacks,Lt.callbacks),Object.assign(t.callbacks,e.callbacks),t.head={},Object.assign(t.head,Lt.head),Object.assign(t.head,e.head),t}(i),morphStyle:i.morphStyle,ignoreActive:i.ignoreActive,ignoreActiveValue:i.ignoreActiveValue,idMap:Ht(e,t),deadIds:new Set,callbacks:i.callbacks,head:i.head}}function Zt(e,t,i){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName&&(""!==e.id&&e.id===t.id||It(i,e,t)>0))}function Nt(e,t){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName)}function Ot(e,t){Mt(t,e),!1!==t.callbacks.beforeNodeRemoved(e)&&(e.remove(),t.callbacks.afterNodeRemoved(e))}function zt(e,t,i){let n=e;for(;n&&n!==t;){const e=n;n=n.nextSibling,Ot(e,i)}return Mt(i,t),t.nextSibling}function $t(e,t,i,n,o){const s=It(o,i,t);let r=null;if(s>0){r=n;let t=0;for(;null!=r;){if(Zt(i,r,o))return r;if(t+=It(o,r,e),t>s)return null;r=r.nextSibling}}return r}function Vt(e,t,i,n,o){let s=n,r=i.nextSibling,a=0;for(;null!=s;){if(It(o,s,e)>0)return null;if(Nt(i,s))return s;if(Nt(r,s)&&(a++,r=r?r.nextSibling:null,a>=2))return null;s=s?s.nextSibling:null}return s}function Rt(e,t,i){return Nt(e,t)?.5+It(i,e,t):0}function Ft(e,t,i,n){return!("value"!==e||!n.ignoreActiveValue||t!==document.activeElement)||!1===n.callbacks.beforeAttributeUpdated(e,t,i)}function qt(e,t,i){var n;if(!i.ignoreActive||e!==document.activeElement)return null==t?!1===i.callbacks.beforeNodeRemoved(e)?e:(e.remove(),i.callbacks.afterNodeRemoved(e),null):Nt(e,t)?(!1===i.callbacks.beforeNodeMorphed(e,t)||(function(e,t,i){const n=e.nodeType;if(1===n){const n=e.attributes,o=t.attributes;for(const e of n)Ft(e.name,t,"update",i)||t.getAttribute(e.name)!==e.value&&(t.setAttribute(e.name,e.value),i.callbacks.afterAttributeUpdated(e.name,t,"update"));for(let n=o.length-1;n>=0;n--){const s=o[n];Ft(s.name,t,"remove",i)||e.hasAttribute(s.name)||(t.removeAttribute(s.name),i.callbacks.afterAttributeUpdated(s.name,t,"remove"))}}8!==n&&3!==n||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue)}(t,e,i),!1===i.callbacks.beforeChildrenUpdated(e,t)||function(e,t){return t.ignoreActiveValue&&e===document.activeElement}(e,i)||Wt(t,e,i),i.callbacks.afterNodeMorphed(e,t)),e):!1===i.callbacks.beforeNodeRemoved(e)||!1===i.callbacks.beforeNodeAdded(t)?e:(null===(n=e.parentElement)||void 0===n||n.replaceChild(t,e),i.callbacks.afterNodeAdded(t),i.callbacks.afterNodeRemoved(e),t)}function Wt(e,t,i){let n,o=e.firstChild,s=t.firstChild;for(;o;){if(n=o,o=n.nextSibling,null==s){if(!1===i.callbacks.beforeNodeAdded(n))return;t.appendChild(n),i.callbacks.afterNodeAdded(n),Mt(i,n);continue}if(Zt(n,s,i)){qt(s,n,i),s=s.nextSibling,Mt(i,n);continue}const r=$t(e,t,n,s,i);if(r){s=zt(s,r,i),qt(r,n,i),Mt(i,n);continue}const a=Vt(e,0,n,s,i);if(a)s=zt(s,a,i),qt(a,n,i),Mt(i,n);else{if(!1===i.callbacks.beforeNodeAdded(n))return;t.insertBefore(n,s),i.callbacks.afterNodeAdded(n),Mt(i,n)}}for(;null!==s;){const e=s;s=s.nextSibling,Ot(e,i)}}function jt(e,t,i){if("innerHTML"===i.morphStyle)return Wt(t,e,i),e.children;const n=function(e,t,i){let n;n=e.firstChild;let o=n,s=0;for(;n;){const e=Rt(n,t,i);e>s&&(o=n,s=e),n=n.nextSibling}return o}(t,e,i),o=null==n?void 0:n.previousSibling,s=null==n?void 0:n.nextSibling,r=qt(e,n,i);return n?function(e,t,i){var n,o;const s=[],r=[];let a=e;for(;null!=a;)s.push(a),a=a.previousSibling;for(;s.length>0;){const e=s.pop();r.push(e),e&&(null===(n=t.parentElement)||void 0===n||n.insertBefore(e,t))}r.push(t);let l=i;for(;null!=l;)s.push(l),r.push(l),l=l.nextSibling;for(;s.length>0;){const e=s.pop();e&&(null===(o=t.parentElement)||void 0===o||o.insertBefore(e,t.nextSibling))}return r}(o,r,s):[]}function Ut(e,t,i={}){const n=function(e){if(null==e)return document.createElement("div");if(e instanceof Node){if(e.generatedByIdiomorph)return e;const t=document.createElement("div");return t.append(e),t}const t=document.createElement("div");for(const i of[...e])t.append(i);return t}(t.get(0)),o=Dt(e.get(0),n,i);jt(e.get(0),n,o)}class Kt{constructor(e){this.canSave=!0,this.list=[],this.index=0,this.limit=100,this.contentRules=s(),this.event=new M,this.selection=e,this.container=e.container}removeBookmark(e){return e.replace(/(<lake-box[^>]+)\sfocus="\w+"([^>]*>)|<lake-bookmark\s+type="(?:anchor|focus)">\s*<\/lake-bookmark>/gi,(e,t,i)=>t?`${t}${i}`:"")}getValue(e){return new Me(e,this.contentRules).getHTML()}addIdToBoxes(e){e.find("lake-box").each(e=>{const t=new x(e),i=`${t.attr("name")}-${t.attr("value")}`;t.attr("id",i)})}removeIdfromBoxes(e){e.find("lake-box").each(e=>{new x(e).removeAttr("id")})}morphContainer(e){const t=this.container,i={beforeChildrenUpdated:e=>{if("lake-box"===new x(e).name)return!1},afterAttributeUpdated:(e,i)=>{const n=new x(i);if(["name","value"].indexOf(e)>=0&&"lake-box"===n.name){we(n).unmount();A(t.id).delete(n.id)}}},n=e.clone(!0);this.addIdToBoxes(t),this.addIdToBoxes(n),Ut(t,n,{callbacks:i}),this.removeIdfromBoxes(t),this.removeIdfromBoxes(n)}get canUndo(){return this.index>1&&!!this.list[this.index-2]}get canRedo(){return!!this.list[this.index]}undo(){if(!this.list[this.index-2])return;this.selection.insertBookmark();const e=this.getValue(this.container);for(;this.index>1;){const t=this.list[this.index-2];if(!t)break;this.index--;const i=this.getValue(t);if(this.removeBookmark(i)!==this.removeBookmark(e)){this.morphContainer(t),this.event.emit("undo",i);break}}this.selection.updateByBookmark(),v(`History undone (index: ${this.index})`)}redo(){if(!this.list[this.index])return;this.selection.insertBookmark();const e=this.getValue(this.container);for(;this.index<this.list.length;){const t=this.list[this.index];if(!t)break;this.index++;const i=this.getValue(t);if(this.removeBookmark(i)!==this.removeBookmark(e)){this.morphContainer(t),this.event.emit("redo",i);break}}this.selection.updateByBookmark(),v(`History redone (index: ${this.index})`)}continue(){this.canSave=!0}pause(){this.canSave=!1}save(e={}){var t,i,n;const o=null!==(t=e.inputType)&&void 0!==t?t:"",s=null!==(i=e.update)&&void 0!==i&&i,r=null===(n=e.emitEvent)||void 0===n||n;if(!this.canSave)return;const a=this.selection.cloneContainer(),l=this.getValue(a);this.list[this.index-1]&&this.removeBookmark(this.getValue(this.list[this.index-1]))===this.removeBookmark(l)||(s?this.list.splice(this.index-1,1/0,a):(this.list.splice(this.index,1/0,a),this.index++),this.list.length>this.limit&&(this.list.shift(),this.index=this.list.length),v(`History saved (index: ${this.index}, inputType: "${o}", update: ${s}, emitEvent: ${r})`),r&&this.event.emit("save",bt(l),{inputType:o,update:s,emitEvent:r}))}}class Xt{constructor(e){this.keydownEventList=[],this.keyupEventList=[],this.container=e,this.container.on("keydown",e=>{const t=e;if(!t.isComposing&&!t.defaultPrevented)for(const e of this.keydownEventList)if(Ce.isKeyHotkey(e.type,t)&&!1===e.listener(t))break}),this.container.on("keyup",e=>{const t=e;if(!t.isComposing&&!t.defaultPrevented)for(const e of this.keyupEventList)if(Ce.isKeyHotkey(e.type,t)&&!1===e.listener(t))break})}setKeydown(e,t){this.keydownEventList.push({type:e,listener:t})}setKeyup(e,t){this.keyupEventList.push({type:e,listener:t})}keydown(e){for(const t of this.keydownEventList)if(t.type===e&&!1===t.listener(new KeyboardEvent(e)))break}keyup(e){for(const t of this.keyupEventList)if(t.type===e&&!1===t.listener(new KeyboardEvent(e)))break}}const Gt={value:"<p><br /></p>",readonly:!1,spellcheck:!1,tabIndex:0,placeholder:"",indentWithTab:!0,lang:"en-US",contentRules:s(),minChangeSize:5,historySize:100,showMessage:(e,t)=>{"success"!==e?"warning"!==e?"error"===e&&console.error(t):console.warn(t):console.log(t)},downloadFile:(e,t)=>{window.open(t)},slash:!1,mention:!1};class Yt{constructor(e){if(this.unsavedInputData="",this.unsavedInputCount=0,this.state={activeItems:[],disabledNameMap:new Map,selectedNameMap:new Map,selectedValuesMap:new Map},this.unmountPluginMap=new Map,this.event=new M,this.isComposing=!1,this.popup=null,this.copyListener=e=>{const t=this.selection.getCurrentRange();this.container.contains(t.commonAncestor)&&this.event.emit("copy",e)},this.cutListener=e=>{const t=this.selection.getCurrentRange();this.container.contains(t.commonAncestor)&&this.event.emit("cut",e)},this.pasteListener=e=>{const t=this.selection.getCurrentRange();this.container.contains(t.commonAncestor)&&this.event.emit("paste",e)},this.selectionchangeListener=()=>{this.updateSelectionRange(),this.updateBoxSelectionStyle(),this.emitStateChangeEvent()},this.clickListener=e=>{const t=new x(e.target);t.get(0).isConnected&&this.event.emit("click",t)},this.updateSelectionRange=st(()=>{this.selection.updateByRange()},1,{immediate:!0}),this.updateBoxSelectionStyle=st(()=>{if(0===this.root.first().length)return;const e=this.selection.getCurrentRange(),t=e.clone();t.adjustBox(),this.container.find("lake-box").each(i=>{const n=we(i),o=n.getContainer();if(0!==o.length){if(e.compareBeforeNode(o)<0&&e.compareAfterNode(o)>0&&(!e.isCollapsed||e.startNode.get(0)!==o.get(0)||0!==e.startOffset))return o.removeClass("lake-box-hovered"),o.removeClass("lake-box-selected"),o.removeClass("lake-box-focused"),o.addClass("lake-box-activated"),void n.event.emit("focus");if(t.intersectsNode(n.node))return o.removeClass("lake-box-activated"),void(e.isCollapsed?(o.removeClass("lake-box-hovered"),o.removeClass("lake-box-selected"),o.addClass("lake-box-focused"),n.event.emit("focus")):(o.removeClass("lake-box-focused"),o.addClass("lake-box-selected"),n.event.emit("blur")));o.removeClass("lake-box-activated"),o.removeClass("lake-box-focused"),o.removeClass("lake-box-selected"),n.event.emit("blur")}})},50,{immediate:!0}),this.emitStateChangeEvent=st(()=>{const e=this.getState();rt(e,this.state)||(this.toolbar&&this.toolbar.updateState(e),this.event.emit("statechange",e),this.state=e)},50,{immediate:!1}),!e.root)throw new Error("The root of the config must be specified.");this.root=b(e.root),this.toolbar=e.toolbar,this.config=Object.assign({},Gt);for(const t of Object.keys(e))this.config[t]=e[t];this.containerWrapper=b('<div class="lake-container-wrapper" />'),this.container=b('<div class="lake-container" />'),this.overlayContainer=b('<div class="lake-overlay" />'),this.readonly=this.config.readonly,this.container.attr({contenteditable:this.readonly?"false":"true",spellcheck:this.config.spellcheck?"true":"false",tabindex:this.config.tabIndex.toString(),readonly:this.readonly?"true":"false"}),""!==this.config.placeholder&&this.container.attr("placeholder",this.config.placeholder),this.selection=new St(this.container),this.command=new Bt(this.selection),this.history=new Kt(this.selection),this.history.limit=this.config.historySize,this.history.contentRules=this.config.contentRules,this.keystroke=new Xt(this.container),P.set(this.container.id,this)}togglePlaceholderClass(e){const t="lake-placeholder";"<p><br /></p>"===(e=bt(e)).replace("<focus />","")?this.container.addClass(t):this.container.removeClass(t)}moveBoxStripText(){const e=this.selection,t=e.range,i=t.startNode.closest(".lake-box-strip"),n=i.closest("lake-box");if("inline"===we(n).type)t.isBoxStart?(t.setStartBefore(n),t.collapseToStart()):(t.setStartAfter(n),t.collapseToStart());else{const e=b("<p />");t.isBoxStart?n.before(e):n.after(e),t.setStart(e,0),t.collapseToStart()}const o=i.text();i.html("<br />"),e.insertContents(document.createTextNode(o))}resetUnsavedInputData(){this.unsavedInputData="",this.unsavedInputCount=0}handleInputEvent(e){var t;this.selection.updateByRange();const i=this.selection.range;if(i.isInsideBox)return;if(i.isBoxStart||i.isBoxEnd)return this.moveBoxStripText(),void this.history.save();if("insertText"===(e instanceof CompositionEvent?"insertText":e.inputType)){const i=null!==(t=e.data)&&void 0!==t?t:"";return i.length>1?void this.history.save({inputType:"insertText",update:!1}):(this.unsavedInputData+=i,this.unsavedInputCount++,void(this.unsavedInputData.length<this.config.minChangeSize?this.history.save({inputType:"insertText",update:this.unsavedInputCount>1}):(this.history.save({inputType:"insertText",update:!0}),this.resetUnsavedInputData())))}this.history.save()}bindInputEvents(){this.container.on("compositionstart",()=>{this.isComposing=!0,this.container.removeClass("lake-placeholder")}),this.container.on("compositionend",e=>{this.isComposing=!1,this.handleInputEvent(e)}),this.container.on("input",e=>{const t=e;this.isComposing=t.isComposing,this.isComposing||this.handleInputEvent(e)})}removeBoxGarbage(){const e=A(this.container.id);for(const t of e.values())t.node.get(0).isConnected||(t.unmount(),e.delete(t.node.id))}bindHistoryEvents(){const e=e=>{this.fixContent()&&(this.history.save({update:!0,emitEvent:!1}),e=this.getValue()),this.emitStateChangeEvent(),this.togglePlaceholderClass(e),this.scrollToCursor(),this.event.emit("change",e)};this.history.event.on("undo",t=>{this.renderBoxes(),e(t),this.resetUnsavedInputData()}),this.history.event.on("redo",t=>{this.renderBoxes(),e(t),this.resetUnsavedInputData()}),this.history.event.on("save",(t,i)=>{this.removeBoxGarbage(),e(t),"insertText"!==i.inputType&&(this.selection.sync(),this.resetUnsavedInputData())})}bindPointerEvents(){this.container.on("pointerdown",e=>{const t=e;if(null!==t.target&&t.target!==this.container.get(0))return;const i=this.container.last();if(i.isTable||i.isBlockBox){const e=i.get(0).getBoundingClientRect();if(t.clientY>e.bottom){t.preventDefault();const e=b("<p><br /></p>");i.after(e),this.selection.range.shrinkBefore(e),this.selection.sync()}}})}get locale(){return pe(this.config.lang)}setPluginConfig(e,t){"object"!=typeof this.config[e]&&(this.config[e]={});for(const i of Object.keys(t))void 0===this.config[e][i]&&(this.config[e][i]=t[i])}fixContent(){const e=this.selection.range,t=e.commonAncestor.closest("td"),i=t.length>0?t:this.container;let n=!1,o=i.children();for(const e of o)(e.isBlock||e.isMark)&&""===e.html()&&(e.remove(),n=!0,v(`Content fixed: empty tag "${e.name}" was removed`));if(o=i.children(),0===o.length)i.html("<p><br /></p>"),e.shrinkBefore(i),n=!0,v("Content fixed: default paragraph was added");else if(1===o.length){const t=o[0];if(t.isVoid||t.isText){const i=e.startNode,o=e.startOffset,s=e.endNode,r=e.endOffset,a=b("<p />");t.before(a),a.append(t),i.isText||s.isText?(e.setStart(i,o),e.setEnd(s,r)):e.shrinkAfter(a),n=!0,v(`Content fixed: void element "${t.name}" was wrapped in paragraph`)}}return e.adjustBr(),n}renderBoxes(){this.removeBoxGarbage();const e=this.container,t=A(e.id);e.find("lake-box").each(e=>{const i=b(e);if(t.get(i.id))return;we(i).render()})}scrollToCursor(){const e=this.selection.range;if(e.isBox)return;const t=e.getRect();if(0===t.x||0===t.y)return;const i=this.container.get(0).getBoundingClientRect(),n=b('<div class="lake-artificial-cursor" />'),o=t.x-i.x,s=t.y-i.y;n.css({position:"absolute",top:`${s}px`,left:`${o}px`,width:`${t.width}px`,height:`${t.height}px`,"z-index":"-1"}),this.overlayContainer.find(".lake-artificial-cursor").remove(),this.overlayContainer.append(n),function(e,t){const i=Z(e);0===i.left&&0===i.right&&0===i.top&&0===i.bottom||e.get(0).scrollIntoView(t)}(n,{behavior:"instant",block:"nearest",inline:"nearest"}),n.remove()}hasFocus(){const e=document.activeElement;return!!e&&b(e).closest(".lake-container").get(0)===this.container.get(0)}focus(){const e=this.selection.range;this.container.contains(e.commonAncestor)&&e.isBox||this.container.focus()}blur(){this.container.blur()}getState(){const e=this.command.getNames();let t=this.selection.getActiveItems();t.length>0&&!this.container.contains(t[0].node)&&(t=[]);const i=new Map,n=new Map,o=new Map;for(const s of e){const e=this.command.getItem(s);if(e.isDisabled&&e.isDisabled(t)&&i.set(s,!0),e.isSelected&&e.isSelected(t)&&n.set(s,!0),t.length>0&&e.selectedValues){const i=e.selectedValues(t);i.length>0&&o.set(s,i)}}return{activeItems:t,disabledNameMap:i,selectedNameMap:n,selectedValuesMap:o}}setValue(e){e=kt(e);const t=new Me(e,this.config.contentRules),i=t.getFragment();this.container.empty(),this.togglePlaceholderClass(t.getHTML()),this.container.append(i),this.renderBoxes(),this.selection.updateByBookmark()}getValue(){const e=this.selection.cloneContainer();let t=new Me(e,this.config.contentRules).getHTML();return t=bt(t),t}getHTML(){return xt(this.getValue())}render(){const e=kt(this.config.value),t=new Me(e,this.config.contentRules),i=t.getFragment();if(this.root.empty(),this.root.append(this.containerWrapper),this.containerWrapper.append(this.container),this.containerWrapper.append(this.overlayContainer),this.togglePlaceholderClass(t.getHTML()),this.container.append(i),this.unmountPluginMap=Yt.plugin.loadAll(this),this.readonly||(this.selection.updateByBookmark(),this.history.save({emitEvent:!1})),this.renderBoxes(),this.toolbar){this.toolbar.render(this);const e=this.getState();this.toolbar.updateState(e)}document.addEventListener("copy",this.copyListener),this.readonly||(document.addEventListener("cut",this.cutListener),document.addEventListener("paste",this.pasteListener),document.addEventListener("selectionchange",this.selectionchangeListener),document.addEventListener("click",this.clickListener),this.bindInputEvents(),this.bindHistoryEvents(),this.bindPointerEvents())}unmount(){this.updateSelectionRange.flush(),this.updateBoxSelectionStyle.flush(),this.emitStateChangeEvent.flush();for(const e of this.unmountPluginMap.keys()){const t=this.unmountPluginMap.get(e);t&&(t(),v(`Plugin "${e}" unmounted`))}this.toolbar&&this.toolbar.unmount(),this.removeBoxGarbage(),this.container.find("lake-box").each(e=>{we(b(e)).unmount()}),this.event.removeAllListeners(),this.history.event.removeAllListeners(),this.root.off(),this.root.empty(),document.removeEventListener("copy",this.copyListener),this.readonly||(document.removeEventListener("cut",this.cutListener),document.removeEventListener("paste",this.pasteListener),document.removeEventListener("selectionchange",this.selectionchangeListener),document.removeEventListener("click",this.clickListener))}}Yt.version="0.4.5",Yt.locale=new class{add(e,t){le[e]=t,he(e)}getNames(){return Object.keys(le)}},Yt.box=new class{add(e){I.set(e.name,e)}remove(e){I.delete(e)}getNames(){return Array.from(I.keys())}},Yt.plugin=new class{constructor(){this.pluginMap=new Map}add(e,t){this.pluginMap.set(e,t)}loadAll(e){const t=new Map;for(const i of this.pluginMap.keys()){const n=this.pluginMap.get(i);if(n&&!1!==e.config[i]){const o=n(e);o&&t.set(i,o)}}return t}};function Qt(e,t){const i=e.get(0),n=b(S`<${t} />`);for(const e of i.attributes)n.attr(e.name,e.value);let o=e.first();for(;o.length>0;){const e=o.next();n.append(o),o=e}return e.replaceWith(n),n}const Jt=Array.from(a).join(",");function ei(e){const t=[e];for(const i of e.getWalker())t.push(i);for(const e of t)"div"===e.name?e.find(Jt).length>0?e.remove(!0):Qt(e,"p"):(e.isHeading||["blockquote","li"].indexOf(e.name)>=0)&&e.find(Jt).remove(!0)}function ti(e,t){const i=e.selection,n=i.range;if(0===t.childNodes.length)return;const o=new x(t.firstChild);let s=new x(t.lastChild);0===n.getBlocks().length&&i.setBlocks("<p />"),function(e,t){const i=e.selection.range,n=i.startNode.closest("lake-box");if(n.length>0)if("inline"===we(n).type)i.isBoxStart?(i.setStartBefore(n),i.collapseToStart()):i.isBoxEnd?(i.setStartAfter(n),i.collapseToStart()):e.selection.removeBox();else{const t=b("<p />");i.isBoxStart?(n.before(t),i.shrinkAfter(t)):i.isBoxEnd?(n.after(t),i.shrinkAfter(t)):e.selection.removeBox()}const o=i.startNode.closestBlock();if(t.isBlockBox){const i=we(t),n=""!==t.attr("value")?i.value:void 0;return e.selection.insertBox(i.name,n),void t.remove()}if(t.first().length>0&&Ne(o),o.isEmpty&&"p"===o.name)return o.replaceWith(t),t.find("lake-box").each(e=>{we(e).render()}),void i.shrinkAfter(t);let s=t.first();for(;s.length>0;){"li"===s.name&&(s=s.first());const t=s.next();e.selection.insertContents(s),s.isBox?we(s).render():s.isElement&&s.find("lake-box").each(e=>{we(e).render()}),s=t}t.remove()}(e,o);let r=new x(t.firstChild);for(;r.length>0;){const e=r.next();"br"===r.name&&r.remove(),r=e}if(s=new x(t.lastChild),t.childNodes.length>0){const o=i.splitBlock();o.start&&(n.setEndAfter(o.start),n.collapseToEnd()),o.end&&o.end.isEmpty&&o.end.remove(),i.insertContents(t),e.renderBoxes(),n.shrinkAfter(s)}Ve(e.container.children().filter(e=>e.isBlock)),e.history.save()}const ii=["info","tip","warning","danger"];function ni(e){e.selection.setBlocks("<p />")}function oi(e){e.selection.setBlocks("<ol><li></li></ol>")}function si(e){e.selection.setBlocks("<ul><li></li></ul>")}function ri(e,t){e.selection.setBlocks(`<ul type="checklist"><li value="${t}"></li></ul>`)}function ai(e){const t=e.startNode.closest("table"),i=b("<p><br /></p>");t.replaceWith(i),e.shrinkBefore(i),v(`deleteTable: table ${t.id}`)}function li(e){const t=[];for(let i=0;i<e.rows.length;i++)t[i]=[];for(let i=0;i<t.length;i++){const n=e.rows[i],o=t[i];let s=0;for(let e=0;e<n.cells.length;e++){for(s=e;o[s];)s++;const r=n.cells[e];for(let e=0;e<r.colSpan;e++)for(let n=0;n<r.rowSpan;n++){const o=t[i+n];o&&(o[s+e]=r)}}}return t}function ci(e,t,i){const n=e[t];for(let e=0;e<n.length;e++){if(n[e]===i)return e}return-1}function di(e,t,i){const n=e[t],o=e[t-1];let s=i;for(let e=0;e<i;e++){const t=n[e];if(t===n[e+1])s--;else if(o){t===o[e]&&s--}}return s}function hi(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0),a=i.get(0),l=r.rowIndex,c=li(s);let d=ci(c,l,a);if("right"===t){const e=c[l];if(d++,e)for(;a===e[d];)d++}v(`insertColumn: rows ${s.rows.length}, column ${d}, ${t}`);for(let e=0;e<s.rows.length;e++){const t=s.rows[e],i=c[e],n=di(c,e,d),o=t.cells[n];if(o&&o.colSpan>1&&o===i[d-1])o.colSpan+=1,o.rowSpan>1&&(e+=o.rowSpan-1);else{t.insertCell(n).innerHTML="<p><br /></p>"}}}function pi(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0);let a=li(s);const l=a[0].length;let c;c="up"===t?r.rowIndex:r.rowIndex+1;const d=s.rows[c];v(`insertRow: rows ${s.rows.length}, target row ${c}`);const h=s.insertRow(c);if(!d){for(let e=0;e<l;e++){h.insertCell(h.cells.length).innerHTML="<p><br /></p>"}return}a=li(s),c=d.rowIndex;let p=-1;for(let e=0;e<l;e++){const t=di(a,c,e);if(t!==p){p=t;const i=d.cells[t];if(!i)break;const n=h.insertCell(h.cells.length);n.innerHTML="<p><br /></p>",i.colSpan>1&&(n.colSpan=i.colSpan,e+=i.colSpan-1)}}for(let e=c-1;e>=0;e--){const t=s.rows[e].cells;for(let i=0;i<t.length;i++){const n=t[i];n.rowSpan>1&&n.rowSpan+1>c-e&&(n.rowSpan+=1)}}}const ui=[{value:"insertLeft",text:e=>e.table.insertColumnLeft()},{value:"insertRight",text:e=>e.table.insertColumnRight()},{value:"delete",text:e=>e.table.deleteColumn()}],mi=[{value:"insertAbove",text:e=>e.table.insertRowAbove()},{value:"insertBelow",text:e=>e.table.insertRowBelow()},{value:"delete",text:e=>e.table.deleteRow()}],gi=[{value:"up",text:e=>e.table.mergeUp()},{value:"right",text:e=>e.table.mergeRight()},{value:"down",text:e=>e.table.mergeDown()},{value:"left",text:e=>e.table.mergeLeft()}],fi=[{value:"leftRight",text:e=>e.table.splitLeftRight()},{value:"topBottom",text:e=>e.table.splitTopBottom()}];function vi(e,t){const i=[{name:"expand",type:"button",icon:n.get("expand"),tooltip:e=>e.table.fitTable(),isSelected:()=>{const t=e.selection.range.startNode.closest("table");if(0===t.length)return!1;return t.css("width")===e.container.innerWidth()-2+"px"},onClick:()=>{const t=e.selection.range.startNode.closest("table");if(0===t.length)return;const i=t.css("width"),n=e.container.innerWidth()-2+"px";i===n?t.css("width",""):t.css("width",n),e.history.save()}},{name:"backgroundColor",type:"dropdown",downIcon:n.get("down"),icon:n.get("backgroundColor"),accentIcon:n.get("backgroundColorAccent"),defaultValue:t.backgroundColor,tooltip:e=>e.table.cellBackground(),menuType:"color",menuItems:F,menuWidth:"296px",selectedValues:()=>{const t=e.selection.range.startNode.closest("td");if(t.length>0){return[f(t.computedCSS("background-color"))]}return[]},onSelect:(i,n)=>{e.selection.range.startNode.closest("td").css("background-color",n),t.backgroundColor=n,e.history.save()}},{name:"tableColumn",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableColumn"),tooltip:e=>e.table.column(),menuType:"list",menuItems:ui,menuCheck:!1,onSelect:(t,i)=>{const n=e.selection.range;"insertLeft"===i?hi(n,"left"):"insertRight"===i?hi(n,"right"):function(e){const t=e.startNode.closest("td"),i=t.closest("table"),n=t.closest("tr"),o=i.get(0),s=n.get(0),r=t.get(0),a=s.rowIndex,l=li(o),c=ci(l,a,r);let d=null;const h=r.cellIndex;s.cells[h+1]?d=s.cells[h+1]:s.cells[h-1]&&(d=s.cells[h-1]),v(`deleteColumn: rows ${o.rows.length}, column ${c}`);const p=function(e,t){for(let i=0;i<e.length;i++){const n=e[i][t],o=e[i+1];if(o&&n.colSpan!==o[t].colSpan)return!1}return!0}(l,c);for(let t=0;t<o.rows.length;t++){const i=o.rows[t],n=di(l,t,c),s=i.cells[n];s.rowSpan>1&&(t+=s.rowSpan-1),s.colSpan>1&&!p?(s.colSpan-=1,1===s.colSpan&&s.removeAttribute("colSpan")):(s===r&&d&&e.shrinkBefore(b(d)),i.deleteCell(n))}0===o.rows[0].cells.length&&ai(e)}(n),e.history.save()}},{name:"tableRow",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableRow"),tooltip:e=>e.table.row(),menuType:"list",menuItems:mi,menuCheck:!1,onSelect:(t,i)=>{const n=e.selection.range;"insertAbove"===i?pi(n,"up"):"insertBelow"===i?pi(n,"down"):function(e){const t=e.startNode.closest("td"),i=t.closest("table"),n=t.closest("tr"),o=i.get(0),s=n.get(0),r=t.get(0),a=s.rowIndex;let l=li(o);const c=l[0].length,d=ci(l,a,r),h=o.rows[a+1]||o.rows[a-1];v(`deleteRow: rows ${o.rows.length}, target row ${a}, column ${d}`);for(let e=a-1;e>=0;e--){const t=o.rows[e].cells;for(let i=0;i<t.length;i++){const n=t[i];n.rowSpan>1&&n.rowSpan>a-e&&(n.rowSpan-=1,1===n.rowSpan&&n.removeAttribute("rowSpan"))}}const p=o.rows[a+1];if(p){let e=-1;for(let t=0;t<c;t++){const i=di(l,a,t);if(i!==e){e=i;const n=s.cells[i];if(n.rowSpan>1){const e=di(l,a+1,t);let i=p.insertCell(e);const o=n.cloneNode(!0);o.removeAttribute("rowSpan"),i.replaceWith(o),i=o,n.rowSpan>2&&(i.rowSpan=n.rowSpan-1)}}}}if(o.deleteRow(a),h){l=li(o);const t=di(l,h.rowIndex,d),i=h.cells[t];i&&e.shrinkBefore(b(i))}0===o.rows.length&&ai(e)}(n),e.history.save()}},{name:"tableMerge",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableMerge"),tooltip:e=>e.table.merge(),menuType:"list",menuItems:gi,menuCheck:!1,onSelect:(t,i)=>{!function(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0),a=i.get(0),l=r.rowIndex,c=li(s);if("left"===t||"right"===t){const i=a.cellIndex;let n,o,s;if("left"===t?(n=r.cells[i-1],o=i,s=a):(n=a,o=i+1,s=r.cells[o]),!n||!s)return;if(v(`mergeCells: row ${l}, cell ${i}, other row ${l}, other cell ${o}`),n.rowSpan!==s.rowSpan)return;const d=c[l],h=ci(c,l,n),p=ci(c,l,s);if(d[h+1]!==s&&d[p-1]!==n)return;return n.colSpan+=s.colSpan,$e(b(n),b(s)),void e.shrinkBefore(b(n))}const d=ci(c,l,a);let h,p,u,m,g,f;if("up"===t){h=-1,p=null;for(let e=r.rowIndex-1;e>=0;e--){const t=c[e];if(!t)break;const i=t[d];if(!i)break;if(p&&i!==p)break;h=e,p=i}u=r.rowIndex,m=r,g=a.cellIndex,f=a}else{h=r.rowIndex,p=a,u=-1,f=null,g=-1;for(let e=r.rowIndex+1;e<s.rows.length;e++){const t=c[e];if(!t)break;const i=t[d];if(!i)break;if(i!==f){u=e,f=i,g=f.cellIndex;break}}if(m=s.rows[u],!m)return}p&&f&&(v(`mergeCells: row ${h}, cell ${p.cellIndex}, other row ${u}, other cell ${g}`),p.colSpan===f.colSpan&&(p.rowSpan+=f.rowSpan,$e(b(p),b(f)),e.shrinkBefore(b(p))))}(e.selection.range,i),e.history.save()}},{name:"tableSplit",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableSplit"),tooltip:e=>e.table.split(),menuType:"list",menuItems:fi,menuCheck:!1,onSelect:(t,i)=>{!function(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0),a=i.get(0),l=r.rowIndex,c=a.rowSpan,d=a.colSpan;let h=li(s);const p=ci(h,l,a);if(v(`splitCell: row ${l}, cell ${p}, ${t}`),"topBottom"===t){const e=h[l];for(let t=0;t<e.length;t++){const i=e[t];if(i===a){const e=c>1?s.rows[l+1]:s.insertRow(l+1),t=di(h,l+1,p),i=e.insertCell(t);i.innerHTML="<p><br /></p>",a.colSpan>1&&(i.colSpan=a.colSpan),a.rowSpan>2&&(i.rowSpan=a.rowSpan-1),a.removeAttribute("rowSpan"),h=li(s)}else if(1===c){for(let e=l;e>=0;e--){const n=h[e];if(0===e||i!==n[t]){i.rowSpan+=1;break}}h=li(s)}i.colSpan>1&&(t+=i.colSpan-1)}return}for(let e=0;e<h.length;e++){const t=s.rows[e],i=h[e],n=i[p];if(n===a){const i=h[e-1];if(!i||n!==i[p]){const i=di(h,e,p),o=t.insertCell(i+1);o.innerHTML="<p><br /></p>",n.rowSpan>1&&(o.rowSpan=n.rowSpan),n.colSpan>2&&(o.colSpan=n.colSpan-1),n.removeAttribute("colSpan")}}else for(let e=p;e>=0;e--)if(0===e||n!==i[e]){1===d&&(n.colSpan+=1);break}}}(e.selection.range,i),e.history.save()}},{name:"remove",type:"button",icon:n.get("remove"),tooltip:e=>e.table.remove(),onClick:()=>{ai(e.selection.range),e.history.save()}}];return i}const wi={start:"left",end:"right"};function yi(e,t){if(e.isList){let i=Number.parseInt(e.attr("indent"),10)||0;if("increase"===t?i++:i--,i<=0)i=0;else if(i>10)return;return 0===i?e.removeAttr("indent"):e.attr("indent",i.toString(10)),void Ve([e])}let i=Number.parseInt(e.css("margin-left"),10)||0;"decrease"!==t||0!==i||""===e.css("text-indent")?("increase"===t?i+=40:i-=40,i<=0&&(i=0),0===i?e.css("margin-left",""):e.css("margin-left",`${i}px`)):e.css("text-indent","")}const xi="strong";const bi="sub";const ki="sup";const Ci="code";const Si="lake-format-painter";function Bi(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class Ai{constructor(e){this.linkNode=null,this.scrollListener=()=>this.updatePosition(),this.resizeListener=()=>this.updatePosition(),this.config=e||{},this.locale=this.config.locale||pe("en-US"),this.container=b(S`
40
+ `),s=new X({root:n.find(".lake-input-field"),name:"embed",type:"primary",text:Ae(o,e.embedButtonText),onClick:()=>{const s=n.find('input[name="url"]').value();e.validUrl(s)?(t.updateValue("url",s),i.history.save(),n.remove(),_e(e,t)):i.config.showMessage("error",Ae(o,e.urlError))}});n.find('input[name="url"]').on("keydown",e=>{Ce.isKeyHotkey("enter",e)&&(e.preventDefault(),s.node.emit("click"))}),s.render(),a.append(n)}else _e(e,t);i.readonly||function(e,t){const i=t.getEditor(),o=t.getContainer().find(".lake-iframe");o.find(".lake-corner-toolbar").length>0||new Se({locale:i.locale,root:o,items:[{name:"remove",icon:n.get("remove"),tooltip:e.deleteButtonText,onClick:e=>{e.stopPropagation(),i.selection.removeBox(t),i.history.save()}}]}).render()}(e,t)}}}class Te{constructor(e){this.fragment=null!=e?e:document.createDocumentFragment()}get(){return this.fragment}find(e){const t=[];let i=new x(this.fragment.firstChild);for(;i.length>0;)i.matches(e)?t.push(i.get(0)):i.isElement&&i.find(e).each(e=>{t.push(e)}),i=i.next();return new x(t)}append(e){b(e).each(e=>{this.fragment.appendChild(e)})}}function Ee(e){e=e.replace(/&quot;/gi,'"');const t={},i=/\s*([\w-]+)\s*:([^;]*)(?:;|$)/g;let n;for(;null!==(n=i.exec(e));){const e=n[1].toLowerCase().trim(),i=f(n[2]).trim();t[e]=i}return t}class Me{constructor(e,t=s()){this.rules=t,this.source="string"==typeof e?this.parseHTML(e):e}parseHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");return new x(t.querySelector("body"))}static matchRule(e,t){return"string"==typeof e?e===t:Array.isArray(e)?e.indexOf(t)>=0:e instanceof RegExp&&e.test(t)}static getOpenTagString(e,t){let i=e.name,n=t[i];if(!n)return"";"string"==typeof n&&(i=n,n=t[i]);const o=e.get(0);if(!o.hasAttributes())return i;const s=new Map;for(const e of o.attributes)if(n[e.name]&&("style"!==e.name&&Me.matchRule(n[e.name],e.value)&&s.set(e.name,e.value),"style"===e.name)){const t=n.style,i=new Map,o=Ee(e.value);for(const e of Object.keys(o)){const n=o[e];t[e]&&Me.matchRule(t[e],n)&&i.set(e,n)}s.set("style",i)}let r=i;for(const[e,t]of s)if("style"===e){let e="";for(const[i,n]of t)e+=`${i}: ${n.replace(/"/g,"&quot;")}; `;""!==e&&(r+=` style="${e.trim()}"`)}else r+=` ${e}="${t}"`;return r}static getClosedTagString(e,t){let i=e.name;const n=t[i];return n?("string"==typeof n&&(i=n),i):""}static getTrimmedText(e){const t=e.parent(),i=e.prev(),n=e.next();let o=e.text();return(i.isBlock||i.isBlockBox)&&(n.isBlock||n.isBlockBox)||0===i.length&&0===n.length&&t.isBlock?o=o.replace(/^[\u0020\t\r\n]+|[\u0020\t\r\n]+$/g,""):i.isBlock||i.isBlockBox||0===i.length&&t.isBlock?o=o.replace(/^[\u0020\t\r\n]+/,""):(n.isBlock||n.isBlockBox||0===n.length&&t.isBlock)&&(o=o.replace(/[\u0020\t\r\n]+$/,"")),o}getHTML(){const e=this.rules;let t="";for(const i of function*t(i){let n=i.first();for(;n.length>0;){const i=n.next();if(n.isText)yield C(Me.getTrimmedText(n));else if(n.isVoid){const t=Me.getOpenTagString(n,e);""!==t&&(yield`<${t} />`)}else if(n.isElement){const i=Me.getOpenTagString(n,e),o=Me.getClosedTagString(n,e);""!==i&&(yield`<${i}>`),n.isBox||(yield*t(n)),""!==o&&(yield`</${o}>`)}n=i}}(this.source))t+=i;return t.trim()}getFragment(){const e=this.getHTML(),t=this.parseHTML(e),i=document.createDocumentFragment();let n=t.first();for(;n.length>0;){const e=n.next();i.appendChild(n.get(0)),n=e}return i}}class Ie{constructor(e){this.content=e}getHTML(){let e=this.content;return e=e.replace(/ {2}/g,"  "),e=C(e.trim()),e=`<p>${e}</p>`,e=e.replace(/(\r\n){2,}/g,"</p><p><br /></p><p>"),e=e.replace(/\r\n/g,"</p><p>"),e=e.replace(/[\r\n]{2,}/g,"</p><p><br /></p><p>"),e=e.replace(/[\r\n]/g,"</p><p>"),e}getFragment(){return new Me(this.getHTML()).getFragment()}}function Pe(e,t){const i=e.get(),n=t.get(0);i.insertNode(n),i.setEndAfter(n),i.collapse(!1)}function He(e){if(e.commonAncestor.isOutside)return{anchor:new x,focus:new x};const t=e.startNode.closest("lake-box");if(t.length>0)return e.isBoxStart?t.attr("focus","start"):e.isBoxEnd?t.attr("focus","end"):t.attr("focus","center"),{anchor:new x,focus:t};if(e.isCollapsed){const t=e.clone();t.collapseToEnd();const i=b('<lake-bookmark type="focus" />');return Pe(t,i),{anchor:new x,focus:i}}const i=e.clone();i.collapseToStart();const n=b('<lake-bookmark type="anchor" />');Pe(i,n);const o=e.clone();o.collapseToEnd();const s=b('<lake-bookmark type="focus" />');return Pe(o,s),{anchor:n,focus:s}}function De(e,t){const i=e.prev(),n=e.next();if(i.isText||n.isText){const t=e.parent();e.remove(),t.get(0).normalize()}else if(0===i.length&&0===n.length){if(e.parent().isMark&&t){const i=new x(document.createTextNode("​"));e.before(i),t.setStartAfter(i),t.collapseToStart()}e.remove()}else e.remove()}function Ze(e,t){const i=t.anchor,n=t.focus;if(i.length>0&&0===n.length)De(i);else{if(n.length>0&&0===i.length){if(n.isBox){const t=we(n);0===t.getContainer().length&&t.render();const i=n.attr("focus");return"start"===i?e.selectBoxStart(n):"center"===i?e.selectBox(n):e.selectBoxEnd(n),void n.removeAttr("focus")}return e.setStartBefore(n),e.collapseToStart(),void De(n,e)}if(i.length>0&&n.length>0){const t=new N;t.selectNode(i),t.collapseToEnd(),-1===t.compareAfterNode(n)?(e.setStartBefore(n),De(n),e.setEndBefore(i),De(i)):(e.setStartBefore(i),De(i),e.setEndBefore(n),De(n))}}}function Ne(e){if(0===e.length)return;const t=[];let i=e.first();for(;i.length>0;){const e=i.next();i.isText&&""===i.text()||t.push(i),i=e}(1===t.length&&"br"===t[0].name||2===t.length&&"br"===t[0].name&&t[1].isBookmark)&&t[0].remove(),2===t.length&&t[0].isBookmark&&"br"===t[1].name&&t[1].remove()}function Oe(e){const t=b("<br />");let i=e;for(;i.isBlock;){let e=i.last();for(;e.isText&&e.isEmpty;)e=e.prev();if(!e.isBlock&&"br"!==e.name){i.append(t);break}i=e}return t}function ze(e){if(e.isText)return{node:e,offset:e.text().length};const t=new N;return t.setEndAfter(e),{node:t.endNode,offset:t.endOffset}}function $e(e,t){const i=t;if(["ul","ol"].indexOf(e.name)>=0){const t=e.find("li");e=t.eq(t.length-1)}if(["ul","ol"].indexOf(t.name)>=0){const e=t.find("li");t=e.eq(0)}if(e.isText||t.isText||e.isVoid||t.isVoid)return ze(e);Ne(e),Ne(t),e.isBlock&&e.isEmpty&&t.isEmpty&&Oe(e);const n=e.last(),o=t.first();let s=o;for(;s.length>0;){const t=s.next();e.append(s),s=t}return i.remove(),n.length>0&&o.length>0&&n.isElement&&!n.isBox&&n.clone(!1).get(0).isEqualNode(o.clone(!1).get(0))?$e(n,o):0===n.length?{node:e,offset:0}:ze(n)}function Ve(e){if(0===e.length)return;const t=e[0],i=e[e.length-1],n=[];let o=t.prev();for(;o.length>0&&"ol"===o.name;)n.push(o),o=o.prev();n.reverse(),n.push(...e);let s=i.next();for(;s.length>0&&"ol"===s.name;)n.push(s),s=s.next();let r=1;for(const e of n){const t=e.prev();if(0!==t.length&&"ol"===t.name||(r=1),"ol"===e.name){"ol"===t.name&&t.attr("indent")!==e.attr("indent")&&(r=1);const i=e.attr("start"),n=r.toString(10);i!==n&&e.attr("start",n),r++}}}function Re(e){if(e.isCollapsed)return;if(e.adjustBox(),e.adjustTable(),e.isInoperative)return;const t=e.startNode.closestBlock(),i=e.endNode.closestBlock(),n=t.get(0)===i.get(0);if(e.get().deleteContents(),e.adjustBlock(),n){const t=e.getBlocks()[0];if(t&&t.isEmpty){const i=Oe(t);e.setStartBefore(i),e.collapseToStart()}return}const o=e.getBlocks()[0];if(!o)return;const s=o.prev();if(0===s.length)return;const r=He(e);$e(s,o),Ve([s]),Ze(e,r)}function Fe(e,t){if(e.commonAncestor.isOutside)return;let i;t instanceof Te?i=t:t instanceof DocumentFragment?i=new Te(t):(i=new Te,i.append(t)),e.isCollapsed?e.adjustBox():Re(e);Ne(e.startNode.closestBlock());const n=e.get();n.insertNode(i.get()),n.collapse(!1),e.adjustBlock()}function qe(e){let t=e;for(;t.length>0;){let e=t.first();if(e.isText&&e.isEmpty&&(e=e.next()),t.isElement&&!t.isVoid&&0===e.length)break;t=e}return t}function We(e,t){if(t=null!=t?t:b("<p />"),0===e.length)return t;const i=qe(t=t.clone(!0));e[0].before(t);for(const t of e)i.append(t);return t}function je(e,t){if(e.commonAncestor.isOutside)return;if(e.isCollapsed){if(e.commonAncestor.closest("lake-box").isBlockBox)return}if("string"!=typeof t){const i=e.getBlocks();for(const e of i)e.css(t);return}const i=b(t),n=i.name,o=i.get(0).attributes,s=e.getBlocks();if(s.length>0){const t=He(e);for(const e of s)if(e.name===n&&0===i.first().length)for(const t of o)e.attr(t.name,t.value);else{const t=i.clone(!0);t.isList&&e.isList&&""!==e.attr("indent")&&t.attr("indent",e.attr("indent"));const n=qe(t);let o=e.first();for(;o.length>0;){const e=o.next();n.append(o),n.name!==o.name&&"li"!==o.name||o.remove(!0),o=e}e.replaceWith(t)}return Ze(e,t),void Ve(e.getBlocks())}if(e.isCollapsed){const t=e.getNextNode();if("br"===t.name){const i=b("<p><br /></p>");return t.replaceWith(i),void e.shrinkBefore(i)}const i=e.getPrevNode();if("br"===i.name){const t=b("<p><br /></p>");return i.replaceWith(t),void e.shrinkBefore(t)}}const r=He(e),a=function(e){const t=e.commonAncestor.closest('div[contenteditable="true"],td');let i=[];if(0===t.length)return i;let n=t.first(),o=!0;for(;n.length>0;){if(n.isMark||n.isText||n.isBookmark||n.isInlineBox)i.push(n);else{if(!o)break;i=[]}e.intersectsNode(n)&&(o=!1),n=n.next()}return i}(e),l=We(a,i);if(Ze(e,r),Ve(e.getBlocks()),l.isEmpty){const t=Oe(l);e.setStartBefore(t),e.collapseToStart()}}function Ue(e,t,i){const n=new N;let o;if(e.isText){o=e.parent();const i=e.splitText(t);n.setStartAfter(e),""===e.text()&&e.remove(),""===i.text()&&i.remove()}else n.setStart(e,t),o=e;if("body"===o.name||"html"===o.name)return null;if(o.get(0)===i.get(0))return null;n.collapseToStart();const s=o.clone();let r=o.first();for(;r.length>0&&!(n.compareBeforeNode(r)>=0);){const e=r.next();s.append(r),r=e}return o.before(s),o.parent().length>0&&o.parent().get(0)!==i.get(0)?Ue(o.parent(),o.index(),i):{start:s,end:o}}function Ke(e){if(e.isMark&&e.isEmpty)e.remove();else for(const t of e.getWalker())t.isMark&&t.isEmpty&&t.remove()}function Xe(e){if(e.commonAncestor.isOutside)return{start:null,end:null};e.isCollapsed?e.adjustBox():Re(e);const t=e.startNode,i=t.closestOperableBlock();if(0===i.length)return{start:null,end:null};let n=i.parent();n.isOutside&&(n=t.closestContainer());const o=Ue(t,e.startOffset,n);let s=null,r=null;return o&&(s=o.start,r=o.end),!o&&t.isBlock&&(e.startOffset>0&&(s=t.children()[e.startOffset-1]),r=t.children()[e.startOffset],r&&!r.isBlock&&(r=null)),s&&s.isEmpty&&(Ke(s),Oe(s)),r&&(r.isEmpty&&(Ke(r),Oe(r)),e.shrinkBefore(r)),Ve(e.getBlocks()),{start:s,end:r}}function Ge(e,t){if(e.commonAncestor.isOutside)return null;const i=b(t),n=Xe(e);return n.start&&(Ke(n.start),e.setEndAfter(n.start),e.collapseToEnd()),n.end&&(Ke(n.end),n.end.isEmpty&&n.end.remove()),Fe(e,i),i.isBox||e.shrinkAfter(i),n.start&&n.start.isEmpty&&n.start.remove(),i}function Ye(e,t,i){let n=null,o=null,s=e.closestBlock();0===s.length&&(s=e.closestContainer());const r=Ue(e,t,s);return r&&(i?(Ke(r.start),Ke(r.end),r.start.isEmpty||(n=r.start),r.end.isEmpty||(o=r.end)):(n=r.start,o=r.end)),{start:n,end:o}}function Qe(e,t=!0){if(e.commonAncestor.isOutside)return{start:null,center:null,end:null};if(e.adjustBox(),e.isCollapsed){const i=Ye(e.startNode,e.startOffset,t);return i.start?(e.setStartAfter(i.start),e.collapseToStart()):i.end&&(e.setStartBefore(i.end),e.collapseToStart()),{start:i.start,center:null,end:i.end}}const i=Ye(e.startNode,e.startOffset,t);i.start?e.setStartAfter(i.start):i.end&&e.setStartBefore(i.end);const n=Ye(e.endNode,e.endOffset,t);return n.start?e.setEndAfter(n.start):n.end&&e.setEndBefore(n.end),{start:i.start,center:n.start,end:n.end}}function Je(e,t){const i=e.text();let n=e;for(;n.length>0;){const e=n.parent();if(!e.isMark||i!==e.text()||!n.isText&&n.name===t&&""!==n.attr("style"))break;n=e}return n}function et(e,t){if(e.commonAncestor.isOutside)return;let i=b(t);const n=i.name,o=Ee(i.attr("style"));if(e.isCollapsed){if(e.isBox){const t=e.startNode.closest("lake-box");if("block"===we(t).type){const i=b("<p><br /></p>");e.isBoxStart?t.before(i):t.after(i),e.shrinkAfter(i)}else e.adjustBox()}Ne(e.startNode.closestBlock());const t=new x(document.createTextNode("​")),s=function(e){let t=e;t.isText&&(t=t.parent());let i=null;for(;t.length>0&&t.isMark;){if(i){const e=t.clone();e.append(i),i=e}else i=t.clone();t=t.parent()}return i}(e.startNode);if(Qe(e),s){let e=s;for(;e.length>0;)e.name===n&&e.css(o),e=e.first();s.name===n?i=s:i.append(s)}if(""===i.text()){qe(i).append(t)}return Fe(e,i),function(e){const t=e.prev();t.length>0&&t.isText&&t.isEmpty&&t.remove();const i=e.next();i.length>0&&i.isText&&i.isEmpty&&i.remove()}(i),void e.shrinkAfter(i)}Qe(e);const s=e.getMarks(!0),r=He(e);for(const e of s)if(!e.isEmpty&&e.isText){const t=Je(e,n);if(t.isMark&&t.name===n)t.css(o);else{const e=i.clone();t.before(e),e.append(t)}}Ze(e,r)}function tt(e,t){if(e.commonAncestor.isOutside)return;let i;if(t){i=b(t).name}if(e.isCollapsed){if(e.isBox)return;if(i&&0===e.commonAncestor.closest(i).length)return;const t=Qe(e,!1);if(!t.start)return;t.end&&Ke(t.end);const n=new x(document.createTextNode("​")),o=function(e,t){if(!e.isMark||!t)return null;let i=null,n=null,o=e;for(;o.length>0&&o.isMark;){if(o.name!==t)if(n){const e=o.clone();n.append(e),n=e}else i=o.clone(),n=i;o=o.last()}return i}(t.start,i);if(!o)return t.start.after(n),Ke(t.start),n.prev().isText?(e.setStartAfter(n.prev()),e.collapseToStart(),void n.remove()):(e.setStartAfter(n),void e.collapseToStart());return qe(o).append(n),t.start.after(o),Ke(t.start),void e.shrinkAfter(o)}Qe(e);const n=e.getMarks(),o=He(e);for(const e of n)if(!i||e.name===i){const t=e.parent();e.remove(!e.isEmpty),t.length>0&&t.get(0).normalize()}!function(e){for(const t of e.getWalker())if(t.isText){const e=t.text();""===e?t.remove():e.length>1&&/\u200B/.test(e)&&(t.get(0).nodeValue=e.replace(/\u200B/g,""))}}(e.commonAncestor),Ze(e,o)}function it(e,t,i){if(e.commonAncestor.isOutside)return null;const n=we(t);if(i&&(n.value=i),"inline"===n.type){if(Qe(e),Fe(e,n.node),n.render(),n.node.isTopInside){const e=b("<p />");n.node.before(e),e.append(n.node)}return e.selectBoxEnd(n.node),we(n.node)}return Ge(e,n.node),n.render(),e.selectBoxEnd(n.node),we(n.node)}function nt(e){const t=e.node.closestContainer();if(e.unmount(),e.node.remove(),t.length>0){A(t.id).delete(e.node.id);A(0).set(e.node.id,e)}return e}function ot(e){if(e.commonAncestor.isOutside)return null;const t=e.commonAncestor.closest("lake-box");if(0===t.length)return null;const i=we(t);if("block"===i.type){const n=b("<p><br /></p>");return t.before(n),e.shrinkAfter(n),nt(i)}e.setStartBefore(t),e.collapseToStart();const n=t.parent();if(nt(i),n.isEmpty){const t=Oe(n);e.setStartBefore(t),e.collapseToStart()}return i}function st(e,t=100,i={}){if("function"!=typeof e)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");if("boolean"==typeof i)throw new TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");const{immediate:n}=i;let o,s,r,a,l;function c(){const t=o,i=s;return o=void 0,s=void 0,l=e.apply(t,i),l}function d(){const e=Date.now()-a;e<t&&e>=0?r=setTimeout(d,t-e):(r=void 0,n||(l=c()))}const h=function(...e){if(o&&this!==o&&Object.getPrototypeOf(this)===Object.getPrototypeOf(o))throw new Error("Debounced method called with different contexts of the same prototype.");o=this,s=e,a=Date.now();const i=n&&!r;if(r||(r=setTimeout(d,t)),i)return l=c(),l};return Object.defineProperty(h,"isPending",{get:()=>void 0!==r}),h.clear=()=>{r&&(clearTimeout(r),r=void 0,o=void 0,s=void 0)},h.flush=()=>{r&&h.trigger()},h.trigger=()=>{l=c(),h.clear()},h}var rt=_(ke?be:(ke=1,be=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,o,s;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(o=n;0!==o--;)if(!e(t[o],i[o]))return!1;return!0}if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],i.get(o[0])))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(o of t.entries())if(!i.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if((n=t.length)!=i.length)return!1;for(o=n;0!==o--;)if(t[o]!==i[o])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(s=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(i,s[o]))return!1;for(o=n;0!==o--;){var r=s[o];if(!e(t[r],i[r]))return!1}return!0}return t!=t&&i!=i})),at=Object.defineProperty,lt=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,ut=(e,t,i)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,mt=(e,t)=>{for(var i in t||(t={}))ht.call(t,i)&&ut(e,i,t[i]);if(dt)for(var i of dt(t))pt.call(t,i)&&ut(e,i,t[i]);return e},gt=(e,t)=>lt(e,ct(t));function ft(e){const t=/[\w\-]+$/.exec(e);return t?t[0]:""}var vt=new Map([["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],[" ","&nbsp;"]]);function wt(e){return e.replace(/[&<>"\xA0]/g,e=>vt.get(e))}function yt(e){var t;let i=`<${e.tagName}`;return e.attributes&&(i+=` ${function(e){const t=[];for(const i of Object.keys(e)){const n=String(e[i]);t.push(`${i}="${wt(n)}"`)}return t.join(" ")}(e.attributes)}`),!0===e.isVoid?i+=" />":i+=`>${null!=(t=e.innerHTML)?t:""}</${e.tagName}>`,i}function xt(e,t){t=null!=t?t:{hr:()=>({tagName:"div",attributes:{class:"lake-box-block lake-hr"},innerHTML:"<hr />"}),image:e=>({tagName:"img",attributes:gt(mt(mt(mt({src:e.url},e.width&&{width:e.width}),e.height&&{height:e.height}),e.caption&&{alt:e.caption}),{border:"0"}),isVoid:!0}),media:e=>({tagName:"video",attributes:gt(mt(mt({src:e.url},e.width&&{width:e.width.replace(/px$/i,"")}),e.height&&{height:e.height.replace(/px$/i,"")}),{controls:"true"})}),file:(e,t)=>({tagName:"a",attributes:{href:e.url,target:"_blank"},innerHTML:t(e.name)}),codeBlock:(e,t)=>({tagName:"pre",attributes:{class:`lang-${e.lang}`},innerHTML:`<code>${t(e.code)}</code>`}),emoji:e=>({tagName:"img",attributes:{src:e.url,width:"32",height:"32",border:"0"},isVoid:!0}),equation:e=>({tagName:"code",innerHTML:e.code}),mention:(e,t)=>{var i;return{tagName:"a",attributes:{href:`/${e.name}`,target:"_blank"},innerHTML:t(null!=(i=e.nickname)?i:e.name)}},video:e=>({tagName:"iframe",attributes:gt(mt({},e.url&&{src:`https://www.youtube.com/embed/${ft(e.url)}`}),{width:e.width?e.width.replace(/px$/i,""):"560",height:e.height?e.height.replace(/px$/i,""):"315",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowfullscreen:"true"})}),twitter:e=>({tagName:"iframe",attributes:gt(mt({},e.url&&{src:`https://platform.twitter.com/embed/Tweet.html?id=${ft(e.url)}`}),{title:"Twitter tweet",scrolling:"no",frameborder:"0",allowtransparency:"true",allowfullscreen:"true",style:"width: 550px; height: 300px;"})})};return e.replace(/(<lake-box[^>]+>)[\s\S]*?(?:<\/lake-box>|$)|(<anchor\s*\/>)|(<focus\s*\/>)/gi,(e,i)=>{if(i){const e=function(e){const t={},i=/\s+(?:([\w\-:]+)=([^\s"'<>]+)|([\w\-:"]+)="([^"]*)"|([\w\-:"]+)='([^']*)')(?=[\s/>])/g;let n;for(;n=i.exec(e);){const e=(n[1]||n[3]||n[5]).toLowerCase(),i=n[1]?n[2]:n[3]?n[4]:n[6];t[e]=i}return t}(i),n=t[e.name];if(n)try{const t=e.value?JSON.parse(function(e){const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(new TextDecoder).decode(i)}(e.value)):{};return yt(n(t,wt))}catch(e){console.error("Failed to parse lake-box value:",e)}}return""})}function bt(e){return e.replace(/(<lake-box[^>]+>)[\s\S]*?<\/lake-box>|<lake-bookmark\s+type="(anchor|focus)">\s*<\/lake-bookmark>/gi,(e,t,i)=>t?`${t}</lake-box>`:"anchor"===i?"<anchor />":"focus"===i?"<focus />":e)}function kt(e){return e.replace(/(<lake-box[^>]+>)[\s\S]*?(?:<\/lake-box>|$)|(<anchor\s*\/>)|(<focus\s*\/>)/gi,(e,t,i,n)=>t?`${t}</lake-box>`:i?'<lake-bookmark type="anchor"></lake-bookmark>':n?'<lake-bookmark type="focus"></lake-bookmark>':e)}function Ct(e){const t=e.get(0),i={};if(t.hasAttributes())for(const e of t.attributes)i[e.name]=e.value;return i}class St{constructor(e){const t=window.getSelection();if(!t)throw new Error("Selection object is null.");this.selection=t,this.container=e,this.range=this.getCurrentRange()}getCurrentRange(){if(this.selection.rangeCount>0){const e=this.selection.getRangeAt(0);return new N(e)}return new N}sync(){this.container.contains(this.range.commonAncestor)&&(this.selection.removeAllRanges(),this.selection.addRange(this.range.get()))}updateByRange(){const e=this.getCurrentRange();this.container.contains(e.commonAncestor)&&(this.range.startNode.get(0)===e.startNode.get(0)&&this.range.startOffset===e.startOffset&&this.range.endNode.get(0)===e.endNode.get(0)&&this.range.endOffset===e.endOffset||(this.range=e))}updateByBookmark(){const e=this.range,t=this.container,i=t.find("lake-box[focus]");if(i.length>0)return Ze(e,{anchor:new x,focus:i}),void this.sync();Ze(e,{anchor:t.find('lake-bookmark[type="anchor"]'),focus:t.find('lake-bookmark[type="focus"]')}),this.sync()}getActiveItems(){const e=[];return function(e,t){let i=t.startNode;for(i.isText&&(i=i.parent());i.length>0&&i.isContentEditable&&!i.isContainer;)e.push({node:i,name:i.name,attributes:Ct(i),styles:Ee(i.attr("style"))}),i=i.parent()}(e,this.range),function(e,t){const i=t.startNode;let n;if(i.isText&&i.text().length===t.startOffset){const e=i.next();e.length>0&&e.isElement&&(n=e)}if(i.isElement){const e=i.children();if(e.length>0){const i=e[t.startOffset];i&&i.isElement&&(n=i)}}if(n){let t=n;for(;t.length>0;)t.isElement&&e.push({node:t,name:t.name,attributes:Ct(t),styles:Ee(t.attr("style"))}),t=t.first()}}(e,this.range),e}cloneContainer(){const e=this.range,t=this.container.clone(!0);if(t.find("lake-box").each(e=>{we(e).getContainer().empty()}),!this.container.contains(e.commonAncestor))return t;if(e.isInsideBox){const i=e.commonAncestor.closest("lake-box").path(),n=t.find(i),o=e.clone();return o.selectBox(n),He(o),t}const i=e.startNode.path(),n=e.endNode.path(),o=t.find(i),s=t.find(n),r=e.clone();return r.setStart(o,e.startOffset),r.setEnd(s,e.endOffset),He(r),t}insertBookmark(){return He(this.range)}toBookmark(e){return Ze(this.range,e)}insertContents(e){return Fe(this.range,e)}deleteContents(){return Re(this.range)}setBlocks(e){return je(this.range,e)}splitBlock(){return Xe(this.range)}insertBlock(e){return Ge(this.range,e)}splitMarks(e){return Qe(this.range,e)}addMark(e){return et(this.range,e)}removeMark(e){return tt(this.range,e)}selectBox(e){let t=e;t=e instanceof ve?e.node:e,this.range.selectBox(t),this.sync()}insertBox(e,t){const i=it(this.range,e,t);if(!i)throw new Error(`Box "${e}" cannot be inserted into the outside of the editor.`);return i}removeBox(e=null){return e&&this.selectBox(e),ot(this.range)}}class Bt{constructor(e){this.commandMap=new Map,this.selection=e}add(e,t){this.commandMap.set(e,t)}delete(e){this.commandMap.delete(e)}getNames(){return Array.from(this.commandMap.keys())}has(e){return void 0!==this.commandMap.get(e)}getItem(e){const t=this.commandMap.get(e);if(void 0===t)throw new Error(`Command "${e}" has not been defined yet.`);return t}isDisabled(e){const t=this.getItem(e);if(!t.isDisabled)return!1;const i=this.selection.getActiveItems();return t.isDisabled(i)}isSelected(e){const t=this.getItem(e);if(!t.isSelected)return!1;const i=this.selection.getActiveItems();return t.isSelected(i)}selectedValues(e){const t=this.getItem(e);if(!t.selectedValues)return[];const i=this.selection.getActiveItems();return t.selectedValues(i)}execute(e,...t){const i=this.selection.container,n=this.selection.range;i.contains(n.commonAncestor)||n.shrinkAfter(i);this.getItem(e).execute.apply(this,t),v(`Command "${e}" executed`)}}const At=new Set;function _t(){}const Lt={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:_t,afterNodeAdded:_t,beforeNodeMorphed:_t,afterNodeMorphed:_t,beforeNodeRemoved:_t,afterNodeRemoved:_t,beforeAttributeUpdated:_t,afterAttributeUpdated:_t,beforeChildrenUpdated:_t},head:{style:"merge",shouldPreserve:e=>"true"===e.getAttribute("im-preserve"),shouldReAppend:e=>"true"===e.getAttribute("im-re-append"),shouldRemove:_t,afterHeadMorphed:_t}};function Tt(e,t){return!e.deadIds.has(t)}function Et(e,t,i){return(e.idMap.get(i)||At).has(t)}function Mt(e,t){const i=e.idMap.get(t)||At;for(const t of i)e.deadIds.add(t)}function It(e,t,i){const n=e.idMap.get(t)||At;let o=0;for(const t of n)Tt(e,t)&&Et(e,t,i)&&++o;return o}function Pt(e,t){const i=e.parentElement,n=e.querySelectorAll("[id]");for(const e of n){let n=e;for(;n!==i&&null!=n;){let i=t.get(n);null==i&&(i=new Set,t.set(n,i)),i.add(e.id),n=n.parentElement}}}function Ht(e,t){const i=new Map;return Pt(e,i),Pt(t,i),i}function Dt(e,t,i){return{target:e,newContent:t,config:i=function(e){const t={};return Object.assign(t,Lt),Object.assign(t,e),t.callbacks={},Object.assign(t.callbacks,Lt.callbacks),Object.assign(t.callbacks,e.callbacks),t.head={},Object.assign(t.head,Lt.head),Object.assign(t.head,e.head),t}(i),morphStyle:i.morphStyle,ignoreActive:i.ignoreActive,ignoreActiveValue:i.ignoreActiveValue,idMap:Ht(e,t),deadIds:new Set,callbacks:i.callbacks,head:i.head}}function Zt(e,t,i){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName&&(""!==e.id&&e.id===t.id||It(i,e,t)>0))}function Nt(e,t){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName)}function Ot(e,t){Mt(t,e),!1!==t.callbacks.beforeNodeRemoved(e)&&(e.remove(),t.callbacks.afterNodeRemoved(e))}function zt(e,t,i){let n=e;for(;n&&n!==t;){const e=n;n=n.nextSibling,Ot(e,i)}return Mt(i,t),t.nextSibling}function $t(e,t,i,n,o){const s=It(o,i,t);let r=null;if(s>0){r=n;let t=0;for(;null!=r;){if(Zt(i,r,o))return r;if(t+=It(o,r,e),t>s)return null;r=r.nextSibling}}return r}function Vt(e,t,i,n,o){let s=n,r=i.nextSibling,a=0;for(;null!=s;){if(It(o,s,e)>0)return null;if(Nt(i,s))return s;if(Nt(r,s)&&(a++,r=r?r.nextSibling:null,a>=2))return null;s=s?s.nextSibling:null}return s}function Rt(e,t,i){return Nt(e,t)?.5+It(i,e,t):0}function Ft(e,t,i,n){return!("value"!==e||!n.ignoreActiveValue||t!==document.activeElement)||!1===n.callbacks.beforeAttributeUpdated(e,t,i)}function qt(e,t,i){var n;if(!i.ignoreActive||e!==document.activeElement)return null==t?!1===i.callbacks.beforeNodeRemoved(e)?e:(e.remove(),i.callbacks.afterNodeRemoved(e),null):Nt(e,t)?(!1===i.callbacks.beforeNodeMorphed(e,t)||(function(e,t,i){const n=e.nodeType;if(1===n){const n=e.attributes,o=t.attributes;for(const e of n)Ft(e.name,t,"update",i)||t.getAttribute(e.name)!==e.value&&(t.setAttribute(e.name,e.value),i.callbacks.afterAttributeUpdated(e.name,t,"update"));for(let n=o.length-1;n>=0;n--){const s=o[n];Ft(s.name,t,"remove",i)||e.hasAttribute(s.name)||(t.removeAttribute(s.name),i.callbacks.afterAttributeUpdated(s.name,t,"remove"))}}8!==n&&3!==n||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue)}(t,e,i),!1===i.callbacks.beforeChildrenUpdated(e,t)||function(e,t){return t.ignoreActiveValue&&e===document.activeElement}(e,i)||Wt(t,e,i),i.callbacks.afterNodeMorphed(e,t)),e):!1===i.callbacks.beforeNodeRemoved(e)||!1===i.callbacks.beforeNodeAdded(t)?e:(null===(n=e.parentElement)||void 0===n||n.replaceChild(t,e),i.callbacks.afterNodeAdded(t),i.callbacks.afterNodeRemoved(e),t)}function Wt(e,t,i){let n,o=e.firstChild,s=t.firstChild;for(;o;){if(n=o,o=n.nextSibling,null==s){if(!1===i.callbacks.beforeNodeAdded(n))return;t.appendChild(n),i.callbacks.afterNodeAdded(n),Mt(i,n);continue}if(Zt(n,s,i)){qt(s,n,i),s=s.nextSibling,Mt(i,n);continue}const r=$t(e,t,n,s,i);if(r){s=zt(s,r,i),qt(r,n,i),Mt(i,n);continue}const a=Vt(e,0,n,s,i);if(a)s=zt(s,a,i),qt(a,n,i),Mt(i,n);else{if(!1===i.callbacks.beforeNodeAdded(n))return;t.insertBefore(n,s),i.callbacks.afterNodeAdded(n),Mt(i,n)}}for(;null!==s;){const e=s;s=s.nextSibling,Ot(e,i)}}function jt(e,t,i){if("innerHTML"===i.morphStyle)return Wt(t,e,i),e.children;const n=function(e,t,i){let n;n=e.firstChild;let o=n,s=0;for(;n;){const e=Rt(n,t,i);e>s&&(o=n,s=e),n=n.nextSibling}return o}(t,e,i),o=null==n?void 0:n.previousSibling,s=null==n?void 0:n.nextSibling,r=qt(e,n,i);return n?function(e,t,i){var n,o;const s=[],r=[];let a=e;for(;null!=a;)s.push(a),a=a.previousSibling;for(;s.length>0;){const e=s.pop();r.push(e),e&&(null===(n=t.parentElement)||void 0===n||n.insertBefore(e,t))}r.push(t);let l=i;for(;null!=l;)s.push(l),r.push(l),l=l.nextSibling;for(;s.length>0;){const e=s.pop();e&&(null===(o=t.parentElement)||void 0===o||o.insertBefore(e,t.nextSibling))}return r}(o,r,s):[]}function Ut(e,t,i={}){const n=function(e){if(null==e)return document.createElement("div");if(e instanceof Node){if(e.generatedByIdiomorph)return e;const t=document.createElement("div");return t.append(e),t}const t=document.createElement("div");for(const i of[...e])t.append(i);return t}(t.get(0)),o=Dt(e.get(0),n,i);jt(e.get(0),n,o)}class Kt{constructor(e){this.canSave=!0,this.list=[],this.index=0,this.limit=100,this.contentRules=s(),this.event=new M,this.selection=e,this.container=e.container}removeBookmark(e){return e.replace(/(<lake-box[^>]+)\sfocus="\w+"([^>]*>)|<lake-bookmark\s+type="(?:anchor|focus)">\s*<\/lake-bookmark>/gi,(e,t,i)=>t?`${t}${i}`:"")}getValue(e){return new Me(e,this.contentRules).getHTML()}addIdToBoxes(e){e.find("lake-box").each(e=>{const t=new x(e),i=`${t.attr("name")}-${t.attr("value")}`;t.attr("id",i)})}removeIdfromBoxes(e){e.find("lake-box").each(e=>{new x(e).removeAttr("id")})}morphContainer(e){const t=this.container,i={beforeChildrenUpdated:e=>{if("lake-box"===new x(e).name)return!1},afterAttributeUpdated:(e,i)=>{const n=new x(i);if(["name","value"].indexOf(e)>=0&&"lake-box"===n.name){we(n).unmount();A(t.id).delete(n.id)}}},n=e.clone(!0);this.addIdToBoxes(t),this.addIdToBoxes(n),Ut(t,n,{callbacks:i}),this.removeIdfromBoxes(t),this.removeIdfromBoxes(n)}get canUndo(){return this.index>1&&!!this.list[this.index-2]}get canRedo(){return!!this.list[this.index]}undo(){if(!this.list[this.index-2])return;this.selection.insertBookmark();const e=this.getValue(this.container);for(;this.index>1;){const t=this.list[this.index-2];if(!t)break;this.index--;const i=this.getValue(t);if(this.removeBookmark(i)!==this.removeBookmark(e)){this.morphContainer(t),this.event.emit("undo",i);break}}this.selection.updateByBookmark(),v(`History undone (index: ${this.index})`)}redo(){if(!this.list[this.index])return;this.selection.insertBookmark();const e=this.getValue(this.container);for(;this.index<this.list.length;){const t=this.list[this.index];if(!t)break;this.index++;const i=this.getValue(t);if(this.removeBookmark(i)!==this.removeBookmark(e)){this.morphContainer(t),this.event.emit("redo",i);break}}this.selection.updateByBookmark(),v(`History redone (index: ${this.index})`)}continue(){this.canSave=!0}pause(){this.canSave=!1}save(e={}){var t,i,n;const o=null!==(t=e.inputType)&&void 0!==t?t:"",s=null!==(i=e.update)&&void 0!==i&&i,r=null===(n=e.emitEvent)||void 0===n||n;if(!this.canSave)return;const a=this.selection.cloneContainer(),l=this.getValue(a);this.list[this.index-1]&&this.removeBookmark(this.getValue(this.list[this.index-1]))===this.removeBookmark(l)||(s?this.list.splice(this.index-1,1/0,a):(this.list.splice(this.index,1/0,a),this.index++),this.list.length>this.limit&&(this.list.shift(),this.index=this.list.length),v(`History saved (index: ${this.index}, inputType: "${o}", update: ${s}, emitEvent: ${r})`),r&&this.event.emit("save",bt(l),{inputType:o,update:s,emitEvent:r}))}}class Xt{constructor(e){this.keydownEventList=[],this.keyupEventList=[],this.container=e,this.container.on("keydown",e=>{const t=e;if(!t.isComposing&&!t.defaultPrevented)for(const e of this.keydownEventList)if(Ce.isKeyHotkey(e.type,t)&&!1===e.listener(t))break}),this.container.on("keyup",e=>{const t=e;if(!t.isComposing&&!t.defaultPrevented)for(const e of this.keyupEventList)if(Ce.isKeyHotkey(e.type,t)&&!1===e.listener(t))break})}setKeydown(e,t){this.keydownEventList.push({type:e,listener:t})}setKeyup(e,t){this.keyupEventList.push({type:e,listener:t})}keydown(e){for(const t of this.keydownEventList)if(t.type===e&&!1===t.listener(new KeyboardEvent(e)))break}keyup(e){for(const t of this.keyupEventList)if(t.type===e&&!1===t.listener(new KeyboardEvent(e)))break}}const Gt={value:"<p><br /></p>",readonly:!1,spellcheck:!1,tabIndex:0,placeholder:"",indentWithTab:!0,lang:"en-US",contentRules:s(),minChangeSize:5,historySize:100,showMessage:(e,t)=>{"success"!==e?"warning"!==e?"error"===e&&console.error(t):console.warn(t):console.log(t)},downloadFile:(e,t)=>{window.open(t)},slash:!1,mention:!1};class Yt{constructor(e){if(this.unsavedInputData="",this.unsavedInputCount=0,this.state={activeItems:[],disabledNameMap:new Map,selectedNameMap:new Map,selectedValuesMap:new Map},this.unmountPluginMap=new Map,this.event=new M,this.isComposing=!1,this.popup=null,this.copyListener=e=>{const t=this.selection.getCurrentRange();this.container.contains(t.commonAncestor)&&this.event.emit("copy",e)},this.cutListener=e=>{const t=this.selection.getCurrentRange();this.container.contains(t.commonAncestor)&&this.event.emit("cut",e)},this.pasteListener=e=>{const t=this.selection.getCurrentRange();this.container.contains(t.commonAncestor)&&this.event.emit("paste",e)},this.selectionchangeListener=()=>{this.updateSelectionRange(),this.updateBoxSelectionStyle(),this.emitStateChangeEvent()},this.clickListener=e=>{const t=new x(e.target);t.get(0).isConnected&&this.event.emit("click",t)},this.updateSelectionRange=st(()=>{this.selection.updateByRange()},1,{immediate:!0}),this.updateBoxSelectionStyle=st(()=>{if(0===this.root.first().length)return;const e=this.selection.getCurrentRange(),t=e.clone();t.adjustBox(),this.container.find("lake-box").each(i=>{const n=we(i),o=n.getContainer();if(0!==o.length){if(e.compareBeforeNode(o)<0&&e.compareAfterNode(o)>0&&(!e.isCollapsed||e.startNode.get(0)!==o.get(0)||0!==e.startOffset))return o.removeClass("lake-box-hovered"),o.removeClass("lake-box-selected"),o.removeClass("lake-box-focused"),o.addClass("lake-box-activated"),void n.event.emit("focus");if(t.intersectsNode(n.node))return o.removeClass("lake-box-activated"),void(e.isCollapsed?(o.removeClass("lake-box-hovered"),o.removeClass("lake-box-selected"),o.addClass("lake-box-focused"),n.event.emit("focus")):(o.removeClass("lake-box-focused"),o.addClass("lake-box-selected"),n.event.emit("blur")));o.removeClass("lake-box-activated"),o.removeClass("lake-box-focused"),o.removeClass("lake-box-selected"),n.event.emit("blur")}})},50,{immediate:!0}),this.emitStateChangeEvent=st(()=>{const e=this.getState();rt(e,this.state)||(this.toolbar&&this.toolbar.updateState(e),this.event.emit("statechange",e),this.state=e)},50,{immediate:!1}),!e.root)throw new Error("The root of the config must be specified.");this.root=b(e.root),this.toolbar=e.toolbar,this.config=Object.assign({},Gt);for(const t of Object.keys(e))this.config[t]=e[t];this.containerWrapper=b('<div class="lake-container-wrapper" />'),this.container=b('<div class="lake-container" />'),this.overlayContainer=b('<div class="lake-overlay" />'),this.readonly=this.config.readonly,this.container.attr({contenteditable:this.readonly?"false":"true",spellcheck:this.config.spellcheck?"true":"false",tabindex:this.config.tabIndex.toString(),readonly:this.readonly?"true":"false"}),""!==this.config.placeholder&&this.container.attr("placeholder",this.config.placeholder),this.selection=new St(this.container),this.command=new Bt(this.selection),this.history=new Kt(this.selection),this.history.limit=this.config.historySize,this.history.contentRules=this.config.contentRules,this.keystroke=new Xt(this.container),P.set(this.container.id,this)}togglePlaceholderClass(e){const t="lake-placeholder";"<p><br /></p>"===(e=bt(e)).replace("<focus />","")?this.container.addClass(t):this.container.removeClass(t)}moveBoxStripText(){const e=this.selection,t=e.range,i=t.startNode.closest(".lake-box-strip"),n=i.closest("lake-box");if("inline"===we(n).type)t.isBoxStart?(t.setStartBefore(n),t.collapseToStart()):(t.setStartAfter(n),t.collapseToStart());else{const e=b("<p />");t.isBoxStart?n.before(e):n.after(e),t.setStart(e,0),t.collapseToStart()}const o=i.text();i.html("<br />"),e.insertContents(document.createTextNode(o))}resetUnsavedInputData(){this.unsavedInputData="",this.unsavedInputCount=0}handleInputEvent(e){var t;this.selection.updateByRange();const i=this.selection.range;if(i.isInsideBox)return;if(i.isBoxStart||i.isBoxEnd)return this.moveBoxStripText(),void this.history.save();if("insertText"===(e instanceof CompositionEvent?"insertText":e.inputType)){const i=null!==(t=e.data)&&void 0!==t?t:"";return i.length>1?void this.history.save({inputType:"insertText",update:!1}):(this.unsavedInputData+=i,this.unsavedInputCount++,void(this.unsavedInputData.length<this.config.minChangeSize?this.history.save({inputType:"insertText",update:this.unsavedInputCount>1}):(this.history.save({inputType:"insertText",update:!0}),this.resetUnsavedInputData())))}this.history.save()}bindInputEvents(){this.container.on("compositionstart",()=>{this.isComposing=!0,this.container.removeClass("lake-placeholder")}),this.container.on("compositionend",e=>{this.isComposing=!1,this.handleInputEvent(e)}),this.container.on("input",e=>{const t=e;this.isComposing=t.isComposing,this.isComposing||this.handleInputEvent(e)})}removeBoxGarbage(){const e=A(this.container.id);for(const t of e.values())t.node.get(0).isConnected||(t.unmount(),e.delete(t.node.id))}bindHistoryEvents(){const e=e=>{this.fixContent()&&(this.history.save({update:!0,emitEvent:!1}),e=this.getValue()),this.emitStateChangeEvent(),this.togglePlaceholderClass(e),this.scrollToCursor(),this.event.emit("change",e)};this.history.event.on("undo",t=>{this.renderBoxes(),e(t),this.resetUnsavedInputData()}),this.history.event.on("redo",t=>{this.renderBoxes(),e(t),this.resetUnsavedInputData()}),this.history.event.on("save",(t,i)=>{this.removeBoxGarbage(),e(t),"insertText"!==i.inputType&&(this.selection.sync(),this.resetUnsavedInputData())})}bindPointerEvents(){this.container.on("pointerdown",e=>{const t=e;if(null!==t.target&&t.target!==this.container.get(0))return;const i=this.container.last();if(i.isTable||i.isBlockBox){const e=i.get(0).getBoundingClientRect();if(t.clientY>e.bottom){t.preventDefault();const e=b("<p><br /></p>");i.after(e),this.selection.range.shrinkBefore(e),this.selection.sync()}}})}get locale(){return pe(this.config.lang)}setPluginConfig(e,t){"object"!=typeof this.config[e]&&(this.config[e]={});for(const i of Object.keys(t))void 0===this.config[e][i]&&(this.config[e][i]=t[i])}fixContent(){const e=this.selection.range,t=e.commonAncestor.closest("td"),i=t.length>0?t:this.container;let n=!1,o=i.children();for(const e of o)(e.isBlock||e.isMark)&&""===e.html()&&(e.remove(),n=!0,v(`Content fixed: empty tag "${e.name}" was removed`));if(o=i.children(),0===o.length)i.html("<p><br /></p>"),e.shrinkBefore(i),n=!0,v("Content fixed: default paragraph was added");else if(1===o.length){const t=o[0];if(t.isVoid||t.isText){const i=e.startNode,o=e.startOffset,s=e.endNode,r=e.endOffset,a=b("<p />");t.before(a),a.append(t),i.isText||s.isText?(e.setStart(i,o),e.setEnd(s,r)):e.shrinkAfter(a),n=!0,v(`Content fixed: void element "${t.name}" was wrapped in paragraph`)}}return e.adjustBr(),n}renderBoxes(){this.removeBoxGarbage();const e=this.container,t=A(e.id);e.find("lake-box").each(e=>{const i=b(e);if(t.get(i.id))return;we(i).render()})}scrollToCursor(){const e=this.selection.range;if(e.isBox)return;const t=e.getRect();if(0===t.x||0===t.y)return;const i=this.container.get(0).getBoundingClientRect(),n=b('<div class="lake-artificial-cursor" />'),o=t.x-i.x,s=t.y-i.y;n.css({position:"absolute",top:`${s}px`,left:`${o}px`,width:`${t.width}px`,height:`${t.height}px`,"z-index":"-1"}),this.overlayContainer.find(".lake-artificial-cursor").remove(),this.overlayContainer.append(n),function(e,t){const i=Z(e);0===i.left&&0===i.right&&0===i.top&&0===i.bottom||e.get(0).scrollIntoView(t)}(n,{behavior:"instant",block:"nearest",inline:"nearest"}),n.remove()}hasFocus(){const e=document.activeElement;return!!e&&b(e).closest(".lake-container").get(0)===this.container.get(0)}focus(){const e=this.selection.range;this.container.contains(e.commonAncestor)&&e.isBox||this.container.focus()}blur(){this.container.blur()}getState(){const e=this.command.getNames();let t=this.selection.getActiveItems();t.length>0&&!this.container.contains(t[0].node)&&(t=[]);const i=new Map,n=new Map,o=new Map;for(const s of e){const e=this.command.getItem(s);if(e.isDisabled&&e.isDisabled(t)&&i.set(s,!0),e.isSelected&&e.isSelected(t)&&n.set(s,!0),t.length>0&&e.selectedValues){const i=e.selectedValues(t);i.length>0&&o.set(s,i)}}return{activeItems:t,disabledNameMap:i,selectedNameMap:n,selectedValuesMap:o}}setValue(e){e=kt(e);const t=new Me(e,this.config.contentRules),i=t.getFragment();this.container.empty(),this.togglePlaceholderClass(t.getHTML()),this.container.append(i),this.renderBoxes(),this.selection.updateByBookmark()}getValue(){const e=this.selection.cloneContainer();let t=new Me(e,this.config.contentRules).getHTML();return t=bt(t),t}getHTML(){return xt(this.getValue())}render(){const e=kt(this.config.value),t=new Me(e,this.config.contentRules),i=t.getFragment();if(this.root.empty(),this.root.append(this.containerWrapper),this.containerWrapper.append(this.container),this.containerWrapper.append(this.overlayContainer),this.togglePlaceholderClass(t.getHTML()),this.container.append(i),this.unmountPluginMap=Yt.plugin.loadAll(this),this.readonly||(this.selection.updateByBookmark(),this.history.save({emitEvent:!1})),this.renderBoxes(),this.toolbar){this.toolbar.render(this);const e=this.getState();this.toolbar.updateState(e)}document.addEventListener("copy",this.copyListener),this.readonly||(document.addEventListener("cut",this.cutListener),document.addEventListener("paste",this.pasteListener),document.addEventListener("selectionchange",this.selectionchangeListener),document.addEventListener("click",this.clickListener),this.bindInputEvents(),this.bindHistoryEvents(),this.bindPointerEvents())}unmount(){this.updateSelectionRange.flush(),this.updateBoxSelectionStyle.flush(),this.emitStateChangeEvent.flush();for(const e of this.unmountPluginMap.keys()){const t=this.unmountPluginMap.get(e);t&&(t(),v(`Plugin "${e}" unmounted`))}this.toolbar&&this.toolbar.unmount(),this.removeBoxGarbage(),this.container.find("lake-box").each(e=>{we(b(e)).unmount()}),this.event.removeAllListeners(),this.history.event.removeAllListeners(),this.root.off(),this.root.empty(),document.removeEventListener("copy",this.copyListener),this.readonly||(document.removeEventListener("cut",this.cutListener),document.removeEventListener("paste",this.pasteListener),document.removeEventListener("selectionchange",this.selectionchangeListener),document.removeEventListener("click",this.clickListener))}}Yt.version="0.4.6",Yt.locale=new class{add(e,t){le[e]=t,he(e)}getNames(){return Object.keys(le)}},Yt.box=new class{add(e){I.set(e.name,e)}remove(e){I.delete(e)}getNames(){return Array.from(I.keys())}},Yt.plugin=new class{constructor(){this.pluginMap=new Map}add(e,t){this.pluginMap.set(e,t)}loadAll(e){const t=new Map;for(const i of this.pluginMap.keys()){const n=this.pluginMap.get(i);if(n&&!1!==e.config[i]){const o=n(e);o&&t.set(i,o)}}return t}};function Qt(e,t){const i=e.get(0),n=b(S`<${t} />`);for(const e of i.attributes)n.attr(e.name,e.value);let o=e.first();for(;o.length>0;){const e=o.next();n.append(o),o=e}return e.replaceWith(n),n}const Jt=Array.from(a).join(",");function ei(e){const t=[e];for(const i of e.getWalker())t.push(i);for(const e of t)"div"===e.name?e.find(Jt).length>0?e.remove(!0):Qt(e,"p"):(e.isHeading||["blockquote","li"].indexOf(e.name)>=0)&&e.find(Jt).remove(!0)}function ti(e,t){const i=e.selection,n=i.range;if(0===t.childNodes.length)return;const o=new x(t.firstChild);let s=new x(t.lastChild);0===n.getBlocks().length&&i.setBlocks("<p />"),function(e,t){const i=e.selection.range,n=i.startNode.closest("lake-box");if(n.length>0)if("inline"===we(n).type)i.isBoxStart?(i.setStartBefore(n),i.collapseToStart()):i.isBoxEnd?(i.setStartAfter(n),i.collapseToStart()):e.selection.removeBox();else{const t=b("<p />");i.isBoxStart?(n.before(t),i.shrinkAfter(t)):i.isBoxEnd?(n.after(t),i.shrinkAfter(t)):e.selection.removeBox()}const o=i.startNode.closestBlock();if(t.isBlockBox){const i=we(t),n=""!==t.attr("value")?i.value:void 0;return e.selection.insertBox(i.name,n),void t.remove()}if(t.first().length>0&&Ne(o),o.isEmpty&&"p"===o.name)return o.replaceWith(t),t.find("lake-box").each(e=>{we(e).render()}),void i.shrinkAfter(t);let s=t.first();for(;s.length>0;){"li"===s.name&&(s=s.first());const t=s.next();e.selection.insertContents(s),s.isBox?we(s).render():s.isElement&&s.find("lake-box").each(e=>{we(e).render()}),s=t}t.remove()}(e,o);let r=new x(t.firstChild);for(;r.length>0;){const e=r.next();"br"===r.name&&r.remove(),r=e}if(s=new x(t.lastChild),t.childNodes.length>0){const o=i.splitBlock();o.start&&(n.setEndAfter(o.start),n.collapseToEnd()),o.end&&o.end.isEmpty&&o.end.remove(),i.insertContents(t),e.renderBoxes(),n.shrinkAfter(s)}Ve(e.container.children().filter(e=>e.isBlock)),e.history.save()}const ii=["info","tip","warning","danger"];function ni(e){e.selection.setBlocks("<p />")}function oi(e){e.selection.setBlocks("<ol><li></li></ol>")}function si(e){e.selection.setBlocks("<ul><li></li></ul>")}function ri(e,t){e.selection.setBlocks(`<ul type="checklist"><li value="${t}"></li></ul>`)}function ai(e){const t=e.startNode.closest("table"),i=b("<p><br /></p>");t.replaceWith(i),e.shrinkBefore(i),v(`deleteTable: table ${t.id}`)}function li(e){const t=[];for(let i=0;i<e.rows.length;i++)t[i]=[];for(let i=0;i<t.length;i++){const n=e.rows[i],o=t[i];let s=0;for(let e=0;e<n.cells.length;e++){for(s=e;o[s];)s++;const r=n.cells[e];for(let e=0;e<r.colSpan;e++)for(let n=0;n<r.rowSpan;n++){const o=t[i+n];o&&(o[s+e]=r)}}}return t}function ci(e,t,i){const n=e[t];for(let e=0;e<n.length;e++){if(n[e]===i)return e}return-1}function di(e,t,i){const n=e[t],o=e[t-1];let s=i;for(let e=0;e<i;e++){const t=n[e];if(t===n[e+1])s--;else if(o){t===o[e]&&s--}}return s}function hi(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0),a=i.get(0),l=r.rowIndex,c=li(s);let d=ci(c,l,a);if("right"===t){const e=c[l];if(d++,e)for(;a===e[d];)d++}v(`insertColumn: rows ${s.rows.length}, column ${d}, ${t}`);for(let e=0;e<s.rows.length;e++){const t=s.rows[e],i=c[e],n=di(c,e,d),o=t.cells[n];if(o&&o.colSpan>1&&o===i[d-1])o.colSpan+=1,o.rowSpan>1&&(e+=o.rowSpan-1);else{t.insertCell(n).innerHTML="<p><br /></p>"}}}function pi(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0);let a=li(s);const l=a[0].length;let c;c="up"===t?r.rowIndex:r.rowIndex+1;const d=s.rows[c];v(`insertRow: rows ${s.rows.length}, target row ${c}`);const h=s.insertRow(c);if(!d){for(let e=0;e<l;e++){h.insertCell(h.cells.length).innerHTML="<p><br /></p>"}return}a=li(s),c=d.rowIndex;let p=-1;for(let e=0;e<l;e++){const t=di(a,c,e);if(t!==p){p=t;const i=d.cells[t];if(!i)break;const n=h.insertCell(h.cells.length);n.innerHTML="<p><br /></p>",i.colSpan>1&&(n.colSpan=i.colSpan,e+=i.colSpan-1)}}for(let e=c-1;e>=0;e--){const t=s.rows[e].cells;for(let i=0;i<t.length;i++){const n=t[i];n.rowSpan>1&&n.rowSpan+1>c-e&&(n.rowSpan+=1)}}}const ui=[{value:"insertLeft",text:e=>e.table.insertColumnLeft()},{value:"insertRight",text:e=>e.table.insertColumnRight()},{value:"delete",text:e=>e.table.deleteColumn()}],mi=[{value:"insertAbove",text:e=>e.table.insertRowAbove()},{value:"insertBelow",text:e=>e.table.insertRowBelow()},{value:"delete",text:e=>e.table.deleteRow()}],gi=[{value:"up",text:e=>e.table.mergeUp()},{value:"right",text:e=>e.table.mergeRight()},{value:"down",text:e=>e.table.mergeDown()},{value:"left",text:e=>e.table.mergeLeft()}],fi=[{value:"leftRight",text:e=>e.table.splitLeftRight()},{value:"topBottom",text:e=>e.table.splitTopBottom()}];function vi(e,t){const i=[{name:"expand",type:"button",icon:n.get("expand"),tooltip:e=>e.table.fitTable(),isSelected:()=>{const t=e.selection.range.startNode.closest("table");if(0===t.length)return!1;return t.css("width")===e.container.innerWidth()-2+"px"},onClick:()=>{const t=e.selection.range.startNode.closest("table");if(0===t.length)return;const i=t.css("width"),n=e.container.innerWidth()-2+"px";i===n?t.css("width",""):t.css("width",n),e.history.save()}},{name:"backgroundColor",type:"dropdown",downIcon:n.get("down"),icon:n.get("backgroundColor"),accentIcon:n.get("backgroundColorAccent"),defaultValue:t.backgroundColor,tooltip:e=>e.table.cellBackground(),menuType:"color",menuItems:F,menuWidth:"296px",selectedValues:()=>{const t=e.selection.range.startNode.closest("td");if(t.length>0){return[f(t.computedCSS("background-color"))]}return[]},onSelect:(i,n)=>{e.selection.range.startNode.closest("td").css("background-color",n),t.backgroundColor=n,e.history.save()}},{name:"tableColumn",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableColumn"),tooltip:e=>e.table.column(),menuType:"list",menuItems:ui,menuCheck:!1,onSelect:(t,i)=>{const n=e.selection.range;"insertLeft"===i?hi(n,"left"):"insertRight"===i?hi(n,"right"):function(e){const t=e.startNode.closest("td"),i=t.closest("table"),n=t.closest("tr"),o=i.get(0),s=n.get(0),r=t.get(0),a=s.rowIndex,l=li(o),c=ci(l,a,r);let d=null;const h=r.cellIndex;s.cells[h+1]?d=s.cells[h+1]:s.cells[h-1]&&(d=s.cells[h-1]),v(`deleteColumn: rows ${o.rows.length}, column ${c}`);const p=function(e,t){for(let i=0;i<e.length;i++){const n=e[i][t],o=e[i+1];if(o&&n.colSpan!==o[t].colSpan)return!1}return!0}(l,c);for(let t=0;t<o.rows.length;t++){const i=o.rows[t],n=di(l,t,c),s=i.cells[n];s.rowSpan>1&&(t+=s.rowSpan-1),s.colSpan>1&&!p?(s.colSpan-=1,1===s.colSpan&&s.removeAttribute("colSpan")):(s===r&&d&&e.shrinkBefore(b(d)),i.deleteCell(n))}0===o.rows[0].cells.length&&ai(e)}(n),e.history.save()}},{name:"tableRow",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableRow"),tooltip:e=>e.table.row(),menuType:"list",menuItems:mi,menuCheck:!1,onSelect:(t,i)=>{const n=e.selection.range;"insertAbove"===i?pi(n,"up"):"insertBelow"===i?pi(n,"down"):function(e){const t=e.startNode.closest("td"),i=t.closest("table"),n=t.closest("tr"),o=i.get(0),s=n.get(0),r=t.get(0),a=s.rowIndex;let l=li(o);const c=l[0].length,d=ci(l,a,r),h=o.rows[a+1]||o.rows[a-1];v(`deleteRow: rows ${o.rows.length}, target row ${a}, column ${d}`);for(let e=a-1;e>=0;e--){const t=o.rows[e].cells;for(let i=0;i<t.length;i++){const n=t[i];n.rowSpan>1&&n.rowSpan>a-e&&(n.rowSpan-=1,1===n.rowSpan&&n.removeAttribute("rowSpan"))}}const p=o.rows[a+1];if(p){let e=-1;for(let t=0;t<c;t++){const i=di(l,a,t);if(i!==e){e=i;const n=s.cells[i];if(n.rowSpan>1){const e=di(l,a+1,t);let i=p.insertCell(e);const o=n.cloneNode(!0);o.removeAttribute("rowSpan"),i.replaceWith(o),i=o,n.rowSpan>2&&(i.rowSpan=n.rowSpan-1)}}}}if(o.deleteRow(a),h){l=li(o);const t=di(l,h.rowIndex,d),i=h.cells[t];i&&e.shrinkBefore(b(i))}0===o.rows.length&&ai(e)}(n),e.history.save()}},{name:"tableMerge",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableMerge"),tooltip:e=>e.table.merge(),menuType:"list",menuItems:gi,menuCheck:!1,onSelect:(t,i)=>{!function(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0),a=i.get(0),l=r.rowIndex,c=li(s);if("left"===t||"right"===t){const i=a.cellIndex;let n,o,s;if("left"===t?(n=r.cells[i-1],o=i,s=a):(n=a,o=i+1,s=r.cells[o]),!n||!s)return;if(v(`mergeCells: row ${l}, cell ${i}, other row ${l}, other cell ${o}`),n.rowSpan!==s.rowSpan)return;const d=c[l],h=ci(c,l,n),p=ci(c,l,s);if(d[h+1]!==s&&d[p-1]!==n)return;return n.colSpan+=s.colSpan,$e(b(n),b(s)),void e.shrinkBefore(b(n))}const d=ci(c,l,a);let h,p,u,m,g,f;if("up"===t){h=-1,p=null;for(let e=r.rowIndex-1;e>=0;e--){const t=c[e];if(!t)break;const i=t[d];if(!i)break;if(p&&i!==p)break;h=e,p=i}u=r.rowIndex,m=r,g=a.cellIndex,f=a}else{h=r.rowIndex,p=a,u=-1,f=null,g=-1;for(let e=r.rowIndex+1;e<s.rows.length;e++){const t=c[e];if(!t)break;const i=t[d];if(!i)break;if(i!==f){u=e,f=i,g=f.cellIndex;break}}if(m=s.rows[u],!m)return}p&&f&&(v(`mergeCells: row ${h}, cell ${p.cellIndex}, other row ${u}, other cell ${g}`),p.colSpan===f.colSpan&&(p.rowSpan+=f.rowSpan,$e(b(p),b(f)),e.shrinkBefore(b(p))))}(e.selection.range,i),e.history.save()}},{name:"tableSplit",type:"dropdown",downIcon:n.get("down"),icon:n.get("tableSplit"),tooltip:e=>e.table.split(),menuType:"list",menuItems:fi,menuCheck:!1,onSelect:(t,i)=>{!function(e,t){const i=e.startNode.closest("td"),n=i.closest("table"),o=i.closest("tr"),s=n.get(0),r=o.get(0),a=i.get(0),l=r.rowIndex,c=a.rowSpan,d=a.colSpan;let h=li(s);const p=ci(h,l,a);if(v(`splitCell: row ${l}, cell ${p}, ${t}`),"topBottom"===t){const e=h[l];for(let t=0;t<e.length;t++){const i=e[t];if(i===a){const e=c>1?s.rows[l+1]:s.insertRow(l+1),t=di(h,l+1,p),i=e.insertCell(t);i.innerHTML="<p><br /></p>",a.colSpan>1&&(i.colSpan=a.colSpan),a.rowSpan>2&&(i.rowSpan=a.rowSpan-1),a.removeAttribute("rowSpan"),h=li(s)}else if(1===c){for(let e=l;e>=0;e--){const n=h[e];if(0===e||i!==n[t]){i.rowSpan+=1;break}}h=li(s)}i.colSpan>1&&(t+=i.colSpan-1)}return}for(let e=0;e<h.length;e++){const t=s.rows[e],i=h[e],n=i[p];if(n===a){const i=h[e-1];if(!i||n!==i[p]){const i=di(h,e,p),o=t.insertCell(i+1);o.innerHTML="<p><br /></p>",n.rowSpan>1&&(o.rowSpan=n.rowSpan),n.colSpan>2&&(o.colSpan=n.colSpan-1),n.removeAttribute("colSpan")}}else for(let e=p;e>=0;e--)if(0===e||n!==i[e]){1===d&&(n.colSpan+=1);break}}}(e.selection.range,i),e.history.save()}},{name:"remove",type:"button",icon:n.get("remove"),tooltip:e=>e.table.remove(),onClick:()=>{ai(e.selection.range),e.history.save()}}];return i}const wi={start:"left",end:"right"};function yi(e,t){if(e.isList){let i=Number.parseInt(e.attr("indent"),10)||0;if("increase"===t?i++:i--,i<=0)i=0;else if(i>10)return;return 0===i?e.removeAttr("indent"):e.attr("indent",i.toString(10)),void Ve([e])}let i=Number.parseInt(e.css("margin-left"),10)||0;"decrease"!==t||0!==i||""===e.css("text-indent")?("increase"===t?i+=40:i-=40,i<=0&&(i=0),0===i?e.css("margin-left",""):e.css("margin-left",`${i}px`)):e.css("text-indent","")}const xi="strong";const bi="sub";const ki="sup";const Ci="code";const Si="lake-format-painter";function Bi(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class Ai{constructor(e){this.linkNode=null,this.scrollListener=()=>this.updatePosition(),this.resizeListener=()=>this.updatePosition(),this.config=e||{},this.locale=this.config.locale||pe("en-US"),this.container=b(S`
41
41
  <div class="lake-popup lake-link-popup">
42
42
  <div class="lake-row">${this.locale.link.url()}</div>
43
43
  <div class="lake-row lake-url-row">
@@ -97,7 +97,7 @@ function Li(e,t,i){const n=document.createElement(t);return e&&(n.className=e),i
97
97
  </li>
98
98
  `),n=i.find(".lake-mention-avatar");return e.avatar?n.append(e.avatar):n.remove(),e.nickname||i.find(".lake-mention-name").remove(),i.on("click",t=>this.onSelect(t,e)),i}search(e){var t;e=e.toLowerCase();const i=[];for(const n of this.items){const o=null!==(t=n.nickname)&&void 0!==t?t:n.name;(n.name.toLowerCase().indexOf(e)>=0||o.toLowerCase().indexOf(e)>=0||o.replace(/\s+/g,"").indexOf(e)>=0)&&i.push(n)}return i}}var ko={type:"inline",name:"mention",render:e=>{var t;const i=e.getEditor(),{getProfileUrl:n}=i.config.mention,o=e.value,s=n?n(o):"#",r=e.getContainer(),a=b(S`
99
99
  <div class="lake-mention"><a href="${s}">@${null!==(t=o.nickname)&&void 0!==t?t:o.name}</a></div>
100
- `);r.empty(),r.append(a),a.on("click",()=>{i.selection.selectBox(e)}),i.readonly||a.find("a").on("click",e=>{e.preventDefault()})}};function Co(e){const t=e.getCharacterRange("@");if(null===t)return null;let i=t.startNode.text().slice(t.startOffset+1,t.endOffset);return i=i.replace(/[\u200B\u2060]/g,""),i}function So(e){const t=/[\w\-]+$/.exec(e||"");return t?t[0]:""}const Bo=Le({type:"inline",name:"video",width:"560px",height:"315px",formDescription:e=>e.video.description(),urlLabel:e=>e.video.url(),urlPlaceholder:"https://www.youtube.com/watch?v=...",embedButtonText:e=>e.video.embed(),deleteButtonText:e=>e.video.remove(),validUrl:e=>0===e.indexOf("https://www.youtube.com/")&&""!==So(e),urlError:e=>e.video.urlError(),iframePlaceholder:n.get("video"),iframeAttributes:e=>({src:`https://www.youtube.com/embed/${So(e)}`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowfullscreen:"true"}),resize:!0});function Ao(e){const t=/\d+$/.exec(e||"");return t?t[0]:""}function _o(){return document.documentElement.classList.contains("lake-dark")?"dark":"light"}const Lo=Le({type:"inline",name:"twitter",width:"550px",height:"300px",formDescription:e=>e.twitter.description(),urlLabel:e=>e.twitter.url(),urlPlaceholder:"https://x.com/username/status/...",embedButtonText:e=>e.twitter.embed(),deleteButtonText:e=>e.twitter.remove(),validUrl:e=>(0===e.indexOf("https://x.com/")||0===e.indexOf("https://twitter.com/"))&&""!==Ao(e),urlError:e=>e.twitter.urlError(),iframePlaceholder:n.get("twitter"),iframeAttributes:e=>({src:`https://platform.twitter.com/embed/Tweet.html?id=${Ao(e)}&theme=${_o()}`,title:"Twitter tweet",scrolling:"no",frameborder:"0",allowtransparency:"true",allowfullscreen:"true"}),beforeIframeLoad:e=>{const t=e.getContainer(),i=t.find(".lake-iframe-placeholder"),n=t.find("iframe");"dark"===_o()&&n.css("border-radius","13px");const o=e=>{if("https://platform.twitter.com"===e.origin){const t=e.data["twttr.embed"].params[0].height;t>0&&(i.css("height",`${t}px`),n.css("height",`${t}px`),window.removeEventListener("message",o))}};window.addEventListener("message",o)}});const To=new Map([["#","h1"],["##","h2"],["###","h3"],["####","h4"],["#####","h5"],["######","h6"]]),Eo=new Map([["js","javascript"],["ts","typescript"],["md","markdown"],["htm","html"]]),Mo=[{re:/\*\*(.+?)\*\*$/,getParameters:()=>["bold"]},{re:/__(.+?)__$/,getParameters:()=>["bold"]},{re:/_(.+?)_$/,getParameters:()=>["italic"]},{re:/\*(.+?)\*$/,getParameters:()=>["italic"]},{re:/==(.+?)==$/,getParameters:()=>["highlight","#fff566"]},{re:/~~(.+?)~~$/,getParameters:()=>["strikethrough"]},{re:/`(.+?)`$/,getParameters:()=>["code"]}],Io=[{re:/^#+$/,getParameters:e=>{var t;return["heading",null!==(t=To.get(e[0]))&&void 0!==t?t:"h6"]}},{re:/^\d+\.$/,getParameters:()=>["list","numbered"]},{re:/^[*\-+]$/,getParameters:()=>["list","bulleted"]},{re:/^\[\s?\]$/,getParameters:()=>["list","checklist",!1]},{re:/^\[x\]$/i,getParameters:()=>["list","checklist",!0]},{re:/^>$/,getParameters:()=>["blockQuote"]}],Po=[{re:/^:{3,}([a-z]*)$/i,getParameters:e=>e[1]?["blockQuote",e[1]]:["blockQuote","info"]},{re:/^-{3,}$/,getParameters:()=>["hr"]},{re:/^`{3,}([a-z]*)$/i,getParameters:e=>{var t;return e[1]?["codeBlock",{lang:null!==(t=Eo.get(e[1]))&&void 0!==t?t:e[1]}]:["codeBlock"]}}];function Ho(e){const t=e.clone(!0);t.find("lake-bookmark").remove(),""===t.html()&&e.prepend("<br />")}function Do(e,t){const i=e.selection.range,n=i.getEndText();e.selection.splitBlock(),(t=i.getBlocks()[0])&&(""!==n||!t.isHeading&&"blockquote"!==t.name?t.isList&&"checklist"===t.attr("type")&&t.find("li").attr("value","false"):e.selection.setBlocks("<p />"))}function Zo(e){const t=e.selection.range,i=t.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(t.isBoxStart?(t.setStartBefore(i),t.collapseToStart(),Do(e,n)):t.isBoxEnd?(t.setStartAfter(i),t.collapseToStart(),Do(e,n)):e.selection.removeBox());const o=b("<p><br /></p>");t.isBoxStart?i.before(o):t.isBoxEnd?(i.after(o),t.shrinkAfter(o)):e.selection.removeBox()}function No(e){const t=e.selection.range,i=t.startNode.closestBlock();if(i.length>0&&!i.isContainer){const i=t.getPrevNode(),n=t.getEndText();if("br"!==i.name&&""===n)return e.selection.insertContents("<br /><br />"),void e.history.save()}e.selection.insertContents("<br />")}function Oo(e){const t=e.selection.range,i=t.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(t.isBoxStart?(t.setStartBefore(i),t.collapseToStart(),No(e)):t.isBoxEnd?(t.setStartAfter(i),t.collapseToStart(),No(e)):e.selection.removeBox());const o=b("<p><br /></p>");t.isBoxStart?i.before(o):t.isBoxEnd?(i.after(o),t.shrinkAfter(o)):e.selection.removeBox()}function zo(e,t){const i=e.selection.range;let n=t.prev();if(0===n.length)return void("p"!==t.name&&e.selection.setBlocks("<p />"));if(n.isBox||"table"===n.name)return t.isEmpty&&t.remove(),void i.shrinkAfter(n);if("br"===n.name)return void n.remove();if(!n.isBlock){const e=new N;e.selectNodeContents(n),je(e,"<p />"),n=e.startNode.closestBlock()}if(n.isEmpty)return void n.remove();!function(e){const t=e.getBlocks()[0];if(t&&t.isEmpty&&"br"!==t.first().name){t.empty();const i=Oe(t);e.setStartBefore(i),e.collapseToStart()}}(i);const o=i.getNextNode();if("br"===o.name&&"p"!==n.name)return o.remove(),void i.shrinkAfter(n);const s=e.selection.insertBookmark();$e(n,t),Ve([n]),e.selection.toBookmark(s)}function $o(e,t){const i=e.selection.range;let n=t.next();if(0===n.length)return void e.history.save();if(n.isBox)return t.isEmpty&&t.remove(),i.selectBoxStart(n),void e.history.save();if("table"===n.name)return void n.remove();if(!n.isBlock){const e=new N;e.selectNodeContents(n),je(e,"<p />"),n=n.closestBlock()}const o=e.selection.insertBookmark();$e(t,n),Ve([t]),e.selection.toBookmark(o)}const Vo=[{name:"heading1",type:"button",icon:n.get("heading1"),title:e=>e.slash.heading1(),description:e=>e.slash.heading1Desc(),onClick:e=>{e.command.execute("heading","h1")}},{name:"heading2",type:"button",icon:n.get("heading2"),title:e=>e.slash.heading2(),description:e=>e.slash.heading2Desc(),onClick:e=>{e.command.execute("heading","h2")}},{name:"heading3",type:"button",icon:n.get("heading3"),title:e=>e.slash.heading3(),description:e=>e.slash.heading3Desc(),onClick:e=>{e.command.execute("heading","h3")}},{name:"heading4",type:"button",icon:n.get("heading4"),title:e=>e.slash.heading4(),description:e=>e.slash.heading4Desc(),onClick:e=>{e.command.execute("heading","h4")}},{name:"heading5",type:"button",icon:n.get("heading5"),title:e=>e.slash.heading5(),description:e=>e.slash.heading5Desc(),onClick:e=>{e.command.execute("heading","h5")}},{name:"heading6",type:"button",icon:n.get("heading6"),title:e=>e.slash.heading6(),description:e=>e.slash.heading6Desc(),onClick:e=>{e.command.execute("heading","h6")}},{name:"paragraph",type:"button",icon:n.get("paragraph"),title:e=>e.slash.paragraph(),description:e=>e.slash.paragraphDesc(),onClick:e=>{e.command.execute("heading","p")}},{name:"blockQuote",type:"button",icon:n.get("blockQuote"),title:e=>e.slash.blockQuote(),description:e=>e.slash.blockQuoteDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"numberedList",type:"button",icon:n.get("numberedList"),title:e=>e.slash.numberedList(),description:e=>e.slash.numberedListDesc(),onClick:e=>{e.command.execute("list","numbered")}},{name:"bulletedList",type:"button",icon:n.get("bulletedList"),title:e=>e.slash.bulletedList(),description:e=>e.slash.bulletedListDesc(),onClick:e=>{e.command.execute("list","bulleted")}},{name:"checklist",type:"button",icon:n.get("checklist"),title:e=>e.slash.checklist(),description:e=>e.slash.checklistDesc(),onClick:e=>{e.command.execute("list","checklist")}},{name:"table",type:"button",icon:n.get("table"),title:e=>e.slash.table(),description:e=>e.slash.tableDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"infoAlert",type:"button",icon:n.get("info"),title:e=>e.slash.infoAlert(),description:e=>e.slash.infoAlertDesc(),onClick:e=>{e.command.execute("blockQuote","info")}},{name:"tipAlert",type:"button",icon:n.get("tip"),title:e=>e.slash.tipAlert(),description:e=>e.slash.tipAlertDesc(),onClick:e=>{e.command.execute("blockQuote","tip")}},{name:"warningAlert",type:"button",icon:n.get("warning"),title:e=>e.slash.warningAlert(),description:e=>e.slash.warningAlertDesc(),onClick:e=>{e.command.execute("blockQuote","warning")}},{name:"dangerAlert",type:"button",icon:n.get("danger"),title:e=>e.slash.dangerAlert(),description:e=>e.slash.dangerAlertDesc(),onClick:e=>{e.command.execute("blockQuote","danger")}},{name:"hr",type:"button",icon:n.get("hr"),title:e=>e.slash.hr(),description:e=>e.slash.hrDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"codeBlock",type:"button",icon:n.get("codeBlock"),title:e=>e.slash.codeBlock(),description:e=>e.slash.codeBlockDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"video",type:"button",icon:n.get("video"),title:e=>e.slash.video(),description:e=>e.slash.videoDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"equation",type:"button",icon:n.get("equation"),title:e=>e.slash.equation(),description:e=>e.slash.equationDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"twitter",type:"button",icon:n.get("twitter"),title:e=>e.slash.twitter(),description:e=>e.slash.twitterDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"image",type:"upload",icon:n.get("image"),title:e=>e.slash.image(),description:e=>e.slash.imageDesc(),accept:"image/*",multiple:!0},{name:"file",type:"upload",icon:n.get("attachment"),title:e=>e.slash.file(),description:e=>e.slash.fileDesc(),accept:"*",multiple:!0}];function Ro(){}const Fo=new Map;for(const e of Vo)Fo.set(e.name,e);class qo extends yo{constructor(e){super(e),this.locale=e.locale||pe("en-US"),this.onSelect=e.onSelect||Ro,this.container.addClass("lake-slash-menu")}getItem(e){if("string"!=typeof e)return e;const t=Fo.get(e);if(!t)throw new Error(`SlashItem "${e}" has not been defined yet.`);return t}getItemNode(e){const t=this.getItem(e),i="string"==typeof t.title?t.title:t.title(this.locale),n="string"==typeof t.description?t.description:t.description(this.locale),o=b(S`
100
+ `);r.empty(),r.append(a),a.on("click",()=>{i.selection.selectBox(e)}),i.readonly||a.find("a").on("click",e=>{e.preventDefault()})}};function Co(e){const t=e.getCharacterRange("@");if(null===t)return null;let i=t.startNode.text().slice(t.startOffset+1,t.endOffset);return i=i.replace(/[\u200B\u2060]/g,""),i}function So(e){const t=/[\w\-]+$/.exec(e||"");return t?t[0]:""}const Bo=Le({type:"inline",name:"video",width:"560px",height:"315px",formDescription:e=>e.video.description(),urlLabel:e=>e.video.url(),urlPlaceholder:"https://www.youtube.com/watch?v=...",embedButtonText:e=>e.video.embed(),deleteButtonText:e=>e.video.remove(),validUrl:e=>0===e.indexOf("https://www.youtube.com/")&&""!==So(e),urlError:e=>e.video.urlError(),iframePlaceholder:n.get("video"),iframeAttributes:e=>({src:`https://www.youtube.com/embed/${So(e)}`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowfullscreen:"true"}),resize:!0});function Ao(e){const t=/\d+$/.exec(e||"");return t?t[0]:""}function _o(){return document.documentElement.classList.contains("lake-dark")?"dark":"light"}const Lo=Le({type:"inline",name:"twitter",width:"550px",height:"300px",formDescription:e=>e.twitter.description(),urlLabel:e=>e.twitter.url(),urlPlaceholder:"https://x.com/username/status/...",embedButtonText:e=>e.twitter.embed(),deleteButtonText:e=>e.twitter.remove(),validUrl:e=>(0===e.indexOf("https://x.com/")||0===e.indexOf("https://twitter.com/"))&&""!==Ao(e),urlError:e=>e.twitter.urlError(),iframePlaceholder:n.get("twitter"),iframeAttributes:e=>({src:`https://platform.twitter.com/embed/Tweet.html?id=${Ao(e)}&theme=${_o()}`,title:"Twitter tweet",scrolling:"no",frameborder:"0",allowtransparency:"true",allowfullscreen:"true"}),beforeIframeLoad:e=>{const t=e.getContainer(),i=t.find(".lake-iframe-placeholder"),n=t.find("iframe");"dark"===_o()&&n.css("border-radius","13px");const o=e=>{if("https://platform.twitter.com"===e.origin){const t=e.data["twttr.embed"].params[0].height;t>0&&(i.css("height",`${t}px`),n.css("height",`${t}px`),window.removeEventListener("message",o))}};window.addEventListener("message",o)}});const To=new Map([["#","h1"],["##","h2"],["###","h3"],["####","h4"],["#####","h5"],["######","h6"]]),Eo=new Map([["js","javascript"],["ts","typescript"],["md","markdown"],["htm","html"]]),Mo=[{re:/\*\*(.+?)\*\*$/,getParameters:()=>["bold"]},{re:/__(.+?)__$/,getParameters:()=>["bold"]},{re:/_(.+?)_$/,getParameters:()=>["italic"]},{re:/\*(.+?)\*$/,getParameters:()=>["italic"]},{re:/==(.+?)==$/,getParameters:()=>["highlight","#fff566"]},{re:/~~(.+?)~~$/,getParameters:()=>["strikethrough"]},{re:/`(.+?)`$/,getParameters:()=>["code"]}],Io=[{re:/^#+$/,getParameters:e=>{var t;return["heading",null!==(t=To.get(e[0]))&&void 0!==t?t:"h6"]}},{re:/^\d+\.$/,getParameters:()=>["list","numbered"]},{re:/^[*\-+]$/,getParameters:()=>["list","bulleted"]},{re:/^\[\s?\]$/,getParameters:()=>["list","checklist",!1]},{re:/^\[x\]$/i,getParameters:()=>["list","checklist",!0]},{re:/^>$/,getParameters:()=>["blockQuote"]}],Po=[{re:/^:{3,}([a-z]*)$/i,getParameters:e=>e[1]?["blockQuote",e[1]]:["blockQuote","info"]},{re:/^-{3,}$/,getParameters:()=>["hr"]},{re:/^`{3,}([a-z]*)$/i,getParameters:e=>{var t;return e[1]?["codeBlock",{lang:null!==(t=Eo.get(e[1]))&&void 0!==t?t:e[1]}]:["codeBlock"]}}];function Ho(e){const t=e.clone(!0);t.find("lake-bookmark").remove(),""===t.html()&&e.prepend("<br />")}function Do(e,t){const i=e.selection.range,n=i.getEndText();e.selection.splitBlock(),(t=i.getBlocks()[0])&&(""!==n||!t.isHeading&&"blockquote"!==t.name?t.isList&&"checklist"===t.attr("type")&&t.find("li").attr("value","false"):e.selection.setBlocks("<p />"))}function Zo(e){const t=e.selection.range,i=t.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(t.isBoxStart?(t.setStartBefore(i),t.collapseToStart(),Do(e,n)):t.isBoxEnd?(t.setStartAfter(i),t.collapseToStart(),Do(e,n)):e.selection.removeBox());const o=b("<p><br /></p>");t.isBoxStart?i.before(o):t.isBoxEnd?(i.after(o),t.shrinkAfter(o)):e.selection.removeBox()}function No(e){const t=e.selection.range,i=t.startNode.closestBlock();if(i.length>0&&!i.isContainer){const i=t.getPrevNode(),n=t.getEndText();if("br"!==i.name&&""===n)return e.selection.insertContents("<br /><br />"),void e.history.save()}e.selection.insertContents("<br />")}function Oo(e){const t=e.selection.range,i=t.startNode.closest("lake-box"),n=i.closestBlock();if(n.length>0&&!n.isContainer)return void(t.isBoxStart?(t.setStartBefore(i),t.collapseToStart(),No(e)):t.isBoxEnd?(t.setStartAfter(i),t.collapseToStart(),No(e)):e.selection.removeBox());const o=b("<p><br /></p>");t.isBoxStart?i.before(o):t.isBoxEnd?(i.after(o),t.shrinkAfter(o)):e.selection.removeBox()}function zo(e,t){const i=e.selection.range;let n=t.prev();if(0===n.length)return void("p"!==t.name&&e.selection.setBlocks("<p />"));if(n.isBox||"table"===n.name)return t.isEmpty&&t.remove(),void i.shrinkAfter(n);if("br"===n.name)return void n.remove();if(!n.isBlock){const e=new N;e.selectNodeContents(n),je(e,"<p />"),n=e.startNode.closestBlock()}if(n.isEmpty)return void n.remove();!function(e){const t=e.getBlocks()[0];if(t&&t.isEmpty&&"br"!==t.first().name){t.empty();const i=Oe(t);e.setStartBefore(i),e.collapseToStart()}}(i);const o=i.getNextNode();if("br"===o.name&&"p"!==n.name)return o.remove(),void i.shrinkAfter(n);const s=e.selection.insertBookmark();$e(n,t),Ve([n]),e.selection.toBookmark(s)}function $o(e,t){const i=e.selection.range;let n=t.next();if(0===n.length)return void e.history.save();if(n.isBox)return t.isEmpty&&t.remove(),i.selectBoxStart(n),void e.history.save();if("table"===n.name)return void n.remove();if(!n.isBlock){const e=new N;e.selectNodeContents(n),je(e,"<p />"),n=n.closestBlock()}const o=e.selection.insertBookmark();$e(t,n),Ve([t]),e.selection.toBookmark(o)}const Vo=[{name:"heading1",type:"button",icon:n.get("heading1"),title:e=>e.slash.heading1(),description:e=>e.slash.heading1Desc(),onClick:e=>{e.command.execute("heading","h1")}},{name:"heading2",type:"button",icon:n.get("heading2"),title:e=>e.slash.heading2(),description:e=>e.slash.heading2Desc(),onClick:e=>{e.command.execute("heading","h2")}},{name:"heading3",type:"button",icon:n.get("heading3"),title:e=>e.slash.heading3(),description:e=>e.slash.heading3Desc(),onClick:e=>{e.command.execute("heading","h3")}},{name:"heading4",type:"button",icon:n.get("heading4"),title:e=>e.slash.heading4(),description:e=>e.slash.heading4Desc(),onClick:e=>{e.command.execute("heading","h4")}},{name:"heading5",type:"button",icon:n.get("heading5"),title:e=>e.slash.heading5(),description:e=>e.slash.heading5Desc(),onClick:e=>{e.command.execute("heading","h5")}},{name:"heading6",type:"button",icon:n.get("heading6"),title:e=>e.slash.heading6(),description:e=>e.slash.heading6Desc(),onClick:e=>{e.command.execute("heading","h6")}},{name:"paragraph",type:"button",icon:n.get("paragraph"),title:e=>e.slash.paragraph(),description:e=>e.slash.paragraphDesc(),onClick:e=>{e.command.execute("heading","p")}},{name:"blockQuote",type:"button",icon:n.get("blockQuote"),title:e=>e.slash.blockQuote(),description:e=>e.slash.blockQuoteDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"numberedList",type:"button",icon:n.get("numberedList"),title:e=>e.slash.numberedList(),description:e=>e.slash.numberedListDesc(),onClick:e=>{e.command.execute("list","numbered")}},{name:"bulletedList",type:"button",icon:n.get("bulletedList"),title:e=>e.slash.bulletedList(),description:e=>e.slash.bulletedListDesc(),onClick:e=>{e.command.execute("list","bulleted")}},{name:"checklist",type:"button",icon:n.get("checklist"),title:e=>e.slash.checklist(),description:e=>e.slash.checklistDesc(),onClick:e=>{e.command.execute("list","checklist")}},{name:"table",type:"button",icon:n.get("table"),title:e=>e.slash.table(),description:e=>e.slash.tableDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"infoAlert",type:"button",icon:n.get("info"),title:e=>e.slash.infoAlert(),description:e=>e.slash.infoAlertDesc(),onClick:e=>{e.command.execute("blockQuote","info")}},{name:"tipAlert",type:"button",icon:n.get("tip"),title:e=>e.slash.tipAlert(),description:e=>e.slash.tipAlertDesc(),onClick:e=>{e.command.execute("blockQuote","tip")}},{name:"warningAlert",type:"button",icon:n.get("warning"),title:e=>e.slash.warningAlert(),description:e=>e.slash.warningAlertDesc(),onClick:e=>{e.command.execute("blockQuote","warning")}},{name:"dangerAlert",type:"button",icon:n.get("danger"),title:e=>e.slash.dangerAlert(),description:e=>e.slash.dangerAlertDesc(),onClick:e=>{e.command.execute("blockQuote","danger")}},{name:"hr",type:"button",icon:n.get("hr"),title:e=>e.slash.hr(),description:e=>e.slash.hrDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"codeBlock",type:"button",icon:n.get("codeBlock"),title:e=>e.slash.codeBlock(),description:e=>e.slash.codeBlockDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"video",type:"button",icon:n.get("video"),title:e=>e.slash.video(),description:e=>e.slash.videoDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"equation",type:"button",icon:n.get("equation"),title:e=>e.slash.equation(),description:e=>e.slash.equationDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"twitter",type:"button",icon:n.get("twitter"),title:e=>e.slash.twitter(),description:e=>e.slash.twitterDesc(),onClick:(e,t)=>{e.command.execute(t)}},{name:"image",type:"upload",icon:n.get("image"),title:e=>e.slash.image(),description:e=>e.slash.imageDesc(),accept:"image/*",multiple:!0},{name:"media",type:"upload",icon:n.get("media"),title:e=>e.slash.media(),description:e=>e.slash.mediaDesc(),accept:"video/*",multiple:!0},{name:"file",type:"upload",icon:n.get("attachment"),title:e=>e.slash.file(),description:e=>e.slash.fileDesc(),accept:"*",multiple:!0}];function Ro(){}const Fo=new Map;for(const e of Vo)Fo.set(e.name,e);class qo extends yo{constructor(e){super(e),this.locale=e.locale||pe("en-US"),this.onSelect=e.onSelect||Ro,this.container.addClass("lake-slash-menu")}getItem(e){if("string"!=typeof e)return e;const t=Fo.get(e);if(!t)throw new Error(`SlashItem "${e}" has not been defined yet.`);return t}getItemNode(e){const t=this.getItem(e),i="string"==typeof t.title?t.title:t.title(this.locale),n="string"==typeof t.description?t.description:t.description(this.locale),o=b(S`
101
101
  <li name="${t.name}">
102
102
  <div class="lake-slash-icon"></div>
103
103
  <div class="lake-slash-text">