/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.4.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2018 vBulletin Solutions Inc. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["january","february","march","april","may","june","july","august","september","october","november","december","january_short","february_short","march_short","april_short","may_short","june_short","july_short","august_short","september_short","october_short","november_short","december_short","sunday","monday","tuesday","wednesday","thursday","friday","saturday","sunday_short","monday_short","tuesday_short","wednesday_short","thursday_short","friday_short","saturday_short","datepicker_am","datepicker_clicktotoggle","datepicker_pm","datepicker_rangeseparator","datepicker_scrolltoincrement","datepicker_weekabbreviation","datepicker_year",]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["pickerdateformat",]);(function(G){function P(b,Y){var X=["january","february","march","april","may","june","july","august","september","october","november","december"],c=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Z=(Y=="long")?"":"_short",W=(b=="month")?X:c,a=[];G.each(W,function(d,e){a.push(vBulletin.phrase.get(e+Z))});return a}function M(){var a=vBulletin.options.get("pickerdateformat"),X="",b="";if(pageData.user_lang_pickerdateformatoverride){a=pageData.user_lang_pickerdateformatoverride}var d="",g=null,c=null,Y=null,W=null,Z=false,f=false;G.each(a.split(""),function(h,k){var j=!!k.match(/[GHhiSsK]/),l=!!k.match(/[a-z]/i),i=l&&!j;if(d!="\\"){if(j){if(k==="K"){Z=true}if(k==="h"){f=true}if(g===null){g=h}c=h}else{if(i){if(Y===null){Y=h}W=h}}}d=k});if(c<Y){var e=c+1;b=a.slice(0,e);X=a.slice(e)}else{if(W<g){var e=W+1;X=a.slice(0,e);b=a.slice(e)}else{X=a;b=a}}return{datetime:a,date:X,time:b,use24hour:!(Z||f)}}function K(X){var W="m/d/Y",b="H:i",Z=M(),a;var Y={time_24hr:Z.use24hour,onReady:D,onOpen:H,onChange:Q,onPreCalendarPosition:U,altInput:true,locale:{weekdays:{shorthand:P("weekday","short"),longhand:P("weekday","long"),},months:{shorthand:P("month","short"),longhand:P("month","long"),},rangeSeparator:vBulletin.phrase.get("datepicker_rangeseparator"),weekAbbreviation:vBulletin.phrase.get("datepicker_weekabbreviation"),scrollTitle:vBulletin.phrase.get("datepicker_scrolltoincrement"),toggleTitle:vBulletin.phrase.get("datepicker_clicktotoggle"),amPM:[vBulletin.phrase.get("datepicker_am"),vBulletin.phrase.get("datepicker_pm"),],yearAriaLabel:vBulletin.phrase.get("datepicker_year"),firstDayOfWeek:(parseInt(pageData.user_startofweek,10)||1)-1,},};if(vBulletin.isRtl()){Y.nextArrow="<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>";Y.prevArrow="<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>"}switch(X){case"date":Y.enableTime=false;Y.noCalendar=false;Y.dateFormat=W;Y.altFormat=Z.date;break;case"time":Y.enableTime=true;Y.noCalendar=true;Y.dateFormat=b;Y.altFormat=Z.time;break;case"datetime":Y.enableTime=true;Y.noCalendar=false;Y.dateFormat=W+" "+b;Y.altFormat=Z.datetime;break}return Y}function A(Y,X){var W=["onChange","onClose","onOpen","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"];G.each(W,function(Z,a){if(typeof X[a]=="function"){X[a]=[X[a]]}if(typeof Y[a]=="function"){Y[a]=[Y[a]]}});return G.extend(true,{},Y,X)}function E(Y,X,W){X=X||{};X=A(K(W),X);Y.flatpickr(X);Y.attr("data-vb-flatpicker-initialized",W);Y.trigger("vb-flatpicker-initialized")}function B(X,W){var Y=S(X),Z=X.val();if(!Y){return }Y.destroy();E(X,null,W);Y=S(X);Y.setDate(Z)}function F(X,W){E(X,W,"date")}function O(X,W){E(X,W,"time")}function T(X,W){E(X,W,"datetime")}function V(b){var Z=b.find(".js-daterange--min[data-vb-flatpicker-initialized]"),Y=b.find(".js-daterange--max[data-vb-flatpicker-initialized]");if(b.data("vb-daterange-initialized")){return true}if(!Z.length){G(".js-daterange--min",b).one("vb-flatpicker-initialized",function(){V(b)});return true}if(!Y.length){G(".js-daterange--max",b).one("vb-flatpicker-initialized",function(){V(b)});return true}if(Z.length&&Y.length){var c=vBulletin.flatpickr.getInstance(Z),d=vBulletin.flatpickr.getInstance(Y);if(!c||!d){return true}var e=c.config.onChange,X=(function(){var f=false;return function(i,h,g,j){if(!f){f=true;if(h){d.set("minDate",h)}f=false}}})(),W=d.config.onChange,a=(function(){var f=false;return function(i,h,g,j){if(!f){f=true;if(h){c.set("maxDate",h)}f=false}}})();e.push(X);c.set("onChange",e);W.push(a);d.set("onChange",W)}b.attr("data-vb-daterange-initialized",1)}function C(){G(".js-datepicker").each(function(){F(G(this))});G(".js-timepicker").each(function(){O(G(this))});G(".js-datetimepicker").each(function(){T(G(this))});G(".js-daterange").each(function(){V(G(this))})}function S(W){try{return W.get(0)._flatpickr}catch(X){}return null}function J(W){var X=S(W);if(X){W.data("vb-flatpickr-disabled","1");X.clear();X.close()}}function L(W){var X=S(W);if(X){W.data("vb-flatpickr-disabled","0")}}function I(d){if(!vBulletin.isRtl()){return }if(!(d&&d.calendarContainer&&d._positionElement)){return }var a=d.calendarContainer,W=d._positionElement,b=a.offsetWidth,Y=W.offsetWidth,Z=W.getBoundingClientRect(),X=window.pageXOffset+Z.left,c=window.document.body.offsetWidth-Z.right,e=X+Y<b;if(!e){G(a).addClass("rightMost").css({left:"auto",right:c+"px"})}}function D(Y,X,W,Z){I(W)}function H(Z,X,W,a){var Y=G(W.element);I(W);if(Y.data("vb-flatpickr-disabled")=="1"){W.close()}}function Q(Z,X,W,a){var Y=G(W.element);Y.change();I(W)}function U(Y,X,W,Z){window.setTimeout(function(){I(W);var e=G(W.calendarContainer),b=e.find(".flatpickr-days"),f=b.find(".dayContainer"),d=b.outerWidth(),a=f.outerWidth(),c=e.closest(".flatpickr-calendar");if(d&&a&&d>a){c.width(a-1)}},0)}function N(){C()}function R(){G(N);vBulletin.flatpickr=vBulletin.flatpickr||{};vBulletin.flatpickr.initPickers=C;vBulletin.flatpickr.getInstance=S;vBulletin.flatpickr.disablePicker=J;vBulletin.flatpickr.enablePicker=L;vBulletin.flatpickr.initDatePicker=F;vBulletin.flatpickr.initTimePicker=O;vBulletin.flatpickr.initDateTimePicker=T;vBulletin.flatpickr.changePickerType=B}R()})(jQuery);