define("datePicker/subComponents/day",["lodash","react","core","santaProps"],function(a,b,c,d){"use strict";return{displayName:"Day",propTypes:{id:b.PropTypes.string.isRequired,styleId:b.PropTypes.string.isRequired,dateUtils:b.PropTypes.object.isRequired,day:b.PropTypes.object.isRequired,today:b.PropTypes.object.isRequired,calendarDate:b.PropTypes.object.isRequired,closeCalendar:b.PropTypes.func.isRequired,onDateChange:b.PropTypes.func.isRequired,isMobileView:d.Types.isMobileView.isRequired,isMobileDevice:d.Types.Device.isMobileDevice.isRequired,allowPastDates:b.PropTypes.bool,allowFutureDates:b.PropTypes.bool,disabledDates:b.PropTypes.arrayOf(b.PropTypes.string),disabledDaysOfWeek:b.PropTypes.arrayOf(b.PropTypes.number),minDate:b.PropTypes.string,maxDate:b.PropTypes.string,selectedDate:b.PropTypes.object},statics:{useSantaTypes:true},mixins:[c.compMixins.skinBasedComp],getInitialState:function(){return{$mobile:this.props.isMobileDevice||this.props.isMobileView?"mobile":"notMobile"}},componentWillMount:function(){this.isDisabled=this.isDayDisabled(this.props)},componentWillReceiveProps:function(a){this.isDisabled=this.isDayDisabled(a)},isSpecificDateDisable:function(b){return a.some(b.disabledDates,function(a){return b.dateUtils.helpers.isSameDay(b.day,new Date(a))})},isWeekDayDisable:function(b){return a.includes(b.disabledDaysOfWeek,b.dateUtils.helpers.getDay(b.day))},isDisallowedPastDate:function(b){return a.isBoolean(b.allowPastDates)&&!b.allowPastDates&&b.dateUtils.helpers.isBefore(b.day,b.today)},isDisallowedFutureDate:function(b){return a.isBoolean(b.allowFutureDates)&&!b.allowFutureDates&&b.dateUtils.helpers.isAfter(b.day,b.today)},isBeforeMinDate:function(a){return a.minDate&&a.dateUtils.helpers.isBefore(a.day,new Date(a.minDate))},isAfterMaxDate:function(a){return a.maxDate&&a.dateUtils.helpers.isAfter(a.day,new Date(a.maxDate))},isDayDisabled:function(a){return this.isSpecificDateDisable(a)||this.isWeekDayDisable(a)||this.isDisallowedPastDate(a)||this.isDisallowedFutureDate(a)||this.isBeforeMinDate(a)||this.isAfterMaxDate(a)},getCssClasses:function(){var a=this.props.dateUtils;var b=this.props.day;var c={};if(!a.helpers.isSameMonth(b,this.props.calendarDate)){c.hidden=true}else if(this.isDisabled){c.disabled=true}else if(a.helpers.isSameDay(b,this.props.selectedDate)){c.selected=true}else if(a.helpers.isSameDay(b,this.props.today)){c.today=true}return this.classSet(c)},handleDayClick:function(){this.props.onDateChange(this.props.day);this.props.closeCalendar()},getSkinProperties:function(){return{"":{onMouseDown:this.isDisabled?null:this.handleDayClick,className:this.getCssClasses()},dayContent:{children:this.props.dateUtils.helpers.getDate(this.props.day)}}}}});define("datePicker/subComponents/month",["react","lodash","core","santaProps","datePicker/subComponents/day"],function(a,b,c,d,e){"use strict";return{displayName:"Month",propTypes:b.assign({id:a.PropTypes.string.isRequired,styleId:a.PropTypes.string.isRequired,dateUtils:a.PropTypes.object.isRequired,calendarDate:a.PropTypes.object.isRequired,today:a.PropTypes.object.isRequired,closeCalendar:a.PropTypes.func.isRequired,onDateChange:a.PropTypes.func.isRequired,isMobileView:d.Types.isMobileView.isRequired,isMobileDevice:d.Types.Device.isMobileDevice.isRequired,allowPastDates:a.PropTypes.bool,allowFutureDates:a.PropTypes.bool,disabledDates:a.PropTypes.arrayOf(a.PropTypes.string),disabledDaysOfWeek:a.PropTypes.arrayOf(a.PropTypes.number),minDate:a.PropTypes.string,maxDate:a.PropTypes.string,selectedDate:a.PropTypes.object},d.santaTypesUtils.getSantaTypesByDefinition(e)),statics:{useSantaTypes:true},mixins:[c.compMixins.skinBasedComp],getInitialState:function(){return{$mobile:this.props.isMobileDevice||this.props.isMobileView?"mobile":"notMobile"}},isWeekInMonth:function(a){var b=this.props.dateUtils;var c=this.props.calendarDate;var d=b.helpers.addDays(a,6);return b.helpers.isSameMonth(a,c)||b.helpers.isSameMonth(d,c)},generateDays:function(a){var c=this.props.dateUtils;var d=c.helpers.getISOWeek(a);return b(c.constants.NUMBER_OF_DAYS_IN_WEEK).range().map(function(b){return this.createChildComponent({},"wysiwyg.viewer.components.Day","day",{id:this.props.id+"week"+d+"day"+b,ref:this.props.id+"week"+d+"day"+b,key:this.props.id+"week"+d+"day"+b,style:{},dateUtils:this.props.dateUtils,day:c.helpers.addDays(a,b),today:this.props.today,onDateChange:this.props.onDateChange,closeCalendar:this.props.closeCalendar,selectedDate:this.props.selectedDate,calendarDate:this.props.calendarDate,disabledDates:this.props.disabledDates,disabledDaysOfWeek:this.props.disabledDaysOfWeek,allowPastDates:this.props.allowPastDates,allowFutureDates:this.props.allowFutureDates,minDate:this.props.minDate,maxDate:this.props.maxDate})},this).value()},generateWeeks:function(){var c=this.props.dateUtils;var d=c.helpers.getStartDayOfTheMonth(this.props.calendarDate);var e=c.helpers.getStartDayOfTheWeek(d,{weekStartsOn:1});return b(c.constants.MAX_NUMBER_OF_WEEKS).range().map(function(a){return this.props.dateUtils.helpers.addWeeks(e,a)},this).filter(function(a){return this.isWeekInMonth(a)},this).map(function(b){return a.DOM.div({className:this.props.styleId+"_week"},this.generateDays(b))},this).value()},getSkinProperties:function(){return{"":{children:this.generateWeeks()}}}}});define("datePicker/subComponents/calendar",["react","lodash","core","santaProps","datePicker/subComponents/month"],function(a,b,c,d,e){"use strict";return{displayName:"Calendar",propTypes:b.assign({id:a.PropTypes.string.isRequired,styleId:a.PropTypes.string.isRequired,dateUtils:a.PropTypes.object.isRequired,calendarDate:a.PropTypes.object.isRequired,today:a.PropTypes.object.isRequired,closeCalendar:a.PropTypes.func.isRequired,onDateChange:a.PropTypes.func.isRequired,isMobileView:d.Types.isMobileView.isRequired,isMobileDevice:d.Types.Device.isMobileDevice.isRequired,siteWidth:d.Types.siteWidth.isRequired,siteScrollingBlocker:d.Types.Aspects.siteScrollingBlocker.isRequired,forceBackground:d.Types.forceBackground.isRequired,disableForcedBackground:d.Types.disableForcedBackground.isRequired,allowPastDates:a.PropTypes.bool,allowFutureDates:a.PropTypes.bool,disabledDates:a.PropTypes.arrayOf(a.PropTypes.string),disabledDaysOfWeek:a.PropTypes.arrayOf(a.PropTypes.number),minDate:a.PropTypes.string,maxDate:a.PropTypes.string,selectedDate:a.PropTypes.object},d.santaTypesUtils.getSantaTypesByDefinition(e)),statics:{useSantaTypes:true},mixins:[c.compMixins.skinBasedComp],getInitialState:function(){return{calendarDate:this.props.calendarDate,$mobile:this.props.isMobileDevice||this.props.isMobileView?"mobile":"notMobile"}},componentWillReceiveProps:function(a){if(!this.props.dateUtils.helpers.isEqual(this.props.calendarDate,a.calendarDate)){this.setState({calendarDate:a.calendarDate})}},generateDayNames:function(){var c=this.props.dateUtils;var d=c.helpers.getStartDayOfTheWeek(this.state.calendarDate,{weekStartsOn:1});return b(c.constants.NUMBER_OF_DAYS_IN_WEEK).range().map(function(b){var c=this.props.dateUtils.helpers.addDays(d,b);return a.DOM.div({className:this.props.styleId+"_day-name"},this.props.dateUtils.helpers.getDayNameMin(c))},this).value()},generateMonth:function(){return this.createChildComponent({},"wysiwyg.viewer.components.Month","month",{id:this.props.id+"month",ref:this.props.id+"month",style:{},dateUtils:this.props.dateUtils,selectedDate:this.props.selectedDate,calendarDate:this.state.calendarDate,today:this.props.today,onDateChange:this.props.onDateChange,closeCalendar:this.props.closeCalendar,disabledDates:this.props.disabledDates,disabledDaysOfWeek:this.props.disabledDaysOfWeek,allowPastDates:this.props.allowPastDates,allowFutureDates:this.props.allowFutureDates,minDate:this.props.minDate,maxDate:this.props.maxDate})},subYear:function(){this.setState({calendarDate:this.props.dateUtils.helpers.subYears(this.state.calendarDate,1)})},subMonth:function(){this.setState({calendarDate:this.props.dateUtils.helpers.subMonths(this.state.calendarDate,1)})},addMonth:function(){this.setState({calendarDate:this.props.dateUtils.helpers.addMonths(this.state.calendarDate,1)})},addYear:function(){this.setState({calendarDate:this.props.dateUtils.helpers.addYears(this.state.calendarDate,1)})},getCurrentMonth:function(a,b){var c=this.state.$mobile==="mobile"?a:b;return this.props.dateUtils.helpers.getDateByFormat(this.state.calendarDate,c)},createOverlay:function(a){return c.componentUtils.fullScreenOverlay.createOverlay(a,{siteWidth:this.props.siteWidth,siteScrollingBlocker:this.props.siteScrollingBlocker,forceBackground:this.props.forceBackground,disableForcedBackground:this.props.disableForcedBackground,isMobileDevice:this.props.isMobileDevice,overlayBackgroundOpacity:"0.7"})},getSkinProperties:function(){var a={previousYearNav:{onClick:this.subYear},previousMonthNav:{onClick:this.subMonth},currentMonthWithYear:{children:this.getCurrentMonth(this.props.dateUtils.constants.DATE_FORMAT.MMM_YYYY,this.props.dateUtils.constants.DATE_FORMAT.MMMM_YYYY)},currentMonth:{children:this.getCurrentMonth(this.props.dateUtils.constants.DATE_FORMAT.MMM,this.props.dateUtils.constants.DATE_FORMAT.MMMM)},previousYear:{children:this.props.dateUtils.helpers.getDateByFormat(this.props.dateUtils.helpers.subYears(this.state.calendarDate,1),this.props.dateUtils.constants.DATE_FORMAT.YYYY)},currentYear:{children:this.props.dateUtils.helpers.getDateByFormat(this.state.calendarDate,this.props.dateUtils.constants.DATE_FORMAT.YYYY)},nextYear:{children:this.props.dateUtils.helpers.getDateByFormat(this.props.dateUtils.helpers.addYears(this.state.calendarDate,1),this.props.dateUtils.constants.DATE_FORMAT.YYYY)},nextMonthNav:{onClick:this.addMonth},nextYearNav:{onClick:this.addYear},dayNames:{children:this.generateDayNames()},month:this.generateMonth()};return this.state.$mobile==="mobile"?this.createOverlay(a):a}}});define("datePicker/subComponents/datePickerComp",["lodash","core","textCommon","santaProps","siteUtils","datePicker/subComponents/calendar"],function(a,b,c,d,e,f){"use strict";return{displayName:"DatePicker",propTypes:a.assign({compData:d.Types.Component.compData.isRequired,compProp:d.Types.Component.compProp.isRequired,id:d.Types.Component.id.isRequired,styleId:d.Types.Component.styleId.isRequired,renderFlags:d.Types.renderFlags.isRequired,windowClickEventAspect:d.Types.Aspects.windowClickEventAspect.isRequired,isMobileView:d.Types.isMobileView.isRequired,isMobileDevice:d.Types.Device.isMobileDevice.isRequired},d.santaTypesUtils.getSantaTypesByDefinition(f)),statics:{useSantaTypes:true,publicState:["valid"],behaviors:{change:{methodName:"validate"}}},mixins:[b.compMixins.skinBasedComp,b.compMixins.runTimeCompData,b.compMixins.compStateMixin,c.textScaleMixin],getInitialState:function(){return{shouldShowCalendar:false,dateUtilsInit:false,valid:true,selectedDate:this.getSelectedDateFromProps(this.props.compData.value,this.props.compProp.defaultTextType),$mobile:this.props.isMobileDevice||this.props.isMobileView?"mobile":"notMobile"}},componentWillReceiveProps:function(a){var b={selectedDate:this.getSelectedDateFromProps(a.compData.value,a.compProp.defaultTextType)};if(a.renderFlags.shouldResetComponent){this.closeCalendar();b.valid=true}this.setState(b)},componentWillMount:function(){var a=this;require(["dateUtils"],function(b){a.dateUtils=b;a.setState({dateUtilsInit:true})})},componentDidMount:function(){this.props.windowClickEventAspect.registerToDocumentClickEvent(this.props.id)},componentWillUnmount:function(){this.props.windowClickEventAspect.unRegisterToDocumentClickEvent(this.props.id)},onDocumentClick:function(b){var c=b.target.className;var d=b.target.id;var e=this.props.styleId;var f=a.includes(d,this.props.id)&&a.includes(c,e+"input");var g=this.props.isMobileDevice||this.props.isMobileView?!a.isEqual(d,this.props.id+"calendar"):a.includes(c,e+"calendar");if(this.state.shouldShowCalendar&&!f&&!g){this.handleInputBlur()}},openCalendar:function(a){this.setState({shouldShowCalendar:true},a)},closeCalendar:function(a){this.setState({shouldShowCalendar:false},a)},toggleCalendar:function(){if(this.state.shouldShowCalendar){this.handleInputBlur()}else{this.handleInputFocus()}},onDateChange:function(a){if(!this.dateUtils.helpers.isEqual(this.state.selectedDate,a)){var b={selectedDate:a,valid:true};this.setState(b,function(){this.updateData({value:a.toISOString()});this.handleAction(e.constants.ACTION_TYPES.CHANGE);this.handleAction(e.constants.ACTION_TYPES.VALIDATE)}.bind(this))}},getSelectedDateFromProps:function(a,b){var c=null;if(a){c=new Date(a)}else if(b==="today"){if(this.dateUtils){c=this.dateUtils.helpers.getStartOfToday()}else{c=new Date;c.setHours(0,0,0,0)}}return c},isPreviewState:function(b){var c=this.props.renderFlags.componentPreviewStates[this.props.id];return a.includes(c,b)},getCalendarProperties:function(){var a=this.dateUtils.helpers.getStartOfToday();return{id:this.props.id+"calendar",ref:this.props.id+"calendar",style:{},dateUtils:this.dateUtils,calendarDate:this.state.selectedDate||a,today:a,closeCalendar:this.closeCalendar,onDateChange:this.onDateChange,allowPastDates:this.props.compData.allowPastDates,allowFutureDates:this.props.compData.allowFutureDates,disabledDates:this.props.compData.disabledDates,disabledDaysOfWeek:this.props.compData.disabledDaysOfWeek,minDate:this.props.compData.minDate,maxDate:this.props.compData.maxDate,selectedDate:this.state.selectedDate}},getCalendar:function(){var a=this.state.shouldShowCalendar&&this.state.dateUtilsInit;return a?this.createChildComponent({},"wysiwyg.viewer.components.Calendar","calendar",this.getCalendarProperties()):{}},getDateInputText:function(){var a="";if(this.state.selectedDate&&this.state.dateUtilsInit){a=this.dateUtils.helpers.getDateByFormat(this.state.selectedDate,this.props.compProp.dateFormat)}return a},getPlaceholderText:function(){var a=this.props.compProp.placeholder;return this.state.selectedDate||!a?"":a},getHostSkinProperties:function(){var a={};a.focused=this.state.shouldShowCalendar;a[this.props.compProp.textAlignment+"-direction"]=true;a["read-only"]=!!this.props.compProp.readOnly;return{className:this.classSet(a),"data-disabled":!!this.props.compProp.isDisabled,"data-error":!this.state.valid}},handleInputFocus:function(a){this.openCalendar(this.handleAction.bind(this,e.constants.ACTION_TYPES.FOCUS,a))},handleInputBlur:function(a){this.closeCalendar(this.handleAction.bind(this,e.constants.ACTION_TYPES.BLUR,a))},getInputSkinProperties:function(){var b=!!this.props.compProp.readOnly;var c=!!this.props.compProp.isDisabled;var d=this.props.compProp.textPadding;var e=this.props.compProp.textAlignment;var f=e==="right"?{paddingRight:d}:{paddingLeft:d};return{value:this.getDateInputText(),placeholder:this.getPlaceholderText(),onFocus:!b&&!c?this.handleInputFocus:null,onBlur:!b&&!c?this.handleInputBlur:null,readOnly:b,disabled:c,style:a.merge(this.getFontSize(this.props),f)}},validate:function(){var a=this.props.compProp.required?!!this.state.selectedDate:true;this.setState({valid:a});this.handleAction(e.constants.ACTION_TYPES.VALIDATE)},getSkinProperties:function(){return{"":this.getHostSkinProperties(),inputWrapper:{onClick:!this.state.dateUtilsInit||this.props.compProp.isDisabled||this.props.compProp.readOnly?null:this.toggleCalendar},input:this.getInputSkinProperties(),calendar:this.getCalendar()}}}});define("datePicker",["datePicker/subComponents/datePickerComp","datePicker/subComponents/calendar","datePicker/subComponents/month","datePicker/subComponents/day"],function(a,b,c,d){"use strict";return{datePicker:a,calendar:b,month:c,day:d}});