text: /*!
   * OpenUI5
   * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["../base/DataType","../base/Object","../base/ManagedObject","../base/ManagedObjectRegistry","./ElementMetadata","../Device","sap/ui/performance/trace/Interaction","sap/base/Log","sap/base/assert","sap/ui/thirdparty/jquery","sap/ui/events/F6Navigation","./RenderManager"],function(e,t,r,i,o,n,a,s,u,l,p,g){"use strict";var d=r.extend("sap.ui.core.Element",{metadata:{stereotype:"element",abstract:true,publicMethods:["getId","getMetadata","getTooltip_AsString","getTooltip_Text","getModel","setModel","hasModel","bindElement","unbindElement","getElementBinding","prop","getLayoutData","setLayoutData"],library:"sap.ui.core",aggregations:{tooltip:{name:"tooltip",type:"sap.ui.core.TooltipBase",altTypes:["string"],multiple:false},customData:{name:"customData",type:"sap.ui.core.CustomData",multiple:true,singularName:"customData"},layoutData:{name:"layoutData",type:"sap.ui.core.LayoutData",multiple:false,singularName:"layoutData"},dependents:{name:"dependents",type:"sap.ui.core.Element",multiple:true},dragDropConfig:{name:"dragDropConfig",type:"sap.ui.core.dnd.DragDropBase",multiple:true,singularName:"dragDropConfig"}}},constructor:function(e,t){r.apply(this,arguments)},renderer:null},o);i.apply(d,{onDuplicate:function(e,t,r){if(t._sapui_candidateForDestroy){s.debug("destroying dangling template "+t+" when creating new object with same ID");t.destroy()}else{var i="adding element with duplicate id '"+e+"'";if(sap.ui.getCore().getConfiguration().getNoDuplicateIds()){s.error(i);throw new Error("Error: "+i)}else{s.warning(i)}}}});d.defineClass=function(e,r,i){return t.defineClass(e,r,i||o)};d.prototype.getInterface=function(){return this};d.prototype._handleEvent=function(e){var t=this,r="on"+e.type;function i(i){var o,n,a;if(i&&(n=i.length)>0){i=n===1?i:i.slice();for(o=0;o<n;o++){if(e.isImmediateHandlerPropagationStopped()){return}a=i[o].oDelegate;if(a[r]){a[r].call(i[o].vThis===true?t:i[o].vThis||a,e)}}}}i(this.aBeforeDelegates);if(e.isImmediateHandlerPropagationStopped()){return}if(this[r]){this[r](e)}i(this.aDelegates)};d.prototype.init=function(){};d.prototype.exit=function(){};d.create=r.create;d.prototype.toString=function(){return"Element "+this.getMetadata().getName()+"#"+this.sId};d.prototype.getDomRef=function(e){return document.getElementById(e?this.getId()+"-"+e:this.getId())};d.prototype.$=function(e){return l(this.getDomRef(e))};d.prototype.isActive=function(){return this.oParent&&this.oParent.isActive()};d.prototype.prop=function(e,t){var r=this.getMetadata().getAllSettings()[e];if(r){if(arguments.length==1){return this[r._sGetter]()}else{this[r._sMutator](t);return this}}};d.prototype.insertDependent=function(e,t){this.insertAggregation("dependents",e,t,true);return this};d.prototype.addDependent=function(e){this.addAggregation("dependents",e,true);return this};d.prototype.removeDependent=function(e){return this.removeAggregation("dependents",e,true)};d.prototype.removeAllDependents=function(){return this.removeAllAggregation("dependents",true)};d.prototype.destroyDependents=function(){this.destroyAggregation("dependents",true);return this};d.prototype.rerender=function(){if(this.oParent){this.oParent.rerender()}};d.prototype.getUIArea=function(){return this.oParent?this.oParent.getUIArea():null};d.prototype.destroy=function(e){if(this.bIsDestroyed){return}var t=!this.getParent();d._updateFocusInfo(this);r.prototype.destroy.call(this,e);this.data=D;var i=this.getDomRef();if(!i){return}var o=e==="KeepDom";if(e===true||!o&&t||this.isA("sap.ui.core.PopupInterface")||g.isPreservedContent(i)){l(i).remove()}else{i.removeAttribute("data-sap-ui-preserve");if(!o){i.id="sap-ui-destroyed-"+this.getId();for(var n=0,a=i.querySelectorAll('[id^="'+this.getId()+'-"]');n<a.length;n++){a[n].id="sap-ui-destroyed-"+a[n].id}}}};d.prototype.fireEvent=function(e,t,i,o){if(this.hasListeners(e)){a.notifyStepStart(e,this)}if(typeof t==="boolean"){o=i;i=t;t=null}t=t||{};t.id=t.id||this.getId();if(d._interceptEvent){d._interceptEvent(e,this,t)}return r.prototype.fireEvent.call(this,e,t,i,o)};d._interceptEvent=undefined;d.prototype.addDelegate=function(e,t,r,i){u(e,"oDelegate must be not null or undefined");if(!e){return this}this.removeDelegate(e);if(typeof t==="object"){i=r;r=t;t=false}if(typeof r==="boolean"){i=r;r=undefined}(t?this.aBeforeDelegates:this.aDelegates).push({oDelegate:e,bClone:!!i,vThis:r===this?true:r});return this};d.prototype.removeDelegate=function(e){var t;for(t=0;t<this.aDelegates.length;t++){if(this.aDelegates[t].oDelegate==e){this.aDelegates.splice(t,1);t--}}for(t=0;t<this.aBeforeDelegates.length;t++){if(this.aBeforeDelegates[t].oDelegate==e){this.aBeforeDelegates.splice(t,1);t--}}return this};d.prototype.addEventDelegate=function(e,t){return this.addDelegate(e,false,t,true)};d.prototype.removeEventDelegate=function(e){return this.removeDelegate(e)};d.prototype.getFocusDomRef=function(){return this.getDomRef()||null};function f(e){var t,r=[];t=e.parentNode;while(t){r.push({node:t,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop});t=t.parentNode}return r}function h(e){e.forEach(function(e){var t=e.node;if(t.scrollLeft!==e.scrollLeft){t.scrollLeft=e.scrollLeft}if(t.scrollTop!==e.scrollTop){t.scrollTop=e.scrollTop}})}d.prototype.focus=function(e){var t=this.getFocusDomRef(),r=[];e=e||{};if(t){if(n.browser.safari){if(e.preventScroll===true){r=f(t)}t.focus();if(r.length>0){setTimeout(h.bind(null,r),0)}}else{t.focus(e)}}};d.prototype.getFocusInfo=function(){return{id:this.getId()}};d.prototype.applyFocusInfo=function(e){this.focus(e);return this};d.prototype._refreshTooltipBaseDelegate=function(e){var r=this.getTooltip();if(t.isA(r,"sap.ui.core.TooltipBase")){this.removeDelegate(r)}if(t.isA(e,"sap.ui.core.TooltipBase")){e._currentControl=this;this.addDelegate(e)}};d.prototype.setTooltip=function(e){this._refreshTooltipBaseDelegate(e);this.setAggregation("tooltip",e);return this};d.prototype.getTooltip=function(){return this.getAggregation("tooltip")};d.runWithPreprocessors=r.runWithPreprocessors;d.prototype.getTooltip_AsString=function(){var e=this.getTooltip();if(typeof e==="string"||e instanceof String){return e}return undefined};d.prototype.getTooltip_Text=function(){var e=this.getTooltip();if(e&&typeof e.getText==="function"){return e.getText()}return e};var c=d.extend("sap.ui.core.CustomData",{metadata:{library:"sap.ui.core",properties:{key:{type:"string",group:"Data",defaultValue:null},value:{type:"any",group:"Data",defaultValue:null},writeToDom:{type:"boolean",group:"Data",defaultValue:false}},designtime:"sap/ui/core/designtime/CustomData.designtime"}});c.prototype.setValue=function(e){this.setProperty("value",e,true);var t=this.getParent();if(t&&t.getDomRef()){var r=this._checkWriteToDom(t);if(r){t.$().attr(r.key,r.value)}}return this};c.prototype._checkWriteToDom=function(t){if(!this.getWriteToDom()){return null}var r=this.getKey();var i=this.getValue();function o(e){s.error("CustomData with key "+r+" should be written to HTML of "+t+" but "+e);return null}if(typeof i!="string"){return o("the value is not a string.")}var n=e.getType("sap.ui.core.ID");if(!n.isValid(r)||r.indexOf(":")!=-1){return o("the key is not valid (must be a valid sap.ui.core.ID without any colon).")}if(r==p.fastNavigationKey){i=/^\s*(x|true)\s*$/i.test(i)?"true":"false"}else if(r.indexOf("sap-ui")==0){return o("the key is not valid (may not start with 'sap-ui').")}return{key:"data-"+r,value:i}};function y(e,t){var r=e.getAggregation("customData");if(r){for(var i=0;i<r.length;i++){if(r[i].getKey()==t){return r[i]}}}return null}function m(e,t,r,i){var o=y(e,t);if(r===null){if(!o){return}var n=e.getAggregation("customData").length;if(n==1){e.destroyAggregation("customData",true)}else{e.removeAggregation("customData",o,true);o.destroy()}}else if(o){o.setValue(r);o.setWriteToDom(i)}else{e.addAggregation("customData",new c({key:t,value:r,writeToDom:i}),true)}}d.prototype.data=function(){var e=arguments.length;if(e==0){var t=this.getAggregation("customData"),r={};if(t){for(var i=0;i<t.length;i++){r[t[i].getKey()]=t[i].getValue()}}return r}else if(e==1){var o=arguments[0];if(o===null){this.destroyAggregation("customData",true);return this}else if(typeof o=="string"){var n=y(this,o);return n?n.getValue():null}else if(typeof o=="object"){for(var a in o){m(this,a,o[a])}return this}else{throw new TypeError("When data() is called with one argument, this argument must be a string, an object or null, but is "+typeof o+":"+o+" (on UI Element with ID '"+this.getId()+"')")}}else if(e==2){m(this,arguments[0],arguments[1]);return this}else if(e==3){m(this,arguments[0],arguments[1],arguments[2]);return this}else{throw new TypeError("data() may only be called with 0-3 arguments (on UI Element with ID '"+this.getId()+"')")}};d._CustomData=c;function D(){var e=arguments.length;if(e===1&&arguments[0]!==null&&typeof arguments[0]=="object"||e>1&&e<4&&arguments[1]!==null){s.error("Cannot create custom data on an already destroyed element '"+this+"'");return this}return d.prototype.data.apply(this,arguments)}d.prototype.clone=function(e,t){var i=r.prototype.clone.apply(this,arguments);for(var o=0;o<this.aDelegates.length;o++){if(this.aDelegates[o].bClone){i.aDelegates.push(this.aDelegates[o])}}for(var n=0;n<this.aBeforeDelegates.length;n++){if(this.aBeforeDelegates[n].bClone){i.aBeforeDelegates.push(this.aBeforeDelegates[n])}}if(this._sapui_declarativeSourceInfo){i._sapui_declarativeSourceInfo=Object.assign({},this._sapui_declarativeSourceInfo)}return i};d.prototype.findElements=r.prototype.findAggregatedObjects;function v(e){var t=e.getParent();if(t){var r=l.Event("LayoutDataChange");r.srcControl=e;t._handleEvent(r)}}d.prototype.setLayoutData=function(e){this.setAggregation("layoutData",e,true);v(this);return this};d.prototype.destroyLayoutData=function(){this.destroyAggregation("layoutData",true);v(this);return this};d.prototype.bindElement=r.prototype.bindObject;d.prototype.unbindElement=r.prototype.unbindObject;d.prototype.getElementBinding=r.prototype.getObjectBinding;d.prototype._getFieldGroupIds=function(){var e;if(this.getMetadata().hasProperty("fieldGroupIds")){e=this.getFieldGroupIds()}if(!e||e.length==0){var t=this.getParent();if(t&&t._getFieldGroupIds){return t._getFieldGroupIds()}}return e||[]};d.prototype.getDomRefForSetting=function(e){var t=this.getMetadata().getAllSettings()[e];if(t&&t.selector){var r=this.getDomRef();if(r){r=r.parentNode;if(r&&r.querySelector){var i=t.selector.replace(/\{id\}/g,this.getId().replace(/(:|\.)/g,"\\$1"));return r.querySelector(i)}}}return null};d.prototype._getMediaContainerWidth=function(){if(typeof this._oContextualSettings==="undefined"){return undefined}return this._oContextualSettings.contextualWidth};d.prototype._getCurrentMediaContainerRange=function(e){var t=this._getMediaContainerWidth();e=e||n.media.RANGESETS.SAP_STANDARD;return n.media.getCurrentRange(e,t)};d.prototype._onContextualSettingsChanged=function(){var e=this._getMediaContainerWidth(),t=e!==undefined,r=t^!!this._bUsingContextualWidth,i=this._aContextualWidthListeners||[];if(r){if(t){i.forEach(function(e){n.media.detachHandler(e.callback,e.listener,e.name)})}else{i.forEach(function(e){n.media.attachHandler(e.callback,e.listener,e.name)})}this._bUsingContextualWidth=t}i.forEach(function(e){var t=this._getCurrentMediaContainerRange(e.name);if(t&&t.from!==e.media.from){e.media=t;e.callback.call(e.listener||window,t)}},this)};d.prototype._attachMediaContainerWidthChange=function(e,t,r){r=r||n.media.RANGESETS.SAP_STANDARD;this._aContextualWidthListeners=this._aContextualWidthListeners||[];this._aContextualWidthListeners.push({callback:e,listener:t,name:r,media:this._getCurrentMediaContainerRange(r)});if(!this._bUsingContextualWidth){n.media.attachHandler(e,t,r)}};d.prototype._detachMediaContainerWidthChange=function(e,t,r){var i;r=r||n.media.RANGESETS.SAP_STANDARD;if(!this._aContextualWidthListeners){return}for(var o=0,a=this._aContextualWidthListeners.length;o<a;o++){i=this._aContextualWidthListeners[o];if(i.callback===e&&i.listener===t&&i.name===r){if(!this._bUsingContextualWidth){n.media.detachHandler(e,t,r)}this._aContextualWidthListeners.splice(o,1);break}}};return d});