1import{Accessibility as k,Command as w,CommandCollection as C,Context as T,ContextPlugin as W,EditingKeystrokeHandler as D,Editor as P,ElementApiMixin as B,MultiCommand as O,PendingActions as u,Plugin as y,_DEFAULT_ACCESSIBILITY_GROUP_ID as R,_getEditorUsageData as L,attachToForm as M,secureSourceElement as z}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{CKEditorError as V,Collection as K,Config as N,DOCUMENTATION_URL as q,DomEmitterMixin as _,ElementReplacer as U,EmitterMixin as H,EventInfo as G,FocusTracker as Y,KeystrokeHandler as $,Locale as J,ObservableMixin as Q,Rect as X,ResizeObserver as Z,_clearTranslations as ee,_getEmitterId as re,_getEmitterListenedTo as oe,_getUserAgent as te,_isAndroid as ie,_isBlink as me,_isGecko as se,_isMac as ne,_isMediaForcedColors as fe,_isMotionReduced as pe,_isRegExpUnicodePropertySupported as ae,_isSafari as xe,_isWindows as le,_isiOS as ce,_setEmitterId as de,_translate as ue,_unifyTranslations as he,abortableDebounce as ge,add as ye,areConnectedThroughProperties as _e,collectStylesheets as ve,compareArrays as be,count as Ae,crc32 as Ee,createElement as Ie,delay as Se,diff as ke,diffToChanges as we,env as Ce,exponentialDelay as Te,fastDiff as We,findClosestScrollableAncestor as De,first as Pe,formatHtml as Be,getAncestors as Oe,getBorderWidths as Re,getCode as Le,getCommonAncestor as Me,getDataFromElement as ze,getEnvKeystrokeText as Fe,getLanguageDirection as je,getLocalizedArrowKeyCodeDirection as Ve,getOptimalPosition as Ke,getPositionedAncestor as Ne,getRangeFromMouseEvent as qe,getVisualViewportOffset as Ue,global as He,indexOf as Ge,insertAt as Ye,insertToPriorityArray as $e,isArrowKeyCode as Je,isCombiningMark as Qe,isComment as Xe,isForwardArrowKeyCode as Ze,isHighSurrogateHalf as er,isInsideCombinedSymbol as rr,isInsideEmojiSequence as or,isInsideSurrogatePair as tr,isIterable as ir,isLowSurrogateHalf as mr,isNode as sr,isRange as nr,isText as fr,isValidAttributeName as pr,isViewWithFocusTracker as ar,isVisible as xr,isWindow as lr,keyCodes as cr,logError as dr,logWarning as ur,mapsEqual as hr,nth as gr,objectToMap as yr,parseBase64EncodedObject as _r,parseKeystroke as vr,priorities as br,releaseDate as Ar,remove as Er,retry as Ir,scrollAncestorsToShowTarget as Sr,scrollViewportToShowTarget as kr,setDataInElement as wr,spliceArray as Cr,spy as Tr,toArray as Wr,toMap as Dr,toUnit as Pr,uid as Br,version as Or,wait as Rr}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";function v(a,e,{signal:o,edges:t}={}){let i,s=null,x=t!=null&&t.includes("leading"),n=t==null||t.includes("trailing"),m=()=>{s!==null&&(a.apply(i,s),i=void 0,s=null)},f=()=>{n&&m(),d()},r=null,l=()=>{r!=null&&clearTimeout(r),r=setTimeout(()=>{r=null,f()},e)},p=()=>{r!==null&&(clearTimeout(r),r=null)},d=()=>{p(),i=void 0,s=null},b=()=>{p(),m()},c=function(...A){if(o?.aborted)return;i=this,s=A;let E=r==null;l(),x&&E&&m()};return c.schedule=l,c.cancel=d,c.flush=b,o?.addEventListener("abort",d,{once:!0}),c}function h(a,e=0,o={}){typeof o!="object"&&(o={});let{leading:t=!1,trailing:i=!0,maxWait:s}=o,x=Array(2);t&&(x[0]="leading"),i&&(x[1]="trailing");let n,m=null,f=v(function(...p){n=a.apply(this,p),m=null},e,{edges:x}),r=function(...p){return s!=null&&(m===null&&(m=Date.now()),Date.now()-m>=s)?(n=a.apply(this,p),m=Date.now(),f.cancel(),f.schedule(),n):(f.apply(this,p),n)},l=()=>(f.flush(),n);return r.cancel=f.cancel,r.flush=l,r}var g=class extends y{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[u]}constructor(e){super(e);let o=e.config.get("autosave")||{},t=o.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=h(this._save.bind(this),t),this._lastDocumentVersion=e.model.document.version,this._savePromise=null,this._domEmitter=new(_()),this._config=o,this._pendingActions=e.plugins.get(u),this._makeImmediateSave=!1}init(){let e=this.editor,o=e.model.document;this.listenTo(e,"ready",()=>{this.listenTo(o,"change:data",(t,i)=>{this._saveCallbacks.length&&i.isLocal&&(this.state==="synchronized"&&(this.state="waiting",this._setPendingAction()),this.state==="waiting"&&this._debouncedSave())})}),this.listenTo(e,"destroy",()=>this._flush(),{priority:"highest"});this._domEmitter.listenTo(window,"beforeunload",(t,i)=>
1{this._pendingActions.hasAny&&(i.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(e=>e(this.editor)))).finally(()=>{this._savePromise=null}).then(()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}).catch(e=>{throw this.state="error",this.state="saving",this._debouncedSave(),e}),this._savePromise)}_setPendingAction(){let e=this.editor.t;this._action||(this._action=this._pendingActions.add(e("Saving changes")))}get _saveCallbacks(){let e=[];return this.adapter&&this.adapter.save&&e.push(this.adapter.save),this._config.save&&e.push(this._config.save),e}};export{g as Autosave}; 2/*! Bundled license information: 3 4@ckeditor/ckeditor5-autosave/dist/index.js: 5 (** 6 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. 7 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 8 *) 9 (* istanbul ignore next -- @preserve *) 10*/ 11//# sourceMappingURL=@ckeditor$ckeditor5-autosave$dist$index.js.(42N3QBUR).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.