vendor: 18,631 bytes, lines 1-10
1import{a$ as Tt,r as Ce,j as ct}from"./app-48b4d92b.js";var so=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Pe(){}Object.assign(Pe,{default:Pe,register:Pe,revert:function(){},__esModule:!0});Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(s){const e=(this.document||this.ownerDocument).querySelectorAll(s);let t=e.length;for(;--t>=0&&e.item(t)!==this;);return t>-1});Element.prototype.closest||(Element.prototype.closest=function(s){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(s))return e;e=e.parentElement||e.parentNode}while(e!==null);return null});Element.prototype.prepend||(Element.prototype.prepend=function(s){const e=document.createDocumentFragment();Array.isArray(s)||(s=[s]),s.forEach(t=>{const o=t instanceof Node;e.appendChild(o?t:document.createTextNode(t))}),this.insertBefore(e,this.firstChild)});Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(s){s=arguments.length===0?!0:!!s;const e=this.parentNode,t=window.getComputedStyle(e,null),o=parseInt(t.getPropertyValue("border-top-width")),n=parseInt(t.getPropertyValue("border-left-width")),i=this.offsetTop-e.offsetTop<e.scrollTop,r=this.offsetTop-e.offsetTop+this.clientHeight-o>e.scrollTop+e.clientHeight,a=this.offsetLeft-e.offsetLeft<e.scrollLeft,c=this.offsetLeft-e.offsetLeft+this.clientWidth-n>e.scrollLeft+e.clientWidth,l=i&&!r;(i||r)&&s&&(e.scrollTop=this.offsetTop-e.offsetTop-e.clientHeight/2-o+this.clientHeight/2),(a||c)&&s&&(e.scrollLeft=this.offsetLeft-e.offsetLeft-e.clientWidth/2-n+this.clientWidth/2),(i||r||a||c)&&!s&&this.scrollIntoView(l)});window.requestIdleCallback=window.requestIdleCallback||function(s){const e=Date.now();return setTimeout(function(){s({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1)};window.cancelIdleCallback=window.cancelIdleCallback||function(s){clearTimeout(s)};let ao=(s=21)=>crypto.getRandomValues(new Uint8Array(s)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var Bt=(s=>(s.VERBOSE="VERBOSE",s.INFO="INFO",s.WARN="WARN",s.ERROR="ERROR",s))(Bt||{});const N={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,META:91},lo={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4};function Le(s,e,t="log",o,n="color: inherit"){if(!("console"in window)||!window.console[t])return;const i=["info","log","warn","error"].includes(t),r=[];switch(Le.logLevel){case"ERROR":if(t!=="error")return;break;case"WARN":if(!["error","warn"].includes(t))return;break;case"INFO":if(!i||s)return;break}o&&r.push(o);const a="Editor.js 2.28.2",c=`line-height: 1em; 2 color: #006FEA; 3 display: inline-block; 4 font-size: 11px; 5 line-height: 1em; 6 background-color: #fff; 7 padding: 4px 9px; 8 border-radius: 30px; 9 border: 1px solid rgba(56, 138, 229, 0.16); 10 margin: 4px 5px 4px 0;`;s&&(i?(r.unshift(c,n),e=`%c${a}%c ${e}`):e=`( ${a} )${e}`);try{i?o?console[t](`${e} %o`,...r):console[t](e,...r):console[t](e)}catch{}}Le.logLevel="VERBOSE";function co(s){Le.logLevel=s}const H=Le.bind(window,!1),J=Le.bind(window,!0);function ue(s){return Object.prototype.toString.call(s).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function z(s){return ue(s)==="function"||ue(s)==="asyncfunction"}function V(s){return ue(s)==="object"}function ce(s){return ue(s)==="string"}function ho(s){return ue(s)==="boolean"}function dt(s){return ue(s)==="number"}function ht(s){return ue(s)==="undefined"}function ee(s){return s?Object.keys(s).length===0&&s.constructor===Object:!0}function Mt(s){return s>47&&s<58||s===32||s===13||s===229||s>64&&s<91||s>95&&s<112||s>185&&s<193||s>218&&s<223}async function uo(s,e=()=>{},t=()=>{}){async function o(n,i,r){try{await n.function(n.data),await i(ht(n.data)?{}:n.data)}catch{r(ht(n.data)?{}:n.data)}}return s.reduce(async(n,i)=>(await n,o(i,e,t)),Promise.resolve())}function Lt(s){return Array.prototype.slice.call(s)}function ke(s,e){return function(){const t=this,o=arguments;window.setTimeout(()=>s.apply(t,o),e)}}function po(s){return s.name.split(".").pop()}function fo(s){return/^[-\w]+\/([-+\w]+|\*)$/.test(s)}function go(s,e,t){let o;return(...n)=>{const i=this,r=()=>{o=null,t||s.apply(i,n)},a=t&&!o;window.clearTimeout(o),o=window.setTimeout(r,e),a&&s.apply(i,n)}}function je(s,e,t=void 0){let o,n,i,r=null,a=0;t||(t={});const c=function(){a=t.leading===!1?0:Date.now(),r=null,i=s.apply(o,n),r||(o=n=null)};return function(){const l=Date.now();!a&&t.leading===!1&&(a=l);const h=e-(l-a);return o=this,n=arguments,h<=0||h>e?(r&&(clearTimeout(r),r=null),a=l,i=s.apply(o,n),r||(o=n=null)):!r&&t.trailing!==!1&&(r=setTimeout(c,h)),i}}function mo(){const s={win:!1,mac:!1,x11:!1,linux:!1},e=Object.keys(s).find(t=>window.navigator.appVersion.toLowerCase().indexOf(t)!==-1);return e&&(s[e]=!0),s}function we(s){return s[0].toUpperCase()+s.slice(1)}function ze(s,...e){if(!e.length)return s;const t=e.shift();if(V(s)&&V(t))for(const o in t)V(t[o])?(s[o]||Object.assign(s,{[o]:{}}),ze(s[o],t[o])):Object.assign(s,{[o]:t[o]});return ze(s,...e)}function Ke(s){const e=mo();return s=s.replace(/shift/gi,"â§").replace(/backspace/gi,"â«").replace(/enter/gi,"â").replace(/up/gi,"â").replace(/left/gi,"â").replace(/down/gi,"â").replace(/right/gi,"â").replace(/escape/gi,"â").replace(/insert/gi,"Ins").replace(/delete/gi,"â¡").replace(/\+/gi," + "),e.mac?s=s.replace(/ctrl|cmd/gi,"â").replace(/alt/gi,"â¥"):s=s.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN"),s}function bo(s){try{return new URL(s).href}catch{}return s.substring(0,2)==="//"?window.location.protocol+s:window.location.origin+s}function vo(){return ao(10)}function ko(s){window.open(s,"_blank")}function wo(s=""){return`${s}${Math.floor(Math.random()*1e8).toString(16)}`}function Ue(s,e,t){const o=`«${e}» is deprecated and will be removed in the next major release. Please use the «${t}» instead.`;s&&J(o,"warn")}function xe(s,e,t){const o=t.value?"value":"get",n=t[o],i=`#${e}Cache`;if(t[o]=function(...r){return this[i]===void 0&&(this[i]=n.apply(this,...r)),this[i]},o==="get"&&t.set){const r=t.set;t.set=function(a){delete s[i],r.apply(this,a)}}return t}const It=650;function he(){return window.matchMedia(`(max-width: ${It}px)`).matches}const ut=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1);function yo(s,e){const t=Array.isArray(s)||V(s),o=Array.isArray(e)||V(e);return t||o?JSON.stringify(s)===JSON.stringify(e):s===e}let w=class W{static isSingleTag(e){return e.tagName&&["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"].includes(e.tagName)}static isLineBreakTag(e){return e&&e.tagName&&["BR","WBR"].includes(e.tagName)}static make(e,t=null,o={}){const n=document.createElement(e);Array.isArray(t)?n.classList.add(...t):t&&n.classList.add(t);for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i]);return n}static text(e){return document.createTextNode(e)}static append(e,t){Array.isArray(t)?t.forEach(o=>e.appendChild(o)):e.appendChild(t)}static prepend(e,t){Array.isArray(t)?(t=t.reverse(),t.forEach(o=>e.prepend(o))):e.prepend(t)}static swap(e,t){const o=document.createElement("div"),n=e.parentNode;n.insertBefore(o,e),n.insertBefore(e,t),n.insertBefore(t,o),n.removeChild(o)}static find(e=document,t){return e.querySelector(t)}static get(e){return document.getElementById(e)}static findAll(e=document,t){return e.querySelectorAll(t)}static get allInputsSelector(){return"[contenteditable=true], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map(e=>`input[type="${e}"]`).join(", ")}static findAllInputs(e){return Lt(e.querySelectorAll(W.allInputsSelector)).reduce((t,o)=>W.isNativeInput(o)||W.containsOnlyInlineElements(o)?[...t,o]:[...t,...W.getDeepestBlockElements(o)],[])}static getDeepestNode(e,t=!1){const o=t?"lastChild":"firstChild",n=t?"previousSibling":"nextSibling";if(e&&e.nodeType===Node.ELEMENT_NODE&&e[o]){let i=e[o];if(W.isSingleTag(i)&&!W.isNativeInput(i)&&!W.isLineBreakTag(i))if(i[n])i=i[n];else if(i.parentNode[n])i=i.parentNode[n];else return i.parentNode;return this.getDeepestNode(i,t)}return e}static isElement(e){return dt(e)?!1:e&&e.nodeType&&e.nodeType===Node.ELEMENT_NODE}static isFragment(e){return dt(e)?!1:e&&e.nodeType&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}static isContentEditable(e){return e.contentEditable==="true"}static isNativeInput(e){const t=["INPUT","TEXTAREA"];return e&&e.tagName?t.includes(e.tagName):!1}static canSetCaret(e){let t=!0;if(W.isNativeInput(e))switch(e.type){case"file":case"checkbox":case"radio":case"hidden":case"submit":case"button":case"image":case"reset":t=!1;break}else t=W.isContentEditable(e);return t}static isNodeEmpty(e){let t;return this.isSingleTag(e)&&!this.isLineBreakTag(e)?!1:(this.isElement(e)&&this.isNativeInput(e)?t=e.value:t=e.textContent.replace("â",""),t.trim().length===0)}static isLeaf(e){return e?e.childNodes.length===0:!1}static isEmpty(e){e.normalize();const t=[e];for(;t.length>0;)if(e=t.shift(),!!e){if(this.isLeaf(e)&&!this.isNodeEmpty(e))return!1;e.childNodes&&t.push(...Array.from(e.childNodes))}return!0}static isHTMLString(e){const t=W.make("div");return t.innerHTML=e,t.childElementCount>0}static getContentLength(e){return W.isNativeInput(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:e.textContent.length}static get blockElements(){return["address","article","aside","blockquote","canvas","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","ruby","section","table","tbody","thead","tr","tfoot","ul","video"]}static containsOnlyInlineElements(e){let t;ce(e)?(t=document.createElement("div"),t.innerHTML=e):t=e;const o=n=>!W.blockElements.includes(n.tagName.toLowerCase())&&Array.from(n.children).every(o);return Array.from(t.children).every(o)}static getDeepestBlockElements(e){return W.containsOnlyInlineElements(e)?[e]:Array.from(e.children).reduce((t,o)=>[...t,...W.getDeepestBlockElements(o)],[])}static getHolder(e){return ce(e)?document.getElementById(e):e}static isAnchor(e){return e.tagName.toLowerCase()==="a"}static offset(e){const t=e.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,n=window.pageYOffset||document.documentElement.scrollTop,i=t.top+n,r=t.left+o;return{top:i,left:r,bottom:i+t.height,right:r+t.width}}};const xo={blockTunes:{toggler:{"Click to tune":"","or drag to move":""}},inlineToolbar:{converter:{"Convert to":""}},toolbar:{toolbox:{Add:""}},popover:{Filter:"","Nothing found":""}},Co={Text:"",Link:"",Bold:"",Italic:""},So={link:{"Add a link":""},stub:{"The block can not be displayed correctly.":""}},Eo={delete:{Delete:"","Click to delete":""},moveUp:{"Move up":""},moveDown:{"Move down":""}},_t={ui:xo,toolNames:Co,tools:So,blockTunes:Eo},ge=class{static ui(s,e){return ge._t(s,e)}static t(s,e){return ge._t(s,e)}static setDictionary(s){ge.currentDictionary=s}static _t(s,e){const t=ge.getNamespace(s);return!t||!t[e]?e:t[e]}static getNamespace(s){return s.split(".").reduce((e,t)=>!e||!Object.keys(e).length?{}:e[t],ge.currentDictionary)}};let q=ge;q.currentDictionary=_t;class Ot extends Error{}class Ne{constructor(){this.subscribers={}}on(e,t){e in this.subscribers||(this.subscribers[e]=[]),this.subscribers[e].push(t)}once(e,t){e in this.subscribers||(this.subscribers[e]=[]);const o=n=>{const i=t(n),r=this.subscribers[e].indexOf(o);return r!==-1&&this.subscribers[e].splice(r,1),i};this.subscribers[e].push(o)}emit(e,t){ee(this.subscribers)||!this.subscribers[e]||this.subscribers[e].reduce((o,n)=>{const i=n(o);return i!==void 0?i:o},t)}off(e,t){if(this.subscribers[e]===void 0){console.warn(`EventDispatcher .off(): there is no subscribers for event "${e.toString()}". Probably, .off() called before .on()`);return}for(let o=0;o<this.subscribers[e].length;o++)if(this.subscribers[e][o]===t){delete this.subscribers[e][o];break}}destroy(){this.subscribers={}}}function de(s){Object.setPrototypeOf(this,{get id(){return s.id},get name(){return s.name},get config(){return s.config},get holder(){return s.holder},get isEmpty(){return s.isEmpty},get selected(){return s.selected},set stretched(e){s.stretched=e},get stretched(){return s.stretched},call(e,t){return s.call(e,t)},save(){return s.save()},validate(e){return s.validate(e)},dispatchChange(){s.dispatchChange()}})}class Ze{constructor(){this.allListeners=[]}on(e,t,o,n=!1){const i=wo("l"),r={id:i,element:e,eventType:t,handler:o,options:n};if(!this.findOne(e,t,o))return this.allListeners.push(r),e.addEventListener(t,o,n),i}off(e,t,o,n){const i=this.findAll(e,t,o);i.forEach((r,a)=>{const c=this.allListeners.indexOf(i[a]);c>-1&&(this.allListeners.splice(c,1),r.element.removeEventListener(r.eventType,r.handler,r.options))})}offById(e){const t=this.findById(e);t&&t.element.removeEventListener(t.eventType,t.handler,t.options)}findOne(e,t,o){const n=this.findAll(e,t,o);return n.length>0?n[0]:null}findAll(e,t,o){let n;const i=e?this.findByEventTarget(e):[];return e&&t&&o?n=i.filter(r=>r.eventType===t&&r.handler===o):e&&t?n=i.filter(r=>r.eventType===t):n=i,n}removeAll(){this.allListeners.map(e=>{e.element.removeEventListener(e.eventType,e.handler,e.options)}),this.allListeners=[]}destroy(){this.removeAll()}findByEventTarget(e){return this.allListeners.filter(t=>{if(t.element===e)return t})}findByType(e){return this.allListeners.filter(t=>{if(t.eventType===e)return t})}findByHandler(e){return this.allListeners.filter(t=>{if(t.handler===e)return t})}findById(e){return this.allListeners.find(t=>t.id===e)}}let D=class At{constructor({config:e,eventsDispatcher:t}){if(this.nodes={},this.listeners=new Ze,this.readOnlyMutableListeners={on:(o,n,i,r=!1)=>{this.mutableListenerIds.push(this.listeners.on(o,n,i,r))},clearAll:()=>{for(const o of this.mutableListenerIds)this.listeners.offById(o);this.mutableListenerIds=[]}},this.mutableListenerIds=[],new.target===At)throw new TypeError("Constructors for abstract class Module are not allowed.");this.config=e,this.eventsDispatcher=t}set state(e){this.Editor=e}removeAllNodes(){for(const e in this.nodes){const t=this.nodes[e];t instanceof HTMLElement&&t.remove()}}get isRtl(){return this.config.i18n.direction==="rtl"}},A=class ae{constructor(){this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.commandBackground="backColor",this.commandRemoveFormat="removeFormat"}static get CSS(){return{editorWrapper:"codex-editor",editorZone:"codex-editor__redactor"}}static get anchorNode(){const e=window.getSelection();return e?e.anchorNode:null}static get anchorElement(){const e=window.getSelection();if(!e)return null;const t=e.anchorNode;return t?w.isElement(t)?t:t.parentElement:null}static get anchorOffset(){const e=window.getSelection();return e?e.anchorOffset:null}static get isCollapsed(){const e=window.getSelection();return e?e.isCollapsed:null}static get isAtEditor(){return this.isSelectionAtEditor(ae.get())}static isSelectionAtEditor(e){if(!e)return!1;let t=e.anchorNode||e.focusNode;t&&t.nodeType===Node.TEXT_NODE&&(t=t.parentNode);let o=null;return t&&t instanceof Element&&(o=t.closest(`.${ae.CSS.editorZone}`)),o?o.nodeType===Node.ELEMENT_NODE:!1}static isRangeAtEditor(e){if(!e)return;let t=e.startContainer;t&&t.nodeType===Node.TEXT_NODE&&(t=t.parentNode);let o=null;return t&&t instanceof Element&&(o=t.closest(`.${ae.CSS.editorZone}`)),o?o.nodeType===Node.ELEMENT_NODE:!1}static get isSelectionExists(){return!!ae.get().anchorNode}static get range(){return this.getRangeFromSelection(this.get())}static getRangeFromSelection(e){return e&&e.rangeCount?e.getRangeAt(0):null}static get rect(){let e=document.selection,t,o={x:0,y:0,width:0,height:0};if(e&&e.type!=="Control")return e=e,t=e.createRange(),o.x=t.boundingLeft,o.y=t.boundingTop,o.width=t.boundingWidth,o.height=t.boundingHeight,o;if(!window.getSelection)return H("Method window.getSelection is not supported","warn"),o;if(e=window.getSelection(),e.rangeCount===null||isNaN(e.rangeCount))return H("Method SelectionUtils.rangeCount is not supported","warn"),o;if(e.rangeCount===0)return o;if(t=e.getRangeAt(0).cloneRange(),t.getBoundingClientRect&&(o=t.getBoundingClientRect()),o.x===0&&o.y===0){const n=document.createElement("span");if(n.getBoundingClientRect){n.appendChild(document.createTextNode("â")),t.insertNode(n),o=n.getBoundingClientRect();const i=n.parentNode;i.removeChild(n),i.normalize()}}return o}static get text(){return window.getSelection?window.getSelection().toString():""}static get(){return window.getSelection()}static setCursor(e,t=0){const o=document.createRange(),n=window.getSelection();return w.isNativeInput(e)?w.canSetCaret(e)?(e.focus(),e.selectionStart=e.selectionEnd=t,e.getBoundingClientRect()):void 0:(o.setStart(e,t),o.setEnd(e,t),n.removeAllRanges(),n.addRange(o),o.getBoundingClientRect())}static isRangeInsideContainer(e){const t=ae.range;return t===null?!1:e.contains(t.startContainer)}static addFakeCursor(){const e=ae.range;if(e===null)return;const t=w.make("span","codex-editor__fake-cursor");t.dataset.mutationFree="true",e.collapse(),e.insertNode(t)}static isFakeCursorInsideContainer(e){return w.find(e,".codex-editor__fake-cursor")!==null}static removeFakeCursor(e=document.body){const t=w.find(e,".codex-editor__fake-cursor");t&&t.remove()}removeFakeBackground(){this.isFakeBackgroundEnabled&&(this.isFakeBackgroundEnabled=!1,document.execCommand(this.commandRemoveFormat))}setFakeBackground(){document.execCommand(this.commandBackground,!1,"#a8d6ff"),this.isFakeBackgroundEnabled=!0}save(){this.savedSelectionRange=ae.range}restore(){if(!this.savedSelectionRange)return;const e=window.getSelection();e.removeAllRanges(),e.addRange(this.savedSelectionRange)}clearSaved(){this.savedSelectionRange=null}collapseToEnd(){const e=window.getSelection(),t=document.createRange();t.selectNodeContents(e.focusNode),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}
10findParentTag(e,t,o=10){const n=window.getSelection();let i=null;return!n||!n.anchorNode||!n.focusNode?null:([n.anchorNode,n.focusNode].forEach(r=>{let a=o;for(;a>0&&r.parentNode&&!(r.tagName===e&&(i=r,t&&r.classList&&!r.classList.contains(t)&&(i=null),i));)r=r.parentNode,a--}),i)}expandToTag(e){const t=window.getSelection();t.removeAllRanges();const o=document.createRange();o.selectNodeContents(e),t.addRange(o)}};function To(s,e){const{type:t,target:o,addedNodes:n,removedNodes:i}=s;if(o===e)return!0;if(["characterData","attributes"].includes(t)){const c=o.nodeType===Node.TEXT_NODE?o.parentNode:o;return e.contains(c)}const r=Array.from(n).some(c=>e.contains(c)),a=Array.from(i).some(c=>e.contains(c));return r||a}const $e="redactor dom changed",Rt="block changed",Nt="fake cursor is about to be toggled",Dt="fake cursor have been set";function pt(s,e){return s.mergeable&&s.name===e.name}function Bo(s,e){const t=e==null?void 0:e.export;return z(t)?t(s):ce(t)?s[t]:(t!==void 0&&H("Conversion «export» property must be a string or function. String means key of saved data object to export. Function should export processed string to export."),"")}function Mo(s,e){const t=e==null?void 0:e.import;return z(t)?t(s):ce(t)?{[t]:s}:(t!==void 0&&H("Conversion «import» property must be a string or function. String means key of tool data to import. Function accepts a imported string and return composed tool data."),{})}var ne=(s=>(s.APPEND_CALLBACK="appendCallback",s.RENDERED="rendered",s.MOVED="moved",s.UPDATED="updated",s.REMOVED="removed",s.ON_PASTE="onPaste",s))(ne||{});let ie=class te extends Ne{constructor({id:e=vo(),data:t,tool:o,api:n,readOnly:i,tunesData:r},a){super(),this.cachedInputs=[],this.toolRenderedElement=null,this.tunesInstances=new Map,this.defaultTunesInstances=new Map,this.unavailableTunesData={},this.inputIndex=0,this.editorEventBus=null,this.handleFocus=()=>{this.dropInputsCache(),this.updateCurrentInput()},this.didMutated=(c=void 0)=>{const l=c===void 0,h=c instanceof InputEvent;!l&&!h&&this.detectToolRootChange(c);let d;l||h?d=!0:d=!(c.length>0&&c.every(p=>{const{addedNodes:g,removedNodes:f,target:u}=p;return[...Array.from(g),...Array.from(f),u].some(m=>w.isElement(m)?m.dataset.mutationFree==="true":!1)})),d&&(this.dropInputsCache(),this.updateCurrentInput(),this.call("updated"),this.emit("didMutated",this))},this.name=o.name,this.id=e,this.settings=o.settings,this.config=o.settings.config||{},this.api=n,this.editorEventBus=a||null,this.blockAPI=new de(this),this.tool=o,this.toolInstance=o.create(t,this.blockAPI,i),this.tunes=o.tunes,this.composeTunes(r),this.holder=this.compose(),window.requestIdleCallback(()=>{this.watchBlockMutations(),this.addInputEvents()})}static get CSS(){return{wrapper:"ce-block",wrapperStretched:"ce-block--stretched",content:"ce-block__content",focused:"ce-block--focused",selected:"ce-block--selected",dropTarget:"ce-block--drop-target"}}get inputs(){if(this.cachedInputs.length!==0)return this.cachedInputs;const e=w.findAllInputs(this.holder);return this.inputIndex>e.length-1&&(this.inputIndex=e.length-1),this.cachedInputs=e,e}get currentInput(){return this.inputs[this.inputIndex]}set currentInput(e){const t=this.inputs.findIndex(o=>o===e||o.contains(e));t!==-1&&(this.inputIndex=t)}get firstInput(){return this.inputs[0]}get lastInput(){const e=this.inputs;return e[e.length-1]}get nextInput(){return this.inputs[this.inputIndex+1]}get previousInput(){return this.inputs[this.inputIndex-1]}get data(){return this.save().then(e=>e&&!ee(e.data)?e.data:{})}get sanitize(){return this.tool.sanitizeConfig}get mergeable(){return z(this.toolInstance.merge)}get isEmpty(){const e=w.isEmpty(this.pluginsContent),t=!this.hasMedia;return e&&t}get hasMedia(){const e=["img","iframe","video","audio","source","input","textarea","twitterwidget"];return!!this.holder.querySelector(e.join(","))}set focused(e){this.holder.classList.toggle(te.CSS.focused,e)}get focused(){return this.holder.classList.contains(te.CSS.focused)}set selected(e){var t,o;this.holder.classList.toggle(te.CSS.selected,e);const n=e===!0&&A.isRangeInsideContainer(this.holder),i=e===!1&&A.isFakeCursorInsideContainer(this.holder);(n||i)&&((t=this.editorEventBus)==null||t.emit(Nt,{state:e}),n?A.addFakeCursor():A.removeFakeCursor(this.holder),(o=this.editorEventBus)==null||o.emit(Dt,{state:e}))}get selected(){return this.holder.classList.contains(te.CSS.selected)}set stretched(e){this.holder.classList.toggle(te.CSS.wrapperStretched,e)}get stretched(){return this.holder.classList.contains(te.CSS.wrapperStretched)}set dropTarget(e){this.holder.classList.toggle(te.CSS.dropTarget,e)}get pluginsContent(){return this.toolRenderedElement}call(e,t){if(z(this.toolInstance[e])){e==="appendCallback"&&H("`appendCallback` hook is deprecated and will be removed in the next major release. Use `rendered` hook instead","warn");try{this.toolInstance[e].call(this.toolInstance,t)}catch(o){H(`Error during '${e}' call: ${o.message}`,"error")}}}async mergeWith(e){await this.toolInstance.merge(e)}async save(){const e=await this.toolInstance.save(this.pluginsContent),t=this.unavailableTunesData;
10[...this.tunesInstances.entries(),...this.defaultTunesInstances.entries()].forEach(([i,r])=>{if(z(r.save))try{t[i]=r.save()}catch(a){H(`Tune ${r.constructor.name} save method throws an Error %o`,"warn",a)}});const o=window.performance.now();let n;return Promise.resolve(e).then(i=>(n=window.performance.now(),{id:this.id,tool:this.name,data:i,tunes:t,time:n-o})).catch(i=>{H(`Saving process for ${this.name} tool failed due to the ${i}`,"log","red")})}async validate(e){let t=!0;return this.toolInstance.validate instanceof Function&&(t=await this.toolInstance.validate(e)),t}getTunes(){const e=document.createElement("div"),t=[],o=typeof this.toolInstance.renderSettings=="function"?this.toolInstance.renderSettings():[],n=[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].map(i=>i.render());return[o,n].flat().forEach(i=>{w.isElement(i)?e.appendChild(i):Array.isArray(i)?t.push(...i):t.push(i)}),[t,e]}updateCurrentInput(){this.currentInput=w.isNativeInput(document.activeElement)||!A.anchorNode?document.activeElement:A.anchorNode}dispatchChange(){this.didMutated()}destroy(){this.unwatchBlockMutations(),this.removeInputEvents(),super.destroy(),z(this.toolInstance.destroy)&&this.toolInstance.destroy()}async getActiveToolboxEntry(){const e=this.tool.toolbox;if(e.length===1)return Promise.resolve(this.tool.toolbox[0]);const t=await this.data;return e.find(o=>Object.entries(o.data).some(([n,i])=>t[n]&&yo(t[n],i)))}async exportDataAsString(){const e=await this.data;return Bo(e,this.tool.conversionConfig)}compose(){const e=w.make("div",te.CSS.wrapper),t=w.make("div",te.CSS.content),o=this.toolInstance.render();e.dataset.id=this.id,this.toolRenderedElement=o,t.appendChild(this.toolRenderedElement);let n=t;return[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].forEach(i=>{if(z(i.wrap))try{n=i.wrap(n)}catch(r){H(`Tune ${i.constructor.name} wrap method throws an Error %o`,"warn",r)}}),e.appendChild(n),e}composeTunes(e){Array.from(this.tunes.values()).forEach(t=>{(t.isInternal?this.defaultTunesInstances:this.tunesInstances).set(t.name,t.create(e[t.name],this.blockAPI))}),Object.entries(e).forEach(([t,o])=>{this.tunesInstances.has(t)||(this.unavailableTunesData[t]=o)})}addInputEvents(){this.inputs.forEach(e=>{e.addEventListener("focus",this.handleFocus),w.isNativeInput(e)&&e.addEventListener("input",this.didMutated)})}removeInputEvents(){this.inputs.forEach(e=>{e.removeEventListener("focus",this.handleFocus),w.isNativeInput(e)&&e.removeEventListener("input",this.didMutated)})}watchBlockMutations(){var e;this.redactorDomChangedCallback=t=>{const{mutations:o}=t;o.some(n=>To(n,this.toolRenderedElement))&&this.didMutated(o)},(e=this.editorEventBus)==null||e.on($e,this.redactorDomChangedCallback)}unwatchBlockMutations(){var e;(e=this.editorEventBus)==null||e.off($e,this.redactorDomChangedCallback)}detectToolRootChange(e){e.forEach(t=>{if(Array.from(t.removedNodes).includes(this.toolRenderedElement)){const o=t.addedNodes[t.addedNodes.length-1];this.toolRenderedElement=o}})}dropInputsCache(){this.cachedInputs=[]}};class Lo extends D{constructor(){super(...arguments),this.insert=(e=this.config.defaultBlock,t={},o={},n,i,r,a)=>{const c=this.Editor.BlockManager.insert({id:a,tool:e,data:t,index:n,needToFocus:i,replace:r});return new de(c)},this.composeBlockData=async e=>{const t=this.Editor.Tools.blockTools.get(e);return new ie({tool:t,api:this.Editor.API,readOnly:!0,data:{},tunesData:{}}).data},this.update=async(e,t)=>{const{BlockManager:o}=this.Editor,n=o.getBlockById(e);if(n===void 0)throw new Error(`Block with id "${e}" not found`);const i=await o.update(n,t);return new de(i)},this.convert=(e,t,o)=>{var n,i;const{BlockManager:r,Tools:a}=this.Editor,c=r.getBlockById(e);if(!c)throw new Error(`Block with id "${e}" not found`);const l=a.blockTools.get(c.name),h=a.blockTools.get(t);if(!h)throw new Error(`Block Tool with type "${t}" not found`);const d=((n=l==null?void 0:l.conversionConfig)==null?void 0:n.export)!==void 0,p=((i=h.conversionConfig)==null?void 0:i.import)!==void 0;if(d&&p)r.convert(c,t,o);
vendor: 4,678 bytes, line 10
10else{const g=[d?!1:we(c.name),p?!1:we(t)].filter(Boolean).join(" and ");throw new Error(`Conversion from "${c.name}" to "${t}" is not possible. ${g} tool(s) should provide a "conversionConfig"`)}},this.insertMany=(e,t=this.Editor.BlockManager.blocks.length-1)=>{this.validateIndex(t);const o=e.map(({id:n,type:i,data:r})=>this.Editor.BlockManager.composeBlock({id:n,tool:i||this.config.defaultBlock,data:r}));return this.Editor.BlockManager.insertMany(o,t),o.map(n=>new de(n))}}get methods(){return{clear:()=>this.clear(),render:e=>this.render(e),renderFromHTML:e=>this.renderFromHTML(e),delete:e=>this.delete(e),swap:(e,t)=>this.swap(e,t),move:(e,t)=>this.move(e,t),getBlockByIndex:e=>this.getBlockByIndex(e),getById:e=>this.getById(e),getCurrentBlockIndex:()=>this.getCurrentBlockIndex(),getBlockIndex:e=>this.getBlockIndex(e),getBlocksCount:()=>this.getBlocksCount(),stretchBlock:(e,t=!0)=>this.stretchBlock(e,t),insertNewBlock:()=>this.insertNewBlock(),insert:this.insert,insertMany:this.insertMany,update:this.update,composeBlockData:this.composeBlockData,convert:this.convert}}getBlocksCount(){return this.Editor.BlockManager.blocks.length}getCurrentBlockIndex(){return this.Editor.BlockManager.currentBlockIndex}getBlockIndex(e){const t=this.Editor.BlockManager.getBlockById(e);if(!t){J("There is no block with id `"+e+"`","warn");return}return this.Editor.BlockManager.getBlockIndex(t)}getBlockByIndex(e){const t=this.Editor.BlockManager.getBlockByIndex(e);if(t===void 0){J("There is no block at index `"+e+"`","warn");return}return new de(t)}getById(e){const t=this.Editor.BlockManager.getBlockById(e);return t===void 0?(J("There is no block with id `"+e+"`","warn"),null):new de(t)}swap(e,t){H("`blocks.swap()` method is deprecated and will be removed in the next major release. Use `block.move()` method instead","info"),this.Editor.BlockManager.swap(e,t)}move(e,t){this.Editor.BlockManager.move(e,t)}delete(e=this.Editor.BlockManager.currentBlockIndex){try{const t=this.Editor.BlockManager.getBlockByIndex(e);this.Editor.BlockManager.removeBlock(t)}catch(t){J(t,"warn");return}this.Editor.BlockManager.blocks.length===0&&this.Editor.BlockManager.insert(),this.Editor.BlockManager.currentBlock&&this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END),this.Editor.Toolbar.close()}async clear(){await this.Editor.BlockManager.clear(!0),this.Editor.InlineToolbar.close()}async render(e){if(e===void 0||e.blocks===void 0)throw new Error("Incorrect data passed to the render() method");this.Editor.ModificationsObserver.disable(),await this.Editor.BlockManager.clear(),await this.Editor.Renderer.render(e.blocks),this.Editor.ModificationsObserver.enable()}renderFromHTML(e){return this.Editor.BlockManager.clear(),this.Editor.Paste.processText(e,!0)}stretchBlock(e,t=!0){Ue(!0,"blocks.stretchBlock()","BlockAPI");const o=this.Editor.BlockManager.getBlockByIndex(e);o&&(o.stretched=t)}insertNewBlock(){H("Method blocks.insertNewBlock() is deprecated and it will be removed in the next major release. Use blocks.insert() instead.","warn"),this.insert()}validateIndex(e){if(typeof e!="number")throw new Error("Index should be a number");if(e<0)throw new Error("Index should be greater than or equal to 0");if(e===null)throw new Error("Index should be greater than or equal to 0")}}class Io extends D{constructor(){super(...arguments),this.setToFirstBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.firstBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.firstBlock,e,t),!0):!1,this.setToLastBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.lastBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.lastBlock,e,t),!0):!1,this.setToPreviousBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.previousBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.previousBlock,e,t),!0):!1,this.setToNextBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.nextBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.nextBlock,e,t),!0):!1,this.setToBlock=(e,t=this.Editor.Caret.positions.DEFAULT,o=0)=>this.Editor.BlockManager.blocks[e]?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.blocks[e],t,o),!0):!1,this.focus=(e=!1)=>e?this.setToLastBlock(this.Editor.Caret.positions.END):this.setToFirstBlock(this.Editor.Caret.positions.START)}get methods(){return{setToFirstBlock:this.setToFirstBlock,setToLastBlock:this.setToLastBlock,setToPreviousBlock:this.setToPreviousBlock,setToNextBlock:this.setToNextBlock,setToBlock:this.setToBlock,focus:this.focus}}}class _o extends D{get methods(){return{emit:(e,t)=>
10this.emit(e,t),off:(e,t)=>this.off(e,t),on:(e,t)=>this.on(e,t)}}on(e,t){this.eventsDispatcher.on(e,t)}emit(e,t){this.eventsDispatcher.emit(e,t)}off(e,t){this.eventsDispatcher.off(e,t)}}class Ge extends D{static getNamespace(e){return e.isTune()?`blockTunes.${e.name}`:`tools.${e.name}`}get methods(){return{t:()=>{J("I18n.t() method can be accessed only from Tools","warn")}}}getMethodsForTool(e){return Object.assign(this.methods,{t:t=>q.t(Ge.getNamespace(e),t)})}}class Oo extends D{get methods(){return{blocks:this.Editor.BlocksAPI.methods,caret:this.Editor.CaretAPI.methods,events:this.Editor.EventsAPI.methods,listeners:this.Editor.ListenersAPI.methods,notifier:this.Editor.NotifierAPI.methods,sanitizer:this.Editor.SanitizerAPI.methods,saver:this.Editor.SaverAPI.methods,selection:this.Editor.SelectionAPI.methods,styles:this.Editor.StylesAPI.classes,toolbar:this.Editor.ToolbarAPI.methods,inlineToolbar:this.Editor.InlineToolbarAPI.methods,tooltip:this.Editor.TooltipAPI.methods,i18n:this.Editor.I18nAPI.methods,readOnly:this.Editor.ReadOnlyAPI.methods,ui:this.Editor.UiAPI.methods}}getMethodsForTool(e){return Object.assign(this.methods,{i18n:this.Editor.I18nAPI.getMethodsForTool(e)})}}class Ao extends D{get methods(){return{close:()=>this.close(),open:()=>this.open()}}open(){this.Editor.InlineToolbar.tryToShow()}close(){this.Editor.InlineToolbar.close()}}class Ro extends D{get methods(){return{on:(e,t,o,n)=>this.on(e,t,o,n),off:(e,t,o,n)=>this.off(e,t,o,n),offById:e=>this.offById(e)}}on(e,t,o,n){return this.listeners.on(e,t,o,n)}off(e,t,o,n){this.listeners.off(e,t,o,n)}offById(e){this.listeners.offById(e)}}var Ve={},No={get exports(){return Ve},set exports(s){Ve=s}};(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="/",n(n.s=0)}([function(t,o,n){n(1),t.exports=function(){var i=n(6),r="cdx-notify--bounce-in",a=null;return{show:function(c){if(c.message){(function(){if(a)return!0;a=i.getWrapper(),document.body.appendChild(a)})();var l=null,h=c.time||8e3;switch(c.type){case"confirm":l=i.confirm(c);break;case"prompt":l=i.prompt(c);break;default:l=i.alert(c),window.setTimeout(function(){l.remove()},h)}a.appendChild(l),l.classList.add(r)}}}}()},function(t,o,n){var i=n(2);typeof i=="string"&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(4)(i,r),i.locals&&(t.exports=i.locals)},function(t,o,n){(t.exports=n(3)(!1)).push([t.i,`.cdx-notify--error{background:#fffbfb!important}.cdx-notify--error::before{background:#fb5d5d!important}.cdx-notify__input{max-width:130px;padding:5px 10px;background:#f7f7f7;border:0;border-radius:3px;font-size:13px;color:#656b7c;outline:0}.cdx-notify__input:-ms-input-placeholder{color:#656b7c}.cdx-notify__input::placeholder{color:#656b7c}.cdx-notify__input:focus:-ms-input-placeholder{color:rgba(101,107,124,.3)}.cdx-notify__input:focus::placeholder{color:rgba(101,107,124,.3)}.cdx-notify__button{border:none;border-radius:3px;font-size:13px;padding:5px 10px;cursor:pointer}.cdx-notify__button:last-child{margin-left:10px}.cdx-notify__button--cancel{background:#f2f5f7;box-shadow:0 2px 1px 0 rgba(16,19,29,0);color:#656b7c}.cdx-notify__button--cancel:hover{background:#eee}.cdx-notify__button--confirm{background:#34c992;box-shadow:0 1px 1px 0 rgba(18,49,35,.05);color:#fff}.cdx-notify__button--confirm:hover{background:#33b082}.cdx-notify__btns-wrapper{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;margin-top:5px}.cdx-notify__cross{position:absolute;top:5px;right:5px;width:10px;height:10px;padding:5px;opacity:.54;cursor:pointer}.cdx-notify__cross::after,.cdx-notify__cross::before{content:'';position:absolute;
10left:9px;top:5px;height:12px;width:2px;background:#575d67}.cdx-notify__cross::before{transform:rotate(-45deg)}.cdx-notify__cross::after{transform:rotate(45deg)}.cdx-notify__cross:hover{opacity:1}.cdx-notifies{position:fixed;z-index:2;bottom:20px;left:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}.cdx-notify{position:relative;width:220px;margin-top:15px;padding:13px 16px;background:#fff;box-shadow:0 11px 17px 0 rgba(23,32,61,.13);border-radius:5px;font-size:14px;line-height:1.4em;word-wrap:break-word}.cdx-notify::before{content:'';position:absolute;display:block;top:0;left:0;width:3px;height:calc(100% - 6px);margin:3px;border-radius:5px;background:0 0}@keyframes bounceIn{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(.9)}100%{transform:scale(1)}}.cdx-notify--bounce-in{animation-name:bounceIn;animation-duration:.6s;animation-iteration-count:1}.cdx-notify--success{background:#fafffe!important}.cdx-notify--success::before{background:#41ffb1!important}`,""])},function(t,o){t.exports=function(n){var i=[];return i.toString=function(){return this.map(function(r){var a=function(c,l){var h=c[1]||"",d=c[3];if(!d)return h;if(l&&typeof btoa=="function"){var p=(f=d,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(f))))+" */"),g=d.sources.map(function(u){return"/*# sourceURL="+d.sourceRoot+u+" */"});return[h].concat(g).concat([p]).join(` 11`)}var f;return[h].join(` 12`)}(r,n);return r[2]?"@media "+r[2]+"{"+a+"}":a}).join("")},i.i=function(r,a){typeof r=="string"&&(r=[[null,r,""]]);for(var c={},l=0;l<this.length;l++){var h=this[l][0];typeof h=="number"&&(c[h]=!0)}for(l=0;l<r.length;l++){var d=r[l];typeof d[0]=="number"&&c[d[0]]||(a&&!d[2]?d[2]=a:a&&(d[2]="("+d[2]+") and ("+a+")"),i.push(d))}},i}},function(t,o,n){var i,r,a={},c=(i=function(){return window&&document&&document.all&&!window.atob},function(){return r===void 0&&(r=i.apply(this,arguments)),r}),l=function(E){var C={};return function(L){if(typeof L=="function")return L();if(C[L]===void 0){var S=(function(T){return document.querySelector(T)}).call(this,L);if(window.HTMLIFrameElement&&S instanceof window.HTMLIFrameElement)try{S=S.contentDocument.head}catch{S=null}C[L]=S}return C[L]}}(),h=null,d=0,p=[],g=n(5);function f(E,C){for(var L=0;L<E.length;L++){var S=E[L],T=a[S.id];if(T){T.refs++;for(var M=0;M<T.parts.length;M++)T.parts[M](S.parts[M]);for(;M<S.parts.length;M++)T.parts.push(k(S.parts[M],C))}else{var O=[];for(M=0;M<S.parts.length;M++)O.push(k(S.parts[M],C));a[S.id]={id:S.id,refs:1,parts:O}}}}function u(E,C){for(var L=[],S={},T=0;T<E.length;T++){var M=E[T],O=C.base?M[0]+C.base:M[0],I={css:M[1],media:M[2],sourceMap:M[3]};S[O]?S[O].parts.push(I):L.push(S[O]={id:O,parts:[I]})}return L}function m(E,C){var L=l(E.insertInto);if(!L)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var S=p[p.length-1];if(E.insertAt==="top")S?S.nextSibling?L.insertBefore(C,S.nextSibling):L.appendChild(C):L.insertBefore(C,L.firstChild),p.push(C);else if(E.insertAt==="bottom")L.appendChild(C);else{if(typeof E.insertAt!="object"||!E.insertAt.before)throw new Error(`[Style Loader] 13 14 Invalid value for parameter 'insertAt' ('options.insertAt') found. 15 Must be 'top', 'bottom', or Object. 16 (https://github.com/webpack-contrib/style-loader#insertat) 17`);var T=l(E.insertInto+" "+E.insertAt.before);L.insertBefore(C,T)}}function y(E){if(E.parentNode===null)return!1;E.parentNode.removeChild(E);var C=p.indexOf(E);C>=0&&p.splice(C,1)}function x(E){var C=document.createElement("style");return E.attrs.type===void 0&&(E.attrs.type="text/css"),b(C,E.attrs),m(E,C),C}function b(E,C){Object.keys(C).forEach(function(L){E.setAttribute(L,C[L])})}function k(E,C){var L,S,T,M;if(C.transform&&E.css){if(!(M=C.transform(E.css)))return function(){};E.css=M}if(C.singleton){var O=d++;L=h||(h=x(C)),S=_.bind(null,L,O,!1),T=_.bind(null,L,O,!0)}else E.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(L=function(I){var R=document.createElement("link");return I.attrs.type===void 0&&(I.attrs.type="text/css"),I.attrs.rel="stylesheet",b(R,I.attrs),m(I,R),R}(C),S=(function(I,R,j){var P=j.css,Z=j.sourceMap,io=R.convertToAbsoluteUrls===void 0&&Z;(R.convertToAbsoluteUrls||io)&&(P=g(P)),Z&&(P+=` 18/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(Z))))+" */");var ro=new Blob([P],{type:"text/css"}),lt=I.href;I.href=URL.createObjectURL(ro),lt&&URL.revokeObjectURL(lt)}
vendor: 17,143 bytes, lines 18-28
18).bind(null,L,C),T=function(){y(L),L.href&&URL.revokeObjectURL(L.href)}):(L=x(C),S=(function(I,R){var j=R.css,P=R.media;if(P&&I.setAttribute("media",P),I.styleSheet)I.styleSheet.cssText=j;else{for(;I.firstChild;)I.removeChild(I.firstChild);I.appendChild(document.createTextNode(j))}}).bind(null,L),T=function(){y(L)});return S(E),function(I){if(I){if(I.css===E.css&&I.media===E.media&&I.sourceMap===E.sourceMap)return;S(E=I)}else T()}}t.exports=function(E,C){if(typeof DEBUG<"u"&&DEBUG&&typeof document!="object")throw new Error("The style-loader cannot be used in a non-browser environment");(C=C||{}).attrs=typeof C.attrs=="object"?C.attrs:{},C.singleton||typeof C.singleton=="boolean"||(C.singleton=c()),C.insertInto||(C.insertInto="head"),C.insertAt||(C.insertAt="bottom");var L=u(E,C);return f(L,C),function(S){for(var T=[],M=0;M<L.length;M++){var O=L[M];(I=a[O.id]).refs--,T.push(I)}for(S&&f(u(S,C),C),M=0;M<T.length;M++){var I;if((I=T[M]).refs===0){for(var R=0;R<I.parts.length;R++)I.parts[R]();delete a[I.id]}}}};var v,B=(v=[],function(E,C){return v[E]=C,v.filter(Boolean).join(` 19`)});function _(E,C,L,S){var T=L?"":S.css;if(E.styleSheet)E.styleSheet.cssText=B(C,T);else{var M=document.createTextNode(T),O=E.childNodes;O[C]&&E.removeChild(O[C]),O.length?E.insertBefore(M,O[C]):E.appendChild(M)}}},function(t,o){t.exports=function(n){var i=typeof window<"u"&&window.location;if(!i)throw new Error("fixUrls requires window.location");if(!n||typeof n!="string")return n;var r=i.protocol+"//"+i.host,a=r+i.pathname.replace(/\/[^\/]*$/,"/");return n.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(c,l){var h,d=l.trim().replace(/^"(.*)"$/,function(p,g){return g}).replace(/^'(.*)'$/,function(p,g){return g});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(d)?c:(h=d.indexOf("//")===0?d:d.indexOf("/")===0?r+d:a+d.replace(/^\.\//,""),"url("+JSON.stringify(h)+")")})}},function(t,o,n){var i,r,a,c,l,h,d,p,g;t.exports=(i="cdx-notifies",r="cdx-notify",a="cdx-notify__cross",c="cdx-notify__button--confirm",l="cdx-notify__button--cancel",h="cdx-notify__input",d="cdx-notify__button",p="cdx-notify__btns-wrapper",{alert:g=function(f){var u=document.createElement("DIV"),m=document.createElement("DIV"),y=f.message,x=f.style;return u.classList.add(r),x&&u.classList.add(r+"--"+x),u.innerHTML=y,m.classList.add(a),m.addEventListener("click",u.remove.bind(u)),u.appendChild(m),u},confirm:function(f){var u=g(f),m=document.createElement("div"),y=document.createElement("button"),x=document.createElement("button"),b=u.querySelector("."+a),k=f.cancelHandler,v=f.okHandler;return m.classList.add(p),y.innerHTML=f.okText||"Confirm",x.innerHTML=f.cancelText||"Cancel",y.classList.add(d),x.classList.add(d),y.classList.add(c),x.classList.add(l),k&&typeof k=="function"&&(x.addEventListener("click",k),b.addEventListener("click",k)),v&&typeof v=="function"&&y.addEventListener("click",v),y.addEventListener("click",u.remove.bind(u)),x.addEventListener("click",u.remove.bind(u)),m.appendChild(y),m.appendChild(x),u.appendChild(m),u},prompt:function(f){var u=g(f),m=document.createElement("div"),y=document.createElement("button"),x=document.createElement("input"),b=u.querySelector("."+a),k=f.cancelHandler,v=f.okHandler;return m.classList.add(p),y.innerHTML=f.okText||"Ok",y.classList.add(d),y.classList.add(c),x.classList.add(h),f.placeholder&&x.setAttribute("placeholder",f.placeholder),f.default&&(x.value=f.default),f.inputType&&(x.type=f.inputType),k&&typeof k=="function"&&b.addEventListener("click",k),v&&typeof v=="function"&&y.addEventListener("click",function(){v(x.value)}),y.addEventListener("click",u.remove.bind(u)),m.appendChild(x),m.appendChild(y),u.appendChild(m),u},getWrapper:function(){var f=document.createElement("DIV");return f.classList.add(i),f}})}])})})(No);const Do=Re(Ve);class Po{show(e){Do.show(e)}}class Ho extends D{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.notifier=new Po}get methods(){return{show:e=>this.show(e)}}show(e){return this.notifier.show(e)}}class Fo extends D{get methods(){const e=()=>this.isEnabled;return{toggle:t=>this.toggle(t),get isEnabled(){return e()}}}toggle(e){return this.Editor.ReadOnly.toggle(e)}get isEnabled(){return this.Editor.ReadOnly.isEnabled}}var We={},jo={get exports(){return We},set exports(s){We=s}};(function(s,e){(function(t,o){s.exports=o()})(so,function(){function t(d){var p=d.tags,g=Object.keys(p),f=g.map(function(u){return typeof p[u]}).every(function(u){return u==="object"||u==="boolean"||u==="function"});if(!f)throw new Error("The configuration was invalid");this.config=d}var o=["P","LI","TD","TH","DIV","H1","H2","H3","H4","H5","H6","PRE"];function n(d){return o.indexOf(d.nodeName)!==-1}var i=["A","B","STRONG","I","EM","SUB","SUP","U","STRIKE"];function r(d){return i.indexOf(d.nodeName)!==-1}t.prototype.clean=function(d){const p=document.implementation.createHTMLDocument(),g=p.createElement("div");return g.innerHTML=d,this._sanitize(p,g),g.innerHTML},t.prototype._sanitize=function(d,p){var g=a(d,p),f=g.firstChild();if(f)do{if(f.nodeType===Node.TEXT_NODE)if(f.data.trim()===""&&(f.previousElementSibling&&n(f.previousElementSibling)||f.nextElementSibling&&n(f.nextElementSibling))){p.removeChild(f),this._sanitize(d,p);break}else continue;if(f.nodeType===Node.COMMENT_NODE){p.removeChild(f),this._sanitize(d,p);break}var u=r(f),m;u&&(m=Array.prototype.some.call(f.childNodes,n));var y=!!p.parentNode,x=n(p)&&n(f)&&y,b=f.nodeName.toLowerCase(),k=c(this.config,b,f),v=u&&m;if(v||l(f,k)||!this.config.keepNestedBlockElements&&x){if(!(f.nodeName==="SCRIPT"||f.nodeName==="STYLE"))for(;f.childNodes.length>0;)p.insertBefore(f.childNodes[0],f);p.removeChild(f),this._sanitize(d,p);break}for(var B=0;B<f.attributes.length;B+=1){var _=f.attributes[B];h(_,k,f)&&(f.removeAttribute(_.name),B=B-1)}this._sanitize(d,f)}while(f=g.nextSibling())};function a(d,p){return d.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null,!1)}function c(d,p,g){return typeof d.tags[p]=="function"?d.tags[p](g):d.tags[p]}function l(d,p){return typeof p>"u"?!0:typeof p=="boolean"?!p:!1}function h(d,p,g){var f=d.name.toLowerCase();return p===!0?!1:typeof p[f]=="function"?!p[f](d.value,g):typeof p[f]>"u"||p[f]===!1?!0:typeof p[f]=="string"?p[f]!==d.value:!1}return t})})(jo);const zo=We;function Pt(s,e){return s.map(t=>{const o=z(e)?e(t.tool):e;return ee(o)||(t.data=Je(t.data,o)),t})}function re(s,e={}){const t={tags:e};return new zo(t).clean(s)}function Je(s,e){return Array.isArray(s)?Uo(s,e):V(s)?$o(s,e):ce(s)?Vo(s,e):s}function Uo(s,e){return s.map(t=>Je(t,e))}function $o(s,e){const t={};for(const o in s){if(!Object.prototype.hasOwnProperty.call(s,o))continue;const n=s[o],i=Wo(e[o])?e[o]:e;t[o]=Je(n,i)}return t}function Vo(s,e){return V(e)?re(s,e):e===!1?re(s,{}):s}function Wo(s){return V(s)||ho(s)||z(s)}class Yo extends D{get methods(){return{clean:(e,t)=>this.clean(e,t)}}clean(e,t){return re(e,t)}}class qo extends D{get methods(){return{save:()=>this.save()}}save(){const e="Editor's content can not be saved in read-only mode";return this.Editor.ReadOnly.isEnabled?(J(e,"warn"),Promise.reject(new Error(e))):this.Editor.Saver.save()}}class Xo extends D{get methods(){return{findParentTag:(e,t)=>this.findParentTag(e,t),expandToTag:e=>this.expandToTag(e)}}findParentTag(e,t){return new A().findParentTag(e,t)}expandToTag(e){new A().expandToTag(e)}}class Ko extends D{get classes(){return{block:"cdx-block",inlineToolButton:"ce-inline-tool",inlineToolButtonActive:"ce-inline-tool--active",input:"cdx-input",loader:"cdx-loader",button:"cdx-button",settingsButton:"cdx-settings-button",settingsButtonActive:"cdx-settings-button--active"}}}class Zo extends D{get methods(){return{close:()=>this.close(),open:()=>this.open(),toggleBlockSettings:e=>this.toggleBlockSettings(e),toggleToolbox:e=>this.toggleToolbox(e)}}open(){this.Editor.Toolbar.moveAndOpen()}close(){this.Editor.Toolbar.close()}toggleBlockSettings(e){if(this.Editor.BlockManager.currentBlockIndex===-1){J("Could't toggle the Toolbar because there is no block selected ","warn");return}e??!this.Editor.BlockSettings.opened?(this.Editor.Toolbar.moveAndOpen(),this.Editor.BlockSettings.open()):this.Editor.BlockSettings.close()}toggleToolbox(e){if(this.Editor.BlockManager.currentBlockIndex===-1){J("Could't toggle the Toolbox because there is no block selected ","warn");return}e??!this.Editor.Toolbar.toolbox.opened?(this.Editor.Toolbar.moveAndOpen(),this.Editor.Toolbar.toolbox.open()):this.Editor.Toolbar.toolbox.close()}}var Ye={},Go={get exports(){return Ye},set exports(s){Ye=s}};/*! 20 * CodeX.Tooltips 21 * 22 * @version 1.0.5 23 * 24 * @licence MIT 25 * @author CodeX <https://codex.so> 26 * 27 * 28 */(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}([function(t,o,n){t.exports=n(1)},function(t,o,n){n.r(o),n.d(o,"default",function(){return i});class i{constructor(){this.nodes={wrapper:null,content:null},this.showed=!1,this.offsetTop=10,this.offsetLeft=10,this.offsetRight=10,this.hidingDelay=0,this.handleWindowScroll=()=>{this.showed&&this.hide(!0)},this.loadStyles(),this.prepare(),window.addEventListener("scroll",this.handleWindowScroll,{passive:!0})}get CSS(){return{tooltip:"ct",tooltipContent:"ct__content",tooltipShown:"ct--shown",placement:{left:"ct--left",bottom:"ct--bottom",right:"ct--right",top:"ct--top"}}}show(a,c,l){this.nodes.wrapper||this.prepare(),this.hidingTimeout&&clearTimeout(this.hidingTimeout);const h=Object.assign({placement:"bottom",marginTop:0,marginLeft:0,marginRight:0,marginBottom:0,delay:70,hidingDelay:0},l);if(h.hidingDelay&&(this.hidingDelay=h.hidingDelay),this.nodes.content.innerHTML="",typeof c=="string")this.nodes.content.appendChild(document.createTextNode(c));else{if(!(c instanceof Node))throw Error("[CodeX Tooltip] Wrong type of «content» passed. It should be an instance of Node or String. But "+typeof c+" given.");this.nodes.content.appendChild(c)}switch(this.nodes.wrapper.classList.remove(...Object.values(this.CSS.placement)),h.placement){case"top":this.placeTop(a,h);break;case"left":this.placeLeft(a,h);break;case"right":this.placeRight(a,h);break;case"bottom":default:this.placeBottom(a,h)}h&&h.delay?this.showingTimeout=setTimeout(()=>{this.nodes.wrapper.classList.add(this.CSS.tooltipShown),this.showed=!0},h.delay):(this.nodes.wrapper.classList.add(this.CSS.tooltipShown),this.showed=!0)}hide(a=!1){if(this.hidingDelay&&!a)return this.hidingTimeout&&clearTimeout(this.hidingTimeout),void(this.hidingTimeout=setTimeout(()=>{this.hide(!0)},this.hidingDelay));this.nodes.wrapper.classList.remove(this.CSS.tooltipShown),this.showed=!1,this.showingTimeout&&clearTimeout(this.showingTimeout)}onHover(a,c,l){a.addEventListener("mouseenter",()=>{this.show(a,c,l)}),a.addEventListener("mouseleave",()=>{this.hide()})}destroy(){this.nodes.wrapper.remove(),window.removeEventListener("scroll",this.handleWindowScroll)}prepare(){this.nodes.wrapper=this.make("div",this.CSS.tooltip),this.nodes.content=this.make("div",this.CSS.tooltipContent),this.append(this.nodes.wrapper,this.nodes.content),this.append(document.body,this.nodes.wrapper)}loadStyles(){const a="codex-tooltips-style";if(document.getElementById(a))return;const c=n(2),l=this.make("style",null,{textContent:c.toString(),id:a});this.prepend(document.head,l)}placeBottom(a,c){const l=a.getBoundingClientRect(),h=l.left+a.clientWidth/2-this.nodes.wrapper.offsetWidth/2,d=l.bottom+window.pageYOffset+this.offsetTop+c.marginTop;this.applyPlacement("bottom",h,d)}placeTop(a,c){const l=a.getBoundingClientRect(),h=l.left+a.clientWidth/2-this.nodes.wrapper.offsetWidth/2,d=l.top+window.pageYOffset-this.nodes.wrapper.clientHeight-this.offsetTop;this.applyPlacement("top",h,d)}placeLeft(a,c){const l=a.getBoundingClientRect(),h=l.left-this.nodes.wrapper.offsetWidth-this.offsetLeft-c.marginLeft,d=l.top+window.pageYOffset+a.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("left",h,d)}placeRight(a,c){const l=a.getBoundingClientRect(),h=l.right+this.offsetRight+c.marginRight,d=l.top+window.pageYOffset+a.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("right",h,d)}applyPlacement(a,c,l){this.nodes.wrapper.classList.add(this.CSS.placement[a]),this.nodes.wrapper.style.left=c+"px",this.nodes.wrapper.style.top=l+"px"}make(a,c=null,l={}){const h=document.createElement(a);Array.isArray(c)?h.classList.add(...c):c&&h.classList.add(c);for(const d in l)l.hasOwnProperty(d)&&(h[d]=l[d]);return h}append(a,c){Array.isArray(c)?c.forEach(l=>a.appendChild(l)):a.appendChild(c)}prepend(a,c){Array.isArray(c)?(c=c.reverse()).forEach(l=>a.prepend(l)):a.prepend(c)}}},function(t,o){t.exports=`.ct{z-index:999;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1),-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);will-change:opacity,top,left;-webkit-box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);border-radius:9px}.ct,.ct:before{position:absolute;top:0;left:0}.ct:before{content:"";bottom:0;right:0;background-color:#1d202b;z-index:-1;border-radius:4px}@supports(-webkit-mask-box-image:url("")){.ct:before{border-radius:0;-webkit-mask-box-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M10.71 0h2.58c3.02 0 4.64.42 6.1 1.2a8.18 8.18 0 013.4 3.4C23.6 6.07 24 7.7 24 10.71v2.58c0 3.02-.42 4.64-1.2 6.1a8.18 8.18 0 01-3.4 3.4c-1.47.8-3.1 1.21-6.11 1.21H10.7c-3.02 0-4.64-.42-6.1-1.2a8.18 8.18 0 01-3.4-3.4C.4 17.93 0 16.3 0 13.29V10.7c0-3.02.42-4.64 1.2-6.1a8.18 8.18 0 013.4-3.4C6.07.4 7.7 0 10.71 0z"/></svg>') 48% 41% 37.9% 53.3%}}@media (--mobile){.ct{display:none}}.ct__content{padding:6px 10px;color:#cdd1e0;font-size:12px;text-align:center;letter-spacing:.02em;line-height:1em}.ct:after{content:"";width:8px;height:8px;position:absolute;background-color:#1d202b;z-index:-1}.ct--bottom{-webkit-transform:translateY(5px);transform:translateY(5px)}.ct--bottom:after{top:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translateX(-50%) rotate(-45deg)}.ct--top{-webkit-transform:translateY(-5px);transform:translateY(-5px)}.ct--top:after{top:auto;bottom:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translateX(-50%) rotate(-45deg)}.ct--left{-webkit-transform:translateX(-5px);transform:translateX(-5px)}.ct--left:after{top:50%;left:auto;right:0;-webkit-transform:translate(41.6%,-50%) rotate(-45deg);transform:translate(41.6%,-50%) rotate(-45deg)}.ct--right{-webkit-transform:translateX(5px);transform:translateX(5px)}.ct--right:after{top:50%;left:0;-webkit-transform:translate(-41.6%,-50%) rotate(-45deg);transform:translate(-41.6%,-50%) rotate(-45deg)}.ct--shown{opacity:1;-webkit-transform:none;transform:none}`}]).default})})(Go);const Jo=Re(Ye);class Qe{constructor(){this.lib=new Jo}destroy(){this.lib.destroy()}show(e,t,o){this.lib.show(e,t,o)}hide(e=!1){this.lib.hide(e)}onHover(e,t,o){this.lib.onHover(e,t,o)}}class Qo extends D{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.tooltip=new Qe}destroy(){this.tooltip.destroy()}get methods(){return{show:(e,t,o)=>this.show(e,t,o),hide:()=>this.hide(),onHover:(e,t,o)=>this.onHover(e,t,o)}}show(e,t,o){this.tooltip.show(e,t,o)}hide(){this.tooltip.hide()}onHover(e,t,o){this.tooltip.onHover(e,t,o)}}class en extends D{get methods(){return{nodes:this.editorNodes}}get editorNodes(){return{wrapper:this.Editor.UI.nodes.wrapper,redactor:this.Editor.UI.nodes.redactor}}}function Ht(s,e){const t={};return Object.entries(s).forEach(([o,n])=>{if(V(n)){const i=e?`${e}.${o}`:o;Object.values(n).every(r=>ce(r))?t[o]=i:t[o]=Ht(n,i);return}t[o]=n}),t}const Q=Ht(_t);function tn(s,e){const t={};return Object.keys(s).forEach(o=>{const n=e[o];
28n!==void 0?t[n]=s[o]:t[o]=s[o]}),t}const on='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9 12L9 7.1C9 7.04477 9.04477 7 9.1 7H10.4C11.5 7 14 7.1 14 9.5C14 9.5 14 12 11 12M9 12V16.8C9 16.9105 9.08954 17 9.2 17H12.5C14 17 15 16 15 14.5C15 11.7046 11 12 11 12M9 12H11"/></svg>',Ft='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7 10L11.8586 14.8586C11.9367 14.9367 12.0633 14.9367 12.1414 14.8586L17 10"/></svg>',nn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7 15L11.8586 10.1414C11.9367 10.0633 12.0633 10.0633 12.1414 10.1414L17 15"/></svg>',rn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16"/></svg>',sn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2"/></svg>',an='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M13.34 10C12.4223 12.7337 11 17 11 17"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.21 7H14.2"/></svg>',ft='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.5691 6.39509 13.9269 6.25143 12.8271 7.17675L11.3901 8.38588C10.0935 9.47674 9.95706 11.4241 11.0888 12.6852L11.12 12.72"/></svg>',ln='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.40999 7.29999H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 7.29999H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.30999 12H9.3"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 12H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.40999 16.7H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 16.7H14.59"/></svg>',cn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 7V12M12 17V12M17 12H12M12 12H7"/></svg>',dn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="5.5" stroke="currentColor" stroke-width="2"/><line x1="15.4142" x2="19" y1="15" y2="18.5858" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>',hn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M15.7795 11.5C15.7795 11.5 16.053 11.1962 16.5497 10.6722C17.4442 9.72856 17.4701 8.2475 16.5781 7.30145V7.30145C15.6482 6.31522 14.0873 6.29227 13.1288 7.25073L11.8796 8.49999"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8.24517 12.3883C8.24517 12.3883 7.97171 12.6922 7.47504 13.2161C6.58051 14.1598 6.55467 15.6408 7.44666 16.5869V16.5869C8.37653 17.5731 9.93744 17.5961 10.8959 16.6376L12.1452 15.3883"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M17.7802 15.1032L16.597 14.9422C16.0109 14.8624 15.4841 15.3059 15.4627 15.89
2869L15.4199 17.0818"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6.39064 9.03238L7.58432 9.06668C8.17551 9.08366 8.6522 8.58665 8.61056 7.99669L8.5271 6.81397"/><line x1="12.1142" x2="11.7" y1="12.2" y2="11.7858" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>',un='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/><line x1="12" x2="12" y1="9" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 15.02V15.01"/></svg>';let gt=class U{constructor(e){this.nodes={root:null,icon:null},this.confirmationState=null,this.removeSpecialFocusBehavior=()=>{this.nodes.root.classList.remove(U.CSS.noFocus)},this.removeSpecialHoverBehavior=()=>{this.nodes.root.classList.remove(U.CSS.noHover)},this.onErrorAnimationEnd=()=>{this.nodes.icon.classList.remove(U.CSS.wobbleAnimation),this.nodes.icon.removeEventListener("animationend",this.onErrorAnimationEnd)},this.params=e,this.nodes.root=this.make(e)}get isDisabled(){return this.params.isDisabled}get toggle(){return this.params.toggle}get title(){return this.params.title}get closeOnActivate(){return this.params.closeOnActivate}get isConfirmationStateEnabled(){return this.confirmationState!==null}get isFocused(){return this.nodes.root.classList.contains(U.CSS.focused)}static get CSS(){return{container:"ce-popover-item",title:"ce-popover-item__title",secondaryTitle:"ce-popover-item__secondary-title",icon:"ce-popover-item__icon",active:"ce-popover-item--active",disabled:"ce-popover-item--disabled",focused:"ce-popover-item--focused",hidden:"ce-popover-item--hidden",confirmationState:"ce-popover-item--confirmation",noHover:"ce-popover-item--no-hover",noFocus:"ce-popover-item--no-focus",wobbleAnimation:"wobble"}}getElement(){return this.nodes.root}handleClick(){if(this.isConfirmationStateEnabled){this.activateOrEnableConfirmationMode(this.confirmationState);return}this.activateOrEnableConfirmationMode(this.params)}toggleActive(e){this.nodes.root.classList.toggle(U.CSS.active,e)}toggleHidden(e){this.nodes.root.classList.toggle(U.CSS.hidden,e)}reset(){this.isConfirmationStateEnabled&&this.disableConfirmationMode()}onFocus(){this.disableSpecialHoverAndFocusBehavior()}make(e){const t=w.make("div",U.CSS.container);return e.name&&(t.dataset.itemName=e.name),this.nodes.icon=w.make("div",U.CSS.icon,{innerHTML:e.icon||sn}),t.appendChild(this.nodes.icon),t.appendChild(w.make("div",U.CSS.title,{innerHTML:e.title||""})),e.secondaryLabel&&t.appendChild(w.make("div",U.CSS.secondaryTitle,{textContent:e.secondaryLabel})),e.isActive&&t.classList.add(U.CSS.active),e.isDisabled&&t.classList.add(U.CSS.disabled),t}enableConfirmationMode(e){const t={...this.params,...e,confirmation:e.confirmation},o=this.make(t);this.nodes.root.innerHTML=o.innerHTML,this.nodes.root.classList.add(U.CSS.confirmationState),this.confirmationState=e,this.enableSpecialHoverAndFocusBehavior()}disableConfirmationMode(){const e=this.make(this.params);this.nodes.root.innerHTML=e.innerHTML,this.nodes.root.classList.remove(U.CSS.confirmationState),this.confirmationState=null,this.disableSpecialHoverAndFocusBehavior()}enableSpecialHoverAndFocusBehavior(){this.nodes.root.classList.add(U.CSS.noHover),this.nodes.root.classList.add(U.CSS.noFocus),this.nodes.root.addEventListener("mouseleave",this.removeSpecialHoverBehavior,{once:!0})}disableSpecialHoverAndFocusBehavior(){this.removeSpecialFocusBehavior(),this.removeSpecialHoverBehavior(),this.nodes.root.removeEventListener("mouseleave",this.removeSpecialHoverBehavior)}activateOrEnableConfirmationMode(e){if(e.confirmation===void 0)try{e.onActivate(e),this.disableConfirmationMode()}catch{this.animateError()}else this.enableConfirmationMode(e.confirmation)}animateError(){this.nodes.icon.classList.contains(U.CSS.wobbleAnimation)||(this.nodes.icon.classList.add(U.CSS.wobbleAnimation),this.nodes.icon.addEventListener("animationend",this.onErrorAnimationEnd))}};const Se=class{constructor(s,e){this.cursor=-1,this.items=[],this.items=s||[],this.focusedCssClass=e}get currentItem(){return this.cursor===-1?null:this.items[this.cursor]}setCursor(s){s<this.items.length&&s>=-1&&(this.dropCursor(),this.cursor=s,this.items[this.cursor].classList.add(this.focusedCssClass))}setItems(s){this.items=s}next(){this.cursor=this.leafNodesAndReturnIndex(Se.directions.RIGHT)}previous(){this.cursor=this.leafNodesAndReturnIndex(Se.directions.LEFT)}dropCursor(){this.cursor!==-1&&(this.items[this.cursor].classList.remove(this.focusedCssClass),this.cursor=-1)}leafNodesAndReturnIndex(s){if(this.items.length===0)return this.cursor;let e=this.cursor;return e===-1?e=s===Se.directions.RIGHT?-1:0:this.items[e].classList.remove(this.focusedCssClass),s===Se.directions.RIGHT?e=(e+1)%this.items.length:e=(this.items.length+e-1)%this.items.length,w.canSetCaret(this.items[e])&&ke(()=>A.setCursor(this.items[e]),50)(),this.items[e].classList.add(this.focusedCssClass),e}};let me=Se;me.directions={RIGHT:"right",LEFT:"left"};class se{constructor(e){this.iterator=null,this.activated=!1,this.flipCallbacks=[],this.onKeyDown=t=>{if(this.isEventReadyForHandling(t))switch(se.usedKeys.includes(t.keyCode)&&t.preventDefault(),t.keyCode){case N.TAB:this.handleTabPress(t);break;case N.LEFT:case N.UP:this.flipLeft();break;case N.RIGHT:case N.DOWN:this.flipRight();break;case N.ENTER:this.handleEnterPress(t);break}},this.iterator=new me(e.items,e.focusedItemClass),this.activateCallback=e.activateCallback,this.allowedKeys=e.allowedKeys||se.usedKeys}get isActivated(){return this.activated}static get usedKeys(){return[N.TAB,N.LEFT,N.RIGHT,N.ENTER,N.UP,N.DOWN]}activate(e,t){this.activated=!0,e&&this.iterator.setItems(e),t!==void 0&&this.iterator.setCursor(t),document.addEventListener("keydown",this.onKeyDown,!0)}deactivate(){this.activated=!1,this.dropCursor(),document.removeEventListener("keydown",this.onKeyDown)}focusFirst(){this.dropCursor(),this.flipRight()}flipLeft(){this.iterator.previous(),this.flipCallback()}flipRight(){this.iterator.next(),this.flipCallback()}hasFocus(){return!!this.iterator.currentItem}onFlip(e){this.flipCallbacks.push(e)}removeOnFlip(e){this.flipCallbacks=this.flipCallbacks.filter(t=>t!==e)}dropCursor(){this.iterator.dropCursor()}isEventReadyForHandling(e){return this.activated&&this.allowedKeys.includes(e.ke
28yCode)}handleTabPress(e){switch(e.shiftKey?me.directions.LEFT:me.directions.RIGHT){case me.directions.RIGHT:this.flipRight();break;case me.directions.LEFT:this.flipLeft();break}}handleEnterPress(e){this.activated&&(this.iterator.currentItem&&(e.stopPropagation(),e.preventDefault(),this.iterator.currentItem.click()),z(this.activateCallback)&&this.activateCallback(this.iterator.currentItem))}flipCallback(){this.iterator.currentItem&&this.iterator.currentItem.scrollIntoViewIfNeeded(),this.flipCallbacks.forEach(e=>e())}}class Te{static get CSS(){return{wrapper:"cdx-search-field",icon:"cdx-search-field__icon",input:"cdx-search-field__input"}}constructor({items:e,onSearch:t,placeholder:o}){this.listeners=new Ze,this.items=e,this.onSearch=t,this.render(o)}getElement(){return this.wrapper}focus(){this.input.focus()}clear(){this.input.value="",this.searchQuery="",this.onSearch("",this.foundItems)}destroy(){this.listeners.removeAll()}render(e){this.wrapper=w.make("div",Te.CSS.wrapper);const t=w.make("div",Te.CSS.icon,{innerHTML:dn});this.input=w.make("input",Te.CSS.input,{placeholder:e}),this.wrapper.appendChild(t),this.wrapper.appendChild(this.input),this.listeners.on(this.input,"input",()=>{this.searchQuery=this.input.value,this.onSearch(this.searchQuery,this.foundItems)})}get foundItems(){return this.items.filter(e=>this.checkItem(e))}checkItem(e){var t;const o=((t=e.title)==null?void 0:t.toLowerCase())||"",n=this.searchQuery.toLowerCase();return o.includes(n)}}const Ee=class{lock(){ut?this.lockHard():document.body.classList.add(Ee.CSS.scrollLocked)}unlock(){ut?this.unlockHard():document.body.classList.remove(Ee.CSS.scrollLocked)}lockHard(){this.scrollPosition=window.pageYOffset,document.documentElement.style.setProperty("--window-scroll-offset",`${this.scrollPosition}px`),document.body.classList.add(Ee.CSS.scrollLockedHard)}unlockHard(){document.body.classList.remove(Ee.CSS.scrollLockedHard),this.scrollPosition!==null&&window.scrollTo(0,this.scrollPosition),this.scrollPosition=null}};let jt=Ee;jt.CSS={scrollLocked:"ce-scroll-locked",scrollLockedHard:"ce-scroll-locked--hard"};var pn=Object.defineProperty,fn=Object.getOwnPropertyDescriptor,gn=(s,e,t,o)=>{for(var n=o>1?void 0:o?fn(e,t):e,i=s.length-1,r;i>=0;i--)(r=s[i])&&(n=(o?r(e,t,n):r(n))||n);return o&&n&&pn(e,t,n),n},Me=(s=>(s.Close="close",s))(Me||{});const $=class extends Ne{constructor(e){super(),this.scopeElement=document.body,this.listeners=new Ze,this.scrollLocker=new jt,this.nodes={wrapper:null,popover:null,nothingFoundMessage:null,customContent:null,items:null,overlay:null},this.messages={nothingFound:"Nothing found",search:"Search"},this.onFlip=()=>{this.items.find(t=>t.isFocused).onFocus()},this.items=e.items.map(t=>new gt(t)),e.scopeElement!==void 0&&(this.scopeElement=e.scopeElement),e.messages&&(this.messages={...this.messages,...e.messages}),e.customContentFlippableItems&&(this.customContentFlippableItems=e.customContentFlippableItems),this.make(),e.customContent&&this.addCustomContent(e.customContent),e.searchable&&this.addSearch(),this.initializeFlipper()}static get CSS(){return{popover:"ce-popover",popoverOpenTop:"ce-popover--open-top",popoverOpened:"ce-popover--opened",search:"ce-popover__search",nothingFoundMessage:"ce-popover__nothing-found-message",nothingFoundMessageDisplayed:"ce-popover__nothing-found-message--displayed",customContent:"ce-popover__custom-content",customContentHidden:"ce-popover__custom-content--hidden",items:"ce-popover__items",overlay:"ce-popover__overlay",overlayHidden:"ce-popover__overlay--hidden"}}getElement(){return this.nodes.wrapper}hasFocus(){return this.flipper.hasFocus()}show(){this.shouldOpenBottom||(this.nodes.popover.style.setProperty("--popover-height",this.height+"px"),this.nodes.popover.classList.add($.CSS.popoverOpenTop)),this.nodes.overlay.classList.remove($.CSS.overlayHidden),this.nodes.popover.classList.add($.CSS.popoverOpened),this.flipper.activate(this.flippableElements),this.search!==void 0&&setTimeout(()=>{this.search.focus()},100),he()&&this.scrollLocker.lock()}hide(){this.nodes.popover.classList.remove($.CSS.popoverOpened),this.nodes.popover.classList.remove($.CSS.popoverOpenTop),this.nodes.overlay.classList.add($.CSS.overlayHidden
28),this.flipper.deactivate(),this.items.forEach(e=>e.reset()),this.search!==void 0&&this.search.clear(),he()&&this.scrollLocker.unlock(),this.emit("close")}destroy(){this.flipper.deactivate(),this.listeners.removeAll(),he()&&this.scrollLocker.unlock()}make(){this.nodes.popover=w.make("div",[$.CSS.popover]),this.nodes.nothingFoundMessage=w.make("div",[$.CSS.nothingFoundMessage],{textContent:this.messages.nothingFound}),this.nodes.popover.appendChild(this.nodes.nothingFoundMessage),this.nodes.items=w.make("div",[$.CSS.items]),this.items.forEach(e=>{this.nodes.items.appendChild(e.getElement())}),this.nodes.popover.appendChild(this.nodes.items),this.listeners.on(this.nodes.popover,"click",e=>{const t=this.getTargetItem(e);t!==void 0&&this.handleItemClick(t)}),this.nodes.wrapper=w.make("div"),this.nodes.overlay=w.make("div",[$.CSS.overlay,$.CSS.overlayHidden]),this.listeners.on(this.nodes.overlay,"click",()=>{this.hide()}),this.nodes.wrapper.appendChild(this.nodes.overlay),this.nodes.wrapper.appendChild(this.nodes.popover)}addSearch(){this.search=new Te({items:this.items,placeholder:this.messages.search,onSearch:(t,o)=>{this.items.forEach(i=>{const r=!o.includes(i);i.toggleHidden(r)}),this.toggleNothingFoundMessage(o.length===0),this.toggleCustomContent(t!=="");const n=t===""?this.flippableElements:o.map(i=>i.getElement());this.flipper.isActivated&&(this.flipper.deactivate(),this.flipper.activate(n))}});const e=this.search.getElement();e.classList.add($.CSS.search),this.nodes.popover.insertBefore(e,this.nodes.popover.firstChild)}addCustomContent(e){this.nodes.customContent=e,this.nodes.customContent.classList.add($.CSS.customContent),this.nodes.popover.insertBefore(e,this.nodes.popover.firstChild)}getTargetItem(e){return this.items.find(t=>e.composedPath().includes(t.getElement()))}handleItemClick(e){e.isDisabled||(this.items.filter(t=>t!==e).forEach(t=>t.reset()),e.handleClick(),this.toggleItemActivenessIfNeeded(e),e.closeOnActivate&&this.hide())}initializeFlipper(){this.flipper=new se({items:this.flippableElements,focusedItemClass:gt.CSS.focused,allowedKeys:[N.TAB,N.UP,N.DOWN,N.ENTER]}),this.flipper.onFlip(this.onFlip)}get flippableElements(){const e=this.items.map(t=>t.getElement());return(this.customContentFlippableItems||[]).concat(e)}get height(){let e=0;if(this.nodes.popover===null)return e;const t=this.nodes.popover.cloneNode(!0);return t.style.visibility="hidden",t.style.position="absolute",t.style.top="-1000px",t.classList.add($.CSS.popoverOpened),document.body.appendChild(t),e=t.offsetHeight,t.remove(),e}get shouldOpenBottom(){const e=this.nodes.popover.getBoundingClientRect(),t=this.scopeElement.getBoundingClientRect(),o=this.height,n=e.top+o,i=e.top-o,r=Math.min(window.innerHeight,t.bottom);return i<t.top||n<=r}toggleNothingFoundMessage(e){this.nodes.nothingFoundMessage.classList.toggle($.CSS.nothingFoundMessageDisplayed,e)}toggleCustomContent(e){var t;(t=this.nodes.customContent)==null||t.classList.toggle($.CSS.customContentHidden,e)}toggleItemActivenessIfNeeded(e){if(e.toggle===!0&&e.toggleActive(),typeof e.toggle=="string"){const t=this.items.filter(o=>o.toggle===e.toggle);if(t.length===1){e.toggleActive();return}t.forEach(o=>{o.toggleActive(o===e)})}}};let et=$;gn([xe],et.prototype,"height",1);class mn extends D{constructor(){super(...arguments),this.opened=!1,this.selection=new A,this.onPopoverClose=()=>{this.close()}}get events(){return{opened:"block-settings-opened",closed:"block-settings-closed"}}get CSS(){return{settings:"ce-settings"}}get flipper(){var e;return(e=this.popover)==null?void 0:e.flipper}make(){this.nodes.wrapper=w.make("div",[this.CSS.settings])}destroy(){this.removeAllNodes()}open(e=this.Editor.BlockManager.currentBlock){this.opened=!0,this.selection.save(),e.selected=!0,this.Editor.BlockSelection.clearCache();const[t,o]=e.getTunes();this.eventsDispatcher.emit(this.events.opened),this.popover=new et({searchable:!0,items:t.map(n=>this.resolveTuneAliases(n)),customContent:o,customContentFlippableItems:this.getControls(o),scopeElement:this.Editor.API.methods.ui.nodes.redactor,messages:{nothingFound:q.ui(Q.ui.popover,"Nothing found"),search:q.ui(Q.ui.popover,"Filter")}}),this.popover.on(Me.Close,this.onPopoverClose),this.nodes.wrapper.append(this.popover.getElement()),this.popover.show()}getElement(){return this.nodes.wrapper}
28close(){this.opened=!1,A.isAtEditor||this.selection.restore(),this.selection.clearSaved(),!this.Editor.CrossBlockSelection.isCrossBlockSelectionStarted&&this.Editor.BlockManager.currentBlock&&(this.Editor.BlockManager.currentBlock.selected=!1),this.eventsDispatcher.emit(this.events.closed),this.popover&&(this.popover.off(Me.Close,this.onPopoverClose),this.popover.destroy(),this.popover.getElement().remove(),this.popover=null)}getControls(e){const{StylesAPI:t}=this.Editor,o=e.querySelectorAll(`.${t.classes.settingsButton}, ${w.allInputsSelector}`);return Array.from(o)}resolveTuneAliases(e){const t=tn(e,{label:"title"});return e.confirmation&&(t.confirmation=this.resolveTuneAliases(e.confirmation)),t}}class X extends D{constructor(){super(...arguments),this.opened=!1,this.tools=[],this.flipper=null,this.togglingCallback=null}static get CSS(){return{conversionToolbarWrapper:"ce-conversion-toolbar",conversionToolbarShowed:"ce-conversion-toolbar--showed",conversionToolbarTools:"ce-conversion-toolbar__tools",conversionToolbarLabel:"ce-conversion-toolbar__label",conversionTool:"ce-conversion-tool",conversionToolHidden:"ce-conversion-tool--hidden",conversionToolIcon:"ce-conversion-tool__icon",conversionToolSecondaryLabel:"ce-conversion-tool__secondary-label",conversionToolFocused:"ce-conversion-tool--focused",conversionToolActive:"ce-conversion-tool--active"}}make(){this.nodes.wrapper=w.make("div",[X.CSS.conversionToolbarWrapper,...this.isRtl?[this.Editor.UI.CSS.editorRtlFix]:[]]),this.nodes.tools=w.make("div",X.CSS.conversionToolbarTools);const e=w.make("div",X.CSS.conversionToolbarLabel,{textContent:q.ui(Q.ui.inlineToolbar.converter,"Convert to")});return this.addTools(),this.enableFlipper(),w.append(this.nodes.wrapper,e),w.append(this.nodes.wrapper,this.nodes.tools),this.nodes.wrapper}destroy(){this.flipper&&(this.flipper.deactivate(),this.flipper=null),this.removeAllNodes()}toggle(e){this.opened?this.close():this.open(),z(e)&&(this.togglingCallback=e)}open(){this.filterTools(),this.opened=!0,this.nodes.wrapper.classList.add(X.CSS.conversionToolbarShowed),window.requestAnimationFrame(()=>{this.flipper.activate(this.tools.map(e=>e.button).filter(e=>!e.classList.contains(X.CSS.conversionToolHidden))),this.flipper.focusFirst(),z(this.togglingCallback)&&this.togglingCallback(!0)})}close(){this.opened=!1,this.flipper.deactivate(),this.nodes.wrapper.classList.remove(X.CSS.conversionToolbarShowed),z(this.togglingCallback)&&this.togglingCallback(!1)}hasTools(){return this.tools.length===1?this.tools[0].name!==this.config.defaultBlock:!0}async replaceWithBlock(e,t){const{BlockManager:o,BlockSelection:n,InlineToolbar:i,Caret:r}=this.Editor;o.convert(this.Editor.BlockManager.currentBlock,e,t),n.clearSelection(),this.close(),i.close(),window.requestAnimationFrame(()=>{r.setToBlock(this.Editor.BlockManager.currentBlock,r.positions.END)})}addTools(){const e=this.Editor.Tools.blockTools;Array.from(e.entries()).forEach(([t,o])=>{var n;const i=o.conversionConfig;!i||!i.import||(n=o.toolbox)==null||n.forEach(r=>this.addToolIfValid(t,r))})}addToolIfValid(e,t){ee(t)||!t.icon||this.addTool(e,t)}addTool(e,t){var o;const n=w.make("div",[X.CSS.conversionTool]),i=w.make("div",[X.CSS.conversionToolIcon]);n.dataset.tool=e,i.innerHTML=t.icon,w.append(n,i),w.append(n,w.text(q.t(Q.toolNames,t.title||we(e))));const r=(o=this.Editor.Tools.blockTools.get(e))==null?void 0:o.shortcut;if(r){const a=w.make("span",X.CSS.conversionToolSecondaryLabel,{innerText:Ke(r)});w.append(n,a)}w.append(this.nodes.tools,n),this.tools.push({name:e,button:n,toolboxItem:t}),this.listeners.on(n,"click",async()=>{await this.replaceWithBlock(e,t.data)})}async filterTools(){const{currentBlock:e}=this.Editor.BlockManager,t=await e.getActiveToolboxEntry();function o(n,i){return n.icon===i.icon&&n.title===i.title}this.tools.forEach(n=>{let i=!1;if(t){const r=o(t,n.toolboxItem);i=n.button.dataset.tool===e.name&&r}n.button.hidden=i,n.button.classList.toggle(X.CSS.conversionToolHidden,i)})}enableFlipper(){this.flipper=new se({focusedItemClass:X.CSS.conversionToolFocused})}}var qe={},bn={get exports(){return qe},set exports(s){qe=s}};/*! 29 * Library for handling keyboard shortcuts 30 * @copyright CodeX (https://codex.so) 31 * @license MIT 32 * @author CodeX (https://codex.so) 33 * @version 1.2.0 34 */(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};
vendor: 4,660 bytes, line 34
34return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}([function(t,o,n){function i(c,l){for(var h=0;h<l.length;h++){var d=l[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}function r(c,l,h){return l&&i(c.prototype,l),h&&i(c,h),c}n.r(o);var a=function(){function c(l){var h=this;(function(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")})(this,c),this.commands={},this.keys={},this.name=l.name,this.parseShortcutName(l.name),this.element=l.on,this.callback=l.callback,this.executeShortcut=function(d){h.execute(d)},this.element.addEventListener("keydown",this.executeShortcut,!1)}return r(c,null,[{key:"supportedCommands",get:function(){return{SHIFT:["SHIFT"],CMD:["CMD","CONTROL","COMMAND","WINDOWS","CTRL"],ALT:["ALT","OPTION"]}}},{key:"keyCodes",get:function(){return{0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,BACKSPACE:8,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,".":190}}}]),r(c,[{key:"parseShortcutName",value:function(l){l=l.split("+");for(var h=0;h<l.length;h++){l[h]=l[h].toUpperCase();var d=!1;for(var p in c.supportedCommands)if(c.supportedCommands[p].includes(l[h])){d=this.commands[p]=!0;break}d||(this.keys[l[h]]=!0)}for(var g in c.supportedCommands)this.commands[g]||(this.commands[g]=!1)}},{key:"execute",value:function(l){var h,d={CMD:l.ctrlKey||l.metaKey,SHIFT:l.shiftKey,ALT:l.altKey},p=!0;for(h in this.commands)this.commands[h]!==d[h]&&(p=!1);var g,f=!0;for(g in this.keys)f=f&&l.keyCode===c.keyCodes[g];p&&f&&this.callback(l)}},{key:"remove",value:function(){this.element.removeEventListener("keydown",this.executeShortcut)}}]),c}();o.default=a}]).default})})(bn);const vn=Re(qe);class kn{constructor(){this.registeredShortcuts=new Map}add(e){if(this.findShortcut(e.on,e.name))throw Error(`Shortcut ${e.name} is already registered for ${e.on}. Please remove it before add a new handler.`);const t=new vn({name:e.name,on:e.on,callback:e.handler}),o=this.registeredShortcuts.get(e.on)||[];this.registeredShortcuts.set(e.on,[...o,t])}remove(e,t){const o=this.findShortcut(e,t);if(!o)return;o.remove();const n=this.registeredShortcuts.get(e);this.registeredShortcuts.set(e,n.filter(i=>i!==o))}findShortcut(e,t){return(this.registeredShortcuts.get(e)||[]).find(({name:o})=>o===t)}}const ye=new kn;var wn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,zt=(s,e,t,o)=>{for(var n=o>1?void 0:o?yn(e,t):e,i=s.length-1,r;i>=0;i--)(r=s[i])&&(n=(o?r(e,t,n):r(n))||n);return o&&n&&wn(e,t,n),n},Ie=(s=>(s.Opened="toolbox-opened",s.Closed="toolbox-closed",s.BlockAdded="toolbox-block-added",s))(Ie||{});const Ut=class extends Ne{constructor({api:s,tools:e,i18nLabels:t}){super(),this.opened=!1,this.nodes={toolbox:null},this.onPopoverClose=()=>{this.opened=!1,this.emit("toolbox-closed")},this.api=s,this.tools=e,this.i18nLabels=t}get isEmpty(){return this.toolsToBeDisplayed.length===0}static get CSS(){return{toolbox:"ce-toolbox"}}make(){return this.popover=new et({scopeElement:this.api.ui.nodes.redactor,searchable:!0,messages:{nothingFound:this.i18nLabels.nothingFound,search:this.i18nLabels.filter},items:this.toolboxItemsToBeDisplayed}),this.popover.on(Me.Close,this.onPopoverClose),this.enableShortcuts(),this.nodes.toolbox=this.popover.getElement(),this.nodes.toolbox.classList.add(Ut.CSS.toolbox),this.nodes.toolbox}hasFocus(){var s;return(s=this.popover)==null?void 0:s.hasFocus()}destroy(){var s;super.destroy(),this.nodes&&this.nodes.toolbox&&(this.nodes.toolbox.remove(),this.nodes.toolbox=null),this.removeAllShortcuts(),(s=this.popover)==null||s.off(Me.Close,this.onPopoverClose)}toolButtonActivated(s,e){this.insertNewBlock(s,e)}open(){var s;this.isEmpty||((s=this.popover)==null||s.show(),this.opened=!0,this.emit
34("toolbox-opened"))}close(){var s;(s=this.popover)==null||s.hide(),this.opened=!1,this.emit("toolbox-closed")}toggle(){this.opened?this.close():this.open()}get toolsToBeDisplayed(){const s=[];return this.tools.forEach(e=>{e.toolbox&&s.push(e)}),s}get toolboxItemsToBeDisplayed(){const s=(e,t)=>({icon:e.icon,title:q.t(Q.toolNames,e.title||we(t.name)),name:t.name,onActivate:()=>{this.toolButtonActivated(t.name,e.data)},secondaryLabel:t.shortcut?Ke(t.shortcut):""});return this.toolsToBeDisplayed.reduce((e,t)=>(Array.isArray(t.toolbox)?t.toolbox.forEach(o=>{e.push(s(o,t))}):t.toolbox!==void 0&&e.push(s(t.toolbox,t)),e),[])}enableShortcuts(){this.toolsToBeDisplayed.forEach(s=>{const e=s.shortcut;e&&this.enableShortcutForTool(s.name,e)})}enableShortcutForTool(s,e){ye.add({name:e,on:this.api.ui.nodes.redactor,handler:t=>{t.preventDefault();const o=this.api.blocks.getCurrentBlockIndex(),n=this.api.blocks.getBlockByIndex(o);if(n)try{this.api.blocks.convert(n.id,s),window.requestAnimationFrame(()=>{this.api.caret.setToBlock(o,"end")});return}catch{}this.insertNewBlock(s)}})}removeAllShortcuts(){this.toolsToBeDisplayed.forEach(s=>{const e=s.shortcut;e&&ye.remove(this.api.ui.nodes.redactor,e)})}async insertNewBlock(s,e){const t=this.api.blocks.getCurrentBlockIndex(),o=this.api.blocks.getBlockByIndex(t);if(!o)return;const n=o.isEmpty?t:t+1;let i;if(e){const a=await this.api.blocks.composeBlockData(s);i=Object.assign(a,e)}const r=this.api.blocks.insert(s,i,void 0,n,void 0,o.isEmpty);r.call(ne.APPEND_CALLBACK),this.api.caret.setToBlock(n),this.emit("toolbox-block-added",{block:r}),this.api.toolbar.close()}};let tt=Ut;zt([xe],tt.prototype,"toolsToBeDisplayed",1);zt([xe],tt.prototype,"toolboxItemsToBeDisplayed",1);const $t="block hovered";class xn extends D{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.toolboxInstance=null,this.tooltip=new Qe}get CSS(){return{toolbar:"ce-toolbar",content:"ce-toolbar__content",actions:"ce-toolbar__actions",actionsOpened:"ce-toolbar__actions--opened",toolbarOpened:"ce-toolbar--opened",openedToolboxHolderModifier:"codex-editor--toolbox-opened",plusButton:"ce-toolbar__plus",plusButtonShortcut:"ce-toolbar__plus-shortcut",settingsToggler:"ce-toolbar__settings-btn",settingsTogglerHidden:"ce-toolbar__settings-btn--hidden"}}get opened(){return this.nodes.wrapper.classList.contains(this.CSS.toolbarOpened)}get toolbox(){var e;return{opened:(e=this.toolboxInstance)==null?void 0:e.opened,close:()=>{var t;(t=this.toolboxInstance)==null||t.close()},open:()=>{if(this.toolboxInstance===null){H("toolbox.open() called before initialization is finished","warn");return}this.Editor.BlockManager.currentBlock=this.hoveredBlock,this.toolboxInstance.open()},toggle:()=>{if(this.toolboxInstance===null){H("toolbox.toggle() called before initialization is finished","warn");return}this.toolboxInstance.toggle()},hasFocus:()=>{var t;return(t=this.toolboxInstance)==null?void 0:t.hasFocus()}}}get blockActions(){return{hide:()=>{this.nodes.actions.classList.remove(this.CSS.actionsOpened)},show:()=>{this.nodes.actions.classList.add(this.CSS.actionsOpened)}}}get blockTunesToggler(){return{hide:()=>this.nodes.settingsToggler.classList.add(this.CSS.settingsTogglerHidden),show:()=>this.nodes.settingsToggler.classList.remove(this.CSS.settingsTogglerHidden)}}toggleReadOnly(e){e?(this.destroy(),this.Editor.BlockSettings.destroy(),this.disableModuleBindings()):window.requestIdleCallback(()=>{this.drawUI(),this.enableModuleBindings()},{timeout:2e3})}moveAndOpen(e=this.Editor.BlockManager.currentBlock){if(this.toolboxInstance===null){H("Can't open Toolbar since Editor initialization is not finished yet","warn");return}if(this.toolboxInstance.opened&&this.toolboxInstance.close(),this.Editor.BlockSettings.opened&&this.Editor.BlockSettings.close(),!e)return;this.hoveredBlock=e;const t=e.holder,{isMobile:o}=this.Editor.UI,n=e.pluginsContent,i=window.getComputedStyle(n),r=parseInt(i.paddingTop,10),a=t.offsetHeight;let c;o?c=t.offsetTop+a:c=t.offsetTop+r,this.nodes.wrapper.style.top=`${Math.floor(c)}px`,this.Editor.BlockManager.blocks.length===1&&e.isEmpty?this.blockTunesToggler.hide():this.blockTunesToggler.show(),this.open()}close(){var e;this.Editor.ReadOnly.isEnabled||(this.nodes.wrapper.classList.remove(this.CSS.toolbarOpened),this.blockActions.hide(),(e=this.toolboxInstance)==null||e.close(),this.Editor.BlockSettings.close())}open(e=!0){ke(()=>{this.nodes.wrapper.classList.add(this.CSS.toolbarOpened),e?this.blockActions.show():this.blockActions.hide()},50)()}make(){this.nodes.wrapper=w.make("div",this.CSS.toolbar),["content","actions"].forEach(t=>{this.nodes[t]=w.make("div",this.CSS[t])}),w.append(this.nodes.wrapper,this.nodes.content),w.append(this.nodes.content,this.nodes.actions),this.nodes.plusButton=w.make("div",this.CSS.plusButton,{innerHTML:cn}),w.append(this.nodes.actions,this.nodes.plusButton),this.readOnlyMutableListeners.on(this.nodes.plusButton,"click",()=>{this.tooltip.hide(!0),this.plusButtonClicked()},!1);const e=w.make("div");e.appendChild(document.createTextNode(q.ui(Q.ui.toolbar.toolbox,"Add"))),e.appendChild(w.make("div",this.CSS.plusButtonShortcut,{textContent:"⥠Tab"})),this.tooltip.onHover(this.nodes.plusButton,e,{hidingDelay:400}),this.nodes.settingsToggler=w.make("span",this.CSS.settingsToggler,{innerHTML:ln}),w.append(this.nodes.actions,this.nodes.settingsToggler),this.tooltip.onHover(this.nodes.settingsToggler,q.ui(Q.ui.blockTunes.toggler,"Click to tune"),{hidingDelay:400}),w.append(this.nodes.actions,this.makeToolbox()),w.append(this.nodes.actions,this.Editor.BlockSettings.getElement()),w.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper)}makeToolbox(){return this.toolboxInstance=new tt({api:this.Editor.API.methods,tools:this.Editor.Tools.blockTools,i18nLabels:{filter:q.ui(Q.ui.popover,"Filter"),nothingFound:q.ui(Q.ui.popover,"Nothing found")}}),this.toolboxInstance.on(Ie.Opened,()=>{this.Editor.UI.nodes.wrapper.classList.add(this.CSS.openedToolboxHolderModifier)}),this.toolboxInstance.on(Ie.Closed,()=>{this.Editor.UI.nodes.wrapper.classList.remove(this.CSS.openedToolboxHolderModifier)}),this.toolboxInstance.on(Ie.BlockAdded,({block:e})=>{const{BlockManager:t,Caret:o}=this.Editor,n=t.getBlockById(e.id);n.inputs.length===0&&(n===t.lastBlock?(t.insertAtEnd(),o.setToBlock(t.lastBlock)):o.setToBlock(t.nextBlock))}),this.toolboxInstance.make()}plusButtonClicked(){var e;this.Editor.BlockManager.currentBlock=this.hoveredBlock,(e=this.toolboxInstance)==null||e.toggle(
34)}enableModuleBindings(){this.readOnlyMutableListeners.on(this.nodes.settingsToggler,"mousedown",e=>{var t;e.stopPropagation(),this.settingsTogglerClicked(),(t=this.toolboxInstance)!=null&&t.opened&&this.toolboxInstance.close(),this.tooltip.hide(!0)},!0),he()||this.eventsDispatcher.on($t,e=>{var t;this.Editor.BlockSettings.opened||(t=this.toolboxInstance)!=null&&t.opened||this.moveAndOpen(e.block)})}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}settingsTogglerClicked(){this.Editor.BlockManager.currentBlock=this.hoveredBlock,this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.BlockSettings.open(this.hoveredBlock)}drawUI(){this.Editor.BlockSettings.make(),this.make()}destroy(){this.removeAllNodes(),this.toolboxInstance&&this.toolboxInstance.destroy(),this.tooltip.destroy()}}var De=(s=>(s[s.Block=0]="Block",s[s.Inline=1]="Inline",s[s.Tune=2]="Tune",s))(De||{}),_e=(s=>(s.Shortcut="shortcut",s.Toolbox="toolbox",s.EnabledInlineTools="inlineToolbar",s.EnabledBlockTunes="tunes",s.Config="config",s))(_e||{}),Vt=(s=>(s.Shortcut="shortcut",s.SanitizeConfig="sanitize",s))(Vt||{}),be=(s=>(s.IsEnabledLineBreaks="enableLineBreaks",s.Toolbox="toolbox",s.ConversionConfig="conversionConfig",s.IsReadOnlySupported="isReadOnlySupported",s.PasteConfig="pasteConfig",s))(be||{}),ot=(s=>(s.IsInline="isInline",s.Title="title",s))(ot||{}),Wt=(s=>(s.IsTune="isTune",s))(Wt||{});class nt{constructor({name:e,constructable:t,config:o,api:n,isDefault:i,isInternal:r=!1,defaultPlaceholder:a}){this.api=n,this.name=e,this.constructable=t,this.config=o,this.isDefault=i,this.isInternal=r,this.defaultPlaceholder=a}get settings(){const e=this.config.config||{};return this.isDefault&&!("placeholder"in e)&&this.defaultPlaceholder&&(e.placeholder=this.defaultPlaceholder),e}reset(){if(z(this.constructable.reset))return this.constructable.reset()}prepare(){if(z(this.constructable.prepare))return this.constructable.prepare({toolName:this.name,config:this.settings})}get shortcut(){const e=this.constructable.shortcut;return this.config.shortcut||e}get sanitizeConfig(){return this.constructable.sanitize||{}}isInline(){return this.type===1}isBlock(){return this.type===0}isTune(){return this.type===2}}class Cn extends D{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.CSS={inlineToolbar:"ce-inline-toolbar",inlineToolbarShowed:"ce-inline-toolbar--showed",inlineToolbarLeftOriented:"ce-inline-toolbar--left-oriented",inlineToolbarRightOriented:"ce-inline-toolbar--right-oriented",inlineToolbarShortcut:"ce-inline-toolbar__shortcut",buttonsWrapper:"ce-inline-toolbar__buttons",actionsWrapper:"ce-inline-toolbar__actions",inlineToolButton:"ce-inline-tool",inputField:"cdx-input",focusedButton:"ce-inline-tool--focused",conversionToggler:"ce-inline-toolbar__dropdown",conversionTogglerArrow:"ce-inline-toolbar__dropdown-arrow",conversionTogglerHidden:"ce-inline-toolbar__dropdown--hidden",conversionTogglerContent:"ce-inline-toolbar__dropdown-content",togglerAndButtonsWrapper:"ce-inline-toolbar__toggler-and-button-wrapper"},this.opened=!1,this.toolbarVerticalMargin=he()?20:6,this.buttonsList=null,this.width=0,this.flipper=null,this.tooltip=new Qe}toggleReadOnly(e){e?(this.destroy(),this.Editor.ConversionToolbar.destroy()):window.requestIdleCallback(()=>{this.make()},{timeout:2e3})}tryToShow(e=!1,t=!0){if(!this.allowedToShow()){e&&this.close();return}this.move(),this.open(t),this.Editor.Toolbar.close()}move(){const e=A.rect,t=this.Editor.UI.nodes.wrapper.getBoundingClientRect(),o={x:e.x-t.left,y:e.y+e.height-t.top+this.toolbarVerticalMargin};e.width&&(o.x+=Math.floor(e.width/2));const n=o.x-this.width/2,i=o.x+this.width/2;this.nodes.wrapper.classList.toggle(this.CSS.inlineToolbarLeftOriented,n<this.Editor.UI.contentRect.left),this.nodes.wrapper.classList.toggle(this.CSS.inlineToolbarRightOriented,i>this.Editor.UI.contentRect.right),this.nodes.wrapper.style.left=Math.floor(o.x)+"px",this.nodes.wrapper.style.top=Math.floor(o.y)+"px"}close(){this.opened&&(this.Editor.ReadOnly.isEnabled||(this.nodes.wrapper.classList.remove(this.CSS.inl
34ineToolbarShowed),Array.from(this.toolsInstances.entries()).forEach(([e,t])=>{const o=this.getToolShortcut(e);o&&ye.remove(this.Editor.UI.nodes.redactor,o),z(t.clear)&&t.clear()}),this.opened=!1,this.flipper.deactivate(),this.Editor.ConversionToolbar.close()))}open(e=!0){if(this.opened)return;this.addToolsFiltered(),this.nodes.wrapper.classList.add(this.CSS.inlineToolbarShowed),this.buttonsList=this.nodes.buttons.querySelectorAll(`.${this.CSS.inlineToolButton}`),this.opened=!0,e&&this.Editor.ConversionToolbar.hasTools()?this.setConversionTogglerContent():this.nodes.conversionToggler.hidden=!0;let t=Array.from(this.buttonsList);t.unshift(this.nodes.conversionToggler),t=t.filter(o=>!o.hidden),this.flipper.activate(t)}containsNode(e){return this.nodes.wrapper.contains(e)}destroy(){this.flipper&&(this.flipper.deactivate(),this.flipper=null),this.removeAllNodes(),this.tooltip.destroy()}make(){this.nodes.wrapper=w.make("div",[this.CSS.inlineToolbar,...this.isRtl?[this.Editor.UI.CSS.editorRtlFix]:[]]),this.nodes.togglerAndButtonsWrapper=w.make("div",this.CSS.togglerAndButtonsWrapper),this.nodes.buttons=w.make("div",this.CSS.buttonsWrapper),this.nodes.actions=w.make("div",this.CSS.actionsWrapper),this.listeners.on(this.nodes.wrapper,"mousedown",e=>{e.target.closest(`.${this.CSS.actionsWrapper}`)||e.preventDefault()}),w.append(this.nodes.wrapper,[this.nodes.togglerAndButtonsWrapper,this.nodes.actions]),w.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper),this.addConversionToggler(),w.append(this.nodes.togglerAndButtonsWrapper,this.nodes.buttons),this.prepareConversionToolbar(),window.requestAnimationFrame(()=>{this.recalculateWidth()}),this.enableFlipper()}allowedToShow(){const e=["IMG","INPUT"],t=A.get(),o=A.text;if(!t||!t.anchorNode||t.isCollapsed||o.length<1)return!1;const n=w.isElement(t.anchorNode)?t.anchorNode:t.anchorNode.parentElement;if(t&&e.includes(n.tagName)||n.closest('[contenteditable="true"]')===null)return!1;const i=this.Editor.BlockManager.getBlock(t.anchorNode);return i?i.tool.inlineTools.size!==0:!1}recalculateWidth(){this.width=this.nodes.wrapper.offsetWidth}addConversionToggler(){this.nodes.conversionToggler=w.make("div",this.CSS.conversionToggler),this.nodes.conversionTogglerContent=w.make("div",this.CSS.conversionTogglerContent);const e=w.make("div",this.CSS.conversionTogglerArrow,{innerHTML:Ft});this.nodes.conversionToggler.appendChild(this.nodes.conversionTogglerContent),this.nodes.conversionToggler.appendChild(e),this.nodes.togglerAndButtonsWrapper.appendChild(this.nodes.conversionToggler),this.listeners.on(this.nodes.conversionToggler,"click",()=>{this.Editor.ConversionToolbar.toggle(t=>{!t&&this.opened?this.flipper.activate():this.opened&&this.flipper.deactivate()})}),he()===!1&&this.tooltip.onHover(this.nodes.conversionToggler,q.ui(Q.ui.inlineToolbar.converter,"Convert to"),{placement:"top",hidingDelay:100})}async setConversionTogglerContent(){const{BlockManager:e}=this.Editor,{currentBlock:t}=e,o=t.name,n=t.tool.conversionConfig,i=n&&n.export;this.nodes.conversionToggler.hidden=!i,this.nodes.conversionToggler.classList.toggle(this.CSS.conversionTogglerHidden,!i);const r=await t.getActiveToolboxEntry()||{};this.nodes.conversionTogglerContent.innerHTML=r.icon||r.title||we(o)}prepareConversionToolbar(){const e=this.Editor.ConversionToolbar.make();w.append(this.nodes.wrapper,e)}addToolsFiltered(){const e=A.get(),t=this.Editor.BlockManager.getBlock(e.anchorNode);this.nodes.buttons.innerHTML="",this.nodes.actions.innerHTML="",this.toolsInstances=new Map,Array.from(t.tool.inlineTools.values()).forEach(o=>{this.addTool(o)}),this.recalculateWidth()}addTool(e){const t=e.create(),o=t.render();if(!o){H("Render method must return an instance of Node","warn",e.name);return}if(o.dataset.tool=e.name,this.nodes.buttons.appendChild(o),this.toolsInstances.set(e.name,t),z(t.renderActions)){const a=t.renderActions();this.nodes.actions.appendChild(a)}this.listeners.on(o,"click",a=>{this.toolClicked(t),a.preventDefault()});const n=this.getToolShortcut(e.name);if(n)try{this.enableShortcuts(t,n)}catch{}const i=w.make("div"),r=q.t(Q.toolNames,e.title||we(e.name));i.appendChild(w.text(r)),n&&i.appendChild(w.make("div",this.CSS.inl
34ineToolbarShortcut,{textContent:Ke(n)})),he()===!1&&this.tooltip.onHover(o,i,{placement:"top",hidingDelay:100}),t.checkState(A.get())}getToolShortcut(e){const{Tools:t}=this.Editor,o=t.inlineTools.get(e),n=t.internal.inlineTools;return Array.from(n.keys()).includes(e)?this.inlineTools[e][Vt.Shortcut]:o.shortcut}enableShortcuts(e,t){ye.add({name:t,handler:o=>{const{currentBlock:n}=this.Editor.BlockManager;n&&n.tool.enabledInlineTools&&(o.preventDefault(),this.toolClicked(e))},on:this.Editor.UI.nodes.redactor})}toolClicked(e){const t=A.range;e.surround(t),this.checkToolsState(),e.renderActions!==void 0&&this.flipper.deactivate()}checkToolsState(){this.toolsInstances.forEach(e=>{e.checkState(A.get())})}get inlineTools(){const e={};return Array.from(this.Editor.Tools.inlineTools.entries()).forEach(([t,o])=>{e[t]=o.create()}),e}enableFlipper(){this.flipper=new se({focusedItemClass:this.CSS.focusedButton,allowedKeys:[N.ENTER,N.TAB]})}}class Sn extends D{keydown(e){switch(this.beforeKeydownProcessing(e),e.keyCode){case N.BACKSPACE:this.backspace(e);break;case N.DELETE:this.delete(e);break;case N.ENTER:this.enter(e);break;case N.DOWN:case N.RIGHT:this.arrowRightAndDown(e);break;case N.UP:case N.LEFT:this.arrowLeftAndUp(e);break;case N.TAB:this.tabPressed(e);break}}beforeKeydownProcessing(e){this.needToolbarClosing(e)&&Mt(e.keyCode)&&(this.Editor.Toolbar.close(),this.Editor.ConversionToolbar.close(),e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||(this.Editor.BlockManager.clearFocused(),this.Editor.BlockSelection.clearSelection(e)))}keyup(e){e.shiftKey||this.Editor.UI.checkEmptiness()}tabPressed(e){this.Editor.BlockSelection.clearSelection(e);const{BlockManager:t,InlineToolbar:o,ConversionToolbar:n}=this.Editor,i=t.currentBlock;if(!i)return;const r=i.isEmpty,a=i.tool.isDefault&&r,c=!r&&n.opened,l=!r&&!A.isCollapsed&&o.opened;a?this.activateToolbox():!c&&!l&&this.activateBlockSettings()}dragOver(e){const t=this.Editor.BlockManager.getBlockByChildNode(e.target);t.dropTarget=!0}dragLeave(e){const t=this.Editor.BlockManager.getBlockByChildNode(e.target);t.dropTarget=!1}handleCommandC(e){const{BlockSelection:t}=this.Editor;t.anyBlockSelected&&t.copySelectedBlocks(e)}
34handleCommandX(e){const{BlockSelection:t,BlockManager:o,Caret:n}=this.Editor;t.anyBlockSelected&&t.copySelectedBlocks(e).then(()=>{const i=o.removeSelectedBlocks(),r=o.insertDefaultBlockAtIndex(i,!0);n.setToBlock(r,n.positions.START),t.clearSelection(e)})}enter(e){const{BlockManager:t,UI:o}=this.Editor;if(t.currentBlock.tool.isLineBreaksEnabled||o.someToolbarOpened&&o.someFlipperButtonFocused||e.shiftKey)return;let n=this.Editor.BlockManager.currentBlock;this.Editor.Caret.isAtStart&&!this.Editor.BlockManager.currentBlock.hasMedia?this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex):this.Editor.Caret.isAtEnd?n=this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex+1):n=this.Editor.BlockManager.split(),this.Editor.Caret.setToBlock(n),this.Editor.Toolbar.moveAndOpen(n),e.preventDefault()}backspace(e){const{BlockManager:t,Caret:o}=this.Editor,{currentBlock:n,previousBlock:i}=t;if(!(!A.isCollapsed||!o.isAtStart)){if(e.preventDefault(),this.Editor.Toolbar.close(),n.currentInput!==n.firstInput){o.navigatePrevious();return}if(i!==null){if(i.isEmpty){t.removeBlock(i);return}if(n.isEmpty){t.removeBlock(n);const r=t.currentBlock;o.setToBlock(r,o.positions.END);return}pt(n,i)?this.mergeBlocks(i,n):o.setToBlock(i,o.positions.END)}}}delete(e){const{BlockManager:t,Caret:o}=this.Editor,{currentBlock:n,nextBlock:i}=t;if(!(!A.isCollapsed||!o.isAtEnd)){if(e.preventDefault(),this.Editor.Toolbar.close(),n.currentInput!==n.lastInput){o.navigateNext();return}if(i!==null){if(i.isEmpty){t.removeBlock(i);return}if(n.isEmpty){t.removeBlock(n),o.setToBlock(i,o.positions.START);return}pt(n,i)?this.mergeBlocks(n,i):o.setToBlock(i,o.positions.START)}}}
34mergeBlocks(e,t){const{BlockManager:o,Caret:n,Toolbar:i}=this.Editor;n.createShadow(e.pluginsContent),o.mergeBlocks(e,t).then(()=>{window.requestAnimationFrame(()=>{n.restoreCaret(e.pluginsContent),e.pluginsContent.normalize(),i.close()})})}arrowRightAndDown(e){const t=se.usedKeys.includes(e.keyCode)&&(!e.shiftKey||e.keyCode===N.TAB);if(this.Editor.UI.someToolbarOpened&&t)return;this.Editor.BlockManager.clearFocused(),this.Editor.Toolbar.close();const o=this.Editor.Caret.isAtEnd||this.Editor.BlockSelection.anyBlockSelected;if(e.shiftKey&&e.keyCode===N.DOWN&&o){this.Editor.CrossBlockSelection.toggleBlockSelectedState();return}(e.keyCode===N.DOWN||e.keyCode===N.RIGHT&&!this.isRtl?this.Editor.Caret.navigateNext():this.Editor.Caret.navigatePrevious())?e.preventDefault():ke(()=>{this.Editor.BlockManager.currentBlock&&this.Editor.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Editor.BlockSelection.clearSelection(e)}arrowLeftAndUp(e){if(this.Editor.UI.someToolbarOpened){if(se.usedKeys.includes(e.keyCode)&&(!e.shiftKey||e.keyCode===N.TAB))return;this.Editor.UI.closeAllToolbars()}this.Editor.BlockManager.clearFocused(),this.Editor.Toolbar.close();const t=this.Editor.Caret.isAtStart||this.Editor.BlockSelection.anyBlockSelected;if(e.shiftKey&&e.keyCode===N.UP&&t){this.Editor.CrossBlockSelection.toggleBlockSelectedState(!1);return}(e.keyCode===N.UP||e.keyCode===N.LEFT&&!this.isRtl?this.Editor.Caret.navigatePrevious():this.Editor.Caret.navigateNext())?e.preventDefault():ke(()=>{this.Editor.BlockManager.currentBlock&&this.Editor.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Editor.BlockSelection.clearSelection(e)}needToolbarClosing(e){const t=e.keyCode===N.ENTER&&this.Editor.Toolbar.toolbox.opened,o=e.keyCode===N.ENTER&&this.Editor.BlockSettings.opened,n=e.keyCode===N.ENTER&&this.Editor.InlineToolbar.opened,i=e.keyCode===N.ENTER&&this.Editor.ConversionToolbar.opened,r=e.keyCode===N.TAB;return!(e.shiftKey||r||t||o||n||i)}activateToolbox(){this.Editor.Toolbar.opened||this.Editor.Toolbar.moveAndOpen(),this.Editor.Toolbar.toolbox.open()}activateBlockSettings(){this.Editor.Toolbar.opened||(this.Editor.BlockManager.currentBlock.focused=!0,this.Editor.Toolbar.moveAndOpen()),this.Editor.BlockSettings.opened||this.Editor.BlockSettings.open()}}class He{constructor(e){this.blocks=[],this.workingArea=e}get length(){return this.blocks.length}get array(){return this.blocks}get nodes(){return Lt(this.workingArea.children)}static set(e,t,o){return isNaN(Number(t))?(Reflect.set(e,t,o),!0):(e.insert(+t,o),!0)}static get(e,t){return isNaN(Number(t))?Reflect.get(e,t):e.get(+t)}push(e){this.blocks.push(e),this.insertToDOM(e)}swap(e,t){const o=this.blocks[t];w.swap(this.blocks[e].holder,o.holder),this.blocks[t]=this.blocks[e],this.blocks[e]=o}move(e,t){const o=this.blocks.splice(t,1)[0],n=e-1,i=Math.max(0,n),r=this.blocks[i];e>0?this.insertToDOM(o,"afterend",r):this.insertToDOM(o,"beforebegin",r),this.blocks.splice(e,0,o);const a=this.composeBlockEvent("move",{fromIndex:t,toIndex:e});o.call(ne.MOVED,a)}insert(e,t,o=!1){if(!this.length){this.push(t);return}e>this.length&&(e=this.length),o&&(this.blocks[e].holder.remove(),this.blocks[e].call(ne.REMOVED));const n=o?1:0;if(this.blocks.splice(e,n,t),e>0){const i=this.blocks[e-1];this.insertToDOM(t,"afterend",i)}else{const i=this.blocks[e+1];i?this.insertToDOM(t,"beforebegin",i):this.insertToDOM(t)}}replace(e,t){if(this.blocks[e]===void 0)throw Error("Incorrect index");this.blocks[e].holder.replaceWith(t.holder),this.blocks[e]=t}insertMany(e,t){const o=new DocumentFragment;for(const n of e)o.appendChild(n.holder);if(this.length>0){if(t>0){const n=Math.min(t-1,this.length-1);this.blocks[n].holder.after(o)}else t===0&&this.workingArea.prepend(o);this.blocks.splice(t,0,...e)}else this.blocks.push(...e),this.workingArea.appendChild(o);e.forEach(n=>n.call(ne.RENDERED))}remove(e){isNaN(e)&&(e=this.length-1),this.blocks[e].holder.remove(),this.blocks[e].call(ne.REMOVED),this.blocks.splice(e,1)}removeAll(){this.workingArea.innerHTML="",this.blocks.forEach(e=>e.call(ne.REMOVED)),this.blocks.length=0}insertAfter(e,t){const o=this.blocks.indexOf(e);this.insert(o+1,t)}get(e){return this.blocks[e]}indexOf(e){return this.blocks.indexOf(e)}insertToDOM(e,t,o){t?o.holder.insertAdjacentElement(t,e.holder):this.workingArea.appendChild(e.holder),e.call(ne.RENDERED)}composeBlockEvent(e,t){return new CustomEvent(e,{detail:t})}}const mt="block-removed",bt="block-added",En="block-moved",vt="block-changed";
vendor: 4,153 bytes, line 34
34class Tn{constructor(){this.completed=Promise.resolve()}add(e){return new Promise((t,o)=>{this.completed=this.completed.then(e).then(t).catch(o)})}}class Bn extends D{constructor(){super(...arguments),this._currentBlockIndex=-1,this._blocks=null}get currentBlockIndex(){return this._currentBlockIndex}set currentBlockIndex(e){this._currentBlockIndex=e}get firstBlock(){return this._blocks[0]}get lastBlock(){return this._blocks[this._blocks.length-1]}get currentBlock(){return this._blocks[this.currentBlockIndex]}set currentBlock(e){this.currentBlockIndex=this.getBlockIndex(e)}get nextBlock(){return this.currentBlockIndex===this._blocks.length-1?null:this._blocks[this.currentBlockIndex+1]}get nextContentfulBlock(){return this.blocks.slice(this.currentBlockIndex+1).find(e=>!!e.inputs.length)}get previousContentfulBlock(){return this.blocks.slice(0,this.currentBlockIndex).reverse().find(e=>!!e.inputs.length)}get previousBlock(){return this.currentBlockIndex===0?null:this._blocks[this.currentBlockIndex-1]}get blocks(){return this._blocks.array}get isEditorEmpty(){return this.blocks.every(e=>e.isEmpty)}prepare(){const e=new He(this.Editor.UI.nodes.redactor);this._blocks=new Proxy(e,{set:He.set,get:He.get}),this.listeners.on(document,"copy",t=>this.Editor.BlockEvents.handleCommandC(t))}toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}composeBlock({tool:e,data:t={},id:o=void 0,tunes:n={}}){const i=this.Editor.ReadOnly.isEnabled,r=this.Editor.Tools.blockTools.get(e),a=new ie({id:o,data:t,tool:r,api:this.Editor.API,readOnly:i,tunesData:n},this.eventsDispatcher);return i||window.requestIdleCallback(()=>{this.bindBlockEvents(a)},{timeout:2e3}),a}insert({id:e=void 0,tool:t=this.config.defaultBlock,data:o={},index:n,needToFocus:i=!0,replace:r=!1,tunes:a={}}={}){let c=n;c===void 0&&(c=this.currentBlockIndex+(r?0:1));const l=this.composeBlock({id:e,tool:t,data:o,tunes:a});return r&&this.blockDidMutated(mt,this.getBlockByIndex(c),{index:c}),this._blocks.insert(c,l,r),this.blockDidMutated(bt,l,{index:c}),i?this.currentBlockIndex=c:c<=this.currentBlockIndex&&this.currentBlockIndex++,l}insertMany(e,t=0){this._blocks.insertMany(e,t)}async update(e,t){const o=await e.data,n=this.composeBlock({id:e.id,tool:e.name,data:Object.assign({},o,t),tunes:e.tunes}),i=this.getBlockIndex(e);return this._blocks.replace(i,n),this.blockDidMutated(vt,n,{index:i}),n}replace(e,t,o){const n=this.getBlockIndex(e);this.insert({tool:t,data:o,index:n,replace:!0})}paste(e,t,o=!1){const n=this.insert({tool:e,replace:o});try{window.requestIdleCallback(()=>{n.call(ne.ON_PASTE,t)})}catch(i){H(`${e}: onPaste callback call is failed`,"error",i)}return n}insertDefaultBlockAtIndex(e,t=!1){const o=this.composeBlock({tool:this.config.defaultBlock});return this._blocks[e]=o,this.blockDidMutated(bt,o,{index:e}),t?this.currentBlockIndex=e:e<=this.currentBlockIndex&&this.currentBlockIndex++,o}insertAtEnd(){return this.currentBlockIndex=this.blocks.length-1,this.insert()}async mergeBlocks(e,t){const o=await t.data;ee(o)||await e.mergeWith(o),this.removeBlock(t),this.currentBlockIndex=this._blocks.indexOf(e)}removeBlock(e,t=!0){return new Promise(o=>{const n=this._blocks.indexOf(e);if(!this.validateIndex(n))throw new Error("Can't find a Block to remove");e.destroy(),this._blocks.remove(n),this.blockDidMutated(mt,e,{index:n}),this.currentBlockIndex>=n&&this.currentBlockIndex--,this.blocks.length?n===0&&(this.currentBlockIndex=0):(this.currentBlockIndex=-1,t&&this.insert()),o()})}removeSelectedBlocks(){let e;for(let t=this.blocks.length-1;t>=0;t--)this.blocks[t].selected&&(this.removeBlock(this.blocks[t]),e=t);return e}removeAllBlocks(){for(let e=this.blocks.length-1;e>=0;e--)this._blocks.remove(e);this.currentBlockIndex=-1,this.insert(),this.currentBlock.firstInput.focus()}split(){const e=this.Editor.Caret.extractFragmentFromCaretPosition(),t=w.make("div");t.appendChild(e);const o={text:w.isEmpty(t)?"":t.innerHTML};return this.insert({data:o})}getBlockByIndex(e){return e===-1&&(e=this._blocks.length-1),this._blocks[e]}getBlockIndex(e){return this._blocks.indexOf(e)}getBlockById(e){return this._blocks.array.find(t=>
34t.id===e)}getBlock(e){w.isElement(e)||(e=e.parentNode);const t=this._blocks.nodes,o=e.closest(`.${ie.CSS.wrapper}`),n=t.indexOf(o);if(n>=0)return this._blocks[n]}highlightCurrentNode(){this.clearFocused(),this.currentBlock.focused=!0}clearFocused(){this.blocks.forEach(e=>{e.focused=!1})}setCurrentBlockByChildNode(e){w.isElement(e)||(e=e.parentNode);const t=e.closest(`.${ie.CSS.wrapper}`);if(!t)return;const o=t.closest(`.${this.Editor.UI.CSS.editorWrapper}`);if(o!=null&&o.isEqualNode(this.Editor.UI.nodes.wrapper))return this.currentBlockIndex=this._blocks.nodes.indexOf(t),this.currentBlock.updateCurrentInput(),this.currentBlock}getBlockByChildNode(e){w.isElement(e)||(e=e.parentNode);const t=e.closest(`.${ie.CSS.wrapper}`);return this.blocks.find(o=>o.holder===t)}swap(e,t){this._blocks.swap(e,t),this.currentBlockIndex=t}move(e,t=this.currentBlockIndex){if(isNaN(e)||isNaN(t)){H("Warning during 'move' call: incorrect indices provided.","warn");return}if(!this.validateIndex(e)||!this.validateIndex(t)){H("Warning during 'move' call: indices cannot be lower than 0 or greater than the amount of blocks.","warn");return}this._blocks.move(e,t),this.currentBlockIndex=e,this.blockDidMutated(En,this.currentBlock,{fromIndex:t,toIndex:e})}async convert(e,t,o){if(!await e.save())throw new Error("Could not convert Block. Failed to extract original Block data.");const n=this.Editor.Tools.blockTools.get(t);if(!n)throw new Error(`Could not convert Block. Tool «${t}» not found.`);const i=await e.exportDataAsString(),r=re(i,n.sanitizeConfig);let a=Mo(r,n.conversionConfig);o&&(a=Object.assign(a,o)),this.replace(e,n.name,a)}dropPointer(){this.currentBlockIndex=-1,this.clearFocused()}async clear(e=!1){const t=new Tn;this.blocks.forEach(o=>{t.add(async()=>{await this.removeBlock(o,!1)})}),await t.completed,this.dropPointer(),e&&this.insert(),this.Editor.UI.checkEmptiness()}async destroy(){await Promise.all(this.blocks.map(e=>e.destroy()))}bindBlockEvents(e){const{BlockEvents:t}=this.Editor;this.readOnlyMutableListeners.on(e.holder,"keydown",o=>{t.keydown(o)}),this.readOnlyMutableListeners.on(e.holder,"keyup",o=>{t.keyup(o)}),this.readOnlyMutableListeners.on(e.holder,"dragover",o=>{t.dragOver(o)}),this.readOnlyMutableListeners.on(e.holder,"dragleave",o=>{t.dragLeave(o)}),e.on("didMutated",o=>this.blockDidMutated(vt,o,{index:this.getBlockIndex(o)}))}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}enableModuleBindings(){this.readOnlyMutableListeners.on(document,"cut",e=>this.Editor.BlockEvents.handleCommandX(e)),this.blocks.forEach(e=>{this.bindBlockEvents(e)})}validateIndex(e){return!(e<0||e>=this._blocks.length)}blockDidMutated(e,t,o){const n=new CustomEvent(e,{detail:{target:new de(t),...o}});return this.eventsDispatcher.emit(Rt,{event:n}),t}}class Mn extends D{constructor(){super(...arguments),this.anyBlockSelectedCache=null,this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1}get sanitizerConfig(){return{p:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},ol:{},ul:{},li:{},br:!0,img:{src:!0,width:!0,height:!0},a:{href:!0},b:{},i:{},u:{}}}get allBlocksSelected(){const{BlockManager:e}=this.Editor;return e.blocks.every(t=>t.selected===!0)}set allBlocksSelected(e){const{BlockManager:t}=this.Editor;t.blocks.forEach(o=>{o.selected=e}),this.clearCache()}get anyBlockSelected(){const{BlockManager:e}=this.Editor;return this.anyBlockSelectedCache===null&&(this.anyBlockSelectedCache=e.blocks.some(t=>t.selected===!0)),this.anyBlockSelectedCache}get selectedBlocks(){return this.Editor.BlockManager.blocks.filter(e=>e.selected)}prepare(){this.selection=new A,ye.add({name:"CMD+A",handler:e=>{const{BlockManager:t,ReadOnly:o}=this.Editor;if(o.isEnabled){e.preventDefault(),this.selectAllBlocks();return}t.currentBlock&&this.handleCommandA(e)},on:this.Editor.UI.nodes.redactor})}toggleReadOnly(){A.get().removeAllRanges(),this.allBlocksSelected=!1}unSelectBlockByIndex(e){const{BlockManager:t}=this.Editor;let o;isNaN(e)?o=t.currentBlock:o=t.getBlockByIndex(e),o.selected=!1,this.clearCache()}
34clearSelection(e,t=!1){const{BlockManager:o,Caret:n,RectangleSelection:i}=this.Editor;this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1;const r=e&&e instanceof KeyboardEvent,a=r&&Mt(e.keyCode);if(this.anyBlockSelected&&r&&a&&!A.isSelectionExists){const c=o.removeSelectedBlocks();o.insertDefaultBlockAtIndex(c,!0),n.setToBlock(o.currentBlock),ke(()=>{const l=e.key;n.insertContentAtCaretPosition(l.length>1?"":l)},20)()}if(this.Editor.CrossBlockSelection.clear(e),!this.anyBlockSelected||i.isRectActivated()){this.Editor.RectangleSelection.clearSelection();return}t&&this.selection.restore(),this.allBlocksSelected=!1}copySelectedBlocks(e){e.preventDefault();const t=w.make("div");this.selectedBlocks.forEach(i=>{const r=re(i.holder.innerHTML,this.sanitizerConfig),a=w.make("p");a.innerHTML=r,t.appendChild(a)});const o=Array.from(t.childNodes).map(i=>i.textContent).join(` 35 36`),n=t.innerHTML;return e.clipboardData.setData("text/plain",o),e.clipboardData.setData("text/html",n),Promise.all(this.selectedBlocks.map(i=>i.save())).then(i=>{try{e.clipboardData.setData(this.Editor.Paste.MIME_TYPE,JSON.stringify(i))}catch{}})}selectBlockByIndex(e){const{BlockManager:t}=this.Editor;t.clearFocused();let o;isNaN(e)?o=t.currentBlock:o=t.getBlockByIndex(e),this.selection.save(),A.get().removeAllRanges(),o.selected=!0,this.clearCache(),this.Editor.InlineToolbar.close()}clearCache(){this.anyBlockSelectedCache=null}destroy(){ye.remove(this.Editor.UI.nodes.redactor,"CMD+A")}handleCommandA(e){if(this.Editor.RectangleSelection.clearSelection(),w.isNativeInput(e.target)&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}const t=this.Editor.BlockManager.getBlock(e.target).inputs;if(t.length>1&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}if(t.length===1&&!this.needToSelectAll){this.needToSelectAll=!0;return}this.needToSelectAll?(e.preventDefault(),this.selectAllBlocks(),this.needToSelectAll=!1,this.readyToBlockSelection=!1,this.Editor.ConversionToolbar.close()):this.readyToBlockSelection&&(e.preventDefault(),this.selectBlockByIndex(),this.needToSelectAll=!0)}selectAllBlocks(){this.selection.save(),A.get().removeAllRanges(),this.allBlocksSelected=!0,this.Editor.InlineToolbar.close()}}class Oe extends D{get positions(){return{START:"start",END:"end",DEFAULT:"default"}}static get CSS(){return{shadowCaret:"cdx-shadow-caret"}}get isAtStart(){const e=A.get(),t=w.getDeepestNode(this.Editor.BlockManager.currentBlock.currentInput);let o=e.focusNode;if(w.isNativeInput(t))return t.selectionEnd===0;if(!e.anchorNode)return!1;let n=o.textContent.search(/\S/);n===-1&&(n=0);let i=e.focusOffset;return o.nodeType!==Node.TEXT_NODE&&o.childNodes.length&&(o.childNodes[i]?(o=o.childNodes[i],i=0):(o=o.childNodes[i-1],i=o.textContent.length)),(w.isLineBreakTag(t)||w.isEmpty(t))&&this.getHigherLevelSiblings(o,"left").every(r=>{const a=w.isLineBreakTag(r),c=r.children.length===1&&w.isLineBreakTag(r.children[0]),l=a||c;return w.isEmpty(r)&&!l})&&i===n?!0:t===null||o===t&&i<=n}get isAtEnd(){const e=A.get();let t=e.focusNode;const o=w.getDeepestNode(this.Editor.BlockManager.currentBlock.currentInput,!0);if(w.isNativeInput(o))return o.selectionEnd===o.value.length;if(!e.focusNode)return!1;let n=e.focusOffset;if(t.nodeType!==Node.TEXT_NODE&&t.childNodes.length&&(t.childNodes[n-1]?(t=t.childNodes[n-1],n=t.textContent.length):(t=t.childNodes[0],n=0)),w.isLineBreakTag(o)||w.isEmpty(o)){const r=this.getHigherLevelSiblings(t,"right");if(r.every((a,c)=>c===r.length-1&&w.isLineBreakTag(a)||w.isEmpty(a)&&!w.isLineBreakTag(a))&&n===t.textContent.length)return!0}const i=o.textContent.replace(/\s+$/,"");return t===o&&n>=i.length}setToBlock(e,t=this.positions.DEFAULT,o=0){const{BlockManager:n}=this.Editor;let i;switch(t){case this.positions.START:i=e.firstInput;break;case this.positions.END:i=e.lastInput;break;default:i=e.currentInput}if(!i)return;const r=w.getDeepestNode(i,t===this.positions.END),a=w.getContentLength(r);switch(!0){case t===this.positions.START:o=0;break;case t===this.positions.END:case o>a:o=a;break}ke(()=>{this.set(r,o)},20)(),n.setCurrentBlockByChildNode(e.holder),n.currentBlock.currentInput=i}setToInput(e,t=this.positions.DEFAULT,o=0){const{currentBlock:n}=this.Editor.BlockManager,i=w.getDeepestNode(e);switch(t){case this.positions.START:this.set(i,0);break;case this.positions.END:this.set(i,w.getContentLength(i));break;default:o&&this.set(i,o)}n.currentInput=e}set(e,t=0){const{top:o,bottom:n}=A.setCursor(e,t),{innerHeight:i}=window;o<0&&window.scrollBy(0,o),n>i&&window.scrollBy(0,n-i)}setToTheLastBlock(){const e=this.Editor.BlockManager.lastBlock;if(e)if(e.tool.isDefault&&e.isEmpty)this.setToBlock(e);else{const t=this.Editor.BlockManager.insertAtEnd();this.setToBlock(t)}}extractFragmentFromCaretPosition(){const e=A.get();if(e.rangeCount){const t=e.getRangeAt(0),o=this.Editor.BlockManager.currentBlock.currentInput;if(t.deleteContents(),o)if(w.isNativeInput(o)){const n=o,i=document.createDocumentFragment(),r=n.value.substring(0,n.selectionStart),a=n.value.substring(n.selectionStart);return i.textContent=a,n.value=r,i}else{const n=t.cloneRange();return n.selectNodeContents(o),n.setStart(t.endContainer,t.endOffset),n.extractContents()}}}navigateNext(){const{BlockManager:e}=this.Editor,{currentBlock:t,nextContentfulBlock:o}=e,{nextInput:n}=t,i=this.isAtEnd;let r=o;if(!r&&!n){if(t.tool.isDefault||!i)return!1;r=e.insertAtEnd()}return i?(n?this.setToInput(n,this.positions.START):this.setToBlock(r,this.positions.START),!0):!1}navigatePrevious(){const{currentBlock:e,previousContentfulBlock:t}=this.Editor.BlockManager;if(!e)return!1;const{previousInput:o}=e;return!t&&!o?!1:this.isAtStart?(o?this.setToInput(o,this.positions.END):this.setToBlock(t,this.positions.END),!0):!1}createShadow(e){const t=document.createElement("span");t.classList.add(Oe.CSS.shadowCaret),e.insertAdjacentElement("beforeend",t)}restoreCaret(e){const t=e.querySelector(`.${Oe.CSS.shadowCaret}`);if(!t)return;new A().expandToTag(t);const o=document.createRange();o.selectNode(t),o.extractContents()}insertContentAtCaretPosition(e){const t=document.createDocumentFragment(),o=document.createElement("div"),n=A.get(),i=A.range;
36o.innerHTML=e,Array.from(o.childNodes).forEach(l=>t.appendChild(l)),t.childNodes.length===0&&t.appendChild(new Text);const r=t.lastChild;i.deleteContents(),i.insertNode(t);const a=document.createRange(),c=r.nodeType===Node.TEXT_NODE?r:r.firstChild;c!==null&&c.textContent!==null&&a.setStart(c,c.textContent.length),n.removeAllRanges(),n.addRange(a)}getHigherLevelSiblings(e,t){let o=e;const n=[];for(;o.parentNode&&o.parentNode.contentEditable!=="true";)o=o.parentNode;const i=t==="left"?"previousSibling":"nextSibling";for(;o[i];)o=o[i],n.push(o);return n}}class Ln extends D{constructor(){super(...arguments),this.onMouseUp=()=>{this.listeners.off(document,"mouseover",this.onMouseOver),this.listeners.off(document,"mouseup",this.onMouseUp)},this.onMouseOver=e=>{const{BlockManager:t,BlockSelection:o}=this.Editor,n=t.getBlockByChildNode(e.relatedTarget)||this.lastSelectedBlock,i=t.getBlockByChildNode(e.target);if(!(!n||!i)&&i!==n){if(n===this.firstSelectedBlock){A.get().removeAllRanges(),n.selected=!0,i.selected=!0,o.clearCache();return}if(i===this.firstSelectedBlock){n.selected=!1,i.selected=!1,o.clearCache();return}this.Editor.InlineToolbar.close(),this.toggleBlocksSelectedState(n,i),this.lastSelectedBlock=i}}}async prepare(){this.listeners.on(document,"mousedown",e=>{this.enableCrossBlockSelection(e)})}watchSelection(e){if(e.button!==lo.LEFT)return;const{BlockManager:t}=this.Editor;this.firstSelectedBlock=t.getBlock(e.target),this.lastSelectedBlock=this.firstSelectedBlock,this.listeners.on(document,"mouseover",this.onMouseOver),this.listeners.on(document,"mouseup",this.onMouseUp)}get isCrossBlockSelectionStarted(){return!!this.firstSelectedBlock&&!!this.lastSelectedBlock}toggleBlockSelectedState(e=!0){const{BlockManager:t,BlockSelection:o}=this.Editor;this.lastSelectedBlock||(this.lastSelectedBlock=this.firstSelectedBlock=t.currentBlock),this.firstSelectedBlock===this.lastSelectedBlock&&(this.firstSelectedBlock.selected=!0,o.clearCache(),A.get().removeAllRanges());const n=t.blocks.indexOf(this.lastSelectedBlock)+(e?1:-1),i=t.blocks[n];i&&(this.lastSelectedBlock.selected!==i.selected?(i.selected=!0,o.clearCache()):(this.lastSelectedBlock.selected=!1,o.clearCache()),this.lastSelectedBlock=i,this.Editor.InlineToolbar.close(),i.holder.scrollIntoView({block:"nearest"}))}clear(e){const{BlockManager:t,BlockSelection:o,Caret:n}=this.Editor,i=t.blocks.indexOf(this.firstSelectedBlock),r=t.blocks.indexOf(this.lastSelectedBlock);if(o.anyBlockSelected&&i>-1&&r>-1)if(e&&e instanceof KeyboardEvent)switch(e.keyCode){case N.DOWN:case N.RIGHT:n.setToBlock(t.blocks[Math.max(i,r)],n.positions.END);break;case N.UP:case N.LEFT:n.setToBlock(t.blocks[Math.min(i,r)],n.positions.START);break;default:n.setToBlock(t.blocks[Math.max(i,r)],n.positions.END)}else n.setToBlock(t.blocks[Math.max(i,r)],n.positions.END);this.firstSelectedBlock=this.lastSelectedBlock=null}enableCrossBlockSelection(e){const{UI:t}=this.Editor;A.isCollapsed||this.Editor.BlockSelection.clearSelection(e),t.nodes.redactor.contains(e.target)?this.watchSelection(e):this.Editor.BlockSelection.clearSelection(e)}toggleBlocksSelectedState(e,t){const{BlockManager:o,BlockSelection:n}=this.Editor,i=o.blocks.indexOf(e),r=o.blocks.indexOf(t),a=e.selected!==t.selected;for(let c=Math.min(i,r);c<=Math.max(i,r);c++){const l=o.blocks[c];l!==this.firstSelectedBlock&&l!==(a?e:t)&&(o.blocks[c].selected=!o.blocks[c].selected,n.clearCache())}}}class In extends D{constructor(){super(...arguments),this.isStartedAtEditor=!1}toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}enableModuleBindings(){const{UI:e}=this.Editor;this.readOnlyMutableListeners.on(e.nodes.holder,"drop",async t=>{await this.processDrop(t)},!0),this.readOnlyMutableListeners.on(e.nodes.holder,"dragstart",()=>{this.processDragStart()}),this.readOnlyMutableListeners.on(e.nodes.holder,"dragover",t=>{this.processDragOver(t)},!0)}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}async processDrop(e){const{BlockManager:t,Caret:o,Paste:n}=this.Editor;e.preventDefault(),t.blocks.forEach(r=>{r.dropTarget=!1}),A.isAtEditor&&!A.isCollapsed&&this.isStartedAtEditor&&document.execCommand("delete"),this.isStartedAtEditor=!1;const i=t.setCurrentBlockByChildNode(e.target);if(i)this.Editor.Caret.setToBlock(i,o.positions.END);else{const r=t.setCurrentBlockByChildNode(t.lastBlock.holder);this.Editor.Caret.setToBlock(r,o.positions.END)}await n.processDataTransfer(e.dataTransfer,!0)}processDragStart(){A.isAtEditor&&!A.isCollapsed&&(this.isStartedAtEditor=!0),this.Editor.InlineToolbar.close()}processDragOver(e){e.preventDefault()}}
vendor: 18,284 bytes, line 36
36class _n extends D{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.disabled=!1,this.batchingTimeout=null,this.batchingOnChangeQueue=new Map,this.batchTime=400,this.mutationObserver=new MutationObserver(o=>{this.redactorChanged(o)}),this.eventsDispatcher.on(Rt,o=>{this.particularBlockChanged(o.event)}),this.eventsDispatcher.on(Nt,()=>{this.disable()}),this.eventsDispatcher.on(Dt,()=>{this.enable()})}enable(){this.mutationObserver.observe(this.Editor.UI.nodes.redactor,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.disabled=!1}disable(){this.mutationObserver.disconnect(),this.disabled=!0}particularBlockChanged(e){this.disabled||!z(this.config.onChange)||(this.batchingOnChangeQueue.set(`block:${e.detail.target.id}:event:${e.type}`,e),this.batchingTimeout&&clearTimeout(this.batchingTimeout),this.batchingTimeout=setTimeout(()=>{let t;this.batchingOnChangeQueue.size===1?t=this.batchingOnChangeQueue.values().next().value:t=Array.from(this.batchingOnChangeQueue.values()),this.config.onChange&&this.config.onChange(this.Editor.API.methods,t),this.batchingOnChangeQueue.clear()},this.batchTime))}redactorChanged(e){this.eventsDispatcher.emit($e,{mutations:e})}}const Yt=class extends D{constructor(){super(...arguments),this.MIME_TYPE="application/x-editor-js",this.toolsTags={},this.tagsByTool={},this.toolsPatterns=[],this.toolsFiles={},this.exceptionList=[],this.processTool=s=>{try{const e=s.create({},{},!1);if(s.pasteConfig===!1){this.exceptionList.push(s.name);return}if(!z(e.onPaste))return;this.getTagsConfig(s),this.getFilesConfig(s),this.getPatternsConfig(s)}catch(e){H(`Paste handling for «${s.name}» Tool hasn't been set up because of the error`,"warn",e)}},this.handlePasteEvent=async s=>{const{BlockManager:e,Toolbar:t}=this.Editor,o=e.setCurrentBlockByChildNode(s.target);!o||this.isNativeBehaviour(s.target)&&!s.clipboardData.types.includes("Files")||o&&this.exceptionList.includes(o.name)||(s.preventDefault(),this.processDataTransfer(s.clipboardData),e.clearFocused(),t.close())}}async prepare(){this.processTools()}toggleReadOnly(s){s?this.unsetCallback():this.setCallback()}async processDataTransfer(s,e=!1){const{Tools:t}=this.Editor,o=s.types;if((o.includes?o.includes("Files"):o.contains("Files"))&&!ee(this.toolsFiles)){await this.processFiles(s.files);return}const n=s.getData(this.MIME_TYPE),i=s.getData("text/plain");let r=s.getData("text/html");if(n)try{this.insertEditorJSData(JSON.parse(n));return}catch{}e&&i.trim()&&r.trim()&&(r="<p>"+(r.trim()?r:i)+"</p>");const a=Object.keys(this.toolsTags).reduce((h,d)=>(h[d.toLowerCase()]=this.toolsTags[d].sanitizationConfig??{},h),{}),c=Object.assign({},a,t.getAllInlineToolsSanitizeConfig(),{br:{}}),l=re(r,c);!l.trim()||l.trim()===i||!w.isHTMLString(l)?await this.processText(i):await this.processText(l,!0)}async processText(s,e=!1){const{Caret:t,BlockManager:o}=this.Editor,n=e?this.processHTML(s):this.processPlain(s);if(!n.length)return;if(n.length===1){n[0].isBlock?this.processSingleBlock(n.pop()):this.processInlinePaste(n.pop());return}const i=o.currentBlock&&o.currentBlock.tool.isDefault&&o.currentBlock.isEmpty;n.map(async(r,a)=>this.insertBlock(r,a===0&&i)),o.currentBlock&&t.setToBlock(o.currentBlock,t.positions.END)}setCallback(){this.listeners.on(this.Editor.UI.nodes.holder,"paste",this.handlePasteEvent)}unsetCallback(){this.listeners.off(this.Editor.UI.nodes.holder,"paste",this.handlePasteEvent)}processTools(){const s=this.Editor.Tools.blockTools;Array.from(s.values()).forEach(this.processTool)}collectTagNames(s){return ce(s)?[s]:V(s)?Object.keys(s):[]}getTagsConfig(s){if(s.pasteConfig===!1)return;const e=s.pasteConfig.tags||[],t=[];e.forEach(o=>{const n=this.collectTagNames(o);t.push(...n),n.forEach(i=>{if(Object.prototype.hasOwnProperty.call(this.toolsTags,i)){H(`Paste handler for «${s.name}» Tool on «${i}» tag is skipped because it is already used by «${this.toolsTags[i].tool.name}» Tool.`,"warn");return}const r=V(o)?o[i]:null;this.toolsTags[i.toUpperCase()]={tool:s,sanitizationConfig:r}})}),this.tagsByTool[s.name]=t.map(o=>o.toUpperCase())}getFilesConfig(s){if(s.pasteConfig===!1)return;const{files:e={}}=s.pasteConfig;let{extensions:t,mimeTypes:o}=e;!t&&!o||(t&&!Array.isArray(t)&&(H(`«extensions» property of the onDrop config for «${s.name}» Tool should be an array`),t=[]),o&&!Array.isArray(o)&&(H(`«mimeTypes» property of the onDrop config for «${s.name}» Tool should be an array`),o=[]),o&&(o=o.filter(n=>fo(n)?!0:(H(`MIME type value «${n}» for the «${s.name}» Tool is not a valid MIME type`,"warn"),!1))),this.toolsFiles[s.name]={extensions:t||[],mimeTypes:o||[]})}getPatternsConfig(s){s.pasteConfig===!1||!s.pasteConfig.patterns||ee(s.pasteConfig.patterns)||Object.entries(s.pasteConfig.patterns).forEach(([e,t])=>{t instanceof RegExp||H(`Pattern ${t} for «${s.name}» Tool is skipped because it should be a Regexp instance.`,"warn"),this.toolsPatterns.push({key:e,pattern:t,tool:s})})}isNativeBehaviour(s){return w.isNativeInput(s)}async processFiles(s){const{BlockManager:e}=this.Editor;let t;t=await Promise.all(Array.from(s).map(n=>this.processFile(n))),t=t.filter(n=>!!n);const o=e.currentBlock.tool.isDefault&&e.currentBlock.isEmpty;t.forEach((n,i)=>{e.paste(n.type,n.event,i===0&&o)})}async processFile(s){const e=po(s),t=Object.entries(this.toolsFiles).find(([n,{mimeTypes:i,extensions:r}])=>{const[a,c]=s.type.split("/"),l=r.find(d=>d.toLowerCase()===e.toLowerCase()),h=i.find(d=>{const[p,g]=d.split("/");return p===a&&(g===c||g==="*")});return!!l||!!h});if(!t)return;const[o]=t;return{event:this.composePasteEvent("file",{file:s}),type:o}}processHTML(s){const{Tools:e}=this.Editor,t=w.make("DIV");return t.innerHTML=s,this.getNodes(t).map(o=>{let n,i=e.defaultTool,r=!1;switch(o.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:n=w.make("div"),n.appendChild(o);break;case Node.ELEMENT_NODE:n=o,r=!0,this.toolsTags[n.tagName]&&(i=this.toolsTags[n.tagName].tool);break}const{tags:a}=i.pasteConfig||{tags:[]},c=a.reduce((d,p)=>(this.collectTagNames(p).forEach(g=>{const f=V(p)?p[g]:null;d[g.toLowerCase()]=f||{}}),d),{}),l=Object.assign({},c,i.baseSanitizeConfig);if(n.tagName.toLowerCase()==="table"){const d=re(n.outerHTML,l);n=w.make("div",void 0,{innerHTML:d}).firstChild}else n.innerHTML=re(n.innerHTML,l);const h=this.composePasteEvent("tag",{data:n});return{content:n,isBlock:r,tool:i.name,event:h}}).filter(o=>{const n=w.isEmpty(o.content),i=w.isSingleTag(o.content);return!n||i})}processPlain(s){const{defaultBlock:e}=this.config;if(!s)return[];const t=e;return s.split(/\r?\n/).filter(o=>o.trim()).map(o=>{const n=w.make("div");n.textContent=o;const i=this.composePasteEvent("tag",{data:n});return{content:n,tool:t,isBlock:!1,event:i}})}async processSingleBlock(s){const{Caret:e,BlockManager:t}=this.Editor,{currentBlock:o}=t;if(!o||s.tool!==o.name||!w.containsOnlyInlineElements(s.content.innerHTML)){this.insertBlock(s,(o==null?void 0:o.tool.isDefault)&&o.isEmpty);return}e.insertContentAtCaretPosition(s.content.innerHTML)}async processInlinePaste(s){const{BlockManager:e,Caret:t}=this.Editor,{content:o}=s;if(e.currentBlock&&e.currentBlock.tool.isDefault&&o.textContent.length<Yt.PATTERN_PROCESSING_MAX_LENGTH){const n=await this.processPattern(o.textContent);if(n){const i=e.currentBlock&&e.currentBlock.tool.isDefault&&e.currentBlock.isEmpty,r=e.paste(n.tool,n.event,i);t.setToBlock(r,t.positions.END);return}}if(e.currentBlock&&e.currentBlock.currentInput){const n=e.currentBlock.tool.baseSanitizeConfig;document.execCommand("insertHTML",!1,re(o.innerHTML,n))}else this.insertBlock(s)}async processPattern(s){const e=this.toolsPatterns.find(t=>{const o=t.pattern.exec(s);return o?s===o.shift():!1});return e?{event:this.composePasteEvent("pattern",{key:e.key,data:s}),tool:e.tool.name}:void 0}insertBlock(s,e=!1){const{BlockManager:t,Caret:o}=this.Editor,{currentBlock:n}=t;let i;if(e&&n&&n.isEmpty){i=t.paste(s.tool,s.event,!0),o.setToBlock(i,o.positions.END);return}i=t.paste(s.tool,s.event),o.setToBlock(i,o.positions.END)}insertEditorJSData(s){const{BlockManager:e,Caret:t,Tools:o}=this.Editor;Pt(s,n=>o.blockTools.get(n).sanitizeConfig).forEach(({tool:n,data:i},r)=>{let a=!1;r===0&&(a=e.currentBlock&&e.currentBlock.tool.isDefault&&e.currentBlock.isEmpty);const c=e.insert({tool:n,data:i,replace:a});t.setToBlock(c,t.positions.END)})}processElementNode(s,e,t){const o=Object.keys(this.toolsTags),n=s,{tool:i}=this.toolsTags[n.tagName]||{},r=this.tagsByTool[i==null?void 0:i.name]||[],a=o.includes(n.tagName),c=w.blockElements.includes(n.tagName.toLowerCase()),l=Array.from(n.children).some(({tagName:d})=>o.includes(d)&&!r.includes(d)),h=Array.from(n.children).some(({tagName:d})=>w.blockElements.includes(d.toLowerCase()));if(!c&&!a&&!l)return t.appendChild(n),[...e,t];if(a&&!l||c&&!h&&!l)return[...e,t,n]}getNodes(s){const e=Array.from(s.childNodes);let t;const o=(n,i)=>{if(w.isEmpty(i)&&!w.isSingleTag(i))return n;const r=n[n.length-1];let a=new DocumentFragment;switch(r&&w.isFragment(r)&&(a=n.pop()),i.nodeType){case Node.ELEMENT_NODE:if(t=this.processElementNode(i,n,a),t)return t;break;case Node.TEXT_NODE:return a.appendChild(i),[...n,a];default:return[...n,a]}return[...n,...Array.from(i.childNodes).reduce(o,[])]};return e.reduce(o,[])}composePasteEvent(s,e){return new CustomEvent(s,{detail:e})}};let qt=Yt;qt.PATTERN_PROCESSING_MAX_LENGTH=450;class On extends D{constructor(){super(...arguments),this.toolsDontSupportReadOnly=[],this.readOnlyEnabled=!1}get isEnabled(){return this.readOnlyEnabled}async prepare(){const{Tools:e}=this.Editor,{blockTools:t}=e,o=[];Array.from(t.entries()).forEach(([n,i])=>{i.isReadOnlySupported||o.push(n)}),this.toolsDontSupportReadOnly=o,this.config.readOnly&&o.length>0&&this.throwCriticalError(),this.toggle(this.config.readOnly)}async toggle(e=!this.readOnlyEnabled){e&&this.toolsDontSupportReadOnly.length>0&&this.throwCriticalError();const t=this.readOnlyEnabled;this.readOnlyEnabled=e;for(const n in this.Editor)this.Editor[n].toggleReadOnly&&this.Editor[n].toggleReadOnly(e);if(t===e)return this.readOnlyEnabled;const o=await this.Editor.Saver.save();return await this.Editor.BlockManager.clear(),await this.Editor.Renderer.render(o.blocks),this.readOnlyEnabled}throwCriticalError(){throw new Ot(`To enable read-only mode all connected tools should support it. Tools ${this.toolsDontSupportReadOnly.join(", ")} don't support read-only mode.`)}}class Be extends D{constructor(){super(...arguments),this.isRectSelectionActivated=!1,this.SCROLL_SPEED=3,this.HEIGHT_OF_SCROLL_ZONE=40,this.BOTTOM_SCROLL_ZONE=1,this.TOP_SCROLL_ZONE=2,this.MAIN_MOUSE_BUTTON=0,this.mousedown=!1,this.isScrolling=!1,this.inScrollZone=null,this.startX=0,this.startY=0,this.mouseX=0,this.mouseY=0,this.stackOfSelected=[],this.listenerIds=[]}static get CSS(){return{overlay:"codex-editor-overlay",overlayContainer:"codex-editor-overlay__container",rect:"codex-editor-overlay__rectangle",topScrollZone:"codex-editor-overlay__scroll-zone--top",bottomScrollZone:"codex-editor-overlay__scroll-zone--bottom"}}prepare(){this.enableModuleBindings()}startSelection(e,t){const o=document.elementFromPoint(e-window.pageXOffset,t-window.pageYOffset);o.closest(`.${this.Editor.Toolbar.CSS.toolbar}`)||(this.Editor.BlockSelection.allBlocksSelected=!1,this.clearSelection(),this.stackOfSelected=[]);const n=[`.${ie.CSS.content}`,`.${this.Editor.Toolbar.CSS.toolbar}`,`.${this.Editor.InlineToolbar.CSS.inlineToolbar}`],i=o.closest("."+this.Editor.UI.CSS.editorWrapper),r=n.some(a=>!!o.closest(a));!i||r||(this.mousedown=!0,this.startX=e,this.startY=t)}endSelection(){this.mousedown=!1,this.startX=0,this.startY=0,this.overlayRectangle.style.display="none"}isRectActivated(){return this.isRectSelectionActivated}clearSelection(){this.isRectSelectionActivated=!1}enableModuleBindings(){const{container:e}=this.genHTML();this.listeners.on(e,"mousedown",t=>{this.processMouseDown(t)},!1),this.listeners.on(document.body,"mousemove",je(t=>{this.processMouseMove(t)},10),{passive:!0}),this.listeners.on(document.body,"mouseleave",()=>{this.processMouseLeave()}),this.listeners.on(window,"scroll",je(t=>{this.processScroll(t)},10),{passive:!0}),this.listeners.on(document.body,"mouseup",()=>{this.processMouseUp()},!1)}processMouseDown(e){e.button===this.MAIN_MOUSE_BUTTON&&(e.target.closest(w.allInputsSelector)!==null||this.startSelection(e.pageX,e.pageY))}processMouseMove(e){this.changingRectangle(e),this.scrollByZones(e.clientY)}processMouseLeave(){this.clearSelection(),this.endSelection()}processScroll(e){this.changingRectangle(e)}processMouseUp(){this.clearSelection(),this.endSelection()}scrollByZones(e){if(this.inScrollZone=null,e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.TOP_SCROLL_ZONE),document.documentElement.clientHeight-e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.BOTTOM_SCROLL_ZONE),!this.inScrollZone){this.isScrolling=!1;return}this.isScrolling||(this.scrollVertical(this.inScrollZone===this.TOP_SCROLL_ZONE?-this.SCROLL_SPEED:this.SCROLL_SPEED),this.isScrolling=!0)}genHTML(){const{UI:e}=this.Editor,t=e.nodes.holder.querySelector("."+e.CSS.editorWrapper),o=w.make("div",Be.CSS.overlay,{}),n=w.make("div",Be.CSS.overlayContainer,{}),i=w.make("div",Be.CSS.rect,{});return n.appendChild(i),o.appendChild(n),t.appendChild(o),this.overlayRectangle=i,{container:t,overlay:o}}scrollVertical(e){if(!(this.inScrollZone&&this.mousedown))return;const t=window.pageYOffset;window.scrollBy(0,e),this.mouseY+=window.pageYOffset-t,setTimeout(()=>{this.scrollVertical(e)},0)}changingRectangle(e){if(!this.mousedown)return;e.pageY!==void 0&&(this.mouseX=e.pageX,this.mouseY=e.pageY);const{rightPos:t,leftPos:o,index:n}=this.genInfoForMouseSelection(),i=this.startX>t&&this.mouseX>t,r=this.startX<o&&this.mouseX<o;this.rectCrossesBlocks=!(i||r),this.isRectSelectionActivated||(this.rectCrossesBlocks=!1,this.isRectSelectionActivated=!0,this.shrinkRectangleToPoint(),this.overlayRectangle.style.display="block"),this.updateRectangleSize(),this.Editor.Toolbar.close(),n!==void 0&&(this.trySelectNextBlock(n),this.inverseSelection(),A.get().removeAllRanges())}shrinkRectangleToPoint(){this.overlayRectangle.style.left=`${this.startX-window.pageXOffset}px`,this.overlayRectangle.style.top=`${this.startY-window.pageYOffset}px`,this.overlayRectangle.style.bottom=`calc(100% - ${this.startY-window.pageYOffset}px`,this.overlayRectangle.style.right=`calc(100% - ${this.startX-window.pageXOffset}px`}inverseSelection(){const e=this.Editor.BlockManager.getBlockByIndex(this.stackOfSelected[0]).selected;if(this.rectCrossesBlocks&&!e)for(const t of this.stackOfSelected)this.Editor.BlockSelection.selectBlockByIndex(t);if(!this.rectCrossesBlocks&&e)for(const t of this.stackOfSelected)this.Editor.BlockSelection.unSelectBlockByIndex(t)}updateRectangleSize(){this.mouseY>=this.startY?(this.overlayRectangle.style.top=`${this.startY-window.pageYOffset}px`,this.overlayRectangle.style.bottom=`calc(100% - ${this.mouseY-window.pageYOffset}px`):(this.overlayRectangle.style.bottom=`calc(100% - ${this.startY-window.pageYOffset}px`,this.overlayRectangle.style.top=`${this.mouseY-window.pageYOffset}px`),this.mouseX>=this.startX?(this.overlayRectangle.style.left=`${this.startX-window.pageXOffset}px`,this.overlayRectangle.style.right=`calc(100% - ${this.mouseX-window.pageXOffset}px`):(this.overlayRectangle.style.right=`calc(100% - ${this.startX-window.pageXOffset}px`,this.overlayRectangle.style.left=`${this.mouseX-window.pageXOffset}px`)}genInfoForMouseSelection(){const e=document.body.offsetWidth/2,t=this.mouseY-window.pageYOffset,o=document.elementFromPoint(e,t),n=this.Editor.BlockManager.getBlockByChildNode(o);let i;n!==void 0&&(i=this.Editor.BlockManager.blocks.findIndex(h=>h.holder===n.holder));const r=this.Editor.BlockManager.lastBlock.holder.querySelector("."+ie.CSS.content),a=Number.parseInt(window.getComputedStyle(r).width,10)/2,c=e-a,l=e+a;return{index:i,leftPos:c,rightPos:l}}addBlockInSelection(e){this.rectCrossesBlocks&&this.Editor.BlockSelection.selectBlockByIndex(e),this.stackOfSelected.push(e)}trySelectNextBlock(e){const t=this.stackOfSelected[this.stackOfSelected.length-1]===e,o=this.stackOfSelected.length,n=1,i=-1,r=0;if(t)return;const a=this.stackOfSelected[o-1]-this.stackOfSelected[o-2]>0;let c=r;o>1&&(c=a?n:i);const l=e>this.stackOfSelected[o-1]&&c===n,h=e<this.stackOfSelected[o-1]&&c===i,d=!(l||h||c===r);if(!d&&(e>this.stackOfSelected[o-1]||this.stackOfSelected[o-1]===void 0)){let f=this.stackOfSelected[o-1]+1||e;for(f;f<=e;f++)this.addBlockInSelection(f);return}if(!d&&e<this.stackOfSelected[o-1]){for(let f=this.stackOfSelected[o-1]-1;f>=e;f--)this.addBlockInSelection(f);return}if(!d)return;let p=o-1,g;for(e>this.stackOfSelected[o-1]?g=()=>e>this.stackOfSelected[p]:g=()=>e<this.stackOfSelected[p];g();)this.rectCrossesBlocks&&this.Editor.BlockSelection.unSelectBlockByIndex(this.stackOfSelected[p]),this.stackOfSelected.pop(),p--}}class An extends D{async render(e){return new Promise(t=>{const{Tools:o,BlockManager:n}=this.Editor,i=e.map(({type:r,data:a,tunes:c,id:l})=>{o.available.has(r)===!1&&(J(`Tool «${r}» is not found. Check 'tools' property at the Editor.js config.`,"warn"),a=this.composeStubDataForTool(r,a,l),r=o.stubTool);let h;try{h=n.composeBlock({id:l,tool:r,data:a,tunes:c})}catch(d){H(`Block «${r}» skipped because of plugins error`,"error",{data:a,error:d}),a=this.composeStubDataForTool(r,a,l),r=o.stubTool,h=n.composeBlock({id:l,tool:r,data:a,tunes:c})}return h});n.insertMany(i),window.requestIdleCallback(()=>{t()},{timeout:2e3})})}composeStubDataForTool(e,t,o){const{Tools:n}=this.Editor;let i=e;if(n.unavailable.has(e)){const r=n.unavailable.get(e).toolbox;r!==void 0&&r[0].title!==void 0&&(i=r[0].title)}return{savedData:{id:o,type:e,data:t},title:i}}}class Rn extends D{async save(){const{BlockManager:e,Tools:t}=this.Editor,o=e.blocks,n=[];try{o.forEach(a=>{n.push(this.getSavedData(a))});const i=await Promise.all(n),r=await Pt(i,a=>t.blockTools.get(a).sanitizeConfig);return this.makeOutput(r)}catch(i){J("Saving failed due to the Error %o","error",i)}}async getSavedData(e){const t=await e.save(),o=t&&await e.validate(t.data);return{...t,isValid:o}}makeOutput(e){const t=[];return e.forEach(({id:o,tool:n,data:i,tunes:r,isValid:a})=>{if(!a){H(`Block «${n}
36» skipped because saved data is invalid`);return}if(n===this.Editor.Tools.stubTool){t.push(i);return}const c={id:o,type:n,data:i,...!ee(r)&&{tunes:r}};t.push(c)}),{time:+new Date,blocks:t,version:"2.28.2"}}}var Xe={},Nn={get exports(){return Xe},set exports(s){Xe=s}};(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="/",n(n.s=4)}([function(t,o,n){var i=n(1),r=n(2);typeof(r=r.__esModule?r.default:r)=="string"&&(r=[[t.i,r,""]]);var a={insert:"head",singleton:!1};i(r,a),t.exports=r.locals||{}},function(t,o,n){var i,r=function(){return i===void 0&&(i=!!(window&&document&&document.all&&!window.atob)),i},a=function(){var b={};return function(k){if(b[k]===void 0){var v=document.querySelector(k);if(window.HTMLIFrameElement&&v instanceof window.HTMLIFrameElement)try{v=v.contentDocument.head}catch{v=null}b[k]=v}return b[k]}}(),c=[];function l(b){for(var k=-1,v=0;v<c.length;v++)if(c[v].identifier===b){k=v;break}return k}function h(b,k){for(var v={},B=[],_=0;_<b.length;_++){var E=b[_],C=k.base?E[0]+k.base:E[0],L=v[C]||0,S="".concat(C," ").concat(L);v[C]=L+1;var T=l(S),M={css:E[1],media:E[2],sourceMap:E[3]};T!==-1?(c[T].references++,c[T].updater(M)):c.push({identifier:S,updater:x(M,k),references:1}),B.push(S)}return B}function d(b){var k=document.createElement("style"),v=b.attributes||{};if(v.nonce===void 0){var B=n.nc;B&&(v.nonce=B)}if(Object.keys(v).forEach(function(E){k.setAttribute(E,v[E])}),typeof b.insert=="function")b.insert(k);else{var _=a(b.insert||"head");if(!_)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");_.appendChild(k)}return k}
vendor: 1,115 bytes, lines 36-38
36var p,g=(p=[],function(b,k){return p[b]=k,p.filter(Boolean).join(` 37`)});function f(b,k,v,B){var _=v?"":B.media?"@media ".concat(B.media," {").concat(B.css,"}"):B.css;if(b.styleSheet)b.styleSheet.cssText=g(k,_);else{var E=document.createTextNode(_),C=b.childNodes;C[k]&&b.removeChild(C[k]),C.length?b.insertBefore(E,C[k]):b.appendChild(E)}}function u(b,k,v){var B=v.css,_=v.media,E=v.sourceMap;if(_?b.setAttribute("media",_):b.removeAttribute("media"),E&&btoa&&(B+=` 38/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(E))))," */")),b.styleSheet)b.styleSheet.cssText=B;else{for(;b.firstChild;)b.removeChild(b.firstChild);b.appendChild(document.createTextNode(B))}}var m=null,y=0;function x(b,k){var v,B,_;if(k.singleton){var E=y++;v=m||(m=d(k)),B=f.bind(null,v,E,!1),_=f.bind(null,v,E,!0)}else v=d(k),B=u.bind(null,v,k),_=function(){(function(C){if(C.parentNode===null)return!1;C.parentNode.removeChild(C)})(v)};return B(b),function(C){if(C){if(C.css===b.css&&C.media===b.media&&C.sourceMap===b.sourceMap)return;B(b=C)}else _()}}t.exports=function(b,k){(k=k||{}
38).singleton||typeof k.singleton=="boolean"||(k.singleton=r());var v=h(b=b||[],k);return function(B){if(B=B||[],Object.prototype.toString.call(B)==="[object Array]"){for(var _=0;_<v.length;_++){var E=l(v[_]);c[E].references--}for(var C=h(B,k),L=0;L<v.length;L++){var S=l(v[L]);c[S].references===0&&(c[S].updater(),c.splice(S,1))}v=C}}}},function(t,o,n){(o=n(3)(!1)).push([t.i,`.ce-paragraph { 39 line-height: 1.6em; 40 outline: none; 41} 42 43.ce-paragraph[data-placeholder]:empty::before{ 44 content: attr(data-placeholder); 45 color: #707684; 46 font-weight: normal; 47 opacity: 0; 48} 49 50/** Show placeholder at the first paragraph if Editor is empty */ 51.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty::before { 52 opacity: 1; 53} 54 55.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph[data-placeholder]:empty::before, 56.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:focus::before { 57 opacity: 0; 58} 59 60.ce-paragraph p:first-of-type{ 61 margin-top: 0; 62} 63 64.ce-paragraph p:last-of-type{ 65 margin-bottom: 0; 66} 67`,""]),t.exports=o},function(t,o,n){t.exports=function(i){var r=[];return r.toString=function(){return this.map(function(a){var c=function(l,h){var d=l[1]||"",p=l[3];if(!p)return d;if(h&&typeof btoa=="function"){var g=(u=p,m=btoa(unescape(encodeURIComponent(JSON.stringify(u)))),y="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(m),"/*# ".concat(y," */")),f=p.sources.map(function(x){return"/*# sourceURL=".concat(p.sourceRoot||"").concat(x," */")});return[d].concat(f).concat([g]).join(` 68`)}var u,m,y;return[d].join(` 69`)}(a,i);return a[2]?"@media ".concat(a[2]," {").concat(c,"}"):c}).join("")},r.i=function(a,c,l){typeof a=="string"&&(a=[[null,a,""]]);var h={};if(l)for(var d=0;d<this.length;d++){var p=this[d][0];p!=null&&(h[p]=!0)}for(var g=0;g<a.length;g++){var f=[].concat(a[g]);l&&h[f[0]]||(c&&(f[2]?f[2]="".concat(c," and ").concat(f[2]):f[2]=c),r.push(f))}},r}},function(t,o,n){n.r(o),n.d(o,"default",function(){return a}),n(0);function i(c,l){for(var h=0;h<l.length;h++){var d=l[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}function r(c,l,h){return l&&i(c.prototype,l),h&&i(c,h),c}/** 70 * Base Paragraph Block for the Editor.js. 71 * Represents a regular text block 72 * 73 * @author CodeX ([email protected]) 74 * @copyright CodeX 2018 75 * @license The MIT License (MIT) 76 */var a=function(){function c(l){var h=l.data,d=l.config,p=l.api,g=l.readOnly;(function(f,u){if(!(f instanceof u))throw new TypeError("Cannot call a class as a function")})(this,c),this.api=p,this.readOnly=g,this._CSS={block:this.api.styles.block,wrapper:"ce-paragraph"},this.readOnly||(this.onKeyUp=this.onKeyUp.bind(this)),this._placeholder=d.placeholder?d.placeholder:c.DEFAULT_PLACEHOLDER,this._data={},this._element=null,this._preserveBlank=d.preserveBlank!==void 0&&d.preserveBlank,this.data=h}return r(c,null,[{key:"DEFAULT_PLACEHOLDER",get:function(){return""}}]),r(c,[{key:"onKeyUp",value:function(l){l.code!=="Backspace"&&l.code!=="Delete"||this._element.textContent===""&&(this._element.innerHTML="")}},{key:"drawView",value:function(){var l=document.createElement("DIV");return l.classList.add(this._CSS.wrapper,this._CSS.block),l.contentEditable=!1,l.dataset.placeholder=this.api.i18n.t(this._placeholder),this.readOnly||(l.contentEditable=!0,l.addEventListener("keyup",this.onKeyUp)),l}},{key:"render",value:function(){return this._element===null&&(this._element=this.drawView()),this.hydrate(),this._element}},{key:"merge",value:function(l){var h={text:this.data.text+l.text};this.data=h}},{key:"validate",value:function(l){return!(l.text.trim()===""&&!this._preserveBlank)}},{key:"save",value:function(l){return{text:l.innerHTML}}},{key:"onPaste",value:function(l){var h={text:l.detail.data.innerHTML};this.data=h}},{key:"hydrate",value:function(){var l=this;window.requestAnimationFrame(function(){l._element.innerHTML=l._data.text||""})}},{key:"data",get:function(){if(this._element!==null){var l=this._element.innerHTML;this._data.text=l}return this._data},set:function(l){this._data=l||{},this._element!==null&&this.hydrate()}}
76],[{key:"conversionConfig",get:function(){return{export:"text",import:"text"}}},{key:"sanitize",get:function(){return{text:{br:!0}}}},{key:"isReadOnlySupported",get:function(){return!0}},{key:"pasteConfig",get:function(){return{tags:["P"]}}},{key:"toolbox",get:function(){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14"/></svg>',title:"Text"}}}]),c}()}]).default})})(Nn);const Dn=Re(Xe);class it{constructor(){this.commandName="bold",this.CSS={button:"ce-inline-tool",buttonActive:"ce-inline-tool--active",buttonModifier:"ce-inline-tool--bold"},this.nodes={button:void 0}}static get sanitize(){return{b:{}}}render(){return this.nodes.button=document.createElement("button"),this.nodes.button.type="button",this.nodes.button.classList.add(this.CSS.button,this.CSS.buttonModifier),this.nodes.button.innerHTML=on,this.nodes.button}surround(){document.execCommand(this.commandName)}checkState(){const e=document.queryCommandState(this.commandName);return this.nodes.button.classList.toggle(this.CSS.buttonActive,e),e}get shortcut(){return"CMD+B"}}it.isInline=!0;it.title="Bold";class rt{constructor(){this.commandName="italic",this.CSS={button:"ce-inline-tool",buttonActive:"ce-inline-tool--active",buttonModifier:"ce-inline-tool--italic"},this.nodes={button:null}}static get sanitize(){return{i:{}}}render(){return this.nodes.button=document.createElement("button"),this.nodes.button.type="button",this.nodes.button.classList.add(this.CSS.button,this.CSS.buttonModifier),this.nodes.button.innerHTML=an,this.nodes.button}surround(){document.execCommand(this.commandName)}checkState(){const e=document.queryCommandState(this.commandName);return this.nodes.button.classList.toggle(this.CSS.buttonActive,e),e}get shortcut(){return"CMD+I"}}rt.isInline=!0;rt.title="Italic";class st{constructor({api:e}){this.commandLink="createLink",this.commandUnlink="unlink",this.ENTER_KEY=13,this.CSS={button:"ce-inline-tool",buttonActive:"ce-inline-tool--active",buttonModifier:"ce-inline-tool--link",buttonUnlink:"ce-inline-tool--unlink",input:"ce-inline-tool-input",inputShowed:"ce-inline-tool-input--showed"},this.nodes={button:null,input:null},this.inputOpened=!1,this.toolbar=e.toolbar,this.inlineToolbar=e.inlineToolbar,this.notifier=e.notifier,this.i18n=e.i18n,this.selection=new A}static get sanitize(){return{a:{href:!0,target:"_blank",rel:"nofollow"}}}render(){return this.nodes.button=document.createElement("button"),this.nodes.button.type="button",this.nodes.button.classList.add(this.CSS.button,this.CSS.buttonModifier),this.nodes.button.innerHTML=ft,this.nodes.button}renderActions(){return this.nodes.input=document.createElement("input"),this.nodes.input.placeholder=this.i18n.t("Add a link"),this.nodes.input.classList.add(this.CSS.input),this.nodes.input.addEventListener("keydown",e=>{e.keyCode===this.ENTER_KEY&&this.enterPressed(e)}),this.nodes.input}surround(e){if(e){this.inputOpened?(this.selection.restore(),this.selection.removeFakeBackground()):(this.selection.setFakeBackground(),this.selection.save());const t=this.selection.findParentTag("A");if(t){this.selection.expandToTag(t),this.unlink(),this.closeActions(),this.checkState(),this.toolbar.close();return}}this.toggleActions()}checkState(){const e=this.selection.findParentTag("A");if(e){this.nodes.button.innerHTML=hn,this.nodes.button.classList.add(this.CSS.buttonUnlink),this.nodes.button.classList.add(this.CSS.buttonActive),this.openActions();const t=e.getAttribute("href");this.nodes.input.value=t!=="null"?t:"",this.selection.save()}else this.nodes.button.innerHTML=ft,this.nodes.button.classList.remove(this.CSS.buttonUnlink),this.nodes.button.classList.remove(this.CSS.buttonActive);return!!e}clear(){this.closeActions()}get shortcut(){return"CMD+K"}toggleActions(){this.inputOpened?this.closeActions(!1):this.openActions(!0)}openActions(e=!1){this.nodes.input.classList.add(this.CSS.inputShowed),e&&this.nodes.input.focus(),this.inputOpened=!0}
vendor: 13,446 bytes, line 76
76closeActions(e=!0){if(this.selection.isFakeBackgroundEnabled){const t=new A;t.save(),this.selection.restore(),this.selection.removeFakeBackground(),t.restore()}this.nodes.input.classList.remove(this.CSS.inputShowed),this.nodes.input.value="",e&&this.selection.clearSaved(),this.inputOpened=!1}enterPressed(e){let t=this.nodes.input.value||"";if(!t.trim()){this.selection.restore(),this.unlink(),e.preventDefault(),this.closeActions();return}if(!this.validateURL(t)){this.notifier.show({message:"Pasted link is not valid.",style:"error"}),H("Incorrect Link pasted","warn",t);return}t=this.prepareLink(t),this.selection.restore(),this.selection.removeFakeBackground(),this.insertLink(t),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.selection.collapseToEnd(),this.inlineToolbar.close()}validateURL(e){return!/\s/.test(e)}prepareLink(e){return e=e.trim(),e=this.addProtocol(e),e}addProtocol(e){if(/^(\w+):(\/\/)?/.test(e))return e;const t=/^\/[^/\s]/.test(e),o=e.substring(0,1)==="#",n=/^\/\/[^/\s]/.test(e);return!t&&!o&&!n&&(e="http://"+e),e}insertLink(e){const t=this.selection.findParentTag("A");t&&this.selection.expandToTag(t),document.execCommand(this.commandLink,!1,e)}unlink(){document.execCommand(this.commandUnlink)}}st.isInline=!0;st.title="Link";class Xt{constructor({data:e,api:t}){this.CSS={wrapper:"ce-stub",info:"ce-stub__info",title:"ce-stub__title",subtitle:"ce-stub__subtitle"},this.api=t,this.title=e.title||this.api.i18n.t("Error"),this.subtitle=this.api.i18n.t("The block can not be displayed correctly."),this.savedData=e.savedData,this.wrapper=this.make()}render(){return this.wrapper}save(){return this.savedData}make(){const e=w.make("div",this.CSS.wrapper),t=un,o=w.make("div",this.CSS.info),n=w.make("div",this.CSS.title,{textContent:this.title}),i=w.make("div",this.CSS.subtitle,{textContent:this.subtitle});return e.innerHTML=t,o.appendChild(n),o.appendChild(i),e.appendChild(o),e}}Xt.isReadOnlySupported=!0;class Pn extends nt{constructor(){super(...arguments),this.type=De.Inline}get title(){return this.constructable[ot.Title]}create(){return new this.constructable({api:this.api.getMethodsForTool(this),config:this.settings})}}class Hn extends nt{constructor(){super(...arguments),this.type=De.Tune}create(e,t){return new this.constructable({api:this.api.getMethodsForTool(this),config:this.settings,block:t,data:e})}}let oe=class ve extends Map{get blockTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isBlock());return new ve(e)}get inlineTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isInline());return new ve(e)}get blockTunes(){const e=Array.from(this.entries()).filter(([,t])=>t.isTune());return new ve(e)}get internalTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isInternal);return new ve(e)}get externalTools(){const e=Array.from(this.entries()).filter(([,t])=>!t.isInternal);return new ve(e)}};var Fn=Object.defineProperty,jn=Object.getOwnPropertyDescriptor,Kt=(s,e,t,o)=>{for(var n=o>1?void 0:o?jn(e,t):e,i=s.length-1,r;i>=0;i--)(r=s[i])&&(n=(o?r(e,t,n):r(n))||n);return o&&n&&Fn(e,t,n),n};class at extends nt{constructor(){super(...arguments),this.type=De.Block,this.inlineTools=new oe,this.tunes=new oe}create(e,t,o){return new this.constructable({data:e,block:t,readOnly:o,api:this.api.getMethodsForTool(this),config:this.settings})}get isReadOnlySupported(){return this.constructable[be.IsReadOnlySupported]===!0}get isLineBreaksEnabled(){return this.constructable[be.IsEnabledLineBreaks]}get toolbox(){const e=this.constructable[be.Toolbox],t=this.config[_e.Toolbox];if(!ee(e)&&t!==!1)return t?Array.isArray(e)?Array.isArray(t)?t.map((o,n)=>{const i=e[n];return i?{...i,...o}:o}):[t]:Array.isArray(t)?t:[{...e,...t}]:Array.isArray(e)?e:[e]}get conversionConfig(){return this.constructable[be.ConversionConfig]}get enabledInlineTools(){return this.config[_e.EnabledInlineTools]||!1}get enabledBlockTunes(){return this.config[_e.EnabledBlockTunes]}get pasteConfig(){return this.constructable[be.PasteConfig]??{}}get sanitizeConfig(){const e=super.sanitizeConfig,t=this.baseSanitizeConfig;if(ee(e))return t;const o={};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const i=e[n];V(i)?o[n]=Object.assign({},t,i):o[n]=i}return o}get baseSanitizeConfig(){const e={};return Array.from(this.inlineTools.values()).forEach(t=>Object.assign(e,t.sanitizeConfig)),Array.from(this.tunes.values()).forEach(t=>Object.assign(e,t.sanitizeConfig)),e}}Kt([xe],at.prototype,"sanitizeConfig",1);Kt([xe],at.prototype,"baseSanitizeConfig",1);class zn{constructor(e,t,o){this.api=o,this.config=e,this.editorConfig=t}get(e){const{class:t,isInternal:o=!1,...n}=this.config[e],i=this.getConstructor(t);return new i({name:e,constructable:t,config:n,api:this.api,isDefault:e===this.editorConfig.defaultBlock,defaultPlaceholder:this.editorConfig.placeholder,isInternal:o})}getConstructor(e){switch(!0){case e[ot.IsInline]:return Pn;case e[Wt.IsTune]:return Hn;default:return at}}}class Zt{constructor({api:e}){this.CSS={animation:"wobble"},this.api=e}render(){return{icon:Ft,title:this.api.i18n.t("Move down"),onActivate:()=>this.handleClick(),name:"move-down"}}handleClick(){const e=this.api.blocks.getCurrentBlockIndex(),t=this.api.blocks.getBlockByIndex(e+1);if(!t)throw new Error("Unable to move Block down since it is already the last");const o=t.holder,n=o.getBoundingClientRect();let i=Math.abs(window.innerHeight-o.offsetHeight);n.top<window.innerHeight&&(i=window.scrollY+o.offsetHeight),window.scrollTo(0,i),this.api.blocks.move(e+1),this.api.toolbar.toggleBlockSettings(!0)}}Zt.isTune=!0;class Gt{constructor({api:e}){this.api=e}render(){return{icon:rn,title:this.api.i18n.t("Delete"),name:"delete",confirmation:{title:this.api.i18n.t("Click to delete"),onActivate:()=>this.handleClick()}}}handleClick(){this.api.blocks.delete()}}Gt.isTune=!0;class Jt{constructor({api:e}){this.CSS={animation:"wobble"},this.api=e}render(){return{icon:nn,title:this.api.i18n.t("Move up"),onActivate:()=>this.handleClick(),name:"move-up"}}handleClick(){const e=this.api.blocks.getCurrentBlockIndex(),t=this.api.blocks.getBlockByIndex(e),o=this.api.blocks.getBlockByIndex(e-1);if(e===0||!t||!o)throw new Error("Unable to move Block up since it is already the first");const n=t.holder,i=o.holder,r=n.getBoundingClientRect(),a=i.getBoundingClientRect();let c;a.top>0?c=Math.abs(r.top)-Math.abs(a.top):c=Math.abs(r.top)+a.height,window.scrollBy(0,-1*c),this.api.blocks.move(e-1),this.api.toolbar.toggleBlockSettings(!0)}}Jt.isTune=!0;var Un=Object.defineProperty,$n=Object.getOwnPropertyDescriptor,Vn=(s,e,t,o)=>{for(var n=o>1?void 0:o?$n(e,t):e,i=s.length-1,r;i>=0;i--)(r=s[i])&&(n=(o?r(e,t,n):r(n))||n);return o&&n&&Un(e,t,n),n};class Qt extends D{constructor(){super(...arguments),this.stubTool="stub",this.toolsAvailable=new oe,this.toolsUnavailable=new oe}get available(){return this.toolsAvailable}get unavailable(){return this.toolsUnavailable}get inlineTools(){return this.available.inlineTools}get blockTools(){return this.available.blockTools}get blockTunes(){return this.available.blockTunes}get defaultTool(){return this.blockTools.get(this.config.defaultBlock)}get internal(){return this.available.internalTools}async prepare(){if(this.validateTools(),this.config.tools=ze({},this.internalTools,this.config.tools),!Object.prototype.hasOwnProperty.call(this.config,"tools")||Object.keys(this.config.tools).length===0)throw Error("Can't start without tools");const e=this.prepareConfig();this.factory=new zn(e,this.config,this.Editor.API);const t=this.getListOfPrepareFunctions(e);if(t.length===0)return Promise.resolve();await uo(t,o=>{this.toolPrepareMethodSuccess(o)},o=>{this.toolPrepareMethodFallback(o)}),this.prepareBlockTools()}getAllInlineToolsSanitizeConfig(){const e={};return Array.from(this.inlineTools.values()).forEach(t=>{Object.assign(e,t.sanitizeConfig)}),e}destroy(){Object.values(this.available).forEach(async e=>{z(e.reset)&&await e.reset()})}get internalTools(){return{bold:{class:it,isInternal:!0},italic:{class:rt,isInternal:!0},link:{class:st,isInternal:!0},paragraph:{class:Dn,inlineToolbar:!0,isInternal:!0},stub:{class:Xt,isInternal:!0},moveUp:{class:Jt,isInternal:!0},delete:{class:Gt,isInternal:!0},moveDown:{class:Zt,isInternal:!0}}}toolPrepareMethodSuccess(e){const t=this.factory.get(e.toolName);if(t.isInline()){const o=["render","surround","checkState"].filter(n=>!t.create()[n]);if(o.length){H(`Incorrect Inline Tool: ${t.name}. Some of required methods is not implemented %o`,"warn",o),this.toolsUnavailable.set(t.name,t);return}}this.toolsAvailable.set(t.name,t)}toolPrepareMethodFallback(e){this.toolsUnavailable.set(e.toolName,this.factory.get(e.toolName))}getListOfPrepareFunctions(e){const t=[];return Object.entries(e).forEach(([o,n])=>{t.push({function:z(n.class.prepare)?n.class.prepare:()=>{},data:{toolName:o,config:n.config}})}),t}prepareBlockTools(){Array.from(this.blockTools.values()).forEach(e=>{this.assignInlineToolsToBlockTool(e),this.assignBlockTunesToBlockTool(e)})}assignInlineToolsToBlockTool(e){if(this.config.inlineToolbar!==!1){if(e.enabledInlineTools===!0){e.inlineTools=new oe(Array.isArray(this.config.inlineToolbar)?this.config.inlineToolbar.map(t=>[t,this.inlineTools.get(t)]):Array.from(this.inlineTools.entries()));return}Array.isArray(e.enabledInlineTools)&&(e.inlineTools=new oe(e.enabledInlineTools.map(t=>[t,this.inlineTools.get(t)])))}}assignBlockTunesToBlockTool(e){if(e.enabledBlockTunes!==!1){if(Array.isArray(e.enabledBlockTunes)){const t=new oe(e.enabledBlockTunes.map(o=>[o,this.blockTunes.get(o)]));e.tunes=new oe([...t,...this.blockTunes.internalTools]);return}if(Array.isArray(this.config.tunes)){const t=new oe(this.config.tunes.map(o=>[o,this.blockTunes.get(o)]));e.tunes=new oe([...t,...this.blockTunes.internalTools]);return}e.tunes=this.blockTunes.internalTools}}validateTools(){for(const e in this.config.tools)if(Object.prototype.hasOwnProperty.call(this.config.tools,e)){if(e in this.internalTools)return;const t=this.config.tools[e];if(!z(t)&&!z(t.class))throw Error(`Tool «${e}» must be a constructor function or an object with function in the «class» property`)}}prepareConfig(){const e={};for(const t in this.config.tools)V(this.config.tools[t])?e[t]=this.config.tools[t]:e[t]={class:this.config.tools[t]};return e}}Vn([xe],Qt.prototype,"getAllInlineToolsSanitizeConfig",1);const Wn=`:root{--selectionColor: #e1f2ff;--inlineSelectionColor: #d4ecff;--bg-light: #eff2f5;--grayText: #707684;--color-dark: #1D202B;--color-active-icon: #388AE5;--color-gray-border: rgba(201, 201, 204, .48);--content-width: 650px;--narrow-mode-right-padding: 50px;--toolbox-buttons-size: 26px;--toolbox-buttons-size--mobile: 36px;--icon-size: 20px;--icon-size--mobile: 28px;--block-padding-vertical: .4em;--color-line-gray: #EFF0F1 }.codex-editor{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:1}.codex-editor .hide{display:none}.codex-editor__redactor [contenteditable]:empty:after{content:"\\feff"}@media (min-width: 651px){.codex-editor--narrow .codex-editor__redactor{margin-right:50px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .codex-editor__redactor{margin-left:50px;margin-right:0}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__actions{right:-5px}}.codex-editor-copyable{position:absolute;height:1px;width:1px;top:-400%;opacity:.001}.codex-editor-overlay{position:fixed;top:0px;left:0px;right:0px;bottom:0px;z-index:999;pointer-events:none;overflow:hidden}.codex-editor-overlay__container{position:relative;pointer-events:auto;z-index:0}.codex-editor-overlay__rectangle{position:absolute;pointer-events:none;background-color:#2eaadc33;border:1px solid transparent}.codex-editor svg{max-height:100%}.codex-editor path{stroke:currentColor}.codex-editor ::-moz-selection{background-color:#d4ecff}.codex-editor ::selection{background-color:#d4ecff}.codex-editor--toolbox-opened [contentEditable=true][data-placeholder]:focus:before{opacity:0!important}.ce-scroll-locked{overflow:hidden}.ce-scroll-locked--hard{overflow:hidden;top:calc(-1 * var(--window-scroll-offset));position:fixed;width:100%}.ce-toolbar{position:absolute;left:0;right:0;top:0;-webkit-transition:opacity .1s ease;transition:opacity .1s ease;will-change:opacity,top;display:none}.ce-toolbar--opened{display:block}.ce-toolbar__content{max-width:650px;margin:0 auto;position:relative}.ce-toolbar__plus{color:#1d202b;cursor:pointer;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0}@media (max-width: 650px){.ce-toolbar__plus{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__plus:hover{background-color:#eff2f5}}.ce-toolbar__plus--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.ce-toolbar__plus-shortcut{opacity:.6;word-spacing:-2px;margin-top:5px}@media (max-width: 650px){.ce-toolbar__plus{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}
76.ce-toolbar__plus--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__plus--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__actions{position:absolute;right:100%;opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex;padding-right:5px}.ce-toolbar__actions--opened{opacity:1}@media (max-width: 650px){.ce-toolbar__actions{right:auto}}.ce-toolbar__settings-btn{color:#1d202b;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;margin-left:3px;cursor:pointer;user-select:none}@media (max-width: 650px){.ce-toolbar__settings-btn{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__settings-btn:hover{background-color:#eff2f5}}.ce-toolbar__settings-btn--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (min-width: 651px){.ce-toolbar__settings-btn{width:24px}}.ce-toolbar__settings-btn--hidden{display:none}@media (max-width: 650px){.ce-toolbar__settings-btn{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__settings-btn--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__settings-btn--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__plus svg,.ce-toolbar__settings-btn svg{width:24px;height:24px}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__plus{left:5px}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbox .ce-popover{right:0;left:auto;left:initial}}.ce-inline-toolbar{--y-offset: 8px;position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;-webkit-transform:translateX(-50%) translateY(8px) scale(.94);transform:translate(-50%) translateY(8px) scale(.94);opacity:0;visibility:hidden;-webkit-transition:opacity .25s ease,-webkit-transform .15s ease;transition:opacity .25s ease,-webkit-transform .15s ease;transition:transform .15s ease,opacity .25s ease;transition:transform .15s ease,opacity .25s ease,-webkit-transform .15s ease;will-change:transform,opacity;top:0;left:0;z-index:3}.ce-inline-toolbar--left-oriented:before{left:15px;margin-left:0}.ce-inline-toolbar--right-oriented:before{left:auto;right:15px;margin-left:0}.ce-inline-toolbar--showed{opacity:1;visibility:visible;-webkit-transform:translateX(-50%);transform:translate(-50%)}.ce-inline-toolbar--left-oriented{-webkit-transform:translateX(-23px) translateY(8px) scale(.94);transform:translate(-23px) translateY(8px) scale(.94)}.ce-inline-toolbar--left-oriented.ce-inline-toolbar--showed{-webkit-transform:translateX(-23px);transform:translate(-23px)}.ce-inline-toolbar--right-oriented{-webkit-transform:translateX(-100%) translateY(8px) scale(.94);transform:translate(-100%) translateY(8px) scale(.94);margin-left:23px}.ce-inline-toolbar--right-oriented.ce-inline-toolbar--showed{-webkit-transform:translateX(-100%);transform:translate(-100%)}.ce-inline-toolbar [hidden]{display:none!important}.ce-inline-toolbar__toggler-and-button-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:0 6px}.ce-inline-toolbar__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown{display:-webkit-box;display:-ms-flexbox;display:flex;padding:6px;margin:0 6px 0 -6px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-right:1px solid rgba(201,201,204,.48);-webkit-box-sizing:border-box;box-sizing:border-box}@media (hover: hover){.ce-inline-toolbar__dropdown:hover{background:#eff2f5}}.ce-inline-toolbar__dropdown--hidden{display:none}.ce-inline-toolbar__dropdown-content,.ce-inline-toolbar__dropdown-arrow{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown-content svg,.ce-inline-toolbar__dropdown-arrow svg{width:20px;height:20px}.ce-inline-toolbar__shortcut{opacity:.6;word-spacing:-3px;margin-top:3px}.ce-inline-tool{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:6px 1px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;border-radius:0;line-height:normal}.ce-inline-tool svg{width:20px;height:20px}@media (max-width: 650px){.ce-inline-tool svg{width:28px;height:28px}}@media (hover: hover){.ce-inline-tool:hover{background-color:#eff2f5}}.ce-inline-tool--active{color:#388ae5}.ce-inline-tool--focused{background:rgba(34,186,255,.08)!important}.ce-inline-tool--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.ce-inline-tool--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}
76.ce-inline-tool--link .icon--unlink,.ce-inline-tool--unlink .icon--link{display:none}.ce-inline-tool--unlink .icon--unlink{display:inline-block;margin-bottom:-1px}.ce-inline-tool-input{outline:none;border:0;border-radius:0 0 4px 4px;margin:0;font-size:13px;padding:10px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;font-weight:500;border-top:1px solid rgba(201,201,204,.48);-webkit-appearance:none;font-family:inherit}@media (max-width: 650px){.ce-inline-tool-input{font-size:15px;font-weight:500}}.ce-inline-tool-input::-webkit-input-placeholder{color:#707684}.ce-inline-tool-input::-moz-placeholder{color:#707684}.ce-inline-tool-input:-ms-input-placeholder{color:#707684}.ce-inline-tool-input::-ms-input-placeholder{color:#707684}.ce-inline-tool-input::placeholder{color:#707684}.ce-inline-tool-input--showed{display:block}.ce-conversion-toolbar{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;opacity:0;visibility:hidden;will-change:transform,opacity;-webkit-transition:opacity .1s ease,-webkit-transform .1s ease;transition:opacity .1s ease,-webkit-transform .1s ease;transition:transform .1s ease,opacity .1s ease;transition:transform .1s ease,opacity .1s ease,-webkit-transform .1s ease;-webkit-transform:translateY(-8px);transform:translateY(-8px);left:-1px;width:190px;margin-top:5px;-webkit-box-sizing:content-box;box-sizing:content-box}.ce-conversion-toolbar--left-oriented:before{left:15px;margin-left:0}.ce-conversion-toolbar--right-oriented:before{left:auto;right:15px;margin-left:0}.ce-conversion-toolbar--showed{opacity:1;visibility:visible;-webkit-transform:none;transform:none}.ce-conversion-toolbar [hidden]{display:none!important}.ce-conversion-toolbar__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-conversion-toolbar__label{color:#707684;font-size:11px;font-weight:500;letter-spacing:.33px;padding:10px 10px 5px;text-transform:uppercase}.ce-conversion-tool{display:-webkit-box;display:-ms-flexbox;display:flex;padding:5px 10px;font-size:14px;line-height:20px;font-weight:500;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ce-conversion-tool--hidden{display:none}.ce-conversion-tool--focused{background:rgba(34,186,255,.08)!important}.ce-conversion-tool--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.ce-conversion-tool--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.ce-conversion-tool:hover{background:#eff2f5}.ce-conversion-tool__icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:26px;height:26px;-webkit-box-shadow:0 0 0 1px rgba(201,201,204,.48);box-shadow:0 0 0 1px #c9c9cc7a;border-radius:5px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background:#fff;-webkit-box-sizing:content-box;box-sizing:content-box;-ms-flex-negative:0;flex-shrink:0;margin-right:10px}.ce-conversion-tool__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-conversion-tool__icon{width:36px;height:36px;border-radius:8px}.ce-conversion-tool__icon svg{width:28px;height:28px}}.ce-conversion-tool--last{margin-right:0!important}.ce-conversion-tool--active{color:#388ae5!important}.ce-conversion-tool--active{-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.ce-conversion-tool__secondary-label{color:#707684;font-size:12px;margin-left:auto;white-space:nowrap;letter-spacing:-.1em;padding-right:5px;margin-bottom:-2px;opacity:.6}@media (max-width: 650px){.ce-conversion-tool__secondary-label{display:none}}.ce-settings__button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:6px 1px;border-radius:3px;
76cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;line-height:32px}.ce-settings__button svg{width:20px;height:20px}@media (max-width: 650px){.ce-settings__button svg{width:28px;height:28px}}@media (hover: hover){.ce-settings__button:hover{background-color:#eff2f5}}.ce-settings__button--active{color:#388ae5}.ce-settings__button--focused{background:rgba(34,186,255,.08)!important}.ce-settings__button--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.ce-settings__button--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.ce-settings__button:not(:nth-child(3n+3)){margin-right:3px}.ce-settings__button:nth-child(n+4){margin-top:3px}.ce-settings__button--disabled{cursor:not-allowed!important}.ce-settings__button--disabled{opacity:.3}.ce-settings__button--selected{color:#388ae5}@media (min-width: 651px){.codex-editor--narrow .ce-settings .ce-popover{right:0;left:auto;left:initial}}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.ce-block{-webkit-animation:fade-in .3s ease;animation:fade-in .3s ease;-webkit-animation-fill-mode:none;animation-fill-mode:none;-webkit-animation-fill-mode:initial;animation-fill-mode:initial}.ce-block:first-of-type{margin-top:0}.ce-block--selected .ce-block__content{background:#e1f2ff}.ce-block--selected .ce-block__content [contenteditable]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ce-block--selected .ce-block__content img,.ce-block--selected .ce-block__content .ce-stub{opacity:.55}.ce-block--stretched .ce-block__content{max-width:none}.ce-block__content{position:relative;max-width:650px;margin:0 auto;-webkit-transition:background-color .15s ease;transition:background-color .15s ease}.ce-block--drop-target .ce-block__content:before{content:"";position:absolute;top:100%;left:-20px;margin-top:-1px;height:8px;width:8px;border:solid #388AE5;border-width:1px 1px 0 0;-webkit-transform-origin:right;transform-origin:right;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ce-block--drop-target .ce-block__content:after{content:"";position:absolute;top:100%;height:1px;width:100%;color:#388ae5;background:repeating-linear-gradient(90deg,#388AE5,#388AE5 1px,#fff 1px,#fff 6px)}.ce-block a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.ce-block b{font-weight:700}.ce-block i{font-style:italic}@media (min-width: 651px){.codex-editor--narrow .ce-block--focused{margin-right:-50px;padding-right:50px}
vendor: 16,023 bytes, line 76
76}@-webkit-keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}.cdx-block{padding:.4em 0}.cdx-block::-webkit-input-placeholder{line-height:normal!important}.cdx-input{border:1px solid rgba(201,201,204,.48);-webkit-box-shadow:inset 0 1px 2px 0 rgba(35,44,72,.06);box-shadow:inset 0 1px 2px #232c480f;border-radius:3px;padding:10px 12px;outline:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.cdx-input[data-placeholder]:before{position:static!important}.cdx-input[data-placeholder]:before{display:inline-block;width:0;white-space:nowrap;pointer-events:none}.cdx-settings-button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:6px 1px;border-radius:3px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;min-width:26px;min-height:26px}.cdx-settings-button svg{width:20px;height:20px}@media (max-width: 650px){.cdx-settings-button svg{width:28px;height:28px}}@media (hover: hover){.cdx-settings-button:hover{background-color:#eff2f5}}.cdx-settings-button--focused{background:rgba(34,186,255,.08)!important}.cdx-settings-button--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.cdx-settings-button--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.cdx-settings-button--active{color:#388ae5}.cdx-settings-button svg{width:auto;height:auto}@media (max-width: 650px){.cdx-settings-button{width:36px;height:36px;border-radius:8px}}.cdx-loader{position:relative;border:1px solid rgba(201,201,204,.48)}.cdx-loader:before{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-11px 0 0 -11px;border:2px solid rgba(201,201,204,.48);border-left-color:#388ae5;border-radius:50%;-webkit-animation:cdxRotation 1.2s infinite linear;animation:cdxRotation 1.2s infinite linear}@-webkit-keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.cdx-button{padding:13px;border-radius:3px;border:1px solid rgba(201,201,204,.48);font-size:14.9px;background:#fff;-webkit-box-shadow:0 2px 2px 0 rgba(18,30,57,.04);box-shadow:0 2px 2px #121e390a;color:#707684;text-align:center;cursor:pointer}@media (hover: hover){.cdx-button:hover{background:#FBFCFE;-webkit-box-shadow:0 1px 3px 0 rgba(18,30,57,.08);box-shadow:0 1px 3px #121e3914}}.cdx-button svg{height:20px;margin-right:.2em;margin-top:-2px}.ce-stub{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 18px;margin:10px 0;border-radius:10px;background:#eff2f5;border:1px solid #EFF0F1;color:#707684;font-size:14px}.ce-stub svg{width:20px;height:20px}.ce-stub__info{margin-left:14px}.ce-stub__title{font-weight:500;text-transform:capitalize}.codex-editor.codex-editor--rtl{direction:rtl}.codex-editor.codex-editor--rtl .cdx-list{padding-left:0;padding-right:40px}.codex-editor.codex-editor--rtl .ce-toolbar__plus{right:-26px;left:auto}.codex-editor.codex-editor--rtl .ce-toolbar__actions{right:auto;left:-26px}@media (max-width: 650px){.codex-editor.codex-editor--rtl .ce-toolbar__actions{margin-left:0;margin-right:auto;padding-right:0;padding-left:10px}}.codex-editor.codex-editor--rtl .ce-settings{left:5px;right:auto}.codex-editor.codex-editor--rtl .ce-settings:before{right:auto;left:25px}.codex-editor.codex-editor--rtl .ce-settings__button:not(:nth-child(3n+3)){margin-left:3px;margin-right:0}.codex-editor.codex-editor--rtl .ce-conversion-tool__icon{margin-right:0;margin-left:10px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown{border-right:0px solid transparent;border-left:1px solid rgba(201,201,204,.48);margin:0 -6px 0 6px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown .icon--toggler-down{margin-left:0;margin-right:4px}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__plus{left:0px;right:5px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__actions{left:-5px}}.cdx-search-field{--icon-margin-right: 10px;background:rgba(232,232,235,.49);border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:2px;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:auto}.cdx-search-field__icon{width:26px;height:26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:var(--icon-margin-right)}.cdx-search-field__icon svg{width:20px;height:20px;color:#707684}.cdx-search-field__input{font-size:14px;outline:none;font-weight:500;font-family:inherit;border:0;background:transparent;margin:0;padding:0;line-height:22px;min-width:calc(100% - 26px - var(--icon-margin-right))}.cdx-search-field__input::-webkit-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-moz-placeholder{color:#707684;font-weight:500}.cdx-search-field__input:-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::placeholder{color:#707684;font-weight:500}.ce-popover{--border-radius: 6px;--width: 200px;--max-height: 270px;--padding: 6px;--offset-from-target: 8px;--color-border: #e8e8eb;--color-shadow: rgba(13,20,33,.13);--color-background: white;--color-text-primary: black;--color-text-secondary: #707684;--color-border-icon: rgba(201, 201, 204, .48);--color-border-icon-disabled: #EFF0F1;--color-text-icon-active: #388AE5;--color-background-icon-active: rgba(56, 138, 229, .1);--color-background-item-focus: rgba(34, 186, 255, .08);--color-shadow-item-focus: rgba(7, 161, 227, .08);--color-background-item-hover: #eff2f5;--color-background-item-confirm: #E24A4A;--color-background-item-confirm-hover: #CE4343;min-width:var(--width);width:var(--width);max-height:var(--max-height);border-radius:var(--border-radius);overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 3px 15px -3px var(--color-shadow);box-shadow:0 3px 15px -3px var(--color-shadow);position:absolute;left:0;top:calc(100% + var(--offset-from-target));background:var(--color-background);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;z-index:4;opacity:0;max-height:0;pointer-events:none;padding:0;border:none}.ce-popover--opened{opacity:1;padding:var(--padding);max-height:var(--max-height);pointer-events:auto;-webkit-animation:panelShowing .1s ease;animation:panelShowing .1s ease;border:1px solid var(--color-border)}@media (max-width: 650px){.ce-popover--opened{-webkit-animation:panelShowingMobile .25s ease;animation:panelShowingMobile .25s ease}}.ce-popover__items{overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:contain}@media (max-width: 650px){.ce-popover__overlay{position:fixed;top:0;bottom:0;left:0;right:0;background:#1D202B;z-index:3;opacity:.5;-webkit-transition:opacity .12s ease-in;transition:opacity .12s ease-in;will-change:opacity;visibility:visible}}.ce-popover__overlay--hidden{display:none}.ce-popover--open-top{top:calc(-1 * (var(--offset-from-target) + var(--popover-height)))}@media (max-width: 650px){.ce-popover{--offset: 5px;position:fixed;max-width:none;min-width:calc(100% - var(--offset) * 2);left:var(--offset);right:var(--offset);bottom:calc(var(--offset) + env(safe-area-inset-bottom));top:auto;border-radius:10px}.ce-popover .ce-popover__search{display:none}}.ce-popover__search,.ce-popover__custom-content:not(:empty){margin-bottom:5px}.ce-popover__nothing-found-message{color:#707684;display:none;cursor:default;padding:3px;font-size:14px;line-height:20px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ce-popover__nothing-found-message--displayed{display:block}.ce-popover__custom-content:not(:empty){padding:4px}@media (min-width: 651px){.ce-popover__custom-content:not(:empty){padding:0}}.ce-popover__custom-content--hidden{display:none}.ce-popover-item{--border-radius: 6px;--icon-size: 20px;--icon-size-mobile: 28px;border-radius:var(--border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px;color:var(--color-text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media (max-width: 650px){.ce-popover-item{padding:4px}}.ce-popover-item:not(:last-of-type){margin-bottom:1px}.ce-popover-item__icon{border-radius:5px;width:26px;height:26px;-webkit-box-shadow:0 0 0 1px var(--color-border-icon);box-shadow:0 0 0 1px var(--color-border-icon);background:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:10px}.ce-popover-item__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-popover-item__icon{width:36px;height:36px;border-radius:8px}.ce-popover-item__icon svg{width:var(--icon-size-mobile);height:var(--icon-size-mobile)}}.ce-popover-item__title{font-size:14px;line-height:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (max-width: 650px){.ce-popover-item__title{font-size:16px}}.ce-popover-item__secondary-title{color:var(--color-text-secondary);font-size:12px;margin-left:auto;white-space:nowrap;letter-spacing:-.1em;padding-right:5px;margin-bottom:-2px;opacity:.6}@media (max-width: 650px){.ce-popover-item__secondary-title{display:none}}.ce-popover-item--active{background:var(--color-background-icon-active);color:var(--color-text-icon-active)}.ce-popover-item--active .ce-popover-item__icon{-webkit-box-shadow:none;box-shadow:none}.ce-popover-item--disabled{color:var(--color-text-secondary);cursor:default;pointer-events:none}.ce-popover-item--disabled .ce-popover-item__icon{-webkit-box-shadow:0 0 0 1px var(--color-border-icon-disabled);box-shadow:0 0 0 1px var(--color-border-icon-disabled)}.ce-popover-item--focused:not(.ce-popover-item--no-focus){background:var(--color-background-item-focus)!important}.ce-popover-item--focused:not(.ce-popover-item--no-focus){-webkit-box-shadow:inset 0 0 0px 1px var(--color-shadow-item-focus);box-shadow:inset 0 0 0 1px var(--color-shadow-item-focus)}.ce-popover-item--hidden{display:none}@media (hover: hover){.ce-popover-item:hover{cursor:pointer}.ce-popover-item:hover:not(.ce-popover-item--no-hover){background-color:var(--color-background-item-hover)}.ce-popover-item:hover .ce-popover-item__icon{-webkit-box-shadow:none;box-shadow:none}}.ce-popover-item--confirmation{background:var(--color-background-item-confirm)}.ce-popover-item--confirmation .ce-popover-item__icon{color:var(--color-background-item-confirm)}.ce-popover-item--confirmation .ce-popover-item__title{color:#fff}@media (hover: hover){.ce-popover-item--confirmation:not(.ce-popover-item--no-hover):hover{background:var(--color-background-item-confirm-hover)}}.ce-popover-item--confirmation:not(.ce-popover-item--no-focus).ce-popover-item--focused{background:var(--color-background-item-confirm-hover)!important}.ce-popover-item--confirmation .ce-popover-item__icon,.ce-popover-item--active .ce-popover-item__icon,.ce-popover-item--focused .ce-popover-item__icon{-webkit-box-shadow:none;box-shadow:none}@-webkit-keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.wobble{-webkit-animation-name:wobble;animation-name:wobble;-webkit-animation-duration:.4s;animation-duration:.4s}@-webkit-keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}
76 77`;class Yn extends D{constructor(){super(...arguments),this.isMobile=!1,this.contentRectCache=void 0,this.resizeDebouncer=go(()=>{this.windowResize()},200)}get CSS(){return{editorWrapper:"codex-editor",editorWrapperNarrow:"codex-editor--narrow",editorZone:"codex-editor__redactor",editorZoneHidden:"codex-editor__redactor--hidden",editorEmpty:"codex-editor--empty",editorRtlFix:"codex-editor--rtl"}}get contentRect(){if(this.contentRectCache)return this.contentRectCache;const e=this.nodes.wrapper.querySelector(`.${ie.CSS.content}`);return e?(this.contentRectCache=e.getBoundingClientRect(),this.contentRectCache):{width:650,left:0,right:0}}async prepare(){this.checkIsMobile(),this.make(),this.loadStyles()}toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}checkEmptiness(){const{BlockManager:e}=this.Editor;this.nodes.wrapper.classList.toggle(this.CSS.editorEmpty,e.isEditorEmpty)}get someToolbarOpened(){const{Toolbar:e,BlockSettings:t,InlineToolbar:o,ConversionToolbar:n}=this.Editor;return t.opened||o.opened||n.opened||e.toolbox.opened}get someFlipperButtonFocused(){return this.Editor.Toolbar.toolbox.hasFocus()?!0:Object.entries(this.Editor).filter(([e,t])=>t.flipper instanceof se).some(([e,t])=>t.flipper.hasFocus())}destroy(){this.nodes.holder.innerHTML=""}closeAllToolbars(){const{Toolbar:e,BlockSettings:t,InlineToolbar:o,ConversionToolbar:n}=this.Editor;t.close(),o.close(),n.close(),e.toolbox.close()}checkIsMobile(){this.isMobile=window.innerWidth<It}make(){this.nodes.holder=w.getHolder(this.config.holder),this.nodes.wrapper=w.make("div",[this.CSS.editorWrapper,...this.isRtl?[this.CSS.editorRtlFix]:[]]),this.nodes.redactor=w.make("div",this.CSS.editorZone),this.nodes.holder.offsetWidth<this.contentRect.width&&this.nodes.wrapper.classList.add(this.CSS.editorWrapperNarrow),this.nodes.redactor.style.paddingBottom=this.config.minHeight+"px",this.nodes.wrapper.appendChild(this.nodes.redactor),this.nodes.holder.appendChild(this.nodes.wrapper)}loadStyles(){const e="editor-js-styles";if(w.get(e))return;const t=w.make("style",null,{id:e,textContent:Wn.toString()});w.prepend(document.head,t)}enableModuleBindings(){this.readOnlyMutableListeners.on(this.nodes.redactor,"click",e=>{this.redactorClicked(e)},!1),this.readOnlyMutableListeners.on(this.nodes.redactor,"mousedown",e=>{this.documentTouched(e)},!0),this.readOnlyMutableListeners.on(this.nodes.redactor,"touchstart",e=>{this.documentTouched(e)},!0),this.readOnlyMutableListeners.on(document,"keydown",e=>{this.documentKeydown(e)},!0),this.readOnlyMutableListeners.on(document,"mousedown",e=>{this.documentClicked(e)},!0),this.readOnlyMutableListeners.on(document,"selectionchange",()=>{this.selectionChanged()},!0),this.readOnlyMutableListeners.on(window,"resize",()=>{this.resizeDebouncer()},{passive:!0}),this.watchBlockHoveredEvents()}watchBlockHoveredEvents(){let e;this.readOnlyMutableListeners.on(this.nodes.redactor,"mousemove",je(t=>{const o=t.target.closest(".ce-block");this.Editor.BlockSelection.anyBlockSelected||o&&e!==o&&(e=o,this.eventsDispat
77cher.emit($t,{block:this.Editor.BlockManager.getBlockByChildNode(o)}))},20),{passive:!0})}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}windowResize(){this.contentRectCache=null,this.checkIsMobile()}documentKeydown(e){switch(e.keyCode){case N.ENTER:this.enterPressed(e);break;case N.BACKSPACE:case N.DELETE:this.backspacePressed(e);break;case N.ESC:this.escapePressed(e);break;default:this.defaultBehaviour(e);break}}defaultBehaviour(e){const{currentBlock:t}=this.Editor.BlockManager,o=e.target.closest(`.${this.CSS.editorWrapper}`),n=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;if(t!==void 0&&o===null){this.Editor.BlockEvents.keydown(e);return}o||t&&n||(this.Editor.BlockManager.dropPointer(),this.Editor.Toolbar.close())}backspacePressed(e){const{BlockManager:t,BlockSelection:o,Caret:n}=this.Editor;if(o.anyBlockSelected&&!A.isSelectionExists){const i=t.removeSelectedBlocks();n.setToBlock(t.insertDefaultBlockAtIndex(i,!0),n.positions.START),o.clearSelection(e),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}}escapePressed(e){this.Editor.BlockSelection.clearSelection(e),this.Editor.Toolbar.toolbox.opened?(this.Editor.Toolbar.toolbox.close(),this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock)):this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.ConversionToolbar.opened?this.Editor.ConversionToolbar.close():this.Editor.InlineToolbar.opened?this.Editor.InlineToolbar.close():this.Editor.Toolbar.close()}enterPressed(e){const{BlockManager:t,BlockSelection:o}=this.Editor,n=t.currentBlockIndex>=0;if(o.anyBlockSelected&&!A.isSelectionExists){o.clearSelection(e),e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}if(!this.someToolbarOpened&&n&&e.target.tagName==="BODY"){const i=this.Editor.BlockManager.insert();this.Editor.Caret.setToBlock(i),this.Editor.BlockManager.highlightCurrentNode(),this.Editor.Toolbar.moveAndOpen(i)}this.Editor.BlockSelection.clearSelection(e)}documentClicked(e){if(!e.isTrusted)return;const t=e.target;this.nodes.holder.contains(t)||A.isAtEditor||(this.Editor.BlockManager.dropPointer(),this.Editor.Toolbar.close());const o=this.Editor.BlockSettings.nodes.wrapper.contains(t),n=this.Editor.Toolbar.nodes.settingsToggler.contains(t),i=o||n;if(this.Editor.BlockSettings.opened&&!i){this.Editor.BlockSettings.close();const r=this.Editor.BlockManager.getBlockByChildNode(t);this.Editor.Toolbar.moveAndOpen(r)}this.Editor.BlockSelection.clearSelection(e)}documentTouched(e){let t=e.target;if(t===this.nodes.redactor){const o=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,n=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;t=document.elementFromPoint(o,n)}try{this.Editor.BlockManager.setCurrentBlockByChildNode(t),this.Editor.BlockManager.highlightCurrentNode()}catch{this.Editor.RectangleSelection.isRectActivated()||this.Editor.Caret.setToTheLastBlock()}this.Editor.Toolbar.moveAndOpen()}redactorClicked(e){const{BlockSelection:t}=this.Editor;if(!A.isCollapsed)return;const o=()=>{e.stopImmediatePropagation(),e.stopPropagation()},n=e.target,i=e.metaKey||e.ctrlKey;if(w.isAnchor(n)&&i){o();const l=n.getAttribute("href"),h=bo(l);ko(h);return}const r=this.Editor.BlockManager.getBlockByIndex(-1),a=w.offset(r.holder).bottom,c=e.pageY;if(e.target instanceof Element&&e.target.isEqualNode(this.nodes.redactor)&&!t.anyBlockSelected&&a<c){o();const{BlockManager:l,Caret:h,Toolbar:d}=this.Editor;(!l.lastBlock.tool.isDefault||!l.lastBlock.isEmpty)&&l.insertAtEnd(),h.setToTheLastBlock(),d.moveAndOpen(l.lastBlock)}}selectionChanged(){const{CrossBlockSelection:e,BlockSelection:t}=this.Editor,o=A.anchorElement;if(e.isCrossBlockSelectionStarted&&t.anyBlockSelected&&A.get().removeAllRanges(),!o){A.range||this.Editor.InlineToolbar.close();return}const n=o.closest(`.${ie.CSS.content}`)===null;if(n&&(this.Editor.InlineToolbar.containsNode(o)||this.Editor.InlineToolbar.close(),o.dataset.inlineToolbar!=="true"))return;this.Editor.BlockManager.currentBlock||this.Editor.BlockManager.setCurrentBlockByChildNode(o);const i=n!==!0;this.Editor.InlineToolbar.tryToShow(!0,i)}}const qn={BlocksAPI:Lo,CaretAPI:Io,EventsAPI:_o,I18nAPI:Ge,API:Oo,InlineToolbarAPI:Ao,ListenersAPI:Ro,NotifierAPI:Ho,ReadOnlyAPI:Fo,SanitizerAPI:Yo,SaverAPI:qo,SelectionAPI:Xo,StylesAPI:Ko,ToolbarAPI:Zo,TooltipAPI:Qo,UiAPI:en,BlockSettings:mn,ConversionToolbar:X,Toolbar:xn,InlineToolbar:Cn,BlockEvents:Sn,BlockManager:Bn,BlockSelection:Mn,Caret:Oe,CrossBlockSelection:Ln,DragNDrop:In,ModificationsObserver:_n,Paste:qt,ReadOnly:On,RectangleSelection:Be,Renderer:An,Saver:Rn,Tools:Qt,UI:Yn};class Xn{constructor(e){this.moduleInstances={}
vendor: 3,945 bytes, lines 77-83
77,this.eventsDispatcher=new Ne;let t,o;this.isReady=new Promise((n,i)=>{t=n,o=i}),Promise.resolve().then(async()=>{this.configuration=e,this.validate(),this.init(),await this.start(),await this.render();const{BlockManager:n,Caret:i,UI:r,ModificationsObserver:a}=this.moduleInstances;r.checkEmptiness(),a.enable(),this.configuration.autofocus&&(i.setToBlock(n.blocks[0],i.positions.START),n.highlightCurrentNode()),t()}).catch(n=>{H(`Editor.js is not ready because of ${n}`,"error"),o(n)})}set configuration(e){var t,o;V(e)?this.config={...e}:this.config={holder:e},Ue(!!this.config.holderId,"config.holderId","config.holder"),this.config.holderId&&!this.config.holder&&(this.config.holder=this.config.holderId,this.config.holderId=null),this.config.holder==null&&(this.config.holder="editorjs"),this.config.logLevel||(this.config.logLevel=Bt.VERBOSE),co(this.config.logLevel),Ue(!!this.config.initialBlock,"config.initialBlock","config.defaultBlock"),this.config.defaultBlock=this.config.defaultBlock||this.config.initialBlock||"paragraph",this.config.minHeight=this.config.minHeight!==void 0?this.config.minHeight:300;const n={type:this.config.defaultBlock,data:{}};this.config.placeholder=this.config.placeholder||!1,this.config.sanitizer=this.config.sanitizer||{p:!0,b:!0,a:!0},this.config.hideToolbar=this.config.hideToolbar?this.config.hideToolbar:!1,this.config.tools=this.config.tools||{},this.config.i18n=this.config.i18n||{},this.config.data=this.config.data||{blocks:[]},this.config.onReady=this.config.onReady||(()=>{}),this.config.onChange=this.config.onChange||(()=>{}),this.config.inlineToolbar=this.config.inlineToolbar!==void 0?this.config.inlineToolbar:!0,(ee(this.config.data)||!this.config.data.blocks||this.config.data.blocks.length===0)&&(this.config.data={blocks:[n]}),this.config.readOnly=this.config.readOnly||!1,(t=this.config.i18n)!=null&&t.messages&&q.setDictionary(this.config.i18n.messages),this.config.i18n.direction=((o=this.config.i18n)==null?void 0:o.direction)||"ltr"}get configuration(){return this.config}validate(){const{holderId:e,holder:t}=this.config;if(e&&t)throw Error("«holderId» and «holder» param can't assign at the same time.");if(ce(t)&&!w.get(t))throw Error(`element with ID «${t}» is missing. Pass correct holder's ID.`);if(t&&V(t)&&!w.isElement(t))throw Error("«holder» value must be an Element node")}init(){this.constructModules(),this.configureModules()}async start(){await["Tools","UI","BlockManager","Paste","BlockSelection","RectangleSelection","CrossBlockSelection","ReadOnly"].reduce((e,t)=>e.then(async()=>{try{await this.moduleInstances[t].prepare()}catch(o){if(o instanceof Ot)throw new Error(o.message);H(`Module ${t} was skipped because of %o`,"warn",o)}}),Promise.resolve())}render(){return this.moduleInstances.Renderer.render(this.config.data.blocks)}constructModules(){Object.entries(qn).forEach(([e,t])=>{try{this.moduleInstances[e]=new t({config:this.configuration,eventsDispatcher:this.eventsDispatcher})}catch(o){H("[constructModules]",`Module ${e} skipped because`,"error",o)}})}configureModules(){for(const e in this.moduleInstances)Object.prototype.hasOwnProperty.call(this.moduleInstances,e)&&(this.moduleInstances[e].state=this.getModulesDiff(e))}getModulesDiff(e){const t={};for(const o in this.moduleInstances)o!==e&&(t[o]=this.moduleInstances[o]);return t}}/** 78 * Editor.js 79 * 80 * @license Apache-2.0 81 * @see Editor.js <https://editorjs.io> 82 * @author CodeX Team <https://codex.so> 83 */class Kn{static get version(){return"2.28.2"}constructor(e){let t=()=>{};V(e)&&z(e.onReady)&&(t=e.onReady);const o=new Xn(e);this.isReady=o.isReady.then(()=>{this.exportAPI(o),t()})}exportAPI(e){const t=["configuration"],o=()=>{Object.values(e.moduleInstances).forEach(n=>{z(n.destroy)&&n.destroy(),n.listeners.removeAll()}),e=null;for(const n in this)Object.prototype.hasOwnProperty.call(this,n)&&delete this[n];Object.setPrototypeOf(this,null)};t.forEach(n=>{this[n]=e[n]}
83),this.destroy=o,Object.setPrototypeOf(this,e.moduleInstances.API.methods),delete this.exportAPI,Object.entries({blocks:{clear:"clear",render:"render"},caret:{focus:"focus"},events:{on:"on",off:"off",emit:"emit"},saver:{save:"save"}}).forEach(([n,i])=>{Object.entries(i).forEach(([r,a])=>{this[a]=e.moduleInstances.API.methods[n][r]})})}}(function(){try{if(typeof document<"u"){var s=document.createElement("style");s.appendChild(document.createTextNode(".ce-header{padding:.6em 0 3px;margin:0;line-height:1.25em;outline:none}.ce-header p,.ce-header div{padding:0!important;margin:0!important}.ce-header[contentEditable=true][data-placeholder]:before{position:absolute;content:attr(data-placeholder);color:#707684;font-weight:400;display:none;cursor:text}.ce-header[contentEditable=true][data-placeholder]:empty:before{display:block}.ce-header[contentEditable=true][data-placeholder]:empty:focus:before{display:none}")),document.head.appendChild(s)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const Zn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M19 17V10.2135C19 10.1287 18.9011 10.0824 18.836 10.1367L16 12.5"/></svg>',Gn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 11C16 10 19 9.5 19 12C19 13.9771 16.0684 13.9997 16.0012 16.8981C15.9999 16.9533 16.0448 17 16.1 17L19.3 17"/></svg>',Jn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 11C16 10.5 16.8323 10 17.6 10C18.3677 10 19.5 10.311 19.5 11.5C19.5 12.5315 18.7474 12.9022 18.548 12.9823C18.5378 12.9864 18.5395 13.0047 18.5503 13.0063C18.8115 13.0456 20 13.3065 20 14.8C20 16 19.5 17 17.8 17C17.8 17 16 17 16 16.3"/></svg>',Qn='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M18 10L15.2834 14.8511C15.246 14.9178 15.294 15 15.3704 15C16.8489 15 18.7561 15 20.2 15M19 17C19 15.7187 19 14.8813 19 13.6"/></svg>',ei='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 15.9C16 15.9 16.3768 17 17.8 17C19.5 17 20 15.6199 20 14.7C20 12.7323 17.6745 12.0486 16.1635 12.9894C16.094 13.0327 16 12.9846 16 12.9027V10.1C16 10.0448 16.0448 10 16.1 10H19.8"/></svg>',ti='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M19.5 10C16.5 10.5 16 13.3285 16 15M16 15V15C16 16.1046 16.8954 17 18 17H18.3246C19.3251 17 20.3191 16.3492 20.2522 15.3509C20.0612 12.4958 16 12.6611 16 15Z"/></svg>',oi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9 7L9 12M9 17V12M9 12L15 12M15 7V12M15 17L15 12"/></svg>';/** 84 * Header block for the Editor.js. 85 * 86 * @author CodeX ([email protected]) 87 * @copyright CodeX 2018 88 * @license MIT 89 * @version 2.0.0 90 */let ni=class{constructor({data:e,config:t,api:o,readOnly:n}){this.api=o,this.readOnly=n,this._CSS={block:this.api.styles.block,wrapper:"ce-header"},this._settings=t,this._data=this.normalizeData(e),this._element=this.getTag()}normalizeData(e){const t={};return typeof e!="object"&&(e={}),t.text=e.text||"",t.level=parseInt(e.level)||this.defaultLevel.number,t}render(){return this._element}renderSettings(){return this.levels.map(e=>({icon:e.svg,label:this.api.i18n.t(`Heading ${e.number}`),onActivate:()=>this.setLevel(e.number),closeOnActivate:!0,isActive:this.currentLevel.number===e.number}))}setLevel(e){this.data={level:e,text:this.data.text}}merge(e){const t={text:this.data.text+e.text,level:this.data.level};this.data=t}validate(e){return e.text.trim()!==""}save(e){return{text:e.innerHTML,level:this.currentLevel.number}}static get conversionConfig(){return{export:"text",import:"text"}}static get sanitize(){return{level:!1,text:{}}}static get isReadOnlySupported(){return!0}get data(){return this._data.text=this._element.innerHTML,this._data.level=this.currentLevel.number,this._data}set data(e){if(this._data=this.normalizeData(e),e.level!==void 0&&this._element.parentNode){const t=this.getTag();t.innerHTML=this._element.innerHTML,this._element.parentNode.replaceChild(t,this._element),this._element=t}e.text!==void 0&&(this._element.innerHTML=this._data.text||"")}getTag(){const e=document.createElement(this.currentLevel.tag);return e.innerHTML=this._data.text||"",e.classList.add(this._CSS.wrapper),e.contentEditable=this.readOnly?"false":"true",e.dataset.placeholder=this.api.i18n.t(this._settings.placeholder||""),e}get currentLevel(){let e=this.levels.find(t=>t.number===this._data.level);return e||(e=this.defaultLevel),e}get defaultLevel(){if(this._settings.defaultLevel){const e=this.levels.find(t=>t.number===this._settings.defaultLevel);
90if(e)return e;console.warn("(à¸'Ì-'Ì)ภHeading Tool: the default level specified was not found in available levels")}return this.levels[1]}get levels(){const e=[{number:1,tag:"H1",svg:Zn},{number:2,tag:"H2",svg:Gn},{number:3,tag:"H3",svg:Jn},{number:4,tag:"H4",svg:Qn},{number:5,tag:"H5",svg:ei},{number:6,tag:"H6",svg:ti}];return this._settings.levels?e.filter(t=>this._settings.levels.includes(t.number)):e}onPaste(e){const t=e.detail.data;let o=this.defaultLevel.number;switch(t.tagName){case"H1":o=1;break;case"H2":o=2;break;case"H3":o=3;break;case"H4":o=4;break;case"H5":o=5;break;case"H6":o=6;break}this._settings.levels&&(o=this._settings.levels.reduce((n,i)=>Math.abs(i-o)<Math.abs(n-o)?i:n)),this.data={level:o,text:t.innerHTML}}static get pasteConfig(){return{tags:["H1","H2","H3","H4","H5","H6"]}}static get toolbox(){return{icon:oi,title:"Heading"}}};var eo={exports:{}};(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="/",n(n.s=4)}([function(t,o,n){var i=n(1),r=n(2);typeof(r=r.__esModule?r.default:r)=="string"&&(r=[[t.i,r,""]]);var a={insert:"head",singleton:!1};i(r,a),t.exports=r.locals||{}},function(t,o,n){var i,r=function(){return i===void 0&&(i=!!(window&&document&&document.all&&!window.atob)),i},a=function(){var b={};return function(k){if(b[k]===void 0){var v=document.querySelector(k);if(window.HTMLIFrameElement&&v instanceof window.HTMLIFrameElement)try{v=v.contentDocument.head}catch{v=null}b[k]=v}return b[k]}}(),c=[];function l(b){for(var k=-1,v=0;v<c.length;v++)if(c[v].identifier===b){k=v;break}return k}function h(b,k){for(var v={},B=[],_=0;_<b.length;_++){var E=b[_],C=k.base?E[0]+k.base:E[0],L=v[C]||0,S="".concat(C," ").concat(L);v[C]=L+1;var T=l(S),M={css:E[1],media:E[2],sourceMap:E[3]};T!==-1?(c[T].references++,c[T].updater(M)):c.push({identifier:S,updater:x(M,k),references:1}),B.push(S)}return B}function d(b){var k=document.createElement("style"),v=b.attributes||{};if(v.nonce===void 0){var B=n.nc;B&&(v.nonce=B)}if(Object.keys(v).forEach(function(E){k.setAttribute(E,v[E])}),typeof b.insert=="function")b.insert(k);else{var _=a(b.insert||"head");if(!_)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");_.appendChild(k)}return k}
vendor: 1,126 bytes, lines 90-92
90var p,g=(p=[],function(b,k){return p[b]=k,p.filter(Boolean).join(` 91`)});function f(b,k,v,B){var _=v?"":B.media?"@media ".concat(B.media," {").concat(B.css,"}"):B.css;if(b.styleSheet)b.styleSheet.cssText=g(k,_);else{var E=document.createTextNode(_),C=b.childNodes;C[k]&&b.removeChild(C[k]),C.length?b.insertBefore(E,C[k]):b.appendChild(E)}}function u(b,k,v){var B=v.css,_=v.media,E=v.sourceMap;if(_?b.setAttribute("media",_):b.removeAttribute("media"),E&&typeof btoa<"u"&&(B+=` 92/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(E))))," */")),b.styleSheet)b.styleSheet.cssText=B;else{for(;b.firstChild;)b.removeChild(b.firstChild);b.appendChild(document.createTextNode(B))}}var m=null,y=0;function x(b,k){var v,B,_;if(k.singleton){var E=y++;v=m||(m=d(k)),B=f.bind(null,v,E,!1),_=f.bind(null,v,E,!0)}else v=d(k),B=u.bind(null,v,k),_=function(){(function(C){if(C.parentNode===null)return!1;C.parentNode.removeChild(C)})(v)};return B(b),function(C){if(C){if(C.css===b.css&&C.media===b.media&&C.sourceMap===b.sourceMap)return;B(b=C)}else _()}}t.exports=function(b,k){(k=k||{}
92).singleton||typeof k.singleton=="boolean"||(k.singleton=r());var v=h(b=b||[],k);return function(B){if(B=B||[],Object.prototype.toString.call(B)==="[object Array]"){for(var _=0;_<v.length;_++){var E=l(v[_]);c[E].references--}for(var C=h(B,k),L=0;L<v.length;L++){var S=l(v[L]);c[S].references===0&&(c[S].updater(),c.splice(S,1))}v=C}}}},function(t,o,n){(o=n(3)(!1)).push([t.i,`.cdx-underline { 93 text-decoration: underline; 94} 95`,""]),t.exports=o},function(t,o,n){t.exports=function(i){var r=[];return r.toString=function(){return this.map(function(a){var c=function(l,h){var d=l[1]||"",p=l[3];if(!p)return d;if(h&&typeof btoa=="function"){var g=(u=p,m=btoa(unescape(encodeURIComponent(JSON.stringify(u)))),y="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(m),"/*# ".concat(y," */")),f=p.sources.map(function(x){return"/*# sourceURL=".concat(p.sourceRoot||"").concat(x," */")});return[d].concat(f).concat([g]).join(` 96`)}var u,m,y;return[d].join(` 97`)}(a,i);return a[2]?"@media ".concat(a[2]," {").concat(c,"}"):c}).join("")},r.i=function(a,c,l){typeof a=="string"&&(a=[[null,a,""]]);var h={};if(l)for(var d=0;d<this.length;d++){var p=this[d][0];p!=null&&(h[p]=!0)}for(var g=0;g<a.length;g++){var f=[].concat(a[g]);l&&h[f[0]]||(c&&(f[2]?f[2]="".concat(c," and ").concat(f[2]):f[2]=c),r.push(f))}},r}},function(t,o,n){n.r(o),n.d(o,"default",function(){return a}),n(0);function i(c){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(c)}function r(c,l){for(var h=0;h<l.length;h++){var d=l[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,(p=d.key,g=void 0,g=function(f,u){if(i(f)!=="object"||f===null)return f;var m=f[Symbol.toPrimitive];if(m!==void 0){var y=m.call(f,u||"default");if(i(y)!=="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(f)}(p,"string"),i(g)==="symbol"?g:String(g)),d)}var p,g}var a=function(){function c(p){var g=p.api;(function(f,u){if(!(f instanceof u))throw new TypeError("Cannot call a class as a function")})(this,c),this.api=g,this.button=null,this.tag="U",this.iconClasses={base:this.api.styles.inlineToolButton,active:this.api.styles.inlineToolButtonActive}}var l,h,d;return l=c,d=[{key:"CSS",get:function(){return"cdx-underline"}},{key:"isInline",get:function(){return!0}},{key:"sanitize",get:function(){return{u:{class:c.CSS}}}}],(h=[{key:"render",value:function(){return this.button=document.createElement("button"),this.button.type="button",this.button.classList.add(this.iconClasses.base),this.button.innerHTML=this.toolboxIcon,this.button}},{key:"surround",value:function(p){if(p){var g=this.api.selection.findParentTag(this.tag,c.CSS);g?this.unwrap(g):this.wrap(p)}}},{key:"wrap",value:function(p){var g=document.createElement(this.tag);g.classList.add(c.CSS),g.appendChild(p.extractContents()),p.insertNode(g),this.api.selection.expandToTag(g)}},{key:"unwrap",value:function(p){this.api.selection.expandToTag(p);var g=window.getSelection(),f=g.getRangeAt(0),u=f.extractContents();p.parentNode.removeChild(p),f.insertNode(u),g.removeAllRanges(),g.addRange(f)}},{key:"checkState",value:function(){var p=this.api.selection.findParentTag(this.tag,c.CSS);this.button.classList.toggle(this.iconClasses.active,!!p)}},{key:"toolboxIcon",get:function(){return'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 7.5V11.5C9 12.2956 9.31607 13.0587 9.87868 13.6213C10.4413 14.1839 11.2044 14.5 12 14.5C12.7956 14.5 13.5587 14.1839 14.1213 13.6213C14.6839 13.0587 15 12.2956 15 11.5V7.5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7.71429 18H16.2857"/></svg>'}}])&&r(l.prototype,h),d&&r(l,d),Object.defineProperty(l,"prototype",{writable:!1}),c}()}]).default})})(eo);var ii=eo.exports;const ri=Tt(ii);(function(){try{if(typeof document<"u"){var s=document.createElement("style");s.appendChild(document.createTextNode('.image-tool{--bg-color: #cdd1e0;--front-color: #388ae5;--border-color: #e8e8eb}.image-tool__image{border-radius:3px;overflow:hidden;margin-bottom:10px}.image-tool__image-picture{max-width:100%;vertical-align:bottom;display:block}.image-tool__image-preloader{width:50px;height:50px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-color:var(--bg-color);background-position:center center}.image-tool__image-preloader:after{content:"";position:absolute;z-index:3;width:60px;height:60px;border-radius:50%;border:2px solid var(--bg-color);border-top-color:var(--front-color);left:50%;
97top:50%;margin-top:-30px;margin-left:-30px;animation:image-preloader-spin 2s infinite linear;box-sizing:border-box}.image-tool__caption[contentEditable=true][data-placeholder]:before{position:absolute!important;content:attr(data-placeholder);color:#707684;font-weight:400;display:none}.image-tool__caption[contentEditable=true][data-placeholder]:empty:before{display:block}.image-tool__caption[contentEditable=true][data-placeholder]:empty:focus:before{display:none}.image-tool--empty .image-tool__image,.image-tool--empty .image-tool__caption,.image-tool--loading .image-tool__caption{display:none}.image-tool .cdx-button{display:flex;align-items:center;justify-content:center}.image-tool .cdx-button svg{height:auto;margin:0 6px 0 0}.image-tool--filled .cdx-button,.image-tool--filled .image-tool__image-preloader{display:none}.image-tool--loading .image-tool__image{min-height:200px;display:flex;border:1px solid var(--border-color);background-color:#fff}.image-tool--loading .image-tool__image-picture,.image-tool--loading .cdx-button{display:none}.image-tool--withBorder .image-tool__image{border:1px solid var(--border-color)}.image-tool--withBackground .image-tool__image{padding:15px;background:var(--bg-color)}.image-tool--withBackground .image-tool__image-picture{max-width:60%;margin:0 auto}.image-tool--stretched .image-tool__image-picture{width:100%}@keyframes image-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}')),document.head.appendChild(s)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const si='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19V19C9.13623 19 8.20435 19 7.46927 18.6955C6.48915 18.2895 5.71046 17.5108 5.30448 16.5307C5 15.7956 5 14.8638 5 13V12C5 9.19108 5 7.78661 5.67412 6.77772C5.96596 6.34096 6.34096 5.96596 6.77772 5.67412C7.78661 5 9.19108 5 12 5H13.5C14.8956 5 15.5933 5 16.1611 5.17224C17.4395 5.56004 18.44 6.56046 18.8278 7.83886C19 8.40666 19 9.10444 19 10.5V10.5"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 13V16M16 19V16M19 16H16M16 16H13"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6.5 17.5L17.5 6.5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.9919 10.5H19.0015"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.9919 19H11.0015"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13L13 5"/></svg>',ai='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.9919 9.5H19.0015"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.5 5H14.5096"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.625 5H15C17.2091 5 19 6.79086 19 9V9.375"/><path stroke="currentColor" stroke-width="2" d="M9.375 5L9 5C6.79086 5 5 6.79086 5 9V9.375"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.3725 5H9.38207"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 9.5H5.00957"/><path stroke="currentColor" stroke-width="2" d="M9.375 19H9C6.79086 19 5 17.2091 5 15V14.625"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.3725 19H9.38207"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 14.55H5.00957"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 13V16M16 19V16M19 16H16M16 16H13"/></svg>',to='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.13968 15.32L8.69058 11.5661C9.02934 11.2036 9.48873 11 9.96774 11C10.4467 11 10.9061 11.2036 11.2449 11.5661L15.3871 16M13.5806 14.0664L15.0132 12.533C15.3519 12.1705 15.8113 11.9668 16.2903 11.9668C16.7693 11.9668 17.2287 12.1705 17.5675 12.533L18.841 13.9634"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.7778 9.33331H13.7867"/></svg>',li='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
97<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9L20 12L17 15"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 12H20"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 9L4 12L7 15"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 12H10"/></svg>';function pe(s,e=null,t={}){const o=document.createElement(s);Array.isArray(e)?o.classList.add(...e):e&&o.classList.add(e);for(const n in t)o[n]=t[n];return o}class G{constructor({api:e,config:t,onSelectFile:o,readOnly:n}){this.api=e,this.config=t,this.onSelectFile=o,this.readOnly=n,this.nodes={wrapper:pe("div",[this.CSS.baseClass,this.CSS.wrapper]),imageContainer:pe("div",[this.CSS.imageContainer]),fileButton:this.createFileButton(),imageEl:void 0,imagePreloader:pe("div",this.CSS.imagePreloader),caption:pe("div",[this.CSS.input,this.CSS.caption],{contentEditable:!this.readOnly})},this.nodes.caption.dataset.placeholder=this.config.captionPlaceholder,this.nodes.imageContainer.appendChild(this.nodes.imagePreloader),this.nodes.wrapper.appendChild(this.nodes.imageContainer),this.nodes.wrapper.appendChild(this.nodes.caption),this.nodes.wrapper.appendChild(this.nodes.fileButton)}get CSS(){return{baseClass:this.api.styles.block,loading:this.api.styles.loader,input:this.api.styles.input,button:this.api.styles.button,wrapper:"image-tool",imageContainer:"image-tool__image",imagePreloader:"image-tool__image-preloader",imageEl:"image-tool__image-picture",caption:"image-tool__caption"}}static get status(){return{EMPTY:"empty",UPLOADING:"loading",FILLED:"filled"}}render(e){return!e.file||Object.keys(e.file).length===0?this.toggleStatus(G.status.EMPTY):this.toggleStatus(G.status.UPLOADING),this.nodes.wrapper}createFileButton(){const e=pe("div",[this.CSS.button]);return e.innerHTML=this.config.buttonContent||`${to} ${this.api.i18n.t("Select an Image")}`,e.addEventListener("click",()=>{this.onSelectFile()}),e}showPreloader(e){this.nodes.imagePreloader.style.backgroundImage=`url(${e})`,this.toggleStatus(G.status.UPLOADING)}hidePreloader(){this.nodes.imagePreloader.style.backgroundImage="",this.toggleStatus(G.status.EMPTY)}fillImage(e){const t=/\.mp4$/.test(e)?"VIDEO":"IMG",o={src:e};let n="load";t==="VIDEO"&&(o.autoplay=!0,o.loop=!0,o.muted=!0,o.playsinline=!0,n="loadeddata"),this.nodes.imageEl=pe(t,this.CSS.imageEl,o),this.nodes.imageEl.addEventListener(n,()=>{this.toggleStatus(G.status.FILLED),this.nodes.imagePreloader&&(this.nodes.imagePreloader.style.backgroundImage="")}),this.nodes.imageContainer.appendChild(this.nodes.imageEl)}fillCaption(e){this.nodes.caption&&(this.nodes.caption.innerHTML=e)}toggleStatus(e){for(const t in G.status)Object.prototype.hasOwnProperty.call(G.status,t)&&this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${G.status[t]}`,e===G.status[t])}applyTune(e,t){this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${e}`,t)}}function ci(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var oo={exports:{}};(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=3)}([function(t,o){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}t.exports=n},function(t,o,n){(function(i){var r=n(2),a=setTimeout;function c(){}function l(m){if(!(this instanceof l))throw new TypeError("Promises must be constructed via new");if(typeof m!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],u(m,this)}function h(m,y){for(;m._state===3;
vendor: 15,655 bytes, lines 97-111
97)m=m._value;m._state!==0?(m._handled=!0,l._immediateFn(function(){var x=m._state===1?y.onFulfilled:y.onRejected;if(x!==null){var b;try{b=x(m._value)}catch(k){return void p(y.promise,k)}d(y.promise,b)}else(m._state===1?d:p)(y.promise,m._value)})):m._deferreds.push(y)}function d(m,y){try{if(y===m)throw new TypeError("A promise cannot be resolved with itself.");if(y&&(typeof y=="object"||typeof y=="function")){var x=y.then;if(y instanceof l)return m._state=3,m._value=y,void g(m);if(typeof x=="function")return void u((b=x,k=y,function(){b.apply(k,arguments)}),m)}m._state=1,m._value=y,g(m)}catch(v){p(m,v)}var b,k}function p(m,y){m._state=2,m._value=y,g(m)}function g(m){m._state===2&&m._deferreds.length===0&&l._immediateFn(function(){m._handled||l._unhandledRejectionFn(m._value)});for(var y=0,x=m._deferreds.length;y<x;y++)h(m,m._deferreds[y]);m._deferreds=null}function f(m,y,x){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.promise=x}function u(m,y){var x=!1;try{m(function(b){x||(x=!0,d(y,b))},function(b){x||(x=!0,p(y,b))})}catch(b){if(x)return;x=!0,p(y,b)}}l.prototype.catch=function(m){return this.then(null,m)},l.prototype.then=function(m,y){var x=new this.constructor(c);return h(this,new f(m,y,x)),x},l.prototype.finally=r.a,l.all=function(m){return new l(function(y,x){if(!m||m.length===void 0)throw new TypeError("Promise.all accepts an array");var b=Array.prototype.slice.call(m);if(b.length===0)return y([]);var k=b.length;function v(_,E){try{if(E&&(typeof E=="object"||typeof E=="function")){var C=E.then;if(typeof C=="function")return void C.call(E,function(L){v(_,L)},x)}b[_]=E,--k==0&&y(b)}catch(L){x(L)}}for(var B=0;B<b.length;B++)v(B,b[B])})},l.resolve=function(m){return m&&typeof m=="object"&&m.constructor===l?m:new l(function(y){y(m)})},l.reject=function(m){return new l(function(y,x){x(m)})},l.race=function(m){return new l(function(y,x){for(var b=0,k=m.length;b<k;b++)m[b].then(y,x)})},l._immediateFn=typeof i=="function"&&function(m){i(m)}||function(m){a(m,0)},l._unhandledRejectionFn=function(m){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",m)},o.a=l}).call(this,n(5).setImmediate)},function(t,o,n){o.a=function(i){var r=this.constructor;return this.then(function(a){return r.resolve(i()).then(function(){return a})},function(a){return r.resolve(i()).then(function(){return r.reject(a)})})}},function(t,o,n){function i(u){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(u)}n(4);var r,a,c,l,h,d,p,g=n(8),f=(a=function(u){return new Promise(function(m,y){u=l(u),(u=h(u)).beforeSend&&u.beforeSend();var x=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");x.open(u.method,u.url),x.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(u.headers).forEach(function(k){var v=u.headers[k];x.setRequestHeader(k,v)});var b=u.ratio;x.upload.addEventListener("progress",function(k){var v=Math.round(k.loaded/k.total*100),B=Math.ceil(v*b/100);u.progress(Math.min(B,100))},!1),x.addEventListener("progress",function(k){var v=Math.round(k.loaded/k.total*100),B=Math.ceil(v*(100-b)/100)+b;u.progress(Math.min(B,100))},!1),x.onreadystatechange=function(){if(x.readyState===4){var k=x.response;try{k=JSON.parse(k)}catch{}var v=g.parseHeaders(x.getAllResponseHeaders()),B={body:k,code:x.status,headers:v};p(x.status)?m(B):y(B)}},x.send(u.data)})},c=function(u){return u.method="POST",a(u)},l=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(u.url&&typeof u.url!="string")throw new Error("Url must be a string");if(u.url=u.url||"",u.method&&typeof u.method!="string")throw new Error("`method` must be a string or null");if(u.method=u.method?u.method.toUpperCase():"GET",u.headers&&i(u.headers)!=="object")throw new Error("`headers` must be an object or null");if(u.headers=u.headers||{},u.type&&(typeof u.type!="string"||!Object.values(r).includes(u.type)))throw new Error("`type` must be taken from module's «contentType» library");if(u.progress&&typeof u.progress!="function")throw new Error("`progress` must be a function or null");if(u.progress=u.progress||function(m){},u.beforeSend=u.beforeSend||function(m){},u.ratio&&typeof u.ratio!="number")throw new Error("`ratio` must be a number");if(u.ratio<0||u.ratio>100)throw new Error("`ratio` must be in a 0-100 interval");if(u.ratio=u.ratio||90,u.accept&&typeof u.accept!="string")throw new Error("`accept` must be a string with a list of allowed mime-types");if(u.accept=u.accept||"*/*",u.multiple&&typeof u.multiple!="boolean")throw new Error("`multiple` must be a true or false");if(u.multiple=u.multiple||!1,u.fieldName&&typeof u.fieldName!="string")throw new Error("`fieldName` must be a string");return u.fieldName=u.fieldName||"files",u},h=function(u){switch(u.method){case"GET":var m=d(u.data,r.URLENCODED);delete u.data,u.url=/\?/.test(u.url)?u.url+"&"+m:u.url+"?"+m;break;case"POST":case"PUT":case"DELETE":case"UPDATE":var y=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).type||r.JSON}(u);(g.isFormData(u.data)||g.isFormElement(u.data))&&(y=r.FORM),u.data=d(u.data,y),y!==f.contentType.FORM&&(u.headers["content-type"]=y)}return u},d=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};switch(arguments.length>1?arguments[1]:void 0){case r.URLENCODED:return g.urlEncode(u);case r.JSON:return g.jsonEncode(u);case r.FORM:return g.formEncode(u);default:return u}},p=function(u){return u>=200&&u<300},{contentType:r={URLENCODED:"application/x-www-form-urlencoded; charset=utf-8",FORM:"multipart/form-data",JSON:"application/json; charset=utf-8"},request:a,get:function(u){return u.method="GET",a(u)},post:c,transport:function(u){return u=l(u),g.selectFiles(u).then(function(m){for(var y=new FormData,x=0;x<m.length;x++)y.append(u.fieldName,m[x],m[x].name);g.isObject(u.data)&&Object.keys(u.data).forEach(function(k){var v=u.data[k];y.append(k,v)});var b=u.beforeSend;return u.beforeSend=function(){return b(m)},u.data=y,c(u)})},selectFiles:function(u){return delete(u=l(u)).beforeSend,g.selectFiles(u)}});t.exports=f},function(t,o,n){n.r(o);var i=n(1);window.Promise=window.Promise||i.a},function(t,o,n){(function(i){var r=i!==void 0&&i||typeof self<"u"&&self||window,a=Function.prototype.apply;function c(l,h){this._id=l,this._clearFn=h}o.setTimeout=function(){return new c(a.call(setTimeout,r,arguments),clearTimeout)},o.setInterval=function(){return new c(a.call(setInterval,r,arguments),clearInterval)},o.clearTimeout=o.clearInterval=function(l){l&&l.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(r,this._id)},o.enroll=function(l,h){clearTimeout(l._idleTimeoutId),l._idleTimeout=h},o.unenroll=function(l){clearTimeout(l._idleTimeoutId),l._idleTimeout=-1},o._unrefActive=o.active=function(l){clearTimeout(l._idleTimeoutId);var h=l._idleTimeout;h>=0&&(l._idleTimeoutId=setTimeout(function(){l._onTimeout&&l._onTimeout()},h))},n(6),o.setImmediate=typeof self<"u"&&self.setImmediate||i!==void 0&&i.setImmediate||this&&this.setImmediate,o.clearImmediate=typeof self<"u"&&self.clearImmediate||i!==void 0&&i.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},function(t,o,n){(function(i,r){(function(a,c){if(!a.setImmediate){var l,h,d,p,g,f=1,u={},m=!1,y=a.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(a);x=x&&x.setTimeout?x:a,{}.toString.call(a.process)==="[object process]"?l=function(v){r.nextTick(function(){k(v)})}:function(){if(a.postMessage&&!a.importScripts){var v=!0,B=a.onmessage;return a.onmessage=function(){v=!1},a.postMessage("","*"),a.onmessage=B,v}}()?(p="setImmediate$"+Math.random()+"$",g=function(v){v.source===a&&typeof v.data=="string"&&v.data.indexOf(p)===0&&k(+v.data.slice(p.length))},a.addEventListener?a.addEventListener("message",g,!1):a.attachEvent("onmessage",g),l=function(v){a.postMessage(p+v,"*")}):a.MessageChannel?((d=new MessageChannel).port1.onmessage=function(v){k(v.data)},l=function(v){d.port2.postMessage(v)}):y&&"onreadystatechange"in y.createElement("script")?(h=y.documentElement,l=function(v){var B=y.createElement("script");B.onreadystatechange=function(){k(v),B.onreadystatechange=null,h.removeChild(B),B=null},h.appendChild(B)}):l=function(v){setTimeout(k,0,v)},x.setImmediate=function(v){typeof v!="function"&&(v=new Function(""+v));for(var B=new Array(arguments.length-1),_=0;_<B.length;_++)B[_]=arguments[_+1];var E={callback:v,args:B};return u[f]=E,l(f),f++},x.clearImmediate=b}function b(v){delete u[v]}function k(v){if(m)setTimeout(k,0,v);else{var B=u[v];if(B){m=!0;try{(function(_){var E=_.callback,C=_.args;switch(C.length){case 0:E();break;case 1:E(C[0]);break;case 2:E(C[0],C[1]);break;case 3:E(C[0],C[1],C[2]);break;default:E.apply(c,C)}})(B)}finally{b(v),m=!1}}}}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,n(0),n(7))},function(t,o){var n,i,r=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function l(x){if(n===setTimeout)return setTimeout(x,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(x,0);try{return n(x,0)}catch{try{return n.call(null,x,0)}catch{return n.call(this,x,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:a}catch{n=a}try{i=typeof clearTimeout=="function"?clearTimeout:c}catch{i=c}})();var h,d=[],p=!1,g=-1;function f(){p&&h&&(p=!1,h.length?d=h.concat(d):g=-1,d.length&&u())}function u(){if(!p){var x=l(f);p=!0;for(var b=d.length;b;){for(h=d,d=[];++g<b;)h&&h[g].run();g=-1,b=d.length}h=null,p=!1,function(k){if(i===clearTimeout)return clearTimeout(k);if((i===c||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(k);try{i(k)}catch{try{return i.call(null,k)}catch{return i.call(this,k)}}}(x)}}function m(x,b){this.fun=x,this.array=b}function y(){}r.nextTick=function(x){var b=new Array(arguments.length-1);if(arguments.length>1)for(var k=1;k<arguments.length;k++)b[k-1]=arguments[k];d.push(new m(x,b)),d.length!==1||p||l(u)},m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,r.listeners=function(x){return[]},r.binding=function(x){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(x){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,o,n){function i(a,c){for(var l=0;l<c.length;l++){var h=c[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}var r=n(9);t.exports=function(){function a(){(function(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")})(this,a)}var c,l,h;return c=a,h=[{key:"urlEncode",value:function(d){return r(d)}},{key:"jsonEncode",value:function(d){return JSON.stringify(d)}},{key:"formEncode",value:function(d){if(this.isFormData(d))return d;if(this.isFormElement(d))return new FormData(d);if(this.isObject(d)){var p=new FormData;return Object.keys(d).forEach(function(g){var f=d[g];p.append(g,f)}),p}throw new Error("`data` must be an instance of Object, FormData or <FORM> HTMLElement")}},{key:"isObject",value:function(d){return Object.prototype.toString.call(d)==="[object Object]"}},{key:"isFormData",value:function(d){return d instanceof FormData}},{key:"isFormElement",value:function(d){return d instanceof HTMLFormElement}},{key:"selectFiles",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(p,g){var f=document.createElement("INPUT");f.type="file",d.multiple&&f.setAttribute("multiple","multiple"),d.accept&&f.setAttribute("accept",d.accept),f.style.display="none",document.body.appendChild(f),f.addEventListener("change",function(u){var m=u.target.files;p(m),document.body.removeChild(f)},!1),f.click()})}},{key:"parseHeaders",value:function(d){var p=d.trim().split(/[\r\n]+/),g={};return p.forEach(function(f){var u=f.split(": "),m=u.shift(),y=u.join(": ");m&&(g[m]=y)}),g}}],(l=null)&&i(c.prototype,l),h&&i(c,h),a}()},function(t,o){var n=function(r){return encodeURIComponent(r).replace(/[!'()*]/g,escape).replace(/%20/g,"+")},i=function(r,a,c,l){return a=a||null,c=c||"&",l=l||null,r?function(h){for(var d=new Array,p=0;p<h.length;p++)h[p]&&d.push(h[p]);return d}(Object.keys(r).map(function(h){var d,p,g=h;if(l&&(g=l+"["+g+"]"),typeof r[h]=="object"&&r[h]!==null)d=i(r[h],null,c,g);else{a&&(p=g,g=!isNaN(parseFloat(p))&&isFinite(p)?a+Number(g):g);var f=r[h];f=(f=(f=(f=f===!0?"1":f)===!1?"0":f)===0?"0":f)||"",d=n(g)+"="+n(f)}return d})).join(c).replace(/[!'()*]/g,""):""};t.exports=i}])})})(oo);var di=oo.exports;const fe=ci(di);function Fe(s){return s&&typeof s.then=="function"}class hi{constructor({config:e,onUpload:t,onError:o}){this.config=e,this.onUpload=t,this.onError=o}uploadSelectedFile({onPreview:e}){const t=function(n){const i=new FileReader;i.readAsDataURL(n),i.onload=r=>{e(r.target.result)}};let o;this.config.uploader&&typeof this.config.uploader.uploadByFile=="function"?o=fe.selectFiles({accept:this.config.types}).then(n=>{t(n[0]);const i=this.config.uploader.uploadByFile(n[0]);return Fe(i)||console.warn("Custom uploader method uploadByFile should return a Promise"),i}):o=fe.transport({url:this.config.endpoints.byFile,data:this.config.additionalRequestData,accept:this.config.types,headers:this.config.additionalRequestHeaders,beforeSend:n=>{t(n[0])},fieldName:this.config.field}).then(n=>n.body),o.then(n=>{this.onUpload(n)}).catch(n=>{this.onError(n)})}uploadByUrl(e){let t;this.config.uploader&&typeof this.config.uploader.uploadByUrl=="function"?(t=this.config.uploader.uploadByUrl(e),Fe(t)||console.warn("Custom uploader method uploadByUrl should return a Promise")):t=fe.post({url:this.config.endpoints.byUrl,data:Object.assign({url:e},this.config.additionalRequestData),type:fe.contentType.JSON,headers:this.config.additionalRequestHeaders}).then(o=>o.body),t.then(o=>{this.onUpload(o)}).catch(o=>{this.onError(o)})}uploadByFile(e,{onPreview:t}){const o=new FileReader;o.readAsDataURL(e),o.onload=i=>{t(i.target.result)};let n;if(this.config.uploader&&typeof this.config.uploader.uploadByFile=="function")n=this.config.uploader.uploadByFile(e),Fe(n)||console.warn("Custom uploader method uploadByFile should return a Promise");else{const i=new FormData;i.append(this.config.field,e),this.config.additionalRequestData&&Object.keys(this.config.additionalRequestData).length&&Object.entries(this.config.additionalRequestData).forEach(([r,a])=>{i.append(r,a)}),n=fe.post({url:this.config.endpoints.byFile,data:i,type:fe.contentType.JSON,headers:this.config.additionalRequestHeaders}).then(r=>r.body)}n.then(i=>{this.onUpload(i)}).catch(i=>{this.onError(i)})}}/** 98 * Image Tool for the Editor.js 99 * 100 * @author CodeX <[email protected]> 101 * @license MIT 102 * @see {@link https://github.com/editor-js/image} 103 * 104 * To developers. 105 * To simplify Tool structure, we split it to 4 parts: 106 * 1) index.js â main Tool's interface, public API and methods for working with data 107 * 2) uploader.js â module that has methods for sending files via AJAX: from device, by URL or File pasting 108 * 3) ui.js â module for UI manipulations: render, showing preloader, etc 109 * 4) tunes.js â working with Block Tunes: render buttons, handle clicks 110 * 111 * For debug purposes there is a testing server
112 * that can save uploaded files and return a Response {@link UploadResponseFormat} 113 * 114 * $ node dev/server.js 115 * 116 * It will expose 8008 port, so you can pass http://localhost:8008 with the Tools config: 117 * 118 * image: { 119 * class: ImageTool, 120 * config: { 121 * endpoints: { 122 * byFile: 'http://localhost:8008/uploadFile', 123 * byUrl: 'http://localhost:8008/fetchUrl', 124 * } 125 * }, 126 * }, 127 */class Ae{static get isReadOnlySupported(){return!0}static get toolbox(){return{icon:to,title:"Image"}}static get tunes(){return[{name:"withBorder",icon:ai,title:"With border",toggle:!0},{name:"stretched",icon:li,title:"Stretch image",toggle:!0},{name:"withBackground",icon:si,title:"With background",toggle:!0}]}constructor({data:e,config:t,api:o,readOnly:n,block:i}){this.api=o,this.readOnly=n,this.block=i,this.config={endpoints:t.endpoints||"",additionalRequestData:t.additionalRequestData||{},additionalRequestHeaders:t.additionalRequestHeaders||{},field:t.field||"image",types:t.types||"image/*",captionPlaceholder:this.api.i18n.t(t.captionPlaceholder||"Caption"),buttonContent:t.buttonContent||"",uploader:t.uploader||void 0,actions:t.actions||[]},this.uploader=new hi({config:this.config,onUpload:r=>this.onUpload(r),onError:r=>this.uploadingFailed(r)}),this.ui=new G({api:o,config:this.config,onSelectFile:()=>{this.uploader.uploadSelectedFile({onPreview:r=>{this.ui.showPreloader(r)}})},readOnly:n}),this._data={},this.data=e}render(){return this.ui.render(this.data)}validate(e){return e.file&&e.file.url}save(){const e=this.ui.nodes.caption;return this._data.caption=e.innerHTML,this.data}renderSettings(){return Ae.tunes.concat(this.config.actions).map(e=>({icon:e.icon,label:this.api.i18n.t(e.title),name:e.name,toggle:e.toggle,isActive:this.data[e.name],onActivate:()=>{if(typeof e.action=="function"){e.action(e.name);return}this.tuneToggled(e.name)}}))}appendCallback(){this.ui.nodes.fileButton.click()}static get pasteConfig(){return{tags:[{img:{src:!0}}],patterns:{image:/https?:\/\/\S+\.(gif|jpe?g|tiff|png|svg|webp)(\?[a-z0-9=]*)?$/i},files:{mimeTypes:["image/*"]}}}async onPaste(e){switch(e.type){case"tag":{const t=e.detail.data;if(/^blob:/.test(t.src)){const o=await(await fetch(t.src)).blob();this.uploadFile(o);break}this.uploadUrl(t.src);break}case"pattern":{const t=e.detail.data;this.uploadUrl(t);break}case"file":{const t=e.detail.file;this.uploadFile(t);break}}}set data(e){this.image=e.file,this._data.caption=e.caption||"",this.ui.fillCaption(this._data.caption),Ae.tunes.forEach(({name:t})=>{const o=typeof e[t]<"u"?e[t]===!0||e[t]==="true":!1;this.setTune(t,o)})}get data(){return this._data}set image(e){this._data.file=e||{},e&&e.url&&this.ui.fillImage(e.url)}onUpload(e){e.success&&e.file?this.image=e.file:this.uploadingFailed("incorrect response: "+JSON.stringify(e))}uploadingFailed(e){console.log("Image Tool: uploading failed because of",e),this.api.notifier.show({message:this.api.i18n.t("Couldnât upload image. Please try another."),style:"error"}),this.ui.hidePreloader()}tuneToggled(e){this.setTune(e,!this._data[e])}setTune(e,t){this._data[e]=t,this.ui.applyTune(e,t),e==="stretched"&&Promise.resolve().then(()=>{this.block.stretched=t}).catch(o=>{console.error(o)})}uploadFile(e){this.uploader.uploadByFile(e,{onPreview:t=>{this.ui.showPreloader(t)}})}uploadUrl(e){this.ui.showPreloader(e),this.uploader.uploadByUrl(e)}}(function(){try{if(typeof document<"u"){var s=document.createElement("style");s.appendChild(document.createTextNode(".cdx-list{margin:0;padding-left:40px;outline:none}.cdx-list__item{padding:5.5px 0 5.5px 3px;line-height:1.6em}.cdx-list--unordered{list-style:disc}.cdx-list--ordered{list-style:decimal}.cdx-list-settings{display:flex}.cdx-list-settings .cdx-settings-button{width:50%}")),document.head.appendChild(s)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const kt='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><line x1="9" x2="19" y1="7" y2="7" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="9" x2="19" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="9" x2="19" y1="17" y2="17" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.00001 17H4.99002"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.00001 12H4.99002"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.00001 7H4.99002"/></svg>',ui='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><line x1="12" x2="19" y1="7" y2="7" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="12" x2="19" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="12" x2="19" y1="17" y2="17" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7.79999 14L7.79999 7.2135C7.79999 7.12872 7.7011 7.0824 7.63597 7.13668L4.79999 9.5"/></svg>';class pi{static get isReadOnlySupported(){return!0}static get enableLineBreaks(){return!0}static get toolbox(){return{icon:kt,title:"List"}}constructor({data:e,config:t,api:o,readOnly:n}){this._elements={wrapper:null},this.api=o,this.readOnly=n,this.settings=[{name:"unordered",label:this.api.i18n.t("Unordered"),icon:kt,default:t.defaultStyle==="unordered"||!1},{name:"ordered",label:this.api.i18n.t("Ordered"),icon:ui,default:t.defaultStyle==="ordered"||!0}],this._data={style:this.settings.find(i=>i.default===!0).name,items:[]},this.data=e}render(){return this._elements.wrapper=this.makeMainTag(this._data.style),this._data.items.length?this._data.items.forEac
127h(e=>{this._elements.wrapper.appendChild(this._make("li",this.CSS.item,{innerHTML:e}))}):this._elements.wrapper.appendChild(this._make("li",this.CSS.item)),this.readOnly||this._elements.wrapper.addEventListener("keydown",e=>{const[t,o]=[13,8];switch(e.keyCode){case t:this.getOutofList(e);break;case o:this.backspace(e);break}},!1),this._elements.wrapper}save(){return this.data}static get conversionConfig(){return{export:e=>e.items.join(". "),import:e=>({items:[e],style:"unordered"})}}static get sanitize(){return{style:{},items:{br:!0}}}renderSettings(){return this.settings.map(e=>({...e,isActive:this._data.style===e.name,closeOnActivate:!0,onActivate:()=>this.toggleTune(e.name)}))}onPaste(e){const t=e.detail.data;this.data=this.pasteHandler(t)}static get pasteConfig(){return{tags:["OL","UL","LI"]}}makeMainTag(e){const t=e==="ordered"?this.CSS.wrapperOrdered:this.CSS.wrapperUnordered,o=e==="ordered"?"ol":"ul";return this._make(o,[this.CSS.baseBlock,this.CSS.wrapper,t],{contentEditable:!this.readOnly})}toggleTune(e){const t=this.makeMainTag(e);for(;this._elements.wrapper.hasChildNodes();)t.appendChild(this._elements.wrapper.firstChild);this._elements.wrapper.replaceWith(t),this._elements.wrapper=t,this._data.style=e}get CSS(){return{baseBlock:this.api.styles.block,wrapper:"cdx-list",wrapperOrdered:"cdx-list--ordered",wrapperUnordered:"cdx-list--unordered",item:"cdx-list__item"}}set data(e){e||(e={}),this._data.style=e.style||this.settings.find(o=>o.default===!0).name,this._data.items=e.items||[];const t=this._elements.wrapper;t&&t.parentNode.replaceChild(this.render(),t)}get data(){this._data.items=[];const e=this._elements.wrapper.querySelectorAll(`.${this.CSS.item}`);for(let t=0;t<e.length;t++)e[t].innerHTML.replace("<br>"," ").trim()&&this._data.items.push(e[t].innerHTML);return this._data}_make(e,t=null,o={}){const n=document.createElement(e);Array.isArray(t)?n.classList.add(...t):t&&n.classList.add(t);for(const i in o)n[i]=o[i];return n}get currentItem(){let e=window.getSelection().anchorNode;return e.nodeType!==Node.ELEMENT_NODE&&(e=e.parentNode),e.closest(`.${this.CSS.item}`)}getOutofList(e){const t=this._elements.wrapper.querySelectorAll("."+this.CSS.item);if(t.length<2)return;const o=t[t.length-1],n=this.currentItem;n===o&&!o.textContent.trim().length&&(n.parentElement.removeChild(n),this.api.blocks.insert(),this.api.caret.setToBlock(this.api.blocks.getCurrentBlockIndex()),e.preventDefault(),e.stopPropagation())}backspace(e){const t=this._elements.wrapper.querySelectorAll("."+this.CSS.item),o=t[0];o&&t.length<2&&!o.innerHTML.replace("<br>"," ").trim()&&e.preventDefault()}selectItem(e){e.preventDefault();const t=window.getSelection(),o=t.anchorNode.parentNode,n=o.closest("."+this.CSS.item),i=new Range;i.selectNodeContents(n),t.removeAllRanges(),t.addRange(i)}pasteHandler(e){const{tagName:t}=e;let o;switch(t){case"OL":o="ordered";break;case"UL":case"LI":o="unordered"}const n={style:o,items:[]};if(t==="LI")n.items=[e.innerHTML];else{const i=Array.from(e.querySelectorAll("LI"));n.items=i.map(r=>r.innerHTML).filter(r=>!!r.trim())}return n}}(function(){try{if(typeof document<"u"){var s=document.createElement("style");s.appendChild(document.createTextNode('.tc-wrap{--color-background:#f9f9fb;--color-text-secondary:#7b7e89;--color-border:#e8e8eb;--cell-size:34px;--toolbox-icon-size:18px;--toolbox-padding:6px;--toolbox-aiming-field-size:calc(var(--toolbox-icon-size) + var(--toolbox-padding)*2);border-left:0;position:relative;height:100%;width:100%;margin-top:var(--toolbox-icon-size);box-sizing:border-box;display:grid;grid-template-columns:calc(100% - var(--cell-size)) var(--cell-size)}.tc-wrap--readonly{grid-template-columns:100% var(--cell-size)}.tc-wrap svg{vertical-align:top}@media print{.tc-wrap{border-left-color:var(--color-border);border-left-style:solid;border-left-width:1px;grid-template-columns:100% var(--cell-size)}}@media print{.tc-wrap .tc-row:after{display:none}}.tc-table{position:relative;width:100%;height:100%;display:grid;font-size:14px;border-top:1px solid var(--color-border);line-height:1.4}.tc-table:after{width:calc(var(--cell-size));height:100%;left:calc(var(--cell-size)*-1);top:0}.tc-table:after,.tc-table:before{position:absolute;content:""}.tc-table:before{width:100%;height:var(--toolbox-aiming-field-size);top:calc(var(--toolbox-aiming-field-size)*-1);left:0}.tc-table--heading .tc-row:first-child{font-weight:600;border-bottom:2px solid var(--color-border)}.tc-table--heading .tc-row:first-child [contenteditable]:empty:before{content:attr(heading);color:var(--color-text-secondary)}.tc-table--heading .tc-row:first-child:after{bottom:-2px;border-bottom:2px solid var(--color-border)}.tc-add-column,.tc-add-row{display:flex;color:var(--color-text-secondary)}@media print{.tc-add{display:none}}.tc-add-column{padding:4px 0;justify-content:center;border-top:1px solid var(--color-border)}@media print{.tc-add-column{display:none}}.tc-add-row{height:var(--cell-size);align-items:center;padding-left:4px;position:relative}.tc-add-row:before{content:"";position:absolute;right:calc(var(--cell-size)*-1);width:var(--cell-size);height:100%}@media print{.tc-add-row{display:none}}.tc-add-column,.tc-add-row{transition:0s;cursor:pointer;will-change:background-color}
127.tc-add-column:hover,.tc-add-row:hover{transition:background-color .1s ease;background-color:var(--color-background)}.tc-add-row{margin-top:1px}.tc-add-row:hover:before{transition:.1s;background-color:var(--color-background)}.tc-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(10px,1fr));position:relative;border-bottom:1px solid var(--color-border)}.tc-row:after{content:"";pointer-events:none;position:absolute;width:var(--cell-size);height:100%;bottom:-1px;right:calc(var(--cell-size)*-1);border-bottom:1px solid var(--color-border)}.tc-row--selected{background:var(--color-background)}.tc-row--selected:after{background:var(--color-background)}.tc-cell{border-right:1px solid var(--color-border);padding:6px 12px;overflow:hidden;outline:none;line-break:normal}.tc-cell--selected{background:var(--color-background)}.tc-wrap--readonly .tc-row:after{display:none}.tc-toolbox{--toolbox-padding:6px;--popover-margin:30px;--toggler-click-zone-size:30px;--toggler-dots-color:#7b7e89;--toggler-dots-color-hovered:#1d202b;position:absolute;cursor:pointer;z-index:1;opacity:0;transition:opacity .1s;will-change:left,opacity}.tc-toolbox--column{top:calc(var(--toggler-click-zone-size)*-1);transform:translate(calc(var(--toggler-click-zone-size)*-1/2));will-change:left,opacity}.tc-toolbox--row{left:calc(var(--popover-margin)*-1);transform:translateY(calc(var(--toggler-click-zone-size)*-1/2));margin-top:-1px;will-change:top,opacity}.tc-toolbox--showed{opacity:1}.tc-toolbox .tc-popover{position:absolute;top:0;left:var(--popover-margin)}.tc-toolbox__toggler{display:flex;align-items:center;justify-content:center;width:var(--toggler-click-zone-size);height:var(--toggler-click-zone-size);color:var(--toggler-dots-color);opacity:0;transition:opacity .15s ease;will-change:opacity}.tc-toolbox__toggler:hover{color:var(--toggler-dots-color-hovered)}.tc-toolbox__toggler svg{fill:currentColor}.tc-wrap:hover .tc-toolbox__toggler{opacity:1}.tc-settings .cdx-settings-button{width:50%;margin:0}.tc-popover{--color-border:#eaeaea;--color-background:#fff;--color-background-hover:rgba(232,232,235,.49);--color-background-confirm:#e24a4a;--color-background-confirm-hover:#d54040;--color-text-confirm:#fff;background:var(--color-background);border:1px solid var(--color-border);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;padding:6px;display:none;will-change:opacity,transform}.tc-popover--opened{display:block;animation:menuShowing .1s cubic-bezier(.215,.61,.355,1) forwards}.tc-popover__item{display:flex;align-items:center;padding:2px 14px 2px 2px;border-radius:5px;cursor:pointer;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tc-popover__item:hover{background:var(--color-background-hover)}.tc-popover__item:not(:last-of-type){margin-bottom:2px}.tc-popover__item-icon{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;background:var(--color-background);border-radius:5px;border:1px solid var(--color-border);margin-right:8px}.tc-popover__item-label{line-height:22px;font-size:14px;font-weight:500}.tc-popover__item--confirm{background:var(--color-background-confirm);color:var(--color-text-confirm)}.tc-popover__item--confirm:hover{background-color:var(--color-background-confirm-hover)}.tc-popover__item--confirm .tc-popover__item-icon{background:var(--color-background-confirm);border-color:#0000001a}.tc-popover__item--confirm .tc-popover__item-icon svg{transition:transform .2s ease-in;transform:rotate(90deg) scale(1.2)}.tc-popover__item--hidden{display:none}@keyframes menuShowing{0%{opacity:0;transform:translateY(-8px) scale(.9)}70%{opacity:1;transform:translateY(2px)}to{transform:translateY(0)}}')),document.head.appendChild(s)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();function K(s,e,t={}){const o=document.createElement(s);Array.isArray(e)?o.classList.add(...e):e&&o.classList.add(e);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}function wt(s){const e=s.getBoundingClientRect();return{y1:Math.floor(e.top+window.pageYOffset),x1:Math.floor(e.left+window.pageXOffset),x2:Math.floor(e.right+window.pageXOffset),y2:Math.floor(e.bottom+window.pageYOffset)}}function yt(s,e){const t=wt(s),o=wt(e);return{fromTopBorder:o.y1-t.y1,fromLeftBorder:o.x1-t.x1,fromRightBorder:t.x2-o.x2,fromBottomBorder:t.y2-o.y2}}function fi(s,e){const t=s.getBoundingClientRect(),{width:o,height:n,x:i,y:r}=t,{clientX:a,clientY:c}=e;return{width:o,height:n,x:a-i,y:c-r}}function xt(s,e){return e.parentNode.insertBefore(s,e)}function Ct(s,e=!0){const t=document.createRange(),o=window.getSelection();t.selectNodeContents(s),t.collapse(e),o.removeAllRanges(),o.addRange(t)}
vendor: 4,306 bytes, line 127
127class Y{constructor({items:e}){this.items=e,this.wrapper=void 0,this.itemEls=[]}static get CSS(){return{popover:"tc-popover",popoverOpened:"tc-popover--opened",item:"tc-popover__item",itemHidden:"tc-popover__item--hidden",itemConfirmState:"tc-popover__item--confirm",itemIcon:"tc-popover__item-icon",itemLabel:"tc-popover__item-label"}}render(){return this.wrapper=K("div",Y.CSS.popover),this.items.forEach((e,t)=>{const o=K("div",Y.CSS.item),n=K("div",Y.CSS.itemIcon,{innerHTML:e.icon}),i=K("div",Y.CSS.itemLabel,{textContent:e.label});o.dataset.index=t,o.appendChild(n),o.appendChild(i),this.wrapper.appendChild(o),this.itemEls.push(o)}),this.wrapper.addEventListener("click",e=>{this.popoverClicked(e)}),this.wrapper}popoverClicked(e){const t=e.target.closest(`.${Y.CSS.item}`);if(!t)return;const o=t.dataset.index,n=this.items[o];if(n.confirmationRequired&&!this.hasConfirmationState(t)){this.setConfirmationState(t);return}n.onClick()}setConfirmationState(e){e.classList.add(Y.CSS.itemConfirmState)}clearConfirmationState(e){e.classList.remove(Y.CSS.itemConfirmState)}hasConfirmationState(e){return e.classList.contains(Y.CSS.itemConfirmState)}get opened(){return this.wrapper.classList.contains(Y.CSS.popoverOpened)}open(){this.items.forEach((e,t)=>{typeof e.hideIf=="function"&&this.itemEls[t].classList.toggle(Y.CSS.itemHidden,e.hideIf())}),this.wrapper.classList.add(Y.CSS.popoverOpened)}close(){this.wrapper.classList.remove(Y.CSS.popoverOpened),this.itemEls.forEach(e=>{this.clearConfirmationState(e)})}}const St='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16"/></svg>',gi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.8833 9.16666L18.2167 12.5M18.2167 12.5L14.8833 15.8333M18.2167 12.5H10.05C9.16594 12.5 8.31809 12.1488 7.69297 11.5237C7.06785 10.8986 6.71666 10.0507 6.71666 9.16666"/></svg>',mi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.9167 14.9167L11.5833 18.25M11.5833 18.25L8.25 14.9167M11.5833 18.25L11.5833 10.0833C11.5833 9.19928 11.9345 8.35143 12.5596 7.72631C13.1848 7.10119 14.0326 6.75 14.9167 6.75"/></svg>',bi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.13333 14.9167L12.4667 18.25M12.4667 18.25L15.8 14.9167M12.4667 18.25L12.4667 10.0833C12.4667 9.19928 12.1155 8.35143 11.4904 7.72631C10.8652 7.10119 10.0174 6.75 9.13333 6.75"/></svg>',vi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.8833 15.8333L18.2167 12.5M18.2167 12.5L14.8833 9.16667M18.2167 12.5L10.05 12.5C9.16595 12.5 8.31811 12.8512 7.69299 13.4763C7.06787 14.1014 6.71667 14.9493 6.71667 15.8333"/></svg>',ki='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.41 9.66H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 9.66H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.31 14.36H9.3"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 14.36H14.59"/></svg>',Et='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 7V12M12 17V12M17 12H12M12 12H7"/></svg>',wi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M5 10H19"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>',yi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
127<path stroke="currentColor" stroke-width="2" d="M10 5V18.5"/><path stroke="currentColor" stroke-width="2" d="M14 5V18.5"/><path stroke="currentColor" stroke-width="2" d="M5 10H19"/><path stroke="currentColor" stroke-width="2" d="M5 14H19"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>',xi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M10 5V18.5"/><path stroke="currentColor" stroke-width="2" d="M5 10H19"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>';class le{constructor({api:e,items:t,onOpen:o,onClose:n,cssModifier:i=""}){this.api=e,this.items=t,this.onOpen=o,this.onClose=n,this.cssModifier=i,this.popover=null,this.wrapper=this.createToolbox()}static get CSS(){return{toolbox:"tc-toolbox",toolboxShowed:"tc-toolbox--showed",toggler:"tc-toolbox__toggler"}}get element(){return this.wrapper}createToolbox(){const e=K("div",[le.CSS.toolbox,this.cssModifier?`${le.CSS.toolbox}--${this.cssModifier}`:""]);e.dataset.mutationFree="true";const t=this.createPopover(),o=this.createToggler();return e.appendChild(o),e.appendChild(t),e}createToggler(){const e=K("div",le.CSS.toggler,{innerHTML:ki});return e.addEventListener("click",()=>{this.togglerClicked()}),e}createPopover(){return this.popover=new Y({items:this.items}),this.popover.render()}togglerClicked(){this.popover.opened?(this.popover.close(),this.onClose()):(this.popover.open(),this.onOpen())}show(e){const t=e();Object.entries(t).forEach(([o,n])=>{this.wrapper.style[o]=n}),this.wrapper.classList.add(le.CSS.toolboxShowed)}hide(){this.popover.close(),this.wrapper.classList.remove(le.CSS.toolboxShowed)}}function Ci(s,e){let t=0;return function(...o){const n=new Date().getTime();if(!(n-t<s))return t=n,e(...o)}}const F={wrapper:"tc-wrap",wrapperReadOnly:"tc-wrap--readonly",table:"tc-table",row:"tc-row",withHeadings:"tc-table--heading",rowSelected:"tc-row--selected",cell:"tc-cell",cellSelected:"tc-cell--selected",addRow:"tc-add-row",addColumn:"tc-add-column"};class Si{constructor(e,t,o,n){this.readOnly=e,this.api=t,this.data=o,this.config=n,this.wrapper=null,this.table=null,this.toolboxColumn=this.createColumnToolbox(),this.toolboxRow=this.createRowToolbox(),this.createTableWrapper(),this.hoveredRow=0,this.hoveredColumn=0,this.selectedRow=0,this.selectedColumn=0,this.tunes={withHeadings:!1},this.resize(),this.fill(),this.focusedCell={row:0,column:0},this.documentClicked=i=>{const r=i.target.closest(`.${F.table}`)!==null,a=i.target.closest(`.${F.wrapper}`)===null;(r||a)&&this.hideToolboxes();const c=i.target.closest(`.${F.addRow}`),l=i.target.closest(`.${F.addColumn}`);c&&c.parentNode===this.wrapper?(this.addRow(void 0,!0),this.hideToolboxes()):l&&l.parentNode===this.wrapper&&(this.addColumn(void 0,!0),this.hideToolboxes())},this.readOnly||this.bindEvents()}getWrapper(){return this.wrapper}bindEvents(){document.addEventListener("click",this.documentClicked),this.table.addEventListener("mousemove",Ci(150,e=>this.onMouseMoveInTable(e)),{passive:!0}),this.table.onkeypress=e=>this.onKeyPressListener(e),this.table.addEventListener("keydown",e=>this.onKeyDownListener(e)),this.table.addEventListener("focusin",e=>this.focusInTableListener(e))}createColumnToolbox(){return new le({api:this.api,cssModifier:"column",items:[{label:this.api.i18n.t("Add column to left"),icon:mi,onClick:()=>{this.addColumn(this.selectedColumn,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Add column to right"),icon:bi,onClick:()=>{this.addColumn(this.selectedColumn+1,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Delete column"),icon:St,hideIf:()=>this.numberOfColumns===1,confirmationRequired:!0,onClick:()=>{this.deleteColumn(this.selectedColumn),this.hideToolboxes()}}],onOpen:()=>{this.selectColumn(this.hoveredColumn),this.hideRowToolbox()},onClose:()=>{this.unselectColumn()}})}createRowToolbox(){return new le({api:this.api,cssModifier:"row",items:[{label:this.api.i18n.t("Add row above"),icon:vi,onClick:()=>{this.addRow(this.selectedRow,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Add row below"),icon:gi,onClick:()=>{this.addRow(this.selectedRow+1,!0),this.hideToolboxes()}},{label:this.api.i18n.t("Delete row"),icon:St,hideIf:()=>this.numberOfRows===1,confirmationRequired:!0,onClick:()=>{this.deleteRow(this.selectedRow),this.hideToolboxes()}}],onOpen:()=>{this.selectRow(this.hoveredRow),this.hideColumnToolbox()},onClose:()=>{this.unselectRow()}})}moveCursorToNextRow(){this.focusedCell.row!==this.numberOfRows?(this.focusedCell.row+=1,this.focusCell(this.focusedCell)):(this.addRow(),this.focusedCell.row+=1,this.focusCell(this.focusedCell),this.updateToolboxesPosition(0,0))}getCell(e,t){return this.table.querySelectorAll(`.${F.row}:nth-child(${e}) .${F.cell}`)[t-1]}getRow(e){return this.table.querySelector(`.${F.row}:nth-child(${e})`)}getRowByCell(e){return e.parentElement}getRowFirstCell(e){return e.querySelector(`.${F.cell}:first-child`)}setCellContent(e,t,o){const n=this.getCell(e,t);n.innerHTML=o}addColumn(e=-1,t=!1){let o=this.numberOfColumns;for(let n=1;n<=this.numberOfRows;n++){let i;const r=this.createCell();if(e>0&&e<=o?(i=this.getCell(n,e),xt(r,i)):i=this.getRow(n).appendChild(r),n===1){const a=this.getCell(n,e>0?e:o+1);a&&t&&Ct(a)}}this.addHeadingAttrToFirstRow()}addRow(e=-1,t=!1){let o,n=K("div",F.row);this.tunes.withHeadings&&this.removeHeadingAttrFromFirstRow();let i=this.numberOfColumns;if(e>0&&e<=this.numberOfRows){let a=this.getRow(e);o=xt(n,a)}else o=this.table.appendChild(n);this.fillRow(o,i),this.tunes.withHeadings&&this.addHeadingAttrToFirstRow();const r=this.getRowFirstCell(o);return r&&t&&Ct(r),o}deleteColumn(e){for(let t=1;t<=this.numberOfRows;t++){const o=this.getCell(t,e);if(!o)return;o.remove()}}deleteRow(e){this.getRow(e).remove(),this.addHeadingAttrToFirstRow()}
vendor: 6,581 bytes, line 127
127createTableWrapper(){if(this.wrapper=K("div",F.wrapper),this.table=K("div",F.table),this.readOnly&&this.wrapper.classList.add(F.wrapperReadOnly),this.wrapper.appendChild(this.toolboxRow.element),this.wrapper.appendChild(this.toolboxColumn.element),this.wrapper.appendChild(this.table),!this.readOnly){const e=K("div",F.addColumn,{innerHTML:Et}),t=K("div",F.addRow,{innerHTML:Et});this.wrapper.appendChild(e),this.wrapper.appendChild(t)}}computeInitialSize(){const e=this.data&&this.data.content,t=Array.isArray(e),o=t?e.length:!1,n=t?e.length:void 0,i=o?e[0].length:void 0,r=Number.parseInt(this.config&&this.config.rows),a=Number.parseInt(this.config&&this.config.cols),c=!isNaN(r)&&r>0?r:void 0,l=!isNaN(a)&&a>0?a:void 0;return{rows:n||c||2,cols:i||l||2}}resize(){const{rows:e,cols:t}=this.computeInitialSize();for(let o=0;o<e;o++)this.addRow();for(let o=0;o<t;o++)this.addColumn()}fill(){const e=this.data;if(e&&e.content)for(let t=0;t<e.content.length;t++)for(let o=0;o<e.content[t].length;o++)this.setCellContent(t+1,o+1,e.content[t][o])}fillRow(e,t){for(let o=1;o<=t;o++){const n=this.createCell();e.appendChild(n)}}createCell(){return K("div",F.cell,{contentEditable:!this.readOnly})}get numberOfRows(){return this.table.childElementCount}get numberOfColumns(){return this.numberOfRows?this.table.querySelectorAll(`.${F.row}:first-child .${F.cell}`).length:0}get isColumnMenuShowing(){return this.selectedColumn!==0}get isRowMenuShowing(){return this.selectedRow!==0}onMouseMoveInTable(e){const{row:t,column:o}=this.getHoveredCell(e);this.hoveredColumn=o,this.hoveredRow=t,this.updateToolboxesPosition()}onKeyPressListener(e){if(e.key==="Enter"){if(e.shiftKey)return!0;this.moveCursorToNextRow()}return e.key!=="Enter"}onKeyDownListener(e){e.key==="Tab"&&e.stopPropagation()}focusInTableListener(e){const t=e.target,o=this.getRowByCell(t);this.focusedCell={row:Array.from(this.table.querySelectorAll(`.${F.row}`)).indexOf(o)+1,column:Array.from(o.querySelectorAll(`.${F.cell}`)).indexOf(t)+1}}hideToolboxes(){this.hideRowToolbox(),this.hideColumnToolbox(),this.updateToolboxesPosition()}hideRowToolbox(){this.unselectRow(),this.toolboxRow.hide()}hideColumnToolbox(){this.unselectColumn(),this.toolboxColumn.hide()}focusCell(){this.focusedCellElem.focus()}get focusedCellElem(){const{row:e,column:t}=this.focusedCell;return this.getCell(e,t)}updateToolboxesPosition(e=this.hoveredRow,t=this.hoveredColumn){this.isColumnMenuShowing||t>0&&t<=this.numberOfColumns&&this.toolboxColumn.show(()=>({left:`calc((100% - var(--cell-size)) / (${this.numberOfColumns} * 2) * (1 + (${t} - 1) * 2))`})),this.isRowMenuShowing||e>0&&e<=this.numberOfRows&&this.toolboxRow.show(()=>{const o=this.getRow(e),{fromTopBorder:n}=yt(this.table,o),{height:i}=o.getBoundingClientRect();return{top:`${Math.ceil(n+i/2)}px`}})}setHeadingsSetting(e){this.tunes.withHeadings=e,e?(this.table.classList.add(F.withHeadings),this.addHeadingAttrToFirstRow()):(this.table.classList.remove(F.withHeadings),this.removeHeadingAttrFromFirstRow())}addHeadingAttrToFirstRow(){for(let e=1;e<=this.numberOfColumns;e++){let t=this.getCell(1,e);t&&t.setAttribute("heading",this.api.i18n.t("Heading"))}}removeHeadingAttrFromFirstRow(){for(let e=1;e<=this.numberOfColumns;e++){let t=this.getCell(1,e);t&&t.removeAttribute("heading")}}selectRow(e){const t=this.getRow(e);t&&(this.selectedRow=e,t.classList.add(F.rowSelected))}unselectRow(){if(this.selectedRow<=0)return;const e=this.table.querySelector(`.${F.rowSelected}`);e&&e.classList.remove(F.rowSelected),this.selectedRow=0}selectColumn(e){for(let t=1;t<=this.numberOfRows;t++){const o=this.getCell(t,e);o&&o.classList.add(F.cellSelected)}this.selectedColumn=e}unselectColumn(){if(this.selectedColumn<=0)return;let e=this.table.querySelectorAll(`.${F.cellSelected}`);Array.from(e).forEach(t=>{t.classList.remove(F.cellSelected)}),this.selectedColumn=0}getHoveredCell(e){let t=this.hoveredRow,o=this.hoveredColumn;const{width:n,height:i,x:r,y:a}=fi(this.table,e);return r>=0&&(o=this.binSearch(this.numberOfColumns,c=>this.getCell(1,c),({fromLeftBorder:c})=>r<c,({fromRightBorder:c})=>r>n-c)),a>=0&&(t=this.binSearch(this.numberOfRows,c=>this.getCell(c,1),({fromTopBorder:c})=>a<c,({fromBottomBorder:c})=>a>i-c)),{row:t||this.hoveredRow,column:o||this.hoveredColumn}}binSearch(e,t,o,n){let i=0,r=e+1,a=0,c;for(;i<r-1&&a<10;){c=Math.ceil((i+r)/2);const l=t(c),h=yt(this.table,l);if(o(h))r=c;else if(n(h))i=c;else break;a++}return c}getData(){const e=[];for(let t=1;t<=this.numberOfRows;t++){const o=this.table.querySelector(`.${F.row}:nth-child(${t})`),n=Array.from(o.querySelectorAll(`.${F.cell}`));n.every(i=>!i.textContent.trim())||e.push(n.map(i=>i.innerHTML))}return e}destroy(){document.removeEventListener("click",this.documentClicked)}}class Ei{static get isReadOnlySupported(){return!0}static get enableLineBreaks(){return!0}constructor({data:e,config:t,api:o,readOnly:n}){this.api=o,this.readOnly=n,this.config=t,this.data={withHeadings:this.getConfig("withHeadings",!1,e),content:e&&e.content?e.content:[]},this.table=null}static get toolbox(){return{icon:xi,title:"Table"}}render(){return this.table=new Si(this.readOnly,this.api,this.data,this.config),this.container=K("div",this.api.styles.block),this.container.appendChild(this.table.getWrapper()),this.table.setHeadingsSetting(this.data.withHeadings),this.container}renderSettings(){return[{label:this.api.i18n.t("With headings"),icon:wi,isActive:this.data.withHeadings,closeOnActivate:!0,toggle:!0,onActivate:()=>{this.data.withHeadings=!0,this.table.setHeadingsSetting(this.data.withHeadings)}},{label:this.api.i18n.t("Without headings"),icon:yi,isActive:!this.data.withHeadings,closeOnActivate:!0,toggle:!0,onActivate:()=>{this.data.withHeadings=!1,this.table.setHeadingsSetting(this.data.withHeadings)}}]}save(){const e=this.table.getData();return{withHeadings:this.data.withHeadings,content:e}}destroy(){this.table.destroy()}getConfig(e,t=void 0,o=void 0){const n=this.data||o;return n?n[e]?n[e]:t:this.config&&this.config[e]?this.config[e]:t}static get pasteConfig(){return{tags:["TABLE","TR","TH","TD"]}}onPaste(e){const t=e.detail.data,o=t.querySelector(":scope > thead, tr:first-of-type th"),n=Array.from(t.querySelectorAll("tr")).map(i=>Array.from(i.querySelectorAll("th, td")).map(r=>r.innerHTML));this.data={withHeadings:o!==null,content:n},this.table.wrapper&&this.table.wrapper.replaceWith(this.render())}}var no={exports:{}};(function(s,e){(function(t,o){s.exports=o()})(window,function(){return function(t){var o={};function n(i){if(o[i])return o[i].exports;var r=o[i]={i,l:!1,exports:{}};
127return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(i,r,a){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:a})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var c in i)n.d(a,c,(function(l){return i[l]}).bind(null,c));return a},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="/",n(n.s=0)}([function(t,o,n){function i(p){return function(g){if(Array.isArray(g))return r(g)}(p)||function(g){if(typeof Symbol<"u"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}(p)||function(g,f){if(g){if(typeof g=="string")return r(g,f);var u=Object.prototype.toString.call(g).slice(8,-1);if(u==="Object"&&g.constructor&&(u=g.constructor.name),u==="Map"||u==="Set")return Array.from(g);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return r(g,f)}}(p)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 128In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function r(p,g){(g==null||g>p.length)&&(g=p.length);for(var f=0,u=new Array(g);f<g;f++)u[f]=p[f];return u}function a(p,g){for(var f=0;f<g.length;f++){var u=g[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,u.key,u)}}n(1).toString();var c,l,h,d=function(){function p(m){var y=m.data,x=(m.config,m.api),b=m.readOnly;(function(k,v){if(!(k instanceof v))throw new TypeError("Cannot call a class as a function")})(this,p),this.api=x,this.readOnly=b,this.blockIndex=this.api.blocks.getCurrentBlockIndex()+1,this.CSS={baseClass:this.api.styles.block,loading:this.api.styles.loader,input:this.api.styles.input,settingsButton:this.api.styles.settingsButton,settingsButtonActive:this.api.styles.settingsButtonActive,wrapper:"editorjs-iframe",holder:["editorjs-iframe__frame","iframe-flex"]},this.nodes={wrapper:null,holder:null,image:null,iframe:null},this.data={frame:y.frame!==void 0?y.frame:"",alignment:!!y.alignment&&y.alignment},this.settings=[{name:"LeftAligned",icon:'<svg width="15" height="15" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M12.83 344h262.34A12.82 12.82 0 0 0 288 331.17v-22.34A12.82 12.82 0 0 0 275.17 296H12.83A12.82 12.82 0 0 0 0 308.83v22.34A12.82 12.82 0 0 0 12.83 344zm0-256h262.34A12.82 12.82 0 0 0 288 75.17V52.83A12.82 12.82 0 0 0 275.17 40H12.83A12.82 12.82 0 0 0 0 52.83v22.34A12.82 12.82 0 0 0 12.83 88zM432 168H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16z"/></svg>'},{name:"Centered",icon:'<svg width="15" height="15" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M108.1 88h231.81A12.09 12.09 0 0 0 352 75.9V52.09A12.09 12.09 0 0 0 339.91 40H108.1A12.09 12.09 0 0 0 96 52.09V75.9A12.1 12.1 0 0 0 108.1 88zM432 424H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16zm0-256H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16zm-92.09 176A12.09 12.09 0 0 0 352 331.9v-23.81A12.09 12.09 0 0 0 339.91 296H108.1A12.09 12.09 0 0 0 96 308.09v23.81a12.1 12.1 0 0 0 12.1 12.1z"/></svg>'},{name:"RightAligned",icon:'<svg width="15" height="15" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M16 216h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16zm416 208H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16zm3.17-384H172.83A12.82 12.82 0 0 0 160 52.83v22.34A12.82 12.82 0 0 0 172.83 88h262.34A12.82 12.82 0 0 0 448 75.17V52.83A12.82 12.82 0 0 0 435.17 40zm0 256H172.83A12.82 12.82 0 0 0 160 308.83v22.34A12.82 12.82 0 0 0 172.83 344h262.34A
12812.82 12.82 0 0 0 448 331.17v-22.34A12.82 12.82 0 0 0 435.17 296z"/></svg>'}]}var g,f,u;return g=p,u=[{key:"sanitize",get:function(){return{frame:!0,html:{}}}},{key:"isReadOnlySupported",get:function(){return!0}},{key:"pasteConfig",get:function(){return{tags:["iframe"],patterns:{iframe:/(?:<iframe[^>]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/}}}}],(f=[{key:"render",value:function(){var m=this._make("div",[this.CSS.baseClass,this.CSS.wrapper]),y=this._make("div",this.CSS.loading),x=this._make("div",this.CSS.holder),b=this._make("iframe");return m.appendChild(y),x.appendChild(b),m.classList.remove(this.CSS.loading),m.appendChild(x),this.data.frame&&(b.parentElement.innerHTML=this.data.frame),y.remove(),b.onerror=function(k){},this.nodes.holder=x,this.nodes.wrapper=m,this.nodes.iframe=b,this.data.alignment&&(console.log(this.data.alignment),this._acceptTuneView()),m}},{key:"save",value:function(m){var y=m.querySelector("iframe");return y?(Object.assign(this.data,{frame:y.parentElement.innerHTML}),this._data.frame=y.parentElement.innerHTML,this._data):this.data}},{key:"onPaste",value:function(m){switch(m.type){case"tag":var y=m.detail.data;this.data={frame:y};break;case"pattern":var x=m.detail.data;this.data={frame:x},this._data=Object.assign({},this.data,{frame:x})}}},{key:"data",get:function(){return this._data},set:function(m){this._data=Object.assign({},this.data,m),this.nodes.iframe&&(this.nodes.iframe.parentElement.innerHTML=this.data.frame)}},{key:"renderSettings",value:function(){var m=this,y=document.createElement("div");return this.settings.forEach(function(x){var b=document.createElement("div");b.setAttribute("id",x.name),b.classList.add(m.CSS.settingsButton),b.innerHTML=x.icon,b.addEventListener("click",function(){m._toggleTune(x.name)}),m.data.alignment==x.name&&b.classList.add(m.CSS.settingsButtonActive),y.appendChild(b)}),y}},{key:"_make",value:function(m){var y,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=document.createElement(m);for(var v in Array.isArray(x)?(y=k.classList).add.apply(y,i(x)):x&&k.classList.add(x),b)k[v]=b[v];return k}},{key:"_toggleTune",value:function(m){var y=this;this.data[m]=!this.data[m],this.data.alignment=m,this.settings.forEach(function(x){x.name==m?document.getElementById(x.name).classList.add(y.CSS.settingsButtonActive):document.getElementById(x.name).classList.remove(y.CSS.settingsButtonActive)}),this._acceptTuneView()}},{key:"_acceptTuneView",value:function(){this.data.alignment=="LeftAligned"?this.nodes.holder.classList.add("iframe-justify-start"):this.nodes.holder.classList.remove("iframe-justify-start"),this.data.alignment=="RightAligned"?this.nodes.holder.classList.add("iframe-justify-end"):this.nodes.holder.classList.remove("iframe-justify-end"),this.data.alignment=="Centered"?this.nodes.holder.classList.add("iframe-justify-center"):this.nodes.holder.classList.remove("iframe-justify-center")}}])&&a(g.prototype,f),u&&a(g,u),p}();h="Bold",(l="title")in(c=d)?Object.defineProperty(c,l,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[l]=h,t.exports=d},function(t,o,n){var i=n(2);typeof i=="string"&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(4)(i,r),i.locals&&(t.exports=i.locals)},function(t,o,n){(t.exports=n(3)(!1)).push([t.i,`.editorjs-iframe {} 129 130.editorjs-iframe .cdx-loader { 131 min-height: 200px; 132} 133 134.editorjs-iframe .cdx-input { 135 margin-top: 10px; 136} 137 138.editorjs-iframe iframe { 139 max-width: 100%; 140 vertical-align: bottom; 141} 142 143.editorjs-iframe__caption[contentEditable=true][data-placeholder]:empty::before { 144 position: absolute; 145 content: attr(data-placeholder); 146 color: #707684; 147 font-weight: normal; 148 opacity: 0; 149 } 150 151.editorjs-iframe__caption[contentEditable=true][data-placeholder]:empty::before { 152 opacity: 1; 153} 154 155.editorjs-iframe__caption[contentEditable=true][data-placeholder]:empty:focus::before { 156 opacity: 0; 157} 158 159.iframe-flex{ 160 display: flex; 161} 162.iframe-justify-start { 163 justify-content: flex-start; 164} 165.iframe-justify-end { 166 justify-content: flex-end; 167} 168.iframe-justify-center { 169 justify-content: center; 170}`,""])},function(t,o){t.exports=function(n){var i=[];return i.toString=function(){return this.map(function(r){var a=function(c,l){var h=c[1]||"",d=c[3];if(!d)return h;if(l&&typeof btoa=="function"){var p=(f=d,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(f))))+" */"),g=d.sources.map(function(u){return"/*# sourceURL="+d.sourceRoot+u+" */"});return[h].concat(g).concat([p]).join(` 171`)}var f;return[h].join(` 172`)}(r,n);return r[2]?"@media "+r[2]+"{"+a+"}":a}).join("")},i.i=function(r,a){typeof r=="string"&&(r=[[null,r,""]]);for(var c={},l=0;l<this.length;l++){var h=this[l][0];typeof h=="number"&&(c[h]=!0)}for(l=0;l<r.length;l++){var d=r[l];typeof d[0]=="number"&&c[d[0]]||(a&&!d[2]?d[2]=a:a&&(d[2]="("+d[2]+") and ("+a+")"),i.push(d))}},i}},function(t,o,n){var i,r,a={},c=(i=function(){return window&&document&&document.all&&!window.atob},function(){return r===void 0&&(r=i.apply(this,arguments)),r}),l=function(S){return document.querySelector(S)},h=function(S){var T={};return function(M){if(typeof M=="function")return M();if(T[M]===void 0){var O=l.call(this,M);if(window.HTMLIFrameElement&&O instanceof window.HTMLIFrameElement)try{O=O.contentDocument.head}catch{O=null}
vendor: 2,506 bytes, lines 172-177
172T[M]=O}return T[M]}}(),d=null,p=0,g=[],f=n(5);function u(S,T){for(var M=0;M<S.length;M++){var O=S[M],I=a[O.id];if(I){I.refs++;for(var R=0;R<I.parts.length;R++)I.parts[R](O.parts[R]);for(;R<O.parts.length;R++)I.parts.push(v(O.parts[R],T))}else{var j=[];for(R=0;R<O.parts.length;R++)j.push(v(O.parts[R],T));a[O.id]={id:O.id,refs:1,parts:j}}}}function m(S,T){for(var M=[],O={},I=0;I<S.length;I++){var R=S[I],j=T.base?R[0]+T.base:R[0],P={css:R[1],media:R[2],sourceMap:R[3]};O[j]?O[j].parts.push(P):M.push(O[j]={id:j,parts:[P]})}return M}function y(S,T){var M=h(S.insertInto);if(!M)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var O=g[g.length-1];if(S.insertAt==="top")O?O.nextSibling?M.insertBefore(T,O.nextSibling):M.appendChild(T):M.insertBefore(T,M.firstChild),g.push(T);else if(S.insertAt==="bottom")M.appendChild(T);else{if(typeof S.insertAt!="object"||!S.insertAt.before)throw new Error(`[Style Loader] 173 174 Invalid value for parameter 'insertAt' ('options.insertAt') found. 175 Must be 'top', 'bottom', or Object. 176 (https://github.com/webpack-contrib/style-loader#insertat) 177`);var I=h(S.insertInto+" "+S.insertAt.before);M.insertBefore(T,I)}}function x(S){if(S.parentNode===null)return!1;S.parentNode.removeChild(S);var T=g.indexOf(S);T>=0&&g.splice(T,1)}function b(S){var T=document.createElement("style");return S.attrs.type===void 0&&(S.attrs.type="text/css"),k(T,S.attrs),y(S,T),T}function k(S,T){Object.keys(T).forEach(function(M){S.setAttribute(M,T[M])})}function v(S,T){var M,O,I,R;if(T.transform&&S.css){if(!(R=T.transform(S.css)))return function(){};S.css=R}if(T.singleton){var j=p++;M=d||(d=b(T)),O=E.bind(null,M,j,!1),I=E.bind(null,M,j,!0)}else S.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(M=function(P){var Z=document.createElement("link");return P.attrs.type===void 0&&(P.attrs.type="text/css"),P.attrs.rel="stylesheet",k(Z,P.attrs),y(P,Z),Z}(T),O=L.bind(null,M,T),I=function(){x(M),M.href&&URL.revokeObjectURL(M.href)}):(M=b(T),O=C.bind(null,M),I=function(){x(M)});return O(S),function(P){if(P){if(P.css===S.css&&P.media===S.media&&P.sourceMap===S.sourceMap)return;O(S=P)}else I()}}t.exports=function(S,T){if(typeof DEBUG<"u"&&DEBUG&&typeof document!="object")throw new Error("The style-loader cannot be used in a non-browser environment");(T=T||{}).attrs=typeof T.attrs=="object"?T.attrs:{}
177,T.singleton||typeof T.singleton=="boolean"||(T.singleton=c()),T.insertInto||(T.insertInto="head"),T.insertAt||(T.insertAt="bottom");var M=m(S,T);return u(M,T),function(O){for(var I=[],R=0;R<M.length;R++){var j=M[R];(P=a[j.id]).refs--,I.push(P)}for(O&&u(m(O,T),T),R=0;R<I.length;R++){var P;if((P=I[R]).refs===0){for(var Z=0;Z<P.parts.length;Z++)P.parts[Z]();delete a[P.id]}}}};var B,_=(B=[],function(S,T){return B[S]=T,B.filter(Boolean).join(` 178`)});function E(S,T,M,O){var I=M?"":O.css;if(S.styleSheet)S.styleSheet.cssText=_(T,I);else{var R=document.createTextNode(I),j=S.childNodes;j[T]&&S.removeChild(j[T]),j.length?S.insertBefore(R,j[T]):S.appendChild(R)}}function C(S,T){var M=T.css,O=T.media;if(O&&S.setAttribute("media",O),S.styleSheet)S.styleSheet.cssText=M;else{for(;S.firstChild;)S.removeChild(S.firstChild);S.appendChild(document.createTextNode(M))}}function L(S,T,M){var O=M.css,I=M.sourceMap,R=T.convertToAbsoluteUrls===void 0&&I;(T.convertToAbsoluteUrls||R)&&(O=f(O)),I&&(O+=` 179/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(I))))+" */");var j=new Blob([O],{type:"text/css"}),P=S.href;S.href=URL.createObjectURL(j),P&&URL.revokeObjectURL(P)}},function(t,o){t.exports=function(n){var i=typeof window<"u"&&window.location;if(!i)throw new Error("fixUrls requires window.location");if(!n||typeof n!="string")return n;var r=i.protocol+"//"+i.host,a=r+i.pathname.replace(/\/[^\/]*$/,"/");return n.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(c,l){var h,d=l.trim().replace(/^"(.*)"$/,function(p,g){return g}).replace(/^'(.*)'$/,function(p,g){return g});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(d)?c:(h=d.indexOf("//")===0?d:d.indexOf("/")===0?r+d:a+d.replace(/^\.\//,""),"url("+JSON.stringify(h)+")")})}}])})})(no);var Ti=no.exports;const Bi=Tt(Ti);(function(){try{if(typeof document<"u"){var s=document.createElement("style");s.appendChild(document.createTextNode('.ce-delimiter{line-height:1.6em;width:100%;text-align:center}.ce-delimiter:before{display:inline-block;content:"***";font-size:30px;line-height:65px;height:30px;letter-spacing:.2em}')),document.head.appendChild(s)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const Mi='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><line x1="6" x2="10" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="14" x2="18" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>';/** 180 * Delimiter Block for the Editor.js. 181 * 182 * @author CodeX ([email protected]) 183 * @copyright CodeX 2018 184 * @license The MIT License (MIT) 185 * @version 2.0.0 186 */class Li{static get isReadOnlySupported(){return!0}static get contentless(){return!0}constructor({data:e,config:t,api:o}){this.api=o,this._CSS={block:this.api.styles.block,wrapper:"ce-delimiter"},this._data={},this._element=this.drawView(),this.data=e}drawView(){let e=document.createElement("DIV");return e.classList.add(this._CSS.wrapper,this._CSS.block),e}render(){return this._element}save(e){return{}}static get toolbox(){return{icon:Mi,title:"Delimiter"}}}const Ai=Ce.forwardRef(({uploadUrl:s,initialValue:e,placeholder:t,onFocus:o,disabled:n,availableTools:i},r)=>{const a=Ce.useRef(null),c=Ce.useRef(null);return Ce.useLayoutEffect(()=>{const l={header:{class:ni,inlineToolbar:!0,config:{levels:[2,3,4],defaultLevel:3}},underline:ri,image:{class:Ae,config:{uploader:{uploadByFile(p){const g=new FormData;return g.append("media",p),window.axios.post(s,g).then(({data:f})=>({success:1,file:f})).catch(f=>({success:0}))},uploadByUrl(p){return window.axios.post(s,{url:p}).then(({data:g})=>({success:1,file:g})).catch(g=>({success:0}))}}}},list:{class:pi,inlineToolbar:!0,config:{defaultStyle:"unordered"}},table:{class:Ei,inlineToolbar:!1,config:{rows:2,cols:3}},iframe:Bi,delimiter:Li},h=i?Object.keys(l).filter(p=>i.includes(p)).reduce((p,g)=>(p[g]=l[g],p),{}):l,d=["bold","italic","link"];return(!i||i.includes("underline"))&&d.push("underline"),a.current=new Kn({holder:c.current,placeholder:t||"",minHeight:150,tools:h,data:e||{},inlineToolbar:d}),o&&c.current.addEventListener("focusin",o),()=>{o&&c.current.removeEventListener("focusin",o),typeof a.current.destroy=="function"&&a.current.destroy()}},[]),Ce.useImperativeHandle(r,()=>({save(){var l,h;
186return(h=(l=a.current).save)==null?void 0:h.call(l)}})),ct.jsx("div",{className:`border border-solid rounded-lg px-4 py-3 ${n?"opacity-50 bg-gray-200 cursor-not-allowed border-gray-400":"border-gray-200"}`,children:ct.jsx("div",{className:`${n?"pointer-events-none":""}`,ref:c})})});export{Ai as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.