diff --git a/calendar-preact.js b/calendar-preact.js index 91f95f9..4b1da60 100644 --- a/calendar-preact.js +++ b/calendar-preact.js @@ -3,7 +3,7 @@ * Creates a calendar widget which can be used to select the date more easily than using just a text box * * Modified: http://yourcmc.ru/git/vitalif-js/calendar - * Version: 2018-10-23 + * Version: 2019-07-18 * License: MIT-like, http://www.openjs.com/license.php * * Example: @@ -46,6 +46,11 @@ export class Calendar extends preact.Component componentDidMount() { this.componentDidUpdate(); + this.props.input.addEventListener('blur', () => + { + if (!Calendar.stopBlur || Calendar.stopBlur < Date.now()-200) + Calendar.hideCalendar(); + }); } componentDidUpdate() @@ -77,8 +82,8 @@ export class Calendar extends preact.Component if (this.props.callback) { // Safari does not understand new Date('YYYY-MM-DD HH:MM:SS') - t = t ? t.split(/:/) : null; - t = t ? new Date(year-0, month-1, day-0, t[0]-0, t[1]-0, t[2]-0) : new Date(year-0, month-1, day-0); + t = t ? t.split(/:/) : [ 0, 0, 0 ]; + t = new Date(year-0, month-1, day-0, t[0]-0, t[1]-0, t[2]-0); var c = this.props.callback; c(new Date(t)); } @@ -323,6 +328,7 @@ export class Calendar extends preact.Component }; Calendar.init(); Calendar.box.style.display = "block"; + Calendar.stopBlur = Date.now(); preact.render(, Calendar.box.parentNode, Calendar.box); } @@ -368,6 +374,7 @@ export class Calendar extends preact.Component ev.stopPropagation(); else ev.cancelBubble = true; + Calendar.stopBlur = Date.now(); return true; }); document.getElementsByTagName("body")[0].insertBefore(div, document.getElementsByTagName("body")[0].firstChild); diff --git a/calendar-preact.min.js b/calendar-preact.min.js index 73d7e13..fbc38f4 100644 --- a/calendar-preact.min.js +++ b/calendar-preact.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Calendar=void 0;var o,r=Object.assign||function(e){for(var t=1;tl?o.style.left=l-o.offsetWidth-1+"px":o.style.left=r.left-1+"px",o.offsetHeight+r.top+a-1>=i&&r.top-o.offsetHeight>=0?o.style.top=r.top-o.offsetHeight+"px":o.style.top=r.top+a-1+"px"}},{key:"selectDate",value:function(e,n,o){var r=this.props.input,a=r.value.split(/\s+/,2)[1]||"";if(n=Number(n)+1,this.props.callback)a=(a=a?a.split(/:/):null)?new Date(e-0,n-1,o-0,a[0]-0,a[1]-0,a[2]-0):new Date(e-0,n-1,o-0),(0,this.props.callback)(new Date(a));else if(n<10&&(n="0"+n),o<10&&(o="0"+o),a=("Y-m-d"==this.format?e+"-"+n+"-"+o:o+"."+n+"."+e)+(a?" "+a:""),r.value=a,"Event"in window){var l=document.createEvent("Event");l.initEvent("change",!0,!0),r.dispatchEvent(l)}else r.fireEvent("onchange");t.hideCalendar()}},{key:"showMonths",value:function(e){this.props.onChangeProps({year:e,mode:"months"})}},{key:"showYears",value:function(e){this.props.onChangeProps({year:e,mode:"years"})}},{key:"showDays",value:function(e,t){this.props.onChangeProps({year:e,month:t,mode:"days"})}},{key:"renderMonths",value:function(e){var t=this,n=e.year,o=e.today.getFullYear(),r=e.today.getMonth(),a=e.selected.getFullYear()==n?e.selected.getMonth():-1;return i.default.h("table",null,i.default.h("tr",null,i.default.h("th",{colspan:"4",class:"calendar-title"},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n-1)},title:n-1,class:"prev"}),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(n)}},n),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n+1)},title:n+1,class:"next"}))),[[0,1,2],[3,4,5],[6,7,8],[9,10,11]].map(function(l){return i.default.h("tr",null,l.map(function(l){return i.default.h("td",{class:"months "+(no||n==o&&l>r?"future":"today")+(l==a?" selected":"")},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(n,l)}},e.month_names[l]))}))}))}},{key:"renderYears",value:function(e){var t=this,n=e.selected,o=e.today,r=e.year,a=-16&r,l=o.getFullYear(),s=n.getFullYear();return i.default.h("table",null,i.default.h("tr",null,i.default.h("th",{colspan:"4",class:"calendar-title"},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(r-16)},title:a-16+" - "+(a-1),class:"prev"}),i.default.h("b",null,a+" - "+(a+15)),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(r+16)},title:a+16+" - "+(a+31),class:"next"}))),[0,1,2,3].map(function(e){return i.default.h("tr",null,[0,1,2,3].map(function(n){var o=a+n+4*e,r=(ol?"future":"today")+(o==s?" selected":"");return i.default.h("td",{class:"years "+r},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(o)}},o))}))}))}},{key:"_yearOptions",value:function(e,t,n){for(var o=[],r=e;r=12&&(c=0,d++);var f=o-1,p=n;f<0&&(f=11,p--);var h=s.getFullYear(),v=(new Date(n,o,1).getDay()+l)%7,m=2==o?n%4||!(n%100)&&n%400?28:29:o<7==!(1&o)?31:30,y=s.getFullYear(),_=n-y||o-s.getMonth(),b=r&&n==r.getFullYear()&&o==r.getMonth()?r.getDate():-1;return i.default.h("table",null,i.default.h("tr",null,i.default.h("th",{colspan:"7",class:"calendar-title"},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(p,f)},title:u[f]+" "+p,class:"prev"}),a?[i.default.h("select",{name:"calendar-month",class:"calendar-month",onchange:function(e){return t.showDays(n,e.target.value)}},u.map(function(e,t){return i.default.h("option",{value:t,selected:t==o},e)})),i.default.h("select",{name:"calendar-year",class:"calendar-year",onchange:function(e){return t.showDays(e.target.value,o)}},this._yearOptions(h+e.years.min,h+e.years.max,n))]:[i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n,o)}},u[o]),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(n)}},n)],i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(d,c)},title:e.month_names[c]+" "+d,class:"next"}))),i.default.h("tr",{class:"header"},e.weekdays.map(function(e){return i.default.h("td",null,e)})),[0,1,2,3,4].map(function(r){return 7*r0||a>=v)&&l<=m){var u="days",c=_||l-s.getDate();return u+=c<0?" past":c?" future":" today",l==b&&(u+=" selected"),u+=" "+e.weekdayIds[a].toLowerCase(),i.default.h("td",{class:u},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.selectDate(n,o,l)}},l))}return i.default.h("td",{class:"days"}," ")})):null}))}}],[{key:"showCalendar",value:function(e,n){var o=r({},t.defaultProps,n);o.selected=new Date;var a=e.value.replace(/\s+.*$/,"");if(a){var l=!1,s=a.split("-");3==s.length?(s[1]--,l=new Date(s[0],s[1],s[2])):1==s.length&&3==(s=a.split(".")).length&&(s[1]--,l=new Date(s[2],s[1],s[0])),l&&!isNaN(l.getFullYear())&&(o.selected=l)}o.today=new Date,o.year=o.selected.getFullYear(),o.month=o.selected.getMonth(),o.mode=o.start,o.input=e,o.onChangeProps=function(e){o=r({},o,e),i.default.render(i.default.h(t,o),t.box.parentNode,t.box)},t.init(),t.box.style.display="block",i.default.render(i.default.h(t,o),t.box.parentNode,t.box)}},{key:"hideCalendar",value:function(){t.box&&(t.box.style.display="none")}},{key:"set",value:function(e,n){"string"==typeof e&&(e=document.getElementById(e)),e&&e.addEventListener("focus",function(o){t.showCalendar(e,n)})}},{key:"init",value:function(){if(!t.box||!t.box.parentNode){var e=document.createElement("div");t.box||(t.box=e),e.className="calendar-box",e.addEventListener("mousedown",function(e){return(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0,!0}),document.getElementsByTagName("body")[0].insertBefore(e,document.getElementsByTagName("body")[0].firstChild),t.addedListener||(document.addEventListener("mousedown",function(){t.hideCalendar()}),t.addedListener=!0)}}}]),t}();s.defaultProps={month_names:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],close_label:"Закрыть",weekdays:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],weekdayIds:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],sunday:6,selectboxes:!1,years:{min:-70,max:10},format:"d.m.Y",today:new Date,start:"days"},window.Calendar=s},function(e,t,n){"use strict";n.r(t),n.d(t,"h",function(){return i}),n.d(t,"createElement",function(){return i}),n.d(t,"cloneElement",function(){return c}),n.d(t,"Component",function(){return B}),n.d(t,"render",function(){return Y}),n.d(t,"rerender",function(){return h}),n.d(t,"options",function(){return r});var o=function(){},r={},a=[],l=[];function i(e,t){var n,i,s,u,c=l;for(u=arguments.length;u-- >2;)a.push(arguments[u]);for(t&&null!=t.children&&(a.length||a.push(t.children),delete t.children);a.length;)if((i=a.pop())&&void 0!==i.pop)for(u=i.length;u--;)a.push(i[u]);else"boolean"==typeof i&&(i=null),(s="function"!=typeof e)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(s=!1)),s&&n?c[c.length-1]+=i:c===l?c=[i]:c.push(i),n=s;var d=new o;return d.nodeName=e,d.children=c,d.attributes=null==t?void 0:t,d.key=null==t?void 0:t.key,void 0!==r.vnode&&r.vnode(d),d}function s(e,t){for(var n in t)e[n]=t[n];return e}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return i(e.nodeName,s(s({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function p(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(r.debounceRendering||u)(h)}function h(){var e,t=f;for(f=[];e=t.pop();)e._dirty&&T(e)}function v(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function m(e){var t=s({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var a in n)a in o||(e.style[a]="");for(var a in o)e.style[a]="number"==typeof o[a]&&!1===d.test(a)?o[a]+"px":o[a]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,b,l):e.removeEventListener(t,b,l),(e._listeners||(e._listeners={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e){try{e[t]=null==o?"":o}catch(e){}null!=o&&!1!==o||"spellcheck"==t||e.removeAttribute(t)}else{var i=r&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?i?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(i?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function b(e){return this._listeners[e.type](r.event&&r.event(e)||e)}var g=[],w=0,x=!1,C=!1;function k(){for(var e;e=g.pop();)r.afterMount&&r.afterMount(e),e.componentDidMount&&e.componentDidMount()}function N(e,t,n,o,r,a){w++||(x=null!=r&&void 0!==r.ownerSVGElement,C=null!=e&&!("__preactattr_"in e));var l=P(e,t,n,o,a);return r&&l.parentNode!==r&&r.appendChild(l),--w||(C=!1,a||k()),l}function P(e,t,n,o,r){var a=e,l=x;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),D(e,!0))),a.__preactattr_=!0,a;var i,s,u=t.nodeName;if("function"==typeof u)return function(e,t,n,o){var r=e&&e._component,a=r,l=e,i=r&&e._componentConstructor===t.nodeName,s=i,u=m(t);for(;r&&!s&&(r=r._parentComponent);)s=r.constructor===t.nodeName;r&&s&&(!o||r._component)?(O(r,u,3,n,o),e=r.base):(a&&!i&&(L(a),e=l=null),r=S(t.nodeName,u,n),e&&!r.nextBase&&(r.nextBase=e,l=null),O(r,u,1,n,o),e=r.base,l&&e!==l&&(l._component=null,D(l,!1)));return e}(e,t,n,o);if(x="svg"===u||"foreignObject"!==u&&x,u=String(u),(!e||!v(e,u))&&(i=u,(s=x?document.createElementNS("http://www.w3.org/2000/svg",i):document.createElement(i)).normalizedNodeName=i,a=s,e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),D(e,!0)}var c=a.firstChild,d=a.__preactattr_,f=t.children;if(null==d){d=a.__preactattr_={};for(var p=a.attributes,h=p.length;h--;)d[p[h].name]=p[h].value}return!C&&f&&1===f.length&&"string"==typeof f[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=f[0]&&(c.nodeValue=f[0]):(f&&f.length||null!=c)&&function(e,t,n,o,r){var a,l,i,s,u,c=e.childNodes,d=[],f={},p=0,h=0,m=c.length,_=0,b=t?t.length:0;if(0!==m)for(var g=0;gl?o.style.left=l-o.offsetWidth-1+"px":o.style.left=r.left-1+"px",o.offsetHeight+r.top+a-1>=i&&r.top-o.offsetHeight>=0?o.style.top=r.top-o.offsetHeight+"px":o.style.top=r.top+a-1+"px"}},{key:"selectDate",value:function(e,n,o){var r=this.props.input,a=r.value.split(/\s+/,2)[1]||"";if(n=Number(n)+1,this.props.callback)a=a?a.split(/:/):[0,0,0],a=new Date(e-0,n-1,o-0,a[0]-0,a[1]-0,a[2]-0),(0,this.props.callback)(new Date(a));else if(n<10&&(n="0"+n),o<10&&(o="0"+o),a=("Y-m-d"==this.format?e+"-"+n+"-"+o:o+"."+n+"."+e)+(a?" "+a:""),r.value=a,"Event"in window){var l=document.createEvent("Event");l.initEvent("change",!0,!0),r.dispatchEvent(l)}else r.fireEvent("onchange");t.hideCalendar()}},{key:"showMonths",value:function(e){this.props.onChangeProps({year:e,mode:"months"})}},{key:"showYears",value:function(e){this.props.onChangeProps({year:e,mode:"years"})}},{key:"showDays",value:function(e,t){this.props.onChangeProps({year:e,month:t,mode:"days"})}},{key:"renderMonths",value:function(e){var t=this,n=e.year,o=e.today.getFullYear(),r=e.today.getMonth(),a=e.selected.getFullYear()==n?e.selected.getMonth():-1;return i.default.h("table",null,i.default.h("tr",null,i.default.h("th",{colspan:"4",class:"calendar-title"},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n-1)},title:n-1,class:"prev"}),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(n)}},n),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n+1)},title:n+1,class:"next"}))),[[0,1,2],[3,4,5],[6,7,8],[9,10,11]].map(function(l){return i.default.h("tr",null,l.map(function(l){return i.default.h("td",{class:"months "+(no||n==o&&l>r?"future":"today")+(l==a?" selected":"")},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(n,l)}},e.month_names[l]))}))}))}},{key:"renderYears",value:function(e){var t=this,n=e.selected,o=e.today,r=e.year,a=-16&r,l=o.getFullYear(),s=n.getFullYear();return i.default.h("table",null,i.default.h("tr",null,i.default.h("th",{colspan:"4",class:"calendar-title"},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(r-16)},title:a-16+" - "+(a-1),class:"prev"}),i.default.h("b",null,a+" - "+(a+15)),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(r+16)},title:a+16+" - "+(a+31),class:"next"}))),[0,1,2,3].map(function(e){return i.default.h("tr",null,[0,1,2,3].map(function(n){var o=a+n+4*e,r=(ol?"future":"today")+(o==s?" selected":"");return i.default.h("td",{class:"years "+r},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(o)}},o))}))}))}},{key:"_yearOptions",value:function(e,t,n){for(var o=[],r=e;r=12&&(c=0,d++);var f=o-1,p=n;f<0&&(f=11,p--);var h=s.getFullYear(),v=(new Date(n,o,1).getDay()+l)%7,m=2==o?n%4||!(n%100)&&n%400?28:29:o<7==!(1&o)?31:30,y=s.getFullYear(),_=n-y||o-s.getMonth(),b=r&&n==r.getFullYear()&&o==r.getMonth()?r.getDate():-1;return i.default.h("table",null,i.default.h("tr",null,i.default.h("th",{colspan:"7",class:"calendar-title"},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(p,f)},title:u[f]+" "+p,class:"prev"}),a?[i.default.h("select",{name:"calendar-month",class:"calendar-month",onchange:function(e){return t.showDays(n,e.target.value)}},u.map(function(e,t){return i.default.h("option",{value:t,selected:t==o},e)})),i.default.h("select",{name:"calendar-year",class:"calendar-year",onchange:function(e){return t.showDays(e.target.value,o)}},this._yearOptions(h+e.years.min,h+e.years.max,n))]:[i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showMonths(n,o)}},u[o]),i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showYears(n)}},n)],i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.showDays(d,c)},title:e.month_names[c]+" "+d,class:"next"}))),i.default.h("tr",{class:"header"},e.weekdays.map(function(e){return i.default.h("td",null,e)})),[0,1,2,3,4].map(function(r){return 7*r0||a>=v)&&l<=m){var u="days",c=_||l-s.getDate();return u+=c<0?" past":c?" future":" today",l==b&&(u+=" selected"),u+=" "+e.weekdayIds[a].toLowerCase(),i.default.h("td",{class:u},i.default.h("a",{href:"javascript:void(0)",onclick:function(){return t.selectDate(n,o,l)}},l))}return i.default.h("td",{class:"days"}," ")})):null}))}}],[{key:"showCalendar",value:function(e,n){var o=r({},t.defaultProps,n);o.selected=new Date;var a=e.value.replace(/\s+.*$/,"");if(a){var l=!1,s=a.split("-");3==s.length?(s[1]--,l=new Date(s[0],s[1],s[2])):1==s.length&&3==(s=a.split(".")).length&&(s[1]--,l=new Date(s[2],s[1],s[0])),l&&!isNaN(l.getFullYear())&&(o.selected=l)}o.today=new Date,o.year=o.selected.getFullYear(),o.month=o.selected.getMonth(),o.mode=o.start,o.input=e,o.onChangeProps=function(e){o=r({},o,e),i.default.render(i.default.h(t,o),t.box.parentNode,t.box)},t.init(),t.box.style.display="block",t.stopBlur=Date.now(),i.default.render(i.default.h(t,o),t.box.parentNode,t.box)}},{key:"hideCalendar",value:function(){t.box&&(t.box.style.display="none")}},{key:"set",value:function(e,n){"string"==typeof e&&(e=document.getElementById(e)),e&&e.addEventListener("focus",function(o){t.showCalendar(e,n)})}},{key:"init",value:function(){if(!t.box||!t.box.parentNode){var e=document.createElement("div");t.box||(t.box=e),e.className="calendar-box",e.addEventListener("mousedown",function(e){return(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0,t.stopBlur=Date.now(),!0}),document.getElementsByTagName("body")[0].insertBefore(e,document.getElementsByTagName("body")[0].firstChild),t.addedListener||(document.addEventListener("mousedown",function(){t.hideCalendar()}),t.addedListener=!0)}}}]),t}();s.defaultProps={month_names:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],close_label:"Закрыть",weekdays:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],weekdayIds:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],sunday:6,selectboxes:!1,years:{min:-70,max:10},format:"d.m.Y",today:new Date,start:"days"},window.Calendar=s},function(e,t,n){"use strict";n.r(t),n.d(t,"h",function(){return i}),n.d(t,"createElement",function(){return i}),n.d(t,"cloneElement",function(){return c}),n.d(t,"Component",function(){return L}),n.d(t,"render",function(){return Y}),n.d(t,"rerender",function(){return h}),n.d(t,"options",function(){return r});var o=function(){},r={},a=[],l=[];function i(e,t){var n,i,s,u,c=l;for(u=arguments.length;u-- >2;)a.push(arguments[u]);for(t&&null!=t.children&&(a.length||a.push(t.children),delete t.children);a.length;)if((i=a.pop())&&void 0!==i.pop)for(u=i.length;u--;)a.push(i[u]);else"boolean"==typeof i&&(i=null),(s="function"!=typeof e)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(s=!1)),s&&n?c[c.length-1]+=i:c===l?c=[i]:c.push(i),n=s;var d=new o;return d.nodeName=e,d.children=c,d.attributes=null==t?void 0:t,d.key=null==t?void 0:t.key,void 0!==r.vnode&&r.vnode(d),d}function s(e,t){for(var n in t)e[n]=t[n];return e}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return i(e.nodeName,s(s({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function p(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(r.debounceRendering||u)(h)}function h(){var e,t=f;for(f=[];e=t.pop();)e._dirty&&T(e)}function v(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function m(e){var t=s({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var a in n)a in o||(e.style[a]="");for(var a in o)e.style[a]="number"==typeof o[a]&&!1===d.test(a)?o[a]+"px":o[a]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,b,l):e.removeEventListener(t,b,l),(e._listeners||(e._listeners={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e){try{e[t]=null==o?"":o}catch(e){}null!=o&&!1!==o||"spellcheck"==t||e.removeAttribute(t)}else{var i=r&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?i?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(i?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function b(e){return this._listeners[e.type](r.event&&r.event(e)||e)}var g=[],w=0,x=!1,C=!1;function k(){for(var e;e=g.pop();)r.afterMount&&r.afterMount(e),e.componentDidMount&&e.componentDidMount()}function N(e,t,n,o,r,a){w++||(x=null!=r&&void 0!==r.ownerSVGElement,C=null!=e&&!("__preactattr_"in e));var l=D(e,t,n,o,a);return r&&l.parentNode!==r&&r.appendChild(l),--w||(C=!1,a||k()),l}function D(e,t,n,o,r){var a=e,l=x;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),P(e,!0))),a.__preactattr_=!0,a;var i,s,u=t.nodeName;if("function"==typeof u)return function(e,t,n,o){var r=e&&e._component,a=r,l=e,i=r&&e._componentConstructor===t.nodeName,s=i,u=m(t);for(;r&&!s&&(r=r._parentComponent);)s=r.constructor===t.nodeName;r&&s&&(!o||r._component)?(O(r,u,3,n,o),e=r.base):(a&&!i&&(B(a),e=l=null),r=E(t.nodeName,u,n),e&&!r.nextBase&&(r.nextBase=e,l=null),O(r,u,1,n,o),e=r.base,l&&e!==l&&(l._component=null,P(l,!1)));return e}(e,t,n,o);if(x="svg"===u||"foreignObject"!==u&&x,u=String(u),(!e||!v(e,u))&&(i=u,(s=x?document.createElementNS("http://www.w3.org/2000/svg",i):document.createElement(i)).normalizedNodeName=i,a=s,e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),P(e,!0)}var c=a.firstChild,d=a.__preactattr_,f=t.children;if(null==d){d=a.__preactattr_={};for(var p=a.attributes,h=p.length;h--;)d[p[h].name]=p[h].value}return!C&&f&&1===f.length&&"string"==typeof f[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=f[0]&&(c.nodeValue=f[0]):(f&&f.length||null!=c)&&function(e,t,n,o,r){var a,l,i,s,u,c=e.childNodes,d=[],f={},p=0,h=0,m=c.length,_=0,b=t?t.length:0;if(0!==m)for(var g=0;g\n * \n */\n\nimport preact from 'preact';\n/** @jsx preact.h */\n\nexport class Calendar extends preact.Component\n{\n\t// Configuration\n\tstatic defaultProps = {\n\t\tmonth_names: [\"Январь\",\"Февраль\",\"Март\",\"Апрель\",\"Май\",\"Июнь\",\"Июль\",\"Август\",\"Сентябрь\",\"Октябрь\",\"Ноябрь\",\"Декабрь\"],\n\t\tclose_label: 'Закрыть',\n\t\tweekdays: [\"Пн\",\"Вт\",\"Ср\",\"Чт\",\"Пт\",\"Сб\",\"Вс\"],\n\t\tweekdayIds: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],\n\t\tsunday: 6,\n\t\tselectboxes: false, // true: use selectboxes for year and month, false: show months and years in table\n\t\tyears: { min: -70, max: 10 }, // range of displayed years if selectboxes==true\n\t\tformat: 'd.m.Y', // either d.m.Y or Y-m-d, other formats are not supported\n\t\t// Today's date\n\t\ttoday: new Date(),\n\t\tstart: 'days',\n\t}\n\n\trender(props, state)\n\t{\n\t\treturn (
\n\t\t\t{props.mode == 'months' ? this.renderMonths(props) : null}\n\t\t\t{props.mode == 'years' ? this.renderYears(props) : null}\n\t\t\t{props.mode == 'days' ? this.renderDays(props) : null}\n\t\t\t Calendar.hideCalendar()}>{props.close_label}\n\t\t
);\n\t}\n\n\tcomponentDidMount()\n\t{\n\t\tthis.componentDidUpdate();\n\t}\n\n\tcomponentDidUpdate()\n\t{\n\t\t// Position the div in the correct location...\n\t\tvar input = this.props.input;\n\t\tvar div = Calendar.box;\n\t\tvar xy = getOffset(input);\n\t\tvar height = input.clientHeight||input.offsetHeight;\n\t\tvar ww = document.body.clientWidth||document.documentElement.clientWidth;\n\t\tvar wh = document.body.clientHeight||document.documentElement.clientHeight;\n\t\tif (xy.left-1+div.offsetWidth > ww)\n\t\t\tdiv.style.left = (ww-div.offsetWidth-1)+\"px\";\n\t\telse\n\t\t\tdiv.style.left = (xy.left-1)+\"px\";\n\t\tif (div.offsetHeight + xy.top+height-1 >= wh &&\n\t\t\txy.top-div.offsetHeight >= 0)\n\t\t\tdiv.style.top = (xy.top-div.offsetHeight)+'px';\n\t\telse\n\t\t\tdiv.style.top = (xy.top+height-1)+\"px\";\n\t}\n\n\t/// Called when the user clicks on a date in the calendar.\n\tselectDate(year, month, day)\n\t{\n\t\tvar i = this.props.input;\n\t\tvar t = i.value.split(/\\s+/, 2)[1]||'';\n\t\tmonth = Number(month)+1;\n\t\tif (this.props.callback)\n\t\t{\n\t\t\t// Safari does not understand new Date('YYYY-MM-DD HH:MM:SS')\n\t\t\tt = t ? t.split(/:/) : null;\n\t\t\tt = t ? new Date(year-0, month-1, day-0, t[0]-0, t[1]-0, t[2]-0) : new Date(year-0, month-1, day-0);\n\t\t\tvar c = this.props.callback;\n\t\t\tc(new Date(t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (month < 10)\n\t\t\t\tmonth = '0'+month;\n\t\t\tif (day < 10)\n\t\t\t\tday = '0'+day;\n\t\t\tt = (this.format == 'Y-m-d' ? year + '-' + month + '-' + day : day + '.' + month + '.' + year) + (t ? ' '+t : '');\n\t\t\ti.value = t;\n\t\t\tif (\"Event\" in window)\n\t\t\t{\n\t\t\t\tvar evt = document.createEvent('Event');\n\t\t\t\tevt.initEvent('change', true, true);\n\t\t\t\ti.dispatchEvent(evt);\n\t\t\t}\n\t\t\telse\n\t\t\t\ti.fireEvent(\"onchange\");\n\t\t}\n\t\tCalendar.hideCalendar();\n\t}\n\n\tshowMonths(year)\n\t{\n\t\tthis.props.onChangeProps({ year, mode: 'months' });\n\t}\n\n\tshowYears(year)\n\t{\n\t\tthis.props.onChangeProps({ year, mode: 'years' });\n\t}\n\n\tshowDays(year, month)\n\t{\n\t\tthis.props.onChangeProps({ year, month, mode: 'days' });\n\t}\n\n\trenderMonths(props)\n\t{\n\t\tvar year = props.year;\n\t\tvar cur_y = props.today.getFullYear();\n\t\tvar cur_m = props.today.getMonth();\n\t\tvar sel_m = props.selected.getFullYear() == year ? props.selected.getMonth() : -1;\n\t\tvar months = [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ], [ 9, 10, 11 ] ];\n\t\treturn (\n\t\t\t\n\t\t\t{months.map(g => (\n\t\t\t\t{g.map(i => (\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showMonths(year-1)} title={(year-1)} class='prev'>\n\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t this.showMonths(year+1)} title={(year+1)} class='next'>\n\t\t\t
cur_y || year == cur_y && i > cur_m ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_m ? ' selected' : '')}>\n\t\t\t\t\t\t this.showDays(year, i)}>\n\t\t\t\t\t\t\t{props.month_names[i]}\n\t\t\t\t\t\t\n\t\t\t\t\t
);\n\t}\n\n\trenderYears({ selected, today, year })\n\t{\n\t\tvar beg = year & ~15;\n\t\tvar cur_y = today.getFullYear();\n\t\tvar sel_y = selected.getFullYear();\n\t\treturn (\n\t\t\t\n\t\t\t{[0, 1, 2, 3].map(r => (\n\t\t\t\t\n\t\t\t\t{[0, 1, 2, 3].map(j => {\n\t\t\t\t\tvar i = beg + j + r*4;\n\t\t\t\t\tvar class_name = (i < cur_y ? 'past' : (i > cur_y ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_y ? ' selected' : '');\n\t\t\t\t\treturn ();\n\t\t\t\t})}\n\t\t\t\t\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showYears(year-16)} title={(beg-16)+\" - \"+(beg-1)} class='prev'>\n\t\t\t\t{beg+' - '+(beg+15)}\n\t\t\t\t this.showYears(year+16)} title={(beg+16)+\" - \"+(beg+31)} class='next'>\n\t\t\t
\n\t\t\t\t\t\t this.showMonths(i)}>{i}\n\t\t\t\t\t
);\n\t}\n\n\t_yearOptions(min, max, year)\n\t{\n\t\tvar r = [];\n\t\tfor (var i = min; i < max; i++)\n\t\t\tr.push();\n\t\treturn r;\n\t}\n\n\t/// Creates a calendar with the date given in the argument as the selected date.\n\trenderDays(props)\n\t{\n\t\tvar { year, month, selected, selectboxes, sunday, today, month_names } = props;\n\n\t\t// Display the table\n\t\tvar next_month = month+1;\n\t\tvar next_month_year = year;\n\t\tif (next_month >= 12)\n\t\t{\n\t\t\tnext_month = 0;\n\t\t\tnext_month_year++;\n\t\t}\n\n\t\tvar previous_month = month-1;\n\t\tvar previous_month_year = year;\n\t\tif (previous_month < 0)\n\t\t{\n\t\t\tprevious_month = 11;\n\t\t\tprevious_month_year--;\n\t\t}\n\n\t\tvar current_year = today.getFullYear();\n\n\t\t// Get the first day of this month\n\t\tvar first_day = new Date(year, month, 1);\n\t\tvar start_day = (first_day.getDay()+sunday)%7;\n\n\t\tvar d = 1;\n\t\tvar flag = 0;\n\n\t\t// Leap year support\n\t\tvar days_in_this_month = (month == 2\n\t\t\t? (!(year % 4) && ((year % 100) || !(year % 400)) ? 29 : 28)\n\t\t\t: ((month < 7) == !(month & 1) ? 31 : 30));\n\n\t\tvar yea = today.getFullYear();\n\t\tvar all_diff = (year - yea) || (month - today.getMonth());\n\t\tvar sel_day = selected && year == selected.getFullYear() && month == selected.getMonth() ? selected.getDate() : -1;\n\n\t\treturn (\n\t\t\t\n\t\t\t\n\t\t\t\t{props.weekdays.map(name => ())}\n\t\t\t\n\t\t\t{[0, 1, 2, 3, 4].map(i => (\n\t\t\t\t(i*7 < days_in_this_month+start_day ? \n\t\t\t\t\t{[0, 1, 2, 3, 4, 5, 6].map(j =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d = i*7+j+1-start_day;\n\t\t\t\t\t\tvar visible = (i > 0 || j >= start_day) && (d <= days_in_this_month);\n\t\t\t\t\t\tif (visible)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar class_name = 'days';\n\t\t\t\t\t\t\tvar diff = all_diff || (d - today.getDate());\n\t\t\t\t\t\t\tif (diff < 0)\n\t\t\t\t\t\t\t\tclass_name += ' past';\n\t\t\t\t\t\t\telse if (!diff)\n\t\t\t\t\t\t\t\tclass_name += ' today';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tclass_name += ' future';\n\t\t\t\t\t\t\tif (d == sel_day)\n\t\t\t\t\t\t\t\tclass_name += ' selected';\n\t\t\t\t\t\t\tclass_name += ' ' + props.weekdayIds[j].toLowerCase();\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t})}\n\t\t\t\t : null)\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showDays(previous_month_year, previous_month)}\n\t\t\t\t\ttitle={month_names[previous_month]+\" \"+previous_month_year} class='prev'>\n\t\t\t\t{!selectboxes ?\n\t\t\t\t\t[\n\t\t\t\t\t\t this.showMonths(year, month)}>{month_names[month]},\n\t\t\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t\t] : [\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t\t this.showDays(next_month_year,next_month)}\n\t\t\t\t\ttitle={props.month_names[next_month]+\" \"+next_month_year} class='next'>\n\t\t\t
{name}
\n\t\t\t\t\t\t\t\t this.selectDate(year, month, d)}>{d}\n\t\t\t\t\t\t\t 
);\n\t}\n\n\t/// Display the calendar - if a date exists in the input box, that will be selected in the calendar.\n\tstatic showCalendar(input, options)\n\t{\n\t\t// Show the calendar with the date in the input as the selected date\n\t\tvar props = { ...Calendar.defaultProps, ...options };\n\t\tprops.selected = new Date();\n\t\tvar date_in_input = input.value.replace(/\\s+.*$/, ''); // Remove time\n\t\tif (date_in_input)\n\t\t{\n\t\t\t// date format is HARDCODE\n\t\t\tvar selected_date = false;\n\t\t\tvar date_parts = date_in_input.split(\"-\");\n\t\t\tif (date_parts.length == 3)\n\t\t\t{\n\t\t\t\t// Y-m-d\n\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\tselected_date = new Date(date_parts[0], date_parts[1], date_parts[2]);\n\t\t\t}\n\t\t\telse if (date_parts.length == 1)\n\t\t\t{\n\t\t\t\tdate_parts = date_in_input.split('.');\n\t\t\t\tif (date_parts.length == 3)\n\t\t\t\t{\n\t\t\t\t\t// d.m.Y\n\t\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\t\tselected_date = new Date(date_parts[2], date_parts[1], date_parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selected_date && !isNaN(selected_date.getFullYear()))\n\t\t\t{\n\t\t\t\t// Valid date.\n\t\t\t\tprops.selected = selected_date;\n\t\t\t}\n\t\t}\n\t\tprops.today = new Date();\n\t\tprops.year = props.selected.getFullYear();\n\t\tprops.month = props.selected.getMonth();\n\t\tprops.mode = props.start;\n\t\tprops.input = input;\n\t\tprops.onChangeProps = (h) =>\n\t\t{\n\t\t\tprops = { ...props, ...h };\n\t\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t\t};\n\t\tCalendar.init();\n\t\tCalendar.box.style.display = \"block\";\n\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t}\n\n\t/// Hides the currently show calendar.\n\tstatic hideCalendar()\n\t{\n\t\tif (!Calendar.box)\n\t\t\treturn;\n\t\tCalendar.box.style.display = \"none\";\n\t}\n\n\t/// Setup a text input box to be a calendar box.\n\tstatic set(input_or_id, options)\n\t{\n\t\tif (typeof input_or_id == 'string')\n\t\t{\n\t\t\tinput_or_id = document.getElementById(input_or_id);\n\t\t}\n\t\tif (!input_or_id)\n\t\t{\n\t\t\treturn; // If the input field is not there, exit.\n\t\t}\n\t\tinput_or_id.addEventListener('focus', function(ev)\n\t\t{\n\t\t\tCalendar.showCalendar(input_or_id, options);\n\t\t});\n\t\t// FIXME: Add change listener to enable interactive date selection in calendar while typing\n\t}\n\n\t// Will be called once when the first input is set.\n\tstatic init()\n\t{\n\t\tif (!Calendar.box || !Calendar.box.parentNode)\n\t\t{\n\t\t\tvar div = document.createElement('div');\n\t\t\tif (!Calendar.box)\n\t\t\t\tCalendar.box = div;\n\t\t\tdiv.className = \"calendar-box\";\n\t\t\tdiv.addEventListener(\"mousedown\", function(ev)\n\t\t\t{\n\t\t\t\tev = ev || window.event;\n\t\t\t\tif (ev.stopPropagation)\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\telse\n\t\t\t\t\tev.cancelBubble = true;\n\t\t\t\treturn true;\n\t\t\t});\n\t\t\tdocument.getElementsByTagName(\"body\")[0].insertBefore(div, document.getElementsByTagName(\"body\")[0].firstChild);\n\t\t\tif (!Calendar.addedListener)\n\t\t\t{\n\t\t\t\tdocument.addEventListener(\"mousedown\", function() { Calendar.hideCalendar(); });\n\t\t\t\tCalendar.addedListener = true;\n\t\t\t}\n\t\t}\n\t}\n}\n\nwindow.Calendar = Calendar;\n\nfunction getOffsetRect(elem)\n{\n\tvar box = elem.getBoundingClientRect();\n\n\tvar body = document.body;\n\tvar docElem = document.documentElement;\n\n\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n\tvar clientTop = docElem.clientTop || body.clientTop || 0;\n\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\n\tvar top = box.top + scrollTop - clientTop;\n\tvar left = box.left + scrollLeft - clientLeft;\n\n\treturn { top: Math.round(top), left: Math.round(left) };\n}\n\nfunction getOffsetSum(elem)\n{\n\tvar top = 0, left = 0;\n\twhile(elem)\n\t{\n\t\ttop = top + parseInt(elem.offsetTop);\n\t\tleft = left + parseInt(elem.offsetLeft);\n\t\telem = elem.offsetParent;\n\t}\n\treturn { top: top, left: left };\n}\n\nfunction getOffset(elem)\n{\n\tif (elem.getBoundingClientRect)\n\t\treturn getOffsetRect(elem);\n\telse\n\t\treturn getOffsetSum(elem);\n}\n","var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p,\n\t list = items;\n\titems = [];\n\twhile (p = list.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tif (old) old(null);\n\t\tif (value) value(node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null && node['__preactattr_'].ref) node['__preactattr_'].ref(null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tif (component.__ref) component.__ref(component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.unshift(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tif (component.__ref) component.__ref(null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./calendar-preact.js","webpack:///./node_modules/preact/dist/preact.mjs"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_preact","Calendar","preact","Component","props","state","_preact2","default","h","class","style","display","this","renderMonths","renderYears","renderDays","onclick","hideCalendar","close_label","componentDidUpdate","input","addEventListener","stopBlur","Date","now","elem","div","box","xy","getBoundingClientRect","body","document","docElem","documentElement","scrollTop","window","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","top","left","Math","round","getOffsetRect","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetSum","height","clientHeight","offsetHeight","ww","clientWidth","wh","offsetWidth","year","month","day","split","Number","callback","format","evt","createEvent","initEvent","dispatchEvent","fireEvent","onChangeProps","_this2","cur_y","today","getFullYear","cur_m","getMonth","sel_m","selected","colspan","href","showMonths","title","showYears","map","g","showDays","month_names","_this3","_ref","beg","sel_y","j","class_name","min","max","push","_this4","selectboxes","sunday","next_month","next_month_year","previous_month","previous_month_year","current_year","start_day","getDay","days_in_this_month","yea","all_diff","sel_day","getDate","onchange","e","target","_yearOptions","years","weekdays","diff","weekdayIds","toLowerCase","selectDate","options","defaultProps","date_in_input","replace","selected_date","date_parts","length","isNaN","start","render","parentNode","init","input_or_id","getElementById","ev","showCalendar","createElement","className","event","stopPropagation","cancelBubble","getElementsByTagName","insertBefore","firstChild","addedListener","__webpack_exports__","cloneElement","rerender","VNode","stack","EMPTY_CHILDREN","nodeName","attributes","lastSimple","child","simple","children","arguments","pop","undefined","String","vnode","extend","obj","defer","Promise","resolve","then","setTimeout","slice","IS_NON_DIMENSIONAL","items","enqueueRender","component","_dirty","debounceRendering","list","renderComponent","isNamedNode","node","normalizedNodeName","getNodeProps","removeNode","removeChild","setAccessor","old","isSvg","cssText","test","innerHTML","__html","useCapture","substring","eventProxy","removeEventListener","_listeners","removeAttribute","removeAttributeNS","setAttributeNS","setAttribute","type","mounts","diffLevel","isSvgMode","hydrating","flushMounts","afterMount","componentDidMount","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","splitText","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","originalComponent","oldDom","isDirectOwner","_componentConstructor","isOwner","_parentComponent","constructor","setComponentProps","base","unmountComponent","createComponent","nextBase","buildComponentFromVNode","createElementNS","fc","vchildren","a","nextSibling","isHydrating","f","vchild","originalChildren","childNodes","keyed","keyedLen","len","childrenLen","vlen","_child","__key","trim","innerDiffNode","dangerouslySetInnerHTML","attrs","diffAttributes","unmountOnly","ref","removeChildren","lastChild","next","previousSibling","recyclerComponents","Ctor","inst","doRender","splice","renderMode","_disable","__ref","getDerivedStateFromProps","componentWillMount","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","snapshot","shouldComponentUpdate","componentWillUpdate","getChildContext","getSnapshotBeforeUpdate","toUnmount","childComponent","childProps","baseParent","componentRef","unshift","afterUpdate","_renderCallbacks","beforeUnmount","componentWillUnmount","inner","merge","setState","forceUpdate"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,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AAH,EAEApD,EAAAoD,GACAiC,EAAA7K,KAAA+E,GAEA0F,EAAA7B,IAGA7D,EAAAqG,OAAArG,EAAAqG,MAAA,MAGA,SAAAjR,EAAAC,EAAA+M,GACAvM,KAAAoK,QAAA,EAEApK,KAAAuM,UAEAvM,KAAAR,QAEAQ,KAAAP,MAAAO,KAAAP,OAAA,GAEAO,KAAAsS,iBAAA,GAiBA,SAAA/K,EAAAgC,EAAAkD,EAAAiG,GACA,OAAAhM,EAAAgM,EAAAnJ,EAAA,IAA8B,EAAAkD,GAAA,GAf9BjD,EAAAjK,EAAAP,UAAA,CACA2T,SAAA,SAAAlT,EAAA0D,GACAnD,KAAAoR,YAAApR,KAAAoR,UAAApR,KAAAP,OACAO,KAAAP,MAAA+J,IAAA,GAA+BxJ,KAAAP,OAAA,mBAAAA,IAAAO,KAAAP,MAAAO,KAAAR,OAAAC,GAC/B0D,GAAAnD,KAAAsS,iBAAAlN,KAAAjC,GACA+G,EAAAlK,OAEA4S,YAAA,SAAAzP,GACAA,GAAAnD,KAAAsS,iBAAAlN,KAAAjC,GACAoH,EAAAvK,KAAA,IAEAuH,OAAA,eAOA,IAAAjI,EAAA,CACAM,IACAkI,cAAAlI,EACA4I,eACAjJ,YACAgI,SACAkB,WACA3B,WAGeyB,EAAA","file":"./calendar-preact.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Calendar Script\n * Creates a calendar widget which can be used to select the date more easily than using just a text box\n *\n * Modified: http://yourcmc.ru/git/vitalif-js/calendar\n * Version: 2019-07-18\n * License: MIT-like, http://www.openjs.com/license.php\n *\n * Example:\n * \n * \n */\n\nimport preact from 'preact';\n/** @jsx preact.h */\n\nexport class Calendar extends preact.Component\n{\n\t// Configuration\n\tstatic defaultProps = {\n\t\tmonth_names: [\"Январь\",\"Февраль\",\"Март\",\"Апрель\",\"Май\",\"Июнь\",\"Июль\",\"Август\",\"Сентябрь\",\"Октябрь\",\"Ноябрь\",\"Декабрь\"],\n\t\tclose_label: 'Закрыть',\n\t\tweekdays: [\"Пн\",\"Вт\",\"Ср\",\"Чт\",\"Пт\",\"Сб\",\"Вс\"],\n\t\tweekdayIds: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],\n\t\tsunday: 6,\n\t\tselectboxes: false, // true: use selectboxes for year and month, false: show months and years in table\n\t\tyears: { min: -70, max: 10 }, // range of displayed years if selectboxes==true\n\t\tformat: 'd.m.Y', // either d.m.Y or Y-m-d, other formats are not supported\n\t\t// Today's date\n\t\ttoday: new Date(),\n\t\tstart: 'days',\n\t}\n\n\trender(props, state)\n\t{\n\t\treturn (
\n\t\t\t{props.mode == 'months' ? this.renderMonths(props) : null}\n\t\t\t{props.mode == 'years' ? this.renderYears(props) : null}\n\t\t\t{props.mode == 'days' ? this.renderDays(props) : null}\n\t\t\t Calendar.hideCalendar()}>{props.close_label}\n\t\t
);\n\t}\n\n\tcomponentDidMount()\n\t{\n\t\tthis.componentDidUpdate();\n\t\tthis.props.input.addEventListener('blur', () =>\n\t\t{\n\t\t\tif (!Calendar.stopBlur || Calendar.stopBlur < Date.now()-200)\n\t\t\t\tCalendar.hideCalendar();\n\t\t});\n\t}\n\n\tcomponentDidUpdate()\n\t{\n\t\t// Position the div in the correct location...\n\t\tvar input = this.props.input;\n\t\tvar div = Calendar.box;\n\t\tvar xy = getOffset(input);\n\t\tvar height = input.clientHeight||input.offsetHeight;\n\t\tvar ww = document.body.clientWidth||document.documentElement.clientWidth;\n\t\tvar wh = document.body.clientHeight||document.documentElement.clientHeight;\n\t\tif (xy.left-1+div.offsetWidth > ww)\n\t\t\tdiv.style.left = (ww-div.offsetWidth-1)+\"px\";\n\t\telse\n\t\t\tdiv.style.left = (xy.left-1)+\"px\";\n\t\tif (div.offsetHeight + xy.top+height-1 >= wh &&\n\t\t\txy.top-div.offsetHeight >= 0)\n\t\t\tdiv.style.top = (xy.top-div.offsetHeight)+'px';\n\t\telse\n\t\t\tdiv.style.top = (xy.top+height-1)+\"px\";\n\t}\n\n\t/// Called when the user clicks on a date in the calendar.\n\tselectDate(year, month, day)\n\t{\n\t\tvar i = this.props.input;\n\t\tvar t = i.value.split(/\\s+/, 2)[1]||'';\n\t\tmonth = Number(month)+1;\n\t\tif (this.props.callback)\n\t\t{\n\t\t\t// Safari does not understand new Date('YYYY-MM-DD HH:MM:SS')\n\t\t\tt = t ? t.split(/:/) : [ 0, 0, 0 ];\n\t\t\tt = new Date(year-0, month-1, day-0, t[0]-0, t[1]-0, t[2]-0);\n\t\t\tvar c = this.props.callback;\n\t\t\tc(new Date(t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (month < 10)\n\t\t\t\tmonth = '0'+month;\n\t\t\tif (day < 10)\n\t\t\t\tday = '0'+day;\n\t\t\tt = (this.format == 'Y-m-d' ? year + '-' + month + '-' + day : day + '.' + month + '.' + year) + (t ? ' '+t : '');\n\t\t\ti.value = t;\n\t\t\tif (\"Event\" in window)\n\t\t\t{\n\t\t\t\tvar evt = document.createEvent('Event');\n\t\t\t\tevt.initEvent('change', true, true);\n\t\t\t\ti.dispatchEvent(evt);\n\t\t\t}\n\t\t\telse\n\t\t\t\ti.fireEvent(\"onchange\");\n\t\t}\n\t\tCalendar.hideCalendar();\n\t}\n\n\tshowMonths(year)\n\t{\n\t\tthis.props.onChangeProps({ year, mode: 'months' });\n\t}\n\n\tshowYears(year)\n\t{\n\t\tthis.props.onChangeProps({ year, mode: 'years' });\n\t}\n\n\tshowDays(year, month)\n\t{\n\t\tthis.props.onChangeProps({ year, month, mode: 'days' });\n\t}\n\n\trenderMonths(props)\n\t{\n\t\tvar year = props.year;\n\t\tvar cur_y = props.today.getFullYear();\n\t\tvar cur_m = props.today.getMonth();\n\t\tvar sel_m = props.selected.getFullYear() == year ? props.selected.getMonth() : -1;\n\t\tvar months = [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ], [ 9, 10, 11 ] ];\n\t\treturn (\n\t\t\t\n\t\t\t{months.map(g => (\n\t\t\t\t{g.map(i => (\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showMonths(year-1)} title={(year-1)} class='prev'>\n\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t this.showMonths(year+1)} title={(year+1)} class='next'>\n\t\t\t
cur_y || year == cur_y && i > cur_m ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_m ? ' selected' : '')}>\n\t\t\t\t\t\t this.showDays(year, i)}>\n\t\t\t\t\t\t\t{props.month_names[i]}\n\t\t\t\t\t\t\n\t\t\t\t\t
);\n\t}\n\n\trenderYears({ selected, today, year })\n\t{\n\t\tvar beg = year & ~15;\n\t\tvar cur_y = today.getFullYear();\n\t\tvar sel_y = selected.getFullYear();\n\t\treturn (\n\t\t\t\n\t\t\t{[0, 1, 2, 3].map(r => (\n\t\t\t\t\n\t\t\t\t{[0, 1, 2, 3].map(j => {\n\t\t\t\t\tvar i = beg + j + r*4;\n\t\t\t\t\tvar class_name = (i < cur_y ? 'past' : (i > cur_y ? 'future' : 'today'))\n\t\t\t\t\t\t+ (i == sel_y ? ' selected' : '');\n\t\t\t\t\treturn ();\n\t\t\t\t})}\n\t\t\t\t\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showYears(year-16)} title={(beg-16)+\" - \"+(beg-1)} class='prev'>\n\t\t\t\t{beg+' - '+(beg+15)}\n\t\t\t\t this.showYears(year+16)} title={(beg+16)+\" - \"+(beg+31)} class='next'>\n\t\t\t
\n\t\t\t\t\t\t this.showMonths(i)}>{i}\n\t\t\t\t\t
);\n\t}\n\n\t_yearOptions(min, max, year)\n\t{\n\t\tvar r = [];\n\t\tfor (var i = min; i < max; i++)\n\t\t\tr.push();\n\t\treturn r;\n\t}\n\n\t/// Creates a calendar with the date given in the argument as the selected date.\n\trenderDays(props)\n\t{\n\t\tvar { year, month, selected, selectboxes, sunday, today, month_names } = props;\n\n\t\t// Display the table\n\t\tvar next_month = month+1;\n\t\tvar next_month_year = year;\n\t\tif (next_month >= 12)\n\t\t{\n\t\t\tnext_month = 0;\n\t\t\tnext_month_year++;\n\t\t}\n\n\t\tvar previous_month = month-1;\n\t\tvar previous_month_year = year;\n\t\tif (previous_month < 0)\n\t\t{\n\t\t\tprevious_month = 11;\n\t\t\tprevious_month_year--;\n\t\t}\n\n\t\tvar current_year = today.getFullYear();\n\n\t\t// Get the first day of this month\n\t\tvar first_day = new Date(year, month, 1);\n\t\tvar start_day = (first_day.getDay()+sunday)%7;\n\n\t\tvar d = 1;\n\t\tvar flag = 0;\n\n\t\t// Leap year support\n\t\tvar days_in_this_month = (month == 2\n\t\t\t? (!(year % 4) && ((year % 100) || !(year % 400)) ? 29 : 28)\n\t\t\t: ((month < 7) == !(month & 1) ? 31 : 30));\n\n\t\tvar yea = today.getFullYear();\n\t\tvar all_diff = (year - yea) || (month - today.getMonth());\n\t\tvar sel_day = selected && year == selected.getFullYear() && month == selected.getMonth() ? selected.getDate() : -1;\n\n\t\treturn (\n\t\t\t\n\t\t\t\n\t\t\t\t{props.weekdays.map(name => ())}\n\t\t\t\n\t\t\t{[0, 1, 2, 3, 4].map(i => (\n\t\t\t\t(i*7 < days_in_this_month+start_day ? \n\t\t\t\t\t{[0, 1, 2, 3, 4, 5, 6].map(j =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d = i*7+j+1-start_day;\n\t\t\t\t\t\tvar visible = (i > 0 || j >= start_day) && (d <= days_in_this_month);\n\t\t\t\t\t\tif (visible)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar class_name = 'days';\n\t\t\t\t\t\t\tvar diff = all_diff || (d - today.getDate());\n\t\t\t\t\t\t\tif (diff < 0)\n\t\t\t\t\t\t\t\tclass_name += ' past';\n\t\t\t\t\t\t\telse if (!diff)\n\t\t\t\t\t\t\t\tclass_name += ' today';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tclass_name += ' future';\n\t\t\t\t\t\t\tif (d == sel_day)\n\t\t\t\t\t\t\t\tclass_name += ' selected';\n\t\t\t\t\t\t\tclass_name += ' ' + props.weekdayIds[j].toLowerCase();\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn ();\n\t\t\t\t\t})}\n\t\t\t\t : null)\n\t\t\t))}\n\t\t
\n\t\t\t\t this.showDays(previous_month_year, previous_month)}\n\t\t\t\t\ttitle={month_names[previous_month]+\" \"+previous_month_year} class='prev'>\n\t\t\t\t{!selectboxes ?\n\t\t\t\t\t[\n\t\t\t\t\t\t this.showMonths(year, month)}>{month_names[month]},\n\t\t\t\t\t\t this.showYears(year)}>{year}\n\t\t\t\t\t] : [\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t\t this.showDays(next_month_year,next_month)}\n\t\t\t\t\ttitle={props.month_names[next_month]+\" \"+next_month_year} class='next'>\n\t\t\t
{name}
\n\t\t\t\t\t\t\t\t this.selectDate(year, month, d)}>{d}\n\t\t\t\t\t\t\t 
);\n\t}\n\n\t/// Display the calendar - if a date exists in the input box, that will be selected in the calendar.\n\tstatic showCalendar(input, options)\n\t{\n\t\t// Show the calendar with the date in the input as the selected date\n\t\tvar props = { ...Calendar.defaultProps, ...options };\n\t\tprops.selected = new Date();\n\t\tvar date_in_input = input.value.replace(/\\s+.*$/, ''); // Remove time\n\t\tif (date_in_input)\n\t\t{\n\t\t\t// date format is HARDCODE\n\t\t\tvar selected_date = false;\n\t\t\tvar date_parts = date_in_input.split(\"-\");\n\t\t\tif (date_parts.length == 3)\n\t\t\t{\n\t\t\t\t// Y-m-d\n\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\tselected_date = new Date(date_parts[0], date_parts[1], date_parts[2]);\n\t\t\t}\n\t\t\telse if (date_parts.length == 1)\n\t\t\t{\n\t\t\t\tdate_parts = date_in_input.split('.');\n\t\t\t\tif (date_parts.length == 3)\n\t\t\t\t{\n\t\t\t\t\t// d.m.Y\n\t\t\t\t\tdate_parts[1]--; // Month starts with 0\n\t\t\t\t\tselected_date = new Date(date_parts[2], date_parts[1], date_parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selected_date && !isNaN(selected_date.getFullYear()))\n\t\t\t{\n\t\t\t\t// Valid date.\n\t\t\t\tprops.selected = selected_date;\n\t\t\t}\n\t\t}\n\t\tprops.today = new Date();\n\t\tprops.year = props.selected.getFullYear();\n\t\tprops.month = props.selected.getMonth();\n\t\tprops.mode = props.start;\n\t\tprops.input = input;\n\t\tprops.onChangeProps = (h) =>\n\t\t{\n\t\t\tprops = { ...props, ...h };\n\t\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t\t};\n\t\tCalendar.init();\n\t\tCalendar.box.style.display = \"block\";\n\t\tCalendar.stopBlur = Date.now();\n\t\tpreact.render(, Calendar.box.parentNode, Calendar.box);\n\t}\n\n\t/// Hides the currently show calendar.\n\tstatic hideCalendar()\n\t{\n\t\tif (!Calendar.box)\n\t\t\treturn;\n\t\tCalendar.box.style.display = \"none\";\n\t}\n\n\t/// Setup a text input box to be a calendar box.\n\tstatic set(input_or_id, options)\n\t{\n\t\tif (typeof input_or_id == 'string')\n\t\t{\n\t\t\tinput_or_id = document.getElementById(input_or_id);\n\t\t}\n\t\tif (!input_or_id)\n\t\t{\n\t\t\treturn; // If the input field is not there, exit.\n\t\t}\n\t\tinput_or_id.addEventListener('focus', function(ev)\n\t\t{\n\t\t\tCalendar.showCalendar(input_or_id, options);\n\t\t});\n\t\t// FIXME: Add change listener to enable interactive date selection in calendar while typing\n\t}\n\n\t// Will be called once when the first input is set.\n\tstatic init()\n\t{\n\t\tif (!Calendar.box || !Calendar.box.parentNode)\n\t\t{\n\t\t\tvar div = document.createElement('div');\n\t\t\tif (!Calendar.box)\n\t\t\t\tCalendar.box = div;\n\t\t\tdiv.className = \"calendar-box\";\n\t\t\tdiv.addEventListener(\"mousedown\", function(ev)\n\t\t\t{\n\t\t\t\tev = ev || window.event;\n\t\t\t\tif (ev.stopPropagation)\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\telse\n\t\t\t\t\tev.cancelBubble = true;\n\t\t\t\tCalendar.stopBlur = Date.now();\n\t\t\t\treturn true;\n\t\t\t});\n\t\t\tdocument.getElementsByTagName(\"body\")[0].insertBefore(div, document.getElementsByTagName(\"body\")[0].firstChild);\n\t\t\tif (!Calendar.addedListener)\n\t\t\t{\n\t\t\t\tdocument.addEventListener(\"mousedown\", function() { Calendar.hideCalendar(); });\n\t\t\t\tCalendar.addedListener = true;\n\t\t\t}\n\t\t}\n\t}\n}\n\nwindow.Calendar = Calendar;\n\nfunction getOffsetRect(elem)\n{\n\tvar box = elem.getBoundingClientRect();\n\n\tvar body = document.body;\n\tvar docElem = document.documentElement;\n\n\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n\tvar clientTop = docElem.clientTop || body.clientTop || 0;\n\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\n\tvar top = box.top + scrollTop - clientTop;\n\tvar left = box.left + scrollLeft - clientLeft;\n\n\treturn { top: Math.round(top), left: Math.round(left) };\n}\n\nfunction getOffsetSum(elem)\n{\n\tvar top = 0, left = 0;\n\twhile(elem)\n\t{\n\t\ttop = top + parseInt(elem.offsetTop);\n\t\tleft = left + parseInt(elem.offsetLeft);\n\t\telem = elem.offsetParent;\n\t}\n\treturn { top: top, left: left };\n}\n\nfunction getOffset(elem)\n{\n\tif (elem.getBoundingClientRect)\n\t\treturn getOffsetRect(elem);\n\telse\n\t\treturn getOffsetSum(elem);\n}\n","var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p,\n\t list = items;\n\titems = [];\n\twhile (p = list.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tif (old) old(null);\n\t\tif (value) value(node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null && node['__preactattr_'].ref) node['__preactattr_'].ref(null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tif (component.__ref) component.__ref(component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.unshift(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tif (component.__ref) component.__ref(null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n"],"sourceRoot":""} \ No newline at end of file diff --git a/calendar.js b/calendar.js index 6557c2e..3575da0 100644 --- a/calendar.js +++ b/calendar.js @@ -4,7 +4,7 @@ * * Original: http://www.openjs.com/scripts/ui/calendar/ * Modified: http://yourcmc.ru/git/vitalif-js/calendar - * Version: 2018-11-04 + * Version: 2019-07-16 * License: MIT-like, http://www.openjs.com/license.php * * Example: @@ -81,12 +81,12 @@ export class Calendar selectDate(year, month, day) { var i = this.input; - var t = i.value.split(/[\s]+/, 2)[1]||''; + var t = i.value.split(/\s+/, 2)[1]||''; if (this.callback) { // Safari does not understand new Date('YYYY-MM-DD HH:MM:SS') - t = t ? t.split(/:/) : null; - t = t ? new Date(year-0, month-1, day-0, t[0]-0, t[1]-0, t[2]-0) : new Date(year-0, month-1, day-0); + t = t ? t.split(/:/) : [ 0, 0, 0 ]; + t = new Date(year-0, month-1, day-0, t[0]-0, t[1]-0, t[2]-0); var c = this.callback; c(t); } @@ -332,6 +332,11 @@ export class Calendar input_or_id.addEventListener('focus', function(ev) { instance.showCalendar(); }); + input_or_id.addEventListener('blur', function(ev) { + if (!instance.stopBlur || instance.stopBlur < Date.now()-200) { + instance.hideCalendar(); + } + }); return instance; } @@ -349,6 +354,8 @@ export class Calendar ev.stopPropagation(); else ev.cancelBubble = true; + if (Calendar.instance) + Calendar.instance.stopBlur = Date.now(); return true; }); document.getElementsByTagName("body")[0].insertBefore(div,document.getElementsByTagName("body")[0].firstChild);