nice-elements 1.4.5 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/README.md +1 -1
- package/dist/nice.js +12 -4
- package/dist/nice.min.js +1 -1
- package/dist/style.css +3 -2
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-date/nice-date.html +1 -1
- package/src/components/nice-date/nice-date.js +8 -3
- package/src/components/nice-date/nice-date.scss +1 -1
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +2 -1
- package/src/components/nice-search2/nice-search2.js +3 -0
package/dist/nice.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";angular.module("niceElements",[]),angular.module("niceElements").directive("niceButtonToggle",function(){return{templateUrl:"src/components/nice-button-toggle/nice-button-toggle.html",restrict:"E",scope:{model:"=?",label:"@"},link:function(scope,element,attrs){angular.isDefined(scope.model)&&(scope.model=!1)}}}),angular.module("niceElements").directive("niceButton",function($q){return{templateUrl:"src/components/nice-button/nice-button.html",restrict:"E",transclude:!0,scope:{niceDisabled:"=",title:"@",noMargin:"=",fieldWidth:"@",labelWidth:"@",niceClick:"&",addClass:"@",isInline:"=",type:"@"},link:function(scope,element,attrs){scope.loading=!1,scope.type||(scope.type="button"),scope.click=function(){!1===scope.loading&&!0!==scope.niceDisabled&&(scope.loading=!0,$q.when(scope.niceClick()).finally(function(){scope.loading=!1}))}}}}),angular.module("niceElements").directive("niceCalendar",function($timeout,gettextCatalog){return{restrict:"E",templateUrl:"src/components/nice-calendar/nice-calendar.html",scope:{title:"@",fieldWidth:"@",labelWidth:"@",minDate:"=",maxDate:"=",hideHover:"=",time:"=",noMargin:"@",color:"@",endDate:"=",startDate:"=",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element){function bootstrap(){scope.time?(scope.startDateHour=moment(scope.startDate).hours(),scope.startDateMinute=moment(scope.startDate).minutes(),scope.endDateHour=moment(scope.endDate).hours(),scope.endDateMinute=moment(scope.endDate).minutes()):(scope.startDateHour=0,scope.startDateMinute=0,scope.startDate.hours(0),scope.startDate.minutes(0),scope.startDate.seconds(0),scope.startDate.millisecond(0),scope.endDateHour=0,scope.endDateMinut=0,scope.endDate.hours(23),scope.endDate.minutes(59),scope.endDate.seconds(59),scope.endDate.millisecond(999)),scope.month=angular.copy(moment(scope.startDate));var start=angular.copy(moment(scope.startDate));_removeTimeWithDate(start.date(0)),_buildMonth(scope,start,scope.month)}function _removeTime(date){return moment(date).hour(0).minute(0).second(0).millisecond(0)}function _removeTimeWithDate(date){return date.day(0).hour(0).minute(0).second(0).millisecond(0)}function _buildMonth(scope,start,month){var done=!(scope.weeks=[]),date=start.clone().startOf("week").isoWeekday(1),monthIndex=date.month(),count=0;for(date.add(1,"w");!done;)scope.weeks.push({days:_buildWeek(date.clone(),month)}),date.add(1,"w"),done=2<count++&&monthIndex!==date.month(),monthIndex=date.month()}function _buildWeek(date,month){for(var days=[],i=0;i<7;i++){var day={name:date.format("dd"),number:date.date(),isCurrentMonth:date.month()===month.month(),isToday:date.isSame(new Date,"day"),isWeekday:0==date.weekday()||6==date.weekday(),date:date};scope.minDate&&(day.isDisabled=date.isBefore(moment(scope.minDate))),scope.maxDate&&(day.isDisabled=date.isAfter(moment(scope.maxDate))),scope.minDate&&scope.maxDate&&(day.isDisabled=!date.isBetween(moment(scope.minDate),moment(scope.maxDate))),days.push(day),(date=date.clone()).add(1,"d")}return days}scope.selectStart=!0,scope.popupText=gettextCatalog.getString("Select start date",null,"Nice"),scope.hours=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],scope.minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],scope.startDate||(scope.startDate=moment().minutes(0).second(0).millisecond(0)),scope.endDate||(scope.endDate=moment().minutes(0).second(0).millisecond(0)),scope.$watch("startDate",function(value,valueOld){bootstrap()}),scope.$watch("endDate",function(value,valueOld){bootstrap()}),scope.$watch("minDate",function(value,valueOld){bootstrap()}),scope.$watch("maxDate",function(value,valueOld){bootstrap()}),bootstrap(),scope.select=function(selectedDate){selectedDate.isDisabled||(selectedDate=angular.copy(selectedDate.date),scope.selectStart?(scope.time?(selectedDate.hours(scope.startDateHour),selectedDate.minutes(scope.startDateMinute)):(selectedDate.hours(0),selectedDate.minutes(0),selectedDate.seconds(0),selectedDate.millisecond(0)),scope.startDate=selectedDate,scope.selectStart=!1,scope.popupText=gettextCatalog.getString("Select end date",null,"Nice"),scope.formCalendar.$setDirty(),scope.displayStartChange(),scope.startDate.isAfter(scope.endDate)&&(scope.endDate=angular.copy(scope.startDate))):(scope.time?(selectedDate.hours(scope.endDateHour),selectedDate.minutes(scope.endDateMinute)):(selectedDate.hours(23),selectedDate.minutes(59),selectedDate.seconds(59),selectedDate.millisecond(999)),scope.endDate=selectedDate,scope.selectStart=!0,scope.popupText=gettextCatalog.getString("Select start date",null,"Nice"),scope.formCalendar.$setDirty(),scope.displayEndChange(),scope.endDate.isBefore(scope.startDate)&&(scope.startDate=angular.copy(scope.endDate))),scope.onChange&&scope.onChange({model:{startDate:scope.startDate,endDate:scope.endDate},element:element}))},scope.displayStartChange=function(){scope.startTimeClass="change",$timeout(function(){scope.startTimeClass=""},1e3)},scope.displayEndChange=function(){scope.endTimeClass="change",$timeout(function(){scope.endTimeClass=""},1e3)},scope.startHourChange=function(value){scope.startDateHour=value,scope.startDate=moment(scope.startDate).hours(scope.startDateHour),scope.formCalendar.$setDirty(),scope.displayStartChange(),scope.handleUpdate()},scope.startMinuteChange=function(value){scope.startDateMinute=value,scope.startDate=moment(scope.startDate).minutes(scope.startDateMinute),scope.formCalendar.$setDirty(),scope.displayStartChange(),scope.handleUpdate()},scope.endHourChange=function(value){scope.endDateHour=value,scope.endDate=moment(scope.endDate).hours(scope.endDateHour),scope.formCalendar.$setDirty(),scope.displayEndChange(),scope.handleUpdate()},scope.endMinuteChange=function(value){scope.endDateMinute=value,scope.endDate=moment(scope.endDate).minutes(scope.endDateMinute),scope.formCalendar.$setDirty(),scope.displayEndChange(),scope.handleUpdate()},scope.handleUpdate=function(){scope.onChange&&scope.onChange({model:{startDate:scope.startDate,endDate:scope.endDate},element:element})},scope.next=function(){var next=angular.copy(scope.month);_removeTimeWithDate(next.month(next.month()+1).date(0)),scope.month.month(scope.month.month()+1),_buildMonth(scope,next,scope.month)},scope.previous=function(){var previous=angular.copy(scope.month);_removeTimeWithDate(previous.month(previous.month()-1).date(0)),scope.month.month(scope.month.month()-1),_buildMonth(scope,previous,scope.month)},scope.isSameDay=function(d1,d2){d1=_removeTime(angular.copy(d1)),d2=_removeTime(angular.copy(d2));return d1.isSame(d2)},scope.isBetweenRange=function(date){return date.isBefore(moment(scope.endDate))&&date.isAfter(moment(scope.startDate))},scope.formatDate=function(date){return scope.time?moment(date).format("D.M.YYYY • H:mm"):moment(date).format("D.M.YYYY")},scope.lighten=function(b){var usePound=!1;"#"==b[0]&&(b=b.slice(1),usePound=!0);var g=parseInt(b,16),r=20+(g>>16);255<r?r=255:r<0&&(r=0);b=20+(g>>8&255);255<b?b=255:b<0&&(b=0);g=20+(255&g);return 255<g?g=255:g<0&&(g=0),(usePound?"#":"")+(g|b<<8|r<<16).toString(16)}}}}),angular.module("niceElements").directive("niceCheckbox",function(){return{templateUrl:"src/components/nice-checkbox/nice-checkbox.html",restrict:"E",scope:{model:"=",title:"@",noMargin:"@",onChange:"&?"},controller:function($scope){void 0===$scope.model&&($scope.model=!1),$scope.toggle=function(){$scope.model=!$scope.model,$scope.onChange&&$scope.onChange({model:$scope.model})}}}}),angular.module("niceElements").directive("niceChoice",function(){return{transclude:!0,templateUrl:"src/components/nice-choice/nice-choice.html",restrict:"E",scope:{title:"@",model:"=",list:"=",isDisabled:"=",fieldWidth:"@",labelWidth:"@",listIsObj:"@",selectedIsObj:"@",objValue:"@",objKey:"@",noMargin:"@",multiple:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element,obj){obj.title||(obj.title=""),obj.fieldWidth||(obj.fieldWidth="col-sm-8"),obj.labelWidth||(obj.labelWidth="col-sm-4"),obj.listIsObj=angular.isDefined(obj.listIsObj),obj.selectedIsObj=angular.isDefined(obj.selectedIsObj),obj.objValue||(obj.objValue="value"),obj.objKey||(obj.objKey="id"),obj.multiple=angular.isDefined(obj.multiple),scope.firstTime=!0,scope.checkIfFirstTime=function(){return!!scope.firstTime&&!(scope.firstTime=!1)},angular.isDefined(scope.model)||scope.multiple&&(scope.model=[]),scope.listIsObj?scope.internalList=scope.list:scope.internalList=_.map(scope.list,function(val){var obj={};return obj[scope.objKey]=val,obj[scope.objValue]=val,obj}),scope.selectedIsObj?scope.internalSelected=scope.model:scope.multiple?scope.internalSelected=_.map(scope.model,function(val){var obj={};return obj[scope.objKey]=val,obj[scope.objValue]=val,obj}):scope.model?((obj={})[scope.objKey]=scope.model,obj[scope.objValue]=scope.model,scope.internalSelected=obj):scope.internalSelected=scope.internalList[0]},controller:function($rootScope,$scope){function getFilter(item){var filter={};return item.hasOwnProperty($scope.objKey)?filter[$scope.objKey]=item[$scope.objKey]:filter[$scope.objKey]=item,filter}$scope.setDefault=function(){$scope.multiple||($scope.internalSelected=$scope.internalList[0])},$scope.isItemSelected=function(item){return!!$scope.internalSelected&&($scope.multiple?0<_.where($scope.internalSelected,getFilter(item)).length:$scope.internalSelected[$scope.objKey]==item[$scope.objKey])},$scope.toggle=function(item){$scope.isDisabled||($scope.formChoice.$setDirty(),$scope.multiple?$scope.isItemSelected(item)?$scope.internalSelected=_.without($scope.internalSelected,_.findWhere($scope.internalSelected,getFilter(item))):$scope.internalSelected.push(item):$scope.internalSelected=item)},$scope.getLabel=function(item){return item[$scope.objValue]},$scope.$watchCollection("list",function(value_new,value_old){$scope.listIsObj?$scope.internalList=$scope.list:$scope.internalList=_.map($scope.list,function(val){var obj={};return obj[$scope.objKey]=val,obj[$scope.objValue]=val,obj})}),$scope.$watchCollection("internalSelected",function(value_new,value_old){!value_new||angular.equals(value_new,value_old)&&!$scope.checkIfFirstTime()||($scope.selectedIsObj?$scope.model=value_new:$scope.multiple?$scope.model=_.map(value_new,$scope.objKey):$scope.model=value_new[$scope.objKey],$scope.onChange&&$scope.onChange({model:$scope.model}))}),$scope.$watchCollection("model",function(value_new,value_old){angular.equals(value_new,value_old)||(value_new?$scope.selectedIsObj?$scope.internalSelected=value_new:$scope.multiple?$scope.internalSelected=_.map(value_new,function(item){return _.find($scope.internalList,getFilter(item))}):$scope.internalSelected=_.find($scope.internalList,getFilter(value_new)):$scope.multiple?$scope.internalSelected=[]:$scope.internalSelected=$scope.internalList[0]),value_new||$scope.multiple||($scope.internalSelected=$scope.internalList[0])})}}}),angular.module("niceElements").directive("clickOutside",function($document,$parse,$timeout){return{restrict:"A",link:function($scope,elem,attr){$scope.isOpen=!1,attr.$observe("isOpen",function(value){$scope.isOpen="true"==value}),$timeout(function(){var classList=void 0!==attr.outsideIfNot?attr.outsideIfNot.split(/[ ,]+/):[];function eventHandler(e){var i,element,r,id,classNames,l;if($scope.isOpen&&(e&&e.target)){for(element=e.target;element;element=element.parentNode){if(element===elem[0])return;if(id=element.id,classNames=element.className,l=classList.length,(classNames=classNames&&void 0!==classNames.baseVal?classNames.baseVal:classNames)||id)for(i=0;i<l;i++)if(r=new RegExp("\\b"+classList[i]+"\\b"),void 0!==id&&id===classList[i]||classNames&&r.test(classNames))return}$timeout(function(){$parse(attr.clickOutside)($scope,{event:e})})}}function _hasTouch(){return"ontouchstart"in window||navigator.maxTouchPoints}_hasTouch()&&$document.on("touchstart",eventHandler),$document.on("click",eventHandler),$scope.$on("$destroy",function(){_hasTouch()&&$document.off("touchstart",eventHandler),$document.off("click",eventHandler)})})}}}),angular.module("niceElements").directive("niceComment",function($timeout){return{templateUrl:"src/components/nice-comment/nice-comment.html",restrict:"E",scope:{model:"=",title:"@?",placeholder:"@",noTextLabel:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",help:"@",isInline:"=",rows:"@"},link:function(scope,element,attrs){null==scope.model&&(scope.model=""),attrs.placeholder||(attrs.placeholder=""),attrs.noTextLabel||angular.isDefined(attrs.noTextLabel),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.help||(attrs.help=""),attrs.rows||(attrs.rows=1);var textareas=element.find("textarea");function autosize(){var el=textareas[0];$timeout(function(){el.style.cssText="height:auto; padding:0",el.style.cssText="-moz-box-sizing:content-box",el.style.cssText="height:"+(el.scrollHeight+2)+"px"})}scope.edit=function(){scope.editing=!0,$timeout(function(){textareas[0].focus()})},textareas[0].addEventListener("keydown",autosize),autosize()},controller:function($scope){$scope.editing=!1,$scope.save=function(){$scope.editing=!1}}}}),angular.module("niceElements").directive("niceDateRange",function(){return{restrict:"E",transclude:!0,templateUrl:"src/components/nice-date-range/nice-date-range.html",scope:{model:"=",title:"@",fieldWidth:"@",format:"@",min:"@",max:"@",noMargin:"@",labelWidth:"@",startOfTheYear:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,model){model.title||(model.title=""),model.fieldWidth||(model.fieldWidth="col-sm-8"),model.labelWidth||(model.labelWidth="col-sm-4"),model.format||(model.format="dd.MM.yyyy"),model.noMargin=angular.isDefined(model.noMargin),angular.isDefined(scope.model)||(model=null,model=angular.isDefined(scope.startOfTheYear)?{startDate:moment([moment().year()]).format(),endDate:moment().format()}:{startDate:moment().format(),endDate:moment().format()},scope.model=model,scope.onChange&&scope.onChange(scope.model))},controller:function($scope){$scope.opts={locale:{applyClass:"btn-green",firstDay:1},ranges:{},min:$scope.min,max:$scope.max},$scope.opts.ranges[gettextCatalog.getString("Today",null,"Nice")]=[moment(),moment()],$scope.opts.ranges[gettextCatalog.getString("Last 7 days",null,"Nice")]=[moment().subtract(7,"days"),moment()],$scope.opts.ranges[gettextCatalog.getString("Last 30 days",null,"Nice")]=[moment().subtract(30,"days"),moment()],$scope.opts.ranges[gettextCatalog.getString("This month",null,"Nice")]=[moment().startOf("month"),moment().endOf("month")],angular.isDefined($scope.format)&&($scope.opts.format=format)}}}),angular.module("niceElements").directive("niceDate",function(){return{restrict:"E",replace:!0,transclude:!0,templateUrl:"src/components/nice-date/nice-date.html",scope:{title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",model:"=",time:"@",help:"@",inline:"@",maxDate:"=",minDate:"=",nextDate:"=",isDisabled:"=",isInline:"=",onChange:"&?"},controller:function($scope,$element,gettextCatalog){$scope.isOpen=!1,$scope.hours=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],$scope.minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],$scope.translations={nextMonth:gettextCatalog.getString("Next month",null,"Nice"),prevMonth:gettextCatalog.getString("Previous month",null,"Nice")},$scope.innerDate={month:0,year:0,minute:0,hour:0,date:moment(),value:""},$scope.days=[],$scope.weekdays=[gettextCatalog.getString("Mon",null,"Nice"),gettextCatalog.getString("Tue",null,"Nice"),gettextCatalog.getString("Wed",null,"Nice"),gettextCatalog.getString("Thu",null,"Nice"),gettextCatalog.getString("Fri",null,"Nice"),gettextCatalog.getString("Sat",null,"Nice"),gettextCatalog.getString("Sun",null,"Nice")],$scope.years=[];for(var year=moment().year()-100,i=0;i<200;i++)$scope.years.push(year+i);$scope.months=[{value:0,name:gettextCatalog.getString("January",null,"Nice")},{value:1,name:gettextCatalog.getString("February",null,"Nice")},{value:2,name:gettextCatalog.getString("March",null,"Nice")},{value:3,name:gettextCatalog.getString("April",null,"Nice")},{value:4,name:gettextCatalog.getString("May",null,"Nice")},{value:5,name:gettextCatalog.getString("June",null,"Nice")},{value:6,name:gettextCatalog.getString("July",null,"Nice")},{value:7,name:gettextCatalog.getString("August",null,"Nice")},{value:8,name:gettextCatalog.getString("September",null,"Nice")},{value:9,name:gettextCatalog.getString("October",null,"Nice")},{value:10,name:gettextCatalog.getString("November",null,"Nice")},{value:11,name:gettextCatalog.getString("December",null,"Nice")}],$scope.model||($scope.model=moment()),$scope.time?$scope.time="true"==$scope.time:$scope.time=!1,$scope.maxDate&&($scope.maxDate=moment($scope.maxDate)),$scope.minDate&&($scope.minDate=moment($scope.minDate)),$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("nice-date-button")[0],tooltip=$element[0].getElementsByClassName("nice-date-dropdown-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,5]}}]})},$scope.inline||$scope.setupPopper(),$scope.timeChange=function(){var selectedDate=angular.copy($scope.model);(selectedDate=$scope._removeTime(selectedDate)).hours($scope.innerDate.hour),selectedDate.minutes($scope.innerDate.minute),$scope.innerDate.value=$scope.formatDate(selectedDate),$scope.model=selectedDate,$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.forma.$setDirty()},$scope.select=function(selectedDate){selectedDate.isDisabled||((selectedDate=angular.copy(selectedDate.date)).hours($scope.innerDate.hour),selectedDate.minutes($scope.innerDate.minute),$scope.model=selectedDate,$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.forma.$setDirty())},$scope.handleDateChange=function(){$scope.innerDate.date.year($scope.innerDate.year),$scope.innerDate.date.month($scope.innerDate.month),$scope._buildMonth()},$scope.setInnerDate=function(date){$scope.innerDate.year=date.year(),$scope.innerDate.month=date.month(),$scope.innerDate.date=date},$scope.today=function(){$scope.setInnerDate(moment()),$scope._buildMonth()},$scope.next=function(){$scope.innerDate.date.add(1,"month"),$scope.setInnerDate($scope.innerDate.date),$scope._buildMonth()},$scope.previous=function(){$scope.innerDate.date.subtract(1,"month"),$scope.setInnerDate($scope.innerDate.date),$scope._buildMonth()},$scope.isSameDay=function(date1,date2){return date1=moment(date1),date2=moment(date2),date1.date()==date2.date()&&date1.month()==date2.month()&&date1.year()==date2.year()},$scope.isSameMonth=function(date1,date2){return date1=moment(date1),date2=moment(date2),date1.month()==date2.month()&&date1.year()==date2.year()},$scope.isBetween=function(date1,date2,date3){return!!$scope.nextDate&&(!(!$scope.isSameDay(date1,date2)&&!$scope.isSameDay(date1,date3))||(date2.isBefore(date3)?$scope._removeTime(date1).isBetween(date2,date3):$scope._removeTime(date1).isBetween(date3,date2)))},$scope.formatDate=function(date){return $scope.time?date.format("D.M.YYYY • H:mm"):date.format("D.M.YYYY")},$scope._removeTime=function(date){return date.hour(0).minute(0).second(0).millisecond(0)},$scope._removeTimeWithDate=function(date){return date.date(0).hour(0).minute(0).second(0).millisecond(0)},$scope._buildMonth=function(){var done=!1,date=angular.copy($scope.innerDate.date).date(0).startOf("week").isoWeekday(1),monthIndex=date.month(),count=0;for(date.add(1,"w"),$scope.weeks=[];!done;)$scope.weeks.push({days:$scope._buildWeek(date.clone())}),date.add(1,"w"),done=2<count++&&monthIndex!==date.month(),monthIndex=date.month()},$scope._buildWeek=function(date){for(var days=[],i=0;i<7;i++){var day={name:date.format("dd"),number:date.date(),isCurrentMonth:$scope.isSameMonth(date,$scope.innerDate.date),isToday:date.isSame(new Date,"day"),isWeekday:6==date.weekday()||0==date.weekday(),value:date.format("D.M.YYYY"),date:date};$scope.minDate&&(day.isDisabled=date.isBefore($scope.minDate)),$scope.maxDate&&(day.isDisabled=date.isAfter($scope.maxDate)),$scope.minDate&&$scope.maxDate&&(day.isDisabled=!date.isBetween($scope.minDate,$scope.maxDate)),days.push(day),(date=date.clone()).add(1,"d")}return days},$scope.$watchGroup(["model","minDate","maxDate","nextDate"],function(value){$scope.boostrap()}),$scope.getTime=function(){$scope.time?($scope.innerDate.hour=moment($scope.model).hours(),$scope.innerDate.minute=moment($scope.model).minutes()):($scope.innerDate.hour=0,$scope.innerDate.minute=0),$scope.innerDate.value=$scope.formatDate($scope.innerDate.date)},$scope.boostrap=function(){$scope.setInnerDate(moment($scope.model)),$scope.getTime(),$scope.time||($scope.model=$scope._removeTime($scope.model)),$scope.innerDate.value=$scope.formatDate(moment($scope.model)),$scope._buildMonth()},$scope.boostrap(),$scope.toggleOpen=function(){$scope.isDisabled||($scope.isOpen=!$scope.isOpen,$scope.popper.update())}}}}),angular.module("niceElements").directive("niceDatetimePicker",function(){return{restrict:"E",transclude:!1,templateUrl:"src/components/nice-datetime-picker/nice-datetime-picker.html",scope:{model:"=",format:"@",date:"@",time:"@",width:"@",enableOkButtons:"@",lang:"@",minDate:"@",maxDate:"@",weekStart:"@",okText:"@",cancelText:"@",shortTime:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},controller:function($scope,gettextCatalog){$scope.date="true"==$scope.date||1==$scope.date,$scope.time="true"==$scope.time||1==$scope.time,"true"===$scope.noMargin||$scope.noMargin,"true"===$scope.enableOkButtons||$scope.enableOkButtons,$scope.lang=$scope.lang||"en",$scope.okText=$scope.okText||gettextCatalog.getString("OK",null,"Nice"),$scope.cancelText=$scope.cancelText||gettextCatalog.getString("Cancel",null,"Nice"),$scope.weekStart=parseInt($scope.weekStart)||1,$scope.width=parseInt($scope.width)||300,$scope.isOpen=!1,$scope.internalDate=moment($scope.model)||moment(),$scope.format||($scope.date&&!$scope.time?$scope.format="D.M.YYYY":!$scope.date&&$scope.time?$scope.format="HH:mm":$scope.format="D.M.YYYY • H:mm"),$scope.openDtp=function(){$scope.isDisabled||($scope.isOpen=!0,$scope.$broadcast("dtp-open-click"))},$scope.closeDtp=function(response){$scope.isOpen=!1,$scope.$broadcast("dtp-close-click")},$scope.$on("dateSelected",function(){$scope.formDatetimePicker.$setDirty()}),$scope.$watch("internalDate",function(newDate){$scope.model=moment(newDate),$scope.value=moment(newDate).format($scope.format),$scope.onChange&&$scope.onChange({model:$scope.model})}),$scope.$watch("model",function(newModel,oldModel){$scope.value=moment(newModel).format($scope.format)})}}}),angular.module("niceElements").directive("niceDatetimerangePicker2",function(){return{scope:{startDate:"=",endDate:"=",formatString:"@",modelFormat:"@",time:"@",minDate:"@",maxDate:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},templateUrl:"src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html",controller:function($element,$scope){$scope.isOpen=!1,$scope.time?$scope.time="true"==$scope.time:$scope.time=!1,$scope.formatString||($scope.time?$scope.formatString="D.M.YYYY • H:mm":$scope.formatString="D.M.YYYY"),$scope.startDate?$scope.innerStartDate=angular.copy($scope.startDate):$scope.startDate=moment(),$scope.endDate?$scope.innerEndDate=angular.copy($scope.endDate):$scope.endDate=moment(),$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("nice-daterange-picker-button")[0],tooltip=$element[0].getElementsByClassName("nice-daterange-picker-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,5]}}]})},$scope.setupPopper(),$scope.format=function(){$scope.modelFormat=$scope.startDate.format($scope.formatString)+" - "+$scope.endDate.format($scope.formatString)},$scope.open=function(){$scope.isDisabled||($scope.isOpen=!0,$scope.popper.update())},$scope.close=function(){$scope.innerStartDate=angular.copy($scope.startDate),$scope.innerEndDate=angular.copy($scope.endDate),$scope.isOpen=!1},$scope.confirm=function(){$scope.startDate=angular.copy($scope.innerStartDate),$scope.endDate=angular.copy($scope.innerEndDate),$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.close()},$scope.selectToday=function(){$scope.innerStartDate=moment().startOf("day"),$scope.innerEndDate=moment().endOf("day")},$scope.selectLastNDays=function(days){$scope.innerStartDate=moment().subtract(days,"days").startOf("day"),$scope.innerEndDate=moment().endOf("day")},$scope.selectLastMonth=function(){$scope.innerStartDate=moment().subtract(1,"months").startOf("month").startOf("date"),$scope.innerEndDate=moment().subtract(1,"months").endOf("month").endOf("date")},$scope.selectThisMonth=function(){$scope.innerStartDate=moment().startOf("month").startOf("date"),$scope.innerEndDate=moment().endOf("month").endOf("date")},$scope._removeTime=function(date){return date.hour(0).minute(0).second(0).millisecond(0)},$scope.$watchGroup(["innerStartDate","innerEndDate"],function(newValues){var temp;newValues[0]&&newValues[1]&&($scope.innerStartDate.isAfter($scope.innerEndDate)&&(temp=angular.copy($scope.innerStartDate),$scope.innerStartDate=angular.copy($scope.innerEndDate),$scope.innerEndDate=temp),$scope.innerEndDate.isBefore($scope.innerStartDate)&&(temp=angular.copy($scope.innerStartDate),$scope.innerStartDate=angular.copy($scope.innerEndDate),$scope.innerEndDate=temp))}),$scope.$watchGroup(["startDate","endDate"],function(){$scope.innerStartDate=angular.copy($scope.startDate),$scope.innerEndDate=angular.copy($scope.endDate),$scope.format()})}}}),angular.module("niceElements").directive("niceDatetimerangePicker",function(gettextCatalog){return{scope:{modelStart:"=",modelEnd:"=",format:"@",modelFormat:"@",date:"@",time:"@",width:"@",enableOkButtons:"@",lang:"@",minDate:"@",maxDate:"@",weekStart:"@",okText:"@",cancelText:"@",shortTime:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",formatOutput:"@",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},templateUrl:"src/components/nice-datetimerange-picker/nice-datetimerange-picker.html",link:{pre:function($scope){var params={title:"",noMargin:!1,fieldWidth:"col-sm-8",labelWidth:"col-sm-4",format:"D.M.YYYY • H:mm",modelFormat:"YYYY-MM-DDTHH:mm:ss.SSS",minDate:null,maxDate:null,lang:"en",weekStart:1,shortTime:!1,cancelText:gettextCatalog.getString("Cancel",null,"Nice"),okText:gettextCatalog.getString("OK",null,"Nice"),date:!0,time:!1,width:300,enableOkButtons:!1};void 0===$scope.formatOutput&&($scope.formatOutput=!1);function setLabelValue(){var _from=moment($scope.internalStart).format(params.format),_to=moment($scope.internalEnd).format(params.format);$scope.value=_from+" - "+_to}function initCurrentDates(){var _end,_time,i_hour,i_min,hours,minutes;void 0===$scope.modelStart||null===$scope.modelStart?(_end=moment().subtract(1,"days"),$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelStart=_end):!params.date&¶ms.time?(_time=moment(),i_hour=params.modelFormat.indexOf("HH:mm"),i_min=params.modelFormat.indexOf("mm"),hours=$scope.model.substring(i_hour,i_hour+2),minutes=$scope.model.substring(i_min,i_min+2),-1<i_hour&&-1<i_min?(_time.hours(hours),_time.minutes(minutes)):console.error("Cannot parse current time model with passed modelFilter. Please check if you missed modelFilter setting in directive.. Falling back to current time instead."),$scope.dateStart=_time):$scope.dateStart=moment($scope.modelStart),void 0===$scope.modelEnd||null===$scope.modelEnd?(_end=moment(),$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelEnd=_end):!params.date&¶ms.time?(_time=moment(),i_hour=params.modelFormat.indexOf("HH:mm"),i_min=params.modelFormat.indexOf("mm"),hours=$scope.model.substring(i_hour,i_hour+2),minutes=$scope.model.substring(i_min,i_min+2),-1<i_hour&&-1<i_min?(_time.hours(hours),_time.minutes(minutes)):console.error("Cannot parse current time model with passed modelFilter. Please check if you missed modelFilter setting in directive.. Falling back to current time instead."),$scope.dateEnd=_time):$scope.dateEnd=moment($scope.modelEnd),$scope.dateStart>$scope.dateEnd&&($scope.dateEnd=moment($scope.dateStart))}params.date="true"===$scope.date,params.time="true"===$scope.time,$scope.format&&""!=$scope.format&&(params.format=$scope.format),$scope.enableOkButtons&&(params.enableOkButtons="true"===$scope.enableOkButtons),$scope.lang&&(params.lang=$scope.lang),$scope.minDate&&(params.minDate=$scope.minDate),$scope.maxDate&&(params.maxDate=$scope.maxDate),$scope.weekStart&&(params.weekStart=parseInt($scope.weekStart)),$scope.okText&&(params.okText=$scope.okText),$scope.cancelText&&(params.cancelText=$scope.cancelText),$scope.noMargin&&(params.noMargin="true"===$scope.noMargin),$scope.modelFormat&&(params.modelFormat=$scope.modelFormat),$scope.date=params.date,$scope.time=params.time,($scope=angular.extend($scope,params)).openDtpRange=function(){$scope.isDisabled||(initCurrentDates(),$scope.showDtpRange=!0)},$scope.okClick=function(){setLabelValue();var _end=moment($scope.internalStart,params.modelFormat);$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelStart=_end;_end=moment($scope.internalEnd,params.modelFormat);$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelEnd=_end,$scope.showDtpRange=!1,$scope.onChange&&$scope.onChange({modelStart:$scope.modelStart,modelEnd:$scope.modelEnd})},$scope.cancelClick=function(){$scope.showDtpRange=!1;var _start=moment($scope.modelStart);$scope.formatOutput&&(_start=_start.format(params.modelFormat));var _end=moment($scope.modelEnd);$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.internalStart=_start,$scope.internalEnd=_end,setLabelValue()},$scope.selectLastNDays=function(days){$scope.dateStart=moment().subtract(days,"days"),$scope.dateEnd=moment(),$scope.internalStart=$scope.dateStart,$scope.internalEnd=$scope.dateEnd,setLabelValue()},$scope.selectLastMonth=function(){$scope.dateStart=moment().subtract(1,"months"),$scope.dateEnd=moment(),$scope.internalStart=$scope.dateStart,$scope.internalEnd=$scope.dateEnd,setLabelValue()},$scope.selectThisMonth=function(){$scope.dateStart=moment().date(1).hours(0).minutes(0).seconds(0).milliseconds(0),$scope.dateEnd=moment().endOf("month"),$scope.internalStart=$scope.dateStart,$scope.internalEnd=$scope.dateEnd,setLabelValue()},$scope.$watchGroup(["dateStart","dateEnd"],function(newValues){$scope.internalStart=moment(newValues[0]),$scope.internalEnd=moment(newValues[1]),setLabelValue()}),$scope.$watchGroup(["modelStart","modelEnd"],function(){initCurrentDates()})}}}}),angular.module("niceElements").directive("niceDropdownDate",function(gettextCatalog){return{restrict:"E",replace:!0,templateUrl:"src/components/nice-dropdown-date/nice-dropdown-date.html",scope:{model:"=",title:"@",fieldWidth:"@",labelWidth:"@",noMargin:"@",isDisabled:"=",numYears:"@",startingYear:"@",mature:"@",help:"@",isInline:"=",onChange:"&?"},link:function($scope){$scope.days=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],$scope.months=[{value:0,name:gettextCatalog.getString("Jan",null,"Nice")},{value:1,name:gettextCatalog.getString("Feb",null,"Nice")},{value:2,name:gettextCatalog.getString("Mar",null,"Nice")},{value:3,name:gettextCatalog.getString("Apr",null,"Nice")},{value:4,name:gettextCatalog.getString("May",null,"Nice")},{value:5,name:gettextCatalog.getString("Jun",null,"Nice")},{value:6,name:gettextCatalog.getString("Jul",null,"Nice")},{value:7,name:gettextCatalog.getString("Aug",null,"Nice")},{value:8,name:gettextCatalog.getString("Sep",null,"Nice")},{value:9,name:gettextCatalog.getString("Oct",null,"Nice")},{value:10,name:gettextCatalog.getString("Nov",null,"Nice")},{value:11,name:gettextCatalog.getString("Dec",null,"Nice")}];var currentYear=parseInt($scope.startingYear,10)||(new Date).getFullYear(),oldestYear=currentYear-(parseInt($scope.numYears,10)||100),newestYear=currentYear;$scope.mature&&(newestYear-=17),$scope.years=[];for(var date,i=currentYear;oldestYear<=i;i--)i<=newestYear&&$scope.years.push(i);$scope.dateFields={},$scope.$watch("model",function(date,oldDate){date&&date!=oldDate&&(date=moment(date),$scope.dateFields.day=date.get("date"),$scope.dateFields.month=date.get("month"),$scope.dateFields.year=date.get("year"),$scope.checkDate())}),$scope.checkDate=function(){var date=moment($scope.dateFields.day+"."+($scope.dateFields.month+1)+"."+$scope.dateFields.year,"D.M.YYYY");if(date.isValid()){for($scope.model=date.format(),$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.days=[],i=1;i<=date.daysInMonth();i++)$scope.days.push(i);$scope.dropdownDateForm.$setValidity("validDate",!0),$scope.dropdownDateForm.$setDirty()}else $scope.dropdownDateForm.$setValidity("validDate",!1)},$scope.model?(date=moment($scope.model),$scope.dateFields.day=date.get("date"),$scope.dateFields.month=date.get("month"),$scope.dateFields.year=date.get("year")):(date=moment(),$scope.dateFields.day=date.get("date"),$scope.dateFields.month=date.get("month"),$scope.dateFields.year=date.get("year"),$scope.mature&&($scope.dateFields.year-=18)),$scope.checkDate()}}}),angular.module("niceElements").directive("niceDropdownOld",function(){return{templateUrl:"src/components/nice-dropdown-old/nice-dropdown-old.html",restrict:"E",transclude:!0,scope:{title:"@",model:"=",list:"=",isDisabled:"=",fieldWidth:"@",labelWidth:"@",addButtonEnable:"=",addButtonFunction:"&",objValue:"@",objKey:"@?",selectedIsObj:"@",nullable:"@",required:"@",showTax:"@",noMargin:"@",multiple:"@",help:"@",listenKeydown:"@",noOptionsText:"@",isInline:"=",onChange:"&?"},controller:function($scope,$element,gettextCatalog){$scope.objValue||($scope.objValue="value"),$scope.objKey||($scope.objKey="id"),$scope.list||($scope.list=[]),$scope.noOptionsText||($scope.noOptionsText=gettextCatalog.getString("No options",null,"Nice")),$scope.addButtonFunction||($scope.addButtonFunction=null),$scope.listenKeydown||($scope.listenKeydown=!1),$scope.valid=$scope.formDropdown,$scope.selectedIsObj="true"===$scope.selectedIsObj||!0===$scope.selectedIsObj,$scope.nullable="true"===$scope.nullable||!0===$scope.nullable,$scope.required="true"===$scope.required||!0===$scope.required,$scope.showTax="true"===$scope.showTax||!0===$scope.showTax,$scope.noMargin="true"===$scope.noMargin||!0===$scope.noMargin,$scope.multiple="true"===$scope.multiple||!0===$scope.multiple,$scope.internalSelected=null,$scope.id=Math.random().toString(36).substring(7),$scope.isOpen=!1,$scope.toggle=function(){$scope.isOpen=!$scope.isOpen},$scope.close=function(){$scope.isOpen=!1},$scope.open=function(){$scope.isOpen=!0};function getFilter(item){var filter={};return item.hasOwnProperty($scope.objKey)?filter[$scope.objKey]=item[$scope.objKey]:filter[$scope.objKey]=item,filter}function _get_selected_object(selected){return selected?$scope.selectedIsObj?selected:_.find($scope.internalList,getFilter(selected)):null}function _set_internal_selected_one(selected){var obj={},selectedObj=_get_selected_object(selected),obj=selectedObj&&_.find($scope.internalList,getFilter(selected))?selectedObj:$scope.internalList[0];$scope.internalSelected=obj,_set_model(obj)}function _get_selected_objects(selected){return selected?$scope.selectedIsObj?selected:_.map(selected,function(val){return _.find($scope.internalList,getFilter(val))}):null}function _set_internal_selected_multiple(_selected_objects){_selected_objects=_get_selected_objects(_selected_objects),$scope.internalSelected=_selected_objects||[],_set_model($scope.internalSelected)}function init(){var sel;$scope.internalList=angular.copy($scope.list),$scope.nullable&&!$scope.multiple&&((sel={})[$scope.objKey]=null,sel[$scope.objValue]="-",$scope.internalList=[sel].concat($scope.internalList)),$scope.multiple&&$scope.model&&($scope.internalSelected?_set_internal_selected_multiple(_.filter($scope.internalSelected,function(obj){return _.find($scope.internalList,getFilter(obj))})):$scope.internalSelected=[]),$scope.internalList&&0<$scope.internalList.length?($scope.emptyList=!1,($scope.multiple?_set_internal_selected_multiple:_set_internal_selected_one)($scope.model),$scope.formDropdown&&$scope.required&&$scope.formDropdown.$setValidity("required",!0)):($scope.emptyList=!0,(sel={})[$scope.objKey]=null,sel[$scope.objValue]=$scope.noOptionsText,$scope.internalList=[sel],$scope.formDropdown&&$scope.required&&$scope.formDropdown.$setValidity("required",!1),$scope.multiple?_set_internal_selected_multiple(sel):_set_internal_selected_one([sel]))}var _set_model=function(value){var _new=angular.copy($scope.model),_new=$scope.multiple?$scope.selectedIsObj?value:_.map(value,function(val){return val[$scope.objKey]}):null==value[$scope.objKey]?null:$scope.selectedIsObj?value:value[$scope.objKey];_.isEqual(_new,$scope.model)||($scope.model=_new,$scope.onChange&&$scope.onChange({model:$scope.model}))};$scope.isItemSelected=function(item){return!!$scope.internalSelected&&($scope.multiple?0<_.where($scope.internalSelected,{id:item.id}).length:$scope.internalSelected[$scope.objKey]==item[$scope.objKey])},$scope.clicked=function(item){var _current;$scope.formDropdown.$setDirty(),$scope.multiple?(_current=angular.copy($scope.internalSelected),_.find(_current,getFilter(item))?_current=_.reject(_current,getFilter(item[$scope.objKey])):_current.push(item),_set_internal_selected_multiple(_current)):(_set_internal_selected_one(item),$scope.close())},$scope.getLabel=function(item){return item?item[$scope.objValue]:"-"},$scope.$watch("list",function(value_new,value_old){init()}),$scope.$watch("model",function(_new_model_object,value_old){_new_model_object=($scope.multiple?_get_selected_object:_get_selected_objects)(_new_model_object),_.isEqual(_new_model_object,$scope.internalSelected)||init()}),$scope.bindKeypress=function(){$scope.listenKeydown&&$element.bind("keyup",function(e){var char;$scope.isOpen&&(char=String.fromCharCode(e.which).toLowerCase(),_.findIndex($scope.internalList,function(item){return 0===item[$scope.objValue].toLowerCase().indexOf(char)}))})},$scope.unbindKeypress=function(){$element.off("keyup",function(e){})}}}}),angular.module("niceElements").directive("niceDropdown",function($window){return{templateUrl:"src/components/nice-dropdown/nice-dropdown.html",restrict:"E",transclude:{button:"?niceDropdownButton",option:"?niceDropdownOption"},scope:{title:"@",model:"=",list:"=",onChange:"&?",isDisabled:"=",fieldWidth:"@",labelWidth:"@",loading:"=?",addButtonFunction:"=?",objValue:"@",objKey:"@?",selectedIsKey:"@?",nullable:"@",required:"@",noMargin:"@",multiple:"@",help:"@",noOptionsText:"@",noDataText:"@",selectText:"@",searchText:"@",nullableText:"@",selectedText:"@",searchFunction:"=?",isInline:"=",clearOnSelect:"@"},controller:function($scope,$element,$timeout,gettextCatalog){$scope.objValue||($scope.objValue="value"),$scope.objKey||($scope.objKey="id"),$scope.noOptionsText||($scope.noOptionsText=gettextCatalog.getString("No options",null,"Nice")),$scope.noDataText||($scope.noDataText=gettextCatalog.getString("No options",null,"Nice")),$scope.searchText||($scope.searchText=gettextCatalog.getString("Search...",null,"Nice")),$scope.nullableText||($scope.nullableText=gettextCatalog.getString("None",null,"Nice")),$scope.selectText||($scope.selectText=gettextCatalog.getString("None",null,"Nice")),$scope.selectedText||($scope.selectedText=gettextCatalog.getString("selected",null,"Nice")),$scope.addButtonFunction||($scope.addButtonFunction=null),$scope.nullable="true"===$scope.nullable||!0===$scope.nullable,$scope.required="true"===$scope.required||!0===$scope.required,$scope.noMargin="true"===$scope.noMargin||!0===$scope.noMargin,$scope.multiple="true"===$scope.multiple||!0===$scope.multiple,$scope.clearOnSelect="true"===$scope.clearOnSelect||!0===$scope.clearOnSelect,$scope.valid=$scope.formDropdown,$scope.isOpen=!1,$scope.selected=null,$scope.selectedIndex=0,$scope.popper=null,$scope.internal={search:""},$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("btn-dropdown")[0],tooltip=$element[0].getElementsByClassName("nice-dropdown-menu-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",scroll:!0,resize:!0,modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state})=>{state.styles.popper.width=`${state.rects.reference.width}px`},effect:({state})=>{state.elements.popper.style.width=`${state.elements.reference.offsetWidth}px`}}]})},$scope.setupPopper(),$scope.toggle=function(){$scope.isOpen?$scope.close():$scope.open()},$scope.close=function(){$scope.isOpen=!1},$scope.open=function(){$scope.isOpen=!0,$timeout(function(){$scope.popper.update(),$scope.focusInput(),$scope.scrollToHover(!0)},100)},$scope.focusInput=function(){var input=$element[0].getElementsByTagName("input")[0];input&&$timeout(function(){input.focus()})},$scope.scrollToHover=function(notSmooth){var dorpdownList,topPos=$element[0].getElementsByClassName("nice-dropdown-menu")[0];!topPos||(topPos=(dorpdownList=topPos.getElementsByClassName("nice-dropdown-items")[0]).getElementsByClassName("hover")[0])&&(topPos=topPos.offsetTop,dorpdownList.scroll({top:topPos-120,left:0,behavior:notSmooth?"auto":"smooth"}))},$scope.handleSearch=function(){$scope.loading=!0,$scope.searchFunction($scope.internal.search).then(function(response){$scope.internalList=response,$scope.loading=!1,$scope.handleDefault()},function(error){$scope.internalList=null,$scope.loading=!1})},$scope.handleSelected=function(item,index){$scope.formDropdown.$setDirty(),null!=item?$scope.multiple?$scope.handleMultipleSelect(item,index):$scope.handleSingleSelect(item,index):$scope.handleSingleSelect(void 0,-1)},$scope.handleMultipleSelect=function(item,index){$scope.selected||($scope.selected=[]),item._selected?$scope.selected=$scope.selected.filter(function(s){return s[$scope.objKey]!=item[$scope.objKey]}):$scope.selected.push(item),$scope.handleSetModel()},$scope.handleSingleSelect=function(item,index){$scope.selected=item,$scope.close(),$scope.handleSetModel()},$scope.handleSetModel=function(){var obj=angular.copy($scope.selected);null!=$scope.selected&&($scope.multiple?angular.forEach(obj,function(o){o._selected=void 0}):obj._selected=void 0,$scope.selectedIsKey&&($scope.multiple?angular.forEach(obj,function(o){o=o[$scope.objKey]}):obj=obj[$scope.objKey])),$scope.clearOnSelect?$scope.model=null:$scope.model=obj,$timeout(function(){$scope.onChange&&$scope.onChange({model:obj})})},$scope.handleDefault=function(){$scope.model&&$scope.handleModelChange(),!$scope.nullable&&!$scope.model&&!$scope.clearOnSelect&&$scope.internalList&&0<$scope.internalList.length&&$scope.handleSelected($scope.internalList[0],0)},$scope.$watchCollection("list",function(value_new,value_old){$scope.internalList=angular.copy($scope.list),$scope.handleDefault()}),$scope.$watch("model",function(value_new,value_old){$scope.handleModelChange()}),$scope.handleModelChange=function(){$scope.selected=angular.copy($scope.model),angular.forEach($scope.internalList,function(i,index){i._selected=!1,$scope.selectedIsKey?$scope.multiple?angular.forEach($scope.selected,function(s){i[$scope.objKey]==s&&(i._selected=!0,$scope.selectedIndex=index)}):null!=$scope.selected&&i[$scope.objKey]==$scope.selected&&(i._selected=!0,$scope.selected=i,$scope.selectedIndex=index,$scope.scrollToHover()):$scope.multiple?angular.forEach($scope.selected,function(s){i[$scope.objKey]==s[$scope.objKey]&&(i._selected=!0,$scope.selectedIndex=index)}):null!=$scope.selected&&i[$scope.objKey]==$scope.selected[$scope.objKey]&&(i._selected=!0,$scope.selected=i,$scope.selectedIndex=index,$scope.scrollToHover())})},$element.bind("keydown keypress",function(event){38==event.keyCode&&(event.preventDefault(),$timeout(function(){0<$scope.selectedIndex&&(--$scope.selectedIndex,$timeout(function(){$scope.scrollToHover()}))})),40==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.internalList&&$scope.selectedIndex<$scope.internalList.length-1&&($scope.selectedIndex+=1,$timeout(function(){$scope.scrollToHover()}))})),13==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.handleSelected($scope.internalList[$scope.selectedIndex],$scope.selectedIndex)})),27==event.keyCode&&$timeout(function(){$scope.close()})}),$scope.handleDefault(),$scope.searchFunction&&$scope.handleSearch()}}}),angular.module("niceElements").directive("niceDtp",function($window,$parse,$document){return{scope:{onChange:"&?",model:"=",format:"@",modelFormat:"@",date:"@",time:"@",width:"@",enableOkButtons:"@",lang:"@",minDate:"@",maxDate:"@",weekStart:"@",okText:"@",cancelText:"@",shortTime:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",closed:"="},templateUrl:"src/components/nice-dtp/nice-dtp.html",controller:function($scope,$element,$attrs,gettextCatalog){var params={title:"",noMargin:!1,fieldWidth:"col-sm-8",labelWidth:"col-sm-4",format:"D.M.YYYY • H:mm",modelFormat:"YYYY-MM-DDTHH:mm:ss.SSS",minDate:null,maxDate:null,lang:"en",weekStart:1,shortTime:!1,cancelText:gettextCatalog.getString("Cancel",null,"Nice"),okText:gettextCatalog.getString("OK",null,"Nice"),date:!0,time:!1,width:300,enableOkButtons:!1};$scope.date="true"===$attrs.date||!0===$attrs.date,$scope.time="true"===$attrs.time||!0===$attrs.time;var that={init:function(){$scope.showDtp=!1,that.initDays(),that.initDates()},initDays:function(){$scope.days=[];for(var i=params.weekStart;$scope.days.length<7;i++)$scope.days.push((i=6<i?0:i).toString())},fixMinMaxDate:function(){""===$scope.minDate&&($scope.minDate=null),""===$scope.maxDate&&($scope.maxDate=null)},initDates:function(){that.fixMinMaxDate(),void 0===$scope.model||null===$scope.model?$scope.currentDate=moment():$scope.currentDate=moment($scope.model).locale(params.lang),that.setDateModel(),that.setElementValue(),void 0!==$scope.minDate&&null!==$scope.minDate&&"string"==typeof $scope.minDate&&($scope.minDate=moment($scope.minDate).locale(params.lang)),void 0!==$scope.maxDate&&null!==$scope.maxDate&&"string"==typeof $scope.maxDate&&($scope.maxDate=moment($scope.maxDate).locale(params.lang)),!0===params.date&&(that.isAfterMinDate($scope.currentDate)||($scope.currentDate=moment($scope.minDate)),that.isBeforeMaxDate($scope.currentDate)||($scope.currentDate=moment($scope.maxDate)))},initDate:function(){that.fixMinMaxDate(),$scope.currentView=0,$scope.showCalendar=!0,$scope.showTime=!1;var _date=void 0!==$scope.currentDate&&null!==$scope.currentDate?$scope.currentDate:null;$scope.calendar=that.generateCalendar($scope.currentDate),void 0!==$scope.calendar.week&&void 0!==$scope.calendar.days&&(that.constructHTMLCalendar(_date,$scope.calendar),that.toggleButtons(_date)),that._centerBox(),that.showDate(_date)},initHours:function(){that.fixMinMaxDate(),$scope.currentView=1,$scope.hours=[],$scope.minutes=[],$scope.showTime=!0,$scope.showCalendar=!1,that.showTime($scope.currentDate);for(var r=100,j=r/1.55,j_pm=r/1.15,_hours=[],h=0;h<12;++h){var cH=24==$scope.currentDate.format("HH")?0:$scope.currentDate.format("HH"),_hour={style:{x:x=j*Math.sin(2*Math.PI*(h/12)),y:y=j*Math.cos(2*Math.PI*(h/12)),marginLeft:r+x+parseInt(10)/2-(parseInt(10)+parseInt(20))+"px",marginTop:r-y-parseInt(10)/2-(parseInt(10)+parseInt(10))+"px"},h:0==h?12:h,selected:h==parseInt(cH)};_hours.push(_hour)}for(h=0;h<12;++h){var x,y,cH=24==$scope.currentDate.format("HH")?0:$scope.currentDate.format("HH"),_hour={style:{x:x=j_pm*Math.sin(2*Math.PI*(h/12)),y:y=j_pm*Math.cos(2*Math.PI*(h/12)),marginLeft:r+x+parseInt(10)/2-(parseInt(10)+parseInt(20))+"px",marginTop:r-y-parseInt(10)/2-(parseInt(10)+parseInt(10))+"px"},h:0==h?0:h+12,selected:h+12==parseInt(cH)};_hours.push(_hour)}$scope.hours=_hours,that.toggleTime(!0),that.initHands(!0)},initMinutes:function(){that.fixMinMaxDate(),$scope.currentView=2,$scope.hours=[],$scope.minutes=[],$scope.showCalendar=!1,$scope.showTime=!0,that.showTime($scope.currentDate);for(var j=100/1.2,_minutes=[],m=0;m<60;m+=5){var x=j*Math.sin(2*Math.PI*(m/60)),_minute=j*Math.cos(2*Math.PI*(m/60)),_minute={style:{x:x,y:_minute,marginLeft:100+x+parseInt(10)/2-(parseInt(10)+parseInt(20))+"px",marginTop:100-_minute-parseInt(10)/2-(parseInt(10)+parseInt(10))+"px"},m:2==m.toString().length?m:"0"+m,selected:m==5*Math.round($scope.currentDate.minute()/5)};_minutes.push(_minute)}$scope.minutes=_minutes,that.toggleTime(!1),that.initHands(!1),that._centerBox()},initHands:function(t){var r=100,_hL=r/1.7,_mL=r/1.5,dtpClockCenter=$element[0].getElementsByClassName("dtp-hour-hand")[0];dtpClockCenter.style.left=r+1.5*parseInt(20)+"px",dtpClockCenter.style.height=_hL+"px",dtpClockCenter.style.marginTop=r-_hL-parseInt(10)+"px",t&&dtpClockCenter.classList.add("on");dtpClockCenter=$element[0].getElementsByClassName("dtp-minute-hand")[0];dtpClockCenter.style.left=r+1.5*parseInt(20)+"px",dtpClockCenter.style.height=_mL+"px",dtpClockCenter.style.marginTop=r-_mL-parseInt(10)+"px",t&&dtpClockCenter.classList.add("on");dtpClockCenter=$element[0].getElementsByClassName("dtp-clock-center")[0];dtpClockCenter.style.left=r+parseInt(10)+parseInt(20)-7.5+"px",dtpClockCenter.style.marginTop=r-parseInt(20)/2-7.5+"px",that.animateHands(),that._centerBox()},animateHands:function(){var h=$scope.currentDate.hour(),m=$scope.currentDate.minute(),dtpHourHand=$element[0].getElementsByClassName("dtp-hour-hand")[0],dtpMinuteHand=$element[0].getElementsByClassName("dtp-minute-hand")[0];that.rotateElement(dtpHourHand,30*h),that.rotateElement(dtpMinuteHand,5*Math.round(m/5)*6)},isAfterMinDate:function(_date,checkHour,checkMinute){var _minDate,_return=!0;return void 0!==$scope.minDate&&null!==$scope.minDate&&(_minDate=moment($scope.minDate),_date=moment(_date),checkHour||checkMinute||(_minDate.hour(0),_minDate.minute(0),_date.hour(0),_date.minute(0)),_minDate.second(0),_date.second(0),_minDate.millisecond(0),_date.millisecond(0),_return=(checkMinute||(_date.minute(0),_minDate.minute(0)),parseInt(_date.format("X"))>=parseInt(_minDate.format("X")))),_return},isBeforeMaxDate:function(_date,checkTime,checkMinute){var _maxDate,_return=!0;return void 0!==$scope.maxDate&&null!==$scope.maxDate&&(_maxDate=moment($scope.maxDate),_date=moment(_date),checkTime||checkMinute||(_maxDate.hour(0),_maxDate.minute(0),_date.hour(0),_date.minute(0)),_maxDate.second(0),_date.second(0),_maxDate.millisecond(0),_date.millisecond(0),_return=(checkMinute||(_date.minute(0),_maxDate.minute(0)),parseInt(_date.format("X"))<=parseInt(_maxDate.format("X")))),_return},rotateElement:function(el,deg){el.style.transform="rotate("+deg+"deg)"},showDate:function(date){$scope.showTimeHeader=!0,date&&($scope.showDateHeader=!0,$scope.actualDay=date.locale(params.lang).format("dddd"),$scope.actualMonth=date.locale(params.lang).format("MMM").toUpperCase(),$scope.actualNum=date.locale(params.lang).format("DD"),$scope.actualYear=date.locale(params.lang).format("YYYY"))},showTime:function(date){var _time;date&&(_time=5*Math.round(date.minute()/5),_time={hours:date.format("HH"),minutes:2==_time.toString().length?_time:"0"+_time},params.date?$scope.showTimeHeader=!0:(params.shortTime?$scope.actualDay=date.format("A"):$scope.actualDay=" ",$scope.showTimeHeader=!1),$scope.actualTime=_time)},selectDate:function(date){date&&($scope.currentDate=date,that.showDate($scope.currentDate),$scope.$emit("dateSelected",{date:date}))},generateCalendar:function(date){var _calendar={};if(null!==date){var startOfMonth=moment(date).locale(params.lang).startOf("month"),endOfMonth=moment(date).locale(params.lang).endOf("month"),iNumDay=startOfMonth.format("d");_calendar.week=$scope.days,_calendar.days=[];for(var i=startOfMonth.date();i<=endOfMonth.date();i++){if(i===startOfMonth.date()){var iWeek=_calendar.week.indexOf(iNumDay.toString());if(0<iWeek)for(var x=0;x<iWeek;x++)_calendar.days.push(0)}_calendar.days.push(moment(startOfMonth).locale(params.lang).date(i))}}return _calendar},constructHTMLCalendar:function(date,calendar){$scope.monthAndYear=date.locale(params.lang).format("MMMM YYYY");for(var _weekDays=[],i=0;i<calendar.week.length;i++)_weekDays.push(moment(parseInt(calendar.week[i]),"d").locale(params.lang).format("dd").substring(0,1));$scope.weekDays=_weekDays;for(var _weeks=[],_week=[],i=0;i<calendar.days.length;i++){i%7==0&&(0!=i&&_weeks.push(_week),_week=[]);var _day={label:null,selected:!1,disabled:!0,data:{}};0!=calendar.days[i]&&(_day.disabled=!1,_day.label=moment(calendar.days[i]).locale(params.lang).format("DD"),_day.data=calendar.days[i],!1===that.isBeforeMaxDate(moment(calendar.days[i]),!1,!1)||!1===that.isAfterMinDate(moment(calendar.days[i]),!1,!1)?_day.disabled=!0:moment(calendar.days[i]).locale(params.lang).format("DD")===moment($scope.currentDate).locale(params.lang).format("DD")&&(_day.selected=!0)),_week.push(_day)}0<_week.length&&_weeks.push(_week),$scope.weeks=_weeks},setName:function(){for(var text="",possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)text+=possible.charAt(Math.floor(Math.random()*possible.length));return text},isPM:function(){return $scope.isPM},setElementValue:function(date){$scope.value=moment($scope.currentDate).locale(params.lang).format(params.format)},setDateModel:function(){$scope.model=angular.copy($scope.currentDate),$scope.onChange&&$scope.onChange({model:$scope.model})},toggleButtons:function(endOfYear){var startOfMonth,startOfYear;endOfYear&&endOfYear.isValid()&&(startOfMonth=moment(endOfYear).locale(params.lang).startOf("month"),startOfYear=moment(endOfYear).locale(params.lang).endOf("month"),$scope.btnMonthBeforeEnabled=that.isAfterMinDate(startOfMonth,!1,!1),$scope.btnMonthAfterEnabled=that.isBeforeMaxDate(startOfYear,!1,!1),startOfYear=moment(endOfYear).locale(params.lang).startOf("year"),endOfYear=moment(endOfYear).locale(params.lang).endOf("year"),$scope.btnYearBeforeEnabled=that.isAfterMinDate(startOfYear,!1,!1),$scope.btnYearAfterEnabled=that.isBeforeMaxDate(endOfYear,!1,!1))},toggleTime:function(isHours){isHours?angular.forEach($scope.hours,function(hour,hourKey){var _date=moment($scope.currentDate);_date.hour(that.convertHours(hour.h)).minute(0).second(0),!1===that.isAfterMinDate(_date,!0,!1)||!1===that.isBeforeMaxDate(_date,!0,!1)?hour.disabled=!0:hour.disabled=!1}):angular.forEach($scope.minutes,function(minute,minuteKey){var _minute=minute.m,_date=moment($scope.currentDate);_date.minute(_minute).second(0),!1===that.isAfterMinDate(_date,!0,!0)||!1===that.isBeforeMaxDate(_date,!0,!0)?minute.disabled=!0:minute.disabled=!1})},_onClick:function(){$scope.currentView=0,that.initDates(),that.show(),params.date?($scope.showDate=!0,that.initDate()):params.time&&($scope.showTime=!0,that.initHours())},_onBackgroundClick:function(e){e.stopPropagation(),that.hide()},_onElementClick:function(e){e.stopPropagation()},_onCloseClick:function(){that.hide(),$scope.closed&&$scope.closed(!0)},_onOKClick:function(){switch($scope.currentView){case 0:!0===params.time?that.initHours():(that.setElementValue(),that.setDateModel(),$scope.inline||that.hide());break;case 1:that.initMinutes();break;case 2:that.setElementValue(),that.setDateModel(),$scope.inline?that._onClick():that.hide()}},_onCancelClick:function(){if(params.time)switch($scope.currentView){case 0:that.hide();break;case 1:params.date?that.initDate():that.hide();break;case 2:that.initHours()}else that.hide()},_onMonthBeforeClick:function(){$scope.btnMonthBeforeEnabled&&($scope.currentDate.subtract(1,"months"),that.initDate($scope.currentDate))},_onMonthAfterClick:function(){$scope.btnMonthAfterEnabled&&($scope.currentDate.add(1,"months"),that.initDate($scope.currentDate))},_onYearBeforeClick:function(){$scope.btnYearBeforeEnabled&&($scope.currentDate.subtract(1,"years"),that.initDate($scope.currentDate))},_onYearAfterClick:function(){$scope.btnYearAfterEnabled&&($scope.currentDate.add(1,"years"),that.initDate($scope.currentDate))},_onSelectDate:function(date){angular.forEach($scope.weeks,function(week,weekKey){angular.forEach($scope.weeks[weekKey],function(day,dayKey){$scope.weeks[weekKey][dayKey].selected=!1})}),date.selected=!0,that.selectDate(date.data),params.enableOkButtons||that._onOKClick()},_onSelectHour:function(dataHour){dataHour.disabled||(angular.forEach($scope.hours,function(hour,hourKey){$scope.hours[hourKey].selected=!1}),dataHour.selected=!0,dataHour=parseInt(dataHour.h),that.isPM()&&(dataHour+=12),$scope.currentDate.hour(dataHour),that.showTime($scope.currentDate),that.animateHands(),params.enableOkButtons||that._onOKClick())},_onSelectMinute:function(minuteSelected){minuteSelected.disabled||(angular.forEach($scope.minutes,function(minute,minuteKey){$scope.minutes[minuteKey].selected=!1}),minuteSelected.selected=!0,$scope.currentDate.minute(parseInt(minuteSelected.m)),that.showTime($scope.currentDate),that.animateHands(),params.enableOkButtons||that._onOKClick())},convertHours:function(h){var _return=h;return h<12&&that.isPM()&&(_return+=12),_return},setDate:function(date){params.currentDate=date,that.initDates()},setMinDate:function(date){params.minDate=date,that.initDates()},setMaxDate:function(date){params.maxDate=date,that.initDates()},show:function(){$scope.showDtp=!0,that._centerBox()},hide:function(){$scope.showDtp=!1},resetDate:function(){},_centerBox:function(){}};$scope.onClick=that._onClick,$scope.onOKClick=that._onOKClick,$scope.onCancelClick=that._onCancelClick,$scope.onCloseClick=that._onCloseClick,$scope.onSelectDate=that._onSelectDate,$scope.onMonthBeforeClick=that._onMonthBeforeClick,$scope.onMonthAfterClick=that._onMonthAfterClick,$scope.onYearBeforeClick=that._onYearBeforeClick,$scope.onYearAfterClick=that._onYearAfterClick,$scope.onSelectHour=that._onSelectHour,$scope.onSelectMinute=that._onSelectMinute,$scope.initDate=that.initDate,$scope.initHours=that.initHours,$scope.initMinutes=that.initMinutes,params.date="true"===$attrs.date||!0===$attrs.date,params.time="true"===$attrs.time||!0===$attrs.time,params.inline="true"===$attrs.inline||!0===$attrs.inline,$attrs.format&&""!=$attrs.format&&(params.format=$attrs.format),$scope.enableOkButtons&&""!=$attrs.enableOkButtons&&(params.enableOkButtons="true"===$attrs.enableOkButtons),$attrs.lang&&""!=$attrs.lang&&(params.lang=$attrs.lang),$attrs.minDate&&""!=$attrs.minDate&&(params.minDate=$attrs.minDate),$attrs.maxDate&&""!=$attrs.maxDate&&(params.maxDate=$attrs.maxDate),$scope.weekStart&&""!=$attrs.weekStart&&(params.weekStart=parseInt($attrs.weekStart)),$attrs.okText&&""!=$attrs.okText&&(params.okText=$attrs.okText),$attrs.cancelText&&""!=$attrs.cancelText&&(params.cancelText=$attrs.cancelText),$attrs.noMargin&&""!=$attrs.noMargin&&(params.noMargin="true"===$attrs.noMargin),$attrs.modelFormat&&""!=$attrs.modelFormat&&(params.modelFormat=$attrs.modelFormat),$attrs.width&&(params.width=parseInt($attrs.width)),$scope=angular.extend($scope,params),that.init(),$scope.inline&&that._onClick(),$scope.$on("dtp-open-click",function(){that._onClick()}),$scope.$on("dtp-close-click",function(){that.hide()}),$scope.$watch("model",function(newDate){$scope.currentDate=newDate,that.showDate($scope.currentDate),that.initDate()})}}}),angular.module("niceElements").directive("niceHelp",function(){return{templateUrl:"src/components/nice-help/nice-help.html",restrict:"E",scope:{text:"@"}}}),angular.module("niceElements").directive("niceInput",function(){return{templateUrl:"src/components/nice-input/nice-input.html",restrict:"E",transclude:!0,scope:{model:"=",valid:"=",isDisabled:"=",type:"@",title:"@?",regex:"@?",placeholder:"@",min:"@?",max:"@?",minlength:"@?",maxlength:"@?",required:"=",fieldWidth:"@",labelWidth:"@",hideValid:"@",showValid:"@",textArea:"@",textAreaLines:"@",symbol:"@",help:"@",name:"@",noMargin:"@",minDecimalsCutZeros:"@",tabIndex:"@",isFocused:"@",isInline:"=",onChange:"&?"},link:function(scope,input,attrs){attrs.type||(attrs.type="text"),attrs.title||(attrs.title=""),attrs.regex||(attrs.regex=null),attrs.placeholder||(attrs.placeholder=""),attrs.minlength||(attrs.minlength=1),attrs.maxlength||(attrs.maxlength=100),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.textAreaLines||(attrs.textAreaLines=3),attrs.symbol||(attrs.symbol=""),attrs.help||(attrs.help=""),attrs.name||(attrs.name=""),attrs.minDecimalsCutZeros||(attrs.minDecimalsCutZeros=0),attrs.hideValid=angular.isDefined(attrs.hideValid),attrs.showValid=angular.isDefined(attrs.showValid),attrs.textArea=angular.isDefined(attrs.textArea),attrs.noMargin=angular.isDefined(attrs.noMargin),attrs.required="true"===attrs.required,scope.textArea?scope.elementType="textarea":scope.elementType="input",!scope.isFocused||(input=input[0].getElementsByTagName(scope.elementType)[0])&&input.focus(),scope.internalType=attrs.type,"percent"==attrs.type?(scope.internalType="percent",attrs.symbol="%"):"number"==attrs.type?(scope.internalType="number",scope.model?scope.model=Number(scope.model):scope.model=null):"integer"==attrs.type?(scope.internalType="text",scope.model=Number(scope.model)):"email"==attrs.type&&(scope.regexexp=new RegExp("^[_a-zA-Z0-9]+(.[_a-zA-Z0-9]+)*@[a-zA-Z0-9]+(.[a-zA-Z0-9]+)+(.[a-zA-Z]{2,4})")),angular.isDefined(attrs.valid)&&(scope.valid=scope.form),angular.isDefined(attrs.minDecimalsCutZeros)&&"number"==attrs.type&&(scope.model=Number(scope.model),(scope.model.toString().split(".").length<2||scope.model.toString().split(".")[1].length<parseInt(attrs.minDecimalsCutZeros))&&(scope.model=Number(scope.model).toFixed(parseInt(attrs.minDecimalsCutZeros)))),angular.isDefined(scope.regex)&&""!=scope.regex&&(scope.regexexp=new RegExp(scope.regex)),scope.$watch("model",function(value_new,value_old){scope.internalModel=scope.model}),scope.$watch("internalModel",function(value_new,value_old){"number"==attrs.type&&value_new?"number"!=typeof value_new&&(scope.internalModel=value_new.replace(",","."),scope.model=scope.internalModel,scope.onChange&&scope.onChange({model:scope.model})):scope.onChange&&scope.onChange({model:scope.model})})},controller:function($scope){$scope.id=Math.random().toString(36).substring(7),$scope.keypress=function(event){if("number"==$scope.type||"integer"==$scope.type)return 46==event.charCode||44==event.charCode?"number"!=$scope.type||0<=String($scope.model).indexOf(".")?(event.preventDefault(),!1):void 0:45!=event.charCode?48<=event.charCode&&event.charCode<=58||0==event.charCode||(event.preventDefault(),!1):0<=String($scope.model).indexOf("-")?(event.preventDefault(),!1):void 0}}}}),angular.module("niceElements").directive("niceLabel",function(){return{templateUrl:"src/components/nice-label/nice-label.html",restrict:"E",scope:{fieldWidth:"@",labelWidth:"@",value:"@",title:"@",noMargin:"@",isInline:"=",help:"@"},link:function(scope,element,attrs){attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.value||(attrs.labelWidth=""),attrs.title||(attrs.labelWidth="")}}}),angular.module("niceElements").directive("niceLoader",function(){return{templateUrl:"src/components/nice-loader/nice-loader.html",restrict:"E",transclude:!0,scope:{visibleWhen:"=",message:"@",fullscreen:"@",fulldiv:"@",addClass:"@"}}}),angular.module("niceElements").factory("NiceNotification",function($timeout,$http,$compile,$templateCache,$rootScope,$sce){function notify(args,t){(args="object"!=typeof args?{message:args}:args).template=args.template||"src/components/nice-notification/nice-notification.html",args.delay=angular.isUndefined(args.delay)?5e3:args.delay,args.type=t||"",$http.get(args.template,{cache:$templateCache}).success(function(template){var scope=$rootScope.$new();if(scope.message=$sce.trustAsHtml(args.message),scope.title=$sce.trustAsHtml(args.title),scope.t=args.type.substr(0,1),scope.delay=args.delay,"object"==typeof args.scope)for(var key in args.scope)scope[key]=args.scope[key];function reposite(){for(var j=0,k=0,lastTop=startTop,i=messageElements.length-1;0<=i;i--){var element=messageElements[i],elHeight=parseInt(element[0].offsetHeight),right=parseInt(element[0].offsetWidth);top+elHeight>window.innerHeight&&(lastTop=startTop,k++,j=0);var top=lastTop+(0===j?0:verticalSpacing),right=10+k*(10+right);element.css("top",top+"px"),element.css("right",right+"px"),lastTop=top+elHeight,j++}}var templateElement=$compile(template)(scope);templateElement.addClass(args.type),templateElement.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd click",function(e){("click"===(e=e.originalEvent||e).type||"opacity"===e.propertyName&&.4<=e.elapsedTime)&&(templateElement.remove(),messageElements.splice(messageElements.indexOf(templateElement),1),reposite())}),$timeout(function(){templateElement.addClass("killed"),templateElement.remove(),messageElements.splice(messageElements.indexOf(templateElement),1),reposite()},args.delay),angular.element(document.getElementsByTagName("body")).append(templateElement),messageElements.push(templateElement),$timeout(reposite)}).error(function(data){throw new Error("Template ("+args.template+") could not be loaded. "+data)})}var startTop=10,verticalSpacing=10,messageElements=[];return notify.config=function(args){startTop=args.top||startTop,verticalSpacing=args.verticalSpacing||verticalSpacing},notify.primary=function(){this(args,"")},notify.error=function(args){this(args,"error")},notify.success=function(args){this(args,"success")},notify.info=function(args){this(args,"info")},notify.warning=function(args){this(args,"warning")},notify}),angular.module("niceElements").directive("niceNumber",function(){return{templateUrl:"src/components/nice-number/nice-number.html",restrict:"E",scope:{model:"=",valid:"=",disabled:"=",title:"@?",min:"@",max:"@",defaultValue:"@",required:"@",fieldWidth:"@",labelWidth:"@",hideError:"@",preventZero:"@",noMargin:"@",step:"@",decimals:"@",allowNegative:"@",floatingError:"@",help:"@",isInline:"=",onChange:"&?"},controller:function($scope,$timeout){$scope.canAdd=!0,$scope.canSubstract=!0,$scope.preventZero="true"==$scope.preventZero,$scope.valid&&($scope.valid=$scope.forma),$scope.min?$scope.min=parseFloat($scope.min):$scope.min=0,$scope.allowNegative&&($scope.min=-1/0),$scope.max&&($scope.max=parseFloat($scope.max)),$scope.defaultValue?$scope.defaultValue=parseInt($scope.defaultValue):0!=$scope.min&&$scope.min!=-1/0?$scope.defaultValue=$scope.min:$scope.defaultValue=0,$scope.decimals?$scope.decimals=parseInt($scope.decimals):$scope.decimals=0,$scope.step?$scope.step=parseFloat($scope.step):$scope.step=1,$scope.model&&parseFloat($scope.model)?$scope.model=parseFloat($scope.model):$scope.model=$scope.defaultValue,$scope.check=function(){!$scope.required||null!=$scope.model&&null!=$scope.model?$scope.niceNumberForm.$setValidity("no-value",null):$scope.niceNumberForm.$setValidity("no-value",!1),$scope.min&&parseFloat($scope.model)<=$scope.min?$scope.canSubstract=!1:$scope.canSubstract=!0,$scope.max&&parseFloat($scope.model)>=$scope.max?$scope.canAdd=!1:$scope.canAdd=!0,$scope.preventZero&&0==parseFloat($scope.model)?$scope.niceNumberForm.$setValidity("zero",!1):$scope.niceNumberForm.$setValidity("zero",null),$scope.onChange&&$scope.onChange({model:$scope.model})},$timeout(function(){$scope.check()}),$scope.inputChanged=function(){$scope.check()},$scope.$watch("model",function(){$scope.check()}),$scope.add=function(){var result=new Decimal(null!=$scope.model?$scope.model:$scope.defaultValue).plus($scope.step).toNumber();(!$scope.max||result<=parseFloat($scope.max))&&($scope.model=result,$scope.niceNumberForm.$setDirty()),$scope.check()},$scope.subtract=function(){var result=new Decimal(null!=$scope.model?$scope.model:$scope.defaultValue).minus($scope.step).toNumber();result>=Number($scope.min)&&($scope.model=result,$scope.niceNumberForm.$setDirty()),$scope.check()}}}}),angular.module("niceElements").directive("nicePercent",function(){return{templateUrl:"src/components/nice-percent/nice-percent.html",restrict:"E",transclude:!0,scope:{model:"=",valid:"=",isDisabled:"=",title:"@?",required:"@",fieldWidth:"@",labelWidth:"@",placeholder:"@",noMargin:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element,attrs){attrs.title||(attrs.title=""),attrs.required=angular.isDefined(attrs.required),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.placeholder||(attrs.placeholder=""),attrs.noMargin=angular.isDefined(attrs.noMargin)},controller:function($rootScope,$scope){angular.isDefined($scope.valid)&&($scope.valid=$scope.form);function roundN(number,decimals){return Number(new Decimal(String(number)).toFixed(decimals,4))}angular.isDefined($scope.model)?$scope.internalModel=roundN(100*angular.copy($scope.model),6):($scope.internalModel="0",$scope.model=0),$scope.change=function(){$scope.internalModel?($scope.internalModel=String($scope.internalModel).replace(",","."),100<parseFloat($scope.internalModel)&&($scope.internalModel=100),$scope.model=roundN(parseFloat($scope.internalModel)/100,6)):$scope.model=0,$scope.onChange&&$scope.onChange({model:$scope.model})},$scope.keypress=function(event){return 46!=event.charCode&&44!=event.charCode?48<=event.charCode&&event.charCode<=58||0==event.charCode||(event.preventDefault(),!1):0<=$scope.internalModel.indexOf(".")?(event.preventDefault(),!1):void 0},$scope.$watch("model",function(value_new,value_old){value_new&&($scope.internalModel=roundN(100*angular.copy($scope.model),6))}),$scope.$watch("internalModel",function(value_new,value_old){$scope.internalModel||($scope.internalModel="0")})}}}),angular.module("niceElements").directive("niceProgressBar",function(){return{restrict:"E",replace:!0,templateUrl:"src/components/nice-progress-bar/nice-progress-bar.html",scope:{title:"@",noMargin:"@",value:"=",max:"=",color:"=",isInline:"=",help:"@"},controller:function($scope,$element,$timeout){$scope.width=0,$scope.resize=function(){$timeout(function(){$scope.width=$element[0].getElementsByClassName("progress")[0].offsetWidth},100)},window.onresize=function(){$scope.resize()},$scope.resize(),$scope.$watch("value",function(valueNew,valueOld){$scope.calculate()}),$scope.$watch("max",function(valueNew,valueOld){$scope.calculate()}),$scope.calculate=function(){$scope.percentage=$scope.value/$scope.max*100},$scope.calculate()}}}),angular.module("niceElements").directive("niceQuantity",function(){return{templateUrl:"src/components/nice-quantity/nice-quantity.html",restrict:"E",scope:{title:"@",model:"=",max:"=",onChange:"&?",noMargin:"@",fieldWidth:"@",labelWidth:"@",isDisabled:"=",isInline:"=",help:"@"},controller:function($scope){$scope.model||($scope.model=0),$scope.add=function(){(!$scope.max||$scope.max>=$scope.model+1)&&($scope.model+=1,$scope.onChange&&$scope.onChange({model:$scope.model}))},$scope.sub=function(){0<=$scope.model-1&&(--$scope.model,$scope.onChange&&$scope.onChange({model:$scope.model}))},$scope.handleChange=function(){$scope.model&&($scope.model=Number($scope.model))}}}}),angular.module("niceElements").directive("niceSearch",function(){return{transclude:!0,templateUrl:"src/components/nice-search/nice-search.html",restrict:"E",scope:{model:"=",isDisabled:"=",title:"@?",placeholder:"@",required:"@",fieldWidth:"@",labelWidth:"@",hideValid:"@",refreshFunction:"=",refreshSelectedCallback:"=",showDropdown:"@?",clearInput:"@",resetSearchInput:"@?",keyForInputLabel:"@?",disableRow:"@?",noMargin:"@",setText:"@",tabIndex:"@",isFocused:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element,attrs,ctrl,transcludeFn){attrs.title||(attrs.title=""),attrs.placeholder||(attrs.placeholder=""),attrs.required=angular.isDefined(attrs.required),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.hideValid=angular.isDefined(attrs.hideValid),attrs.showDropdown=angular.isDefined(attrs.showDropdown),attrs.clearInput=angular.isDefined(attrs.clearInput),attrs.resetSearchInput=angular.isDefined(attrs.resetSearchInput),attrs.disableRow=angular.isDefined(attrs.disableRow),attrs.noMargin=angular.isDefined(attrs.noMargin),attrs.setText||(attrs.setText=""),scope.$watch("setText",function(){scope.modelString=scope.setText}),angular.isDefined(scope.model)&&(angular.isDefined(scope.keyForInputLabel)?scope.modelString=scope.model[scope.keyForInputLabel]:scope.modelString=scope.model);function setValid(isValid){scope.required&&scope.form.$setValidity("objectSelected",isValid)}scope.$watch("model",function(newValue){scope.model&&scope.model.id?setValid(!0):setValid(!1)}),scope.selectRow=function(obj){angular.isDefined(scope.refreshSelectedCallback)&&scope.refreshSelectedCallback(obj),scope.resetSearchInput?scope.model=null:scope.model=obj,angular.isDefined(scope.keyForInputLabel)?scope.modelString=obj[scope.keyForInputLabel]:scope.modelString=obj,scope.clear()},scope.clear=function(){scope.results=[],scope.clearInput&&(scope.modelString="")};function onClick(event){0<element.find(event.target).length||(scope.results=[],scope.noResults=!1,scope.$apply())}angular.element(element).on("click",onClick);function onKeyDown(event){(38==event.keyCode||40==event.keyCode||13==event.keyCode||27==event.keyCode)&&scope.results&&0<scope.results.length&&(event.preventDefault(),27==event.keyCode&&(scope.modelString="",scope.clear()),13==event.keyCode&&scope.selectRow(scope.results[scope.selectedIndex]),40==event.keyCode&&scope.results&&scope.selectedIndex+1<scope.results.length&&(scope.selectedIndex+=1),38==event.keyCode&&scope.results&&0<=scope.selectedIndex-1&&--scope.selectedIndex,scope.$apply())}angular.element(element).on("keydown",onKeyDown),scope.$on("$destroy",function(){angular.element(element).off("click",onClick),angular.element(element).off("keydown",onKeyDown)})},controller:function($scope,$timeout,$element){$scope.id=Math.random().toString(36).substring(7),$scope.loading=!1,$scope.noResults=!1,$scope.requests=0,$scope.focus=function(){var input=$element[0].getElementsByTagName("input")[0];input&&input.focus()},$scope.isFocused&&$scope.focus(),$scope.results=[];$scope.updateSearch=function(){$scope.loading=!0,$scope.timer_promise&&$timeout.cancel($scope.timer_promise),$scope.timer_promise=$timeout(function(){$scope.onChange&&$scope.onChange({model:$scope.model,modelString:$scope.modelString}),$scope.requests=$scope.requests+1;var requestNumber=angular.copy($scope.requests);$scope.refreshFunction($scope.modelString).then(function(response){!function(results,requestNumber){results&&$scope.requests==requestNumber&&($scope.noResults=0==results.length,$scope.results=results,$scope.noResults||($scope.selectedIndex=0)),$scope.loading=!1}(response,requestNumber)},function(error){$scope.loading=!1})},200)},$scope.search=function(){$scope.isDisabled||($scope.showDropdown&&$scope.updateSearch(),$scope.focus())},$scope.remove=function(){$scope.model=null,$scope.modelString=null}}}}),angular.module("niceElements").directive("niceSearch2",function(){return{transclude:!0,templateUrl:"src/components/nice-search2/nice-search2.html",restrict:"E",scope:{model:"=",isDisabled:"=",showDropdown:"=",title:"@?",placeholder:"@",fieldWidth:"@",labelWidth:"@",refreshFunction:"=",refreshSelectedCallback:"=",onSelect:"=",onChange:"&?",noMargin:"@",tabIndex:"@",debounceTime:"@",isInline:"=",help:"@"},controller:function($scope,$timeout,$element){$scope.loading=!1,$scope.isOpen=!1,$scope.debounce=null,$scope.results=[],$scope.noResults=!1,$scope.selectedIndex=0,$scope.requestNumber=0,$scope.debounceTime||($scope.debounceTime=500),$scope.model||($scope.model=""),$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("nice-search-button")[0],tooltip=$element[0].getElementsByClassName("nice-search-dropdown-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state})=>{state.styles.popper.width=`${state.rects.reference.width}px`},effect:({state})=>{state.elements.popper.style.width=`${state.elements.reference.offsetWidth}px`}}]})},$scope.setupPopper(),$scope.onFocus=function(){$scope.showDropdown&&0==$scope.results.length&&$scope.getData($scope.model),$scope.open();var input=$element[0].getElementsByTagName("input")[0];input&&input.focus()},$scope.open=function(){$scope.isOpen=!0},$scope.close=function(){$scope.isOpen=!1;var input=$element[0].getElementsByTagName("input")[0];input&&input.blur(),$timeout(function(){$scope.popper.update()})},$scope.updateSearch=function(){$scope.debounce&&$timeout.cancel($scope.debounce),$scope.debounce=$timeout(function(){$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.getData($scope.model)},$scope.debounceTime)},$scope.getData=function(keywords){var requestNumber;null!=$scope.refreshFunction?($scope.loading=!0,$scope.requestNumber+=1,requestNumber=angular.copy($scope.requestNumber),$scope.refreshFunction(keywords).then(function(results){$scope.requestNumber==requestNumber&&$timeout(function(){$scope.open(),$scope.loading=!1,$scope.noResults=0==results.length,$scope.results=results,$scope.noResults||($scope.selectedIndex=0)})},function(error){$scope.loading=!1,$scope.close()})):$scope.loading=!1},$scope.search=function(){$scope.isDisabled||($scope.showDropdown&&$scope.updateSearch(),$scope.focus())},$scope.clear=function(){$scope.model=""},$scope.selectItem=function(item){$scope.onSelect&&($scope.onSelect(item),$scope.clear(),$scope.close())},$scope.scrollToHover=function(notSmooth){var dropdownMenu=$element[0].getElementsByClassName("nice-dropdown")[0],topPos=dropdownMenu.getElementsByClassName("active")[0];topPos&&(topPos=topPos.offsetTop,dropdownMenu.scroll({top:topPos-120,left:0,behavior:notSmooth?"auto":"smooth"}))},$element.bind("keydown keypress",function(event){38==event.keyCode&&(event.preventDefault(),$timeout(function(){0<$scope.selectedIndex&&(--$scope.selectedIndex,$timeout(function(){$scope.scrollToHover()}))})),40==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.results&&$scope.selectedIndex<$scope.results.length-1&&($scope.selectedIndex+=1,$timeout(function(){$scope.scrollToHover()}))})),13==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.selectItem($scope.results[$scope.selectedIndex],$scope.selectedIndex)})),27==event.keyCode&&$timeout(function(){$scope.close()})})}}}),angular.module("niceElements").directive("niceSlot",function(){return{templateUrl:"src/components/nice-slot/nice-slot.html",restrict:"E",transclude:!0,scope:{fieldWidth:"@",labelWidth:"@",title:"@",noMargin:"@",isInline:"=",help:"@"},link:function(scope,element,attrs){attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.title||(attrs.labelWidth="")}}}),angular.module("niceElements").directive("niceTimePicker",function(){return{scope:{model:"=",title:"@",isDisabled:"=",noMargin:"@",fieldWidth:"@",labelWidth:"@",onChange:"&?",isInline:"=",help:"@"},restrict:"E",templateUrl:"src/components/nice-time-picker/nice-time-picker.html",link:function($scope,$element,$attrs){$scope.model||($scope.model=moment()),$scope.open=!1,$scope.close=function(){$scope.open=!1},$scope.validateDate=function(){$scope.checkDate($scope.modelString)},$scope.checkDate=function(parsedDate){parsedDate=moment(parsedDate,"HH:mm");parsedDate.isValid()?($scope.forma.$setValidity("valid-time",!0),$scope.model=parsedDate,$scope.refreshTime(),$scope.onChange&&$scope.onChange({model:$scope.model})):($scope.forma.$setValidity("valid-time",!1),$scope.modelString="")},$scope.refreshTime=function(){$scope.hours=$scope.model.format("HH"),$scope.minutes=$scope.model.format("mm"),$scope.modelString=$scope.model.format("HH:mm")},$scope.changeHour=function(add){add?$scope.model.add(1,"hour"):$scope.model.subtract(1,"hour"),$scope.refreshTime(),$scope.forma.$setDirty()},$scope.changeMinutes=function(add){add?$scope.model.add(1,"minutes"):$scope.model.subtract(1,"minutes"),$scope.refreshTime(),$scope.forma.$setDirty()},$scope.$watch("model",function(value,oldValue){$scope.refreshTime(),value.isSame(oldValue)||$scope.checkDate(value)})}}}),angular.module("niceElements").directive("niceTooltip",function(){return{restrict:"EA",link:function(scope,element,attrs){var html=element.html();element.addClass("nice-tooltip"),html=html+"<span class='nice-tooltip-window'>"+attrs.niceTooltip+"</span>",element.html(html)}}}),angular.module("niceElements").directive("niceUpload",function($timeout,gettextCatalog){return{restrict:"E",replace:!0,transclude:!0,templateUrl:"src/components/nice-upload/nice-upload.html",scope:{model:"=",title:"@",text:"@",fieldWidth:"@",labelWidth:"@",noMargin:"@",accept:"@",uploadFunction:"=",callbackFunction:"=",callbackFile:"=",callbackUrl:"=",isDisabled:"=",isInline:"=",help:"@"},link:function(scope,element,attrs){attrs.title||(attrs.title=""),attrs.text||(attrs.text=gettextCatalog.getString("Click to upload file",null,"Nice")),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.noMargin=angular.isDefined(attrs.noMargin);element.bind("change",function(changeEvent){null!=scope.callbackUrl&&scope.callbackUrl(URL.createObjectURL(changeEvent.target.files[0])),$timeout(function(){var inputObj=changeEvent.target;scope.loading=!0,scope.error=null;var reader=new FileReader;if(inputObj.files){try{var fileSize=inputObj.files[0].size;reader.onload=function(event){$timeout(function(){fileSize<=1e6?(null!=scope.callbackFunction&&(scope.loading=!1,scope.imageSource=null,scope.callbackFunction(event.target.result),scope.text=inputObj.files[0].name,scope.form.$setDirty()),null!=scope.callbackFile&&(scope.loading=!1,scope.text=inputObj.files[0].name,scope.callbackFile(inputObj.files[0]),scope.form.$setDirty()),null!=scope.uploadFunction&&scope.uploadFunction(inputObj.files[0]).then(function(response){scope.loading=!1,scope.imageSource=event.target.result,scope.model=response.data.url,scope.form.$setDirty()},function(error){scope.error=error,scope.loading=!1,scope.imageSource=null})):(scope.error=gettextCatalog.getString("File must be smaller than 1MB",null,"Nice"),scope.loading=!1,scope.imageSource=null)})}}catch(err){scope.error=gettextCatalog.getString("Something went wrong",null,"Nice"),scope.loading=!1,scope.imageSource=null}reader.readAsDataURL(inputObj.files[0])}})})},controller:function($scope){$scope.$watch("model",function(value){$scope.imageSource=angular.copy($scope.model)})}}}),angular.module("niceElements").directive("niceYesno",function(){return{templateUrl:"src/components/nice-yesno/nice-yesno.html",restrict:"E",scope:{model:"=",modelValue:"=",yes:"@",no:"@",title:"@",isDisabled:"=",fieldWidth:"@",labelWidth:"@",options:"=",defaultFalse:"@",noMargin:"@",onChange:"&?",isInline:"=",help:"@"},controller:function($scope,gettextCatalog){$scope.yes||($scope.yes=gettextCatalog.getString("Yes",null,"Nice")),$scope.no||($scope.no=gettextCatalog.getString("No",null,"Nice")),$scope.title||($scope.title=""),$scope.fieldWidth||($scope.fieldWidth="col-sm-8"),$scope.labelWidth||($scope.labelWidth="col-sm-4"),angular.isDefined($scope.model)||angular.isDefined($scope.options)||($scope.model=!angular.isDefined($scope.defaultFalse)),!angular.isDefined($scope.modelValue)&&angular.isDefined($scope.options)&&($scope.modelValue=$scope.options[0]),$scope.defaultFalse=angular.isDefined($scope.defaultFalse),$scope.noMargin=angular.isDefined($scope.noMargin),$scope.buttonClass="",$scope.setButtonPosition=function(state){$scope.buttonClass=state?"yesno-button-yes":"yesno-button-no"},$scope.$watch("model",function(value_new,value_old){angular.isDefined($scope.model)&&($scope.setButtonLabel($scope.model),$scope.setButtonPosition($scope.model))}),$scope.$watch("modelValue",function(value_new,value_old){$scope.options&&($scope.model=$scope.modelValue==$scope.options[0])}),$scope.setButtonLabel=function(state){$scope.state=state?$scope.yes:$scope.no},$scope.setWidth=function(width,el){el.style.width=width},$scope.switch=function(){$scope.isDisabled||($scope.model=!$scope.model,$scope.options&&($scope.model?$scope.modelValue=$scope.options[0]:$scope.modelValue=$scope.options[1]),$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.formYesno.$setDirty())},$scope.setButtonPosition($scope.model),$scope.setButtonLabel($scope.model)}}}),angular.module("niceElements").filter("niceDate",function(){return function(object,formatString){formatString=formatString?"D.M.YYYY • H:mm":"D.M.YYYY";return moment(object).format(formatString)}}),angular.module("niceElements").filter("niceHighlight",function(){return function(value,regex){regex=new RegExp(regex,"gmi");return String(value).replace(regex,"<span class='nice-highligh'>$&</span>")}}),angular.module("niceElements").run(["$templateCache",function($templateCache){$templateCache.put("src/components/nice-button-toggle/nice-button-toggle.html",'<div class="nice-component nice-button-toggle row">\n<div class="col-xs-offset-4 col-xs-8">\n<button type="button" class="btn btn-block btn-primary" ng-click="model = !model">\n<span>{{ label }}</span>\n<span ng-show="!model" class="glyphicon glyphicon-menu-down"></span>\n<span ng-show="model" class="glyphicon glyphicon-menu-up"></span>\n</button>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-button/nice-button.html",'<div class="nice-component nice-button" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<button type="{{ type }}" class="btn btn-primary" ng-class="addClass" ng-click="click()" ng-disabled="niceDisabled===true">\n<div ng-class="{opacity0: loading==true, opacity1: loading==false}"><ng-transclude></ng-transclude></div>\n<div ng-class="{display0: loading==false, opacity1: loading==true}" class="nice-button-loader-wrapper"><nice-loader add-class="nice-button-loader"></nice-loader></div>\n</button>\n</div>\n'),$templateCache.put("src/components/nice-calendar/nice-calendar.html",'<div class="nice-component nice-calendar" ng-form="formCalendar" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="disabled-shield" ng-if="isDisabled"></div>\n<div class="nice-calendar-wrapper">\n<div class="nice-calendar-weeks">\n<div class="header">\n<i class="fa fa-angle-left" ng-click="previous()" title="{{ \'Previous month\' | translate:\'Nice\' }}"></i>\n<span title="{{ month.format(\'M.YYYY\' )}}">{{ month.format("MMMM, YYYY" )}}</span>\n<i class="fa fa-angle-right" ng-click="next()" title="{{ \'Next month\' | translate:\'Nice\' }}"></i>\n</div>\n<div class="week names">\n<span class="day" translate translate-context="Nice">Mon</span>\n<span class="day" translate translate-context="Nice">Tue</span>\n<span class="day" translate translate-context="Nice">Wed</span>\n<span class="day" translate translate-context="Nice">Thu</span>\n<span class="day" translate translate-context="Nice">Fri</span>\n<span class="day weekend" translate translate-context="Nice">Sat</span>\n<span class="day weekend" translate translate-context="Nice">Sun</span>\n</div>\n<div class="week" ng-repeat="week in weeks">\n<span class="day" title="{{ day.date.format(\'D.M.YYYY\') }}" ng-class="{\n today: day.isToday,\n \'different-month\': !day.isCurrentMonth,\n \'start-selected\': isSameDay(day.date, startDate),\n \'end-selected\': isSameDay(day.date, endDate),\n \'selected\': isBetweenRange(day.date),\n \'selecting-start\': selectStart,\n \'selecting-end\': !selectStart,\n \'weekend\': day.isWeekday,\n \'disabled\': day.isDisabled\n }" ng-style="\n (color && isBetweenRange(day.date)) && {\'background-color\': lighten(color) } ||\n (color && isSameDay(day.date, startDate)) && {\'background-color\': color } ||\n (color && isSameDay(day.date, endDate)) && {\'background-color\': color }\n " ng-click="select(day)" ng-repeat="day in week.days">\n{{ day.number }}\n<p class="popup" ng-if="!hideHover">{{ popupText }}</p>\n</span>\n</div>\n</div>\n<div class="nice-calendar-time" ng-if="time">\n<div class="time-picker">\n<select title="{{ \'Select start time\' | translate:\'Nice\' }}" class="time-picker-hour" ng-model="startDateHour" ng-change="startHourChange(startDateHour)" ng-options="hour for hour in hours">\n</select>\n</div>\n<div class="time-picker">\n<select title="{{ \'Select start time\' | translate:\'Nice\' }}" class="time-picker-minute" ng-model="startDateMinute" ng-change="startMinuteChange(startDateMinute)" ng-options="minute for minute in minutes">\n</select>\n</div>\n<div class="time-picket-icon">\n<i class="fa fa-clock-o"></i>\n</div>\n<div class="time-picker">\n<select title="{{ \'Select end time\' | translate:\'Nice\' }}" class="time-picker-hour" ng-model="endDateHour" ng-change="endHourChange(endDateHour)" ng-options="hour for hour in hours">\n</select>\n</div>\n<div class="time-picker no-border-right">\n<select title="{{ \'Select end time\' | translate:\'Nice\' }}" class="time-picker-minute" ng-model="endDateMinute" ng-change="endMinuteChange(endDateMinute)" ng-options="minute for minute in minutes">\n</select>\n</div>\n</div>\n<div class="nice-selected-dates">\n<div class="nice-start-date">\n<label translate translate-context="Nice">Start</label>\n<div ng-class="startTimeClass">{{ formatDate(startDate) }}</div>\n</div>\n<div class="nice-end-date">\n<label translate translate-context="Nice">End</label>\n<div ng-class="endTimeClass">{{ formatDate(endDate) }}</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-checkbox/nice-checkbox.html",'<div class="nice-component nice-checkbox" ng-class="{ \'checked\': model, \'margin-bottom-0\' : noMargin }" ng-click="toggle()">\n<div class="checkbox">\n<svg class="check" viewBox="-281 373 48 48">\n<path class="check-stroke" d="M-273.2,398.2l10,9.9 l22.4-22.3"></path>\n</svg>\n</div>\n<div ng-if="title" class="message">{{ title }}</div>\n</div>'),$templateCache.put("src/components/nice-choice/nice-choice.html",'<div class="nice-component nice-choice" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" ng-form="formChoice">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<ul class="list-unstyled" ng-class="{ \'disabled\': isDisabled }">\n<li ng-repeat="item in internalList" ng-class="{ \'selected\' : isItemSelected(item) }" ng-click="toggle(item)">\n<div class="choice-checkbox" ng-class="{\'circle\' : !multiple }"><i class="fa fa-check"></i></div>\n<div ng-transclude class="choice-label">{{ getLabel(item) }}</div>\n</li>\n</ul>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-comment/nice-comment.html",'<div class="nice-component nice-comment" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'" ng-click="edit()">\n<textarea ng-class="{\'editing\': editing}" class="form-control" ng-model="model" placeholder="{{placeholder}}" rows="{{rows}}" ng-blur="save()"></textarea>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-date-range/nice-date-range.html",'<ng-form class="nice-component nice-date-range" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group">\n<input date-range-picker class="form-control date-picker" type="text" options="opts" ng-model="model">\n<span date-range-picker options="opts" ng-model="model" class="input-group-addon"><i class="fa fa-calendar"></i></span>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-date/nice-date.html",'<div class="nice-component nice-date" ng-form="forma" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-date-background" ng-click="toggleOpen()" ng-if="isOpen && !inline"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="disabled-shield" ng-if="isDisabled"></div>\n<div class="nice-date-button input-group" ng-class="{ \'open\': isOpen }" ng-show="!inline" ng-click="toggleOpen()">\n<input type="text" class="form-control" value="{{ model | niceDate:time }}" readonly="readonly">\n<span class="input-group-addon clickable">\n<i class="fa fa-calendar"></i>\n</span>\n</div>\n<div class="nice-date-dropdown-wrapper">\n<div ng-class="{ \'nice-date-dropdown\': !inline }" ng-if="inline || isOpen">\n<div class="nice-date-date" ng-class="{ \'with-time\': time }">\n<div class="nice-date-header">\n<span>\n<select class="year-picker" ng-model="innerDate.year" ng-change="handleDateChange()" ng-options="year for year in years">\n</select>,\n<select class="month-picker" ng-model="innerDate.month" ng-change="handleDateChange()" ng-options="month.value as month.name for month in months">\n</select>\n</span>\n<i class="fa fa-angle-left" ng-click="previous()"></i>\n<i class="fa fa-circle" ng-click="today()"></i>\n<i class="fa fa-angle-right" ng-click="next()"></i>\n</div>\n<div class="nice-date-week names">\n<span class="nice-date-day" ng-class="{ \'weekend\': $index == 6 || $index == 5 }" ng-repeat="day in weekdays">{{ day }}</span>\n</div>\n<div class="nice-date-week" ng-repeat="week in weeks">\n<span class="nice-date-day" title="{{ day.value }}" ng-class="{\n \'today\': day.isToday,\n \'different-month\': !day.isCurrentMonth,\n \'selected\': isSameDay(model, day.date),\n \'weekend\': day.isWeekday,\n \'disabled\': day.isDisabled,\n \'between\': isBetween(day.date, model, nextDate)\n }" ng-click="select(day)" ng-repeat="day in week.days">{{ day.number }}</span>\n</div>\n</div>\n<div class="nice-date-time" ng-if="time">\n<i class="fa fa-clock-o"></i>\n<div class="time-picker time-picker-hour">\n<select ng-disabled="isDisabled" ng-model="innerDate.hour" ng-change="timeChange()" ng-options="hour as hour for hour in hours track by hour">\n</select>\n</div>\n<div class="divider">:</div>\n<div class="time-picker time-picker-minute">\n<select ng-disabled="isDisabled" ng-model="innerDate.minute" ng-change="timeChange()" ng-options="minute as minute for minute in minutes track by minute">\n</select>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-datetime-picker/nice-datetime-picker.html",'<div class="nice-component nice-datetime-picker" name="form" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-dtp-background" ng-click="closeDtp(true)" ng-if="isOpen"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div ng-form="formDatetimePicker"></div>\n<div class="input-group" id="dropdown{{randNum}}">\n<input type="text" class="form-control" value="{{ value }}" ng-click="openDtp()" ng-disabled="isDisabled">\n<span class="input-group-addon clickable" ng-click="openDtp()">\n<i class="fa" ng-class="date == \'true\' ? \'fa-calendar\' : \'fa-clock-o\'"></i>\n</span>\n</div>\n<div ng-show="isOpen">\n<nice-dtp model="internalDate" format="{{ format }}" model-format="{{ modelFormat }}" date="{{ date == \'true\' }}" time="{{ time == \'true\' }}" width="{{ width }}" enable-ok-buttons="{{ enableOkButtons }}" lang="{{ lang }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" week-start="{{ weekStart }}" ok-text="{{ okText }}" cancel-text="{{ cancelText }}" closed="closeDtp"></nice-dtp>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html",'<div class="nice-component nice-datetimerange-picker-2" ng-form="formDateRangePicker" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-dtp-background" ng-click="close()" ng-if="isOpen"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="nice-daterange-picker-button input-group" ng-class="{ \'open\': isOpen }" ng-click="open()">\n<input type="text" class="form-control" value="{{ modelFormat }}" readonly="readonly">\n<span class="input-group-addon clickable"><i class="fa fa-calendar"></i></span>\n</div>\n<div class="nice-daterange-picker-wrapper">\n<div class="dtp-wrapper" ng-if="isOpen">\n<div class="dtp-buttons-left">\n<div class="dtp-buttons-top">\n<a class="btn btn-primary btn-block" ng-click="selectToday()" translate translate-context="Nice">Last 24 hours</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)" translate translate-context="Nice">Last 7 days</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastMonth()" translate translate-context="Nice">Last month</a>\n<a class="btn btn-primary btn-block" ng-click="selectThisMonth()" translate translate-context="Nice">This month</a>\n</div>\n<div class="dtp-buttons-bottom">\n<a class="btn btn-danger btn-block" ng-click="close()" translate translate-context="Nice">Cancel</a>\n<a class="btn btn-success btn-block" ng-click="confirm()" translate translate-context="Nice">OK</a>\n</div>\n</div>\n<div class="dtp-left">\n<nice-date model="innerStartDate" next-date="innerEndDate" field-width="col-xs-12" no-margin="true" inline="true" time="time"></nice-date>\n</div>\n<div class="dtp-right">\n<nice-date model="innerEndDate" next-date="innerStartDate" field-width="col-xs-12" no-margin="true" inline="true" time="time"></nice-date>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-datetimerange-picker/nice-datetimerange-picker.html",'<div class="nice-component nice-datetime-picker nice-datetimerange-picker" name="form" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-dtp-background" ng-click="cancelClick()" ng-if="showDtpRange"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div ng-form="formDatetimeRangePicker"></div>\n<div class="dropdown">\n<a class="dropdown-toggle" id="dropdown{{randNum}}" role="button" ng-click="openDtpRange()" href="javascript:void(0);">\n<div class="input-group">\n<input type="text" class="form-control" value="{{value}}" ng-click="openDtpRange()">\n<span class="input-group-addon clickable"><i class="fa" ng-class="{\'fa-clock-o\': date==\'false\', \'fa-calendar\': date!=\'false\'}"></i></span>\n</div>\n</a>\n</div>\n<div class="dtp-range-wrapper" ng-show="showDtpRange">\n<div class="dtp-layer">\n<div class="dtp-buttons-left">\n<a class="btn btn-primary btn-block" ng-click="selectLastNDays(1)" translate translate-context="Nice">Last 24 hours</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)" translate translate-context="Nice">Last 7 days</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastMonth()" translate translate-context="Nice">Last month</a>\n<a class="btn btn-primary btn-block" ng-click="selectThisMonth()" translate translate-context="Nice">This month</a>\n</div>\n<div class="dtp-left">\n<nice-dtp model="dateStart" format="{{format}}" model-format="{{modelFormat}}" date="{{date}}" time="{{time}}" width="{{width}}" enable-ok-buttons="{{enableOkButtons}}" lang="{{lang}}" min-date="{{minDate}}" max-date="{{maxDate}}" week-start="{{weekStart}}" ok-text="{{okText}}" cancel-text="{{cancelText}}" inline="true"></nice-dtp>\n</div>\n<div class="dtp-right">\n<nice-dtp model="dateEnd" format="{{format}}" model-format="{{modelFormat}}" date="{{date}}" time="{{time}}" width="{{width}}" enable-ok-buttons="{{enableOkButtons}}" lang="{{lang}}" min-date="{{minDate}}" max-date="{{maxDate}}" week-start="{{weekStart}}" ok-text="{{okText}}" cancel-text="{{cancelText}}" inline="true"></nice-dtp>\n</div>\n<div class="dtp-buttons-bottom">\n<a class="btn btn-danger btn-block margin-right-20" ng-click="cancelClick()" translate translate-context="Nice">Cancel</a>\n<a class="btn btn-success btn-block" ng-click="okClick()" translate translate-context="Nice">OK</a>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-dropdown-date/nice-dropdown-date.html",'<div class="nice-component nice-dropdown-date" ng-form="dropdownDateForm" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[\n fieldWidth ? fieldWidth : \'col-sm-8\',\n {\n \'has-warning\': !isDisabled && dropdownDateForm.$invalid && dropdownDateForm.$dirty,\n \'nice-disabled\': isDisabled\n }\n ]">\n<div class="form-inline">\n<div class="input-group nice-dropdown-date-day">\n<select ng-model="dateFields.day" class="form-control" ng-options="day for day in days" ng-change="checkDate()" ng-disabled="isDisabled" required="true"></select>\n</div>\n<div class="input-group nice-dropdown-date-month">\n<select ng-model="dateFields.month" class="form-control" ng-options="month.value as month.name for month in months" ng-change="checkDate()" ng-disabled="isDisabled" required="true"></select>\n</div>\n<div class="input-group nice-dropdown-date-year">\n<select ng-model="dateFields.year" class="form-control" ng-options="year for year in years" ng-change="checkDate()" ng-disabled="isDisabled" required="true"></select>\n</div>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-dropdown-old/nice-dropdown-old.html",'<div class="nice-component nice-dropdown-old" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div ng-class="addButtonEnable && !isDisabled ? \'input-group\': \'\'">\n<div class="btn-group" dropdown is-open="status.isopen" ng-class="{ \'disabled\': isDisabled || emptyList }">\n<button type="button" class="btn btn-block btn-dropdown dropdown-toggle" title="{{ getLabel(internalSelected) }}" dropdown-toggle ng-disabled="isDisabled || emptyList">\n<span ng-if="internalSelected.color_hex_code" class="dropdown-color" ng-style="{\'background\': internalSelected.color_hex_code}"></span>\n<span ng-if="!multiple">{{ getLabel(internalSelected) }}</span>\n<span ng-if="multiple">\n<span ng-if="internalSelected.length > 1">{{ internalSelected.length }}<translate translate-context="Nice">selected</translate></span>\n<span ng-if="internalSelected.length == 1">{{ getLabel(internalSelected[0]) }}</span>\n<span ng-if="internalSelected.length == 0" translate translate-context="Nice">None</span>\n</span>\n<span class="caret"></span>\n</button>\n<ul id="{{id}}" class="dropdown-menu" role="menu">\n<li id="{{id}}-{{$index}}" ng-repeat="item in internalList" ng-click="clicked(item)">\n<a href>\n<span class="choice-checkbox" ng-if="multiple" ng-class="{ \'selected\' : isItemSelected(item) }"><i class="fa fa-check"></i></span>\n<span ng-if="item.color_hex_code" class="dropdown-color" ng-style="{\'background\': item.color_hex_code}"></span>\n<span ng-class="{\'multiple-item\': multiple}">{{ getLabel(item) }}</span>\n</a>\n</li>\n</ul>\n</div>\n<span class="input-group-btn" ng-if="addButtonEnable && !isDisabled">\n<button class="btn btn-primary" ng-click="addButtonFunction()" type="button">+</button>\n</span>\n</div>\n</div>\n</div>\n<div ng-form="formDropdown"></div>\n</div>'),$templateCache.put("src/components/nice-dropdown/nice-dropdown.html",'<div class="nice-component nice-dropdown" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[ fieldWidth ? fieldWidth : \'col-sm-8\', { \'open\': isOpen, \'nice-disabled\': isDisabled || emptyList } ]" click-outside="close()" is-open="{{ isOpen }}">\n<div class="nice-field-wrapper">\n<button type="button" class="btn btn-dropdown" ng-ref="dropdown-button" ng-click="toggle()" ng-disabled="isDisabled || emptyList">\n<div class="btn-dropdown-inside" ng-transclude="button" ng-if="selected != null">\n<span ng-if="!multiple">{{ selected[objValue] }}</span>\n<span ng-if="multiple">\n<span ng-if="selected.length > 1">{{ selected.length }} {{ selectedText }}</span>\n<span ng-if="selected.length == 1">{{ selected[0][objValue] }}</span>\n<span ng-if="selected.length == 0">{{ nullableText }}</span>\n</span>\n</div>\n<div class="not-selected" ng-if="selected == null">{{ selectText }}</div>\n<span class="caret" ng-show="!loading"></span>\n<nice-loader visible-when="!loading"></nice-loader>\n</button>\n<div class="nice-dropdown-menu-wrapper">\n<div class="nice-dropdown-menu" ng-if="isOpen">\n<div class="search-bar" ng-if="searchFunction">\n<input ng-model="internal.search" ng-model-options="{ debounce: 500 }" ng-change="handleSearch()" placeholder="{{ searchText }}">\n<span class="icon"><i class="fa fa-search"></i></span>\n</div>\n<div class="nice-dropdown-items">\n<div class="nice-no-data" ng-if="internalList && internalList.length == 0">{{ noDataText }}</div>\n<div class="nice-dropdown-item null-item" ng-if="nullable && internalList.length != 0" ng-click="handleSelected(null, -1)">\n{{ nullableText }}\n</div>\n<div class="nice-dropdown-item" ng-repeat="item in internalList" ng-click="handleSelected(item, $index)" ng-class="{ \'selected\': item._selected, \'hover\': $index == selectedIndex }">\n<span class="choice-checkbox" ng-if="multiple"><i class="fa fa-check"></i></span>\n<span ng-transclude="option">\n<span ng-class="{ \'multiple-item\': multiple }">{{ item[objValue] }}</span>\n</span>\n</div>\n</div>\n</div>\n</div>\n<button class="btn btn-primary add-btn" type="button" ng-if="addButtonFunction && !isDisabled" ng-click="addButtonFunction()">+</button>\n</div>\n</div>\n</div>\n<div ng-form="formDropdown"></div>\n</div>'),$templateCache.put("src/components/nice-dtp/nice-dtp.html",'<div class="dtp-wrapper">\n<div class="dtp" id="this.name" ng-class="{\'hidden\': !showDtp}">\n<div class="dtp-content" ng-style="dtp_content_style">\n<div class="dtp-date-view">\n<div class="dtp-header" ng-if="!inline">\n<div class="dtp-actual-day">{{actualDay}}</div>\n<div class="dtp-close" ng-if="!inline"><a href="javascript:void(0);" ng-click="onCloseClick()"><i class="fa fa-close"></i></a></div>\n</div>\n<div class="dtp-date" ng-if="!inline" ng-class="{\'hidden\': !showDateHeader}">\n<div>\n<div class="left center p10">\n<a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{\'disabled\': !btnMonthBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>\n</div>\n<div class="dtp-actual-month p80" ng-click="initDate()">{{actualMonth}}</div>\n<div class="right center p10">\n<a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{\'disabled\': !btnMonthAfterEnabled}"><i class="fa fa-chevron-right"></i></a>\n</div>\n<div class="clearfix"></div>\n</div>\n<div class="dtp-actual-num" ng-click="initDate()">{{actualNum}}</div>\n<div>\n<div class="left center p10">\n<a href="javascript:void(0);" class="dtp-select-year-before" ng-click="onYearBeforeClick()" ng-class="{\'disabled\': !btnYearBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>\n</div>\n<div class="dtp-actual-year p80" ng-click="initDate()">{{actualYear}}</div>\n<div class="right center p10">\n<a href="javascript:void(0);" class="dtp-select-year-after" ng-click="onYearAfterClick()" ng-class="{\'disabled\': !btnYearAfterEnabled}"><i class="fa fa-chevron-right"></i></a>\n</div>\n<div class="clearfix"></div>\n</div>\n</div>\n<div class="dtp-time" ng-show="!showTimeHeader">\n<div class="dtp-actual-maxtime">\n<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==1}" ng-click="initHours()" href="javascript:void(0);">{{actualTime.hours}}</a>:<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==2}" ng-click="initMinutes()" href="javascript:void(0);">{{actualTime.minutes}}</a>\n</div>\n</div>\n<div class="dtp-picker">\n<div class="dtp-picker-calendar" ng-class="{\'hidden\': !showCalendar}">\n<div>\n<div ng-if="inline" class="left center p10">\n<a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{\'disabled\': !btnMonthBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>\n</div>\n<div class="dtp-picker-month" ng-class="{\'p80\': inline}">{{monthAndYear}}</div>\n<div class="right center p10" ng-if="inline">\n<a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{\'disabled\': !btnMonthAfterEnabled}"><i class="fa fa-chevron-right"></i></a>\n</div>\n</div>\n<table class="table dtp-picker-days">\n<thead>\n<th ng-repeat="weekDay in weekDays track by $index">{{weekDay}}</th>\n</thead>\n<tbody>\n<tr ng-repeat="week in weeks">\n<td ng-repeat="day in week">\n<span ng-if="day.disabled" class="dtp-select-day">{{day.label}}</span>\n<a ng-if="!day.disabled" ng-click="onSelectDate(day)" href="javascript:void(0);" class="dtp-select-day" ng-class="{\'selected\': day.selected}">{{day.label}}</a>\n</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class="dtp-picker-datetime" ng-class="{\'hidden\': !showTime}">\n<div class="dtp-actual-meridien">\n<div class="dtp-actual-time p60" ng-show="showTimeHeader">\n<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==1}" ng-click="initHours()" href="javascript:void(0);">{{actualTime.hours}}</a>:<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==2}" ng-click="initMinutes()" href="javascript:void(0);">{{actualTime.minutes}}</a>\n</div>\n<div class="clearfix"></div>\n</div>\n<div class="dtp-picker-clock">\n<div class="dtp-hand dtp-hour-hand" ng-show="currentView==1"></div>\n<div class="dtp-hand dtp-minute-hand" ng-show="currentView==2"></div>\n<div class="dtp-clock-center"></div>\n<div ng-repeat="hour in hours" class="dtp-picker-time" ng-style="hour.style">\n<a href="javascript:void(0);" class="dtp-select-hour" ng-class="{\'selected\': hour.selected, \'disabled\': hour.disabled}" ng-click="onSelectHour(hour)">{{hour.h}}</a>\n</div>\n<div ng-repeat="minute in minutes" class="dtp-picker-time" ng-style="minute.style">\n<a href="javascript:void(0);" class="dtp-select-minute" ng-class="{\'selected\': minute.selected, \'disabled\': minute.disabled}" ng-click="onSelectMinute(minute)">{{minute.m}}</a>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-help/nice-help.html",'<div class="nice-help">\n<i class="fa fa-question-circle"></i>\n<div class="help-window" ng-bind-html="text">{{ text }}</div>\n</div>\n'),$templateCache.put("src/components/nice-input/nice-input.html",'<ng-form class="nice-component nice-input" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="forma">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="form-group" ng-class="{\n \'has-feedback\': showValid && !hideValid,\n \'has-warning\': !isDisabled && forma.$invalid && forma.$dirty && !hideValid,\n \'has-success\': !isDisabled && forma.$valid && forma.$dirty && showValid,\n \'symbol\': symbol,\n \'nice-disabled\': isDisabled\n }">\n<textarea ng-show="textArea" class="form-control" ng-model="model" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{textAreaLines}}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>\n<input ng-show="!textArea" class="form-control" type="{{ internalType }}" ng-model="model" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled">\n<span class="input-group-addon" ng-if="symbol">{{ symbol }}</span>\n</div>\n<div ng-if="forma.$error && forma.$dirty">\n<div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate translate-context="Nice">Email is not valid.</div>\n<div class="error-message" ng-if="forma.$dirty && forma.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>\n<div class="error-message" ng-if="forma.$error.minlength"><translate translate-context="Nice">Your input is too short. It must contain at least</translate> {{ minlength }} <translate translate-context="Nice">characters</translate>.</div>\n<div class="error-message" ng-if="forma.$error.maxlength" translate translate-context="Nice">Your input is too long</div>\n<div class="error-message" ng-if="forma.$error.required" ng-if="forma.$dirty" translate translate-context="Nice">This field is required.</div>\n<div class="error-message" ng-if="forma.$error.unique" translate translate-context="Nice">This field must be unique.</div>\n</div>\n</div>\n</div>\n</ng-form>\n'),$templateCache.put("src/components/nice-label/nice-label.html",'<div class="nice-component nice-label" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}</div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-xs-8\'">\n<p class="value">{{ value }}</p>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-loader/nice-loader.html",'<div class="nice-loader" ng-if="!visibleWhen" ng-class="[addClass, { \'nice-loader-fullscreen\': fullscreen, \'nice-loader-fulldiv\': fulldiv }]">\n<svg version="1.1" id="loader" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">\n<path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path>\n</svg>\n<div class="nice-loader-message" ng-if="message">{{ message }}</div>\n<ng-transclude></ng-transclude>\n</div>'),$templateCache.put("src/components/nice-notification/nice-notification.html",'<div class="notification">\n<h3 ng-show="title" ng-bind-html="title"></h3>\n<div class="message" ng-bind-html="message"></div>\n</div>'),$templateCache.put("src/components/nice-number/nice-number.html",'<div class="nice-component nice-number" ng-form="niceNumberForm" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div ng-class="{\'row\' : !disableRow}">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group" ng-class="{\'has-warning\': !disabled && niceNumberForm.$invalid && niceNumberForm.$dirty}">\n<span class="input-group-btn">\n<button class="btn btn-default" type="button" ng-disabled="!canSubstract" ng-click="subtract()">-</button>\n</span>\n<input type="number" step="{{ step }}" ng-change="inputChanged()" class="form-control" max="{{ max }}" min="{{ min }}" ng-model="model">\n<span class="input-group-btn">\n<button class="btn btn-default" type="button" ng-disabled="!canAdd" ng-click="add()">+</button>\n</span>\n</div>\n<div class="error-messages" ng-if="niceNumberForm.$error && !hideError" ng-class="{ \'floating-error\': floatingError }">\n<div class="error-message" ng-if="niceNumberForm.$dirty && niceNumberForm.$error.number" translate translate-context="Nice">This field requires a number</div>\n<div class="error-message" ng-if="niceNumberForm.$error.min">\n<translate translate-context="Nice">Minimum value is</translate>{{ min }}\n</div>\n<div class="error-message" ng-if="niceNumberForm.$error.max">\n<translate translate-context="Nice">Maximum value is</translate>{{ max }}\n</div>\n<div class="error-message" ng-if="niceNumberForm.$error.zero">\n<translate translate-context="Nice">0 is not allowed</translate>\n</div>\n<div class="error-message" ng-if="niceNumberForm.$error.no-value && !niceNumberForm.$error.zero && !niceNumberForm.$error.min && !niceNumberForm.$error.max">\n<translate translate-context="Nice">Value is missing</translate>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-percent/nice-percent.html",'<ng-form class="nice-component nice-input" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group has-feedback symbol" ng-class="{\n \'has-warning\': !isDisabled && form.$invalid && form.$dirty && !hideValid,\n \'has-success\': !isDisabled && form.$valid && form.$dirty && showValid,\n \'disabled\': isDisabled\n }">\n<input class="form-control" type="text" max="100" min="0" ng-model="internalModel" placeholder="{{ placeholder }}" ng-required="required" ng-keypress="keypress($event)" ng-change="change()" ng-disabled="isDisabled">\n<span class="input-group-addon">%</span>\n</div>\n<div ng-if="form.$error">\n<div class="error-message" ng-if="form.$dirty && form.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>\n<div class="error-message" ng-if="form.$dirty && form.$error.required" translate translate-context="Nice">This field is required.</div>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-progress-bar/nice-progress-bar.html",'<div class="nice-component nice-progress-bar" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="progress">\n<div class="progress-value">{{ value }} / {{ max }}</div>\n<div class="progress-bar" ng-style="{\'width\': percentage+\'%\', \'background\': color}">\n<div class="progress-value" ng-style="{\'width\': width+\'px\'}">{{ value }} / {{ max }}</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-quantity/nice-quantity.html",'<div class="nice-component nice-quantity" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="input-group">\n<span class="input-group-btn">\n<button class="btn btn-primary btn-left" ng-click="sub()" type="button" ng-disabled="isDisabled">-</button>\n</span>\n<input class="value form-control" ng-model="model" type="number" ng-change="handleChange()" ng-disabled="isDisabled">\n<span class="input-group-btn">\n<button class="btn btn-primary btn-right" ng-click="add()" type="button" ng-disabled="isDisabled">+</button>\n</span>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-search/nice-search.html",'<ng-form class="nice-component nice-input nice-search" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline}" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="input-group" ng-class="{\n \'disabled\': isDisabled,\n \'has-warning\': !isDisabled && form.$invalid && form.$dirty,\n \'has-success\': !isDisabled && form.$valid && form.$dirty}\n ">\n<input class="form-control" type="text" id="{{ id }}" ng-model="modelString" ng-keypress="keypress($event)" placeholder="{{ placeholder }}" ng-disabled="isDisabled" ng-change="updateSearch()" ng-required="required" tabindex="{{ tabIndex }}">\n<span class="input-group-addon clickable" ng-click="search()" ng-if="!model">\n<i ng-show="!loading" class="fa fa-search"></i>\n<i ng-show="loading" class="fa fa-refresh fa-spin"></i>\n</span>\n<span class="input-group-addon clickable" ng-click="remove()" ng-if="model">\n<i ng-show="!loading" class="fa fa-remove"></i>\n</span>\n</div>\n</div>\n</div>\n<div class="row">\n<div ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title"></div>\n<div ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="nice-dropdown-empty" ng-if="noResults">\n<div class="nice-search-row" translate translate-context="Nice">No results found.</div>\n</div>\n<div class="nice-dropdown" ng-if="results.length">\n<div ng-repeat="result in results" class="nice-search-row" ng-class="{\'active\': selectedIndex == $index}" ng-click="selectRow(result)">\n<span class="text-bold">{{ result[keyForInputLabel] }}</span>\n</div>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-search2/nice-search2.html",'<ng-form class="nice-component nice-input nice-search2" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}</div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]" click-outside="close()">\n<div class="nice-search-button input-group" ng-class="{ \'disabled\': isDisabled, \'has-warning\': !isDisabled && form.$invalid && form.$dirty, \'has-success\': !isDisabled && form.$valid && form.$dirty}">\n<input class="form-control" type="text" id="{{ id }}" ng-model="model" placeholder="{{ placeholder }}" ng-disabled="isDisabled" ng-change="updateSearch()" ng-focus="onFocus()" tabindex="{{ tabIndex }}">\n<span class="input-group-addon clickable" ng-click="onFocus()">\n<i ng-show="!loading" class="fa fa-search"></i>\n<i ng-show="loading" class="fa fa-refresh fa-spin"></i>\n</span>\n</div>\n<div class="nice-search-dropdown-wrapper">\n<div class="nice-search-dropdown" ng-if="showDropdown && isOpen">\n<div class="nice-search-row nice-search-row-loading" ng-if="loading && results.length == 0">\n<nice-loader visible-when="!loading"></nice-loader>\n</div>\n<div class="nice-search-row nice-search-row-empty" ng-if="!loading && results.length == 0" translate translate-context="Nice">No results found.</div>\n<div ng-repeat="result in results" class="nice-search-row" ng-class="{\'active\': selectedIndex == $index}" ng-click="selectItem(result)">\n<ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>\n</div>\n</div>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-slot/nice-slot.html",'<div class="nice-component nice-slot" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'">\n<div class="nice-title-text" ng-if="title">{{ title }}</div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-xs-8\'">\n<ng-transclude></ng-transclude>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-time-picker/nice-time-picker.html",'<div class="nice-component nice-time-picker" ng-form="forma" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group" ng-class="{\n \'has-warning\': !isDisabled && forma.$invalid && forma.$dirty,\n \'disabled\': isDisabled\n }">\n<input type="text" class="form-control" ng-model="modelString" ng-keyup="$event.keyCode == 13 && validateDate()" ng-blur="validateDate()">\n<span class="input-group-addon clickable" ng-click="open = !open"><i class="fa fa-clock-o"></i></span>\n</div>\n<div class="nice-time-picker-dropdown" ng-if="open">\n<div class="row">\n<div class="col-xs-6">\n<button ng-click="changeHour(true)"><i class="fa fa-chevron-up"></i></button>\n</div>\n<div class="col-xs-6">\n<button ng-click="changeMinutes(true)"><i class="fa fa-chevron-up"></i></button>\n</div>\n</div>\n<div class="row numbers">\n<div class="col-xs-6">{{ hours }}</div>\n<div class="col-xs-6">{{ minutes }}</div>\n</div>\n<div class="row">\n<div class="col-xs-6">\n<button ng-click="changeHour(false)"><i class="fa fa-chevron-down"></i></button>\n</div>\n<div class="col-xs-6">\n<button ng-click="changeMinutes(false)"><i class="fa fa-chevron-down"></i></button>\n</div>\n</div>\n</div>\n</div>\n</div>\n<div class="nice-background" ng-click="close()" ng-if="open"></div>\n</div>'),$templateCache.put("src/components/nice-upload/nice-upload.html",'<ng-form class="nice-component nice-upload" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<input class="input-file" type="file" accept="{{ accept }}" ng-model="file" ng-disabled="isDisabled">\n<div class="input-area">\n<div class="middle-text" ng-if="!imageSource && !loading">\n<div class="text">{{ text }}</div>\n<div class="error" ng-if="error">{{ error }}</div>\n</div>\n<img ng-if="imageSource" data-ng-src="{{ imageSource }}">\n</div>\n<div class="loading" ng-if="loading">\n<nice-loader></nice-loader>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-yesno/nice-yesno.html",'<div class="nice-component nice-yesno" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" ng-form="formYesno">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="yesno-wrapper noselect" ng-class="{ \'disabled\': isDisabled }">\n<div class="yesno-yes-bg" ng-click="switch()">{{ yes }}</div>\n<div class="yesno-no-bg" ng-click="switch()">{{ no }}</div>\n<div class="yesno-button" ng-class="buttonClass" ng-click="switch()">{{ state }}</div>\n</div>\n</div>\n</div>\n</div>')}]);
|
|
1
|
+
"use strict";angular.module("niceElements",[]),angular.module("niceElements").directive("niceButtonToggle",function(){return{templateUrl:"src/components/nice-button-toggle/nice-button-toggle.html",restrict:"E",scope:{model:"=?",label:"@"},link:function(scope,element,attrs){angular.isDefined(scope.model)&&(scope.model=!1)}}}),angular.module("niceElements").directive("niceButton",function($q){return{templateUrl:"src/components/nice-button/nice-button.html",restrict:"E",transclude:!0,scope:{niceDisabled:"=",title:"@",noMargin:"=",fieldWidth:"@",labelWidth:"@",niceClick:"&",addClass:"@",isInline:"=",type:"@"},link:function(scope,element,attrs){scope.loading=!1,scope.type||(scope.type="button"),scope.click=function(){!1===scope.loading&&!0!==scope.niceDisabled&&(scope.loading=!0,$q.when(scope.niceClick()).finally(function(){scope.loading=!1}))}}}}),angular.module("niceElements").directive("niceCalendar",function($timeout,gettextCatalog){return{restrict:"E",templateUrl:"src/components/nice-calendar/nice-calendar.html",scope:{title:"@",fieldWidth:"@",labelWidth:"@",minDate:"=",maxDate:"=",hideHover:"=",time:"=",noMargin:"@",color:"@",endDate:"=",startDate:"=",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element){function bootstrap(){scope.time?(scope.startDateHour=moment(scope.startDate).hours(),scope.startDateMinute=moment(scope.startDate).minutes(),scope.endDateHour=moment(scope.endDate).hours(),scope.endDateMinute=moment(scope.endDate).minutes()):(scope.startDateHour=0,scope.startDateMinute=0,scope.startDate.hours(0),scope.startDate.minutes(0),scope.startDate.seconds(0),scope.startDate.millisecond(0),scope.endDateHour=0,scope.endDateMinut=0,scope.endDate.hours(23),scope.endDate.minutes(59),scope.endDate.seconds(59),scope.endDate.millisecond(999)),scope.month=angular.copy(moment(scope.startDate));var start=angular.copy(moment(scope.startDate));_removeTimeWithDate(start.date(0)),_buildMonth(scope,start,scope.month)}function _removeTime(date){return moment(date).hour(0).minute(0).second(0).millisecond(0)}function _removeTimeWithDate(date){return date.day(0).hour(0).minute(0).second(0).millisecond(0)}function _buildMonth(scope,start,month){var done=!(scope.weeks=[]),date=start.clone().startOf("week").isoWeekday(1),monthIndex=date.month(),count=0;for(date.add(1,"w");!done;)scope.weeks.push({days:_buildWeek(date.clone(),month)}),date.add(1,"w"),done=2<count++&&monthIndex!==date.month(),monthIndex=date.month()}function _buildWeek(date,month){for(var days=[],i=0;i<7;i++){var day={name:date.format("dd"),number:date.date(),isCurrentMonth:date.month()===month.month(),isToday:date.isSame(new Date,"day"),isWeekday:0==date.weekday()||6==date.weekday(),date:date};scope.minDate&&(day.isDisabled=date.isBefore(moment(scope.minDate))),scope.maxDate&&(day.isDisabled=date.isAfter(moment(scope.maxDate))),scope.minDate&&scope.maxDate&&(day.isDisabled=!date.isBetween(moment(scope.minDate),moment(scope.maxDate))),days.push(day),(date=date.clone()).add(1,"d")}return days}scope.selectStart=!0,scope.popupText=gettextCatalog.getString("Select start date",null,"Nice"),scope.hours=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],scope.minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],scope.startDate||(scope.startDate=moment().minutes(0).second(0).millisecond(0)),scope.endDate||(scope.endDate=moment().minutes(0).second(0).millisecond(0)),scope.$watch("startDate",function(value,valueOld){bootstrap()}),scope.$watch("endDate",function(value,valueOld){bootstrap()}),scope.$watch("minDate",function(value,valueOld){bootstrap()}),scope.$watch("maxDate",function(value,valueOld){bootstrap()}),bootstrap(),scope.select=function(selectedDate){selectedDate.isDisabled||(selectedDate=angular.copy(selectedDate.date),scope.selectStart?(scope.time?(selectedDate.hours(scope.startDateHour),selectedDate.minutes(scope.startDateMinute)):(selectedDate.hours(0),selectedDate.minutes(0),selectedDate.seconds(0),selectedDate.millisecond(0)),scope.startDate=selectedDate,scope.selectStart=!1,scope.popupText=gettextCatalog.getString("Select end date",null,"Nice"),scope.formCalendar.$setDirty(),scope.displayStartChange(),scope.startDate.isAfter(scope.endDate)&&(scope.endDate=angular.copy(scope.startDate))):(scope.time?(selectedDate.hours(scope.endDateHour),selectedDate.minutes(scope.endDateMinute)):(selectedDate.hours(23),selectedDate.minutes(59),selectedDate.seconds(59),selectedDate.millisecond(999)),scope.endDate=selectedDate,scope.selectStart=!0,scope.popupText=gettextCatalog.getString("Select start date",null,"Nice"),scope.formCalendar.$setDirty(),scope.displayEndChange(),scope.endDate.isBefore(scope.startDate)&&(scope.startDate=angular.copy(scope.endDate))),scope.onChange&&scope.onChange({model:{startDate:scope.startDate,endDate:scope.endDate},element:element}))},scope.displayStartChange=function(){scope.startTimeClass="change",$timeout(function(){scope.startTimeClass=""},1e3)},scope.displayEndChange=function(){scope.endTimeClass="change",$timeout(function(){scope.endTimeClass=""},1e3)},scope.startHourChange=function(value){scope.startDateHour=value,scope.startDate=moment(scope.startDate).hours(scope.startDateHour),scope.formCalendar.$setDirty(),scope.displayStartChange(),scope.handleUpdate()},scope.startMinuteChange=function(value){scope.startDateMinute=value,scope.startDate=moment(scope.startDate).minutes(scope.startDateMinute),scope.formCalendar.$setDirty(),scope.displayStartChange(),scope.handleUpdate()},scope.endHourChange=function(value){scope.endDateHour=value,scope.endDate=moment(scope.endDate).hours(scope.endDateHour),scope.formCalendar.$setDirty(),scope.displayEndChange(),scope.handleUpdate()},scope.endMinuteChange=function(value){scope.endDateMinute=value,scope.endDate=moment(scope.endDate).minutes(scope.endDateMinute),scope.formCalendar.$setDirty(),scope.displayEndChange(),scope.handleUpdate()},scope.handleUpdate=function(){scope.onChange&&scope.onChange({model:{startDate:scope.startDate,endDate:scope.endDate},element:element})},scope.next=function(){var next=angular.copy(scope.month);_removeTimeWithDate(next.month(next.month()+1).date(0)),scope.month.month(scope.month.month()+1),_buildMonth(scope,next,scope.month)},scope.previous=function(){var previous=angular.copy(scope.month);_removeTimeWithDate(previous.month(previous.month()-1).date(0)),scope.month.month(scope.month.month()-1),_buildMonth(scope,previous,scope.month)},scope.isSameDay=function(d1,d2){d1=_removeTime(angular.copy(d1)),d2=_removeTime(angular.copy(d2));return d1.isSame(d2)},scope.isBetweenRange=function(date){return date.isBefore(moment(scope.endDate))&&date.isAfter(moment(scope.startDate))},scope.formatDate=function(date){return scope.time?moment(date).format("D.M.YYYY • H:mm"):moment(date).format("D.M.YYYY")},scope.lighten=function(b){var usePound=!1;"#"==b[0]&&(b=b.slice(1),usePound=!0);var g=parseInt(b,16),r=20+(g>>16);255<r?r=255:r<0&&(r=0);b=20+(g>>8&255);255<b?b=255:b<0&&(b=0);g=20+(255&g);return 255<g?g=255:g<0&&(g=0),(usePound?"#":"")+(g|b<<8|r<<16).toString(16)}}}}),angular.module("niceElements").directive("niceCheckbox",function(){return{templateUrl:"src/components/nice-checkbox/nice-checkbox.html",restrict:"E",scope:{model:"=",title:"@",noMargin:"@",onChange:"&?"},controller:function($scope){void 0===$scope.model&&($scope.model=!1),$scope.toggle=function(){$scope.model=!$scope.model,$scope.onChange&&$scope.onChange({model:$scope.model})}}}}),angular.module("niceElements").directive("niceChoice",function(){return{transclude:!0,templateUrl:"src/components/nice-choice/nice-choice.html",restrict:"E",scope:{title:"@",model:"=",list:"=",isDisabled:"=",fieldWidth:"@",labelWidth:"@",listIsObj:"@",selectedIsObj:"@",objValue:"@",objKey:"@",noMargin:"@",multiple:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element,obj){obj.title||(obj.title=""),obj.fieldWidth||(obj.fieldWidth="col-sm-8"),obj.labelWidth||(obj.labelWidth="col-sm-4"),obj.listIsObj=angular.isDefined(obj.listIsObj),obj.selectedIsObj=angular.isDefined(obj.selectedIsObj),obj.objValue||(obj.objValue="value"),obj.objKey||(obj.objKey="id"),obj.multiple=angular.isDefined(obj.multiple),scope.firstTime=!0,scope.checkIfFirstTime=function(){return!!scope.firstTime&&!(scope.firstTime=!1)},angular.isDefined(scope.model)||scope.multiple&&(scope.model=[]),scope.listIsObj?scope.internalList=scope.list:scope.internalList=_.map(scope.list,function(val){var obj={};return obj[scope.objKey]=val,obj[scope.objValue]=val,obj}),scope.selectedIsObj?scope.internalSelected=scope.model:scope.multiple?scope.internalSelected=_.map(scope.model,function(val){var obj={};return obj[scope.objKey]=val,obj[scope.objValue]=val,obj}):scope.model?((obj={})[scope.objKey]=scope.model,obj[scope.objValue]=scope.model,scope.internalSelected=obj):scope.internalSelected=scope.internalList[0]},controller:function($rootScope,$scope){function getFilter(item){var filter={};return item.hasOwnProperty($scope.objKey)?filter[$scope.objKey]=item[$scope.objKey]:filter[$scope.objKey]=item,filter}$scope.setDefault=function(){$scope.multiple||($scope.internalSelected=$scope.internalList[0])},$scope.isItemSelected=function(item){return!!$scope.internalSelected&&($scope.multiple?0<_.where($scope.internalSelected,getFilter(item)).length:$scope.internalSelected[$scope.objKey]==item[$scope.objKey])},$scope.toggle=function(item){$scope.isDisabled||($scope.formChoice.$setDirty(),$scope.multiple?$scope.isItemSelected(item)?$scope.internalSelected=_.without($scope.internalSelected,_.findWhere($scope.internalSelected,getFilter(item))):$scope.internalSelected.push(item):$scope.internalSelected=item)},$scope.getLabel=function(item){return item[$scope.objValue]},$scope.$watchCollection("list",function(value_new,value_old){$scope.listIsObj?$scope.internalList=$scope.list:$scope.internalList=_.map($scope.list,function(val){var obj={};return obj[$scope.objKey]=val,obj[$scope.objValue]=val,obj})}),$scope.$watchCollection("internalSelected",function(value_new,value_old){!value_new||angular.equals(value_new,value_old)&&!$scope.checkIfFirstTime()||($scope.selectedIsObj?$scope.model=value_new:$scope.multiple?$scope.model=_.map(value_new,$scope.objKey):$scope.model=value_new[$scope.objKey],$scope.onChange&&$scope.onChange({model:$scope.model}))}),$scope.$watchCollection("model",function(value_new,value_old){angular.equals(value_new,value_old)||(value_new?$scope.selectedIsObj?$scope.internalSelected=value_new:$scope.multiple?$scope.internalSelected=_.map(value_new,function(item){return _.find($scope.internalList,getFilter(item))}):$scope.internalSelected=_.find($scope.internalList,getFilter(value_new)):$scope.multiple?$scope.internalSelected=[]:$scope.internalSelected=$scope.internalList[0]),value_new||$scope.multiple||($scope.internalSelected=$scope.internalList[0])})}}}),angular.module("niceElements").directive("clickOutside",function($document,$parse,$timeout){return{restrict:"A",link:function($scope,elem,attr){$scope.isOpen=!1,attr.$observe("isOpen",function(value){$scope.isOpen="true"==value}),$timeout(function(){var classList=void 0!==attr.outsideIfNot?attr.outsideIfNot.split(/[ ,]+/):[];function eventHandler(e){var i,element,r,id,classNames,l;if($scope.isOpen&&(e&&e.target)){for(element=e.target;element;element=element.parentNode){if(element===elem[0])return;if(id=element.id,classNames=element.className,l=classList.length,(classNames=classNames&&void 0!==classNames.baseVal?classNames.baseVal:classNames)||id)for(i=0;i<l;i++)if(r=new RegExp("\\b"+classList[i]+"\\b"),void 0!==id&&id===classList[i]||classNames&&r.test(classNames))return}$timeout(function(){$parse(attr.clickOutside)($scope,{event:e})})}}function _hasTouch(){return"ontouchstart"in window||navigator.maxTouchPoints}_hasTouch()&&$document.on("touchstart",eventHandler),$document.on("click",eventHandler),$scope.$on("$destroy",function(){_hasTouch()&&$document.off("touchstart",eventHandler),$document.off("click",eventHandler)})})}}}),angular.module("niceElements").directive("niceComment",function($timeout){return{templateUrl:"src/components/nice-comment/nice-comment.html",restrict:"E",scope:{model:"=",title:"@?",placeholder:"@",noTextLabel:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",help:"@",isInline:"=",rows:"@"},link:function(scope,element,attrs){null==scope.model&&(scope.model=""),attrs.placeholder||(attrs.placeholder=""),attrs.noTextLabel||angular.isDefined(attrs.noTextLabel),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.help||(attrs.help=""),attrs.rows||(attrs.rows=1);var textareas=element.find("textarea");function autosize(){var el=textareas[0];$timeout(function(){el.style.cssText="height:auto; padding:0",el.style.cssText="-moz-box-sizing:content-box",el.style.cssText="height:"+(el.scrollHeight+2)+"px"})}scope.edit=function(){scope.editing=!0,$timeout(function(){textareas[0].focus()})},textareas[0].addEventListener("keydown",autosize),autosize()},controller:function($scope){$scope.editing=!1,$scope.save=function(){$scope.editing=!1}}}}),angular.module("niceElements").directive("niceDateRange",function(){return{restrict:"E",transclude:!0,templateUrl:"src/components/nice-date-range/nice-date-range.html",scope:{model:"=",title:"@",fieldWidth:"@",format:"@",min:"@",max:"@",noMargin:"@",labelWidth:"@",startOfTheYear:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,model){model.title||(model.title=""),model.fieldWidth||(model.fieldWidth="col-sm-8"),model.labelWidth||(model.labelWidth="col-sm-4"),model.format||(model.format="dd.MM.yyyy"),model.noMargin=angular.isDefined(model.noMargin),angular.isDefined(scope.model)||(model=null,model=angular.isDefined(scope.startOfTheYear)?{startDate:moment([moment().year()]).format(),endDate:moment().format()}:{startDate:moment().format(),endDate:moment().format()},scope.model=model,scope.onChange&&scope.onChange(scope.model))},controller:function($scope){$scope.opts={locale:{applyClass:"btn-green",firstDay:1},ranges:{},min:$scope.min,max:$scope.max},$scope.opts.ranges[gettextCatalog.getString("Today",null,"Nice")]=[moment(),moment()],$scope.opts.ranges[gettextCatalog.getString("Last 7 days",null,"Nice")]=[moment().subtract(7,"days"),moment()],$scope.opts.ranges[gettextCatalog.getString("Last 30 days",null,"Nice")]=[moment().subtract(30,"days"),moment()],$scope.opts.ranges[gettextCatalog.getString("This month",null,"Nice")]=[moment().startOf("month"),moment().endOf("month")],angular.isDefined($scope.format)&&($scope.opts.format=format)}}}),angular.module("niceElements").directive("niceDate",function(){return{restrict:"E",replace:!0,transclude:!0,templateUrl:"src/components/nice-date/nice-date.html",scope:{title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",model:"=",time:"@",help:"@",inline:"@",maxDate:"=",minDate:"=",nextDate:"=",isDisabled:"=",isInline:"=",onChange:"&?"},controller:function($scope,$element,$timeout,gettextCatalog){$scope.isOpen=!1,$scope.hours=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],$scope.minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],$scope.translations={nextMonth:gettextCatalog.getString("Next month",null,"Nice"),prevMonth:gettextCatalog.getString("Previous month",null,"Nice")},$scope.innerDate={month:0,year:0,minute:0,hour:0,date:moment(),value:""},$scope.days=[],$scope.weekdays=[gettextCatalog.getString("Mon",null,"Nice"),gettextCatalog.getString("Tue",null,"Nice"),gettextCatalog.getString("Wed",null,"Nice"),gettextCatalog.getString("Thu",null,"Nice"),gettextCatalog.getString("Fri",null,"Nice"),gettextCatalog.getString("Sat",null,"Nice"),gettextCatalog.getString("Sun",null,"Nice")],$scope.years=[];for(var year=moment().year()-100,i=0;i<200;i++)$scope.years.push(year+i);$scope.months=[{value:0,name:gettextCatalog.getString("January",null,"Nice")},{value:1,name:gettextCatalog.getString("February",null,"Nice")},{value:2,name:gettextCatalog.getString("March",null,"Nice")},{value:3,name:gettextCatalog.getString("April",null,"Nice")},{value:4,name:gettextCatalog.getString("May",null,"Nice")},{value:5,name:gettextCatalog.getString("June",null,"Nice")},{value:6,name:gettextCatalog.getString("July",null,"Nice")},{value:7,name:gettextCatalog.getString("August",null,"Nice")},{value:8,name:gettextCatalog.getString("September",null,"Nice")},{value:9,name:gettextCatalog.getString("October",null,"Nice")},{value:10,name:gettextCatalog.getString("November",null,"Nice")},{value:11,name:gettextCatalog.getString("December",null,"Nice")}],$scope.model||($scope.model=moment()),$scope.time?$scope.time="true"==$scope.time:$scope.time=!1,$scope.maxDate&&($scope.maxDate=moment($scope.maxDate)),$scope.minDate&&($scope.minDate=moment($scope.minDate)),$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("nice-date-button")[0],tooltip=$element[0].getElementsByClassName("nice-date-dropdown-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,5]}}]})},$timeout(function(){$scope.isInline||$scope.setupPopper()}),$scope.timeChange=function(){var selectedDate=angular.copy($scope.model);(selectedDate=$scope._removeTime(selectedDate)).hours($scope.innerDate.hour),selectedDate.minutes($scope.innerDate.minute),$scope.innerDate.value=$scope.formatDate(selectedDate),$scope.model=selectedDate,$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.forma.$setDirty()},$scope.select=function(selectedDate){selectedDate.isDisabled||((selectedDate=angular.copy(selectedDate.date)).hours($scope.innerDate.hour),selectedDate.minutes($scope.innerDate.minute),$scope.model=selectedDate,$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.forma.$setDirty())},$scope.handleDateChange=function(){$scope.innerDate.date.year($scope.innerDate.year),$scope.innerDate.date.month($scope.innerDate.month),$scope._buildMonth()},$scope.setInnerDate=function(date){$scope.innerDate.year=date.year(),$scope.innerDate.month=date.month(),$scope.innerDate.date=date},$scope.today=function(){$scope.setInnerDate(moment()),$scope._buildMonth()},$scope.next=function(){$scope.innerDate.date.add(1,"month"),$scope.setInnerDate($scope.innerDate.date),$scope._buildMonth()},$scope.previous=function(){$scope.innerDate.date.subtract(1,"month"),$scope.setInnerDate($scope.innerDate.date),$scope._buildMonth()},$scope.isSameDay=function(date1,date2){return date1=moment(date1),date2=moment(date2),date1.date()==date2.date()&&date1.month()==date2.month()&&date1.year()==date2.year()},$scope.isSameMonth=function(date1,date2){return date1=moment(date1),date2=moment(date2),date1.month()==date2.month()&&date1.year()==date2.year()},$scope.isBetween=function(date1,date2,date3){return!!$scope.nextDate&&(!(!$scope.isSameDay(date1,date2)&&!$scope.isSameDay(date1,date3))||(date2.isBefore(date3)?$scope._removeTime(date1).isBetween(date2,date3):$scope._removeTime(date1).isBetween(date3,date2)))},$scope.formatDate=function(date){return $scope.time?date.format("D.M.YYYY • H:mm"):date.format("D.M.YYYY")},$scope._removeTime=function(date){return date.hour(0).minute(0).second(0).millisecond(0)},$scope._removeTimeWithDate=function(date){return date.date(0).hour(0).minute(0).second(0).millisecond(0)},$scope._buildMonth=function(){var done=!1,date=angular.copy($scope.innerDate.date).date(0).startOf("week").isoWeekday(1),monthIndex=date.month(),count=0;for(date.add(1,"w"),$scope.weeks=[];!done;)$scope.weeks.push({days:$scope._buildWeek(date.clone())}),date.add(1,"w"),done=2<count++&&monthIndex!==date.month(),monthIndex=date.month()},$scope._buildWeek=function(date){for(var days=[],i=0;i<7;i++){var day={name:date.format("dd"),number:date.date(),isCurrentMonth:$scope.isSameMonth(date,$scope.innerDate.date),isToday:date.isSame(new Date,"day"),isWeekday:6==date.weekday()||0==date.weekday(),value:date.format("D.M.YYYY"),date:date};$scope.minDate&&(day.isDisabled=date.isBefore($scope.minDate)),$scope.maxDate&&(day.isDisabled=date.isAfter($scope.maxDate)),$scope.minDate&&$scope.maxDate&&(day.isDisabled=!date.isBetween($scope.minDate,$scope.maxDate)),days.push(day),(date=date.clone()).add(1,"d")}return days},$scope.$watchGroup(["model","minDate","maxDate","nextDate"],function(value){$scope.boostrap()}),$scope.getTime=function(){$scope.time?($scope.innerDate.hour=moment($scope.model).hours(),$scope.innerDate.minute=moment($scope.model).minutes()):($scope.innerDate.hour=0,$scope.innerDate.minute=0),$scope.innerDate.value=$scope.formatDate($scope.innerDate.date)},$scope.boostrap=function(){$scope.setInnerDate(moment($scope.model)),$scope.getTime(),$scope.time||($scope.model=$scope._removeTime($scope.model)),$scope.innerDate.value=$scope.formatDate(moment($scope.model)),$scope._buildMonth()},$scope.boostrap(),$scope.toggleOpen=function(){$scope.isDisabled||($scope.isOpen=!$scope.isOpen,$timeout(function(){$scope.popper&&$scope.popper.update()}))}}}}),angular.module("niceElements").directive("niceDatetimePicker",function(){return{restrict:"E",transclude:!1,templateUrl:"src/components/nice-datetime-picker/nice-datetime-picker.html",scope:{model:"=",format:"@",date:"@",time:"@",width:"@",enableOkButtons:"@",lang:"@",minDate:"@",maxDate:"@",weekStart:"@",okText:"@",cancelText:"@",shortTime:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},controller:function($scope,gettextCatalog){$scope.date="true"==$scope.date||1==$scope.date,$scope.time="true"==$scope.time||1==$scope.time,"true"===$scope.noMargin||$scope.noMargin,"true"===$scope.enableOkButtons||$scope.enableOkButtons,$scope.lang=$scope.lang||"en",$scope.okText=$scope.okText||gettextCatalog.getString("OK",null,"Nice"),$scope.cancelText=$scope.cancelText||gettextCatalog.getString("Cancel",null,"Nice"),$scope.weekStart=parseInt($scope.weekStart)||1,$scope.width=parseInt($scope.width)||300,$scope.isOpen=!1,$scope.internalDate=moment($scope.model)||moment(),$scope.format||($scope.date&&!$scope.time?$scope.format="D.M.YYYY":!$scope.date&&$scope.time?$scope.format="HH:mm":$scope.format="D.M.YYYY • H:mm"),$scope.openDtp=function(){$scope.isDisabled||($scope.isOpen=!0,$scope.$broadcast("dtp-open-click"))},$scope.closeDtp=function(response){$scope.isOpen=!1,$scope.$broadcast("dtp-close-click")},$scope.$on("dateSelected",function(){$scope.formDatetimePicker.$setDirty()}),$scope.$watch("internalDate",function(newDate){$scope.model=moment(newDate),$scope.value=moment(newDate).format($scope.format),$scope.onChange&&$scope.onChange({model:$scope.model})}),$scope.$watch("model",function(newModel,oldModel){$scope.value=moment(newModel).format($scope.format)})}}}),angular.module("niceElements").directive("niceDatetimerangePicker2",function(){return{scope:{startDate:"=",endDate:"=",formatString:"@",modelFormat:"@",time:"@",minDate:"@",maxDate:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},templateUrl:"src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html",controller:function($element,$scope){$scope.isOpen=!1,$scope.time?$scope.time="true"==$scope.time:$scope.time=!1,$scope.formatString||($scope.time?$scope.formatString="D.M.YYYY • H:mm":$scope.formatString="D.M.YYYY"),$scope.startDate?$scope.innerStartDate=angular.copy($scope.startDate):$scope.startDate=moment(),$scope.endDate?$scope.innerEndDate=angular.copy($scope.endDate):$scope.endDate=moment(),$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("nice-daterange-picker-button")[0],tooltip=$element[0].getElementsByClassName("nice-daterange-picker-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,5]}}]})},$scope.setupPopper(),$scope.format=function(){$scope.modelFormat=$scope.startDate.format($scope.formatString)+" - "+$scope.endDate.format($scope.formatString)},$scope.open=function(){$scope.isDisabled||($scope.isOpen=!0,$scope.popper.update())},$scope.close=function(){$scope.innerStartDate=angular.copy($scope.startDate),$scope.innerEndDate=angular.copy($scope.endDate),$scope.isOpen=!1},$scope.confirm=function(){$scope.startDate=angular.copy($scope.innerStartDate),$scope.endDate=angular.copy($scope.innerEndDate),$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.close()},$scope.selectToday=function(){$scope.innerStartDate=moment().startOf("day"),$scope.innerEndDate=moment().endOf("day")},$scope.selectLastNDays=function(days){$scope.innerStartDate=moment().subtract(days,"days").startOf("day"),$scope.innerEndDate=moment().endOf("day")},$scope.selectLastMonth=function(){$scope.innerStartDate=moment().subtract(1,"months").startOf("month").startOf("date"),$scope.innerEndDate=moment().subtract(1,"months").endOf("month").endOf("date")},$scope.selectThisMonth=function(){$scope.innerStartDate=moment().startOf("month").startOf("date"),$scope.innerEndDate=moment().endOf("month").endOf("date")},$scope._removeTime=function(date){return date.hour(0).minute(0).second(0).millisecond(0)},$scope.$watchGroup(["innerStartDate","innerEndDate"],function(newValues){var temp;newValues[0]&&newValues[1]&&($scope.innerStartDate.isAfter($scope.innerEndDate)&&(temp=angular.copy($scope.innerStartDate),$scope.innerStartDate=angular.copy($scope.innerEndDate),$scope.innerEndDate=temp),$scope.innerEndDate.isBefore($scope.innerStartDate)&&(temp=angular.copy($scope.innerStartDate),$scope.innerStartDate=angular.copy($scope.innerEndDate),$scope.innerEndDate=temp))}),$scope.$watchGroup(["startDate","endDate"],function(){$scope.innerStartDate=angular.copy($scope.startDate),$scope.innerEndDate=angular.copy($scope.endDate),$scope.format()})}}}),angular.module("niceElements").directive("niceDatetimerangePicker",function(gettextCatalog){return{scope:{modelStart:"=",modelEnd:"=",format:"@",modelFormat:"@",date:"@",time:"@",width:"@",enableOkButtons:"@",lang:"@",minDate:"@",maxDate:"@",weekStart:"@",okText:"@",cancelText:"@",shortTime:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",formatOutput:"@",isDisabled:"=",help:"@",isInline:"=",onChange:"&?"},templateUrl:"src/components/nice-datetimerange-picker/nice-datetimerange-picker.html",link:{pre:function($scope){var params={title:"",noMargin:!1,fieldWidth:"col-sm-8",labelWidth:"col-sm-4",format:"D.M.YYYY • H:mm",modelFormat:"YYYY-MM-DDTHH:mm:ss.SSS",minDate:null,maxDate:null,lang:"en",weekStart:1,shortTime:!1,cancelText:gettextCatalog.getString("Cancel",null,"Nice"),okText:gettextCatalog.getString("OK",null,"Nice"),date:!0,time:!1,width:300,enableOkButtons:!1};void 0===$scope.formatOutput&&($scope.formatOutput=!1);function setLabelValue(){var _from=moment($scope.internalStart).format(params.format),_to=moment($scope.internalEnd).format(params.format);$scope.value=_from+" - "+_to}function initCurrentDates(){var _end,_time,i_hour,i_min,hours,minutes;void 0===$scope.modelStart||null===$scope.modelStart?(_end=moment().subtract(1,"days"),$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelStart=_end):!params.date&¶ms.time?(_time=moment(),i_hour=params.modelFormat.indexOf("HH:mm"),i_min=params.modelFormat.indexOf("mm"),hours=$scope.model.substring(i_hour,i_hour+2),minutes=$scope.model.substring(i_min,i_min+2),-1<i_hour&&-1<i_min?(_time.hours(hours),_time.minutes(minutes)):console.error("Cannot parse current time model with passed modelFilter. Please check if you missed modelFilter setting in directive.. Falling back to current time instead."),$scope.dateStart=_time):$scope.dateStart=moment($scope.modelStart),void 0===$scope.modelEnd||null===$scope.modelEnd?(_end=moment(),$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelEnd=_end):!params.date&¶ms.time?(_time=moment(),i_hour=params.modelFormat.indexOf("HH:mm"),i_min=params.modelFormat.indexOf("mm"),hours=$scope.model.substring(i_hour,i_hour+2),minutes=$scope.model.substring(i_min,i_min+2),-1<i_hour&&-1<i_min?(_time.hours(hours),_time.minutes(minutes)):console.error("Cannot parse current time model with passed modelFilter. Please check if you missed modelFilter setting in directive.. Falling back to current time instead."),$scope.dateEnd=_time):$scope.dateEnd=moment($scope.modelEnd),$scope.dateStart>$scope.dateEnd&&($scope.dateEnd=moment($scope.dateStart))}params.date="true"===$scope.date,params.time="true"===$scope.time,$scope.format&&""!=$scope.format&&(params.format=$scope.format),$scope.enableOkButtons&&(params.enableOkButtons="true"===$scope.enableOkButtons),$scope.lang&&(params.lang=$scope.lang),$scope.minDate&&(params.minDate=$scope.minDate),$scope.maxDate&&(params.maxDate=$scope.maxDate),$scope.weekStart&&(params.weekStart=parseInt($scope.weekStart)),$scope.okText&&(params.okText=$scope.okText),$scope.cancelText&&(params.cancelText=$scope.cancelText),$scope.noMargin&&(params.noMargin="true"===$scope.noMargin),$scope.modelFormat&&(params.modelFormat=$scope.modelFormat),$scope.date=params.date,$scope.time=params.time,($scope=angular.extend($scope,params)).openDtpRange=function(){$scope.isDisabled||(initCurrentDates(),$scope.showDtpRange=!0)},$scope.okClick=function(){setLabelValue();var _end=moment($scope.internalStart,params.modelFormat);$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelStart=_end;_end=moment($scope.internalEnd,params.modelFormat);$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.modelEnd=_end,$scope.showDtpRange=!1,$scope.onChange&&$scope.onChange({modelStart:$scope.modelStart,modelEnd:$scope.modelEnd})},$scope.cancelClick=function(){$scope.showDtpRange=!1;var _start=moment($scope.modelStart);$scope.formatOutput&&(_start=_start.format(params.modelFormat));var _end=moment($scope.modelEnd);$scope.formatOutput&&(_end=_end.format(params.modelFormat)),$scope.internalStart=_start,$scope.internalEnd=_end,setLabelValue()},$scope.selectLastNDays=function(days){$scope.dateStart=moment().subtract(days,"days"),$scope.dateEnd=moment(),$scope.internalStart=$scope.dateStart,$scope.internalEnd=$scope.dateEnd,setLabelValue()},$scope.selectLastMonth=function(){$scope.dateStart=moment().subtract(1,"months"),$scope.dateEnd=moment(),$scope.internalStart=$scope.dateStart,$scope.internalEnd=$scope.dateEnd,setLabelValue()},$scope.selectThisMonth=function(){$scope.dateStart=moment().date(1).hours(0).minutes(0).seconds(0).milliseconds(0),$scope.dateEnd=moment().endOf("month"),$scope.internalStart=$scope.dateStart,$scope.internalEnd=$scope.dateEnd,setLabelValue()},$scope.$watchGroup(["dateStart","dateEnd"],function(newValues){$scope.internalStart=moment(newValues[0]),$scope.internalEnd=moment(newValues[1]),setLabelValue()}),$scope.$watchGroup(["modelStart","modelEnd"],function(){initCurrentDates()})}}}}),angular.module("niceElements").directive("niceDropdownDate",function(gettextCatalog){return{restrict:"E",replace:!0,templateUrl:"src/components/nice-dropdown-date/nice-dropdown-date.html",scope:{model:"=",title:"@",fieldWidth:"@",labelWidth:"@",noMargin:"@",isDisabled:"=",numYears:"@",startingYear:"@",mature:"@",help:"@",isInline:"=",onChange:"&?"},link:function($scope){$scope.days=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],$scope.months=[{value:0,name:gettextCatalog.getString("Jan",null,"Nice")},{value:1,name:gettextCatalog.getString("Feb",null,"Nice")},{value:2,name:gettextCatalog.getString("Mar",null,"Nice")},{value:3,name:gettextCatalog.getString("Apr",null,"Nice")},{value:4,name:gettextCatalog.getString("May",null,"Nice")},{value:5,name:gettextCatalog.getString("Jun",null,"Nice")},{value:6,name:gettextCatalog.getString("Jul",null,"Nice")},{value:7,name:gettextCatalog.getString("Aug",null,"Nice")},{value:8,name:gettextCatalog.getString("Sep",null,"Nice")},{value:9,name:gettextCatalog.getString("Oct",null,"Nice")},{value:10,name:gettextCatalog.getString("Nov",null,"Nice")},{value:11,name:gettextCatalog.getString("Dec",null,"Nice")}];var currentYear=parseInt($scope.startingYear,10)||(new Date).getFullYear(),oldestYear=currentYear-(parseInt($scope.numYears,10)||100),newestYear=currentYear;$scope.mature&&(newestYear-=17),$scope.years=[];for(var date,i=currentYear;oldestYear<=i;i--)i<=newestYear&&$scope.years.push(i);$scope.dateFields={},$scope.$watch("model",function(date,oldDate){date&&date!=oldDate&&(date=moment(date),$scope.dateFields.day=date.get("date"),$scope.dateFields.month=date.get("month"),$scope.dateFields.year=date.get("year"),$scope.checkDate())}),$scope.checkDate=function(){var date=moment($scope.dateFields.day+"."+($scope.dateFields.month+1)+"."+$scope.dateFields.year,"D.M.YYYY");if(date.isValid()){for($scope.model=date.format(),$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.days=[],i=1;i<=date.daysInMonth();i++)$scope.days.push(i);$scope.dropdownDateForm.$setValidity("validDate",!0),$scope.dropdownDateForm.$setDirty()}else $scope.dropdownDateForm.$setValidity("validDate",!1)},$scope.model?(date=moment($scope.model),$scope.dateFields.day=date.get("date"),$scope.dateFields.month=date.get("month"),$scope.dateFields.year=date.get("year")):(date=moment(),$scope.dateFields.day=date.get("date"),$scope.dateFields.month=date.get("month"),$scope.dateFields.year=date.get("year"),$scope.mature&&($scope.dateFields.year-=18)),$scope.checkDate()}}}),angular.module("niceElements").directive("niceDropdownOld",function(){return{templateUrl:"src/components/nice-dropdown-old/nice-dropdown-old.html",restrict:"E",transclude:!0,scope:{title:"@",model:"=",list:"=",isDisabled:"=",fieldWidth:"@",labelWidth:"@",addButtonEnable:"=",addButtonFunction:"&",objValue:"@",objKey:"@?",selectedIsObj:"@",nullable:"@",required:"@",showTax:"@",noMargin:"@",multiple:"@",help:"@",listenKeydown:"@",noOptionsText:"@",isInline:"=",onChange:"&?"},controller:function($scope,$element,gettextCatalog){$scope.objValue||($scope.objValue="value"),$scope.objKey||($scope.objKey="id"),$scope.list||($scope.list=[]),$scope.noOptionsText||($scope.noOptionsText=gettextCatalog.getString("No options",null,"Nice")),$scope.addButtonFunction||($scope.addButtonFunction=null),$scope.listenKeydown||($scope.listenKeydown=!1),$scope.valid=$scope.formDropdown,$scope.selectedIsObj="true"===$scope.selectedIsObj||!0===$scope.selectedIsObj,$scope.nullable="true"===$scope.nullable||!0===$scope.nullable,$scope.required="true"===$scope.required||!0===$scope.required,$scope.showTax="true"===$scope.showTax||!0===$scope.showTax,$scope.noMargin="true"===$scope.noMargin||!0===$scope.noMargin,$scope.multiple="true"===$scope.multiple||!0===$scope.multiple,$scope.internalSelected=null,$scope.id=Math.random().toString(36).substring(7),$scope.isOpen=!1,$scope.toggle=function(){$scope.isOpen=!$scope.isOpen},$scope.close=function(){$scope.isOpen=!1},$scope.open=function(){$scope.isOpen=!0};function getFilter(item){var filter={};return item.hasOwnProperty($scope.objKey)?filter[$scope.objKey]=item[$scope.objKey]:filter[$scope.objKey]=item,filter}function _get_selected_object(selected){return selected?$scope.selectedIsObj?selected:_.find($scope.internalList,getFilter(selected)):null}function _set_internal_selected_one(selected){var obj={},selectedObj=_get_selected_object(selected),obj=selectedObj&&_.find($scope.internalList,getFilter(selected))?selectedObj:$scope.internalList[0];$scope.internalSelected=obj,_set_model(obj)}function _get_selected_objects(selected){return selected?$scope.selectedIsObj?selected:_.map(selected,function(val){return _.find($scope.internalList,getFilter(val))}):null}function _set_internal_selected_multiple(_selected_objects){_selected_objects=_get_selected_objects(_selected_objects),$scope.internalSelected=_selected_objects||[],_set_model($scope.internalSelected)}function init(){var sel;$scope.internalList=angular.copy($scope.list),$scope.nullable&&!$scope.multiple&&((sel={})[$scope.objKey]=null,sel[$scope.objValue]="-",$scope.internalList=[sel].concat($scope.internalList)),$scope.multiple&&$scope.model&&($scope.internalSelected?_set_internal_selected_multiple(_.filter($scope.internalSelected,function(obj){return _.find($scope.internalList,getFilter(obj))})):$scope.internalSelected=[]),$scope.internalList&&0<$scope.internalList.length?($scope.emptyList=!1,($scope.multiple?_set_internal_selected_multiple:_set_internal_selected_one)($scope.model),$scope.formDropdown&&$scope.required&&$scope.formDropdown.$setValidity("required",!0)):($scope.emptyList=!0,(sel={})[$scope.objKey]=null,sel[$scope.objValue]=$scope.noOptionsText,$scope.internalList=[sel],$scope.formDropdown&&$scope.required&&$scope.formDropdown.$setValidity("required",!1),$scope.multiple?_set_internal_selected_multiple(sel):_set_internal_selected_one([sel]))}var _set_model=function(value){var _new=angular.copy($scope.model),_new=$scope.multiple?$scope.selectedIsObj?value:_.map(value,function(val){return val[$scope.objKey]}):null==value[$scope.objKey]?null:$scope.selectedIsObj?value:value[$scope.objKey];_.isEqual(_new,$scope.model)||($scope.model=_new,$scope.onChange&&$scope.onChange({model:$scope.model}))};$scope.isItemSelected=function(item){return!!$scope.internalSelected&&($scope.multiple?0<_.where($scope.internalSelected,{id:item.id}).length:$scope.internalSelected[$scope.objKey]==item[$scope.objKey])},$scope.clicked=function(item){var _current;$scope.formDropdown.$setDirty(),$scope.multiple?(_current=angular.copy($scope.internalSelected),_.find(_current,getFilter(item))?_current=_.reject(_current,getFilter(item[$scope.objKey])):_current.push(item),_set_internal_selected_multiple(_current)):(_set_internal_selected_one(item),$scope.close())},$scope.getLabel=function(item){return item?item[$scope.objValue]:"-"},$scope.$watch("list",function(value_new,value_old){init()}),$scope.$watch("model",function(_new_model_object,value_old){_new_model_object=($scope.multiple?_get_selected_object:_get_selected_objects)(_new_model_object),_.isEqual(_new_model_object,$scope.internalSelected)||init()}),$scope.bindKeypress=function(){$scope.listenKeydown&&$element.bind("keyup",function(e){var char;$scope.isOpen&&(char=String.fromCharCode(e.which).toLowerCase(),_.findIndex($scope.internalList,function(item){return 0===item[$scope.objValue].toLowerCase().indexOf(char)}))})},$scope.unbindKeypress=function(){$element.off("keyup",function(e){})}}}}),angular.module("niceElements").directive("niceDropdown",function($window){return{templateUrl:"src/components/nice-dropdown/nice-dropdown.html",restrict:"E",transclude:{button:"?niceDropdownButton",option:"?niceDropdownOption"},scope:{title:"@",model:"=",list:"=",onChange:"&?",isDisabled:"=",fieldWidth:"@",labelWidth:"@",loading:"=?",addButtonFunction:"=?",objValue:"@",objKey:"@?",selectedIsKey:"@?",nullable:"@",required:"@",noMargin:"@",multiple:"@",help:"@",noOptionsText:"@",noDataText:"@",selectText:"@",searchText:"@",nullableText:"@",selectedText:"@",searchFunction:"=?",isInline:"=",clearOnSelect:"@"},controller:function($scope,$element,$timeout,gettextCatalog){$scope.objValue||($scope.objValue="value"),$scope.objKey||($scope.objKey="id"),$scope.noOptionsText||($scope.noOptionsText=gettextCatalog.getString("No options",null,"Nice")),$scope.noDataText||($scope.noDataText=gettextCatalog.getString("No options",null,"Nice")),$scope.searchText||($scope.searchText=gettextCatalog.getString("Search...",null,"Nice")),$scope.nullableText||($scope.nullableText=gettextCatalog.getString("None",null,"Nice")),$scope.selectText||($scope.selectText=gettextCatalog.getString("None",null,"Nice")),$scope.selectedText||($scope.selectedText=gettextCatalog.getString("selected",null,"Nice")),$scope.addButtonFunction||($scope.addButtonFunction=null),$scope.nullable="true"===$scope.nullable||!0===$scope.nullable,$scope.required="true"===$scope.required||!0===$scope.required,$scope.noMargin="true"===$scope.noMargin||!0===$scope.noMargin,$scope.multiple="true"===$scope.multiple||!0===$scope.multiple,$scope.clearOnSelect="true"===$scope.clearOnSelect||!0===$scope.clearOnSelect,$scope.valid=$scope.formDropdown,$scope.isOpen=!1,$scope.selected=null,$scope.selectedIndex=0,$scope.popper=null,$scope.internal={search:""},$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("btn-dropdown")[0],tooltip=$element[0].getElementsByClassName("nice-dropdown-menu-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",scroll:!0,resize:!0,modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state})=>{state.styles.popper.width=`${state.rects.reference.width}px`},effect:({state})=>{state.elements.popper.style.width=`${state.elements.reference.offsetWidth}px`}}]})},$scope.setupPopper(),$scope.toggle=function(){$scope.isOpen?$scope.close():$scope.open()},$scope.close=function(){$scope.isOpen=!1},$scope.open=function(){$scope.isOpen=!0,$timeout(function(){$scope.popper.update(),$scope.focusInput(),$scope.scrollToHover(!0)},100)},$scope.focusInput=function(){var input=$element[0].getElementsByTagName("input")[0];input&&$timeout(function(){input.focus()})},$scope.scrollToHover=function(notSmooth){var dorpdownList,topPos=$element[0].getElementsByClassName("nice-dropdown-menu")[0];!topPos||(topPos=(dorpdownList=topPos.getElementsByClassName("nice-dropdown-items")[0]).getElementsByClassName("hover")[0])&&(topPos=topPos.offsetTop,dorpdownList.scroll({top:topPos-120,left:0,behavior:notSmooth?"auto":"smooth"}))},$scope.handleSearch=function(){$scope.loading=!0,$scope.searchFunction($scope.internal.search).then(function(response){$scope.internalList=response,$scope.loading=!1,$scope.handleDefault()},function(error){$scope.internalList=null,$scope.loading=!1})},$scope.handleSelected=function(item,index){$scope.formDropdown.$setDirty(),null!=item?$scope.multiple?$scope.handleMultipleSelect(item,index):$scope.handleSingleSelect(item,index):$scope.handleSingleSelect(void 0,-1)},$scope.handleMultipleSelect=function(item,index){$scope.selected||($scope.selected=[]),item._selected?$scope.selected=$scope.selected.filter(function(s){return s[$scope.objKey]!=item[$scope.objKey]}):$scope.selected.push(item),$scope.handleSetModel()},$scope.handleSingleSelect=function(item,index){$scope.selected=item,$scope.close(),$scope.handleSetModel()},$scope.handleSetModel=function(){var obj=angular.copy($scope.selected);null!=$scope.selected&&($scope.multiple?angular.forEach(obj,function(o){o._selected=void 0}):obj._selected=void 0,$scope.selectedIsKey&&($scope.multiple?angular.forEach(obj,function(o){o=o[$scope.objKey]}):obj=obj[$scope.objKey])),$scope.clearOnSelect?$scope.model=null:$scope.model=obj,$timeout(function(){$scope.onChange&&$scope.onChange({model:obj})})},$scope.handleDefault=function(){$scope.model&&$scope.handleModelChange(),!$scope.nullable&&!$scope.model&&!$scope.clearOnSelect&&$scope.internalList&&0<$scope.internalList.length&&$scope.handleSelected($scope.internalList[0],0)},$scope.$watchCollection("list",function(value_new,value_old){$scope.internalList=angular.copy($scope.list),$scope.handleDefault()}),$scope.$watch("model",function(value_new,value_old){$scope.handleModelChange()}),$scope.handleModelChange=function(){$scope.selected=angular.copy($scope.model),angular.forEach($scope.internalList,function(i,index){i._selected=!1,$scope.selectedIsKey?$scope.multiple?angular.forEach($scope.selected,function(s){i[$scope.objKey]==s&&(i._selected=!0,$scope.selectedIndex=index)}):null!=$scope.selected&&i[$scope.objKey]==$scope.selected&&(i._selected=!0,$scope.selected=i,$scope.selectedIndex=index,$scope.scrollToHover()):$scope.multiple?angular.forEach($scope.selected,function(s){i[$scope.objKey]==s[$scope.objKey]&&(i._selected=!0,$scope.selectedIndex=index)}):null!=$scope.selected&&i[$scope.objKey]==$scope.selected[$scope.objKey]&&(i._selected=!0,$scope.selected=i,$scope.selectedIndex=index,$scope.scrollToHover())})},$element.bind("keydown keypress",function(event){38==event.keyCode&&(event.preventDefault(),$timeout(function(){0<$scope.selectedIndex&&(--$scope.selectedIndex,$timeout(function(){$scope.scrollToHover()}))})),40==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.internalList&&$scope.selectedIndex<$scope.internalList.length-1&&($scope.selectedIndex+=1,$timeout(function(){$scope.scrollToHover()}))})),13==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.handleSelected($scope.internalList[$scope.selectedIndex],$scope.selectedIndex)})),27==event.keyCode&&$timeout(function(){$scope.close()})}),$scope.handleDefault(),$scope.searchFunction&&$scope.handleSearch()}}}),angular.module("niceElements").directive("niceDtp",function($window,$parse,$document){return{scope:{onChange:"&?",model:"=",format:"@",modelFormat:"@",date:"@",time:"@",width:"@",enableOkButtons:"@",lang:"@",minDate:"@",maxDate:"@",weekStart:"@",okText:"@",cancelText:"@",shortTime:"@",title:"@",noMargin:"@",fieldWidth:"@",labelWidth:"@",closed:"="},templateUrl:"src/components/nice-dtp/nice-dtp.html",controller:function($scope,$element,$attrs,gettextCatalog){var params={title:"",noMargin:!1,fieldWidth:"col-sm-8",labelWidth:"col-sm-4",format:"D.M.YYYY • H:mm",modelFormat:"YYYY-MM-DDTHH:mm:ss.SSS",minDate:null,maxDate:null,lang:"en",weekStart:1,shortTime:!1,cancelText:gettextCatalog.getString("Cancel",null,"Nice"),okText:gettextCatalog.getString("OK",null,"Nice"),date:!0,time:!1,width:300,enableOkButtons:!1};$scope.date="true"===$attrs.date||!0===$attrs.date,$scope.time="true"===$attrs.time||!0===$attrs.time;var that={init:function(){$scope.showDtp=!1,that.initDays(),that.initDates()},initDays:function(){$scope.days=[];for(var i=params.weekStart;$scope.days.length<7;i++)$scope.days.push((i=6<i?0:i).toString())},fixMinMaxDate:function(){""===$scope.minDate&&($scope.minDate=null),""===$scope.maxDate&&($scope.maxDate=null)},initDates:function(){that.fixMinMaxDate(),void 0===$scope.model||null===$scope.model?$scope.currentDate=moment():$scope.currentDate=moment($scope.model).locale(params.lang),that.setDateModel(),that.setElementValue(),void 0!==$scope.minDate&&null!==$scope.minDate&&"string"==typeof $scope.minDate&&($scope.minDate=moment($scope.minDate).locale(params.lang)),void 0!==$scope.maxDate&&null!==$scope.maxDate&&"string"==typeof $scope.maxDate&&($scope.maxDate=moment($scope.maxDate).locale(params.lang)),!0===params.date&&(that.isAfterMinDate($scope.currentDate)||($scope.currentDate=moment($scope.minDate)),that.isBeforeMaxDate($scope.currentDate)||($scope.currentDate=moment($scope.maxDate)))},initDate:function(){that.fixMinMaxDate(),$scope.currentView=0,$scope.showCalendar=!0,$scope.showTime=!1;var _date=void 0!==$scope.currentDate&&null!==$scope.currentDate?$scope.currentDate:null;$scope.calendar=that.generateCalendar($scope.currentDate),void 0!==$scope.calendar.week&&void 0!==$scope.calendar.days&&(that.constructHTMLCalendar(_date,$scope.calendar),that.toggleButtons(_date)),that._centerBox(),that.showDate(_date)},initHours:function(){that.fixMinMaxDate(),$scope.currentView=1,$scope.hours=[],$scope.minutes=[],$scope.showTime=!0,$scope.showCalendar=!1,that.showTime($scope.currentDate);for(var r=100,j=r/1.55,j_pm=r/1.15,_hours=[],h=0;h<12;++h){var cH=24==$scope.currentDate.format("HH")?0:$scope.currentDate.format("HH"),_hour={style:{x:x=j*Math.sin(2*Math.PI*(h/12)),y:y=j*Math.cos(2*Math.PI*(h/12)),marginLeft:r+x+parseInt(10)/2-(parseInt(10)+parseInt(20))+"px",marginTop:r-y-parseInt(10)/2-(parseInt(10)+parseInt(10))+"px"},h:0==h?12:h,selected:h==parseInt(cH)};_hours.push(_hour)}for(h=0;h<12;++h){var x,y,cH=24==$scope.currentDate.format("HH")?0:$scope.currentDate.format("HH"),_hour={style:{x:x=j_pm*Math.sin(2*Math.PI*(h/12)),y:y=j_pm*Math.cos(2*Math.PI*(h/12)),marginLeft:r+x+parseInt(10)/2-(parseInt(10)+parseInt(20))+"px",marginTop:r-y-parseInt(10)/2-(parseInt(10)+parseInt(10))+"px"},h:0==h?0:h+12,selected:h+12==parseInt(cH)};_hours.push(_hour)}$scope.hours=_hours,that.toggleTime(!0),that.initHands(!0)},initMinutes:function(){that.fixMinMaxDate(),$scope.currentView=2,$scope.hours=[],$scope.minutes=[],$scope.showCalendar=!1,$scope.showTime=!0,that.showTime($scope.currentDate);for(var j=100/1.2,_minutes=[],m=0;m<60;m+=5){var x=j*Math.sin(2*Math.PI*(m/60)),_minute=j*Math.cos(2*Math.PI*(m/60)),_minute={style:{x:x,y:_minute,marginLeft:100+x+parseInt(10)/2-(parseInt(10)+parseInt(20))+"px",marginTop:100-_minute-parseInt(10)/2-(parseInt(10)+parseInt(10))+"px"},m:2==m.toString().length?m:"0"+m,selected:m==5*Math.round($scope.currentDate.minute()/5)};_minutes.push(_minute)}$scope.minutes=_minutes,that.toggleTime(!1),that.initHands(!1),that._centerBox()},initHands:function(t){var r=100,_hL=r/1.7,_mL=r/1.5,dtpClockCenter=$element[0].getElementsByClassName("dtp-hour-hand")[0];dtpClockCenter.style.left=r+1.5*parseInt(20)+"px",dtpClockCenter.style.height=_hL+"px",dtpClockCenter.style.marginTop=r-_hL-parseInt(10)+"px",t&&dtpClockCenter.classList.add("on");dtpClockCenter=$element[0].getElementsByClassName("dtp-minute-hand")[0];dtpClockCenter.style.left=r+1.5*parseInt(20)+"px",dtpClockCenter.style.height=_mL+"px",dtpClockCenter.style.marginTop=r-_mL-parseInt(10)+"px",t&&dtpClockCenter.classList.add("on");dtpClockCenter=$element[0].getElementsByClassName("dtp-clock-center")[0];dtpClockCenter.style.left=r+parseInt(10)+parseInt(20)-7.5+"px",dtpClockCenter.style.marginTop=r-parseInt(20)/2-7.5+"px",that.animateHands(),that._centerBox()},animateHands:function(){var h=$scope.currentDate.hour(),m=$scope.currentDate.minute(),dtpHourHand=$element[0].getElementsByClassName("dtp-hour-hand")[0],dtpMinuteHand=$element[0].getElementsByClassName("dtp-minute-hand")[0];that.rotateElement(dtpHourHand,30*h),that.rotateElement(dtpMinuteHand,5*Math.round(m/5)*6)},isAfterMinDate:function(_date,checkHour,checkMinute){var _minDate,_return=!0;return void 0!==$scope.minDate&&null!==$scope.minDate&&(_minDate=moment($scope.minDate),_date=moment(_date),checkHour||checkMinute||(_minDate.hour(0),_minDate.minute(0),_date.hour(0),_date.minute(0)),_minDate.second(0),_date.second(0),_minDate.millisecond(0),_date.millisecond(0),_return=(checkMinute||(_date.minute(0),_minDate.minute(0)),parseInt(_date.format("X"))>=parseInt(_minDate.format("X")))),_return},isBeforeMaxDate:function(_date,checkTime,checkMinute){var _maxDate,_return=!0;return void 0!==$scope.maxDate&&null!==$scope.maxDate&&(_maxDate=moment($scope.maxDate),_date=moment(_date),checkTime||checkMinute||(_maxDate.hour(0),_maxDate.minute(0),_date.hour(0),_date.minute(0)),_maxDate.second(0),_date.second(0),_maxDate.millisecond(0),_date.millisecond(0),_return=(checkMinute||(_date.minute(0),_maxDate.minute(0)),parseInt(_date.format("X"))<=parseInt(_maxDate.format("X")))),_return},rotateElement:function(el,deg){el.style.transform="rotate("+deg+"deg)"},showDate:function(date){$scope.showTimeHeader=!0,date&&($scope.showDateHeader=!0,$scope.actualDay=date.locale(params.lang).format("dddd"),$scope.actualMonth=date.locale(params.lang).format("MMM").toUpperCase(),$scope.actualNum=date.locale(params.lang).format("DD"),$scope.actualYear=date.locale(params.lang).format("YYYY"))},showTime:function(date){var _time;date&&(_time=5*Math.round(date.minute()/5),_time={hours:date.format("HH"),minutes:2==_time.toString().length?_time:"0"+_time},params.date?$scope.showTimeHeader=!0:(params.shortTime?$scope.actualDay=date.format("A"):$scope.actualDay=" ",$scope.showTimeHeader=!1),$scope.actualTime=_time)},selectDate:function(date){date&&($scope.currentDate=date,that.showDate($scope.currentDate),$scope.$emit("dateSelected",{date:date}))},generateCalendar:function(date){var _calendar={};if(null!==date){var startOfMonth=moment(date).locale(params.lang).startOf("month"),endOfMonth=moment(date).locale(params.lang).endOf("month"),iNumDay=startOfMonth.format("d");_calendar.week=$scope.days,_calendar.days=[];for(var i=startOfMonth.date();i<=endOfMonth.date();i++){if(i===startOfMonth.date()){var iWeek=_calendar.week.indexOf(iNumDay.toString());if(0<iWeek)for(var x=0;x<iWeek;x++)_calendar.days.push(0)}_calendar.days.push(moment(startOfMonth).locale(params.lang).date(i))}}return _calendar},constructHTMLCalendar:function(date,calendar){$scope.monthAndYear=date.locale(params.lang).format("MMMM YYYY");for(var _weekDays=[],i=0;i<calendar.week.length;i++)_weekDays.push(moment(parseInt(calendar.week[i]),"d").locale(params.lang).format("dd").substring(0,1));$scope.weekDays=_weekDays;for(var _weeks=[],_week=[],i=0;i<calendar.days.length;i++){i%7==0&&(0!=i&&_weeks.push(_week),_week=[]);var _day={label:null,selected:!1,disabled:!0,data:{}};0!=calendar.days[i]&&(_day.disabled=!1,_day.label=moment(calendar.days[i]).locale(params.lang).format("DD"),_day.data=calendar.days[i],!1===that.isBeforeMaxDate(moment(calendar.days[i]),!1,!1)||!1===that.isAfterMinDate(moment(calendar.days[i]),!1,!1)?_day.disabled=!0:moment(calendar.days[i]).locale(params.lang).format("DD")===moment($scope.currentDate).locale(params.lang).format("DD")&&(_day.selected=!0)),_week.push(_day)}0<_week.length&&_weeks.push(_week),$scope.weeks=_weeks},setName:function(){for(var text="",possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)text+=possible.charAt(Math.floor(Math.random()*possible.length));return text},isPM:function(){return $scope.isPM},setElementValue:function(date){$scope.value=moment($scope.currentDate).locale(params.lang).format(params.format)},setDateModel:function(){$scope.model=angular.copy($scope.currentDate),$scope.onChange&&$scope.onChange({model:$scope.model})},toggleButtons:function(endOfYear){var startOfMonth,startOfYear;endOfYear&&endOfYear.isValid()&&(startOfMonth=moment(endOfYear).locale(params.lang).startOf("month"),startOfYear=moment(endOfYear).locale(params.lang).endOf("month"),$scope.btnMonthBeforeEnabled=that.isAfterMinDate(startOfMonth,!1,!1),$scope.btnMonthAfterEnabled=that.isBeforeMaxDate(startOfYear,!1,!1),startOfYear=moment(endOfYear).locale(params.lang).startOf("year"),endOfYear=moment(endOfYear).locale(params.lang).endOf("year"),$scope.btnYearBeforeEnabled=that.isAfterMinDate(startOfYear,!1,!1),$scope.btnYearAfterEnabled=that.isBeforeMaxDate(endOfYear,!1,!1))},toggleTime:function(isHours){isHours?angular.forEach($scope.hours,function(hour,hourKey){var _date=moment($scope.currentDate);_date.hour(that.convertHours(hour.h)).minute(0).second(0),!1===that.isAfterMinDate(_date,!0,!1)||!1===that.isBeforeMaxDate(_date,!0,!1)?hour.disabled=!0:hour.disabled=!1}):angular.forEach($scope.minutes,function(minute,minuteKey){var _minute=minute.m,_date=moment($scope.currentDate);_date.minute(_minute).second(0),!1===that.isAfterMinDate(_date,!0,!0)||!1===that.isBeforeMaxDate(_date,!0,!0)?minute.disabled=!0:minute.disabled=!1})},_onClick:function(){$scope.currentView=0,that.initDates(),that.show(),params.date?($scope.showDate=!0,that.initDate()):params.time&&($scope.showTime=!0,that.initHours())},_onBackgroundClick:function(e){e.stopPropagation(),that.hide()},_onElementClick:function(e){e.stopPropagation()},_onCloseClick:function(){that.hide(),$scope.closed&&$scope.closed(!0)},_onOKClick:function(){switch($scope.currentView){case 0:!0===params.time?that.initHours():(that.setElementValue(),that.setDateModel(),$scope.inline||that.hide());break;case 1:that.initMinutes();break;case 2:that.setElementValue(),that.setDateModel(),$scope.inline?that._onClick():that.hide()}},_onCancelClick:function(){if(params.time)switch($scope.currentView){case 0:that.hide();break;case 1:params.date?that.initDate():that.hide();break;case 2:that.initHours()}else that.hide()},_onMonthBeforeClick:function(){$scope.btnMonthBeforeEnabled&&($scope.currentDate.subtract(1,"months"),that.initDate($scope.currentDate))},_onMonthAfterClick:function(){$scope.btnMonthAfterEnabled&&($scope.currentDate.add(1,"months"),that.initDate($scope.currentDate))},_onYearBeforeClick:function(){$scope.btnYearBeforeEnabled&&($scope.currentDate.subtract(1,"years"),that.initDate($scope.currentDate))},_onYearAfterClick:function(){$scope.btnYearAfterEnabled&&($scope.currentDate.add(1,"years"),that.initDate($scope.currentDate))},_onSelectDate:function(date){angular.forEach($scope.weeks,function(week,weekKey){angular.forEach($scope.weeks[weekKey],function(day,dayKey){$scope.weeks[weekKey][dayKey].selected=!1})}),date.selected=!0,that.selectDate(date.data),params.enableOkButtons||that._onOKClick()},_onSelectHour:function(dataHour){dataHour.disabled||(angular.forEach($scope.hours,function(hour,hourKey){$scope.hours[hourKey].selected=!1}),dataHour.selected=!0,dataHour=parseInt(dataHour.h),that.isPM()&&(dataHour+=12),$scope.currentDate.hour(dataHour),that.showTime($scope.currentDate),that.animateHands(),params.enableOkButtons||that._onOKClick())},_onSelectMinute:function(minuteSelected){minuteSelected.disabled||(angular.forEach($scope.minutes,function(minute,minuteKey){$scope.minutes[minuteKey].selected=!1}),minuteSelected.selected=!0,$scope.currentDate.minute(parseInt(minuteSelected.m)),that.showTime($scope.currentDate),that.animateHands(),params.enableOkButtons||that._onOKClick())},convertHours:function(h){var _return=h;return h<12&&that.isPM()&&(_return+=12),_return},setDate:function(date){params.currentDate=date,that.initDates()},setMinDate:function(date){params.minDate=date,that.initDates()},setMaxDate:function(date){params.maxDate=date,that.initDates()},show:function(){$scope.showDtp=!0,that._centerBox()},hide:function(){$scope.showDtp=!1},resetDate:function(){},_centerBox:function(){}};$scope.onClick=that._onClick,$scope.onOKClick=that._onOKClick,$scope.onCancelClick=that._onCancelClick,$scope.onCloseClick=that._onCloseClick,$scope.onSelectDate=that._onSelectDate,$scope.onMonthBeforeClick=that._onMonthBeforeClick,$scope.onMonthAfterClick=that._onMonthAfterClick,$scope.onYearBeforeClick=that._onYearBeforeClick,$scope.onYearAfterClick=that._onYearAfterClick,$scope.onSelectHour=that._onSelectHour,$scope.onSelectMinute=that._onSelectMinute,$scope.initDate=that.initDate,$scope.initHours=that.initHours,$scope.initMinutes=that.initMinutes,params.date="true"===$attrs.date||!0===$attrs.date,params.time="true"===$attrs.time||!0===$attrs.time,params.inline="true"===$attrs.inline||!0===$attrs.inline,$attrs.format&&""!=$attrs.format&&(params.format=$attrs.format),$scope.enableOkButtons&&""!=$attrs.enableOkButtons&&(params.enableOkButtons="true"===$attrs.enableOkButtons),$attrs.lang&&""!=$attrs.lang&&(params.lang=$attrs.lang),$attrs.minDate&&""!=$attrs.minDate&&(params.minDate=$attrs.minDate),$attrs.maxDate&&""!=$attrs.maxDate&&(params.maxDate=$attrs.maxDate),$scope.weekStart&&""!=$attrs.weekStart&&(params.weekStart=parseInt($attrs.weekStart)),$attrs.okText&&""!=$attrs.okText&&(params.okText=$attrs.okText),$attrs.cancelText&&""!=$attrs.cancelText&&(params.cancelText=$attrs.cancelText),$attrs.noMargin&&""!=$attrs.noMargin&&(params.noMargin="true"===$attrs.noMargin),$attrs.modelFormat&&""!=$attrs.modelFormat&&(params.modelFormat=$attrs.modelFormat),$attrs.width&&(params.width=parseInt($attrs.width)),$scope=angular.extend($scope,params),that.init(),$scope.inline&&that._onClick(),$scope.$on("dtp-open-click",function(){that._onClick()}),$scope.$on("dtp-close-click",function(){that.hide()}),$scope.$watch("model",function(newDate){$scope.currentDate=newDate,that.showDate($scope.currentDate),that.initDate()})}}}),angular.module("niceElements").directive("niceHelp",function(){return{templateUrl:"src/components/nice-help/nice-help.html",restrict:"E",scope:{text:"@"}}}),angular.module("niceElements").directive("niceInput",function(){return{templateUrl:"src/components/nice-input/nice-input.html",restrict:"E",transclude:!0,scope:{model:"=",valid:"=",isDisabled:"=",type:"@",title:"@?",regex:"@?",placeholder:"@",min:"@?",max:"@?",minlength:"@?",maxlength:"@?",required:"=",fieldWidth:"@",labelWidth:"@",hideValid:"@",showValid:"@",textArea:"@",textAreaLines:"@",symbol:"@",help:"@",name:"@",noMargin:"@",minDecimalsCutZeros:"@",tabIndex:"@",isFocused:"@",isInline:"=",onChange:"&?"},link:function(scope,input,attrs){attrs.type||(attrs.type="text"),attrs.title||(attrs.title=""),attrs.regex||(attrs.regex=null),attrs.placeholder||(attrs.placeholder=""),attrs.minlength||(attrs.minlength=1),attrs.maxlength||(attrs.maxlength=100),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.textAreaLines||(attrs.textAreaLines=3),attrs.symbol||(attrs.symbol=""),attrs.help||(attrs.help=""),attrs.name||(attrs.name=""),attrs.minDecimalsCutZeros||(attrs.minDecimalsCutZeros=0),attrs.hideValid=angular.isDefined(attrs.hideValid),attrs.showValid=angular.isDefined(attrs.showValid),attrs.textArea=angular.isDefined(attrs.textArea),attrs.noMargin=angular.isDefined(attrs.noMargin),attrs.required="true"===attrs.required,scope.textArea?scope.elementType="textarea":scope.elementType="input",!scope.isFocused||(input=input[0].getElementsByTagName(scope.elementType)[0])&&input.focus(),scope.internalType=attrs.type,"percent"==attrs.type?(scope.internalType="percent",attrs.symbol="%"):"number"==attrs.type?(scope.internalType="number",scope.model?scope.model=Number(scope.model):scope.model=null):"integer"==attrs.type?(scope.internalType="text",scope.model=Number(scope.model)):"email"==attrs.type&&(scope.regexexp=new RegExp("^[_a-zA-Z0-9]+(.[_a-zA-Z0-9]+)*@[a-zA-Z0-9]+(.[a-zA-Z0-9]+)+(.[a-zA-Z]{2,4})")),angular.isDefined(attrs.valid)&&(scope.valid=scope.form),angular.isDefined(attrs.minDecimalsCutZeros)&&"number"==attrs.type&&(scope.model=Number(scope.model),(scope.model.toString().split(".").length<2||scope.model.toString().split(".")[1].length<parseInt(attrs.minDecimalsCutZeros))&&(scope.model=Number(scope.model).toFixed(parseInt(attrs.minDecimalsCutZeros)))),angular.isDefined(scope.regex)&&""!=scope.regex&&(scope.regexexp=new RegExp(scope.regex)),scope.$watch("model",function(value_new,value_old){scope.internalModel=scope.model}),scope.$watch("internalModel",function(value_new,value_old){"number"==attrs.type&&value_new?"number"!=typeof value_new&&(scope.internalModel=value_new.replace(",","."),scope.model=scope.internalModel,scope.onChange&&scope.onChange({model:scope.model})):scope.onChange&&scope.onChange({model:scope.model})})},controller:function($scope){$scope.id=Math.random().toString(36).substring(7),$scope.keypress=function(event){if("number"==$scope.type||"integer"==$scope.type)return 46==event.charCode||44==event.charCode?"number"!=$scope.type||0<=String($scope.model).indexOf(".")?(event.preventDefault(),!1):void 0:45!=event.charCode?48<=event.charCode&&event.charCode<=58||0==event.charCode||(event.preventDefault(),!1):0<=String($scope.model).indexOf("-")?(event.preventDefault(),!1):void 0}}}}),angular.module("niceElements").directive("niceLabel",function(){return{templateUrl:"src/components/nice-label/nice-label.html",restrict:"E",scope:{fieldWidth:"@",labelWidth:"@",value:"@",title:"@",noMargin:"@",isInline:"=",help:"@"},link:function(scope,element,attrs){attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.value||(attrs.labelWidth=""),attrs.title||(attrs.labelWidth="")}}}),angular.module("niceElements").directive("niceLoader",function(){return{templateUrl:"src/components/nice-loader/nice-loader.html",restrict:"E",transclude:!0,scope:{visibleWhen:"=",message:"@",fullscreen:"@",fulldiv:"@",addClass:"@"}}}),angular.module("niceElements").factory("NiceNotification",function($timeout,$http,$compile,$templateCache,$rootScope,$sce){function notify(args,t){(args="object"!=typeof args?{message:args}:args).template=args.template||"src/components/nice-notification/nice-notification.html",args.delay=angular.isUndefined(args.delay)?5e3:args.delay,args.type=t||"",$http.get(args.template,{cache:$templateCache}).success(function(template){var scope=$rootScope.$new();if(scope.message=$sce.trustAsHtml(args.message),scope.title=$sce.trustAsHtml(args.title),scope.t=args.type.substr(0,1),scope.delay=args.delay,"object"==typeof args.scope)for(var key in args.scope)scope[key]=args.scope[key];function reposite(){for(var j=0,k=0,lastTop=startTop,i=messageElements.length-1;0<=i;i--){var element=messageElements[i],elHeight=parseInt(element[0].offsetHeight),right=parseInt(element[0].offsetWidth);top+elHeight>window.innerHeight&&(lastTop=startTop,k++,j=0);var top=lastTop+(0===j?0:verticalSpacing),right=10+k*(10+right);element.css("top",top+"px"),element.css("right",right+"px"),lastTop=top+elHeight,j++}}var templateElement=$compile(template)(scope);templateElement.addClass(args.type),templateElement.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd click",function(e){("click"===(e=e.originalEvent||e).type||"opacity"===e.propertyName&&.4<=e.elapsedTime)&&(templateElement.remove(),messageElements.splice(messageElements.indexOf(templateElement),1),reposite())}),$timeout(function(){templateElement.addClass("killed"),templateElement.remove(),messageElements.splice(messageElements.indexOf(templateElement),1),reposite()},args.delay),angular.element(document.getElementsByTagName("body")).append(templateElement),messageElements.push(templateElement),$timeout(reposite)}).error(function(data){throw new Error("Template ("+args.template+") could not be loaded. "+data)})}var startTop=10,verticalSpacing=10,messageElements=[];return notify.config=function(args){startTop=args.top||startTop,verticalSpacing=args.verticalSpacing||verticalSpacing},notify.primary=function(){this(args,"")},notify.error=function(args){this(args,"error")},notify.success=function(args){this(args,"success")},notify.info=function(args){this(args,"info")},notify.warning=function(args){this(args,"warning")},notify}),angular.module("niceElements").directive("niceNumber",function(){return{templateUrl:"src/components/nice-number/nice-number.html",restrict:"E",scope:{model:"=",valid:"=",disabled:"=",title:"@?",min:"@",max:"@",defaultValue:"@",required:"@",fieldWidth:"@",labelWidth:"@",hideError:"@",preventZero:"@",noMargin:"@",step:"@",decimals:"@",allowNegative:"@",floatingError:"@",help:"@",isInline:"=",onChange:"&?"},controller:function($scope,$timeout){$scope.canAdd=!0,$scope.canSubstract=!0,$scope.preventZero="true"==$scope.preventZero,$scope.valid&&($scope.valid=$scope.forma),$scope.min?$scope.min=parseFloat($scope.min):$scope.min=0,$scope.allowNegative&&($scope.min=-1/0),$scope.max&&($scope.max=parseFloat($scope.max)),$scope.defaultValue?$scope.defaultValue=parseInt($scope.defaultValue):0!=$scope.min&&$scope.min!=-1/0?$scope.defaultValue=$scope.min:$scope.defaultValue=0,$scope.decimals?$scope.decimals=parseInt($scope.decimals):$scope.decimals=0,$scope.step?$scope.step=parseFloat($scope.step):$scope.step=1,$scope.model&&parseFloat($scope.model)?$scope.model=parseFloat($scope.model):$scope.model=$scope.defaultValue,$scope.check=function(){!$scope.required||null!=$scope.model&&null!=$scope.model?$scope.niceNumberForm.$setValidity("no-value",null):$scope.niceNumberForm.$setValidity("no-value",!1),$scope.min&&parseFloat($scope.model)<=$scope.min?$scope.canSubstract=!1:$scope.canSubstract=!0,$scope.max&&parseFloat($scope.model)>=$scope.max?$scope.canAdd=!1:$scope.canAdd=!0,$scope.preventZero&&0==parseFloat($scope.model)?$scope.niceNumberForm.$setValidity("zero",!1):$scope.niceNumberForm.$setValidity("zero",null),$scope.onChange&&$scope.onChange({model:$scope.model})},$timeout(function(){$scope.check()}),$scope.inputChanged=function(){$scope.check()},$scope.$watch("model",function(){$scope.check()}),$scope.add=function(){var result=new Decimal(null!=$scope.model?$scope.model:$scope.defaultValue).plus($scope.step).toNumber();(!$scope.max||result<=parseFloat($scope.max))&&($scope.model=result,$scope.niceNumberForm.$setDirty()),$scope.check()},$scope.subtract=function(){var result=new Decimal(null!=$scope.model?$scope.model:$scope.defaultValue).minus($scope.step).toNumber();result>=Number($scope.min)&&($scope.model=result,$scope.niceNumberForm.$setDirty()),$scope.check()}}}}),angular.module("niceElements").directive("nicePercent",function(){return{templateUrl:"src/components/nice-percent/nice-percent.html",restrict:"E",transclude:!0,scope:{model:"=",valid:"=",isDisabled:"=",title:"@?",required:"@",fieldWidth:"@",labelWidth:"@",placeholder:"@",noMargin:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element,attrs){attrs.title||(attrs.title=""),attrs.required=angular.isDefined(attrs.required),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.placeholder||(attrs.placeholder=""),attrs.noMargin=angular.isDefined(attrs.noMargin)},controller:function($rootScope,$scope){angular.isDefined($scope.valid)&&($scope.valid=$scope.form);function roundN(number,decimals){return Number(new Decimal(String(number)).toFixed(decimals,4))}angular.isDefined($scope.model)?$scope.internalModel=roundN(100*angular.copy($scope.model),6):($scope.internalModel="0",$scope.model=0),$scope.change=function(){$scope.internalModel?($scope.internalModel=String($scope.internalModel).replace(",","."),100<parseFloat($scope.internalModel)&&($scope.internalModel=100),$scope.model=roundN(parseFloat($scope.internalModel)/100,6)):$scope.model=0,$scope.onChange&&$scope.onChange({model:$scope.model})},$scope.keypress=function(event){return 46!=event.charCode&&44!=event.charCode?48<=event.charCode&&event.charCode<=58||0==event.charCode||(event.preventDefault(),!1):0<=$scope.internalModel.indexOf(".")?(event.preventDefault(),!1):void 0},$scope.$watch("model",function(value_new,value_old){value_new&&($scope.internalModel=roundN(100*angular.copy($scope.model),6))}),$scope.$watch("internalModel",function(value_new,value_old){$scope.internalModel||($scope.internalModel="0")})}}}),angular.module("niceElements").directive("niceProgressBar",function(){return{restrict:"E",replace:!0,templateUrl:"src/components/nice-progress-bar/nice-progress-bar.html",scope:{title:"@",noMargin:"@",value:"=",max:"=",color:"=",isInline:"=",help:"@"},controller:function($scope,$element,$timeout){$scope.width=0,$scope.resize=function(){$timeout(function(){$scope.width=$element[0].getElementsByClassName("progress")[0].offsetWidth},100)},window.onresize=function(){$scope.resize()},$scope.resize(),$scope.$watch("value",function(valueNew,valueOld){$scope.calculate()}),$scope.$watch("max",function(valueNew,valueOld){$scope.calculate()}),$scope.calculate=function(){$scope.percentage=$scope.value/$scope.max*100},$scope.calculate()}}}),angular.module("niceElements").directive("niceQuantity",function(){return{templateUrl:"src/components/nice-quantity/nice-quantity.html",restrict:"E",scope:{title:"@",model:"=",max:"=",onChange:"&?",noMargin:"@",fieldWidth:"@",labelWidth:"@",isDisabled:"=",isInline:"=",help:"@"},controller:function($scope){$scope.model||($scope.model=0),$scope.add=function(){(!$scope.max||$scope.max>=$scope.model+1)&&($scope.model+=1,$scope.onChange&&$scope.onChange({model:$scope.model}))},$scope.sub=function(){0<=$scope.model-1&&(--$scope.model,$scope.onChange&&$scope.onChange({model:$scope.model}))},$scope.handleChange=function(){$scope.model&&($scope.model=Number($scope.model))}}}}),angular.module("niceElements").directive("niceSearch",function(){return{transclude:!0,templateUrl:"src/components/nice-search/nice-search.html",restrict:"E",scope:{model:"=",isDisabled:"=",title:"@?",placeholder:"@",required:"@",fieldWidth:"@",labelWidth:"@",hideValid:"@",refreshFunction:"=",refreshSelectedCallback:"=",showDropdown:"@?",clearInput:"@",resetSearchInput:"@?",keyForInputLabel:"@?",disableRow:"@?",noMargin:"@",setText:"@",tabIndex:"@",isFocused:"@",help:"@",isInline:"=",onChange:"&?"},link:function(scope,element,attrs,ctrl,transcludeFn){attrs.title||(attrs.title=""),attrs.placeholder||(attrs.placeholder=""),attrs.required=angular.isDefined(attrs.required),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.hideValid=angular.isDefined(attrs.hideValid),attrs.showDropdown=angular.isDefined(attrs.showDropdown),attrs.clearInput=angular.isDefined(attrs.clearInput),attrs.resetSearchInput=angular.isDefined(attrs.resetSearchInput),attrs.disableRow=angular.isDefined(attrs.disableRow),attrs.noMargin=angular.isDefined(attrs.noMargin),attrs.setText||(attrs.setText=""),scope.$watch("setText",function(){scope.modelString=scope.setText}),angular.isDefined(scope.model)&&(angular.isDefined(scope.keyForInputLabel)?scope.modelString=scope.model[scope.keyForInputLabel]:scope.modelString=scope.model);function setValid(isValid){scope.required&&scope.form.$setValidity("objectSelected",isValid)}scope.$watch("model",function(newValue){scope.model&&scope.model.id?setValid(!0):setValid(!1)}),scope.selectRow=function(obj){angular.isDefined(scope.refreshSelectedCallback)&&scope.refreshSelectedCallback(obj),scope.resetSearchInput?scope.model=null:scope.model=obj,angular.isDefined(scope.keyForInputLabel)?scope.modelString=obj[scope.keyForInputLabel]:scope.modelString=obj,scope.clear()},scope.clear=function(){scope.results=[],scope.clearInput&&(scope.modelString="")};function onClick(event){0<element.find(event.target).length||(scope.results=[],scope.noResults=!1,scope.$apply())}angular.element(element).on("click",onClick);function onKeyDown(event){(38==event.keyCode||40==event.keyCode||13==event.keyCode||27==event.keyCode)&&scope.results&&0<scope.results.length&&(event.preventDefault(),27==event.keyCode&&(scope.modelString="",scope.clear()),13==event.keyCode&&scope.selectRow(scope.results[scope.selectedIndex]),40==event.keyCode&&scope.results&&scope.selectedIndex+1<scope.results.length&&(scope.selectedIndex+=1),38==event.keyCode&&scope.results&&0<=scope.selectedIndex-1&&--scope.selectedIndex,scope.$apply())}angular.element(element).on("keydown",onKeyDown),scope.$on("$destroy",function(){angular.element(element).off("click",onClick),angular.element(element).off("keydown",onKeyDown)})},controller:function($scope,$timeout,$element){$scope.id=Math.random().toString(36).substring(7),$scope.loading=!1,$scope.noResults=!1,$scope.requests=0,$scope.focus=function(){var input=$element[0].getElementsByTagName("input")[0];input&&input.focus()},$scope.isFocused&&$scope.focus(),$scope.results=[];$scope.updateSearch=function(){$scope.loading=!0,$scope.timer_promise&&$timeout.cancel($scope.timer_promise),$scope.timer_promise=$timeout(function(){$scope.onChange&&$scope.onChange({model:$scope.model,modelString:$scope.modelString}),$scope.requests=$scope.requests+1;var requestNumber=angular.copy($scope.requests);$scope.refreshFunction($scope.modelString).then(function(response){!function(results,requestNumber){results&&$scope.requests==requestNumber&&($scope.noResults=0==results.length,$scope.results=results,$scope.noResults||($scope.selectedIndex=0)),$scope.loading=!1}(response,requestNumber)},function(error){$scope.loading=!1})},200)},$scope.search=function(){$scope.isDisabled||($scope.showDropdown&&$scope.updateSearch(),$scope.focus())},$scope.remove=function(){$scope.model=null,$scope.modelString=null}}}}),angular.module("niceElements").directive("niceSearch2",function(){return{transclude:!0,templateUrl:"src/components/nice-search2/nice-search2.html",restrict:"E",scope:{model:"=",isDisabled:"=",showDropdown:"=",title:"@?",placeholder:"@",fieldWidth:"@",labelWidth:"@",refreshFunction:"=",refreshSelectedCallback:"=",onSelect:"=",onChange:"&?",noMargin:"@",tabIndex:"@",debounceTime:"@",isInline:"=",help:"@"},controller:function($scope,$timeout,$element){$scope.loading=!1,$scope.isOpen=!1,$scope.debounce=null,$scope.results=[],$scope.noResults=!1,$scope.selectedIndex=0,$scope.requestNumber=0,$scope.debounceTime||($scope.debounceTime=500),$scope.model||($scope.model=""),$scope.setupPopper=function(){var button=$element[0].getElementsByClassName("nice-search-button")[0],tooltip=$element[0].getElementsByClassName("nice-search-dropdown-wrapper")[0];$scope.popper=Popper.createPopper(button,tooltip,{strategy:"fixed",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state})=>{state.styles.popper.width=`${state.rects.reference.width}px`},effect:({state})=>{state.elements.popper.style.width=`${state.elements.reference.offsetWidth}px`}}]})},$scope.setupPopper(),$scope.onFocus=function(){$scope.showDropdown&&0==$scope.results.length&&$scope.getData($scope.model),$scope.open();var input=$element[0].getElementsByTagName("input")[0];input&&input.focus()},$scope.open=function(){$scope.isOpen=!0,$timeout(function(){$scope.popper&&$scope.popper.update()})},$scope.close=function(){$scope.isOpen=!1;var input=$element[0].getElementsByTagName("input")[0];input&&input.blur(),$timeout(function(){$scope.popper.update()})},$scope.updateSearch=function(){$scope.debounce&&$timeout.cancel($scope.debounce),$scope.debounce=$timeout(function(){$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.getData($scope.model)},$scope.debounceTime)},$scope.getData=function(keywords){var requestNumber;null!=$scope.refreshFunction?($scope.loading=!0,$scope.requestNumber+=1,requestNumber=angular.copy($scope.requestNumber),$scope.refreshFunction(keywords).then(function(results){$scope.requestNumber==requestNumber&&$timeout(function(){$scope.open(),$scope.loading=!1,$scope.noResults=0==results.length,$scope.results=results,$scope.noResults||($scope.selectedIndex=0)})},function(error){$scope.loading=!1,$scope.close()})):$scope.loading=!1},$scope.search=function(){$scope.isDisabled||($scope.showDropdown&&$scope.updateSearch(),$scope.focus())},$scope.clear=function(){$scope.model=""},$scope.selectItem=function(item){$scope.onSelect&&($scope.onSelect(item),$scope.clear(),$scope.close())},$scope.scrollToHover=function(notSmooth){var dropdownMenu=$element[0].getElementsByClassName("nice-dropdown")[0],topPos=dropdownMenu.getElementsByClassName("active")[0];topPos&&(topPos=topPos.offsetTop,dropdownMenu.scroll({top:topPos-120,left:0,behavior:notSmooth?"auto":"smooth"}))},$element.bind("keydown keypress",function(event){38==event.keyCode&&(event.preventDefault(),$timeout(function(){0<$scope.selectedIndex&&(--$scope.selectedIndex,$timeout(function(){$scope.scrollToHover()}))})),40==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.results&&$scope.selectedIndex<$scope.results.length-1&&($scope.selectedIndex+=1,$timeout(function(){$scope.scrollToHover()}))})),13==event.keyCode&&(event.preventDefault(),$timeout(function(){$scope.selectItem($scope.results[$scope.selectedIndex],$scope.selectedIndex)})),27==event.keyCode&&$timeout(function(){$scope.close()})})}}}),angular.module("niceElements").directive("niceSlot",function(){return{templateUrl:"src/components/nice-slot/nice-slot.html",restrict:"E",transclude:!0,scope:{fieldWidth:"@",labelWidth:"@",title:"@",noMargin:"@",isInline:"=",help:"@"},link:function(scope,element,attrs){attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.title||(attrs.labelWidth="")}}}),angular.module("niceElements").directive("niceTimePicker",function(){return{scope:{model:"=",title:"@",isDisabled:"=",noMargin:"@",fieldWidth:"@",labelWidth:"@",onChange:"&?",isInline:"=",help:"@"},restrict:"E",templateUrl:"src/components/nice-time-picker/nice-time-picker.html",link:function($scope,$element,$attrs){$scope.model||($scope.model=moment()),$scope.open=!1,$scope.close=function(){$scope.open=!1},$scope.validateDate=function(){$scope.checkDate($scope.modelString)},$scope.checkDate=function(parsedDate){parsedDate=moment(parsedDate,"HH:mm");parsedDate.isValid()?($scope.forma.$setValidity("valid-time",!0),$scope.model=parsedDate,$scope.refreshTime(),$scope.onChange&&$scope.onChange({model:$scope.model})):($scope.forma.$setValidity("valid-time",!1),$scope.modelString="")},$scope.refreshTime=function(){$scope.hours=$scope.model.format("HH"),$scope.minutes=$scope.model.format("mm"),$scope.modelString=$scope.model.format("HH:mm")},$scope.changeHour=function(add){add?$scope.model.add(1,"hour"):$scope.model.subtract(1,"hour"),$scope.refreshTime(),$scope.forma.$setDirty()},$scope.changeMinutes=function(add){add?$scope.model.add(1,"minutes"):$scope.model.subtract(1,"minutes"),$scope.refreshTime(),$scope.forma.$setDirty()},$scope.$watch("model",function(value,oldValue){$scope.refreshTime(),value.isSame(oldValue)||$scope.checkDate(value)})}}}),angular.module("niceElements").directive("niceTooltip",function(){return{restrict:"EA",link:function(scope,element,attrs){var html=element.html();element.addClass("nice-tooltip"),html=html+"<span class='nice-tooltip-window'>"+attrs.niceTooltip+"</span>",element.html(html)}}}),angular.module("niceElements").directive("niceUpload",function($timeout,gettextCatalog){return{restrict:"E",replace:!0,transclude:!0,templateUrl:"src/components/nice-upload/nice-upload.html",scope:{model:"=",title:"@",text:"@",fieldWidth:"@",labelWidth:"@",noMargin:"@",accept:"@",uploadFunction:"=",callbackFunction:"=",callbackFile:"=",callbackUrl:"=",isDisabled:"=",isInline:"=",help:"@"},link:function(scope,element,attrs){attrs.title||(attrs.title=""),attrs.text||(attrs.text=gettextCatalog.getString("Click to upload file",null,"Nice")),attrs.fieldWidth||(attrs.fieldWidth="col-sm-8"),attrs.labelWidth||(attrs.labelWidth="col-sm-4"),attrs.noMargin=angular.isDefined(attrs.noMargin);element.bind("change",function(changeEvent){null!=scope.callbackUrl&&scope.callbackUrl(URL.createObjectURL(changeEvent.target.files[0])),$timeout(function(){var inputObj=changeEvent.target;scope.loading=!0,scope.error=null;var reader=new FileReader;if(inputObj.files){try{var fileSize=inputObj.files[0].size;reader.onload=function(event){$timeout(function(){fileSize<=1e6?(null!=scope.callbackFunction&&(scope.loading=!1,scope.imageSource=null,scope.callbackFunction(event.target.result),scope.text=inputObj.files[0].name,scope.form.$setDirty()),null!=scope.callbackFile&&(scope.loading=!1,scope.text=inputObj.files[0].name,scope.callbackFile(inputObj.files[0]),scope.form.$setDirty()),null!=scope.uploadFunction&&scope.uploadFunction(inputObj.files[0]).then(function(response){scope.loading=!1,scope.imageSource=event.target.result,scope.model=response.data.url,scope.form.$setDirty()},function(error){scope.error=error,scope.loading=!1,scope.imageSource=null})):(scope.error=gettextCatalog.getString("File must be smaller than 1MB",null,"Nice"),scope.loading=!1,scope.imageSource=null)})}}catch(err){scope.error=gettextCatalog.getString("Something went wrong",null,"Nice"),scope.loading=!1,scope.imageSource=null}reader.readAsDataURL(inputObj.files[0])}})})},controller:function($scope){$scope.$watch("model",function(value){$scope.imageSource=angular.copy($scope.model)})}}}),angular.module("niceElements").directive("niceYesno",function(){return{templateUrl:"src/components/nice-yesno/nice-yesno.html",restrict:"E",scope:{model:"=",modelValue:"=",yes:"@",no:"@",title:"@",isDisabled:"=",fieldWidth:"@",labelWidth:"@",options:"=",defaultFalse:"@",noMargin:"@",onChange:"&?",isInline:"=",help:"@"},controller:function($scope,gettextCatalog){$scope.yes||($scope.yes=gettextCatalog.getString("Yes",null,"Nice")),$scope.no||($scope.no=gettextCatalog.getString("No",null,"Nice")),$scope.title||($scope.title=""),$scope.fieldWidth||($scope.fieldWidth="col-sm-8"),$scope.labelWidth||($scope.labelWidth="col-sm-4"),angular.isDefined($scope.model)||angular.isDefined($scope.options)||($scope.model=!angular.isDefined($scope.defaultFalse)),!angular.isDefined($scope.modelValue)&&angular.isDefined($scope.options)&&($scope.modelValue=$scope.options[0]),$scope.defaultFalse=angular.isDefined($scope.defaultFalse),$scope.noMargin=angular.isDefined($scope.noMargin),$scope.buttonClass="",$scope.setButtonPosition=function(state){$scope.buttonClass=state?"yesno-button-yes":"yesno-button-no"},$scope.$watch("model",function(value_new,value_old){angular.isDefined($scope.model)&&($scope.setButtonLabel($scope.model),$scope.setButtonPosition($scope.model))}),$scope.$watch("modelValue",function(value_new,value_old){$scope.options&&($scope.model=$scope.modelValue==$scope.options[0])}),$scope.setButtonLabel=function(state){$scope.state=state?$scope.yes:$scope.no},$scope.setWidth=function(width,el){el.style.width=width},$scope.switch=function(){$scope.isDisabled||($scope.model=!$scope.model,$scope.options&&($scope.model?$scope.modelValue=$scope.options[0]:$scope.modelValue=$scope.options[1]),$scope.onChange&&$scope.onChange({model:$scope.model}),$scope.formYesno.$setDirty())},$scope.setButtonPosition($scope.model),$scope.setButtonLabel($scope.model)}}}),angular.module("niceElements").filter("niceDate",function(){return function(object,formatString){formatString=formatString?"D.M.YYYY • H:mm":"D.M.YYYY";return moment(object).format(formatString)}}),angular.module("niceElements").filter("niceHighlight",function(){return function(value,regex){regex=new RegExp(regex,"gmi");return String(value).replace(regex,"<span class='nice-highligh'>$&</span>")}}),angular.module("niceElements").run(["$templateCache",function($templateCache){$templateCache.put("src/components/nice-button-toggle/nice-button-toggle.html",'<div class="nice-component nice-button-toggle row">\n<div class="col-xs-offset-4 col-xs-8">\n<button type="button" class="btn btn-block btn-primary" ng-click="model = !model">\n<span>{{ label }}</span>\n<span ng-show="!model" class="glyphicon glyphicon-menu-down"></span>\n<span ng-show="model" class="glyphicon glyphicon-menu-up"></span>\n</button>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-button/nice-button.html",'<div class="nice-component nice-button" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<button type="{{ type }}" class="btn btn-primary" ng-class="addClass" ng-click="click()" ng-disabled="niceDisabled===true">\n<div ng-class="{opacity0: loading==true, opacity1: loading==false}"><ng-transclude></ng-transclude></div>\n<div ng-class="{display0: loading==false, opacity1: loading==true}" class="nice-button-loader-wrapper"><nice-loader add-class="nice-button-loader"></nice-loader></div>\n</button>\n</div>\n'),$templateCache.put("src/components/nice-calendar/nice-calendar.html",'<div class="nice-component nice-calendar" ng-form="formCalendar" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="disabled-shield" ng-if="isDisabled"></div>\n<div class="nice-calendar-wrapper">\n<div class="nice-calendar-weeks">\n<div class="header">\n<i class="fa fa-angle-left" ng-click="previous()" title="{{ \'Previous month\' | translate:\'Nice\' }}"></i>\n<span title="{{ month.format(\'M.YYYY\' )}}">{{ month.format("MMMM, YYYY" )}}</span>\n<i class="fa fa-angle-right" ng-click="next()" title="{{ \'Next month\' | translate:\'Nice\' }}"></i>\n</div>\n<div class="week names">\n<span class="day" translate translate-context="Nice">Mon</span>\n<span class="day" translate translate-context="Nice">Tue</span>\n<span class="day" translate translate-context="Nice">Wed</span>\n<span class="day" translate translate-context="Nice">Thu</span>\n<span class="day" translate translate-context="Nice">Fri</span>\n<span class="day weekend" translate translate-context="Nice">Sat</span>\n<span class="day weekend" translate translate-context="Nice">Sun</span>\n</div>\n<div class="week" ng-repeat="week in weeks">\n<span class="day" title="{{ day.date.format(\'D.M.YYYY\') }}" ng-class="{\n today: day.isToday,\n \'different-month\': !day.isCurrentMonth,\n \'start-selected\': isSameDay(day.date, startDate),\n \'end-selected\': isSameDay(day.date, endDate),\n \'selected\': isBetweenRange(day.date),\n \'selecting-start\': selectStart,\n \'selecting-end\': !selectStart,\n \'weekend\': day.isWeekday,\n \'disabled\': day.isDisabled\n }" ng-style="\n (color && isBetweenRange(day.date)) && {\'background-color\': lighten(color) } ||\n (color && isSameDay(day.date, startDate)) && {\'background-color\': color } ||\n (color && isSameDay(day.date, endDate)) && {\'background-color\': color }\n " ng-click="select(day)" ng-repeat="day in week.days">\n{{ day.number }}\n<p class="popup" ng-if="!hideHover">{{ popupText }}</p>\n</span>\n</div>\n</div>\n<div class="nice-calendar-time" ng-if="time">\n<div class="time-picker">\n<select title="{{ \'Select start time\' | translate:\'Nice\' }}" class="time-picker-hour" ng-model="startDateHour" ng-change="startHourChange(startDateHour)" ng-options="hour for hour in hours">\n</select>\n</div>\n<div class="time-picker">\n<select title="{{ \'Select start time\' | translate:\'Nice\' }}" class="time-picker-minute" ng-model="startDateMinute" ng-change="startMinuteChange(startDateMinute)" ng-options="minute for minute in minutes">\n</select>\n</div>\n<div class="time-picket-icon">\n<i class="fa fa-clock-o"></i>\n</div>\n<div class="time-picker">\n<select title="{{ \'Select end time\' | translate:\'Nice\' }}" class="time-picker-hour" ng-model="endDateHour" ng-change="endHourChange(endDateHour)" ng-options="hour for hour in hours">\n</select>\n</div>\n<div class="time-picker no-border-right">\n<select title="{{ \'Select end time\' | translate:\'Nice\' }}" class="time-picker-minute" ng-model="endDateMinute" ng-change="endMinuteChange(endDateMinute)" ng-options="minute for minute in minutes">\n</select>\n</div>\n</div>\n<div class="nice-selected-dates">\n<div class="nice-start-date">\n<label translate translate-context="Nice">Start</label>\n<div ng-class="startTimeClass">{{ formatDate(startDate) }}</div>\n</div>\n<div class="nice-end-date">\n<label translate translate-context="Nice">End</label>\n<div ng-class="endTimeClass">{{ formatDate(endDate) }}</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-checkbox/nice-checkbox.html",'<div class="nice-component nice-checkbox" ng-class="{ \'checked\': model, \'margin-bottom-0\' : noMargin }" ng-click="toggle()">\n<div class="checkbox">\n<svg class="check" viewBox="-281 373 48 48">\n<path class="check-stroke" d="M-273.2,398.2l10,9.9 l22.4-22.3"></path>\n</svg>\n</div>\n<div ng-if="title" class="message">{{ title }}</div>\n</div>'),$templateCache.put("src/components/nice-choice/nice-choice.html",'<div class="nice-component nice-choice" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" ng-form="formChoice">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<ul class="list-unstyled" ng-class="{ \'disabled\': isDisabled }">\n<li ng-repeat="item in internalList" ng-class="{ \'selected\' : isItemSelected(item) }" ng-click="toggle(item)">\n<div class="choice-checkbox" ng-class="{\'circle\' : !multiple }"><i class="fa fa-check"></i></div>\n<div ng-transclude class="choice-label">{{ getLabel(item) }}</div>\n</li>\n</ul>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-comment/nice-comment.html",'<div class="nice-component nice-comment" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'" ng-click="edit()">\n<textarea ng-class="{\'editing\': editing}" class="form-control" ng-model="model" placeholder="{{placeholder}}" rows="{{rows}}" ng-blur="save()"></textarea>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-date-range/nice-date-range.html",'<ng-form class="nice-component nice-date-range" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group">\n<input date-range-picker class="form-control date-picker" type="text" options="opts" ng-model="model">\n<span date-range-picker options="opts" ng-model="model" class="input-group-addon"><i class="fa fa-calendar"></i></span>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-date/nice-date.html",'<div class="nice-component nice-date" ng-form="forma" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-date-background" ng-click="toggleOpen()" ng-if="isOpen && !inline"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="disabled-shield" ng-if="isDisabled"></div>\n<div class="nice-date-button input-group" ng-class="{ \'open\': isOpen }" ng-show="!inline" ng-click="toggleOpen()">\n<input type="text" class="form-control" value="{{ model | niceDate:time }}" readonly="readonly">\n<span class="input-group-addon clickable">\n<i class="fa fa-calendar"></i>\n</span>\n</div>\n<div ng-class="{ \'nice-date-dropdown-wrapper\': !inline }">\n<div ng-class="{ \'nice-date-dropdown\': !inline }" ng-if="inline || isOpen">\n<div class="nice-date-date" ng-class="{ \'with-time\': time }">\n<div class="nice-date-header">\n<span>\n<select class="year-picker" ng-model="innerDate.year" ng-change="handleDateChange()" ng-options="year for year in years">\n</select>,\n<select class="month-picker" ng-model="innerDate.month" ng-change="handleDateChange()" ng-options="month.value as month.name for month in months">\n</select>\n</span>\n<i class="fa fa-angle-left" ng-click="previous()"></i>\n<i class="fa fa-circle" ng-click="today()"></i>\n<i class="fa fa-angle-right" ng-click="next()"></i>\n</div>\n<div class="nice-date-week names">\n<span class="nice-date-day" ng-class="{ \'weekend\': $index == 6 || $index == 5 }" ng-repeat="day in weekdays">{{ day }}</span>\n</div>\n<div class="nice-date-week" ng-repeat="week in weeks">\n<span class="nice-date-day" title="{{ day.value }}" ng-class="{\n \'today\': day.isToday,\n \'different-month\': !day.isCurrentMonth,\n \'selected\': isSameDay(model, day.date),\n \'weekend\': day.isWeekday,\n \'disabled\': day.isDisabled,\n \'between\': isBetween(day.date, model, nextDate)\n }" ng-click="select(day)" ng-repeat="day in week.days">{{ day.number }}</span>\n</div>\n</div>\n<div class="nice-date-time" ng-if="time">\n<i class="fa fa-clock-o"></i>\n<div class="time-picker time-picker-hour">\n<select ng-disabled="isDisabled" ng-model="innerDate.hour" ng-change="timeChange()" ng-options="hour as hour for hour in hours track by hour">\n</select>\n</div>\n<div class="divider">:</div>\n<div class="time-picker time-picker-minute">\n<select ng-disabled="isDisabled" ng-model="innerDate.minute" ng-change="timeChange()" ng-options="minute as minute for minute in minutes track by minute">\n</select>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-datetime-picker/nice-datetime-picker.html",'<div class="nice-component nice-datetime-picker" name="form" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-dtp-background" ng-click="closeDtp(true)" ng-if="isOpen"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div ng-form="formDatetimePicker"></div>\n<div class="input-group" id="dropdown{{randNum}}">\n<input type="text" class="form-control" value="{{ value }}" ng-click="openDtp()" ng-disabled="isDisabled">\n<span class="input-group-addon clickable" ng-click="openDtp()">\n<i class="fa" ng-class="date == \'true\' ? \'fa-calendar\' : \'fa-clock-o\'"></i>\n</span>\n</div>\n<div ng-show="isOpen">\n<nice-dtp model="internalDate" format="{{ format }}" model-format="{{ modelFormat }}" date="{{ date == \'true\' }}" time="{{ time == \'true\' }}" width="{{ width }}" enable-ok-buttons="{{ enableOkButtons }}" lang="{{ lang }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" week-start="{{ weekStart }}" ok-text="{{ okText }}" cancel-text="{{ cancelText }}" closed="closeDtp"></nice-dtp>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html",'<div class="nice-component nice-datetimerange-picker-2" ng-form="formDateRangePicker" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-dtp-background" ng-click="close()" ng-if="isOpen"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="nice-daterange-picker-button input-group" ng-class="{ \'open\': isOpen }" ng-click="open()">\n<input type="text" class="form-control" value="{{ modelFormat }}" readonly="readonly">\n<span class="input-group-addon clickable"><i class="fa fa-calendar"></i></span>\n</div>\n<div class="nice-daterange-picker-wrapper">\n<div class="dtp-wrapper" ng-if="isOpen">\n<div class="dtp-buttons-left">\n<div class="dtp-buttons-top">\n<a class="btn btn-primary btn-block" ng-click="selectToday()" translate translate-context="Nice">Last 24 hours</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)" translate translate-context="Nice">Last 7 days</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastMonth()" translate translate-context="Nice">Last month</a>\n<a class="btn btn-primary btn-block" ng-click="selectThisMonth()" translate translate-context="Nice">This month</a>\n</div>\n<div class="dtp-buttons-bottom">\n<a class="btn btn-danger btn-block" ng-click="close()" translate translate-context="Nice">Cancel</a>\n<a class="btn btn-success btn-block" ng-click="confirm()" translate translate-context="Nice">OK</a>\n</div>\n</div>\n<div class="dtp-left">\n<nice-date model="innerStartDate" next-date="innerEndDate" field-width="col-xs-12" no-margin="true" inline="true" time="time"></nice-date>\n</div>\n<div class="dtp-right">\n<nice-date model="innerEndDate" next-date="innerStartDate" field-width="col-xs-12" no-margin="true" inline="true" time="time"></nice-date>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-datetimerange-picker/nice-datetimerange-picker.html",'<div class="nice-component nice-datetime-picker nice-datetimerange-picker" name="form" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="nice-dtp-background" ng-click="cancelClick()" ng-if="showDtpRange"></div>\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div ng-form="formDatetimeRangePicker"></div>\n<div class="dropdown">\n<a class="dropdown-toggle" id="dropdown{{randNum}}" role="button" ng-click="openDtpRange()" href="javascript:void(0);">\n<div class="input-group">\n<input type="text" class="form-control" value="{{value}}" ng-click="openDtpRange()">\n<span class="input-group-addon clickable"><i class="fa" ng-class="{\'fa-clock-o\': date==\'false\', \'fa-calendar\': date!=\'false\'}"></i></span>\n</div>\n</a>\n</div>\n<div class="dtp-range-wrapper" ng-show="showDtpRange">\n<div class="dtp-layer">\n<div class="dtp-buttons-left">\n<a class="btn btn-primary btn-block" ng-click="selectLastNDays(1)" translate translate-context="Nice">Last 24 hours</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)" translate translate-context="Nice">Last 7 days</a>\n<a class="btn btn-primary btn-block" ng-click="selectLastMonth()" translate translate-context="Nice">Last month</a>\n<a class="btn btn-primary btn-block" ng-click="selectThisMonth()" translate translate-context="Nice">This month</a>\n</div>\n<div class="dtp-left">\n<nice-dtp model="dateStart" format="{{format}}" model-format="{{modelFormat}}" date="{{date}}" time="{{time}}" width="{{width}}" enable-ok-buttons="{{enableOkButtons}}" lang="{{lang}}" min-date="{{minDate}}" max-date="{{maxDate}}" week-start="{{weekStart}}" ok-text="{{okText}}" cancel-text="{{cancelText}}" inline="true"></nice-dtp>\n</div>\n<div class="dtp-right">\n<nice-dtp model="dateEnd" format="{{format}}" model-format="{{modelFormat}}" date="{{date}}" time="{{time}}" width="{{width}}" enable-ok-buttons="{{enableOkButtons}}" lang="{{lang}}" min-date="{{minDate}}" max-date="{{maxDate}}" week-start="{{weekStart}}" ok-text="{{okText}}" cancel-text="{{cancelText}}" inline="true"></nice-dtp>\n</div>\n<div class="dtp-buttons-bottom">\n<a class="btn btn-danger btn-block margin-right-20" ng-click="cancelClick()" translate translate-context="Nice">Cancel</a>\n<a class="btn btn-success btn-block" ng-click="okClick()" translate translate-context="Nice">OK</a>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-dropdown-date/nice-dropdown-date.html",'<div class="nice-component nice-dropdown-date" ng-form="dropdownDateForm" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[\n fieldWidth ? fieldWidth : \'col-sm-8\',\n {\n \'has-warning\': !isDisabled && dropdownDateForm.$invalid && dropdownDateForm.$dirty,\n \'nice-disabled\': isDisabled\n }\n ]">\n<div class="form-inline">\n<div class="input-group nice-dropdown-date-day">\n<select ng-model="dateFields.day" class="form-control" ng-options="day for day in days" ng-change="checkDate()" ng-disabled="isDisabled" required="true"></select>\n</div>\n<div class="input-group nice-dropdown-date-month">\n<select ng-model="dateFields.month" class="form-control" ng-options="month.value as month.name for month in months" ng-change="checkDate()" ng-disabled="isDisabled" required="true"></select>\n</div>\n<div class="input-group nice-dropdown-date-year">\n<select ng-model="dateFields.year" class="form-control" ng-options="year for year in years" ng-change="checkDate()" ng-disabled="isDisabled" required="true"></select>\n</div>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-dropdown-old/nice-dropdown-old.html",'<div class="nice-component nice-dropdown-old" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div ng-class="addButtonEnable && !isDisabled ? \'input-group\': \'\'">\n<div class="btn-group" dropdown is-open="status.isopen" ng-class="{ \'disabled\': isDisabled || emptyList }">\n<button type="button" class="btn btn-block btn-dropdown dropdown-toggle" title="{{ getLabel(internalSelected) }}" dropdown-toggle ng-disabled="isDisabled || emptyList">\n<span ng-if="internalSelected.color_hex_code" class="dropdown-color" ng-style="{\'background\': internalSelected.color_hex_code}"></span>\n<span ng-if="!multiple">{{ getLabel(internalSelected) }}</span>\n<span ng-if="multiple">\n<span ng-if="internalSelected.length > 1">{{ internalSelected.length }}<translate translate-context="Nice">selected</translate></span>\n<span ng-if="internalSelected.length == 1">{{ getLabel(internalSelected[0]) }}</span>\n<span ng-if="internalSelected.length == 0" translate translate-context="Nice">None</span>\n</span>\n<span class="caret"></span>\n</button>\n<ul id="{{id}}" class="dropdown-menu" role="menu">\n<li id="{{id}}-{{$index}}" ng-repeat="item in internalList" ng-click="clicked(item)">\n<a href>\n<span class="choice-checkbox" ng-if="multiple" ng-class="{ \'selected\' : isItemSelected(item) }"><i class="fa fa-check"></i></span>\n<span ng-if="item.color_hex_code" class="dropdown-color" ng-style="{\'background\': item.color_hex_code}"></span>\n<span ng-class="{\'multiple-item\': multiple}">{{ getLabel(item) }}</span>\n</a>\n</li>\n</ul>\n</div>\n<span class="input-group-btn" ng-if="addButtonEnable && !isDisabled">\n<button class="btn btn-primary" ng-click="addButtonFunction()" type="button">+</button>\n</span>\n</div>\n</div>\n</div>\n<div ng-form="formDropdown"></div>\n</div>'),$templateCache.put("src/components/nice-dropdown/nice-dropdown.html",'<div class="nice-component nice-dropdown" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[ fieldWidth ? fieldWidth : \'col-sm-8\', { \'open\': isOpen, \'nice-disabled\': isDisabled || emptyList } ]" click-outside="close()" is-open="{{ isOpen }}">\n<div class="nice-field-wrapper">\n<button type="button" class="btn btn-dropdown" ng-ref="dropdown-button" ng-click="toggle()" ng-disabled="isDisabled || emptyList">\n<div class="btn-dropdown-inside" ng-transclude="button" ng-if="selected != null">\n<span ng-if="!multiple">{{ selected[objValue] }}</span>\n<span ng-if="multiple">\n<span ng-if="selected.length > 1">{{ selected.length }} {{ selectedText }}</span>\n<span ng-if="selected.length == 1">{{ selected[0][objValue] }}</span>\n<span ng-if="selected.length == 0">{{ nullableText }}</span>\n</span>\n</div>\n<div class="not-selected" ng-if="selected == null">{{ selectText }}</div>\n<span class="caret" ng-show="!loading"></span>\n<nice-loader visible-when="!loading"></nice-loader>\n</button>\n<div class="nice-dropdown-menu-wrapper">\n<div class="nice-dropdown-menu" ng-if="isOpen">\n<div class="search-bar" ng-if="searchFunction">\n<input ng-model="internal.search" ng-model-options="{ debounce: 500 }" ng-change="handleSearch()" placeholder="{{ searchText }}">\n<span class="icon"><i class="fa fa-search"></i></span>\n</div>\n<div class="nice-dropdown-items">\n<div class="nice-no-data" ng-if="internalList && internalList.length == 0">{{ noDataText }}</div>\n<div class="nice-dropdown-item null-item" ng-if="nullable && internalList.length != 0" ng-click="handleSelected(null, -1)">\n{{ nullableText }}\n</div>\n<div class="nice-dropdown-item" ng-repeat="item in internalList" ng-click="handleSelected(item, $index)" ng-class="{ \'selected\': item._selected, \'hover\': $index == selectedIndex }">\n<span class="choice-checkbox" ng-if="multiple"><i class="fa fa-check"></i></span>\n<span ng-transclude="option">\n<span ng-class="{ \'multiple-item\': multiple }">{{ item[objValue] }}</span>\n</span>\n</div>\n</div>\n</div>\n</div>\n<button class="btn btn-primary add-btn" type="button" ng-if="addButtonFunction && !isDisabled" ng-click="addButtonFunction()">+</button>\n</div>\n</div>\n</div>\n<div ng-form="formDropdown"></div>\n</div>'),$templateCache.put("src/components/nice-dtp/nice-dtp.html",'<div class="dtp-wrapper">\n<div class="dtp" id="this.name" ng-class="{\'hidden\': !showDtp}">\n<div class="dtp-content" ng-style="dtp_content_style">\n<div class="dtp-date-view">\n<div class="dtp-header" ng-if="!inline">\n<div class="dtp-actual-day">{{actualDay}}</div>\n<div class="dtp-close" ng-if="!inline"><a href="javascript:void(0);" ng-click="onCloseClick()"><i class="fa fa-close"></i></a></div>\n</div>\n<div class="dtp-date" ng-if="!inline" ng-class="{\'hidden\': !showDateHeader}">\n<div>\n<div class="left center p10">\n<a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{\'disabled\': !btnMonthBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>\n</div>\n<div class="dtp-actual-month p80" ng-click="initDate()">{{actualMonth}}</div>\n<div class="right center p10">\n<a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{\'disabled\': !btnMonthAfterEnabled}"><i class="fa fa-chevron-right"></i></a>\n</div>\n<div class="clearfix"></div>\n</div>\n<div class="dtp-actual-num" ng-click="initDate()">{{actualNum}}</div>\n<div>\n<div class="left center p10">\n<a href="javascript:void(0);" class="dtp-select-year-before" ng-click="onYearBeforeClick()" ng-class="{\'disabled\': !btnYearBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>\n</div>\n<div class="dtp-actual-year p80" ng-click="initDate()">{{actualYear}}</div>\n<div class="right center p10">\n<a href="javascript:void(0);" class="dtp-select-year-after" ng-click="onYearAfterClick()" ng-class="{\'disabled\': !btnYearAfterEnabled}"><i class="fa fa-chevron-right"></i></a>\n</div>\n<div class="clearfix"></div>\n</div>\n</div>\n<div class="dtp-time" ng-show="!showTimeHeader">\n<div class="dtp-actual-maxtime">\n<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==1}" ng-click="initHours()" href="javascript:void(0);">{{actualTime.hours}}</a>:<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==2}" ng-click="initMinutes()" href="javascript:void(0);">{{actualTime.minutes}}</a>\n</div>\n</div>\n<div class="dtp-picker">\n<div class="dtp-picker-calendar" ng-class="{\'hidden\': !showCalendar}">\n<div>\n<div ng-if="inline" class="left center p10">\n<a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{\'disabled\': !btnMonthBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>\n</div>\n<div class="dtp-picker-month" ng-class="{\'p80\': inline}">{{monthAndYear}}</div>\n<div class="right center p10" ng-if="inline">\n<a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{\'disabled\': !btnMonthAfterEnabled}"><i class="fa fa-chevron-right"></i></a>\n</div>\n</div>\n<table class="table dtp-picker-days">\n<thead>\n<th ng-repeat="weekDay in weekDays track by $index">{{weekDay}}</th>\n</thead>\n<tbody>\n<tr ng-repeat="week in weeks">\n<td ng-repeat="day in week">\n<span ng-if="day.disabled" class="dtp-select-day">{{day.label}}</span>\n<a ng-if="!day.disabled" ng-click="onSelectDate(day)" href="javascript:void(0);" class="dtp-select-day" ng-class="{\'selected\': day.selected}">{{day.label}}</a>\n</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class="dtp-picker-datetime" ng-class="{\'hidden\': !showTime}">\n<div class="dtp-actual-meridien">\n<div class="dtp-actual-time p60" ng-show="showTimeHeader">\n<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==1}" ng-click="initHours()" href="javascript:void(0);">{{actualTime.hours}}</a>:<a class="dtp-hours-minutes-btn" ng-class="{\'selected\': currentView==2}" ng-click="initMinutes()" href="javascript:void(0);">{{actualTime.minutes}}</a>\n</div>\n<div class="clearfix"></div>\n</div>\n<div class="dtp-picker-clock">\n<div class="dtp-hand dtp-hour-hand" ng-show="currentView==1"></div>\n<div class="dtp-hand dtp-minute-hand" ng-show="currentView==2"></div>\n<div class="dtp-clock-center"></div>\n<div ng-repeat="hour in hours" class="dtp-picker-time" ng-style="hour.style">\n<a href="javascript:void(0);" class="dtp-select-hour" ng-class="{\'selected\': hour.selected, \'disabled\': hour.disabled}" ng-click="onSelectHour(hour)">{{hour.h}}</a>\n</div>\n<div ng-repeat="minute in minutes" class="dtp-picker-time" ng-style="minute.style">\n<a href="javascript:void(0);" class="dtp-select-minute" ng-class="{\'selected\': minute.selected, \'disabled\': minute.disabled}" ng-click="onSelectMinute(minute)">{{minute.m}}</a>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-help/nice-help.html",'<div class="nice-help">\n<i class="fa fa-question-circle"></i>\n<div class="help-window" ng-bind-html="text">{{ text }}</div>\n</div>\n'),$templateCache.put("src/components/nice-input/nice-input.html",'<ng-form class="nice-component nice-input" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="forma">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="form-group" ng-class="{\n \'has-feedback\': showValid && !hideValid,\n \'has-warning\': !isDisabled && forma.$invalid && forma.$dirty && !hideValid,\n \'has-success\': !isDisabled && forma.$valid && forma.$dirty && showValid,\n \'symbol\': symbol,\n \'nice-disabled\': isDisabled\n }">\n<textarea ng-show="textArea" class="form-control" ng-model="model" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{textAreaLines}}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>\n<input ng-show="!textArea" class="form-control" type="{{ internalType }}" ng-model="model" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled">\n<span class="input-group-addon" ng-if="symbol">{{ symbol }}</span>\n</div>\n<div ng-if="forma.$error && forma.$dirty">\n<div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate translate-context="Nice">Email is not valid.</div>\n<div class="error-message" ng-if="forma.$dirty && forma.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>\n<div class="error-message" ng-if="forma.$error.minlength"><translate translate-context="Nice">Your input is too short. It must contain at least</translate> {{ minlength }} <translate translate-context="Nice">characters</translate>.</div>\n<div class="error-message" ng-if="forma.$error.maxlength" translate translate-context="Nice">Your input is too long</div>\n<div class="error-message" ng-if="forma.$error.required" ng-if="forma.$dirty" translate translate-context="Nice">This field is required.</div>\n<div class="error-message" ng-if="forma.$error.unique" translate translate-context="Nice">This field must be unique.</div>\n</div>\n</div>\n</div>\n</ng-form>\n'),$templateCache.put("src/components/nice-label/nice-label.html",'<div class="nice-component nice-label" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}</div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-xs-8\'">\n<p class="value">{{ value }}</p>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-loader/nice-loader.html",'<div class="nice-loader" ng-if="!visibleWhen" ng-class="[addClass, { \'nice-loader-fullscreen\': fullscreen, \'nice-loader-fulldiv\': fulldiv }]">\n<svg version="1.1" id="loader" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">\n<path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path>\n</svg>\n<div class="nice-loader-message" ng-if="message">{{ message }}</div>\n<ng-transclude></ng-transclude>\n</div>'),$templateCache.put("src/components/nice-notification/nice-notification.html",'<div class="notification">\n<h3 ng-show="title" ng-bind-html="title"></h3>\n<div class="message" ng-bind-html="message"></div>\n</div>'),$templateCache.put("src/components/nice-number/nice-number.html",'<div class="nice-component nice-number" ng-form="niceNumberForm" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div ng-class="{\'row\' : !disableRow}">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group" ng-class="{\'has-warning\': !disabled && niceNumberForm.$invalid && niceNumberForm.$dirty}">\n<span class="input-group-btn">\n<button class="btn btn-default" type="button" ng-disabled="!canSubstract" ng-click="subtract()">-</button>\n</span>\n<input type="number" step="{{ step }}" ng-change="inputChanged()" class="form-control" max="{{ max }}" min="{{ min }}" ng-model="model">\n<span class="input-group-btn">\n<button class="btn btn-default" type="button" ng-disabled="!canAdd" ng-click="add()">+</button>\n</span>\n</div>\n<div class="error-messages" ng-if="niceNumberForm.$error && !hideError" ng-class="{ \'floating-error\': floatingError }">\n<div class="error-message" ng-if="niceNumberForm.$dirty && niceNumberForm.$error.number" translate translate-context="Nice">This field requires a number</div>\n<div class="error-message" ng-if="niceNumberForm.$error.min">\n<translate translate-context="Nice">Minimum value is</translate>{{ min }}\n</div>\n<div class="error-message" ng-if="niceNumberForm.$error.max">\n<translate translate-context="Nice">Maximum value is</translate>{{ max }}\n</div>\n<div class="error-message" ng-if="niceNumberForm.$error.zero">\n<translate translate-context="Nice">0 is not allowed</translate>\n</div>\n<div class="error-message" ng-if="niceNumberForm.$error.no-value && !niceNumberForm.$error.zero && !niceNumberForm.$error.min && !niceNumberForm.$error.max">\n<translate translate-context="Nice">Value is missing</translate>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-percent/nice-percent.html",'<ng-form class="nice-component nice-input" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group has-feedback symbol" ng-class="{\n \'has-warning\': !isDisabled && form.$invalid && form.$dirty && !hideValid,\n \'has-success\': !isDisabled && form.$valid && form.$dirty && showValid,\n \'disabled\': isDisabled\n }">\n<input class="form-control" type="text" max="100" min="0" ng-model="internalModel" placeholder="{{ placeholder }}" ng-required="required" ng-keypress="keypress($event)" ng-change="change()" ng-disabled="isDisabled">\n<span class="input-group-addon">%</span>\n</div>\n<div ng-if="form.$error">\n<div class="error-message" ng-if="form.$dirty && form.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>\n<div class="error-message" ng-if="form.$dirty && form.$error.required" translate translate-context="Nice">This field is required.</div>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-progress-bar/nice-progress-bar.html",'<div class="nice-component nice-progress-bar" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="progress">\n<div class="progress-value">{{ value }} / {{ max }}</div>\n<div class="progress-bar" ng-style="{\'width\': percentage+\'%\', \'background\': color}">\n<div class="progress-value" ng-style="{\'width\': width+\'px\'}">{{ value }} / {{ max }}</div>\n</div>\n</div>\n</div>\n</div>\n</div>'),$templateCache.put("src/components/nice-quantity/nice-quantity.html",'<div class="nice-component nice-quantity" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="input-group">\n<span class="input-group-btn">\n<button class="btn btn-primary btn-left" ng-click="sub()" type="button" ng-disabled="isDisabled">-</button>\n</span>\n<input class="value form-control" ng-model="model" type="number" ng-change="handleChange()" ng-disabled="isDisabled">\n<span class="input-group-btn">\n<button class="btn btn-primary btn-right" ng-click="add()" type="button" ng-disabled="isDisabled">+</button>\n</span>\n</div>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-search/nice-search.html",'<ng-form class="nice-component nice-input nice-search" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline}" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<div class="input-group" ng-class="{\n \'disabled\': isDisabled,\n \'has-warning\': !isDisabled && form.$invalid && form.$dirty,\n \'has-success\': !isDisabled && form.$valid && form.$dirty}\n ">\n<input class="form-control" type="text" id="{{ id }}" ng-model="modelString" ng-keypress="keypress($event)" placeholder="{{ placeholder }}" ng-disabled="isDisabled" ng-change="updateSearch()" ng-required="required" tabindex="{{ tabIndex }}">\n<span class="input-group-addon clickable" ng-click="search()" ng-if="!model">\n<i ng-show="!loading" class="fa fa-search"></i>\n<i ng-show="loading" class="fa fa-refresh fa-spin"></i>\n</span>\n<span class="input-group-addon clickable" ng-click="remove()" ng-if="model">\n<i ng-show="!loading" class="fa fa-remove"></i>\n</span>\n</div>\n</div>\n</div>\n<div class="row">\n<div ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title"></div>\n<div ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="nice-dropdown-empty" ng-if="noResults">\n<div class="nice-search-row" translate translate-context="Nice">No results found.</div>\n</div>\n<div class="nice-dropdown" ng-if="results.length">\n<div ng-repeat="result in results" class="nice-search-row" ng-class="{\'active\': selectedIndex == $index}" ng-click="selectRow(result)">\n<span class="text-bold">{{ result[keyForInputLabel] }}</span>\n</div>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-search2/nice-search2.html",'<ng-form class="nice-component nice-input nice-search2" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}</div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]" click-outside="close()">\n<div class="nice-search-button input-group" ng-class="{ \'disabled\': isDisabled, \'has-warning\': !isDisabled && form.$invalid && form.$dirty, \'has-success\': !isDisabled && form.$valid && form.$dirty}">\n<input class="form-control" type="text" id="{{ id }}" ng-model="model" placeholder="{{ placeholder }}" ng-disabled="isDisabled" ng-change="updateSearch()" ng-focus="onFocus()" tabindex="{{ tabIndex }}">\n<span class="input-group-addon clickable" ng-click="onFocus()">\n<i ng-show="!loading" class="fa fa-search"></i>\n<i ng-show="loading" class="fa fa-refresh fa-spin"></i>\n</span>\n</div>\n<div class="nice-search-dropdown-wrapper">\n<div class="nice-search-dropdown" ng-if="showDropdown && isOpen">\n<div class="nice-search-row nice-search-row-loading" ng-if="loading && results.length == 0">\n<nice-loader visible-when="!loading"></nice-loader>\n</div>\n<div class="nice-search-row nice-search-row-empty" ng-if="!loading && results.length == 0" translate translate-context="Nice">No results found.</div>\n<div ng-repeat="result in results" class="nice-search-row" ng-class="{\'active\': selectedIndex == $index}" ng-click="selectItem(result)">\n<ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>\n</div>\n</div>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-slot/nice-slot.html",'<div class="nice-component nice-slot" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'">\n<div class="nice-title-text" ng-if="title">{{ title }}</div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-xs-8\'">\n<ng-transclude></ng-transclude>\n</div>\n</div>\n</div>\n'),$templateCache.put("src/components/nice-time-picker/nice-time-picker.html",'<div class="nice-component nice-time-picker" ng-form="forma" ng-class="{ \'margin-bottom-0\': noMargin, \'nice-component-inline\': isInline }">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="input-group" ng-class="{\n \'has-warning\': !isDisabled && forma.$invalid && forma.$dirty,\n \'disabled\': isDisabled\n }">\n<input type="text" class="form-control" ng-model="modelString" ng-keyup="$event.keyCode == 13 && validateDate()" ng-blur="validateDate()">\n<span class="input-group-addon clickable" ng-click="open = !open"><i class="fa fa-clock-o"></i></span>\n</div>\n<div class="nice-time-picker-dropdown" ng-if="open">\n<div class="row">\n<div class="col-xs-6">\n<button ng-click="changeHour(true)"><i class="fa fa-chevron-up"></i></button>\n</div>\n<div class="col-xs-6">\n<button ng-click="changeMinutes(true)"><i class="fa fa-chevron-up"></i></button>\n</div>\n</div>\n<div class="row numbers">\n<div class="col-xs-6">{{ hours }}</div>\n<div class="col-xs-6">{{ minutes }}</div>\n</div>\n<div class="row">\n<div class="col-xs-6">\n<button ng-click="changeHour(false)"><i class="fa fa-chevron-down"></i></button>\n</div>\n<div class="col-xs-6">\n<button ng-click="changeMinutes(false)"><i class="fa fa-chevron-down"></i></button>\n</div>\n</div>\n</div>\n</div>\n</div>\n<div class="nice-background" ng-click="close()" ng-if="open"></div>\n</div>'),$templateCache.put("src/components/nice-upload/nice-upload.html",'<ng-form class="nice-component nice-upload" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" name="form">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : \'col-sm-8\', { \'nice-disabled\': isDisabled }]">\n<input class="input-file" type="file" accept="{{ accept }}" ng-model="file" ng-disabled="isDisabled">\n<div class="input-area">\n<div class="middle-text" ng-if="!imageSource && !loading">\n<div class="text">{{ text }}</div>\n<div class="error" ng-if="error">{{ error }}</div>\n</div>\n<img ng-if="imageSource" data-ng-src="{{ imageSource }}">\n</div>\n<div class="loading" ng-if="loading">\n<nice-loader></nice-loader>\n</div>\n</div>\n</div>\n</ng-form>'),$templateCache.put("src/components/nice-yesno/nice-yesno.html",'<div class="nice-component nice-yesno" ng-class="{ \'margin-bottom-0\' : noMargin, \'nice-component-inline\': isInline }" ng-form="formYesno">\n<div class="row">\n<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : \'col-sm-4\'" ng-if="title">\n<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>\n<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>\n</div>\n<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : \'col-sm-8\'">\n<div class="yesno-wrapper noselect" ng-class="{ \'disabled\': isDisabled }">\n<div class="yesno-yes-bg" ng-click="switch()">{{ yes }}</div>\n<div class="yesno-no-bg" ng-click="switch()">{{ no }}</div>\n<div class="yesno-button" ng-class="buttonClass" ng-click="switch()">{{ state }}</div>\n</div>\n</div>\n</div>\n</div>')}]);
|