text: /*! Copyright Pyplan 2020. All rights reserved. */
  (window.webpackJsonp=window.webpackJsonp||[]).push([[287],{2108:function(e,t,o){"use strict";(function(l,i){var n,s;n=[o(746)],void 0===(s=function(e){return l.View.extend({el:i("none"),from:0,to:0,outsideInputForm:!1,includeAll:!1,isSelecting:!1,render:function(){var t=-1,o=this;this.el=this.options.$el,this.model=new e;var l=0;this.options.inputLength&&(l=this.options.inputLength),this.outsideInputForm=!1,this.includeAll=this.options.includeAll;var n=this.el.parent().width();n=n<100?150:n;var s="Select..";if(void 0!==o.options.selectedLabel&&null!==o.options.selectedLabel&&(s=o.options.selectedLabel),i(this.el).select2({placeholder:s,width:n,minimumInputLength:l,initSelection:function(e,t){o.options.selectedId&&t(o.options.selectedId)},query:function(e){clearTimeout(t);var l=o.options.params.pageSize,n=(e.page-1)*l+1,s=n+l;o.options.params.filters=[],1===e.page&&(n=1,s=l),o.options.params.fromReg=n,o.options.params.toReg=s,o.options.relatedObject&&i.each(o.options.relatedObject,function(e,t){var l=t.relatedVal;"-1"!==(l=""===l?"-1":l.split("|-|")[0])&&o.options.params.filters.push({field:(t.relatedManyToManyEntity?t.relatedManyToManyEntity+".":"")+t.relatedField,values:[l],relatedManyToManyKey:t.relatedManyToManyKey})}),e.context="something",t=setTimeout(function(){e.term&&""!==e.term&&o.options.params.filters.push({field:o.options.labelField,values:[e.term],useLike:!0});var t=o.options.params;o.model.getData(t,function(t){var n=!0,s="";if(t.length>0)for(var a=0;a<t.length;a++)t[a].id=t[a].id,s=t[a][o.options.labelField],t[a].text=null===s?"":s,o.options.enabledItemField&&(t[a].disabled=!t[a][o.options.enabledItemField]),parseInt(o.options.selectedId)===t[a].id&&(t[a].disabled=!0),t[a][o.options.valueField]=t[a].id+"|-|"+t[a][o.options.labelField];if((0===t.length||t.length<l)&&(n=!1),o.includeAll&&t.unshift({id:"-1",text:"All"}),o.el.hasClass("remoteDropdown select2-offscreen"))e.callback({results:t,more:n});else{var d=o.options.selectedId+"|-|"+o.options.selectedLabel,r={};r[o.options.valueField]=d,o.options.callback(r),i(o.el).select2("destroy")}})},400)},escapeMarkup:function(e){return e}}).on("select2-selecting",function(e){o.options.callback&&(o.isSelecting=!0,setTimeout(function(){o.options.callback(i(o.el).select2("data"))},100))}).on("select2-close",function(e){o.isSelecting||o.options.callback&&!o.outsideInputForm&&setTimeout(function(){var e=o.options.selectedId+"|-|"+o.options.selectedLabel,t={};t[o.options.valueField]=e,o.options.callback(t),i(o.el).select2("destroy")},100)}),o.outsideInputForm||i(o.el).select2("open"),!o.includeAll&&o.outsideInputForm){if(o.options.relatedObject){var a=o.options.relatedObject.relatedVal;"-1"!==(a=""===a?"-1":a.split("|-|")[0])&&(o.options.params.filters=[{field:(o.options.relatedObject.relatedManyToManyEntity?o.options.relatedObject.relatedManyToManyEntity+".":"")+o.options.relatedObject.relatedField,values:[a],relatedManyToManyKey:o.options.relatedObject.relatedManyToManyKey}])}var d=o.options.params;d.fromReg=1,d.toReg=1;var r="";o.model.getData(d,function(e){if(e.length>0)for(var t=0;t<e.length;t++)e[t].id=e[t].id,r=e[t][o.options.labelField],e[t].text=null===r?"":r,e[t][o.options.valueField]=e[t].id+"|-|"+e[t][o.options.labelField];i(o.el).select2("data",e),i(o.el).select2("val",e[0].id),i(o.el).trigger("filterSelected",[o.options])})}},destroy:function(){i(this.el).select2("destroy")}})}.apply(t,n))||(e.exports=s)}).call(this,o(218),o(1))}}]);