{"version":3,"sources":["events.js"],"names":["$","ThingsToDoOnResize","breakpoint","indexOf","prevAll","length","after","nextAll","before","window","resize","calendarView","change","selectedCategory","this","val","urlPrefix","fullCalendar","location","href","baseUrl","keydown","e","charCode","keyCode","click","searchText","goToUrl","encodeURIComponent","pathname","search","header","left","center","right","eventSources","url","calendarUrl","type","data","category","success","calendarData","count","text","error","alert","month","year","moment","day","attr"],"mappings":"AAAAA,GAAA,WAOA,SAAAC,KACA,GAAAC,aAAAC,QAAA,UAAAH,EAAA,eAAAI,QAAA,YAAAC,OAAA,EACAL,EAAA,eAAAM,MAAAN,EAAA,cAEA,GAAAE,aAAAC,QAAA,UAAAH,EAAA,eAAAO,QAAA,YAAAF,OAAA,GACAL,EAAA,eAAAQ,OAAAR,EAAA,YAEA,CAbAA,EAAAS,QAAAC,QAAA,WACAT,GACA,IAEAA,IAWA,IAAAU,EAAAX,EAAA,aAAAK,OAAA,EAgCA,GA/BAL,EAAA,aAAAY,QAAA,WACA,IAAAC,EAAAb,EAAAc,MAAAC,MACA,IAAAF,IACAA,EAAAG,WAEAL,EACAX,EAAA,aAAAiB,aAAA,iBAEAR,OAAAS,SAAAC,KAAAC,QAAAP,CACA,IAEAb,EAAA,eAAAqB,SAAA,SAAAC,GAEA,KADAA,EAAAC,UAAAD,EAAAE,SAAA,IAEAxB,EAAA,cAAAyB,OACA,IAEAzB,EAAA,cAAAyB,OAAA,WACA,GAAAd,EACAX,EAAA,aAAAiB,aAAA,qBADA,CAIA,IAAAJ,EAAAb,EAAA,aAAAe,MACA,IAAAF,IACAA,EAAAG,WACA,IAAAU,EAAA1B,EAAA,eAAAe,MACAY,EAAAP,QAAAP,GAAA,IAAAa,EAAA,eAAAE,mBAAAF,GAAA,IACAjB,OAAAS,SAAAW,SAAApB,OAAAS,SAAAY,QAAAH,IACAlB,OAAAS,SAAAC,KAAAQ,EAPA,CAQA,IAEAhB,EAAA,CACAX,EAAA,aAAAiB,aAAA,CACAc,OAAA,CACAC,KAAA,kBACAC,OAAA,QACAC,MAAA,8BAEAC,aAAA,CAAA,CACAC,IAAAC,YACAC,KAAA,OACAC,KAAA,WACA,MAAA,CACAb,WAAA1B,EAAA,eAAAe,MACAyB,SAAAxC,EAAA,aAAAe,MAEA,EACA0B,QAAA,SAAAC,GACA,GAAAA,EAAA,CACA,IAAAC,EAAAD,EAAArC,OACAL,EAAA,iCAAA4C,KAAA,GAAAD,kBACA,CACA,EACAE,MAAA,WACAC,MAAA,4CACA,MAeA9C,EAAA,0BAAAY,QAXA,WACA,IAAAmC,EAAA/C,EAAA,eAAAe,MACAiC,EAAAhD,EAAA,cAAAe,MACA,IAAAgC,IACAA,EAAA,GACA,IAAAC,IACAA,EAAAC,SAAAD,QAEAhD,EAAA,aAAAiB,aAAA,WAAAgC,OAAA,CAAAD,KAAAA,EAAAD,MAAAA,EAAA,EAAAG,IAAA,IACA,IAGAlD,EAAA,mBAAAmD,KAAA,aAAA,YACAnD,EAAA,mBAAAmD,KAAA,aAAA,OACA,CACA","file":"events-bundle.js","sourcesContent":["$(function () {\r\n\t$(window).resize(function () {\r\n\t\tThingsToDoOnResize();\r\n\t});\r\n\r\n\tThingsToDoOnResize();\r\n\r\n\tfunction ThingsToDoOnResize() {\r\n\t\tif (breakpoint().indexOf(\"phone\") != -1 && $(\"h4.calendar\").prevAll(\".jump-to\").length > 0) {\r\n\t\t\t$(\"h4.calendar\").after($(\".jump-to\"));\r\n\t\t}\r\n\t\telse if (breakpoint().indexOf(\"phone\") == -1 && $(\"h4.calendar\").nextAll(\".jump-to\").length > 0) {\r\n\t\t\t$(\"h4.calendar\").before($(\".jump-to\"));\r\n\t\t}\r\n\t}\r\n\r\n\tvar calendarView = $(\"#calendar\").length > 0;\r\n\t$(\"#Category\").change(function () {\r\n\t\tvar selectedCategory = $(this).val();\r\n\t\tif (selectedCategory == \"\")\r\n\t\t\tselectedCategory = urlPrefix;\r\n\r\n\t\tif (calendarView)\r\n\t\t\t$(\"#calendar\").fullCalendar(\"refetchEvents\");\r\n\t\telse\r\n\t\t\twindow.location.href = baseUrl + selectedCategory;\r\n\t});\r\n\r\n\t$(\"#search-box\").keydown(function (e) {\r\n\t\tvar key = e.charCode || e.keyCode || 0;\r\n\t\tif (key == 13)\r\n\t\t\t$(\"#search-go\").click();\r\n\t});\r\n\r\n\t$(\"#search-go\").click(function () {\r\n\t\tif (calendarView) {\r\n\t\t\t$(\"#calendar\").fullCalendar(\"refetchEvents\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar selectedCategory = $(\"#Category\").val();\r\n\t\tif (selectedCategory == \"\")\r\n\t\t\tselectedCategory = urlPrefix;\r\n\t\tvar searchText = $(\"#search-box\").val();\r\n\t\tvar goToUrl = baseUrl + selectedCategory + (searchText != \"\" ? \"?SearchText=\" + encodeURIComponent(searchText) : \"\");\r\n\t\tif (window.location.pathname + window.location.search != goToUrl)\r\n\t\t\twindow.location.href = goToUrl;\r\n\t});\r\n\r\n\tif (calendarView) {\r\n\t\t$(\"#calendar\").fullCalendar({\r\n\t\t\theader: {\r\n\t\t\t\tleft: 'prev,next today',\r\n\t\t\t\tcenter: 'title',\r\n\t\t\t\tright: 'month,agendaWeek,agendaDay'\r\n\t\t\t},\r\n\t\t\teventSources: [{\r\n\t\t\t\turl: calendarUrl,\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\tdata: function () {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tsearchText: $(\"#search-box\").val(),\r\n\t\t\t\t\t\tcategory: $(\"#Category\").val()\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function (calendarData) {\r\n\t\t\t\t\tif (calendarData) {\r\n\t\t\t\t\t\tvar count = calendarData.length;\r\n\t\t\t\t\t\t$(\"#events-calendar-filter-alert\").text(`${count} events found.`);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\terror: function () {\r\n\t\t\t\t\talert('there was an error while fetching events!');\r\n\t\t\t\t}\r\n\t\t\t}]\r\n\t\t});\r\n\r\n\t\tfunction JumpToDate() {\r\n\t\t\tvar month = $(\"#jump-month\").val();\r\n\t\t\tvar year = $(\"#jump-year\").val();\r\n\t\t\tif (month == \"\")\r\n\t\t\t\tmonth = 1;\r\n\t\t\tif (year == \"\")\r\n\t\t\t\tyear = moment().year();\r\n\r\n\t\t\t$(\"#calendar\").fullCalendar('gotoDate', moment({ year: year, month: month - 1, day: 1 }));\r\n\t\t}\r\n\r\n\t\t$(\"#jump-month,#jump-year\").change(JumpToDate);\r\n\t\t$(\".fc-prev-button\").attr(\"aria-label\", \"Previous\");\r\n\t\t$(\".fc-next-button\").attr(\"aria-label\", \"Next\");\r\n\t}\r\n});"]}