(function(A){const Util=Liferay.Util,Lang=A.Lang,htmlEscapedValues=[],htmlUnescapedValues=[],MAP_HTML_CHARS_ESCAPED={'"':"&#034;","&":"&amp;","'":"&#039;","/":"&#047;","<":"&lt;",">":"&gt;","`":"&#096;"},MAP_HTML_CHARS_UNESCAPED={};A.Object.each(MAP_HTML_CHARS_ESCAPED,((e,t)=>{MAP_HTML_CHARS_UNESCAPED[e]=t,htmlEscapedValues.push(e),htmlUnescapedValues.push(t)}));const REGEX_DASH=/-([a-z])/gi,STR_RIGHT_SQUARE_BRACKET="]";Util.actsAsAspect=function(object){object.yield=null,object.rv={},object.before=function(method,f){const original=eval("this."+method);this[method]=function(){return f.apply(this,arguments),original.apply(this,arguments)}},object.after=function(method,f){const original=eval("this."+method);this[method]=function(){return this.rv[method]=original.apply(this,arguments),f.apply(this,arguments)}},object.around=function(method,f){const original=eval("this."+method);this[method]=function(){return this.yield=original,f.apply(this,arguments)}}},Util.addInputFocus=function(){A.use("aui-base",(e=>{const t=function handleFocus(e){const t=e.target;let n=t.get("tagName");n&&(n=n.toLowerCase());const a=t.get("type");if("input"===n&&/text|password/.test(a)||"textarea"===n){let n="addClass";/blur|focusout/.test(e.type)&&(n="removeClass"),t[n]("focus")}};e.on("focus",t,document),e.on("blur",t,document)})),Util.addInputFocus=function(){}},Util.addInputType=function(e){return Util.addInputType=Lang.emptyFn,Util.addInputType(e)},Util.camelize=function(e,t){let n=REGEX_DASH;return t&&(n=new RegExp(t+"([a-z])","gi")),e=e.replace(n,((e,t)=>t.toUpperCase()))},Util.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)},Util.isEditorPresent=function(e){return Liferay.EDITORS&&Liferay.EDITORS[e]},Util.randomMinMax=function(e,t){return Math.round(Math.random()*(t-e))+e},Util.selectAndCopy=function(e){if(e.focus(),e.select(),document.all){e.createTextRange().execCommand("copy")}},Util.setBox=function(e,t){for(let t=e.length-1;t>-1;t--)e.options[t]=null;for(let n=0;n<t.length;n++)e.options[n]=new Option(t[n].value,n);e.options[0].selected=!0},Util.startsWith=function(e,t){return 0===e.indexOf(t)},Util.textareaTabs=function(e){const t=e.currentTarget.getDOM();if(e.isKey("TAB")){e.halt();const n=t.scrollTop;if(t.setSelectionRange){const e=t.selectionStart+1,n=t.value;t.value=n.substring(0,t.selectionStart)+"\t"+n.substring(t.selectionEnd,n.length),setTimeout((()=>{t.focus(),t.setSelectionRange(e,e)}),0)}else document.selection.createRange().text="\t";return t.scrollTop=n,!1}},Util.uncamelize=function(e,t){return t=t||" ",e=(e=e.replace(/([a-zA-Z][a-zA-Z])([A-Z])([a-z])/g,"$1"+t+"$2$3")).replace(/([a-z])([A-Z])/g,"$1"+t+"$2")},Liferay.provide(Util,"check",((e,t,n)=>{const a=A.one(e[t]);a&&a.attr("checked",n)}),["aui-base"]),Liferay.provide(Util,"disableSelectBoxes",((e,t,n)=>{const a=A.one("#"+n),i=A.one("#"+e);if(a&&i){const e=Lang.isFunction(t),n=function disabled(){const n=a.val();let o=t===n;e&&(o=t(n,t)),i.attr("disabled",!o)};n(),a.on("change",n)}}),["aui-base"]),Liferay.provide(Util,"disableTextareaTabs",(e=>{(e=A.one(e))&&"enabled"!==e.attr("textareatabs")&&(e.attr("textareatabs","disabled"),e.detach("keydown",Util.textareaTabs))}),["aui-base"]),Liferay.provide(Util,"enableTextareaTabs",(e=>{(e=A.one(e))&&"enabled"!==e.attr("textareatabs")&&(e.attr("textareatabs","disabled"),e.on("keydown",Util.textareaTabs))}),["aui-base"]),Liferay.provide(Util,"removeItem",((e,t)=>{const n=(e=A.one(e)).get("selectedIndex");t?e.all("option[value="+t+STR_RIGHT_SQUARE_BRACKET).item(n).remove(!0):e.all("option").item(n).remove(!0)}),["aui-base"]),Liferay.provide(Util,"resizeTextarea",((e,t)=>{let n=A.one("#"+e);if(n||(n=A.one("textarea[name="+e+STR_RIGHT_SQUARE_BRACKET)),n){const a=A.getBody();let i;const o=function resize(o){const s=a.get("winHeight");if(t)try{"iframe"!==n.get("nodeName").toLowerCase()&&(n=window[e])}catch(e){}if(!i){const e=a.one(".button-holder"),t=a.one(".lfr-template-editor");if(e&&t){const n=t.getXY();i=e.outerHeight(!0)+n[1]+25}else i=170}n=A.one(n);const l={width:"98%"};o&&(l.height=s-i),!t||n&&A.DOM.inDoc(n)?n&&n.setStyles(l):A.on("available",(()=>{n=A.one(window[e]),n&&n.setStyles(l)}),"#"+e+"_cp")};o();const s=Liferay.Util.getWindow();if(s){const e=s.iframe.after("resizeiframe:heightChange",o);A.getWin().on("unload",e.detach,e)}}}),["aui-base"]),Liferay.provide(Util,"setSelectedValue",((e,t)=>{const n=A.one(e).one("option[value="+t+STR_RIGHT_SQUARE_BRACKET);n&&n.attr("selected",!0)}),["aui-base"]),Liferay.provide(Util,"switchEditor",(e=>{const t=e.uri,n=Liferay.Util.getWindowName(),a=Liferay.Util.getWindow(n);a&&a.iframe.set("uri",t)}),["aui-io"])})(AUI());
//# sourceMappingURL=deprecated.js.map