Liferay.Loader.define("frontend-js-web@5.0.31/liferay/aop/AOP.es",["module","exports","require"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.AOP=t.default=void 0;const e="alterReturn",r="halt",a="__METAL_AOP__",n="prevent";class s{constructor(e,t){this.after_=[],this.before_=[],this.fnName_=t,this.fn_=e[t],this.obj_=e}createHandle(e,t){return{detach:this.detach_.bind(this,e,t)}}detach_(e,t){const r=t?this.before_:this.after_;r.splice(r.indexOf(e),1)}exec(...t){let i,a,f=!1;for(let e=0;e<this.before_.length;e++)if(i=this.before_[e].apply(this.obj_,t),i&&i.type){if(i.type===r)return i.value;i.type===n&&(f=!0)}f||(a=this.fn_.apply(this.obj_,t)),s.currentRetVal=a,s.originalRetVal=a;for(let n=0;n<this.after_.length;n++)if(i=this.after_[n].apply(this.obj_,t),i&&i.type){if(i.type===r)return i.value;i.type===e&&(a=i.value,s.currentRetVal=a)}return a}register(e,t){return t?this.before_.push(e):this.after_.push(e),this.createHandle(e,t)}static after(e,t,r){return s.inject(!1,e,t,r)}static alterReturn(t){return s.modify_(e,t)}static before(e,t,r){return s.inject(!0,e,t,r)}static halt(e){return s.modify_(r,e)}static inject(e,t,r,i){let n=r[a];return n||(n=r[a]={}),n[i]||(n[i]=new s(r,i),r[i]=function(...e){return n[i].exec(...e)}),n[i].register(t,e)}static modify_(e,t){return{type:e,value:t}}static prevent(){return s.modify_(n)}}t.AOP=s;var i=s;t.default=i}}));
//# sourceMappingURL=AOP.es.js.map