text: BX.namespace("BX.Crm");if(typeof BX.Crm.EntityRequisiteSelector==="undefined"){BX.Crm.EntityRequisiteSelector=function(){this._id="";this._settings={};this._editorSaveHandler=BX.delegate(this.onEditorSave,this);this._editorCancelHandler=BX.delegate(this.onEditorCancel,this);this._editorReleaseHandler=BX.delegate(this.onEditorRelease,this);this._sliderCloseHandler=BX.delegate(this.onSliderClose,this)};BX.Crm.EntityRequisiteSelector.prototype={initialize:function(e,t){this._id=BX.type.isNotEmptyString(e)?e:BX.util.getRandomString(4);this._settings=t?t:{};this.bindEvents();if(typeof top.BX.Bitrix24.Slider!=="undefined"){var i=top.BX.Bitrix24.Slider.getCurrentPage();if(i){BX.addCustomEvent(i.getWindow(),"BX.Bitrix24.PageSlider:onClose",this._sliderCloseHandler)}}},bindEvents:function(){BX.addCustomEvent(window,"BX.Crm.EntityEditor:onSave",this._editorSaveHandler);BX.addCustomEvent(window,"BX.Crm.EntityEditor:onCancel",this._editorCancelHandler);BX.addCustomEvent(window,"BX.Crm.EntityEditor:onRelease",this._editorReleaseHandler)},unbindEvents:function(){BX.removeCustomEvent(window,"BX.Crm.EntityEditor:onSave",this._editorSaveHandler);BX.removeCustomEvent(window,"BX.Crm.EntityEditor:onCancel",this._editorCancelHandler);BX.removeCustomEvent(window,"BX.Crm.EntityEditor:onRelease",this._editorReleaseHandler)},onEditorSave:function(e,t){if(this._id!==BX.prop.getString(t,"id")){return}BX.localStorage.set("BX.Crm.EntityRequisiteSelector:onSave",{context:t["externalContext"],entityTypeId:t["entityTypeId"],entityId:t["entityId"],requisiteId:t["model"].getField("REQUISITE_ID",0),bankDetailId:t["model"].getField("BANK_DETAIL_ID",0)},10);t["cancel"]=true;t["enableCloseConfirmation"]=false;this.unbindEvents();this.closeSlider()},onEditorCancel:function(e,t){if(this._id!==BX.prop.getString(t,"id")){return}BX.localStorage.set("BX.Crm.EntityRequisiteSelector:onCancel",{context:t["externalContext"],entityTypeId:t["entityTypeId"],entityId:t["entityId"],requisiteId:t["model"].getField("REQUISITE_ID",0),bankDetailId:t["model"].getField("BANK_DETAIL_ID",0)},10);t["cancel"]=true;t["enableCloseConfirmation"]=false;this.unbindEvents();this.closeSlider()},onEditorRelease:function(e,t){if(this._id!==BX.prop.getString(t,"id")){return}BX.localStorage.set("BX.Crm.EntityRequisiteSelector:onCancel",{context:t["externalContext"],entityTypeId:t["entityTypeId"],entityId:t["entityId"],requisiteId:t["model"].getField("REQUISITE_ID",0),bankDetailId:t["model"].getField("BANK_DETAIL_ID",0)},10);this.unbindEvents();this.closeSlider()},closeSlider:function(){if(typeof top.BX.Bitrix24.Slider!=="undefined"){setTimeout(function(){top.BX.Bitrix24.Slider.close(false)},250)}},onSliderClose:function(e){setTimeout(function(){top.BX.Bitrix24.Slider.destroy(e.getUrl())},1e3)}};BX.Crm.EntityRequisiteSelector.create=function(e,t){var i=new BX.Crm.EntityRequisiteSelector;i.initialize(e,t);return i}}