/**
* SyoTimer v.1.1.0 | under MIT licence
* https://github.com/mrfratello/SyoTimer#readme
*/
!function(e){const t=86400,i=3600,o=60;var n={rus:{second:["секунда","секунды","секунд"],minute:["минута","минуты","минут"],hour:["час","часа","часов"],day:["день","дня","дней"]},eng:{second:["second","seconds"],minute:["minute","minutes"],hour:["hour","hours"],day:["day","days"]}};const r={year:2014,month:7,day:31,hour:0,minute:0,second:0,timeZone:"local",ignoreTransferTime:!1,periodic:!1,periodInterval:7,periodUnit:"d",dayVisible:!0,dubleNumbers:!0,doubleNumbers:!0,effectType:"none",lang:"eng",headTitle:"",footTitle:"",afterDeadline:function(e){e.bodyBlock.html('
The countdown is finished!
')}};var a={init:function(t){var i=e.extend({},r,t||{});return t.hasOwnProperty("dubleNumbers")&&(i.doubleNumbers=t.dubleNumbers),this.each(function(){var t=e(this);t.data("syotimer-options",i),a._render.apply(this,[]),a._perSecondHandler.apply(this,[])})},_render:function(){var t,i=e(this),o=i.data("syotimer-options"),n=o.dayVisible?s.getCellDom("day","0"):"";t=''+o.headTitle+'
'+n+s.getCellDom("hour")+s.getCellDom("minute")+s.getCellDom("second")+'
",i.addClass("syotimer").addClass("timer").html(t);var r=e(".timer-head-block",i),a=e(".timer-body-block",i),d=e(".timer-foot-block",i),l={headBlock:r,bodyBlock:a,footBlock:d};i.data("syotimer-blocks",l)},_perSecondHandler:function(){var t=e(this),i=t.data("syotimer-options");e(".second .tab-val",t).css("opacity",1);var o=new Date,n=new Date(i.year,i.month-1,i.day,i.hour,i.minute,i.second),r=s.getDifferenceWithTimezone(o,n,i),d=s.getSecondsToDeadLine(r,i);d>=0?(a._refreshUnitsDom.apply(this,[d]),a._applyEffectSwitch.apply(this,[i.effectType])):(t=e.extend(t,t.data("syotimer-blocks")),i.afterDeadline(t))},_refreshUnitsDom:function(t){var i=e(this),o=i.data("syotimer-options"),r=["day","hour","minute","second"],a=s.getUnitsToDeadLine(t),d=n[o.lang];o.dayVisible||(a.hour+=24*a.day,r.splice(0,1));for(var l=0;l'+t+'
'},getSecondsToDeadLine:function(e,t){var i,o=e/1e3;if(o=Math.floor(o),t.periodic){var n,r,a=s.getPeriodUnit(t.periodUnit),d=e/(1e3*a);d=Math.ceil(d),d=Math.abs(d),o>=0?(r=d%t.periodInterval,r=0==r?t.periodInterval:r,r-=1):r=t.periodInterval-d%t.periodInterval,n=o%a,0==n&&o<0&&r--,i=Math.abs(r*a+n)}else i=o;return i},getUnitsToDeadLine:function(e){for(var t=["day","hour","minute","second"],i={},o=0;o4&&e%100<20?2:n[e%10<5?e%10:5],t[o];case"eng":return t[1==e?0:1]}}},d={setOption:function(t,i){var o=e(this),n=o.data("syotimer-options");n.hasOwnProperty(t)&&(n[t]=i,o.data("syotimer-options",n))}};e.fn.syotimer=function(t){if("string"==typeof t&&"setOption"===t){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){d[t].apply(this,i)})}return null===t||"object"==typeof t?a.init.apply(this,[t]):void e.error("SyoTimer. Error in call methods: methods is not exist")}}(jQuery);
//# sourceMappingURL=jquery.syotimer.min.js.map