info.js 83.1 KB
webpackJsonp([1],[function(e,t,a){(function(e){"use strict";var t=a(1),i=t(".gender"),n=t("#gender"),o=t(".mask"),s=t("form"),r=t(".birthday-div span");a(2),e.jQuery=t,e.$=t,a(4),a(5),t(function(){var e=t(".birthday-picker");n.val(i.find(".checked").data("gender")),i.on("click",".icon",function(){i.find(".check").removeClass("checked"),t(this).find(".check").addClass("checked"),n.val(i.find(".checked").data("gender"))}),o.on("click",".close",function(){o.addClass("hide")}),t(".submit").on("click",function(){return s.find('[name="nick"]').val()&&s.find('[name="birthday"]').val()?void s.submit():void o.removeClass("hide")}),t(".birthday-input").on("change",function(){r.html(t(this).val())}),e.AnyPicker({mode:"datetime",theme:"iOS",selectedDate:new Date(e.data("number")),dateTimeFormat:"yyyy年MM月dd日",lang:"zh-cn",minValue:new Date("1900-01-01"),maxValue:new Date("2015-12-31")})})}).call(t,function(){return this}())},,,,function(e,t,a){var i,n,o;!function(){"use strict";function s(e,t){var a=this;a.elem=e;var i=void 0!==t.lang||null!==t.lang?t.lang:$.CalenStyle.defaults.lang,n=$.extend(!0,{},$.AnyPicker.defaults.i18n,t.i18n,$.AnyPicker.i18n[i]),o=$.extend(!0,{},$.AnyPicker.defaults);n={i18n:n},o.i18n={},t.i18n={},a.setting=$.extend({},o,t,n),a.tmp=$.extend({},$.AnyPicker.tempDefaults),a.tmp.overlayClass="ap-overlay-"+a.setting.timestamp,a.tmp.overlaySelector="."+a.tmp.overlayClass,a.tmp.sOrientation=a._getDeviceOrientation(),$.CF.isValid(t.headerTitle)&&(a.tmp.headerTitleDefined=!0),$.CF.compareStrings(a.setting.theme,"Android")?($.CF.isValid(t.rowHeight)||(a.setting.rowHeight=50),$.CF.isValid(t.visibleRows)||(a.setting.visibleRows=3)):$.CF.compareStrings(a.setting.theme,"iOS")?($.CF.isValid(t.rowHeight)||(a.setting.rowHeight=36),$.CF.isValid(t.visibleRows)||(a.setting.visibleRows=5),$.CF.isValid(t.viewSections)||(a.setting.viewSections={header:["cancelButton","headerTitle","setButton"],contentTop:[],contentBottom:[],footer:[]}),$.AnyPicker.extra.bIsiPad&&(a.tmp.bIsiPad=!0),a.tmp.bIsiPad&&$.CF.compareStrings(a.setting.layout,"popup")&&(a.setting.layout="popover")):$.CF.compareStrings(a.setting.theme,"Windows")&&(a.setting.layout="popup",a.setting.visibleRows=5,a.setting.rowHeight=100,$.CF.isValid(t.viewSections)||(a.setting.viewSections={header:["headerTitle"],contentTop:[],contentBottom:[],footer:["setButton","cancelButton"]}),$.CF.isValid(t.setButton)&&(a.tmp.bModified.set=!0),$.CF.isValid(t.cancelButton)&&(a.tmp.bModified.cancel=!0),$.CF.isValid(t.nowButton)&&(a.tmp.bModified.now=!0),$.CF.isValid(t.clearButton)&&(a.tmp.bModified.clear=!0)),a.tmp.iExt=Math.floor(a.setting.visibleRows/2),a.tmp.sDir=a.setting.rtl?"rtl":"ltr",$.AnyPicker.extra.dToday=a._getCurrentDate(),null===a.tmp.selectedDate&&(a.tmp.selectedDate=$.AnyPicker.extra.dToday),0===a.setting.maxYear&&(a.setting.maxYear=$.AnyPicker.extra.dToday.getFullYear()),$.CF.isValid(a.setting.components)&&0===a.tmp.numOfComp&&(a.tmp.numOfComp=a.setting.components.length),$.AnyPicker.extra.sStartEv=$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bHasIE10Pointer?"MSPointerDown":"pointerdown":$.AnyPicker.extra.bIsTouchDevice?"touchstart":"mousedown touchstart",$.AnyPicker.extra.sMoveEv=$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bHasIE10Pointer?"MSPointerMove":"pointermove":$.AnyPicker.extra.bIsTouchDevice?"touchmove":"mousemove touchmove",$.AnyPicker.extra.sEndEv=$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bHasIE10Pointer?"MSPointerUp":"pointerup":$.AnyPicker.extra.bIsTouchDevice?"touchend":"mouseup touchend",$.AnyPicker.extra.sLeaveEv=$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bHasIE10Pointer?"MSPointerLeave":"pointerleave":$.AnyPicker.extra.bIsTouchDevice?null:"mouseleave",$.AnyPicker.extra.sCancelEv=$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bHasIE10Pointer?"MSPointerCancel":"pointercancel":null,$.AnyPicker.extra.sOutEv=$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bHasIE10Pointer?"MSPointerOut":"pointerout":null}$.CF={setPropertiesStyle:function(e,t){var a=window.getComputedStyle(document.documentElement,"");for(var i in t)if(void 0!==a[t[i]]){var n="";return-1!==t[i].search("Webkit")?n="-webkit-":-1!==t[i].search("Moz")?n="-moz-":-1!==t[i].search("O")?n="-o-":-1!==t[i].search("ms")&&(n="-ms-"),n+e}},testProperties:function(e,t,a){var i=window.getComputedStyle(document.documentElement,"");for(var n in t)if(void 0!==i[t[n]])return a?t[n]:!0;return a?"":!1},compareDataType:function(e,t){return typeof e===t.toLocaleLowerCase()?!0:!1},compareStrings:function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t?"string"==typeof e&&"string"==typeof t&&e.toLocaleLowerCase()===t.toLocaleLowerCase()?!0:!1:null===e&&null===t||void 0===e&&void 0===t?!0:!1},isValid:function(e){return void 0!==e&&null!==e&&""!==e?!0:!1}},$.AnyPicker=$.AnyPicker||{name:"AnyPicker",version:"1.0.0",i18n:{},defaults:{mode:"datetime",parent:"body",layout:"popup",hAlign:"left",vAlign:"bottom",relativeTo:null,inputElement:null,inputChangeEvent:"onSet",lang:"",rtl:!1,animationDuration:500,setButton:{markup:"<a id='ap-button-set' class='ap-button'>Set</a>",markupContentWindows:"<span class='ap-button-icon ap-icon-set'></span><span class='ap-button-text'>set</span>",type:"Button"},clearButton:{markup:"<a id='ap-button-clear' class='ap-button'>Clear</a>",markupContentWindows:"<span class='ap-button-icon ap-icon-clear'></span><span class='ap-button-text'>clear</span>",type:"Button"},nowButton:{markup:"<a id='ap-button-now' class='ap-button'>Now</a>",markupContentWindows:"<span class='ap-button-icon ap-icon-now'></span><span class='ap-button-text'>now</span>",type:"Button"},cancelButton:{markup:"<a id='ap-button-cancel' class='ap-button'>Cancel</a>",markupContentWindows:"<span class='ap-button-icon ap-icon-cancel'></span><span class='ap-button-text'>cancel</span>",type:"Button"},headerTitle:{markup:"<span class='ap-header__title'>Select</span>",type:"Text",contentBehaviour:"Static",format:""},viewSections:{header:["headerTitle"],contentTop:[],contentBottom:[],footer:["cancelButton","setButton"]},i18n:{headerTitle:"Select",setButton:"Set",clearButton:"Clear",nowButton:"Now",cancelButton:"Cancel",dateSwitch:"Date",timeSwitch:"Time"},theme:"Default",onInit:null,onBeforeShowPicker:null,onShowPicker:null,onBeforeHidePicker:null,onHidePicker:null,parseInput:null,formatOutput:null,setOutput:null,onSetOutput:null},tempDefaults:{sOrientation:"portrait",overlayClass:"",overlaySelector:"",iExt:2,dir:"ltr",sElemTag:"",oElemValid:{bIsInput:!1,bIsListItem:!1,bIsSelect:!1},sInputElemTag:"",oInputElemValid:{bIsInput:!1,bIsListItem:!1,bIsSelect:!1},prevActive:null,bFirst:!0,sDateTimeTab:"date",iCompDragStart:0,headerTitleDefined:!1,bIsiPad:!1,bModified:{set:!1,cancel:!1,clear:!1,now:!1},tabKey:!1},extra:{sArrModes:["select","datetime"],sArrLayout:["popup","relative","fixed","inline"],sArrHAlign:["left","center","right"],sArrVAlign:["top","middle","bottom"],sArrViewSections:["header","contentTop","contentBottom","footer"],oArrInputChangeEvent:["onChange","onSet"],sArrThemes:["Default","iOS","Android","Windows"],bIsTouchDevice:"ontouchstart"in document.documentElement,sClickHandler:("ontouchstart"in document.documentElement,"click"),sClickHandlerButtons:"ontouchstart"in document.documentElement?"touchstart":"click",bHasCSS3D:$.CF.testProperties("perspective",["WebkitPerspective","MozPerspective","OPerspective","msPerspective","perspective","perspectiveProperty"],!1),sCSSTransform:$.CF.testProperties("transform",["WebkitTransform","MozTransform","OTransform","msTransform","transform"],!0),sCSSTransformStyle:$.CF.setPropertiesStyle("transform",["WebkitTransform","MozTransform","OTransform","msTransform","transform"]),sCSSTransition:$.CF.testProperties("transition",["WebkitTransition","MozTransition","OTransition","msTransition","transition"],!0),bHasCSSAnimation:$.CF.testProperties("animation",["WebkitAnimation","MozAnimation","OAnimation","msAnimation","animation"],!1),sMouseWheel:"onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],bHasIE10Pointer:window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,bHasPointer:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,bIsiPad:null!==navigator.userAgent.match(/iPad/i)}},function(s){n=[a(1)],i=s,o="function"==typeof i?i.apply(t,n):i,!(void 0!==o&&(e.exports=o))}(function(e){e.fn.AnyPicker=function(t){var a,i,n=e(this).data(),o=Object.keys(n);if(null===t||void 0===t)if(o.length>0){for(a in o)if(i=o[a],-1!==i.search("plugin_AnyPicker_"))return n[i]}else console.log("No AnyPicker Object Defined For This Element");else{if("string"!=typeof t)return this.each(function(){var r=(new Date).getTime();if(e.data(this,"plugin_AnyPicker_"+r))if(o.length>0){for(a in o)if(i=o[a],-1!==i.search("plugin_AnyPicker_"))return n[i]}else console.log("No AnyPicker Object Defined For This Element");else t.timestamp=r,n=new s(this,t),e.data(this,"plugin_AnyPicker_"+r,n),n.init()});if(null!==n||void 0!==n)if(o.length>0){if("destroy"===t)if(o.length>0){for(a in o)if(i=o[a],-1!==i.search("plugin_AnyPicker_")){n=n[i],e(window).off("blur."+n.setting.timestamp);var r=e(n.setting.inputElement);e(r).off("focus."+n.setting.timestamp),e(r).off("blur."+n.setting.timestamp),e(".ap-overlay-"+i.replace("plugin_AnyPicker_","")).remove(),e(this).removeData(i);break}}else console.log("No AnyPicker Object Defined For This Element")}else console.log("No AnyPicker Object Defined For This Element")}}}),s.prototype={init:function(){var e=this;if($.CF.isValid(e.elem)&&(e.tmp.sElemTag=$(e.elem).prop("tagName").toLowerCase(),"input"===e.tmp.sElemTag?e.tmp.oElemValid.bIsInput=!0:"ul"===e.tmp.sElemTag||"ol"===e.tmp.sElemTag||"dl"===e.tmp.sElemTag?e.tmp.oElemValid.bIsListItem=!0:"select"===e.tmp.sElemTag&&(e.tmp.oElemValid.bIsSelect=!0)),$.CF.isValid(e.setting.inputElement)?(e.tmp.sInputElemTag=$(e.setting.inputElement).prop("tagName").toLowerCase(),"input"===e.tmp.sInputElemTag?e.tmp.oInputElemValid.bIsInput=!0:"ul"===e.tmp.sInputElemTag||"ol"===e.tmp.sInputElemTag||"dl"===e.tmp.sInputElemTag?e.tmp.oInputElemValid.bIsListItem=!0:"select"===e.tmp.sInputElemTag&&(e.tmp.oInputElemValid.bIsSelect=!0)):$.CF.isValid(e.elem)&&(e.setting.inputElement=e.elem,e.tmp.sInputElemTag=e.tmp.sElemTag,e.tmp.oInputElemValid=e.tmp.oElemValid),$.CF.compareStrings(e.setting.mode,"select")?e.__setComponentsOfSelect():$.CF.compareStrings(e.setting.mode,"datetime")&&e.__setComponentsOfDateTimePicker(),""!==e.tmp.sInputElemTag&&!e.tmp.oInputElemValid.bIsListItem&&!e.tmp.oInputElemValid.bIsSelect){var t=$(e.setting.inputElement);e.tmp.oInputElemValid.bIsInput?(t.off("focus."+e.setting.timestamp),t.on("focus."+e.setting.timestamp,{apo:e},e._inputElementClicked),t.on("blur."+e.setting.timestamp,function(t){$.AnyPicker.tempDefaults.tabKey&&e.showOrHidePicker(),e.tmp.prevActive=null}),t.on("keydown."+e.setting.timestamp,function(e){"9"===(e.keyCode?e.keyCode:e.which)&&($.AnyPicker.tempDefaults.tabKey=!0)})):(t.off("click."+e.setting.timestamp),t.on("click."+e.setting.timestamp,{apo:e},e._inputElementClicked))}$.CF.isValid(e.setting.onInit)&&e.setting.onInit.call(e)},_inputElementClicked:function(e){e.stopPropagation(),e.preventDefault();var t=e.data.apo;if(document.activeElement!==t.tmp.prevActive||document.activeElement!==t.setting.inputElement)if(t.tmp.prevActive=document.activeElement,""===t.tmp.sInputElemTag||t.tmp.oInputElemValid.bIsListItem||t.tmp.oInputElemValid.bIsSelect)console.log("No InputElement Specified");else{var a,i=$(t.setting.inputElement);if(t.tmp.oInputElemValid.bIsInput)a=i.val();else{var n=i.attr("data-val");a=$.CF.isValid(n)?n:i.text()}$.AnyPicker.tempDefaults.tabKey?($.AnyPicker.tempDefaults.tabKey=!1,setTimeout(function(){t.showOrHidePicker(a)},500)):t.showOrHidePicker(a)}},showOrHidePicker:function(e){var t,a,i,n=this,o=[],s=[];if(void 0!==e&&null!==e)if($.CF.isValid(n.setting.parseInput)){if($.CF.compareStrings(n.setting.mode,"datetime"))n.setting.selectedDate=n.setting.parseInput.call(n,e);else if($.CF.compareStrings(n.setting.mode,"select")){for(o=n.setting.parseInput.call(n,e),t=0;t<o.length;t++)a=o[t],i=n.__getDataSourceValueFromLabel(a,t,!0),s.push({component:t,val:i,label:a});n.tmp.selectedValues.values=s}}else if($.CF.compareStrings(n.setting.mode,"datetime"))n.setting.selectedDate=e;else if($.CF.compareStrings(n.setting.mode,"select")){if(""!==e)for(o=[],s=[],n.tmp.numOfComp>1?o=e.split(" "):o.push(e),t=0;t<o.length;t++)a=o[t],i=n.__getDataSourceValueFromLabel(a,t,!0),s.push({component:t,val:i,label:a});else for(t=0;t<n.tmp.numOfComp;t++){var r=n.setting.dataSource[t].data;a=r[0].label,i=r[0].val,s.push({component:t,val:i,label:a})}n.tmp.selectedValues.values=s}$(n.tmp.overlaySelector).length>0?n._hidePicker():n._showPicker()},_showPicker:function(){var e=this;e.tmp.sOrientation=e._getDeviceOrientation(),$.CF.isValid(e.setting.onBeforeShowPicker)&&e.setting.onBeforeShowPicker.call(e);var t="",a=($.CF.compareStrings(e.setting.layout,"popup")||$.CF.compareStrings(e.setting.layout,"popover"))&&e.setting.viewSections.header.length>0,i=($.CF.compareStrings(e.setting.layout,"popup")||$.CF.compareStrings(e.setting.layout,"popover"))&&e.setting.viewSections.footer.length>0,n=$.CF.compareStrings(e.setting.layout,"fixed")&&$.CF.compareStrings(e.setting.vAlign,"bottom")&&e.setting.viewSections.footer.length>0,o=$.CF.compareStrings(e.setting.layout,"fixed")&&$.CF.compareStrings(e.setting.vAlign,"top")&&e.setting.viewSections.footer.length>0,s=$.CF.compareStrings(e.setting.mode,"datetime")&&"datetime"===e.tmp.sDateTimeMode,r="ap-layout-"+e.setting.layout,l="ap-theme-"+e.setting.theme.toLowerCase(),m="ap-dir-"+e.tmp.sDir;if($.CF.compareStrings(e.setting.layout,"popover")){var p=$("body").scrollTop(),c=$(window).height(),d=p,u=p+c,g=$.CF.compareStrings(e.setting.rowsNavigation,"scroller")?300:350,f=$(e.setting.inputElement).offset().top-g,h=d>f?!1:!0,v=$(e.setting.inputElement).offset().top+$(e.setting.inputElement).height()+g,D=v>u?!1:!0;e.tmp.sTooltip=D?"bottom":h?"top":e.setting.rtl?"right":"left"}t+="<div class='ap-overlay "+r+" "+e.tmp.overlayClass+" "+l+" "+m+"'>",t+="<div class='ap-bg'>",t+="<div class='ap-cont' dir='"+e.tmp.sDir+"'>",$.CF.isValid(e.tmp.sTooltip)&&(t+="<span class='ap-tooltip ap-tooltip-"+e.tmp.sTooltip+"'></span>"),a&&(t+="<div class='ap-header'>",s&&$.CF.compareStrings(e.setting.theme,"Windows")&&(t+="<div class='ap-content-switch'>",e.setting.rtl?(t+="<span class='ap-content-switch-tab ap-content-switch-time'>"+e.setting.i18n.timeSwitch+"</span>",t+="<span class='ap-content-switch-tab ap-content-switch-date ap-content-switch-selected'>"+e.setting.i18n.dateSwitch+"</span>"):(t+="<span class='ap-content-switch-tab ap-content-switch-date ap-content-switch-selected'>"+e.setting.i18n.dateSwitch+"</span>",t+="<span class='ap-content-switch-tab ap-content-switch-time'>"+e.setting.i18n.timeSwitch+"</span>"),t+="</div>",e.tmp.sDateTimeTab="time"),t+="</div>"),n&&(t+="<div class='ap-footer ap-footer-top'>",$.CF.compareStrings(e.setting.theme,"Default")&&(t+="<div class='ap-button-cont'></div>"),t+="</div>"),t+="<div class='ap-content'>",e.setting.viewSections.contentTop.length>0&&(t+="<div class='ap-content-top'></div>"),s&&!$.CF.compareStrings(e.setting.theme,"Windows")&&(t+="<div class='ap-content-switch'>",e.setting.rtl?(t+="<span class='ap-content-switch-tab ap-content-switch-time'>"+e.setting.i18n.timeSwitch+"</span>",t+="<span class='ap-content-switch-tab ap-content-switch-date ap-content-switch-selected'>"+e.setting.i18n.dateSwitch+"</span>"):(t+="<span class='ap-content-switch-tab ap-content-switch-date ap-content-switch-selected'>"+e.setting.i18n.dateSwitch+"</span>",t+="<span class='ap-content-switch-tab ap-content-switch-time'>"+e.setting.i18n.timeSwitch+"</span>"),t+="</div>",e.tmp.sDateTimeTab="date"),t+="<div class='ap-content-middle'>",t+="<div class='ap-component-section'></div>",t+="</div>",e.setting.viewSections.contentBottom.length>0&&(t+="<div class='ap-content-bottom'></div>"),t+="</div>",(i||o)&&(t+="<div class='ap-footer ap-footer-bottom'>",$.CF.compareStrings(e.setting.theme,"Default")&&(t+="<div class='ap-button-cont'></div>"),t+="</div>"),t+="</div>",t+="</div>",t+="</div>",$(e.setting.parent).append(t),"popover"===e.setting.layout&&$("body").addClass("noscroll"),$.AnyPicker.extra.bHasCSSAnimation?($(e.tmp.overlaySelector).addClass("ap-show"),$(e.tmp.overlaySelector).css({display:"block"}),$.CF.compareStrings(e.setting.layout,"fixed")&&($.CF.compareStrings(e.setting.vAlign,"top")?$(e.tmp.overlaySelector).find(".ap-cont").addClass("ap-top-slide-down"):$.CF.compareStrings(e.setting.vAlign,"bottom")&&$(e.tmp.overlaySelector).find(".ap-cont").addClass("ap-bottom-slide-up")),setTimeout(function(){$(e.tmp.overlaySelector).css({opacity:1}),$(e.tmp.overlaySelector).removeClass("ap-show"),$.CF.compareStrings(e.setting.layout,"fixed")&&($.CF.compareStrings(e.setting.vAlign,"top")?($(e.tmp.overlaySelector).find(".ap-cont").removeClass("ap-top-slide-down"),$(e.tmp.overlaySelector+" .ap-cont").css({top:0})):$.CF.compareStrings(e.setting.vAlign,"bottom")&&($(e.tmp.overlaySelector).find(".ap-cont").removeClass("ap-bottom-slide-up"),$(e.tmp.overlaySelector+" .ap-cont").css({bottom:0})))},e.setting.animationDuration)):$(e.tmp.overlaySelector).show(0),$.CF.isValid(e.setting.onShowPicker)&&e.setting.onShowPicker.call(e),e._adjustPicker(),e._addViewSectionComponents(),e.__initComponents(),e._adjustPicker(),$.CF.compareStrings(e.setting.mode,"datetime")&&"datetime"===e.tmp.sDateTimeMode&&e._setDateTimeTabs(e.tmp.sDateTimeTab)},_hidePicker:function(){var e=this;$(e.tmp.overlaySelector).length>0&&($.CF.isValid(e.setting.onBeforeHidePicker)&&e.setting.onBeforeHidePicker.call(e),$.AnyPicker.extra.bHasCSSAnimation?($(e.tmp.overlaySelector).addClass("ap-hide"),$.CF.compareStrings(e.setting.layout,"fixed")&&($.CF.compareStrings(e.setting.vAlign,"top")?$(e.tmp.overlaySelector).find(".ap-cont").addClass("ap-top-slide-up"):$.CF.compareStrings(e.setting.vAlign,"bottom")&&$(e.tmp.overlaySelector).find(".ap-cont").addClass("ap-bottom-slide-down")),setTimeout(function(){$(e.tmp.overlaySelector).remove()},e.setting.animationDuration)):($(e.tmp.overlaySelector).hide(0),setTimeout(function(){$(e.tmp.overlaySelector).remove()},e.setting.animationDuration)),"popover"===e.setting.layout&&$("body").removeClass("noscroll"),e.tmp.prevActive=null,$.CF.isValid(e.setting.onHidePicker)&&e.setting.onHidePicker.call(e))},_adjustPicker:function(e){var t=this;if($.CF.compareStrings(t.setting.theme,"Windows")){e=$.CF.isValid(e)?parseInt(e):t.tmp.numOfComp;var a,i=$(window).height(),n=$(window).width(),o="portrait"===t._getDeviceOrientation(),s=10;o?t.setting.visibleRows=5:t.setting.visibleRows=3,t.setting.componentsCoverFullWidth||(o?(l=Math.floor(n/3),a=l*e,s=(n-a)/2):(l=Math.floor(i/3),a=l*e,a=i>a?a:i,s=(n-a)/2,n=i),$(t.tmp.overlaySelector).find(".ap-content-middle").css({"padding-left":s,"padding-right":s})),n-=16;var r=Math.floor(i/t.setting.visibleRows),l=Math.floor(n/3);t.setting.componentsCoverFullWidth?(r=Math.floor(i/t.setting.visibleRows),t.setting.rowHeight=r):t.setting.rowHeight=l;var m,p,c=t.setting.rowHeight*t.setting.visibleRows,d=(i-c)/2;$(t.tmp.overlaySelector).find(".ap-content").css({top:d}),d+=2,m=$(t.tmp.overlaySelector).find(".ap-header").height()-d,$(t.tmp.overlaySelector).find(".ap-content-top").css({top:m}),d-=2,p=$(t.tmp.overlaySelector).find(".ap-footer").height()+d,$(t.tmp.overlaySelector).find(".ap-content-bottom").css({bottom:p}),t.tmp.iExt=Math.floor(t.setting.visibleRows/2)}var u=$(null===t.setting.relativeTo?t.setting.inputElement:t.setting.relativeTo),g=u.offset().top,f=u.offset().left,h=u.outerWidth();if($.CF.compareStrings(t.setting.layout,"popover")){var v,D,S,y=$("body").scrollTop(),T=($(window).outerWidth(),$(window).outerHeight(),y),C=$(t.setting.inputElement).offset().top-y,b=$(t.setting.inputElement).outerHeight(),w=C+b,_=$(t.setting.inputElement).offset().left,F=$(t.setting.inputElement).outerWidth(),M=_+F,V=$(t.tmp.overlaySelector).find(".ap-cont").outerWidth(),A=$(t.tmp.overlaySelector).find(".ap-cont").outerHeight(),P=10,x=10;"top"===t.tmp.sTooltip?(v=C-A-P,S=0>v?5:v,D=_+5):"bottom"===t.tmp.sTooltip?(v=w+P,D=_+5,"rtl"===t.tmp.sDir&&(D=M-V)):"left"===t.tmp.sTooltip?(v=C-(A/2-b/2),v=T>v?5:v,D=_+F+5):"right"===t.tmp.sTooltip&&(v=C-(A/2-b/2),v=T>v?5:v,D=_-(V+x)),$(t.tmp.overlaySelector).find(".ap-cont").css({position:"absolute",left:D,top:v})}else if($.CF.compareStrings(t.setting.layout,"inline"))$(t.tmp.overlaySelector).find(".ap-cont").css({position:"absolute",width:h,left:f,top:g});else if($.CF.compareStrings(t.setting.layout,"relative")){u=$(null===t.setting.relativeTo?t.setting.inputElement:t.setting.relativeTo);var k=0,I=$(document).outerWidth(),O=$(".ap-cont").outerWidth(),H=h;h=H>O?O:H,g+=u.outerHeight(),$.CF.compareStrings(t.setting.hAlign,"center")?f=H>h?f+h/2:H===h?f:f-h/2:$.CF.compareStrings(t.setting.hAlign,"right")&&(f-=h),f=k>f?k+5:f;var E=f+h;E>I&&(f>k+5?(f-=E-(I+5),f=k>f?k+5:f,E=f+h,h=E>I?I-10:h):h=I-10),$(t.tmp.overlaySelector).find(".ap-cont").css({position:"absolute","min-width":h,left:f,top:g})}else $.CF.compareStrings(t.setting.layout,"fixed")&&($.CF.compareStrings(t.setting.vAlign,"top")?$(t.tmp.overlaySelector+" .ap-cont").css({top:-1e3}):$.CF.compareStrings(t.setting.vAlign,"bottom")&&$(t.tmp.overlaySelector+" .ap-cont").css({bottom:-1e3}))},_addViewSectionComponents:function(){var e,t,a=this,i=$.CF.compareStrings(a.setting.theme,"Windows");for(e=0;e<$.AnyPicker.extra.sArrViewSections.length;e++){var n=$.AnyPicker.extra.sArrViewSections[e],o=a.setting.viewSections[n];if(o.length>0)for(t=0;t<o.length;t++){var s=o[t],r=a.setting[s]||null,l=$(r.markup);if(i&&$.CF.isValid(r.markupContentWindows)&&l.html(r.markupContentWindows),void 0!==r&&null!==r&&""!==r){if($.CF.compareStrings(n,"header"))$(a.tmp.overlaySelector).find(".ap-header").append(l),$.CF.compareStrings(r.type,"Button")&&$.CF.compareDataType(r.action,"function")&&l.on("click."+a.setting.timestamp,{apo:a},r.action);else if($.CF.compareStrings(n,"contentTop"))$(a.tmp.overlaySelector).find(".ap-content-top").append(l),$.CF.compareStrings(r.type,"Button")&&$.CF.compareDataType(r.action,"function")&&l.on("click."+a.setting.timestamp,{apo:a},r.action);else if($.CF.compareStrings(n,"contentBottom"))$(a.tmp.overlaySelector).find(".ap-content-bottom").append(l),$.CF.compareStrings(r.type,"Button")&&$.CF.compareDataType(r.action,"function")&&l.on("click."+a.setting.timestamp,{apo:a},r.action);else if($.CF.compareStrings(n,"footer")){var m=$(a.tmp.overlaySelector).find(".ap-button-cont");m.length>0?m.append(l):$(a.tmp.overlaySelector).find(".ap-footer").append(l),$.CF.compareStrings(r.type,"Button")&&$.CF.compareDataType(r.action,"function")&&l.on("click."+a.setting.timestamp,{apo:a},r.action)}$.CF.compareStrings(s,"headerTitle")&&$.CF.compareStrings(r.contentBehaviour,"Static")&&$(a.tmp.overlaySelector).find(".ap-header__title").text(a.setting.i18n.headerTitle),$.CF.compareStrings(s,"setButton")?!i||i&&a.tmp.bModified.set?l.text(a.setting.i18n.setButton):i&&!a.tmp.bModified.set&&l.find(".ap-button-text").text(a.setting.i18n.setButton):$.CF.compareStrings(s,"clearButton")?!i||i&&a.tmp.bModified.clear?l.text(a.setting.i18n.clearButton):i&&!a.tmp.bModified.clear&&l.find(".ap-button-text").text(a.setting.i18n.clearButton):$.CF.compareStrings(s,"nowButton")?!i||i&&a.tmp.bModified.now?l.text(a.setting.i18n.nowButton):i&&!a.tmp.bModified.now&&l.find(".ap-button-text").text(a.setting.i18n.nowButton):$.CF.compareStrings(s,"cancelButton")&&(!i||i&&a.tmp.bModified.cancel?l.text(a.setting.i18n.cancelButton):i&&!a.tmp.bModified.cancel&&l.find(".ap-button-text").text(a.setting.i18n.cancelButton)),$.CF.compareStrings(r.type,"Button")&&($.CF.compareDataType(r.action,"function")||($.CF.compareStrings(s,"setButton")?l.on("click."+a.setting.timestamp,{apo:a},a._setButtonAction):$.CF.compareStrings(s,"clearButton")?l.on("click."+a.setting.timestamp,{apo:a},a._clearButtonAction):$.CF.compareStrings(s,"nowButton")?l.on("click."+a.setting.timestamp,{apo:a},a._nowButtonAction):$.CF.compareStrings(s,"cancelButton")&&l.on("click."+a.setting.timestamp,{apo:a},a._cancelButtonAction)))}}}i&&$(".ap-button-icon, .ap-button-text").click(function(e){$(this).closest(".ap-button").trigger("click")}),$(a.tmp.overlaySelector).find(".ap-button").on("mousedown touchstart",function(e){$(this).addClass("ap-button-active")}).on("mouseup touchend",function(e){$(this).removeClass("ap-button-active")}),$(window).on("blur."+a.setting.timestamp,function(e){a.tmp.prevActive=document.activeElement}),$(a.tmp.overlaySelector).off("click."+a.setting.timestamp),setTimeout(function(){$(a.tmp.overlaySelector).on("click."+a.setting.timestamp,function(e){var t=Date.now()-a.tmp.iCompDragStart;!a.setting.bIsTouched&&t>1e3&&a._hidePicker()})},300),$(a.tmp.overlaySelector).find(".ap-cont, .ap-cont *").on("click."+a.setting.timestamp,function(e){e.stopPropagation()}),$(a.tmp.overlaySelector).find(".ap-content-switch-date").click(function(e){e.stopPropagation(),a._setDateTimeTabs("date")}),$(a.tmp.overlaySelector).find(".ap-content-switch-time").click(function(e){e.stopPropagation(),a._setDateTimeTabs("time")}),$(window).resize(function(){a._adjustOnOrientationChange()})},_setDateTimeTabs:function(e){var t=this,a="date"===e?"time":"date";t.tmp.sDateTimeTab=e,$(t.tmp.overlaySelector).find(".ap-content-switch-tab").removeClass("ap-content-switch-selected"),$(t.tmp.overlaySelector).find(".ap-content-switch-"+e).addClass("ap-content-switch-selected");var i=$(t.tmp.overlaySelector).find("[data-type='"+a+"']"),n=$(t.tmp.overlaySelector).find("[data-type='"+e+"']");i.css("display","none"),n.css("display","table-cell"),$.CF.compareStrings(t.setting.theme,"Windows")&&t._adjustPicker(n.length)},_setOutput:function(){var e=this,t="";if($.CF.isValid(e.setting.formatOutput))t=e.setting.formatOutput.call(e,e.tmp.selectedValues);else if($.CF.compareStrings(e.setting.mode,"select"))for(var a=0;a<e.tmp.numOfComp;a++)0!==a&&(t+=" "),t+=e.tmp.selectedValues.values[a].label;else $.CF.compareStrings(e.setting.mode,"datetime")&&(t=e.formatOutputDates(e.tmp.selectedValues.date));if(e.tmp.oElemValid.bIsListItem||e.tmp.oElemValid.bIsSelect){var i,n;e.tmp.oElemValid.bIsListItem?i="li":e.tmp.oElemValid.bIsSelect&&(i="option"),$(e.elem).find(i).each(function(){n=$(this);var t=n.attr("value")||n.data("value")||n.text();e.tmp.selectedValues.values[0].val===t?e.tmp.oElemValid.bIsSelect?n.attr("selected",!0):e.tmp.oElemValid.bIsListItem&&n.attr("data-selected",!0):e.tmp.oElemValid.bIsSelect?n.attr("selected",!1):e.tmp.oElemValid.bIsListItem&&n.attr("data-selected",!1)})}if($.CF.isValid(e.setting.setOutput))e.setting.setOutput.call(e,t,e.tmp.selectedValues);else{if(null!==e.setting.inputElement){var o=$(e.setting.inputElement);e.tmp.oInputElemValid.bIsInput?o.val(t):o.text(t)}$.CF.isValid(e.setting.onSetOutput)&&e.setting.onSetOutput.call(e,t,e.tmp.selectedValues)}},_clearOutput:function(){var e=this,t=$(e.setting.inputElement);e.tmp.oInputElemValid.bIsInput?t.val(""):t.text("")},_setButtonAction:function(e){var t=e.data.apo;t._setOutput(),t.showOrHidePicker()},_clearButtonAction:function(e){var t=e.data.apo;if(t.tmp.selectedDate=$.AnyPicker.extra.dToday,""!==t.tmp.sInputElemTag&&!t.tmp.oInputElemValid.bIsListItem&&!t.tmp.oInputElemValid.bIsSelect){var a=$(t.setting.inputElement);t.tmp.oInputElemValid.bIsInput?a.val(""):a.text("")}t.showOrHidePicker()},_nowButtonAction:function(e){var t=e.data.apo;$.CF.compareStrings(t.setting.mode,"datetime")&&(t.tmp.selectedDate=t._getCurrentDate(),t._setSelectedAndInvalidValuesForRows())},_cancelButtonAction:function(e){var t=e.data.apo;t.showOrHidePicker()},_getDeviceOrientation:function(){var e=$(window);return e.width()>e.height()?"landscape":"portrait"},_adjustOnOrientationChange:function(){var e=this,t=e._getDeviceOrientation();t!==e.tmp.sOrientation&&($("body").prepend("<div class='ap-loading'>Loading</div>"),e.tmp.sOrientation=t,e._adjustPicker(),e.reloadAllComponents())}},$.AnyPicker=$.extend(!0,$.AnyPicker,{defaults:{components:null,dataSource:null,showComponentLabel:!1,componentsCoverFullWidth:!1,visibleRows:3,maxRows:0,rowHeight:50,rowsNavigation:"scroller",rowView:null,onChange:null},tempDefaults:{numOfComp:0,selectedValues:{},bIsManualDragging:!1,bIsTouched:!1,iTS:0,iPos:0,iPosPrev:0,iPosStop:0,iOffset:0,iOffsetPrev:0,iVelocity:0,iAmplitude:0,oVelocityTicker:null,oScrollTicker:null,iMinTopPos:0,iMaxTopPos:0,oScrollingComp:null,iScrollingComp:-1,iTmConst:100,bEnd:!1},extra:{sArrRowsNavigation:["scroller+buttons","scroller","buttons"]}}),s.prototype=$.extend(s.prototype,{__initComponents:function(){var e=this;e.tmp.bFirst?e.tmp.bFirst=!1:$.CF.compareStrings(e.setting.mode,"select")?e.__setComponentsOfSelect():$.CF.compareStrings(e.setting.mode,"datetime")&&e.__setComponentsOfDateTimePicker();var t=e.tmp.numOfComp||e.setting.components.length;t>0&&(e.setting.components.length>0?e.reloadAllComponents():console.log("For apo.setting.mode \n 1. Select - \n Please set apo.setting.components 2. DateTime - \n Please enter a valid outputDateTimeFormat "))},reloadAllComponents:function(){var e,t=this;for($(t.setting.parent).find(".ap-component-section").html(""),$("body").prepend("<div class='ap-loading'></div>"),e=0;e<t.tmp.numOfComp;e++)t.reloadComponent(e,!1);t.adjustComponents(),t.setSelectedAndInvalidValuesForRows(!0)},reloadComponent:function(e,t){var a,i,n=this,o="",s=n.setting.dataSource[e].data,r=!1,l="ap-component-"+e,m=$(n.setting.parent).find("#"+l),p=n.setting.components[e],c=$.CF.isValid(p.type)?p.type:p.label,d=$.CF.isValid(p.width)?"width: "+p.width:"",u=n.setting.rtl?$.CF.compareStrings(p.textAlign,"left")?"right":$.CF.compareStrings(p.textAlign,"right")?"left":"":p.textAlign,g=$.CF.isValid(u)?"text-align: "+u:"";for(0===m.length&&(o+="<div class='ap-component' id='"+l+"' data-type='"+c+"' "+(""!==d?"style='"+d+";'":"")+">"),$.CF.compareStrings(n.setting.theme,"Windows")||n.setting.showComponentLabel&&(o+="<div class='ap-component-label' "+(""!==g?"style='"+g+";'":"")+">"+p.label+"</div>"),($.CF.compareStrings(n.setting.rowsNavigation,"scroller+buttons")||$.CF.compareStrings(n.setting.rowsNavigation,"buttons"))&&(o+="<div class='ap-component-plus ap-icon-arrow-up-filled' "+(""!==g?"style='"+g+";'":"")+"></div>"),o+="<div class='ap-component-cont' tabindex='0'>",o+="<div class='ap-component-data' role='listbox' aria-label='"+p.label+"'>",a=0;a<n.tmp.iExt;a++)o+="<div class='ap-row ap-row-ext'></div>";for(a=0;a<s.length;a++)r=$.CF.isValid(s[a].selected)?s[a].selected:!1,i=r?"ap-row-selected":"",o+="<div class='ap-row "+i+"' id='ap-row-"+e+"-"+a+"' data-value='"+s[a].val+"' data-label='"+s[a].label+"' role='option' aria-selected='"+r+"' "+(""!==g?"style='"+g+";'":"")+">",$.CF.compareStrings(n.setting.theme,"Windows")&&(o+="<div class='ap-row-bg'>",$.CF.isValid(n.setting.rowView)||(o+="<div class='ap-row-content'>")),o+=$.CF.isValid(n.setting.rowView)?n.setting.rowView.call(n,e,a,s[a]):s[a].label,$.CF.compareStrings(n.setting.theme,"Windows")&&!$.CF.isValid(n.setting.rowView)&&(o+="</div>",o+="<div class='ap-row-label'>",n.setting.showComponentLabel&&(o+=p.label),o+="</div>"),$.CF.compareStrings(n.setting.theme,"Windows")&&(o+="</div>"),o+="</div>";for(a=0;a<n.tmp.iExt;a++)o+="<div class='ap-row ap-row-ext'></div>";o+="</div>",o+="<div class='ap-component-gradient'></div>",o+="<div class='ap-component-selector' id='ap-component-selector-"+e+"'></div>",o+="</div>",($.CF.compareStrings(n.setting.rowsNavigation,"scroller+buttons")||$.CF.compareStrings(n.setting.rowsNavigation,"buttons"))&&(o+="<div class='ap-component-minus ap-icon-arrow-down-filled' "+(""!==g?"style='"+g+";'":"")+"></div>"),0===m.length&&(o+="</div>"),m.length>0?m.html(o):$(n.setting.parent).find(".ap-component-section").append(o),n._bindEventsToComponent(e),(m.length>0||t)&&n.adjustComponents(),t&&n.setSelectedAndInvalidValuesForRows(!0)},_bindEventsToComponent:function(e){var t=this,a=$("#ap-component-"+e),i=a.find(".ap-component-cont"),n={
component:e,apo:t};if(($.CF.compareStrings(t.setting.rowsNavigation,"scroller+buttons")||$.CF.compareStrings(t.setting.rowsNavigation,"scroller"))&&(i.on($.AnyPicker.extra.sStartEv+"."+t.setting.timestamp,n,t._onStartDrag),i.on($.AnyPicker.extra.sMoveEv+"."+t.setting.timestamp,n,t._onDrag),$.CF.isValid($.AnyPicker.extra.sEndEv)&&i.on($.AnyPicker.extra.sEndEv+"."+t.setting.timestamp,n,t._onEndDrag),$.CF.isValid($.AnyPicker.extra.sOutEv)&&i.on($.AnyPicker.extra.sOutEv+"."+t.setting.timestamp,n,t._onEndDrag),$.AnyPicker.extra.sMouseWheel.length>0))for(var o=0;o<$.AnyPicker.extra.sMouseWheel.length;o++)i.on($.AnyPicker.extra.sMouseWheel[o]+"."+t.setting.timestamp,n,t._onMouseWheelScroll);($.CF.compareStrings(t.setting.rowsNavigation,"scroller+buttons")||$.CF.compareStrings(t.setting.rowsNavigation,"buttons"))&&(a.find(".ap-component-plus").on("click."+t.setting.timestamp,n,t._onClickButtonPlus),a.find(".ap-component-minus").on("click."+t.setting.timestamp,n,t._onClickButtonMinus)),i.on("keydown."+t.setting.timestamp,n,t._onKeyDown),i.on("keyup."+t.setting.timestamp,n,t._onKeyUp)},adjustComponents:function(){var e=this,t=$(e.tmp.overlaySelector);if(t.find(".ap-component-cont").css({height:e.setting.rowHeight*e.setting.visibleRows}),t.find(".ap-row, .ap-component-selector").css({height:e.setting.rowHeight,"line-height":e.setting.rowHeight+"px"}),t.find(".ap-row-bg").css({height:e.setting.rowHeight-8}),!$.CF.compareStrings(e.setting.theme,"Windows")){var a=$(".ap-cont").width(),i=$(".ap-cont").height(),n=$(window).width(),o=$(window).height(),s=n,r=o,l=!1,m=!1;if(a>n&&(l=!0,s=a+20),i>o&&(m=!0,r=i+20),(l||m)&&(t.css({position:"absolute",height:r,width:s}),$.CF.compareStrings(e.setting.layout,"fixed")&&$(".ap-cont").css({position:"absolute"})),$.CF.compareStrings(e.setting.layout,"relative")){var p=$(null===e.setting.relativeTo?e.setting.inputElement:e.setting.relativeTo),c=t.find(".ap-cont"),d=p.offset().top+c.height();$.CF.compareStrings(e.setting.vAlign,"top")&&c.css({top:d})}}setTimeout(function(){$(".ap-loading").remove()},0)},_onStartDrag:function(e){var t=e.data.apo;if(t.tmp.bIsManualDragging||(t.tmp.bIsManualDragging=!0),t.tmp.bIsTouched=!0,t.tmp.bEnd=!1,t.tmp.iPos=t._getTouchPosition(e),t.tmp.bFromTouchStart=!0,t._setScrollingData(e),$.CF.compareStrings(t.setting.theme,"Windows")){var a=$(t.tmp.overlaySelector).find("#ap-component-"+t.tmp.iScrollingComp);t.tmp.bIsManualDragging&&($(t.tmp.overlaySelector).find(".ap-component").removeClass("ap-component-modifying"),a.addClass("ap-component-modifying"))}return"mousedown"===e.type&&($(document).on("mousemove."+t.setting.timestamp,e.data,t._onDrag),$(document).on("mouseup."+t.setting.timestamp,e.data,t._onEndDrag)),e.preventDefault(),e.stopPropagation(),!1},_onDrag:function(e){var t,a,i,n,o,s,r=e.data.apo,l=Date.now();if(r._clearScrollTicker(),r.tmp.bIsTouched&&(!$.AnyPicker.extra.bHasPointer||$.AnyPicker.extra.bHasPointer&&(r.tmp.bFromTouchStart||!r.tmp.bFromTouchStart&&l-r.tmp.iTS>1e3))&&(t=r._getTouchPosition(e),l=Date.now(),a=r.tmp.iPos-t,o=a/Math.abs(a),a>2||-2>a)){if($.CF.compareStrings(r.setting.theme,"Windows")){var m=$(r.tmp.overlaySelector).find("#ap-component-"+r.tmp.iScrollingComp),p=m.find(".ap-row");p.attr("aria-selected","false"),p.removeClass("ap-row-selected")}r.tmp.iPosPrev=r.tmp.iPos,r.tmp.iPos=t,i=l-r.tmp.iTS,r.tmp.iTS=l,n=a/i,r.tmp.iTotalDS+=a,s=r.tmp.iPrevDSTS-n,$.AnyPicker.extra.bHasPointer?$.AnyPicker.extra.bIsTouchDevice?a>10||-10>a?$.CF.compareStrings(r.setting.theme,"iOS")?a=4*r.setting.visibleRows*n:Math.abs(r.tmp.iTotalDS)>100?a=n>.05?$.CF.compareStrings(r.setting.theme,"Windows")?a*i*5:a*i*2:1===o?o*r.setting.rowHeight/2:o*r.setting.rowHeight/1.2:n>.06&&Math.abs(s)>.08?a=$.CF.compareStrings(r.setting.theme,"Windows")?a*i*5:a*i*2:(a>50||-50>a)&&(a=$.CF.compareStrings(r.setting.theme,"Windows")?a*i*5:a*i*2):a=Math.abs(n)>.06&&Math.abs(s)>.08?$.CF.compareStrings(r.setting.theme,"Windows")?a*i*5:a*i*2:1===o?o*r.setting.rowHeight/2:o*r.setting.rowHeight/1.2:(2>a&&a>-2&&0!==a&&(a=5*o),a=a>5||-5>a?r.setting.visibleRows/10*320*n:o*r.setting.rowHeight):(a>10||-10>a)&&(a+=16*r.setting.visibleRows*n),r.tmp.iPrevDSTS=n,r._scrollToPosition("drag",r.tmp.iOffset+a,!1,"#ap-component-"+r.tmp.iScrollingComp+" .ap-component-data"),r.tmp.bFromTouchStart=!1}return e.preventDefault(),e.stopPropagation(),!1},_onEndDrag:function(e){var t=e.data.apo;return t.tmp.bEnd||(t.tmp.bEnd=!0,t.tmp.bIsTouched=!1,t._scrollToPosition("drag",t.tmp.iOffset,!0,"#ap-component-"+t.tmp.iScrollingComp+" .ap-component-data"),"mouseup"===e.type&&($(document).off("mousemove."+t.setting.timestamp,t._onDrag),$(document).off("mouseup."+t.setting.timestamp,t._onEndDrag))),e.preventDefault(),e.stopPropagation(),!1},_onMouseWheelScroll:function(e){var t,a=e.data.apo,i=e.data;return e=e||window.event,i.component!==a.tmp.iScrollingComp&&a._setScrollingData(e),a._clearScrollTicker(),t=e.wheelDelta?e.wheelDelta/3:e.originalEvent.wheelDelta?e.originalEvent.wheelDelta/3:e.detail?-e.detail/3:0,a._scrollToPosition("mouseWheel",a.tmp.iOffset-t,!0,"#ap-component-"+a.tmp.iScrollingComp+" .ap-component-data"),e.preventDefault(),e.stopPropagation(),!1},_onClickButtonPlus:function(e){var t=e.data.apo;e.preventDefault(),e.stopPropagation(),t._setScrollingData(e),t._clearScrollTicker(),t._scrollToPosition("button",t.tmp.iOffset+t.setting.rowHeight,!0,"#ap-component-"+t.tmp.iScrollingComp+" .ap-component-data")},_onClickButtonMinus:function(e){var t=e.data.apo;e.preventDefault(),e.stopPropagation(),t._setScrollingData(e),t._clearScrollTicker(),t._scrollToPosition("button",t.tmp.iOffset-t.setting.rowHeight,!0,"#ap-component-"+t.tmp.iScrollingComp+" .ap-component-data")},_onKeyDown:function(e){var t=e.data.apo;e.preventDefault(),e.stopPropagation(),t._setScrollingData(e),t._clearScrollTicker(),38===e.keyCode?t._scrollToPosition("key",t.tmp.iOffset+t.setting.rowHeight,!0,"#ap-component-"+t.tmp.iScrollingComp+" .ap-component-data"):40===e.keyCode&&t._scrollToPosition("key",t.tmp.iOffset-t.setting.rowHeight,!0,"#ap-component-"+t.tmp.iScrollingComp+" .ap-component-data")},_onKeyUp:function(e){var t=e.data.apo;e.preventDefault(),e.stopPropagation(),t._unsetScrollingData()},_getTouchPosition:function(e){e.data.apo;return e=e.originalEvent||e,e.changedTouches?e.changedTouches[0].pageY:e.pageY},_setScrollingData:function(e){var t=e.data.apo;t.tmp.iScrollingComp=parseInt(e.data.component),t.tmp.oScrollingComp=$("#ap-component-"+e.data.component).find(".ap-component-data"),t.tmp.iMinTopPos=0,t.tmp.iMaxTopPos=$(t.tmp.oScrollingComp).find(".ap-row").length*t.setting.rowHeight-$(t.tmp.oScrollingComp).parent().innerHeight(),t.tmp.iTS=Date.now(),t.tmp.iCompDragStart=t.tmp.iTS,t.tmp.iOffsetStart=Math.abs($(t.tmp.oScrollingComp).position().top),t.tmp.iOffset=t.tmp.iOffsetStart,t.tmp.iOffsetPrev=t.tmp.iOffsetStart,t.tmp.iTimeout=0,t.tmp.iDir=1,t.tmp.iTotalDS=0,t.tmp.iPrevDSTS=0,t._clearScrollTicker()},_unsetScrollingData:function(){var e=this;e.tmp.bIsTouched=!1,e.tmp.iPos=0,e.tmp.iTS=0,e.tmp.iOffset=0,e.tmp.iTimeout=0,e.tmp.iMinTopPos=0,e.tmp.iMaxTopPos=0,e.tmp.oScrollingComp=null,e.tmp.iScrollingComp=-1,e.tmp.iDir=0,e._clearScrollTicker(),$(document).off("mousemove."+e.setting.timestamp),$(document).off("mouseup."+e.setting.timestamp),$(document).off("touchend."+e.setting.timestamp)},_getScrollingData:function(){var e=this,t={};return t.iScrollingComp=e.tmp.iScrollingComp,t.oScrollingComp=e.tmp.oScrollingComp,t.iMinTopPos=e.tmp.iMinTopPos,t.iMaxTopPos=e.tmp.iMaxTopPos,t.iTS=e.tmp.iTS,t.iCompDragStart=e.tmp.iCompDragStart,t.iOffsetStart=e.tmp.iOffsetStart,t.iOffset=e.tmp.iOffset,t.iOffsetPrev=e.tmp.iOffsetPrev,t.iTimeout=e.tmp.iTimeout,t.iDir=e.tmp.iDir,t},_clearScrollTicker:function(){var e=this;clearTimeout(e.tmp.oScrollTicker),e.tmp.oScrollTicker=null},_scrollToPosition:function(e,t,a,i){var n=this,o=n.tmp.iScrollingComp,s=t<n.tmp.iOffset?1:t===n.tmp.iOffset?n.tmp.iDir:-1,r=t%n.setting.rowHeight,l=n.setting.rowHeight/4,m=n.tmp.iOffset,p=.1;n.tmp.iDir=s,a&&(t=0!==r?l>r?t-r:t+(n.setting.rowHeight-r):t);var c=n.tmp.iMinTopPos-n.setting.rowHeight,d=n.tmp.iMaxTopPos+n.setting.rowHeight;if(n.tmp.iOffset=t>n.tmp.iMaxTopPos?d:t<n.tmp.iMinTopPos?c:t,$.AnyPicker.extra.bHasCSS3D){var u=Math.abs(m-n.tmp.iOffset);"drag"===e?u<6*n.setting.rowHeight?p=u/(10*n.setting.rowHeight):(p=u/(10*n.setting.rowHeight),p=.2>=p?.2:p):p=.1,n._performTransition(o,i,n.tmp.iOffset,n.tmp.iTimeout/1e3,n.tmp.iMinTopPos,n.tmp.iMaxTopPos,s,c,d,e,a),n.tmp.iTimeout=n.tmp.iTimeout-(Date.now()-n.tmp.iTS)+1e3*p}else n._performTransition(o,i,n.tmp.iOffset,p,n.tmp.iMinTopPos,n.tmp.iMaxTopPos,s,c,d,e,a)},_performTransition:function(e,t,a,i,n,o,s,r,l,m,p){var c=this,d=$(c.tmp.overlaySelector).find(t).get(0),u=c._getOffset(d,!0),g=Math.abs(u-a),f=g/(10*c.setting.rowHeight);i=i>f?f:i,i=.1>i?.1:i,i=$.AnyPicker.extra.bHasPointer&&c.tmp.bIsTouched&&"auto"===m?0:i,$.AnyPicker.extra.bHasCSS3D?(d.style[$.AnyPicker.extra.sCSSTransition]=$.AnyPicker.extra.sCSSTransformStyle+" "+i+"s ease-out",d.style[$.AnyPicker.extra.sCSSTransform]="translate3d(0px, "+-a+"px, 0px)"):$(d).animate({top:-a},100),c.tmp.iOffset=a;var h=c._getScrollingData();c._performTransitionAfter(h,l,r,m,i,p),c._clearScrollTicker()},_performTransitionAfter:function(e,t,a,i,n,o){var s=this;setTimeout(function(){!o||"drag"!==i&&"mouseWheel"!==i||(s.tmp.oScrollTicker=1,s._scrollToRow(e.iDir,t,a,e.iMinTopPos,e.iMaxTopPos,i));var r=$(e.oScrollingComp).get(0),l="auto"===i?e.iOffset:-s._getOffset(r,!1),m=l<e.iMinTopPos,p=l>e.iMaxTopPos,c=Math.abs(l);m?l=e.iMinTopPos:p&&(l=e.iMaxTopPos),m||p?(n=Math.abs(c-l)/(10*s.setting.rowHeight),$.AnyPicker.extra.bHasCSS3D?(r.style[$.AnyPicker.extra.sCSSTransition]=$.AnyPicker.extra.sCSSTransformStyle+" "+n+"s ease-out",r.style[$.AnyPicker.extra.sCSSTransform]="translate3d(0px, "+-Math.abs(l)+"px, 0px)"):$(r).animate({top:-Math.abs(l)},100),e.iOffset=l,c=l,s._skipDisabledRowAfter(e,c,i,n,o)):(o||c===e.iMinTopPos||c===e.iMaxTopPos)&&s._skipDisabledRow(i,e.iScrollingComp,c,e.iDir)},1e3*n)},_skipDisabledRowAfter:function(e,t,a,i,n){var o=this;setTimeout(function(){var i="auto"===a?t:e.iOffset;(n||i===e.iMinTopPos||i===e.iMaxTopPos)&&o._skipDisabledRow(a,e.iScrollingComp,i,e.iDir)},1e3*i)},_getOffset:function(e,t){var a=$(e).hasClass("ap-component-data")?$(e).css("transform"):$(e).find(".ap-component-data").css("transform"),i=0;if($.CF.isValid(a))if("none"===a)i=0;else{a=a.replace("matrix(",""),a=a.replace(")","");var n=a.split(", ");i=n.length>6?parseInt(n[13]):parseInt(n[5])}return t?Math.abs(i):i},_scrollToRow:function(e,t,a,i,n,o){var s,r,l,m=this;if(null!==m.tmp.oScrollTicker){var p=$(m.tmp.oScrollingComp).get(0);r=m._getOffset(p,!1),s=r%m.setting.rowHeight,(0!==s||0===s&&(r>i||-n>r))&&(r=Math.abs(r),r=-1===e?r+(m.setting.rowHeight-Math.abs(s)):r+s,r=r>n?n:i>r?i:r,l=.4,$.AnyPicker.extra.bHasCSS3D?(p.style[$.AnyPicker.extra.sCSSTransition]=$.AnyPicker.extra.sCSSTransformStyle+" "+l+"s ease-out",p.style[$.AnyPicker.extra.sCSSTransform]="translate3d(0px, "+-Math.abs(r)+"px, 0px)"):$(p).animate({top:-Math.abs(r)},100),m.tmp.iOffset=r)}},__scrollToSelectedRow:function(){var e,t=this,a=0;for($.CF.compareStrings(t.setting.mode,"datetime")&&t.__setSelectedDateTimeInComponent(),e=0;e<t.tmp.numOfComp;e++){var i=$(t.tmp.overlaySelector).find("#ap-component-"+e+" .ap-row-selected"),n=i.length>0?i[0]:null;if(null!==n){var o=$(n).position().top,s=t.tmp.iExt*t.setting.rowHeight;o=0===o?o:o-s,t.callScrollToPosition(e,t,o,a),a+=200}}},callScrollToPosition:function(e,t,a,i){var n=this,o={};o.data={component:e,apo:t},n._setScrollingData(o),n._scrollToPosition("auto",a,!0,"#ap-component-"+e+" .ap-component-data")},setSelectedAndInvalidValuesForRows:function(e){var t=this;$.CF.compareStrings(t.setting.mode,"select")?t.__disableInvalidRowsOfSelect():$.CF.compareStrings(t.setting.mode,"datetime")&&(e&&t.__setSelectedDateTimeInComponent(),$(t.tmp.overlaySelector).find(".ap-row").removeClass("ap-row-disabled ap-row-invalid ap-row-hidden"),t.__disableInvalidRowsOfDateTimePicker(),t.__setDaysOfMonthInDatePicker()),e&&t.__scrollToSelectedRow()},__changeComponentValue:function(e,t){var a,i,n,o=this,s=(o.setting.components[e],o.setting.dataSource[e].data);for(a=0;a<s.length;a++)i="#ap-row-"+e+"-"+a,n=$(o.tmp.overlaySelector).find(i),s[a].val===t?(s[a].selected=!0,n.attr("aria-selected","true"),n.addClass("ap-row-selected")):(s[a].selected=!1,n.attr("aria-selected","false"),n.removeClass("ap-row-selected"))},_skipDisabledRow:function(e,t,a,i){var n=this,o="#ap-component-"+t+" .ap-component-data",s=$(n.tmp.overlaySelector).find(o).get(0),r=Math.floor(a/n.setting.rowHeight),l="#ap-row-"+t+"-",m=l+r,p=$(s).find(".ap-row").length-2*n.tmp.iExt,c=$(s).find(m).hasClass("ap-row-disabled"),d=-1,u=0,g={},f=!1;if($.CF.isValid(s)&&c){1===i&&(d=n._findRows(t,r,p,s,i),-1===d&&(i=-1,u=1)),-1===i&&(d=n._findRows(t,r,p,s,i),-1===d&&0===u&&(i=1,d=n._findRows(t,r,p,s,i)));var h=-1!==d?$(s).find(l+d).position().top-n.tmp.iExt*n.setting.rowHeight:-1;-1!==d&&a!==h?(f=!0,g.data={component:t,apo:n},n._setScrollingData(g),n._scrollToPosition("auto",h,!0,o)):setTimeout(function(){n._actionsOnComponentStop(e,t,r,a,i)},200)}else setTimeout(function(){n._actionsOnComponentStop(e,t,r,a,i)},200)},_actionsOnComponentStop:function(e,t,a,i,n){var o=this,s=!1,r="";if(o.__setAriaSelectedForRowElement(t,i,n),o._getSelectedValueInComponent(null),$.CF.compareStrings(o.setting.inputChangeEvent,"onChange")&&o._setOutput(),"DynamicFunction"===o.tmp.sHeaderTitleType)r=o.setting.headerTitle.format.call(o.tmp.selectedValues),$(o.tmp.overlaySelector).find(".ap-header__title").text(r);else if("DynamicString"===o.tmp.sHeaderTitleType){if($.CF.compareStrings(o.setting.mode,"select"))for(var l=0;l<o.tmp.numOfComp;l++)0!==l&&(r+=" "),r+=o.tmp.selectedValues.values[l].label;else $.CF.compareStrings(o.setting.mode,"datetime")&&(r=o.formatOutputDates(o.tmp.selectedValues.date,o.tmp.sArrHeaderTitleFormat));var m=!0;o.tmp.bIsManualDragging||(m=!1),m&&$(o.tmp.overlaySelector).find(".ap-header__title").text(r)}"auto"!==e&&$.CF.isValid(o.setting.onChange)&&o.setting.onChange.call(o,t,a,o.tmp.selectedValues,e),s||o.setSelectedAndInvalidValuesForRows(!1)},_findRows:function(e,t,a,i,n){var o;if(-1===n){for(o=t+1;a>o;o++)if(!$(i).find("#ap-row-"+e+"-"+o).hasClass("ap-row-disabled"))return o}else if(1===n)for(o=t-1;o>0;o--)if(!$(i).find("#ap-row-"+e+"-"+o).hasClass("ap-row-disabled"))return o;return-1},_validateSelectedValues:function(){var e=this;if($.CF.compareStrings(e.setting.mode,"datetime")){var t=e.__getSelectedDate(!1);e.__validateSelectedDate(t,!1)}},__setAriaSelectedForRowElement:function(e,t,a){var i,n=this,o=$(n.tmp.overlaySelector).find("#ap-component-"+e);0===t&&(t=n._getOffset(o,!0)),1===a?i=Math.floor(t/n.setting.rowHeight):-1===a&&(i=Math.ceil(t/n.setting.rowHeight));var s=o.find(".ap-row"),r=o.find("#ap-row-"+e+"-"+i);s.attr("aria-selected","false"),s.removeClass("ap-row-selected"),r.attr("aria-selected","true"),r.addClass("ap-row-selected")},_getSelectedValueInComponent:function(e){var t,a,i=this,n=[];if(i.tmp.selectedValues={},$.CF.isValid(e))a=$(i.tmp.overlaySelector).find("#ap-component-"+e+" .ap-row-selected"),n.push({component:e,val:a.data("value"),label:a.data("label")});else for(t=0;t<i.tmp.numOfComp;t++)a=$(i.tmp.overlaySelector).find("#ap-component-"+t+" .ap-row-selected"),n.push({component:t,val:a.data("value"),label:a.data("label")});i.tmp.selectedValues.values=n,$.CF.compareStrings(i.setting.mode,"datetime")&&(i.tmp.selectedValues.date=i.__getSelectedDate(!1),i.tmp.selectedDate=i.tmp.selectedValues.date)},__getDataSourceValueFromLabel:function(e,t,a){var i,n,o,s,r=this,l="";if($.CF.isValid(t))for(o=r.setting.dataSource[t].data,n=0;n<o.length;n++)s=o[n],$.CF.compareStrings(s.label,e)?(l=s.val,a&&(s.selected=!0)):a&&(s.selected=!1),r.setting.dataSource[t].data[n]=s;else for(i=0;i<r.tmp.numOfComp;i++)for(o=r.setting.dataSource[i].data,n=0;n<o.length;n++)s=o[n],$.CF.compareStrings(s.label,e)?(a&&(s.selected=!0),l=s.val):a&&(s.selected=!1);return l},__getValuesOfComponent:function(e,t){var a,i=this,n=null;if("component"===e)if(i.setting.components[t].component===t)n=i.setting.components[t];else for(a=0;a<i.tmp.numOfComp;a++)i.setting.components[a].component===t&&(n=i.setting.components[a]);else if("datasource"===e)if(i.setting.dataSource[t].component===t)n=i.setting.dataSource[t];else for(a=0;a<i.tmp.numOfComp;a++)i.setting.dataSource[a].component===t&&(n=i.setting.dataSource[a]);return n}}),s.prototype=$.extend(s.prototype,{__setComponentsOfSelect:function(){var e=this;if(null===e.setting.dataSource)if(e.tmp.oElemValid.bIsListItem||e.tmp.oElemValid.bIsSelect){var t,a;e.setting.components=[];var i={};i.component=1,i.name=$(e.elem).data("name"),i.label=$(e.elem).data("label"),e.setting.components.push(i);var n=[];e.tmp.oElemValid.bIsListItem?t="li":e.tmp.oElemValid.bIsSelect&&(t="option"),$(e.elem).find(t).each(function(){a=$(this);var t={val:a.attr("value")||a.data("value")||a.text(),label:a.text(),selected:function(){return a.attr("selected")||void 0!==a.attr("data-selected")&&"true"===a.attr("data-selected")?!0:!1},disabled:function(){return a.attr("disabled")||void 0!==a.data("disabled")&&"true"===a.data("disabled")?!0:!1}};t.disabled?t.selected=!1:t.selected&&(e.tmp.selected={val:t.val,displayVal:t.displayVal}),n.push(t)}),e.setting.dataSource=[];var o={};o.component=1,o.data=n,e.setting.dataSource.push(o),e.tmp.numOfComp=1,$.CF.compareStrings(e.setting.headerTitle.contentBehaviour,"Dynamic")&&$.CF.isValid(e.setting.headerTitle.format)&&("function"==typeof e.setting.headerTitle.format?e.tmp.sHeaderTitleType="DynamicFunction":"string"==typeof e.setting.headerTitle.format&&(e.tmp.sHeaderTitleType="DynamicString"))}else console.log("You will have to specify dataSource either as a JSON object or as <ul>, <ol>, <dl> or <select>")},__disableInvalidRowsOfSelect:function(){var e,t,a=this,i=a.setting.dataSource[0].data;for(e=0;e<i.length;e++)t=$.CF.isValid(i[e].disabled),t&&i[e].disabled===!0&&$(a.elem).find("#ap-row-0-"+e).addClass("ap-row-disabled")}}),$.AnyPicker=$.extend(!0,$.AnyPicker,{defaults:{selectedDate:null,i18n:{veryShortDays:["Su","Mo","Tu","We","Th","Fr","Sa"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],numbers:["0","1","2","3","4","5","6","7","8","9"],meridiem:{a:["a","p"],aa:["am","pm"],A:["A","P"],AA:["AM","PM"]}},inputDateTimeFormat:"",dateTimeFormat:"dd-MM-yyyy hh:mm AA",tzOffset:"",maxValue:null,minValue:null,maxYear:0,disableValues:{},intervals:{h:1,m:1,s:1},roundOff:!0},tempDefaults:{oMinMax:{},oArrPDisable:{},sDateTimeMode:"",sArrDateTimeFormat:[],sDateTimeRegex:"",diffDateTimeFormats:!1,sArrInputDateTimeFormat:[],sInputDateTimeRegex:"",sHeaderTitleType:"Static",sArrHeaderTitleFormat:[],dPrevDate:null},extra:{dToday:new Date,iMS:{m:6e4,h:36e5,d:864e5,w:6048e5},sFormatRegex:/(\[[^\[]*\])|(\\)?(MMMM|MMM|MM?|DDDD|DDD|DD|D|dd?|yyyy|YYYY|yy|YY|y|Y|aa?|AA?|hh?|HH?|mm?|ss?|x|X|zz?|ZZ?|.)/g,en:{veryShortDays:["Su","Mo","Tu","We","Th","Fr","Sa"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],numbers:["0","1","2","3","4","5","6","7","8","9"],meridiem:{a:["a","p"],aa:["am","pm"],A:["A","P"],AA:["PM","PM"]}},sArrDateComponents:["d","dd","DD","DDD","DDDD","M","MM","MMM","MMMM","y","yy","yyyy","Y","YY","YYYY","h","hh","H","HH","m","mm","s","ss","AA","A","aa","a"],sArrDateTimeModes:["date","time","datetime"]}}),s.prototype=$.extend(s.prototype,{_isSupportedFormat:function(e){return-1!==e.search($.AnyPicker.extra.sFormatRegex,"")},__setComponentsOfDateTimePicker:function(){var e,t,a=this;a.setting.components=[],a.tmp.numOfComp=0,a.setting.dataSource=[];var i=-1!==a.setting.dateTimeFormat.search(/D|d|M|y|Y/,""),n=-1!==a.setting.dateTimeFormat.search(/H|h|m|s|A|a/,"");a.tmp.sDateTimeMode=i&&n?"datetime":i?"date":n?"time":"",$.CF.isValid(a.setting.dateTimeFormat)&&($.CF.isValid(a.setting.inputDateTimeFormat)?a.tmp.diffDateTimeFormats=a.setting.dateTimeFormat!==a.setting.inputDateTimeFormat:(a.setting.inputDateTimeFormat=a.setting.dateTimeFormat,a.tmp.diffDateTimeFormats=!1)),a.tmp.sArrDateTimeFormat=a._setDateTimeFormatComponentsArray(a.setting.dateTimeFormat),a.tmp.diffDateTimeFormats&&(a.tmp.sArrInputDateTimeFormat=a._setDateTimeFormatComponentsArray(a.setting.inputDateTimeFormat)),a.tmp.sDateTimeRegex=a._createDateTimeRegex(a.tmp.sArrDateTimeFormat),a.tmp.diffDateTimeFormats&&(a.tmp.sInputDateTimeRegex=a._createDateTimeRegex(a.tmp.sArrInputDateTimeFormat)),a.parseDisableValues(),a.setSelectedDate(a.setting.selectedDate);var o=a.setting.dateTimeFormat.match(/(MMMM).*(dd|d).*(yyyy|YYYY)/);if(a.tmp.sArrDateTimeFormat.length>0)for(e=0;e<a.tmp.sArrDateTimeFormat.length;e++)t=a.tmp.sArrDateTimeFormat[e],-1!==t.search(/D|d|M|y|Y|H|h|m|s|A|a/,"g")&&a._setComponentAndDataSourceForFormat(t,{MMMMddYYYY:o});a.tmp.headerTitleDefined||!$.CF.compareStrings(a.setting.mode,"datetime")||$.CF.compareStrings(a.setting.theme,"iOS")||(a.setting.headerTitle.contentBehaviour="Dynamic","datetime"===a.tmp.sDateTimeMode?a._formatContains(a.tmp.sArrDateTimeFormat,["d","M","y|Y","h","m"],"and")&&a._formatContains(a.tmp.sArrDateTimeFormat,["a","A"],"or")?a.setting.headerTitle.format="dd.MM.yyyy, hh:mm "+a._getFormatForComponent("meridiem"):a._formatContains(a.tmp.sArrDateTimeFormat,["d","M","y|Y","H","m"],"and")?a.setting.headerTitle.format="dd.MM.yyyy, HH:mm":a.setting.headerTitle.format=a.setting.dateTimeFormat:"date"===a.tmp.sDateTimeMode?a._formatContains(a.tmp.sArrDateTimeFormat,["d","M","y|Y"],"and")?a.setting.headerTitle.format="DDD, MMM dd, yyyy":a.setting.headerTitle.format=a.setting.dateTimeFormat:"time"===a.tmp.sDateTimeMode&&(a._formatContains(a.tmp.sArrDateTimeFormat,["h","m"],"and")&&a._formatContains(a.tmp.sArrDateTimeFormat,["a","A"],"or")?a.setting.headerTitle.format="hh:mm "+a._getFormatForComponent("meridiem"):a._formatContains(a.tmp.sArrDateTimeFormat,["H","m"],"and")?a.setting.headerTitle.format="HH:mm":a.setting.headerTitle.format=a.setting.dateTimeFormat)),$.CF.compareStrings(a.setting.headerTitle.contentBehaviour,"Dynamic")&&$.CF.isValid(a.setting.headerTitle.format)&&("function"==typeof a.setting.headerTitle.format?a.tmp.sHeaderTitleType="DynamicFunction":"string"==typeof a.setting.headerTitle.format&&(a.tmp.sHeaderTitleType="DynamicString",a.tmp.sArrHeaderTitleFormat=a._matchRegex($.AnyPicker.extra.sFormatRegex,a.setting.headerTitle.format)))},setSelectedDate:function(e){var t=this;if($.CF.isValid(e)){if("string"==typeof e?t.tmp.selectedDate=t._parseInputDateTime(e):"[object Date]"===Object.prototype.toString.call(e)&&(t.setting.selectedDate=t.formatOutputDates(e),t.tmp.selectedDate=new Date(e)),null!==t.setting.inputElement){var a=$(t.setting.inputElement);t.tmp.oInputElemValid.bIsInput?a.val(t.setting.selectedDate):a.text(t.setting.selectedDate)}}else t.tmp.selectedDate=new Date($.AnyPicker.extra.dToday)},setMinimumDate:function(e){var t=this;t.setting.minValue=e,t.parseDisableValues()},setMaximumDate:function(e){var t=this;t.setting.maxValue=e,t.parseDisableValues()},_getFormatForComponent:function(e){for(var t=this,a=0;a<t.tmp.numOfComp;a++){var i=t.setting.components[a];if(i.name===e)return i.format}},_formatContains:function(e,t,a){var i,n,o,s=[];for(i=0;i<t.length;i++){var r=t[i],l=!1;for(n=0;n<e.length;n++){var m=e[n];if($.CF.isValid(m)&&$.CF.isValid(r)&&-1!==m.search(new RegExp(r),"")){l=!0;break}}s.push(l)}if("and"===a){for(o=!0,i=0;i<s.length;i++)if(s[i]!==!0){o=!1;break}}else if("or"===a)for(o=!1,i=0;i<s.length;i++)if(s[i]===!0){o=!0;break}return o},_setComponentAndDataSourceForFormat:function(e,t){var a=this,i={},n={},o=a._isSupportedFormat(e);o&&("d"===e||"dd"===e?(i.name="date",i.label="Date",i.type="date",$.CF.compareStrings(a.setting.theme,"iOS")&&t.MMMMddYYYY&&(i.width="24%",i.textAlign="right")):"DD"===e||"DDD"===e||"DDDD"===e?(i.name="day",i.label="Day",i.type="date"):"M"===e||"MM"===e||"MMM"===e||"MMMM"===e?(i.name="month",i.label="Month",i.type="date",$.CF.compareStrings(a.setting.theme,"iOS")&&t.MMMMddYYYY&&(i.width="46%",i.textAlign="left")):"y"===e||"Y"===e||"yyyy"===e||"Y"===e||"YYYY"===e?(i.name="year",i.label="Year",i.type="date",$.CF.compareStrings(a.setting.theme,"iOS")&&t.MMMMddYYYY&&(i.width="30%",i.textAlign="right")):"H"===e||"HH"===e||"h"===e||"hh"===e?(i.name="hours",i.label="Hours",i.type="time"):"m"===e||"mm"===e?(i.name="minutes",i.label="Minutes",i.type="time"):"s"===e||"ss"===e?(i.name="seconds",i.label="Seconds",i.type="time"):"aa"===e||"a"===e||"AA"===e||"A"===e?(i.name="meridiem",i.label="Meridiem",i.type="time"):console.log("Picker Component for "+e+" can noot be added because the format you specified as  "+e+"  cannot be parsed using this function. If you want to parse it, please add the condition in the _setComponentAndDataSourceForFormat function."),i.format=e,i.component=a.tmp.numOfComp,a.setting.components.push(i),n.component=i.component,n.data=a.__setDataSourceArrayForComponent(i.name,e),a.setting.dataSource.push(n),a.tmp.numOfComp++)},__setDataSourceArrayForComponent:function(e,t){var a,i,n,o,s,r,l,m=this,p=[],c=m.getDateObject(m.tmp.selectedDate),d=null,u=null;if($.CF.isValid(m.tmp.oMinMax.min)&&(d=m.getDateObject(m.tmp.oMinMax.min)),$.CF.isValid(m.tmp.oMinMax.max)&&(u=m.getDateObject(m.tmp.oMinMax.max)),"day"===e){if("DD"===t)for(i=0;i<$.AnyPicker.extra.en.veryShortDays.length;i++)p.push({val:i,label:m.setting.i18n.veryShortDays[i]});else if("DDD"===t)for(i=0;i<$.AnyPicker.extra.en.shortDays.length;i++)p.push({val:i,label:m.setting.i18n.shortDays[i]});else if("DDDD"===t)for(i=0;i<$.AnyPicker.extra.en.fullDays.length;i++)p.push({val:i,label:m.setting.i18n.fullDays[i]})}else if("date"===e)for(n=31,o=1,s=n,$.CF.isValid(d)&&$.CF.isValid(u)&&d.y===u.y&&d.M===u.M&&(o=d.d,s=u.d),i=o;s>=i;i++)"d"===t?a=0:"dd"===t&&(a=2),p.push({val:i,label:m.getNumberStringInFormat(i,a,!0)});else if("month"===e){if(o=1,s=12,$.CF.isValid(d)&&$.CF.isValid(u)&&d.y===u.y&&(o=d.M,s=u.M),"M"===t||"MM"===t)for("M"===t?a=0:"MM"===t&&(a=2),i=o;s>=i;i++)p.push({val:i-1,label:m.getNumberStringInFormat(i,a,!0)});else if("MMM"===t)for(i=o;s>=i;i++)p.push({val:i-1,label:m.setting.i18n.shortMonths[i-1]});else if("MMMM"===t)for(i=o;s>=i;i++)p.push({val:i-1,label:m.setting.i18n.fullMonths[i-1]})}else if("year"===e)for(r=0===m.setting.maxRows?50:m.setting.maxRows,l=Math.floor(r/2),o=$.CF.isValid(d)?d.y:r%2===0?c.y-l-1:c.y-l,s=$.CF.isValid(u)?u.y:c.y+l,i=o;s>=i;i++)p.push({val:i,label:m.getNumberStringInFormat(i,0,!0)});else if("hours"===e){var g=[],f=0;if(!m.setting.roundOff)for(f=c.H;f-m.setting.intervals.h>=0;)f-=m.setting.intervals.h;for("h"===t||"hh"===t?(g=[12,1,2,3,4,5,6,7,8,9,10,11],f%=12,f=0===f?12:f,o=g.indexOf(f),s=11):("H"===t||"HH"===t)&&(o=f,s=23),"h"===t||"H"===t?a=0:("hh"===t||"HH"===t)&&(a=2),i=o;s>=i;i+=m.setting.intervals.h)"h"===t||"hh"===t?p.push({val:g[i],label:m.getNumberStringInFormat(g[i],a,!0)}):("H"===t||"HH"===t)&&p.push({val:i,label:m.getNumberStringInFormat(i,a,!0)})}else if("minutes"===e){var h=0;if(!m.setting.roundOff)for(h=c.m;h-m.setting.intervals.m>=0;)h-=m.setting.intervals.m;for("m"===t?a=0:"mm"===t&&(a=2),i=h;60>i;i+=m.setting.intervals.m)p.push({val:i,label:m.getNumberStringInFormat(i,a,!0)})}else if("seconds"===e){var v=0;if(!m.setting.roundOff)for(v=c.s;v-m.setting.intervals.s>=0;)v-=m.setting.intervals.s;for("s"===t?a=0:"ss"===t&&(a=2),i=v;60>i;i+=m.setting.intervals.s)p.push({val:i,label:m.getNumberStringInFormat(i,a,!0)})}else if("meridiem"===e)for(i=0;2>i;i++)p.push({val:i,label:m.setting.i18n.meridiem[t][i]});return p},_setDateTimeFormatComponentsArray:function(e){var t,a=this,i=a._matchRegex($.AnyPicker.extra.sFormatRegex,e),n="",o=[];for(t=0;t<i.length;t++){var s=i[t];s.match(/[a-zA-Z0-9]/)?(""!==n&&(o.push(n),n=""),o.push(s)):n+=s}return""!==n&&(o.push(n),n=""),o},_createDateTimeRegex:function(e){var t,a,i,n=this,o="",s="(\\[[^\\[]*\\])|(\\\\)?",r="|.";for(o+=s,t=0;t<e.length;t++)a=e[t],o=n._getRegexComponentForFormat(o,a);return o+=r,i=new RegExp(o,"g")},_getRegexComponentForFormat:function(e,t){var a=this;return"d"===t||"dd"===t?e+="(\\d{1,2})":"DD"===t?(e+="(",e+=a.setting.i18n.veryShortDays.join("|"),e+=")"):"DDD"===t?(e+="(",e+=a.setting.i18n.shortDays.join("|"),e+=")"):"DDDD"===t?(e+="(",e+=a.setting.i18n.fullDays.join("|"),e+=")"):"M"===t||"MM"===t?e+="(\\d{1,2})":"MMM"===t?(e+="(",e+=a.setting.i18n.shortMonths.join("|"),e+=")"):"MMMM"===t?(e+="(",e+=a.setting.i18n.fullMonths.join("|"),e+=")"):$.CF.compareStrings(t,"y")||$.CF.compareStrings(t,"yyyy")?e+="(\\d{1,4})":$.CF.compareStrings(t,"yy")?e+="(\\d{2})":$.CF.compareStrings(t,"h")||$.CF.compareStrings(t,"hh")?e+="(\\d{1,2})":"m"===t||"mm"===t?e+="(\\d{1,2})":"s"===t||"ss"===t?e+="(\\d{1,2})":"a"===t||"aa"===t||"A"===t||"AA"===t?(e+="(","a"===t?e+=a.setting.i18n.meridiem.a.join("|"):"aa"===t?e+=a.setting.i18n.meridiem.aa.join("|"):"A"===t?e+=a.setting.i18n.meridiem.A.join("|"):"AA"===t&&(e+=a.setting.i18n.meridiem.AA.join("|")),e+=")"):e+="/"===t||"-"===t||"."===t||" "===t||":"===t||","===t?"(/|-|.| |:|,)":"("+t+")",e},_matchRegex:function(e,t){for(var a=[],i=[];null!==(i=e.exec(t));){for(var n=3;n<i.length;n++)a.push(i[n]);i.index===e.lastIndex&&e.lastIndex++}return a},_parseInputDateTime:function(e){var t,a,i,n,o,s,r=this,l=null,m={};if("string"==typeof e){for(s=r.tmp.diffDateTimeFormats?r.tmp.sArrInputDateTimeFormat:r.tmp.sArrDateTimeFormat,o=r.tmp.diffDateTimeFormats?r.tmp.sInputDateTimeRegex:r.tmp.sDateTimeRegex,n=r._matchRegex(o,e),t=0;t<s.length;t++)a=s[t],i=n[t],-1!==a.search(/D|d|M|y|Y|H|h|m|s|A|a/,"")&&(m=r._setInputDateTimeValue(a,i,m));$.CF.isValid(m.h)&&(($.CF.compareStrings(m.me,"AM")||$.CF.compareStrings(m.sm,"A"))&&12===m.h?m.H=0:($.CF.compareStrings(m.me,"PM")||$.CF.compareStrings(m.sm,"P"))&&m.h<12?m.H=m.h+12:m.H=m.h),l=r.setDateInFormat({iDate:m},"")}else"[object Date]"===Object.prototype.toString.call(e)&&(l=new Date(e));return l},_setInputDateTimeValue:function(e,t,a){var i=this;if(i._isSupportedFormat(e))if("d"===e||"dd"===e)a.d=parseInt(t);else if("M"===e||"MM"===e)a.M=parseInt(t)-1;else if("MMM"===e)a.M=i.setting.i18n.shortMonths.indexOf(t);else if("MMMM"===e)a.M=i.setting.i18n.fullMonths.indexOf(t);else if($.CF.compareStrings(e,"yy")){a.y=parseInt(t);var n=i.setting.maxYear/100,o=i.setting.maxYear%100;a.y>o?a.y=100*(n-1)+a.y:a.y=100*n+a.y}else $.CF.compareStrings(e,"y")||$.CF.compareStrings(e,"yyyy")?a.y=parseInt(t):"H"===e||"HH"===e?a.H=parseInt(t):"h"===e||"hh"===e?a.h=parseInt(t):"m"===e||"mm"===e?a.m=parseInt(t):"s"===e||"ss"===e?a.s=parseInt(t):"a"===e||"A"===e?$.CF.isValid(t)&&(-1!==t.search(/A/gi,"")?a.me="A":-1!==t.search(/P/gi,"")&&(a.me="P")):("aa"===e||"AA"===e)&&$.CF.isValid(t)&&(-1!==t.search(/AM/gi,"")?a.me="AM":-1!==t.search(/PM/gi,"")&&(a.me="PM"));return a},formatOutputDates:function(e,t){var a,i,n,o,s=this,r="";for(n=$.CF.isValid(t)?"string"==typeof t?s._setDateTimeFormatComponentsArray(t):t:s.tmp.diffDateTimeFormats?s.tmp.sArrInputDateTimeFormat:s.tmp.sArrDateTimeFormat,o=s.getDateObject(e),i=0;i<n.length;i++)if(a=n[i],"dd"===a)r+=s.getNumberStringInFormat(o.d,2,!0);else if("d"===a)r+=s.getNumberStringInFormat(o.d,0,!0);else if("DDDD"===a)r+=s.setting.i18n.fullDays[o.D];else if("DDD"===a)r+=s.setting.i18n.shortDays[o.D];else if("DD"===a)r+=s.setting.i18n.veryShortDays[o.D];else if("MMMM"===a)r+=s.setting.i18n.fullMonths[o.M];else if("MMM"===a)r+=s.setting.i18n.shortMonths[o.M];else if("MM"===a)r+=s.getNumberStringInFormat(o.M+1,2,!0);else if("M"===a)r+=s.getNumberStringInFormat(o.M+1,0,!0);else if($.CF.compareStrings(a,"yyyy"))r+=s.getNumberStringInFormat(o.y,4,!0);else if($.CF.compareStrings(a,"yy")){
var l=Math.floor(o.y/10)%10*10+o.y%10;r+=s.getNumberStringInFormat(l,2,!0)}else r+=$.CF.compareStrings(a,"y")?s.getNumberStringInFormat(o.y,4,!0):"hh"===a?s.getNumberStringInFormat(o.h,2,!0):"h"===a?s.getNumberStringInFormat(o.h,0,!0):"HH"===a?s.getNumberStringInFormat(o.H,2,!0):"H"===a?s.getNumberStringInFormat(o.H,0,!0):"mm"===a?s.getNumberStringInFormat(o.m,2,!0):"m"===a?s.getNumberStringInFormat(o.m,0,!0):"ss"===a?s.getNumberStringInFormat(o.s,2,!0):"s"===a?s.getNumberStringInFormat(o.s,0,!0):"aa"===a?o.me:"a"===a?o.sm:"AA"===a?o.me.toUpperCase():"A"===a?o.sm.toUpperCase():a;return r},parseDisableValues:function(){var e=this;e.tmp.oMinMax={min:null,max:null},e.tmp.oArrPDisable={day:[],date:[],time:[],datetime:[]};var t,a,i;if($.CF.isValid(e.setting.minValue)){var n=e._parseInputDateTime(e.setting.minValue);$.CF.isValid(n)&&(e.tmp.oMinMax.min=n)}if($.CF.isValid(e.setting.maxValue)){var o=e._parseInputDateTime(e.setting.maxValue);$.CF.isValid(o)&&(e.tmp.oMinMax.max=o)}if("date"===e.tmp.sDateTimeMode?e.tmp.oArrPDisable.date.push([e.tmp.oMinMax]):"time"===e.tmp.sDateTimeMode?e.tmp.oArrPDisable.time.push({day:[],val:[e.tmp.oMinMax]}):"datetime"===e.tmp.sDateTimeMode&&e.tmp.oArrPDisable.datetime.push(e.tmp.oMinMax),$.CF.isValid(e.setting.disableValues)){if($.CF.isValid(e.setting.disableValues.day)&&e.setting.disableValues.day.length>0)for(t=0;t<e.setting.disableValues.day.length;t++)e.setting.disableValues.day[t]>=0&&e.setting.disableValues.day[t]<=6&&e.tmp.oArrPDisable.day.push(e.setting.disableValues.day[t]);if($.CF.isValid(e.setting.disableValues.date)&&e.setting.disableValues.date.length>0)for(t=0;t<e.setting.disableValues.date.length;t++){var s=e.setting.disableValues.date[t],r=null;if($.CF.isValid(s.val)){var l=e._parseInputDateTime(s.val);$.CF.isValid(l)&&(null===r&&(r={}),r.val=l)}if($.CF.isValid(s.start)){var m=e._parseInputDateTime(s.start);$.CF.isValid(m)&&(null===r&&(r={}),r.start=m)}if($.CF.isValid(s.end)){var p=e._parseInputDateTime(s.end);$.CF.isValid(p)&&(null===r&&(r={}),r.end=p)}$.CF.isValid(r)&&e.tmp.oArrPDisable.date.push(r)}if($.CF.isValid(e.setting.disableValues.time)&&e.setting.disableValues.time.length>0)for(a=0;a<e.setting.disableValues.time.length;a++){var c=e.setting.disableValues.time[a],d=$.CF.isValid(c.day)&&c.day.length>0,u=$.CF.isValid(c.val)&&c.val.length>0;if(u){var g=[];for(i=0;i<c.val.length;i++){var f=c.val[i],h=null;if($.CF.isValid(f.val)){var v=e._parseInputDateTime(f.val);$.CF.isValid(v)&&(null===h&&(h={}),h.val=f)}if($.CF.isValid(f.start)){var D=e._parseInputDateTime(f.start);$.CF.isValid(D)&&(null===h&&(h={}),h.start=D)}if($.CF.isValid(f.end)){var S=e._parseInputDateTime(f.end);$.CF.isValid(S)&&(null===h&&(h={}),h.end=S)}$.CF.isValid(h)&&g.push(h)}g.length>0&&e.tmp.oArrPDisable.time.push({day:d?c.day:[],val:g})}}if($.CF.isValid(e.setting.disableValues.datetime)&&e.setting.disableValues.datetime.length>0)for(a=0;a<e.setting.disableValues.datetime.length;a++){var y=e.setting.disableValues.datetime[a],T=null;if($.CF.isValid(y.val)){var C=e._parseInputDateTime(y.val);$.CF.isValid(C)&&(null===T&&(T={}),T.val=C)}if($.CF.isValid(y.start)){var b=e._parseInputDateTime(y.start);$.CF.isValid(b)&&(null===T&&(T={}),T.start=b)}if($.CF.isValid(y.end)){var w=e._parseInputDateTime(y.end);$.CF.isValid(w)&&(null===T&&(T={}),T.end=w)}$.CF.isValid(T)&&e.tmp.oArrPDisable.datetime.push(T)}}else console.log("Invalid value for AnyPicker plugin option disableValues")},__setSelectedDateTimeInComponent:function(){var e,t,a=this,i="",n=a.getDateObject(a.tmp.selectedDate);for(e=0;e<a.tmp.numOfComp;e++)t=a.setting.components[e],"date"===t.name?i=n.d:"day"===t.name?i=n.D:"month"===t.name?i=n.M:"year"===t.name?i=n.y:"hours"===t.name?"h"===t.format||"hh"===t.format?i=n.h:("H"===t.format||"HH"===t.format)&&(i=n.H):"minutes"===t.name?i=n.m:"seconds"===t.name?i=n.s:"meridiem"===t.name&&("a"===n.sm?i=0:"p"===n.sm&&(i=1)),a.__changeComponentValue(e,i)},__disableInvalidRowsOfDateTimePicker:function(){var e,t,a,i,n,o,s,r,l,m=this;if(1===m.tmp.numOfComp){if(o=m.setting.components[0],s=o.name,r=o.format,l=m.setting.dataSource[0].data,"day"===s)for(e=0;e<l.length;e++)for(t=0;t<m.tmp.oArrPDisable.day.length;t++)m.tmp.oArrPDisable.day[t]===l[t].val&&$(m.elem).find("#ap-row-0-"+e).addClass("ap-row-disabled ap-row-invalid")}else for(n=m.__getSelectedDate(!0)[1],e=0;e<m.setting.dataSource.length;e++){var p=m.setting.dataSource[e];for(t=0;t<p.data.length;t++){var c={d:1,M:0,y:0,H:0,h:0,m:0,s:0,sm:0};for(a=0;a<m.tmp.numOfComp;a++)a===e?(i=p.data[t].val,o=m.setting.components[a],s=o.name,r=o.format):(i=n[a],o=m.setting.components[a],s=o.name,r=o.format),"date"===s?c.d=parseInt(i):"month"===s?c.M=parseInt(i):"year"===s?c.y=parseInt(i):"hours"===s?"h"===r||"hh"===r?(c.h=parseInt(i),c.H=-1):("H"===r||"HH"===r)&&(c.H=parseInt(i)):"minutes"===s?c.m=parseInt(i):"seconds"===s?c.s=parseInt(i):"meridiem"===s&&(c.sm=parseInt(i));-1===c.H&&(c.H=1===c.sm?12===c.h?12:c.h+12:12===c.h?0:c.h);var d=m.setDateInFormat({iDate:c},""),u=m.__validateSelectedDate(d,!0,!1);u||$("#ap-component-"+e).find("#ap-row-"+e+"-"+t).addClass("ap-row-disabled ap-row-invalid")}}},__getSelectedDate:function(e){var t,a,i,n,o,s=this,r=s.getDateObject(s.tmp.selectedDate),l={},m=0,p=[];for(t=0;t<s.tmp.numOfComp;t++)a=s.setting.components[t],i=$(s.tmp.overlaySelector).find("#ap-component-"+t+" .ap-row-selected"),n=i.length>0?i[0]:null,o=parseInt($(n).data("value")),p.push(o),"date"===a.name?r.d=isNaN(o)?r.d:o:"day"===a.name?r.D=isNaN(o)?r.D:o:"month"===a.name?r.M=isNaN(o)?r.M:o:"year"===a.name?r.y=isNaN(o)?r.y:o:"hours"===a.name?"h"===a.format||"hh"===a.format?(r.h=isNaN(o)?r.h:o,r.H=-1):r.H=isNaN(o)?r.H:o:"minutes"===a.name?r.m=isNaN(o)?r.m:o:"seconds"===a.name?r.s=isNaN(o)?r.s:o:"meridiem"===a.name&&(m=isNaN(o)?"a"===r.sm?0:1:o);-1===r.H&&(r.H=1===m?12===r.h?12:r.h+12:12===r.h?0:r.h);var c=s._getNumberOfDaysOfMonth(r.M,r.y);return r.d>c&&(r.d=c),l=s.setDateInFormat({iDate:r},""),e?[l,p]:l},__validateSelectedDate:function(e,t,a){var i=this,n=i.getDateObject(e);if($.CF.isValid(i.tmp.oArrPDisable)){var o,s,r,l,m,p,c,d="datetime"===i.tmp.sDateTimeMode||"date"===i.tmp.sDateTimeMode,u="datetime"===i.tmp.sDateTimeMode||"time"===i.tmp.sDateTimeMode,g=!1,f=!0;if(!g&&d&&i.tmp.oArrPDisable.day.length>0)for(o=0;o<i.tmp.oArrPDisable.day.length;o++)if(i.tmp.oArrPDisable.day[o]===n.D){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,e,"day"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}if(!g&&d&&i.tmp.oArrPDisable.date.length>0)for(o=0;o<i.tmp.oArrPDisable.date.length;o++)if(p=i.tmp.oArrPDisable.date[o],$.CF.isValid(p.val)){if(0===i.compareDates(e,p.val)){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,e,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.start)&&$.CF.isValid(p.end)){if(i.compareDates(e,p.start)>=0&&i.compareDates(e,p.end)<=0){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,p.start,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.start)){if(i.compareDates(e,p.start)>=0){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!0,p.start,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.end)){if(i.compareDates(e,p.end)<=0){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!1,p.end,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.min)&&$.CF.isValid(p.max)){if(r=i.compareDates(e,p.min)<0,l=i.compareDates(e,p.max)>0,m=r?!0:l?!1:!0,r||l){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(m,p.min,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.min)){if(i.compareDates(e,p.min)<0){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!1,p.min,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.max)&&i.compareDates(e,p.max)>0){0===i.compareDates(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!0,p.max,"date"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}if(!g&&u&&i.tmp.oArrPDisable.time.length>0)for(o=0;o<i.tmp.oArrPDisable.time.length;o++){var h=i.tmp.oArrPDisable.time[o],v=!1;if($.CF.isValid(h.day)&&h.day.length>0)for(s=0;s<h.day.length&&!(v=h.day[s]===n.D);s++);else v=!0;if(v)for(s=0;s<h.val.length;s++)if(c=h.val[s],$.CF.isValid(c.val)){if(0===i.compareTimes(e,c.val)){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,e,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(c.start)&&$.CF.isValid(c.end)){if(i.compareTimes(e,c.start)>=0&&i.compareTimes(e,c.end)<=0){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,c.start,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(c.start)){if(i.compareTimes(e,c.start)>=0){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!0,c.start,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(c.end)){if(i.compareTimes(e,c.end)<=0){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!1,c.end,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(c.min)&&$.CF.isValid(c.max)){if(r=i.compareTimes(e,c.min)<0,l=i.compareTimes(e,c.max)>0,m=r?!0:l?!1:!0,r||l){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(m,c.min,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(c.min)){if(i.compareTimes(e,c.min)<0){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!1,c.min,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(c.max)&&i.compareTimes(e,c.max)>0){0===i.compareTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!0,c.max,"time"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}if(!g&&u&&i.tmp.oArrPDisable.datetime.length>0)for(o=0;o<i.tmp.oArrPDisable.datetime.length;o++)if(p=i.tmp.oArrPDisable.datetime[o],$.CF.isValid(p.val)){if(0===i.compareDateTimes(e,p.val)){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,e,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.start)&&$.CF.isValid(p.end)){if(i.compareDateTimes(e,p.start)>=0&&i.compareDateTimes(e,p.end)<=0){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(a,p.start,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.start)){if(i.compareDateTimes(e,p.start)>=0){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!0,p.start,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.end)){if(i.compareDateTimes(e,p.end)<=0){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!1,p.end,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.min)&&$.CF.isValid(p.max)){if(r=i.compareDates(e,p.min)<0,l=i.compareDates(e,p.max)>0,m=r?!0:l?!1:!0,r||l){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(m,p.min,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.min)){if(i.compareDateTimes(e,p.min)<0){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!1,p.min,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}}else if($.CF.isValid(p.max)&&i.compareDateTimes(e,p.max)>0){0===i.compareDateTimes(e,i.tmp.selectedDate)?(g=!0,e=i._findValidSelectedDate(!0,p.max,"datetime"),i.tmp.selectedDate=new Date(e),i.__scrollToSelectedRow()):t?f=!1:i.__scrollToSelectedRow();break}if(t)return f}else if(t)return!0},_findValidSelectedDate:function(e,t,a){var i=this;if("day"===a||"date"===a){$.CF.isValid(i.setting.minValue)&&i.compareDates(i.setting.minValue,t)>=0&&(t=new Date(i.setting.minValue),e=!1),$.CF.isValid(i.setting.maxValue)&&i.compareDates(i.setting.maxValue,t)<=0&&(t=new Date(i.setting.maxValue),e=!0);do if(t=e?new Date(t.getTime()-$.AnyPicker.extra.iMS.d):new Date(t.getTime()+$.AnyPicker.extra.iMS.d),i.__validateSelectedDate(t,!0,!1)&&(!$.CF.isValid(i.setting.minValue)||$.CF.isValid(i.setting.minValue)&&i.compareDates(i.setting.minValue,t)<=0)&&(!$.CF.isValid(i.setting.maxValue)||$.CF.isValid(i.setting.maxValue)&&i.compareDates(i.setting.maxValue,t)>=0))return t;while((!$.CF.isValid(i.setting.minValue)||$.CF.isValid(i.setting.minValue)&&i.compareDates(i.setting.minValue,t)<=0)&&(!$.CF.isValid(i.setting.maxValue)||$.CF.isValid(i.setting.maxValue)&&i.compareDates(i.setting.maxValue,t)>=0))}else if("time"===a){$.CF.isValid(i.setting.minValue)&&i.compareTimes(i.setting.minValue,t)>=0&&(t=new Date(i.setting.minValue),e=!1),$.CF.isValid(i.setting.maxValue)&&i.compareTimes(i.setting.maxValue,t)<=0&&(t=new Date(i.setting.maxValue),e=!0);do if(t=e?new Date(t.getTime()-$.AnyPicker.extra.iMS.m*i.setting.intervals.m):new Date(t.getTime()+$.AnyPicker.extra.iMS.m*i.setting.intervals.m),i.__validateSelectedDate(t,!0,!1)&&(!$.CF.isValid(i.setting.minValue)||$.CF.isValid(i.setting.minValue)&&i.compareTimes(i.setting.minValue,t)<=0)&&(!$.CF.isValid(i.setting.maxValue)||$.CF.isValid(i.setting.maxValue)&&i.compareTimes(i.setting.maxValue,t)>=0))return t;while((!$.CF.isValid(i.setting.minValue)||$.CF.isValid(i.setting.minValue)&&i.compareTimes(i.setting.minValue,t)<=0)&&(!$.CF.isValid(i.setting.maxValue)||$.CF.isValid(i.setting.maxValue)&&i.compareTimes(i.setting.maxValue,t)>=0))}else if("datetime"===a){$.CF.isValid(i.setting.minValue)&&i.compareDateTimes(i.setting.minValue,t)>=0&&(t=new Date(i.setting.minValue),e=!1),$.CF.isValid(i.setting.maxValue)&&i.compareDateTimes(i.setting.maxValue,t)<=0&&(t=new Date(i.setting.maxValue),e=!0);do if(t=e?new Date(t.getTime()-$.AnyPicker.extra.iMS.m*i.setting.intervals.m):new Date(t.getTime()+$.AnyPicker.extra.iMS.m*i.setting.intervals.m),i.__validateSelectedDate(t,!0,!1)&&(!$.CF.isValid(i.setting.minValue)||$.CF.isValid(i.setting.minValue)&&i.compareDateTimes(i.setting.minValue,t)<=0)&&(!$.CF.isValid(i.setting.maxValue)||$.CF.isValid(i.setting.maxValue)&&i.compareDateTimes(i.setting.maxValue,t)>=0))return t;while((!$.CF.isValid(i.setting.minValue)||$.CF.isValid(i.setting.minValue)&&i.compareDateTimes(i.setting.minValue,t)<=0)&&(!$.CF.isValid(i.setting.maxValue)||$.CF.isValid(i.setting.maxValue)&&i.compareDateTimes(i.setting.maxValue,t)>=0))}return $.CF.isValid(i.setting.minValue)?i.setting.minValue:void 0},__setDaysOfMonthInDatePicker:function(){var e,t,a=this,i=null,n=null;for(e=0;e<a.tmp.numOfComp;e++)t=a.setting.components[e],"date"===t.name&&(i=t.component,n=t.format);if(null!==i){var o=a.getDateObject(a.tmp.selectedDate),s=a._getNumberOfDaysOfMonth(o.M,o.y),r=!1;for(e=s+1;31>=e;e++){var l=$("#ap-component-"+i).find("#ap-row-"+i+"-"+(e-1));l.addClass("ap-row-disabled ap-row-hidden"),r||(r="true"===l.attr("aria-selected")?!0:!1)}if(r){var m=new Date(o.y,o.M,s,o.H,o.m,o.s,o.ms);a.__validateSelectedDate(m,!1,!0),a.__scrollToSelectedRow()}}},setDateInFormat:function(e,t){var a=this;void 0===e.date&&void 0===e.iDate&&(e.date=a._getCurrentDate()),void 0===e.iDate?e.iDate={d:e.date.getDate(),M:e.date.getMonth(),y:e.date.getFullYear(),H:e.date.getHours(),m:e.date.getMinutes(),s:e.date.getSeconds(),ms:e.date.getMilliseconds()}:e.iDate={d:void 0!==e.iDate.d?e.iDate.d:1,M:void 0!==e.iDate.M?e.iDate.M:$.AnyPicker.extra.dToday.getMonth(),y:void 0!==e.iDate.y?e.iDate.y:$.AnyPicker.extra.dToday.getFullYear(),H:void 0!==e.iDate.H?e.iDate.H:0,m:void 0!==e.iDate.m?e.iDate.m:0,s:void 0!==e.iDate.s?e.iDate.s:0,ms:void 0!==e.iDate.ms?e.iDate.ms:0};var i;return $.CF.isValid(t)?"START"===t?i=new Date(e.iDate.y,e.iDate.M,e.iDate.d,0,0,0,0):"END"===t&&(i=new Date(e.iDate.y,e.iDate.M,e.iDate.d,23,59,59,999)):i=new Date(e.iDate.y,e.iDate.M,e.iDate.d,e.iDate.H,e.iDate.m,e.iDate.s,e.iDate.ms),i},_getCurrentDate:function(){var e=this,t=e.getDateByAddingOutputTZOffset(e.convertToUTC(new Date),e.setting.tzOffset);return t},convertToUTC:function(e,t){var a=this;return new Date(e.getTime()-(void 0===t||""===t||null===t?-(e.getTimezoneOffset()*$.AnyPicker.extra.iMS.m):a._getTZOffsetInMS(t)))},_getTZOffsetInMS:function(e){var t=this,a=0;if(void 0===e||""===e||null===e)a=-($.AnyPicker.extra.dToday.getTimezoneOffset()*$.AnyPicker.extra.iMS.m);else{var i=t._matchRegex(/^([+|-]{1})([0-1]{0,1}[0-9]{1}):([0-6]{0,1}[0-9]{1})$/,e);a=parseInt(i[2])*$.AnyPicker.extra.iMS.h+parseInt(i[3])*$.AnyPicker.extra.iMS.m,a="+"===i[1]?a:-a}return a},getDateByAddingOutputTZOffset:function(e,t){var a=this;return new Date(e.getTime()+a._getTZOffsetInMS(t))},normalizeDateTimeWithOffset:function(e,t,a){var i=this;return i.getDateByAddingOutputTZOffset(i.convertToUTC(e,t),a)},_getNumberOfDaysOfMonth:function(e,t){var a=[31,28,31,30,31,30,31,31,30,31,30,31],i=[31,29,31,30,31,30,31,31,30,31,30,31];return t%4===0?i[e]:a[e]},_normalizeDateTime:function(e,t,a){var i,n=this,o={d:e.getDate(),M:e.getMonth(),y:e.getFullYear(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()};switch(a){case"s":"START"===t?i=new Date(o.y,o.M,o.d,o.H,o.m,0,0):"END"===t&&(i=new Date(o.y,o.M,o.d,o.H,o.m,59,999));break;case"m":"START"===t?i=new Date(o.y,o.M,o.d,o.H,0,0,0):"END"===t&&(i=new Date(o.y,o.M,o.d,o.H,59,59,999));break;case"h":case"T":"START"===t?i=new Date(o.y,o.M,o.d,0,0,0,0):"END"===t&&(i=new Date(o.y,o.M,o.d,23,59,59,999));break;case"d":case"dE":"START"===t?i=new Date(o.y,o.M,1,0,0,0,0):"END"===t&&(i=new Date(o.y,o.M,n._getNumberOfDaysOfMonth(o.M,o.y),0,0,0,0));break;case"M":case"ME":case"y":case"yE":"START"===t?i=new Date(o.y,0,1,0,0,0,0):"END"===t&&(i=new Date(o.y,11,n._getNumberOfDaysOfMonth(11,o.y),0,0,0,0))}return("dE"===a||"ME"===a||"yE"===a)&&(i=n._normalizeDateTime(i,"END","T")),i},_getDifference:function(e,t,a){var i,n=t.getTime()-a.getTime();return"ms"===e?i=n:"s"===e?i=n/$.AnyPicker.extra.iMS.s:"m"===e?i=n/$.AnyPicker.extra.iMS.m:"h"===e?i=n/$.AnyPicker.extra.iMS.h:"d"===e?i=n/$.AnyPicker.extra.iMS.d:"M"===e?i=n/$.AnyPicker.extra.iMS.m:"y"===e&&(i=n/$.AnyPicker.extra.iMS.y),i},compareDates:function(e,t){var a=this;e=a._normalizeDateTime(e,"START","T"),t=a._normalizeDateTime(t,"START","T");var i=a._getDifference("d",e,t);return 0===i?i:i/Math.abs(i)},compareDateTimes:function(e,t){var a=this,i=a._getDifference("m",e,t);return 0===i?i:i/Math.abs(i)},compareTimes:function(e,t){var a=this,i=new Date($.AnyPicker.extra.dToday),n=new Date($.AnyPicker.extra.dToday);i.setHours(e.getHours()),i.setMinutes(e.getMinutes()),i.setSeconds(e.getSeconds()),n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),a.compareDateTimes(i,n)},getNumberStringInFormat:function(e,t,a){var i,n=this,o="",s=e.toString(),r=s.length;if(0!==t)for(i=0;t-r>i;i++)o+=a?n.setting.i18n.numbers[0]:"0";if(a)for(i=0;r>i;i++)o+=n.setting.i18n.numbers[parseInt(s.charAt(i))];else o+=s;return o},getDateObject:function(e){var t={D:e.getDay(),d:e.getDate(),M:e.getMonth(),y:e.getFullYear(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds(),ms:e.getMilliseconds()};return t.h=t.H>12?t.H-12:0===t.H?12:t.H,t.me=t.H<12?"am":"pm",t.sm=t.H<12?"a":"p",t}})}()},function(e,t){!function(e){e.AnyPicker.i18n["zh-cn"]=e.extend(e.AnyPicker.i18n["zh-cn"],{headerTitle:"选择",setButton:"确认",clearButton:"明确",nowButton:"现在",cancelButton:"取消",dateSwitch:"日期",timeSwitch:"时间",veryShortDays:"日_一_二_三_四_五_六".split("_"),shortDays:"周日_周一_周二_周三_周四_周五_周六".split("_"),fullDays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),shortMonths:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),fullMonths:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),numbers:"0_1_2_3_4_5_6_7_8_9".split("_"),meridiem:{a:["a","p"],aa:["am","pm"],A:["A","P"],AA:["AM","PM"]}})}(jQuery)}]);