1import{Accessibility as se,Command as h,CommandCollection as de,Context as ue,ContextPlugin as ge,EditingKeystrokeHandler as me,Editor as pe,ElementApiMixin as fe,MultiCommand as Ie,PendingActions as we,Plugin as b,_DEFAULT_ACCESSIBILITY_GROUP_ID as he,_getEditorUsageData as be,attachToForm as Ce,secureSourceElement as Be}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{Enter as Se,EnterCommand as _e,EnterObserver as Le,ShiftEnter as R,ShiftEnterCommand as ve,_getCopyOnEnterAttributes as Te}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-enter$dist$index.js.js";import{AttributeOperation as Ee,Batch as Pe,BubblingEmitterMixin as Ae,BubblingEventInfo as xe,ClickObserver as ye,CompositionObserver as Oe,Conversion as Re,ConversionHelpers as Fe,DataController as Ne,Differ as He,DomEventObserver as Ue,DowncastHelpers as We,EditingController as ze,EditingView as je,FakeSelectionObserver as qe,FocusObserver as Ke,History as Ge,HtmlDataProcessor as $e,InputObserver as Je,InsertOperation as Qe,KeyObserver as Xe,MarkerCollection as Ye,MarkerOperation as Ze,Matcher as eo,MergeOperation as oo,Model as to,ModelDocument as no,ModelDocumentFragment as io,ModelDocumentSelection as ro,ModelElement as ao,ModelLivePosition as co,ModelLiveRange as lo,ModelNode as so,ModelNodeList as uo,ModelPosition as go,ModelRange as mo,ModelRootElement as po,ModelSchemaContext as fo,ModelSelection as Io,ModelText as wo,ModelTextProxy as ho,ModelTreeWalker as bo,ModelTypeCheckable as Co,ModelWriter as Bo,MouseObserver as ko,MoveOperation as Vo,MutationObserver as So,NoOperation as _o,Observer as Lo,OperationFactory as vo,RenameOperation as To,RootAttributeOperation as Mo,RootOperation as Do,SelectionObserver as Eo,SplitOperation as Po,StylesMap as Ao,StylesProcessor as xo,TabObserver as yo,TouchObserver as Oo,UpcastHelpers as Ro,UpcastWriter as Fo,ViewAttributeElement as No,ViewContainerElement as Ho,ViewDataTransfer as Uo,ViewDocument as Wo,ViewDocumentDomEventData as zo,ViewDocumentFragment as jo,ViewDocumentSelection as qo,ViewDomConverter as Ko,ViewDowncastWriter as Go,ViewEditableElement as $o,ViewElement as Jo,ViewEmptyElement as Qo,ViewNode as Xo,ViewPosition as Yo,ViewRange as Zo,ViewRawElement as et,ViewRenderer as ot,ViewRootEditableElement as tt,ViewSelection as nt,ViewText as it,ViewTextProxy as rt,ViewTokenList as at,ViewTreeWalker as ct,ViewTypeCheckable as lt,ViewUIElement as st,ViewUpcastWriter as F,XmlDataProcessor as dt,_DataProcessorBasicHtmlWriter as ut,_DetachOperation as gt,_MapperCache as mt,_OperationReplayer as pt,_VIEW_BR_FILLER as ft,_VIEW_INLINE_FILLER as It,_VIEW_INLINE_FILLER_LENGTH as wt,_VIEW_MARKED_NBSP_FILLER as ht,_VIEW_NBSP_FILLER as bt,_ViewElementConversionConsumables as Ct,_autoParagraphEmptyModelRoots as Bt,_convertMapToStringifiedObject as kt,_convertMapToTags as Vt,_deleteModelContent as St,_downcastCleanSelection as _t,_downcastConvertCollapsedSelection as Lt,_downcastConvertRangeSelection as vt,_downcastCreateViewElementFromDowncastHighlightDescriptor as Tt,_downcastInsertAttributesAndChildren as Mt,_downcastInsertElement as Dt,_downcastInsertStructure as Et,_downcastInsertText as Pt,_downcastInsertUIElement as At,_downcastRemove as xt,_downcastWrap as yt,_dumpTrees as Ot,_getDataWithoutViewFiller as Rt,_getModelData as Ft,_getModelNodeAfterPosition as Nt,_getModelNodeBeforePosition as Ht,_getModelTextNodeAtPosition as Ut,_getSelectedModelContent as Wt,_getViewData as zt,_initDocumentDumping as jt,_injectModelSelectionPostFixer as qt,_injectViewQuirksHandling as Kt,_injectViewUIElementHandling as Gt,_insertIntoModelNodeList as $t,_insertModelContent as Jt,_insertModelObject as Qt,_isInlineViewFiller as Xt,_isParagraphableModelNode as Yt,_isViewPatternMatched as Zt,_logDocument as en,_mergeIntersectingModelRanges as on,_modifyModelSelection as tn,_moveInModelNodeList as nn,_normalizeConversionConsumables as rn,_normalizeInModelNodeList as an,_operationTransform as cn,_parseModel as ln,_parseView as sn,_removeFromModelNodeList as dn,_setAttributeInModelNodeList as un,_setModelData as gn,_setVie
1wData as mn,_startsWithViewFiller as pn,_stringifyModel as fn,_stringifyView as In,_tryFixingModelRange as wn,_upcastConvertSelectionChange as hn,_upcastConvertText as bn,_upcastConvertToModelFragment as Cn,_wrapInModelParagraph as Bn,addBackgroundStylesRules as kn,addBorderStylesRules as Vn,addMarginStylesRules as Sn,addPaddingStylesRules as _n,autoParagraphEmptyRoots as Ln,disableViewPlaceholder as vn,enableViewPlaceholder as Tn,getBoxSidesStyleShorthandValue as Mn,getBoxSidesStyleValueReducer as Dn,getBoxSidesStyleValues as En,getPositionStyleShorthandNormalizer as Pn,getShorthandStylesValues as An,getViewFillerOffset as xn,hideViewPlaceholder as yn,isAttachmentStyleValue as On,isColorStyleValue as Rn,isLengthStyleValue as Fn,isLineStyleValue as Nn,isParagraphable as Hn,isPercentageStyleValue as Un,isPositionStyleValue as Wn,isRepeatStyleValue as zn,isURLStyleValue as jn,needsViewPlaceholder as qn,showViewPlaceholder as Kn,transformOperationSets as Gn,wrapInParagraph as $n}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";import{Clipboard as Xn,ClipboardMarkersUtils as Yn,ClipboardObserver as Zn,ClipboardPipeline as N,DragDrop as ei,DragDropBlockToolbar as oi,DragDropTarget as ti,PastePlainText as ni,_ClipboardLineVie
1w as ii,_DragDrop as ri,_DragDropBlockToolbar as ai,_DragDropTarget as ci,_normalizeClipboardData as li,plainTextToHtml as si,viewToPlainText as di}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-clipboard$dist$index.js.js";import{CKEditorError as mi,Collection as H,Config as pi,DOCUMENTATION_URL as fi,DomEmitterMixin as Ii,ElementReplacer as wi,EmitterMixin as hi,EventInfo as bi,FocusTracker as Ci,KeystrokeHandler as Bi,Locale as ki,ObservableMixin as Vi,Rect as Si,ResizeObserver as _i,_clearTranslations as Li,_getEmitterId as vi,_getEmitterListenedTo as Ti,_getUserAgent as Mi,_isAndroid as Di,_isBlink as Ei,_isGecko as Pi,_isMac as Ai,_isMediaForcedColors as xi,_isMotionReduced as yi,_isRegExpUnicodePropertySupported as Oi,_isSafari as Ri,_isWindows as Fi,_isiOS as Ni,_setEmitterId as Hi,_translate as Ui,_unifyTranslations as Wi,abortableDebounce as zi,add as ji,areConnectedThroughProperties as qi,collectStylesheets as Ki,compareArrays as Gi,count as $i,crc32 as Ji,createElement as Qi,delay as Xi,diff as Yi,diffToChanges as Zi,env as er,exponentialDelay as or,fastDiff as tr,findClosestScrollableAncestor as nr,first as C,formatHtml as ir,getAncestors as rr,getBorderWidths as ar,getCode as cr,getCommonAncestor as lr,getDataFromElement as sr,getEnvKeystrokeText as dr,getLanguageDirection as ur,getLocalizedArrowKeyCodeDirection as gr,getOptimalPosition as mr,getPositionedAncestor as pr,getRangeFromMouseEvent as fr,getVisualViewportOffset as Ir,global as wr,indexOf as hr,insertAt as br,insertToPriorityArray as Cr,isArrowKeyCode as Br,isCombiningMark as kr,isComment as Vr,isForwardArrowKeyCode as Sr,isHighSurrogateHalf as _r,isInsideCombinedSymbol as Lr,isInsideEmojiSequence as vr,isInsideSurrogatePair as Tr,isIterable as Mr,isLowSurrogateHalf as Dr,
1isNode as Er,isRange as Pr,isText as Ar,isValidAttributeName as xr,isViewWithFocusTracker as yr,isVisible as Or,isWindow as Rr,keyCodes as Fr,logError as Nr,logWarning as Hr,mapsEqual as Ur,nth as Wr,objectToMap as zr,parseBase64EncodedObject as jr,parseKeystroke as qr,priorities as Kr,releaseDate as Gr,remove as $r,retry as Jr,scrollAncestorsToShowTarget as Qr,scrollViewportToShowTarget as Xr,setDataInElement as Yr,spliceArray as Zr,spy as ea,toArray as oa,toMap as ta,toUnit as na,uid as ia,version as ra,wait as aa}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";import{AccessibilityHelp as sa,AccessibilityHelpContentView as da,AriaLiveAnnouncer as ua,AriaLiveAnnouncerPoliteness as ga,AriaLiveAnnouncerRegionView as ma,AriaLiveAnnouncerView as pa,AutocompleteView as fa,Badge as Ia,BalloonPanelView as wa,BalloonToolbar as ha,BlockButtonView as ba,BlockToolbar as Ca,BodyCollection as Ba,BoxedEditorUIView as ka,ButtonLabelView as Va,ButtonLabelWithHighlightView as Sa,ButtonView as _a,CollapsibleView as La,ColorGridView as va,ColorGridsFragmentView as Ta,ColorPickerFragmentView as Ma,ColorPickerInputRowView as Da,ColorPickerView as Ea,ColorSelectorView as Pa,ColorTileView as Aa,ComponentFactory as xa,ContextualBalloon as ya,CssTransitionDisablerMixin as Oa,DefaultMenuBarItems as Ra,Dialog as Fa,DialogActionsView as Na,DialogContentView as Ha,DialogView as Ua,DialogViewPosition as Wa,DocumentColorCollection as za,DraggableViewMixin as ja,DropdownButtonView as qa,DropdownMenuButtonView as Ka,DropdownMenuListItemButtonView as Ga,DropdownMenuListItemView as $a,DropdownMenuListView as Ja,DropdownMenuNestedMenuPanelView as Qa,DropdownMenuNestedMenuView as Xa,DropdownMenuPanelPositioningFunctions as Ya,DropdownMenuRootListView as Za,DropdownPanelView as ec,DropdownView as oc,EditableUIView as tc,EditorUI as nc,EditorUIView as ic,EvaluationBadge as rc,FileDialogButtonView as ac,FileDialogListItemButtonView as cc,FileDialogViewMixin as lc,FocusCycler as sc,FormHeaderView as dc,FormRowView as uc,HighlightedTextView as gc,IconView as mc,IframeView as pc,InlineEditableUIView as fc,InputBase as Ic,InputNumberView as wc,InputTextView as hc,InputView as bc,ItemsView as Cc,LabelView as Bc,LabelWithHighlightView as kc,LabeledFieldView as Vc,LabeledInputView as Sc,ListItemButtonView as _c,ListItemGroupView as Lc,ListItemView as vc,ListSeparatorView as Tc,ListView as Mc,MenuBarMenuButtonView as Dc,MenuBarMenuListItemButtonView as U,MenuBarMenuListItemFileDialogButtonView as Ec,MenuBarMenuListItemView as W,MenuBarMenuListView as z,MenuBarMenuPanelView as Pc,MenuBarMenuView as j,MenuBarView as Ac,NESTED_TOOLBAR_ICONS as xc,Notification as yc,PoweredBy as Oc,SearchInfoView as Rc,SearchResultsView as Fc,SearchTextView as Nc,SliderView as Hc,SpinnerView as Uc,SplitButtonView as q,StickyPanelView as Wc,SwitchButtonView as zc,Template as jc,TextareaView as qc,ToolbarLineBreakView as Kc,ToolbarSeparatorView as Gc,ToolbarView as $c,TooltipManager as Jc,UIModel as K,View as Qc,ViewCollection as Xc,ViewModel as Yc,_CheckIconHolderView as Zc,_CollapsibleView as el,_ContextualBalloonRotatorView as ol,_DropdownMenuBehaviors as tl,_DropdownRootMenuBehaviors as nl,_MenuBarBehaviors as il,_MenuBarMenuBehaviors as rl,_MenuBarMenuViewPanelPositioningFunctions as al,_SearchInfoView as cl,_SearchTextQueryView as ll,_TemplateBinding as sl,_TemplateIfBinding as dl,_TemplateToBinding as ul,_convertColor as gl,_convertColorToHex as ml,_preventUiViewDefault as pl,_processMenuBarConfig as fl,_registerCustomElement as Il,_tryNormalizeHexColor as wl,addKeyboardHandlingForGrid as hl,addListToDropdown as G,addMenuToDropdown as bl,addToolbarToDropdown as Cl,clickOutsideHandler as Bl,createDropdown as $,createLabeledDropdown as kl,createLabeledInputNumber as Vl,createLabeledInputText as Sl,createLabeledTextarea as _l,filterGroupAndItemNames as Ll,focusChildOnDropdownOpen as vl,getLocalizedColorOptions as Tl,isFocusable as Ml,isViewWithFocusCycler as Dl,normalizeColorOptions as El,normalizeMenuBarConfig as Pl,normalizeSingleColorDefinition as Al,normalizeToolbarConfig as xl,submitHandler as yl}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-ui$dist$index.js.js";import{IconAccessibility as Fl,IconAddComment as Nl,IconAlignBottom as Hl,IconAlignCenter as Ul,IconAlignJustify as Wl,IconAlignLeft as zl,IconAlignMiddle as jl,IconAlignRight as ql,IconAlignTop as Kl,IconArrowDown as Gl,IconArrowUp as $l,IconBold as Jl,IconBookmark as Ql,IconBookmarkInline as Xl,IconBookmarkMedium as Yl,IconBookmarkSmall as Zl,IconBrowseFiles as es,IconBulletedList as os,IconCancel as ts,IconCaption as ns,IconCaseChange as is,IconCheck as rs,IconChevronDown as as,IconChevronUp as cs,IconCkboxImageEdit as ls,IconCode as ss,IconCodeBlock as T,IconCog as ds,IconColorPalette as us,IconColorTileCheck as gs,IconCommentsArchive as ms,IconContentLock as ps,IconContentUnlock as fs,IconCopy as Is,IconDragHandle as ws,IconDragIndicator as hs,IconDropbox as bs,IconDropdownArrow as Cs,IconEditComment as Bs,IconEmoji as ks,IconEraser as Vs,IconError as Ss,IconExportPdf as _s,IconExportWord as Ls,IconFacebook as vs,IconFindReplace as Ts,IconFontBackgroun
vendor: 17,324 bytes, lines 1-13
1d as Ms,IconFontColor as Ds,IconFontFamily as Es,IconFontSize as Ps,IconFullscreenEnter as As,IconFullscreenLeave as xs,IconGoogleDrive as ys,IconGooglePhotos as Os,IconHeading1 as Rs,IconHeading2 as Fs,IconHeading3 as Ns,IconHeading4 as Hs,IconHeading5 as Us,IconHeading6 as Ws,IconHistory as zs,IconHorizontalLine as js,IconHtml as qs,IconImage as Ks,IconImageAssetManager as Gs,IconImageUpload as $s,IconImageUrl as Js,IconImportExport as Qs,IconImportWord as Xs,IconIndent as Ys,IconInsertMergeField as Zs,IconItalic as ed,IconLegalStyleList as od,IconLineHeight as td,IconLink as nd,IconListStyleCircle as id,IconListStyleDecimal as rd,IconListStyleDecimalLeadingZero as ad,IconListStyleDisc as cd,IconListStyleLowerLatin as ld,IconListStyleLowerRoman as sd,IconListStyleSquare as dd,IconListStyleUpperLatin as ud,IconListStyleUpperRoman as gd,IconLocal as md,IconLoupe as pd,IconLowVision as fd,IconMagicWand as Id,IconMarker as wd,IconMedia as hd,IconMediaPlaceholder as bd,IconMultiLevelList as Cd,IconNextArrow as Bd,IconNotification as kd,IconNumberedList as Vd,IconObjectCenter as Sd,IconObjectFullWidth as _d,IconObjectInline as Ld,IconObjectInlineLeft as vd,IconObjectInlineRight as Td,IconObjectLeft as Md,IconObjectRight as Dd,IconObjectSizeCustom as Ed,IconObjectSizeFull as Pd,IconObjectSizeLarge as Ad,IconObjectSizeMedium as xd,IconObjectSizeSmall as yd,IconOneDrive as Od,IconOutdent as Rd,IconPageBreak as Fd,IconPaginationExample as Nd,IconPaintRoller as Hd,IconPaintRollerCursorDefault as Ud,IconPaintRollerCursorText as Wd,IconParagraph as zd,IconPen as jd,IconPencil as qd,IconPilcrow as Kd,IconPlay as Gd,IconPlus as $d,IconPreviewMergeFields as Jd,IconPreviousArrow as Qd,IconPrint as Xd,IconProjectLogo as Yd,IconQuote as Zd,IconRedo as eu,IconRemove as ou,IconRemoveComment as tu,IconRemoveFormat as nu,IconReturnArrow as iu,IconRevisionHistory as ru,IconRobotPencil as au,IconSelectAll as cu,IconSettings as lu,IconShowBlocks as su,IconSource as du,IconSpecialCharacters as uu,IconStrikethrough as gu,IconSubmit as mu,IconSubscript as pu,IconSuperscript as fu,IconTable as Iu,IconTableCellProperties as wu,IconTableColumn as hu,IconTableLayout as bu,IconTableMergeCell as Cu,IconTableOfContents as Bu,IconTableProperties as ku,IconTableRow as Vu,IconTemplate as Su,IconTemplateGeneric as _u,IconText as Lu,IconTextAlternative as vu,IconThreeVerticalDots as Tu,IconTodoList as Mu,IconTrackChanges as Du,IconTrackChangesAccept as Eu,IconTrackChangesDiscard as Pu,IconUnderline as Au,IconUndo as xu,IconUnlink as yu,IconUploadcareImageEdit as Ou,IconUploadcareImageUpload as Ru,IconUploadcareLink as Fu,IconUser as Nu,IconWarning as Hu}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-icons$dist$index.js.js";function f(i){let e=i.t,t=i.config.get("codeBlock.languages");for(let n of t)n.label==="Plain text"&&(n.label=e("Plain text")),n.class===void 0&&(n.class=`language-${n.language}`);return t}function I(i,e,t){let n={};for(let a of i)if(e==="class"){let r=a[e].split(" ").shift();n[r]=a[t]}else n[a[e]]=a[t];return n}function v(i){return i.data.match(/^(\s*)/)[0]}function Q(i,e){let t=i.createDocumentFragment(),n=e.split(` 2`),a=n.reduce((r,o,c)=>(r.push(o),c<n.length-1&&r.push(i.createElement("br")),r),[]);return i.appendChild(a,t),t}function B(i){let e=i.document.selection,t=[];if(e.isCollapsed)return[e.anchor];let n=e.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(let{item:a}of n){let r=a.is("$textProxy")?a.textNode:a,o=r.parent;if(!o.is("element","codeBlock")||r.is("element","softBreak"))continue;for(;r.previousSibling&&!r.previousSibling.is("element","softBreak");)r=r.previousSibling;let c=r.is("$text")?r.startOffset+v(r).length:r.startOffset,l=i.createPositionAt(o,c);t.every(s=>!s.isEqual(l))&&t.push(l)}return t}function x(i){let e=C(i.getSelectedBlocks());return!!e&&e.is("element","codeBlock")}function D(i,e){return e.is("rootElement")||i.isLimit(e)?!1:i.checkChild(e.parent,"codeBlock")}function E(i,e,t,n){let a=I(e,"language","label"),r=t.getAttribute("language");if(r in a){let o=a[r];return i(n==="enter"?"Entering %0 code snippet":"Leaving %0 code snippet",o)}return i(n==="enter"?"Entering code snippet":"Leaving code snippet")}function y(i,e){for(i.textNode&&(i=e.createPositionBefore(i.textNode));i.nodeBefore&&!i.nodeBefore.is("element","softBreak");)i=e.createPositionBefore(i.nodeBefore);let t=i.nodeAfter;return t&&t.is("$text")?t:null}var k=class extends h{_lastLanguage;constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor,n=t.model,a=n.document.selection,o=f(t)[0],c=Array.from(a.getSelectedBlocks()),l=e.forceValue==null?!this.value:e.forceValue,s=ne(e,this._lastLanguage,o.language);n.change(d=>{l?this._applyCodeBlock(d,c,s):this._removeCodeBlock(d,c)})}_getValue(){let e=this.editor.model.document.selection,t=C(e.getSelectedBlocks());return!!t?.is("element","codeBlock")?t.getAttribute("language"):!1}_checkEnabled(){if(this.value)return!0;let e=this.editor.model.document.selection,t=this.editor.model.schema,n=C(e.getSelectedBlocks());return n?D(t,n):!1}_applyCodeBlock(e,t,n){this._lastLanguage=n;let a=this.editor.model.schema,r=t.filter(o=>D(a,o));for(let o of r)e.rename(o,"codeBlock"),e.setAttribute("language",n,o),a.removeDisallowedAttributes([o],e),Array.from(o.getChildren()).filter(c=>!a.checkChild(o,c)).forEach(c=>e.remove(c));r.reverse().forEach((o,c)=>{let l=r[c+1];o.previousSibling===l&&(e.appendElement("softBreak",l),e.merge(e.createPositionBefore(o)))})}_removeCodeBlock(e,t){let n=t.filter(a=>a.is("element","codeBlock"));for(let a of n){let r=e.createRangeOn(a);for(let o of Array.from(r.getItems()).reverse())if(o.is("element","softBreak")&&o.parent.is("element","codeBlock")){let{position:c}=e.split(e.createPositionBefore(o)),l=c.nodeAfter;e.rename(l,"paragraph"),e.removeAttribute("language",l),e.remove(o)}e.rename(a,"paragraph"),e.removeAttribute("language",a)}}};function ne(i,e,t){return i.language?i.language:i.usePreviousLanguageChoice&&e?e:t}var V=class extends h{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){let t=this.editor.model;t.change(n=>{let a=B(t);for(let r of a){let o=n.createText(this._indentSequence);t.insertContent(o,r)}})}_checkEnabled(){return this._indentSequence?x(this.editor.model.document.selection):!1}},S=class extends h{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){let t=this.editor.model;t.change(()=>{let n=B(t);for(let a of n){let r=J(t,a,this._indentSequence);r&&t.deleteContent(t.createSelection(r))}})}_checkEnabled(){if(!this._indentSequence)return!1;let e=this.editor.model;return x(e.document.selection)?B(e).some(t=>J(e,t,this._indentSequence)):!1}};function J(i,e,t){let n=y(e,i);if(!n)return null;let a=v(n),r=a.lastIndexOf(t);if(r+t.length!==a.length||r===-1)return null;let{parent:o,startOffset:c}=n;return i.createRange(i.createPositionAt(o,c+r),i.createPositionAt(o,c+r+t.length))}function P(i,e,t=!1){let n=I(e,"language","class"),a=I(e,"language","label");return(r,o,c)=>{let{writer:l,mapper:s,consumable:d}=c;if(!d.consume(o.item,"insert"))return;let u=o.item.getAttribute("language"),g=s.toViewPosition(i.createPositionBefore(o.item)),m={};t&&(m["data-language"]=a[u],m.spellcheck="false");let w=n[u]?{class:n[u]}:void 0,O=l.createContainerElement("code",w),te=l.createContainerElement("pre",m,O);l.insert(g,te),s.bindElements(o.item,O)}}function X(i){return(e,t,n)=>{if(t.item.parent.name!=="codeBlock")return;let{writer:a,mapper:r,consumable:o}=n;if(!o.consume(t.item,"insert"))return;let c=r.toViewPosition(i.createPositionBefore(t.item));a.insert(c,a.createText(` 3`))}}function Y(i,e){let t=I(e,"class","language"),n=e[0].language;return(a,r,o)=>{let c=r.viewItem,l=c.parent;if(!l||!l.is("element","pre")||r.modelCursor.findAncestor("codeBlock"))return;let{consumable:s,writer:d}=o;if(!s.test(c,{name:!0}))return;let u=d.createElement("codeBlock"),g=[...c.getClassNames()];g.length||g.push("");for(let m of g){let w=t[m];if(w){s.consume(c,{classes:[m]}),d.setAttribute("language",w,u);break}}u.hasAttribute("language")||d.setAttribute("language",n,u),o.convertChildren(c,u),o.safeInsert(u,r.modelCursor)&&(s.consume(c,{name:!0}),o.updateConversionResult(u,r))}}function Z(){return(i,e,{consumable:t,writer:n})=>{let a=e.modelCursor;if(!t.test(e.viewItem)||!a.findAncestor("codeBlock"))return;t.consume(e.viewItem);let o=e.viewItem.data.split(` 4`).map(l=>n.createText(l)),c=o[o.length-1];for(let l of o)if(n.insert(l,a),a=a.getShiftedBy(l.offsetSize),l!==c){let s=n.createElement("softBreak");n.insert(s,a),a=n.createPositionAfter(s)}e.modelRange=n.createRange(e.modelCursor,a),e.modelCursor=a}}function ee(){return(i,e,{consumable:t})=>{let n=e.viewItem;if(n.findAncestor("pre"))return;let a=Array.from(n.getChildren()),r=a.find(o=>o.is("element","code"));if(r)for(let o of a)o===r||!o.is("$text")||t.consume(o,{name:!0})}}var oe="paragraph",_=class extends b{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[R]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"go",label:"Go"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:" "})}init(){let e=this.editor,t=e.model.schema,n=e.model,a=e.editing.view,r=f(e);e.commands.add("codeBlock",new k(e)),e.commands.add("indentCodeBlock",new V(e)),e.commands.add("outdentCodeBlock",new S(e)),this.listenTo(a.document,"tab",(o,c)=>{let l=c.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(l).isEnabled&&(e.execute(l),c.stopPropagation(),c.preventDefault(),o.stop())},{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),t.addAttributeCheck((o,c)=>{let l=o.getItem(o.length-2);if(t.getAttributeProperties(c).isFormatting&&l&&l.name=="codeBlock")return!1}),e.editing.downcastDispatcher.on("insert:codeBlock",P(n,r,!0)),e.data.downcastDispatcher.on("insert:codeBlock",P(n,r)),e.data.downcastDispatcher.on("insert:softBreak",X(n),{priority:"high"}),e.data.upcastDispatcher.on("element:code",Y(a,r)),e.data.upcastDispatcher.on("text",Z()),e.data.upcastDispatcher.on("element:pre",ee(),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",(o,c)=>{let l=n.createRange(n.document.selection.anchor);if(c.targetRanges&&(l=e.editing.mapper.toModelRange(c.targetRanges[0])),!l.start.parent.is("element","codeBlock"))return;let s=c.dataTransfer.getData("text/plain"),d=new F(e.editing.view.document);c.content=Q(d,s)}),e.plugins.has("ClipboardPipeline")&&e.plugins.get(N).on("contentInsertion",(o,c)=>{let l=e.model,s=l.document.selection;s.anchor.parent.is("element","codeBlock")&&l.change(d=>{let u=d.createRangeIn(c.content);for(let g of[...u.getItems()])g.is("node")&&!t.checkChild(s.anchor,g)&&d.remove(g)})}),this.listenTo(n,"getSelectedContent",(o,[c])=>{let l=c.anchor;c.isCollapsed||!l.parent.is("element","codeBlock")||!l.hasSameParentAs(c.focus)||n.change(s=>{let d=o.return;if(l.parent.is("element")&&(d.childCount>1||c.containsEntireContent(l.parent))){let g=s.createElement("codeBlock",l.parent.getAttributes());s.append(d,g);let m=s.createDocumentFragment();s.append(g,m),o.return=m;return}let u=d.getChild(0);t.checkAttribute(u,"code")&&s.setAttribute("code",!0,u)})})}afterInit(){let e=this.editor,t=e.commands,n=t.get("indent"),a=t.get("outdent");n&&n.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),a&&a.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",(r,o)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(!re(e,o.isSoft)&&!ae(e,o.isSoft)&&ie(e),o.preventDefault(),r.stop())},{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){let{model:e,ui:t,t:n}=this.editor,a=f(this.editor),r=null;e.document.selection.on("change:range",()=>{let o=e.document.selection.focus.parent;!t||r===o||!o.is("element")||(r&&r.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(E(n,a,r,"leave")),o.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(E(n,a,o,"enter")),r=o)})}};function ie(i){let e=i.model,t=e.document,n=t.selection.getLastPosition(),a,r=y(n,e);r&&r.is("$text")&&(a=v(r)),i.model.change(o=>{i.execute("shiftEnter"),a&&o.insertText(a,t.selection.anchor)})}function re(i,e){let n=i.model.document,a=i.editing.view,r=n.selection.getLastPosition(),o=r.nodeAfter;return e||!n.selection.isCollapsed||!r.isAtStart||!p(o)?!1:(i.model.change(c=>{i.execute("enter");let l=n.selection.anchor.parent.previousSibling;c.rename(l,oe),c.setSelection(l,"in"),i.model.schema.removeDisallowedAttributes([l],c),c.remove(o)}),a.scrollToTheSelection(),!0)}function ae(i,e){let t=i.model,n=t.document,a=i.editing.view,r=n.selection.getLastPosition(),o=r.nodeBefore,c;if(e||!n.selection.isCollapsed||!r.isAtEnd||!o||!o.previousSibling)return!1;if(p(o)&&p(o.previousSibling))c=t.createRange(t.createPositionBefore(o.previousSibling),t.createPositionAfter(o));else if(M(o)&&p(o.previousSibling)&&p(o.previousSibling.previousSibling))c=t.createRange(t.createPositionBefore(o.previousSibling.previousSibling),t.createPositionAfter(o));else if(M(o)&&p(o.previousSibling)&&M(o.previousSibling.previousSibling)&&o.previousSibling.previousSibling&&p(o.previousSibling.previousSibling.previousSibling))c=t.createRange(t.createPositionBefore(o.previousSibling.previousSibling.previousSibling),t.createPositionAfter(o));else return!1;return i.model.change(l=>{l.remove(c),i.execute("enter");let s=n.selection.anchor.parent;l.rename(s,oe),i.model.schema.removeDisallowedAttributes([s],l)}),a.scrollToTheSelection(),!0}function M(i){return i&&i.is("$text")&&!i.data.match(/\S/)}function p(i){return i&&i.is("element","softBreak")}var L=class extends b{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t,n=e.ui.componentFactory,a=f(e),r=this._getLanguageListItemDefinitions(a),o=e.commands.get("codeBlock");n.add("codeBlock",c=>{let l=$(c,q),s=l.buttonView,d=t("Insert code block");return s.set({label:d,tooltip:!0,icon:T,isToggleable:!0}),s.bind("isOn").to(o,"value",u=>!!u),s.on("execute",()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()}),l.on("execute",u=>{e.execute("codeBlock",{language:u.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()}),l.class="ck-code-block-dropdown",l.bind("isEnabled").to(o),G(l,r,{role:"menu",ariaLabel:d}),l}),n.add("menuBar:codeBlock",c=>{let l=new j(c);l.buttonView.set({role:"menuitem",label:t("Code block"),icon:T}),l.bind("isEnabled").to(o);let s=new z(c);s.set({ariaLabel:t("Insert code block")});for(let d of r){let u=new W(c,l),g=new U(c);g.bind(...Object.keys(d.model)).to(d.model),g.set({isToggleable:!0,role:"menuitemcheckbox"}),g.delegate("execute").to(l),g.on("execute",()=>{e.execute("codeBlock",{language:d.model._codeBlockLanguage,forceValue:o.value!=d.model._codeBlockLanguage}),e.editing.view.focus()}),u.children.add(g),s.items.add(u)}return l.panelView.children.add(s),l})}_getLanguageListItemDefinitions(e){let n=this.editor.commands.get("codeBlock"),a=new H;for(let r of e){let o={type:"button",model:new K({_codeBlockLanguage:r.language,label:r.label,role:"menuitemradio",withText:!0})};o.model.bind("isOn").to(n,"value",c=>c===o.model._codeBlockLanguage),a.add(o)}return a}},A=class extends b{static get requires(){return[_,L]}static get pluginName(){return"CodeBlock"}static get isOfficialPlugin(){return!0}};export{A as CodeBlock,k as CodeBlockCommand,_ as CodeBlockEditing,L as CodeBlockUI,V as IndentCodeBlockCommand,S as OutdentCodeBlockCommand,D as _canBeCodeBlock,Y as _dataViewToModelCodeBlockInsertion,ee as _dataViewToModelCodeBlockOrphanNodeConsumer,Z as _dataViewToModelCodeBlockTextNewlinesInsertion,E as _getCodeBlockAriaAnnouncement,B as _getCodeBlockIndentOutdentPositions,v as _getCodeBlockLeadingWhiteSpaces,I as _getCodeBlockPropertyAssociation,y as _getCodeBlockTextNodeAtLineStart,f as _getNormalizedAndLocalizedCodeBlockLanguageDefinitions,x as _isModelSelectionInCodeBlock,X as _modelToDataViewCodeBlockSoftBreakInsertion,P as _modelToViewCodeBlockInsertion,Q as _rawCodeBlockSnippetTextToViewDocumentFragment}; 5/*! Bundled license information: 6 7@ckeditor/ckeditor5-code-block/dist/index.js: 8 (** 9 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. 10 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 11 *) 12*/ 13//# sourceMappingURL=@ckeditor$ckeditor5-code-block$dist$index.js.(LA4JNHMW).js.map
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.