/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. 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   # ||
|| ###################################################################### ||
\*========================================================================*/
vBulletin.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".split(" "),
["pickerdateformat"]);
vBulletin.flatpickr=function(f){function r(a,b){var c="january february march april may june july august september october november december".split(" "),e="sunday monday tuesday wednesday thursday friday saturday".split(" "),d="long"==b?"":"_short",g=[];f.each("month"==a?c:e,function(k,h){g.push(vBulletin.phrase.get(h+d))});return g}function C(){var a=vBulletin.options.get("pickerdateformat"),b="",c="";pageData.user_lang_pickerdateformatoverride&&(a=pageData.user_lang_pickerdateformatoverride);var e=
"",d=null,g=null,k=null,h=null,t=!1,l=!1;f.each(a.split(""),function(n,p){var x=!!p.match(/[GHhiSsK]/),D=!!p.match(/[a-z]/i);"\\"!=e&&(x?("K"===p&&(t=!0),"h"===p&&(l=!0),null===d&&(d=n),g=n):D&&!x&&(null===k&&(k=n),h=n));e=p});if(g<k){var m=g+1;c=a.slice(0,m);b=a.slice(m)}else h<d?(m=h+1,b=a.slice(0,m),c=a.slice(m)):c=b=a;return{datetime:a,date:b,time:c,use24hour:!(t||l)}}function E(a,b){f.each("onChange onClose onOpen onMonthChange onYearChange onReady onValueUpdate onDayCreate".split(" "),function(c,
e){"function"==typeof b[e]&&(b[e]=[b[e]]);"function"==typeof a[e]&&(a[e]=[a[e]])});return f.extend(!0,{},a,b)}function u(a,b,c){b=b||{};var e=C(),d={time_24hr:e.use24hour,onReady:F,onOpen:G,onChange:H,onPreCalendarPosition:I,altInput:!0,locale:{weekdays:{shorthand:r("weekday","short"),longhand:r("weekday","long")},months:{shorthand:r("month","short"),longhand:r("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}};vBulletin.isRtl()&&(d.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>",
d.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(c){case "date":d.enableTime=!1;d.noCalendar=!1;d.dateFormat="m/d/Y";d.altFormat=e.date;break;case "time":d.enableTime=!0;d.noCalendar=!0;d.dateFormat="H:i";d.altFormat=e.time;break;case "datetime":d.enableTime=!0,d.noCalendar=!1,d.dateFormat="m/d/Y H:i",
d.altFormat=e.datetime}b=E(d,b);a.flatpickr(b);a.attr("data-vb-flatpicker-initialized",c);a.trigger("vb-flatpicker-initialized")}function y(a,b){u(a,b,"date")}function z(a,b){u(a,b,"time")}function A(a,b){u(a,b,"datetime")}function w(a){var b=a.find(".js-daterange--min[data-vb-flatpicker-initialized]"),c=a.find(".js-daterange--max[data-vb-flatpicker-initialized]");if(a.data("vb-daterange-initialized"))return!0;if(!b.length)return f(".js-daterange--min",a).one("vb-flatpicker-initialized",function(){w(a)}),
!0;if(!c.length)return f(".js-daterange--max",a).one("vb-flatpicker-initialized",function(){w(a)}),!0;if(b.length&&c.length){var e=vBulletin.flatpickr.getInstance(b),d=vBulletin.flatpickr.getInstance(c);if(!e||!d)return!0;b=e.config.onChange;c=function(){var h=!1;return function(t,l,m,n){h||(h=!0,l&&d.set("minDate",l),h=!1)}}();var g=d.config.onChange,k=function(){var h=!1;return function(t,l,m,n){h||(h=!0,l&&e.set("maxDate",l),h=!1)}}();b.push(c);e.set("onChange",b);g.push(k);d.set("onChange",g)}a.attr("data-vb-daterange-initialized",
1)}function B(){f(".js-datepicker").each(function(){y(f(this))});f(".js-timepicker").each(function(){z(f(this))});f(".js-datetimepicker").each(function(){A(f(this))});f(".js-daterange").each(function(){w(f(this))})}function q(a){try{return a.get(0)._flatpickr}catch(b){}return null}function v(a){if(vBulletin.isRtl()&&a&&a.calendarContainer&&a._positionElement){var b=a.calendarContainer,c=a._positionElement;a=b.offsetWidth;var e=c.offsetWidth;c=c.getBoundingClientRect();var d=window.document.body.offsetWidth-
c.right;window.pageXOffset+c.left+e<a||f(b).addClass("rightMost").css({left:"auto",right:d+"px"})}}function F(a,b,c,e){v(c)}function G(a,b,c,e){a=f(c.element);v(c);"1"==a.data("vb-flatpickr-disabled")&&c.close()}function H(a,b,c,e){f(c.element).change();v(c)}function I(a,b,c,e){setTimeout(function(){v(c);var d=f(c.calendarContainer),g=d.find(".flatpickr-days"),k=g.find(".dayContainer");g=g.outerWidth();k=k.outerWidth();d=d.closest(".flatpickr-calendar");g&&k&&g>k&&d.width(k-1)},0)}f(function(){B()});
return{initPickers:B,getInstance:q,disablePicker:function(a){var b=q(a);b&&(a.data("vb-flatpickr-disabled","1"),b.clear(),b.close())},enablePicker:function(a){q(a)&&a.data("vb-flatpickr-disabled","0")},initDatePicker:y,initTimePicker:z,initDateTimePicker:A,changePickerType:function(a,b){var c=q(a),e=a.val();c&&(c.destroy(),u(a,null,b),c=q(a),c.setDate(e))}}}(jQuery);
