PageSourceSearch

https://www.axa.es/o/frontend-editor-ckeditor-web/__liferay__/expo…keditor$ckeditor5-autosave$dist$index.js.js

js axa.es collected 2026-10-02 10:37:53 UTC 4,428 bytes, 11 lines download raw bytes

1var I=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var E=(t,r)=>{for(var o in r)I(t,o,{get:r[o],enumerable:!0})},b=(t,r,o,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of B(r))!P.call(t,e)&&e!==o&&I(t,e,{get:()=>r[e],enumerable:!(i=w(r,e))||i.enumerable});return t},h=(t,r,o)=>(b(t,r,"default"),o&&b(o,r,"default"));var _={};E(_,{Autosave:()=>v});var p={};h(p,O);import*as O from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";var l={};h(l,R);import*as R from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";function A(t,r,{signal:o,edges:i}={}){let e,s=null,c=i!=null&&i.includes("leading"),n=i==null||i.includes("trailing"),m=()=>{s!==null&&(t.apply(e,s),e=void 0,s=null)},x=()=>{n&&m(),g()},f=null,d=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,x()},r)},a=()=>{f!==null&&(clearTimeout(f),f=null)},g=()=>{a(),e=void 0,s=null},k=()=>{a(),m()},u=function(...W){if(o?.aborted)return;e=this,s=W;let S=f==null;d(),c&&S&&m()};return u.schedule=d,u.cancel=g,u.flush=k,o?.addEventListener("abort",g,{once:!0}),u}function y(t,r=0,o={}){typeof o!="object"&&(o={});let{leading:i=!1,trailing:e=!0,maxWait:s}=o,c=Array(2);i&&(c[0]="leading"),e&&(c[1]="trailing");let n,m=null,x=A(function(...a){n=t.apply(this,a),m=null},r,{edges:c}),f=function(...a){return s!=null&&(m===null&&(m=Date.now()),Date.now()-m>=s)?(n=t.apply(this,a),m=Date.now(),x.cancel(),x.schedule(),n):(x.apply(this,a),n)},d=()=>(x.flush(),n);return f.cancel=x.cancel,f.flush=d,f}var v=class extends p.Plugin{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[p.PendingActions]}constructor(r){super(r);let o=r.config.get("autosave")||{},i=o.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=y(this._save.bind(this),i),this._lastDocumentVersion=r.model.document.version,this._savePromise=null,this._domEmitter=new((0,l.DomEmitterMixin)()),this._config=o,this._pendingActions=r.plugins.get(p.PendingActions),this._makeImmediateSave=!1}init(){let r=this.editor,o=r.model.document;this.listenTo(r,"ready",()=>{this.listenTo(o,"change:data",(i,e)=>{this._saveCallbacks.length&&e.isLocal&&(this.state==="synchronized"&&(this.state="waiting",this._setPendingAction()),this.state==="waiting"&&this._debouncedSave())})}),this.listenTo(r,"destroy",()=>this._flush(),{priority:"highest"});this._domEmitter.listenTo(window,"beforeunload",(i,e)=>{this._pendingActions.hasAny&&(e.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(r=>r(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(r=>{throw this.state="error",this.state="saving",this._debouncedSave(),r}),this._savePromise)}_setPendingAction(){let r=this.editor.t;this._action||(this._action=this._pendingActions.add(r("Saving changes")))}get _saveCallbacks(){let r=[];return this.adapter&&this.adapter.save&&r.push(this.adapter.save),this._config.save&&r.push(this._config.save),r}};var{Autosave:F,__esModule:V}=_;export{F as Autosave,V as __esModule};
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.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.