From 2653f6a943a6ed74e2b72246ba8211c5fb699a7f Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 7 Aug 2016 02:17:47 +0200 Subject: restructured ;) --- js/abmahn.js | 197 ++ js/components/accordion.js | 174 -- js/components/accordion.min.js | 2 - js/components/autocomplete.js | 334 ---- js/components/autocomplete.min.js | 2 - js/components/datepicker.js | 3166 ------------------------------ js/components/datepicker.min.js | 3 - js/components/form-password.js | 67 - js/components/form-password.min.js | 2 - js/components/form-select.js | 77 - js/components/form-select.min.js | 2 - js/components/grid-parallax.js | 168 -- js/components/grid-parallax.min.js | 2 - js/components/grid.js | 527 ----- js/components/grid.min.js | 2 - js/components/htmleditor.js | 679 ------- js/components/htmleditor.min.js | 2 - js/components/lightbox.js | 591 ------ js/components/lightbox.min.js | 2 - js/components/nestable.js | 653 ------ js/components/nestable.min.js | 2 - js/components/notify.js | 189 -- js/components/notify.min.js | 2 - js/components/pagination.js | 147 -- js/components/pagination.min.js | 2 - js/components/parallax.js | 462 ----- js/components/parallax.min.js | 2 - js/components/search.js | 92 - js/components/search.min.js | 2 - js/components/slider.js | 540 ----- js/components/slider.min.js | 2 - js/components/slideset.js | 514 ----- js/components/slideset.min.js | 2 - js/components/slideshow-fx.js | 383 ---- js/components/slideshow-fx.min.js | 2 - js/components/slideshow.js | 560 ------ js/components/slideshow.min.js | 2 - js/components/sortable.js | 688 ------- js/components/sortable.min.js | 2 - js/components/sticky.js | 364 ---- js/components/sticky.min.js | 2 - js/components/timepicker.js | 192 -- js/components/timepicker.min.js | 2 - js/components/tooltip.js | 234 --- js/components/tooltip.min.js | 2 - js/components/upload.js | 257 --- js/components/upload.min.js | 2 - js/core/alert.js | 66 - js/core/alert.min.js | 2 - js/core/button.js | 157 -- js/core/button.min.js | 2 - js/core/core.js | 786 -------- js/core/core.min.js | 2 - js/core/cover.js | 95 - js/core/cover.min.js | 2 - js/core/dropdown.js | 525 ----- js/core/dropdown.min.js | 2 - js/core/grid.js | 117 -- js/core/grid.min.js | 2 - js/core/modal.js | 393 ---- js/core/modal.min.js | 2 - js/core/nav.js | 136 -- js/core/nav.min.js | 2 - js/core/offcanvas.js | 180 -- js/core/offcanvas.min.js | 2 - js/core/scrollspy.js | 209 -- js/core/scrollspy.min.js | 2 - js/core/smooth-scroll.js | 62 - js/core/smooth-scroll.min.js | 2 - js/core/switcher.js | 307 --- js/core/switcher.min.js | 2 - js/core/tab.js | 167 -- js/core/tab.min.js | 2 - js/core/toggle.js | 120 -- js/core/toggle.min.js | 2 - js/core/touch.js | 175 -- js/core/touch.min.js | 2 - js/core/utility.js | 319 --- js/core/utility.min.js | 2 - js/pdfmake.min.js | 17 + js/uikit.js | 3814 ------------------------------------ js/uikit.min.js | 3 - js/vfs_fonts.js | 1 + 83 files changed, 215 insertions(+), 18768 deletions(-) create mode 100644 js/abmahn.js delete mode 100755 js/components/accordion.js delete mode 100755 js/components/accordion.min.js delete mode 100755 js/components/autocomplete.js delete mode 100755 js/components/autocomplete.min.js delete mode 100755 js/components/datepicker.js delete mode 100755 js/components/datepicker.min.js delete mode 100755 js/components/form-password.js delete mode 100755 js/components/form-password.min.js delete mode 100755 js/components/form-select.js delete mode 100755 js/components/form-select.min.js delete mode 100755 js/components/grid-parallax.js delete mode 100755 js/components/grid-parallax.min.js delete mode 100755 js/components/grid.js delete mode 100755 js/components/grid.min.js delete mode 100755 js/components/htmleditor.js delete mode 100755 js/components/htmleditor.min.js delete mode 100755 js/components/lightbox.js delete mode 100755 js/components/lightbox.min.js delete mode 100755 js/components/nestable.js delete mode 100755 js/components/nestable.min.js delete mode 100755 js/components/notify.js delete mode 100755 js/components/notify.min.js delete mode 100755 js/components/pagination.js delete mode 100755 js/components/pagination.min.js delete mode 100755 js/components/parallax.js delete mode 100755 js/components/parallax.min.js delete mode 100755 js/components/search.js delete mode 100755 js/components/search.min.js delete mode 100755 js/components/slider.js delete mode 100755 js/components/slider.min.js delete mode 100755 js/components/slideset.js delete mode 100755 js/components/slideset.min.js delete mode 100755 js/components/slideshow-fx.js delete mode 100755 js/components/slideshow-fx.min.js delete mode 100755 js/components/slideshow.js delete mode 100755 js/components/slideshow.min.js delete mode 100755 js/components/sortable.js delete mode 100755 js/components/sortable.min.js delete mode 100755 js/components/sticky.js delete mode 100755 js/components/sticky.min.js delete mode 100755 js/components/timepicker.js delete mode 100755 js/components/timepicker.min.js delete mode 100755 js/components/tooltip.js delete mode 100755 js/components/tooltip.min.js delete mode 100755 js/components/upload.js delete mode 100755 js/components/upload.min.js delete mode 100755 js/core/alert.js delete mode 100755 js/core/alert.min.js delete mode 100755 js/core/button.js delete mode 100755 js/core/button.min.js delete mode 100755 js/core/core.js delete mode 100755 js/core/core.min.js delete mode 100755 js/core/cover.js delete mode 100755 js/core/cover.min.js delete mode 100755 js/core/dropdown.js delete mode 100755 js/core/dropdown.min.js delete mode 100755 js/core/grid.js delete mode 100755 js/core/grid.min.js delete mode 100755 js/core/modal.js delete mode 100755 js/core/modal.min.js delete mode 100755 js/core/nav.js delete mode 100755 js/core/nav.min.js delete mode 100755 js/core/offcanvas.js delete mode 100755 js/core/offcanvas.min.js delete mode 100755 js/core/scrollspy.js delete mode 100755 js/core/scrollspy.min.js delete mode 100755 js/core/smooth-scroll.js delete mode 100755 js/core/smooth-scroll.min.js delete mode 100755 js/core/switcher.js delete mode 100755 js/core/switcher.min.js delete mode 100755 js/core/tab.js delete mode 100755 js/core/tab.min.js delete mode 100755 js/core/toggle.js delete mode 100755 js/core/toggle.min.js delete mode 100755 js/core/touch.js delete mode 100755 js/core/touch.min.js delete mode 100755 js/core/utility.js delete mode 100755 js/core/utility.min.js create mode 100644 js/pdfmake.min.js delete mode 100755 js/uikit.js delete mode 100755 js/uikit.min.js create mode 100644 js/vfs_fonts.js (limited to 'js') diff --git a/js/abmahn.js b/js/abmahn.js new file mode 100644 index 0000000..6864d4f --- /dev/null +++ b/js/abmahn.js @@ -0,0 +1,197 @@ +function getText(input) { + return document.getElementById(input).value || ''; +} + +function getDate(input) { + var date = Date.parse(document.getElementById(input)); + if( !date ) return 'von letzter Woche'; + return 'vom ' + date.toLocaleDateString(); +} + +function setText(input, text) { + document.getElementById(input).value = text; +} + +function step1_cancel() { document.getElementById('wrapper').className = 'wrapper stepcancel'; } +function step1_done() { document.getElementById('wrapper').className = 'wrapper step2'; } +function step2_done() { document.getElementById('wrapper').className = 'wrapper step3'; } +function step3_done() { document.getElementById('wrapper').className = 'wrapper step4'; } +function step4_done() { document.getElementById('wrapper').className = 'wrapper step5'; } +function step5_done() { document.getElementById('wrapper').className = 'wrapper step6'; } +function step6_done() { document.getElementById('wrapper').className = 'wrapper step7'; } + +function waldorff() { + setText('abmahnender_kanzlei', 'Waldorff & Frommer RAe'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'Beethovenstraße 12'); + setText('abmahnender_plz', '80336'); + setText('abmahnender_ort', 'München'); + setText('abmahnender_fax', '089/52 05 72 30'); +} + +function sasse() { + setText('abmahnender_kanzlei', 'Sasse & Partner Rechtsanwälte'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'Neumühlen 17'); + setText('abmahnender_plz', '22763'); + setText('abmahnender_ort', 'Hamburg'); + setText('abmahnender_fax', '040/8222699 11'); +} + +function fareds() { + setText('abmahnender_kanzlei', 'Fareds Rechtsanwaltsgesellschaft mbH'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'Jungfernstieg 40'); + setText('abmahnender_plz', '20354'); + setText('abmahnender_ort', 'Hamburg'); + setText('abmahnender_fax', '040 / 43 20 84 710'); +} + +function rasch() { + setText('abmahnender_kanzlei', 'Rasch Rechtsanwälte'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'An der Alster 6'); + setText('abmahnender_plz', '20099'); + setText('abmahnender_ort', 'Hamburg'); + setText('abmahnender_fax', '040/244 297-20'); +} + +function wesave() { + setText('abmahnender_kanzlei', 'WeSaveYourCopyrights Rechtsanwaltsgesellschaft mbH'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'Walter-Kolb-Straße 9-11'); + setText('abmahnender_plz', '60594'); + setText('abmahnender_ort', 'Frankfurt am Main'); + setText('abmahnender_fax', '069/663 68 41 - 222'); +} + +function schutt() { + setText('abmahnender_kanzlei', 'Schutt, Waetke Rechtsanwälte'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'Kriegsstraße 37'); + setText('abmahnender_plz', '76133'); + setText('abmahnender_ort', 'Karlsruhe'); + setText('abmahnender_fax', '0721/12 05 05'); +} + +function schulenberg() { + setText('abmahnender_kanzlei', 'Schulenberg & Schenk Rechtsanwälte'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', 'Alsterchaussee 25'); + setText('abmahnender_plz', '20149'); + setText('abmahnender_ort', 'Hamburg'); + setText('abmahnender_fax', '040/73440860'); +} + +function sebastian() { + setText('abmahnender_kanzlei', 'Daniel Sebastian Rechtsanwalt'); + setText('abmahnender_bearbeiter', ''); + setText('abmahnender_strasse', ' Storkower Str. 158'); + setText('abmahnender_plz', '10407'); + setText('abmahnender_ort', 'Berlin'); + setText('abmahnender_fax', '030/88 92 20 21'); +} + +function ausfuellen() { + setText('abgemahnter_vorname', 'Max'); + setText('abgemahnter_nachname', 'Mustermann'); + setText('abgemahnter_zusatz', 'c/o beim Nachbarn'); + setText('abgemahnter_strasse', 'Lange Straße 126'); + setText('abgemahnter_plz', '10999') + setText('abgemahnter_ort', 'Berlin'); + + setText('abmahnender_kanzlei', 'Waldorff & Frommer'); + setText('abmahnender_bearbeiter', 'Horst Müller'); + setText('abmahnender_strasse', 'Beethovenstraße 12'); + setText('abmahnender_plz', '80336'); + setText('abmahnender_ort', 'München'); + + setText('vorgang_aktenzeichen', '16P99964sShA'); + setText('vorgang_datum', '10. 6. 2016'); + +} + +function abmahnbeantworter() { + step6_done(); + + var today = new Date(); + var absender = getText('abgemahnter_vorname') + ' ' + getText('abgemahnter_nachname') + ', ' + getText('abgemahnter_strasse') + ' in ' + getText('abgemahnter_plz') + ' ' + getText('abgemahnter_ort'); + var land = getText('abgemahnter_land'); + if(land) { + absender +=', ' + land; + } + + var bearbeiter = getText('abmahnender_bearbeiter'); + var empfaenger = getText('abmahnender_kanzlei'); + if(bearbeiter) { + empfaenger += '\nz. H. ' + bearbeiter; + } + empfaenger += '\n' + getText('abmahnender_strasse'); + empfaenger += '\n' + getText('abmahnender_plz') + ' ' + getText('abmahnender_ort'); + var fax = getText('abmahnender_fax'); + if(fax) { + empfaenger += '\n\n\nPer Fax an: ' + fax; + document.getElementById('faxempfaenger').innerHTML = 'an ' + fax + ' ' + } + + var datums_feld = getText('abgemahnter_ort') + ', ' + today.toLocaleDateString(); + var zeichen = 'Ihr Zeichen ' + getText('vorgang_aktenzeichen'); + + var fliesstext = 'Sehr geehrte Damen und Herren,\n\n'; + + fliesstext += 'ich nehme Bezug auf Ihr Schreiben vom ' + getText('vorgang_datum') + '. Hierzu muss ich Ihnen mitteilen, dass ich den angeblichen Verstoß nicht begangen habe.\n\n'; + + fliesstext += 'Vorsorglich weise ich darauf hin, dass ich ein offenes W-Lan mit einer Vorschaltseite betreibe, das von meinen Nachbarn und meiner Familie mitbenutzt wird.\n\n'; + + fliesstext += 'Ich komme weder als Täter noch als Störer in Betracht.\n\n'; + + var frist = new Date(today.getTime() + 1209600000); + fliesstext += 'Ich fordere Sie daher auf, die Abmahnung umgehend zurückzunehmen. Sollte ich bis zum ' + frist.toLocaleDateString() + ' keine diesbezügliche Nachricht von Ihnen erhalten haben, werde ich mit anwaltlicher Hilfe das Nichtbestehen der Forderung gerichtlich bestätigen lassen.\n\n'; + + fliesstext += 'Mit freundlichen Grüßen'; + var signatur = getText('abgemahnter_nachname'); + + pdfMake.fonts = { + 'Gentium Book Basic': { + normal: 'GenBkBasR.ttf', + bold: 'GenBkBasB.ttf', + italics: 'GenBkBasI.ttf', + bolditalics: 'GenBkBasBI.ttf' + }, + }; + var docDefinition = { + background: { + canvas: [ + { + type: 'line', + x1: 0, y1: 297.6378, + x2: 28.3465, y2: 297.6378, + lineWidth: 0.25, + lineColor: 'grey', + }, + { + type: 'line', + x1: 0, y1: 595.276, + x2: 28.3465, y2: 595.276, + lineWidth: 0.25, + lineColor: 'grey', + }, + ] + }, + content: [ + { text: absender, fontSize: 7, absolutePosition: { x: 62.3622, y: 153.071 } }, + { text: empfaenger, fontSize: 11, absolutePosition: { x: 62.3622, y: 181.417 } }, + { text: zeichen, bold: true, absolutePosition: { x: 62.3622, y: 270+40 } }, + { text: datums_feld, alignment: 'right', margin: [ 62.3622 - 40.0, 270, 62.3622, 0 ] }, + { text: fliesstext, margin: [ 62.3622 - 40.0, 30, 62.3622, 0 ] }, + { text: signatur, margin: [ 40, 27, 0, 0 ] }, + ], + pageSize: 'A4', + defaultStyle: { + font: 'Gentium Book Basic', + fontSize: 12, + } + } + pdfMake.createPdf(docDefinition).download('Abmahnung-' + getText('vorgang_aktenzeichen') + '.pdf'); + +} diff --git a/js/components/accordion.js b/js/components/accordion.js deleted file mode 100755 index 2401780..0000000 --- a/js/components/accordion.js +++ /dev/null @@ -1,174 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-accordion", ["uikit"], function(){ - return component || addon(UIkit); - }); - } -})(function(UI){ - - "use strict"; - - UI.component('accordion', { - - defaults: { - showfirst : true, - collapse : true, - animate : true, - easing : 'swing', - duration : 300, - toggle : '.uk-accordion-title', - containers : '.uk-accordion-content', - clsactive : 'uk-active' - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - setTimeout(function(){ - - UI.$("[data-uk-accordion]", context).each(function(){ - - var ele = UI.$(this); - - if(!ele.data("accordion")) { - UI.accordion(ele, UI.Utils.options(ele.attr('data-uk-accordion'))); - } - }); - - }, 0); - }); - }, - - init: function() { - - var $this = this; - - this.element.on('click.uk.accordion', this.options.toggle, function(e) { - - e.preventDefault(); - - $this.toggleItem(UI.$(this).data('wrapper'), $this.options.animate, $this.options.collapse); - }); - - this.update(); - - if (this.options.showfirst) { - this.toggleItem(this.toggle.eq(0).data('wrapper'), false, false); - } - }, - - toggleItem: function(wrapper, animated, collapse) { - - var $this = this; - - wrapper.data('toggle').toggleClass(this.options.clsactive); - wrapper.data('content').toggleClass(this.options.clsactive); - - var active = wrapper.data('toggle').hasClass(this.options.clsactive); - - if (collapse) { - this.toggle.not(wrapper.data('toggle')).removeClass(this.options.clsactive); - this.content.not(wrapper.data('content')).removeClass(this.options.clsactive) - .parent().stop().css('overflow', 'hidden').animate({ height: 0 }, {easing: this.options.easing, duration: animated ? this.options.duration : 0}).attr('aria-expanded', 'false'); - } - - wrapper.stop().css('overflow', 'hidden'); - - if (animated) { - - wrapper.animate({ height: active ? getHeight(wrapper.data('content')) : 0 }, {easing: this.options.easing, duration: this.options.duration, complete: function() { - - if (active) { - wrapper.css({'overflow': '', 'height': 'auto'}); - UI.Utils.checkDisplay(wrapper.data('content')); - } - - $this.trigger('display.uk.check'); - }}); - - } else { - - wrapper.height(active ? 'auto' : 0); - - if (active) { - wrapper.css({'overflow': ''}); - UI.Utils.checkDisplay(wrapper.data('content')); - } - - this.trigger('display.uk.check'); - } - - // Update ARIA - wrapper.attr('aria-expanded', active); - - this.element.trigger('toggle.uk.accordion', [active, wrapper.data('toggle'), wrapper.data('content')]); - }, - - update: function() { - - var $this = this, $content, $wrapper, $toggle; - - this.toggle = this.find(this.options.toggle); - this.content = this.find(this.options.containers); - - this.content.each(function(index) { - - $content = UI.$(this); - - if ($content.parent().data('wrapper')) { - $wrapper = $content.parent(); - } else { - $wrapper = UI.$(this).wrap('
').parent(); - - // Init ARIA - $wrapper.attr('aria-expanded', 'false'); - } - - $toggle = $this.toggle.eq(index); - - $wrapper.data('toggle', $toggle); - $wrapper.data('content', $content); - $toggle.data('wrapper', $wrapper); - $content.data('wrapper', $wrapper); - }); - - this.element.trigger('update.uk.accordion', [this]); - } - - }); - - // helper - - function getHeight(ele) { - - var $ele = UI.$(ele), height = "auto"; - - if ($ele.is(":visible")) { - height = $ele.outerHeight(); - } else { - - var tmp = { - position : $ele.css("position"), - visibility : $ele.css("visibility"), - display : $ele.css("display") - }; - - height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); - - $ele.css(tmp); // reset element - } - - return height; - } - - return UI.accordion; -}); diff --git a/js/components/accordion.min.js b/js/components/accordion.min.js deleted file mode 100755 index ca3e452..0000000 --- a/js/components/accordion.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-accordion",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(i){var o=t.$(i),e="auto";if(o.is(":visible"))e=o.outerHeight();else{var a={position:o.css("position"),visibility:o.css("visibility"),display:o.css("display")};e=o.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),o.css(a)}return e}return t.component("accordion",{defaults:{showfirst:!0,collapse:!0,animate:!0,easing:"swing",duration:300,toggle:".uk-accordion-title",containers:".uk-accordion-content",clsactive:"uk-active"},boot:function(){t.ready(function(i){setTimeout(function(){t.$("[data-uk-accordion]",i).each(function(){var i=t.$(this);i.data("accordion")||t.accordion(i,t.Utils.options(i.attr("data-uk-accordion")))})},0)})},init:function(){var i=this;this.element.on("click.uk.accordion",this.options.toggle,function(o){o.preventDefault(),i.toggleItem(t.$(this).data("wrapper"),i.options.animate,i.options.collapse)}),this.update(),this.options.showfirst&&this.toggleItem(this.toggle.eq(0).data("wrapper"),!1,!1)},toggleItem:function(o,e,a){var n=this;o.data("toggle").toggleClass(this.options.clsactive),o.data("content").toggleClass(this.options.clsactive);var s=o.data("toggle").hasClass(this.options.clsactive);a&&(this.toggle.not(o.data("toggle")).removeClass(this.options.clsactive),this.content.not(o.data("content")).removeClass(this.options.clsactive).parent().stop().css("overflow","hidden").animate({height:0},{easing:this.options.easing,duration:e?this.options.duration:0}).attr("aria-expanded","false")),o.stop().css("overflow","hidden"),e?o.animate({height:s?i(o.data("content")):0},{easing:this.options.easing,duration:this.options.duration,complete:function(){s&&(o.css({overflow:"",height:"auto"}),t.Utils.checkDisplay(o.data("content"))),n.trigger("display.uk.check")}}):(o.height(s?"auto":0),s&&(o.css({overflow:""}),t.Utils.checkDisplay(o.data("content"))),this.trigger("display.uk.check")),o.attr("aria-expanded",s),this.element.trigger("toggle.uk.accordion",[s,o.data("toggle"),o.data("content")])},update:function(){var i,o,e,a=this;this.toggle=this.find(this.options.toggle),this.content=this.find(this.options.containers),this.content.each(function(n){i=t.$(this),i.parent().data("wrapper")?o=i.parent():(o=t.$(this).wrap('
').parent(),o.attr("aria-expanded","false")),e=a.toggle.eq(n),o.data("toggle",e),o.data("content",i),e.data("wrapper",o),i.data("wrapper",o)}),this.element.trigger("update.uk.accordion",[this])}}),t.accordion}); \ No newline at end of file diff --git a/js/components/autocomplete.js b/js/components/autocomplete.js deleted file mode 100755 index 58a405d..0000000 --- a/js/components/autocomplete.js +++ /dev/null @@ -1,334 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-autocomplete", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - var active; - - UI.component('autocomplete', { - - defaults: { - minLength: 3, - param: 'search', - method: 'post', - delay: 300, - loadingClass: 'uk-loading', - flipDropdown: false, - skipClass: 'uk-skip', - hoverClass: 'uk-active', - source: null, - renderer: null, - - // template - - template: '' - }, - - visible : false, - value : null, - selected : null, - - boot: function() { - - // init code - UI.$html.on("focus.autocomplete.uikit", "[data-uk-autocomplete]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("autocomplete")) { - UI.autocomplete(ele, UI.Utils.options(ele.attr("data-uk-autocomplete"))); - } - }); - - // register outer click for autocompletes - UI.$html.on("click.autocomplete.uikit", function(e) { - if (active && e.target!=active.input[0]) active.hide(); - }); - }, - - init: function() { - - var $this = this, - select = false, - trigger = UI.Utils.debounce(function(e) { - if(select) { - return (select = false); - } - $this.handle(); - }, this.options.delay); - - - this.dropdown = this.find('.uk-dropdown'); - this.template = this.find('script[type="text/autocomplete"]').html(); - this.template = UI.Utils.template(this.template || this.options.template); - this.input = this.find("input:first").attr("autocomplete", "off"); - - if (!this.dropdown.length) { - this.dropdown = UI.$('
').appendTo(this.element); - } - - if (this.options.flipDropdown) { - this.dropdown.addClass('uk-dropdown-flip'); - } - - this.dropdown.attr('aria-expanded', 'false'); - - this.input.on({ - "keydown": function(e) { - - if (e && e.which && !e.shiftKey) { - - switch (e.which) { - case 13: // enter - select = true; - - if ($this.selected) { - e.preventDefault(); - $this.select(); - } - break; - case 38: // up - e.preventDefault(); - $this.pick('prev', true); - break; - case 40: // down - e.preventDefault(); - $this.pick('next', true); - break; - case 27: - case 9: // esc, tab - $this.hide(); - break; - default: - break; - } - } - - }, - "keyup": trigger - }); - - this.dropdown.on("click", ".uk-autocomplete-results > *", function(){ - $this.select(); - }); - - this.dropdown.on("mouseover", ".uk-autocomplete-results > *", function(){ - $this.pick(UI.$(this)); - }); - - this.triggercomplete = trigger; - }, - - handle: function() { - - var $this = this, old = this.value; - - this.value = this.input.val(); - - if (this.value.length < this.options.minLength) return this.hide(); - - if (this.value != old) { - $this.request(); - } - - return this; - }, - - pick: function(item, scrollinview) { - - var $this = this, - items = UI.$(this.dropdown.find('.uk-autocomplete-results').children(':not(.'+this.options.skipClass+')')), - selected = false; - - if (typeof item !== "string" && !item.hasClass(this.options.skipClass)) { - selected = item; - } else if (item == 'next' || item == 'prev') { - - if (this.selected) { - var index = items.index(this.selected); - - if (item == 'next') { - selected = items.eq(index + 1 < items.length ? index + 1 : 0); - } else { - selected = items.eq(index - 1 < 0 ? items.length - 1 : index - 1); - } - - } else { - selected = items[(item == 'next') ? 'first' : 'last'](); - } - - selected = UI.$(selected); - } - - if (selected && selected.length) { - this.selected = selected; - items.removeClass(this.options.hoverClass); - this.selected.addClass(this.options.hoverClass); - - // jump to selected if not in view - if (scrollinview) { - - var top = selected.position().top, - scrollTop = $this.dropdown.scrollTop(), - dpheight = $this.dropdown.height(); - - if (top > dpheight || top < 0) { - $this.dropdown.scrollTop(scrollTop + top); - } - } - } - }, - - select: function() { - - if(!this.selected) return; - - var data = this.selected.data(); - - this.trigger("selectitem.uk.autocomplete", [data, this]); - - if (data.value) { - this.input.val(data.value).trigger('change'); - } - - this.hide(); - }, - - show: function() { - if (this.visible) return; - this.visible = true; - this.element.addClass("uk-open"); - - if (active && active!==this) { - active.hide(); - } - - active = this; - - // Update aria - this.dropdown.attr('aria-expanded', 'true'); - - return this; - }, - - hide: function() { - if (!this.visible) return; - this.visible = false; - this.element.removeClass("uk-open"); - - if (active === this) { - active = false; - } - - // Update aria - this.dropdown.attr('aria-expanded', 'false'); - - return this; - }, - - request: function() { - - var $this = this, - release = function(data) { - - if(data) { - $this.render(data); - } - - $this.element.removeClass($this.options.loadingClass); - }; - - this.element.addClass(this.options.loadingClass); - - if (this.options.source) { - - var source = this.options.source; - - switch(typeof(this.options.source)) { - case 'function': - - this.options.source.apply(this, [release]); - - break; - - case 'object': - - if(source.length) { - - var items = []; - - source.forEach(function(item){ - if(item.value && item.value.toLowerCase().indexOf($this.value.toLowerCase())!=-1) { - items.push(item); - } - }); - - release(items); - } - - break; - - case 'string': - - var params ={}; - - params[this.options.param] = this.value; - - UI.$.ajax({ - url: this.options.source, - data: params, - type: this.options.method, - dataType: 'json' - }).done(function(json) { - release(json || []); - }); - - break; - - default: - release(null); - } - - } else { - this.element.removeClass($this.options.loadingClass); - } - }, - - render: function(data) { - - this.dropdown.empty(); - - this.selected = false; - - if (this.options.renderer) { - - this.options.renderer.apply(this, [data]); - - } else if(data && data.length) { - - this.dropdown.append(this.template({"items":data})); - this.show(); - - this.trigger('show.uk.autocomplete'); - } - - return this; - } - }); - - return UI.autocomplete; -}); diff --git a/js/components/autocomplete.min.js b/js/components/autocomplete.min.js deleted file mode 100755 index 10eed9a..0000000 --- a/js/components/autocomplete.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e;return t.component("autocomplete",{defaults:{minLength:3,param:"search",method:"post",delay:300,loadingClass:"uk-loading",flipDropdown:!1,skipClass:"uk-skip",hoverClass:"uk-active",source:null,renderer:null,template:''},visible:!1,value:null,selected:null,boot:function(){t.$html.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(){var e=t.$(this);e.data("autocomplete")||t.autocomplete(e,t.Utils.options(e.attr("data-uk-autocomplete")))}),t.$html.on("click.autocomplete.uikit",function(t){e&&t.target!=e.input[0]&&e.hide()})},init:function(){var e=this,i=!1,s=t.Utils.debounce(function(){return i?i=!1:(e.handle(),void 0)},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=t.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=t.$('
').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.dropdown.attr("aria-expanded","false"),this.input.on({keydown:function(t){if(t&&t.which&&!t.shiftKey)switch(t.which){case 13:i=!0,e.selected&&(t.preventDefault(),e.select());break;case 38:t.preventDefault(),e.pick("prev",!0);break;case 40:t.preventDefault(),e.pick("next",!0);break;case 27:case 9:e.hide()}},keyup:s}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){e.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){e.pick(t.$(this))}),this.triggercomplete=s},handle:function(){var t=this,e=this.value;return this.value=this.input.val(),this.value.lengtha-1?o.length-1:a-1)}else n=o["next"==e?"first":"last"]();n=t.$(n)}}else n=e;if(n&&n.length&&(this.selected=n,o.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),i)){var l=n.position().top,h=s.dropdown.scrollTop(),r=s.dropdown.height();(l>r||0>l)&&s.dropdown.scrollTop(h+l)}},select:function(){if(this.selected){var t=this.selected.data();this.trigger("selectitem.uk.autocomplete",[t,this]),t.value&&this.input.val(t.value).trigger("change"),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),e&&e!==this&&e.hide(),e=this,this.dropdown.attr("aria-expanded","true"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),e===this&&(e=!1),this.dropdown.attr("aria-expanded","false"),this):void 0},request:function(){var e=this,i=function(t){t&&e.render(t),e.element.removeClass(e.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var s=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[i]);break;case"object":if(s.length){var o=[];s.forEach(function(t){t.value&&-1!=t.value.toLowerCase().indexOf(e.value.toLowerCase())&&o.push(t)}),i(o)}break;case"string":var n={};n[this.options.param]=this.value,t.$.ajax({url:this.options.source,data:n,type:this.options.method,dataType:"json"}).done(function(t){i(t||[])});break;default:i(null)}}else this.element.removeClass(e.options.loadingClass)},render:function(t){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[t]):t&&t.length&&(this.dropdown.append(this.template({items:t})),this.show(),this.trigger("show.uk.autocomplete")),this}}),t.autocomplete}); \ No newline at end of file diff --git a/js/components/datepicker.js b/js/components/datepicker.js deleted file mode 100755 index 31890b4..0000000 --- a/js/components/datepicker.js +++ /dev/null @@ -1,3166 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-datepicker", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - // Datepicker - - var active = false, dropdown, moment; - - UI.component('datepicker', { - - defaults: { - mobile: false, - weekstart: 1, - i18n: { - months : ['January','February','March','April','May','June','July','August','September','October','November','December'], - weekdays : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] - }, - format: "YYYY-MM-DD", - offsettop: 5, - maxDate: false, - minDate: false, - pos: 'auto', - template: function(data, opts) { - - var content = '', i; - - content += '
'; - content += ''; - content += ''; - - if (UI.formSelect) { - - var currentyear = (new Date()).getFullYear(), options = [], months, years, minYear, maxYear; - - for (i=0;i'+opts.i18n.months[i]+''); - } else { - options.push(''); - } - } - - months = ''+ opts.i18n.months[data.month] + ''; - - // -- - - options = []; - - minYear = data.minDate ? data.minDate.year() : currentyear - 50; - maxYear = data.maxDate ? data.maxDate.year() : currentyear + 20; - - for (i=minYear;i<=maxYear;i++) { - if (i == data.year) { - options.push(''); - } else { - options.push(''); - } - } - - years = ''+ data.year + ''; - - content += '
'+ months + ' ' + years +'
'; - - } else { - content += '
'+ opts.i18n.months[data.month] +' '+ data.year+'
'; - } - - content += '
'; - - content += ''; - content += ''; - for(i = 0; i < data.weekdays.length; i++) { - if (data.weekdays[i]) { - content += ''; - } - } - content += ''; - - content += ''; - for(i = 0; i < data.days.length; i++) { - if (data.days[i] && data.days[i].length){ - content += ''; - for(var d = 0; d < data.days[i].length; d++) { - if (data.days[i][d]) { - var day = data.days[i][d], - cls = []; - - if(!day.inmonth) cls.push("uk-datepicker-table-muted"); - if(day.selected) cls.push("uk-active"); - if(day.disabled) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted'); - - content += ''; - } - } - content += ''; - } - } - content += ''; - - content += '
'+data.weekdays[i]+'
'+day.day.format("D")+'
'; - - return content; - } - }, - - boot: function() { - - UI.$win.on("resize orientationchange", function() { - - if (active) { - active.hide(); - } - }); - - // init code - UI.$html.on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("datepicker")) { - e.preventDefault(); - UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker"))); - ele.trigger("focus"); - } - }); - - UI.$html.on("click focus", '*', function(e) { - - var target = UI.$(e.target); - - if (active && target[0] != dropdown[0] && !target.data("datepicker") && !target.parents(".uk-datepicker:first").length) { - active.hide(); - } - }); - }, - - init: function() { - - // use native datepicker on touch devices - if (UI.support.touch && this.element.attr('type')=='date' && !this.options.mobile) { - return; - } - - var $this = this; - - this.current = this.element.val() ? moment(this.element.val(), this.options.format) : moment(); - - this.on("click focus", function(){ - if (active!==$this) $this.pick(this.value ? this.value:($this.options.minDate ? $this.options.minDate :'')); - }).on("change", function(){ - - if ($this.element.val() && !moment($this.element.val(), $this.options.format).isValid()) { - $this.element.val(moment().format($this.options.format)); - } - }); - - // init dropdown - if (!dropdown) { - - dropdown = UI.$('
'); - - dropdown.on("click", ".uk-datepicker-next, .uk-datepicker-previous, [data-date]", function(e){ - - e.stopPropagation(); - e.preventDefault(); - - var ele = UI.$(this); - - if (ele.hasClass('uk-datepicker-date-disabled')) return false; - - if (ele.is('[data-date]')) { - active.current = moment(ele.data("date")); - active.element.val(active.current.isValid() ? active.current.format(active.options.format) : null).trigger("change"); - active.hide(); - } else { - active.add((ele.hasClass("uk-datepicker-next") ? 1:-1), "months"); - } - }); - - dropdown.on('change', '.update-picker-month, .update-picker-year', function(){ - - var select = UI.$(this); - active[select.is('.update-picker-year') ? 'setYear':'setMonth'](Number(select.val())); - }); - - dropdown.appendTo("body"); - } - }, - - pick: function(initdate) { - - var offset = this.element.offset(), - css = {"left": offset.left, "right":""}; - - this.current = isNaN(initdate) ? moment(initdate, this.options.format):moment(); - this.initdate = this.current.format("YYYY-MM-DD"); - - this.update(); - - if (UI.langdirection == 'right') { - css.right = window.innerWidth - (css.left + this.element.outerWidth()); - css.left = ""; - } - - var posTop = (offset.top - this.element.outerHeight() + this.element.height()) - this.options.offsettop - dropdown.outerHeight(), - posBottom = offset.top + this.element.outerHeight() + this.options.offsettop; - - css.top = posBottom; - - if (this.options.pos == 'top') { - css.top = posTop; - } else if(this.options.pos == 'auto' && (window.innerHeight - posBottom - dropdown.outerHeight() < 0 && posTop >= 0) ) { - css.top = posTop; - } - - dropdown.css(css).show(); - this.trigger('show.uk.datepicker'); - - active = this; - }, - - add: function(unit, value) { - this.current.add(unit, value); - this.update(); - }, - - setMonth: function(month) { - this.current.month(month); - this.update(); - }, - - setYear: function(year) { - this.current.year(year); - this.update(); - }, - - update: function() { - - var data = this.getRows(this.current.year(), this.current.month()), - tpl = this.options.template(data, this.options); - - dropdown.html(tpl); - - this.trigger('update.uk.datepicker'); - }, - - getRows: function(year, month) { - - var opts = this.options, - now = moment().format('YYYY-MM-DD'), - days = [31, (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month], - before = new Date(year, month, 1, 12).getDay(), - data = {"month":month, "year":year,"weekdays":[],"days":[], "maxDate": false, "minDate": false}, - row = []; - - if (opts.maxDate!==false){ - data.maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format) : moment().add(opts.maxDate, 'days'); - } - - if (opts.minDate!==false){ - data.minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format) : moment().add(opts.minDate-1, 'days'); - } - - data.weekdays = (function(){ - - for (var i=0, arr=[]; i < 7; i++) { - - var day = i + (opts.weekstart || 0); - - while (day >= 7) { - day -= 7; - } - - arr.push(opts.i18n.weekdays[day]); - } - - return arr; - })(); - - if (opts.weekstart && opts.weekstart > 0) { - before -= opts.weekstart; - if (before < 0) { - before += 7; - } - } - - var cells = days + before, after = cells; - - while(after > 7) { after -= 7; } - - cells += 7 - after; - - var day, isDisabled, isSelected, isToday, isInMonth; - - for (var i = 0, r = 0; i < cells; i++) { - - day = new Date(year, month, 1 + (i - before), 12); - isDisabled = (data.minDate && data.minDate > day) || (data.maxDate && day > data.maxDate); - isInMonth = !(i < before || i >= (days + before)); - - day = moment(day); - - isSelected = this.initdate == day.format("YYYY-MM-DD"); - isToday = now == day.format("YYYY-MM-DD"); - - row.push({"selected": isSelected, "today": isToday, "disabled": isDisabled, "day":day, "inmonth":isInMonth}); - - if (++r === 7) { - data.days.push(row); - row = []; - r = 0; - } - } - - return data; - }, - - hide: function() { - - if (active && active === this) { - dropdown.hide(); - active = false; - - this.trigger('hide.uk.datepicker'); - } - } - }); - - //! moment.js - //! version : 2.8.3 - //! authors : Tim Wood, Iskren Chernev, Moment.js contributors - //! license : MIT - //! momentjs.com - - moment = (function (undefined) { - /************************************ - Constants - ************************************/ - var moment, - VERSION = '2.8.3', - // the global-scope this is NOT the global object in Node.js - globalScope = typeof global !== 'undefined' ? global : this, - oldGlobalMoment, - round = Math.round, - hasOwnProperty = Object.prototype.hasOwnProperty, - i, - - YEAR = 0, - MONTH = 1, - DATE = 2, - HOUR = 3, - MINUTE = 4, - SECOND = 5, - MILLISECOND = 6, - - // internal storage for locale config files - locales = {}, - - // extra moment internal properties (plugins register props here) - momentProperties = [], - - // check for nodeJS - hasModule = (typeof module !== 'undefined' && module.exports), - - // ASP.NET json date format regex - aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, - aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, - - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, - - // format tokens - formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, - - // parsing token regexes - parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 - parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 - parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 - parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999 - parseTokenDigits = /\d+/, // nonzero number of digits - parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. - parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z - parseTokenT = /T/i, // T (ISO separator) - parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 - parseTokenOrdinal = /\d{1,2}/, - - //strict parsing regexes - parseTokenOneDigit = /\d/, // 0 - 9 - parseTokenTwoDigits = /\d\d/, // 00 - 99 - parseTokenThreeDigits = /\d{3}/, // 000 - 999 - parseTokenFourDigits = /\d{4}/, // 0000 - 9999 - parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 - parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf - - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, - - isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', - - isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] - ], - - // iso time formats and regexes - isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] - ], - - // timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-15', '30'] - parseTimezoneChunker = /([\+\-]|\d\d)/gi, - - // getter and setter names - proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), - unitMillisecondFactors = { - 'Milliseconds' : 1, - 'Seconds' : 1e3, - 'Minutes' : 6e4, - 'Hours' : 36e5, - 'Days' : 864e5, - 'Months' : 2592e6, - 'Years' : 31536e6 - }, - - unitAliases = { - ms : 'millisecond', - s : 'second', - m : 'minute', - h : 'hour', - d : 'day', - D : 'date', - w : 'week', - W : 'isoWeek', - M : 'month', - Q : 'quarter', - y : 'year', - DDD : 'dayOfYear', - e : 'weekday', - E : 'isoWeekday', - gg: 'weekYear', - GG: 'isoWeekYear' - }, - - camelFunctions = { - dayofyear : 'dayOfYear', - isoweekday : 'isoWeekday', - isoweek : 'isoWeek', - weekyear : 'weekYear', - isoweekyear : 'isoWeekYear' - }, - - // format function strings - formatFunctions = {}, - - // default relative time thresholds - relativeTimeThresholds = { - s: 45, // seconds to minute - m: 45, // minutes to hour - h: 22, // hours to day - d: 26, // days to month - M: 11 // months to year - }, - - // tokens to ordinalize and pad - ordinalizeTokens = 'DDD w W M D d'.split(' '), - paddedTokens = 'M D H h m s w W'.split(' '), - - formatTokenFunctions = { - M : function () { - return this.month() + 1; - }, - MMM : function (format) { - return this.localeData().monthsShort(this, format); - }, - MMMM : function (format) { - return this.localeData().months(this, format); - }, - D : function () { - return this.date(); - }, - DDD : function () { - return this.dayOfYear(); - }, - d : function () { - return this.day(); - }, - dd : function (format) { - return this.localeData().weekdaysMin(this, format); - }, - ddd : function (format) { - return this.localeData().weekdaysShort(this, format); - }, - dddd : function (format) { - return this.localeData().weekdays(this, format); - }, - w : function () { - return this.week(); - }, - W : function () { - return this.isoWeek(); - }, - YY : function () { - return leftZeroFill(this.year() % 100, 2); - }, - YYYY : function () { - return leftZeroFill(this.year(), 4); - }, - YYYYY : function () { - return leftZeroFill(this.year(), 5); - }, - YYYYYY : function () { - var y = this.year(), sign = y >= 0 ? '+' : '-'; - return sign + leftZeroFill(Math.abs(y), 6); - }, - gg : function () { - return leftZeroFill(this.weekYear() % 100, 2); - }, - gggg : function () { - return leftZeroFill(this.weekYear(), 4); - }, - ggggg : function () { - return leftZeroFill(this.weekYear(), 5); - }, - GG : function () { - return leftZeroFill(this.isoWeekYear() % 100, 2); - }, - GGGG : function () { - return leftZeroFill(this.isoWeekYear(), 4); - }, - GGGGG : function () { - return leftZeroFill(this.isoWeekYear(), 5); - }, - e : function () { - return this.weekday(); - }, - E : function () { - return this.isoWeekday(); - }, - a : function () { - return this.localeData().meridiem(this.hours(), this.minutes(), true); - }, - A : function () { - return this.localeData().meridiem(this.hours(), this.minutes(), false); - }, - H : function () { - return this.hours(); - }, - h : function () { - return this.hours() % 12 || 12; - }, - m : function () { - return this.minutes(); - }, - s : function () { - return this.seconds(); - }, - S : function () { - return toInt(this.milliseconds() / 100); - }, - SS : function () { - return leftZeroFill(toInt(this.milliseconds() / 10), 2); - }, - SSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - SSSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - Z : function () { - var a = -this.zone(), - b = '+'; - if (a < 0) { - a = -a; - b = '-'; - } - return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2); - }, - ZZ : function () { - var a = -this.zone(), - b = '+'; - if (a < 0) { - a = -a; - b = '-'; - } - return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2); - }, - z : function () { - return this.zoneAbbr(); - }, - zz : function () { - return this.zoneName(); - }, - X : function () { - return this.unix(); - }, - Q : function () { - return this.quarter(); - } - }, - - deprecations = {}, - - lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin']; - - // Pick the first defined of two or three arguments. dfl comes from - // default. - function dfl(a, b, c) { - switch (arguments.length) { - case 2: return a != null ? a : b; - case 3: return a != null ? a : b != null ? b : c; - default: throw new Error('Implement me'); - } - } - - function hasOwnProp(a, b) { - return hasOwnProperty.call(a, b); - } - - function defaultParsingFlags() { - // We need to deep clone this object, and es5 standard is not very - // helpful. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso: false - }; - } - - function printMsg(msg) { - if (moment.suppressDeprecationWarnings === false && - typeof console !== 'undefined' && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } - - function deprecate(msg, fn) { - var firstTime = true; - return extend(function () { - if (firstTime) { - printMsg(msg); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - function deprecateSimple(name, msg) { - if (!deprecations[name]) { - printMsg(msg); - deprecations[name] = true; - } - } - - function padToken(func, count) { - return function (a) { - return leftZeroFill(func.call(this, a), count); - }; - } - function ordinalizeToken(func, period) { - return function (a) { - return this.localeData().ordinal(func.call(this, a), period); - }; - } - - while (ordinalizeTokens.length) { - i = ordinalizeTokens.pop(); - formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); - } - while (paddedTokens.length) { - i = paddedTokens.pop(); - formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); - } - formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); - - - /************************************ - Constructors - ************************************/ - - function Locale() { - } - - // Moment prototype object - function Moment(config, skipOverflow) { - if (skipOverflow !== false) { - checkOverflow(config); - } - copyConfig(this, config); - this._d = new Date(+config._d); - } - - // Duration Constructor - function Duration(duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - quarters * 3 + - years * 12; - - this._data = {}; - - this._locale = moment.localeData(); - - this._bubble(); - } - - /************************************ - Helpers - ************************************/ - - - function extend(a, b) { - for (var i in b) { - if (hasOwnProp(b, i)) { - a[i] = b[i]; - } - } - - if (hasOwnProp(b, 'toString')) { - a.toString = b.toString; - } - - if (hasOwnProp(b, 'valueOf')) { - a.valueOf = b.valueOf; - } - - return a; - } - - function copyConfig(to, from) { - var i, prop, val; - - if (typeof from._isAMomentObject !== 'undefined') { - to._isAMomentObject = from._isAMomentObject; - } - if (typeof from._i !== 'undefined') { - to._i = from._i; - } - if (typeof from._f !== 'undefined') { - to._f = from._f; - } - if (typeof from._l !== 'undefined') { - to._l = from._l; - } - if (typeof from._strict !== 'undefined') { - to._strict = from._strict; - } - if (typeof from._tzm !== 'undefined') { - to._tzm = from._tzm; - } - if (typeof from._isUTC !== 'undefined') { - to._isUTC = from._isUTC; - } - if (typeof from._offset !== 'undefined') { - to._offset = from._offset; - } - if (typeof from._pf !== 'undefined') { - to._pf = from._pf; - } - if (typeof from._locale !== 'undefined') { - to._locale = from._locale; - } - - if (momentProperties.length > 0) { - for (i in momentProperties) { - prop = momentProperties[i]; - val = from[prop]; - if (typeof val !== 'undefined') { - to[prop] = val; - } - } - } - - return to; - } - - function absRound(number) { - if (number < 0) { - return Math.ceil(number); - } else { - return Math.floor(number); - } - } - - // left zero fill a number - // see http://jsperf.com/left-zero-filling for performance comparison - function leftZeroFill(number, targetLength, forceSign) { - var output = '' + Math.abs(number), - sign = number >= 0; - - while (output.length < targetLength) { - output = '0' + output; - } - return (sign ? (forceSign ? '+' : '') : '-') + output; - } - - function positiveMomentsDifference(base, other) { - var res = {milliseconds: 0, months: 0}; - - res.months = other.month() - base.month() + - (other.year() - base.year()) * 12; - if (base.clone().add(res.months, 'M').isAfter(other)) { - --res.months; - } - - res.milliseconds = +other - +(base.clone().add(res.months, 'M')); - - return res; - } - - function momentsDifference(base, other) { - var res; - other = makeAs(other, base); - if (base.isBefore(other)) { - res = positiveMomentsDifference(base, other); - } else { - res = positiveMomentsDifference(other, base); - res.milliseconds = -res.milliseconds; - res.months = -res.months; - } - - return res; - } - - // TODO: remove 'name' arg after deprecation is removed - function createAdder(direction, name) { - return function (val, period) { - var dur, tmp; - //invert the arguments, but complain about it - if (period !== null && !isNaN(+period)) { - deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).'); - tmp = val; val = period; period = tmp; - } - - val = typeof val === 'string' ? +val : val; - dur = moment.duration(val, period); - addOrSubtractDurationFromMoment(this, dur, direction); - return this; - }; - } - - function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; - updateOffset = updateOffset == null ? true : updateOffset; - - if (milliseconds) { - mom._d.setTime(+mom._d + milliseconds * isAdding); - } - if (days) { - rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding); - } - if (months) { - rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding); - } - if (updateOffset) { - moment.updateOffset(mom, days || months); - } - } - - // check if is an array - function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; - } - - function isDate(input) { - return Object.prototype.toString.call(input) === '[object Date]' || - input instanceof Date; - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } - - function normalizeUnits(units) { - if (units) { - var lowered = units.toLowerCase().replace(/(.)s$/, '$1'); - units = unitAliases[units] || camelFunctions[lowered] || lowered; - } - return units; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (hasOwnProp(inputObject, prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - function makeList(field) { - var count, setter; - - if (field.indexOf('week') === 0) { - count = 7; - setter = 'day'; - } - else if (field.indexOf('month') === 0) { - count = 12; - setter = 'month'; - } - else { - return; - } - - moment[field] = function (format, index) { - var i, getter, - method = moment._locale[field], - results = []; - - if (typeof format === 'number') { - index = format; - format = undefined; - } - - getter = function (i) { - var m = moment().utc().set(setter, i); - return method.call(moment._locale, m, format || ''); - }; - - if (index != null) { - return getter(index); - } - else { - for (i = 0; i < count; i++) { - results.push(getter(i)); - } - return results; - } - }; - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - if (coercedNumber >= 0) { - value = Math.floor(coercedNumber); - } else { - value = Math.ceil(coercedNumber); - } - } - - return value; - } - - function daysInMonth(year, month) { - return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); - } - - function weeksInYear(year, dow, doy) { - return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week; - } - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - - function checkOverflow(m) { - var overflow; - if (m._a && m._pf.overflow === -2) { - overflow = - m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : - m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : - m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : - m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : - m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : - m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : - -1; - - if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - - m._pf.overflow = overflow; - } - } - - function isValid(m) { - if (m._isValid == null) { - m._isValid = !isNaN(m._d.getTime()) && - m._pf.overflow < 0 && - !m._pf.empty && - !m._pf.invalidMonth && - !m._pf.nullInput && - !m._pf.invalidFormat && - !m._pf.userInvalidated; - - if (m._strict) { - m._isValid = m._isValid && - m._pf.charsLeftOver === 0 && - m._pf.unusedTokens.length === 0; - } - } - return m._isValid; - } - - function normalizeLocale(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // pick the locale from the array - // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function chooseLocale(names) { - var i = 0, j, next, locale, split; - - while (i < names.length) { - split = normalizeLocale(names[i]).split('-'); - j = split.length; - next = normalizeLocale(names[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - locale = loadLocale(split.slice(0, j).join('-')); - if (locale) { - return locale; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return null; - } - - function loadLocale(name) { - var oldLocale = null; - if (!locales[name] && hasModule) { - try { - oldLocale = moment.locale(); - require('./locale/' + name); - // because defineLocale currently also sets the global locale, we want to undo that for lazy loaded locales - moment.locale(oldLocale); - } catch (e) { } - } - return locales[name]; - } - - // Return a moment from input, that is local/utc/zone equivalent to model. - function makeAs(input, model) { - return model._isUTC ? moment(input).zone(model._offset || 0) : - moment(input).local(); - } - - /************************************ - Locale - ************************************/ - - - extend(Locale.prototype, { - - set : function (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - }, - - _months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - months : function (m) { - return this._months[m.month()]; - }, - - _monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - monthsShort : function (m) { - return this._monthsShort[m.month()]; - }, - - monthsParse : function (monthName) { - var i, mom, regex; - - if (!this._monthsParse) { - this._monthsParse = []; - } - - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - if (!this._monthsParse[i]) { - mom = moment.utc([2000, i]); - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._monthsParse[i].test(monthName)) { - return i; - } - } - }, - - _weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdays : function (m) { - return this._weekdays[m.day()]; - }, - - _weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysShort : function (m) { - return this._weekdaysShort[m.day()]; - }, - - _weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - weekdaysMin : function (m) { - return this._weekdaysMin[m.day()]; - }, - - weekdaysParse : function (weekdayName) { - var i, mom, regex; - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - if (!this._weekdaysParse[i]) { - mom = moment([2000, 1]).day(i); - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - }, - - _longDateFormat : { - LT : 'h:mm A', - L : 'MM/DD/YYYY', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY LT', - LLLL : 'dddd, MMMM D, YYYY LT' - }, - longDateFormat : function (key) { - var output = this._longDateFormat[key]; - if (!output && this._longDateFormat[key.toUpperCase()]) { - output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - this._longDateFormat[key] = output; - } - return output; - }, - - isPM : function (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - }, - - _meridiemParse : /[ap]\.?m?\.?/i, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - }, - - _calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendar[key]; - return typeof output === 'function' ? output.apply(mom) : output; - }, - - _relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - - relativeTime : function (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (typeof output === 'function') ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - }, - - pastFuture : function (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - }, - - ordinal : function (number) { - return this._ordinal.replace('%d', number); - }, - _ordinal : '%d', - - preparse : function (string) { - return string; - }, - - postformat : function (string) { - return string; - }, - - week : function (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - }, - - _week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }, - - _invalidDate: 'Invalid date', - invalidDate: function () { - return this._invalidDate; - } - }); - - /************************************ - Formatting - ************************************/ - - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ''); - } - return input.replace(/\\/g, ''); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = ''; - for (i = 0; i < length; i++) { - output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - if (!m.isValid()) { - return m.localeData().invalidDate(); - } - - format = expandFormat(format, m.localeData()); - - if (!formatFunctions[format]) { - formatFunctions[format] = makeFormatFunction(format); - } - - return formatFunctions[format](m); - } - - function expandFormat(format, locale) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return locale.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - - /************************************ - Parsing - ************************************/ - - - // get the regex to find the next token - function getParseRegexForToken(token, config) { - var a, strict = config._strict; - switch (token) { - case 'Q': - return parseTokenOneDigit; - case 'DDDD': - return parseTokenThreeDigits; - case 'YYYY': - case 'GGGG': - case 'gggg': - return strict ? parseTokenFourDigits : parseTokenOneToFourDigits; - case 'Y': - case 'G': - case 'g': - return parseTokenSignedNumber; - case 'YYYYYY': - case 'YYYYY': - case 'GGGGG': - case 'ggggg': - return strict ? parseTokenSixDigits : parseTokenOneToSixDigits; - case 'S': - if (strict) { - return parseTokenOneDigit; - } - /* falls through */ - case 'SS': - if (strict) { - return parseTokenTwoDigits; - } - /* falls through */ - case 'SSS': - if (strict) { - return parseTokenThreeDigits; - } - /* falls through */ - case 'DDD': - return parseTokenOneToThreeDigits; - case 'MMM': - case 'MMMM': - case 'dd': - case 'ddd': - case 'dddd': - return parseTokenWord; - case 'a': - case 'A': - return config._locale._meridiemParse; - case 'X': - return parseTokenTimestampMs; - case 'Z': - case 'ZZ': - return parseTokenTimezone; - case 'T': - return parseTokenT; - case 'SSSS': - return parseTokenDigits; - case 'MM': - case 'DD': - case 'YY': - case 'GG': - case 'gg': - case 'HH': - case 'hh': - case 'mm': - case 'ss': - case 'ww': - case 'WW': - return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits; - case 'M': - case 'D': - case 'd': - case 'H': - case 'h': - case 'm': - case 's': - case 'w': - case 'W': - case 'e': - case 'E': - return parseTokenOneOrTwoDigits; - case 'Do': - return parseTokenOrdinal; - default : - a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i')); - return a; - } - } - - function timezoneMinutesFromString(string) { - string = string || ''; - var possibleTzMatches = (string.match(parseTokenTimezone) || []), - tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], - parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], - minutes = +(parts[1] * 60) + toInt(parts[2]); - - return parts[0] === '+' ? -minutes : minutes; - } - - // function to convert string input to date - function addTimeToArrayFromToken(token, input, config) { - var a, datePartArray = config._a; - - switch (token) { - // QUARTER - case 'Q': - if (input != null) { - datePartArray[MONTH] = (toInt(input) - 1) * 3; - } - break; - // MONTH - case 'M' : // fall through to MM - case 'MM' : - if (input != null) { - datePartArray[MONTH] = toInt(input) - 1; - } - break; - case 'MMM' : // fall through to MMMM - case 'MMMM' : - a = config._locale.monthsParse(input); - // if we didn't find a month name, mark the date as invalid. - if (a != null) { - datePartArray[MONTH] = a; - } else { - config._pf.invalidMonth = input; - } - break; - // DAY OF MONTH - case 'D' : // fall through to DD - case 'DD' : - if (input != null) { - datePartArray[DATE] = toInt(input); - } - break; - case 'Do' : - if (input != null) { - datePartArray[DATE] = toInt(parseInt(input, 10)); - } - break; - // DAY OF YEAR - case 'DDD' : // fall through to DDDD - case 'DDDD' : - if (input != null) { - config._dayOfYear = toInt(input); - } - - break; - // YEAR - case 'YY' : - datePartArray[YEAR] = moment.parseTwoDigitYear(input); - break; - case 'YYYY' : - case 'YYYYY' : - case 'YYYYYY' : - datePartArray[YEAR] = toInt(input); - break; - // AM / PM - case 'a' : // fall through to A - case 'A' : - config._isPm = config._locale.isPM(input); - break; - // 24 HOUR - case 'H' : // fall through to hh - case 'HH' : // fall through to hh - case 'h' : // fall through to hh - case 'hh' : - datePartArray[HOUR] = toInt(input); - break; - // MINUTE - case 'm' : // fall through to mm - case 'mm' : - datePartArray[MINUTE] = toInt(input); - break; - // SECOND - case 's' : // fall through to ss - case 'ss' : - datePartArray[SECOND] = toInt(input); - break; - // MILLISECOND - case 'S' : - case 'SS' : - case 'SSS' : - case 'SSSS' : - datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); - break; - // UNIX TIMESTAMP WITH MS - case 'X': - config._d = new Date(parseFloat(input) * 1000); - break; - // TIMEZONE - case 'Z' : // fall through to ZZ - case 'ZZ' : - config._useUTC = true; - config._tzm = timezoneMinutesFromString(input); - break; - // WEEKDAY - human - case 'dd': - case 'ddd': - case 'dddd': - a = config._locale.weekdaysParse(input); - // if we didn't get a weekday name, mark the date as invalid - if (a != null) { - config._w = config._w || {}; - config._w['d'] = a; - } else { - config._pf.invalidWeekday = input; - } - break; - // WEEK, WEEK DAY - numeric - case 'w': - case 'ww': - case 'W': - case 'WW': - case 'd': - case 'e': - case 'E': - token = token.substr(0, 1); - /* falls through */ - case 'gggg': - case 'GGGG': - case 'GGGGG': - token = token.substr(0, 2); - if (input) { - config._w = config._w || {}; - config._w[token] = toInt(input); - } - break; - case 'gg': - case 'GG': - config._w = config._w || {}; - config._w[token] = moment.parseTwoDigitYear(input); - } - } - - function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - dow = 1; - doy = 4; - - // TODO: We need to take the current isoWeekYear, but that depends on - // how we interpret now (local, utc, fixed offset). So create - // a now version of current config (take local/utc/offset flags, and - // create now). - weekYear = dfl(w.GG, config._a[YEAR], weekOfYear(moment(), 1, 4).year); - week = dfl(w.W, 1); - weekday = dfl(w.E, 1); - } else { - dow = config._locale._week.dow; - doy = config._locale._week.doy; - - weekYear = dfl(w.gg, config._a[YEAR], weekOfYear(moment(), dow, doy).year); - week = dfl(w.w, 1); - - if (w.d != null) { - // weekday -- low day numbers are considered next week - weekday = w.d; - if (weekday < dow) { - ++week; - } - } else if (w.e != null) { - // local weekday -- counting starts from begining of week - weekday = w.e + dow; - } else { - // default to begining of week - weekday = dow; - } - } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function dateFromConfig(config) { - var i, date, input = [], currentDate, yearToUse; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - dayOfYearFromWeekInfo(config); - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear) { - yearToUse = dfl(config._a[YEAR], currentDate[YEAR]); - - if (config._dayOfYear > daysInYear(yearToUse)) { - config._pf._overflowDayOfYear = true; - } - - date = makeUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); - // Apply timezone offset from input. The actual zone can be changed - // with parseZone. - if (config._tzm != null) { - config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm); - } - } - - function dateFromObject(config) { - var normalizedInput; - - if (config._d) { - return; - } - - normalizedInput = normalizeObjectUnits(config._i); - config._a = [ - normalizedInput.year, - normalizedInput.month, - normalizedInput.day, - normalizedInput.hour, - normalizedInput.minute, - normalizedInput.second, - normalizedInput.millisecond - ]; - - dateFromConfig(config); - } - - function currentDateArray(config) { - var now = new Date(); - if (config._useUTC) { - return [ - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate() - ]; - } else { - return [now.getFullYear(), now.getMonth(), now.getDate()]; - } - } - - // date from string and format string - function makeDateFromStringAndFormat(config) { - if (config._f === moment.ISO_8601) { - parseISO(config); - return; - } - - config._a = []; - config._pf.empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; - - tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; - - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - config._pf.unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - config._pf.empty = false; - } - else { - config._pf.unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - config._pf.unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - config._pf.charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - config._pf.unusedInput.push(string); - } - - // handle am pm - if (config._isPm && config._a[HOUR] < 12) { - config._a[HOUR] += 12; - } - // if is 12 am, change hours to 0 - if (config._isPm === false && config._a[HOUR] === 12) { - config._a[HOUR] = 0; - } - - dateFromConfig(config); - checkOverflow(config); - } - - function unescapeFormat(s) { - return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - }); - } - - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function regexpEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - // date from string and array of format strings - function makeDateFromStringAndArray(config) { - var tempConfig, - bestMoment, - - scoreToBeat, - i, - currentScore; - - if (config._f.length === 0) { - config._pf.invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = copyConfig({}, config); - if (config._useUTC != null) { - tempConfig._useUTC = config._useUTC; - } - tempConfig._pf = defaultParsingFlags(); - tempConfig._f = config._f[i]; - makeDateFromStringAndFormat(tempConfig); - - if (!isValid(tempConfig)) { - continue; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += tempConfig._pf.charsLeftOver; - - //or tokens - currentScore += tempConfig._pf.unusedTokens.length * 10; - - tempConfig._pf.score = currentScore; - - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - - extend(config, bestMoment || tempConfig); - } - - // date from iso format - function parseISO(config) { - var i, l, - string = config._i, - match = isoRegex.exec(string); - - if (match) { - config._pf.iso = true; - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - // match[5] should be 'T' or undefined - config._f = isoDates[i][0] + (match[6] || ' '); - break; - } - } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - config._f += isoTimes[i][0]; - break; - } - } - if (string.match(parseTokenTimezone)) { - config._f += 'Z'; - } - makeDateFromStringAndFormat(config); - } else { - config._isValid = false; - } - } - - // date from iso format or fallback - function makeDateFromString(config) { - parseISO(config); - if (config._isValid === false) { - delete config._isValid; - moment.createFromInputFallback(config); - } - } - - function map(arr, fn) { - var res = [], i; - for (i = 0; i < arr.length; ++i) { - res.push(fn(arr[i], i)); - } - return res; - } - - function makeDateFromInput(config) { - var input = config._i, matched; - if (input === undefined) { - config._d = new Date(); - } else if (isDate(input)) { - config._d = new Date(+input); - } else if ((matched = aspNetJsonRegex.exec(input)) !== null) { - config._d = new Date(+matched[1]); - } else if (typeof input === 'string') { - makeDateFromString(config); - } else if (isArray(input)) { - config._a = map(input.slice(0), function (obj) { - return parseInt(obj, 10); - }); - dateFromConfig(config); - } else if (typeof(input) === 'object') { - dateFromObject(config); - } else if (typeof(input) === 'number') { - // from milliseconds - config._d = new Date(input); - } else { - moment.createFromInputFallback(config); - } - } - - function makeDate(y, m, d, h, M, s, ms) { - //can't just apply() to create a date: - //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var date = new Date(y, m, d, h, M, s, ms); - - //the date constructor doesn't accept years < 1970 - if (y < 1970) { - date.setFullYear(y); - } - return date; - } - - function makeUTCDate(y) { - var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { - date.setUTCFullYear(y); - } - return date; - } - - function parseWeekday(input, locale) { - if (typeof input === 'string') { - if (!isNaN(input)) { - input = parseInt(input, 10); - } - else { - input = locale.weekdaysParse(input); - if (typeof input !== 'number') { - return null; - } - } - } - return input; - } - - /************************************ - Relative Time - ************************************/ - - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { - return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime(posNegDuration, withoutSuffix, locale) { - var duration = moment.duration(posNegDuration).abs(), - seconds = round(duration.as('s')), - minutes = round(duration.as('m')), - hours = round(duration.as('h')), - days = round(duration.as('d')), - months = round(duration.as('M')), - years = round(duration.as('y')), - - args = seconds < relativeTimeThresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || - minutes < relativeTimeThresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || - hours < relativeTimeThresholds.h && ['hh', hours] || - days === 1 && ['d'] || - days < relativeTimeThresholds.d && ['dd', days] || - months === 1 && ['M'] || - months < relativeTimeThresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; - - args[2] = withoutSuffix; - args[3] = +posNegDuration > 0; - args[4] = locale; - return substituteTimeAgo.apply({}, args); - } - - - /************************************ - Week of Year - ************************************/ - - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = moment(mom).add(daysToDayOfWeek, 'd'); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; - } - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear; - - d = d === 0 ? 7 : d; - weekday = weekday != null ? weekday : firstDayOfWeek; - daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0); - dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1; - - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear - }; - } - - /************************************ - Top Level Functions - ************************************/ - - function makeMoment(config) { - var input = config._i, - format = config._f; - - config._locale = config._locale || moment.localeData(config._l); - - if (input === null || (format === undefined && input === '')) { - return moment.invalid({nullInput: true}); - } - - if (typeof input === 'string') { - config._i = input = config._locale.preparse(input); - } - - if (moment.isMoment(input)) { - return new Moment(input, true); - } else if (format) { - if (isArray(format)) { - makeDateFromStringAndArray(config); - } else { - makeDateFromStringAndFormat(config); - } - } else { - makeDateFromInput(config); - } - - return new Moment(config); - } - - moment = function (input, format, locale, strict) { - var c; - - if (typeof(locale) === 'boolean') { - strict = locale; - locale = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._i = input; - c._f = format; - c._l = locale; - c._strict = strict; - c._isUTC = false; - c._pf = defaultParsingFlags(); - - return makeMoment(c); - }; - - moment.suppressDeprecationWarnings = false; - - moment.createFromInputFallback = deprecate( - 'moment construction falls back to js Date. This is ' + - 'discouraged and will be removed in upcoming major ' + - 'release. Please refer to ' + - 'https://github.com/moment/moment/issues/1407 for more info.', - function (config) { - config._d = new Date(config._i); - } - ); - - // Pick a moment m from moments so that m[fn](other) is true for all - // other. This relies on the function fn to be transitive. - // - // moments should either be an array of moment objects or an array, whose - // first element is an array of moment objects. - function pickBy(fn, moments) { - var res, i; - if (moments.length === 1 && isArray(moments[0])) { - moments = moments[0]; - } - if (!moments.length) { - return moment(); - } - res = moments[0]; - for (i = 1; i < moments.length; ++i) { - if (moments[i][fn](res)) { - res = moments[i]; - } - } - return res; - } - - moment.min = function () { - var args = [].slice.call(arguments, 0); - - return pickBy('isBefore', args); - }; - - moment.max = function () { - var args = [].slice.call(arguments, 0); - - return pickBy('isAfter', args); - }; - - // creating with utc - moment.utc = function (input, format, locale, strict) { - var c; - - if (typeof(locale) === 'boolean') { - strict = locale; - locale = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._useUTC = true; - c._isUTC = true; - c._l = locale; - c._i = input; - c._f = format; - c._strict = strict; - c._pf = defaultParsingFlags(); - - return makeMoment(c).utc(); - }; - - // creating with unix timestamp (in seconds) - moment.unix = function (input) { - return moment(input * 1000); - }; - - // duration - moment.duration = function (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - parseIso, - diffRes; - - if (moment.isDuration(input)) { - duration = { - ms: input._milliseconds, - d: input._days, - M: input._months - }; - } else if (typeof input === 'number') { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - duration = { - y: 0, - d: toInt(match[DATE]) * sign, - h: toInt(match[HOUR]) * sign, - m: toInt(match[MINUTE]) * sign, - s: toInt(match[SECOND]) * sign, - ms: toInt(match[MILLISECOND]) * sign - }; - } else if (!!(match = isoDurationRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - parseIso = function (inp) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - }; - duration = { - y: parseIso(match[2]), - M: parseIso(match[3]), - d: parseIso(match[4]), - h: parseIso(match[5]), - m: parseIso(match[6]), - s: parseIso(match[7]), - w: parseIso(match[8]) - }; - } else if (typeof duration === 'object' && - ('from' in duration || 'to' in duration)) { - diffRes = momentsDifference(moment(duration.from), moment(duration.to)); - - duration = {}; - duration.ms = diffRes.milliseconds; - duration.M = diffRes.months; - } - - ret = new Duration(duration); - - if (moment.isDuration(input) && hasOwnProp(input, '_locale')) { - ret._locale = input._locale; - } - - return ret; - }; - - // version number - moment.version = VERSION; - - // default format - moment.defaultFormat = isoFormat; - - // constant that refers to the ISO standard - moment.ISO_8601 = function () {}; - - // Plugins that add properties should also add the key here (null value), - // so we can properly clone ourselves. - moment.momentProperties = momentProperties; - - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - moment.updateOffset = function () {}; - - // This function allows you to set a threshold for relative time strings - moment.relativeTimeThreshold = function (threshold, limit) { - if (relativeTimeThresholds[threshold] === undefined) { - return false; - } - if (limit === undefined) { - return relativeTimeThresholds[threshold]; - } - relativeTimeThresholds[threshold] = limit; - return true; - }; - - moment.lang = deprecate( - 'moment.lang is deprecated. Use moment.locale instead.', - function (key, value) { - return moment.locale(key, value); - } - ); - - // This function will load locale and then set the global locale. If - // no arguments are passed in, it will simply return the current global - // locale key. - moment.locale = function (key, values) { - var data; - if (key) { - if (typeof(values) !== 'undefined') { - data = moment.defineLocale(key, values); - } - else { - data = moment.localeData(key); - } - - if (data) { - moment.duration._locale = moment._locale = data; - } - } - - return moment._locale._abbr; - }; - - moment.defineLocale = function (name, values) { - if (values !== null) { - values.abbr = name; - if (!locales[name]) { - locales[name] = new Locale(); - } - locales[name].set(values); - - // backwards compat for now: also set the locale - moment.locale(name); - - return locales[name]; - } else { - // useful for testing - delete locales[name]; - return null; - } - }; - - moment.langData = deprecate( - 'moment.langData is deprecated. Use moment.localeData instead.', - function (key) { - return moment.localeData(key); - } - ); - - // returns locale data - moment.localeData = function (key) { - var locale; - - if (key && key._locale && key._locale._abbr) { - key = key._locale._abbr; - } - - if (!key) { - return moment._locale; - } - - if (!isArray(key)) { - //short-circuit everything else - locale = loadLocale(key); - if (locale) { - return locale; - } - key = [key]; - } - - return chooseLocale(key); - }; - - // compare moment object - moment.isMoment = function (obj) { - return obj instanceof Moment || - (obj != null && hasOwnProp(obj, '_isAMomentObject')); - }; - - // for typechecking Duration objects - moment.isDuration = function (obj) { - return obj instanceof Duration; - }; - - for (i = lists.length - 1; i >= 0; --i) { - makeList(lists[i]); - } - - moment.normalizeUnits = function (units) { - return normalizeUnits(units); - }; - - moment.invalid = function (flags) { - var m = moment.utc(NaN); - if (flags != null) { - extend(m._pf, flags); - } - else { - m._pf.userInvalidated = true; - } - - return m; - }; - - moment.parseZone = function () { - return moment.apply(null, arguments).parseZone(); - }; - - moment.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; - - /************************************ - Moment Prototype - ************************************/ - - - extend(moment.fn = Moment.prototype, { - - clone : function () { - return moment(this); - }, - - valueOf : function () { - return +this._d + ((this._offset || 0) * 60000); - }, - - unix : function () { - return Math.floor(+this / 1000); - }, - - toString : function () { - return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); - }, - - toDate : function () { - return this._offset ? new Date(+this) : this._d; - }, - - toISOString : function () { - var m = moment(this).utc(); - if (0 < m.year() && m.year() <= 9999) { - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } else { - return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } - }, - - toArray : function () { - var m = this; - return [ - m.year(), - m.month(), - m.date(), - m.hours(), - m.minutes(), - m.seconds(), - m.milliseconds() - ]; - }, - - isValid : function () { - return isValid(this); - }, - - isDSTShifted : function () { - if (this._a) { - return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0; - } - - return false; - }, - - parsingFlags : function () { - return extend({}, this._pf); - }, - - invalidAt: function () { - return this._pf.overflow; - }, - - utc : function (keepLocalTime) { - return this.zone(0, keepLocalTime); - }, - - local : function (keepLocalTime) { - if (this._isUTC) { - this.zone(0, keepLocalTime); - this._isUTC = false; - - if (keepLocalTime) { - this.add(this._dateTzOffset(), 'm'); - } - } - return this; - }, - - format : function (inputString) { - var output = formatMoment(this, inputString || moment.defaultFormat); - return this.localeData().postformat(output); - }, - - add : createAdder(1, 'add'), - - subtract : createAdder(-1, 'subtract'), - - diff : function (input, units, asFloat) { - var that = makeAs(input, this), - zoneDiff = (this.zone() - that.zone()) * 6e4, - diff, output, daysAdjust; - - units = normalizeUnits(units); - - if (units === 'year' || units === 'month') { - // average number of days in the months in the given dates - diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 - // difference in months - output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); - // adjust by taking difference in days, average number of days - // and dst in the given months. - daysAdjust = (this - moment(this).startOf('month')) - - (that - moment(that).startOf('month')); - // same as above but with zones, to negate all dst - daysAdjust -= ((this.zone() - moment(this).startOf('month').zone()) - - (that.zone() - moment(that).startOf('month').zone())) * 6e4; - output += daysAdjust / diff; - if (units === 'year') { - output = output / 12; - } - } else { - diff = (this - that); - output = units === 'second' ? diff / 1e3 : // 1000 - units === 'minute' ? diff / 6e4 : // 1000 * 60 - units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 - units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst - units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst - diff; - } - return asFloat ? output : absRound(output); - }, - - from : function (time, withoutSuffix) { - return moment.duration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); - }, - - fromNow : function (withoutSuffix) { - return this.from(moment(), withoutSuffix); - }, - - calendar : function (time) { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're zone'd or not. - var now = time || moment(), - sod = makeAs(now, this).startOf('day'), - diff = this.diff(sod, 'days', true), - format = diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(this.localeData().calendar(format, this)); - }, - - isLeapYear : function () { - return isLeapYear(this.year()); - }, - - isDST : function () { - return (this.zone() < this.clone().month(0).zone() || - this.zone() < this.clone().month(5).zone()); - }, - - day : function (input) { - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.localeData()); - return this.add(input - day, 'd'); - } else { - return day; - } - }, - - month : makeAccessor('Month', true), - - startOf : function (units) { - units = normalizeUnits(units); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'quarter': - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'isoWeek': - case 'day': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - /* falls through */ - } - - // weeks are a special case - if (units === 'week') { - this.weekday(0); - } else if (units === 'isoWeek') { - this.isoWeekday(1); - } - - // quarters are also special - if (units === 'quarter') { - this.month(Math.floor(this.month() / 3) * 3); - } - - return this; - }, - - endOf: function (units) { - units = normalizeUnits(units); - return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); - }, - - isAfter: function (input, units) { - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); - if (units === 'millisecond') { - input = moment.isMoment(input) ? input : moment(input); - return +this > +input; - } else { - return +this.clone().startOf(units) > +moment(input).startOf(units); - } - }, - - isBefore: function (input, units) { - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); - if (units === 'millisecond') { - input = moment.isMoment(input) ? input : moment(input); - return +this < +input; - } else { - return +this.clone().startOf(units) < +moment(input).startOf(units); - } - }, - - isSame: function (input, units) { - units = normalizeUnits(units || 'millisecond'); - if (units === 'millisecond') { - input = moment.isMoment(input) ? input : moment(input); - return +this === +input; - } else { - return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); - } - }, - - min: deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', - function (other) { - other = moment.apply(null, arguments); - return other < this ? this : other; - } - ), - - max: deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', - function (other) { - other = moment.apply(null, arguments); - return other > this ? this : other; - } - ), - - // keepLocalTime = true means only change the timezone, without - // affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]--> - // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone - // +0200, so we adjust the time as needed, to be valid. - // - // Keeping the time actually adds/subtracts (one hour) - // from the actual represented time. That is why we call updateOffset - // a second time. In case it wants us to change the offset again - // _changeInProgress == true case, then we have to adjust, because - // there is no such time in the given timezone. - zone : function (input, keepLocalTime) { - var offset = this._offset || 0, - localAdjust; - if (input != null) { - if (typeof input === 'string') { - input = timezoneMinutesFromString(input); - } - if (Math.abs(input) < 16) { - input = input * 60; - } - if (!this._isUTC && keepLocalTime) { - localAdjust = this._dateTzOffset(); - } - this._offset = input; - this._isUTC = true; - if (localAdjust != null) { - this.subtract(localAdjust, 'm'); - } - if (offset !== input) { - if (!keepLocalTime || this._changeInProgress) { - addOrSubtractDurationFromMoment(this, - moment.duration(offset - input, 'm'), 1, false); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - moment.updateOffset(this, true); - this._changeInProgress = null; - } - } - } else { - return this._isUTC ? offset : this._dateTzOffset(); - } - return this; - }, - - zoneAbbr : function () { - return this._isUTC ? 'UTC' : ''; - }, - - zoneName : function () { - return this._isUTC ? 'Coordinated Universal Time' : ''; - }, - - parseZone : function () { - if (this._tzm) { - this.zone(this._tzm); - } else if (typeof this._i === 'string') { - this.zone(this._i); - } - return this; - }, - - hasAlignedHourOffset : function (input) { - if (!input) { - input = 0; - } - else { - input = moment(input).zone(); - } - - return (this.zone() - input) % 60 === 0; - }, - - daysInMonth : function () { - return daysInMonth(this.year(), this.month()); - }, - - dayOfYear : function (input) { - var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); - }, - - quarter : function (input) { - return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); - }, - - weekYear : function (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); - }, - - isoWeekYear : function (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); - }, - - week : function (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - }, - - isoWeek : function (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - }, - - weekday : function (input) { - var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; - return input == null ? weekday : this.add(input - weekday, 'd'); - }, - - isoWeekday : function (input) { - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); - }, - - isoWeeksInYear : function () { - return weeksInYear(this.year(), 1, 4); - }, - - weeksInYear : function () { - var weekInfo = this.localeData()._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units](); - }, - - set : function (units, value) { - units = normalizeUnits(units); - if (typeof this[units] === 'function') { - this[units](value); - } - return this; - }, - - // If passed a locale key, it will set the locale for this - // instance. Otherwise, it will return the locale configuration - // variables for this instance. - locale : function (key) { - var newLocaleData; - - if (key === undefined) { - return this._locale._abbr; - } else { - newLocaleData = moment.localeData(key); - if (newLocaleData != null) { - this._locale = newLocaleData; - } - return this; - } - }, - - lang : deprecate( - 'moment().lang() is deprecated. Use moment().localeData() instead.', - function (key) { - if (key === undefined) { - return this.localeData(); - } else { - return this.locale(key); - } - } - ), - - localeData : function () { - return this._locale; - }, - - _dateTzOffset : function () { - // On Firefox.24 Date#getTimezoneOffset returns a floating point. - // https://github.com/moment/moment/pull/1871 - return Math.round(this._d.getTimezoneOffset() / 15) * 15; - } - }); - - function rawMonthSetter(mom, value) { - var dayOfMonth; - - // TODO: Move this out of here! - if (typeof value === 'string') { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; - } - } - - dayOfMonth = Math.min(mom.date(), - daysInMonth(mom.year(), value)); - mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); - return mom; - } - - function rawGetter(mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); - } - - function rawSetter(mom, unit, value) { - if (unit === 'Month') { - return rawMonthSetter(mom, value); - } else { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); - } - } - - function makeAccessor(unit, keepTime) { - return function (value) { - if (value != null) { - rawSetter(this, unit, value); - moment.updateOffset(this, keepTime); - return this; - } else { - return rawGetter(this, unit); - } - }; - } - - moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false); - moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false); - moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false); - // Setting the hour should keep the time, because the user explicitly - // specified which hour he wants. So trying to maintain the same hour (in - // a new timezone) makes sense. Adding/subtracting hours does not follow - // this rule. - moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true); - // moment.fn.month is defined separately - moment.fn.date = makeAccessor('Date', true); - moment.fn.dates = deprecate('dates accessor is deprecated. Use date instead.', makeAccessor('Date', true)); - moment.fn.year = makeAccessor('FullYear', true); - moment.fn.years = deprecate('years accessor is deprecated. Use year instead.', makeAccessor('FullYear', true)); - - // add plural methods - moment.fn.days = moment.fn.day; - moment.fn.months = moment.fn.month; - moment.fn.weeks = moment.fn.week; - moment.fn.isoWeeks = moment.fn.isoWeek; - moment.fn.quarters = moment.fn.quarter; - - // add aliased format methods - moment.fn.toJSON = moment.fn.toISOString; - - /************************************ - Duration Prototype - ************************************/ - - - function daysToYears (days) { - // 400 years have 146097 days (taking into account leap year rules) - return days * 400 / 146097; - } - - function yearsToDays (years) { - // years * 365 + absRound(years / 4) - - // absRound(years / 100) + absRound(years / 400); - return years * 146097 / 400; - } - - extend(moment.duration.fn = Duration.prototype, { - - _bubble : function () { - var milliseconds = this._milliseconds, - days = this._days, - months = this._months, - data = this._data, - seconds, minutes, hours, years = 0; - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absRound(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absRound(seconds / 60); - data.minutes = minutes % 60; - - hours = absRound(minutes / 60); - data.hours = hours % 24; - - days += absRound(hours / 24); - - // Accurately convert days to years, assume start from year 0. - years = absRound(daysToYears(days)); - days -= absRound(yearsToDays(years)); - - // 30 days to a month - // TODO (iskren): Use anchor date (like 1st Jan) to compute this. - months += absRound(days / 30); - days %= 30; - - // 12 months -> 1 year - years += absRound(months / 12); - months %= 12; - - data.days = days; - data.months = months; - data.years = years; - }, - - abs : function () { - this._milliseconds = Math.abs(this._milliseconds); - this._days = Math.abs(this._days); - this._months = Math.abs(this._months); - - this._data.milliseconds = Math.abs(this._data.milliseconds); - this._data.seconds = Math.abs(this._data.seconds); - this._data.minutes = Math.abs(this._data.minutes); - this._data.hours = Math.abs(this._data.hours); - this._data.months = Math.abs(this._data.months); - this._data.years = Math.abs(this._data.years); - - return this; - }, - - weeks : function () { - return absRound(this.days() / 7); - }, - - valueOf : function () { - return this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6; - }, - - humanize : function (withSuffix) { - var output = relativeTime(this, !withSuffix, this.localeData()); - - if (withSuffix) { - output = this.localeData().pastFuture(+this, output); - } - - return this.localeData().postformat(output); - }, - - add : function (input, val) { - // supports only 2.0-style add(1, 's') or add(moment) - var dur = moment.duration(input, val); - - this._milliseconds += dur._milliseconds; - this._days += dur._days; - this._months += dur._months; - - this._bubble(); - - return this; - }, - - subtract : function (input, val) { - var dur = moment.duration(input, val); - - this._milliseconds -= dur._milliseconds; - this._days -= dur._days; - this._months -= dur._months; - - this._bubble(); - - return this; - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units.toLowerCase() + 's'](); - }, - - as : function (units) { - var days, months; - units = normalizeUnits(units); - - if (units === 'month' || units === 'year') { - days = this._days + this._milliseconds / 864e5; - months = this._months + daysToYears(days) * 12; - return units === 'month' ? months : months / 12; - } else { - // handle milliseconds separately because of floating point math errors (issue #1867) - days = this._days + yearsToDays(this._months / 12); - switch (units) { - case 'week': return days / 7 + this._milliseconds / 6048e5; - case 'day': return days + this._milliseconds / 864e5; - case 'hour': return days * 24 + this._milliseconds / 36e5; - case 'minute': return days * 24 * 60 + this._milliseconds / 6e4; - case 'second': return days * 24 * 60 * 60 + this._milliseconds / 1000; - // Math.floor prevents floating point math errors here - case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + this._milliseconds; - default: throw new Error('Unknown unit ' + units); - } - } - }, - - lang : moment.fn.lang, - locale : moment.fn.locale, - - toIsoString : deprecate( - 'toIsoString() is deprecated. Please use toISOString() instead ' + - '(notice the capitals)', - function () { - return this.toISOString(); - } - ), - - toISOString : function () { - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var years = Math.abs(this.years()), - months = Math.abs(this.months()), - days = Math.abs(this.days()), - hours = Math.abs(this.hours()), - minutes = Math.abs(this.minutes()), - seconds = Math.abs(this.seconds() + this.milliseconds() / 1000); - - if (!this.asSeconds()) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - return (this.asSeconds() < 0 ? '-' : '') + - 'P' + - (years ? years + 'Y' : '') + - (months ? months + 'M' : '') + - (days ? days + 'D' : '') + - ((hours || minutes || seconds) ? 'T' : '') + - (hours ? hours + 'H' : '') + - (minutes ? minutes + 'M' : '') + - (seconds ? seconds + 'S' : ''); - }, - - localeData : function () { - return this._locale; - } - }); - - moment.duration.fn.toString = moment.duration.fn.toISOString; - - function makeDurationGetter(name) { - moment.duration.fn[name] = function () { - return this._data[name]; - }; - } - - for (i in unitMillisecondFactors) { - if (hasOwnProp(unitMillisecondFactors, i)) { - makeDurationGetter(i.toLowerCase()); - } - } - - moment.duration.fn.asMilliseconds = function () { - return this.as('ms'); - }; - moment.duration.fn.asSeconds = function () { - return this.as('s'); - }; - moment.duration.fn.asMinutes = function () { - return this.as('m'); - }; - moment.duration.fn.asHours = function () { - return this.as('h'); - }; - moment.duration.fn.asDays = function () { - return this.as('d'); - }; - moment.duration.fn.asWeeks = function () { - return this.as('weeks'); - }; - moment.duration.fn.asMonths = function () { - return this.as('M'); - }; - moment.duration.fn.asYears = function () { - return this.as('y'); - }; - - /************************************ - Default Locale - ************************************/ - - - // Set default locale, other locale will inherit from English. - moment.locale('en', { - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - return moment; - - }).call(this); - - UI.Utils.moment = moment; - - return UI.datepicker; -}); diff --git a/js/components/datepicker.min.js b/js/components/datepicker.min.js deleted file mode 100755 index f8dfe47..0000000 --- a/js/components/datepicker.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-datepicker",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e,n,a=!1;return t.component("datepicker",{defaults:{mobile:!1,weekstart:1,i18n:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},format:"YYYY-MM-DD",offsettop:5,maxDate:!1,minDate:!1,pos:"auto",template:function(e,n){var a,s="";if(s+='
',s+='',s+='',t.formSelect){var i,r,o,u,c=(new Date).getFullYear(),d=[];for(a=0;a'+n.i18n.months[a]+""):d.push('");for(i=''+n.i18n.months[e.month]+'",d=[],o=e.minDate?e.minDate.year():c-50,u=e.maxDate?e.maxDate.year():c+20,a=o;u>=a;a++)a==e.year?d.push('"):d.push('");r=''+e.year+'",s+='
'+i+" "+r+"
"}else s+='
'+n.i18n.months[e.month]+" "+e.year+"
";for(s+="
",s+='',s+="",a=0;a"+e.weekdays[a]+"");for(s+="",s+="",a=0;a";for(var l=0;l'+h.day.format("D")+""}s+=""}return s+="",s+="
"}},boot:function(){t.$win.on("resize orientationchange",function(){a&&a.hide()}),t.$html.on("focus.datepicker.uikit","[data-uk-datepicker]",function(e){var n=t.$(this);n.data("datepicker")||(e.preventDefault(),t.datepicker(n,t.Utils.options(n.attr("data-uk-datepicker"))),n.trigger("focus"))}),t.$html.on("click focus","*",function(n){var s=t.$(n.target);!a||s[0]==e[0]||s.data("datepicker")||s.parents(".uk-datepicker:first").length||a.hide()})},init:function(){if(!t.support.touch||"date"!=this.element.attr("type")||this.options.mobile){var s=this;this.current=this.element.val()?n(this.element.val(),this.options.format):n(),this.on("click focus",function(){a!==s&&s.pick(this.value?this.value:s.options.minDate?s.options.minDate:"")}).on("change",function(){s.element.val()&&!n(s.element.val(),s.options.format).isValid()&&s.element.val(n().format(s.options.format))}),e||(e=t.$('
'),e.on("click",".uk-datepicker-next, .uk-datepicker-previous, [data-date]",function(e){e.stopPropagation(),e.preventDefault();var s=t.$(this);return s.hasClass("uk-datepicker-date-disabled")?!1:(s.is("[data-date]")?(a.current=n(s.data("date")),a.element.val(a.current.isValid()?a.current.format(a.options.format):null).trigger("change"),a.hide()):a.add(s.hasClass("uk-datepicker-next")?1:-1,"months"),void 0)}),e.on("change",".update-picker-month, .update-picker-year",function(){var e=t.$(this);a[e.is(".update-picker-year")?"setYear":"setMonth"](Number(e.val()))}),e.appendTo("body"))}},pick:function(s){var i=this.element.offset(),r={left:i.left,right:""};this.current=isNaN(s)?n(s,this.options.format):n(),this.initdate=this.current.format("YYYY-MM-DD"),this.update(),"right"==t.langdirection&&(r.right=window.innerWidth-(r.left+this.element.outerWidth()),r.left="");var o=i.top-this.element.outerHeight()+this.element.height()-this.options.offsettop-e.outerHeight(),u=i.top+this.element.outerHeight()+this.options.offsettop;r.top=u,"top"==this.options.pos?r.top=o:"auto"==this.options.pos&&window.innerHeight-u-e.outerHeight()<0&&o>=0&&(r.top=o),e.css(r).show(),this.trigger("show.uk.datepicker"),a=this},add:function(t,e){this.current.add(t,e),this.update()},setMonth:function(t){this.current.month(t),this.update()},setYear:function(t){this.current.year(t),this.update()},update:function(){var t=this.getRows(this.current.year(),this.current.month()),n=this.options.template(t,this.options);e.html(n),this.trigger("update.uk.datepicker")},getRows:function(t,e){var a=this.options,s=n().format("YYYY-MM-DD"),i=[31,t%4===0&&t%100!==0||t%400===0?29:28,31,30,31,30,31,31,30,31,30,31][e],r=new Date(t,e,1,12).getDay(),o={month:e,year:t,weekdays:[],days:[],maxDate:!1,minDate:!1},u=[];a.maxDate!==!1&&(o.maxDate=isNaN(a.maxDate)?n(a.maxDate,a.format):n().add(a.maxDate,"days")),a.minDate!==!1&&(o.minDate=isNaN(a.minDate)?n(a.minDate,a.format):n().add(a.minDate-1,"days")),o.weekdays=function(){for(var t=0,e=[];7>t;t++){for(var n=t+(a.weekstart||0);n>=7;)n-=7;e.push(a.i18n.weekdays[n])}return e}(),a.weekstart&&a.weekstart>0&&(r-=a.weekstart,0>r&&(r+=7));for(var c=i+r,d=c;d>7;)d-=7;c+=7-d;for(var l,h,f,m,_,p=0,y=0;c>p;p++)l=new Date(t,e,1+(p-r),12),h=o.minDate&&o.minDate>l||o.maxDate&&l>o.maxDate,_=!(r>p||p>=i+r),l=n(l),f=this.initdate==l.format("YYYY-MM-DD"),m=s==l.format("YYYY-MM-DD"),u.push({selected:f,today:m,disabled:h,day:l,inmonth:_}),7===++y&&(o.days.push(u),u=[],y=0);return o},hide:function(){a&&a===this&&(e.hide(),a=!1,this.trigger("hide.uk.datepicker"))}}),n=function(t){function e(t,e,n){switch(arguments.length){case 2:return null!=t?t:e;case 3:return null!=t?t:null!=e?e:n;default:throw new Error("Implement me")}}function n(t,e){return Ye.call(t,e)}function a(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function s(t){De.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function i(t,e){var n=!0;return h(function(){return n&&(s(t),n=!1),e.apply(this,arguments)},e)}function r(t,e){mn[t]||(s(e),mn[t]=!0)}function o(t,e){return function(n){return _(t.call(this,n),e)}}function u(t,e){return function(n){return this.localeData().ordinal(t.call(this,n),e)}}function c(){}function d(t,e){e!==!1&&F(t),f(this,t),this._d=new Date(+t._d)}function l(t){var e=v(t),n=e.year||0,a=e.quarter||0,s=e.month||0,i=e.week||0,r=e.day||0,o=e.hour||0,u=e.minute||0,c=e.second||0,d=e.millisecond||0;this._milliseconds=+d+1e3*c+6e4*u+36e5*o,this._days=+r+7*i,this._months=+s+3*a+12*n,this._data={},this._locale=De.localeData(),this._bubble()}function h(t,e){for(var a in e)n(e,a)&&(t[a]=e[a]);return n(e,"toString")&&(t.toString=e.toString),n(e,"valueOf")&&(t.valueOf=e.valueOf),t}function f(t,e){var n,a,s;if("undefined"!=typeof e._isAMomentObject&&(t._isAMomentObject=e._isAMomentObject),"undefined"!=typeof e._i&&(t._i=e._i),"undefined"!=typeof e._f&&(t._f=e._f),"undefined"!=typeof e._l&&(t._l=e._l),"undefined"!=typeof e._strict&&(t._strict=e._strict),"undefined"!=typeof e._tzm&&(t._tzm=e._tzm),"undefined"!=typeof e._isUTC&&(t._isUTC=e._isUTC),"undefined"!=typeof e._offset&&(t._offset=e._offset),"undefined"!=typeof e._pf&&(t._pf=e._pf),"undefined"!=typeof e._locale&&(t._locale=e._locale),Fe.length>0)for(n in Fe)a=Fe[n],s=e[a],"undefined"!=typeof s&&(t[a]=s);return t}function m(t){return 0>t?Math.ceil(t):Math.floor(t)}function _(t,e,n){for(var a=""+Math.abs(t),s=t>=0;a.lengtha;a++)(n&&t[a]!==e[a]||!n&&S(t[a])!==S(e[a]))&&r++;return r+i}function w(t){if(t){var e=t.toLowerCase().replace(/(.)s$/,"$1");t=on[t]||un[e]||e}return t}function v(t){var e,a,s={};for(a in t)n(t,a)&&(e=w(a),e&&(s[e]=t[a]));return s}function b(e){var n,a;if(0===e.indexOf("week"))n=7,a="day";else{if(0!==e.indexOf("month"))return;n=12,a="month"}De[e]=function(s,i){var r,o,u=De._locale[e],c=[];if("number"==typeof s&&(i=s,s=t),o=function(t){var e=De().utc().set(a,t);return u.call(De._locale,e,s||"")},null!=i)return o(i);for(r=0;n>r;r++)c.push(o(r));return c}}function S(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=e>=0?Math.floor(e):Math.ceil(e)),n}function T(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function O(t,e,n){return oe(De([t,11,31+e-n]),e,n).week}function W(t){return U(t)?366:365}function U(t){return t%4===0&&t%100!==0||t%400===0}function F(t){var e;t._a&&-2===t._pf.overflow&&(e=t._a[ve]<0||t._a[ve]>11?ve:t._a[be]<1||t._a[be]>T(t._a[we],t._a[ve])?be:t._a[Se]<0||t._a[Se]>23?Se:t._a[Te]<0||t._a[Te]>59?Te:t._a[Oe]<0||t._a[Oe]>59?Oe:t._a[We]<0||t._a[We]>999?We:-1,t._pf._overflowDayOfYear&&(we>e||e>be)&&(e=be),t._pf.overflow=e)}function G(t){return null==t._isValid&&(t._isValid=!isNaN(t._d.getTime())&&t._pf.overflow<0&&!t._pf.empty&&!t._pf.invalidMonth&&!t._pf.nullInput&&!t._pf.invalidFormat&&!t._pf.userInvalidated,t._strict&&(t._isValid=t._isValid&&0===t._pf.charsLeftOver&&0===t._pf.unusedTokens.length)),t._isValid}function C(t){return t?t.toLowerCase().replace("_","-"):t}function z(t){for(var e,n,a,s,i=0;i0;){if(a=x(s.slice(0,e).join("-")))return a;if(n&&n.length>=e&&Y(s,n,!0)>=e-1)break;e--}i++}return null}function x(t){var e=null;if(!Ue[t]&&Ge)try{e=De.locale(),require("./locale/"+t),De.locale(e)}catch(n){}return Ue[t]}function I(t,e){return e._isUTC?De(t).zone(e._offset||0):De(t).local()}function H(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function L(t){var e,n,a=t.match(Ie);for(e=0,n=a.length;n>e;e++)a[e]=fn[a[e]]?fn[a[e]]:H(a[e]);return function(s){var i="";for(e=0;n>e;e++)i+=a[e]instanceof Function?a[e].call(s,t):a[e];return i}}function P(t,e){return t.isValid()?(e=A(e,t.localeData()),cn[e]||(cn[e]=L(e)),cn[e](t)):t.localeData().invalidDate()}function A(t,e){function n(t){return e.longDateFormat(t)||t}var a=5;for(He.lastIndex=0;a>=0&&He.test(t);)t=t.replace(He,n),He.lastIndex=0,a-=1;return t}function N(t,e){var n,a=e._strict;switch(t){case"Q":return qe;case"DDDD":return Re;case"YYYY":case"GGGG":case"gggg":return a?Xe:Ae;case"Y":case"G":case"g":return Ke;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return a?Be:Ne;case"S":if(a)return qe;case"SS":if(a)return Qe;case"SSS":if(a)return Re;case"DDD":return Pe;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return je;case"a":case"A":return e._locale._meridiemParse;case"X":return Ve;case"Z":case"ZZ":return Ee;case"T":return $e;case"SSSS":return Ze;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return a?Qe:Le;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Le;case"Do":return Je;default:return n=new RegExp(R(Q(t.replace("\\","")),"i"))}}function Z(t){t=t||"";var e=t.match(Ee)||[],n=e[e.length-1]||[],a=(n+"").match(sn)||["-",0,0],s=+(60*a[1])+S(a[2]);return"+"===a[0]?-s:s}function j(t,e,n){var a,s=n._a;switch(t){case"Q":null!=e&&(s[ve]=3*(S(e)-1));break;case"M":case"MM":null!=e&&(s[ve]=S(e)-1);break;case"MMM":case"MMMM":a=n._locale.monthsParse(e),null!=a?s[ve]=a:n._pf.invalidMonth=e;break;case"D":case"DD":null!=e&&(s[be]=S(e));break;case"Do":null!=e&&(s[be]=S(parseInt(e,10)));break;case"DDD":case"DDDD":null!=e&&(n._dayOfYear=S(e));break;case"YY":s[we]=De.parseTwoDigitYear(e);break;case"YYYY":case"YYYYY":case"YYYYYY":s[we]=S(e);break;case"a":case"A":n._isPm=n._locale.isPM(e);break;case"H":case"HH":case"h":case"hh":s[Se]=S(e);break;case"m":case"mm":s[Te]=S(e);break;case"s":case"ss":s[Oe]=S(e);break;case"S":case"SS":case"SSS":case"SSSS":s[We]=S(1e3*("0."+e));break;case"X":n._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":n._useUTC=!0,n._tzm=Z(e);break;case"dd":case"ddd":case"dddd":a=n._locale.weekdaysParse(e),null!=a?(n._w=n._w||{},n._w.d=a):n._pf.invalidWeekday=e;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":t=t.substr(0,1);case"gggg":case"GGGG":case"GGGGG":t=t.substr(0,2),e&&(n._w=n._w||{},n._w[t]=S(e));break;case"gg":case"GG":n._w=n._w||{},n._w[t]=De.parseTwoDigitYear(e)}}function E(t){var n,a,s,i,r,o,u;n=t._w,null!=n.GG||null!=n.W||null!=n.E?(r=1,o=4,a=e(n.GG,t._a[we],oe(De(),1,4).year),s=e(n.W,1),i=e(n.E,1)):(r=t._locale._week.dow,o=t._locale._week.doy,a=e(n.gg,t._a[we],oe(De(),r,o).year),s=e(n.w,1),null!=n.d?(i=n.d,r>i&&++s):i=null!=n.e?n.e+r:r),u=ue(a,s,i,o,r),t._a[we]=u.year,t._dayOfYear=u.dayOfYear}function $(t){var n,a,s,i,r=[];if(!t._d){for(s=J(t),t._w&&null==t._a[be]&&null==t._a[ve]&&E(t),t._dayOfYear&&(i=e(t._a[we],s[we]),t._dayOfYear>W(i)&&(t._pf._overflowDayOfYear=!0),a=ae(i,0,t._dayOfYear),t._a[ve]=a.getUTCMonth(),t._a[be]=a.getUTCDate()),n=0;3>n&&null==t._a[n];++n)t._a[n]=r[n]=s[n];for(;7>n;n++)t._a[n]=r[n]=null==t._a[n]?2===n?1:0:t._a[n];t._d=(t._useUTC?ae:ne).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()+t._tzm)}}function V(t){var e;t._d||(e=v(t._i),t._a=[e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond],$(t))}function J(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function q(t){if(t._f===De.ISO_8601)return B(t),void 0;t._a=[],t._pf.empty=!0;var e,n,a,s,i,r=""+t._i,o=r.length,u=0;for(a=A(t._f,t._locale).match(Ie)||[],e=0;e0&&t._pf.unusedInput.push(i),r=r.slice(r.indexOf(n)+n.length),u+=n.length),fn[s]?(n?t._pf.empty=!1:t._pf.unusedTokens.push(s),j(s,n,t)):t._strict&&!n&&t._pf.unusedTokens.push(s);t._pf.charsLeftOver=o-u,r.length>0&&t._pf.unusedInput.push(r),t._isPm&&t._a[Se]<12&&(t._a[Se]+=12),t._isPm===!1&&12===t._a[Se]&&(t._a[Se]=0),$(t),F(t)}function Q(t){return t.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,a,s){return e||n||a||s})}function R(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function X(t){var e,n,s,i,r;if(0===t._f.length)return t._pf.invalidFormat=!0,t._d=new Date(0/0),void 0;for(i=0;ir)&&(s=r,n=e));h(t,n||e)}function B(t){var e,n,a=t._i,s=tn.exec(a);if(s){for(t._pf.iso=!0,e=0,n=nn.length;n>e;e++)if(nn[e][1].exec(a)){t._f=nn[e][0]+(s[6]||" ");break}for(e=0,n=an.length;n>e;e++)if(an[e][1].exec(a)){t._f+=an[e][0];break}a.match(Ee)&&(t._f+="Z"),q(t)}else t._isValid=!1}function K(t){B(t),t._isValid===!1&&(delete t._isValid,De.createFromInputFallback(t))}function te(t,e){var n,a=[];for(n=0;nt&&o.setFullYear(t),o}function ae(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function se(t,e){if("string"==typeof t)if(isNaN(t)){if(t=e.weekdaysParse(t),"number"!=typeof t)return null}else t=parseInt(t,10);return t}function ie(t,e,n,a,s){return s.relativeTime(e||1,!!n,t,a)}function re(t,e,n){var a=De.duration(t).abs(),s=Me(a.as("s")),i=Me(a.as("m")),r=Me(a.as("h")),o=Me(a.as("d")),u=Me(a.as("M")),c=Me(a.as("y")),d=s0,d[4]=n,ie.apply({},d)}function oe(t,e,n){var a,s=n-e,i=n-t.day();return i>s&&(i-=7),s-7>i&&(i+=7),a=De(t).add(i,"d"),{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function ue(t,e,n,a,s){var i,r,o=ae(t,0,1).getUTCDay();return o=0===o?7:o,n=null!=n?n:s,i=s-o+(o>a?7:0)-(s>o?7:0),r=7*(e-1)+(n-s)+i+1,{year:r>0?t:t-1,dayOfYear:r>0?r:W(t-1)+r}}function ce(e){var n=e._i,a=e._f;return e._locale=e._locale||De.localeData(e._l),null===n||a===t&&""===n?De.invalid({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),De.isMoment(n)?new d(n,!0):(a?k(a)?X(e):q(e):ee(e),new d(e)))}function de(t,e){var n,a;if(1===e.length&&k(e[0])&&(e=e[0]),!e.length)return De();for(n=e[0],a=1;a=0?"+":"-";return e+_(Math.abs(t),6)},gg:function(){return _(this.weekYear()%100,2)},gggg:function(){return _(this.weekYear(),4)},ggggg:function(){return _(this.weekYear(),5)},GG:function(){return _(this.isoWeekYear()%100,2)},GGGG:function(){return _(this.isoWeekYear(),4)},GGGGG:function(){return _(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return S(this.milliseconds()/100)},SS:function(){return _(S(this.milliseconds()/10),2)},SSS:function(){return _(this.milliseconds(),3)},SSSS:function(){return _(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+_(S(t/60),2)+":"+_(S(t)%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+_(S(t/60),2)+_(S(t)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},mn={},_n=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ln.length;)ge=ln.pop(),fn[ge+"o"]=u(fn[ge],ge);for(;hn.length;)ge=hn.pop(),fn[ge+ge]=o(fn[ge],2);fn.DDDD=o(fn.DDD,3),h(c.prototype,{set:function(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,n,a;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(n=De.utc([2e3,e]),a="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[e]=new RegExp(a.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},weekdaysParse:function(t){var e,n,a;for(this._weekdaysParse||(this._weekdaysParse=[]),e=0;7>e;e++)if(this._weekdaysParse[e]||(n=De([2e3,1]).day(e),a="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(a.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},isPM:function(t){return"p"===(t+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(t,e){var n=this._calendar[t];return"function"==typeof n?n.apply(e):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(t,e,n,a){var s=this._relativeTime[n];return"function"==typeof s?s(t,e,n,a):s.replace(/%d/i,t)},pastFuture:function(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return oe(t,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),De=function(e,n,s,i){var r;return"boolean"==typeof s&&(i=s,s=t),r={},r._isAMomentObject=!0,r._i=e,r._f=n,r._l=s,r._strict=i,r._isUTC=!1,r._pf=a(),ce(r)},De.suppressDeprecationWarnings=!1,De.createFromInputFallback=i("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i)}),De.min=function(){var t=[].slice.call(arguments,0);return de("isBefore",t)},De.max=function(){var t=[].slice.call(arguments,0);return de("isAfter",t)},De.utc=function(e,n,s,i){var r;return"boolean"==typeof s&&(i=s,s=t),r={},r._isAMomentObject=!0,r._useUTC=!0,r._isUTC=!0,r._l=s,r._i=e,r._f=n,r._strict=i,r._pf=a(),ce(r).utc()},De.unix=function(t){return De(1e3*t)},De.duration=function(t,e){var a,s,i,r,o=t,u=null;return De.isDuration(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(u=ze.exec(t))?(a="-"===u[1]?-1:1,o={y:0,d:S(u[be])*a,h:S(u[Se])*a,m:S(u[Te])*a,s:S(u[Oe])*a,ms:S(u[We])*a}):(u=xe.exec(t))?(a="-"===u[1]?-1:1,i=function(t){var e=t&&parseFloat(t.replace(",","."));return(isNaN(e)?0:e)*a},o={y:i(u[2]),M:i(u[3]),d:i(u[4]),h:i(u[5]),m:i(u[6]),s:i(u[7]),w:i(u[8])}):"object"==typeof o&&("from"in o||"to"in o)&&(r=y(De(o.from),De(o.to)),o={},o.ms=r.milliseconds,o.M=r.months),s=new l(o),De.isDuration(t)&&n(t,"_locale")&&(s._locale=t._locale),s},De.version=ke,De.defaultFormat=en,De.ISO_8601=function(){},De.momentProperties=Fe,De.updateOffset=function(){},De.relativeTimeThreshold=function(e,n){return dn[e]===t?!1:n===t?dn[e]:(dn[e]=n,!0)},De.lang=i("moment.lang is deprecated. Use moment.locale instead.",function(t,e){return De.locale(t,e)}),De.locale=function(t,e){var n;return t&&(n="undefined"!=typeof e?De.defineLocale(t,e):De.localeData(t),n&&(De.duration._locale=De._locale=n)),De._locale._abbr},De.defineLocale=function(t,e){return null!==e?(e.abbr=t,Ue[t]||(Ue[t]=new c),Ue[t].set(e),De.locale(t),Ue[t]):(delete Ue[t],null)},De.langData=i("moment.langData is deprecated. Use moment.localeData instead.",function(t){return De.localeData(t)}),De.localeData=function(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return De._locale;if(!k(t)){if(e=x(t))return e;t=[t]}return z(t)},De.isMoment=function(t){return t instanceof d||null!=t&&n(t,"_isAMomentObject")},De.isDuration=function(t){return t instanceof l};for(ge=_n.length-1;ge>=0;--ge)b(_n[ge]);De.normalizeUnits=function(t){return w(t)},De.invalid=function(t){var e=De.utc(0/0);return null!=t?h(e._pf,t):e._pf.userInvalidated=!0,e},De.parseZone=function(){return De.apply(null,arguments).parseZone()},De.parseTwoDigitYear=function(t){return S(t)+(S(t)>68?1900:2e3)},h(De.fn=d.prototype,{clone:function(){return De(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var t=De(this).utc();return 00:!1},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(t){return this.zone(0,t)},local:function(t){return this._isUTC&&(this.zone(0,t),this._isUTC=!1,t&&this.add(this._dateTzOffset(),"m")),this},format:function(t){var e=P(this,t||De.defaultFormat);return this.localeData().postformat(e)},add:D(1,"add"),subtract:D(-1,"subtract"),diff:function(t,e,n){var a,s,i,r=I(t,this),o=6e4*(this.zone()-r.zone());return e=w(e),"year"===e||"month"===e?(a=432e5*(this.daysInMonth()+r.daysInMonth()),s=12*(this.year()-r.year())+(this.month()-r.month()),i=this-De(this).startOf("month")-(r-De(r).startOf("month")),i-=6e4*(this.zone()-De(this).startOf("month").zone()-(r.zone()-De(r).startOf("month").zone())),s+=i/a,"year"===e&&(s/=12)):(a=this-r,s="second"===e?a/1e3:"minute"===e?a/6e4:"hour"===e?a/36e5:"day"===e?(a-o)/864e5:"week"===e?(a-o)/6048e5:a),n?s:m(s)},from:function(t,e){return De.duration({to:this,from:t}).locale(this.locale()).humanize(!e)},fromNow:function(t){return this.from(De(),t)},calendar:function(t){var e=t||De(),n=I(e,this).startOf("day"),a=this.diff(n,"days",!0),s=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.localeData().calendar(s,this))},isLeapYear:function(){return U(this.year())},isDST:function(){return this.zone()+t):+this.clone().startOf(e)>+De(t).startOf(e)},isBefore:function(t,e){return e=w("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=De.isMoment(t)?t:De(t),+t>+this):+this.clone().startOf(e)<+De(t).startOf(e)},isSame:function(t,e){return e=w(e||"millisecond"),"millisecond"===e?(t=De.isMoment(t)?t:De(t),+this===+t):+this.clone().startOf(e)===+I(t,this).startOf(e)},min:i("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(t){return t=De.apply(null,arguments),this>t?this:t}),max:i("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(t){return t=De.apply(null,arguments),t>this?this:t}),zone:function(t,e){var n,a=this._offset||0;return null==t?this._isUTC?a:this._dateTzOffset():("string"==typeof t&&(t=Z(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(n=this._dateTzOffset()),this._offset=t,this._isUTC=!0,null!=n&&this.subtract(n,"m"),a!==t&&(!e||this._changeInProgress?g(this,De.duration(a-t,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,De.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this -},hasAlignedHourOffset:function(t){return t=t?De(t).zone():0,(this.zone()-t)%60===0},daysInMonth:function(){return T(this.year(),this.month())},dayOfYear:function(t){var e=Me((De(this).startOf("day")-De(this).startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},quarter:function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},weekYear:function(t){var e=oe(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==t?e:this.add(t-e,"y")},isoWeekYear:function(t){var e=oe(this,1,4).year;return null==t?e:this.add(t-e,"y")},week:function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},isoWeek:function(t){var e=oe(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},weekday:function(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},isoWeekday:function(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)},isoWeeksInYear:function(){return O(this.year(),1,4)},weeksInYear:function(){var t=this.localeData()._week;return O(this.year(),t.dow,t.doy)},get:function(t){return t=w(t),this[t]()},set:function(t,e){return t=w(t),"function"==typeof this[t]&&this[t](e),this},locale:function(e){var n;return e===t?this._locale._abbr:(n=De.localeData(e),null!=n&&(this._locale=n),this)},lang:i("moment().lang() is deprecated. Use moment().localeData() instead.",function(e){return e===t?this.localeData():this.locale(e)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),De.fn.millisecond=De.fn.milliseconds=me("Milliseconds",!1),De.fn.second=De.fn.seconds=me("Seconds",!1),De.fn.minute=De.fn.minutes=me("Minutes",!1),De.fn.hour=De.fn.hours=me("Hours",!0),De.fn.date=me("Date",!0),De.fn.dates=i("dates accessor is deprecated. Use date instead.",me("Date",!0)),De.fn.year=me("FullYear",!0),De.fn.years=i("years accessor is deprecated. Use year instead.",me("FullYear",!0)),De.fn.days=De.fn.day,De.fn.months=De.fn.month,De.fn.weeks=De.fn.week,De.fn.isoWeeks=De.fn.isoWeek,De.fn.quarters=De.fn.quarter,De.fn.toJSON=De.fn.toISOString,h(De.duration.fn=l.prototype,{_bubble:function(){var t,e,n,a=this._milliseconds,s=this._days,i=this._months,r=this._data,o=0;r.milliseconds=a%1e3,t=m(a/1e3),r.seconds=t%60,e=m(t/60),r.minutes=e%60,n=m(e/60),r.hours=n%24,s+=m(n/24),o=m(_e(s)),s-=m(pe(o)),i+=m(s/30),s%=30,o+=m(i/12),i%=12,r.days=s,r.months=i,r.years=o},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return m(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12)},humanize:function(t){var e=re(this,!t,this.localeData());return t&&(e=this.localeData().pastFuture(+this,e)),this.localeData().postformat(e)},add:function(t,e){var n=De.duration(t,e);return this._milliseconds+=n._milliseconds,this._days+=n._days,this._months+=n._months,this._bubble(),this},subtract:function(t,e){var n=De.duration(t,e);return this._milliseconds-=n._milliseconds,this._days-=n._days,this._months-=n._months,this._bubble(),this},get:function(t){return t=w(t),this[t.toLowerCase()+"s"]()},as:function(t){var e,n;if(t=w(t),"month"===t||"year"===t)return e=this._days+this._milliseconds/864e5,n=this._months+12*_e(e),"month"===t?n:n/12;switch(e=this._days+pe(this._months/12),t){case"week":return e/7+this._milliseconds/6048e5;case"day":return e+this._milliseconds/864e5;case"hour":return 24*e+this._milliseconds/36e5;case"minute":return 24*e*60+this._milliseconds/6e4;case"second":return 24*e*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*e*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+t)}},lang:De.fn.lang,locale:De.fn.locale,toIsoString:i("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var t=Math.abs(this.years()),e=Math.abs(this.months()),n=Math.abs(this.days()),a=Math.abs(this.hours()),s=Math.abs(this.minutes()),i=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(t?t+"Y":"")+(e?e+"M":"")+(n?n+"D":"")+(a||s||i?"T":"")+(a?a+"H":"")+(s?s+"M":"")+(i?i+"S":""):"P0D"},localeData:function(){return this._locale}}),De.duration.fn.toString=De.duration.fn.toISOString;for(ge in rn)n(rn,ge)&&ye(ge.toLowerCase());return De.duration.fn.asMilliseconds=function(){return this.as("ms")},De.duration.fn.asSeconds=function(){return this.as("s")},De.duration.fn.asMinutes=function(){return this.as("m")},De.duration.fn.asHours=function(){return this.as("h")},De.duration.fn.asDays=function(){return this.as("d")},De.duration.fn.asWeeks=function(){return this.as("weeks")},De.duration.fn.asMonths=function(){return this.as("M")},De.duration.fn.asYears=function(){return this.as("y")},De.locale("en",{ordinal:function(t){var e=t%10,n=1===S(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),De}.call(this),t.Utils.moment=n,t.datepicker}); \ No newline at end of file diff --git a/js/components/form-password.js b/js/components/form-password.js deleted file mode 100755 index b0b0e60..0000000 --- a/js/components/form-password.js +++ /dev/null @@ -1,67 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-form-password", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - UI.component('formPassword', { - - defaults: { - "lblShow": "Show", - "lblHide": "Hide" - }, - - boot: function() { - // init code - UI.$html.on("click.formpassword.uikit", "[data-uk-form-password]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("formPassword")) { - - e.preventDefault(); - - UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password"))); - ele.trigger("click"); - } - }); - }, - - init: function() { - - var $this = this; - - this.on("click", function(e) { - - e.preventDefault(); - - if($this.input.length) { - var type = $this.input.attr("type"); - $this.input.attr("type", type=="text" ? "password":"text"); - $this.element.html($this.options[type=="text" ? "lblShow":"lblHide"]); - } - }); - - this.input = this.element.next("input").length ? this.element.next("input") : this.element.prev("input"); - this.element.html(this.options[this.input.is("[type='password']") ? "lblShow":"lblHide"]); - - - this.element.data("formPassword", this); - } - }); - - return UI.formPassword; -}); diff --git a/js/components/form-password.min.js b/js/components/form-password.min.js deleted file mode 100755 index b358994..0000000 --- a/js/components/form-password.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";return t.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){t.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(i){var e=t.$(this);e.data("formPassword")||(i.preventDefault(),t.formPassword(e,t.Utils.options(e.attr("data-uk-form-password"))),e.trigger("click"))})},init:function(){var t=this;this.on("click",function(i){if(i.preventDefault(),t.input.length){var e=t.input.attr("type");t.input.attr("type","text"==e?"password":"text"),t.element.html(t.options["text"==e?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.html(this.options[this.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),t.formPassword}); \ No newline at end of file diff --git a/js/components/form-select.js b/js/components/form-select.js deleted file mode 100755 index 8f081fb..0000000 --- a/js/components/form-select.js +++ /dev/null @@ -1,77 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-form-select", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - UI.component('formSelect', { - - defaults: { - 'target': '>span:first', - 'activeClass': 'uk-active' - }, - - boot: function() { - // init code - UI.ready(function(context) { - - UI.$("[data-uk-form-select]", context).each(function(){ - - var ele = UI.$(this); - - if (!ele.data("formSelect")) { - UI.formSelect(ele, UI.Utils.options(ele.attr("data-uk-form-select"))); - } - }); - }); - }, - - init: function() { - var $this = this; - - this.target = this.find(this.options.target); - this.select = this.find('select'); - - // init + on change event - this.select.on("change", (function(){ - - var select = $this.select[0], fn = function(){ - - try { - if($this.options.target === 'input') - { - $this.target.val(select.options[select.selectedIndex].text); - } - else - { - $this.target.text(select.options[select.selectedIndex].text); - } - } catch(e) {} - - $this.element[$this.select.val() ? 'addClass':'removeClass']($this.options.activeClass); - - return fn; - }; - - return fn(); - })()); - - this.element.data("formSelect", this); - } - }); - - return UI.formSelect; -}); diff --git a/js/components/form-select.min.js b/js/components/form-select.min.js deleted file mode 100755 index ee92f53..0000000 --- a/js/components/form-select.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("formSelect",{defaults:{target:">span:first",activeClass:"uk-active"},boot:function(){t.ready(function(e){t.$("[data-uk-form-select]",e).each(function(){var e=t.$(this);e.data("formSelect")||t.formSelect(e,t.Utils.options(e.attr("data-uk-form-select")))})})},init:function(){var t=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on("change",function(){var e=t.select[0],i=function(){try{"input"===t.options.target?t.target.val(e.options[e.selectedIndex].text):t.target.text(e.options[e.selectedIndex].text)}catch(n){}return t.element[t.select.val()?"addClass":"removeClass"](t.options.activeClass),i};return i()}()),this.element.data("formSelect",this)}}),t.formSelect}); \ No newline at end of file diff --git a/js/components/grid-parallax.js b/js/components/grid-parallax.js deleted file mode 100755 index 45b7a9e..0000000 --- a/js/components/grid-parallax.js +++ /dev/null @@ -1,168 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-grid-parallax", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - var parallaxes = [], checkParallaxes = function() { - - requestAnimationFrame(function(){ - for (var i=0; i < parallaxes.length; i++) { - parallaxes[i].process(); - } - }); - }; - - - UI.component('gridparallax', { - - defaults: { - target : false, - smooth : 150, - translate : 150 - }, - - boot: function() { - - // listen to scroll and resize - UI.$doc.on("scrolling.uk.document", checkParallaxes); - UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){ - checkParallaxes(); - }, 50)); - - // init code - UI.ready(function(context) { - - UI.$('[data-uk-grid-parallax]', context).each(function() { - - var parallax = UI.$(this); - - if (!parallax.data("gridparallax")) { - UI.gridparallax(parallax, UI.Utils.options(parallax.attr("data-uk-grid-parallax"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.initItems().process(); - parallaxes.push(this); - - UI.$win.on('load resize orientationchange', (function() { - - var fn = function() { - var columns = getcolumns($this.element); - - $this.element.css('margin-bottom', ''); - - if (columns > 1) { - $this.element.css('margin-bottom', $this.options.translate + parseInt($this.element.css('margin-bottom'))); - } - }; - - UI.$(function() { fn(); }); - - return UI.Utils.debounce(fn, 50); - })()); - }, - - initItems: function() { - - var smooth = this.options.smooth; - - this.items = (this.options.target ? this.element.find(this.options.target) : this.element.children()).each(function(){ - UI.$(this).css({ - transition: 'transform '+smooth+'ms linear', - transform: '' - }); - }); - - return this; - }, - - process: function() { - - var percent = percentageInViewport(this.element), - columns = getcolumns(this.element), - items = this.items, - mods = [(columns-1)]; - - if (columns == 1 || !percent) { - items.css('transform', ''); - return; - } - - while(mods.length < columns) { - if(!(mods[mods.length-1] - 2)) break; - mods.push(mods[mods.length-1] - 2); - } - - var translate = this.options.translate, percenttranslate = percent * translate; - - items.each(function(idx, ele, translate){ - translate = mods.indexOf((idx+1) % columns) != -1 ? percenttranslate : percenttranslate / 8; - UI.$(this).css('transform', 'translate3d(0,'+(translate)+'px, 0)'); - }); - } - - }); - - - function getcolumns(element) { - - var children = element.children(), - first = children.filter(':visible:first'), - top = first[0].offsetTop + first.outerHeight(); - - for (var column=0;column= top) break; - } - - return column || 1; - } - - function percentageInViewport(element) { - - var top = element.offset().top, - height = element.outerHeight(), - scrolltop = UIkit.$win.scrollTop(), - wh = window.innerHeight, - distance, percentage, percent; - - if (top > (scrolltop + wh)) { - percent = 0; - } else if ((top + height) < scrolltop) { - percent = 1; - } else { - - if ((top + height) < wh) { - percent = (scrolltop < wh ? scrolltop : scrolltop - wh) / (top+height); - } else { - - distance = (scrolltop + wh) - top; - percentage = Math.round(distance / ((wh + height) / 100)); - percent = percentage/100; - } - - if (top < wh) { - percent = percent * scrolltop / ((top + height) - wh); - } - } - - return percent > 1 ? 1:percent; - } -}); \ No newline at end of file diff --git a/js/components/grid-parallax.min.js b/js/components/grid-parallax.min.js deleted file mode 100755 index fddc517..0000000 --- a/js/components/grid-parallax.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var n;window.UIkit&&(n=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-grid-parallax",["uikit"],function(){return n||t(UIkit)})}(function(t){function n(t){for(var n=t.children(),i=n.filter(":visible:first"),e=i[0].offsetTop+i.outerHeight(),o=0;o=e);o++);return o||1}function i(t){var n,i,e,o=t.offset().top,r=t.outerHeight(),s=UIkit.$win.scrollTop(),a=window.innerHeight;return o>s+a?e=0:s>o+r?e=1:(a>o+r?e=(a>s?s:s-a)/(o+r):(n=s+a-o,i=Math.round(n/((a+r)/100)),e=i/100),a>o&&(e=e*s/(o+r-a))),e>1?1:e}var e=[],o=function(){requestAnimationFrame(function(){for(var t=0;t1&&i.element.css("margin-bottom",i.options.translate+parseInt(i.element.css("margin-bottom")))};return t.$(function(){e()}),t.Utils.debounce(e,50)}())},initItems:function(){var n=this.options.smooth;return this.items=(this.options.target?this.element.find(this.options.target):this.element.children()).each(function(){t.$(this).css({transition:"transform "+n+"ms linear",transform:""})}),this},process:function(){var e=i(this.element),o=n(this.element),r=this.items,s=[o-1];if(1==o||!e)return r.css("transform",""),void 0;for(;s.length -1) infilter = true; - }); - } - - elements[infilter ? "visible":"hidden"].push(ele); - }); - - // convert to jQuery collections - elements.hidden = UI.$(elements.hidden).map(function () {return this[0];}); - elements.visible = UI.$(elements.visible).map(function () {return this[0];}); - - elements.hidden.attr('aria-hidden', 'true').filter(':visible').fadeOut(this.options.duration); - elements.visible.attr('aria-hidden', 'false').filter(':hidden').css('opacity', 0).show(); - - $this.updateLayout(elements.visible); - - if (this.controls && this.controls.length) { - this.controls.find('[data-uk-filter]').removeClass('uk-active').filter('[data-uk-filter="'+filter+'"]').addClass('uk-active'); - } - }, - - sort: function(by, order){ - - order = order || 1; - - // covert from string (asc|desc) to number - if (typeof(order) === 'string') { - order = order.toLowerCase() == 'desc' ? -1 : 1; - } - - var elements = this.element.children(); - - elements.sort(function(a, b){ - - a = UI.$(a); - b = UI.$(b); - - return (b.data(by) || '') < (a.data(by) || '') ? order : (order*-1); - - }).appendTo(this.element); - - this.updateLayout(elements.filter(':visible')); - - if (this.controls && this.controls.length) { - this.controls.find('[data-uk-sort]').removeClass('uk-active').filter('[data-uk-sort="'+by+':'+(order == -1 ? 'desc':'asc')+'"]').addClass('uk-active'); - } - } - }); - - - /*! - * getSize v1.2.2 - * measure size of elements - * MIT license - * https://github.com/desandro/get-size - */ - function _getSize() { - - var prefixes = 'Webkit Moz ms Ms O'.split(' '); - var docElemStyle = document.documentElement.style; - - function getStyleProperty( propName ) { - if ( !propName ) { - return; - } - - // test standard property first - if ( typeof docElemStyle[ propName ] === 'string' ) { - return propName; - } - - // capitalize - propName = propName.charAt(0).toUpperCase() + propName.slice(1); - - // test vendor specific properties - var prefixed; - for ( var i=0, len = prefixes.length; i < len; i++ ) { - prefixed = prefixes[i] + propName; - if ( typeof docElemStyle[ prefixed ] === 'string' ) { - return prefixed; - } - } - } - - // -------------------------- helpers -------------------------- // - - // get a number from a string, not a percentage - function getStyleSize( value ) { - var num = parseFloat( value ); - // not a percent like '100%', and a number - var isValid = value.indexOf('%') === -1 && !isNaN( num ); - return isValid && num; - } - - function noop() {} - - var logError = typeof console === 'undefined' ? noop : function( message ) { - console.error( message ); - }; - - // -------------------------- measurements -------------------------- // - - var measurements = [ - 'paddingLeft', - 'paddingRight', - 'paddingTop', - 'paddingBottom', - 'marginLeft', - 'marginRight', - 'marginTop', - 'marginBottom', - 'borderLeftWidth', - 'borderRightWidth', - 'borderTopWidth', - 'borderBottomWidth' - ]; - - function getZeroSize() { - var size = { - width: 0, - height: 0, - innerWidth: 0, - innerHeight: 0, - outerWidth: 0, - outerHeight: 0 - }; - for ( var i=0, len = measurements.length; i < len; i++ ) { - var measurement = measurements[i]; - size[ measurement ] = 0; - } - return size; - } - - - // -------------------------- setup -------------------------- // - - var isSetup = false; - var getStyle, boxSizingProp, isBoxSizeOuter; - - /** - * setup vars and functions - * do it on initial getSize(), rather than on script load - * For Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=548397 - */ - function setup() { - // setup once - if ( isSetup ) { - return; - } - isSetup = true; - - var getComputedStyle = window.getComputedStyle; - getStyle = ( function() { - var getStyleFn = getComputedStyle ? - function( elem ) { - return getComputedStyle( elem, null ); - } : - function( elem ) { - return elem.currentStyle; - }; - - return function getStyle( elem ) { - var style = getStyleFn( elem ); - if ( !style ) { - logError( 'Style returned ' + style + - '. Are you running this code in a hidden iframe on Firefox? ' + - 'See http://bit.ly/getsizebug1' ); - } - return style; - }; - })(); - - // -------------------------- box sizing -------------------------- // - - boxSizingProp = getStyleProperty('boxSizing'); - - /** - * WebKit measures the outer-width on style.width on border-box elems - * IE & Firefox measures the inner-width - */ - if ( boxSizingProp ) { - var div = document.createElement('div'); - div.style.width = '200px'; - div.style.padding = '1px 2px 3px 4px'; - div.style.borderStyle = 'solid'; - div.style.borderWidth = '1px 2px 3px 4px'; - div.style[ boxSizingProp ] = 'border-box'; - - var body = document.body || document.documentElement; - body.appendChild( div ); - var style = getStyle( div ); - - isBoxSizeOuter = getStyleSize( style.width ) === 200; - body.removeChild( div ); - } - - } - - // -------------------------- getSize -------------------------- // - - function getSize( elem ) { - setup(); - - // use querySeletor if elem is string - if ( typeof elem === 'string' ) { - elem = document.querySelector( elem ); - } - - // do not proceed on non-objects - if ( !elem || typeof elem !== 'object' || !elem.nodeType ) { - return; - } - - var style = getStyle( elem ); - - // if hidden, everything is 0 - if ( style.display === 'none' ) { - return getZeroSize(); - } - - var size = {}; - size.width = elem.offsetWidth; - size.height = elem.offsetHeight; - - var isBorderBox = size.isBorderBox = !!( boxSizingProp && - style[ boxSizingProp ] && style[ boxSizingProp ] === 'border-box' ); - - // get all measurements - for ( var i=0, len = measurements.length; i < len; i++ ) { - var measurement = measurements[i]; - var value = style[ measurement ]; - - var num = parseFloat( value ); - // any 'auto', 'medium' value will be 0 - size[ measurement ] = !isNaN( num ) ? num : 0; - } - - var paddingWidth = size.paddingLeft + size.paddingRight; - var paddingHeight = size.paddingTop + size.paddingBottom; - var marginWidth = size.marginLeft + size.marginRight; - var marginHeight = size.marginTop + size.marginBottom; - var borderWidth = size.borderLeftWidth + size.borderRightWidth; - var borderHeight = size.borderTopWidth + size.borderBottomWidth; - - var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; - - // overwrite width and height if we can get it from style - var styleWidth = getStyleSize( style.width ); - if ( styleWidth !== false ) { - size.width = styleWidth + - // add padding and border unless it's already including it - ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); - } - - var styleHeight = getStyleSize( style.height ); - if ( styleHeight !== false ) { - size.height = styleHeight + - // add padding and border unless it's already including it - ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); - } - - size.innerWidth = size.width - ( paddingWidth + borderWidth ); - size.innerHeight = size.height - ( paddingHeight + borderHeight ); - - size.outerWidth = size.width + marginWidth; - size.outerHeight = size.height + marginHeight; - - return size; - } - - return getSize; - - } - - function getElementSize(ele) { - return _getSize()(ele); - } -}); diff --git a/js/components/grid.min.js b/js/components/grid.min.js deleted file mode 100755 index 3eeedfe..0000000 --- a/js/components/grid.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-grid",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){function t(t){if(t){if("string"==typeof u[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var i,e=0,n=h.length;n>e;e++)if(i=h[e]+t,"string"==typeof u[i])return i}}function i(t){var i=parseFloat(t),e=-1===t.indexOf("%")&&!isNaN(i);return e&&i}function e(){}function n(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0,e=f.length;e>i;i++){var n=f[i];t[n]=0}return t}function r(){if(!c){c=!0;var e=window.getComputedStyle;if(a=function(){var t=e?function(t){return e(t,null)}:function(t){return t.currentStyle};return function(i){var e=t(i);return e||l("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}}(),s=t("boxSizing")){var n=document.createElement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderStyle="solid",n.style.borderWidth="1px 2px 3px 4px",n.style[s]="border-box";var r=document.body||document.documentElement;r.appendChild(n);var o=a(n);d=200===i(o.width),r.removeChild(n)}}}function o(t){if(r(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=a(t);if("none"===e.display)return n();var o={};o.width=t.offsetWidth,o.height=t.offsetHeight;for(var h=o.isBorderBox=!(!s||!e[s]||"border-box"!==e[s]),u=0,l=f.length;l>u;u++){var c=f[u],p=e[c],g=parseFloat(p);o[c]=isNaN(g)?0:g}var m=o.paddingLeft+o.paddingRight,v=o.paddingTop+o.paddingBottom,b=o.marginLeft+o.marginRight,y=o.marginTop+o.marginBottom,k=o.borderLeftWidth+o.borderRightWidth,w=o.borderTopWidth+o.borderBottomWidth,x=h&&d,W=i(e.width);W!==!1&&(o.width=W+(x?0:m+k));var L=i(e.height);return L!==!1&&(o.height=L+(x?0:v+w)),o.innerWidth=o.width-(m+k),o.innerHeight=o.height-(v+w),o.outerWidth=o.width+b,o.outerHeight=o.height+y,o}}var a,s,d,h="Webkit Moz ms Ms O".split(" "),u=document.documentElement.style,l="undefined"==typeof console?e:function(t){console.error(t)},f=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],c=!1;return o}function e(t){return i()(t)}t.component("grid",{defaults:{colwidth:"auto",animation:!0,duration:300,gutter:0,controls:!1,filter:!1},boot:function(){t.ready(function(i){t.$("[data-uk-grid]",i).each(function(){var i=t.$(this);i.data("grid")||t.grid(i,t.Utils.options(i.attr("data-uk-grid")))})})},init:function(){var i=this,e=String(this.options.gutter).trim().split(" ");this.gutterv=parseInt(e[0],10),this.gutterh=parseInt(e[1]||e[0],10),this.element.css({position:"relative"}),this.controls=null,this.options.controls&&(this.controls=t.$(this.options.controls),this.controls.on("click","[data-uk-filter]",function(e){e.preventDefault(),i.filter(t.$(this).attr("data-uk-filter"))}),this.controls.on("click","[data-uk-sort]",function(e){e.preventDefault();var n=t.$(this).attr("data-uk-sort").split(":");i.sort(n[0],n[1])})),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){i.currentfilter?i.filter(i.currentfilter):this.updateLayout()}.bind(this),100)),this.on("display.uk.check",function(){i.element.is(":visible")&&i.updateLayout()}),t.domObserve(this.element,function(){i.updateLayout()}),this.options.filter!==!1?this.filter(this.options.filter):this.updateLayout()},_prepareElements:function(){var t,i=this.element.children(":not([data-grid-prepared])");i.length&&(t={position:"absolute","box-sizing":"border-box",width:"auto"==this.options.colwidth?"":this.options.colwidth},this.options.gutter&&(t["padding-left"]=this.gutterh,t["padding-bottom"]=this.gutterv,this.element.css("margin-left",-1*this.gutterh)),i.attr("data-grid-prepared","true").css(t))},updateLayout:function(i){this._prepareElements(),i=i||this.element.children(":visible");var n,r,o,a,s,d,h,u,l=i,f=this.element.width()+2*this.gutterh+2,c=0,p=0,g=[];this.trigger("beforeupdate.uk.grid",[l]),l.each(function(){for(u=e(this),n=t.$(this),r=u.outerWidth,o=u.outerHeight,c=0,p=0,s=0,h=g.length;h>s;s++)a=g[s],c<=a.aX&&(c=a.aX),c+r>f&&(c=0),p<=a.aY&&(p=a.aY);g.push({ele:n,top:p,left:c,width:r,height:o,aY:p+o,aX:c+r})});var m,v=0;for(s=0,h=g.length;h>s;s++){for(a=g[s],p=0,d=0;s>d;d++)m=g[d],a.left-1&&(o=!0)})),r[o?"visible":"hidden"].push(e)}),r.hidden=t.$(r.hidden).map(function(){return this[0]}),r.visible=t.$(r.visible).map(function(){return this[0]}),r.hidden.attr("aria-hidden","true").filter(":visible").fadeOut(this.options.duration),r.visible.attr("aria-hidden","false").filter(":hidden").css("opacity",0).show(),e.updateLayout(r.visible),this.controls&&this.controls.length&&this.controls.find("[data-uk-filter]").removeClass("uk-active").filter('[data-uk-filter="'+i+'"]').addClass("uk-active")},sort:function(i,e){e=e||1,"string"==typeof e&&(e="desc"==e.toLowerCase()?-1:1);var n=this.element.children();n.sort(function(n,r){return n=t.$(n),r=t.$(r),(r.data(i)||"")<(n.data(i)||"")?e:-1*e}).appendTo(this.element),this.updateLayout(n.filter(":visible")),this.controls&&this.controls.length&&this.controls.find("[data-uk-sort]").removeClass("uk-active").filter('[data-uk-sort="'+i+":"+(-1==e?"desc":"asc")+'"]').addClass("uk-active")}})}); \ No newline at end of file diff --git a/js/components/htmleditor.js b/js/components/htmleditor.js deleted file mode 100755 index 68b5b52..0000000 --- a/js/components/htmleditor.js +++ /dev/null @@ -1,679 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-htmleditor", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI) { - - "use strict"; - - var editors = []; - - UI.component('htmleditor', { - - defaults: { - iframe : false, - mode : 'split', - markdown : false, - autocomplete : true, - enablescripts: false, - height : 500, - maxsplitsize : 1000, - codemirror : { mode: 'htmlmixed', lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false} }, - toolbar : [ 'bold', 'italic', 'strike', 'link', 'image', 'blockquote', 'listUl', 'listOl' ], - lblPreview : 'Preview', - lblCodeview : 'HTML', - lblMarkedview: 'Markdown' - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$('textarea[data-uk-htmleditor]', context).each(function() { - - var editor = UI.$(this); - - if (!editor.data('htmleditor')) { - UI.htmleditor(editor, UI.Utils.options(editor.attr('data-uk-htmleditor'))); - } - }); - }); - }, - - init: function() { - - var $this = this, tpl = UI.components.htmleditor.template; - - this.CodeMirror = this.options.CodeMirror || CodeMirror; - this.buttons = {}; - - tpl = tpl.replace(/\{:lblPreview}/g, this.options.lblPreview); - tpl = tpl.replace(/\{:lblCodeview}/g, this.options.lblCodeview); - - this.htmleditor = UI.$(tpl); - this.content = this.htmleditor.find('.uk-htmleditor-content'); - this.toolbar = this.htmleditor.find('.uk-htmleditor-toolbar'); - this.preview = this.htmleditor.find('.uk-htmleditor-preview').children().eq(0); - this.code = this.htmleditor.find('.uk-htmleditor-code'); - - this.element.before(this.htmleditor).appendTo(this.code); - this.editor = this.CodeMirror.fromTextArea(this.element[0], this.options.codemirror); - this.editor.htmleditor = this; - this.editor.on('change', UI.Utils.debounce(function() { $this.render(); }, 150)); - this.editor.on('change', function() { - $this.editor.save(); - $this.element.trigger('input'); - }); - this.code.find('.CodeMirror').css('height', this.options.height); - - // iframe mode? - if (this.options.iframe) { - - this.iframe = UI.$(''); - this.preview.append(this.iframe); - - // must open and close document object to start using it! - this.iframe[0].contentWindow.document.open(); - this.iframe[0].contentWindow.document.close(); - - this.preview.container = UI.$(this.iframe[0].contentWindow.document).find('body'); - - // append custom stylesheet - if (typeof(this.options.iframe) === 'string') { - this.preview.container.parent().append(''); - } - - } else { - this.preview.container = this.preview; - } - - UI.$win.on('resize load', UI.Utils.debounce(function() { $this.fit(); }, 200)); - - var previewContainer = this.iframe ? this.preview.container:$this.preview.parent(), - codeContent = this.code.find('.CodeMirror-sizer'), - codeScroll = this.code.find('.CodeMirror-scroll').on('scroll', UI.Utils.debounce(function() { - - if ($this.htmleditor.attr('data-mode') == 'tab') return; - - // calc position - var codeHeight = codeContent.height() - codeScroll.height(), - previewHeight = previewContainer[0].scrollHeight - ($this.iframe ? $this.iframe.height() : previewContainer.height()), - ratio = previewHeight / codeHeight, - previewPosition = codeScroll.scrollTop() * ratio; - - // apply new scroll - previewContainer.scrollTop(previewPosition); - - }, 10)); - - this.htmleditor.on('click', '.uk-htmleditor-button-code, .uk-htmleditor-button-preview', function(e) { - - e.preventDefault(); - - if ($this.htmleditor.attr('data-mode') == 'tab') { - - $this.htmleditor.find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview').removeClass('uk-active').filter(this).addClass('uk-active'); - - $this.activetab = UI.$(this).hasClass('uk-htmleditor-button-code') ? 'code' : 'preview'; - $this.htmleditor.attr('data-active-tab', $this.activetab); - $this.editor.refresh(); - } - }); - - // toolbar actions - this.htmleditor.on('click', 'a[data-htmleditor-button]', function() { - - if (!$this.code.is(':visible')) return; - - $this.trigger('action.' + UI.$(this).data('htmleditor-button'), [$this.editor]); - }); - - this.preview.parent().css('height', this.code.height()); - - // autocomplete - if (this.options.autocomplete && this.CodeMirror.showHint && this.CodeMirror.hint && this.CodeMirror.hint.html) { - - this.editor.on('inputRead', UI.Utils.debounce(function() { - var doc = $this.editor.getDoc(), POS = doc.getCursor(), mode = $this.CodeMirror.innerMode($this.editor.getMode(), $this.editor.getTokenAt(POS).state).mode.name; - - if (mode == 'xml') { //html depends on xml - - var cur = $this.editor.getCursor(), token = $this.editor.getTokenAt(cur); - - if (token.string.charAt(0) == '<' || token.type == 'attribute') { - $this.CodeMirror.showHint($this.editor, $this.CodeMirror.hint.html, { completeSingle: false }); - } - } - }, 100)); - } - - this.debouncedRedraw = UI.Utils.debounce(function () { $this.redraw(); }, 5); - - this.on('init.uk.component', function() { - $this.debouncedRedraw(); - }); - - this.element.attr('data-uk-check-display', 1).on('display.uk.check', function(e) { - if (this.htmleditor.is(":visible")) this.fit(); - }.bind(this)); - - editors.push(this); - }, - - addButton: function(name, button) { - this.buttons[name] = button; - }, - - addButtons: function(buttons) { - UI.$.extend(this.buttons, buttons); - }, - - replaceInPreview: function(regexp, callback) { - - var editor = this.editor, results = [], value = editor.getValue(), offset = -1, index = 0; - - this.currentvalue = this.currentvalue.replace(regexp, function() { - - offset = value.indexOf(arguments[0], ++offset); - - var match = { - matches: arguments, - from : translateOffset(offset), - to : translateOffset(offset + arguments[0].length), - replace: function(value) { - editor.replaceRange(value, match.from, match.to); - }, - inRange: function(cursor) { - - if (cursor.line === match.from.line && cursor.line === match.to.line) { - return cursor.ch >= match.from.ch && cursor.ch < match.to.ch; - } - - return (cursor.line === match.from.line && cursor.ch >= match.from.ch) || - (cursor.line > match.from.line && cursor.line < match.to.line) || - (cursor.line === match.to.line && cursor.ch < match.to.ch); - } - }; - - var result = typeof(callback) === 'string' ? callback : callback(match, index); - - if (!result && result !== '') { - return arguments[0]; - } - - index++; - - results.push(match); - return result; - }); - - function translateOffset(offset) { - var result = editor.getValue().substring(0, offset).split('\n'); - return { line: result.length - 1, ch: result[result.length - 1].length } - } - - return results; - }, - - _buildtoolbar: function() { - - if (!(this.options.toolbar && this.options.toolbar.length)) return; - - var $this = this, bar = []; - - this.toolbar.empty(); - - this.options.toolbar.forEach(function(button) { - if (!$this.buttons[button]) return; - - var title = $this.buttons[button].title ? $this.buttons[button].title : button; - - bar.push('
  • '+$this.buttons[button].label+'
  • '); - }); - - this.toolbar.html(bar.join('\n')); - }, - - fit: function() { - - var mode = this.options.mode; - - if (mode == 'split' && this.htmleditor.width() < this.options.maxsplitsize) { - mode = 'tab'; - } - - if (mode == 'tab') { - if (!this.activetab) { - this.activetab = 'code'; - this.htmleditor.attr('data-active-tab', this.activetab); - } - - this.htmleditor.find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview').removeClass('uk-active') - .filter(this.activetab == 'code' ? '.uk-htmleditor-button-code' : '.uk-htmleditor-button-preview') - .addClass('uk-active'); - } - - this.editor.refresh(); - this.preview.parent().css('height', this.code.height()); - - this.htmleditor.attr('data-mode', mode); - }, - - redraw: function() { - this._buildtoolbar(); - this.render(); - this.fit(); - }, - - getMode: function() { - return this.editor.getOption('mode'); - }, - - getCursorMode: function() { - var param = { mode: 'html'}; - this.trigger('cursorMode', [param]); - return param.mode; - }, - - render: function() { - - this.currentvalue = this.editor.getValue(); - - if (!this.options.enablescripts) { - this.currentvalue = this.currentvalue.replace(/<(script|style)\b[^<]*(?:(?!<\/(script|style)>)<[^<]*)*<\/(script|style)>/img, ''); - } - - // empty code - if (!this.currentvalue) { - - this.element.val(''); - this.preview.container.html(''); - - return; - } - - this.trigger('render', [this]); - this.trigger('renderLate', [this]); - - this.preview.container.html(this.currentvalue); - }, - - addShortcut: function(name, callback) { - var map = {}; - if (!UI.$.isArray(name)) { - name = [name]; - } - - name.forEach(function(key) { - map[key] = callback; - }); - - this.editor.addKeyMap(map); - - return map; - }, - - addShortcutAction: function(action, shortcuts) { - var editor = this; - this.addShortcut(shortcuts, function() { - editor.element.trigger('action.' + action, [editor.editor]); - }); - }, - - replaceSelection: function(replace) { - - var text = this.editor.getSelection(); - - if (!text.length) { - - var cur = this.editor.getCursor(), - curLine = this.editor.getLine(cur.line), - start = cur.ch, - end = start; - - while (end < curLine.length && /[\w$]+/.test(curLine.charAt(end))) ++end; - while (start && /[\w$]+/.test(curLine.charAt(start - 1))) --start; - - var curWord = start != end && curLine.slice(start, end); - - if (curWord) { - this.editor.setSelection({ line: cur.line, ch: start}, { line: cur.line, ch: end }); - text = curWord; - } - } - - var html = replace.replace('$1', text); - - this.editor.replaceSelection(html, 'end'); - this.editor.focus(); - }, - - replaceLine: function(replace) { - var pos = this.editor.getDoc().getCursor(), - text = this.editor.getLine(pos.line), - html = replace.replace('$1', text); - - this.editor.replaceRange(html , { line: pos.line, ch: 0 }, { line: pos.line, ch: text.length }); - this.editor.setCursor({ line: pos.line, ch: html.length }); - this.editor.focus(); - }, - - save: function() { - this.editor.save(); - } - }); - - - UI.components.htmleditor.template = [ - '
    ', - '
    ', - '
      ', - '
      ', - '', - '
      ', - '
      ', - '
      ', - '
      ', - '
      ', - '
      ', - '
      ' - ].join(''); - - - UI.plugin('htmleditor', 'base', { - - init: function(editor) { - - editor.addButtons({ - - fullscreen: { - title : 'Fullscreen', - label : '' - }, - bold : { - title : 'Bold', - label : '' - }, - italic : { - title : 'Italic', - label : '' - }, - strike : { - title : 'Strikethrough', - label : '' - }, - blockquote : { - title : 'Blockquote', - label : '' - }, - link : { - title : 'Link', - label : '' - }, - image : { - title : 'Image', - label : '' - }, - listUl : { - title : 'Unordered List', - label : '' - }, - listOl : { - title : 'Ordered List', - label : '' - } - - }); - - addAction('bold', '$1'); - addAction('italic', '$1'); - addAction('strike', '$1'); - addAction('blockquote', '

      $1

      ', 'replaceLine'); - addAction('link', '$1'); - addAction('image', '$1'); - - var listfn = function(tag) { - if (editor.getCursorMode() == 'html') { - - tag = tag || 'ul'; - - var cm = editor.editor, - doc = cm.getDoc(), - pos = doc.getCursor(true), - posend = doc.getCursor(false), - im = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(cm.getCursor()).state), - inList = im && im.state && im.state.context && ['ul','ol'].indexOf(im.state.context.tagName) != -1; - - for (var i=pos.line; i<(posend.line+1);i++) { - cm.replaceRange('
    • '+cm.getLine(i)+'
    • ', { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length }); - } - - if (!inList) { - cm.replaceRange('<'+tag+'>'+"\n"+cm.getLine(pos.line), { line: pos.line, ch: 0 }, { line: pos.line, ch: cm.getLine(pos.line).length }); - cm.replaceRange(cm.getLine((posend.line+1))+"\n"+'', { line: (posend.line+1), ch: 0 }, { line: (posend.line+1), ch: cm.getLine((posend.line+1)).length }); - cm.setCursor({ line: posend.line+1, ch: cm.getLine(posend.line+1).length }); - } else { - cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }); - } - - cm.focus(); - } - }; - - editor.on('action.listUl', function() { - listfn('ul'); - }); - - editor.on('action.listOl', function() { - listfn('ol'); - }); - - editor.htmleditor.on('click', 'a[data-htmleditor-button="fullscreen"]', function() { - - editor.htmleditor.toggleClass('uk-htmleditor-fullscreen'); - - var wrap = editor.editor.getWrapperElement(); - - if (editor.htmleditor.hasClass('uk-htmleditor-fullscreen')) { - - var fixedParent = false, parents = editor.htmleditor.parents().each(function(){ - if (UI.$(this).css('position')=='fixed' && !UI.$(this).is('html')) { - fixedParent = UI.$(this); - } - }); - - editor.htmleditor.data('fixedParents', false); - - if (fixedParent) { - - var transformed = []; - - fixedParent = fixedParent.parent().find(parents).each(function(){ - - if (UI.$(this).css('transform') != 'none') { - transformed.push(UI.$(this).data('transform-reset', { - 'transform': this.style.transform, - '-webkit-transform': this.style.webkitTransform, - '-webkit-transition':this.style.webkitTransition, - 'transition':this.style.transition - }).css({ - 'transform': 'none', - '-webkit-transform': 'none', - '-webkit-transition':'none', - 'transition':'none' - })); - } - }); - - editor.htmleditor.data('fixedParents', transformed); - } - - editor.editor.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, width: wrap.style.width, height: wrap.style.height}; - wrap.style.width = ''; - wrap.style.height = editor.content.height()+'px'; - document.documentElement.style.overflow = 'hidden'; - - } else { - - document.documentElement.style.overflow = ''; - var info = editor.editor.state.fullScreenRestore; - wrap.style.width = info.width; wrap.style.height = info.height; - window.scrollTo(info.scrollLeft, info.scrollTop); - - if (editor.htmleditor.data('fixedParents')) { - editor.htmleditor.data('fixedParents').forEach(function(parent){ - parent.css(parent.data('transform-reset')); - }); - } - } - - setTimeout(function() { - editor.fit(); - UI.$win.trigger('resize'); - }, 50); - }); - - editor.addShortcut(['Ctrl-S', 'Cmd-S'], function() { editor.element.trigger('htmleditor-save', [editor]); }); - editor.addShortcutAction('bold', ['Ctrl-B', 'Cmd-B']); - - function addAction(name, replace, mode) { - editor.on('action.'+name, function() { - if (editor.getCursorMode() == 'html') { - editor[mode == 'replaceLine' ? 'replaceLine' : 'replaceSelection'](replace); - } - }); - } - } - }); - - UI.plugin('htmleditor', 'markdown', { - - init: function(editor) { - - var parser = editor.options.mdparser || window.marked || null; - - if (!parser) return; - - if (editor.options.markdown) { - enableMarkdown(); - } - - addAction('bold', '**$1**'); - addAction('italic', '*$1*'); - addAction('strike', '~~$1~~'); - addAction('blockquote', '> $1', 'replaceLine'); - addAction('link', '[$1](http://)'); - addAction('image', '![$1](http://)'); - - editor.on('action.listUl', function() { - - if (editor.getCursorMode() == 'markdown') { - - var cm = editor.editor, - pos = cm.getDoc().getCursor(true), - posend = cm.getDoc().getCursor(false); - - for (var i=pos.line; i<(posend.line+1);i++) { - cm.replaceRange('* '+cm.getLine(i), { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length }); - } - - cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }); - cm.focus(); - } - }); - - editor.on('action.listOl', function() { - - if (editor.getCursorMode() == 'markdown') { - - var cm = editor.editor, - pos = cm.getDoc().getCursor(true), - posend = cm.getDoc().getCursor(false), - prefix = 1; - - if (pos.line > 0) { - var prevline = cm.getLine(pos.line-1), matches; - - if(matches = prevline.match(/^(\d+)\./)) { - prefix = Number(matches[1])+1; - } - } - - for (var i=pos.line; i<(posend.line+1);i++) { - cm.replaceRange(prefix+'. '+cm.getLine(i), { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length }); - prefix++; - } - - cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }); - cm.focus(); - } - }); - - editor.on('renderLate', function() { - if (editor.editor.options.mode == 'gfm') { - editor.currentvalue = parser(editor.currentvalue); - } - }); - - editor.on('cursorMode', function(e, param) { - if (editor.editor.options.mode == 'gfm') { - var pos = editor.editor.getDoc().getCursor(); - if (!editor.editor.getTokenAt(pos).state.base.htmlState) { - param.mode = 'markdown'; - } - } - }); - - UI.$.extend(editor, { - - enableMarkdown: function() { - enableMarkdown(); - this.render(); - }, - disableMarkdown: function() { - this.editor.setOption('mode', 'htmlmixed'); - this.htmleditor.find('.uk-htmleditor-button-code a').html(this.options.lblCodeview); - this.render(); - } - - }); - - // switch markdown mode on event - editor.on({ - enableMarkdown : function() { editor.enableMarkdown(); }, - disableMarkdown : function() { editor.disableMarkdown(); } - }); - - function enableMarkdown() { - editor.editor.setOption('mode', 'gfm'); - editor.htmleditor.find('.uk-htmleditor-button-code a').html(editor.options.lblMarkedview); - } - - function addAction(name, replace, mode) { - editor.on('action.'+name, function() { - if (editor.getCursorMode() == 'markdown') { - editor[mode == 'replaceLine' ? 'replaceLine' : 'replaceSelection'](replace); - } - }); - } - } - }); - - return UI.htmleditor; -}); diff --git a/js/components/htmleditor.min.js b/js/components/htmleditor.min.js deleted file mode 100755 index a62f47e..0000000 --- a/js/components/htmleditor.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-htmleditor",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e=[];return t.component("htmleditor",{defaults:{iframe:!1,mode:"split",markdown:!1,autocomplete:!0,enablescripts:!1,height:500,maxsplitsize:1e3,codemirror:{mode:"htmlmixed",lineWrapping:!0,dragDrop:!1,autoCloseTags:!0,matchTags:!0,autoCloseBrackets:!0,matchBrackets:!0,indentUnit:4,indentWithTabs:!1,tabSize:4,hintOptions:{completionSingle:!1}},toolbar:["bold","italic","strike","link","image","blockquote","listUl","listOl"],lblPreview:"Preview",lblCodeview:"HTML",lblMarkedview:"Markdown"},boot:function(){t.ready(function(e){t.$("textarea[data-uk-htmleditor]",e).each(function(){var e=t.$(this);e.data("htmleditor")||t.htmleditor(e,t.Utils.options(e.attr("data-uk-htmleditor")))})})},init:function(){var i=this,o=t.components.htmleditor.template;this.CodeMirror=this.options.CodeMirror||CodeMirror,this.buttons={},o=o.replace(/\{:lblPreview}/g,this.options.lblPreview),o=o.replace(/\{:lblCodeview}/g,this.options.lblCodeview),this.htmleditor=t.$(o),this.content=this.htmleditor.find(".uk-htmleditor-content"),this.toolbar=this.htmleditor.find(".uk-htmleditor-toolbar"),this.preview=this.htmleditor.find(".uk-htmleditor-preview").children().eq(0),this.code=this.htmleditor.find(".uk-htmleditor-code"),this.element.before(this.htmleditor).appendTo(this.code),this.editor=this.CodeMirror.fromTextArea(this.element[0],this.options.codemirror),this.editor.htmleditor=this,this.editor.on("change",t.Utils.debounce(function(){i.render()},150)),this.editor.on("change",function(){i.editor.save(),i.element.trigger("input")}),this.code.find(".CodeMirror").css("height",this.options.height),this.options.iframe?(this.iframe=t.$(''),this.preview.append(this.iframe),this.iframe[0].contentWindow.document.open(),this.iframe[0].contentWindow.document.close(),this.preview.container=t.$(this.iframe[0].contentWindow.document).find("body"),"string"==typeof this.options.iframe&&this.preview.container.parent().append('')):this.preview.container=this.preview,t.$win.on("resize load",t.Utils.debounce(function(){i.fit()},200));var n=this.iframe?this.preview.container:i.preview.parent(),r=this.code.find(".CodeMirror-sizer"),l=this.code.find(".CodeMirror-scroll").on("scroll",t.Utils.debounce(function(){if("tab"!=i.htmleditor.attr("data-mode")){var t=r.height()-l.height(),e=n[0].scrollHeight-(i.iframe?i.iframe.height():n.height()),o=e/t,s=l.scrollTop()*o;n.scrollTop(s)}},10));this.htmleditor.on("click",".uk-htmleditor-button-code, .uk-htmleditor-button-preview",function(e){e.preventDefault(),"tab"==i.htmleditor.attr("data-mode")&&(i.htmleditor.find(".uk-htmleditor-button-code, .uk-htmleditor-button-preview").removeClass("uk-active").filter(this).addClass("uk-active"),i.activetab=t.$(this).hasClass("uk-htmleditor-button-code")?"code":"preview",i.htmleditor.attr("data-active-tab",i.activetab),i.editor.refresh())}),this.htmleditor.on("click","a[data-htmleditor-button]",function(){i.code.is(":visible")&&i.trigger("action."+t.$(this).data("htmleditor-button"),[i.editor])}),this.preview.parent().css("height",this.code.height()),this.options.autocomplete&&this.CodeMirror.showHint&&this.CodeMirror.hint&&this.CodeMirror.hint.html&&this.editor.on("inputRead",t.Utils.debounce(function(){var t=i.editor.getDoc(),e=t.getCursor(),o=i.CodeMirror.innerMode(i.editor.getMode(),i.editor.getTokenAt(e).state).mode.name;if("xml"==o){var n=i.editor.getCursor(),r=i.editor.getTokenAt(n);("<"==r.string.charAt(0)||"attribute"==r.type)&&i.CodeMirror.showHint(i.editor,i.CodeMirror.hint.html,{completeSingle:!1})}},100)),this.debouncedRedraw=t.Utils.debounce(function(){i.redraw()},5),this.on("init.uk.component",function(){i.debouncedRedraw()}),this.element.attr("data-uk-check-display",1).on("display.uk.check",function(){this.htmleditor.is(":visible")&&this.fit()}.bind(this)),e.push(this)},addButton:function(t,e){this.buttons[t]=e},addButtons:function(e){t.$.extend(this.buttons,e)},replaceInPreview:function(t,e){function i(t){var e=o.getValue().substring(0,t).split("\n");return{line:e.length-1,ch:e[e.length-1].length}}var o=this.editor,n=[],r=o.getValue(),l=-1,s=0;return this.currentvalue=this.currentvalue.replace(t,function(){l=r.indexOf(arguments[0],++l);var t={matches:arguments,from:i(l),to:i(l+arguments[0].length),replace:function(e){o.replaceRange(e,t.from,t.to)},inRange:function(e){return e.line===t.from.line&&e.line===t.to.line?e.ch>=t.from.ch&&e.ch=t.from.ch||e.line>t.from.line&&e.line'+t.buttons[i].label+"")}}),this.toolbar.html(e.join("\n"))}},fit:function(){var t=this.options.mode;"split"==t&&this.htmleditor.width())<[^<]*)*<\/(script|style)>/gim,"")),this.currentvalue?(this.trigger("render",[this]),this.trigger("renderLate",[this]),this.preview.container.html(this.currentvalue),void 0):(this.element.val(""),this.preview.container.html(""),void 0)},addShortcut:function(e,i){var o={};return t.$.isArray(e)||(e=[e]),e.forEach(function(t){o[t]=i}),this.editor.addKeyMap(o),o},addShortcutAction:function(t,e){var i=this;this.addShortcut(e,function(){i.element.trigger("action."+t,[i.editor])})},replaceSelection:function(t){var e=this.editor.getSelection();if(!e.length){for(var i=this.editor.getCursor(),o=this.editor.getLine(i.line),n=i.ch,r=n;r','
      ','
        ','
        ','","
        ","
        ",'
        ','
        ','
        ',"
        ",""].join(""),t.plugin("htmleditor","base",{init:function(e){function i(t,i,o){e.on("action."+t,function(){"html"==e.getCursorMode()&&e["replaceLine"==o?"replaceLine":"replaceSelection"](i)})}e.addButtons({fullscreen:{title:"Fullscreen",label:''},bold:{title:"Bold",label:''},italic:{title:"Italic",label:''},strike:{title:"Strikethrough",label:''},blockquote:{title:"Blockquote",label:''},link:{title:"Link",label:''},image:{title:"Image",label:''},listUl:{title:"Unordered List",label:''},listOl:{title:"Ordered List",label:''}}),i("bold","$1"),i("italic","$1"),i("strike","$1"),i("blockquote","

        $1

        ","replaceLine"),i("link",'$1'),i("image",'$1');var o=function(t){if("html"==e.getCursorMode()){t=t||"ul";for(var i=e.editor,o=i.getDoc(),n=o.getCursor(!0),r=o.getCursor(!1),l=CodeMirror.innerMode(i.getMode(),i.getTokenAt(i.getCursor()).state),s=l&&l.state&&l.state.context&&-1!=["ul","ol"].indexOf(l.state.context.tagName),a=n.line;a"+i.getLine(a)+"",{line:a,ch:0},{line:a,ch:i.getLine(a).length});s?i.setCursor({line:r.line,ch:i.getLine(r.line).length}):(i.replaceRange("<"+t+">\n"+i.getLine(n.line),{line:n.line,ch:0},{line:n.line,ch:i.getLine(n.line).length}),i.replaceRange(i.getLine(r.line+1)+"\n",{line:r.line+1,ch:0},{line:r.line+1,ch:i.getLine(r.line+1).length}),i.setCursor({line:r.line+1,ch:i.getLine(r.line+1).length})),i.focus()}};e.on("action.listUl",function(){o("ul")}),e.on("action.listOl",function(){o("ol")}),e.htmleditor.on("click",'a[data-htmleditor-button="fullscreen"]',function(){e.htmleditor.toggleClass("uk-htmleditor-fullscreen");var i=e.editor.getWrapperElement();if(e.htmleditor.hasClass("uk-htmleditor-fullscreen")){var o=!1,n=e.htmleditor.parents().each(function(){"fixed"!=t.$(this).css("position")||t.$(this).is("html")||(o=t.$(this))});if(e.htmleditor.data("fixedParents",!1),o){var r=[];o=o.parent().find(n).each(function(){"none"!=t.$(this).css("transform")&&r.push(t.$(this).data("transform-reset",{transform:this.style.transform,"-webkit-transform":this.style.webkitTransform,"-webkit-transition":this.style.webkitTransition,transition:this.style.transition}).css({transform:"none","-webkit-transform":"none","-webkit-transition":"none",transition:"none"}))}),e.htmleditor.data("fixedParents",r)}e.editor.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:i.style.width,height:i.style.height},i.style.width="",i.style.height=e.content.height()+"px",document.documentElement.style.overflow="hidden"}else{document.documentElement.style.overflow="";var l=e.editor.state.fullScreenRestore;i.style.width=l.width,i.style.height=l.height,window.scrollTo(l.scrollLeft,l.scrollTop),e.htmleditor.data("fixedParents")&&e.htmleditor.data("fixedParents").forEach(function(t){t.css(t.data("transform-reset"))})}setTimeout(function(){e.fit(),t.$win.trigger("resize")},50)}),e.addShortcut(["Ctrl-S","Cmd-S"],function(){e.element.trigger("htmleditor-save",[e])}),e.addShortcutAction("bold",["Ctrl-B","Cmd-B"])}}),t.plugin("htmleditor","markdown",{init:function(e){function i(){e.editor.setOption("mode","gfm"),e.htmleditor.find(".uk-htmleditor-button-code a").html(e.options.lblMarkedview)}function o(t,i,o){e.on("action."+t,function(){"markdown"==e.getCursorMode()&&e["replaceLine"==o?"replaceLine":"replaceSelection"](i)})}var n=e.options.mdparser||window.marked||null;n&&(e.options.markdown&&i(),o("bold","**$1**"),o("italic","*$1*"),o("strike","~~$1~~"),o("blockquote","> $1","replaceLine"),o("link","[$1](http://)"),o("image","![$1](http://)"),e.on("action.listUl",function(){if("markdown"==e.getCursorMode()){for(var t=e.editor,i=t.getDoc().getCursor(!0),o=t.getDoc().getCursor(!1),n=i.line;n0){var r,l=t.getLine(i.line-1);(r=l.match(/^(\d+)\./))&&(n=Number(r[1])+1)}for(var s=i.line;s 1) { - - content = [ - content, - '', - '' - ].join(''); - } - - // calculate width - var tmp = UI.$('
         
        ').css({ - 'opacity' : 0, - 'position' : 'absolute', - 'top' : 0, - 'left' : 0, - 'width' : '100%', - 'max-width' : $this.modal.dialog.css('max-width'), - 'padding' : $this.modal.dialog.css('padding'), - 'margin' : $this.modal.dialog.css('margin') - }), maxwidth, maxheight, w = data.meta.width, h = data.meta.height; - - tmp.appendTo('body').width(); - - maxwidth = tmp.width(); - maxheight = window.innerHeight - dpad; - - tmp.remove(); - - this.modal.dialog.find('.uk-modal-caption').remove(); - - if (data.title) { - this.modal.dialog.append('
        '+data.title+'
        '); - maxheight -= this.modal.dialog.find('.uk-modal-caption').outerHeight(); - } - - if (maxwidth < data.meta.width) { - - h = Math.floor( h * (maxwidth / w) ); - w = maxwidth; - } - - if (maxheight < h) { - - h = Math.floor(maxheight); - w = Math.ceil(data.meta.width * (maxheight/data.meta.height)); - } - - this.modal.content.css('opacity', 0).width(w).html(content); - - if (data.type == 'iframe') { - this.modal.content.find('iframe:first').height(h); - } - - var dh = h + pad, - t = Math.floor(window.innerHeight/2 - dh/2) - dpad; - - if (t < 0) { t = 0; } - - this.modal.closer.addClass('uk-hidden'); - - if ($this.modal.data('mwidth') == w && $this.modal.data('mheight') == h) { - duration = 0; - } - - this.modal.dialog.animate({width: w + pad, height: h + pad, top: t }, duration, 'swing', function() { - $this.modal.loader.addClass('uk-hidden'); - $this.modal.content.css({width:''}).animate({'opacity': 1}, function() { - $this.modal.closer.removeClass('uk-hidden'); - }); - - $this.modal.data({'mwidth': w, 'mheight': h}); - }); - }, - - next: function() { - this.show(this.siblings[(this.index+1)] ? (this.index+1) : 0); - }, - - previous: function() { - this.show(this.siblings[(this.index-1)] ? (this.index-1) : this.siblings.length-1); - } - }); - - - // Plugins - - UI.plugin('lightbox', 'image', { - - init: function(lightbox) { - - lightbox.on("showitem.uk.lightbox", function(e, data){ - - if (data.type == 'image' || data.source && data.source.match(/\.(jpg|jpeg|png|gif|svg)$/i)) { - - var resolve = function(source, width, height) { - - data.meta = { - "content" : '', - "width" : width, - "height" : height - }; - - data.type = 'image'; - - data.promise.resolve(); - }; - - if (!cache[data.source]) { - - var img = new Image(); - - img.onerror = function(){ - data.promise.reject('Loading image failed'); - }; - - img.onload = function(){ - cache[data.source] = {width: img.width, height: img.height}; - resolve(data.source, cache[data.source].width, cache[data.source].height); - }; - - img.src = data.source; - - } else { - resolve(data.source, cache[data.source].width, cache[data.source].height); - } - } - }); - } - }); - - UI.plugin("lightbox", "youtube", { - - init: function(lightbox) { - - var youtubeRegExp = /(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/, - youtubeRegExpShort = /youtu\.be\/(.*)/; - - - lightbox.on("showitem.uk.lightbox", function(e, data){ - - var id, matches, resolve = function(id, width, height) { - - data.meta = { - 'content': '', - 'width': width, - 'height': height - }; - - data.type = 'iframe'; - - data.promise.resolve(); - }; - - if (matches = data.source.match(youtubeRegExp)) { - id = matches[2]; - } - - if (matches = data.source.match(youtubeRegExpShort)) { - id = matches[1]; - } - - if (id) { - - if(!cache[id]) { - - var img = new Image(), lowres = false; - - img.onerror = function(){ - cache[id] = {width:640, height:320}; - resolve(id, cache[id].width, cache[id].height); - }; - - img.onload = function(){ - //youtube default 404 thumb, fall back to lowres - if (img.width == 120 && img.height == 90) { - if (!lowres) { - lowres = true; - img.src = '//img.youtube.com/vi/' + id + '/0.jpg'; - } else { - cache[id] = {width: 640, height: 320}; - resolve(id, cache[id].width, cache[id].height); - } - } else { - cache[id] = {width: img.width, height: img.height}; - resolve(id, img.width, img.height); - } - }; - - img.src = '//img.youtube.com/vi/'+id+'/maxresdefault.jpg'; - - } else { - resolve(id, cache[id].width, cache[id].height); - } - - e.stopImmediatePropagation(); - } - }); - } - }); - - - UI.plugin("lightbox", "vimeo", { - - init: function(lightbox) { - - var regex = /(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/, matches; - - - lightbox.on("showitem.uk.lightbox", function(e, data){ - - var id, resolve = function(id, width, height) { - - data.meta = { - 'content': '', - 'width': width, - 'height': height - }; - - data.type = 'iframe'; - - data.promise.resolve(); - }; - - if (matches = data.source.match(regex)) { - - id = matches[2]; - - if(!cache[id]) { - - UI.$.ajax({ - type : 'GET', - url : 'http://vimeo.com/api/oembed.json?url=' + encodeURI(data.source), - jsonp : 'callback', - dataType : 'jsonp', - success : function(data) { - cache[id] = {width:data.width, height:data.height}; - resolve(id, cache[id].width, cache[id].height); - } - }); - - } else { - resolve(id, cache[id].width, cache[id].height); - } - - e.stopImmediatePropagation(); - } - }); - } - }); - - UI.plugin("lightbox", "video", { - - init: function(lightbox) { - - lightbox.on("showitem.uk.lightbox", function(e, data){ - - - var resolve = function(source, width, height) { - - data.meta = { - 'content': '', - 'width': width, - 'height': height - }; - - data.type = 'video'; - - data.promise.resolve(); - }; - - if (data.type == 'video' || data.source.match(/\.(mp4|webm|ogv)$/i)) { - - if (!cache[data.source]) { - - var vid = UI.$('').attr('src', data.source).appendTo('body'); - - var idle = setInterval(function() { - - if (vid[0].videoWidth) { - clearInterval(idle); - cache[data.source] = {width: vid[0].videoWidth, height: vid[0].videoHeight}; - resolve(data.source, cache[data.source].width, cache[data.source].height); - vid.remove(); - } - - }, 20); - - } else { - resolve(data.source, cache[data.source].width, cache[data.source].height); - } - } - }); - } - }); - - - UIkit.plugin("lightbox", "iframe", { - - init: function (lightbox) { - - lightbox.on("showitem.uk.lightbox", function (e, data) { - - var resolve = function (source, width, height) { - - data.meta = { - 'content': '', - 'width': width, - 'height': height - }; - - data.type = 'iframe'; - - data.promise.resolve(); - }; - - if (data.type === 'iframe' || data.source.match(/\.(html|php)$/)) { - resolve(data.source, (lightbox.options.width || 800), (lightbox.options.height || 600)); - } - }); - - } - }); - - function getModal(lightbox) { - - if (modal) { - modal.lightbox = lightbox; - return modal; - } - - // init lightbox container - modal = UI.$([ - '
        ', - '
        ', - '', - '
        ', - '
        ', - '
        ', - '
        ' - ].join('')).appendTo('body'); - - modal.dialog = modal.find('.uk-modal-dialog:first'); - modal.content = modal.find('.uk-lightbox-content:first'); - modal.loader = modal.find('.uk-modal-spinner:first'); - modal.closer = modal.find('.uk-close.uk-close-alt'); - modal.modal = UI.modal(modal, {modal:false}); - - // next / previous - modal.on("swipeRight swipeLeft", function(e) { - modal.lightbox[e.type=='swipeLeft' ? 'next':'previous'](); - }).on("click", "[data-lightbox-previous], [data-lightbox-next]", function(e){ - e.preventDefault(); - modal.lightbox[UI.$(this).is('[data-lightbox-next]') ? 'next':'previous'](); - }); - - // destroy content on modal hide - modal.on("hide.uk.modal", function(e) { - modal.content.html(''); - }); - - var resizeCache = {w: window.innerWidth, h:window.innerHeight}; - - UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(e){ - - if (resizeCache.w !== window.innerWidth && modal.is(':visible') && !UI.Utils.isFullscreen()) { - modal.lightbox.fitSize(); - } - - resizeCache = {w: window.innerWidth, h:window.innerHeight}; - - }, 100)); - - modal.lightbox = lightbox; - - return modal; - } - - UI.lightbox.create = function(items, options) { - - if (!items) return; - - var group = [], o; - - items.forEach(function(item) { - - group.push(UI.$.extend({ - 'source' : '', - 'title' : '', - 'type' : 'auto', - 'link' : false - }, (typeof(item) == 'string' ? {'source': item} : item))); - }); - - o = UI.lightbox(UI.$.extend({}, options, {'group':group})); - - return o; - }; - - return UI.lightbox; -}); diff --git a/js/components/lightbox.min.js b/js/components/lightbox.min.js deleted file mode 100755 index 5075244..0000000 --- a/js/components/lightbox.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(i){var t;window.UIkit&&(t=i(UIkit)),"function"==typeof define&&define.amd&&define("uikit-lightbox",["uikit"],function(){return t||i(UIkit)})}(function(i){"use strict";function t(t){if(e)return e.lightbox=t,e;e=i.$(['
        ','
        ','','
        ','
        ',"
        ","
        "].join("")).appendTo("body"),e.dialog=e.find(".uk-modal-dialog:first"),e.content=e.find(".uk-lightbox-content:first"),e.loader=e.find(".uk-modal-spinner:first"),e.closer=e.find(".uk-close.uk-close-alt"),e.modal=i.modal(e,{modal:!1}),e.on("swipeRight swipeLeft",function(i){e.lightbox["swipeLeft"==i.type?"next":"previous"]()}).on("click","[data-lightbox-previous], [data-lightbox-next]",function(t){t.preventDefault(),e.lightbox[i.$(this).is("[data-lightbox-next]")?"next":"previous"]()}),e.on("hide.uk.modal",function(){e.content.html("")});var o={w:window.innerWidth,h:window.innerHeight};return i.$win.on("load resize orientationchange",i.Utils.debounce(function(){o.w!==window.innerWidth&&e.is(":visible")&&!i.Utils.isFullscreen()&&e.lightbox.fitSize(),o={w:window.innerWidth,h:window.innerHeight}},100)),e.lightbox=t,e}var e,o={};return i.component("lightbox",{defaults:{allowfullscreen:!0,duration:400,group:!1,keyboard:!0},index:0,items:!1,boot:function(){i.$html.on("click","[data-uk-lightbox]",function(t){t.preventDefault();var e=i.$(this);e.data("lightbox")||i.lightbox(e,i.Utils.options(e.attr("data-uk-lightbox"))),e.data("lightbox").show(e)}),i.$doc.on("keyup",function(i){if(e&&e.is(":visible")&&e.lightbox.options.keyboard)switch(i.preventDefault(),i.keyCode){case 37:e.lightbox.previous();break;case 39:e.lightbox.next()}})},init:function(){var t=[];if(this.index=0,this.siblings=[],this.element&&this.element.length){var e=this.options.group?i.$(['[data-uk-lightbox*="'+this.options.group+'"]',"[data-uk-lightbox*='"+this.options.group+"']"].join(",")):this.element;e.each(function(){var e=i.$(this);t.push({source:e.attr("href"),title:e.attr("data-title")||e.attr("title"),type:e.attr("data-lightbox-type")||"auto",link:e})}),this.index=e.index(this.element),this.siblings=t}else this.options.group&&this.options.group.length&&(this.siblings=this.options.group);this.trigger("lightbox-init",[this])},show:function(e){this.modal=t(this),this.modal.dialog.stop(),this.modal.content.stop();var o,n,s=this,h=i.$.Deferred();e=e||0,"object"==typeof e&&this.siblings.forEach(function(i,t){e[0]===i.link[0]&&(e=t)}),0>e?e=this.siblings.length-e:this.siblings[e]||(e=0),n=this.siblings[e],o={lightbox:s,source:n.source,type:n.type,index:e,promise:h,title:n.title,item:n,meta:{content:"",width:null,height:null}},this.index=e,this.modal.content.empty(),this.modal.is(":visible")||(this.modal.content.css({width:"",height:""}).empty(),this.modal.modal.show()),this.modal.loader.removeClass("uk-hidden"),h.promise().done(function(){s.data=o,s.fitSize(o)}).fail(function(){o.meta.content='
        Loading resource failed!
        ',o.meta.width=400,o.meta.height=300,s.data=o,s.fitSize(o)}),s.trigger("showitem.uk.lightbox",[o])},fitSize:function(){var t=this,e=this.data,o=this.modal.dialog.outerWidth()-this.modal.dialog.width(),n=parseInt(this.modal.dialog.css("margin-top"),10),s=parseInt(this.modal.dialog.css("margin-bottom"),10),h=n+s,a=e.meta.content,l=t.options.duration;this.siblings.length>1&&(a=[a,'',''].join(""));var d,r,u=i.$("
         
        ").css({opacity:0,position:"absolute",top:0,left:0,width:"100%","max-width":t.modal.dialog.css("max-width"),padding:t.modal.dialog.css("padding"),margin:t.modal.dialog.css("margin")}),c=e.meta.width,g=e.meta.height;u.appendTo("body").width(),d=u.width(),r=window.innerHeight-h,u.remove(),this.modal.dialog.find(".uk-modal-caption").remove(),e.title&&(this.modal.dialog.append('
        '+e.title+"
        "),r-=this.modal.dialog.find(".uk-modal-caption").outerHeight()),dr&&(g=Math.floor(r),c=Math.ceil(e.meta.width*(r/e.meta.height))),this.modal.content.css("opacity",0).width(c).html(a),"iframe"==e.type&&this.modal.content.find("iframe:first").height(g);var m=g+o,p=Math.floor(window.innerHeight/2-m/2)-h;0>p&&(p=0),this.modal.closer.addClass("uk-hidden"),t.modal.data("mwidth")==c&&t.modal.data("mheight")==g&&(l=0),this.modal.dialog.animate({width:c+o,height:g+o,top:p},l,"swing",function(){t.modal.loader.addClass("uk-hidden"),t.modal.content.css({width:""}).animate({opacity:1},function(){t.modal.closer.removeClass("uk-hidden")}),t.modal.data({mwidth:c,mheight:g})})},next:function(){this.show(this.siblings[this.index+1]?this.index+1:0)},previous:function(){this.show(this.siblings[this.index-1]?this.index-1:this.siblings.length-1)}}),i.plugin("lightbox","image",{init:function(i){i.on("showitem.uk.lightbox",function(i,t){if("image"==t.type||t.source&&t.source.match(/\.(jpg|jpeg|png|gif|svg)$/i)){var e=function(i,e,o){t.meta={content:'',width:e,height:o},t.type="image",t.promise.resolve()};if(o[t.source])e(t.source,o[t.source].width,o[t.source].height);else{var n=new Image;n.onerror=function(){t.promise.reject("Loading image failed")},n.onload=function(){o[t.source]={width:n.width,height:n.height},e(t.source,o[t.source].width,o[t.source].height)},n.src=t.source}}})}}),i.plugin("lightbox","youtube",{init:function(i){var t=/(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/,n=/youtu\.be\/(.*)/;i.on("showitem.uk.lightbox",function(i,s){var h,a,l=function(i,t,o){s.meta={content:'",width:t,height:o},s.type="iframe",s.promise.resolve()};if((a=s.source.match(t))&&(h=a[2]),(a=s.source.match(n))&&(h=a[1]),h){if(o[h])l(h,o[h].width,o[h].height);else{var d=new Image,r=!1;d.onerror=function(){o[h]={width:640,height:320},l(h,o[h].width,o[h].height)},d.onload=function(){120==d.width&&90==d.height?r?(o[h]={width:640,height:320},l(h,o[h].width,o[h].height)):(r=!0,d.src="//img.youtube.com/vi/"+h+"/0.jpg"):(o[h]={width:d.width,height:d.height},l(h,d.width,d.height))},d.src="//img.youtube.com/vi/"+h+"/maxresdefault.jpg"}i.stopImmediatePropagation()}})}}),i.plugin("lightbox","vimeo",{init:function(t){var n,s=/(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/;t.on("showitem.uk.lightbox",function(t,h){var a,l=function(i,t,o){h.meta={content:'",width:t,height:o},h.type="iframe",h.promise.resolve()};(n=h.source.match(s))&&(a=n[2],o[a]?l(a,o[a].width,o[a].height):i.$.ajax({type:"GET",url:"http://vimeo.com/api/oembed.json?url="+encodeURI(h.source),jsonp:"callback",dataType:"jsonp",success:function(i){o[a]={width:i.width,height:i.height},l(a,o[a].width,o[a].height)}}),t.stopImmediatePropagation())})}}),i.plugin("lightbox","video",{init:function(t){t.on("showitem.uk.lightbox",function(t,e){var n=function(i,t,o){e.meta={content:'',width:t,height:o},e.type="video",e.promise.resolve()};if("video"==e.type||e.source.match(/\.(mp4|webm|ogv)$/i))if(o[e.source])n(e.source,o[e.source].width,o[e.source].height);else var s=i.$('').attr("src",e.source).appendTo("body"),h=setInterval(function(){s[0].videoWidth&&(clearInterval(h),o[e.source]={width:s[0].videoWidth,height:s[0].videoHeight},n(e.source,o[e.source].width,o[e.source].height),s.remove())},20)})}}),UIkit.plugin("lightbox","iframe",{init:function(i){i.on("showitem.uk.lightbox",function(t,o){var n=function(i,t,n){o.meta={content:'",width:t,height:n},o.type="iframe",o.promise.resolve()};("iframe"===o.type||o.source.match(/\.(html|php)$/))&&n(o.source,i.options.width||800,i.options.height||600)})}}),i.lightbox.create=function(t,e){if(t){var o,n=[];return t.forEach(function(t){n.push(i.$.extend({source:"",title:"",type:"auto",link:!1},"string"==typeof t?{source:t}:t))}),o=i.lightbox(i.$.extend({},e,{group:n}))}},i.lightbox}); \ No newline at end of file diff --git a/js/components/nestable.js b/js/components/nestable.js deleted file mode 100755 index 573345d..0000000 --- a/js/components/nestable.js +++ /dev/null @@ -1,653 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -/* - * Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/ - */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-nestable", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI) { - - "use strict"; - - var hasTouch = 'ontouchstart' in window, - html = UI.$html, - touchedlists = [], - $win = UI.$win, - draggingElement; - - var eStart = hasTouch ? 'touchstart' : 'mousedown', - eMove = hasTouch ? 'touchmove' : 'mousemove', - eEnd = hasTouch ? 'touchend' : 'mouseup', - eCancel = hasTouch ? 'touchcancel' : 'mouseup'; - - - UI.component('nestable', { - - defaults: { - listBaseClass : 'uk-nestable', - listClass : 'uk-nestable-list', - listItemClass : 'uk-nestable-item', - dragClass : 'uk-nestable-dragged', - movingClass : 'uk-nestable-moving', - noChildrenClass : 'uk-nestable-nochildren', - emptyClass : 'uk-nestable-empty', - handleClass : '', - collapsedClass : 'uk-collapsed', - placeholderClass: 'uk-nestable-placeholder', - noDragClass : 'uk-nestable-nodrag', - group : false, - maxDepth : 10, - threshold : 20, - idlethreshold : 10, - }, - - boot: function() { - - // adjust document scrolling - UI.$html.on('mousemove touchmove', function(e) { - - if (draggingElement) { - - var top = draggingElement.offset().top; - - if (top < UI.$win.scrollTop()) { - UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingElement.height()/2)); - } else if ( (top + draggingElement.height()) > (window.innerHeight + UI.$win.scrollTop()) ) { - UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingElement.height()/2)); - } - } - }); - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-nestable]", context).each(function(){ - - var ele = UI.$(this); - - if (!ele.data("nestable")) { - UI.nestable(ele, UI.Utils.options(ele.attr("data-uk-nestable"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - Object.keys(this.options).forEach(function(key){ - - if(String(key).indexOf('Class')!=-1) { - $this.options['_'+key] = '.' + $this.options[key]; - } - }); - - this.find(this.options._listItemClass).find(">ul").addClass(this.options.listClass); - - this.checkEmptyList(); - - this.reset(); - this.element.data('nestable-group', this.options.group || UI.Utils.uid('nestable-group')); - - this.find(this.options._listItemClass).each(function() { - $this.setParent(UI.$(this)); - }); - - this.on('click', '[data-nestable-action]', function(e) { - - if ($this.dragEl || (!hasTouch && e.button !== 0)) { - return; - } - - e.preventDefault(); - - var target = UI.$(e.currentTarget), - action = target.data('nestableAction'), - item = target.closest($this.options._listItemClass); - - if (action === 'collapse') { - $this.collapseItem(item); - } - if (action === 'expand') { - $this.expandItem(item); - } - if (action === 'toggle') { - $this.toggleItem(item); - } - }); - - var onStartEvent = function(e) { - - var handle = UI.$(e.target), - link = handle.is('a[href]') ? handle:handle.parents('a[href]'); - - if (e.target === $this.element[0]) { - return; - } - - if (handle.is($this.options._noDragClass) || handle.closest($this.options._noDragClass).length) { - return; - } - - if (handle.is('[data-nestable-action]') || handle.closest('[data-nestable-action]').length) { - return; - } - - if ($this.options.handleClass && !handle.hasClass($this.options.handleClass)) { - - if ($this.options.handleClass) { - handle = handle.closest($this.options._handleClass); - } - } - - if (!handle.length || $this.dragEl || (!hasTouch && e.button !== 0) || (hasTouch && e.touches.length !== 1)) { - return; - } - - if (e.originalEvent && e.originalEvent.touches) { - e = evt.originalEvent.touches[0]; - } - - $this.delayMove = function(evt) { - - link = false; - - evt.preventDefault(); - $this.dragStart(e); - $this.trigger('start.uk.nestable', [$this]); - - $this.delayMove = false; - }; - - $this.delayMove.x = parseInt(e.pageX, 10); - $this.delayMove.y = parseInt(e.pageY, 10); - $this.delayMove.threshold = $this.options.idlethreshold; - - if (link.length && eEnd == 'touchend') { - - $this.one(eEnd, function(){ - if (link && link.attr('href').trim()) { - location.href = link.attr('href'); - } - }); - } - - e.preventDefault(); - }; - - var onMoveEvent = function(e) { - - if (e.originalEvent && e.originalEvent.touches) { - e = e.originalEvent.touches[0]; - } - - if ($this.delayMove && (Math.abs(e.pageX - $this.delayMove.x) > $this.delayMove.threshold || Math.abs(e.pageY - $this.delayMove.y) > $this.delayMove.threshold)) { - - if (!window.getSelection().toString()) { - $this.delayMove(e); - } else { - $this.delayMove = false; - } - } - - if ($this.dragEl) { - e.preventDefault(); - $this.dragMove(e); - $this.trigger('move.uk.nestable', [$this]); - } - }; - - var onEndEvent = function(e) { - - if ($this.dragEl) { - e.preventDefault(); - $this.dragStop(hasTouch ? e.touches[0] : e); - } - - draggingElement = false; - $this.delayMove = false; - }; - - if (hasTouch) { - this.element[0].addEventListener(eStart, onStartEvent, false); - window.addEventListener(eMove, onMoveEvent, false); - window.addEventListener(eEnd, onEndEvent, false); - window.addEventListener(eCancel, onEndEvent, false); - } else { - this.on(eStart, onStartEvent); - $win.on(eMove, onMoveEvent); - $win.on(eEnd, onEndEvent); - } - - }, - - serialize: function() { - - var data, - depth = 0, - list = this, - step = function(level, depth) { - - var array = [ ], items = level.children(list.options._listItemClass); - - items.each(function() { - - var li = UI.$(this), - item = {}, attribute, - sub = li.children(list.options._listClass); - - for (var i = 0, attr, val; i < li[0].attributes.length; i++) { - attribute = li[0].attributes[i]; - if (attribute.name.indexOf('data-') === 0) { - attr = attribute.name.substr(5); - val = UI.Utils.str2json(attribute.value); - item[attr] = (val || attribute.value=='false' || attribute.value=='0') ? val:attribute.value; - } - } - - if (sub.length) { - item.children = step(sub, depth + 1); - } - - array.push(item); - - }); - return array; - }; - - data = step(list.element, depth); - - return data; - }, - - list: function(options) { - - var data = [], - list = this, - depth = 0, - step = function(level, depth, parent) { - - var items = level.children(options._listItemClass); - - items.each(function(index) { - var li = UI.$(this), - item = UI.$.extend({parent_id: (parent ? parent : null), depth: depth, order: index}, li.data()), - sub = li.children(options._listClass); - - data.push(item); - - if (sub.length) { - step(sub, depth + 1, li.data(options.idProperty || 'id')); - } - }); - }; - - options = UI.$.extend({}, list.options, options); - - step(list.element, depth); - - return data; - }, - - reset: function() { - - this.mouse = { - offsetX : 0, - offsetY : 0, - startX : 0, - startY : 0, - lastX : 0, - lastY : 0, - nowX : 0, - nowY : 0, - distX : 0, - distY : 0, - dirAx : 0, - dirX : 0, - dirY : 0, - lastDirX : 0, - lastDirY : 0, - distAxX : 0, - distAxY : 0 - }; - this.moving = false; - this.dragEl = null; - this.dragRootEl = null; - this.dragDepth = 0; - this.hasNewRoot = false; - this.pointEl = null; - - for (var i=0; i').addClass(this.options.listClass + ' ' + this.options.dragClass).append(dragItem.clone()); - this.dragEl.css('width', dragItem.width()); - this.placeEl.addClass(this.options.placeholderClass); - - draggingElement = this.dragEl; - - this.tmpDragOnSiblings = [dragItem[0].previousSibling, dragItem[0].nextSibling]; - - UI.$body.append(this.dragEl); - - this.dragEl.css({ - left : offset.left, - top : offset.top - }); - - // total depth of dragging item - var i, depth, items = this.dragEl.find(this.options._listItemClass); - - for (i = 0; i < items.length; i++) { - depth = UI.$(items[i]).parents(this.options._listClass+','+this.options._listBaseClass).length; - if (depth > this.dragDepth) { - this.dragDepth = depth; - } - } - - html.addClass(this.options.movingClass); - }, - - dragStop: function(e) { - - var el = UI.$(this.placeEl), - root = this.placeEl.parents(this.options._listBaseClass+':first'); - - this.placeEl.removeClass(this.options.placeholderClass); - this.dragEl.remove(); - - if (this.element[0] !== root[0]) { - - root.trigger('change.uk.nestable',[root.data('nestable'), el, 'added']); - this.element.trigger('change.uk.nestable', [this, el, 'removed']); - - } else { - this.element.trigger('change.uk.nestable',[this, el, "moved"]); - } - - this.trigger('stop.uk.nestable', [this, el]); - - this.reset(); - - html.removeClass(this.options.movingClass); - }, - - dragMove: function(e) { - var list, parent, prev, next, depth, - opt = this.options, - mouse = this.mouse, - maxDepth = this.dragRootEl ? this.dragRootEl.data('nestable').options.maxDepth : opt.maxDepth; - - this.dragEl.css({ - left : e.pageX - mouse.offsetX, - top : e.pageY - mouse.offsetY - }); - - // mouse position last events - mouse.lastX = mouse.nowX; - mouse.lastY = mouse.nowY; - // mouse position this events - mouse.nowX = e.pageX; - mouse.nowY = e.pageY; - // distance mouse moved between events - mouse.distX = mouse.nowX - mouse.lastX; - mouse.distY = mouse.nowY - mouse.lastY; - // direction mouse was moving - mouse.lastDirX = mouse.dirX; - mouse.lastDirY = mouse.dirY; - // direction mouse is now moving (on both axis) - mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1; - mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1; - // axis mouse is now moving on - var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0; - - // do nothing on first move - if (!mouse.moving) { - mouse.dirAx = newAx; - mouse.moving = true; - return; - } - - // calc distance moved on this axis (and direction) - if (mouse.dirAx !== newAx) { - mouse.distAxX = 0; - mouse.distAxY = 0; - } else { - mouse.distAxX += Math.abs(mouse.distX); - if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) { - mouse.distAxX = 0; - } - mouse.distAxY += Math.abs(mouse.distY); - if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) { - mouse.distAxY = 0; - } - } - mouse.dirAx = newAx; - - /** - * move horizontal - */ - if (mouse.dirAx && mouse.distAxX >= opt.threshold) { - // reset move distance on x-axis for new phase - mouse.distAxX = 0; - prev = this.placeEl.prev('li'); - - // increase horizontal level if previous sibling exists, is not collapsed, and does not have a 'no children' class - if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass) && !prev.hasClass(opt.noChildrenClass)) { - - // cannot increase level when item above is collapsed - list = prev.find(opt._listClass).last(); - - // check if depth limit has reached - depth = this.placeEl.parents(opt._listClass+','+opt._listBaseClass).length; - - if (depth + this.dragDepth <= maxDepth) { - - // create new sub-level if one doesn't exist - if (!list.length) { - list = UI.$('
          ').addClass(opt.listClass); - list.append(this.placeEl); - prev.append(list); - this.setParent(prev); - } else { - // else append to next level up - list = prev.children(opt._listClass).last(); - list.append(this.placeEl); - } - } - } - - // decrease horizontal level - if (mouse.distX < 0) { - - // we cannot decrease the level if an item precedes the current one - next = this.placeEl.next(opt._listItemClass); - if (!next.length) { - - // get parent ul of the list item - var parentUl = this.placeEl.closest([opt._listBaseClass, opt._listClass].join(',')); - // try to get the li surrounding the ul - var surroundingLi = parentUl.closest(opt._listItemClass); - - // if the ul is inside of a li (meaning it is nested) - if (surroundingLi.length) { - // we can decrease the horizontal level - surroundingLi.after(this.placeEl); - // if the previous parent ul is now empty - if (!parentUl.children().length) { - this.unsetParent(surroundingLi); - } - } - } - } - } - - var isEmpty = false; - - // find list item under cursor - var pointX = e.pageX - (window.pageXOffset || document.scrollLeft || 0), - pointY = e.pageY - (window.pageYOffset || document.documentElement.scrollTop); - this.pointEl = UI.$(document.elementFromPoint(pointX, pointY)); - - if (opt.handleClass && this.pointEl.hasClass(opt.handleClass)) { - - this.pointEl = this.pointEl.closest(opt._listItemClass); - - } else { - - var nestableitem = this.pointEl.closest(opt._listItemClass); - - if (nestableitem.length) { - this.pointEl = nestableitem; - } - } - - if (this.placeEl.find(this.pointEl).length) { - return; - } - - if (this.pointEl.data('nestable') && !this.pointEl.children().length) { - isEmpty = true; - this.checkEmptyList(this.pointEl); - } else if (!this.pointEl.length || !this.pointEl.hasClass(opt.listItemClass)) { - return; - } - - // find parent list of item under cursor - var pointElRoot = this.element, - tmpRoot = this.pointEl.closest(this.options._listBaseClass), - isNewRoot = pointElRoot[0] != tmpRoot[0]; - - /** - * move vertical - */ - if (!mouse.dirAx || isNewRoot || isEmpty) { - - // check if groups match if dragging over new root - if (isNewRoot && opt.group !== tmpRoot.data('nestable-group')) { - return; - } else { - touchedlists.push(pointElRoot); - } - - // check depth limit - depth = this.dragDepth - 1 + this.pointEl.parents(opt._listClass+','+opt._listBaseClass).length; - - if (depth > maxDepth) { - return; - } - - var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2); - - parent = this.placeEl.parent(); - - if (isEmpty) { - this.pointEl.append(this.placeEl); - } else if (before) { - this.pointEl.before(this.placeEl); - } else { - this.pointEl.after(this.placeEl); - } - - if (!parent.children().length) { - if (!parent.data("nestable")) this.unsetParent(parent.parent()); - } - - this.checkEmptyList(this.dragRootEl); - this.checkEmptyList(pointElRoot); - - // parent root list has changed - if (isNewRoot) { - this.dragRootEl = tmpRoot; - this.hasNewRoot = this.element[0] !== this.dragRootEl[0]; - } - } - }, - - checkEmptyList: function(list) { - - list = list ? UI.$(list) : this.element; - - if (this.options.emptyClass) { - list[!list.children().length ? 'addClass':'removeClass'](this.options.emptyClass); - } - } - - }); - - return UI.nestable; -}); diff --git a/js/components/nestable.min.js b/js/components/nestable.min.js deleted file mode 100755 index e0d4da2..0000000 --- a/js/components/nestable.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var s;window.UIkit&&(s=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-nestable",["uikit"],function(){return s||t(UIkit)})}(function(t){"use strict";var s,e="ontouchstart"in window,i=t.$html,l=[],a=t.$win,n=e?"touchstart":"mousedown",o=e?"touchmove":"mousemove",h=e?"touchend":"mouseup",r=e?"touchcancel":"mouseup";return t.component("nestable",{defaults:{listBaseClass:"uk-nestable",listClass:"uk-nestable-list",listItemClass:"uk-nestable-item",dragClass:"uk-nestable-dragged",movingClass:"uk-nestable-moving",noChildrenClass:"uk-nestable-nochildren",emptyClass:"uk-nestable-empty",handleClass:"",collapsedClass:"uk-collapsed",placeholderClass:"uk-nestable-placeholder",noDragClass:"uk-nestable-nodrag",group:!1,maxDepth:10,threshold:20,idlethreshold:10},boot:function(){t.$html.on("mousemove touchmove",function(){if(s){var e=s.offset().top;ewindow.innerHeight+t.$win.scrollTop()&&t.$win.scrollTop(t.$win.scrollTop()+Math.ceil(s.height()/2))}}),t.ready(function(s){t.$("[data-uk-nestable]",s).each(function(){var s=t.$(this);s.data("nestable")||t.nestable(s,t.Utils.options(s.attr("data-uk-nestable")))})})},init:function(){var i=this;Object.keys(this.options).forEach(function(t){-1!=String(t).indexOf("Class")&&(i.options["_"+t]="."+i.options[t])}),this.find(this.options._listItemClass).find(">ul").addClass(this.options.listClass),this.checkEmptyList(),this.reset(),this.element.data("nestable-group",this.options.group||t.Utils.uid("nestable-group")),this.find(this.options._listItemClass).each(function(){i.setParent(t.$(this))}),this.on("click","[data-nestable-action]",function(s){if(!i.dragEl&&(e||0===s.button)){s.preventDefault();var l=t.$(s.currentTarget),a=l.data("nestableAction"),n=l.closest(i.options._listItemClass);"collapse"===a&&i.collapseItem(n),"expand"===a&&i.expandItem(n),"toggle"===a&&i.toggleItem(n)}});var l=function(s){var l=t.$(s.target),a=l.is("a[href]")?l:l.parents("a[href]");s.target!==i.element[0]&&(l.is(i.options._noDragClass)||l.closest(i.options._noDragClass).length||l.is("[data-nestable-action]")||l.closest("[data-nestable-action]").length||(i.options.handleClass&&!l.hasClass(i.options.handleClass)&&i.options.handleClass&&(l=l.closest(i.options._handleClass)),!l.length||i.dragEl||!e&&0!==s.button||e&&1!==s.touches.length||(s.originalEvent&&s.originalEvent.touches&&(s=evt.originalEvent.touches[0]),i.delayMove=function(t){a=!1,t.preventDefault(),i.dragStart(s),i.trigger("start.uk.nestable",[i]),i.delayMove=!1},i.delayMove.x=parseInt(s.pageX,10),i.delayMove.y=parseInt(s.pageY,10),i.delayMove.threshold=i.options.idlethreshold,a.length&&"touchend"==h&&i.one(h,function(){a&&a.attr("href").trim()&&(location.href=a.attr("href"))}),s.preventDefault())))},d=function(t){t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]),i.delayMove&&(Math.abs(t.pageX-i.delayMove.x)>i.delayMove.threshold||Math.abs(t.pageY-i.delayMove.y)>i.delayMove.threshold)&&(window.getSelection().toString()?i.delayMove=!1:i.delayMove(t)),i.dragEl&&(t.preventDefault(),i.dragMove(t),i.trigger("move.uk.nestable",[i]))},p=function(t){i.dragEl&&(t.preventDefault(),i.dragStop(e?t.touches[0]:t)),s=!1,i.delayMove=!1};e?(this.element[0].addEventListener(n,l,!1),window.addEventListener(o,d,!1),window.addEventListener(h,p,!1),window.addEventListener(r,p,!1)):(this.on(n,l),a.on(o,d),a.on(h,p))},serialize:function(){var s,e=0,i=this,l=function(s,e){var a=[],n=s.children(i.options._listItemClass);return n.each(function(){for(var s,n,o,h=t.$(this),r={},d=h.children(i.options._listClass),p=0;p
        ").addClass(this.options.listClass+" "+this.options.dragClass).append(n.clone()),this.dragEl.css("width",n.width()),this.placeEl.addClass(this.options.placeholderClass),s=this.dragEl,this.tmpDragOnSiblings=[n[0].previousSibling,n[0].nextSibling],t.$body.append(this.dragEl),this.dragEl.css({left:o.left,top:o.top});var h,r,d=this.dragEl.find(this.options._listItemClass);for(h=0;hthis.dragDepth&&(this.dragDepth=r);i.addClass(this.options.movingClass)},dragStop:function(){var s=t.$(this.placeEl),e=this.placeEl.parents(this.options._listBaseClass+":first");this.placeEl.removeClass(this.options.placeholderClass),this.dragEl.remove(),this.element[0]!==e[0]?(e.trigger("change.uk.nestable",[e.data("nestable"),s,"added"]),this.element.trigger("change.uk.nestable",[this,s,"removed"])):this.element.trigger("change.uk.nestable",[this,s,"moved"]),this.trigger("stop.uk.nestable",[this,s]),this.reset(),i.removeClass(this.options.movingClass)},dragMove:function(s){var e,i,a,n,o,h=this.options,r=this.mouse,d=this.dragRootEl?this.dragRootEl.data("nestable").options.maxDepth:h.maxDepth;this.dragEl.css({left:s.pageX-r.offsetX,top:s.pageY-r.offsetY}),r.lastX=r.nowX,r.lastY=r.nowY,r.nowX=s.pageX,r.nowY=s.pageY,r.distX=r.nowX-r.lastX,r.distY=r.nowY-r.lastY,r.lastDirX=r.dirX,r.lastDirY=r.dirY,r.dirX=0===r.distX?0:r.distX>0?1:-1,r.dirY=0===r.distY?0:r.distY>0?1:-1;var p=Math.abs(r.distX)>Math.abs(r.distY)?1:0;if(!r.moving)return r.dirAx=p,r.moving=!0,void 0;if(r.dirAx!==p?(r.distAxX=0,r.distAxY=0):(r.distAxX+=Math.abs(r.distX),0!==r.dirX&&r.dirX!==r.lastDirX&&(r.distAxX=0),r.distAxY+=Math.abs(r.distY),0!==r.dirY&&r.dirY!==r.lastDirY&&(r.distAxY=0)),r.dirAx=p,r.dirAx&&r.distAxX>=h.threshold&&(r.distAxX=0,a=this.placeEl.prev("li"),r.distX>0&&a.length&&!a.hasClass(h.collapsedClass)&&!a.hasClass(h.noChildrenClass)&&(e=a.find(h._listClass).last(),o=this.placeEl.parents(h._listClass+","+h._listBaseClass).length,o+this.dragDepth<=d&&(e.length?(e=a.children(h._listClass).last(),e.append(this.placeEl)):(e=t.$("
          ").addClass(h.listClass),e.append(this.placeEl),a.append(e),this.setParent(a)))),r.distX<0&&(n=this.placeEl.next(h._listItemClass),!n.length))){var c=this.placeEl.closest([h._listBaseClass,h._listClass].join(",")),g=c.closest(h._listItemClass);g.length&&(g.after(this.placeEl),c.children().length||this.unsetParent(g))}var u=!1,f=s.pageX-(window.pageXOffset||document.scrollLeft||0),m=s.pageY-(window.pageYOffset||document.documentElement.scrollTop);if(this.pointEl=t.$(document.elementFromPoint(f,m)),h.handleClass&&this.pointEl.hasClass(h.handleClass))this.pointEl=this.pointEl.closest(h._listItemClass);else{var C=this.pointEl.closest(h._listItemClass);C.length&&(this.pointEl=C)}if(!this.placeEl.find(this.pointEl).length){if(this.pointEl.data("nestable")&&!this.pointEl.children().length)u=!0,this.checkEmptyList(this.pointEl);else if(!this.pointEl.length||!this.pointEl.hasClass(h.listItemClass))return;var v=this.element,E=this.pointEl.closest(this.options._listBaseClass),b=v[0]!=E[0];if(!r.dirAx||b||u){if(b&&h.group!==E.data("nestable-group"))return;if(l.push(v),o=this.dragDepth-1+this.pointEl.parents(h._listClass+","+h._listBaseClass).length,o>d)return;var X=s.pageY', - '', - '
          ', - '' - - ].join('')).data("notifyMessage", this); - - this.content(this.options.message); - - // status - if (this.options.status) { - this.element.addClass('uk-notify-message-'+this.options.status); - this.currentstatus = this.options.status; - } - - this.group = this.options.group; - - messages[this.uuid] = this; - - if(!containers[this.options.pos]) { - containers[this.options.pos] = UI.$('
          ').appendTo('body').on("click", ".uk-notify-message", function(){ - - var message = UI.$(this).data("notifyMessage"); - - message.element.trigger('manualclose.uk.notify', [message]); - message.close(); - }); - } - }; - - - UI.$.extend(Message.prototype, { - - uuid: false, - element: false, - timout: false, - currentstatus: "", - group: false, - - show: function() { - - if (this.element.is(":visible")) return; - - var $this = this; - - containers[this.options.pos].show().prepend(this.element); - - var marginbottom = parseInt(this.element.css("margin-bottom"), 10); - - this.element.css({"opacity":0, "margin-top": -1*this.element.outerHeight(), "margin-bottom":0}).animate({"opacity":1, "margin-top": 0, "margin-bottom":marginbottom}, function(){ - - if ($this.options.timeout) { - - var closefn = function(){ $this.close(); }; - - $this.timeout = setTimeout(closefn, $this.options.timeout); - - $this.element.hover( - function() { clearTimeout($this.timeout); }, - function() { $this.timeout = setTimeout(closefn, $this.options.timeout); } - ); - } - - }); - - return this; - }, - - close: function(instantly) { - - var $this = this, - finalize = function(){ - $this.element.remove(); - - if (!containers[$this.options.pos].children().length) { - containers[$this.options.pos].hide(); - } - - $this.options.onClose.apply($this, []); - $this.element.trigger('close.uk.notify', [$this]); - - delete messages[$this.uuid]; - }; - - if (this.timeout) clearTimeout(this.timeout); - - if (instantly) { - finalize(); - } else { - this.element.animate({"opacity":0, "margin-top": -1* this.element.outerHeight(), "margin-bottom":0}, function(){ - finalize(); - }); - } - }, - - content: function(html){ - - var container = this.element.find(">div"); - - if(!html) { - return container.html(); - } - - container.html(html); - - return this; - }, - - status: function(status) { - - if (!status) { - return this.currentstatus; - } - - this.element.removeClass('uk-notify-message-'+this.currentstatus).addClass('uk-notify-message-'+status); - - this.currentstatus = status; - - return this; - } - }); - - Message.defaults = { - message: "", - status: "", - timeout: 5000, - group: null, - pos: 'top-center', - onClose: function() {} - }; - - UI.notify = notify; - UI.notify.message = Message; - UI.notify.closeAll = closeAll; - - return notify; -}); diff --git a/js/components/notify.min.js b/js/components/notify.min.js deleted file mode 100755 index 6c24ebb..0000000 --- a/js/components/notify.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-notify",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e={},i={},s=function(e){return"string"==t.$.type(e)&&(e={message:e}),arguments[1]&&(e=t.$.extend(e,"string"==t.$.type(arguments[1])?{status:arguments[1]}:arguments[1])),new n(e).show()},o=function(t,e){var s;if(t)for(s in i)t===i[s].group&&i[s].close(e);else for(s in i)i[s].close(e)},n=function(s){this.options=t.$.extend({},n.defaults,s),this.uuid=t.Utils.uid("notifymsg"),this.element=t.$(['
          ','',"
          ","
          "].join("")).data("notifyMessage",this),this.content(this.options.message),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,i[this.uuid]=this,e[this.options.pos]||(e[this.options.pos]=t.$('
          ').appendTo("body").on("click",".uk-notify-message",function(){var e=t.$(this).data("notifyMessage");e.element.trigger("manualclose.uk.notify",[e]),e.close()}))};return t.$.extend(n.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var t=this;e[this.options.pos].show().prepend(this.element);var i=parseInt(this.element.css("margin-bottom"),10);return this.element.css({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0}).animate({opacity:1,"margin-top":0,"margin-bottom":i},function(){if(t.options.timeout){var e=function(){t.close()};t.timeout=setTimeout(e,t.options.timeout),t.element.hover(function(){clearTimeout(t.timeout)},function(){t.timeout=setTimeout(e,t.options.timeout)})}}),this}},close:function(t){var s=this,o=function(){s.element.remove(),e[s.options.pos].children().length||e[s.options.pos].hide(),s.options.onClose.apply(s,[]),s.element.trigger("close.uk.notify",[s]),delete i[s.uuid]};this.timeout&&clearTimeout(this.timeout),t?o():this.element.animate({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0},function(){o()})},content:function(t){var e=this.element.find(">div");return t?(e.html(t),this):e.html()},status:function(t){return t?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+t),this.currentstatus=t,this):this.currentstatus}}),n.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:function(){}},t.notify=s,t.notify.message=n,t.notify.closeAll=o,s}); \ No newline at end of file diff --git a/js/components/pagination.js b/js/components/pagination.js deleted file mode 100755 index f5a8478..0000000 --- a/js/components/pagination.js +++ /dev/null @@ -1,147 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -/* - * Based on simplePagination - Copyright (c) 2012 Flavius Matis - http://flaviusmatis.github.com/simplePagination.js/ (MIT) - */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-pagination", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - UI.component('pagination', { - - defaults: { - items : 1, - itemsOnPage : 1, - pages : 0, - displayedPages : 7, - edges : 1, - currentPage : 0, - lblPrev : false, - lblNext : false, - onSelectPage : function() {} - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-pagination]", context).each(function(){ - var ele = UI.$(this); - - if (!ele.data("pagination")) { - UI.pagination(ele, UI.Utils.options(ele.attr("data-uk-pagination"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.pages = this.options.pages ? this.options.pages : Math.ceil(this.options.items / this.options.itemsOnPage) ? Math.ceil(this.options.items / this.options.itemsOnPage) : 1; - this.currentPage = this.options.currentPage; - this.halfDisplayed = this.options.displayedPages / 2; - - this.on("click", "a[data-page]", function(e){ - e.preventDefault(); - $this.selectPage(UI.$(this).data("page")); - }); - - this._render(); - }, - - _getInterval: function() { - - return { - start: Math.ceil(this.currentPage > this.halfDisplayed ? Math.max(Math.min(this.currentPage - this.halfDisplayed, (this.pages - this.options.displayedPages)), 0) : 0), - end : Math.ceil(this.currentPage > this.halfDisplayed ? Math.min(this.currentPage + this.halfDisplayed, this.pages) : Math.min(this.options.displayedPages, this.pages)) - }; - }, - - render: function(pages) { - this.pages = pages ? pages : this.pages; - this._render(); - }, - - selectPage: function(pageIndex, pages) { - this.currentPage = pageIndex; - this.render(pages); - - this.options.onSelectPage.apply(this, [pageIndex]); - this.trigger('select.uk.pagination', [pageIndex, this]); - }, - - _render: function() { - - var o = this.options, interval = this._getInterval(), i; - - this.element.empty(); - - // Generate Prev link - if (o.lblPrev) this._append(this.currentPage - 1, {text: o.lblPrev}); - - // Generate start edges - if (interval.start > 0 && o.edges > 0) { - - var end = Math.min(o.edges, interval.start); - - for (i = 0; i < end; i++) this._append(i); - - if (o.edges < interval.start && (interval.start - o.edges != 1)) { - this.element.append('
        • ...
        • '); - } else if (interval.start - o.edges == 1) { - this._append(o.edges); - } - } - - // Generate interval links - for (i = interval.start; i < interval.end; i++) this._append(i); - - // Generate end edges - if (interval.end < this.pages && o.edges > 0) { - - if (this.pages - o.edges > interval.end && (this.pages - o.edges - interval.end != 1)) { - this.element.append('
        • ...
        • '); - } else if (this.pages - o.edges - interval.end == 1) { - this._append(interval.end++); - } - - var begin = Math.max(this.pages - o.edges, interval.end); - - for (i = begin; i < this.pages; i++) this._append(i); - } - - // Generate Next link (unless option is set for at front) - if (o.lblNext) this._append(this.currentPage + 1, {text: o.lblNext}); - }, - - _append: function(pageIndex, opts) { - - var item, options; - - pageIndex = pageIndex < 0 ? 0 : (pageIndex < this.pages ? pageIndex : this.pages - 1); - options = UI.$.extend({ text: pageIndex + 1 }, opts); - - item = (pageIndex == this.currentPage) ? '
        • ' + (options.text) + '
        • ' : '
        • '+options.text+'
        • '; - - this.element.append(item); - } - }); - - return UI.pagination; -}); diff --git a/js/components/pagination.min.js b/js/components/pagination.min.js deleted file mode 100755 index 7361066..0000000 --- a/js/components/pagination.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-pagination",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:7,edges:1,currentPage:0,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-pagination]",e).each(function(){var e=t.$(this);e.data("pagination")||t.pagination(e,t.Utils.options(e.attr("data-uk-pagination")))})})},init:function(){var e=this;this.pages=this.options.pages?this.options.pages:Math.ceil(this.options.items/this.options.itemsOnPage)?Math.ceil(this.options.items/this.options.itemsOnPage):1,this.currentPage=this.options.currentPage,this.halfDisplayed=this.options.displayedPages/2,this.on("click","a[data-page]",function(i){i.preventDefault(),e.selectPage(t.$(this).data("page"))}),this._render()},_getInterval:function(){return{start:Math.ceil(this.currentPage>this.halfDisplayed?Math.max(Math.min(this.currentPage-this.halfDisplayed,this.pages-this.options.displayedPages),0):0),end:Math.ceil(this.currentPage>this.halfDisplayed?Math.min(this.currentPage+this.halfDisplayed,this.pages):Math.min(this.options.displayedPages,this.pages))}},render:function(t){this.pages=t?t:this.pages,this._render()},selectPage:function(t,e){this.currentPage=t,this.render(e),this.options.onSelectPage.apply(this,[t]),this.trigger("select.uk.pagination",[t,this])},_render:function(){var t,e=this.options,i=this._getInterval();if(this.element.empty(),e.lblPrev&&this._append(this.currentPage-1,{text:e.lblPrev}),i.start>0&&e.edges>0){var s=Math.min(e.edges,i.start);for(t=0;s>t;t++)this._append(t);e.edges..."):i.start-e.edges==1&&this._append(e.edges)}for(t=i.start;t0){this.pages-e.edges>i.end&&this.pages-e.edges-i.end!=1?this.element.append("
        • ...
        • "):this.pages-e.edges-i.end==1&&this._append(i.end++);var a=Math.max(this.pages-e.edges,i.end);for(t=a;te?0:e'+a.text+"":'
        • '+a.text+"
        • ",this.element.append(s)}}),t.pagination}); \ No newline at end of file diff --git a/js/components/parallax.js b/js/components/parallax.js deleted file mode 100755 index e706abb..0000000 --- a/js/components/parallax.js +++ /dev/null @@ -1,462 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-parallax", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - var parallaxes = [], - supports3d = false, - scrolltop = 0, - wh = window.innerHeight, - checkParallaxes = function() { - - scrolltop = UI.$win.scrollTop(); - - window.requestAnimationFrame(function(){ - for (var i=0; i < parallaxes.length; i++) { - parallaxes[i].process(); - } - }); - }; - - - UI.component('parallax', { - - defaults: { - velocity : 0.5, - target : false, - viewport : false, - media : false - }, - - boot: function() { - - supports3d = (function(){ - - var el = document.createElement('div'), - has3d, - transforms = { - 'WebkitTransform':'-webkit-transform', - 'MSTransform':'-ms-transform', - 'MozTransform':'-moz-transform', - 'Transform':'transform' - }; - - // Add it to the body to get the computed style. - document.body.insertBefore(el, null); - - for (var t in transforms) { - if (el.style[t] !== undefined) { - el.style[t] = "translate3d(1px,1px,1px)"; - has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); - } - } - - document.body.removeChild(el); - - return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); - })(); - - // listen to scroll and resize - UI.$doc.on("scrolling.uk.document", checkParallaxes); - UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){ - wh = window.innerHeight; - checkParallaxes(); - }, 50)); - - // init code - UI.ready(function(context) { - - UI.$('[data-uk-parallax]', context).each(function() { - - var parallax = UI.$(this); - - if (!parallax.data("parallax")) { - UI.parallax(parallax, UI.Utils.options(parallax.attr("data-uk-parallax"))); - } - }); - }); - }, - - init: function() { - - this.base = this.options.target ? UI.$(this.options.target) : this.element; - this.props = {}; - this.velocity = (this.options.velocity || 1); - - var reserved = ['target','velocity','viewport','plugins','media']; - - Object.keys(this.options).forEach(function(prop){ - - if (reserved.indexOf(prop) !== -1) { - return; - } - - var start, end, dir, diff, startend = String(this.options[prop]).split(','); - - if (prop.match(/color/i)) { - start = startend[1] ? startend[0] : this._getStartValue(prop), - end = startend[1] ? startend[1] : startend[0]; - - if (!start) { - start = 'rgba(255,255,255,0)'; - } - - } else { - start = parseFloat(startend[1] ? startend[0] : this._getStartValue(prop)), - end = parseFloat(startend[1] ? startend[1] : startend[0]); - diff = (start < end ? (end-start):(start-end)); - dir = (start < end ? 1:-1); - } - - this.props[prop] = { 'start': start, 'end': end, 'dir': dir, 'diff': diff }; - - }.bind(this)); - - parallaxes.push(this); - }, - - process: function() { - - if (this.options.media) { - - switch(typeof(this.options.media)) { - case 'number': - if (window.innerWidth < this.options.media) { - return false; - } - break; - case 'string': - if (window.matchMedia && !window.matchMedia(this.options.media).matches) { - return false; - } - break; - } - } - - var percent = this.percentageInViewport(); - - if (this.options.viewport !== false) { - percent = (this.options.viewport === 0) ? 1 : percent / this.options.viewport; - } - - this.update(percent); - }, - - percentageInViewport: function() { - - var top = this.base.offset().top, - height = this.base.outerHeight(), - distance, percentage, percent; - - if (top > (scrolltop + wh)) { - percent = 0; - } else if ((top + height) < scrolltop) { - percent = 1; - } else { - - if ((top + height) < wh) { - - percent = (scrolltop < wh ? scrolltop : scrolltop - wh) / (top+height); - - } else { - - distance = (scrolltop + wh) - top; - percentage = Math.round(distance / ((wh + height) / 100)); - percent = percentage/100; - } - } - - return percent; - }, - - update: function(percent) { - - var $this = this, - css = {transform:'', filter:''}, - compercent = percent * (1 - (this.velocity - (this.velocity * percent))), - opts, val; - - if (compercent < 0) compercent = 0; - if (compercent > 1) compercent = 1; - - if (this._percent !== undefined && this._percent == compercent) { - return; - } - - Object.keys(this.props).forEach(function(prop) { - - opts = this.props[prop]; - - if (percent === 0) { - val = opts.start; - } else if(percent === 1) { - val = opts.end; - } else if(opts.diff !== undefined) { - val = opts.start + (opts.diff * compercent * opts.dir); - } - - if ((prop == 'bg' || prop == 'bgp') && !this._bgcover) { - this._bgcover = initBgImageParallax(this, prop, opts); - } - - switch(prop) { - - // transforms - case 'x': - css.transform += supports3d ? ' translate3d('+val+'px, 0, 0)':' translateX('+val+'px)'; - break; - case 'xp': - css.transform += supports3d ? ' translate3d('+val+'%, 0, 0)':' translateX('+val+'%)'; - break; - case 'y': - css.transform += supports3d ? ' translate3d(0, '+val+'px, 0)':' translateY('+val+'px)'; - break; - case 'yp': - css.transform += supports3d ? ' translate3d(0, '+val+'%, 0)':' translateY('+val+'%)'; - break; - case 'rotate': - css.transform += ' rotate('+val+'deg)'; - break; - case 'scale': - css.transform += ' scale('+val+')'; - break; - - // bg image - case 'bg': - - // don't move if image height is too small - // if ($this.element.data('bgsize') && ($this.element.data('bgsize').h + val - window.innerHeight) < 0) { - // break; - // } - - css['background-position'] = '50% '+val+'px'; - break; - case 'bgp': - css['background-position'] = '50% '+val+'%'; - break; - - // color - case 'color': - case 'background-color': - case 'border-color': - css[prop] = calcColor(opts.start, opts.end, compercent); - break; - - // CSS Filter - case 'blur': - css.filter += ' blur('+val+'px)'; - break; - case 'hue': - css.filter += ' hue-rotate('+val+'deg)'; - break; - case 'grayscale': - css.filter += ' grayscale('+val+'%)'; - break; - case 'invert': - css.filter += ' invert('+val+'%)'; - break; - case 'fopacity': - css.filter += ' opacity('+val+'%)'; - break; - case 'saturate': - css.filter += ' saturate('+val+'%)'; - break; - case 'sepia': - css.filter += ' sepia('+val+'%)'; - break; - - default: - css[prop] = val; - break; - } - - }.bind(this)); - - if (css.filter) { - css['-webkit-filter'] = css.filter; - } - - this.element.css(css); - - this._percent = compercent; - }, - - _getStartValue: function(prop) { - - var value = 0; - - switch(prop) { - case 'scale': - value = 1; - break; - default: - value = this.element.css(prop); - } - - return (value || 0); - } - - }); - - - // helper - - function initBgImageParallax(obj, prop, opts) { - - var img = new Image(), url, element, size, check, ratio, width, height; - - element = obj.element.css({'background-size': 'cover', 'background-repeat': 'no-repeat'}); - url = element.css('background-image').replace(/^url\(/g, '').replace(/\)$/g, '').replace(/("|')/g, ''); - check = function() { - - var w = element.innerWidth(), h = element.innerHeight(), extra = (prop=='bg') ? opts.diff : (opts.diff/100) * h; - - h += extra; - w += Math.ceil(extra * ratio); - - if (w-extra < size.w && h < size.h) { - return obj.element.css({'background-size': 'auto'}); - } - - // if element height < parent height (gap underneath) - if ((w / ratio) < h) { - - width = Math.ceil(h * ratio); - height = h; - - if (h > window.innerHeight) { - width = width * 1.2; - height = height * 1.2; - } - - // element width < parent width (gap to right) - } else { - - width = w; - height = Math.ceil(w / ratio); - } - - element.css({'background-size': (width+'px '+height+'px')}).data('bgsize', {w:width,h:height}); - }; - - img.onerror = function(){ - // image url doesn't exist - }; - - img.onload = function(){ - size = {w:img.width, h:img.height}; - ratio = img.width / img.height; - - UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){ - check(); - }, 50)); - - check(); - }; - - img.src = url; - - return true; - } - - - // Some named colors to work with, added by Bradley Ayers - // From Interface by Stefan Petre - // http://interface.eyecon.ro/ - var colors = { - 'black': [0,0,0,1], - 'blue': [0,0,255,1], - 'brown': [165,42,42,1], - 'cyan': [0,255,255,1], - 'fuchsia': [255,0,255,1], - 'gold': [255,215,0,1], - 'green': [0,128,0,1], - 'indigo': [75,0,130,1], - 'khaki': [240,230,140,1], - 'lime': [0,255,0,1], - 'magenta': [255,0,255,1], - 'maroon': [128,0,0,1], - 'navy': [0,0,128,1], - 'olive': [128,128,0,1], - 'orange': [255,165,0,1], - 'pink': [255,192,203,1], - 'purple': [128,0,128,1], - 'violet': [128,0,128,1], - 'red': [255,0,0,1], - 'silver': [192,192,192,1], - 'white': [255,255,255,1], - 'yellow': [255,255,0,1], - 'transparent': [255,255,255,0] - }; - - function calcColor(start, end, pos) { - - start = parseColor(start); - end = parseColor(end); - pos = pos || 0; - - return calculateColor(start, end, pos); - } - - /**! - * @preserve Color animation 1.6.0 - * http://www.bitstorm.org/jquery/color-animation/ - * Copyright 2011, 2013 Edwin Martin - * Released under the MIT and GPL licenses. - */ - - // Calculate an in-between color. Returns "#aabbcc"-like string. - function calculateColor(begin, end, pos) { - var color = 'rgba(' - + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ',' - + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ',' - + parseInt((begin[2] + pos * (end[2] - begin[2])), 10) + ',' - + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1); - - color += ')'; - return color; - } - - // Parse an CSS-syntax color. Outputs an array [r, g, b] - function parseColor(color) { - - var match, quadruplet; - - // Match #aabbcc - if (match = /#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(color)) { - quadruplet = [parseInt(match[1], 16), parseInt(match[2], 16), parseInt(match[3], 16), 1]; - - // Match #abc - } else if (match = /#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(color)) { - quadruplet = [parseInt(match[1], 16) * 17, parseInt(match[2], 16) * 17, parseInt(match[3], 16) * 17, 1]; - - // Match rgb(n, n, n) - } else if (match = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) { - quadruplet = [parseInt(match[1]), parseInt(match[2]), parseInt(match[3]), 1]; - - } else if (match = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(color)) { - quadruplet = [parseInt(match[1], 10), parseInt(match[2], 10), parseInt(match[3], 10),parseFloat(match[4])]; - - // No browser returns rgb(n%, n%, n%), so little reason to support this format. - } else { - quadruplet = colors[color] || [255,255,255,0]; - } - return quadruplet; - } - - return UI.parallax; -}); diff --git a/js/components/parallax.min.js b/js/components/parallax.min.js deleted file mode 100755 index aa290a1..0000000 --- a/js/components/parallax.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-parallax",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(t,a,r){var i,n,s,o,c,l,p,f=new Image;return n=t.element.css({"background-size":"cover","background-repeat":"no-repeat"}),i=n.css("background-image").replace(/^url\(/g,"").replace(/\)$/g,"").replace(/("|')/g,""),o=function(){var e=n.innerWidth(),i=n.innerHeight(),o="bg"==a?r.diff:r.diff/100*i;return i+=o,e+=Math.ceil(o*c),e-oe/c?(l=Math.ceil(i*c),p=i,i>window.innerHeight&&(l=1.2*l,p=1.2*p)):(l=e,p=Math.ceil(e/c)),n.css({"background-size":l+"px "+p+"px"}).data("bgsize",{w:l,h:p}),void 0)},f.onerror=function(){},f.onload=function(){s={w:f.width,h:f.height},c=f.width/f.height,e.$win.on("load resize orientationchange",e.Utils.debounce(function(){o()},50)),o()},f.src=i,!0}function a(e,t,a){return e=i(e),t=i(t),a=a||0,r(e,t,a)}function r(e,t,a){var r="rgba("+parseInt(e[0]+a*(t[0]-e[0]),10)+","+parseInt(e[1]+a*(t[1]-e[1]),10)+","+parseInt(e[2]+a*(t[2]-e[2]),10)+","+(e&&t?parseFloat(e[3]+a*(t[3]-e[3])):1);return r+=")"}function i(e){var t,a;return a=(t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(e))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1]:(t=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(e))?[17*parseInt(t[1],16),17*parseInt(t[2],16),17*parseInt(t[3],16),1]:(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),1]:(t=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(e))?[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10),parseFloat(t[4])]:p[e]||[255,255,255,0]}var n=[],s=!1,o=0,c=window.innerHeight,l=function(){o=e.$win.scrollTop(),window.requestAnimationFrame(function(){for(var e=0;e0&&"none"!==e}(),e.$doc.on("scrolling.uk.document",l),e.$win.on("load resize orientationchange",e.Utils.debounce(function(){c=window.innerHeight,l()},50)),e.ready(function(t){e.$("[data-uk-parallax]",t).each(function(){var t=e.$(this);t.data("parallax")||e.parallax(t,e.Utils.options(t.attr("data-uk-parallax")))})})},init:function(){this.base=this.options.target?e.$(this.options.target):this.element,this.props={},this.velocity=this.options.velocity||1;var t=["target","velocity","viewport","plugins","media"];Object.keys(this.options).forEach(function(e){if(-1===t.indexOf(e)){var a,r,i,n,s=String(this.options[e]).split(",");e.match(/color/i)?(a=s[1]?s[0]:this._getStartValue(e),r=s[1]?s[1]:s[0],a||(a="rgba(255,255,255,0)")):(a=parseFloat(s[1]?s[0]:this._getStartValue(e)),r=parseFloat(s[1]?s[1]:s[0]),n=r>a?r-a:a-r,i=r>a?1:-1),this.props[e]={start:a,end:r,dir:i,diff:n}}}.bind(this)),n.push(this)},process:function(){if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidtho+c?a=0:o>r+i?a=1:c>r+i?a=(c>o?o:o-c)/(r+i):(e=o+c-r,t=Math.round(e/((c+i)/100)),a=t/100),a},update:function(e){var r,i,n={transform:"",filter:""},o=e*(1-(this.velocity-this.velocity*e));0>o&&(o=0),o>1&&(o=1),(void 0===this._percent||this._percent!=o)&&(Object.keys(this.props).forEach(function(c){switch(r=this.props[c],0===e?i=r.start:1===e?i=r.end:void 0!==r.diff&&(i=r.start+r.diff*o*r.dir),"bg"!=c&&"bgp"!=c||this._bgcover||(this._bgcover=t(this,c,r)),c){case"x":n.transform+=s?" translate3d("+i+"px, 0, 0)":" translateX("+i+"px)";break;case"xp":n.transform+=s?" translate3d("+i+"%, 0, 0)":" translateX("+i+"%)";break;case"y":n.transform+=s?" translate3d(0, "+i+"px, 0)":" translateY("+i+"px)";break;case"yp":n.transform+=s?" translate3d(0, "+i+"%, 0)":" translateY("+i+"%)";break;case"rotate":n.transform+=" rotate("+i+"deg)";break;case"scale":n.transform+=" scale("+i+")";break;case"bg":n["background-position"]="50% "+i+"px";break;case"bgp":n["background-position"]="50% "+i+"%";break;case"color":case"background-color":case"border-color":n[c]=a(r.start,r.end,o);break;case"blur":n.filter+=" blur("+i+"px)";break;case"hue":n.filter+=" hue-rotate("+i+"deg)";break;case"grayscale":n.filter+=" grayscale("+i+"%)";break;case"invert":n.filter+=" invert("+i+"%)";break;case"fopacity":n.filter+=" opacity("+i+"%)";break;case"saturate":n.filter+=" saturate("+i+"%)";break;case"sepia":n.filter+=" sepia("+i+"%)";break;default:n[c]=i}}.bind(this)),n.filter&&(n["-webkit-filter"]=n.filter),this.element.css(n),this._percent=o)},_getStartValue:function(e){var t=0;switch(e){case"scale":t=1;break;default:t=this.element.css(e)}return t||0}});var p={black:[0,0,0,1],blue:[0,0,255,1],brown:[165,42,42,1],cyan:[0,255,255,1],fuchsia:[255,0,255,1],gold:[255,215,0,1],green:[0,128,0,1],indigo:[75,0,130,1],khaki:[240,230,140,1],lime:[0,255,0,1],magenta:[255,0,255,1],maroon:[128,0,0,1],navy:[0,0,128,1],olive:[128,128,0,1],orange:[255,165,0,1],pink:[255,192,203,1],purple:[128,0,128,1],violet:[128,0,128,1],red:[255,0,0,1],silver:[192,192,192,1],white:[255,255,255,1],yellow:[255,255,0,1],transparent:[255,255,255,0]};return e.parallax}); \ No newline at end of file diff --git a/js/components/search.js b/js/components/search.js deleted file mode 100755 index 6f8a46e..0000000 --- a/js/components/search.js +++ /dev/null @@ -1,92 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-search", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - UI.component('search', { - defaults: { - msgResultsHeader : 'Search Results', - msgMoreResults : 'More Results', - msgNoResults : 'No results found', - template : '', - - renderer: function(data) { - - var opts = this.options; - - this.dropdown.append(this.template({"items":data.results || [], "msgResultsHeader":opts.msgResultsHeader, "msgMoreResults": opts.msgMoreResults, "msgNoResults": opts.msgNoResults})); - this.show(); - } - }, - - boot: function() { - - // init code - UI.$html.on("focus.search.uikit", "[data-uk-search]", function(e) { - var ele =UI.$(this); - - if (!ele.data("search")) { - UI.search(ele, UI.Utils.options(ele.attr("data-uk-search"))); - } - }); - }, - - init: function() { - var $this = this; - - this.autocomplete = UI.autocomplete(this.element, this.options); - - this.autocomplete.dropdown.addClass('uk-dropdown-search'); - - this.autocomplete.input.on("keyup", function(){ - $this.element[$this.autocomplete.input.val() ? "addClass":"removeClass"]("uk-active"); - }).closest("form").on("reset", function(){ - $this.value=""; - $this.element.removeClass("uk-active"); - }); - - this.on('selectitem.uk.autocomplete', function(e, data) { - if (data.url) { - location.href = data.url; - } else if(data.moreresults) { - $this.autocomplete.input.closest('form').submit(); - } - }); - - this.element.data("search", this); - } - }); -}); diff --git a/js/components/search.min.js b/js/components/search.min.js deleted file mode 100755 index d74b4ac..0000000 --- a/js/components/search.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(e){var s;window.UIkit&&(s=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return s||e(UIkit)})}(function(e){"use strict";e.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'',renderer:function(e){var s=this.options;this.dropdown.append(this.template({items:e.results||[],msgResultsHeader:s.msgResultsHeader,msgMoreResults:s.msgMoreResults,msgNoResults:s.msgNoResults})),this.show()}},boot:function(){e.$html.on("focus.search.uikit","[data-uk-search]",function(){var s=e.$(this);s.data("search")||e.search(s,e.Utils.options(s.attr("data-uk-search")))})},init:function(){var s=this;this.autocomplete=e.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){s.element[s.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){s.value="",s.element.removeClass("uk-active")}),this.on("selectitem.uk.autocomplete",function(e,t){t.url?location.href=t.url:t.moreresults&&s.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}})}); \ No newline at end of file diff --git a/js/components/slider.js b/js/components/slider.js deleted file mode 100755 index f89b588..0000000 --- a/js/components/slider.js +++ /dev/null @@ -1,540 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-slider", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - var dragging, delayIdle, anchor, dragged, store = {}; - - UI.component('slider', { - - defaults: { - center : false, - threshold : 10, - infinite : true, - autoplay : false, - autoplayInterval : 7000, - pauseOnHover : true, - activecls : 'uk-active' - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - setTimeout(function(){ - - UI.$('[data-uk-slider]', context).each(function(){ - - var ele = UI.$(this); - - if (!ele.data('slider')) { - UI.slider(ele, UI.Utils.options(ele.attr('data-uk-slider'))); - } - }); - - }, 0); - }); - }, - - init: function() { - - var $this = this; - - this.container = this.element.find('.uk-slider'); - this.focus = 0; - - UI.$win.on('resize load', UI.Utils.debounce(function() { - $this.resize(true); - }, 100)); - - this.on('click.uk.slider', '[data-uk-slider-item]', function(e) { - - e.preventDefault(); - - var item = UI.$(this).attr('data-uk-slider-item'); - - if ($this.focus == item) return; - - // stop autoplay - $this.stop(); - - switch(item) { - case 'next': - case 'previous': - $this[item=='next' ? 'next':'previous'](); - break; - default: - $this.updateFocus(parseInt(item, 10)); - } - }); - - this.container.on({ - - 'touchstart mousedown': function(evt) { - - if (evt.originalEvent && evt.originalEvent.touches) { - evt = evt.originalEvent.touches[0]; - } - - // ignore right click button - if (evt.button && evt.button==2 || !$this.active) { - return; - } - - // stop autoplay - $this.stop(); - - anchor = UI.$(evt.target).is('a') ? UI.$(evt.target) : UI.$(evt.target).parents('a:first'); - dragged = false; - - if (anchor.length) { - - anchor.one('click', function(e){ - if (dragged) e.preventDefault(); - }); - } - - delayIdle = function(e) { - - dragged = true; - dragging = $this; - store = { - touchx : parseInt(e.pageX, 10), - dir : 1, - focus : $this.focus, - base : $this.options.center ? 'center':'area' - }; - - if (e.originalEvent && e.originalEvent.touches) { - e = e.originalEvent.touches[0]; - } - - dragging.element.data({ - 'pointer-start': {x: parseInt(e.pageX, 10), y: parseInt(e.pageY, 10)}, - 'pointer-pos-start': $this.pos - }); - - $this.container.addClass('uk-drag'); - - delayIdle = false; - }; - - delayIdle.x = parseInt(evt.pageX, 10); - delayIdle.threshold = $this.options.threshold; - - }, - - mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; }, - mouseleave: function() { $this.hovering = false; } - }); - - this.resize(true); - - this.on('display.uk.check', function(){ - if ($this.element.is(":visible")) { - $this.resize(true); - } - }); - - // prevent dragging links + images - this.element.find('a,img').attr('draggable', 'false'); - - // Set autoplay - if (this.options.autoplay) { - this.start(); - } - - }, - - resize: function(focus) { - - var $this = this, pos = 0, maxheight = 0, item, width, cwidth, size; - - this.items = this.container.children().filter(':visible'); - this.vp = this.element[0].getBoundingClientRect().width; - - this.container.css({'min-width': '', 'min-height': ''}); - - this.items.each(function(idx){ - - item = UI.$(this); - size = item.css({'left': '', 'width':''})[0].getBoundingClientRect(); - width = size.width; - cwidth = item.width(); - maxheight = Math.max(maxheight, size.height); - - item.css({'left': pos, 'width':width}).data({'idx':idx, 'left': pos, 'width': width, 'cwidth':cwidth, 'area': (pos+width), 'center':(pos - ($this.vp/2 - cwidth/2))}); - - pos += width; - }); - - this.container.css({'min-width': pos, 'min-height': maxheight}); - - if (this.options.infinite && (pos <= (2*this.vp) || this.items.length < 5) && !this.itemsResized) { - - // fill with cloned items - this.container.children().each(function(idx){ - $this.container.append($this.items.eq(idx).clone(true).attr('id', '')); - }).each(function(idx){ - $this.container.append($this.items.eq(idx).clone(true).attr('id', '')); - }); - - this.itemsResized = true; - - return this.resize(); - } - - this.cw = pos; - this.pos = 0; - this.active = pos >= this.vp; - - this.container.css({ - '-ms-transform': '', - '-webkit-transform': '', - 'transform': '' - }); - - if (focus) this.updateFocus(this.focus); - }, - - updatePos: function(pos) { - this.pos = pos; - this.container.css({ - '-ms-transform': 'translateX('+pos+'px)', - '-webkit-transform': 'translateX('+pos+'px)', - 'transform': 'translateX('+pos+'px)' - }); - }, - - updateFocus: function(idx, dir) { - - if (!this.active) { - return; - } - - dir = dir || (idx > this.focus ? 1:-1); - - var item = this.items.eq(idx), area, i; - - if (this.options.infinite) { - this.infinite(idx, dir); - } - - if (this.options.center) { - - this.updatePos(item.data('center')*-1); - - this.items.filter('.'+this.options.activecls).removeClass(this.options.activecls); - item.addClass(this.options.activecls); - - } else { - - if (this.options.infinite) { - - this.updatePos(item.data('left')*-1); - - } else { - - area = 0; - - for (i=idx;i this.vp) { - - this.updatePos(item.data('left')*-1); - - } else { - - if (dir == 1) { - - area = 0; - - for (i=this.items.length-1;i>=0;i--) { - - area += this.items.eq(i).data('width'); - - if (area == this.vp) { - idx = i; - break; - } - - if (area > this.vp) { - idx = (i < this.items.length-1) ? i+1 : i; - break; - } - } - - if (area > this.vp) { - this.updatePos((this.container.width() - this.vp) * -1); - } else { - this.updatePos(this.items.eq(idx).data('left')*-1); - } - } - } - } - } - - // mark elements - var left = this.items.eq(idx).data('left'); - - this.items.removeClass('uk-slide-before uk-slide-after').each(function(i){ - if (i!==idx) { - UI.$(this).addClass(UI.$(this).data('left') < left ? 'uk-slide-before':'uk-slide-after'); - } - }); - - this.focus = idx; - - this.trigger('focusitem.uk.slider', [idx,this.items.eq(idx),this]); - }, - - next: function() { - - var focus = this.items[this.focus + 1] ? (this.focus + 1) : (this.options.infinite ? 0:this.focus); - - this.updateFocus(focus, 1); - }, - - previous: function() { - - var focus = this.items[this.focus - 1] ? (this.focus - 1) : (this.options.infinite ? (this.items[this.focus - 1] ? this.items-1:this.items.length-1):this.focus); - - this.updateFocus(focus, -1); - }, - - start: function() { - - this.stop(); - - var $this = this; - - this.interval = setInterval(function() { - if (!$this.hovering) $this.next(); - }, this.options.autoplayInterval); - - }, - - stop: function() { - if (this.interval) clearInterval(this.interval); - }, - - infinite: function(baseidx, direction) { - - var $this = this, item = this.items.eq(baseidx), i, z = baseidx, move = [], area = 0; - - if (direction == 1) { - - - for (i=0;i this.vp) { - break; - } - - z = z+1 == this.items.length ? 0:z+1; - } - - if (move.length) { - - move.forEach(function(itm){ - - var left = item.data('area'); - - itm.css({'left': left}).data({ - 'left' : left, - 'area' : (left+itm.data('width')), - 'center': (left - ($this.vp/2 - itm.data('cwidth')/2)) - }); - - item = itm; - }); - } - - - } else { - - for (i=this.items.length-1;i >-1 ;i--) { - - area += this.items.eq(z).data('width'); - - if (z != baseidx) { - move.push(this.items.eq(z)); - } - - if (area > this.vp) { - break; - } - - z = z-1 == -1 ? this.items.length-1:z-1; - } - - if (move.length) { - - move.forEach(function(itm){ - - var left = item.data('left') - itm.data('width'); - - itm.css({'left': left}).data({ - 'left' : left, - 'area' : (left+itm.data('width')), - 'center': (left - ($this.vp/2 - itm.data('cwidth')/2)) - }); - - item = itm; - }); - } - } - } - }); - - // handle dragging - UI.$doc.on('mousemove.uk.slider touchmove.uk.slider', function(e) { - - if (e.originalEvent && e.originalEvent.touches) { - e = e.originalEvent.touches[0]; - } - - if (delayIdle && Math.abs(e.pageX - delayIdle.x) > delayIdle.threshold) { - - if (!window.getSelection().toString()) { - delayIdle(e); - } else { - dragging = delayIdle = false; - } - } - - if (!dragging) { - return; - } - - var x, xDiff, pos, dir, focus, item, next, diff, i, z, itm; - - if (e.clientX || e.clientY) { - x = e.clientX; - } else if (e.pageX || e.pageY) { - x = e.pageX - document.body.scrollLeft - document.documentElement.scrollLeft; - } - - focus = store.focus; - xDiff = x - dragging.element.data('pointer-start').x; - pos = dragging.element.data('pointer-pos-start') + xDiff; - dir = x > dragging.element.data('pointer-start').x ? -1:1; - item = dragging.items.eq(store.focus); - - if (dir == 1) { - - diff = item.data('left') + Math.abs(xDiff); - - for (i=0,z=store.focus;i diff) { - focus = z; - break; - } - - z = z+1 == dragging.items.length ? 0:z+1; - } - - } else { - - diff = item.data('left') - Math.abs(xDiff); - - for (i=0,z=store.focus;i store.diff) { - focus = z; - break; - } - - z = z+1 == dragging.items.length ? 0:z+1; - } - - } else { - - for (i=0,z=store.focus;i=this.vp,this.container.css({"-ms-transform":"","-webkit-transform":"",transform:""}),e&&this.updateFocus(this.focus),void 0)},updatePos:function(t){this.pos=t,this.container.css({"-ms-transform":"translateX("+t+"px)","-webkit-transform":"translateX("+t+"px)",transform:"translateX("+t+"px)"})},updateFocus:function(e,i){if(this.active){i=i||(e>this.focus?1:-1);var s,n,a=this.items.eq(e);if(this.options.infinite&&this.infinite(e,i),this.options.center)this.updatePos(-1*a.data("center")),this.items.filter("."+this.options.activecls).removeClass(this.options.activecls),a.addClass(this.options.activecls);else if(this.options.infinite)this.updatePos(-1*a.data("left"));else{for(s=0,n=e;nthis.vp)this.updatePos(-1*a.data("left"));else if(1==i){for(s=0,n=this.items.length-1;n>=0;n--){if(s+=this.items.eq(n).data("width"),s==this.vp){e=n;break}if(s>this.vp){e=nthis.vp?this.updatePos(-1*(this.container.width()-this.vp)):this.updatePos(-1*this.items.eq(e).data("left"))}}var o=this.items.eq(e).data("left");this.items.removeClass("uk-slide-before uk-slide-after").each(function(i){i!==e&&t.$(this).addClass(t.$(this).data("left")this.vp));i++)a=a+1==this.items.length?0:a+1;o.length&&o.forEach(function(t){var e=n.data("area");t.css({left:e}).data({left:e,area:e+t.data("width"),center:e-(s.vp/2-t.data("cwidth")/2)}),n=t})}else{for(i=this.items.length-1;i>-1&&(h+=this.items.eq(a).data("width"),a!=t&&o.push(this.items.eq(a)),!(h>this.vp));i--)a=a-1==-1?this.items.length-1:a-1;o.length&&o.forEach(function(t){var e=n.data("left")-t.data("width");t.css({left:e}).data({left:e,area:e+t.data("width"),center:e-(s.vp/2-t.data("cwidth")/2)}),n=t})}}}),t.$doc.on("mousemove.uk.slider touchmove.uk.slider",function(t){if(t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]),i&&Math.abs(t.pageX-i.x)>i.threshold&&(window.getSelection().toString()?e=i=!1:i(t)),e){var s,n,o,h,r,c,f,u,d,l;if(t.clientX||t.clientY?s=t.clientX:(t.pageX||t.pageY)&&(s=t.pageX-document.body.scrollLeft-document.documentElement.scrollLeft),r=a.focus,n=s-e.element.data("pointer-start").x,o=e.element.data("pointer-pos-start")+n,h=s>e.element.data("pointer-start").x?-1:1,c=e.items.eq(a.focus),1==h)for(f=c.data("left")+Math.abs(n),u=0,d=a.focus;uf){r=d;break}d=d+1==e.items.length?0:d+1}else for(f=c.data("left")-Math.abs(n),u=0,d=a.focus;ua.diff){o=n;break}n=n+1==e.items.length?0:n+1}else for(s=0,n=a.focus;s'); - } - - this.nav[this.nav.children().length==1 ? 'addClass':'removeClass']('uk-invisible'); - } - - this.activeSet = false; - this.show(0, !animate); - }, - - updateFilter: function(currentfilter) { - - var $this = this, filter; - - this.currentFilter = currentfilter; - - this.controls.find('[data-uk-filter]').each(function(){ - - filter = UI.$(this); - - if (!filter.parent().hasClass('uk-slideset')) { - - if (filter.attr('data-uk-filter') == $this.currentFilter) { - filter.addClass('uk-active'); - } else { - filter.removeClass('uk-active'); - } - } - }); - }, - - getVisibleOnCurrenBreakpoint: function() { - - var breakpoint = null, - tmp = UI.$('
          ').appendTo('body'), - testdiv = tmp.children().eq(0), - breakpoints = this.options; - - ['xlarge', 'large', 'medium', 'small'].forEach(function(bp) { - - if (!breakpoints[bp] || breakpoint) { - return; - } - - tmp.attr('class', 'uk-grid-width-'+bp+'-1-2').width(); - - if (testdiv.width() == 50) { - breakpoint = bp; - } - }); - - tmp.remove(); - - return this.options[breakpoint] || this.options['default']; - }, - - getItems: function() { - - var items = [], filter; - - if (this.currentFilter) { - - filter = this.currentFilter || []; - - if (typeof(filter) === 'string') { - filter = filter.split(/,/).map(function(item){ return item.trim(); }); - } - - this.children.each(function(index){ - - var ele = UI.$(this), f = ele.attr('data-uk-filter'), infilter = filter.length ? false : true; - - if (f) { - - f = f.split(/,/).map(function(item){ return item.trim(); }); - - filter.forEach(function(item){ - if (f.indexOf(item) > -1) infilter = true; - }); - } - - if(infilter) items.push(ele[0]); - }); - - items = UI.$(items); - - } else { - items = this.list.children(); - } - - return items; - }, - - show: function(setIndex, noanimate, dir) { - - var $this = this; - - if (this.activeSet === setIndex || this.animating) { - return; - } - - dir = dir || (setIndex < this.activeSet ? -1:1); - - var current = this.sets[this.activeSet] || [], - next = this.sets[setIndex], - animation = this._getAnimation(); - - if (noanimate || !UI.support.animation) { - animation = Animations.none; - } - - this.animating = true; - - if (this.nav.length) { - this.nav.children().removeClass('uk-active').eq(setIndex).addClass('uk-active'); - } - - animation.apply($this, [current, next, dir]).then(function(){ - - UI.Utils.checkDisplay(next, true); - - $this.children.hide().removeClass('uk-active'); - next.addClass('uk-active').css({'display': '', 'opacity':''}); - - $this.animating = false; - $this.activeSet = setIndex; - - UI.Utils.checkDisplay(next, true); - - $this.trigger('show.uk.slideset', [next]); - }); - - }, - - _getAnimation: function() { - - var animation = Animations[this.options.animation] || Animations.none; - - if (!UI.support.animation) { - animation = Animations.none; - } - - return animation; - }, - - _hide: function() { - - var $this = this, - current = this.sets[this.activeSet] || [], - animation = this._getAnimation(); - - this.animating = true; - - return animation.apply($this, [current, [], 1]).then(function(){ - $this.animating = false; - }); - }, - - next: function() { - this.show(this.sets[this.activeSet + 1] ? (this.activeSet + 1) : 0, false, 1); - }, - - previous: function() { - this.show(this.sets[this.activeSet - 1] ? (this.activeSet - 1) : (this.sets.length - 1), false, -1); - }, - - start: function() { - - this.stop(); - - var $this = this; - - this.interval = setInterval(function() { - if (!$this.hovering && !$this.animating) $this.next(); - }, this.options.autoplayInterval); - - }, - - stop: function() { - if (this.interval) clearInterval(this.interval); - } - }); - - Animations = { - - 'none': function() { - var d = UI.$.Deferred(); - d.resolve(); - return d.promise(); - }, - - 'fade': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-fade', current, next]); - }, - - 'slide-bottom': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-bottom', current, next]); - }, - - 'slide-top': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-top', current, next]); - }, - - 'slide-vertical': function(current, next, dir) { - - var anim = ['uk-animation-slide-top', 'uk-animation-slide-bottom']; - - if (dir == -1) { - anim.reverse(); - } - - return coreAnimation.apply(this, [anim, current, next]); - }, - - 'slide-horizontal': function(current, next, dir) { - - var anim = ['uk-animation-slide-right', 'uk-animation-slide-left']; - - if (dir == -1) { - anim.reverse(); - } - - return coreAnimation.apply(this, [anim, current, next, dir]); - }, - - 'scale': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-scale-up', current, next]); - } - }; - - UI.slideset.animations = Animations; - - // helpers - - function coreAnimation(cls, current, next, dir) { - - var d = UI.$.Deferred(), - delay = (this.options.delay === false) ? Math.floor(this.options.duration/2) : this.options.delay, - $this = this, clsIn, clsOut, release, i; - - dir = dir || 1; - - this.element.css('min-height', this.element.height()); - - if (next[0]===current[0]) { - d.resolve(); - return d.promise(); - } - - if (typeof(cls) == 'object') { - clsIn = cls[0]; - clsOut = cls[1] || cls[0]; - } else { - clsIn = cls; - clsOut = clsIn; - } - - release = function() { - - if (current && current.length) { - current.hide().removeClass(clsOut+' uk-animation-reverse').css({'opacity':'', 'animation-delay': '', 'animation':''}); - } - - if (!next.length) { - d.resolve(); - return; - } - - for (i=0;ii)return null;for(;a>s;)e=s%i,e?o[n][e]=t[s]:o[++n]=[t[s]],s++;for(s=0,a=o.length;a>s;)o[s]=jQuery(o[s]),s++;return o}var s;t.component("slideset",{defaults:{"default":1,animation:"fade",duration:200,filter:"",delay:!1,controls:!1,autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},sets:[],boot:function(){t.ready(function(i){t.$("[data-uk-slideset]",i).each(function(){var i=t.$(this);i.data("slideset")||t.slideset(i,t.Utils.options(i.attr("data-uk-slideset")))})})},init:function(){var i=this;this.activeSet=!1,this.list=this.element.find(".uk-slideset"),this.nav=this.element.find(".uk-slideset-nav"),this.controls=this.options.controls?t.$(this.options.controls):this.element,t.$win.on("resize load",t.Utils.debounce(function(){i.updateSets()},100)),i.list.addClass("uk-grid-width-1-"+i.options.default),["xlarge","large","medium","small"].forEach(function(t){i.options[t]&&i.list.addClass("uk-grid-width-"+t+"-1-"+i.options[t])}),this.on("click.uk.slideset","[data-uk-slideset-item]",function(e){if(e.preventDefault(),!i.animating){var s=t.$(this).attr("data-uk-slideset-item");if(i.activeSet!==s)switch(s){case"next":case"previous":i["next"==s?"next":"previous"]();break;default:i.show(parseInt(s,10))}}}),this.controls.on("click.uk.slideset","[data-uk-filter]",function(e){var s=t.$(this);s.parent().hasClass("uk-slideset")||(e.preventDefault(),i.animating||i.currentFilter==s.attr("data-uk-filter")||(i.updateFilter(s.attr("data-uk-filter")),i._hide().then(function(){i.updateSets(!0,!0)})))}),this.on("swipeRight swipeLeft",function(t){i["swipeLeft"==t.type?"next":"previous"]()}),this.updateFilter(this.options.filter),this.updateSets(),this.element.on({mouseenter:function(){i.options.pauseOnHover&&(i.hovering=!0)},mouseleave:function(){i.hovering=!1}}),this.options.autoplay&&this.start()},updateSets:function(t,i){var s,n=this.visible;if(this.visible=this.getVisibleOnCurrenBreakpoint(),n!=this.visible||i){for(this.children=this.list.children().hide(),this.items=this.getItems(),this.sets=e(this.items,this.visible),s=0;s');this.nav[1==this.nav.children().length?"addClass":"removeClass"]("uk-invisible")}this.activeSet=!1,this.show(0,!t)}},updateFilter:function(i){var e,s=this;this.currentFilter=i,this.controls.find("[data-uk-filter]").each(function(){e=t.$(this),e.parent().hasClass("uk-slideset")||(e.attr("data-uk-filter")==s.currentFilter?e.addClass("uk-active"):e.removeClass("uk-active"))})},getVisibleOnCurrenBreakpoint:function(){var i=null,e=t.$('
          ').appendTo("body"),s=e.children().eq(0),n=this.options;return["xlarge","large","medium","small"].forEach(function(t){n[t]&&!i&&(e.attr("class","uk-grid-width-"+t+"-1-2").width(),50==s.width()&&(i=t))}),e.remove(),this.options[i]||this.options["default"]},getItems:function(){var i,e=[];return this.currentFilter?(i=this.currentFilter||[],"string"==typeof i&&(i=i.split(/,/).map(function(t){return t.trim()})),this.children.each(function(){var s=t.$(this),n=s.attr("data-uk-filter"),a=i.length?!1:!0;n&&(n=n.split(/,/).map(function(t){return t.trim()}),i.forEach(function(t){n.indexOf(t)>-1&&(a=!0)})),a&&e.push(s[0])}),e=t.$(e)):e=this.list.children(),e},show:function(i,e,n){var a=this;if(this.activeSet!==i&&!this.animating){n=n||(i').css({ - top : 0, - left : 0, - width : this.container.width(), - height : this.container.height(), - opacity: 1, - zIndex : 15 - }), - ghostWidth = ghost.width(), - ghostHeight = ghost.height(), - pos = fromfx == 'slice-up' ? ghostHeight:'0', - bar; - - for (var i = 0; i < this.options.slices; i++) { - - if (fromfx == 'slice-up-down') { - pos = ((i % 2) + 2) % 2==0 ? '0':ghostHeight; - } - - var width = (i == this.options.slices-1) ? sliceWidth : sliceWidth, - clipto = ('rect(0px, '+(width*(i+1))+'px, '+ghostHeight+'px, '+(sliceWidth*i)+'px)'), - clipfrom; - - //slice-down - default - clipfrom = ('rect(0px, '+(width*(i+1))+'px, 0px, '+(sliceWidth*i)+'px)'); - - if (fromfx == 'slice-up' || (fromfx == 'slice-up-down' && ((i % 2) + 2) % 2==0 )) { - clipfrom = ('rect('+ghostHeight+'px, '+(width*(i+1))+'px, '+ghostHeight+'px, '+(sliceWidth*i)+'px)'); - } - - bar = UI.$('
          ').css({ - 'position' : 'absolute', - 'top' : 0, - 'left' : 0, - 'width' : ghostWidth, - 'height' : ghostHeight, - 'background-image' : bgimage, - 'clip' : clipfrom, - 'opacity' : 0, - 'transition' : 'all '+this.options.duration+'ms ease-in-out '+(i*60)+'ms', - '-webkit-transition' : 'all '+this.options.duration+'ms ease-in-out '+(i*60)+'ms' - - }).data('clip', clipto); - - ghost.append(bar); - } - - this.container.append(ghost); - - ghost.children().last().on(UI.support.transition.end, function() { - - setTimeout(ghost.remove.bind(ghost), 0); - - d.resolve(); - }); - - ghost.width(); - - ghost.children().each(function() { - var bar = UI.$(this); - - bar.css({ - 'clip': bar.data('clip'), - 'opacity': 1 - }); - }); - - return d.promise(); - }, - - 'slice-up': function(current, next, dir) { - return Animations.slice.apply(this, [current, next, dir, 'slice-up']); - }, - - 'slice-down': function(current, next, dir) { - return Animations.slice.apply(this, [current, next, dir, 'slice-down']); - }, - - 'slice-up-down': function(current, next, dir) { - return Animations.slice.apply(this, [current, next, dir, 'slice-up-down']); - }, - - 'fold': function(current, next, dir) { - - if (!next.data('cover')) { - return Animations.fade.apply(this, arguments); - } - - var d = UI.$.Deferred(); - - var sliceWidth = Math.ceil(this.element.width() / this.options.slices), - bgimage = next.data('cover').css('background-image'), - ghost = UI.$('
        • ').css({ - width : next.width(), - height : next.height(), - opacity: 1, - zIndex : 15 - }), - ghostWidth = next.width(), - ghostHeight = next.height(), - bar; - - for (var i = 0; i < this.options.slices; i++) { - - bar = UI.$('
          ').css({ - 'position' : 'absolute', - 'top' : 0, - 'left' : 0, - 'width' : ghostWidth, - 'height' : ghostHeight, - 'background-image' : bgimage, - 'transform-origin' : (sliceWidth*i)+'px 0 0', - 'clip' : ('rect(0px, '+(sliceWidth*(i+1))+'px, '+ghostHeight+'px, '+(sliceWidth*i)+'px)'), - 'opacity' : 0, - 'transform' : 'scaleX(0.000001)', - 'transition' : 'all '+this.options.duration+'ms ease-in-out '+(100+i*60)+'ms', - '-webkit-transition' : 'all '+this.options.duration+'ms ease-in-out '+(100+i*60)+'ms' - }); - - ghost.prepend(bar); - } - - this.container.append(ghost); - - ghost.width(); - - ghost.children().first().on(UI.support.transition.end, function() { - - setTimeout(ghost.remove.bind(ghost), 0); - - d.resolve(); - }).end().css({ - 'transform': 'scaleX(1)', - 'opacity': 1 - }); - - return d.promise(); - }, - - 'puzzle': function(current, next, dir) { - - if (!next.data('cover')) { - return Animations.fade.apply(this, arguments); - } - - var d = UI.$.Deferred(), $this = this; - - var boxCols = Math.round(this.options.slices/2), - boxWidth = Math.round(next.width()/boxCols), - boxRows = Math.round(next.height()/boxWidth), - boxHeight = Math.round(next.height()/boxRows)+1, - bgimage = next.data('cover').css('background-image'), - ghost = UI.$('
        • ').css({ - width : this.container.width(), - height : this.container.height(), - opacity : 1, - zIndex : 15 - }), - ghostWidth = this.container.width(), - ghostHeight = this.container.height(), - box, rect, width; - - for (var rows = 0; rows < boxRows; rows++) { - - for (var cols = 0; cols < boxCols; cols++) { - - width = (cols == boxCols-1) ? (boxWidth + 2) : boxWidth; - - rect = [ - (boxHeight * rows) +'px', // top - (width * (cols+1)) +'px', // right - (boxHeight * (rows + 1)) +'px', // bottom - (boxWidth * cols) +'px' // left - ]; - - box = UI.$('
          ').css({ - 'position' : 'absolute', - 'top' : 0, - 'left' : 0, - 'opacity' : 0, - 'width' : ghostWidth, - 'height' : ghostHeight, - 'background-image' : bgimage, - 'clip' : ('rect('+rect.join(',')+')'), - '-webkit-transform' : 'translateZ(0)', // fixes webkit opacity flickering bug - 'transform' : 'translateZ(0)' // fixes moz opacity flickering bug - }); - - ghost.append(box); - } - } - - this.container.append(ghost); - - var boxes = shuffle(ghost.children()); - - boxes.each(function(i) { - UI.$(this).css({ - 'transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms', - '-webkit-transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms' - }); - }).last().on(UI.support.transition.end, function() { - - setTimeout(ghost.remove.bind(ghost), 0); - - d.resolve(); - }); - - ghost.width(); - - boxes.css({'opacity': 1}); - - return d.promise(); - }, - - 'boxes': function(current, next, dir, fromfx) { - - if (!next.data('cover')) { - return Animations.fade.apply(this, arguments); - } - - var d = UI.$.Deferred(); - - var boxCols = Math.round(this.options.slices/2), - boxWidth = Math.round(next.width()/boxCols), - boxRows = Math.round(next.height()/boxWidth), - boxHeight = Math.round(next.height()/boxRows)+1, - bgimage = next.data('cover').css('background-image'), - ghost = UI.$('
        • ').css({ - width : next.width(), - height : next.height(), - opacity : 1, - zIndex : 15 - }), - ghostWidth = next.width(), - ghostHeight = next.height(), - box, rect, width, cols; - - for (var rows = 0; rows < boxRows; rows++) { - - for (cols = 0; cols < boxCols; cols++) { - - width = (cols == boxCols-1) ? (boxWidth + 2) : boxWidth; - - rect = [ - (boxHeight * rows) +'px', // top - (width * (cols+1)) +'px', // right - (boxHeight * (rows + 1)) +'px', // bottom - (boxWidth * cols) +'px' // left - ]; - - box = UI.$('
          ').css({ - 'position' : 'absolute', - 'top' : 0, - 'left' : 0, - 'opacity' : 1, - 'width' : ghostWidth, - 'height' : ghostHeight, - 'background-image' : bgimage, - 'transform-origin' : rect[3]+' '+rect[0]+' 0', - 'clip' : ('rect('+rect.join(',')+')'), - '-webkit-transform' : 'scale(0.0000000000000001)', - 'transform' : 'scale(0.0000000000000001)' - }); - - ghost.append(box); - } - } - - this.container.append(ghost); - - var rowIndex = 0, colIndex = 0, timeBuff = 0, box2Darr = [[]], boxes = ghost.children(), prevCol; - - if (fromfx == 'boxes-reverse') { - boxes = [].reverse.apply(boxes); - } - - boxes.each(function() { - - box2Darr[rowIndex][colIndex] = UI.$(this); - colIndex++; - - if(colIndex == boxCols) { - rowIndex++; - colIndex = 0; - box2Darr[rowIndex] = []; - } - }); - - for (cols = 0, prevCol = 0; cols < (boxCols * boxRows); cols++) { - - prevCol = cols; - - for (var row = 0; row < boxRows; row++) { - - if (prevCol >= 0 && prevCol < boxCols) { - - box2Darr[row][prevCol].css({ - 'transition': 'all '+this.options.duration+'ms linear '+(50+timeBuff)+'ms', - '-webkit-transition': 'all '+this.options.duration+'ms linear '+(50+timeBuff)+'ms' - }); - } - prevCol--; - } - timeBuff += 100; - } - - boxes.last().on(UI.support.transition.end, function() { - - setTimeout(ghost.remove.bind(ghost), 0); - - d.resolve(); - }); - - ghost.width(); - - boxes.css({ - '-webkit-transform': 'scale(1)', - 'transform': 'scale(1)' - }); - - return d.promise(); - }, - - 'boxes-reverse': function(current, next, dir) { - return Animations.boxes.apply(this, [current, next, dir, 'boxes-reverse']); - }, - - 'random-fx': function(){ - - var animations = ['slice-up', 'fold', 'puzzle', 'slice-down', 'boxes', 'slice-up-down', 'boxes-reverse']; - - this.fxIndex = (this.fxIndex === undefined ? -1 : this.fxIndex) + 1; - - if (!animations[this.fxIndex]) this.fxIndex = 0; - - return Animations[animations[this.fxIndex]].apply(this, arguments); - } - }); - - - // helper functions - - // Shuffle an array - var shuffle = function(arr) { - for (var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x) {} - return arr; - }; - - return UI.slideshow.animations; -}); diff --git a/js/components/slideshow-fx.min.js b/js/components/slideshow-fx.min.js deleted file mode 100755 index 72340d1..0000000 --- a/js/components/slideshow-fx.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(i){var t;window.UIkit&&(t=i(UIkit)),"function"==typeof define&&define.amd&&define("uikit-slideshow-fx",["uikit"],function(){return t||i(UIkit)})}(function(i){"use strict";var t=i.slideshow.animations;i.$.extend(i.slideshow.animations,{slice:function(e,s,n,o){if(!e.data("cover"))return t.fade.apply(this,arguments);for(var r,a=i.$.Deferred(),c=Math.ceil(this.element.width()/this.options.slices),d=s.data("cover").css("background-image"),h=i.$("
        • ").css({top:0,left:0,width:this.container.width(),height:this.container.height(),opacity:1,zIndex:15}),p=h.width(),l=h.height(),u="slice-up"==o?l:"0",f=0;f').css({position:"absolute",top:0,left:0,width:p,height:l,"background-image":d,clip:m,opacity:0,transition:"all "+this.options.duration+"ms ease-in-out "+60*f+"ms","-webkit-transition":"all "+this.options.duration+"ms ease-in-out "+60*f+"ms"}).data("clip",v),h.append(r)}return this.container.append(h),h.children().last().on(i.support.transition.end,function(){setTimeout(h.remove.bind(h),0),a.resolve()}),h.width(),h.children().each(function(){var t=i.$(this);t.css({clip:t.data("clip"),opacity:1})}),a.promise()},"slice-up":function(i,e,s){return t.slice.apply(this,[i,e,s,"slice-up"])},"slice-down":function(i,e,s){return t.slice.apply(this,[i,e,s,"slice-down"])},"slice-up-down":function(i,e,s){return t.slice.apply(this,[i,e,s,"slice-up-down"])},fold:function(e,s){if(!s.data("cover"))return t.fade.apply(this,arguments);for(var n,o=i.$.Deferred(),r=Math.ceil(this.element.width()/this.options.slices),a=s.data("cover").css("background-image"),c=i.$("
        • ").css({width:s.width(),height:s.height(),opacity:1,zIndex:15}),d=s.width(),h=s.height(),p=0;p').css({position:"absolute",top:0,left:0,width:d,height:h,"background-image":a,"transform-origin":r*p+"px 0 0",clip:"rect(0px, "+r*(p+1)+"px, "+h+"px, "+r*p+"px)",opacity:0,transform:"scaleX(0.000001)",transition:"all "+this.options.duration+"ms ease-in-out "+(100+60*p)+"ms","-webkit-transition":"all "+this.options.duration+"ms ease-in-out "+(100+60*p)+"ms"}),c.prepend(n);return this.container.append(c),c.width(),c.children().first().on(i.support.transition.end,function(){setTimeout(c.remove.bind(c),0),o.resolve()}).end().css({transform:"scaleX(1)",opacity:1}),o.promise()},puzzle:function(s,n){if(!n.data("cover"))return t.fade.apply(this,arguments);for(var o,r,a,c=i.$.Deferred(),d=this,h=Math.round(this.options.slices/2),p=Math.round(n.width()/h),l=Math.round(n.height()/p),u=Math.round(n.height()/l)+1,f=n.data("cover").css("background-image"),m=i.$("
        • ").css({width:this.container.width(),height:this.container.height(),opacity:1,zIndex:15}),x=this.container.width(),v=this.container.height(),g=0;l>g;g++)for(var w=0;h>w;w++)a=w==h-1?p+2:p,r=[u*g+"px",a*(w+1)+"px",u*(g+1)+"px",p*w+"px"],o=i.$('
          ').css({position:"absolute",top:0,left:0,opacity:0,width:x,height:v,"background-image":f,clip:"rect("+r.join(",")+")","-webkit-transform":"translateZ(0)",transform:"translateZ(0)"}),m.append(o);this.container.append(m);var b=e(m.children());return b.each(function(t){i.$(this).css({transition:"all "+d.options.duration+"ms ease-in-out "+(50+25*t)+"ms","-webkit-transition":"all "+d.options.duration+"ms ease-in-out "+(50+25*t)+"ms"})}).last().on(i.support.transition.end,function(){setTimeout(m.remove.bind(m),0),c.resolve()}),m.width(),b.css({opacity:1}),c.promise()},boxes:function(e,s,n,o){if(!s.data("cover"))return t.fade.apply(this,arguments);for(var r,a,c,d,h=i.$.Deferred(),p=Math.round(this.options.slices/2),l=Math.round(s.width()/p),u=Math.round(s.height()/l),f=Math.round(s.height()/u)+1,m=s.data("cover").css("background-image"),x=i.$("
        • ").css({width:s.width(),height:s.height(),opacity:1,zIndex:15}),v=s.width(),g=s.height(),w=0;u>w;w++)for(d=0;p>d;d++)c=d==p-1?l+2:l,a=[f*w+"px",c*(d+1)+"px",f*(w+1)+"px",l*d+"px"],r=i.$('
          ').css({position:"absolute",top:0,left:0,opacity:1,width:v,height:g,"background-image":m,"transform-origin":a[3]+" "+a[0]+" 0",clip:"rect("+a.join(",")+")","-webkit-transform":"scale(0.0000000000000001)",transform:"scale(0.0000000000000001)"}),x.append(r);this.container.append(x);var b,k=0,y=0,$=0,I=[[]],M=x.children();for("boxes-reverse"==o&&(M=[].reverse.apply(M)),M.each(function(){I[k][y]=i.$(this),y++,y==p&&(k++,y=0,I[k]=[])}),d=0,b=0;p*u>d;d++){b=d;for(var z=0;u>z;z++)b>=0&&p>b&&I[z][b].css({transition:"all "+this.options.duration+"ms linear "+(50+$)+"ms","-webkit-transition":"all "+this.options.duration+"ms linear "+(50+$)+"ms"}),b--;$+=100}return M.last().on(i.support.transition.end,function(){setTimeout(x.remove.bind(x),0),h.resolve()}),x.width(),M.css({"-webkit-transform":"scale(1)",transform:"scale(1)"}),h.promise()},"boxes-reverse":function(i,e,s){return t.boxes.apply(this,[i,e,s,"boxes-reverse"])},"random-fx":function(){var i=["slice-up","fold","puzzle","slice-down","boxes","slice-up-down","boxes-reverse"];return this.fxIndex=(void 0===this.fxIndex?-1:this.fxIndex)+1,i[this.fxIndex]||(this.fxIndex=0),t[i[this.fxIndex]].apply(this,arguments)}});var e=function(i){for(var t,e,s=i.length;s;t=parseInt(Math.random()*s),e=i[--s],i[s]=i[t],i[t]=e);return i};return i.slideshow.animations}); \ No newline at end of file diff --git a/js/components/slideshow.js b/js/components/slideshow.js deleted file mode 100755 index 88cd4e7..0000000 --- a/js/components/slideshow.js +++ /dev/null @@ -1,560 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-slideshow", ["uikit"], function() { - return component || addon(UIkit); - }); - } - -})(function(UI) { - - "use strict"; - - var Animations, playerId = 0; - - UI.component('slideshow', { - - defaults: { - animation : "fade", - duration : 500, - height : "auto", - start : 0, - autoplay : false, - autoplayInterval : 7000, - videoautoplay : true, - videomute : true, - slices : 15, - pauseOnHover : true, - kenburns : false, - kenburnsanimations : [ - 'uk-animation-middle-left', - 'uk-animation-top-right', - 'uk-animation-bottom-left', - 'uk-animation-top-center', - '', // middle-center - 'uk-animation-bottom-right' - ] - }, - - current : false, - interval : null, - hovering : false, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$('[data-uk-slideshow]', context).each(function() { - - var slideshow = UI.$(this); - - if (!slideshow.data("slideshow")) { - UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow"))); - } - }); - }); - }, - - init: function() { - - var $this = this, canvas, kbanimduration; - - this.container = this.element.hasClass('uk-slideshow') ? this.element : UI.$(this.find('.uk-slideshow:first')); - this.slides = this.container.children(); - this.slidesCount = this.slides.length; - this.current = this.options.start; - this.animating = false; - this.triggers = this.find('[data-uk-slideshow-item]'); - this.fixFullscreen = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) && this.container.hasClass('uk-slideshow-fullscreen'); // viewport unit fix for height:100vh - should be fixed in iOS 8 - - if (this.options.kenburns) { - - kbanimduration = this.options.kenburns === true ? '15s': this.options.kenburns; - - if (!String(kbanimduration).match(/(ms|s)$/)) { - kbanimduration += 'ms'; - } - - if (typeof(this.options.kenburnsanimations) == 'string') { - this.options.kenburnsanimations = this.options.kenburnsanimations.split(','); - } - } - - this.slides.each(function(index) { - - var slide = UI.$(this), - media = slide.children('img,video,iframe').eq(0); - - slide.data('media', media); - slide.data('sizer', media); - - if (media.length) { - - var placeholder; - - switch(media[0].nodeName) { - case 'IMG': - - var cover = UI.$('
          ').css({'background-image':'url('+ media.attr('src') + ')'}); - - if (media.attr('width') && media.attr('height')) { - placeholder = UI.$('').attr({width:media.attr('width'), height:media.attr('height')}); - media.replaceWith(placeholder); - media = placeholder; - placeholder = undefined; - } - - media.css({width: '100%',height: 'auto', opacity:0}); - slide.prepend(cover).data('cover', cover); - break; - - case 'IFRAME': - - var src = media[0].src, iframeId = 'sw-'+(++playerId); - - media - .attr('src', '').on('load', function(){ - - if (index !== $this.current || (index == $this.current && !$this.options.videoautoplay)) { - $this.pausemedia(media); - } - - if ($this.options.videomute) { - - $this.mutemedia(media); - - var inv = setInterval((function(ic) { - return function() { - $this.mutemedia(media); - if (++ic >= 4) clearInterval(inv); - } - })(0), 250); - } - - }) - .data('slideshow', $this) // add self-reference for the vimeo-ready listener - .attr('data-player-id', iframeId) // add frameId for the vimeo-ready listener - .attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1&player_id='+iframeId].join('')) - .addClass('uk-position-absolute'); - - // disable pointer events - if(!UI.support.touch) media.css('pointer-events', 'none'); - - placeholder = true; - - if (UI.cover) { - UI.cover(media); - media.attr('data-uk-cover', '{}'); - } - - break; - - case 'VIDEO': - media.addClass('uk-cover-object uk-position-absolute'); - placeholder = true; - - if ($this.options.videomute) $this.mutemedia(media); - } - - if (placeholder) { - - canvas = UI.$('').attr({'width': media[0].width, 'height': media[0].height}); - var img = UI.$('').attr('src', canvas[0].toDataURL()); - - slide.prepend(img); - slide.data('sizer', img); - } - - } else { - slide.data('sizer', slide); - } - - if ($this.hasKenBurns(slide)) { - - slide.data('cover').css({ - '-webkit-animation-duration': kbanimduration, - 'animation-duration': kbanimduration - }); - } - }); - - this.on("click.uk.slideshow", '[data-uk-slideshow-item]', function(e) { - - e.preventDefault(); - - var slide = UI.$(this).attr('data-uk-slideshow-item'); - - if ($this.current == slide) return; - - switch(slide) { - case 'next': - case 'previous': - $this[slide=='next' ? 'next':'previous'](); - break; - default: - $this.show(parseInt(slide, 10)); - } - - $this.stop(); - }); - - // Set start slide - this.slides.attr('aria-hidden', 'true').eq(this.current).addClass('uk-active').attr('aria-hidden', 'false'); - this.triggers.filter('[data-uk-slideshow-item="'+this.current+'"]').addClass('uk-active'); - - UI.$win.on("resize load", UI.Utils.debounce(function() { - $this.resize(); - - if ($this.fixFullscreen) { - $this.container.css('height', window.innerHeight); - $this.slides.css('height', window.innerHeight); - } - }, 100)); - - // chrome image load fix - setTimeout(function(){ - $this.resize(); - }, 80); - - // Set autoplay - if (this.options.autoplay) { - this.start(); - } - - if (this.options.videoautoplay && this.slides.eq(this.current).data('media')) { - this.playmedia(this.slides.eq(this.current).data('media')); - } - - if (this.options.kenburns) { - this.applyKenBurns(this.slides.eq(this.current)); - } - - this.container.on({ - mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; }, - mouseleave: function() { $this.hovering = false; } - }); - - this.on('swipeRight swipeLeft', function(e) { - $this[e.type=='swipeLeft' ? 'next' : 'previous'](); - }); - - this.on('display.uk.check', function(){ - if ($this.element.is(":visible")) { - - $this.resize(); - - if ($this.fixFullscreen) { - $this.container.css('height', window.innerHeight); - $this.slides.css('height', window.innerHeight); - } - } - }); - }, - - - resize: function() { - - if (this.container.hasClass('uk-slideshow-fullscreen')) return; - - var height = this.options.height; - - if (this.options.height === 'auto') { - - height = 0; - - this.slides.css('height', '').each(function() { - height = Math.max(height, UI.$(this).height()); - }); - } - - this.container.css('height', height); - this.slides.css('height', height); - }, - - show: function(index, direction) { - - if (this.animating || this.current == index) return; - - this.animating = true; - - var $this = this, - current = this.slides.eq(this.current), - next = this.slides.eq(index), - dir = direction ? direction : this.current < index ? 1 : -1, - currentmedia = current.data('media'), - animation = Animations[this.options.animation] ? this.options.animation : 'fade', - nextmedia = next.data('media'), - finalize = function() { - - if (!$this.animating) return; - - if (currentmedia && currentmedia.is('video,iframe')) { - $this.pausemedia(currentmedia); - } - - if (nextmedia && nextmedia.is('video,iframe')) { - $this.playmedia(nextmedia); - } - - next.addClass("uk-active").attr('aria-hidden', 'false'); - current.removeClass("uk-active").attr('aria-hidden', 'true'); - - $this.animating = false; - $this.current = index; - - UI.Utils.checkDisplay(next, '[class*="uk-animation-"]:not(.uk-cover-background.uk-position-cover)'); - - $this.trigger('show.uk.slideshow', [next, current, $this]); - }; - - $this.applyKenBurns(next); - - // animation fallback - if (!UI.support.animation) { - animation = 'none'; - } - - current = UI.$(current); - next = UI.$(next); - - $this.trigger('beforeshow.uk.slideshow', [next, current, $this]); - - Animations[animation].apply(this, [current, next, dir]).then(finalize); - - $this.triggers.removeClass('uk-active'); - $this.triggers.filter('[data-uk-slideshow-item="'+index+'"]').addClass('uk-active'); - }, - - applyKenBurns: function(slide) { - - if (!this.hasKenBurns(slide)) { - return; - } - - var animations = this.options.kenburnsanimations, - index = this.kbindex || 0; - - - slide.data('cover').attr('class', 'uk-cover-background uk-position-cover').width(); - slide.data('cover').addClass(['uk-animation-scale', 'uk-animation-reverse', animations[index].trim()].join(' ')); - - this.kbindex = animations[index + 1] ? (index+1):0; - }, - - hasKenBurns: function(slide) { - return (this.options.kenburns && slide.data('cover')); - }, - - next: function() { - this.show(this.slides[this.current + 1] ? (this.current + 1) : 0, 1); - }, - - previous: function() { - this.show(this.slides[this.current - 1] ? (this.current - 1) : (this.slides.length - 1), -1); - }, - - start: function() { - - this.stop(); - - var $this = this; - - this.interval = setInterval(function() { - if (!$this.hovering) $this.next(); - }, this.options.autoplayInterval); - - }, - - stop: function() { - if (this.interval) clearInterval(this.interval); - }, - - playmedia: function(media) { - - if (!(media && media[0])) return; - - switch(media[0].nodeName) { - case 'VIDEO': - - if (!this.options.videomute) { - media[0].muted = false; - } - - media[0].play(); - break; - case 'IFRAME': - - if (!this.options.videomute) { - media[0].contentWindow.postMessage('{ "event": "command", "func": "unmute", "method":"setVolume", "value":1}', '*'); - } - - media[0].contentWindow.postMessage('{ "event": "command", "func": "playVideo", "method":"play"}', '*'); - break; - } - }, - - pausemedia: function(media) { - - switch(media[0].nodeName) { - case 'VIDEO': - media[0].pause(); - break; - case 'IFRAME': - media[0].contentWindow.postMessage('{ "event": "command", "func": "pauseVideo", "method":"pause"}', '*'); - break; - } - }, - - mutemedia: function(media) { - - switch(media[0].nodeName) { - case 'VIDEO': - media[0].muted = true; - break; - case 'IFRAME': - media[0].contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*'); - break; - } - } - }); - - Animations = { - - 'none': function() { - - var d = UI.$.Deferred(); - d.resolve(); - return d.promise(); - }, - - 'scroll': function(current, next, dir) { - - var d = UI.$.Deferred(); - - current.css('animation-duration', this.options.duration+'ms'); - next.css('animation-duration', this.options.duration+'ms'); - - next.css('opacity', 1).one(UI.support.animation.end, function() { - - current.css('opacity', 0).removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out'); - next.removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in'); - d.resolve(); - - }.bind(this)); - - current.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out'); - next.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in'); - next.width(); // force redraw - - return d.promise(); - }, - - 'swipe': function(current, next, dir) { - - var d = UI.$.Deferred(); - - current.css('animation-duration', this.options.duration+'ms'); - next.css('animation-duration', this.options.duration+'ms'); - - next.css('opacity', 1).one(UI.support.animation.end, function() { - - current.css('opacity', 0).removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out'); - next.removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in'); - d.resolve(); - - }.bind(this)); - - current.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out'); - next.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in'); - next.width(); // force redraw - - return d.promise(); - }, - - 'scale': function(current, next, dir) { - - var d = UI.$.Deferred(); - - current.css('animation-duration', this.options.duration+'ms'); - next.css('animation-duration', this.options.duration+'ms'); - - next.css('opacity', 1); - - current.one(UI.support.animation.end, function() { - - current.css('opacity', 0).removeClass('uk-slideshow-scale-out'); - d.resolve(); - - }.bind(this)); - - current.addClass('uk-slideshow-scale-out'); - current.width(); // force redraw - - return d.promise(); - }, - - 'fade': function(current, next, dir) { - - var d = UI.$.Deferred(); - - current.css('animation-duration', this.options.duration+'ms'); - next.css('animation-duration', this.options.duration+'ms'); - - next.css('opacity', 1); - - // for plain text content slides - looks smoother - if (!(next.data('cover') || next.data('placeholder'))) { - - next.css('opacity', 1).one(UI.support.animation.end, function() { - next.removeClass('uk-slideshow-fade-in'); - }).addClass('uk-slideshow-fade-in'); - } - - current.one(UI.support.animation.end, function() { - - current.css('opacity', 0).removeClass('uk-slideshow-fade-out'); - d.resolve(); - - }.bind(this)); - - current.addClass('uk-slideshow-fade-out'); - current.width(); // force redraw - - return d.promise(); - } - }; - - UI.slideshow.animations = Animations; - - // Listen for messages from the vimeo player - window.addEventListener('message', function onMessageReceived(e) { - - var data = e.data, iframe; - - if (typeof(data) == 'string') { - - try { - data = JSON.parse(data); - } catch(err) { - data = {}; - } - } - - if (e.origin && e.origin.indexOf('vimeo') > -1 && data.event == 'ready' && data.player_id) { - iframe = UI.$('[data-player-id="'+ data.player_id+'"]'); - - if (iframe.length) { - iframe.data('slideshow').mutemedia(iframe); - } - } - }, false); - -}); diff --git a/js/components/slideshow.min.js b/js/components/slideshow.min.js deleted file mode 100755 index 0dc7037..0000000 --- a/js/components/slideshow.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(i){var t;window.UIkit&&(t=i(UIkit)),"function"==typeof define&&define.amd&&define("uikit-slideshow",["uikit"],function(){return t||i(UIkit)})}(function(i){"use strict";var t,s=0;i.component("slideshow",{defaults:{animation:"fade",duration:500,height:"auto",start:0,autoplay:!1,autoplayInterval:7e3,videoautoplay:!0,videomute:!0,slices:15,pauseOnHover:!0,kenburns:!1,kenburnsanimations:["uk-animation-middle-left","uk-animation-top-right","uk-animation-bottom-left","uk-animation-top-center","","uk-animation-bottom-right"]},current:!1,interval:null,hovering:!1,boot:function(){i.ready(function(t){i.$("[data-uk-slideshow]",t).each(function(){var t=i.$(this);t.data("slideshow")||i.slideshow(t,i.Utils.options(t.attr("data-uk-slideshow")))})})},init:function(){var t,e,a=this;this.container=this.element.hasClass("uk-slideshow")?this.element:i.$(this.find(".uk-slideshow:first")),this.slides=this.container.children(),this.slidesCount=this.slides.length,this.current=this.options.start,this.animating=!1,this.triggers=this.find("[data-uk-slideshow-item]"),this.fixFullscreen=navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&this.container.hasClass("uk-slideshow-fullscreen"),this.options.kenburns&&(e=this.options.kenburns===!0?"15s":this.options.kenburns,String(e).match(/(ms|s)$/)||(e+="ms"),"string"==typeof this.options.kenburnsanimations&&(this.options.kenburnsanimations=this.options.kenburnsanimations.split(","))),this.slides.each(function(n){var o=i.$(this),r=o.children("img,video,iframe").eq(0);if(o.data("media",r),o.data("sizer",r),r.length){var d;switch(r[0].nodeName){case"IMG":var u=i.$('
          ').css({"background-image":"url("+r.attr("src")+")"});r.attr("width")&&r.attr("height")&&(d=i.$("").attr({width:r.attr("width"),height:r.attr("height")}),r.replaceWith(d),r=d,d=void 0),r.css({width:"100%",height:"auto",opacity:0}),o.prepend(u).data("cover",u);break;case"IFRAME":var h=r[0].src,c="sw-"+ ++s;r.attr("src","").on("load",function(){if((n!==a.current||n==a.current&&!a.options.videoautoplay)&&a.pausemedia(r),a.options.videomute){a.mutemedia(r);var i=setInterval(function(t){return function(){a.mutemedia(r),++t>=4&&clearInterval(i)}}(0),250)}}).data("slideshow",a).attr("data-player-id",c).attr("src",[h,h.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1&player_id="+c].join("")).addClass("uk-position-absolute"),i.support.touch||r.css("pointer-events","none"),d=!0,i.cover&&(i.cover(r),r.attr("data-uk-cover","{}"));break;case"VIDEO":r.addClass("uk-cover-object uk-position-absolute"),d=!0,a.options.videomute&&a.mutemedia(r)}if(d){t=i.$("").attr({width:r[0].width,height:r[0].height});var l=i.$('').attr("src",t[0].toDataURL());o.prepend(l),o.data("sizer",l)}}else o.data("sizer",o);a.hasKenBurns(o)&&o.data("cover").css({"-webkit-animation-duration":e,"animation-duration":e})}),this.on("click.uk.slideshow","[data-uk-slideshow-item]",function(t){t.preventDefault();var s=i.$(this).attr("data-uk-slideshow-item");if(a.current!=s){switch(s){case"next":case"previous":a["next"==s?"next":"previous"]();break;default:a.show(parseInt(s,10))}a.stop()}}),this.slides.attr("aria-hidden","true").eq(this.current).addClass("uk-active").attr("aria-hidden","false"),this.triggers.filter('[data-uk-slideshow-item="'+this.current+'"]').addClass("uk-active"),i.$win.on("resize load",i.Utils.debounce(function(){a.resize(),a.fixFullscreen&&(a.container.css("height",window.innerHeight),a.slides.css("height",window.innerHeight))},100)),setTimeout(function(){a.resize()},80),this.options.autoplay&&this.start(),this.options.videoautoplay&&this.slides.eq(this.current).data("media")&&this.playmedia(this.slides.eq(this.current).data("media")),this.options.kenburns&&this.applyKenBurns(this.slides.eq(this.current)),this.container.on({mouseenter:function(){a.options.pauseOnHover&&(a.hovering=!0)},mouseleave:function(){a.hovering=!1}}),this.on("swipeRight swipeLeft",function(i){a["swipeLeft"==i.type?"next":"previous"]()}),this.on("display.uk.check",function(){a.element.is(":visible")&&(a.resize(),a.fixFullscreen&&(a.container.css("height",window.innerHeight),a.slides.css("height",window.innerHeight)))})},resize:function(){if(!this.container.hasClass("uk-slideshow-fullscreen")){var t=this.options.height;"auto"===this.options.height&&(t=0,this.slides.css("height","").each(function(){t=Math.max(t,i.$(this).height())})),this.container.css("height",t),this.slides.css("height",t)}},show:function(s,e){if(!this.animating&&this.current!=s){this.animating=!0;var a=this,n=this.slides.eq(this.current),o=this.slides.eq(s),r=e?e:this.current-1&&"ready"==e.event&&e.player_id&&(s=i.$('[data-player-id="'+e.player_id+'"]'),s.length&&s.data("slideshow").mutemedia(s))},!1)}); \ No newline at end of file diff --git a/js/components/sortable.js b/js/components/sortable.js deleted file mode 100755 index de378d9..0000000 --- a/js/components/sortable.js +++ /dev/null @@ -1,688 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -/* - * Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable - */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-sortable", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - var supportsTouch = ('ontouchstart' in window || 'MSGesture' in window) || (window.DocumentTouch && document instanceof DocumentTouch), - draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved, overElement, startEvent; - - var POINTER_DOWN = supportsTouch ? ('MSGesture' in window ? 'pointerdown':'touchstart') : 'mousedown', - POINTER_MOVE = supportsTouch ? ('MSGesture' in window ? 'pointermove':'touchmove') : 'mousemove', - POINTER_UP = supportsTouch ? ('MSGesture' in window ? 'pointerup':'touchend') : 'mouseup'; - - function closestSortable(ele) { - - ele = UI.$(ele); - - do { - if (ele.data('sortable')) { - return ele; - } - ele = UI.$(ele).parent(); - } while(ele.length); - - return ele; - } - - UI.component('sortable', { - - defaults: { - - animation : 150, - threshold : 10, - - childClass : 'uk-sortable-item', - placeholderClass : 'uk-sortable-placeholder', - overClass : 'uk-sortable-over', - draggingClass : 'uk-sortable-dragged', - dragMovingClass : 'uk-sortable-moving', - baseClass : 'uk-sortable', - noDragClass : 'uk-sortable-nodrag', - emptyClass : 'uk-sortable-empty', - dragCustomClass : '', - handleClass : false, - group : false, - - stop : function() {}, - start : function() {}, - change : function() {} - }, - - boot: function() { - - // auto init - UI.ready(function(context) { - - UI.$("[data-uk-sortable]", context).each(function(){ - - var ele = UI.$(this); - - if(!ele.data("sortable")) { - UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable"))); - } - }); - }); - - UI.$html.on(POINTER_MOVE, function(e) { - - if (delayIdle) { - - var src = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0] : e; - - if (Math.abs(src.pageX - delayIdle.pos.x) > delayIdle.threshold || Math.abs(src.pageY - delayIdle.pos.y) > delayIdle.threshold) { - delayIdle.apply(src); - } - } - - if (draggingPlaceholder) { - - if (!moving) { - moving = true; - draggingPlaceholder.show(); - - draggingPlaceholder.$current.addClass(draggingPlaceholder.$sortable.options.placeholderClass); - draggingPlaceholder.$sortable.element.children().addClass(draggingPlaceholder.$sortable.options.childClass); - - UI.$html.addClass(draggingPlaceholder.$sortable.options.dragMovingClass); - } - - var offset = draggingPlaceholder.data('mouse-offset'), - ev = e.originalEvent.touches && e.originalEvent.touches[0] || e.originalEvent, - left = parseInt(ev.pageX, 10) + offset.left, - top = parseInt(ev.pageY, 10) + offset.top; - - draggingPlaceholder.css({'left': left, 'top': top }); - - // adjust document scrolling - - if (top + (draggingPlaceholder.height()/3) > document.body.offsetHeight) { - return; - } - - if (top < UI.$win.scrollTop()) { - UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingPlaceholder.height()/3)); - } else if ( (top + (draggingPlaceholder.height()/3)) > (window.innerHeight + UI.$win.scrollTop()) ) { - UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingPlaceholder.height()/3)); - } - } - }); - - UI.$html.on(POINTER_UP, function(e) { - - delayIdle = clickedlink = false; - - // dragging? - if (!currentlyDraggingElement || !draggingPlaceholder) { - // completely reset dragging attempt. will cause weird delay behavior elsewise - currentlyDraggingElement = draggingPlaceholder = null; - return; - } - - // inside or outside of sortable? - var sortable = closestSortable(currentlyDraggingElement), - component = draggingPlaceholder.$sortable, - ev = { type: e.type }; - - if (sortable[0]) { - component.dragDrop(ev, component.element); - } - component.dragEnd(ev, component.element); - }); - }, - - init: function() { - - var $this = this, - element = this.element[0]; - - touchedlists = []; - - this.checkEmptyList(); - - this.element.data('sortable-group', this.options.group ? this.options.group : UI.Utils.uid('sortable-group')); - - var handleDragStart = delegate(function(e) { - - if (e.data && e.data.sortable) { - return; - } - - var $target = UI.$(e.target), - $link = $target.is('a[href]') ? $target:$target.parents('a[href]'); - - if ($target.is(':input')) { - return; - } - - if ($this.options.handleClass) { - var handle = $target.hasClass($this.options.handleClass) ? $target : $target.closest('.'+$this.options.handleClass, $this.element); - if (!handle.length) return; - } - - e.preventDefault(); - - if ($link.length) { - - $link.one('click', function(e){ - e.preventDefault(); - }).one(POINTER_UP, function(){ - - if (!moved) { - $link.trigger('click'); - if (supportsTouch && $link.attr('href').trim()) { - location.href = $link.attr('href'); - } - } - }); - } - - e.data = e.data || {}; - - e.data.sortable = element; - - return $this.dragStart(e, this); - }); - - var handleDragEnter = delegate(UI.Utils.debounce(function(e) { - return $this.dragEnter(e, this); - }), 40); - - var handleDragLeave = delegate(function(e) { - - // Prevent dragenter on a child from allowing a dragleave on the container - var previousCounter = $this.dragenterData(this); - $this.dragenterData(this, previousCounter - 1); - - // This is a fix for child elements firing dragenter before the parent fires dragleave - if (!$this.dragenterData(this)) { - UI.$(this).removeClass($this.options.overClass); - $this.dragenterData(this, false); - } - }); - - var handleTouchMove = delegate(function(e) { - - if (!currentlyDraggingElement || - currentlyDraggingElement === this || - currentlyDraggingTarget === this) { - return true; - } - - $this.element.children().removeClass($this.options.overClass); - currentlyDraggingTarget = this; - - $this.moveElementNextTo(currentlyDraggingElement, this); - - return prevent(e); - }); - - // Bind/unbind standard mouse/touch events as a polyfill. - function addDragHandlers() { - - if (supportsTouch && startEvent.touches && startEvent.touches.length) { - element.addEventListener(POINTER_MOVE, handleTouchMove, false); - } else { - element.addEventListener('mouseover', handleDragEnter, false); - element.addEventListener('mouseout', handleDragLeave, false); - } - - // document.addEventListener("selectstart", prevent, false); - } - - function removeDragHandlers() { - if (supportsTouch && startEvent.touches && startEvent.touches.length) { - element.removeEventListener(POINTER_MOVE, handleTouchMove, false); - } else { - element.removeEventListener('mouseover', handleDragEnter, false); - element.removeEventListener('mouseout', handleDragLeave, false); - } - - // document.removeEventListener("selectstart", prevent, false); - } - - this.addDragHandlers = addDragHandlers; - this.removeDragHandlers = removeDragHandlers; - - function handleDragMove(e) { - - if (!currentlyDraggingElement) { - return; - } - - $this.dragMove(e, $this); - } - - function delegate(fn) { - - return function(e) { - - var touch, target, context; - - startEvent = e; - - if (e) { - touch = e.touches && e.touches[0] || e; - target = touch.target || e.target; - - // Fix event.target for a touch event - if (supportsTouch && document.elementFromPoint) { - target = document.elementFromPoint(touch.pageX - document.body.scrollLeft, touch.pageY - document.body.scrollTop); - } - - overElement = UI.$(target); - } - - if (UI.$(target).hasClass('.'+$this.options.childClass)) { - fn.apply(target, [e]); - } else if (target !== element) { - - // If a child is initiating the event or ending it, then use the container as context for the callback. - context = moveUpToChildNode(element, target); - - if (context) { - fn.apply(context, [e]); - } - } - }; - } - - window.addEventListener(POINTER_MOVE, handleDragMove, false); - element.addEventListener(POINTER_DOWN, handleDragStart, false); - }, - - dragStart: function(e, elem) { - - moved = false; - moving = false; - dragging = false; - - var $this = this, - target = UI.$(e.target); - - if (!supportsTouch && e.button==2) { - return; - } - - if (target.is('.'+$this.options.noDragClass) || target.closest('.'+$this.options.noDragClass).length) { - return; - } - - // prevent dragging if taget is a form field - if (target.is(':input')) { - return; - } - - currentlyDraggingElement = elem; - - // init drag placeholder - if (draggingPlaceholder) { - draggingPlaceholder.remove(); - } - - var $current = UI.$(currentlyDraggingElement), offset = $current.offset(), ev = e.touches && e.touches[0] || e; - - delayIdle = { - - pos : { x:ev.pageX, y:ev.pageY }, - threshold : $this.options.handleClass ? 1 : $this.options.threshold, - apply : function(evt) { - - draggingPlaceholder = UI.$('
          ').css({ - display : 'none', - top : offset.top, - left : offset.left, - width : $current.width(), - height : $current.height(), - padding : $current.css('padding') - }).data({ - 'mouse-offset': { - 'left' : offset.left - parseInt(ev.pageX, 10), - 'top' : offset.top - parseInt(ev.pageY, 10) - }, - 'origin' : $this.element, - 'index' : $current.index() - }).append($current.html()).appendTo('body'); - - draggingPlaceholder.$current = $current; - draggingPlaceholder.$sortable = $this; - - $current.data({ - 'start-list': $current.parent(), - 'start-index': $current.index(), - 'sortable-group': $this.options.group - }); - - $this.addDragHandlers(); - - $this.options.start(this, currentlyDraggingElement); - $this.trigger('start.uk.sortable', [$this, currentlyDraggingElement, draggingPlaceholder]); - - moved = true; - delayIdle = false; - } - }; - }, - - dragMove: function(e, elem) { - - overElement = UI.$(document.elementFromPoint(e.pageX - (document.body.scrollLeft || document.scrollLeft || 0), e.pageY - (document.body.scrollTop || document.documentElement.scrollTop || 0))); - - var overRoot = overElement.closest('.'+this.options.baseClass), - groupOver = overRoot.data("sortable-group"), - $current = UI.$(currentlyDraggingElement), - currentRoot = $current.parent(), - groupCurrent = $current.data("sortable-group"), - overChild; - - if (overRoot[0] !== currentRoot[0] && groupCurrent !== undefined && groupOver === groupCurrent) { - - overRoot.data('sortable').addDragHandlers(); - - touchedlists.push(overRoot); - overRoot.children().addClass(this.options.childClass); - - // swap root - if (overRoot.children().length > 0) { - overChild = overElement.closest('.'+this.options.childClass); - - if (overChild.length) { - overChild.before($current); - } else { - overRoot.append($current); - } - - } else { // empty list - overElement.append($current); - } - - UIkit.$doc.trigger('mouseover'); - } - - this.checkEmptyList(); - this.checkEmptyList(currentRoot); - }, - - dragEnter: function(e, elem) { - - if (!currentlyDraggingElement || currentlyDraggingElement === elem) { - return true; - } - - var previousCounter = this.dragenterData(elem); - - this.dragenterData(elem, previousCounter + 1); - - // Prevent dragenter on a child from allowing a dragleave on the container - if (previousCounter === 0) { - - var currentlist = UI.$(elem).parent(), - startlist = UI.$(currentlyDraggingElement).data("start-list"); - - if (currentlist[0] !== startlist[0]) { - - var groupOver = currentlist.data('sortable-group'), - groupCurrent = UI.$(currentlyDraggingElement).data("sortable-group"); - - if ((groupOver || groupCurrent) && (groupOver != groupCurrent)) { - return false; - } - } - - UI.$(elem).addClass(this.options.overClass); - this.moveElementNextTo(currentlyDraggingElement, elem); - } - - return false; - }, - - dragEnd: function(e, elem) { - - var $this = this; - - // avoid triggering event twice - if (currentlyDraggingElement) { - // TODO: trigger on right element? - this.options.stop(elem); - this.trigger('stop.uk.sortable', [this]); - } - - currentlyDraggingElement = null; - currentlyDraggingTarget = null; - - touchedlists.push(this.element); - touchedlists.forEach(function(el, i) { - UI.$(el).children().each(function() { - if (this.nodeType === 1) { - UI.$(this).removeClass($this.options.overClass) - .removeClass($this.options.placeholderClass) - .removeClass($this.options.childClass); - $this.dragenterData(this, false); - } - }); - }); - - touchedlists = []; - - UI.$html.removeClass(this.options.dragMovingClass); - - this.removeDragHandlers(); - - if (draggingPlaceholder) { - draggingPlaceholder.remove(); - draggingPlaceholder = null; - } - }, - - dragDrop: function(e, elem) { - - if (e.type === 'drop') { - - if (e.stopPropagation) { - e.stopPropagation(); - } - - if (e.preventDefault) { - e.preventDefault(); - } - } - - this.triggerChangeEvents(); - }, - - triggerChangeEvents: function() { - - // trigger events once - if (!currentlyDraggingElement) return; - - var $current = UI.$(currentlyDraggingElement), - oldRoot = draggingPlaceholder.data("origin"), - newRoot = $current.closest('.'+this.options.baseClass), - triggers = [], - el = UI.$(currentlyDraggingElement); - - // events depending on move inside lists or across lists - if (oldRoot[0] === newRoot[0] && draggingPlaceholder.data('index') != $current.index() ) { - triggers.push({sortable: this, mode: 'moved'}); - } else if (oldRoot[0] != newRoot[0]) { - triggers.push({sortable: UI.$(newRoot).data('sortable'), mode: 'added'}, {sortable: UI.$(oldRoot).data('sortable'), mode: 'removed'}); - } - - triggers.forEach(function (trigger, i) { - if (trigger.sortable) { - trigger.sortable.element.trigger('change.uk.sortable', [trigger.sortable, el, trigger.mode]); - } - }); - }, - - dragenterData: function(element, val) { - - element = UI.$(element); - - if (arguments.length == 1) { - return parseInt(element.data('child-dragenter'), 10) || 0; - } else if (!val) { - element.removeData('child-dragenter'); - } else { - element.data('child-dragenter', Math.max(0, val)); - } - }, - - moveElementNextTo: function(element, elementToMoveNextTo) { - - dragging = true; - - var $this = this, - list = UI.$(element).parent().css('min-height', ''), - next = isBelow(element, elementToMoveNextTo) ? elementToMoveNextTo : elementToMoveNextTo.nextSibling, - children = list.children(), - count = children.length; - - if (!$this.options.animation) { - elementToMoveNextTo.parentNode.insertBefore(element, next); - UI.Utils.checkDisplay($this.element.parent()); - return; - } - - list.css('min-height', list.height()); - - children.stop().each(function(){ - var ele = UI.$(this), - offset = ele.position(); - - offset.width = ele.width(); - - ele.data('offset-before', offset); - }); - - elementToMoveNextTo.parentNode.insertBefore(element, next); - - UI.Utils.checkDisplay($this.element.parent()); - - children = list.children().each(function() { - var ele = UI.$(this); - ele.data('offset-after', ele.position()); - }).each(function() { - var ele = UI.$(this), - before = ele.data('offset-before'); - ele.css({'position':'absolute', 'top':before.top, 'left':before.left, 'min-width':before.width }); - }); - - children.each(function(){ - - var ele = UI.$(this), - before = ele.data('offset-before'), - offset = ele.data('offset-after'); - - ele.css('pointer-events', 'none').width(); - - setTimeout(function(){ - ele.animate({'top':offset.top, 'left':offset.left}, $this.options.animation, function() { - ele.css({'position':'','top':'', 'left':'', 'min-width': '', 'pointer-events':''}).removeClass($this.options.overClass).removeData('child-dragenter'); - count--; - if (!count) { - list.css('min-height', ''); - UI.Utils.checkDisplay($this.element.parent()); - } - }); - }, 0); - }); - }, - - serialize: function() { - - var data = [], item, attribute; - - this.element.children().each(function(j, child) { - item = {}; - for (var i = 0, attr, val; i < child.attributes.length; i++) { - attribute = child.attributes[i]; - if (attribute.name.indexOf('data-') === 0) { - attr = attribute.name.substr(5); - val = UI.Utils.str2json(attribute.value); - item[attr] = (val || attribute.value=='false' || attribute.value=='0') ? val:attribute.value; - } - } - data.push(item); - }); - - return data; - }, - - checkEmptyList: function(list) { - - list = list ? UI.$(list) : this.element; - - if (this.options.emptyClass) { - list[!list.children().length ? 'addClass':'removeClass'](this.options.emptyClass); - } - } - }); - - // helpers - - function isBelow(el1, el2) { - - var parent = el1.parentNode; - - if (el2.parentNode != parent) { - return false; - } - - var cur = el1.previousSibling; - - while (cur && cur.nodeType !== 9) { - if (cur === el2) { - return true; - } - cur = cur.previousSibling; - } - - return false; - } - - function moveUpToChildNode(parent, child) { - var cur = child; - if (cur == parent) { return null; } - - while (cur) { - if (cur.parentNode === parent) { - return cur; - } - - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur.nodeType === 11 ) { - break; - } - } - return null; - } - - function prevent(e) { - if (e.stopPropagation) { - e.stopPropagation(); - } - if (e.preventDefault) { - e.preventDefault(); - } - e.returnValue = false; - } - - return UI.sortable; -}); diff --git a/js/components/sortable.min.js b/js/components/sortable.min.js deleted file mode 100755 index 3807ff1..0000000 --- a/js/components/sortable.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sortable",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(e){e=t.$(e);do{if(e.data("sortable"))return e;e=t.$(e).parent()}while(e.length);return e}function o(t,e){var o=t.parentNode;if(e.parentNode!=o)return!1;for(var n=t.previousSibling;n&&9!==n.nodeType;){if(n===e)return!0;n=n.previousSibling}return!1}function n(t,e){var o=e;if(o==t)return null;for(;o;){if(o.parentNode===t)return o;if(o=o.parentNode,!o||!o.ownerDocument||11===o.nodeType)break}return null}function s(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}var a,r,i,l,d,h,u,p,c,g,f,m="ontouchstart"in window||"MSGesture"in window||window.DocumentTouch&&document instanceof DocumentTouch,v=m?"MSGesture"in window?"pointerdown":"touchstart":"mousedown",b=m?"MSGesture"in window?"pointermove":"touchmove":"mousemove",C=m?"MSGesture"in window?"pointerup":"touchend":"mouseup";return t.component("sortable",{defaults:{animation:150,threshold:10,childClass:"uk-sortable-item",placeholderClass:"uk-sortable-placeholder",overClass:"uk-sortable-over",draggingClass:"uk-sortable-dragged",dragMovingClass:"uk-sortable-moving",baseClass:"uk-sortable",noDragClass:"uk-sortable-nodrag",emptyClass:"uk-sortable-empty",dragCustomClass:"",handleClass:!1,group:!1,stop:function(){},start:function(){},change:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-sortable]",e).each(function(){var e=t.$(this);e.data("sortable")||t.sortable(e,t.Utils.options(e.attr("data-uk-sortable")))})}),t.$html.on(b,function(e){if(u){var o=e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e;(Math.abs(o.pageX-u.pos.x)>u.threshold||Math.abs(o.pageY-u.pos.y)>u.threshold)&&u.apply(o)}if(a){d||(d=!0,a.show(),a.$current.addClass(a.$sortable.options.placeholderClass),a.$sortable.element.children().addClass(a.$sortable.options.childClass),t.$html.addClass(a.$sortable.options.dragMovingClass));var n=a.data("mouse-offset"),s=e.originalEvent.touches&&e.originalEvent.touches[0]||e.originalEvent,r=parseInt(s.pageX,10)+n.left,i=parseInt(s.pageY,10)+n.top;if(a.css({left:r,top:i}),i+a.height()/3>document.body.offsetHeight)return;iwindow.innerHeight+t.$win.scrollTop()&&t.$win.scrollTop(t.$win.scrollTop()+Math.ceil(a.height()/3))}}),t.$html.on(C,function(t){if(u=h=!1,!r||!a)return r=a=null,void 0;var o=e(r),n=a.$sortable,s={type:t.type};o[0]&&n.dragDrop(s,n.element),n.dragEnd(s,n.element)})},init:function(){function e(){m&&f.touches&&f.touches.length?h.addEventListener(b,y,!1):(h.addEventListener("mouseover",$,!1),h.addEventListener("mouseout",w,!1))}function o(){m&&f.touches&&f.touches.length?h.removeEventListener(b,y,!1):(h.removeEventListener("mouseover",$,!1),h.removeEventListener("mouseout",w,!1))}function a(t){r&&d.dragMove(t,d)}function l(e){return function(o){var s,a,r;f=o,o&&(s=o.touches&&o.touches[0]||o,a=s.target||o.target,m&&document.elementFromPoint&&(a=document.elementFromPoint(s.pageX-document.body.scrollLeft,s.pageY-document.body.scrollTop)),g=t.$(a)),t.$(a).hasClass("."+d.options.childClass)?e.apply(a,[o]):a!==h&&(r=n(h,a),r&&e.apply(r,[o]))}}var d=this,h=this.element[0];p=[],this.checkEmptyList(),this.element.data("sortable-group",this.options.group?this.options.group:t.Utils.uid("sortable-group"));var u=l(function(e){if(!e.data||!e.data.sortable){var o=t.$(e.target),n=o.is("a[href]")?o:o.parents("a[href]");if(!o.is(":input")){if(d.options.handleClass){var s=o.hasClass(d.options.handleClass)?o:o.closest("."+d.options.handleClass,d.element);if(!s.length)return}return e.preventDefault(),n.length&&n.one("click",function(t){t.preventDefault()}).one(C,function(){c||(n.trigger("click"),m&&n.attr("href").trim()&&(location.href=n.attr("href")))}),e.data=e.data||{},e.data.sortable=h,d.dragStart(e,this)}}}),$=l(t.Utils.debounce(function(t){return d.dragEnter(t,this)}),40),w=l(function(){var e=d.dragenterData(this);d.dragenterData(this,e-1),d.dragenterData(this)||(t.$(this).removeClass(d.options.overClass),d.dragenterData(this,!1))}),y=l(function(t){return r&&r!==this&&i!==this?(d.element.children().removeClass(d.options.overClass),i=this,d.moveElementNextTo(r,this),s(t)):!0});this.addDragHandlers=e,this.removeDragHandlers=o,window.addEventListener(b,a,!1),h.addEventListener(v,u,!1)},dragStart:function(e,o){c=!1,d=!1,l=!1;var n=this,s=t.$(e.target);if(!(!m&&2==e.button||s.is("."+n.options.noDragClass)||s.closest("."+n.options.noDragClass).length||s.is(":input"))){r=o,a&&a.remove();var i=t.$(r),h=i.offset(),p=e.touches&&e.touches[0]||e;u={pos:{x:p.pageX,y:p.pageY},threshold:n.options.handleClass?1:n.options.threshold,apply:function(){a=t.$('
          ').css({display:"none",top:h.top,left:h.left,width:i.width(),height:i.height(),padding:i.css("padding")}).data({"mouse-offset":{left:h.left-parseInt(p.pageX,10),top:h.top-parseInt(p.pageY,10)},origin:n.element,index:i.index()}).append(i.html()).appendTo("body"),a.$current=i,a.$sortable=n,i.data({"start-list":i.parent(),"start-index":i.index(),"sortable-group":n.options.group}),n.addDragHandlers(),n.options.start(this,r),n.trigger("start.uk.sortable",[n,r,a]),c=!0,u=!1}}}},dragMove:function(e){g=t.$(document.elementFromPoint(e.pageX-(document.body.scrollLeft||document.scrollLeft||0),e.pageY-(document.body.scrollTop||document.documentElement.scrollTop||0)));var o,n=g.closest("."+this.options.baseClass),s=n.data("sortable-group"),a=t.$(r),i=a.parent(),l=a.data("sortable-group");n[0]!==i[0]&&void 0!==l&&s===l&&(n.data("sortable").addDragHandlers(),p.push(n),n.children().addClass(this.options.childClass),n.children().length>0?(o=g.closest("."+this.options.childClass),o.length?o.before(a):n.append(a)):g.append(a),UIkit.$doc.trigger("mouseover")),this.checkEmptyList(),this.checkEmptyList(i)},dragEnter:function(e,o){if(!r||r===o)return!0;var n=this.dragenterData(o);if(this.dragenterData(o,n+1),0===n){var s=t.$(o).parent(),a=t.$(r).data("start-list");if(s[0]!==a[0]){var i=s.data("sortable-group"),l=t.$(r).data("sortable-group");if((i||l)&&i!=l)return!1}t.$(o).addClass(this.options.overClass),this.moveElementNextTo(r,o)}return!1},dragEnd:function(e,o){var n=this;r&&(this.options.stop(o),this.trigger("stop.uk.sortable",[this])),r=null,i=null,p.push(this.element),p.forEach(function(e){t.$(e).children().each(function(){1===this.nodeType&&(t.$(this).removeClass(n.options.overClass).removeClass(n.options.placeholderClass).removeClass(n.options.childClass),n.dragenterData(this,!1))})}),p=[],t.$html.removeClass(this.options.dragMovingClass),this.removeDragHandlers(),a&&(a.remove(),a=null)},dragDrop:function(t){"drop"===t.type&&(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()),this.triggerChangeEvents()},triggerChangeEvents:function(){if(r){var e=t.$(r),o=a.data("origin"),n=e.closest("."+this.options.baseClass),s=[],i=t.$(r);o[0]===n[0]&&a.data("index")!=e.index()?s.push({sortable:this,mode:"moved"}):o[0]!=n[0]&&s.push({sortable:t.$(n).data("sortable"),mode:"added"},{sortable:t.$(o).data("sortable"),mode:"removed"}),s.forEach(function(t){t.sortable&&t.sortable.element.trigger("change.uk.sortable",[t.sortable,i,t.mode])})}},dragenterData:function(e,o){return e=t.$(e),1==arguments.length?parseInt(e.data("child-dragenter"),10)||0:(o?e.data("child-dragenter",Math.max(0,o)):e.removeData("child-dragenter"),void 0)},moveElementNextTo:function(e,n){l=!0;var s=this,a=t.$(e).parent().css("min-height",""),r=o(e,n)?n:n.nextSibling,i=a.children(),d=i.length;return s.options.animation?(a.css("min-height",a.height()),i.stop().each(function(){var e=t.$(this),o=e.position();o.width=e.width(),e.data("offset-before",o)}),n.parentNode.insertBefore(e,r),t.Utils.checkDisplay(s.element.parent()),i=a.children().each(function(){var e=t.$(this);e.data("offset-after",e.position())}).each(function(){var e=t.$(this),o=e.data("offset-before");e.css({position:"absolute",top:o.top,left:o.left,"min-width":o.width})}),i.each(function(){var e=t.$(this),o=(e.data("offset-before"),e.data("offset-after"));e.css("pointer-events","none").width(),setTimeout(function(){e.animate({top:o.top,left:o.left},s.options.animation,function(){e.css({position:"",top:"",left:"","min-width":"","pointer-events":""}).removeClass(s.options.overClass).removeData("child-dragenter"),d--,d||(a.css("min-height",""),t.Utils.checkDisplay(s.element.parent()))})},0)}),void 0):(n.parentNode.insertBefore(e,r),t.Utils.checkDisplay(s.element.parent()),void 0)},serialize:function(){var e,o,n=[];return this.element.children().each(function(s,a){e={};for(var r,i,l=0;l').parent(); - this.computeWrapper(); - this.wrapper.css({ - 'margin-top' : this.element.css('margin-top'), - 'margin-bottom' : this.element.css('margin-bottom'), - 'margin-left' : this.element.css('margin-left'), - 'margin-right' : this.element.css('margin-right') - }) - this.element.css('margin', 0); - - if (boundary) { - - if (boundary === true || boundary[0] === '!') { - - boundary = boundary === true ? this.wrapper.parent() : this.wrapper.closest(boundary.substr(1)); - boundtoparent = true; - - } else if (typeof boundary === "string") { - boundary = UI.$(boundary); - } - } - - this.sticky = { - self : this, - options : this.options, - element : this.element, - currentTop : null, - wrapper : this.wrapper, - init : false, - getWidthFrom : UI.$(this.options.getWidthFrom || this.wrapper), - boundary : boundary, - boundtoparent : boundtoparent, - top : 0, - calcTop : function() { - - var top = this.options.top; - - // dynamic top parameter - if (this.options.top && typeof(this.options.top) == 'string') { - - // e.g. 50vh - if (this.options.top.match(/^(-|)(\d+)vh$/)) { - top = window.innerHeight * parseInt(this.options.top, 10)/100; - // e.g. #elementId, or .class-1,class-2,.class-3 (first found is used) - } else { - - var topElement = UI.$(this.options.top).first(); - - if (topElement.length && topElement.is(':visible')) { - top = -1 * ((topElement.offset().top + topElement.outerHeight()) - this.wrapper.offset().top); - } - } - - } - - this.top = top; - }, - - reset: function(force) { - - this.calcTop(); - - var finalize = function() { - this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"}); - this.element.removeClass([this.options.animation, 'uk-animation-reverse', this.options.clsactive].join(' ')); - this.element.addClass(this.options.clsinactive); - this.element.trigger('inactive.uk.sticky'); - - this.currentTop = null; - this.animate = false; - - }.bind(this); - - - if (!force && this.options.animation && UI.support.animation && !UI.Utils.isInView(this.wrapper)) { - - this.animate = true; - - this.element.removeClass(this.options.animation).one(UI.support.animation.end, function(){ - finalize(); - }).width(); // force redraw - - this.element.addClass(this.options.animation+' '+'uk-animation-reverse'); - } else { - finalize(); - } - }, - - check: function() { - - if (this.options.disabled) { - return false; - } - - if (this.options.media) { - - switch(typeof(this.options.media)) { - case 'number': - if (window.innerWidth < this.options.media) { - return false; - } - break; - case 'string': - if (window.matchMedia && !window.matchMedia(this.options.media).matches) { - return false; - } - break; - } - } - - var scrollTop = $win.scrollTop(), - documentHeight = $doc.height(), - dwh = documentHeight - window.innerHeight, - extra = (scrollTop > dwh) ? dwh - scrollTop : 0, - elementTop = this.wrapper.offset().top, - etse = elementTop - this.top - extra, - active = (scrollTop >= etse); - - if (active && this.options.showup) { - - // set inactiv if scrolling down - if (direction == 1) { - active = false; - } - - // set inactive when wrapper is still in view - if (direction == -1 && !this.element.hasClass(this.options.clsactive) && UI.Utils.isInView(this.wrapper)) { - active = false; - } - } - - return active; - } - }; - - this.sticky.calcTop(); - - sticked.push(this.sticky); - }, - - update: function() { - checkscrollposition(this.sticky); - }, - - enable: function() { - this.options.disabled = false; - this.update(); - }, - - disable: function(force) { - this.options.disabled = true; - this.sticky.reset(force); - }, - - computeWrapper: function() { - - this.wrapper.css({ - 'height' : ['absolute','fixed'].indexOf(this.element.css('position')) == -1 ? this.element.outerHeight() : '', - 'float' : this.element.css('float') != 'none' ? this.element.css('float') : '' - }); - - if (this.element.css('position') == 'fixed') { - this.element.css({ - width: this.sticky.getWidthFrom.length ? this.sticky.getWidthFrom.width() : this.element.width() - }); - } - } - }); - - function checkscrollposition(direction) { - - var stickies = arguments.length ? arguments : sticked; - - if (!stickies.length || $win.scrollTop() < 0) return; - - var scrollTop = $win.scrollTop(), - documentHeight = $doc.height(), - windowHeight = $win.height(), - dwh = documentHeight - windowHeight, - extra = (scrollTop > dwh) ? dwh - scrollTop : 0, - newTop, containerBottom, stickyHeight, sticky; - - for (var i = 0; i < stickies.length; i++) { - - sticky = stickies[i]; - - if (!sticky.element.is(":visible") || sticky.animate) { - continue; - } - - if (!sticky.check()) { - - if (sticky.currentTop !== null) { - sticky.reset(); - } - - } else { - - if (sticky.top < 0) { - newTop = 0; - } else { - stickyHeight = sticky.element.outerHeight(); - newTop = documentHeight - stickyHeight - sticky.top - sticky.options.bottom - scrollTop - extra; - newTop = newTop < 0 ? newTop + sticky.top : sticky.top; - } - - if (sticky.boundary && sticky.boundary.length) { - - var bTop = sticky.boundary.offset().top; - - if (sticky.boundtoparent) { - containerBottom = documentHeight - (bTop + sticky.boundary.outerHeight()) + parseInt(sticky.boundary.css('padding-bottom')); - } else { - containerBottom = documentHeight - bTop; - } - - newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.top < 0 ? 0 : sticky.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop; - } - - - if (sticky.currentTop != newTop) { - - sticky.element.css({ - position : "fixed", - top : newTop, - width : sticky.getWidthFrom.length ? sticky.getWidthFrom.width() : sticky.element.width() - }); - - if (!sticky.init) { - - sticky.element.addClass(sticky.options.clsinit); - - if (location.hash && scrollTop > 0 && sticky.options.target) { - - var $target = UI.$(location.hash); - - if ($target.length) { - - setTimeout((function($target, sticky){ - - return function() { - - sticky.element.width(); // force redraw - - var offset = $target.offset(), - maxoffset = offset.top + $target.outerHeight(), - stickyOffset = sticky.element.offset(), - stickyHeight = sticky.element.outerHeight(), - stickyMaxOffset = stickyOffset.top + stickyHeight; - - if (stickyOffset.top < maxoffset && offset.top < stickyMaxOffset) { - scrollTop = offset.top - stickyHeight - sticky.options.target; - window.scrollTo(0, scrollTop); - } - }; - - })($target, sticky), 0); - } - } - } - - sticky.element.addClass(sticky.options.clsactive).removeClass(sticky.options.clsinactive); - sticky.element.trigger('active.uk.sticky'); - sticky.element.css('margin', ''); - - if (sticky.options.animation && sticky.init && !UI.Utils.isInView(sticky.wrapper)) { - sticky.element.addClass(sticky.options.animation); - } - - sticky.currentTop = newTop; - } - } - - sticky.init = true; - } - } - - return UI.sticky; -}); diff --git a/js/components/sticky.min.js b/js/components/sticky.min.js deleted file mode 100755 index 0fa4ead..0000000 --- a/js/components/sticky.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,h,p=e.scrollTop(),c=s.height(),l=e.height(),m=c-l,d=p>m?m-p:0,u=0;uo?o+h.top:h.top),h.boundary&&h.boundary.length){var f=h.boundary.offset().top;a=h.boundtoparent?c-(f+h.boundary.outerHeight())+parseInt(h.boundary.css("padding-bottom")):c-f,o=p+r>c-a-(h.top<0?0:h.top)?c-a-(p+r):o}if(h.currentTop!=o){if(h.element.css({position:"fixed",top:o,width:h.getWidthFrom.length?h.getWidthFrom.width():h.element.width()}),!h.init&&(h.element.addClass(h.options.clsinit),location.hash&&p>0&&h.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top').parent(),this.computeWrapper(),this.wrapper.css({"margin-top":this.element.css("margin-top"),"margin-bottom":this.element.css("margin-bottom"),"margin-left":this.element.css("margin-left"),"margin-right":this.element.css("margin-right")}),this.element.css("margin",0),a&&(a===!0||"!"===a[0]?(a=a===!0?this.wrapper.parent():this.wrapper.closest(a.substr(1)),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:a,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidtha?a-i:0,h=this.wrapper.offset().top,p=h-this.top-r,c=i>=p;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):""}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky}); \ No newline at end of file diff --git a/js/components/timepicker.js b/js/components/timepicker.js deleted file mode 100755 index 1b7a808..0000000 --- a/js/components/timepicker.js +++ /dev/null @@ -1,192 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-timepicker", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - - UI.component('timepicker', { - - defaults: { - format : '24h', - delay : 0, - start : 0, - end : 24 - }, - - boot: function() { - - // init code - UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("timepicker")) { - var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker"))); - - setTimeout(function(){ - obj.autocomplete.input.focus(); - }, 40); - } - }); - }, - - init: function() { - - var $this = this, times = getTimeRange(this.options.start, this.options.end), container; - - this.options.minLength = 0; - this.options.template = ''; - - this.options.source = function(release) { - release(times[$this.options.format] || times['12h']); - }; - - if (this.element.is('input')) { - this.element.wrap('
          '); - container = this.element.parent(); - } else { - container = this.element.addClass('uk-autocomplete'); - } - - this.autocomplete = UI.autocomplete(container, this.options); - this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable'); - - this.autocomplete.on('show.uk.autocomplete', function() { - - var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]'); - - setTimeout(function(){ - $this.autocomplete.pick(selected, true); - }, 10); - }); - - this.autocomplete.input.on('focus', function(){ - - $this.autocomplete.value = Math.random(); - $this.autocomplete.triggercomplete(); - - }).on('blur', UI.Utils.debounce(function() { - $this.checkTime(); - }, 100)); - - this.element.data("timepicker", this); - }, - - checkTime: function() { - - var arr, timeArray, meridian = 'AM', hour, minute, time = this.autocomplete.input.val(); - - if (this.options.format == '12h') { - arr = time.split(' '); - timeArray = arr[0].split(':'); - meridian = arr[1]; - } else { - timeArray = time.split(':'); - } - - hour = parseInt(timeArray[0], 10); - minute = parseInt(timeArray[1], 10); - - if (isNaN(hour)) hour = 0; - if (isNaN(minute)) minute = 0; - - if (this.options.format == '12h') { - if (hour > 12) { - hour = 12; - } else if (hour < 0) { - hour = 12; - } - - if (meridian === 'am' || meridian === 'a') { - meridian = 'AM'; - } else if (meridian === 'pm' || meridian === 'p') { - meridian = 'PM'; - } - - if (meridian !== 'AM' && meridian !== 'PM') { - meridian = 'AM'; - } - - } else { - - if (hour >= 24) { - hour = 23; - } else if (hour < 0) { - hour = 0; - } - } - - if (minute < 0) { - minute = 0; - } else if (minute >= 60) { - minute = 0; - } - - this.autocomplete.input.val(this.formatTime(hour, minute, meridian)).trigger('change'); - }, - - formatTime: function(hour, minute, meridian) { - hour = hour < 10 ? '0' + hour : hour; - minute = minute < 10 ? '0' + minute : minute; - return hour + ':' + minute + (this.options.format == '12h' ? ' ' + meridian : ''); - } - }); - - // helper - - function getTimeRange(start, end) { - - start = start || 0; - end = end || 24; - - var times = {'12h':[], '24h':[]}, i, h; - - for (i = start, h=''; i 0 && i<13 && i!==12) { - times['12h'].push({value: (h+':00 AM')}); - times['12h'].push({value: (h+':30 AM')}); - } - - if (i >= 12) { - - h = h-12; - if (h === 0) h = 12; - if (h < 10) h = '0'+String(h); - - times['12h'].push({value: (h+':00 PM')}); - times['12h'].push({value: (h+':30 PM')}); - } - } - - return times; - } - -}); diff --git a/js/components/timepicker.min.js b/js/components/timepicker.min.js deleted file mode 100755 index df160db..0000000 --- a/js/components/timepicker.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-timepicker",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(t,e){t=t||0,e=e||24;var i,o,a={"12h":[],"24h":[]};for(i=t,o="";e>i;i++)o=""+i,10>i&&(o="0"+o),a["24h"].push({value:o+":00"}),a["24h"].push({value:o+":30"}),0===i&&(o=12,a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>0&&13>i&&12!==i&&(a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>=12&&(o-=12,0===o&&(o=12),10>o&&(o="0"+String(o)),a["12h"].push({value:o+":00 PM"}),a["12h"].push({value:o+":30 PM"}));return a}t.component("timepicker",{defaults:{format:"24h",delay:0,start:0,end:24},boot:function(){t.$html.on("focus.timepicker.uikit","[data-uk-timepicker]",function(){var e=t.$(this);if(!e.data("timepicker")){var i=t.timepicker(e,t.Utils.options(e.attr("data-uk-timepicker")));setTimeout(function(){i.autocomplete.input.focus()},40)}})},init:function(){var i,o=this,a=e(this.options.start,this.options.end);this.options.minLength=0,this.options.template='',this.options.source=function(t){t(a[o.options.format]||a["12h"])},this.element.is("input")?(this.element.wrap('
          '),i=this.element.parent()):i=this.element.addClass("uk-autocomplete"),this.autocomplete=t.autocomplete(i,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-small uk-dropdown-scrollable"),this.autocomplete.on("show.uk.autocomplete",function(){var t=o.autocomplete.dropdown.find('[data-value="'+o.autocomplete.input.val()+'"]');setTimeout(function(){o.autocomplete.pick(t,!0)},10)}),this.autocomplete.input.on("focus",function(){o.autocomplete.value=Math.random(),o.autocomplete.triggercomplete()}).on("blur",t.Utils.debounce(function(){o.checkTime()},100)),this.element.data("timepicker",this)},checkTime:function(){var t,e,i,o,a="AM",u=this.autocomplete.input.val();"12h"==this.options.format?(t=u.split(" "),e=t[0].split(":"),a=t[1]):e=u.split(":"),i=parseInt(e[0],10),o=parseInt(e[1],10),isNaN(i)&&(i=0),isNaN(o)&&(o=0),"12h"==this.options.format?(i>12?i=12:0>i&&(i=12),"am"===a||"a"===a?a="AM":("pm"===a||"p"===a)&&(a="PM"),"AM"!==a&&"PM"!==a&&(a="AM")):i>=24?i=23:0>i&&(i=0),0>o?o=0:o>=60&&(o=0),this.autocomplete.input.val(this.formatTime(i,o,a)).trigger("change")},formatTime:function(t,e,i){return t=10>t?"0"+t:t,e=10>e?"0"+e:e,t+":"+e+("12h"==this.options.format?" "+i:"")}})}); \ No newline at end of file diff --git a/js/components/tooltip.js b/js/components/tooltip.js deleted file mode 100755 index a38d49d..0000000 --- a/js/components/tooltip.js +++ /dev/null @@ -1,234 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-tooltip", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - var $tooltip, // tooltip container - tooltipdelay, checkdelay; - - UI.component('tooltip', { - - defaults: { - "offset": 5, - "pos": "top", - "animation": false, - "delay": 0, // in miliseconds - "cls": "", - "activeClass": "uk-active", - "src": function(ele) { - var title = ele.attr('title'); - - if (title !== undefined) { - ele.data('cached-title', title).removeAttr('title'); - } - - return ele.data("cached-title"); - } - }, - - tip: "", - - boot: function() { - - // init code - UI.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) { - var ele = UI.$(this); - - if (!ele.data("tooltip")) { - UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip"))); - ele.trigger("mouseenter"); - } - }); - }, - - init: function() { - - var $this = this; - - if (!$tooltip) { - $tooltip = UI.$('
          ').appendTo("body"); - } - - this.on({ - focus : function(e) { $this.show(); }, - blur : function(e) { $this.hide(); }, - mouseenter : function(e) { $this.show(); }, - mouseleave : function(e) { $this.hide(); } - }); - }, - - show: function() { - - this.tip = typeof(this.options.src) === "function" ? this.options.src(this.element) : this.options.src; - - if (tooltipdelay) clearTimeout(tooltipdelay); - if (checkdelay) clearTimeout(checkdelay); - - if (typeof(this.tip) === 'string' ? !this.tip.length:true) return; - - $tooltip.stop().css({"top": -2000, "visibility": "hidden"}).removeClass(this.options.activeClass).show(); - $tooltip.html('
          ' + this.tip + '
          '); - - var $this = this, - pos = UI.$.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}), - width = $tooltip[0].offsetWidth, - height = $tooltip[0].offsetHeight, - offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset, - position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos, - tmppos = position.split("-"), - tcss = { - "display" : "none", - "visibility" : "visible", - "top" : (pos.top + pos.height + height), - "left" : pos.left - }; - - - // prevent strange position - // when tooltip is in offcanvas etc. - if (UI.$html.css('position')=='fixed' || UI.$body.css('position')=='fixed'){ - var bodyoffset = UI.$('body').offset(), - htmloffset = UI.$('html').offset(), - docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)}; - - pos.left -= docoffset.left; - pos.top -= docoffset.top; - } - - - if ((tmppos[0] == "left" || tmppos[0] == "right") && UI.langdirection == 'right') { - tmppos[0] = tmppos[0] == "left" ? "right" : "left"; - } - - var variants = { - "bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2}, - "top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2}, - "left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset}, - "right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset} - }; - - UI.$.extend(tcss, variants[tmppos[0]]); - - if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width); - - var boundary = this.checkBoundary(tcss.left, tcss.top, width, height); - - if(boundary) { - - switch(boundary) { - case "x": - - if (tmppos.length == 2) { - position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right"); - } else { - position = tcss.left < 0 ? "right": "left"; - } - - break; - - case "y": - if (tmppos.length == 2) { - position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1]; - } else { - position = (tcss.top < 0 ? "bottom": "top"); - } - - break; - - case "xy": - if (tmppos.length == 2) { - position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right"); - } else { - position = tcss.left < 0 ? "right": "left"; - } - - break; - - } - - tmppos = position.split("-"); - - UI.$.extend(tcss, variants[tmppos[0]]); - - if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width); - } - - - tcss.left -= UI.$body.position().left; - - tooltipdelay = setTimeout(function(){ - - $tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' ')); - - if ($this.options.animation) { - $tooltip.css({opacity: 0, display: 'block'}).addClass($this.options.activeClass).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400); - } else { - $tooltip.show().addClass($this.options.activeClass); - } - - tooltipdelay = false; - - // close tooltip if element was removed or hidden - checkdelay = setInterval(function(){ - if(!$this.element.is(':visible')) $this.hide(); - }, 150); - - }, parseInt(this.options.delay, 10) || 0); - }, - - hide: function() { - if(this.element.is("input") && this.element[0]===document.activeElement) return; - - if(tooltipdelay) clearTimeout(tooltipdelay); - if (checkdelay) clearTimeout(checkdelay); - - $tooltip.stop(); - - if (this.options.animation) { - - var $this = this; - - $tooltip.fadeOut(parseInt(this.options.animation, 10) || 400, function(){ - $tooltip.removeClass($this.options.activeClass) - }); - - } else { - $tooltip.hide().removeClass(this.options.activeClass); - } - }, - - content: function() { - return this.tip; - }, - - checkBoundary: function(left, top, width, height) { - - var axis = ""; - - if(left < 0 || ((left - UI.$win.scrollLeft())+width) > window.innerWidth) { - axis += "x"; - } - - if(top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) { - axis += "y"; - } - - return axis; - } - }); - - return UI.tooltip; -}); diff --git a/js/components/tooltip.min.js b/js/components/tooltip.min.js deleted file mode 100755 index 130ea2e..0000000 --- a/js/components/tooltip.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-tooltip",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";var i,o,e;return t.component("tooltip",{defaults:{offset:5,pos:"top",animation:!1,delay:0,cls:"",activeClass:"uk-active",src:function(t){var i=t.attr("title");return void 0!==i&&t.data("cached-title",i).removeAttr("title"),t.data("cached-title")}},tip:"",boot:function(){t.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit","[data-uk-tooltip]",function(){var i=t.$(this);i.data("tooltip")||(t.tooltip(i,t.Utils.options(i.attr("data-uk-tooltip"))),i.trigger("mouseenter"))})},init:function(){var o=this;i||(i=t.$('
          ').appendTo("body")),this.on({focus:function(){o.show()},blur:function(){o.hide()},mouseenter:function(){o.show()},mouseleave:function(){o.hide()}})},show:function(){if(this.tip="function"==typeof this.options.src?this.options.src(this.element):this.options.src,o&&clearTimeout(o),e&&clearTimeout(e),"string"==typeof this.tip?this.tip.length:0){i.stop().css({top:-2e3,visibility:"hidden"}).removeClass(this.options.activeClass).show(),i.html('
          '+this.tip+"
          ");var s=this,n=t.$.extend({},this.element.offset(),{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}),l=i[0].offsetWidth,f=i[0].offsetHeight,p="function"==typeof this.options.offset?this.options.offset.call(this.element):this.options.offset,a="function"==typeof this.options.pos?this.options.pos.call(this.element):this.options.pos,h=a.split("-"),c={display:"none",visibility:"visible",top:n.top+n.height+f,left:n.left};if("fixed"==t.$html.css("position")||"fixed"==t.$body.css("position")){var r=t.$("body").offset(),d=t.$("html").offset(),u={top:d.top+r.top,left:d.left+r.left};n.left-=u.left,n.top-=u.top}"left"!=h[0]&&"right"!=h[0]||"right"!=t.langdirection||(h[0]="left"==h[0]?"right":"left");var m={bottom:{top:n.top+n.height+p,left:n.left+n.width/2-l/2},top:{top:n.top-f-p,left:n.left+n.width/2-l/2},left:{top:n.top+n.height/2-f/2,left:n.left-l-p},right:{top:n.top+n.height/2-f/2,left:n.left+n.width+p}};t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l);var v=this.checkBoundary(c.left,c.top,l,f);if(v){switch(v){case"x":a=2==h.length?h[0]+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left";break;case"y":a=2==h.length?(c.top<0?"bottom":"top")+"-"+h[1]:c.top<0?"bottom":"top";break;case"xy":a=2==h.length?(c.top<0?"bottom":"top")+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left"}h=a.split("-"),t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l)}c.left-=t.$body.position().left,o=setTimeout(function(){i.css(c).attr("class",["uk-tooltip","uk-tooltip-"+a,s.options.cls].join(" ")),s.options.animation?i.css({opacity:0,display:"block"}).addClass(s.options.activeClass).animate({opacity:1},parseInt(s.options.animation,10)||400):i.show().addClass(s.options.activeClass),o=!1,e=setInterval(function(){s.element.is(":visible")||s.hide()},150)},parseInt(this.options.delay,10)||0)}},hide:function(){if(!this.element.is("input")||this.element[0]!==document.activeElement)if(o&&clearTimeout(o),e&&clearTimeout(e),i.stop(),this.options.animation){var t=this;i.fadeOut(parseInt(this.options.animation,10)||400,function(){i.removeClass(t.options.activeClass)})}else i.hide().removeClass(this.options.activeClass)},content:function(){return this.tip},checkBoundary:function(i,o,e,s){var n="";return(0>i||i-t.$win.scrollLeft()+e>window.innerWidth)&&(n+="x"),(0>o||o-t.$win.scrollTop()+s>window.innerHeight)&&(n+="y"),n}}),t.tooltip}); \ No newline at end of file diff --git a/js/components/upload.js b/js/components/upload.js deleted file mode 100755 index f80f26e..0000000 --- a/js/components/upload.js +++ /dev/null @@ -1,257 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(addon) { - - var component; - - if (window.UIkit) { - component = addon(UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-upload", ["uikit"], function(){ - return component || addon(UIkit); - }); - } - -})(function(UI){ - - "use strict"; - - UI.component('uploadSelect', { - - init: function() { - - var $this = this; - - this.on("change", function() { - xhrupload($this.element[0].files, $this.options); - var twin = $this.element.clone(true).data('uploadSelect', $this); - $this.element.replaceWith(twin); - $this.element = twin; - }); - } - }); - - UI.component('uploadDrop', { - - defaults: { - 'dragoverClass': 'uk-dragover' - }, - - init: function() { - - var $this = this, hasdragCls = false; - - this.on("drop", function(e){ - - if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files) { - - e.stopPropagation(); - e.preventDefault(); - - $this.element.removeClass($this.options.dragoverClass); - $this.element.trigger('dropped.uk.upload', [e.originalEvent.dataTransfer.files]); - - xhrupload(e.originalEvent.dataTransfer.files, $this.options); - } - - }).on("dragenter", function(e){ - e.stopPropagation(); - e.preventDefault(); - }).on("dragover", function(e){ - e.stopPropagation(); - e.preventDefault(); - - if (!hasdragCls) { - $this.element.addClass($this.options.dragoverClass); - hasdragCls = true; - } - }).on("dragleave", function(e){ - e.stopPropagation(); - e.preventDefault(); - $this.element.removeClass($this.options.dragoverClass); - hasdragCls = false; - }); - } - }); - - - UI.support.ajaxupload = (function() { - - function supportFileAPI() { - var fi = document.createElement('INPUT'); fi.type = 'file'; return 'files' in fi; - } - - function supportAjaxUploadProgressEvents() { - var xhr = new XMLHttpRequest(); return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload)); - } - - function supportFormData() { - return !! window.FormData; - } - - return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData(); - })(); - - - function xhrupload(files, settings) { - - if (!UI.support.ajaxupload){ - return this; - } - - settings = UI.$.extend({}, xhrupload.defaults, settings); - - if (!files.length){ - return; - } - - if (settings.allow !== '*.*') { - - for(var i=0,file;file=files[i];i++) { - - if(!matchName(settings.allow, file.name)) { - - if(typeof(settings.notallowed) == 'string') { - alert(settings.notallowed); - } else { - settings.notallowed(file, settings); - } - return; - } - } - } - - var complete = settings.complete; - - if (settings.single){ - - var count = files.length, - uploaded = 0, - allow = true; - - settings.beforeAll(files); - - settings.complete = function(response, xhr){ - - uploaded = uploaded + 1; - - complete(response, xhr); - - if (settings.filelimit && uploaded >= settings.filelimit){ - allow = false; - } - - if (allow && uploaded=a.filelimit&&(p=!1),p&&s>d?r([o[d]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){f(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.originalEvent.dataTransfer&&n.originalEvent.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.originalEvent.dataTransfer.files]),t(n.originalEvent.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t}); \ No newline at end of file diff --git a/js/core/alert.js b/js/core/alert.js deleted file mode 100755 index e145d5f..0000000 --- a/js/core/alert.js +++ /dev/null @@ -1,66 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - UI.component('alert', { - - defaults: { - "fade": true, - "duration": 200, - "trigger": ".uk-alert-close" - }, - - boot: function() { - - // init code - UI.$html.on("click.alert.uikit", "[data-uk-alert]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("alert")) { - - var alert = UI.alert(ele, UI.Utils.options(ele.attr("data-uk-alert"))); - - if (UI.$(e.target).is(alert.options.trigger)) { - e.preventDefault(); - alert.close(); - } - } - }); - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.trigger, function(e) { - e.preventDefault(); - $this.close(); - }); - }, - - close: function() { - - var element = this.trigger("close.uk.alert"), - removeElement = function () { - this.trigger("closed.uk.alert").remove(); - }.bind(this); - - if (this.options.fade) { - element.css("overflow", "hidden").css("max-height", element.height()).animate({ - "height" : 0, - "opacity" : 0, - "padding-top" : 0, - "padding-bottom" : 0, - "margin-top" : 0, - "margin-bottom" : 0 - }, this.options.duration, removeElement); - } else { - removeElement(); - } - } - - }); - -})(UIkit); diff --git a/js/core/alert.min.js b/js/core/alert.min.js deleted file mode 100755 index 501b85d..0000000 --- a/js/core/alert.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";t.component("alert",{defaults:{fade:!0,duration:200,trigger:".uk-alert-close"},boot:function(){t.$html.on("click.alert.uikit","[data-uk-alert]",function(i){var o=t.$(this);if(!o.data("alert")){var e=t.alert(o,t.Utils.options(o.attr("data-uk-alert")));t.$(i.target).is(e.options.trigger)&&(i.preventDefault(),e.close())}})},init:function(){var t=this;this.on("click",this.options.trigger,function(i){i.preventDefault(),t.close()})},close:function(){var t=this.trigger("close.uk.alert"),i=function(){this.trigger("closed.uk.alert").remove()}.bind(this);this.options.fade?t.css("overflow","hidden").css("max-height",t.height()).animate({height:0,opacity:0,"padding-top":0,"padding-bottom":0,"margin-top":0,"margin-bottom":0},this.options.duration,i):i()}})}(UIkit); \ No newline at end of file diff --git a/js/core/button.js b/js/core/button.js deleted file mode 100755 index 9ebe57a..0000000 --- a/js/core/button.js +++ /dev/null @@ -1,157 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - UI.component('buttonRadio', { - - defaults: { - "activeClass": 'uk-active', - "target": ".uk-button" - }, - - boot: function() { - - // init code - UI.$html.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("buttonRadio")) { - - var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr("data-uk-button-radio"))), - target = UI.$(e.target); - - if (target.is(obj.options.target)) { - target.trigger("click"); - } - } - }); - }, - - init: function() { - - var $this = this; - - // Init ARIA - this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true'); - - this.on("click", this.options.target, function(e) { - - var ele = UI.$(this); - - if (ele.is('a[href="#"]')) e.preventDefault(); - - $this.find($this.options.target).not(ele).removeClass($this.options.activeClass).blur(); - ele.addClass($this.options.activeClass); - - // Update ARIA - $this.find($this.options.target).not(ele).attr('aria-checked', 'false'); - ele.attr('aria-checked', 'true'); - - $this.trigger("change.uk.button", [ele]); - }); - - }, - - getSelected: function() { - return this.find('.' + this.options.activeClass); - } - }); - - UI.component('buttonCheckbox', { - - defaults: { - "activeClass": 'uk-active', - "target": ".uk-button" - }, - - boot: function() { - - UI.$html.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) { - var ele = UI.$(this); - - if (!ele.data("buttonCheckbox")) { - - var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr("data-uk-button-checkbox"))), - target = UI.$(e.target); - - if (target.is(obj.options.target)) { - target.trigger("click"); - } - } - }); - }, - - init: function() { - - var $this = this; - - // Init ARIA - this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true'); - - this.on("click", this.options.target, function(e) { - var ele = UI.$(this); - - if (ele.is('a[href="#"]')) e.preventDefault(); - - ele.toggleClass($this.options.activeClass).blur(); - - // Update ARIA - ele.attr('aria-checked', ele.hasClass($this.options.activeClass)); - - $this.trigger("change.uk.button", [ele]); - }); - - }, - - getSelected: function() { - return this.find('.' + this.options.activeClass); - } - }); - - - UI.component('button', { - - defaults: {}, - - boot: function() { - - UI.$html.on("click.button.uikit", "[data-uk-button]", function(e) { - var ele = UI.$(this); - - if (!ele.data("button")) { - - var obj = UI.button(ele, UI.Utils.options(ele.attr("data-uk-button"))); - ele.trigger("click"); - } - }); - }, - - init: function() { - - var $this = this; - - // Init ARIA - this.element.attr('aria-pressed', this.element.hasClass("uk-active")); - - this.on("click", function(e) { - - if ($this.element.is('a[href="#"]')) e.preventDefault(); - - $this.toggle(); - $this.trigger("change.uk.button", [$this.element.blur().hasClass("uk-active")]); - }); - - }, - - toggle: function() { - this.element.toggleClass("uk-active"); - - // Update ARIA - this.element.attr('aria-pressed', this.element.hasClass("uk-active")); - } - }); - -})(UIkit); - diff --git a/js/core/button.min.js b/js/core/button.min.js deleted file mode 100755 index 9458783..0000000 --- a/js/core/button.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";t.component("buttonRadio",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttonradio.uikit","[data-uk-button-radio]",function(i){var a=t.$(this);if(!a.data("buttonRadio")){var e=t.buttonRadio(a,t.Utils.options(a.attr("data-uk-button-radio"))),o=t.$(i.target);o.is(e.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(a){var e=t.$(this);e.is('a[href="#"]')&&a.preventDefault(),i.find(i.options.target).not(e).removeClass(i.options.activeClass).blur(),e.addClass(i.options.activeClass),i.find(i.options.target).not(e).attr("aria-checked","false"),e.attr("aria-checked","true"),i.trigger("change.uk.button",[e])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("buttonCheckbox",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttoncheckbox.uikit","[data-uk-button-checkbox]",function(i){var a=t.$(this);if(!a.data("buttonCheckbox")){var e=t.buttonCheckbox(a,t.Utils.options(a.attr("data-uk-button-checkbox"))),o=t.$(i.target);o.is(e.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(a){var e=t.$(this);e.is('a[href="#"]')&&a.preventDefault(),e.toggleClass(i.options.activeClass).blur(),e.attr("aria-checked",e.hasClass(i.options.activeClass)),i.trigger("change.uk.button",[e])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("button",{defaults:{},boot:function(){t.$html.on("click.button.uikit","[data-uk-button]",function(){var i=t.$(this);if(!i.data("button")){{t.button(i,t.Utils.options(i.attr("data-uk-button")))}i.trigger("click")}})},init:function(){var t=this;this.element.attr("aria-pressed",this.element.hasClass("uk-active")),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle(),t.trigger("change.uk.button",[t.element.blur().hasClass("uk-active")])})},toggle:function(){this.element.toggleClass("uk-active"),this.element.attr("aria-pressed",this.element.hasClass("uk-active"))}})}(UIkit); \ No newline at end of file diff --git a/js/core/core.js b/js/core/core.js deleted file mode 100755 index 85540af..0000000 --- a/js/core/core.js +++ /dev/null @@ -1,786 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(core) { - - if (typeof define == "function" && define.amd) { // AMD - - define("uikit", function(){ - - var uikit = window.UIkit || core(window, window.jQuery, window.document); - - uikit.load = function(res, req, onload, config) { - - var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, ""); - - if (!base) { - throw new Error( "Please define base path to UIkit in the requirejs config." ); - } - - for (i = 0; i < resources.length; i += 1) { - var resource = resources[i].replace(/\./g, '/'); - load.push(base+'/components/'+resource); - } - - req(load, function() { - onload(uikit); - }); - }; - - return uikit; - }); - } - - if (!window.jQuery) { - throw new Error( "UIkit requires jQuery" ); - } - - if (window && window.jQuery) { - core(window, window.jQuery, window.document); - } - - -})(function(global, $, doc) { - - "use strict"; - - var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined; - - UI.version = '2.26.4'; - - UI.noConflict = function() { - // restore UIkit version - if (_UI) { - global.UIkit = _UI; - $.UIkit = _UI; - $.fn.uk = _UI.fn; - } - - return UI; - }; - - UI.prefix = function(str) { - return str; - }; - - // cache jQuery - UI.$ = $; - - UI.$doc = UI.$(document); - UI.$win = UI.$(window); - UI.$html = UI.$('html'); - - UI.support = {}; - UI.support.transition = (function() { - - var transitionEnd = (function() { - - var element = doc.body || doc.documentElement, - transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' - }, name; - - for (name in transEndEventNames) { - if (element.style[name] !== undefined) return transEndEventNames[name]; - } - }()); - - return transitionEnd && { end: transitionEnd }; - })(); - - UI.support.animation = (function() { - - var animationEnd = (function() { - - var element = doc.body || doc.documentElement, - animEndEventNames = { - WebkitAnimation : 'webkitAnimationEnd', - MozAnimation : 'animationend', - OAnimation : 'oAnimationEnd oanimationend', - animation : 'animationend' - }, name; - - for (name in animEndEventNames) { - if (element.style[name] !== undefined) return animEndEventNames[name]; - } - }()); - - return animationEnd && { end: animationEnd }; - })(); - - // requestAnimationFrame polyfill - //https://github.com/darius/requestAnimationFrame - (function() { - - Date.now = Date.now || function() { return new Date().getTime(); }; - - var vendors = ['webkit', 'moz']; - for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { - var vp = vendors[i]; - window.requestAnimationFrame = window[vp+'RequestAnimationFrame']; - window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame'] - || window[vp+'CancelRequestAnimationFrame']); - } - if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) // iOS6 is buggy - || !window.requestAnimationFrame || !window.cancelAnimationFrame) { - var lastTime = 0; - window.requestAnimationFrame = function(callback) { - var now = Date.now(); - var nextTime = Math.max(lastTime + 16, now); - return setTimeout(function() { callback(lastTime = nextTime); }, - nextTime - now); - }; - window.cancelAnimationFrame = clearTimeout; - } - }()); - - UI.support.touch = ( - ('ontouchstart' in document) || - (global.DocumentTouch && document instanceof global.DocumentTouch) || - (global.navigator.msPointerEnabled && global.navigator.msMaxTouchPoints > 0) || //IE 10 - (global.navigator.pointerEnabled && global.navigator.maxTouchPoints > 0) || //IE >=11 - false - ); - - UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null); - - UI.Utils = {}; - - UI.Utils.isFullscreen = function() { - return document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.fullscreenElement || false; - }; - - UI.Utils.str2json = function(str, notevil) { - try { - if (notevil) { - return JSON.parse(str - // wrap keys without quote with valid double quote - .replace(/([\$\w]+)\s*:/g, function(_, $1){return '"'+$1+'":';}) - // replacing single quote wrapped ones to double quote - .replace(/'([^']+)'/g, function(_, $1){return '"'+$1+'"';}) - ); - } else { - return (new Function("", "var json = " + str + "; return JSON.parse(JSON.stringify(json));"))(); - } - } catch(e) { return false; } - }; - - UI.Utils.debounce = function(func, wait, immediate) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; - }; - - UI.Utils.throttle = function (func, limit) { - var wait = false; - return function () { - if (!wait) { - func.call(); - wait = true; - setTimeout(function () { - wait = false; - }, limit); - } - } - }; - - UI.Utils.removeCssRules = function(selectorRegEx) { - var idx, idxs, stylesheet, _i, _j, _k, _len, _len1, _len2, _ref; - - if(!selectorRegEx) return; - - setTimeout(function(){ - try { - _ref = document.styleSheets; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - stylesheet = _ref[_i]; - idxs = []; - stylesheet.cssRules = stylesheet.cssRules; - for (idx = _j = 0, _len1 = stylesheet.cssRules.length; _j < _len1; idx = ++_j) { - if (stylesheet.cssRules[idx].type === CSSRule.STYLE_RULE && selectorRegEx.test(stylesheet.cssRules[idx].selectorText)) { - idxs.unshift(idx); - } - } - for (_k = 0, _len2 = idxs.length; _k < _len2; _k++) { - stylesheet.deleteRule(idxs[_k]); - } - } - } catch (_error) {} - }, 0); - }; - - UI.Utils.isInView = function(element, options) { - - var $element = $(element); - - if (!$element.is(':visible')) { - return false; - } - - var window_left = UI.$win.scrollLeft(), window_top = UI.$win.scrollTop(), offset = $element.offset(), left = offset.left, top = offset.top; - - options = $.extend({topoffset:0, leftoffset:0}, options); - - if (top + $element.height() >= window_top && top - options.topoffset <= window_top + UI.$win.height() && - left + $element.width() >= window_left && left - options.leftoffset <= window_left + UI.$win.width()) { - return true; - } else { - return false; - } - }; - - UI.Utils.checkDisplay = function(context, initanimation) { - - var elements = UI.$('[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]', context || document), animated; - - if (context && !elements.length) { - elements = $(context); - } - - elements.trigger('display.uk.check'); - - // fix firefox / IE animations - if (initanimation) { - - if (typeof(initanimation)!='string') { - initanimation = '[class*="uk-animation-"]'; - } - - elements.find(initanimation).each(function(){ - - var ele = UI.$(this), - cls = ele.attr('class'), - anim = cls.match(/uk-animation-(.+)/); - - ele.removeClass(anim[0]).width(); - - ele.addClass(anim[0]); - }); - } - - return elements; - }; - - UI.Utils.options = function(string) { - - if ($.type(string)!='string') return string; - - if (string.indexOf(':') != -1 && string.trim().substr(-1) != '}') { - string = '{'+string+'}'; - } - - var start = (string ? string.indexOf("{") : -1), options = {}; - - if (start != -1) { - try { - options = UI.Utils.str2json(string.substr(start)); - } catch (e) {} - } - - return options; - }; - - UI.Utils.animate = function(element, cls) { - - var d = $.Deferred(); - - element = UI.$(element); - - element.css('display', 'none').addClass(cls).one(UI.support.animation.end, function() { - element.removeClass(cls); - d.resolve(); - }); - - element.css('display', ''); - - return d.promise(); - }; - - UI.Utils.uid = function(prefix) { - return (prefix || 'id') + (new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000)); - }; - - UI.Utils.template = function(str, data) { - - var tokens = str.replace(/\n/g, '\\n').replace(/\{\{\{\s*(.+?)\s*\}\}\}/g, "{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g), - i=0, toc, cmd, prop, val, fn, output = [], openblocks = 0; - - while(i < tokens.length) { - - toc = tokens[i]; - - if(toc.match(/\{\{\s*(.+?)\s*\}\}/)) { - i = i + 1; - toc = tokens[i]; - cmd = toc[0]; - prop = toc.substring(toc.match(/^(\^|\#|\!|\~|\:)/) ? 1:0); - - switch(cmd) { - case '~': - output.push("for(var $i=0;$i<"+prop+".length;$i++) { var $item = "+prop+"[$i];"); - openblocks++; - break; - case ':': - output.push("for(var $key in "+prop+") { var $val = "+prop+"[$key];"); - openblocks++; - break; - case '#': - output.push("if("+prop+") {"); - openblocks++; - break; - case '^': - output.push("if(!"+prop+") {"); - openblocks++; - break; - case '/': - output.push("}"); - openblocks--; - break; - case '!': - output.push("__ret.push("+prop+");"); - break; - default: - output.push("__ret.push(escape("+prop+"));"); - break; - } - } else { - output.push("__ret.push('"+toc.replace(/\'/g, "\\'")+"');"); - } - i = i + 1; - } - - fn = new Function('$data', [ - 'var __ret = [];', - 'try {', - 'with($data){', (!openblocks ? output.join('') : '__ret = ["Not all blocks are closed correctly."]'), '};', - '}catch(e){__ret = [e.message];}', - 'return __ret.join("").replace(/\\n\\n/g, "\\n");', - "function escape(html) { return String(html).replace(/&/g, '&').replace(/\"/g, '"').replace(//g, '>');}" - ].join("\n")); - - return data ? fn(data) : fn; - }; - - UI.Utils.events = {}; - UI.Utils.events.click = UI.support.touch ? 'tap' : 'click'; - - global.UIkit = UI; - - // deprecated - - UI.fn = function(command, options) { - - var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2]; - - if (!UI[component]) { - $.error("UIkit component [" + component + "] does not exist."); - return this; - } - - return this.each(function() { - var $this = $(this), data = $this.data(component); - if (!data) $this.data(component, (data = UI[component](this, method ? undefined : options))); - if (method) data[method].apply(data, Array.prototype.slice.call(args, 1)); - }); - }; - - $.UIkit = UI; - $.fn.uk = UI.fn; - - UI.langdirection = UI.$html.attr("dir") == "rtl" ? "right" : "left"; - - UI.components = {}; - - UI.component = function(name, def) { - - var fn = function(element, options) { - - var $this = this; - - this.UIkit = UI; - this.element = element ? UI.$(element) : null; - this.options = $.extend(true, {}, this.defaults, options); - this.plugins = {}; - - if (this.element) { - this.element.data(name, this); - } - - this.init(); - - (this.options.plugins.length ? this.options.plugins : Object.keys(fn.plugins)).forEach(function(plugin) { - - if (fn.plugins[plugin].init) { - fn.plugins[plugin].init($this); - $this.plugins[plugin] = true; - } - - }); - - this.trigger('init.uk.component', [name, this]); - - return this; - }; - - fn.plugins = {}; - - $.extend(true, fn.prototype, { - - defaults : {plugins: []}, - - boot: function(){}, - init: function(){}, - - on: function(a1,a2,a3){ - return UI.$(this.element || this).on(a1,a2,a3); - }, - - one: function(a1,a2,a3){ - return UI.$(this.element || this).one(a1,a2,a3); - }, - - off: function(evt){ - return UI.$(this.element || this).off(evt); - }, - - trigger: function(evt, params) { - return UI.$(this.element || this).trigger(evt, params); - }, - - find: function(selector) { - return UI.$(this.element ? this.element: []).find(selector); - }, - - proxy: function(obj, methods) { - - var $this = this; - - methods.split(' ').forEach(function(method) { - if (!$this[method]) $this[method] = function() { return obj[method].apply(obj, arguments); }; - }); - }, - - mixin: function(obj, methods) { - - var $this = this; - - methods.split(' ').forEach(function(method) { - if (!$this[method]) $this[method] = obj[method].bind($this); - }); - }, - - option: function() { - - if (arguments.length == 1) { - return this.options[arguments[0]] || undefined; - } else if (arguments.length == 2) { - this.options[arguments[0]] = arguments[1]; - } - } - - }, def); - - this.components[name] = fn; - - this[name] = function() { - - var element, options; - - if (arguments.length) { - - switch(arguments.length) { - case 1: - - if (typeof arguments[0] === "string" || arguments[0].nodeType || arguments[0] instanceof jQuery) { - element = $(arguments[0]); - } else { - options = arguments[0]; - } - - break; - case 2: - - element = $(arguments[0]); - options = arguments[1]; - break; - } - } - - if (element && element.data(name)) { - return element.data(name); - } - - return (new UI.components[name](element, options)); - }; - - if (UI.domready) { - UI.component.boot(name); - } - - return fn; - }; - - UI.plugin = function(component, name, def) { - this.components[component].plugins[name] = def; - }; - - UI.component.boot = function(name) { - - if (UI.components[name].prototype && UI.components[name].prototype.boot && !UI.components[name].booted) { - UI.components[name].prototype.boot.apply(UI, []); - UI.components[name].booted = true; - } - }; - - UI.component.bootComponents = function() { - - for (var component in UI.components) { - UI.component.boot(component); - } - }; - - - // DOM mutation save ready helper function - - UI.domObservers = []; - UI.domready = false; - - UI.ready = function(fn) { - - UI.domObservers.push(fn); - - if (UI.domready) { - fn(document); - } - }; - - UI.on = function(a1,a2,a3){ - - if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) { - a2.apply(UI.$doc); - } - - return UI.$doc.on(a1,a2,a3); - }; - - UI.one = function(a1,a2,a3){ - - if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) { - a2.apply(UI.$doc); - return UI.$doc; - } - - return UI.$doc.one(a1,a2,a3); - }; - - UI.trigger = function(evt, params) { - return UI.$doc.trigger(evt, params); - }; - - UI.domObserve = function(selector, fn) { - - if(!UI.support.mutationobserver) return; - - fn = fn || function() {}; - - UI.$(selector).each(function() { - - var element = this, - $element = UI.$(element); - - if ($element.data('observer')) { - return; - } - - try { - - var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) { - fn.apply(element, []); - $element.trigger('changed.uk.dom'); - }, 50), {childList: true, subtree: true}); - - // pass in the target node, as well as the observer options - observer.observe(element, { childList: true, subtree: true }); - - $element.data('observer', observer); - - } catch(e) {} - }); - }; - - UI.init = function(root) { - - root = root || document; - - UI.domObservers.forEach(function(fn){ - fn(root); - }); - }; - - UI.on('domready.uk.dom', function(){ - - UI.init(); - - if (UI.domready) UI.Utils.checkDisplay(); - }); - - document.addEventListener('DOMContentLoaded', function(){ - - var domReady = function() { - - UI.$body = UI.$('body'); - - UI.trigger('beforeready.uk.dom'); - - UI.component.bootComponents(); - - // custom scroll observer - var rafToken = requestAnimationFrame((function(){ - - var memory = {dir: {x:0, y:0}, x: window.pageXOffset, y:window.pageYOffset}; - - var fn = function(){ - // reading this (window.page[X|Y]Offset) causes a full page recalc of the layout in Chrome, - // so we only want to do this once - var wpxo = window.pageXOffset; - var wpyo = window.pageYOffset; - - // Did the scroll position change since the last time we were here? - if (memory.x != wpxo || memory.y != wpyo) { - - // Set the direction of the scroll and store the new position - if (wpxo != memory.x) {memory.dir.x = wpxo > memory.x ? 1:-1; } else { memory.dir.x = 0; } - if (wpyo != memory.y) {memory.dir.y = wpyo > memory.y ? 1:-1; } else { memory.dir.y = 0; } - - memory.x = wpxo; - memory.y = wpyo; - - // Trigger the scroll event, this could probably be sent using memory.clone() but this is - // more explicit and easier to see exactly what is being sent in the event. - UI.$doc.trigger('scrolling.uk.document', [{ - "dir": {"x": memory.dir.x, "y": memory.dir.y}, "x": wpxo, "y": wpyo - }]); - } - - cancelAnimationFrame(rafToken); - rafToken = requestAnimationFrame(fn); - }; - - if (UI.support.touch) { - UI.$html.on('touchmove touchend MSPointerMove MSPointerUp pointermove pointerup', fn); - } - - if (memory.x || memory.y) fn(); - - return fn; - - })()); - - // run component init functions on dom - UI.trigger('domready.uk.dom'); - - if (UI.support.touch) { - - // remove css hover rules for touch devices - // UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/); - - // viewport unit fix for uk-height-viewport - should be fixed in iOS 8 - if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { - - UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){ - - var fn = function() { - $('.uk-height-viewport').css('height', window.innerHeight); - return fn; - }; - - return fn(); - - })(), 100)); - } - } - - UI.trigger('afterready.uk.dom'); - - // mark that domready is left behind - UI.domready = true; - - // auto init js components - if (UI.support.mutationobserver) { - - var initFn = UI.Utils.debounce(function(){ - requestAnimationFrame(function(){ UI.init(document.body);}); - }, 10); - - (new UI.support.mutationobserver(function(mutations) { - - var init = false; - - mutations.every(function(mutation){ - - if (mutation.type != 'childList') return true; - - for (var i = 0, node; i < mutation.addedNodes.length; ++i) { - - node = mutation.addedNodes[i]; - - if (node.outerHTML && node.outerHTML.indexOf('data-uk-') !== -1) { - return (init = true) && false; - } - } - return true; - }); - - if (init) initFn(); - - })).observe(document.body, {childList: true, subtree: true}); - } - }; - - if (document.readyState == 'complete' || document.readyState == 'interactive') { - setTimeout(domReady); - } - - return domReady; - - }()); - - // add touch identifier class - UI.$html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch"); - - // add uk-hover class on tap to support overlays on touch devices - if (UI.support.touch) { - - var hoverset = false, - exclude, - hovercls = 'uk-hover', - selector = '.uk-overlay, .uk-overlay-hover, .uk-overlay-toggle, .uk-animation-hover, .uk-has-hover'; - - UI.$html.on('mouseenter touchstart MSPointerDown pointerdown', selector, function() { - - if (hoverset) $('.'+hovercls).removeClass(hovercls); - - hoverset = $(this).addClass(hovercls); - - }).on('mouseleave touchend MSPointerUp pointerup', function(e) { - - exclude = $(e.target).parents(selector); - - if (hoverset) { - hoverset.not(exclude).removeClass(hovercls); - } - }); - } - - return UI; -}); diff --git a/js/core/core.min.js b/js/core/core.min.js deleted file mode 100755 index 07642d0..0000000 --- a/js/core/core.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){if("function"==typeof define&&define.amd&&define("uikit",function(){var n=window.UIkit||t(window,window.jQuery,window.document);return n.load=function(t,e,o,i){var r,a=t.split(","),s=[],u=(i.config&&i.config.uikit&&i.config.uikit.base?i.config.uikit.base:"").replace(/\/+$/g,"");if(!u)throw new Error("Please define base path to UIkit in the requirejs config.");for(r=0;r0||t.navigator.pointerEnabled&&t.navigator.maxTouchPoints>0||!1,o.support.mutationobserver=t.MutationObserver||t.WebKitMutationObserver||null,o.Utils={},o.Utils.isFullscreen=function(){return document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.fullscreenElement||!1},o.Utils.str2json=function(t,n){try{return n?JSON.parse(t.replace(/([\$\w]+)\s*:/g,function(t,n){return'"'+n+'":'}).replace(/'([^']+)'/g,function(t,n){return'"'+n+'"'})):new Function("","var json = "+t+"; return JSON.parse(JSON.stringify(json));")()}catch(e){return!1}},o.Utils.debounce=function(t,n,e){var o;return function(){var i=this,r=arguments,a=function(){o=null,e||t.apply(i,r)},s=e&&!o;clearTimeout(o),o=setTimeout(a,n),s&&t.apply(i,r)}},o.Utils.throttle=function(t,n){var e=!1;return function(){e||(t.call(),e=!0,setTimeout(function(){e=!1},n))}},o.Utils.removeCssRules=function(t){var n,e,o,i,r,a,s,u,c,d;t&&setTimeout(function(){try{for(d=document.styleSheets,i=0,s=d.length;s>i;i++){for(o=d[i],e=[],o.cssRules=o.cssRules,n=r=0,u=o.cssRules.length;u>r;n=++r)o.cssRules[n].type===CSSRule.STYLE_RULE&&t.test(o.cssRules[n].selectorText)&&e.unshift(n);for(a=0,c=e.length;c>a;a++)o.deleteRule(e[a])}}catch(l){}},0)},o.Utils.isInView=function(t,e){var i=n(t);if(!i.is(":visible"))return!1;var r=o.$win.scrollLeft(),a=o.$win.scrollTop(),s=i.offset(),u=s.left,c=s.top;return e=n.extend({topoffset:0,leftoffset:0},e),c+i.height()>=a&&c-e.topoffset<=a+o.$win.height()&&u+i.width()>=r&&u-e.leftoffset<=r+o.$win.width()?!0:!1},o.Utils.checkDisplay=function(t,e){var i=o.$("[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]",t||document);return t&&!i.length&&(i=n(t)),i.trigger("display.uk.check"),e&&("string"!=typeof e&&(e='[class*="uk-animation-"]'),i.find(e).each(function(){var t=o.$(this),n=t.attr("class"),e=n.match(/uk-animation-(.+)/);t.removeClass(e[0]).width(),t.addClass(e[0])})),i},o.Utils.options=function(t){if("string"!=n.type(t))return t;-1!=t.indexOf(":")&&"}"!=t.trim().substr(-1)&&(t="{"+t+"}");var e=t?t.indexOf("{"):-1,i={};if(-1!=e)try{i=o.Utils.str2json(t.substr(e))}catch(r){}return i},o.Utils.animate=function(t,e){var i=n.Deferred();return t=o.$(t),t.css("display","none").addClass(e).one(o.support.animation.end,function(){t.removeClass(e),i.resolve()}),t.css("display",""),i.promise()},o.Utils.uid=function(t){return(t||"id")+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random())},o.Utils.template=function(t,n){for(var e,o,i,r,a=t.replace(/\n/g,"\\n").replace(/\{\{\{\s*(.+?)\s*\}\}\}/g,"{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),s=0,u=[],c=0;s/g, '>');}"].join("\n")),n?r(n):r},o.Utils.events={},o.Utils.events.click=o.support.touch?"tap":"click",t.UIkit=o,o.fn=function(t,e){var i=arguments,r=t.match(/^([a-z\-]+)(?:\.([a-z]+))?/i),a=r[1],s=r[2];return o[a]?this.each(function(){var t=n(this),r=t.data(a);r||t.data(a,r=o[a](this,s?void 0:e)),s&&r[s].apply(r,Array.prototype.slice.call(i,1))}):(n.error("UIkit component ["+a+"] does not exist."),this)},n.UIkit=o,n.fn.uk=o.fn,o.langdirection="rtl"==o.$html.attr("dir")?"right":"left",o.components={},o.component=function(t,e){var i=function(e,r){var a=this;return this.UIkit=o,this.element=e?o.$(e):null,this.options=n.extend(!0,{},this.defaults,r),this.plugins={},this.element&&this.element.data(t,this),this.init(),(this.options.plugins.length?this.options.plugins:Object.keys(i.plugins)).forEach(function(t){i.plugins[t].init&&(i.plugins[t].init(a),a.plugins[t]=!0)}),this.trigger("init.uk.component",[t,this]),this};return i.plugins={},n.extend(!0,i.prototype,{defaults:{plugins:[]},boot:function(){},init:function(){},on:function(t,n,e){return o.$(this.element||this).on(t,n,e)},one:function(t,n,e){return o.$(this.element||this).one(t,n,e)},off:function(t){return o.$(this.element||this).off(t)},trigger:function(t,n){return o.$(this.element||this).trigger(t,n)},find:function(t){return o.$(this.element?this.element:[]).find(t)},proxy:function(t,n){var e=this;n.split(" ").forEach(function(n){e[n]||(e[n]=function(){return t[n].apply(t,arguments)})})},mixin:function(t,n){var e=this;n.split(" ").forEach(function(n){e[n]||(e[n]=t[n].bind(e))})},option:function(){return 1==arguments.length?this.options[arguments[0]]||void 0:(2==arguments.length&&(this.options[arguments[0]]=arguments[1]),void 0)}},e),this.components[t]=i,this[t]=function(){var e,i;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?e=n(arguments[0]):i=arguments[0];break;case 2:e=n(arguments[0]),i=arguments[1]}return e&&e.data(t)?e.data(t):new o.components[t](e,i)},o.domready&&o.component.boot(t),i},o.plugin=function(t,n,e){this.components[t].plugins[n]=e},o.component.boot=function(t){o.components[t].prototype&&o.components[t].prototype.boot&&!o.components[t].booted&&(o.components[t].prototype.boot.apply(o,[]),o.components[t].booted=!0)},o.component.bootComponents=function(){for(var t in o.components)o.component.boot(t)},o.domObservers=[],o.domready=!1,o.ready=function(t){o.domObservers.push(t),o.domready&&t(document)},o.on=function(t,n,e){return t&&t.indexOf("ready.uk.dom")>-1&&o.domready&&n.apply(o.$doc),o.$doc.on(t,n,e)},o.one=function(t,n,e){return t&&t.indexOf("ready.uk.dom")>-1&&o.domready?(n.apply(o.$doc),o.$doc):o.$doc.one(t,n,e)},o.trigger=function(t,n){return o.$doc.trigger(t,n)},o.domObserve=function(t,n){o.support.mutationobserver&&(n=n||function(){},o.$(t).each(function(){var t=this,e=o.$(t);if(!e.data("observer"))try{var i=new o.support.mutationobserver(o.Utils.debounce(function(){n.apply(t,[]),e.trigger("changed.uk.dom")},50),{childList:!0,subtree:!0});i.observe(t,{childList:!0,subtree:!0}),e.data("observer",i)}catch(r){}}))},o.init=function(t){t=t||document,o.domObservers.forEach(function(n){n(t)})},o.on("domready.uk.dom",function(){o.init(),o.domready&&o.Utils.checkDisplay()}),document.addEventListener("DOMContentLoaded",function(){var t=function(){o.$body=o.$("body"),o.trigger("beforeready.uk.dom"),o.component.bootComponents();var t=requestAnimationFrame(function(){var n={dir:{x:0,y:0},x:window.pageXOffset,y:window.pageYOffset},e=function(){var i=window.pageXOffset,r=window.pageYOffset;(n.x!=i||n.y!=r)&&(n.dir.x=i!=n.x?i>n.x?1:-1:0,n.dir.y=r!=n.y?r>n.y?1:-1:0,n.x=i,n.y=r,o.$doc.trigger("scrolling.uk.document",[{dir:{x:n.dir.x,y:n.dir.y},x:i,y:r}])),cancelAnimationFrame(t),t=requestAnimationFrame(e)};return o.support.touch&&o.$html.on("touchmove touchend MSPointerMove MSPointerUp pointermove pointerup",e),(n.x||n.y)&&e(),e}());if(o.trigger("domready.uk.dom"),o.support.touch&&navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&o.$win.on("load orientationchange resize",o.Utils.debounce(function(){var t=function(){return n(".uk-height-viewport").css("height",window.innerHeight),t};return t()}(),100)),o.trigger("afterready.uk.dom"),o.domready=!0,o.support.mutationobserver){var e=o.Utils.debounce(function(){requestAnimationFrame(function(){o.init(document.body)})},10);new o.support.mutationobserver(function(t){var n=!1;t.every(function(t){if("childList"!=t.type)return!0;for(var e,o=0;o -1 ? '&':'?'), 'enablejsapi=1&api=1'].join('')); - } - }, - - check: function() { - - this.element.css({ - 'width' : '', - 'height' : '' - }); - - this.dimension = {w: this.element.width(), h: this.element.height()}; - - if (this.element.attr('width') && !isNaN(this.element.attr('width'))) { - this.dimension.w = this.element.attr('width'); - } - - if (this.element.attr('height') && !isNaN(this.element.attr('height'))) { - this.dimension.h = this.element.attr('height'); - } - - this.ratio = this.dimension.w / this.dimension.h; - - var w = this.parent.width(), h = this.parent.height(), width, height; - - // if element height < parent height (gap underneath) - if ((w / this.ratio) < h) { - - width = Math.ceil(h * this.ratio); - height = h; - - // element width < parent width (gap to right) - } else { - - width = w; - height = Math.ceil(w / this.ratio); - } - - this.element.css({ - 'width' : width, - 'height' : height - }); - } - }); - -})(UIkit); diff --git a/js/core/cover.min.js b/js/core/cover.min.js deleted file mode 100755 index 6bc18a9..0000000 --- a/js/core/cover.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";t.component("cover",{defaults:{automute:!0},boot:function(){t.ready(function(i){t.$("[data-uk-cover]",i).each(function(){var i=t.$(this);if(!i.data("cover")){t.cover(i,t.Utils.options(i.attr("data-uk-cover")))}})})},init:function(){if(this.parent=this.element.parent(),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){this.check()}.bind(this),100)),this.on("display.uk.check",function(){this.element.is(":visible")&&this.check()}.bind(this)),this.check(),this.element.is("iframe")&&this.options.automute){var i=this.element.attr("src");this.element.attr("src","").on("load",function(){this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")}).attr("src",[i,i.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){this.element.css({width:"",height:""}),this.dimension={w:this.element.width(),h:this.element.height()},this.element.attr("width")&&!isNaN(this.element.attr("width"))&&(this.dimension.w=this.element.attr("width")),this.element.attr("height")&&!isNaN(this.element.attr("height"))&&(this.dimension.h=this.element.attr("height")),this.ratio=this.dimension.w/this.dimension.h;var t,i,e=this.parent.width(),n=this.parent.height();e/this.ratio boundarywidth) { - dropdown.addClass("uk-dropdown-stack"); - this.trigger('stack.uk.dropdown', [this]); - } - - dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]); - }, - - checkBoundary: function(left, top, width, height, boundarywidth) { - - var axis = ""; - - if (left < 0 || ((left - UI.$win.scrollLeft())+width) > boundarywidth) { - axis += "x"; - } - - if ((top - UI.$win.scrollTop()) < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) { - axis += "y"; - } - - return axis; - } - }); - - - UI.component('dropdownOverlay', { - - defaults: { - 'justify' : false, - 'cls' : '', - 'duration': 200 - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-dropdown-overlay]", context).each(function() { - var ele = UI.$(this); - - if (!ele.data("dropdownOverlay")) { - UI.dropdownOverlay(ele, UI.Utils.options(ele.attr("data-uk-dropdown-overlay"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.justified = this.options.justify ? UI.$(this.options.justify) : false; - this.overlay = this.element.find('uk-dropdown-overlay'); - - if (!this.overlay.length) { - this.overlay = UI.$('
          ').appendTo(this.element); - } - - this.overlay.addClass(this.options.cls); - - this.on({ - - 'beforeshow.uk.dropdown': function(e, dropdown) { - $this.dropdown = dropdown; - - if ($this.justified && $this.justified.length) { - justify($this.overlay.css({'display':'block', 'margin-left':'','margin-right':''}), $this.justified, $this.justified.outerWidth()); - } - }, - - 'show.uk.dropdown': function(e, dropdown) { - - var h = $this.dropdown.dropdown.outerHeight(true); - - $this.dropdown.element.removeClass('uk-open'); - - $this.overlay.stop().css('display', 'block').animate({height: h}, $this.options.duration, function() { - - $this.dropdown.dropdown.css('visibility', ''); - $this.dropdown.element.addClass('uk-open'); - - UI.Utils.checkDisplay($this.dropdown.dropdown, true); - }); - - $this.pointerleave = false; - }, - - 'hide.uk.dropdown': function() { - $this.overlay.stop().animate({height: 0}, $this.options.duration); - }, - - 'pointerenter.uk.dropdown': function(e, dropdown) { - clearTimeout($this.remainIdle); - }, - - 'pointerleave.uk.dropdown': function(e, dropdown) { - $this.pointerleave = true; - } - }); - - - this.overlay.on({ - - 'mouseenter': function() { - if ($this.remainIdle) { - clearTimeout($this.dropdown.remainIdle); - clearTimeout($this.remainIdle); - } - }, - - 'mouseleave': function(){ - - if ($this.pointerleave && active) { - - $this.remainIdle = setTimeout(function() { - if(active) active.hide(); - }, active.options.remaintime); - } - } - }) - } - - }); - - - function justify(ele, justifyTo, boundarywidth, offset) { - - ele = UI.$(ele); - justifyTo = UI.$(justifyTo); - boundarywidth = boundarywidth || window.innerWidth; - offset = offset || ele.offset(); - - if (justifyTo.length) { - - var jwidth = justifyTo.outerWidth(); - - ele.css("min-width", jwidth); - - if (UI.langdirection == 'right') { - - var right1 = boundarywidth - (justifyTo.offset().left + jwidth), - right2 = boundarywidth - (ele.offset().left + ele.outerWidth()); - - ele.css("margin-right", right1 - right2); - - } else { - ele.css("margin-left", justifyTo.offset().left - offset.left); - } - } - } - -})(UIkit); diff --git a/js/core/dropdown.min.js b/js/core/dropdown.min.js deleted file mode 100755 index 410c82e..0000000 --- a/js/core/dropdown.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";function o(o,e,i,n){if(o=t.$(o),e=t.$(e),i=i||window.innerWidth,n=n||o.offset(),e.length){var r=e.outerWidth();if(o.css("min-width",r),"right"==t.langdirection){var s=i-(e.offset().left+r),d=i-(o.offset().left+o.outerWidth());o.css("margin-right",s-d)}else o.css("margin-left",e.offset().left-n.left)}}var e,i=!1,n={x:{"bottom-left":"bottom-right","bottom-right":"bottom-left","bottom-center":"bottom-center","top-left":"top-right","top-right":"top-left","top-center":"top-center","left-top":"right-top","left-bottom":"right-bottom","left-center":"right-center","right-top":"left-top","right-bottom":"left-bottom","right-center":"left-center"},y:{"bottom-left":"top-left","bottom-right":"top-right","bottom-center":"top-center","top-left":"bottom-left","top-right":"bottom-right","top-center":"bottom-center","left-top":"left-bottom","left-bottom":"left-top","left-center":"left-center","right-top":"right-bottom","right-bottom":"right-top","right-center":"right-center"},xy:{"bottom-left":"top-right","bottom-right":"top-left","bottom-center":"top-center","top-left":"bottom-right","top-right":"bottom-left","top-center":"bottom-center","left-top":"right-bottom","left-bottom":"right-top","left-center":"right-center","right-top":"left-bottom","right-bottom":"left-top","right-center":"left-center"}};t.component("dropdown",{defaults:{mode:"hover",pos:"bottom-left",offset:0,remaintime:800,justify:!1,boundary:t.$win,delay:0,dropdownSelector:".uk-dropdown,.uk-dropdown-blank",hoverDelayIdle:250,preventflip:!1},remainIdle:!1,boot:function(){var o=t.support.touch?"click":"mouseenter";t.$html.on(o+".dropdown.uikit","[data-uk-dropdown]",function(e){var i=t.$(this);if(!i.data("dropdown")){var n=t.dropdown(i,t.Utils.options(i.attr("data-uk-dropdown")));("click"==o||"mouseenter"==o&&"hover"==n.options.mode)&&n.element.trigger(o),n.element.find(n.options.dropdownSelector).length&&e.preventDefault()}})},init:function(){var o=this;this.dropdown=this.find(this.options.dropdownSelector),this.offsetParent=this.dropdown.parents().filter(function(){return-1!==t.$.inArray(t.$(this).css("position"),["relative","fixed","absolute"])}).slice(0,1),this.centered=this.dropdown.hasClass("uk-dropdown-center"),this.justified=this.options.justify?t.$(this.options.justify):!1,this.boundary=t.$(this.options.boundary),this.boundary.length||(this.boundary=t.$win),this.dropdown.hasClass("uk-dropdown-up")&&(this.options.pos="top-left"),this.dropdown.hasClass("uk-dropdown-flip")&&(this.options.pos=this.options.pos.replace("left","right")),this.dropdown.hasClass("uk-dropdown-center")&&(this.options.pos=this.options.pos.replace(/(left|right)/,"center")),this.element.attr("aria-haspopup","true"),this.element.attr("aria-expanded",this.element.hasClass("uk-open")),"click"==this.options.mode||t.support.touch?this.on("click.uk.dropdown",function(e){var i=t.$(e.target);i.parents(o.options.dropdownSelector).length||((i.is("a[href='#']")||i.parent().is("a[href='#']")||o.dropdown.length&&!o.dropdown.is(":visible"))&&e.preventDefault(),i.blur()),o.element.hasClass("uk-open")?(!o.dropdown.find(e.target).length||i.is(".uk-dropdown-close")||i.parents(".uk-dropdown-close").length)&&o.hide():o.show()}):this.on("mouseenter",function(){o.trigger("pointerenter.uk.dropdown",[o]),o.remainIdle&&clearTimeout(o.remainIdle),e&&clearTimeout(e),i&&i==o||(e=i&&i!=o?setTimeout(function(){e=setTimeout(o.show.bind(o),o.options.delay)},o.options.hoverDelayIdle):setTimeout(o.show.bind(o),o.options.delay))}).on("mouseleave",function(){e&&clearTimeout(e),o.remainIdle=setTimeout(function(){i&&i==o&&o.hide()},o.options.remaintime),o.trigger("pointerleave.uk.dropdown",[o])}).on("click",function(e){var n=t.$(e.target);return o.remainIdle&&clearTimeout(o.remainIdle),i&&i==o?((!o.dropdown.find(e.target).length||n.is(".uk-dropdown-close")||n.parents(".uk-dropdown-close").length)&&o.hide(),void 0):((n.is("a[href='#']")||n.parent().is("a[href='#']"))&&e.preventDefault(),o.show(),void 0)})},show:function(){t.$html.off("click.outer.dropdown"),i&&i!=this&&i.hide(!0),e&&clearTimeout(e),this.trigger("beforeshow.uk.dropdown",[this]),this.checkDimensions(),this.element.addClass("uk-open"),this.element.attr("aria-expanded","true"),this.trigger("show.uk.dropdown",[this]),t.Utils.checkDisplay(this.dropdown,!0),i=this,this.registerOuterClick()},hide:function(t){this.trigger("beforehide.uk.dropdown",[this,t]),this.element.removeClass("uk-open"),this.remainIdle&&clearTimeout(this.remainIdle),this.remainIdle=!1,this.element.attr("aria-expanded","false"),this.trigger("hide.uk.dropdown",[this,t]),i==this&&(i=!1)},registerOuterClick:function(){var o=this;t.$html.off("click.outer.dropdown"),setTimeout(function(){t.$html.on("click.outer.dropdown",function(n){e&&clearTimeout(e);t.$(n.target);i!=o||o.element.find(n.target).length||(o.hide(!0),t.$html.off("click.outer.dropdown"))})},10)},checkDimensions:function(){if(this.dropdown.length){this.dropdown.removeClass("uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack").css({"top-left":"",left:"","margin-left":"","margin-right":""}),this.justified&&this.justified.length&&this.dropdown.css("min-width","");var e,i=t.$.extend({},this.offsetParent.offset(),{width:this.offsetParent[0].offsetWidth,height:this.offsetParent[0].offsetHeight}),r=this.options.offset,s=this.dropdown,d=(s.show().offset()||{left:0,top:0},s.outerWidth()),h=s.outerHeight(),l=this.boundary.width(),p=(this.boundary[0]!==window&&this.boundary.offset()?this.boundary.offset():{top:0,left:0},this.options.pos),a={"bottom-left":{top:0+i.height+r,left:0},"bottom-right":{top:0+i.height+r,left:0+i.width-d},"bottom-center":{top:0+i.height+r,left:0+i.width/2-d/2},"top-left":{top:0-h-r,left:0},"top-right":{top:0-h-r,left:0+i.width-d},"top-center":{top:0-h-r,left:0+i.width/2-d/2},"left-top":{top:0,left:0-d-r},"left-bottom":{top:0+i.height-h,left:0-d-r},"left-center":{top:0+i.height/2-h/2,left:0-d-r},"right-top":{top:0,left:0+i.width+r},"right-bottom":{top:0+i.height-h,left:0+i.width+r},"right-center":{top:0+i.height/2-h/2,left:0+i.width+r}},f={};if(e=p.split("-"),f=a[p]?a[p]:a["bottom-left"],this.justified&&this.justified.length)o(s.css({left:0}),this.justified,l);else if(this.options.preventflip!==!0){var u;switch(this.checkBoundary(i.left+f.left,i.top+f.top,d,h,l)){case"x":"x"!==this.options.preventflip&&(u=n.x[p]||"right-top");break;case"y":"y"!==this.options.preventflip&&(u=n.y[p]||"top-left");break;case"xy":this.options.preventflip||(u=n.xy[p]||"right-bottom")}u&&(e=u.split("-"),f=a[u]?a[u]:a["bottom-left"],this.checkBoundary(i.left+f.left,i.top+f.top,d,h,l)&&(e=p.split("-"),f=a[p]?a[p]:a["bottom-left"]))}d>l&&(s.addClass("uk-dropdown-stack"),this.trigger("stack.uk.dropdown",[this])),s.css(f).css("display","").addClass("uk-dropdown-"+e[0])}},checkBoundary:function(o,e,i,n,r){var s="";return(0>o||o-t.$win.scrollLeft()+i>r)&&(s+="x"),(e-t.$win.scrollTop()<0||e-t.$win.scrollTop()+n>window.innerHeight)&&(s+="y"),s}}),t.component("dropdownOverlay",{defaults:{justify:!1,cls:"",duration:200},boot:function(){t.ready(function(o){t.$("[data-uk-dropdown-overlay]",o).each(function(){var o=t.$(this);o.data("dropdownOverlay")||t.dropdownOverlay(o,t.Utils.options(o.attr("data-uk-dropdown-overlay")))})})},init:function(){var e=this;this.justified=this.options.justify?t.$(this.options.justify):!1,this.overlay=this.element.find("uk-dropdown-overlay"),this.overlay.length||(this.overlay=t.$('
          ').appendTo(this.element)),this.overlay.addClass(this.options.cls),this.on({"beforeshow.uk.dropdown":function(t,i){e.dropdown=i,e.justified&&e.justified.length&&o(e.overlay.css({display:"block","margin-left":"","margin-right":""}),e.justified,e.justified.outerWidth())},"show.uk.dropdown":function(){var o=e.dropdown.dropdown.outerHeight(!0);e.dropdown.element.removeClass("uk-open"),e.overlay.stop().css("display","block").animate({height:o},e.options.duration,function(){e.dropdown.dropdown.css("visibility",""),e.dropdown.element.addClass("uk-open"),t.Utils.checkDisplay(e.dropdown.dropdown,!0)}),e.pointerleave=!1},"hide.uk.dropdown":function(){e.overlay.stop().animate({height:0},e.options.duration)},"pointerenter.uk.dropdown":function(){clearTimeout(e.remainIdle)},"pointerleave.uk.dropdown":function(){e.pointerleave=!0}}),this.overlay.on({mouseenter:function(){e.remainIdle&&(clearTimeout(e.dropdown.remainIdle),clearTimeout(e.remainIdle))},mouseleave:function(){e.pointerleave&&i&&(e.remainIdle=setTimeout(function(){i&&i.hide()},i.options.remaintime))}})}})}(UIkit); \ No newline at end of file diff --git a/js/core/grid.js b/js/core/grid.js deleted file mode 100755 index 2552f93..0000000 --- a/js/core/grid.js +++ /dev/null @@ -1,117 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - var grids = []; - - UI.component('gridMatchHeight', { - - defaults: { - "target" : false, - "row" : true, - "ignorestacked" : false, - "observe" : false - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-grid-match]", context).each(function() { - var grid = UI.$(this), obj; - - if (!grid.data("gridMatchHeight")) { - obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.columns = this.element.children(); - this.elements = this.options.target ? this.find(this.options.target) : this.columns; - - if (!this.columns.length) return; - - UI.$win.on('load resize orientationchange', (function() { - - var fn = function() { - if ($this.element.is(":visible")) $this.match(); - }; - - UI.$(function() { fn(); }); - - return UI.Utils.debounce(fn, 50); - })()); - - if (this.options.observe) { - - UI.domObserve(this.element, function(e) { - if ($this.element.is(":visible")) $this.match(); - }); - } - - this.on("display.uk.check", function(e) { - if(this.element.is(":visible")) this.match(); - }.bind(this)); - - grids.push(this); - }, - - match: function() { - - var firstvisible = this.columns.filter(":visible:first"); - - if (!firstvisible.length) return; - - var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100; - - if (stacked && !this.options.ignorestacked) { - this.revert(); - } else { - UI.Utils.matchHeights(this.elements, this.options); - } - - return this; - }, - - revert: function() { - this.elements.css('min-height', ''); - return this; - } - }); - - UI.component('gridMargin', { - - defaults: { - cls : 'uk-grid-margin', - rowfirst : 'uk-row-first' - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-grid-margin]", context).each(function() { - var grid = UI.$(this), obj; - - if (!grid.data("gridMargin")) { - obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin"))); - } - }); - }); - }, - - init: function() { - - var stackMargin = UI.stackMargin(this.element, this.options); - } - }); - -})(UIkit); diff --git a/js/core/grid.min.js b/js/core/grid.min.js deleted file mode 100755 index fe52a52..0000000 --- a/js/core/grid.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";var i=[];t.component("gridMatchHeight",{defaults:{target:!1,row:!0,ignorestacked:!1,observe:!1},boot:function(){t.ready(function(i){t.$("[data-uk-grid-match]",i).each(function(){var i,n=t.$(this);n.data("gridMatchHeight")||(i=t.gridMatchHeight(n,t.Utils.options(n.attr("data-uk-grid-match"))))})})},init:function(){var n=this;this.columns=this.element.children(),this.elements=this.options.target?this.find(this.options.target):this.columns,this.columns.length&&(t.$win.on("load resize orientationchange",function(){var i=function(){n.element.is(":visible")&&n.match()};return t.$(function(){i()}),t.Utils.debounce(i,50)}()),this.options.observe&&t.domObserve(this.element,function(){n.element.is(":visible")&&n.match()}),this.on("display.uk.check",function(){this.element.is(":visible")&&this.match()}.bind(this)),i.push(this))},match:function(){var i=this.columns.filter(":visible:first");if(i.length){var n=Math.ceil(100*parseFloat(i.css("width"))/parseFloat(i.parent().css("width")))>=100;return n&&!this.options.ignorestacked?this.revert():t.Utils.matchHeights(this.elements,this.options),this}},revert:function(){return this.elements.css("min-height",""),this}}),t.component("gridMargin",{defaults:{cls:"uk-grid-margin",rowfirst:"uk-row-first"},boot:function(){t.ready(function(i){t.$("[data-uk-grid-margin]",i).each(function(){var i,n=t.$(this);n.data("gridMargin")||(i=t.gridMargin(n,t.Utils.options(n.attr("data-uk-grid-margin"))))})})},init:function(){t.stackMargin(this.element,this.options)}})}(UIkit); \ No newline at end of file diff --git a/js/core/modal.js b/js/core/modal.js deleted file mode 100755 index 74d122d..0000000 --- a/js/core/modal.js +++ /dev/null @@ -1,393 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - var active = false, activeCount = 0, $html = UI.$html, body; - - UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){ - UI.$('.uk-modal.uk-open').each(function(){ - UI.$(this).data('modal').resize(); - }); - }, 150)); - - UI.component('modal', { - - defaults: { - keyboard: true, - bgclose: true, - minScrollHeight: 150, - center: false, - modal: true - }, - - scrollable: false, - transition: false, - hasTransitioned: true, - - init: function() { - - if (!body) body = UI.$('body'); - - if (!this.element.length) return; - - var $this = this; - - this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left"); - this.dialog = this.find(".uk-modal-dialog"); - - this.active = false; - - // Update ARIA - this.element.attr('aria-hidden', this.element.hasClass("uk-open")); - - this.on("click", ".uk-modal-close", function(e) { - e.preventDefault(); - $this.hide(); - }).on("click", function(e) { - - var target = UI.$(e.target); - - if (target[0] == $this.element[0] && $this.options.bgclose) { - $this.hide(); - } - }); - - UI.domObserve(this.element, function(e) { $this.resize(); }); - }, - - toggle: function() { - return this[this.isActive() ? "hide" : "show"](); - }, - - show: function() { - - if (!this.element.length) return; - - var $this = this; - - if (this.isActive()) return; - - if (this.options.modal && active) { - active.hide(true); - } - - this.element.removeClass("uk-open").show(); - this.resize(true); - - if (this.options.modal) { - active = this; - } - - this.active = true; - - activeCount++; - - if (UI.support.transition) { - this.hasTransitioned = false; - this.element.one(UI.support.transition.end, function(){ - $this.hasTransitioned = true; - }).addClass("uk-open"); - } else { - this.element.addClass("uk-open"); - } - - $html.addClass("uk-modal-page").height(); // force browser engine redraw - - // Update ARIA - this.element.attr('aria-hidden', 'false'); - - this.element.trigger("show.uk.modal"); - - UI.Utils.checkDisplay(this.dialog, true); - - return this; - }, - - hide: function(force) { - - if (!force && UI.support.transition && this.hasTransitioned) { - - var $this = this; - - this.one(UI.support.transition.end, function() { - $this._hide(); - }).removeClass("uk-open"); - - } else { - - this._hide(); - } - - return this; - }, - - resize: function(force) { - - if (!this.isActive() && !force) return; - - var bodywidth = body.width(); - - this.scrollbarwidth = window.innerWidth - bodywidth; - - body.css(this.paddingdir, this.scrollbarwidth); - - this.element.css('overflow-y', this.scrollbarwidth ? 'scroll' : 'auto'); - - if (!this.updateScrollable() && this.options.center) { - - var dh = this.dialog.outerHeight(), - pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10); - - if ((dh + pad) < window.innerHeight) { - this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad }); - } else { - this.dialog.css({'top': ''}); - } - } - }, - - updateScrollable: function() { - - // has scrollable? - var scrollable = this.dialog.find('.uk-overflow-container:visible:first'); - - if (scrollable.length) { - - scrollable.css('height', 0); - - var offset = Math.abs(parseInt(this.dialog.css('margin-top'), 10)), - dh = this.dialog.outerHeight(), - wh = window.innerHeight, - h = wh - 2*(offset < 20 ? 20:offset) - dh; - - scrollable.css({ - 'max-height': (h < this.options.minScrollHeight ? '':h), - 'height':'' - }); - - return true; - } - - return false; - }, - - _hide: function() { - - this.active = false; - if (activeCount > 0) activeCount--; - else activeCount = 0; - - this.element.hide().removeClass('uk-open'); - - // Update ARIA - this.element.attr('aria-hidden', 'true'); - - if (!activeCount) { - $html.removeClass('uk-modal-page'); - body.css(this.paddingdir, ""); - } - - if (active===this) active = false; - - this.trigger('hide.uk.modal'); - }, - - isActive: function() { - return this.element.hasClass('uk-open'); - } - - }); - - UI.component('modalTrigger', { - - boot: function() { - - // init code - UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) { - - var ele = UI.$(this); - - if (ele.is("a")) { - e.preventDefault(); - } - - if (!ele.data("modalTrigger")) { - var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal"))); - modal.show(); - } - - }); - - // close modal on esc button - UI.$html.on('keydown.modal.uikit', function (e) { - - if (active && e.keyCode === 27 && active.options.keyboard) { // ESC - e.preventDefault(); - active.hide(); - } - }); - }, - - init: function() { - - var $this = this; - - this.options = UI.$.extend({ - "target": $this.element.is("a") ? $this.element.attr("href") : false - }, this.options); - - this.modal = UI.modal(this.options.target, this.options); - - this.on("click", function(e) { - e.preventDefault(); - $this.show(); - }); - - //methods - this.proxy(this.modal, "show hide isActive"); - } - }); - - UI.modal.dialog = function(content, options) { - - var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options); - - modal.on("hide.uk.modal", function(){ - if (modal.persist) { - modal.persist.appendTo(modal.persist.data("modalPersistParent")); - modal.persist = false; - } - modal.element.remove(); - }); - - setContent(content, modal); - - return modal; - }; - - UI.modal.dialog.template = '
          '; - - UI.modal.alert = function(content, options) { - - options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options); - - var modal = UI.modal.dialog(([ - '
          '+String(content)+'
          ', - '' - ]).join(""), options); - - modal.on('show.uk.modal', function(){ - setTimeout(function(){ - modal.element.find('button:first').focus(); - }, 50); - }); - - return modal.show(); - }; - - UI.modal.confirm = function(content, onconfirm, oncancel) { - - var options = arguments.length > 1 && arguments[arguments.length-1] ? arguments[arguments.length-1] : {}; - - onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){}; - oncancel = UI.$.isFunction(oncancel) ? oncancel : function(){}; - options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, UI.$.isFunction(options) ? {}:options); - - var modal = UI.modal.dialog(([ - '
          '+String(content)+'
          ', - '' - ]).join(""), options); - - modal.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click", function(){ - UI.$(this).is('.js-modal-confirm') ? onconfirm() : oncancel(); - modal.hide(); - }); - - modal.on('show.uk.modal', function(){ - setTimeout(function(){ - modal.element.find('.js-modal-confirm').focus(); - }, 50); - }); - - return modal.show(); - }; - - UI.modal.prompt = function(text, value, onsubmit, options) { - - onsubmit = UI.$.isFunction(onsubmit) ? onsubmit : function(value){}; - options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options); - - var modal = UI.modal.dialog(([ - text ? '
          '+String(text)+'
          ':'', - '

          ', - '' - ]).join(""), options), - - input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){ - if (e.keyCode == 13) { - modal.element.find(".js-modal-ok").trigger('click'); - } - }); - - modal.element.find(".js-modal-ok").on("click", function(){ - if (onsubmit(input.val())!==false){ - modal.hide(); - } - }); - - modal.on('show.uk.modal', function(){ - setTimeout(function(){ - input.focus(); - }, 50); - }); - - return modal.show(); - }; - - UI.modal.blockUI = function(content, options) { - - var modal = UI.modal.dialog(([ - '
          '+String(content || '
          ...
          ')+'
          ' - ]).join(""), UI.$.extend({bgclose:false, keyboard:false, modal:false}, options)); - - modal.content = modal.element.find('.uk-modal-content:first'); - - return modal.show(); - }; - - - UI.modal.labels = { - 'Ok': 'Ok', - 'Cancel': 'Cancel' - }; - - - // helper functions - function setContent(content, modal){ - - if(!modal) return; - - if (typeof content === 'object') { - - // convert DOM object to a jQuery object - content = content instanceof jQuery ? content : UI.$(content); - - if(content.parent().length) { - modal.persist = content; - modal.persist.data("modalPersistParent", content.parent()); - } - }else if (typeof content === 'string' || typeof content === 'number') { - // just insert the data as innerHTML - content = UI.$('
          ').html(content); - }else { - // unsupported data type! - content = UI.$('
          ').html('UIkit.modal Error: Unsupported data type: ' + typeof content); - } - - content.appendTo(modal.element.find('.uk-modal-dialog')); - - return modal; - } - -})(UIkit); diff --git a/js/core/modal.min.js b/js/core/modal.min.js deleted file mode 100755 index 6dc903a..0000000 --- a/js/core/modal.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";function i(i,e){return e?("object"==typeof i?(i=i instanceof jQuery?i:t.$(i),i.parent().length&&(e.persist=i,e.persist.data("modalPersistParent",i.parent()))):i="string"==typeof i||"number"==typeof i?t.$("
          ").html(i):t.$("
          ").html("UIkit.modal Error: Unsupported data type: "+typeof i),i.appendTo(e.element.find(".uk-modal-dialog")),e):void 0}var e,o=!1,n=0,s=t.$html;t.$win.on("resize orientationchange",t.Utils.debounce(function(){t.$(".uk-modal.uk-open").each(function(){t.$(this).data("modal").resize()})},150)),t.component("modal",{defaults:{keyboard:!0,bgclose:!0,minScrollHeight:150,center:!1,modal:!0},scrollable:!1,transition:!1,hasTransitioned:!0,init:function(){if(e||(e=t.$("body")),this.element.length){var i=this;this.paddingdir="padding-"+("left"==t.langdirection?"right":"left"),this.dialog=this.find(".uk-modal-dialog"),this.active=!1,this.element.attr("aria-hidden",this.element.hasClass("uk-open")),this.on("click",".uk-modal-close",function(t){t.preventDefault(),i.hide()}).on("click",function(e){var o=t.$(e.target);o[0]==i.element[0]&&i.options.bgclose&&i.hide()}),t.domObserve(this.element,function(){i.resize()})}},toggle:function(){return this[this.isActive()?"hide":"show"]()},show:function(){if(this.element.length){var i=this;if(!this.isActive())return this.options.modal&&o&&o.hide(!0),this.element.removeClass("uk-open").show(),this.resize(!0),this.options.modal&&(o=this),this.active=!0,n++,t.support.transition?(this.hasTransitioned=!1,this.element.one(t.support.transition.end,function(){i.hasTransitioned=!0}).addClass("uk-open")):this.element.addClass("uk-open"),s.addClass("uk-modal-page").height(),this.element.attr("aria-hidden","false"),this.element.trigger("show.uk.modal"),t.Utils.checkDisplay(this.dialog,!0),this}},hide:function(i){if(!i&&t.support.transition&&this.hasTransitioned){var e=this;this.one(t.support.transition.end,function(){e._hide()}).removeClass("uk-open")}else this._hide();return this},resize:function(t){if(this.isActive()||t){var i=e.width();if(this.scrollbarwidth=window.innerWidth-i,e.css(this.paddingdir,this.scrollbarwidth),this.element.css("overflow-y",this.scrollbarwidth?"scroll":"auto"),!this.updateScrollable()&&this.options.center){var o=this.dialog.outerHeight(),n=parseInt(this.dialog.css("margin-top"),10)+parseInt(this.dialog.css("margin-bottom"),10);o+ni?20:i)-e;return t.css({"max-height":n0?n--:n=0,this.element.hide().removeClass("uk-open"),this.element.attr("aria-hidden","true"),n||(s.removeClass("uk-modal-page"),e.css(this.paddingdir,"")),o===this&&(o=!1),this.trigger("hide.uk.modal")},isActive:function(){return this.element.hasClass("uk-open")}}),t.component("modalTrigger",{boot:function(){t.$html.on("click.modal.uikit","[data-uk-modal]",function(i){var e=t.$(this);if(e.is("a")&&i.preventDefault(),!e.data("modalTrigger")){var o=t.modalTrigger(e,t.Utils.options(e.attr("data-uk-modal")));o.show()}}),t.$html.on("keydown.modal.uikit",function(t){o&&27===t.keyCode&&o.options.keyboard&&(t.preventDefault(),o.hide())})},init:function(){var i=this;this.options=t.$.extend({target:i.element.is("a")?i.element.attr("href"):!1},this.options),this.modal=t.modal(this.options.target,this.options),this.on("click",function(t){t.preventDefault(),i.show()}),this.proxy(this.modal,"show hide isActive")}}),t.modal.dialog=function(e,o){var n=t.modal(t.$(t.modal.dialog.template).appendTo("body"),o);return n.on("hide.uk.modal",function(){n.persist&&(n.persist.appendTo(n.persist.data("modalPersistParent")),n.persist=!1),n.element.remove()}),i(e,n),n},t.modal.dialog.template='
          ',t.modal.alert=function(i,e){e=t.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:t.modal.labels},e);var o=t.modal.dialog(['
          '+String(i)+"
          ",'"].join(""),e);return o.on("show.uk.modal",function(){setTimeout(function(){o.element.find("button:first").focus()},50)}),o.show()},t.modal.confirm=function(i,e,o){var n=arguments.length>1&&arguments[arguments.length-1]?arguments[arguments.length-1]:{};e=t.$.isFunction(e)?e:function(){},o=t.$.isFunction(o)?o:function(){},n=t.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:t.modal.labels},t.$.isFunction(n)?{}:n);var s=t.modal.dialog(['
          '+String(i)+"
          ",'"].join(""),n);return s.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click",function(){t.$(this).is(".js-modal-confirm")?e():o(),s.hide()}),s.on("show.uk.modal",function(){setTimeout(function(){s.element.find(".js-modal-confirm").focus()},50)}),s.show()},t.modal.prompt=function(i,e,o,n){o=t.$.isFunction(o)?o:function(){},n=t.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:t.modal.labels},n);var s=t.modal.dialog([i?'
          '+String(i)+"
          ":"",'

          ','"].join(""),n),a=s.element.find("input[type='text']").val(e||"").on("keyup",function(t){13==t.keyCode&&s.element.find(".js-modal-ok").trigger("click")});return s.element.find(".js-modal-ok").on("click",function(){o(a.val())!==!1&&s.hide()}),s.on("show.uk.modal",function(){setTimeout(function(){a.focus()},50)}),s.show()},t.modal.blockUI=function(i,e){var o=t.modal.dialog(['
          '+String(i||'
          ...
          ')+"
          "].join(""),t.$.extend({bgclose:!1,keyboard:!1,modal:!1},e));return o.content=o.element.find(".uk-modal-content:first"),o.show()},t.modal.labels={Ok:"Ok",Cancel:"Cancel"}}(UIkit); \ No newline at end of file diff --git a/js/core/nav.js b/js/core/nav.js deleted file mode 100755 index a6157ab..0000000 --- a/js/core/nav.js +++ /dev/null @@ -1,136 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - UI.component('nav', { - - defaults: { - "toggle": ">li.uk-parent > a[href='#']", - "lists": ">li.uk-parent > ul", - "multiple": false - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-nav]", context).each(function() { - var nav = UI.$(this); - - if (!nav.data("nav")) { - var obj = UI.nav(nav, UI.Utils.options(nav.attr("data-uk-nav"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.on("click.uk.nav", this.options.toggle, function(e) { - e.preventDefault(); - var ele = UI.$(this); - $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li")); - }); - - this.find(this.options.lists).each(function() { - var $ele = UI.$(this), - parent = $ele.parent(), - active = parent.hasClass("uk-active"); - - $ele.wrap('
          '); - parent.data("list-container", $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden')); - - // Init ARIA - parent.attr('aria-expanded', parent.hasClass("uk-open")); - - if (active) $this.open(parent, true); - }); - - }, - - open: function(li, noanimation) { - - var $this = this, element = this.element, $li = UI.$(li), $container = $li.data('list-container'); - - if (!this.options.multiple) { - - element.children('.uk-open').not(li).each(function() { - - var ele = UI.$(this); - - if (ele.data('list-container')) { - ele.data('list-container').stop().animate({height: 0}, function() { - UI.$(this).parent().removeClass('uk-open').end().addClass('uk-hidden'); - }); - } - }); - } - - $li.toggleClass('uk-open'); - - // Update ARIA - $li.attr('aria-expanded', $li.hasClass('uk-open')); - - if ($container) { - - if ($li.hasClass('uk-open')) { - $container.removeClass('uk-hidden'); - } - - if (noanimation) { - - $container.stop().height($li.hasClass('uk-open') ? 'auto' : 0); - - if (!$li.hasClass('uk-open')) { - $container.addClass('uk-hidden'); - } - - this.trigger('display.uk.check'); - - } else { - - $container.stop().animate({ - height: ($li.hasClass('uk-open') ? getHeight($container.find('ul:first')) : 0) - }, function() { - - if (!$li.hasClass('uk-open')) { - $container.addClass('uk-hidden'); - } else { - $container.css('height', ''); - } - - $this.trigger('display.uk.check'); - }); - } - } - } - }); - - - // helper - - function getHeight(ele) { - var $ele = UI.$(ele), height = "auto"; - - if ($ele.is(":visible")) { - height = $ele.outerHeight(); - } else { - var tmp = { - position: $ele.css("position"), - visibility: $ele.css("visibility"), - display: $ele.css("display") - }; - - height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); - - $ele.css(tmp); // reset element - } - - return height; - } - -})(UIkit); diff --git a/js/core/nav.min.js b/js/core/nav.min.js deleted file mode 100755 index 3ee579c..0000000 --- a/js/core/nav.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(i){"use strict";function t(t){var s=i.$(t),a="auto";if(s.is(":visible"))a=s.outerHeight();else{var e={position:s.css("position"),visibility:s.css("visibility"),display:s.css("display")};a=s.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),s.css(e)}return a}i.component("nav",{defaults:{toggle:">li.uk-parent > a[href='#']",lists:">li.uk-parent > ul",multiple:!1},boot:function(){i.ready(function(t){i.$("[data-uk-nav]",t).each(function(){var t=i.$(this);if(!t.data("nav")){i.nav(t,i.Utils.options(t.attr("data-uk-nav")))}})})},init:function(){var t=this;this.on("click.uk.nav",this.options.toggle,function(s){s.preventDefault();var a=i.$(this);t.open(a.parent()[0]==t.element[0]?a:a.parent("li"))}),this.find(this.options.lists).each(function(){var s=i.$(this),a=s.parent(),e=a.hasClass("uk-active");s.wrap('
          '),a.data("list-container",s.parent()[e?"removeClass":"addClass"]("uk-hidden")),a.attr("aria-expanded",a.hasClass("uk-open")),e&&t.open(a,!0)})},open:function(s,a){var e=this,n=this.element,o=i.$(s),l=o.data("list-container");this.options.multiple||n.children(".uk-open").not(s).each(function(){var t=i.$(this);t.data("list-container")&&t.data("list-container").stop().animate({height:0},function(){i.$(this).parent().removeClass("uk-open").end().addClass("uk-hidden")})}),o.toggleClass("uk-open"),o.attr("aria-expanded",o.hasClass("uk-open")),l&&(o.hasClass("uk-open")&&l.removeClass("uk-hidden"),a?(l.stop().height(o.hasClass("uk-open")?"auto":0),o.hasClass("uk-open")||l.addClass("uk-hidden"),this.trigger("display.uk.check")):l.stop().animate({height:o.hasClass("uk-open")?t(l.find("ul:first")):0},function(){o.hasClass("uk-open")?l.css("height",""):l.addClass("uk-hidden"),e.trigger("display.uk.check")}))}})}(UIkit); \ No newline at end of file diff --git a/js/core/offcanvas.js b/js/core/offcanvas.js deleted file mode 100755 index 9b2c289..0000000 --- a/js/core/offcanvas.js +++ /dev/null @@ -1,180 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - var scrollpos = {x: window.scrollX, y: window.scrollY}, - $win = UI.$win, - $doc = UI.$doc, - $html = UI.$html, - Offcanvas = { - - show: function(element) { - - element = UI.$(element); - - if (!element.length) return; - - var $body = UI.$('body'), - bar = element.find(".uk-offcanvas-bar:first"), - rtl = (UI.langdirection == "right"), - flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1, - dir = flip * (rtl ? -1 : 1), - - scrollbarwidth = window.innerWidth - $body.width(); - - scrollpos = {x: window.pageXOffset, y: window.pageYOffset}; - - element.addClass("uk-active"); - - $body.css({"width": window.innerWidth - scrollbarwidth, "height": window.innerHeight}).addClass("uk-offcanvas-page"); - $body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw - - $html.css('margin-top', scrollpos.y * -1); - - bar.addClass("uk-offcanvas-bar-show"); - - this._initElement(element); - - bar.trigger('show.uk.offcanvas', [element, bar]); - - // Update ARIA - element.attr('aria-hidden', 'false'); - }, - - hide: function(force) { - - var $body = UI.$('body'), - panel = UI.$(".uk-offcanvas.uk-active"), - rtl = (UI.langdirection == "right"), - bar = panel.find(".uk-offcanvas-bar:first"), - finalize = function() { - $body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""}); - panel.removeClass("uk-active"); - - bar.removeClass("uk-offcanvas-bar-show"); - $html.css('margin-top', ''); - window.scrollTo(scrollpos.x, scrollpos.y); - bar.trigger('hide.uk.offcanvas', [panel, bar]); - - // Update ARIA - panel.attr('aria-hidden', 'true'); - }; - - if (!panel.length) return; - - if (UI.support.transition && !force) { - - $body.one(UI.support.transition.end, function() { - finalize(); - }).css((rtl ? "margin-right" : "margin-left"), ""); - - setTimeout(function(){ - bar.removeClass("uk-offcanvas-bar-show"); - }, 0); - - } else { - finalize(); - } - }, - - _initElement: function(element) { - - if (element.data("OffcanvasInit")) return; - - element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas", function(e) { - - var target = UI.$(e.target); - - if (!e.type.match(/swipe/)) { - - if (!target.hasClass("uk-offcanvas-close")) { - if (target.hasClass("uk-offcanvas-bar")) return; - if (target.parents(".uk-offcanvas-bar:first").length) return; - } - } - - e.stopImmediatePropagation(); - Offcanvas.hide(); - }); - - element.on("click", "a[href*='#']", function(e){ - - var link = UI.$(this), - href = link.attr("href"); - - if (href == "#") { - return; - } - - UI.$doc.one('hide.uk.offcanvas', function() { - - var target; - - try { - target = UI.$(link[0].hash); - } catch (e){ - target = ''; - } - - if (!target.length) { - target = UI.$('[name="'+link[0].hash.replace('#','')+'"]'); - } - - if (target.length && UI.Utils.scrollToElement) { - UI.Utils.scrollToElement(target, UI.Utils.options(link.attr('data-uk-smooth-scroll') || '{}')); - } else { - window.location.href = href; - } - }); - - Offcanvas.hide(); - }); - - element.data("OffcanvasInit", true); - } - }; - - UI.component('offcanvasTrigger', { - - boot: function() { - - // init code - $html.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) { - - e.preventDefault(); - - var ele = UI.$(this); - - if (!ele.data("offcanvasTrigger")) { - var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-uk-offcanvas"))); - ele.trigger("click"); - } - }); - - $html.on('keydown.uk.offcanvas', function(e) { - - if (e.keyCode === 27) { // ESC - Offcanvas.hide(); - } - }); - }, - - init: function() { - - var $this = this; - - this.options = UI.$.extend({ - "target": $this.element.is("a") ? $this.element.attr("href") : false - }, this.options); - - this.on("click", function(e) { - e.preventDefault(); - Offcanvas.show($this.options.target); - }); - } - }); - - UI.offcanvas = Offcanvas; - -})(UIkit); diff --git a/js/core/offcanvas.min.js b/js/core/offcanvas.min.js deleted file mode 100755 index faa3887..0000000 --- a/js/core/offcanvas.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(a){"use strict";var t={x:window.scrollX,y:window.scrollY},n=(a.$win,a.$doc,a.$html),i={show:function(i){if(i=a.$(i),i.length){var o=a.$("body"),s=i.find(".uk-offcanvas-bar:first"),e="right"==a.langdirection,f=s.hasClass("uk-offcanvas-bar-flip")?-1:1,r=f*(e?-1:1),c=window.innerWidth-o.width();t={x:window.pageXOffset,y:window.pageYOffset},i.addClass("uk-active"),o.css({width:window.innerWidth-c,height:window.innerHeight}).addClass("uk-offcanvas-page"),o.css(e?"margin-right":"margin-left",(e?-1:1)*s.outerWidth()*r).width(),n.css("margin-top",-1*t.y),s.addClass("uk-offcanvas-bar-show"),this._initElement(i),s.trigger("show.uk.offcanvas",[i,s]),i.attr("aria-hidden","false")}},hide:function(i){var o=a.$("body"),s=a.$(".uk-offcanvas.uk-active"),e="right"==a.langdirection,f=s.find(".uk-offcanvas-bar:first"),r=function(){o.removeClass("uk-offcanvas-page").css({width:"",height:"","margin-left":"","margin-right":""}),s.removeClass("uk-active"),f.removeClass("uk-offcanvas-bar-show"),n.css("margin-top",""),window.scrollTo(t.x,t.y),f.trigger("hide.uk.offcanvas",[s,f]),s.attr("aria-hidden","true")};s.length&&(a.support.transition&&!i?(o.one(a.support.transition.end,function(){r()}).css(e?"margin-right":"margin-left",""),setTimeout(function(){f.removeClass("uk-offcanvas-bar-show")},0)):r())},_initElement:function(t){t.data("OffcanvasInit")||(t.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas",function(t){var n=a.$(t.target);if(!t.type.match(/swipe/)&&!n.hasClass("uk-offcanvas-close")){if(n.hasClass("uk-offcanvas-bar"))return;if(n.parents(".uk-offcanvas-bar:first").length)return}t.stopImmediatePropagation(),i.hide()}),t.on("click","a[href*='#']",function(){var t=a.$(this),n=t.attr("href");"#"!=n&&(a.$doc.one("hide.uk.offcanvas",function(){var i;try{i=a.$(t[0].hash)}catch(o){i=""}i.length||(i=a.$('[name="'+t[0].hash.replace("#","")+'"]')),i.length&&a.Utils.scrollToElement?a.Utils.scrollToElement(i,a.Utils.options(t.attr("data-uk-smooth-scroll")||"{}")):window.location.href=n}),i.hide())}),t.data("OffcanvasInit",!0))}};a.component("offcanvasTrigger",{boot:function(){n.on("click.offcanvas.uikit","[data-uk-offcanvas]",function(t){t.preventDefault();var n=a.$(this);if(!n.data("offcanvasTrigger")){{a.offcanvasTrigger(n,a.Utils.options(n.attr("data-uk-offcanvas")))}n.trigger("click")}}),n.on("keydown.uk.offcanvas",function(a){27===a.keyCode&&i.hide()})},init:function(){var t=this;this.options=a.$.extend({target:t.element.is("a")?t.element.attr("href"):!1},this.options),this.on("click",function(a){a.preventDefault(),i.show(t.options.target)})}}),a.offcanvas=i}(UIkit); \ No newline at end of file diff --git a/js/core/scrollspy.js b/js/core/scrollspy.js deleted file mode 100755 index a67e2c8..0000000 --- a/js/core/scrollspy.js +++ /dev/null @@ -1,209 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - var $win = UI.$win, - $doc = UI.$doc, - scrollspies = [], - checkScrollSpy = function() { - for(var i=0; i < scrollspies.length; i++) { - window.requestAnimationFrame.apply(window, [scrollspies[i].check]); - } - }; - - UI.component('scrollspy', { - - defaults: { - "target" : false, - "cls" : "uk-scrollspy-inview", - "initcls" : "uk-scrollspy-init-inview", - "topoffset" : 0, - "leftoffset" : 0, - "repeat" : false, - "delay" : 0 - }, - - boot: function() { - - // listen to scroll and resize - $doc.on("scrolling.uk.document", checkScrollSpy); - $win.on("load resize orientationchange", UI.Utils.debounce(checkScrollSpy, 50)); - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-scrollspy]", context).each(function() { - - var element = UI.$(this); - - if (!element.data("scrollspy")) { - var obj = UI.scrollspy(element, UI.Utils.options(element.attr("data-uk-scrollspy"))); - } - }); - }); - }, - - init: function() { - - var $this = this, inviewstate, initinview, togglecls = this.options.cls.split(/,/), fn = function(){ - - var elements = $this.options.target ? $this.element.find($this.options.target) : $this.element, - delayIdx = elements.length === 1 ? 1 : 0, - toggleclsIdx = 0; - - elements.each(function(idx){ - - var element = UI.$(this), - inviewstate = element.data('inviewstate'), - inview = UI.Utils.isInView(element, $this.options), - toggle = element.data('ukScrollspyCls') || togglecls[toggleclsIdx].trim(); - - if (inview && !inviewstate && !element.data('scrollspy-idle')) { - - if (!initinview) { - element.addClass($this.options.initcls); - $this.offset = element.offset(); - initinview = true; - - element.trigger("init.uk.scrollspy"); - } - - element.data('scrollspy-idle', setTimeout(function(){ - - element.addClass("uk-scrollspy-inview").toggleClass(toggle).width(); - element.trigger("inview.uk.scrollspy"); - - element.data('scrollspy-idle', false); - element.data('inviewstate', true); - - }, $this.options.delay * delayIdx)); - - delayIdx++; - } - - if (!inview && inviewstate && $this.options.repeat) { - - if (element.data('scrollspy-idle')) { - clearTimeout(element.data('scrollspy-idle')); - element.data('scrollspy-idle', false); - } - - element.removeClass("uk-scrollspy-inview").toggleClass(toggle); - element.data('inviewstate', false); - - element.trigger("outview.uk.scrollspy"); - } - - toggleclsIdx = togglecls[toggleclsIdx + 1] ? (toggleclsIdx + 1) : 0; - - }); - }; - - fn(); - - this.check = fn; - - scrollspies.push(this); - } - }); - - - var scrollspynavs = [], - checkScrollSpyNavs = function() { - for(var i=0; i < scrollspynavs.length; i++) { - window.requestAnimationFrame.apply(window, [scrollspynavs[i].check]); - } - }; - - UI.component('scrollspynav', { - - defaults: { - "cls" : 'uk-active', - "closest" : false, - "topoffset" : 0, - "leftoffset" : 0, - "smoothscroll" : false - }, - - boot: function() { - - // listen to scroll and resize - $doc.on("scrolling.uk.document", checkScrollSpyNavs); - $win.on("resize orientationchange", UI.Utils.debounce(checkScrollSpyNavs, 50)); - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-scrollspy-nav]", context).each(function() { - - var element = UI.$(this); - - if (!element.data("scrollspynav")) { - var obj = UI.scrollspynav(element, UI.Utils.options(element.attr("data-uk-scrollspy-nav"))); - } - }); - }); - }, - - init: function() { - - var ids = [], - links = this.find("a[href^='#']").each(function(){ if(this.getAttribute("href").trim()!=='#') ids.push(this.getAttribute("href")); }), - targets = UI.$(ids.join(",")), - - clsActive = this.options.cls, - clsClosest = this.options.closest || this.options.closest; - - var $this = this, inviews, fn = function(){ - - inviews = []; - - for (var i=0 ; i < targets.length ; i++) { - if (UI.Utils.isInView(targets.eq(i), $this.options)) { - inviews.push(targets.eq(i)); - } - } - - if (inviews.length) { - - var navitems, - scrollTop = $win.scrollTop(), - target = (function(){ - for(var i=0; i< inviews.length;i++){ - if (inviews[i].offset().top - $this.options.topoffset >= scrollTop){ - return inviews[i]; - } - } - })(); - - if (!target) return; - - if ($this.options.closest) { - links.blur().closest(clsClosest).removeClass(clsActive); - navitems = links.filter("a[href='#"+target.attr("id")+"']").closest(clsClosest).addClass(clsActive); - } else { - navitems = links.removeClass(clsActive).filter("a[href='#"+target.attr("id")+"']").addClass(clsActive); - } - - $this.element.trigger("inview.uk.scrollspynav", [target, navitems]); - } - }; - - if (this.options.smoothscroll && UI.smoothScroll) { - links.each(function(){ - UI.smoothScroll(this, $this.options.smoothscroll); - }); - } - - fn(); - - this.element.data("scrollspynav", this); - - this.check = fn; - scrollspynavs.push(this); - - } - }); - -})(UIkit); diff --git a/js/core/scrollspy.min.js b/js/core/scrollspy.min.js deleted file mode 100755 index 74d651b..0000000 --- a/js/core/scrollspy.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";var s=t.$win,o=t.$doc,i=[],e=function(){for(var t=0;t=p)return o[t]}();if(!f)return;c.options.closest?(e.blur().closest(r).removeClass(a),l=e.filter("a[href='#"+f.attr("id")+"']").closest(r).addClass(a)):l=e.removeClass(a).filter("a[href='#"+f.attr("id")+"']").addClass(a),c.element.trigger("inview.uk.scrollspynav",[f,l])}};this.options.smoothscroll&&t.smoothScroll&&e.each(function(){t.smoothScroll(this,c.options.smoothscroll)}),p(),this.element.data("scrollspynav",this),this.check=p,l.push(this)}})}(UIkit); \ No newline at end of file diff --git a/js/core/smooth-scroll.js b/js/core/smooth-scroll.js deleted file mode 100755 index 789e426..0000000 --- a/js/core/smooth-scroll.js +++ /dev/null @@ -1,62 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - UI.component('smoothScroll', { - - boot: function() { - - // init code - UI.$html.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) { - var ele = UI.$(this); - - if (!ele.data("smoothScroll")) { - var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr("data-uk-smooth-scroll"))); - ele.trigger("click"); - } - - return false; - }); - }, - - init: function() { - - var $this = this; - - this.on("click", function(e) { - e.preventDefault(); - scrollToElement(UI.$(this.hash).length ? UI.$(this.hash) : UI.$("body"), $this.options); - }); - } - }); - - function scrollToElement(ele, options) { - - options = UI.$.extend({ - duration: 1000, - transition: 'easeOutExpo', - offset: 0, - complete: function(){} - }, options); - - // get / set parameters - var target = ele.offset().top - options.offset, - docheight = UI.$doc.height(), - winheight = window.innerHeight; - - if ((target + winheight) > docheight) { - target = docheight - winheight; - } - - // animate to target, fire callback when done - UI.$("html,body").stop().animate({scrollTop: target}, options.duration, options.transition).promise().done(options.complete); - } - - UI.Utils.scrollToElement = scrollToElement; - - if (!UI.$.easing.easeOutExpo) { - UI.$.easing.easeOutExpo = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }; - } - -})(UIkit); diff --git a/js/core/smooth-scroll.min.js b/js/core/smooth-scroll.min.js deleted file mode 100755 index 5968d4e..0000000 --- a/js/core/smooth-scroll.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";function o(o,i){i=t.$.extend({duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},i);var n=o.offset().top-i.offset,s=t.$doc.height(),e=window.innerHeight;n+e>s&&(n=s-e),t.$("html,body").stop().animate({scrollTop:n},i.duration,i.transition).promise().done(i.complete)}t.component("smoothScroll",{boot:function(){t.$html.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(){var o=t.$(this);if(!o.data("smoothScroll")){{t.smoothScroll(o,t.Utils.options(o.attr("data-uk-smooth-scroll")))}o.trigger("click")}return!1})},init:function(){var i=this;this.on("click",function(n){n.preventDefault(),o(t.$(this.hash).length?t.$(this.hash):t.$("body"),i.options)})}}),t.Utils.scrollToElement=o,t.$.easing.easeOutExpo||(t.$.easing.easeOutExpo=function(t,o,i,n,s){return o==s?i+n:n*(-Math.pow(2,-10*o/s)+1)+i})}(UIkit); \ No newline at end of file diff --git a/js/core/switcher.js b/js/core/switcher.js deleted file mode 100755 index 793eb3c..0000000 --- a/js/core/switcher.js +++ /dev/null @@ -1,307 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - var Animations; - - UI.component('switcher', { - - defaults: { - connect : false, - toggle : ">*", - active : 0, - animation : false, - duration : 200, - swiping : true - }, - - animating: false, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-switcher]", context).each(function() { - var switcher = UI.$(this); - - if (!switcher.data("switcher")) { - var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr("data-uk-switcher"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.on("click.uk.switcher", this.options.toggle, function(e) { - e.preventDefault(); - $this.show(this); - }); - - if (this.options.connect) { - - this.connect = UI.$(this.options.connect); - - this.connect.children().removeClass("uk-active"); - - // delegate switch commands within container content - if (this.connect.length) { - - // Init ARIA for connect - this.connect.children().attr('aria-hidden', 'true'); - - this.connect.on("click", '[data-uk-switcher-item]', function(e) { - - e.preventDefault(); - - var item = UI.$(this).attr('data-uk-switcher-item'); - - if ($this.index == item) return; - - switch(item) { - case 'next': - case 'previous': - $this.show($this.index + (item=='next' ? 1:-1)); - break; - default: - $this.show(parseInt(item, 10)); - } - }); - - if (this.options.swiping) { - - this.connect.on('swipeRight swipeLeft', function(e) { - e.preventDefault(); - if(!window.getSelection().toString()) { - $this.show($this.index + (e.type == 'swipeLeft' ? 1 : -1)); - } - }); - } - } - - var toggles = this.find(this.options.toggle), - active = toggles.filter(".uk-active"); - - if (active.length) { - this.show(active, false); - } else { - - if (this.options.active===false) return; - - active = toggles.eq(this.options.active); - this.show(active.length ? active : toggles.eq(0), false); - } - - // Init ARIA for toggles - toggles.not(active).attr('aria-expanded', 'false'); - active.attr('aria-expanded', 'true'); - } - - }, - - show: function(tab, animate) { - - if (this.animating) { - return; - } - - if (isNaN(tab)) { - tab = UI.$(tab); - } else { - - var toggles = this.find(this.options.toggle); - - tab = tab < 0 ? toggles.length-1 : tab; - tab = toggles.eq(toggles[tab] ? tab : 0); - } - - var $this = this, - toggles = this.find(this.options.toggle), - active = UI.$(tab), - animation = Animations[this.options.animation] || function(current, next) { - - if (!$this.options.animation) { - return Animations.none.apply($this); - } - - var anim = $this.options.animation.split(','); - - if (anim.length == 1) { - anim[1] = anim[0]; - } - - anim[0] = anim[0].trim(); - anim[1] = anim[1].trim(); - - return coreAnimation.apply($this, [anim, current, next]); - }; - - if (animate===false || !UI.support.animation) { - animation = Animations.none; - } - - if (active.hasClass("uk-disabled")) return; - - // Update ARIA for Toggles - toggles.attr('aria-expanded', 'false'); - active.attr('aria-expanded', 'true'); - - toggles.filter(".uk-active").removeClass("uk-active"); - active.addClass("uk-active"); - - if (this.options.connect && this.connect.length) { - - this.index = this.find(this.options.toggle).index(active); - - if (this.index == -1 ) { - this.index = 0; - } - - this.connect.each(function() { - - var container = UI.$(this), - children = UI.$(container.children()), - current = UI.$(children.filter('.uk-active')), - next = UI.$(children.eq($this.index)); - - $this.animating = true; - - animation.apply($this, [current, next]).then(function(){ - - current.removeClass("uk-active"); - next.addClass("uk-active"); - - // Update ARIA for connect - current.attr('aria-hidden', 'true'); - next.attr('aria-hidden', 'false'); - - UI.Utils.checkDisplay(next, true); - - $this.animating = false; - - }); - }); - } - - this.trigger("show.uk.switcher", [active]); - } - }); - - Animations = { - - 'none': function() { - var d = UI.$.Deferred(); - d.resolve(); - return d.promise(); - }, - - 'fade': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-fade', current, next]); - }, - - 'slide-bottom': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-bottom', current, next]); - }, - - 'slide-top': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-top', current, next]); - }, - - 'slide-vertical': function(current, next, dir) { - - var anim = ['uk-animation-slide-top', 'uk-animation-slide-bottom']; - - if (current && current.index() > next.index()) { - anim.reverse(); - } - - return coreAnimation.apply(this, [anim, current, next]); - }, - - 'slide-left': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-left', current, next]); - }, - - 'slide-right': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-right', current, next]); - }, - - 'slide-horizontal': function(current, next, dir) { - - var anim = ['uk-animation-slide-right', 'uk-animation-slide-left']; - - if (current && current.index() > next.index()) { - anim.reverse(); - } - - return coreAnimation.apply(this, [anim, current, next]); - }, - - 'scale': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-scale-up', current, next]); - } - }; - - UI.switcher.animations = Animations; - - - // helpers - - function coreAnimation(cls, current, next) { - - var d = UI.$.Deferred(), clsIn = cls, clsOut = cls, release; - - if (next[0]===current[0]) { - d.resolve(); - return d.promise(); - } - - if (typeof(cls) == 'object') { - clsIn = cls[0]; - clsOut = cls[1] || cls[0]; - } - - UI.$body.css('overflow-x', 'hidden'); // fix scroll jumping in iOS - - release = function() { - - if (current) current.hide().removeClass('uk-active '+clsOut+' uk-animation-reverse'); - - next.addClass(clsIn).one(UI.support.animation.end, function() { - - setTimeout(function () { - next.removeClass(''+clsIn+'').css({opacity:'', display:''}); - }, 0); - - d.resolve(); - - UI.$body.css('overflow-x', ''); - - if (current) current.css({opacity:'', display:''}); - - }.bind(this)).show(); - }; - - next.css('animation-duration', this.options.duration+'ms'); - - if (current && current.length) { - - current.css('animation-duration', this.options.duration+'ms'); - - current.css('display', 'none').addClass(clsOut+' uk-animation-reverse').one(UI.support.animation.end, function() { - release(); - }.bind(this)).css('display', ''); - - } else { - next.addClass('uk-active'); - release(); - } - - return d.promise(); - } - -})(UIkit); diff --git a/js/core/switcher.min.js b/js/core/switcher.min.js deleted file mode 100755 index 9c4bc36..0000000 --- a/js/core/switcher.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";function i(i,n,e){var s,a=t.$.Deferred(),o=i,r=i;return e[0]===n[0]?(a.resolve(),a.promise()):("object"==typeof i&&(o=i[0],r=i[1]||i[0]),t.$body.css("overflow-x","hidden"),s=function(){n&&n.hide().removeClass("uk-active "+r+" uk-animation-reverse"),e.addClass(o).one(t.support.animation.end,function(){setTimeout(function(){e.removeClass(""+o).css({opacity:"",display:""})},0),a.resolve(),t.$body.css("overflow-x",""),n&&n.css({opacity:"",display:""})}.bind(this)).show()},e.css("animation-duration",this.options.duration+"ms"),n&&n.length?(n.css("animation-duration",this.options.duration+"ms"),n.css("display","none").addClass(r+" uk-animation-reverse").one(t.support.animation.end,function(){s()}.bind(this)).css("display","")):(e.addClass("uk-active"),s()),a.promise())}var n;t.component("switcher",{defaults:{connect:!1,toggle:">*",active:0,animation:!1,duration:200,swiping:!0},animating:!1,boot:function(){t.ready(function(i){t.$("[data-uk-switcher]",i).each(function(){var i=t.$(this);if(!i.data("switcher")){t.switcher(i,t.Utils.options(i.attr("data-uk-switcher")))}})})},init:function(){var i=this;if(this.on("click.uk.switcher",this.options.toggle,function(t){t.preventDefault(),i.show(this)}),this.options.connect){this.connect=t.$(this.options.connect),this.connect.children().removeClass("uk-active"),this.connect.length&&(this.connect.children().attr("aria-hidden","true"),this.connect.on("click","[data-uk-switcher-item]",function(n){n.preventDefault();var e=t.$(this).attr("data-uk-switcher-item");if(i.index!=e)switch(e){case"next":case"previous":i.show(i.index+("next"==e?1:-1));break;default:i.show(parseInt(e,10))}}),this.options.swiping&&this.connect.on("swipeRight swipeLeft",function(t){t.preventDefault(),window.getSelection().toString()||i.show(i.index+("swipeLeft"==t.type?1:-1))}));var n=this.find(this.options.toggle),e=n.filter(".uk-active");if(e.length)this.show(e,!1);else{if(this.options.active===!1)return;e=n.eq(this.options.active),this.show(e.length?e:n.eq(0),!1)}n.not(e).attr("aria-expanded","false"),e.attr("aria-expanded","true")}},show:function(e,s){if(!this.animating){if(isNaN(e))e=t.$(e);else{var a=this.find(this.options.toggle);e=0>e?a.length-1:e,e=a.eq(a[e]?e:0)}var o=this,a=this.find(this.options.toggle),r=t.$(e),c=n[this.options.animation]||function(t,e){if(!o.options.animation)return n.none.apply(o);var s=o.options.animation.split(",");return 1==s.length&&(s[1]=s[0]),s[0]=s[0].trim(),s[1]=s[1].trim(),i.apply(o,[s,t,e])};s!==!1&&t.support.animation||(c=n.none),r.hasClass("uk-disabled")||(a.attr("aria-expanded","false"),r.attr("aria-expanded","true"),a.filter(".uk-active").removeClass("uk-active"),r.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(r),-1==this.index&&(this.index=0),this.connect.each(function(){var i=t.$(this),n=t.$(i.children()),e=t.$(n.filter(".uk-active")),s=t.$(n.eq(o.index));o.animating=!0,c.apply(o,[e,s]).then(function(){e.removeClass("uk-active"),s.addClass("uk-active"),e.attr("aria-hidden","true"),s.attr("aria-hidden","false"),t.Utils.checkDisplay(s,!0),o.animating=!1})})),this.trigger("show.uk.switcher",[r]))}}}),n={none:function(){var i=t.$.Deferred();return i.resolve(),i.promise()},fade:function(t,n){return i.apply(this,["uk-animation-fade",t,n])},"slide-bottom":function(t,n){return i.apply(this,["uk-animation-slide-bottom",t,n])},"slide-top":function(t,n){return i.apply(this,["uk-animation-slide-top",t,n])},"slide-vertical":function(t,n){var e=["uk-animation-slide-top","uk-animation-slide-bottom"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},"slide-left":function(t,n){return i.apply(this,["uk-animation-slide-left",t,n])},"slide-right":function(t,n){return i.apply(this,["uk-animation-slide-right",t,n])},"slide-horizontal":function(t,n){var e=["uk-animation-slide-right","uk-animation-slide-left"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},scale:function(t,n){return i.apply(this,["uk-animation-scale-up",t,n])}},t.switcher.animations=n}(UIkit); \ No newline at end of file diff --git a/js/core/tab.js b/js/core/tab.js deleted file mode 100755 index 4784a6f..0000000 --- a/js/core/tab.js +++ /dev/null @@ -1,167 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - UI.component('tab', { - - defaults: { - 'target' : '>li:not(.uk-tab-responsive, .uk-disabled)', - 'connect' : false, - 'active' : 0, - 'animation' : false, - 'duration' : 200, - 'swiping' : true - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-tab]", context).each(function() { - - var tab = UI.$(this); - - if (!tab.data("tab")) { - var obj = UI.tab(tab, UI.Utils.options(tab.attr("data-uk-tab"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.current = false; - - this.on("click.uk.tab", this.options.target, function(e) { - - e.preventDefault(); - - if ($this.switcher && $this.switcher.animating) { - return; - } - - var current = $this.find($this.options.target).not(this); - - current.removeClass("uk-active").blur(); - - $this.trigger("change.uk.tab", [UI.$(this).addClass("uk-active"), $this.current]); - - $this.current = UI.$(this); - - // Update ARIA - if (!$this.options.connect) { - current.attr('aria-expanded', 'false'); - UI.$(this).attr('aria-expanded', 'true'); - } - }); - - if (this.options.connect) { - this.connect = UI.$(this.options.connect); - } - - // init responsive tab - this.responsivetab = UI.$('
        • ').append('
            '); - - this.responsivetab.dropdown = this.responsivetab.find('.uk-dropdown'); - this.responsivetab.lst = this.responsivetab.dropdown.find('ul'); - this.responsivetab.caption = this.responsivetab.find('a:first'); - - if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up"); - - // handle click - this.responsivetab.lst.on('click.uk.tab', 'a', function(e) { - - e.preventDefault(); - e.stopPropagation(); - - var link = UI.$(this); - - $this.element.children('li:not(.uk-tab-responsive)').eq(link.data('index')).trigger('click'); - }); - - this.on('show.uk.switcher change.uk.tab', function(e, tab) { - $this.responsivetab.caption.html(tab.text()); - }); - - this.element.append(this.responsivetab); - - // init UIkit components - if (this.options.connect) { - this.switcher = UI.switcher(this.element, { - 'toggle' : '>li:not(.uk-tab-responsive)', - 'connect' : this.options.connect, - 'active' : this.options.active, - 'animation' : this.options.animation, - 'duration' : this.options.duration, - 'swiping' : this.options.swiping - }); - } - - UI.dropdown(this.responsivetab, {"mode": "click", "preventflip": "y"}); - - // init - $this.trigger("change.uk.tab", [this.element.find(this.options.target).not('.uk-tab-responsive').filter('.uk-active')]); - - this.check(); - - UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){ - if ($this.element.is(":visible")) $this.check(); - }, 100)); - - this.on('display.uk.check', function(){ - if ($this.element.is(":visible")) $this.check(); - }); - }, - - check: function() { - - var children = this.element.children('li:not(.uk-tab-responsive)').removeClass('uk-hidden'); - - if (!children.length) { - this.responsivetab.addClass('uk-hidden'); - return; - } - - var top = (children.eq(0).offset().top + Math.ceil(children.eq(0).height()/2)), - doresponsive = false, - item, link, clone; - - this.responsivetab.lst.empty(); - - children.each(function(){ - - if (UI.$(this).offset().top > top) { - doresponsive = true; - } - }); - - if (doresponsive) { - - for (var i = 0; i < children.length; i++) { - - item = UI.$(children.eq(i)); - link = item.find('a'); - - if (item.css('float') != 'none' && !item.attr('uk-dropdown')) { - - if (!item.hasClass('uk-disabled')) { - - clone = item[0].outerHTML.replace('li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0,animation:!1,duration:200,swiping:!0},boot:function(){t.ready(function(i){t.$("[data-uk-tab]",i).each(function(){var i=t.$(this);if(!i.data("tab")){t.tab(i,t.Utils.options(i.attr("data-uk-tab")))}})})},init:function(){var i=this;this.current=!1,this.on("click.uk.tab",this.options.target,function(e){if(e.preventDefault(),!i.switcher||!i.switcher.animating){var s=i.find(i.options.target).not(this);s.removeClass("uk-active").blur(),i.trigger("change.uk.tab",[t.$(this).addClass("uk-active"),i.current]),i.current=t.$(this),i.options.connect||(s.attr("aria-expanded","false"),t.$(this).attr("aria-expanded","true"))}}),this.options.connect&&(this.connect=t.$(this.options.connect)),this.responsivetab=t.$('
          • ').append('
              '),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click.uk.tab","a",function(e){e.preventDefault(),e.stopPropagation();var s=t.$(this);i.element.children("li:not(.uk-tab-responsive)").eq(s.data("index")).trigger("click")}),this.on("show.uk.switcher change.uk.tab",function(t,e){i.responsivetab.caption.html(e.text())}),this.element.append(this.responsivetab),this.options.connect&&(this.switcher=t.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active,animation:this.options.animation,duration:this.options.duration,swiping:this.options.swiping})),t.dropdown(this.responsivetab,{mode:"click",preventflip:"y"}),i.trigger("change.uk.tab",[this.element.find(this.options.target).not(".uk-tab-responsive").filter(".uk-active")]),this.check(),t.$win.on("resize orientationchange",t.Utils.debounce(function(){i.element.is(":visible")&&i.check()},100)),this.on("display.uk.check",function(){i.element.is(":visible")&&i.check()})},check:function(){var i=this.element.children("li:not(.uk-tab-responsive)").removeClass("uk-hidden");if(!i.length)return this.responsivetab.addClass("uk-hidden"),void 0;var e,s,n,a=i.eq(0).offset().top+Math.ceil(i.eq(0).height()/2),o=!1;if(this.responsivetab.lst.empty(),i.each(function(){t.$(this).offset().top>a&&(o=!0)}),o)for(var r=0;r= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down'); - } - - function longTap() { - longTapTimeout = null; - if (touch.last) { - if ( touch.el !== undefined ) touch.el.trigger('longTap'); - touch = {}; - } - } - - function cancelLongTap() { - if (longTapTimeout) clearTimeout(longTapTimeout); - longTapTimeout = null; - } - - function cancelAll() { - if (touchTimeout) clearTimeout(touchTimeout); - if (tapTimeout) clearTimeout(tapTimeout); - if (swipeTimeout) clearTimeout(swipeTimeout); - if (longTapTimeout) clearTimeout(longTapTimeout); - touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null; - touch = {}; - } - - function isPrimaryTouch(event){ - return event.pointerType == event.MSPOINTER_TYPE_TOUCH && event.isPrimary; - } - - $(function(){ - var now, delta, deltaX = 0, deltaY = 0, firstTouch; - - if ('MSGesture' in window) { - gesture = new MSGesture(); - gesture.target = document.body; - } - - $(document) - .on('MSGestureEnd gestureend', function(e){ - - var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null; - - if (swipeDirectionFromVelocity && touch.el !== undefined) { - touch.el.trigger('swipe'); - touch.el.trigger('swipe'+ swipeDirectionFromVelocity); - } - }) - // MSPointerDown: for IE10 - // pointerdown: for IE11 - .on('touchstart MSPointerDown pointerdown', function(e){ - - if(e.type == 'MSPointerDown' && !isPrimaryTouch(e.originalEvent)) return; - - firstTouch = (e.type == 'MSPointerDown' || e.type == 'pointerdown') ? e : e.originalEvent.touches[0]; - - now = Date.now(); - delta = now - (touch.last || now); - touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode); - - if(touchTimeout) clearTimeout(touchTimeout); - - touch.x1 = firstTouch.pageX; - touch.y1 = firstTouch.pageY; - - if (delta > 0 && delta <= 250) touch.isDoubleTap = true; - - touch.last = now; - longTapTimeout = setTimeout(longTap, longTapDelay); - - // adds the current touch contact for IE gesture recognition - if (gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) { - gesture.addPointer(e.originalEvent.pointerId); - } - - }) - // MSPointerMove: for IE10 - // pointermove: for IE11 - .on('touchmove MSPointerMove pointermove', function(e){ - - if (e.type == 'MSPointerMove' && !isPrimaryTouch(e.originalEvent)) return; - - firstTouch = (e.type == 'MSPointerMove' || e.type == 'pointermove') ? e : e.originalEvent.touches[0]; - - cancelLongTap(); - touch.x2 = firstTouch.pageX; - touch.y2 = firstTouch.pageY; - - deltaX += Math.abs(touch.x1 - touch.x2); - deltaY += Math.abs(touch.y1 - touch.y2); - }) - // MSPointerUp: for IE10 - // pointerup: for IE11 - .on('touchend MSPointerUp pointerup', function(e){ - - if (e.type == 'MSPointerUp' && !isPrimaryTouch(e.originalEvent)) return; - - cancelLongTap(); - - // swipe - if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){ - - swipeTimeout = setTimeout(function() { - if ( touch.el !== undefined ) { - touch.el.trigger('swipe'); - touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))); - } - touch = {}; - }, 0); - - // normal tap - } else if ('last' in touch) { - - // don't fire tap when delta position changed by more than 30 pixels, - // for instance when moving to a point and back to origin - if (isNaN(deltaX) || (deltaX < 30 && deltaY < 30)) { - // delay by one tick so we can cancel the 'tap' event if 'scroll' fires - // ('tap' fires before 'scroll') - tapTimeout = setTimeout(function() { - - // trigger universal 'tap' with the option to cancelTouch() - // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) - var event = $.Event('tap'); - event.cancelTouch = cancelAll; - if ( touch.el !== undefined ) touch.el.trigger(event); - - // trigger double tap immediately - if (touch.isDoubleTap) { - if ( touch.el !== undefined ) touch.el.trigger('doubleTap'); - touch = {}; - } - - // trigger single tap after 250ms of inactivity - else { - touchTimeout = setTimeout(function(){ - touchTimeout = null; - if ( touch.el !== undefined ) touch.el.trigger('singleTap'); - touch = {}; - }, 250); - } - }, 0); - } else { - touch = {}; - } - deltaX = deltaY = 0; - } - }) - // when the browser window loses focus, - // for example when a modal dialog is shown, - // cancel all ongoing events - .on('touchcancel MSPointerCancel', cancelAll); - - // scrolling the window indicates intention of the user - // to scroll, not tap or swipe, so cancel all ongoing events - $(window).on('scroll', cancelAll); - }); - - ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ - $.fn[eventName] = function(callback){ return $(this).on(eventName, callback); }; - }); -})(jQuery); diff --git a/js/core/touch.min.js b/js/core/touch.min.js deleted file mode 100755 index b86dfd1..0000000 --- a/js/core/touch.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(e){function t(e,t,n,o){return Math.abs(e-t)>=Math.abs(n-o)?e-t>0?"Left":"Right":n-o>0?"Up":"Down"}function n(){p=null,g.last&&(void 0!==g.el&&g.el.trigger("longTap"),g={})}function o(){p&&clearTimeout(p),p=null}function i(){a&&clearTimeout(a),l&&clearTimeout(l),u&&clearTimeout(u),p&&clearTimeout(p),a=l=u=p=null,g={}}function r(e){return e.pointerType==e.MSPOINTER_TYPE_TOUCH&&e.isPrimary}if(!e.fn.swipeLeft){var a,l,u,p,c,g={},s=750;e(function(){var v,y,w,f=0,d=0;"MSGesture"in window&&(c=new MSGesture,c.target=document.body),e(document).on("MSGestureEnd gestureend",function(e){var t=e.originalEvent.velocityX>1?"Right":e.originalEvent.velocityX<-1?"Left":e.originalEvent.velocityY>1?"Down":e.originalEvent.velocityY<-1?"Up":null;t&&void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t))}).on("touchstart MSPointerDown pointerdown",function(t){("MSPointerDown"!=t.type||r(t.originalEvent))&&(w="MSPointerDown"==t.type||"pointerdown"==t.type?t:t.originalEvent.touches[0],v=Date.now(),y=v-(g.last||v),g.el=e("tagName"in w.target?w.target:w.target.parentNode),a&&clearTimeout(a),g.x1=w.pageX,g.y1=w.pageY,y>0&&250>=y&&(g.isDoubleTap=!0),g.last=v,p=setTimeout(n,s),!c||"MSPointerDown"!=t.type&&"pointerdown"!=t.type&&"touchstart"!=t.type||c.addPointer(t.originalEvent.pointerId))}).on("touchmove MSPointerMove pointermove",function(e){("MSPointerMove"!=e.type||r(e.originalEvent))&&(w="MSPointerMove"==e.type||"pointermove"==e.type?e:e.originalEvent.touches[0],o(),g.x2=w.pageX,g.y2=w.pageY,f+=Math.abs(g.x1-g.x2),d+=Math.abs(g.y1-g.y2))}).on("touchend MSPointerUp pointerup",function(n){("MSPointerUp"!=n.type||r(n.originalEvent))&&(o(),g.x2&&Math.abs(g.x1-g.x2)>30||g.y2&&Math.abs(g.y1-g.y2)>30?u=setTimeout(function(){void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t(g.x1,g.x2,g.y1,g.y2))),g={}},0):"last"in g&&(isNaN(f)||30>f&&30>d?l=setTimeout(function(){var t=e.Event("tap");t.cancelTouch=i,void 0!==g.el&&g.el.trigger(t),g.isDoubleTap?(void 0!==g.el&&g.el.trigger("doubleTap"),g={}):a=setTimeout(function(){a=null,void 0!==g.el&&g.el.trigger("singleTap"),g={}},250)},0):g={},f=d=0))}).on("touchcancel MSPointerCancel",i),e(window).on("scroll",i)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(t){e.fn[t]=function(n){return e(this).on(t,n)}})}}(jQuery); \ No newline at end of file diff --git a/js/core/utility.js b/js/core/utility.js deleted file mode 100755 index 0090b8c..0000000 --- a/js/core/utility.js +++ /dev/null @@ -1,319 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(UI) { - - "use strict"; - - var stacks = []; - - UI.component('stackMargin', { - - defaults: { - cls: 'uk-margin-small-top', - rowfirst: false, - observe: false - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-margin]", context).each(function() { - - var ele = UI.$(this); - - if (!ele.data("stackMargin")) { - UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - UI.$win.on('resize orientationchange', (function() { - - var fn = function() { - $this.process(); - }; - - UI.$(function() { - fn(); - UI.$win.on("load", fn); - }); - - return UI.Utils.debounce(fn, 20); - })()); - - this.on("display.uk.check", function(e) { - if (this.element.is(":visible")) this.process(); - }.bind(this)); - - if (this.options.observe) { - - UI.domObserve(this.element, function(e) { - if ($this.element.is(":visible")) $this.process(); - }); - } - - stacks.push(this); - }, - - process: function() { - - var $this = this, columns = this.element.children(); - - UI.Utils.stackMargin(columns, this.options); - - if (!this.options.rowfirst || !columns.length) { - return this; - } - - // Mark first column elements - var group = {}, minleft = false; - - columns.removeClass(this.options.rowfirst).each(function(offset, $ele){ - - $ele = UI.$(this); - - if (this.style.display != 'none') { - offset = $ele.offset().left; - ((group[offset] = group[offset] || []) && group[offset]).push(this); - minleft = minleft === false ? offset : Math.min(minleft, offset); - } - }); - - UI.$(group[minleft]).addClass(this.options.rowfirst); - - return this; - } - - }); - - - // responsive element e.g. iframes - - (function(){ - - var elements = [], check = function(ele) { - - if (!ele.is(':visible')) return; - - var width = ele.parent().width(), - iwidth = ele.data('width'), - ratio = (width / iwidth), - height = Math.floor(ratio * ele.data('height')); - - ele.css({'height': (width < iwidth) ? height : ele.data('height')}); - }; - - UI.component('responsiveElement', { - - defaults: {}, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("iframe.uk-responsive-width, [data-uk-responsive]", context).each(function() { - - var ele = UI.$(this), obj; - - if (!ele.data("responsiveElement")) { - obj = UI.responsiveElement(ele, {}); - } - }); - }); - }, - - init: function() { - - var ele = this.element; - - if (ele.attr('width') && ele.attr('height')) { - - ele.data({ - - 'width' : ele.attr('width'), - 'height': ele.attr('height') - - }).on('display.uk.check', function(){ - check(ele); - }); - - check(ele); - - elements.push(ele); - } - } - }); - - UI.$win.on('resize load', UI.Utils.debounce(function(){ - - elements.forEach(function(ele){ - check(ele); - }); - - }, 15)); - - })(); - - - - // helper - - UI.Utils.stackMargin = function(elements, options) { - - options = UI.$.extend({ - 'cls': 'uk-margin-small-top' - }, options); - - elements = UI.$(elements).removeClass(options.cls); - - var min = false; - - elements.each(function(offset, height, pos, $ele){ - - $ele = UI.$(this); - - if ($ele.css('display') != 'none') { - - offset = $ele.offset(); - height = $ele.outerHeight(); - pos = offset.top + height; - - $ele.data({ - 'ukMarginPos': pos, - 'ukMarginTop': offset.top - }); - - if (min === false || (offset.top < min.top) ) { - - min = { - top : offset.top, - left : offset.left, - pos : pos - }; - } - } - - }).each(function($ele) { - - $ele = UI.$(this); - - if ($ele.css('display') != 'none' && $ele.data('ukMarginTop') > min.top && $ele.data('ukMarginPos') > min.pos) { - $ele.addClass(options.cls); - } - }); - }; - - UI.Utils.matchHeights = function(elements, options) { - - elements = UI.$(elements).css('min-height', ''); - options = UI.$.extend({ row : true }, options); - - var matchHeights = function(group){ - - if (group.length < 2) return; - - var max = 0; - - group.each(function() { - max = Math.max(max, UI.$(this).outerHeight()); - }).each(function() { - - var element = UI.$(this), - height = max - (element.css('box-sizing') == 'border-box' ? 0 : (element.outerHeight() - element.height())); - - element.css('min-height', height + 'px'); - }); - }; - - if (options.row) { - - elements.first().width(); // force redraw - - setTimeout(function(){ - - var lastoffset = false, group = []; - - elements.each(function() { - - var ele = UI.$(this), offset = ele.offset().top; - - if (offset != lastoffset && group.length) { - - matchHeights(UI.$(group)); - group = []; - offset = ele.offset().top; - } - - group.push(ele); - lastoffset = offset; - }); - - if (group.length) { - matchHeights(UI.$(group)); - } - - }, 0); - - } else { - matchHeights(elements); - } - }; - - (function(cacheSvgs){ - - UI.Utils.inlineSvg = function(selector, root) { - - var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){ - - var img = UI.$(this), - src = img.attr('src'); - - if (!cacheSvgs[src]) { - - var d = UI.$.Deferred(); - - UI.$.get(src, {nc: Math.random()}, function(data){ - d.resolve(UI.$(data).find('svg')); - }); - - cacheSvgs[src] = d.promise(); - } - - cacheSvgs[src].then(function(svg) { - - var $svg = UI.$(svg).clone(); - - if (img.attr('id')) $svg.attr('id', img.attr('id')); - if (img.attr('class')) $svg.attr('class', img.attr('class')); - if (img.attr('style')) $svg.attr('style', img.attr('style')); - - if (img.attr('width')) { - $svg.attr('width', img.attr('width')); - if (!img.attr('height')) $svg.removeAttr('height'); - } - - if (img.attr('height')){ - $svg.attr('height', img.attr('height')); - if (!img.attr('width')) $svg.removeAttr('width'); - } - - img.replaceWith($svg); - }); - }); - }; - - // init code - UI.ready(function(context) { - UI.Utils.inlineSvg('[data-uk-svg]', context); - }); - - })({}); - -})(UIkit); diff --git a/js/core/utility.min.js b/js/core/utility.min.js deleted file mode 100755 index 1b8e7ab..0000000 --- a/js/core/utility.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){"use strict";var i=[];t.component("stackMargin",{defaults:{cls:"uk-margin-small-top",rowfirst:!1,observe:!1},boot:function(){t.ready(function(i){t.$("[data-uk-margin]",i).each(function(){var i=t.$(this);i.data("stackMargin")||t.stackMargin(i,t.Utils.options(i.attr("data-uk-margin")))})})},init:function(){var n=this;t.$win.on("resize orientationchange",function(){var i=function(){n.process()};return t.$(function(){i(),t.$win.on("load",i)}),t.Utils.debounce(i,20)}()),this.on("display.uk.check",function(){this.element.is(":visible")&&this.process()}.bind(this)),this.options.observe&&t.domObserve(this.element,function(){n.element.is(":visible")&&n.process()}),i.push(this)},process:function(){var i=this.element.children();if(t.Utils.stackMargin(i,this.options),!this.options.rowfirst||!i.length)return this;var n={},e=!1;return i.removeClass(this.options.rowfirst).each(function(i,s){s=t.$(this),"none"!=this.style.display&&(i=s.offset().left,((n[i]=n[i]||[])&&n[i]).push(this),e=e===!1?i:Math.min(e,i))}),t.$(n[e]).addClass(this.options.rowfirst),this}}),function(){var i=[],n=function(t){if(t.is(":visible")){var i=t.parent().width(),n=t.data("width"),e=i/n,s=Math.floor(e*t.data("height"));t.css({height:n>i?s:t.data("height")})}};t.component("responsiveElement",{defaults:{},boot:function(){t.ready(function(i){t.$("iframe.uk-responsive-width, [data-uk-responsive]",i).each(function(){var i,n=t.$(this);n.data("responsiveElement")||(i=t.responsiveElement(n,{}))})})},init:function(){var t=this.element;t.attr("width")&&t.attr("height")&&(t.data({width:t.attr("width"),height:t.attr("height")}).on("display.uk.check",function(){n(t)}),n(t),i.push(t))}}),t.$win.on("resize load",t.Utils.debounce(function(){i.forEach(function(t){n(t)})},15))}(),t.Utils.stackMargin=function(i,n){n=t.$.extend({cls:"uk-margin-small-top"},n),i=t.$(i).removeClass(n.cls);var e=!1;i.each(function(i,n,s,a){a=t.$(this),"none"!=a.css("display")&&(i=a.offset(),n=a.outerHeight(),s=i.top+n,a.data({ukMarginPos:s,ukMarginTop:i.top}),(e===!1||i.tope.top&&i.data("ukMarginPos")>e.pos&&i.addClass(n.cls)})},t.Utils.matchHeights=function(i,n){i=t.$(i).css("min-height",""),n=t.$.extend({row:!0},n);var e=function(i){if(!(i.length<2)){var n=0;i.each(function(){n=Math.max(n,t.$(this).outerHeight())}).each(function(){var i=t.$(this),e=n-("border-box"==i.css("box-sizing")?0:i.outerHeight()-i.height());i.css("min-height",e+"px")})}};n.row?(i.first().width(),setTimeout(function(){var n=!1,s=[];i.each(function(){var i=t.$(this),a=i.offset().top;a!=n&&s.length&&(e(t.$(s)),s=[],a=i.offset().top),s.push(i),n=a}),s.length&&e(t.$(s))},0)):e(i)},function(i){t.Utils.inlineSvg=function(n,e){t.$(n||'img[src$=".svg"]',e||document).each(function(){var n=t.$(this),e=n.attr("src");if(!i[e]){var s=t.$.Deferred();t.$.get(e,{nc:Math.random()},function(i){s.resolve(t.$(i).find("svg"))}),i[e]=s.promise()}i[e].then(function(i){var e=t.$(i).clone();n.attr("id")&&e.attr("id",n.attr("id")),n.attr("class")&&e.attr("class",n.attr("class")),n.attr("style")&&e.attr("style",n.attr("style")),n.attr("width")&&(e.attr("width",n.attr("width")),n.attr("height")||e.removeAttr("height")),n.attr("height")&&(e.attr("height",n.attr("height")),n.attr("width")||e.removeAttr("width")),n.replaceWith(e)})})},t.ready(function(i){t.Utils.inlineSvg("[data-uk-svg]",i)})}({})}(UIkit); \ No newline at end of file diff --git a/js/pdfmake.min.js b/js/pdfmake.min.js new file mode 100644 index 0000000..2923504 --- /dev/null +++ b/js/pdfmake.min.js @@ -0,0 +1,17 @@ +!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(e){t.exports=e.pdfMake=n(1)}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";function r(t,e,n){this.docDefinition=t,this.fonts=e||s,this.vfs=n}var i=n(6),o=n(105),a=o.saveAs,s={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-Italic.ttf"}};r.prototype._createDoc=function(t,n){var r=new i(this.fonts);r.fs.bindFS(this.vfs);var o,a=r.createPdfKitDocument(this.docDefinition,t),s=[];a.on("data",function(t){s.push(t)}),a.on("end",function(){o=e.concat(s),n(o,a._pdfMakePages)}),a.end()},r.prototype._getPages=function(t,e){if(!e)throw"getBuffer is an async method and needs a callback argument";this._createDoc(t,function(t,n){e(n)})},r.prototype.open=function(t){var e=window.open("","_blank");try{this.getDataUrl(function(t){e.location.href=t})}catch(n){throw e.close(),n}},r.prototype.print=function(){this.getDataUrl(function(t){var e=document.createElement("iframe");e.style.position="absolute",e.style.left="-99999px",e.src=t,e.onload=function(){function t(){document.body.removeChild(e),document.removeEventListener("click",t)}document.addEventListener("click",t,!1)},document.body.appendChild(e)},{autoPrint:!0})},r.prototype.download=function(t,e){"function"==typeof t&&(e=t,t=null),t=t||"file.pdf",this.getBuffer(function(n){var r;try{r=new Blob([n],{type:"application/pdf"})}catch(i){if("InvalidStateError"==i.name){var o=new Uint8Array(n);r=new Blob([o.buffer],{type:"application/pdf"})}}if(!r)throw"Could not generate blob";a(r,t),"function"==typeof e&&e()})},r.prototype.getBase64=function(t,e){if(!t)throw"getBase64 is an async method and needs a callback argument";this._createDoc(e,function(e){t(e.toString("base64"))})},r.prototype.getDataUrl=function(t,e){if(!t)throw"getDataUrl is an async method and needs a callback argument";this._createDoc(e,function(e){t("data:application/pdf;base64,"+e.toString("base64"))})},r.prototype.getBuffer=function(t,e){if(!t)throw"getBuffer is an async method and needs a callback argument";this._createDoc(e,function(e){t(e)})},t.exports={createPdf:function(t){return new r(t,window.pdfMake.fonts,window.pdfMake.vfs)}}}).call(e,n(2).Buffer)},function(t,e,n){(function(t,r){function i(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(n){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function t(e){return this instanceof t?(this.length=0,this.parent=void 0,"number"==typeof e?a(this,e):"string"==typeof e?s(this,e,arguments.length>1?arguments[1]:"utf8"):h(this,e)):arguments.length>1?new t(e,arguments[1]):new t(e)}function a(e,n){if(e=g(e,0>n?0:0|v(n)),!t.TYPED_ARRAY_SUPPORT)for(var r=0;n>r;r++)e[r]=0;return e}function s(t,e,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|y(e,n);return t=g(t,r),t.write(e,n),t}function h(e,n){if(t.isBuffer(n))return u(e,n);if(V(n))return c(e,n);if(null==n)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(n.buffer instanceof ArrayBuffer)return l(e,n);if(n instanceof ArrayBuffer)return f(e,n)}return n.length?d(e,n):p(e,n)}function u(t,e){var n=0|v(e.length);return t=g(t,n),e.copy(t,0,0,n),t}function c(t,e){var n=0|v(e.length);t=g(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function l(t,e){var n=0|v(e.length);t=g(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function f(e,n){return t.TYPED_ARRAY_SUPPORT?(n.byteLength,e=t._augment(new Uint8Array(n))):e=l(e,new Uint8Array(n)),e}function d(t,e){var n=0|v(e.length);t=g(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function p(t,e){var n,r=0;"Buffer"===e.type&&V(e.data)&&(n=e.data,r=0|v(n.length)),t=g(t,r);for(var i=0;r>i;i+=1)t[i]=255&n[i];return t}function g(e,n){t.TYPED_ARRAY_SUPPORT?(e=t._augment(new Uint8Array(n)),e.__proto__=t.prototype):(e.length=n,e._isBuffer=!0);var r=0!==n&&n<=t.poolSize>>>1;return r&&(e.parent=$),e}function v(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function m(e,n){if(!(this instanceof m))return new m(e,n);var r=new t(e,n);return delete r.parent,r}function y(t,e){"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var r=!1;if(e=0|e,n=void 0===n||n===1/0?this.length:0|n,t||(t="utf8"),0>e&&(e=0),n>this.length&&(n=this.length),e>=n)return"";for(;;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return L(this,e,n);case"binary":return R(this,e,n);case"base64":return C(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function w(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[n+a]=s}return a}function b(t,e,n,r){return q(H(e,t.length-n),t,n,r)}function x(t,e,n,r){return q(Z(e),t,n,r)}function S(t,e,n,r){return x(t,e,n,r)}function k(t,e,n,r){return q(Y(e),t,n,r)}function E(t,e,n,r){return q(G(e,t.length-n),t,n,r)}function C(t,e,n){return 0===e&&n===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,n))}function I(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;n>i;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(n>=i+s){var h,u,c,l;switch(s){case 1:128>o&&(a=o);break;case 2:h=t[i+1],128===(192&h)&&(l=(31&o)<<6|63&h,l>127&&(a=l));break;case 3:h=t[i+1],u=t[i+2],128===(192&h)&&128===(192&u)&&(l=(15&o)<<12|(63&h)<<6|63&u,l>2047&&(55296>l||l>57343)&&(a=l));break;case 4:h=t[i+1],u=t[i+2],c=t[i+3],128===(192&h)&&128===(192&u)&&128===(192&c)&&(l=(15&o)<<18|(63&h)<<12|(63&u)<<6|63&c,l>65535&&1114112>l&&(a=l))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return A(r)}function A(t){var e=t.length;if(J>=e)return String.fromCharCode.apply(String,t);for(var n="",r=0;e>r;)n+=String.fromCharCode.apply(String,t.slice(r,r+=J));return n}function L(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(127&t[i]);return r}function R(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function T(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=j(t[o]);return i}function B(t,e,n){for(var r=t.slice(e,n),i="",o=0;ot)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,n,r,i,o,a){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(n>o||a>n)throw new RangeError("value is out of bounds");if(r+i>e.length)throw new RangeError("index out of range")}function D(t,e,n,r){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);o>i;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function U(t,e,n,r){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);o>i;i++)t[n+i]=e>>>8*(r?i:3-i)&255}function P(t,e,n,r,i,o){if(e>i||o>e)throw new RangeError("value is out of bounds");if(n+r>t.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function z(t,e,n,r,i){return i||P(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,i){return i||P(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,n,r,52,8),n+8}function W(t){if(t=N(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function N(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function j(t){return 16>t?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],a=0;r>a;a++){if(n=t.charCodeAt(a),n>55295&&57344>n){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(56320>n){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,128>n){if((e-=1)<0)break;o.push(n)}else if(2048>n){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function Y(t){return K.toByteArray(W(t))}function q(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);i++)e[i+n]=t[i];return i}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var K=n(3),X=n(4),V=n(5);e.Buffer=t,e.SlowBuffer=m,e.INSPECT_MAX_BYTES=50,t.poolSize=8192;var $={};t.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:i(),t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array),t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,i=n.length,o=0,a=Math.min(r,i);a>o&&e[o]===n[o];)++o;return o!==a&&(r=e[o],i=n[o]),i>r?-1:r>i?1:0},t.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,n){if(!V(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new t(0);var r;if(void 0===n)for(n=0,r=0;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:t.compare(this,e)},t.prototype.indexOf=function(e,n){function r(t,e,n){for(var r=-1,i=0;n+i2147483647?n=2147483647:-2147483648>n&&(n=-2147483648),n>>=0,0===this.length)return-1;if(n>=this.length)return-1;if(0>n&&(n=Math.max(this.length+n,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,n);if(t.isBuffer(e))return r(this,e,n);if("number"==typeof e)return t.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,n):r(this,[e],n);throw new TypeError("val must be string, number or Buffer")},t.prototype.get=function(t){return this.readUInt8(t)},t.prototype.set=function(t,e){return this.writeUInt8(t,e)},t.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var i=r;r=e,e=0|n,n=i}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(0>n||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return x(this,t,e,n);case"binary":return S(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;t.prototype.slice=function(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>n?(n+=r,0>n&&(n=0)):n>r&&(n=r),e>n&&(n=e);var i;if(t.TYPED_ARRAY_SUPPORT)i=t._augment(this.subarray(e,n));else{var o=n-e;i=new t(o,void 0);for(var a=0;o>a;a++)i[a]=this[a+e]}return i.length&&(i.parent=this.parent||this),i},t.prototype.readUIntLE=function(t,e,n){t=0|t,e=0|e,n||O(t,e,this.length);for(var r=this[t],i=1,o=0;++o0&&(i*=256);)r+=this[t+--e]*i;return r},t.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||O(t,e,this.length);for(var r=this[t],i=1,o=0;++o=i&&(r-=Math.pow(2,8*e)),r},t.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||O(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),X.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),X.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),X.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),X.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,r){t=+t,e=0|e,n=0|n,r||M(this,t,e,n,Math.pow(2,8*n),0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},t.prototype.writeUInt8=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},t.prototype.writeUInt16LE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):D(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):D(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):U(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):U(this,e,n,!1),n+4},t.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=0|e,!r){var i=Math.pow(2,8*n-1);M(this,t,e,n,i-1,-i)}var o=0,a=1,s=0>t?1:0;for(this[e]=255&t;++o>0)-s&255;return e+n},t.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=0|e,!r){var i=Math.pow(2,8*n-1);M(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0>t?1:0;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=(t/a>>0)-s&255;return e+n},t.prototype.writeInt8=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[n]=255&e,n+1},t.prototype.writeInt16LE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):D(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):D(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):U(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,r){return e=+e,n=0|n,r||M(this,e,n,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):U(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(t,e,n){return z(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return z(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},t.prototype.copy=function(e,n,r,i){if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&r>i&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(0>n)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>i)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-nr&&i>n)for(o=a-1;o>=0;o--)e[o+n]=this[o+r];else if(1e3>a||!t.TYPED_ARRAY_SUPPORT)for(o=0;a>o;o++)e[o+n]=this[o+r];else e._set(this.subarray(r,r+a),n);return a},t.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),e>n)throw new RangeError("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var i=H(t.toString()),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),n=0,r=e.length;r>n;n+=1)e[n]=this[n];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Q=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._set=e.set,e.get=Q.get,e.set=Q.set,e.write=Q.write,e.toString=Q.toString,e.toLocaleString=Q.toString,e.toJSON=Q.toJSON,e.equals=Q.equals,e.compare=Q.compare,e.indexOf=Q.indexOf,e.copy=Q.copy,e.slice=Q.slice,e.readUIntLE=Q.readUIntLE,e.readUIntBE=Q.readUIntBE,e.readUInt8=Q.readUInt8,e.readUInt16LE=Q.readUInt16LE,e.readUInt16BE=Q.readUInt16BE,e.readUInt32LE=Q.readUInt32LE,e.readUInt32BE=Q.readUInt32BE,e.readIntLE=Q.readIntLE,e.readIntBE=Q.readIntBE,e.readInt8=Q.readInt8,e.readInt16LE=Q.readInt16LE,e.readInt16BE=Q.readInt16BE,e.readInt32LE=Q.readInt32LE,e.readInt32BE=Q.readInt32BE,e.readFloatLE=Q.readFloatLE,e.readFloatBE=Q.readFloatBE,e.readDoubleLE=Q.readDoubleLE,e.readDoubleBE=Q.readDoubleBE,e.writeUInt8=Q.writeUInt8,e.writeUIntLE=Q.writeUIntLE,e.writeUIntBE=Q.writeUIntBE,e.writeUInt16LE=Q.writeUInt16LE,e.writeUInt16BE=Q.writeUInt16BE,e.writeUInt32LE=Q.writeUInt32LE,e.writeUInt32BE=Q.writeUInt32BE,e.writeIntLE=Q.writeIntLE,e.writeIntBE=Q.writeIntBE,e.writeInt8=Q.writeInt8,e.writeInt16LE=Q.writeInt16LE,e.writeInt16BE=Q.writeInt16BE,e.writeInt32LE=Q.writeInt32LE,e.writeInt32BE=Q.writeInt32BE,e.writeFloatLE=Q.writeFloatLE,e.writeFloatBE=Q.writeFloatBE,e.writeDoubleLE=Q.writeDoubleLE,e.writeDoubleBE=Q.writeDoubleBE,e.fill=Q.fill,e.inspect=Q.inspect,e.toArrayBuffer=Q.toArrayBuffer,e};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,n(2).Buffer,function(){return this}())},function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a||e===l?62:e===s||e===f?63:h>e?-1:h+10>e?e-h+26+26:c+26>e?e-c:u+26>e?e-u+26:void 0}function n(t){function n(t){u[l++]=t}var r,i,a,s,h,u;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.length;h="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,u=new o(3*t.length/4-h),a=h>0?t.length-4:t.length;var l=0;for(r=0,i=0;a>r;r+=4,i+=3)s=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===h?(s=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&s)):1===h&&(s=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(s>>8&255),n(255&s)),u}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,a,s=t.length%3,h="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],h+=n(o);switch(s){case 1:o=t[t.length-1],h+=e(o>>2),h+=e(o<<4&63),h+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],h+=e(o>>10),h+=e(o>>4&63),h+=e(o<<2&63),h+="="}return h}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),h="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0),l="-".charCodeAt(0),f="_".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}(e)},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,h=(1<>1,c=-7,l=n?i-1:0,f=n?-1:1,d=t[e+l];for(l+=f,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+l],l+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+l],l+=f,c-=8);if(0===o)o=1-u;else{if(o===h)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,r),o-=u}return(d?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,h,u=8*o-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),e+=a+l>=1?f/h:f*Math.pow(2,1-l),e*h>=2&&(a++,h/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*h-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[n+d]=255&a,d+=p,a/=256,u-=8);t[n+d-p]|=128*g}},function(t,e){var n=Array.isArray,r=Object.prototype.toString;t.exports=n||function(t){return!!t&&"[object Array]"==r.call(t)}},function(t,e,n){"use strict";function r(t){this.fontDescriptors=t}function i(t){if(!t)return null;if("number"==typeof t||t instanceof Number)t={left:t,right:t,top:t,bottom:t};else if(t instanceof Array)if(2===t.length)t={left:t[0],top:t[1],right:t[0],bottom:t[1]};else{if(4!==t.length)throw"Invalid pageMargins definition";t={left:t[0],top:t[1],right:t[2],bottom:t[3]}}return t}function o(t){t.registerTableLayouts({noBorders:{hLineWidth:function(t){return 0},vLineWidth:function(t){return 0},paddingLeft:function(t){return t&&4||0},paddingRight:function(t,e){return te.options.size[1]?"landscape":"portrait";if(t.pageSize.orientation!==n){var r=e.options.size[0],i=e.options.size[1];e.options.size=[i,r]}}function h(t,e,n){n._pdfMakePages=t;for(var r=0;r0&&(s(t[r],n),n.addPage(n.options));for(var i=t[r],o=0,a=i.items.length;a>o;o++){var h=i.items[o];switch(h.type){case"vector":l(h.item,n);break;case"line":u(h.item,h.item.x,h.item.y,n);break;case"image":f(h.item,h.item.x,h.item.y,n)}}i.watermark&&c(i,n),e.setFontRefsToPdfDoc()}}function u(t,e,n,r){e=e||0,n=n||0;var i=t.getHeight(),o=t.getAscenderHeight();_.drawBackground(t,e,n,r);for(var a=0,s=t.inlines.length;s>a;a++){var h=t.inlines[a];r.fill(h.color||"black"),r.save(),r.transform(1,0,0,-1,0,r.page.height);var u=h.font.encode(h.text);r.addContent("BT"),r.addContent(""+(e+h.x)+" "+(r.page.height-n-o)+" Td"),r.addContent("/"+u.fontId+" "+h.fontSize+" Tf"),r.addContent("<"+u.encodedText+"> Tj"),r.addContent("ET"),h.link&&r.link(e+h.x,r.page.height-n-i,h.width,i,h.link),r.restore()}_.drawDecorations(t,e,n,r)}function c(t,e){var n=t.watermark;e.fill("black"),e.opacity(.6),e.save(),e.transform(1,0,0,-1,0,e.page.height);var r=180*Math.atan2(e.page.height,e.page.width)/Math.PI;e.rotate(r,{origin:[e.page.width/2,e.page.height/2]});var i=n.font.encode(n.text);e.addContent("BT"),e.addContent(""+(e.page.width/2-n.size.size.width/2)+" "+(e.page.height/2-n.size.size.height/4)+" Td"),e.addContent("/"+i.fontId+" "+n.size.fontSize+" Tf"),e.addContent("<"+i.encodedText+"> Tj"),e.addContent("ET"),e.restore()}function l(t,e){switch(e.lineWidth(t.lineWidth||1),t.dash?e.dash(t.dash.length,{space:t.dash.space||t.dash.length}):e.undash(),e.fillOpacity(t.fillOpacity||1),e.strokeOpacity(t.strokeOpacity||1),e.lineJoin(t.lineJoin||"miter"),t.type){case"ellipse":e.ellipse(t.x,t.y,t.r1,t.r2);break;case"rect":t.r?e.roundedRect(t.x,t.y,t.w,t.h,t.r):e.rect(t.x,t.y,t.w,t.h);break;case"line":e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2);break;case"polyline":if(0===t.points.length)break;e.moveTo(t.points[0].x,t.points[0].y);for(var n=1,r=t.points.length;r>n;n++)e.lineTo(t.points[n].x,t.points[n].y);if(t.points.length>1){var i=t.points[0],o=t.points[t.points.length-1];(t.closePath||i.x===o.x&&i.y===o.y)&&e.closePath()}}t.color&&t.lineColor?e.fillAndStroke(t.color,t.lineColor):t.color?e.fill(t.color):e.stroke(t.lineColor||"black")}function f(t,e,n,r){r.image(t.image,t.x,t.y,{width:t._width,height:t._height})}var d=n(7),p=n(9),g=n(11),v=n(24),m=(n(46),n(102)),y=n(103),_=n(104),p=n(9);d.noConflict(),r.prototype.createPdfKitDocument=function(t,e){e=e||{};var n=a(t.pageSize||"a4");if("landscape"===t.pageOrientation&&(n={width:n.height,height:n.width}),n.orientation="landscape"===t.pageOrientation?t.pageOrientation:"portrait",this.pdfKitDoc=new v({size:[n.width,n.height],compress:!1}),this.pdfKitDoc.info.Producer="pdfmake",this.pdfKitDoc.info.Creator="pdfmake",t.info){t.info;this.pdfKitDoc.info.Title=t.info.title?t.info.title:null,this.pdfKitDoc.info.Author=t.info.author?t.info.author:null,this.pdfKitDoc.info.Subject=t.info.subject?t.info.subject:null,this.pdfKitDoc.info.Keywords=t.info.keywords?t.info.keywords:null}this.fontProvider=new p(this.fontDescriptors,this.pdfKitDoc),t.images=t.images||{};var r=new g(n,i(t.pageMargins||40),new y(this.pdfKitDoc,t.images));o(r),e.tableLayouts&&r.registerTableLayouts(e.tableLayouts);var s=r.layoutDocument(t.content,this.fontProvider,t.styles||{},t.defaultStyle||{fontSize:12,font:"Roboto"},t.background,t.header,t.footer,t.images,t.watermark,t.pageBreakBefore);if(h(s,this.fontProvider,this.pdfKitDoc),e.autoPrint){var u=this.pdfKitDoc.ref({Type:"Action",S:"Named",N:"Print"});this.pdfKitDoc._root.data.OpenAction=u,u.end()}return this.pdfKitDoc};t.exports=r,r.prototype.fs=n(44)},function(t,e,n){var r;(function(t,i){(function(){function o(t,e){if(t!==e){var n=null===t,r=t===I,i=t===t,o=null===e,a=e===I,s=e===e;if(t>e&&!o||!i||n&&!a&&s||r&&s)return 1;if(e>t&&!n||!s||o&&!r&&i||a&&i)return-1}return 0}function a(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i-1;);return n}function l(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function f(t,e){return o(t.criteria,e.criteria)||t.index-e.index}function d(t,e,n){for(var r=-1,i=t.criteria,a=e.criteria,s=i.length,h=n.length;++r=h)return u;var c=n[r];return u*("asc"===c||c===!0?1:-1)}}return t.index-e.index}function p(t){return Yt[t]}function g(t){return qt[t]}function v(t,e,n){return e?t=Vt[t]:n&&(t=$t[t]),"\\"+t}function m(t){return"\\"+$t[t]}function y(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var n=-1,r=t.length,i=-1,o=[];++ne,i=n?t.length:0,o=Yn(0,i,this.__views__),a=o.start,s=o.end,h=s-a,u=r?s:a-1,c=this.__iteratees__,l=c.length,f=0,d=Sa(h,this.__takeCount__);if(!n||j>i||i==h&&d==h)return nn(r&&n?t.reverse():t,this.__actions__);var p=[];t:for(;h--&&d>f;){u+=e;for(var g=-1,v=t[u];++g=j?gn(e):null,u=e.length;h&&(o=$t,a=!1,e=h);t:for(;++in&&(n=-n>i?0:i+n),r=r===I||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Ie(t,e){var n=[];return Ua(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Ae(t,e,n,r){var i;return n(t,function(t,n,o){return e(t,n,o)?(i=r?n:t,!1):void 0}),i}function Le(t,e,n,r){r||(r=[]);for(var i=-1,o=t.length;++ir;)t=t[e[r++]];return r&&r==i?t:I}}function De(t,e,n,r,i,o){return t===e?!0:null==t||null==e||!Mi(t)&&!_(e)?t!==t&&e!==e:Ue(t,e,De,n,r,i,o)}function Ue(t,e,n,r,i,o,a){var s=Ls(t),h=Ls(e),u=K,c=K;s||(u=ra.call(t),u==q?u=et:u!=et&&(s=Hi(t))),h||(c=ra.call(e),c==q?c=et:c!=et&&(h=Hi(e)));var l=u==et,f=c==et,d=u==c;if(d&&!s&&!l)return Fn(t,e,u);if(!i){var p=l&&ea.call(t,"__wrapped__"),g=f&&ea.call(e,"__wrapped__");if(p||g)return n(p?t.value():t,g?e.value():e,r,i,o,a)}if(!d)return!1;o||(o=[]),a||(a=[]);for(var v=o.length;v--;)if(o[v]==t)return a[v]==e;o.push(t),a.push(e);var m=(s?zn:Wn)(t,e,n,r,i,o,a);return o.pop(),a.pop(),m}function Pe(t,e,n){var r=e.length,i=r,o=!n;if(null==t)return!i;for(t=lr(t);r--;){var a=e[r];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++re&&(e=-e>i?0:i+e),n=n===I||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=No(i);++r=j,h=a?gn():null,u=[];h?(r=$t,o=!1):(a=!1,h=e?[]:u);t:for(;++n=i){for(;i>r;){var o=r+i>>>1,a=t[o];(n?e>=a:e>a)&&null!==a?r=o+1:i=o}return i}return on(t,e,Ao,n)}function on(t,e,n,r){e=n(e);for(var i=0,o=t?t.length:0,a=e!==e,s=null===e,h=e===I;o>i;){var u=ya((i+o)/2),c=n(t[u]),l=c!==I,f=c===c;if(a)var d=f||r;else d=s?f&&l&&(r||null!=c):h?f&&(r||l):null==c?!1:r?e>=c:e>c;d?i=u+1:o=u}return Sa(o,Ra)}function an(t,e,n){if("function"!=typeof t)return Ao;if(e===I)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,a){return t.call(e,n,r,i,o,a)}}return function(){return t.apply(e,arguments)}}function sn(t){var e=new aa(t.byteLength),n=new pa(e);return n.set(new pa(t)),e}function hn(t,e,n){for(var r=n.length,i=-1,o=xa(t.length-r,0),a=-1,s=e.length,h=No(s+o);++a2?n[i-2]:I,a=i>2?n[2]:I,s=i>1?n[i-1]:I;for("function"==typeof o?(o=an(o,s,5),i-=2):(o="function"==typeof s?s:I,i-=o?1:0),a&&Qn(n[0],n[1],a)&&(o=3>i?I:o,i=1);++r-1?n[o]:I}return Ae(n,r,t)}}function xn(t){return function(e,n,r){return e&&e.length?(n=Nn(n,r,3),a(e,n,t)):-1}}function Sn(t){return function(e,n,r){return n=Nn(n,r,3),Ae(e,n,t,!0)}}function kn(t){return function(){for(var e,n=arguments.length,i=t?n:-1,o=0,a=No(n);t?i--:++i=j)return e.plant(r).value();for(var i=0,o=n?a[i].apply(this,t):r;++iy){var k=s?te(s):I,E=xa(u-y,0),C=p?S:I,A=p?I:S,T=p?w:I,B=p?I:w;e|=p?M:D,e&=~(p?D:M),g||(e&=~(L|R));var O=[t,e,n,T,C,B,A,k,h,E],U=Bn.apply(I,O);return er(t)&&Ha(U,O),U.placeholder=x,U}}var P=f?n:this,z=d?P[t]:t;return s&&(w=hr(w,s)),l&&h=e||!wa(e))return"";var i=e-r;return n=null==n?" ":n+"",mo(n,va(i/n.length)).slice(0,i)}function Mn(t,e,n,r){function i(){for(var e=-1,s=arguments.length,h=-1,u=r.length,c=No(u+s);++hh))return!1;for(;++s-1&&t%1==0&&e>t}function Qn(t,e,n){if(!Mi(n))return!1;var r=typeof e;if("number"==r?$n(n)&&Jn(e,n.length):"string"==r&&e in n){var i=n[e];return t===t?t===i:i!==i}return!1}function tr(t,e){var n=typeof t;if("string"==n&&It.test(t)||"number"==n)return!0;if(Ls(t))return!1;var r=!Ct.test(t);return r||null!=e&&t in lr(e)}function er(t){var n=jn(t);if(!(n in i.prototype))return!1;var r=e[n];if(t===r)return!0;var o=Na(r);return!!o&&t===o[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Ba>=t}function rr(t){return t===t&&!Mi(t)}function ir(t,e){var n=t[1],r=e[1],i=n|r,o=U>i,a=r==U&&n==B||r==U&&n==P&&t[7].length<=e[8]||r==(U|P)&&n==B;if(!o&&!a)return t;r&L&&(t[2]=e[2],i|=n&L?0:T);var s=e[3];if(s){var h=t[3];t[3]=h?hn(h,s,e[4]):te(s),t[4]=h?b(t[3],Y):te(e[4])}return s=e[5],s&&(h=t[5],t[5]=h?un(h,s,e[6]):te(s),t[6]=h?b(t[5],Y):te(e[6])),s=e[7],s&&(t[7]=te(s)),r&U&&(t[8]=null==t[8]?e[8]:Sa(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function or(t,e){return t===I?e:Rs(t,e,or)}function ar(t,e){t=lr(t);for(var n=-1,r=e.length,i={};++nr;)a[++o]=Ke(t,r,r+=e);return a}function gr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function mr(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ke(t,0,0>e?0:e)):[]}function yr(t,e,n){return t&&t.length?en(t,Nn(e,n,3),!0,!0):[]}function _r(t,e,n){return t&&t.length?en(t,Nn(e,n,3),!0):[]}function wr(t,e,n,r){var i=t?t.length:0;return i?(n&&"number"!=typeof n&&Qn(t,e,n)&&(n=0,r=i),Ce(t,e,n,r)):[]}function br(t){return t?t[0]:I}function xr(t,e,n){var r=t?t.length:0;return n&&Qn(t,e,n)&&(e=!1),r?Le(t,e):[]}function Sr(t){var e=t?t.length:0;return e?Le(t,!0):[]}function kr(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xa(r+n,0):n;else if(n){var i=rn(t,e);return r>i&&(e===e?e===t[i]:t[i]!==t[i])?i:-1}return s(t,e,n||0)}function Er(t){return mr(t,1)}function Cr(t){var e=t?t.length:0;return e?t[e-1]:I}function Ir(t,e,n){var r=t?t.length:0;if(!r)return-1;var i=r;if("number"==typeof n)i=(0>n?xa(r+n,0):Sa(n||0,r-1))+1;else if(n){i=rn(t,e,!0)-1;var o=t[i];return(e===e?e===o:o!==o)?i:-1}if(e!==e)return y(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Ar(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Hn(),i=t.length;++n-1;)da.call(e,o,1);return e}function Lr(t,e,n){var r=[];if(!t||!t.length)return r;var i=-1,o=[],a=t.length;for(e=Nn(e,n,3);++ie?0:e)):[]}function Or(t,e,n){var r=t?t.length:0;return r?((n?Qn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ke(t,0>e?0:e)):[]}function Mr(t,e,n){return t&&t.length?en(t,Nn(e,n,3),!1,!0):[]}function Dr(t,e,n){return t&&t.length?en(t,Nn(e,n,3)):[]}function Ur(t,e,n,r){var i=t?t.length:0;if(!i)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Qn(t,e,r)?I:e,e=!1);var o=Nn();return(null!=n||o!==we)&&(n=o(n,r,3)),e&&Hn()==s?x(t,n):Qe(t,n)}function Pr(t){if(!t||!t.length)return[];var e=-1,n=0;t=se(t,function(t){return $n(t)?(n=xa(t.length,n),!0):void 0});for(var r=No(n);++en?xa(i+n,0):n||0,"string"==typeof t||!Ls(t)&&ji(t)?i>=n&&t.indexOf(e,n)>-1:!!i&&Hn(t,e,n)>-1}function ti(t,e,n){var r=Ls(t)?he:ze;return e=Nn(e,n,3),r(t,e)}function ei(t,e){return ti(t,Mo(e))}function ni(t,e,n){var r=Ls(t)?se:Ie;return e=Nn(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ri(t,e,n){if(n?Qn(t,e,n):null==e){t=cr(t);var r=t.length;return r>0?t[Ye(0,r-1)]:I}var i=-1,o=qi(t),r=o.length,a=r-1;for(e=Sa(0>e?0:+e||0,r);++i0&&(n=e.apply(this,arguments)),1>=t&&(e=I),n}}function di(t,e,n){function r(){d&&sa(d),u&&sa(u),g=0,u=d=p=I}function i(e,n){n&&sa(n),u=d=p=I,e&&(g=gs(),c=t.apply(f,h),d||u||(h=f=I))}function o(){var t=e-(gs()-l);0>=t||t>e?i(p,u):d=fa(o,t)}function a(){i(m,d)}function s(){if(h=arguments,l=gs(),f=this,p=m&&(d||!y),v===!1)var n=y&&!d;else{u||y||(g=l);var r=v-(l-g),i=0>=r||r>v;i?(u&&(u=sa(u)),g=l,c=t.apply(f,h)):u||(u=fa(a,r))}return i&&d?d=sa(d):d||e===v||(d=fa(o,e)),n&&(i=!0,c=t.apply(f,h)),!i||d||u||(h=f=I),c}var h,u,c,l,f,d,p,g=0,v=!1,m=!0;if("function"!=typeof t)throw new Vo(G);if(e=0>e?0:+e||0,n===!0){var y=!0;m=!1}else Mi(n)&&(y=!!n.leading,v="maxWait"in n&&xa(+n.maxWait||0,e),m="trailing"in n?!!n.trailing:m);return s.cancel=r,s}function pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Vo(G);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new pi.Cache,n}function gi(t){if("function"!=typeof t)throw new Vo(G);return function(){return!t.apply(this,arguments)}}function vi(t){return fi(2,t)}function mi(t,e){if("function"!=typeof t)throw new Vo(G);return e=xa(e===I?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,i=xa(n.length-e,0),o=No(i);++re}function ki(t,e){return t>=e}function Ei(t){return _(t)&&$n(t)&&ea.call(t,"callee")&&!ca.call(t,"callee")}function Ci(t){return t===!0||t===!1||_(t)&&ra.call(t)==X}function Ii(t){return _(t)&&ra.call(t)==V}function Ai(t){return!!t&&1===t.nodeType&&_(t)&&!Wi(t)}function Li(t){return null==t?!0:$n(t)&&(Ls(t)||ji(t)||Ei(t)||_(t)&&Oi(t.splice))?!t.length:!Ws(t).length}function Ri(t,e,n,r){n="function"==typeof n?an(n,r,3):I;var i=n?n(t,e):I;return i===I?De(t,e,n):!!i}function Ti(t){return _(t)&&"string"==typeof t.message&&ra.call(t)==$}function Bi(t){return"number"==typeof t&&wa(t)}function Oi(t){return Mi(t)&&ra.call(t)==J}function Mi(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Di(t,e,n,r){return n="function"==typeof n?an(n,r,3):I,Pe(t,Zn(e),n)}function Ui(t){return Fi(t)&&t!=+t}function Pi(t){return null==t?!1:Oi(t)?oa.test(ta.call(t)):_(t)&&Ut.test(t)}function zi(t){return null===t}function Fi(t){return"number"==typeof t||_(t)&&ra.call(t)==tt}function Wi(t){var e;if(!_(t)||ra.call(t)!=et||Ei(t)||!ea.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return Re(t,function(t,e){n=e}),n===I||ea.call(t,n)}function Ni(t){return Mi(t)&&ra.call(t)==nt}function ji(t){return"string"==typeof t||_(t)&&ra.call(t)==it}function Hi(t){return _(t)&&nr(t.length)&&!!Zt[ra.call(t)]}function Zi(t){return t===I}function Gi(t,e){return e>t}function Yi(t,e){return e>=t}function qi(t){var e=t?ja(t):0;return nr(e)?e?te(t):[]:oo(t)}function Ki(t){return _e(t,to(t))}function Xi(t,e,n){var r=Da(t);return n&&Qn(t,e,n)&&(e=I),e?me(r,e):r}function Vi(t){return Oe(t,to(t))}function $i(t,e,n){var r=null==t?I:Me(t,fr(e),e+"");return r===I?n:r}function Ji(t,e){if(null==t)return!1;var n=ea.call(t,e);if(!n&&!tr(e)){if(e=fr(e),t=1==e.length?t:Me(t,Ke(e,0,-1)),null==t)return!1;e=Cr(e),n=ea.call(t,e)}return n||nr(t.length)&&Jn(e,t.length)&&(Ls(t)||Ei(t))}function Qi(t,e,n){n&&Qn(t,e,n)&&(e=I);for(var r=-1,i=Ws(t),o=i.length,a={};++r0;++r=Sa(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function fo(t){return t=u(t),t&&xt.test(t)?t.replace(wt,g):t}function po(t){return t=u(t),t&&Rt.test(t)?t.replace(Lt,v):t||"(?:)"}function go(t,e,n){t=u(t),e=+e;var r=t.length;if(r>=e||!wa(e))return t;var i=(e-r)/2,o=ya(i),a=va(i);return n=On("",a,n),n.slice(0,o)+t+n}function vo(t,e,n){return(n?Qn(t,e,n):null==e)?e=0:e&&(e=+e),t=wo(t),Ea(t,e||(Dt.test(t)?16:10))}function mo(t,e){var n="";if(t=u(t),e=+e,1>e||!t||!wa(e))return n;do e%2&&(n+=t),e=ya(e/2),t+=t;while(e);return n}function yo(t,e,n){return t=u(t),n=null==n?0:Sa(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function _o(t,n,r){var i=e.templateSettings;r&&Qn(t,n,r)&&(n=r=I),t=u(t),n=ve(me({},r||n),i,ge);var o,a,s=ve(me({},n.imports),i.imports,ge),h=Ws(s),c=tn(s,h),l=0,f=n.interpolate||Ft,d="__p += '",p=Ko((n.escape||Ft).source+"|"+f.source+"|"+(f===Et?Ot:Ft).source+"|"+(n.evaluate||Ft).source+"|$","g"),g="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ht+"]")+"\n";t.replace(p,function(e,n,r,i,s,h){return r||(r=i),d+=t.slice(l,h).replace(Wt,m),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=h+e.length,e}),d+="';\n";var v=n.variable;v||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(vt,""):d).replace(mt,"$1").replace(yt,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var y=$s(function(){return Zo(h,g+"return "+d).apply(I,c)});if(y.source=d,Ti(y))throw y;return y}function wo(t,e,n){var r=t;return(t=u(t))?(n?Qn(r,e,n):null==e)?t.slice(S(t),k(t)+1):(e+="",t.slice(c(t,e),l(t,e)+1)):t}function bo(t,e,n){var r=t;return t=u(t),t?(n?Qn(r,e,n):null==e)?t.slice(S(t)):t.slice(c(t,e+"")):t}function xo(t,e,n){var r=t;return t=u(t),t?(n?Qn(r,e,n):null==e)?t.slice(0,k(t)+1):t.slice(0,l(t,e+"")+1):t}function So(t,e,n){n&&Qn(t,e,n)&&(e=I);var r=z,i=F;if(null!=e)if(Mi(e)){var o="separator"in e?e.separator:o;r="length"in e?+e.length||0:r,i="omission"in e?u(e.omission):i}else r=+e||0;if(t=u(t),r>=t.length)return t;var a=r-i.length;if(1>a)return i;var s=t.slice(0,a);if(null==o)return s+i;if(Ni(o)){if(t.slice(a).search(o)){var h,c,l=t.slice(0,a);for(o.global||(o=Ko(o.source,(Mt.exec(o)||"")+"g")),o.lastIndex=0;h=o.exec(l);)c=h.index;s=s.slice(0,null==c?a:c)}}else if(t.indexOf(o,a)!=a){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+i}function ko(t){return t=u(t),t&&bt.test(t)?t.replace(_t,E):t}function Eo(t,e,n){return n&&Qn(t,e,n)&&(e=I),t=u(t),t.match(e||Nt)||[]}function Co(t,e,n){return n&&Qn(t,e,n)&&(e=I),_(t)?Lo(t):we(t,e)}function Io(t){return function(){return t}}function Ao(t){return t}function Lo(t){return Fe(be(t,!0))}function Ro(t,e){return We(t,be(e,!0))}function To(t,e,n){if(null==n){var r=Mi(e),i=r?Ws(e):I,o=i&&i.length?Oe(e,i):I;(o?o.length:r)||(o=!1,n=e,e=t,t=this)}o||(o=Oe(e,Ws(e)));var a=!0,s=-1,h=Oi(t),u=o.length;n===!1?a=!1:Mi(n)&&"chain"in n&&(a=n.chain);for(;++st||!wa(t))return[];var r=-1,i=No(Sa(t,La));for(e=an(e,n,1);++rr?i[r]=e(r):e(r);return i}function zo(t){var e=++na;return u(t)+e}function Fo(t,e){return(+t||0)+(+e||0)}function Wo(t,e,n){return n&&Qn(t,e,n)&&(e=I),e=Nn(e,n,3),1==e.length?de(Ls(t)?t:cr(t),e):Je(t,e)}t=t?ie.defaults(re.Object(),t,ie.pick(re,jt)):re;var No=t.Array,jo=t.Date,Ho=t.Error,Zo=t.Function,Go=t.Math,Yo=t.Number,qo=t.Object,Ko=t.RegExp,Xo=t.String,Vo=t.TypeError,$o=No.prototype,Jo=qo.prototype,Qo=Xo.prototype,ta=Zo.prototype.toString,ea=Jo.hasOwnProperty,na=0,ra=Jo.toString,ia=re._,oa=Ko("^"+ta.call(ea).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),aa=t.ArrayBuffer,sa=t.clearTimeout,ha=t.parseFloat,ua=Go.pow,ca=Jo.propertyIsEnumerable,la=Gn(t,"Set"),fa=t.setTimeout,da=$o.splice,pa=t.Uint8Array,ga=Gn(t,"WeakMap"),va=Go.ceil,ma=Gn(qo,"create"),ya=Go.floor,_a=Gn(No,"isArray"),wa=t.isFinite,ba=Gn(qo,"keys"),xa=Go.max,Sa=Go.min,ka=Gn(jo,"now"),Ea=t.parseInt,Ca=Go.random,Ia=Yo.NEGATIVE_INFINITY,Aa=Yo.POSITIVE_INFINITY,La=4294967295,Ra=La-1,Ta=La>>>1,Ba=9007199254740991,Oa=ga&&new ga,Ma={};e.support={};e.templateSettings={escape:St,evaluate:kt,interpolate:Et,variable:"",imports:{_:e}};var Da=function(){function t(){}return function(e){if(Mi(e)){t.prototype=e;var n=new t;t.prototype=I}return n||{}}}(),Ua=fn(Te),Pa=fn(Be,!0),za=dn(),Fa=dn(!0),Wa=Oa?function(t,e){return Oa.set(t,e),t}:Ao,Na=Oa?function(t){return Oa.get(t)}:Oo,ja=He("length"),Ha=function(){var t=0,e=0;return function(n,r){var i=gs(),o=N-(i-e);if(e=i,o>0){if(++t>=W)return n}else t=0;return Wa(n,r)}}(),Za=mi(function(t,e){return _(t)&&$n(t)?Se(t,Le(e,!1,!0)):[]}),Ga=xn(),Ya=xn(!0),qa=mi(function(t){for(var e=t.length,n=e,r=No(l),i=Hn(),o=i==s,a=[];n--;){var h=t[n]=$n(h=t[n])?h:[];r[n]=o&&h.length>=120?gn(n&&h):null}var u=t[0],c=-1,l=u?u.length:0,f=r[0];t:for(;++c2?t[e-2]:I,r=e>1?t[e-1]:I;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):I,r=I),t.length=e,zr(t,n,r)}),es=mi(function(t){return t=Le(t),this.thru(function(e){return Qt(Ls(e)?e:[lr(e)],t)})}),ns=mi(function(t,e){return ye(t,Le(e))}),rs=cn(function(t,e,n){ea.call(t,n)?++t[n]:t[n]=1}),is=bn(Ua),os=bn(Pa,!0),as=En(ee,Ua),ss=En(ne,Pa),hs=cn(function(t,e,n){ea.call(t,n)?t[n].push(e):t[n]=[e]}),us=cn(function(t,e,n){t[n]=e}),cs=mi(function(t,e,n){var r=-1,i="function"==typeof e,o=tr(e),a=$n(t)?No(t.length):[];return Ua(t,function(t){var s=i?e:o&&null!=t?t[e]:I;a[++r]=s?s.apply(t,n):Vn(t,e,n)}),a}),ls=cn(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),fs=Tn(ce,Ua),ds=Tn(le,Pa),ps=mi(function(t,e){if(null==t)return[];var n=e[2];return n&&Qn(e[0],e[1],n)&&(e.length=1),$e(t,Le(e),[])}),gs=ka||function(){return(new jo).getTime()},vs=mi(function(t,e,n){var r=L;if(n.length){var i=b(n,vs.placeholder);r|=M}return Pn(t,r,e,n,i)}),ms=mi(function(t,e){e=e.length?Le(e):Vi(t);for(var n=-1,r=e.length;++n0||0>e)?new i(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==I&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},i.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},i.prototype.toArray=function(){return this.take(Aa)},Te(i.prototype,function(t,n){var o=/^(?:filter|map|reject)|While$/.test(n),a=/^(?:first|last)$/.test(n),s=e[a?"take"+("last"==n?"Right":""):n];s&&(e.prototype[n]=function(){var e=a?[1]:arguments,n=this.__chain__,h=this.__wrapped__,u=!!this.__actions__.length,c=h instanceof i,l=e[0],f=c||Ls(h);f&&o&&"function"==typeof l&&1!=l.length&&(c=f=!1);var d=function(t){return a&&n?s(t,1)[0]:s.apply(I,ue([t],e))},p={func:Hr,args:[d],thisArg:I},g=c&&!u;if(a&&!n)return g?(h=h.clone(),h.__actions__.push(p),t.call(h)):s.call(I,this.value())[0];if(!a&&f){h=g?h:new i(this);var v=t.apply(h,e);return v.__actions__.push(p),new r(v,n)}return this.thru(d)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Qo:$o)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Te(i.prototype,function(t,n){var r=e[n];if(r){var i=r.name,o=Ma[i]||(Ma[i]=[]);o.push({name:n,func:r})}}),Ma[Bn(I,R).name]=[{name:"wrapper",func:I}],i.prototype.clone=w,i.prototype.reverse=Q,i.prototype.value=rt,e.prototype.chain=Zr,e.prototype.commit=Gr,e.prototype.concat=es,e.prototype.plant=Yr,e.prototype.reverse=qr,e.prototype.toString=Kr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Xr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var I,A="3.10.1",L=1,R=2,T=4,B=8,O=16,M=32,D=64,U=128,P=256,z=30,F="...",W=150,N=16,j=200,H=1,Z=2,G="Expected a function",Y="__lodash_placeholder__",q="[object Arguments]",K="[object Array]",X="[object Boolean]",V="[object Date]",$="[object Error]",J="[object Function]",Q="[object Map]",tt="[object Number]",et="[object Object]",nt="[object RegExp]",rt="[object Set]",it="[object String]",ot="[object WeakMap]",at="[object ArrayBuffer]",st="[object Float32Array]",ht="[object Float64Array]",ut="[object Int8Array]",ct="[object Int16Array]",lt="[object Int32Array]",ft="[object Uint8Array]",dt="[object Uint8ClampedArray]",pt="[object Uint16Array]",gt="[object Uint32Array]",vt=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_t=/&(?:amp|lt|gt|quot|#39|#96);/g,wt=/[&<>"'`]/g,bt=RegExp(_t.source),xt=RegExp(wt.source),St=/<%-([\s\S]+?)%>/g,kt=/<%([\s\S]+?)%>/g,Et=/<%=([\s\S]+?)%>/g,Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,It=/^\w*$/,At=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Lt=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Rt=RegExp(Lt.source),Tt=/[\u0300-\u036f\ufe20-\ufe23]/g,Bt=/\\(\\)?/g,Ot=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mt=/\w*$/,Dt=/^0[xX]/,Ut=/^\[object .+?Constructor\]$/,Pt=/^\d+$/,zt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ft=/($^)/,Wt=/['\n\r\u2028\u2029\\]/g,Nt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),jt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ht=-1,Zt={};Zt[st]=Zt[ht]=Zt[ut]=Zt[ct]=Zt[lt]=Zt[ft]=Zt[dt]=Zt[pt]=Zt[gt]=!0,Zt[q]=Zt[K]=Zt[at]=Zt[X]=Zt[V]=Zt[$]=Zt[J]=Zt[Q]=Zt[tt]=Zt[et]=Zt[nt]=Zt[rt]=Zt[it]=Zt[ot]=!1;var Gt={};Gt[q]=Gt[K]=Gt[at]=Gt[X]=Gt[V]=Gt[st]=Gt[ht]=Gt[ut]=Gt[ct]=Gt[lt]=Gt[tt]=Gt[et]=Gt[nt]=Gt[it]=Gt[ft]=Gt[dt]=Gt[pt]=Gt[gt]=!0,Gt[$]=Gt[J]=Gt[Q]=Gt[rt]=Gt[ot]=!1;var Yt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},qt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Kt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Xt={"function":!0,object:!0},Vt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},$t={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Jt=Xt[typeof e]&&e&&!e.nodeType&&e,Qt=Xt[typeof t]&&t&&!t.nodeType&&t,te=Jt&&Qt&&"object"==typeof i&&i&&i.Object&&i,ee=Xt[typeof self]&&self&&self.Object&&self,ne=Xt[typeof window]&&window&&window.Object&&window,re=(Qt&&Qt.exports===Jt&&Jt,te||ne!==(this&&this.window)&&ne||ee||this),ie=C();re._=ie,r=function(){return ie}.call(e,n,e,t),!(r!==I&&(t.exports=r))}).call(this)}).call(e,n(8)(t),function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t,e){var n="normal";return t&&e?n="bolditalics":t?n="bold":e&&(n="italics"),n}function i(t,e){this.fonts={},this.pdfDoc=e,this.fontWrappers={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];this.fonts[n]={normal:r.normal,bold:r.bold,italics:r.italics,bolditalics:r.bolditalics}}}var o=n(7),a=n(10);o.noConflict(),i.prototype.provideFont=function(t,e,n){var i=r(e,n);if(!this.fonts[t]||!this.fonts[t][i])throw new Error("Font '"+t+"' in style '"+i+"' is not defined in the font section of the document definition.");return this.fontWrappers[t]=this.fontWrappers[t]||{},this.fontWrappers[t][i]||(this.fontWrappers[t][i]=new a(this.pdfDoc,this.fonts[t][i],t+"("+i+")")),this.fontWrappers[t][i]},i.prototype.setFontRefsToPdfDoc=function(){var t=this;o.each(t.fontWrappers,function(e){o.each(e,function(e){o.each(e.pdfFonts,function(e){t.pdfDoc.page.fonts[e.id]||(t.pdfDoc.page.fonts[e.id]=e.ref())})})})},t.exports=i},function(t,e,n){"use strict";function r(t,e,n){this.MAX_CHAR_TYPES=92,this.pdfkitDoc=t,this.path=e,this.pdfFonts=[],this.charCatalogue=[],this.name=n,Object.defineProperty(this,"ascender",{get:function(){var t=this.getFont(0);return t.ascender}}),Object.defineProperty(this,"decender",{get:function(){var t=this.getFont(0);return t.decender}})}var i=n(7);i.noConflict(),r.prototype.getFont=function(t){if(!this.pdfFonts[t]){var e=this.name+t;this.postscriptName&&delete this.pdfkitDoc._fontFamilies[this.postscriptName],this.pdfFonts[t]=this.pdfkitDoc.font(this.path,e)._font,this.postscriptName||(this.postscriptName=this.pdfFonts[t].name)}return this.pdfFonts[t]},r.prototype.widthOfString=function(){var t=this.getFont(0);return t.widthOfString.apply(t,arguments)},r.prototype.lineHeight=function(){var t=this.getFont(0);return t.lineHeight.apply(t,arguments)},r.prototype.ref=function(){var t=this.getFont(0);return t.ref.apply(t,arguments)};var o=function(t){return t.charCodeAt(0)};r.prototype.encode=function(t){var e=this,n=i.chain(t.split("")).map(o).uniq().value();if(n.length>e.MAX_CHAR_TYPES)throw new Error("Inline has more than "+e.MAX_CHAR_TYPES+": "+t+" different character types and therefore cannot be properly embedded into pdf.");var r=function(t){return i.uniq(t.concat(n)).length<=e.MAX_CHAR_TYPES},a=i.findIndex(e.charCatalogue,r);0>a&&(a=e.charCatalogue.length,e.charCatalogue[a]=[]);var s=e.getFont(a);s.use(t),i.each(n,function(t){i.includes(e.charCatalogue[a],t)||e.charCatalogue[a].push(t)});var h=i.map(s.encode(t),function(t){return t.charCodeAt(0).toString(16)}).join("");return{encodedText:h,fontId:s.id}},t.exports=r},function(t,e,n){"use strict";function r(t,e){a.each(e,function(e){t.push(e)})}function i(t,e,n){this.pageSize=t,this.pageMargins=e,this.tracker=new s,this.imageMeasure=n,this.tableLayouts={}}function o(t){var e=t.x,n=t.y;t.positions=[],a.each(t.canvas,function(t){var e=t.x,n=t.y,r=t.x1,i=t.y1,o=t.x2,a=t.y2;t.resetXY=function(){t.x=e,t.y=n,t.x1=r,t.y1=i,t.x2=o,t.y2=a}}),t.resetXY=function(){t.x=e,t.y=n,a.each(t.canvas,function(t){t.resetXY()})}}var a=n(7),s=n(12),h=n(13),u=n(19),c=n(20),l=n(16),f=n(23),d=n(22),p=n(17).pack,g=n(17).offsetVector,v=n(17).fontStringify,m=n(17).isFunction,y=n(14),_=n(15);i.prototype.registerTableLayouts=function(t){this.tableLayouts=p(this.tableLayouts,t)},i.prototype.layoutDocument=function(t,e,n,r,i,o,s,u,c,l){function f(t,e){return m(l)?(t=a.reject(t,function(t){return a.isEmpty(t.positions)}),a.each(t,function(t){var n=a.pick(t,["id","text","ul","ol","table","image","qr","canvas","columns","headlineLevel","style","pageBreak","pageOrientation","width","height"]);n.startPosition=a.first(t.positions),n.pageNumbers=a.chain(t.positions).map("pageNumber").uniq().value(),n.pages=e.length,n.stack=a.isArray(t.stack),t.nodeInfo=n}),a.any(t,function(t,e,n){if("before"!==t.pageBreak&&!t.pageBreakCalculated){t.pageBreakCalculated=!0;var r=a.first(t.nodeInfo.pageNumbers),i=a.chain(n).drop(e+1).filter(function(t){return a.contains(t.nodeInfo.pageNumbers,r)}).value(),o=a.chain(n).drop(e+1).filter(function(t){return a.contains(t.nodeInfo.pageNumbers,r+1)}).value(),s=a.chain(n).take(e).filter(function(t){return a.contains(t.nodeInfo.pageNumbers,r)}).value();if(l(t.nodeInfo,a.map(i,"nodeInfo"),a.map(o,"nodeInfo"),a.map(s,"nodeInfo")))return t.pageBreak="before",!0}})):!1}function d(t){a.each(t.linearNodeList,function(t){t.resetXY()})}this.docMeasure=new h(e,n,r,this.imageMeasure,this.tableLayouts,u);for(var p=this.tryLayoutDocument(t,e,n,r,i,o,s,u,c);f(p.linearNodeList,p.pages);)d(p),p=this.tryLayoutDocument(t,e,n,r,i,o,s,u,c);return p.pages},i.prototype.tryLayoutDocument=function(t,e,n,r,i,o,a,s,h,l){this.linearNodeList=[],t=this.docMeasure.measureDocument(t),this.writer=new c(new u(this.pageSize,this.pageMargins),this.tracker);var f=this;return this.writer.context().tracker.startTracking("pageAdded",function(){f.addBackground(i)}),this.addBackground(i),this.processNode(t),this.addHeadersAndFooters(o,a),null!=h&&this.addWatermark(h,e),{pages:this.writer.context().pages,linearNodeList:this.linearNodeList}},i.prototype.addBackground=function(t){var e=m(t)?t:function(){return t},n=e(this.writer.context().page+1);if(n){var r=this.writer.context().getCurrentPage().pageSize;this.writer.beginUnbreakableBlock(r.width,r.height),this.processNode(this.docMeasure.measureDocument(n)),this.writer.commitUnbreakableBlock(0,0)}},i.prototype.addStaticRepeatable=function(t,e){this.addDynamicRepeatable(function(){return t},e)},i.prototype.addDynamicRepeatable=function(t,e){for(var n=this.writer.context().pages,r=0,i=n.length;i>r;r++){this.writer.context().page=r;var o=t(r+1,i);if(o){var a=e(this.writer.context().getCurrentPage().pageSize,this.pageMargins);this.writer.beginUnbreakableBlock(a.width,a.height),this.processNode(this.docMeasure.measureDocument(o)),this.writer.commitUnbreakableBlock(a.x,a.y)}}},i.prototype.addHeadersAndFooters=function(t,e){var n=function(t,e){return{x:0,y:0,width:t.width,height:e.top}},r=function(t,e){return{x:0,y:t.height-e.bottom,width:t.width,height:e.bottom}};m(t)?this.addDynamicRepeatable(t,n):t&&this.addStaticRepeatable(t,n),m(e)?this.addDynamicRepeatable(e,r):e&&this.addStaticRepeatable(e,r)},i.prototype.addWatermark=function(t,e){function n(t,e,n){for(var r,i=t.width,o=t.height,a=.8*Math.sqrt(i*i+o*o),s=new y(n),h=new _,u=0,c=1e3,l=(u+c)/2;Math.abs(u-c)>1;)h.push({fontSize:l}),r=s.sizeOfString(e,h),r.width>a?(c=l,l=(u+c)/2):r.widtha;a++)o[a].watermark=i},i.prototype.processNode=function(t){function e(e){var r=t._margin;"before"===t.pageBreak&&n.writer.moveToNextPage(t.pageOrientation),r&&(n.writer.context().moveDown(r[1]),n.writer.context().addMargin(r[0],r[2])),e(),r&&(n.writer.context().addMargin(-r[0],-r[2]),n.writer.context().moveDown(r[3])),"after"===t.pageBreak&&n.writer.moveToNextPage(t.pageOrientation)}var n=this;this.linearNodeList.push(t),o(t),e(function(){var e=t.absolutePosition;if(e&&(n.writer.context().beginDetachedBlock(),n.writer.context().moveTo(e.x||0,e.y||0)),t.stack)n.processVerticalContainer(t);else if(t.columns)n.processColumns(t);else if(t.ul)n.processList(!1,t);else if(t.ol)n.processList(!0,t);else if(t.table)n.processTable(t);else if(void 0!==t.text)n.processLeaf(t);else if(t.image)n.processImage(t);else if(t.canvas)n.processCanvas(t);else if(t.qr)n.processQr(t);else if(!t._span)throw"Unrecognized document structure: "+JSON.stringify(t,v);e&&n.writer.context().endDetachedBlock()})},i.prototype.processVerticalContainer=function(t){var e=this;t.stack.forEach(function(n){e.processNode(n),r(t.positions,n.positions)})},i.prototype.processColumns=function(t){function e(t){if(!t)return null;var e=[];e.push(0);for(var r=n.length-1;r>0;r--)e.push(t);return e}var n=t.columns,i=this.writer.context().availableWidth,o=e(t._gap);o&&(i-=(o.length-1)*t._gap),l.buildColumnWidths(n,i);var a=this.processRow(n,n,o);r(t.positions,a.positions)},i.prototype.processRow=function(t,e,n,i,o){function a(t){for(var e,n=0,r=c.length;r>n;n++){var i=c[n];if(i.prevPage===t.prevPage){e=i;break}}e||(e=t,c.push(e)),e.prevY=Math.max(e.prevY,t.prevY),e.y=Math.min(e.y,t.y)}function s(t){return n&&n.length>t?n[t]:0}function h(t,e){if(t.rowSpan&&t.rowSpan>1){var n=o+t.rowSpan-1;if(n>=i.length)throw"Row span for column "+e+" (with indexes starting from 0) exceeded row count";return i[n][e]}return null}var u=this,c=[],l=[];return this.tracker.auto("pageChanged",a,function(){e=e||t,u.writer.context().beginColumnGroup();for(var i=0,o=t.length;o>i;i++){var a=t[i],c=e[i]._calcWidth,f=s(i);if(a.colSpan&&a.colSpan>1)for(var d=1;dn;n++){e.beginRow(n,this.writer);var o=this.processRow(t.table.body[n],t.table.widths,t._offsets.offsets,t.table.body,n);r(t.positions,o.positions),e.endRow(n,this.writer,o.pageBreaks)}e.endTable(this.writer)},i.prototype.processLeaf=function(t){for(var e=this.buildNextLine(t),n=e?e.getHeight():0,r=t.maxHeight||-1;e&&(-1===r||r>n);){var i=this.writer.addLine(e);t.positions.push(i),e=this.buildNextLine(t),e&&(n+=e.getHeight())}},i.prototype.buildNextLine=function(t){if(!t._inlines||0===t._inlines.length)return null;for(var e=new d(this.writer.context().availableWidth);t._inlines&&t._inlines.length>0&&e.hasEnoughSpaceForInline(t._inlines[0]);)e.addInline(t._inlines.shift());return e.lastLineInParagraph=0===t._inlines.length,e},i.prototype.processImage=function(t){var e=this.writer.addImage(t);t.positions.push(e)},i.prototype.processCanvas=function(t){var e=t._minHeight;this.writer.context().availableHeight=0&&n.splice(r,1)}},n.prototype.emit=function(t){var e=Array.prototype.slice.call(arguments,1),n=this.events[t];n&&n.forEach(function(t){t.apply(this,e)})},n.prototype.auto=function(t,e,n){this.startTracking(t,e),n(),this.stopTracking(t,e)},t.exports=n},function(t,e,n){"use strict";function r(t,e,n,r,a,s){this.textTools=new i(t),this.styleStack=new o(e,n),this.imageMeasure=r,this.tableLayouts=a,this.images=s,this.autoImageIndex=1}var i=n(14),o=n(15),a=n(16),s=n(17).fontStringify,h=n(17).pack,u=n(18);r.prototype.measureDocument=function(t){return this.measureNode(t)},r.prototype.measureNode=function(t){function e(t){var e=t._margin;return e&&(t._minWidth+=e[0]+e[2],t._maxWidth+=e[0]+e[2]),t}function n(){function e(t,e){return t.marginLeft||t.marginTop||t.marginRight||t.marginBottom?[t.marginLeft||e[0]||0,t.marginTop||e[1]||0,t.marginRight||e[2]||0,t.marginBottom||e[3]||0]:e}function n(t){for(var e={},n=t.length-1;n>=0;n--){var i=t[n],o=r.styleStack.styleDictionary[i];for(var a in o)o.hasOwnProperty(a)&&(e[a]=o[a])}return e}function i(t){return"number"==typeof t||t instanceof Number?t=[t,t,t,t]:t instanceof Array&&2===t.length&&(t=[t[0],t[1],t[0],t[1]]),t}var o=[void 0,void 0,void 0,void 0];if(t.style){var a=t.style instanceof Array?t.style:[t.style],s=n(a);s&&(o=e(s,o)),s.margin&&(o=i(s.margin))}return o=e(t,o),t.margin&&(o=i(t.margin)),void 0===o[0]&&void 0===o[1]&&void 0===o[2]&&void 0===o[3]?null:o}t instanceof Array?t={stack:t}:("string"==typeof t||t instanceof String)&&(t={text:t}),0===Object.keys(t).length&&(t={text:""});var r=this;return this.styleStack.auto(t,function(){if(t._margin=n(t),t.columns)return e(r.measureColumns(t));if(t.stack)return e(r.measureVerticalContainer(t));if(t.ul)return e(r.measureList(!1,t));if(t.ol)return e(r.measureList(!0,t));if(t.table)return e(r.measureTable(t));if(void 0!==t.text)return e(r.measureLeaf(t));if(t.image)return e(r.measureImage(t));if(t.canvas)return e(r.measureCanvas(t));if(t.qr)return e(r.measureQr(t));throw"Unrecognized document structure: "+JSON.stringify(t,s)})},r.prototype.convertIfBase64Image=function(t){if(/^data:image\/(jpeg|jpg|png);base64,/.test(t.image)){var e="$$pdfmake$$"+this.autoImageIndex++;this.images[e]=t.image,t.image=e}},r.prototype.measureImage=function(t){this.images&&this.convertIfBase64Image(t);var e=this.imageMeasure.measureImage(t.image);if(t.fit){var n=e.width/e.height>t.fit[0]/t.fit[1]?t.fit[0]/e.width:t.fit[1]/e.height;t._width=t._minWidth=t._maxWidth=e.width*n,t._height=e.height*n}else t._width=t._minWidth=t._maxWidth=t.width||e.width,t._height=t.height||e.height*t._width/e.width;return t._alignment=this.styleStack.getProperty("alignment"),t},r.prototype.measureLeaf=function(t){var e=this.styleStack.clone();e.push(t);var n=this.textTools.buildInlines(t.text,e);return t._inlines=n.items,t._minWidth=n.minWidth,t._maxWidth=n.maxWidth,t},r.prototype.measureVerticalContainer=function(t){var e=t.stack;t._minWidth=0,t._maxWidth=0;for(var n=0,r=e.length;r>n;n++)e[n]=this.measureNode(e[n]),t._minWidth=Math.max(t._minWidth,e[n]._minWidth),t._maxWidth=Math.max(t._maxWidth,e[n]._maxWidth);return t},r.prototype.gapSizeForList=function(t,e){if(t){var n=e.length.toString().replace(/./g,"9");return this.textTools.sizeOfString(n+". ",this.styleStack)}return this.textTools.sizeOfString("9. ",this.styleStack)},r.prototype.buildMarker=function(t,e,n,r){var i;if(t)i={_inlines:this.textTools.buildInlines(e,n).items};else{var o=r.fontSize/6;i={canvas:[{x:o,y:r.height/r.lineHeight+r.decender-r.fontSize/3,r1:o,r2:o,type:"ellipse",color:"black"}]}}return i._minWidth=i._maxWidth=r.width,i._minHeight=i._maxHeight=r.height,i},r.prototype.measureList=function(t,e){var n=this.styleStack.clone(),r=t?e.ol:e.ul;e._gapSize=this.gapSizeForList(t,r),e._minWidth=0,e._maxWidth=0;for(var i=1,o=0,a=r.length;a>o;o++){var s=r[o]=this.measureNode(r[o]),h=i++ +". ";s.ol||s.ul||(s.listMarker=this.buildMarker(t,s.counter||h,n,e._gapSize)),e._minWidth=Math.max(e._minWidth,r[o]._minWidth+e._gapSize.width),e._maxWidth=Math.max(e._maxWidth,r[o]._maxWidth+e._gapSize.width)}return e},r.prototype.measureColumns=function(t){var e=t.columns;t._gap=this.styleStack.getProperty("columnGap")||0;for(var n=0,r=e.length;r>n;n++)e[n]=this.measureNode(e[n]);var i=a.measureMinMax(e);return t._minWidth=i.min+t._gap*(e.length-1),t._maxWidth=i.max+t._gap*(e.length-1),t},r.prototype.measureTable=function(t){function e(t,e){return function(){return null!==e&&"object"==typeof e&&(e.fillColor=t.styleStack.getProperty("fillColor")),t.measureNode(e)}}function n(e){var n=t.layout;("string"==typeof t.layout||t instanceof String)&&(n=e[n]);var r={hLineWidth:function(t,e){return 1},vLineWidth:function(t,e){return 1},hLineColor:function(t,e){return"black"},vLineColor:function(t,e){return"black"},paddingLeft:function(t,e){return 4},paddingRight:function(t,e){return 4},paddingTop:function(t,e){return 2},paddingBottom:function(t,e){return 2}};return h(r,n)}function r(e){for(var n=[],r=0,i=0,o=0,a=t.table.widths.length;a>o;o++){var s=i+e.vLineWidth(o,t)+e.paddingLeft(o,t);n.push(s),r+=s,i=e.paddingRight(o,t)}return r+=i+e.vLineWidth(t.table.widths.length,t),{total:r,offsets:n}}function i(){for(var e,n,r=0,i=g.length;i>r;r++){var a=g[r],s=o(a.col,a.span,t._offsets),h=a.minWidth-s.minWidth,u=a.maxWidth-s.maxWidth;if(h>0)for(e=h/a.span,n=0;n0)for(e=u/a.span,n=0;no;o++)i.minWidth+=t.table.widths[e+o]._minWidth+(o?r.offsets[e+o]:0),i.maxWidth+=t.table.widths[e+o]._maxWidth+(o?r.offsets[e+o]:0);return i}function s(t,e,n){for(var r=1;n>r;r++)t[e+r]={_span:!0,_minWidth:0,_maxWidth:0,rowSpan:t[e].rowSpan}}function u(t,e,n,r){for(var i=1;r>i;i++)t.body[e+i][n]={_span:!0,_minWidth:0,_maxWidth:0,fillColor:t.body[e][n].fillColor}}function c(t){if(t.table.widths||(t.table.widths="auto"),"string"==typeof t.table.widths||t.table.widths instanceof String)for(t.table.widths=[t.table.widths];t.table.widths.lengthe;e++){var r=t.table.widths[e];("number"==typeof r||r instanceof Number||"string"==typeof r||r instanceof String)&&(t.table.widths[e]={width:r})}}c(t),t._layout=n(this.tableLayouts),t._offsets=r(t._layout);var l,f,d,p,g=[];for(l=0,d=t.table.body[0].length;d>l;l++){var v=t.table.widths[l];for(v._minWidth=0,v._maxWidth=0,f=0,p=t.table.body.length;p>f;f++){var m=t.table.body[f],y=m[l];if(!y._span){y=m[l]=this.styleStack.auto(y,e(this,y)),y.colSpan&&y.colSpan>1?(s(m,l,y.colSpan),g.push({col:l,span:y.colSpan,minWidth:y._minWidth,maxWidth:y._maxWidth})):(v._minWidth=Math.max(v._minWidth,y._minWidth),v._maxWidth=Math.max(v._maxWidth,y._maxWidth))}y.rowSpan&&y.rowSpan>1&&u(t.table,f,l,y.rowSpan)}}i();var _=a.measureMinMax(t.table.widths);return t._minWidth=_.min+t._offsets.total,t._maxWidth=_.max+t._offsets.total,t},r.prototype.measureCanvas=function(t){for(var e=0,n=0,r=0,i=t.canvas.length;i>r;r++){var o=t.canvas[r];switch(o.type){case"ellipse":e=Math.max(e,o.x+o.r1),n=Math.max(n,o.y+o.r2);break;case"rect":e=Math.max(e,o.x+o.w),n=Math.max(n,o.y+o.h);break;case"line":e=Math.max(e,o.x1,o.x2),n=Math.max(n,o.y1,o.y2);break;case"polyline":for(var a=0,s=o.points.length;s>a;a++)e=Math.max(e,o.points[a].x),n=Math.max(n,o.points[a].y)}}return t._minWidth=t._maxWidth=e,t._minHeight=t._maxHeight=n,t},r.prototype.measureQr=function(t){return t=u.measure(t),t._alignment=this.styleStack.getProperty("alignment"),t},t.exports=r},function(t,e){"use strict";function n(t){this.fontProvider=t}function r(t,e){var n=[];t=t.replace(" "," ");var r;r=e?[t,""]:t.match(u);for(var i=0,o=r.length;o-1>i;i++){var a=r[i],s=0===a.length;if(s){var h=0===n.length||n[n.length-1].lineEnd;h?n.push({text:"",lineEnd:!0}):n[n.length-1].lineEnd=!0}else n.push({text:a})}return n}function i(t,e){e=e||{},t=t||{};for(var n in t)"text"!=n&&t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function o(t){var e=[];("string"==typeof t||t instanceof String)&&(t=[t]);for(var n=0,o=t.length;o>n;n++){var a,s=t[n],h=null;"string"==typeof s||s instanceof String?a=r(s):(a=r(s.text,s.noWrap),h=i(s));for(var u=0,c=a.length;c>u;u++){var l={text:a[u].text};a[u].lineEnd&&(l.lineEnd=!0),i(h,l),e.push(l)}}return e}function a(t){return t.replace(/[^A-Za-z0-9\[\] ]/g,function(t){return f[t]||t})}function s(t,e,n,r){var i;return void 0!==t[n]&&null!==t[n]?t[n]:e?(e.auto(t,function(){i=e.getProperty(n)}),null!==i&&void 0!==i?i:r):r}function h(t,e,n){var r=o(e);return r.forEach(function(e){var r=s(e,n,"font","Roboto"),i=s(e,n,"fontSize",12),o=s(e,n,"bold",!1),h=s(e,n,"italics",!1),u=s(e,n,"color","black"),f=s(e,n,"decoration",null),d=s(e,n,"decorationColor",null),p=s(e,n,"decorationStyle",null),g=s(e,n,"background",null),v=s(e,n,"lineHeight",1),m=t.provideFont(r,o,h);e.width=m.widthOfString(a(e.text),i),e.height=m.lineHeight(i)*v;var y=e.text.match(c),_=e.text.match(l);y?e.leadingCut=m.widthOfString(y[0],i):e.leadingCut=0,_?e.trailingCut=m.widthOfString(_[0],i):e.trailingCut=0,e.alignment=s(e,n,"alignment","left"),e.font=m,e.fontSize=i,e.color=u,e.decoration=f,e.decorationColor=d,e.decorationStyle=p,e.background=g}),r}var u=/([^ ,\/!.?:;\-\n]*[ ,\/!.?:;\-]*)|\n/g,c=/^(\s)+/g,l=/(\s)+$/g;n.prototype.buildInlines=function(t,e){function n(t){return Math.max(0,t.width-t.leadingCut-t.trailingCut)}var r,i=h(this.fontProvider,t,e),o=0,a=0;return i.forEach(function(t){o=Math.max(o,t.width-t.leadingCut-t.trailingCut),r||(r={width:0,leadingCut:t.leadingCut,trailingCut:0}),r.width+=t.width,r.trailingCut=t.trailingCut,a=Math.max(a,n(r)),t.lineEnd&&(r=null)}),s({},e,"noWrap",!1)&&(o=a),{items:i,minWidth:o,maxWidth:a}},n.prototype.sizeOfString=function(t,e){t=t.replace(" "," ");var n=s({},e,"font","Roboto"),r=s({},e,"fontSize",12),i=s({},e,"bold",!1),o=s({},e,"italics",!1),h=s({},e,"lineHeight",1),u=this.fontProvider.provideFont(n,i,o);return{width:u.widthOfString(a(t),r),height:u.lineHeight(r)*h,fontSize:r,lineHeight:h,ascender:u.ascender/1e3*r,decender:u.decender/1e3*r}};var f={"Ą":"A","Ć":"C","Ę":"E","Ł":"L","Ń":"N","Ó":"O","Ś":"S","Ź":"Z","Ż":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ó":"o","ś":"s","ź":"z","ż":"z"};t.exports=n},function(t,e){"use strict";function n(t,e){this.defaultStyle=e||{},this.styleDictionary=t,this.styleOverrides=[]}n.prototype.clone=function(){var t=new n(this.styleDictionary,this.defaultStyle);return this.styleOverrides.forEach(function(e){t.styleOverrides.push(e)}),t},n.prototype.push=function(t){this.styleOverrides.push(t)},n.prototype.pop=function(t){for(t=t||1;t-- >0;)this.styleOverrides.pop()},n.prototype.autopush=function(t){if("string"==typeof t||t instanceof String)return 0;var e=[];t.style&&(e=t.style instanceof Array?t.style:[t.style]);for(var n=0,r=e.length;r>n;n++)this.push(e[n]);var i={},o=!1;return["font","fontSize","bold","italics","alignment","color","columnGap","fillColor","decoration","decorationStyle","decorationColor","background","lineHeight","noWrap"].forEach(function(e){void 0!==t[e]&&null!==t[e]&&(i[e]=t[e],o=!0)}),o&&this.push(i),e.length+(o?1:0)},n.prototype.auto=function(t,e){var n=this.autopush(t),r=e();return n>0&&this.pop(n),r},n.prototype.getProperty=function(t){if(this.styleOverrides)for(var e=this.styleOverrides.length-1;e>=0;e--){var n=this.styleOverrides[e];if("string"==typeof n||n instanceof String){var r=this.styleDictionary[n];if(r&&null!==r[t]&&void 0!==r[t])return r[t]}else if(void 0!==n[t]&&null!==n[t])return n[t]}return this.defaultStyle&&this.defaultStyle[t]},t.exports=n},function(t,e){"use strict";function n(t,e){var n=[],o=0,a=0,s=[],h=0,u=0,c=[],l=e;t.forEach(function(t){r(t)?(n.push(t),o+=t._minWidth,a+=t._maxWidth):i(t)?(s.push(t),h=Math.max(h,t._minWidth),u=Math.max(u,t._maxWidth)):c.push(t)}),c.forEach(function(t){"string"==typeof t.width&&/\d+%/.test(t.width)&&(t.width=parseFloat(t.width)*l/100),t.width=e)n.forEach(function(t){t._calcWidth=t._minWidth}),s.forEach(function(t){t._calcWidth=h});else{if(e>d)n.forEach(function(t){t._calcWidth=t._maxWidth,e-=t._calcWidth});else{var p=e-f,g=d-f;n.forEach(function(t){var n=t._maxWidth-t._minWidth;t._calcWidth=t._minWidth+n*p/g,e-=t._calcWidth})}if(s.length>0){var v=e/s.length;s.forEach(function(t){t._calcWidth=v})}}}function r(t){return"auto"===t.width}function i(t){return null===t.width||void 0===t.width||"*"===t.width||"star"===t.width}function o(t){for(var e={min:0,max:0},n={min:0,max:0},o=0,a=0,s=t.length;s>a;a++){var h=t[a];i(h)?(n.min=Math.max(n.min,h._minWidth),n.max=Math.max(n.max,h._maxWidth),o++):r(h)?(e.min+=h._minWidth,e.max+=h._maxWidth):(e.min+=void 0!==h.width&&h.width||h._minWidth,e.max+=void 0!==h.width&&h.width||h._maxWidth)}return o&&(e.min+=o*n.min,e.max+=o*n.max),e}t.exports={buildColumnWidths:n,measureMinMax:o,isAutoColumn:r,isStarColumn:i}},function(t,e){"use strict";function n(){for(var t={},e=0,n=arguments.length;n>e;e++){var r=arguments[e];if(r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}function r(t,e,n){switch(t.type){case"ellipse":case"rect":t.x+=e,t.y+=n;break;case"line":t.x1+=e,t.x2+=e,t.y1+=n,t.y2+=n;break;case"polyline":for(var r=0,i=t.points.length;i>r;r++)t.points[r].x+=e,t.points[r].y+=n}}function i(t,e){return"font"===t?"font":e}function o(t){var e={};return t&&"[object Function]"===e.toString.call(t)}t.exports={pack:n,fontStringify:i,offsetVector:r,isFunction:o}},function(t,e){"use strict";function n(t,e){var n={numeric:s,alphanumeric:h,octet:u},r={L:p,M:g,Q:v,H:m};e=e||{};var i=e.version||-1,o=r[(e.eccLevel||"L").toUpperCase()],a=e.mode?n[e.mode.toLowerCase()]:-1,c="mask"in e?e.mask:-1;if(0>a)a="string"==typeof t?t.match(l)?s:t.match(d)?h:u:u;else if(a!=s&&a!=h&&a!=u)throw"invalid or unsupported mode";if(t=U(a,t),null===t)throw"invalid data format";if(0>o||o>3)throw"invalid ECC level";if(0>i){for(i=1;40>=i&&!(t.length<=D(i,a,o));++i);if(i>40)throw"too large data for the Qr format"}else if(1>i||i>40)throw"invalid Qr version! should be between 1 and 40";if(-1!=c&&(0>c||c>8))throw"invalid mask";return Y(t,i,a,o,c)}function r(t,e){var r=[],i=t.background||"#fff",o=t.foreground||"#000",a=n(t,e),s=a.length,h=Math.floor(e.fit?e.fit/s:5),u=s*h;r.push({type:"rect",x:0,y:0,w:u,h:u,lineWidth:0,color:i});for(var c=0;s>c;++c)for(var l=0;s>l;++l)a[c][l]&&r.push({type:"rect",x:h*c,y:h*l,w:h,h:h,lineWidth:0,color:o});return{canvas:r,size:u}}function i(t){var e=r(t.qr,t);return t._canvas=e.canvas,t._width=t._height=t._minWidth=t._maxWidth=t._minHeight=t._maxHeight=e.size,t}for(var o=[null,[[10,7,17,13],[1,1,1,1],[]],[[16,10,28,22],[1,1,1,1],[4,16]],[[26,15,22,18],[1,1,2,2],[4,20]],[[18,20,16,26],[2,1,4,2],[4,24]],[[24,26,22,18],[2,1,4,4],[4,28]],[[16,18,28,24],[4,2,4,4],[4,32]],[[18,20,26,18],[4,2,5,6],[4,20,36]],[[22,24,26,22],[4,2,6,6],[4,22,40]],[[22,30,24,20],[5,2,8,8],[4,24,44]],[[26,18,28,24],[5,4,8,8],[4,26,48]],[[30,20,24,28],[5,4,11,8],[4,28,52]],[[22,24,28,26],[8,4,11,10],[4,30,56]],[[22,26,22,24],[9,4,16,12],[4,32,60]],[[24,30,24,20],[9,4,16,16],[4,24,44,64]],[[24,22,24,30],[10,6,18,12],[4,24,46,68]],[[28,24,30,24],[10,6,16,17],[4,24,48,72]],[[28,28,28,28],[11,6,19,16],[4,28,52,76]],[[26,30,28,28],[13,6,21,18],[4,28,54,80]],[[26,28,26,26],[14,7,25,21],[4,28,56,84]],[[26,28,28,30],[16,8,25,20],[4,32,60,88]],[[26,28,30,28],[17,8,25,23],[4,26,48,70,92]],[[28,28,24,30],[17,9,34,23],[4,24,48,72,96]],[[28,30,30,30],[18,9,30,25],[4,28,52,76,100]],[[28,30,30,30],[20,10,32,27],[4,26,52,78,104]],[[28,26,30,30],[21,12,35,29],[4,30,56,82,108]],[[28,28,30,28],[23,12,37,34],[4,28,56,84,112]],[[28,30,30,30],[25,12,40,34],[4,32,60,88,116]],[[28,30,30,30],[26,13,42,35],[4,24,48,72,96,120]],[[28,30,30,30],[28,14,45,38],[4,28,52,76,100,124]],[[28,30,30,30],[29,15,48,40],[4,24,50,76,102,128]],[[28,30,30,30],[31,16,51,43],[4,28,54,80,106,132]],[[28,30,30,30],[33,17,54,45],[4,32,58,84,110,136]],[[28,30,30,30],[35,18,57,48],[4,28,56,84,112,140]],[[28,30,30,30],[37,19,60,51],[4,32,60,88,116,144]],[[28,30,30,30],[38,19,63,53],[4,28,52,76,100,124,148]],[[28,30,30,30],[40,20,66,56],[4,22,48,74,100,126,152]],[[28,30,30,30],[43,21,70,59],[4,26,52,78,104,130,156]],[[28,30,30,30],[45,22,74,62],[4,30,56,82,108,134,160]],[[28,30,30,30],[47,24,77,65],[4,24,52,80,108,136,164]],[[28,30,30,30],[49,25,81,68],[4,28,56,84,112,140,168]]],a=0,s=1,h=2,u=4,c=8,l=/^\d*$/,f=/^[A-Za-z0-9 $%*+\-./:]*$/,d=/^[A-Z0-9 $%*+\-./:]*$/,p=1,g=0,v=3,m=2,y=[],_=[-1],w=0,b=1;255>w;++w)y.push(b), +_[b]=w,b=2*b^(b>=128?285:0);for(var x=[[]],w=0;30>w;++w){for(var S=x[w],k=[],E=0;w>=E;++E){var C=w>E?y[S[E]]:0,I=y[(w+(S[E-1]||0))%255];k.push(_[C^I])}x.push(k)}for(var A={},w=0;45>w;++w)A["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".charAt(w)]=w;var L=[function(t,e){return(t+e)%2===0},function(t,e){return t%2===0},function(t,e){return e%3===0},function(t,e){return(t+e)%3===0},function(t,e){return((t/2|0)+(e/3|0))%2===0},function(t,e){return t*e%2+t*e%3===0},function(t,e){return(t*e%2+t*e%3)%2===0},function(t,e){return((t+e)%2+t*e%3)%2===0}],R=function(t){return t>6},T=function(t){return 4*t+17},B=function(t){var e=o[t],n=16*t*t+128*t+64;return R(t)&&(n-=36),e[2].length&&(n-=25*e[2].length*e[2].length-10*e[2].length-55),n},O=function(t,e){var n=-8&B(t),r=o[t];return n-=8*r[0][e]*r[1][e]},M=function(t,e){switch(e){case s:return 10>t?10:27>t?12:14;case h:return 10>t?9:27>t?11:13;case u:return 10>t?8:16;case c:return 10>t?8:27>t?10:12}},D=function(t,e,n){var r=O(t,n)-4-M(t,e);switch(e){case s:return 3*(r/10|0)+(4>r%10?0:7>r%10?1:2);case h:return 2*(r/11|0)+(6>r%11?0:1);case u:return r/8|0;case c:return r/13|0}},U=function(t,e){switch(t){case s:return e.match(l)?e:null;case h:return e.match(f)?e.toUpperCase():null;case u:if("string"==typeof e){for(var n=[],r=0;ri?n.push(i):2048>i?n.push(192|i>>6,128|63&i):65536>i?n.push(224|i>>12,128|i>>6&63,128|63&i):n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i)}return n}return e}},P=function(t,e,n,r){var i=[],o=0,c=8,l=n.length,f=function(t,e){if(e>=c){for(i.push(o|t>>(e-=c));e>=8;)i.push(t>>(e-=8)&255);o=0,c=8}e>0&&(o|=(t&(1<p;p+=3)f(parseInt(n.substring(p-2,p+1),10),10);f(parseInt(n.substring(p-2),10),[0,4,7][l%3]);break;case h:for(var p=1;l>p;p+=2)f(45*A[n.charAt(p-1)]+A[n.charAt(p)],11);l%2==1&&f(A[n.charAt(p-1)],6);break;case u:for(var p=0;l>p;++p)f(n[p],8)}for(f(a,4),8>c&&i.push(o);i.length+1o;++o)n.push(0);for(var o=0;r>o;){var a=_[n[o++]];if(a>=0)for(var s=0;i>s;++s)n[o+s]^=y[(a+e[s])%255]}return n.slice(r)},F=function(t,e,n){for(var r=[],i=t.length/e|0,o=0,a=e-t.length%e,s=0;a>s;++s)r.push(o),o+=i;for(var s=a;e>s;++s)r.push(o),o+=i+1;r.push(o);for(var h=[],s=0;e>s;++s)h.push(z(t.slice(r[s],r[s+1]),n));for(var u=[],c=t.length/e|0,s=0;c>s;++s)for(var l=0;e>l;++l)u.push(t[r[l]+s]);for(var l=a;e>l;++l)u.push(t[r[l+1]-1]);for(var s=0;sl;++l)u.push(h[l][s]);return u},W=function(t,e,n,r){for(var i=t<=0;--o)i>>r+o&1&&(i^=n<a;++a)r.push([]),i.push([]);var s=function(t,e,n,o,a){for(var s=0;n>s;++s)for(var h=0;o>h;++h)r[t+s][e+h]=a[s]>>h&1,i[t+s][e+h]=1};s(0,0,9,9,[127,65,93,93,93,65,383,0,64]),s(n-8,0,8,9,[256,127,65,93,93,93,65,127]),s(0,n-8,9,8,[254,130,186,186,186,130,254,0,0]);for(var a=9;n-8>a;++a)r[6][a]=r[a][6]=1&~a,i[6][a]=i[a][6]=1;for(var h=e[2],u=h.length,a=0;u>a;++a)for(var c=0===a||a===u-1?1:0,l=0===a?u-1:u,f=c;l>f;++f)s(h[a],h[f],5,5,[31,17,21,17,31]);if(R(t))for(var d=W(t,6,7973,12),p=0,a=0;6>a;++a)for(var f=0;3>f;++f)r[a][n-11+f]=r[n-11+f][a]=d>>p++&1,i[a][n-11+f]=i[n-11+f][a]=1;return{matrix:r,reserved:i}},j=function(t,e,n){for(var r=t.length,i=0,o=-1,a=r-1;a>=0;a-=2){6==a&&--a;for(var s=0>o?r-1:0,h=0;r>h;++h){for(var u=a;u>a-2;--u)e[s][u]||(t[s][u]=n[i>>3]>>(7&~i)&1,++i);s+=o}o=-o}return t},H=function(t,e,n){for(var r=L[n],i=t.length,o=0;i>o;++o)for(var a=0;i>a;++a)e[o][a]||(t[o][a]^=r(o,a));return t},Z=function(t,e,n,r){for(var i=t.length,o=21522^W(n<<3|r,5,1335,10),a=0;15>a;++a){var s=[0,1,2,3,4,5,7,8,i-7,i-6,i-5,i-4,i-3,i-2,i-1][a],h=[i-1,i-2,i-3,i-4,i-5,i-6,i-7,i-8,7,5,4,3,2,1,0][a];t[s][8]=t[8][h]=o>>a&1}return t},G=function(t){for(var e=3,n=3,r=40,i=10,o=function(t){for(var n=0,i=0;i=5&&(n+=e+(t[i]-5));for(var i=5;i=4*o||t[i+1]>=4*o)&&(n+=r)}return n},a=t.length,s=0,h=0,u=0;a>u;++u){var c,l=t[u];c=[0];for(var f=0;a>f;){var d;for(d=0;a>f&&l[f];++d)++f;for(c.push(d),d=0;a>f&&!l[f];++d)++f;c.push(d)}s+=o(c),c=[0];for(var f=0;a>f;){var d;for(d=0;a>f&&t[f][u];++d)++f;for(c.push(d),d=0;a>f&&!t[f][u];++d)++f;c.push(d)}s+=o(c);var p=t[u+1]||[];h+=l[0];for(var f=1;a>f;++f){var g=l[f];h+=g,l[f-1]==g&&p[f]===g&&p[f-1]===g&&(s+=n)}}return s+=i*(Math.abs(h/a/a-.5)/.05|0)},Y=function(t,e,n,r,i){var a=o[e],s=P(e,n,t,O(e,r)>>3);s=F(s,a[1][r],x[a[0][r]]);var h=N(e),u=h.matrix,c=h.reserved;if(j(u,c,s),0>i){H(u,c,0),Z(u,c,r,0);var l=0,f=G(u);for(H(u,c,0),i=1;8>i;++i){H(u,c,i),Z(u,c,r,i);var d=G(u);f>d&&(f=d,l=i),H(u,c,i)}i=l}return H(u,c,i),Z(u,c,r,i),u};t.exports={measure:i}},function(t,e,n){"use strict";function r(t,e){this.pages=[],this.pageMargins=e,this.x=e.left,this.availableWidth=t.width-e.left-e.right,this.availableHeight=0,this.page=-1,this.snapshots=[],this.endingCell=null,this.tracker=new a,this.addPage(t)}function i(t,e){return void 0===t?e:"landscape"===t?"landscape":"portrait"}function o(t,e){var n;return n=t.page>e.page?t:e.page>t.page?e:t.y>e.y?t:e,{page:n.page,x:n.x,y:n.y,availableHeight:n.availableHeight,availableWidth:n.availableWidth}}var a=n(12);r.prototype.beginColumnGroup=function(){this.snapshots.push({x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,page:this.page,bottomMost:{y:this.y,page:this.page},endingCell:this.endingCell,lastColumnWidth:this.lastColumnWidth}),this.lastColumnWidth=0},r.prototype.beginColumn=function(t,e,n){var r=this.snapshots[this.snapshots.length-1];this.calculateBottomMost(r),this.endingCell=n,this.page=r.page,this.x=this.x+this.lastColumnWidth+(e||0),this.y=r.y,this.availableWidth=t,this.availableHeight=r.availableHeight,this.lastColumnWidth=t},r.prototype.calculateBottomMost=function(t){this.endingCell?(this.saveContextInEndingCell(this.endingCell),this.endingCell=null):t.bottomMost=o(this,t.bottomMost)},r.prototype.markEnding=function(t){this.page=t._columnEndingContext.page,this.x=t._columnEndingContext.x,this.y=t._columnEndingContext.y,this.availableWidth=t._columnEndingContext.availableWidth,this.availableHeight=t._columnEndingContext.availableHeight,this.lastColumnWidth=t._columnEndingContext.lastColumnWidth},r.prototype.saveContextInEndingCell=function(t){t._columnEndingContext={page:this.page,x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,lastColumnWidth:this.lastColumnWidth}},r.prototype.completeColumnGroup=function(){var t=this.snapshots.pop();this.calculateBottomMost(t),this.endingCell=null,this.x=t.x,this.y=t.bottomMost.y,this.page=t.bottomMost.page,this.availableWidth=t.availableWidth,this.availableHeight=t.bottomMost.availableHeight,this.lastColumnWidth=t.lastColumnWidth},r.prototype.addMargin=function(t,e){this.x+=t,this.availableWidth-=t+(e||0)},r.prototype.moveDown=function(t){return this.y+=t,this.availableHeight-=t,this.availableHeight>0},r.prototype.initializePage=function(){this.y=this.pageMargins.top,this.availableHeight=this.getCurrentPage().pageSize.height-this.pageMargins.top-this.pageMargins.bottom,this.pageSnapshot().availableWidth=this.getCurrentPage().pageSize.width-this.pageMargins.left-this.pageMargins.right},r.prototype.pageSnapshot=function(){return this.snapshots[0]?this.snapshots[0]:this},r.prototype.moveTo=function(t,e){void 0!==t&&null!==t&&(this.x=t,this.availableWidth=this.getCurrentPage().pageSize.width-this.x-this.pageMargins.right),void 0!==e&&null!==e&&(this.y=e,this.availableHeight=this.getCurrentPage().pageSize.height-this.y-this.pageMargins.bottom)},r.prototype.beginDetachedBlock=function(){this.snapshots.push({x:this.x,y:this.y,availableHeight:this.availableHeight,availableWidth:this.availableWidth,page:this.page,endingCell:this.endingCell,lastColumnWidth:this.lastColumnWidth})},r.prototype.endDetachedBlock=function(){var t=this.snapshots.pop();this.x=t.x,this.y=t.y,this.availableWidth=t.availableWidth,this.availableHeight=t.availableHeight,this.page=t.page,this.endingCell=t.endingCell,this.lastColumnWidth=t.lastColumnWidth};var s=function(t,e){return e=i(e,t.pageSize.orientation),e!==t.pageSize.orientation?{orientation:e,width:t.pageSize.height,height:t.pageSize.width}:{orientation:t.pageSize.orientation,width:t.pageSize.width,height:t.pageSize.height}};r.prototype.moveToNextPage=function(t){var e=this.page+1,n=this.page,r=this.y,i=e>=this.pages.length;return i?this.addPage(s(this.getCurrentPage(),t)):(this.page=e,this.initializePage()),{newPageCreated:i,prevPage:n,prevY:r,y:this.y}},r.prototype.addPage=function(t){var e={items:[],pageSize:t};return this.pages.push(e),this.page=this.pages.length-1,this.initializePage(),this.tracker.emit("pageAdded"),e},r.prototype.getCurrentPage=function(){return this.page<0||this.page>=this.pages.length?null:this.pages[this.page]},r.prototype.getCurrentPosition=function(){var t=this.getCurrentPage().pageSize,e=t.height-this.pageMargins.top-this.pageMargins.bottom,n=t.width-this.pageMargins.left-this.pageMargins.right;return{pageNumber:this.page+1,pageOrientation:t.orientation,pageInnerHeight:e,pageInnerWidth:n,left:this.x,top:this.y,verticalRatio:(this.y-this.pageMargins.top)/e,horizontalRatio:(this.x-this.pageMargins.left)/n}},t.exports=r},function(t,e,n){"use strict";function r(t,e){this.transactionLevel=0,this.repeatables=[],this.tracker=e,this.writer=new o(t,e)}function i(t,e){var n=e(t);return n||(t.moveToNextPage(),n=e(t)),n}var o=n(21);r.prototype.addLine=function(t,e,n){return i(this,function(r){return r.writer.addLine(t,e,n)})},r.prototype.addImage=function(t,e){return i(this,function(n){return n.writer.addImage(t,e)})},r.prototype.addQr=function(t,e){return i(this,function(n){return n.writer.addQr(t,e)})},r.prototype.addVector=function(t,e,n,r){return this.writer.addVector(t,e,n,r)},r.prototype.addFragment=function(t,e,n,r){this.writer.addFragment(t,e,n,r)||(this.moveToNextPage(),this.writer.addFragment(t,e,n,r))},r.prototype.moveToNextPage=function(t){var e=this.writer.context.moveToNextPage(t);e.newPageCreated?this.repeatables.forEach(function(t){this.writer.addFragment(t,!0)},this):this.repeatables.forEach(function(t){this.writer.context.moveDown(t.height)},this),this.writer.tracker.emit("pageChanged",{prevPage:e.prevPage,prevY:e.prevY,y:e.y})},r.prototype.beginUnbreakableBlock=function(t,e){0===this.transactionLevel++&&(this.originalX=this.writer.context.x,this.writer.pushContext(t,e))},r.prototype.commitUnbreakableBlock=function(t,e){if(0===--this.transactionLevel){var n=this.writer.context;this.writer.popContext();var r=n.pages.length;if(r>0){var i=n.pages[0];if(i.xOffset=t,i.yOffset=e,r>1)if(void 0!==t||void 0!==e)i.height=n.getCurrentPage().pageSize.height-n.pageMargins.top-n.pageMargins.bottom;else{i.height=this.writer.context.getCurrentPage().pageSize.height-this.writer.context.pageMargins.top-this.writer.context.pageMargins.bottom;for(var o=0,a=this.repeatables.length;a>o;o++)i.height-=this.repeatables[o].height}else i.height=n.y;void 0!==t||void 0!==e?this.writer.addFragment(i,!0,!0,!0):this.addFragment(i)}}},r.prototype.currentBlockToRepeatable=function(){var t=this.writer.context,e={items:[]};return t.pages[0].items.forEach(function(t){e.items.push(t)}),e.xOffset=this.originalX,e.height=t.y,e},r.prototype.pushToRepeatables=function(t){this.repeatables.push(t)},r.prototype.popFromRepeatables=function(){this.repeatables.pop()},r.prototype.context=function(){return this.writer.context},t.exports=r},function(t,e,n){"use strict";function r(t,e){this.context=t,this.contextStack=[],this.tracker=e}function i(t,e,n){null===n||void 0===n||0>n||n>t.items.length?t.items.push(e):t.items.splice(n,0,e)}function o(t){var e=new a(t.maxWidth);for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var a=n(22),s=n(17).pack,h=n(17).offsetVector,u=n(19);r.prototype.addLine=function(t,e,n){var r=t.getHeight(),o=this.context,a=o.getCurrentPage(),s=this.getCurrentPositionOnPage();return o.availableHeight0&&t.inlines[0].alignment,i=0;switch(r){case"right":i=e-n;break;case"center":i=(e-n)/2}if(i&&(t.x=(t.x||0)+i),"justify"===r&&!t.newLineForced&&!t.lastLineInParagraph&&t.inlines.length>1)for(var o=(e-n)/(t.inlines.length-1),a=1,s=t.inlines.length;s>a;a++)i=a*o,t.inlines[a].x+=i},r.prototype.addImage=function(t,e){var n=this.context,r=n.getCurrentPage(),o=this.getCurrentPositionOnPage();return n.availableHeighto;o++){var s=t._canvas[o];s.x+=t.x,s.y+=t.y,this.addVector(s,!0,!0,e)}return n.moveDown(t._height),i},r.prototype.alignImage=function(t){var e=this.context.availableWidth,n=t._minWidth,r=0;switch(t._alignment){case"right":r=e-n;break;case"center":r=(e-n)/2}r&&(t.x=(t.x||0)+r)},r.prototype.addVector=function(t,e,n,r){var o=this.context,a=o.getCurrentPage(),s=this.getCurrentPositionOnPage();return a?(h(t,e?0:o.x,n?0:o.y),i(a,{type:"vector",item:t},r),s):void 0},r.prototype.addFragment=function(t,e,n,r){var i=this.context,a=i.getCurrentPage();return!e&&t.height>i.availableHeight?!1:(t.items.forEach(function(r){switch(r.type){case"line":var u=o(r.item);u.x=(u.x||0)+(e?t.xOffset||0:i.x),u.y=(u.y||0)+(n?t.yOffset||0:i.y),a.items.push({type:"line",item:u});break;case"vector":var c=s(r.item);h(c,e?t.xOffset||0:i.x,n?t.yOffset||0:i.y),a.items.push({type:"vector",item:c});break;case"image":var l=s(r.item);l.x=(l.x||0)+(e?t.xOffset||0:i.x),l.y=(l.y||0)+(n?t.yOffset||0:i.y),a.items.push({type:"image",item:l})}}),r||i.moveDown(t.height),!0)},r.prototype.pushContext=function(t,e){void 0===t&&(e=this.context.getCurrentPage().height-this.context.pageMargins.top-this.context.pageMargins.bottom,t=this.context.availableWidth),("number"==typeof t||t instanceof Number)&&(t=new u({width:t,height:e},{left:0,right:0,top:0,bottom:0})),this.contextStack.push(this.context),this.context=t},r.prototype.popContext=function(){this.context=this.contextStack.pop()},r.prototype.getCurrentPositionOnPage=function(){return(this.contextStack[0]||this.context).getCurrentPosition()},t.exports=r},function(t,e){"use strict";function n(t){this.maxWidth=t,this.leadingCut=0,this.trailingCut=0,this.inlineWidths=0,this.inlines=[]}n.prototype.getAscenderHeight=function(){var t=0;return this.inlines.forEach(function(e){t=Math.max(t,e.font.ascender/1e3*e.fontSize)}),t},n.prototype.hasEnoughSpaceForInline=function(t){return 0===this.inlines.length?!0:this.newLineForced?!1:this.inlineWidths+t.width-this.leadingCut-(t.trailingCut||0)<=this.maxWidth},n.prototype.addInline=function(t){0===this.inlines.length&&(this.leadingCut=t.leadingCut||0),this.trailingCut=t.trailingCut||0,t.x=this.inlineWidths-this.leadingCut,this.inlines.push(t),this.inlineWidths+=t.width,t.lineEnd&&(this.newLineForced=!0)},n.prototype.getWidth=function(){return this.inlineWidths-this.leadingCut-this.trailingCut},n.prototype.getHeight=function(){var t=0;return this.inlines.forEach(function(e){t=Math.max(t,e.height||0)}),t},t.exports=n},function(t,e,n){"use strict";function r(t){this.tableNode=t}var i=n(16);r.prototype.beginTable=function(t){function e(){var t=0;return r.table.widths.forEach(function(e){t+=e._calcWidth}),t}function n(){var t=[],e=0,n=0;t.push({left:0,rowSpan:0});for(var r=0,i=a.tableNode.table.body[0].length;i>r;r++){var o=a.layout.paddingLeft(r,a.tableNode)+a.layout.paddingRight(r,a.tableNode),s=a.layout.vLineWidth(r,a.tableNode);n=o+s+a.tableNode.table.widths[r]._calcWidth,t[t.length-1].width=n,e+=n,t.push({left:e,rowSpan:0,width:0})}return t}var r,o,a=this;r=this.tableNode,this.offsets=r._offsets,this.layout=r._layout,o=t.context().availableWidth-this.offsets.total,i.buildColumnWidths(r.table.widths,o),this.tableWidth=r._offsets.total+e(),this.rowSpanData=n(),this.cleanUpRepeatables=!1,this.headerRows=r.table.headerRows||0,this.rowsWithoutPageBreak=this.headerRows+(r.table.keepWithHeaderRows||0),this.dontBreakRows=r.table.dontBreakRows||!1,this.rowsWithoutPageBreak&&t.beginUnbreakableBlock(),this.drawHorizontalLine(0,t)},r.prototype.onRowBreak=function(t,e){var n=this;return function(){var t=n.rowPaddingTop+(n.headerRows?0:n.topLineWidth);e.context().moveDown(t)}},r.prototype.beginRow=function(t,e){this.topLineWidth=this.layout.hLineWidth(t,this.tableNode),this.rowPaddingTop=this.layout.paddingTop(t,this.tableNode),this.bottomLineWidth=this.layout.hLineWidth(t+1,this.tableNode),this.rowPaddingBottom=this.layout.paddingBottom(t,this.tableNode),this.rowCallback=this.onRowBreak(t,e),e.tracker.startTracking("pageChanged",this.rowCallback),this.dontBreakRows&&e.beginUnbreakableBlock(),this.rowTopY=e.context().y,this.reservedAtBottom=this.bottomLineWidth+this.rowPaddingBottom,e.context().availableHeight-=this.reservedAtBottom,e.context().moveDown(this.rowPaddingTop)},r.prototype.drawHorizontalLine=function(t,e,n){var r=this.layout.hLineWidth(t,this.tableNode);if(r){for(var i=r/2,o=null,a=0,s=this.rowSpanData.length;s>a;a++){var h=this.rowSpanData[a],u=!h.rowSpan;!o&&u&&(o={left:h.left,width:0}),u&&(o.width+=h.width||0);var c=(n||0)+i;u&&a!==s-1||o&&(e.addVector({type:"line",x1:o.left,x2:o.left+o.width,y1:c,y2:c,lineWidth:r,lineColor:"function"==typeof this.layout.hLineColor?this.layout.hLineColor(t,this.tableNode):this.layout.hLineColor},!1,n),o=null)}e.context().moveDown(r)}},r.prototype.drawVerticalLine=function(t,e,n,r,i){var o=this.layout.vLineWidth(r,this.tableNode);0!==o&&i.addVector({type:"line",x1:t+o/2,x2:t+o/2,y1:e,y2:n,lineWidth:o,lineColor:"function"==typeof this.layout.vLineColor?this.layout.vLineColor(r,this.tableNode):this.layout.vLineColor},!1,!0)},r.prototype.endTable=function(t){this.cleanUpRepeatables&&t.popFromRepeatables()},r.prototype.endRow=function(t,e,n){function r(){for(var e=[],n=0,r=0,i=a.tableNode.table.body[t].length;i>r;r++){if(!n){e.push({x:a.rowSpanData[r].left,index:r});var o=a.tableNode.table.body[t][r];n=o._colSpan||o.colSpan||0}n>0&&n--}return e.push({x:a.rowSpanData[a.rowSpanData.length-1].left,index:a.rowSpanData.length-1}),e}var i,o,a=this;e.tracker.stopTracking("pageChanged",this.rowCallback),e.context().moveDown(this.layout.paddingBottom(t,this.tableNode)),e.context().availableHeight+=this.reservedAtBottom;var s=e.context().page,h=e.context().y,u=r(),c=[],l=n&&n.length>0;if(c.push({y0:this.rowTopY,page:l?n[0].prevPage:s}),l)for(o=0,i=n.length;i>o;o++){var f=n[o];c[c.length-1].y1=f.prevY,c.push({y0:f.y,page:f.prevPage+1})}c[c.length-1].y1=h;for(var d=c[0].y1-c[0].y0===this.rowPaddingTop,p=d?1:0,g=c.length;g>p;p++){var v=p0&&!this.headerRows,y=m?0:this.topLineWidth,_=c[p].y0,w=c[p].y1;for(v&&(w+=this.rowPaddingBottom),e.context().page!=c[p].page&&(e.context().page=c[p].page,this.reservedAtBottom=0),o=0,i=u.length;i>o;o++)if(this.drawVerticalLine(u[o].x,_-y,w+this.bottomLineWidth,u[o].index,e),i-1>o){var b=u[o].index,x=this.tableNode.table.body[t][b].fillColor;if(x){var S=this.layout.vLineWidth(b,this.tableNode),k=u[o].x+S,E=_-y;e.addVector({type:"rect",x:k,y:E,w:u[o+1].x-k,h:w+this.bottomLineWidth-E,lineWidth:0,color:x},!1,!0,0)}}v&&this.layout.hLineWhenBroken!==!1&&this.drawHorizontalLine(t+1,e,w),m&&this.layout.hLineWhenBroken!==!1&&this.drawHorizontalLine(t,e,_)}e.context().page=s,e.context().y=h;var C=this.tableNode.table.body[t];for(o=0,i=C.length;i>o;o++){if(C[o].rowSpan&&(this.rowSpanData[o].rowSpan=C[o].rowSpan,C[o].colSpan&&C[o].colSpan>1))for(var I=1;I0&&this.rowSpanData[o].rowSpan--}this.drawHorizontalLine(t+1,e),this.headerRows&&t===this.headerRows-1&&(this.headerRepeatable=e.currentBlockToRepeatable()),this.dontBreakRows&&e.tracker.auto("pageChanged",function(){a.drawHorizontalLine(t,e)},function(){e.commitUnbreakableBlock(),a.drawHorizontalLine(t,e)}),!this.headerRepeatable||t!==this.rowsWithoutPageBreak-1&&t!==this.tableNode.table.body.length-1||(e.commitUnbreakableBlock(),e.pushToRepeatables(this.headerRepeatable),this.cleanUpRepeatables=!0,this.headerRepeatable=null)},t.exports=r},function(t,e,n){(function(e){(function(){var r,i,o,a,s,h,u={}.hasOwnProperty,c=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};h=n(25),s=n(44),i=n(45),a=n(46),o=n(64),r=function(t){function r(t){var e,n,i,o;if(this.options=null!=t?t:{},r.__super__.constructor.apply(this,arguments),this.version=1.3,this.compress=null!=(i=this.options.compress)?i:!0,this._pageBuffer=[],this._pageBufferStart=0,this._offsets=[],this._waiting=0,this._ended=!1,this._offset=0,this._root=this.ref({Type:"Catalog",Pages:this.ref({Type:"Pages",Count:0,Kids:[]})}),this.page=null,this.initColor(),this.initVector(),this.initFonts(),this.initText(),this.initImages(),this.info={Producer:"PDFKit",Creator:"PDFKit",CreationDate:new Date},this.options.info){o=this.options.info;for(e in o)n=o[e],this.info[e]=n}this._write("%PDF-"+this.version),this._write("%ÿÿÿÿ"),this.addPage()}var h;return c(r,t),h=function(t){var e,n,i;i=[];for(n in t)e=t[n],i.push(r.prototype[n]=e);return i},h(n(65)),h(n(67)),h(n(69)),h(n(89)),h(n(96)),h(n(101)),r.prototype.addPage=function(t){var e;return null==t&&(t=this.options),this.options.bufferPages||this.flushPages(),this.page=new o(this,t),this._pageBuffer.push(this.page),e=this._root.data.Pages.data,e.Kids.push(this.page.dictionary),e.Count++,this.x=this.page.margins.left,this.y=this.page.margins.top,this._ctm=[1,0,0,1,0,0],this.transform(1,0,0,-1,0,this.page.height),this},r.prototype.bufferedPageRange=function(){return{start:this._pageBufferStart,count:this._pageBuffer.length}},r.prototype.switchToPage=function(t){var e;if(!(e=this._pageBuffer[t-this._pageBufferStart]))throw new Error("switchToPage("+t+") out of bounds, current buffer covers pages "+this._pageBufferStart+" to "+(this._pageBufferStart+this._pageBuffer.length-1));return this.page=e},r.prototype.flushPages=function(){var t,e,n,r;for(e=this._pageBuffer,this._pageBuffer=[],this._pageBufferStart+=e.length,n=0,r=e.length;r>n;n++)t=e[n],t.end()},r.prototype.ref=function(t){var e;return e=new a(this,this._offsets.length+1,t),this._offsets.push(null),this._waiting++,e},r.prototype._read=function(){},r.prototype._write=function(t){return e.isBuffer(t)||(t=new e(t+"\n","binary")),this.push(t),this._offset+=t.length},r.prototype.addContent=function(t){return this.page.write(t),this},r.prototype._refEnd=function(t){return this._offsets[t.id-1]=t.offset,0===--this._waiting&&this._ended?(this._finalize(),this._ended=!1):void 0},r.prototype.write=function(t,e){var n;return n=new Error("PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. Please pipe the document into a Node stream."),this.pipe(s.createWriteStream(t)),this.end(),this.once("end",e)},r.prototype.output=function(t){throw new Error("PDFDocument#output is deprecated, and has been removed from PDFKit. Please pipe the document into a Node stream.")},r.prototype.end=function(){var t,e,n,r,i,o;this.flushPages(),this._info=this.ref(),i=this.info;for(e in i)r=i[e],"string"==typeof r&&(r=new String(r)),this._info.data[e]=r;this._info.end(),o=this._fontFamilies;for(n in o)t=o[n],t.embed();return this._root.end(),this._root.data.Pages.end(),0===this._waiting?this._finalize():this._ended=!0},r.prototype._finalize=function(t){var e,n,r,o,a;for(n=this._offset,this._write("xref"),this._write("0 "+(this._offsets.length+1)),this._write("0000000000 65535 f "),a=this._offsets,r=0,o=a.length;o>r;r++)e=a[r],e=("0000000000"+e).slice(-10),this._write(e+" 00000 n ");return this._write("trailer"),this._write(i.convert({Size:this._offsets.length+1,Root:this._root,Info:this._info})),this._write("startxref"),this._write(""+n),this._write("%%EOF"),this.push(null)},r.prototype.toString=function(){return"[object PDFDocument]"},r}(h.Readable),t.exports=r}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){function r(){i.call(this)}t.exports=r;var i=n(26).EventEmitter,o=n(27);o(r,i),r.Readable=n(28),r.Writable=n(40),r.Duplex=n(41),r.Transform=n(42),r.PassThrough=n(43),r.Stream=r,r.prototype.pipe=function(t,e){function n(e){t.writable&&!1===t.write(e)&&u.pause&&u.pause()}function r(){u.readable&&u.resume&&u.resume()}function o(){c||(c=!0,t.end())}function a(){c||(c=!0,"function"==typeof t.destroy&&t.destroy())}function s(t){if(h(),0===i.listenerCount(this,"error"))throw t}function h(){u.removeListener("data",n),t.removeListener("drain",r),u.removeListener("end",o),u.removeListener("close",a),u.removeListener("error",s),t.removeListener("error",s),u.removeListener("end",h),u.removeListener("close",h),t.removeListener("close",h)}var u=this;u.on("data",n),t.on("drain",r),t._isStdio||e&&e.end===!1||(u.on("end",o),u.on("close",a));var c=!1;return u.on("error",s),t.on("error",s),u.on("end",h),u.on("close",h),t.on("close",h),t.emit("pipe",u),t}},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,s,h,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),u=n.slice(),i=u.length,h=0;i>h;h++)u[h].apply(this,s);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,"function"==typeof console.trace)),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){e=t.exports=n(29),e.Stream=n(25),e.Readable=e,e.Writable=n(36),e.Duplex=n(35),e.Transform=n(38),e.PassThrough=n(39)},function(t,e,n){(function(e){function r(t,e){var r=n(35);t=t||{};var i=t.highWaterMark,o=t.objectMode?16:16384;this.highWaterMark=i||0===i?i:o,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,e instanceof r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(A||(A=n(37).StringDecoder),this.decoder=new A(t.encoding),this.encoding=t.encoding)}function i(t){n(35);return this instanceof i?(this._readableState=new r(t,this),this.readable=!0,void C.call(this)):new i(t)}function o(t,e,n,r,i){var o=u(e,n);if(o)t.emit("error",o);else if(I.isNullOrUndefined(n))e.reading=!1,e.ended||c(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||i||r||(n=e.decoder.write(n)),i||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&l(t)),d(t,e);else i||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=R)t=R;else{t--;for(var e=1;32>e;e<<=1)t|=t>>e;t++}return t}function h(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||I.isNull(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:0>=t?0:(t>e.highWaterMark&&(e.highWaterMark=s(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function u(t,e){var n=null;return I.isBuffer(e)||I.isString(e)||I.isNullOrUndefined(e)||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function c(t,e){if(e.decoder&&!e.ended){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,l(t)}function l(t){var n=t._readableState;n.needReadable=!1,n.emittedReadable||(L("emitReadable",n.flowing),n.emittedReadable=!0,n.sync?e.nextTick(function(){f(t)}):f(t))}function f(t){L("emit readable"),t.emit("readable"),y(t)}function d(t,n){n.readingMore||(n.readingMore=!0,e.nextTick(function(){p(t,n)}))}function p(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=i)n=o?r.join(""):k.concat(r,i),r.length=0;else if(tu&&t>h;u++){var s=r[0],l=Math.min(t-h,s.length);o?n+=s.slice(0,l):s.copy(n,h,0,l),l0)throw new Error("endReadable called on non-empty stream");n.endEmitted||(n.ended=!0,e.nextTick(function(){n.endEmitted||0!==n.length||(n.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function b(t,e){for(var n=0,r=t.length;r>n;n++)e(t[n],n)}function x(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1}t.exports=i;var S=n(31),k=n(2).Buffer;i.ReadableState=r;var E=n(26).EventEmitter;E.listenerCount||(E.listenerCount=function(t,e){return t.listeners(e).length});var C=n(25),I=n(32);I.inherits=n(33);var A,L=n(34);L=L&&L.debuglog?L.debuglog("stream"):function(){},I.inherits(i,C),i.prototype.push=function(t,e){var n=this._readableState;return I.isString(t)&&!n.objectMode&&(e=e||n.defaultEncoding,e!==n.encoding&&(t=new k(t,e),e="")),o(this,n,t,e,!1)},i.prototype.unshift=function(t){var e=this._readableState;return o(this,e,t,"",!0)},i.prototype.setEncoding=function(t){return A||(A=n(37).StringDecoder),this._readableState.decoder=new A(t),this._readableState.encoding=t,this};var R=8388608;i.prototype.read=function(t){L("read",t);var e=this._readableState,n=t;if((!I.isNumber(t)||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return L("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?w(this):l(this),null;if(t=h(t,e),0===t&&e.ended)return 0===e.length&&w(this),null;var r=e.needReadable;L("need readable",r),(0===e.length||e.length-t0?_(t,e):null,I.isNull(i)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),n!==t&&e.ended&&0===e.length&&w(this),I.isNull(i)||this.emit("data",i),i},i.prototype._read=function(t){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,n){function r(t){L("onunpipe"),t===l&&o()}function i(){L("onend"),t.end()}function o(){L("cleanup"),t.removeListener("close",h),t.removeListener("finish",u),t.removeListener("drain",v),t.removeListener("error",s),t.removeListener("unpipe",r),l.removeListener("end",i),l.removeListener("end",o),l.removeListener("data",a),!f.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){L("ondata");var n=t.write(e);!1===n&&(L("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,l.pause())}function s(e){L("onerror",e),c(),t.removeListener("error",s),0===E.listenerCount(t,"error")&&t.emit("error",e)}function h(){t.removeListener("finish",u),c()}function u(){L("onfinish"),t.removeListener("close",h),c()}function c(){L("unpipe"),l.unpipe(t)}var l=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=t;break;case 1:f.pipes=[f.pipes,t];break;default:f.pipes.push(t)}f.pipesCount+=1,L("pipe count=%d opts=%j",f.pipesCount,n);var d=(!n||n.end!==!1)&&t!==e.stdout&&t!==e.stderr,p=d?i:o;f.endEmitted?e.nextTick(p):l.once("end",p),t.on("unpipe",r);var v=g(l);return t.on("drain",v),l.on("data",a),t._events&&t._events.error?S(t._events.error)?t._events.error.unshift(s):t._events.error=[s,t._events.error]:t.on("error",s),t.once("close",h),t.once("finish",u),t.emit("pipe",l),f.flowing||(L("pipe resume"),l.resume()),t},i.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=x(e.pipes,t);return-1===i?this:(e.pipes.splice(i,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},i.prototype.on=function(t,n){var r=C.prototype.on.call(this,t,n);if("data"===t&&!1!==this._readableState.flowing&&this.resume(),"readable"===t&&this.readable){var i=this._readableState;if(!i.readableListening)if(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading)i.length&&l(this,i);else{var o=this;e.nextTick(function(){L("readable nexttick read 0"),o.read(0)})}}return r},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){var t=this._readableState;return t.flowing||(L("resume"),t.flowing=!0,t.reading||(L("resume read 0"),this.read(0)),v(this,t)),this},i.prototype.pause=function(){return L("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(L("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;t.on("end",function(){if(L("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)}),t.on("data",function(i){if(L("wrapped data"),e.decoder&&(i=e.decoder.write(i)),i&&(e.objectMode||i.length)){var o=r.push(i);o||(n=!0,t.pause())}});for(var i in t)I.isFunction(t[i])&&I.isUndefined(this[i])&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return b(o,function(e){t.on(e,r.emit.bind(r,e))}),r._read=function(e){L("wrapped _read",e),n&&(n=!1,t.resume())},r},i._fromList=_}).call(e,n(30))},function(t,e){function n(){u=!1,a.length?h=a.concat(h):c=-1,h.length&&r()}function r(){if(!u){var t=setTimeout(n);u=!0;for(var e=h.length;e;){for(a=h,h=[];++c1)for(var n=1;nn;n++)e(t[n],n)}t.exports=r;var a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},s=n(32);s.inherits=n(33);var h=n(29),u=n(36);s.inherits(r,h),o(a(u.prototype),function(t){r.prototype[t]||(r.prototype[t]=u.prototype[t])})}).call(e,n(30))},function(t,e,n){(function(e){function r(t,e,n){this.chunk=t,this.encoding=e,this.callback=n}function i(t,e){var r=n(35);t=t||{};var i=t.highWaterMark,o=t.objectMode?16:16384;this.highWaterMark=i||0===i?i:o,this.objectMode=!!t.objectMode,e instanceof r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var a=t.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){d(e,t)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function o(t){var e=n(35);return this instanceof o||this instanceof e?(this._writableState=new i(t,this),this.writable=!0,void S.call(this)):new o(t)}function a(t,n,r){var i=new Error("write after end");t.emit("error",i),e.nextTick(function(){r(i)})}function s(t,n,r,i){var o=!0;if(!(x.isBuffer(r)||x.isString(r)||x.isNullOrUndefined(r)||n.objectMode)){var a=new TypeError("Invalid non-string/buffer chunk");t.emit("error",a),e.nextTick(function(){i(a)}),o=!1}return o}function h(t,e,n){return!t.objectMode&&t.decodeStrings!==!1&&x.isString(e)&&(e=new b(e,n)),e}function u(t,e,n,i,o){n=h(e,n,i),x.isBuffer(n)&&(i="buffer");var a=e.objectMode?1:n.length;e.length+=a;var s=e.length1){for(var n=[],r=0;r=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&56319>=r)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,r=e.charCodeAt(i);if(r>=55296&&56319>=r){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},u.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(2>=e&&n>>4==14){this.charLength=3;break}if(3>=e&&n>>3==30){this.charLength=4;break}}this.charReceived=e},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e}},function(t,e,n){function r(t,e){this.afterTransform=function(t,n){return i(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,h.isNullOrUndefined(n)||t.push(n),i&&i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.lengthi;n=i+=2)e=t[n],t[n]=t[n+1],t[n+1]=e;return t},t.convert=function(s){var h,u,c,l,f,d,p,g,v,m;if("string"==typeof s)return"/"+s;if(s instanceof String){for(p=s.replace(r,function(t){return n[t]}),c=!1,u=v=0,m=p.length;m>v;u=v+=1)if(p.charCodeAt(u)>127){c=!0;break}return c&&(p=a(new e("\ufeff"+p,"utf16le")).toString("binary")),"("+p+")"}if(e.isBuffer(s))return"<"+s.toString("hex")+">";if(s instanceof i)return s.toString();if(s instanceof Date)return"(D:"+o(s.getUTCFullYear(),4)+o(s.getUTCMonth(),2)+o(s.getUTCDate(),2)+o(s.getUTCHours(),2)+o(s.getUTCMinutes(),2)+o(s.getUTCSeconds(),2)+"Z)";if(Array.isArray(s))return l=function(){var e,n,r;for(r=[],e=0,n=s.length;n>e;e++)h=s[e],r.push(t.convert(h));return r}().join(" "),"["+l+"]";if("[object Object]"==={}.toString.call(s)){d=["<<"];for(f in s)g=s[f],d.push("/"+f+" "+t.convert(g));return d.push(">>"),d.join("\n")}return""+s},t}(),t.exports=r,i=n(46)}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){(function(e){(function(){var r,i,o,a=function(t,e){return function(){return t.apply(e,arguments)}};o=n(47),i=function(){function t(t,e,n){this.document=t,this.id=e,this.data=null!=n?n:{},this.finalize=a(this.finalize,this),this.gen=0,this.deflate=null,this.compress=this.document.compress&&!this.data.Filter,this.uncompressedLength=0,this.chunks=[]}return t.prototype.initDeflate=function(){return this.data.Filter="FlateDecode",this.deflate=o.createDeflate(),this.deflate.on("data",function(t){return function(e){return t.chunks.push(e),t.data.Length+=e.length}}(this)),this.deflate.on("end",this.finalize)},t.prototype.write=function(t){var n;return e.isBuffer(t)||(t=new e(t+"\n","binary")),this.uncompressedLength+=t.length,null==(n=this.data).Length&&(n.Length=0),this.compress?(this.deflate||this.initDeflate(),this.deflate.write(t)):(this.chunks.push(t),this.data.Length+=t.length)},t.prototype.end=function(t){return("string"==typeof t||e.isBuffer(t))&&this.write(t),this.deflate?this.deflate.end():this.finalize()},t.prototype.finalize=function(){var t,e,n,i;if(this.offset=this.document._offset,this.document._write(""+this.id+" "+this.gen+" obj"),this.document._write(r.convert(this.data)),this.chunks.length){for(this.document._write("stream"),i=this.chunks,e=0,n=i.length;n>e;e++)t=i[e],this.document._write(t);this.chunks.length=0,this.document._write("\nendstream")}return this.document._write("endobj"),this.document._refEnd(this)},t.prototype.toString=function(){return""+this.id+" "+this.gen+" R"},t}(),t.exports=i,r=n(45)}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){(function(t,r){function i(e,n,r){function i(){for(var t;null!==(t=e.read());)s.push(t),h+=t.length;e.once("readable",i)}function o(t){e.removeListener("end",a),e.removeListener("readable",i),r(t)}function a(){var n=t.concat(s,h);s=[],r(null,n),e.close()}var s=[],h=0;e.on("error",o),e.on("end",a),e.end(n),i()}function o(e,n){if("string"==typeof n&&(n=new t(n)),!t.isBuffer(n))throw new TypeError("Not a string or buffer");var r=g.Z_FINISH;return e._processChunk(n,r)}function a(t){return this instanceof a?void d.call(this,t,g.DEFLATE):new a(t)}function s(t){return this instanceof s?void d.call(this,t,g.INFLATE):new s(t)}function h(t){return this instanceof h?void d.call(this,t,g.GZIP):new h(t)}function u(t){return this instanceof u?void d.call(this,t,g.GUNZIP):new u(t)}function c(t){return this instanceof c?void d.call(this,t,g.DEFLATERAW):new c(t)}function l(t){return this instanceof l?void d.call(this,t,g.INFLATERAW):new l(t)}function f(t){return this instanceof f?void d.call(this,t,g.UNZIP):new f(t)}function d(n,r){if(this._opts=n=n||{},this._chunkSize=n.chunkSize||e.Z_DEFAULT_CHUNK,p.call(this,n),n.flush&&n.flush!==g.Z_NO_FLUSH&&n.flush!==g.Z_PARTIAL_FLUSH&&n.flush!==g.Z_SYNC_FLUSH&&n.flush!==g.Z_FULL_FLUSH&&n.flush!==g.Z_FINISH&&n.flush!==g.Z_BLOCK)throw new Error("Invalid flush flag: "+n.flush);if(this._flushFlag=n.flush||g.Z_NO_FLUSH,n.chunkSize&&(n.chunkSizee.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+n.chunkSize);if(n.windowBits&&(n.windowBitse.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+n.windowBits);if(n.level&&(n.levele.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+n.level);if(n.memLevel&&(n.memLevele.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+n.memLevel);if(n.strategy&&n.strategy!=e.Z_FILTERED&&n.strategy!=e.Z_HUFFMAN_ONLY&&n.strategy!=e.Z_RLE&&n.strategy!=e.Z_FIXED&&n.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+n.strategy);if(n.dictionary&&!t.isBuffer(n.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new g.Zlib(r);var i=this;this._hadError=!1,this._binding.onerror=function(t,n){i._binding=null,i._hadError=!0;var r=new Error(t);r.errno=n,r.code=e.codes[n],i.emit("error",r)};var o=e.Z_DEFAULT_COMPRESSION;"number"==typeof n.level&&(o=n.level);var a=e.Z_DEFAULT_STRATEGY;"number"==typeof n.strategy&&(a=n.strategy),this._binding.init(n.windowBits||e.Z_DEFAULT_WINDOWBITS,o,n.memLevel||e.Z_DEFAULT_MEMLEVEL,a,n.dictionary),this._buffer=new t(this._chunkSize),this._offset=0,this._closed=!1,this._level=o,this._strategy=a,this.once("end",this.close)}var p=n(42),g=n(48),v=n(60),m=n(63).ok;g.Z_MIN_WINDOWBITS=8,g.Z_MAX_WINDOWBITS=15,g.Z_DEFAULT_WINDOWBITS=15,g.Z_MIN_CHUNK=64,g.Z_MAX_CHUNK=1/0,g.Z_DEFAULT_CHUNK=16384,g.Z_MIN_MEMLEVEL=1,g.Z_MAX_MEMLEVEL=9,g.Z_DEFAULT_MEMLEVEL=8,g.Z_MIN_LEVEL=-1,g.Z_MAX_LEVEL=9,g.Z_DEFAULT_LEVEL=g.Z_DEFAULT_COMPRESSION,Object.keys(g).forEach(function(t){t.match(/^Z/)&&(e[t]=g[t])}),e.codes={Z_OK:g.Z_OK,Z_STREAM_END:g.Z_STREAM_END,Z_NEED_DICT:g.Z_NEED_DICT,Z_ERRNO:g.Z_ERRNO,Z_STREAM_ERROR:g.Z_STREAM_ERROR,Z_DATA_ERROR:g.Z_DATA_ERROR,Z_MEM_ERROR:g.Z_MEM_ERROR,Z_BUF_ERROR:g.Z_BUF_ERROR,Z_VERSION_ERROR:g.Z_VERSION_ERROR},Object.keys(e.codes).forEach(function(t){e.codes[e.codes[t]]=t}),e.Deflate=a,e.Inflate=s,e.Gzip=h,e.Gunzip=u,e.DeflateRaw=c,e.InflateRaw=l,e.Unzip=f,e.createDeflate=function(t){return new a(t)},e.createInflate=function(t){return new s(t)},e.createDeflateRaw=function(t){return new c(t)},e.createInflateRaw=function(t){return new l(t)},e.createGzip=function(t){return new h(t)},e.createGunzip=function(t){return new u(t)},e.createUnzip=function(t){return new f(t)},e.deflate=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new a(e),t,n)},e.deflateSync=function(t,e){return o(new a(e),t)},e.gzip=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new h(e),t,n)},e.gzipSync=function(t,e){return o(new h(e),t)},e.deflateRaw=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new c(e),t,n)},e.deflateRawSync=function(t,e){return o(new c(e),t)},e.unzip=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new f(e),t,n)},e.unzipSync=function(t,e){return o(new f(e),t)},e.inflate=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new s(e),t,n)},e.inflateSync=function(t,e){return o(new s(e),t)},e.gunzip=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new u(e),t,n)},e.gunzipSync=function(t,e){return o(new u(e),t)},e.inflateRaw=function(t,e,n){return"function"==typeof e&&(n=e,e={}),i(new l(e),t,n)},e.inflateRawSync=function(t,e){return o(new l(e),t)},v.inherits(d,p),d.prototype.params=function(t,n,i){if(te.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(n!=e.Z_FILTERED&&n!=e.Z_HUFFMAN_ONLY&&n!=e.Z_RLE&&n!=e.Z_FIXED&&n!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==t||this._strategy!==n){var o=this;this.flush(g.Z_SYNC_FLUSH,function(){o._binding.params(t,n),o._hadError||(o._level=t,o._strategy=n,i&&i())})}else r.nextTick(i)},d.prototype.reset=function(){return this._binding.reset()},d.prototype._flush=function(e){this._transform(new t(0),"",e)},d.prototype.flush=function(e,n){var i=this._writableState;if(("function"==typeof e||void 0===e&&!n)&&(n=e,e=g.Z_FULL_FLUSH),i.ended)n&&r.nextTick(n);else if(i.ending)n&&this.once("end",n);else if(i.needDrain){var o=this;this.once("drain",function(){o.flush(n)})}else this._flushFlag=e,this.write(new t(0),"",n)},d.prototype.close=function(t){if(t&&r.nextTick(t),!this._closed){this._closed=!0,this._binding.close();var e=this;r.nextTick(function(){e.emit("close")})}},d.prototype._transform=function(e,n,r){var i,o=this._writableState,a=o.ending||o.ended,s=a&&(!e||o.length===e.length);if(null===!e&&!t.isBuffer(e))return r(new Error("invalid input"));s?i=g.Z_FINISH:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||g.Z_NO_FLUSH));this._processChunk(e,i,r)},d.prototype._processChunk=function(e,n,r){function i(c,d){if(!h._hadError){var p=a-d;if(m(p>=0,"have should not go down"),p>0){var g=h._buffer.slice(h._offset,h._offset+p);h._offset+=p,u?h.push(g):(l.push(g),f+=g.length)}if((0===d||h._offset>=h._chunkSize)&&(a=h._chunkSize,h._offset=0,h._buffer=new t(h._chunkSize)),0===d){if(s+=o-c,o=c,!u)return!0;var v=h._binding.write(n,e,s,o,h._buffer,h._offset,h._chunkSize);return v.callback=i,void(v.buffer=e)}return u?void r():!1}}var o=e&&e.length,a=this._chunkSize-this._offset,s=0,h=this,u="function"==typeof r;if(!u){var c,l=[],f=0;this.on("error",function(t){c=t});do var d=this._binding.writeSync(n,e,s,o,this._buffer,this._offset,a);while(!this._hadError&&i(d[0],d[1]));if(this._hadError)throw c;var p=t.concat(l,f);return this.close(),p}var g=this._binding.write(n,e,s,o,this._buffer,this._offset,a);g.buffer=e,g.callback=i},v.inherits(a,d),v.inherits(s,d),v.inherits(h,d),v.inherits(u,d),v.inherits(c,d),v.inherits(l,d),v.inherits(f,d)}).call(e,n(2).Buffer,n(30))},function(t,e,n){(function(t,r){function i(t){if(te.UNZIP)throw new TypeError("Bad argument");this.mode=t,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function o(t,e){for(var n=0;n4?9:0)}function o(t){for(var e=t.length;--e>=0;)t[e]=0}function a(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(A.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function s(t,e){L._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,a(t.strm)}function h(t,e){t.pending_buf[t.pending++]=e}function u(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function c(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,A.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=R(t.adler,e,i,n):2===t.state.wrap&&(t.adler=T(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function l(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,h=t.strstart>t.w_size-ut?t.strstart-(t.w_size-ut):0,u=t.window,c=t.w_mask,l=t.prev,f=t.strstart+ht,d=u[o+a-1],p=u[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,u[n+a]===p&&u[n+a-1]===d&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do;while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&f>o);if(r=ht-(f-o),o=f-ht,r>a){if(t.match_start=e,a=r,r>=s)break;d=u[o+a-1],p=u[o+a]}}while((e=l[e&c])>h&&0!==--i);return a<=t.lookahead?a:t.lookahead}function f(t){var e,n,r,i,o,a=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-ut)){A.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,n=t.hash_size,e=n;do r=t.head[--e],t.head[e]=r>=a?r-a:0;while(--n);n=a,e=n;do r=t.prev[--e],t.prev[e]=r>=a?r-a:0;while(--n);i+=a}if(0===t.strm.avail_in)break;if(n=c(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=st)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(f(t),0===t.lookahead&&e===O)return yt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,s(t,!1),0===t.strm.avail_out))return yt;if(t.strstart-t.block_start>=t.w_size-ut&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===U?(s(t,!0),0===t.strm.avail_out?wt:bt):t.strstart>t.block_start&&(s(t,!1),0===t.strm.avail_out)?yt:yt}function p(t,e){for(var n,r;;){if(t.lookahead=st&&(t.ins_h=(t.ins_h<=st)if(r=L._tr_tally(t,t.strstart-t.match_start,t.match_length-st),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=st){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=st&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=st-1)),t.prev_length>=st&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-st,r=L._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-st),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<=st&&t.strstart>0&&(i=t.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=t.strstart+ht;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&o>i);t.match_length=ht-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=st?(n=L._tr_tally(t,1,t.match_length-st),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=L._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===U?(s(t,!0),0===t.strm.avail_out?wt:bt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?yt:_t}function m(t,e){for(var n;;){if(0===t.lookahead&&(f(t),0===t.lookahead)){if(e===O)return yt;break}if(t.match_length=0,n=L._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(s(t,!1),0===t.strm.avail_out))return yt}return t.insert=0,e===U?(s(t,!0),0===t.strm.avail_out?wt:bt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?yt:_t}function y(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=I[t.level].max_lazy,t.good_match=I[t.level].good_length,t.nice_match=I[t.level].nice_length,t.max_chain_length=I[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=st-1,t.match_available=0,t.ins_h=0}function _(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=V,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new A.Buf16(2*ot),this.dyn_dtree=new A.Buf16(2*(2*rt+1)),this.bl_tree=new A.Buf16(2*(2*it+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new A.Buf16(at+1),this.heap=new A.Buf16(2*nt+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new A.Buf16(2*nt+1),o(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function w(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=X,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?lt:vt,t.adler=2===e.wrap?0:1,e.last_flush=O,L._tr_init(e),z):r(t,W)}function b(t){var e=w(t);return e===z&&y(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?W:(t.state.gzhead=e,z):W}function S(t,e,n,i,o,a){if(!t)return W;var s=1;if(e===H&&(e=6),0>i?(s=0,i=-i):i>15&&(s=2,i-=16),1>o||o>$||n!==V||8>i||i>15||0>e||e>9||0>a||a>q)return r(t,W);8===i&&(i=9);var h=new _;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=i,h.w_size=1<>1,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=a,h.method=n,b(t)}function k(t,e){return S(t,e,V,J,Q,K)}function E(t,e){var n,s,c,l;if(!t||!t.state||e>P||0>e)return t?r(t,W):W;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===mt&&e!==U)return r(t,0===t.avail_out?j:W);if(s.strm=t,n=s.last_flush,s.last_flush=e,s.status===lt)if(2===s.wrap)t.adler=0,h(s,31),h(s,139),h(s,8),s.gzhead?(h(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),h(s,255&s.gzhead.time),h(s,s.gzhead.time>>8&255),h(s,s.gzhead.time>>16&255),h(s,s.gzhead.time>>24&255),h(s,9===s.level?2:s.strategy>=G||s.level<2?4:0),h(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(h(s,255&s.gzhead.extra.length),h(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=T(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=ft):(h(s,0),h(s,0),h(s,0),h(s,0),h(s,0),h(s,9===s.level?2:s.strategy>=G||s.level<2?4:0),h(s,xt),s.status=vt);else{var f=V+(s.w_bits-8<<4)<<8,d=-1;d=s.strategy>=G||s.level<2?0:s.level<6?1:6===s.level?2:3,f|=d<<6,0!==s.strstart&&(f|=ct),f+=31-f%31,s.status=vt,u(s,f),0!==s.strstart&&(u(s,t.adler>>>16),u(s,65535&t.adler)),t.adler=1}if(s.status===ft)if(s.gzhead.extra){for(c=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>c&&(t.adler=T(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending!==s.pending_buf_size));)h(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>c&&(t.adler=T(t.adler,s.pending_buf,s.pending-c,c)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=dt)}else s.status=dt;if(s.status===dt)if(s.gzhead.name){c=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>c&&(t.adler=T(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexc&&(t.adler=T(t.adler,s.pending_buf,s.pending-c,c)),0===l&&(s.gzindex=0,s.status=pt)}else s.status=pt;if(s.status===pt)if(s.gzhead.comment){c=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>c&&(t.adler=T(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexc&&(t.adler=T(t.adler,s.pending_buf,s.pending-c,c)),0===l&&(s.status=gt)}else s.status=gt;if(s.status===gt&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&a(t),s.pending+2<=s.pending_buf_size&&(h(s,255&t.adler),h(s,t.adler>>8&255),t.adler=0,s.status=vt)):s.status=vt),0!==s.pending){if(a(t),0===t.avail_out)return s.last_flush=-1,z}else if(0===t.avail_in&&i(e)<=i(n)&&e!==U)return r(t,j);if(s.status===mt&&0!==t.avail_in)return r(t,j);if(0!==t.avail_in||0!==s.lookahead||e!==O&&s.status!==mt){var p=s.strategy===G?m(s,e):s.strategy===Y?v(s,e):I[s.level].func(s,e);if((p===wt||p===bt)&&(s.status=mt),p===yt||p===wt)return 0===t.avail_out&&(s.last_flush=-1),z;if(p===_t&&(e===M?L._tr_align(s):e!==P&&(L._tr_stored_block(s,0,0,!1),e===D&&(o(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),a(t),0===t.avail_out))return s.last_flush=-1,z}return e!==U?z:s.wrap<=0?F:(2===s.wrap?(h(s,255&t.adler),h(s,t.adler>>8&255),h(s,t.adler>>16&255),h(s,t.adler>>24&255),h(s,255&t.total_in),h(s,t.total_in>>8&255),h(s,t.total_in>>16&255),h(s,t.total_in>>24&255)):(u(s,t.adler>>>16),u(s,65535&t.adler)),a(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?z:F)}function C(t){var e;return t&&t.state?(e=t.state.status,e!==lt&&e!==ft&&e!==dt&&e!==pt&&e!==gt&&e!==vt&&e!==mt?r(t,W):(t.state=null,e===vt?r(t,N):z)):W}var I,A=n(52),L=n(53),R=n(54),T=n(55),B=n(49),O=0,M=1,D=3,U=4,P=5,z=0,F=1,W=-2,N=-3,j=-5,H=-1,Z=1,G=2,Y=3,q=4,K=0,X=2,V=8,$=9,J=15,Q=8,tt=29,et=256,nt=et+1+tt,rt=30,it=19,ot=2*nt+1,at=15,st=3,ht=258,ut=ht+st+1,ct=32,lt=42,ft=69,dt=73,pt=91,gt=103,vt=113,mt=666,yt=1,_t=2,wt=3,bt=4,xt=3,St=function(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i};I=[new St(0,0,0,0,d),new St(4,4,8,4,p),new St(4,5,16,8,p),new St(4,6,32,32,p),new St(4,4,16,16,g),new St(8,16,32,32,g),new St(8,16,128,128,g),new St(8,32,128,256,g),new St(32,128,258,1024,g),new St(32,258,258,4096,g)],e.deflateInit=k,e.deflateInit2=S,e.deflateReset=b,e.deflateResetKeep=w,e.deflateSetHeader=x,e.deflate=E,e.deflateEnd=C,e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(n,n+r),i);for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;n>e;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;n>e;e++)o=t[e],a.set(o,i),i+=o.length;return a}},i={arraySet:function(t,e,n,r,i){for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(n)},function(t,e,n){"use strict";function r(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t){return 256>t?at[t]:at[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function a(t,e,n){t.bi_valid>q-n?(t.bi_buf|=e<>q-t.bi_valid,t.bi_valid+=n-q):(t.bi_buf|=e<>>=1,n<<=1;while(--e>0);return n>>>1}function u(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function c(t,e){var n,r,i,o,a,s,h=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;Y>=o;o++)t.bl_count[o]=0;for(h[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;G>n;n++)r=t.heap[n],o=h[2*h[2*r+1]+1]+1,o>p&&(o=p,g++),h[2*r+1]=o,r>u||(t.bl_count[o]++,a=0,r>=d&&(a=f[r-d]),s=h[2*r],t.opt_len+=s*(o+a),l&&(t.static_len+=s*(c[2*r+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)i=t.heap[--n],i>u||(h[2*i+1]!==o&&(t.opt_len+=(o-h[2*i+1])*h[2*i],h[2*i+1]=o),r--)}}function l(t,e,n){var r,i,o=new Array(Y+1),a=0;for(r=1;Y>=r;r++)o[r]=a=a+n[r-1]<<1;for(i=0;e>=i;i++){var s=t[2*i+1];0!==s&&(t[2*i]=h(o[s]++,s))}}function f(){var t,e,n,r,i,o=new Array(Y+1);for(n=0,r=0;W-1>r;r++)for(ht[r]=n,t=0;t<1<r;r++)for(ut[r]=i,t=0;t<1<>=7;H>r;r++)for(ut[r]=i<<7,t=0;t<1<=e;e++)o[e]=0;for(t=0;143>=t;)it[2*t+1]=8,t++,o[8]++;for(;255>=t;)it[2*t+1]=9,t++,o[9]++;for(;279>=t;)it[2*t+1]=7,t++,o[7]++;for(;287>=t;)it[2*t+1]=8,t++,o[8]++;for(l(it,j+1,o),t=0;H>t;t++)ot[2*t+1]=5,ot[2*t]=h(t,5);ct=new dt(it,Q,N+1,j,Y),lt=new dt(ot,tt,0,H,Y),ft=new dt(new Array(0),et,0,Z,K)}function d(t){var e;for(e=0;j>e;e++)t.dyn_ltree[2*e]=0;for(e=0;H>e;e++)t.dyn_dtree[2*e]=0;for(e=0;Z>e;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*X]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function p(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function g(t,e,n,r){p(t),r&&(o(t,n),o(t,~n)),R.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function v(t,e,n,r){var i=2*e,o=2*n;return t[i]n;n++)0!==o[2*n]?(t.heap[++t.heap_len]=u=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)i=t.heap[++t.heap_len]=2>u?++u:0,o[2*i]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=u,n=t.heap_len>>1;n>=1;n--)m(t,o,n);i=h;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],m(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,m(t,o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],c(t,e),l(o,u,t.bl_count)}function w(t,e,n){var r,i,o=-1,a=e[1],s=0,h=7,u=4;for(0===a&&(h=138,u=3),e[2*(n+1)+1]=65535,r=0;n>=r;r++)i=a,a=e[2*(r+1)+1],++ss?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[2*V]++):10>=s?t.bl_tree[2*$]++:t.bl_tree[2*J]++,s=0,o=i,0===a?(h=138,u=3):i===a?(h=6,u=3):(h=7,u=4))}function b(t,e,n){var r,i,o=-1,h=e[1],u=0,c=7,l=4;for(0===h&&(c=138,l=3),r=0;n>=r;r++)if(i=h,h=e[2*(r+1)+1],!(++uu){do s(t,i,t.bl_tree);while(0!==--u)}else 0!==i?(i!==o&&(s(t,i,t.bl_tree),u--),s(t,V,t.bl_tree),a(t,u-3,2)):10>=u?(s(t,$,t.bl_tree),a(t,u-3,3)):(s(t,J,t.bl_tree),a(t,u-11,7));u=0,o=i,0===h?(c=138,l=3):i===h?(c=6,l=3):(c=7,l=4)}}function x(t){var e;for(w(t,t.dyn_ltree,t.l_desc.max_code),w(t,t.dyn_dtree,t.d_desc.max_code),_(t,t.bl_desc),e=Z-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function S(t,e,n,r){var i;for(a(t,e-257,5),a(t,n-1,5),a(t,r-4,4),i=0;r>i;i++)a(t,t.bl_tree[2*nt[i]+1],3);b(t,t.dyn_ltree,e-1),b(t,t.dyn_dtree,n-1)}function k(t){var e,n=4093624447;for(e=0;31>=e;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return B;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return O;for(e=32;N>e;e++)if(0!==t.dyn_ltree[2*e])return O;return B}function E(t){gt||(f(),gt=!0),t.l_desc=new pt(t.dyn_ltree,ct),t.d_desc=new pt(t.dyn_dtree,lt),t.bl_desc=new pt(t.bl_tree,ft),t.bi_buf=0,t.bi_valid=0,d(t)}function C(t,e,n,r){a(t,(D<<1)+(r?1:0),3),g(t,e,n,!0)}function I(t){a(t,U<<1,3),s(t,X,it),u(t)}function A(t,e,n,r){var i,o,s=0;t.level>0?(t.strm.data_type===M&&(t.strm.data_type=k(t)),_(t,t.l_desc),_(t,t.d_desc),s=x(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,i>=o&&(i=o)):i=o=n+5,i>=n+4&&-1!==e?C(t,e,n,r):t.strategy===T||o===i?(a(t,(U<<1)+(r?1:0),3),y(t,it,ot)):(a(t,(P<<1)+(r?1:0),3),S(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),y(t,t.dyn_ltree,t.dyn_dtree)),d(t),r&&p(t)}function L(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(st[n]+N+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var R=n(52),T=4,B=0,O=1,M=2,D=0,U=1,P=2,z=3,F=258,W=29,N=256,j=N+1+W,H=30,Z=19,G=2*j+1,Y=15,q=16,K=7,X=256,V=16,$=17,J=18,Q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],tt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],et=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,it=new Array(2*(j+2));r(it);var ot=new Array(2*H);r(ot);var at=new Array(rt);r(at);var st=new Array(F-z+1);r(st);var ht=new Array(W);r(ht);var ut=new Array(H);r(ut);var ct,lt,ft,dt=function(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length},pt=function(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e},gt=!1;e._tr_init=E,e._tr_stored_block=C,e._tr_flush_block=A,e._tr_tally=L,e._tr_align=I},function(t,e){"use strict";function n(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){a=n>2e3?2e3:n,n-=a;do i=i+e[r++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}t.exports=n},function(t,e){"use strict";function n(){for(var t,e=[],n=0;256>n;n++){t=n;for(var r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,a=r+n;t=-1^t;for(var s=r;a>s;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}var i=n();t.exports=r},function(t,e,n){"use strict";function r(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new m.Buf16(320),this.work=new m.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=U,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new m.Buf32(pt),e.distcode=e.distdyn=new m.Buf32(gt),e.sane=1,e.back=-1,A):T}function a(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):T}function s(t,e){var n,r;return t&&t.state?(r=t.state,0>e?(n=0,e=-e):(n=(e>>4)+1,48>e&&(e&=15)),e&&(8>e||e>15)?T:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,a(t))):T}function h(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=s(t,e),n!==A&&(t.state=null),n):T}function u(t){return h(t,mt)}function c(t){if(yt){var e;for(g=new m.Buf32(512),v=new m.Buf32(32),e=0;144>e;)t.lens[e++]=8;for(;256>e;)t.lens[e++]=9;for(;280>e;)t.lens[e++]=7;for(;288>e;)t.lens[e++]=8;for(b(S,t.lens,0,288,g,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;b(k,t.lens,0,32,v,0,t.work,{bits:5}),yt=!1}t.lencode=g,t.lenbits=9,t.distcode=v,t.distbits=5}function l(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(m.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),m.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(m.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaved;){if(0===h)break t;h--,f+=i[a++]<>>8&255,n.check=_(n.check,It,2,0),f=0,d=0,n.mode=P;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&f)<<8)+(f>>8))%31){t.msg="incorrect header check",n.mode=lt;break}if((15&f)!==D){t.msg="unknown compression method",n.mode=lt;break}if(f>>>=4,d-=4,xt=(15&f)+8,0===n.wbits)n.wbits=xt;else if(xt>n.wbits){t.msg="invalid window size",n.mode=lt;break}n.dmax=1<d;){if(0===h)break t;h--,f+=i[a++]<>8&1),512&n.flags&&(It[0]=255&f,It[1]=f>>>8&255,n.check=_(n.check,It,2,0)),f=0,d=0,n.mode=z;case z:for(;32>d;){if(0===h)break t;h--,f+=i[a++]<>>8&255,It[2]=f>>>16&255,It[3]=f>>>24&255,n.check=_(n.check,It,4,0)),f=0,d=0,n.mode=F;case F:for(;16>d;){if(0===h)break t;h--,f+=i[a++]<>8),512&n.flags&&(It[0]=255&f,It[1]=f>>>8&255,n.check=_(n.check,It,2,0)),f=0,d=0,n.mode=W;case W:if(1024&n.flags){for(;16>d;){if(0===h)break t;h--,f+=i[a++]<>>8&255,n.check=_(n.check,It,2,0)),f=0,d=0}else n.head&&(n.head.extra=null);n.mode=N;case N:if(1024&n.flags&&(v=n.length,v>h&&(v=h),v&&(n.head&&(xt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),m.arraySet(n.head.extra,i,a,v,xt)),512&n.flags&&(n.check=_(n.check,i,v,a)),h-=v,a+=v,n.length-=v),n.length))break t;n.length=0,n.mode=j;case j:if(2048&n.flags){if(0===h)break t;v=0;do xt=i[a+v++],n.head&&xt&&n.length<65536&&(n.head.name+=String.fromCharCode(xt));while(xt&&h>v);if(512&n.flags&&(n.check=_(n.check,i,v,a)),h-=v,a+=v,xt)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=H;case H:if(4096&n.flags){if(0===h)break t;v=0;do xt=i[a+v++],n.head&&xt&&n.length<65536&&(n.head.comment+=String.fromCharCode(xt));while(xt&&h>v);if(512&n.flags&&(n.check=_(n.check,i,v,a)),h-=v,a+=v,xt)break t}else n.head&&(n.head.comment=null);n.mode=Z;case Z:if(512&n.flags){for(;16>d;){if(0===h)break t;h--,f+=i[a++]<>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=q;break;case G:for(;32>d;){if(0===h)break t;h--,f+=i[a++]<>>=7&d,d-=7&d,n.mode=ht;break}for(;3>d;){if(0===h)break t;h--,f+=i[a++]<>>=1,d-=1,3&f){case 0:n.mode=X;break;case 1:if(c(n),n.mode=et,e===I){f>>>=2,d-=2;break t}break;case 2:n.mode=J;break;case 3:t.msg="invalid block type",n.mode=lt}f>>>=2,d-=2;break;case X:for(f>>>=7&d,d-=7&d;32>d;){if(0===h)break t;h--,f+=i[a++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=lt;break}if(n.length=65535&f,f=0,d=0,n.mode=V,e===I)break t;case V:n.mode=$;case $:if(v=n.length){if(v>h&&(v=h),v>u&&(v=u),0===v)break t;m.arraySet(o,i,a,v,s),h-=v,a+=v,u-=v,s+=v,n.length-=v;break}n.mode=q;break;case J:for(;14>d;){if(0===h)break t;h--,f+=i[a++]<>>=5,d-=5,n.ndist=(31&f)+1,f>>>=5,d-=5,n.ncode=(15&f)+4,f>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=lt;break}n.have=0,n.mode=Q;case Q:for(;n.haved;){if(0===h)break t;h--,f+=i[a++]<>>=3,d-=3}for(;n.have<19;)n.lens[At[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,kt={bits:n.lenbits},St=b(x,n.lens,0,19,n.lencode,0,n.work,kt),n.lenbits=kt.bits,St){t.msg="invalid code lengths set",n.mode=lt;break}n.have=0,n.mode=tt;case tt:for(;n.have>>24,mt=Ct>>>16&255,yt=65535&Ct,!(d>=vt);){if(0===h)break t;h--,f+=i[a++]<yt)f>>>=vt,d-=vt,n.lens[n.have++]=yt;else{if(16===yt){for(Et=vt+2;Et>d;){if(0===h)break t;h--,f+=i[a++]<>>=vt,d-=vt,0===n.have){t.msg="invalid bit length repeat",n.mode=lt;break}xt=n.lens[n.have-1],v=3+(3&f),f>>>=2,d-=2}else if(17===yt){for(Et=vt+3;Et>d;){if(0===h)break t;h--,f+=i[a++]<>>=vt,d-=vt,xt=0,v=3+(7&f),f>>>=3,d-=3}else{for(Et=vt+7;Et>d;){if(0===h)break t;h--,f+=i[a++]<>>=vt,d-=vt,xt=0,v=11+(127&f),f>>>=7,d-=7}if(n.have+v>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=lt;break}for(;v--;)n.lens[n.have++]=xt}}if(n.mode===lt)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=lt;break}if(n.lenbits=9,kt={bits:n.lenbits},St=b(S,n.lens,0,n.nlen,n.lencode,0,n.work,kt),n.lenbits=kt.bits,St){t.msg="invalid literal/lengths set",n.mode=lt;break}if(n.distbits=6,n.distcode=n.distdyn,kt={bits:n.distbits},St=b(k,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,kt),n.distbits=kt.bits,St){t.msg="invalid distances set",n.mode=lt;break}if(n.mode=et,e===I)break t;case et:n.mode=nt;case nt:if(h>=6&&u>=258){t.next_out=s,t.avail_out=u,t.next_in=a,t.avail_in=h,n.hold=f,n.bits=d,w(t,g),s=t.next_out,o=t.output,u=t.avail_out,a=t.next_in,i=t.input,h=t.avail_in,f=n.hold,d=n.bits,n.mode===q&&(n.back=-1);break}for(n.back=0;Ct=n.lencode[f&(1<>>24,mt=Ct>>>16&255,yt=65535&Ct,!(d>=vt);){if(0===h)break t;h--,f+=i[a++]<>_t)],vt=Ct>>>24,mt=Ct>>>16&255,yt=65535&Ct,!(d>=_t+vt);){if(0===h)break t;h--,f+=i[a++]<>>=_t,d-=_t,n.back+=_t}if(f>>>=vt,d-=vt,n.back+=vt,n.length=yt,0===mt){n.mode=st;break}if(32&mt){n.back=-1,n.mode=q;break}if(64&mt){t.msg="invalid literal/length code",n.mode=lt;break}n.extra=15&mt,n.mode=rt;case rt:if(n.extra){for(Et=n.extra;Et>d;){if(0===h)break t;h--,f+=i[a++]<>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=it;case it:for(;Ct=n.distcode[f&(1<>>24,mt=Ct>>>16&255,yt=65535&Ct,!(d>=vt);){if(0===h)break t;h--,f+=i[a++]<>_t)],vt=Ct>>>24,mt=Ct>>>16&255,yt=65535&Ct,!(d>=_t+vt);){if(0===h)break t;h--,f+=i[a++]<>>=_t,d-=_t,n.back+=_t}if(f>>>=vt,d-=vt,n.back+=vt,64&mt){t.msg="invalid distance code",n.mode=lt;break}n.offset=yt,n.extra=15&mt,n.mode=ot;case ot:if(n.extra){for(Et=n.extra;Et>d;){if(0===h)break t;h--,f+=i[a++]<>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=lt;break}n.mode=at;case at:if(0===u)break t;if(v=g-u,n.offset>v){if(v=n.offset-v,v>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=lt;break}v>n.wnext?(v-=n.wnext,pt=n.wsize-v):pt=n.wnext-v,v>n.length&&(v=n.length),gt=n.window}else gt=o,pt=s-n.offset,v=n.length;v>u&&(v=u),u-=v,n.length-=v;do o[s++]=gt[pt++];while(--v);0===n.length&&(n.mode=nt);break;case st:if(0===u)break t;o[s++]=n.length,u--,n.mode=nt;break;case ht:if(n.wrap){for(;32>d;){if(0===h)break t;h--,f|=i[a++]<d;){if(0===h)break t;h--,f+=i[a++]<v&&(g+=I[o++]<>>24,g>>>=x,v-=x,x=b>>>16&255,0===x)A[s++]=65535&b;else{if(!(16&x)){if(0===(64&x)){b=m[(65535&b)+(g&(1<v&&(g+=I[o++]<>>=x,v-=x),15>v&&(g+=I[o++]<>>24,g>>>=x,v-=x,x=b>>>16&255,!(16&x)){if(0===(64&x)){b=y[(65535&b)+(g&(1<v&&(g+=I[o++]<v&&(g+=I[o++]<c){t.msg="invalid distance too far back",i.mode=n;break t}if(g>>>=x,v-=x,x=s-h,k>x){if(x=k-x,x>f&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(E=0,C=p,0===d){if(E+=l-x,S>x){S-=x;do A[s++]=p[E++];while(--x);E=s-k,C=A}}else if(x>d){if(E+=l+d-x,x-=d,S>x){S-=x;do A[s++]=p[E++];while(--x);if(E=0,S>d){x=d,S-=x;do A[s++]=p[E++];while(--x);E=s-k,C=A}}}else if(E+=d-x,S>x){S-=x;do A[s++]=p[E++];while(--x);E=s-k,C=A}for(;S>2;)A[s++]=C[E++],A[s++]=C[E++],A[s++]=C[E++],S-=3;S&&(A[s++]=C[E++],S>1&&(A[s++]=C[E++]))}else{E=s-k;do A[s++]=A[E++],A[s++]=A[E++],A[s++]=A[E++],S-=3;while(S>2);S&&(A[s++]=A[E++],S>1&&(A[s++]=A[E++]))}break}}break}}while(a>o&&u>s);S=v>>3,o-=S,v-=S<<3,g&=(1<o?5+(a-o):5-(o-a),t.avail_out=u>s?257+(u-s):257-(s-u),i.hold=g,i.bits=v}},function(t,e,n){"use strict";var r=n(52),i=15,o=852,a=592,s=0,h=1,u=2,c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],f=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,n,p,g,v,m,y){var _,w,b,x,S,k,E,C,I,A=y.bits,L=0,R=0,T=0,B=0,O=0,M=0,D=0,U=0,P=0,z=0,F=null,W=0,N=new r.Buf16(i+1),j=new r.Buf16(i+1),H=null,Z=0;for(L=0;i>=L;L++)N[L]=0;for(R=0;p>R;R++)N[e[n+R]]++;for(O=A,B=i;B>=1&&0===N[B];B--);if(O>B&&(O=B),0===B)return g[v++]=20971520,g[v++]=20971520,y.bits=1,0;for(T=1;B>T&&0===N[T];T++);for(T>O&&(O=T),U=1,L=1;i>=L;L++)if(U<<=1,U-=N[L],0>U)return-1;if(U>0&&(t===s||1!==B))return-1;for(j[1]=0,L=1;i>L;L++)j[L+1]=j[L]+N[L];for(R=0;p>R;R++)0!==e[n+R]&&(m[j[e[n+R]]++]=R);if(t===s?(F=H=m,k=19):t===h?(F=c,W-=257,H=l,Z-=257,k=256):(F=f,H=d,k=-1),z=0,R=0,L=T,S=v,M=O,D=0,b=-1,P=1<o||t===u&&P>a)return 1;for(var G=0;;){G++,E=L-D,m[R]k?(C=H[Z+m[R]],I=F[W+m[R]]):(C=96,I=0),_=1<>D)+w]=E<<24|C<<16|I|0;while(0!==w);for(_=1<>=1;if(0!==_?(z&=_-1,z+=_):z=0,R++,0===--N[L]){if(L===B)break;L=e[n+m[R]]}if(L>O&&(z&x)!==b){for(0===D&&(D=O),S+=T,M=L-D,U=1<M+D&&(U-=N[M+D],!(0>=U));)M++,U<<=1;if(P+=1<o||t===u&&P>a)return 1;b=z&x,g[b]=O<<24|M<<16|S-v|0}}return 0!==z&&(g[S+z]=L-D<<24|64<<16|0),y.bits=O,0}},function(t,e){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){(function(t,r){function i(t,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(n)?r.showHidden=n:n&&e._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),h(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function h(t,n,r){if(t.customInspect&&n&&C(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return _(i)||(i=h(t,i,r)),i}var o=u(t,n);if(o)return o;var a=Object.keys(n),g=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(n);if(0===a.length){if(C(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(x(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(k(n))return t.stylize(Date.prototype.toString.call(n),"date");if(E(n))return c(n)}var m="",y=!1,w=["{","}"];if(p(n)&&(y=!0,w=["[","]"]),C(n)){var b=n.name?": "+n.name:"";m=" [Function"+b+"]"}if(x(n)&&(m=" "+RegExp.prototype.toString.call(n)),k(n)&&(m=" "+Date.prototype.toUTCString.call(n)),E(n)&&(m=" "+c(n)),0===a.length&&(!y||0==n.length))return w[0]+m+w[1];if(0>r)return x(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var S;return S=y?l(t,n,r,g,a):a.map(function(e){return f(t,n,r,g,e,y)}),t.seen.pop(),d(S,m,w)}function u(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,n,r,i){for(var o=[],a=0,s=e.length;s>a;++a)L(e,String(a))?o.push(f(t,e,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(f(t,e,n,r,i,!0))}),o}function f(t,e,n,r,i,o){var a,s,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),L(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=v(n)?h(t,u.value,null):h(t,u.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return null==t}function y(t){return"number"==typeof t}function _(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function b(t){return void 0===t}function x(t){return S(t)&&"[object RegExp]"===A(t)}function S(t){return"object"==typeof t&&null!==t}function k(t){return S(t)&&"[object Date]"===A(t)}function E(t){return S(t)&&("[object Error]"===A(t)||t instanceof Error)}function C(t){return"function"==typeof t}function I(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function A(t){return Object.prototype.toString.call(t)}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var R=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),s=r[n];o>n;s=r[++n])a+=v(s)||!S(s)?" "+s:" "+i(s);return a},e.deprecate=function(n,i){function o(){if(!a){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation,a=!0}return n.apply(this,arguments)}if(b(t.process))return function(){return e.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var a=!1;return o};var T,B={};e.debuglog=function(t){if(b(T)&&(T=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!B[t])if(new RegExp("\\b"+t+"\\b","i").test(T)){r.pid;B[t]=function(){e.format.apply(e,arguments)}}else B[t]=function(){};return B[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=g,e.isNull=v,e.isNullOrUndefined=m,e.isNumber=y,e.isString=_,e.isSymbol=w,e.isUndefined=b,e.isRegExp=x,e.isObject=S,e.isDate=k,e.isError=E,e.isFunction=C,e.isPrimitive=I,e.isBuffer=n(61);e.log=function(){},e.inherits=n(62),e._extend=function(t,e){if(!e||!S(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(e,function(){return this}(),n(30))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){function r(t,e){return d.isUndefined(e)?""+e:d.isNumber(e)&&!isFinite(e)?e.toString():d.isFunction(e)||d.isRegExp(e)?e.toString():e}function i(t,e){return d.isString(t)?t.length=0;o--)if(a[o]!=s[o])return!1;for(o=a.length-1;o>=0;o--)if(i=a[o],!h(t[i],e[i]))return!1;return!0}function l(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function f(t,e,n,r){var i;d.isString(n)&&(r=n,n=null);try{e()}catch(o){i=o}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&a(i,n,"Missing expected exception"+r),!t&&l(i,n)&&a(i,n,"Got unwanted exception"+r),t&&i&&n&&!l(i,n)||!t&&i)throw i}var d=n(60),p=Array.prototype.slice,g=Object.prototype.hasOwnProperty,v=t.exports=s;v.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var e=t.stackStartFunction||a;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=e.name,s=r.indexOf("\n"+i);if(s>=0){var h=r.indexOf("\n",s+1);r=r.substring(h+1)}this.stack=r}}},d.inherits(v.AssertionError,Error),v.fail=a,v.ok=s,v.equal=function(t,e,n){t!=e&&a(t,e,n,"==",v.equal)},v.notEqual=function(t,e,n){t==e&&a(t,e,n,"!=",v.notEqual)},v.deepEqual=function(t,e,n){h(t,e)||a(t,e,n,"deepEqual",v.deepEqual)},v.notDeepEqual=function(t,e,n){h(t,e)&&a(t,e,n,"notDeepEqual",v.notDeepEqual)},v.strictEqual=function(t,e,n){t!==e&&a(t,e,n,"===",v.strictEqual)},v.notStrictEqual=function(t,e,n){t===e&&a(t,e,n,"!==",v.notStrictEqual)},v["throws"]=function(t,e,n){f.apply(this,[!0].concat(p.call(arguments)))},v.doesNotThrow=function(t,e){f.apply(this,[!1].concat(p.call(arguments)))},v.ifError=function(t){if(t)throw t};var m=Object.keys||function(t){var e=[];for(var n in t)g.call(t,n)&&e.push(n);return e}},function(t,e){(function(){var e;e=function(){function t(t,r){var i;this.document=t,null==r&&(r={}),this.size=r.size||"letter",this.layout=r.layout||"portrait","number"==typeof r.margin?this.margins={top:r.margin,left:r.margin,bottom:r.margin,right:r.margin}:this.margins=r.margins||e,i=Array.isArray(this.size)?this.size:n[this.size.toUpperCase()],this.width=i["portrait"===this.layout?0:1],this.height=i["portrait"===this.layout?1:0],this.content=this.document.ref(),this.resources=this.document.ref({ProcSet:["PDF","Text","ImageB","ImageC","ImageI"]}),Object.defineProperties(this,{fonts:{get:function(t){return function(){var e;return null!=(e=t.resources.data).Font?e.Font:e.Font={}}}(this)},xobjects:{get:function(t){return function(){var e;return null!=(e=t.resources.data).XObject?e.XObject:e.XObject={}}}(this)},ext_gstates:{get:function(t){return function(){var e;return null!=(e=t.resources.data).ExtGState?e.ExtGState:e.ExtGState={}}}(this)},patterns:{get:function(t){return function(){var e;return null!=(e=t.resources.data).Pattern?e.Pattern:e.Pattern={}}}(this)},annotations:{get:function(t){return function(){var e;return null!=(e=t.dictionary.data).Annots?e.Annots:e.Annots=[]}}(this)}}),this.dictionary=this.document.ref({Type:"Page",Parent:this.document._root.data.Pages,MediaBox:[0,0,this.width,this.height],Contents:this.content,Resources:this.resources})}var e,n;return t.prototype.maxY=function(){return this.height-this.margins.bottom},t.prototype.write=function(t){return this.content.write(t)},t.prototype.end=function(){return this.dictionary.end(),this.resources.end(),this.content.end()},e={top:72,left:72,bottom:72,right:72},n={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]},t}(),t.exports=e}).call(this)},function(t,e,n){(function(){var e,r,i,o,a;a=n(66),e=a.PDFGradient,r=a.PDFLinearGradient,i=a.PDFRadialGradient,t.exports={initColor:function(){return this._opacityRegistry={},this._opacityCount=0,this._gradCount=0},_normalizeColor:function(t){var n,r;return t instanceof e?t:("string"==typeof t&&("#"===t.charAt(0)?(4===t.length&&(t=t.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i,"#$1$1$2$2$3$3")),n=parseInt(t.slice(1),16),t=[n>>16,n>>8&255,255&n]):o[t]&&(t=o[t])),Array.isArray(t)?(3===t.length?t=function(){var e,n,i;for(i=[],e=0,n=t.length;n>e;e++)r=t[e],i.push(r/255);return i}():4===t.length&&(t=function(){var e,n,i;for(i=[],e=0,n=t.length;n>e;e++)r=t[e],i.push(r/100);return i}()),t):null)},_setColor:function(t,n){var r,i,o,a;return(t=this._normalizeColor(t))?(this._sMasked&&(r=this.ref({Type:"ExtGState",SMask:"None"}),r.end(),i="Gs"+ ++this._opacityCount,this.page.ext_gstates[i]=r,this.addContent("/"+i+" gs"),this._sMasked=!1),o=n?"SCN":"scn",t instanceof e?(this._setColorSpace("Pattern",n),t.apply(o)):(a=4===t.length?"DeviceCMYK":"DeviceRGB",this._setColorSpace(a,n),t=t.join(" "),this.addContent(""+t+" "+o)),!0):!1},_setColorSpace:function(t,e){var n;return n=e?"CS":"cs",this.addContent("/"+t+" "+n)},fillColor:function(t,e){var n;return null==e&&(e=1),n=this._setColor(t,!1),n&&this.fillOpacity(e),this._fillColor=[t,e],this},strokeColor:function(t,e){var n;return null==e&&(e=1),n=this._setColor(t,!0),n&&this.strokeOpacity(e),this},opacity:function(t){return this._doOpacity(t,t),this},fillOpacity:function(t){return this._doOpacity(t,null),this},strokeOpacity:function(t){return this._doOpacity(null,t),this},_doOpacity:function(t,e){var n,r,i,o,a;if(null!=t||null!=e)return null!=t&&(t=Math.max(0,Math.min(1,t))),null!=e&&(e=Math.max(0,Math.min(1,e))),i=""+t+"_"+e,this._opacityRegistry[i]?(a=this._opacityRegistry[i],n=a[0],o=a[1]):(n={Type:"ExtGState"},null!=t&&(n.ca=t),null!=e&&(n.CA=e),n=this.ref(n),n.end(),r=++this._opacityCount,o="Gs"+r,this._opacityRegistry[i]=[n,o]),this.page.ext_gstates[o]=n,this.addContent("/"+o+" gs")},linearGradient:function(t,e,n,i){return new r(this,t,e,n,i)},radialGradient:function(t,e,n,r,o,a){return new i(this,t,e,n,r,o,a)}},o={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}).call(this)},function(t,e){(function(){var e,n,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};e=function(){function t(t){this.doc=t,this.stops=[],this.embedded=!1,this.transform=[1,0,0,1,0,0],this._colorSpace="DeviceRGB"}return t.prototype.stop=function(t,e,n){return null==n&&(n=1),n=Math.max(0,Math.min(1,n)),this.stops.push([t,this.doc._normalizeColor(e),n]),this},t.prototype.embed=function(){var t,e,n,r,i,o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w,b,x,S,k,E,C,I,A,L,R,T,B,O,M,D;if(!this.embedded&&0!==this.stops.length){for(this.embedded=!0,c=this.stops[this.stops.length-1],c[0]<1&&this.stops.push([1,c[1],c[2]]),t=[],r=[],A=[],u=R=0,O=this.stops.length-1;O>=0?O>R:R>O;u=O>=0?++R:--R)r.push(0,1),u+2!==this.stops.length&&t.push(this.stops[u+1][0]),i=this.doc.ref({FunctionType:2,Domain:[0,1],C0:this.stops[u+0][1],C1:this.stops[u+1][1],N:1}),A.push(i),i.end();if(1===A.length?i=A[0]:(i=this.doc.ref({FunctionType:3,Domain:[0,1],Functions:A,Bounds:t,Encode:r}),i.end()),this.id="Sh"+ ++this.doc._gradCount,l=this.doc._ctm.slice(),f=l[0],d=l[1],v=l[2],_=l[3],w=l[4],b=l[5],M=this.transform,p=M[0],g=M[1],m=M[2],y=M[3],e=M[4],n=M[5],l[0]=f*p+v*g,l[1]=d*p+_*g,l[2]=f*m+v*y,l[3]=d*m+_*y,l[4]=f*e+v*n+w,l[5]=d*e+_*n+b,C=this.shader(i),C.end(),S=this.doc.ref({Type:"Pattern",PatternType:2,Shading:C,Matrix:function(){var t,e,n;for(n=[],t=0,e=l.length;e>t;t++)L=l[t],n.push(+L.toFixed(5));return n}()}),this.doc.page.patterns[this.id]=S,S.end(),this.stops.some(function(t){return t[2]<1})){for(a=this.opacityGradient(),a._colorSpace="DeviceGray",D=this.stops,T=0,B=D.length;B>T;T++)I=D[T],a.stop(I[0],[I[2]]);a=a.embed(),s=this.doc.ref({Type:"Group",S:"Transparency",CS:"DeviceGray"}),s.end(),k=this.doc.ref({ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Shading:{Sh1:a.data.Shading}}),k.end(),o=this.doc.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:[0,0,this.doc.page.width,this.doc.page.height],Group:s,Resources:k}),o.end("/Sh1 sh"),E=this.doc.ref({Type:"Mask",S:"Luminosity",G:o}),E.end(),h=this.doc.ref({Type:"ExtGState",SMask:E}),this.opacity_id=++this.doc._opacityCount,x="Gs"+this.opacity_id,this.doc.page.ext_gstates[x]=h,h.end()}return S}},t.prototype.apply=function(t){return this.embedded||this.embed(),this.doc.addContent("/"+this.id+" "+t),this.opacity_id?(this.doc.addContent("/Gs"+this.opacity_id+" gs"),this.doc._sMasked=!0):void 0},t}(),n=function(t){function e(t,n,r,i,o){this.doc=t,this.x1=n,this.y1=r,this.x2=i,this.y2=o,e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.shader=function(t){return this.doc.ref({ShadingType:2,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.x2,this.y2],Function:t,Extend:[!0,!0]})},e.prototype.opacityGradient=function(){return new e(this.doc,this.x1,this.y1,this.x2,this.y2)},e}(e),r=function(t){function e(t,n,r,i,o,a,s){this.doc=t,this.x1=n,this.y1=r,this.r1=i,this.x2=o,this.y2=a,this.r2=s,e.__super__.constructor.apply(this,arguments)}return o(e,t),e.prototype.shader=function(t){return this.doc.ref({ShadingType:3,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.r1,this.x2,this.y2,this.r2],Function:t,Extend:[!0,!0]})},e.prototype.opacityGradient=function(){return new e(this.doc,this.x1,this.y1,this.r1,this.x2,this.y2,this.r2)},e}(e),t.exports={PDFGradient:e,PDFLinearGradient:n,PDFRadialGradient:r}}).call(this)},function(t,e,n){(function(){var e,r,i=[].slice;r=n(68),e=4*((Math.sqrt(2)-1)/3),t.exports={initVector:function(){return this._ctm=[1,0,0,1,0,0],this._ctmStack=[]},save:function(){return this._ctmStack.push(this._ctm.slice()),this.addContent("q")},restore:function(){return this._ctm=this._ctmStack.pop()||[1,0,0,1,0,0],this.addContent("Q")},closePath:function(){return this.addContent("h")},lineWidth:function(t){return this.addContent(""+t+" w")},_CAP_STYLES:{BUTT:0,ROUND:1,SQUARE:2},lineCap:function(t){return"string"==typeof t&&(t=this._CAP_STYLES[t.toUpperCase()]),this.addContent(""+t+" J")},_JOIN_STYLES:{MITER:0,ROUND:1,BEVEL:2},lineJoin:function(t){return"string"==typeof t&&(t=this._JOIN_STYLES[t.toUpperCase()]),this.addContent(""+t+" j")},miterLimit:function(t){return this.addContent(""+t+" M")},dash:function(t,e){var n,r,i;return null==e&&(e={}),null==t?this:(r=null!=(i=e.space)?i:t,n=e.phase||0,this.addContent("["+t+" "+r+"] "+n+" d"))},undash:function(){return this.addContent("[] 0 d")},moveTo:function(t,e){return this.addContent(""+t+" "+e+" m")},lineTo:function(t,e){return this.addContent(""+t+" "+e+" l")},bezierCurveTo:function(t,e,n,r,i,o){return this.addContent(""+t+" "+e+" "+n+" "+r+" "+i+" "+o+" c")},quadraticCurveTo:function(t,e,n,r){return this.addContent(""+t+" "+e+" "+n+" "+r+" v")},rect:function(t,e,n,r){return this.addContent(""+t+" "+e+" "+n+" "+r+" re")},roundedRect:function(t,e,n,r,i){return null==i&&(i=0),this.moveTo(t+i,e),this.lineTo(t+n-i,e),this.quadraticCurveTo(t+n,e,t+n,e+i),this.lineTo(t+n,e+r-i),this.quadraticCurveTo(t+n,e+r,t+n-i,e+r),this.lineTo(t+i,e+r),this.quadraticCurveTo(t,e+r,t,e+r-i),this.lineTo(t,e+i),this.quadraticCurveTo(t,e,t+i,e)},ellipse:function(t,n,r,i){var o,a,s,h,u,c;return null==i&&(i=r),t-=r,n-=i,o=r*e,a=i*e,s=t+2*r,u=n+2*i,h=t+r,c=n+i,this.moveTo(t,c),this.bezierCurveTo(t,c-a,h-o,n,h,n),this.bezierCurveTo(h+o,n,s,c-a,s,c),this.bezierCurveTo(s,c+a,h+o,u,h,u),this.bezierCurveTo(h-o,u,t,c+a,t,c),this.closePath()},circle:function(t,e,n){return this.ellipse(t,e,n)},polygon:function(){var t,e,n,r;for(e=1<=arguments.length?i.call(arguments,0):[],this.moveTo.apply(this,e.shift()),n=0,r=e.length;r>n;n++)t=e[n],this.lineTo.apply(this,t);return this.closePath()},path:function(t){return r.apply(this,t),this},_windingRule:function(t){return/even-?odd/.test(t)?"*":""},fill:function(t,e){return/(even-?odd)|(non-?zero)/.test(t)&&(e=t,t=null),t&&this.fillColor(t),this.addContent("f"+this._windingRule(e))},stroke:function(t){return t&&this.strokeColor(t),this.addContent("S")},fillAndStroke:function(t,e,n){var r;return null==e&&(e=t),r=/(even-?odd)|(non-?zero)/,r.test(t)&&(n=t,t=null),r.test(e)&&(n=e,e=t),t&&(this.fillColor(t),this.strokeColor(e)),this.addContent("B"+this._windingRule(n))},clip:function(t){return this.addContent("W"+this._windingRule(t)+" n")},transform:function(t,e,n,r,i,o){var a,s,h,u,c,l,f,d,p;return a=this._ctm,s=a[0],h=a[1],u=a[2],c=a[3],l=a[4],f=a[5],a[0]=s*t+u*e,a[1]=h*t+c*e,a[2]=s*n+u*r,a[3]=h*n+c*r,a[4]=s*i+u*o+l,a[5]=h*i+c*o+f,p=function(){var a,s,h,u;for(h=[t,e,n,r,i,o],u=[],a=0,s=h.length;s>a;a++)d=h[a],u.push(+d.toFixed(5));return u}().join(" "),this.addContent(""+p+" cm")},translate:function(t,e){return this.transform(1,0,0,1,t,e)},rotate:function(t,e){var n,r,i,o,a,s,h,u;return null==e&&(e={}),r=t*Math.PI/180,n=Math.cos(r),i=Math.sin(r),o=s=0,null!=e.origin&&(u=e.origin,o=u[0],s=u[1],a=o*n-s*i,h=o*i+s*n,o-=a,s-=h),this.transform(n,i,-i,n,o,s)},scale:function(t,e,n){var r,i,o;return null==e&&(e=t),null==n&&(n={}),2===arguments.length&&(e=t,n=e),r=i=0,null!=n.origin&&(o=n.origin,r=o[0],i=o[1],r-=t*r,i-=e*i),this.transform(t,0,0,e,r,i)}}}).call(this)},function(t,e){(function(){var e;e=function(){function t(){}var e,n,r,i,o,a,s,h,u,c,l,f,d;return t.apply=function(t,n){var r;return r=a(n),e(r,t)},o={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},a=function(t){var e,n,r,i,a,s,h,u,c;for(h=[],e=[],i="",a=!1,s=0,u=0,c=t.length;c>u;u++)if(n=t[u],null!=o[n])s=o[n],r&&(i.length>0&&(e[e.length]=+i),h[h.length]={cmd:r,args:e},e=[],i="",a=!1),r=n;else if(" "===n||","===n||"-"===n&&i.length>0&&"e"!==i[i.length-1]||"."===n&&a){if(0===i.length)continue;e.length===s?(h[h.length]={cmd:r,args:e},e=[+i],"M"===r&&(r="L"),"m"===r&&(r="l")):e[e.length]=+i,a="."===n,i="-"===n||"."===n?n:""}else i+=n,"."===n&&(a=!0);return i.length>0&&(e.length===s?(h[h.length]={cmd:r,args:e},e=[+i],"M"===r&&(r="L"),"m"===r&&(r="l")):e[e.length]=+i),h[h.length]={cmd:r,args:e},h},r=i=s=h=f=d=0,e=function(t,e){var n,o,a,c,l;for(r=i=s=h=f=d=0,o=a=0,c=t.length;c>a;o=++a)n=t[o],"function"==typeof u[l=n.cmd]&&u[l](e,n.args);return r=i=s=h=0},u={M:function(t,e){return r=e[0],i=e[1],s=h=null,f=r,d=i,t.moveTo(r,i)},m:function(t,e){return r+=e[0],i+=e[1],s=h=null,f=r,d=i,t.moveTo(r,i)},C:function(t,e){return r=e[4],i=e[5],s=e[2],h=e[3],t.bezierCurveTo.apply(t,e)},c:function(t,e){return t.bezierCurveTo(e[0]+r,e[1]+i,e[2]+r,e[3]+i,e[4]+r,e[5]+i),s=r+e[2],h=i+e[3],r+=e[4],i+=e[5]},S:function(t,e){return null===s&&(s=r,h=i),t.bezierCurveTo(r-(s-r),i-(h-i),e[0],e[1],e[2],e[3]),s=e[0],h=e[1],r=e[2],i=e[3]},s:function(t,e){return null===s&&(s=r,h=i),t.bezierCurveTo(r-(s-r),i-(h-i),r+e[0],i+e[1],r+e[2],i+e[3]),s=r+e[0],h=i+e[1],r+=e[2],i+=e[3]},Q:function(t,e){return s=e[0],h=e[1],r=e[2],i=e[3],t.quadraticCurveTo(e[0],e[1],r,i)},q:function(t,e){return t.quadraticCurveTo(e[0]+r,e[1]+i,e[2]+r,e[3]+i),s=r+e[0],h=i+e[1],r+=e[2],i+=e[3]},T:function(t,e){return null===s?(s=r,h=i):(s=r-(s-r),h=i-(h-i)),t.quadraticCurveTo(s,h,e[0],e[1]),s=r-(s-r),h=i-(h-i),r=e[0],i=e[1]},t:function(t,e){return null===s?(s=r,h=i):(s=r-(s-r),h=i-(h-i)),t.quadraticCurveTo(s,h,r+e[0],i+e[1]),r+=e[0],i+=e[1]},A:function(t,e){return l(t,r,i,e),r=e[5],i=e[6]},a:function(t,e){return e[5]+=r,e[6]+=i,l(t,r,i,e),r=e[5],i=e[6]},L:function(t,e){return r=e[0],i=e[1],s=h=null,t.lineTo(r,i)},l:function(t,e){return r+=e[0],i+=e[1],s=h=null,t.lineTo(r,i)},H:function(t,e){return r=e[0],s=h=null,t.lineTo(r,i)},h:function(t,e){return r+=e[0],s=h=null,t.lineTo(r,i); +},V:function(t,e){return i=e[0],s=h=null,t.lineTo(r,i)},v:function(t,e){return i+=e[0],s=h=null,t.lineTo(r,i)},Z:function(t){return t.closePath(),r=f,i=d},z:function(t){return t.closePath(),r=f,i=d}},l=function(t,e,r,i){var o,a,s,h,u,l,f,d,p,g,v,m,y;for(l=i[0],f=i[1],u=i[2],h=i[3],g=i[4],a=i[5],s=i[6],p=n(a,s,l,f,h,g,u,e,r),y=[],v=0,m=p.length;m>v;v++)d=p[v],o=c.apply(null,d),y.push(t.bezierCurveTo.apply(t,o));return y},n=function(t,e,n,r,i,o,a,u,c){var l,f,d,p,g,v,m,y,_,w,b,x,S,k,E,C,I,A,L,R,T,B,O,M,D,U;for(k=a*(Math.PI/180),S=Math.sin(k),g=Math.cos(k),n=Math.abs(n),r=Math.abs(r),s=g*(u-t)*.5+S*(c-e)*.5,h=g*(c-e)*.5-S*(u-t)*.5,y=s*s/(n*n)+h*h/(r*r),y>1&&(y=Math.sqrt(y),n*=y,r*=y),l=g/n,f=S/n,d=-S/r,p=g/r,R=l*u+f*c,O=d*u+p*c,T=l*t+f*e,M=d*t+p*e,v=(T-R)*(T-R)+(M-O)*(M-O),x=1/v-.25,0>x&&(x=0),b=Math.sqrt(x),o===i&&(b=-b),B=.5*(R+T)-b*(M-O),D=.5*(O+M)+b*(T-R),E=Math.atan2(O-D,R-B),C=Math.atan2(M-D,T-B),L=C-E,0>L&&1===o?L+=2*Math.PI:L>0&&0===o&&(L-=2*Math.PI),w=Math.ceil(Math.abs(L/(.5*Math.PI+.001))),_=[],m=U=0;w>=0?w>U:U>w;m=w>=0?++U:--U)I=E+m*L/w,A=E+(m+1)*L/w,_[m]=[B,D,I,A,n,r,S,g];return _},c=function(t,e,n,r,i,o,a,s){var h,u,c,l,f,d,p,g,v,m,y,_;return h=s*i,u=-a*o,c=a*i,l=s*o,d=.5*(r-n),f=8/3*Math.sin(.5*d)*Math.sin(.5*d)/Math.sin(d),p=t+Math.cos(n)-f*Math.sin(n),m=e+Math.sin(n)+f*Math.cos(n),v=t+Math.cos(r),_=e+Math.sin(r),g=v+f*Math.sin(r),y=_-f*Math.cos(r),[h*p+u*m,c*p+l*m,h*g+u*y,c*g+l*y,h*v+u*_,c*v+l*_]},t}(),t.exports=e}).call(this)},function(t,e,n){(function(){var e;e=n(70),t.exports={initFonts:function(){this._fontFamilies={},this._fontCount=0,this._fontSize=12,this._font=null,this._registeredFonts={}},font:function(t,n,r){var i,o,a,s;return"number"==typeof n&&(r=n,n=null),"string"==typeof t&&this._registeredFonts[t]?(i=t,s=this._registeredFonts[t],t=s.src,n=s.family):(i=n||t,"string"!=typeof i&&(i=null)),null!=r&&this.fontSize(r),(o=this._fontFamilies[i])?(this._font=o,this):(a="F"+ ++this._fontCount,this._font=new e(this,t,n,a),(o=this._fontFamilies[this._font.name])?(this._font=o,this):(i&&(this._fontFamilies[i]=this._font),this._fontFamilies[this._font.name]=this._font,this))},fontSize:function(t){return this._fontSize=t,this},currentLineHeight:function(t){return null==t&&(t=!1),this._font.lineHeight(this._fontSize,t)},registerFont:function(t,e,n){return this._registeredFonts[t]={src:e,family:n},this}}}).call(this)},function(t,e,n){(function(e,r){(function(){var i,o,a,s,h;s=n(71),i=n(87),a=n(88),h=n(44),o=function(){function t(t,r,o,h){if(this.document=t,this.id=h,"string"==typeof r){if(r in n)return this.isAFM=!0,this.font=new i(n[r]()),void this.registerAFM(r);if(/\.(ttf|ttc)$/i.test(r))this.font=s.open(r,o);else{if(!/\.dfont$/i.test(r))throw new Error("Not a supported font format or standard PDF font.");this.font=s.fromDFont(r,o)}}else if(e.isBuffer(r))this.font=s.fromBuffer(r,o);else if(r instanceof Uint8Array)this.font=s.fromBuffer(new e(r),o);else{if(!(r instanceof ArrayBuffer))throw new Error("Not a supported font format or standard PDF font.");this.font=s.fromBuffer(new e(new Uint8Array(r)),o)}this.subset=new a(this.font),this.registerTTF()}var n,o;return n={Courier:function(){return h.readFileSync(r+"/font/data/Courier.afm","utf8")},"Courier-Bold":function(){return h.readFileSync(r+"/font/data/Courier-Bold.afm","utf8")},"Courier-Oblique":function(){return h.readFileSync(r+"/font/data/Courier-Oblique.afm","utf8")},"Courier-BoldOblique":function(){return h.readFileSync(r+"/font/data/Courier-BoldOblique.afm","utf8")},Helvetica:function(){return h.readFileSync(r+"/font/data/Helvetica.afm","utf8")},"Helvetica-Bold":function(){return h.readFileSync(r+"/font/data/Helvetica-Bold.afm","utf8")},"Helvetica-Oblique":function(){return h.readFileSync(r+"/font/data/Helvetica-Oblique.afm","utf8")},"Helvetica-BoldOblique":function(){return h.readFileSync(r+"/font/data/Helvetica-BoldOblique.afm","utf8")},"Times-Roman":function(){return h.readFileSync(r+"/font/data/Times-Roman.afm","utf8")},"Times-Bold":function(){return h.readFileSync(r+"/font/data/Times-Bold.afm","utf8")},"Times-Italic":function(){return h.readFileSync(r+"/font/data/Times-Italic.afm","utf8")},"Times-BoldItalic":function(){return h.readFileSync(r+"/font/data/Times-BoldItalic.afm","utf8")},Symbol:function(){return h.readFileSync(r+"/font/data/Symbol.afm","utf8")},ZapfDingbats:function(){return h.readFileSync(r+"/font/data/ZapfDingbats.afm","utf8")}},t.prototype.use=function(t){var e;return null!=(e=this.subset)?e.use(t):void 0},t.prototype.embed=function(){return this.embedded||null==this.dictionary?void 0:(this.isAFM?this.embedAFM():this.embedTTF(),this.embedded=!0)},t.prototype.encode=function(t){var e;return this.isAFM?this.font.encodeText(t):(null!=(e=this.subset)?e.encodeText(t):void 0)||t},t.prototype.ref=function(){return null!=this.dictionary?this.dictionary:this.dictionary=this.document.ref()},t.prototype.registerTTF=function(){var t,e,n,r,i;if(this.name=this.font.name.postscriptName,this.scaleFactor=1e3/this.font.head.unitsPerEm,this.bbox=function(){var e,n,r,i;for(r=this.font.bbox,i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(Math.round(t*this.scaleFactor));return i}.call(this),this.stemV=0,this.font.post.exists?(r=this.font.post.italic_angle,e=r>>16,n=255&r,e&!0&&(e=-((65535^e)+1)),this.italicAngle=+(""+e+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.font.ascender*this.scaleFactor),this.decender=Math.round(this.font.decender*this.scaleFactor),this.lineGap=Math.round(this.font.lineGap*this.scaleFactor),this.capHeight=this.font.os2.exists&&this.font.os2.capHeight||this.ascender,this.xHeight=this.font.os2.exists&&this.font.os2.xHeight||0,this.familyClass=(this.font.os2.exists&&this.font.os2.familyClass||0)>>8,this.isSerif=1===(i=this.familyClass)||2===i||3===i||4===i||5===i||7===i,this.isScript=10===this.familyClass,this.flags=0,this.font.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.font.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.embedTTF=function(){var t,e,n,r,i,a,s,h;return r=this.subset.encode(),s=this.document.ref(),s.write(r),s.data.Length1=s.uncompressedLength,s.end(),i=this.document.ref({Type:"FontDescriptor",FontName:this.subset.postscriptName,FontFile2:s,FontBBox:this.bbox,Flags:this.flags,StemV:this.stemV,ItalicAngle:this.italicAngle,Ascent:this.ascender,Descent:this.decender,CapHeight:this.capHeight,XHeight:this.xHeight}),i.end(),a=+Object.keys(this.subset.cmap)[0],t=function(){var t,e;t=this.subset.cmap,e=[];for(n in t)h=t[n],e.push(Math.round(this.font.widthOfGlyph(h)));return e}.call(this),e=this.document.ref(),e.end(o(this.subset.subset)),this.dictionary.data={Type:"Font",BaseFont:this.subset.postscriptName,Subtype:"TrueType",FontDescriptor:i,FirstChar:a,LastChar:a+t.length-1,Widths:t,Encoding:"MacRomanEncoding",ToUnicode:e},this.dictionary.end()},o=function(t){var e,n,r,i,o,a,s;for(o="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<00>\nendcodespacerange",n=Object.keys(t).sort(function(t,e){return t-e}),r=[],a=0,s=n.length;s>a;a++)e=n[a],r.length>=100&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),i=("0000"+t[e].toString(16)).slice(-4),e=(+e).toString(16),r.push("<"+e+"><"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"},t.prototype.registerAFM=function(t){var e;return this.name=t,e=this.font,this.ascender=e.ascender,this.decender=e.decender,this.bbox=e.bbox,this.lineGap=e.lineGap,e},t.prototype.embedAFM=function(){return this.dictionary.data={Type:"Font",BaseFont:this.name,Subtype:"Type1",Encoding:"WinAnsiEncoding"},this.dictionary.end()},t.prototype.widthOfString=function(t,e){var n,r,i,o,a,s;for(t=""+t,o=0,r=a=0,s=t.length;s>=0?s>a:a>s;r=s>=0?++a:--a)n=t.charCodeAt(r),o+=this.font.widthOfGlyph(this.font.characterToGlyph(n))||0;return i=e/1e3,o*i},t.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1),n=e?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},t}(),t.exports=o}).call(this)}).call(e,n(2).Buffer,"/")},function(t,e,n){(function(){var CmapTable,e,r,i,GlyfTable,HeadTable,HheaTable,HmtxTable,LocaTable,MaxpTable,NameTable,OS2Table,PostTable,o,a;a=n(44),r=n(72),e=n(73),i=n(74),NameTable=n(75),HeadTable=n(78),CmapTable=n(79),HmtxTable=n(80),HheaTable=n(81),MaxpTable=n(82),PostTable=n(83),OS2Table=n(84),LocaTable=n(85),GlyfTable=n(86),o=function(){function t(t,e){var n,i,o,a,s,h,u,c,l;if(this.rawData=t,n=this.contents=new r(this.rawData),"ttcf"===n.readString(4)){if(!e)throw new Error("Must specify a font name for TTC files.");for(h=n.readInt(),o=n.readInt(),s=[],i=u=0;o>=0?o>u:u>o;i=o>=0?++u:--u)s[i]=n.readInt();for(i=c=0,l=s.length;l>c;i=++c)if(a=s[i],n.pos=a,this.parse(),this.name.postscriptName===e)return;throw new Error("Font "+e+" not found in TTC file.")}n.pos=0,this.parse()}return t.open=function(e,n){var r;return r=a.readFileSync(e),new t(r,n)},t.fromDFont=function(n,r){var i;return i=e.open(n),new t(i.getNamedFont(r))},t.fromBuffer=function(n,r){var i,o,a;try{if(a=new t(n,r),!(a.head.exists&&a.name.exists&&a.cmap.exists||(i=new e(n),a=new t(i.getNamedFont(r)),a.head.exists&&a.name.exists&&a.cmap.exists)))throw new Error("Invalid TTF file in DFont");return a}catch(s){throw o=s,new Error("Unknown font format in buffer: "+o.message)}},t.prototype.parse=function(){return this.directory=new i(this.contents),this.head=new HeadTable(this),this.name=new NameTable(this),this.cmap=new CmapTable(this),this.hhea=new HheaTable(this),this.maxp=new MaxpTable(this),this.hmtx=new HmtxTable(this),this.post=new PostTable(this),this.os2=new OS2Table(this),this.loca=new LocaTable(this),this.glyf=new GlyfTable(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},t}(),t.exports=o}).call(this)},function(t,e){(function(){var e;e=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.byteAt=function(t){return this.data[t]},t.prototype.readBool=function(){return!!this.readByte()},t.prototype.writeBool=function(t){return this.writeByte(t?1:0)},t.prototype.readUInt32=function(){var t,e,n,r;return t=16777216*this.readByte(),e=this.readByte()<<16,n=this.readByte()<<8,r=this.readByte(),t+e+n+r},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return t=this.readUInt32(),t>=2147483648?t-4294967296:t},t.prototype.writeInt32=function(t){return 0>t&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){var t,e;return t=this.readByte()<<8,e=this.readByte(),t|e},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return t=this.readUInt16(),t>=32768?t-65536:t},t.prototype.writeInt16=function(t){return 0>t&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n,r;for(n=[],e=r=0;t>=0?t>r:r>t;e=t>=0?++r:--r)n[e]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var e,n,r,i;for(i=[],e=n=0,r=t.length;r>=0?r>n:n>r;e=r>=0?++n:--n)i.push(this.writeByte(t.charCodeAt(e)));return i},t.prototype.stringAt=function(t,e){return this.pos=t,this.readString(e)},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,e,n,r,i,o,a,s;return t=this.readByte(),e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),o=this.readByte(),a=this.readByte(),s=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^e)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^o)+256*(255^a)+(255^s)+1):72057594037927940*t+281474976710656*e+1099511627776*n+4294967296*r+16777216*i+65536*o+256*a+s},t.prototype.writeLongLong=function(t){var e,n;return e=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.slice=function(t,e){return this.data.slice(t,e)},t.prototype.read=function(t){var e,n,r;for(e=[],n=r=0;t>=0?t>r:r>t;n=t>=0?++r:--r)e.push(this.readByte());return e},t.prototype.write=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;r>n;n++)e=t[n],i.push(this.writeByte(e));return i},t}(),t.exports=e}).call(this)},function(t,e,n){(function(){var e,r,i,NameTable,o;o=n(44),r=n(72),i=n(74),NameTable=n(75),e=function(){function t(t){this.contents=new r(t),this.parse(this.contents)}return t.open=function(e){var n;return n=o.readFileSync(e),new t(n)},t.prototype.parse=function(t){var e,n,o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w,b,x,S,k,E,C,I,A,L,R,T;for(h=t.readInt(),_=t.readInt(),s=t.readInt(),y=t.readInt(),this.map={},t.pos=_+24,L=t.readShort()+_,S=t.readShort()+_,t.pos=L,w=t.readShort(),d=R=0;w>=R;d=R+=1){for(A=t.readString(4),b=t.readShort(),I=t.readShort(),this.map[A]={list:[],named:{}},C=t.pos,t.pos=L+I,g=T=0;b>=T;g=T+=1)p=t.readShort(),k=t.readShort(),e=t.readByte(),n=t.readByte()<<16,o=t.readByte()<<8,a=t.readByte(),u=h+(0|n|o|a),f=t.readUInt32(),c={id:p,attributes:e,offset:u,handle:f},E=t.pos,-1!==k&&_+y>S+k?(t.pos=S+k,v=t.readByte(),c.name=t.readString(v)):"sfnt"===A&&(t.pos=c.offset,m=t.readUInt32(),l={},l.contents=new r(t.slice(t.pos,t.pos+m)),l.directory=new i(l.contents),x=new NameTable(l),c.name=x.fontName[0].raw),t.pos=E,this.map[A].list.push(c),c.name&&(this.map[A].named[c.name]=c);t.pos=C}},t.prototype.getNamedFont=function(t){var e,n,r,i,o,a;if(e=this.contents,i=e.pos,n=null!=(a=this.map.sfnt)?a.named[t]:void 0,!n)throw new Error("Font "+t+" not found in DFont file.");return e.pos=n.offset,r=e.readUInt32(),o=e.slice(e.pos,e.pos+r),e.pos=i,o},t}(),t.exports=e}).call(this)},function(t,e,n){(function(e){(function(){var r,i,o=[].slice;r=n(72),i=function(){function t(t){var e,n,r,i;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=r=0,i=this.tableCount;i>=0?i>r:r>i;n=i>=0?++r:--r)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}var n;return t.prototype.encode=function(t){var i,o,a,s,h,u,c,l,f,d,p,g,v,m;g=Object.keys(t).length,u=Math.log(2),f=16*Math.floor(Math.log(g)/u),s=Math.floor(f/u),l=16*g-f,o=new r,o.writeInt(this.scalarType),o.writeShort(g),o.writeShort(f),o.writeShort(s),o.writeShort(l),a=16*g,c=o.pos+a,h=null,v=[];for(m in t)for(p=t[m],o.writeString(m),o.writeInt(n(p)),o.writeInt(c),o.writeInt(p.length),v=v.concat(p),"head"===m&&(h=c),c+=p.length;c%4;)v.push(0),c++;return o.write(v),d=n(o.data),i=2981146554-d,o.pos=h+8,o.writeUInt32(i),new e(o.data)},n=function(t){var e,n,i,a,s;for(t=o.call(t);t.length%4;)t.push(0);for(i=new r(t),n=0,e=a=0,s=t.length;s>a;e=a+=4)n+=i.readUInt32();return 4294967295&n},t}(),t.exports=i}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){(function(){var e,r,NameTable,i,o,a={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};i=n(76),e=n(72),o=n(77),NameTable=function(t){function NameTable(){return NameTable.__super__.constructor.apply(this,arguments)}var n;return s(NameTable,t),NameTable.prototype.tag="name",NameTable.prototype.parse=function(t){var e,n,i,o,a,s,h,u,c,l,f,d,p;for(t.pos=this.offset,o=t.readShort(),e=t.readShort(),h=t.readShort(),n=[],a=l=0;e>=0?e>l:l>e;a=e>=0?++l:--l)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+h+t.readShort()});for(u={},a=f=0,d=n.length;d>f;a=++f)i=n[a],t.pos=i.offset,c=t.readString(i.length),s=new r(c,i),null==u[p=i.nameID]&&(u[p]=[]),u[i.nameID].push(s);return this.strings=u,this.copyright=u[0],this.fontFamily=u[1],this.fontSubfamily=u[2],this.uniqueSubfamily=u[3],this.fontName=u[4],this.version=u[5],this.postscriptName=u[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,""),this.trademark=u[7],this.manufacturer=u[8],this.designer=u[9],this.description=u[10],this.vendorUrl=u[11],this.designerUrl=u[12],this.license=u[13],this.licenseUrl=u[14],this.preferredFamily=u[15],this.preferredSubfamily=u[17],this.compatibleFull=u[18],this.sampleText=u[19]},n="AAAAAA",NameTable.prototype.encode=function(){var t,i,a,s,h,u,c,l,f,d,p,g,v,m;f={},m=this.strings;for(t in m)p=m[t],f[t]=p;h=new r(""+n+"+"+this.postscriptName,{platformID:1,encodingID:0,languageID:0}),f[6]=[h],n=o.successorOf(n),u=0;for(t in f)i=f[t],null!=i&&(u+=i.length);d=new e,c=new e,d.writeShort(0),d.writeShort(u),d.writeShort(6+12*u);for(a in f)if(i=f[a],null!=i)for(g=0,v=i.length;v>g;g++)l=i[g],d.writeShort(l.platformID),d.writeShort(l.encodingID),d.writeShort(l.languageID),d.writeShort(a),d.writeShort(l.length),d.writeShort(c.pos),c.writeString(l.raw);return s={postscriptName:h.raw,table:d.data.concat(c.data)}},NameTable}(i),t.exports=NameTable,r=function(){function t(t,e){this.raw=t,this.length=this.raw.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID}return t}()}).call(this)},function(t,e){(function(){var e;e=function(){function t(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}(),t.exports=e}).call(this)},function(t,e){(function(){e.successorOf=function(t){var e,n,r,i,o,a,s,h,u,c;for(n="abcdefghijklmnopqrstuvwxyz",h=n.length,c=t,i=t.length;i>=0;){if(s=t.charAt(--i),isNaN(s)){if(o=n.indexOf(s.toLowerCase()),-1===o)u=s,r=!0;else if(u=n.charAt((o+1)%h),a=s===s.toUpperCase(),a&&(u=u.toUpperCase()),r=o+1>=h,r&&0===i){e=a?"A":"a",c=e+u+c.slice(1);break}}else if(u=+s+1,r=u>9,r&&(u=0),r&&0===i){c="1"+u+c.slice(1);break}if(c=c.slice(0,i)+u+c.slice(i+1),!r)break}return c},e.invert=function(t){var e,n,r;n={};for(e in t)r=t[e],n[r]=e;return n}}).call(this)},function(t,e,n){(function(){var e,HeadTable,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=n(76),e=n(72),HeadTable=function(t){function HeadTable(){return HeadTable.__super__.constructor.apply(this,arguments)}return o(HeadTable,t),HeadTable.prototype.tag="head",HeadTable.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},HeadTable.prototype.encode=function(t){var n;return n=new e,n.writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t.type),n.writeShort(this.glyphDataFormat),n.data},HeadTable}(r),t.exports=HeadTable}).call(this)},function(t,e,n){(function(){var e,CmapTable,r,i,o={}.hasOwnProperty,a=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};i=n(76),r=n(72),CmapTable=function(t){function CmapTable(){return CmapTable.__super__.constructor.apply(this,arguments)}return a(CmapTable,t),CmapTable.prototype.tag="cmap",CmapTable.prototype.parse=function(t){var n,r,i,o;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,r=o=0;i>=0?i>o:o>i;r=i>=0?++o:--o)n=new e(t,this.offset),this.tables.push(n),n.isUnicode&&null==this.unicode&&(this.unicode=n);return!0},CmapTable.encode=function(t,n){var i,o;return null==n&&(n="macroman"),i=e.encode(t,n),o=new r,o.writeUInt16(0),o.writeUInt16(1),i.table=o.data.concat(i.subtable),i},CmapTable}(i),e=function(){function t(t,e){var n,r,i,o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=e+t.readInt(),l=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(s=m=0;256>m;s=++m)this.codeMap[s]=t.readByte();break;case 4:for(d=t.readUInt16(),f=d/2,t.pos+=6,i=function(){var e,n;for(n=[],s=e=0;f>=0?f>e:e>f;s=f>=0?++e:--e)n.push(t.readUInt16());return n}(),t.pos+=2,g=function(){var e,n;for(n=[],s=e=0;f>=0?f>e:e>f;s=f>=0?++e:--e)n.push(t.readUInt16());return n}(),h=function(){var e,n;for(n=[],s=e=0;f>=0?f>e:e>f;s=f>=0?++e:--e)n.push(t.readUInt16());return n}(),u=function(){var e,n;for(n=[],s=e=0;f>=0?f>e:e>f;s=f>=0?++e:--e)n.push(t.readUInt16());return n}(),r=(this.length-t.pos+this.offset)/2,a=function(){var e,n;for(n=[],s=e=0;r>=0?r>e:e>r;s=r>=0?++e:--e)n.push(t.readUInt16());return n}(),s=y=0,w=i.length;w>y;s=++y)for(v=i[s],p=g[s],n=_=p;v>=p?v>=_:_>=v;n=v>=p?++_:--_)0===u[s]?o=n+h[s]:(c=u[s]/2+(n-p)-(f-s),o=a[c]||0,0!==o&&(o+=h[s])),this.codeMap[n]=65535&o}t.pos=l}return t.encode=function(t,e){var n,i,o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w,b,x,S,k,E,C,I,A,L,R,T,B,O,M,D,U,P,z,F,W,N,j,H,Z,G,Y,q,K,X;switch(T=new r,a=Object.keys(t).sort(function(t,e){return t-e}),e){case"macroman":for(g=0,v=function(){var t,e;for(e=[],p=t=0;256>t;p=++t)e.push(0);return e}(),y={0:0},o={},B=0,U=a.length;U>B;B++)i=a[B],null==y[Y=t[i]]&&(y[Y]=++g),o[i]={old:t[i],"new":y[t[i]]},v[i]=y[t[i]];return T.writeUInt16(1),T.writeUInt16(0),T.writeUInt32(12),T.writeUInt16(0),T.writeUInt16(262),T.writeUInt16(0),T.write(v),k={charMap:o,subtable:T.data,maxGlyphID:g+1};case"unicode":for(L=[],l=[],_=0,y={},n={},m=u=null,O=0,P=a.length;P>O;O++)i=a[O],b=t[i],null==y[b]&&(y[b]=++_),n[i]={old:b,"new":y[b]},s=y[b]-i,(null==m||s!==u)&&(m&&l.push(m),L.push(i),u=s),m=i;for(m&&l.push(m),l.push(65535),L.push(65535),C=L.length,I=2*C,E=2*Math.pow(Math.log(C)/Math.LN2,2),f=Math.log(E/2)/Math.LN2,S=2*C-E,h=[],x=[],d=[],p=M=0,z=L.length;z>M;p=++M){if(A=L[p],c=l[p],65535===A){h.push(0),x.push(0);break}if(R=n[A]["new"],A-R>=32768)for(h.push(0),x.push(2*(d.length+C-p)),i=D=A;c>=A?c>=D:D>=c;i=c>=A?++D:--D)d.push(n[i]["new"]);else h.push(R-A),x.push(0)}for(T.writeUInt16(3),T.writeUInt16(1),T.writeUInt32(12),T.writeUInt16(4),T.writeUInt16(16+8*C+2*d.length),T.writeUInt16(0),T.writeUInt16(I),T.writeUInt16(E),T.writeUInt16(f),T.writeUInt16(S),Z=0,F=l.length;F>Z;Z++)i=l[Z],T.writeUInt16(i);for(T.writeUInt16(0),G=0,W=L.length;W>G;G++)i=L[G],T.writeUInt16(i);for(q=0,N=h.length;N>q;q++)s=h[q],T.writeUInt16(s);for(K=0,j=x.length;j>K;K++)w=x[K],T.writeUInt16(w);for(X=0,H=d.length;H>X;X++)g=d[X],T.writeUInt16(g);return k={charMap:n,subtable:T.data,maxGlyphID:_+1}}},t}(),t.exports=CmapTable}).call(this)},function(t,e,n){(function(){var e,HmtxTable,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=n(76),e=n(72),HmtxTable=function(t){function HmtxTable(){return HmtxTable.__super__.constructor.apply(this,arguments)}return o(HmtxTable,t),HmtxTable.prototype.tag="hmtx",HmtxTable.prototype.parse=function(t){var e,n,r,i,o,a,s,h;for(t.pos=this.offset,this.metrics=[],e=o=0,s=this.file.hhea.numberOfMetrics;s>=0?s>o:o>s;e=s>=0?++o:--o)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i;for(i=[],e=n=0;r>=0?r>n:n>r;e=r>=0?++n:--n)i.push(t.readInt16());return i}(),this.widths=function(){var t,e,n,r;for(n=this.metrics,r=[],t=0,e=n.length;e>t;t++)i=n[t],r.push(i.advance);return r}.call(this),n=this.widths[this.widths.length-1],h=[],e=a=0;r>=0?r>a:a>r;e=r>=0?++a:--a)h.push(this.widths.push(n));return h},HmtxTable.prototype.forGlyph=function(t){var e;return t in this.metrics?this.metrics[t]:e={advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},HmtxTable.prototype.encode=function(t){var n,r,i,o,a;for(i=new e,o=0,a=t.length;a>o;o++)n=t[o],r=this.forGlyph(n),i.writeUInt16(r.advance),i.writeUInt16(r.lsb);return i.data},HmtxTable}(r),t.exports=HmtxTable}).call(this)},function(t,e,n){(function(){var e,HheaTable,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=n(76),e=n(72),HheaTable=function(t){function HheaTable(){return HheaTable.__super__.constructor.apply(this,arguments)}return o(HheaTable,t),HheaTable.prototype.tag="hhea",HheaTable.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},HheaTable.prototype.encode=function(t){var n,r,i,o;for(r=new e,r.writeInt(this.version),r.writeShort(this.ascender),r.writeShort(this.decender),r.writeShort(this.lineGap),r.writeShort(this.advanceWidthMax),r.writeShort(this.minLeftSideBearing),r.writeShort(this.minRightSideBearing),r.writeShort(this.xMaxExtent),r.writeShort(this.caretSlopeRise),r.writeShort(this.caretSlopeRun),r.writeShort(this.caretOffset),n=i=0,o=8;o>=0?o>i:i>o;n=o>=0?++i:--i)r.writeByte(0);return r.writeShort(this.metricDataFormat),r.writeUInt16(t.length),r.data},HheaTable}(r),t.exports=HheaTable}).call(this)},function(t,e,n){(function(){var e,MaxpTable,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=n(76),e=n(72),MaxpTable=function(t){function MaxpTable(){return MaxpTable.__super__.constructor.apply(this,arguments)}return o(MaxpTable,t),MaxpTable.prototype.tag="maxp",MaxpTable.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},MaxpTable.prototype.encode=function(t){var n;return n=new e,n.writeInt(this.version),n.writeUInt16(t.length),n.writeUInt16(this.maxPoints),n.writeUInt16(this.maxContours),n.writeUInt16(this.maxCompositePoints),n.writeUInt16(this.maxComponentContours),n.writeUInt16(this.maxZones),n.writeUInt16(this.maxTwilightPoints),n.writeUInt16(this.maxStorage),n.writeUInt16(this.maxFunctionDefs),n.writeUInt16(this.maxInstructionDefs),n.writeUInt16(this.maxStackElements),n.writeUInt16(this.maxSizeOfInstructions),n.writeUInt16(this.maxComponentElements),n.writeUInt16(this.maxComponentDepth),n.data},MaxpTable}(r),t.exports=MaxpTable}).call(this)},function(t,e,n){(function(){var e,PostTable,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=n(76),e=n(72),PostTable=function(t){function PostTable(){return PostTable.__super__.constructor.apply(this,arguments)}var n;return o(PostTable,t),PostTable.prototype.tag="post",PostTable.prototype.parse=function(t){var e,n,r,i,o;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:break;case 131072:for(r=t.readUInt16(),this.glyphNameIndex=[],e=i=0;r>=0?r>i:i>r;e=r>=0?++i:--i)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],o=[];t.pos=0?r>n:n>r;e=r>=0?++n:--n)i.push(t.readUInt32());return i}.call(this)}},PostTable.prototype.glyphFor=function(t){var e;switch(this.format){case 65536:return n[t]||".notdef";case 131072:return e=this.glyphNameIndex[t],257>=e?n[e]:this.names[e-258]||".notdef";case 151552:return n[t+this.offsets[t]]||".notdef";case 196608:return".notdef";case 262144:return this.map[t]||65535}},PostTable.prototype.encode=function(t){var r,i,o,a,s,h,u,c,l,f,d,p,g,v,m;if(!this.exists)return null;if(h=this.raw(),196608===this.format)return h;for(l=new e(h.slice(0,32)),l.writeUInt32(131072),l.pos=32,o=[],c=[],f=0,g=t.length;g>f;f++)r=t[f],s=this.glyphFor(r),a=n.indexOf(s),-1!==a?o.push(a):(o.push(257+c.length),c.push(s));for(l.writeUInt16(Object.keys(t).length),d=0,v=o.length;v>d;d++)i=o[d],l.writeUInt16(i);for(p=0,m=c.length;m>p;p++)u=c[p],l.writeByte(u.length),l.writeString(u);return l.data},n=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent\nampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash\nzero one two three four five six seven eight nine colon semicolon less equal greater\nquestion at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\nbracketleft backslash bracketright asciicircum underscore grave\na b c d e f g h i j k l m n o p q r s t u v w x y z\nbraceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis\nUdieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave\necircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve\nocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent\nsterling section bullet paragraph germandbls registered copyright trademark acute\ndieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu\npartialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash\nquestiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft\nguillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash\nquotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis\nfraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered\nquotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis\nEgrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute\nUcircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla\nhungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth\neth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior\nonehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla\nCacute cacute Ccaron ccaron dcroat".split(/\s+/g), +PostTable}(r),t.exports=PostTable}).call(this)},function(t,e,n){(function(){var OS2Table,e,r={}.hasOwnProperty,i=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};e=n(76),OS2Table=function(t){function OS2Table(){return OS2Table.__super__.constructor.apply(this,arguments)}return i(OS2Table,t),OS2Table.prototype.tag="OS/2",OS2Table.prototype.parse=function(t){var e;return t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,r;for(r=[],e=n=0;10>n;e=++n)r.push(t.readByte());return r}(),this.charRange=function(){var n,r;for(r=[],e=n=0;4>n;e=++n)r.push(t.readInt());return r}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,r;for(r=[],e=n=0;2>n;e=++n)r.push(t.readInt());return r}(),this.version>1)?(this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()):void 0},OS2Table.prototype.encode=function(){return this.raw()},OS2Table}(e),t.exports=OS2Table}).call(this)},function(t,e,n){(function(){var e,LocaTable,r,i={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=n(76),e=n(72),LocaTable=function(t){function LocaTable(){return LocaTable.__super__.constructor.apply(this,arguments)}return o(LocaTable,t),LocaTable.prototype.tag="loca",LocaTable.prototype.parse=function(t){var e,n;return t.pos=this.offset,e=this.file.head.indexToLocFormat,0===e?this.offsets=function(){var e,r,i;for(i=[],n=e=0,r=this.length;r>e;n=e+=2)i.push(2*t.readUInt16());return i}.call(this):this.offsets=function(){var e,r,i;for(i=[],n=e=0,r=this.length;r>e;n=e+=4)i.push(t.readUInt32());return i}.call(this)},LocaTable.prototype.indexOf=function(t){return this.offsets[t]},LocaTable.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},LocaTable.prototype.encode=function(t){var n,r,i,o,a,s,h,u,c,l,f;for(o=new e,a=0,u=t.length;u>a;a++)if(r=t[a],r>65535){for(f=this.offsets,s=0,c=f.length;c>s;s++)n=f[s],o.writeUInt32(n);return i={format:1,table:o.data}}for(h=0,l=t.length;l>h;h++)n=t[h],o.writeUInt16(n/2);return i={format:0,table:o.data}},LocaTable}(r),t.exports=LocaTable}).call(this)},function(t,e,n){(function(){var e,r,GlyfTable,i,o,a={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},h=[].slice;o=n(76),r=n(72),GlyfTable=function(t){function GlyfTable(){return GlyfTable.__super__.constructor.apply(this,arguments)}return s(GlyfTable,t),GlyfTable.prototype.tag="glyf",GlyfTable.prototype.parse=function(t){return this.cache={}},GlyfTable.prototype.glyphFor=function(t){var n,o,a,s,h,u,c,l,f,d;return t in this.cache?this.cache[t]:(s=this.file.loca,n=this.file.contents,o=s.indexOf(t),a=s.lengthOf(t),0===a?this.cache[t]=null:(n.pos=this.offset+o,u=new r(n.read(a)),h=u.readShort(),l=u.readShort(),d=u.readShort(),c=u.readShort(),f=u.readShort(),-1===h?this.cache[t]=new e(u,l,d,c,f):this.cache[t]=new i(u,h,l,d,c,f),this.cache[t]))},GlyfTable.prototype.encode=function(t,e,n){var r,i,o,a,s,h;for(a=[],o=[],s=0,h=e.length;h>s;s++)i=e[s],r=t[i],o.push(a.length),r&&(a=a.concat(r.encode(n)));return o.push(a.length),{table:a,offsets:o}},GlyfTable}(o),i=function(){function t(t,e,n,r,i,o){this.raw=t,this.numberOfContours=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),e=function(){function t(t,r,s,h,u){var c,l;for(this.raw=t,this.xMin=r,this.yMin=s,this.xMax=h,this.yMax=u,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],c=this.raw;;){if(l=c.readShort(),this.glyphOffsets.push(c.pos),this.glyphIDs.push(c.readShort()),!(l&n))break;l&e?c.pos+=4:c.pos+=2,l&a?c.pos+=8:l&i?c.pos+=4:l&o&&(c.pos+=2)}}var e,n,i,o,a,s;return e=1,o=8,n=32,i=64,a=128,s=256,t.prototype.encode=function(t){var e,n,i,o,a,s;for(i=new r(h.call(this.raw.data)),s=this.glyphIDs,e=o=0,a=s.length;a>o;e=++o)n=s[e],i.pos=this.glyphOffsets[e],i.writeShort(t[n]);return i.data},t}(),t.exports=GlyfTable}).call(this)},function(t,e,n){(function(){var e,r;r=n(44),e=function(){function t(t){var e,r;this.contents=t,this.attributes={},this.glyphWidths={},this.boundingBoxes={},this.parse(),this.charWidths=function(){var t,e;for(e=[],r=t=0;255>=t;r=++t)e.push(this.glyphWidths[n[r]]);return e}.call(this),this.bbox=function(){var t,n,r,i;for(r=this.attributes.FontBBox.split(/\s+/),i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(+e);return i}.call(this),this.ascender=+(this.attributes.Ascender||0),this.decender=+(this.attributes.Descender||0),this.lineGap=this.bbox[3]-this.bbox[1]-(this.ascender-this.decender)}var e,n;return t.open=function(e){return new t(r.readFileSync(e,"utf8"))},t.prototype.parse=function(){var t,e,n,r,i,o,a,s,h,u;for(o="",u=this.contents.split("\n"),s=0,h=u.length;h>s;s++)if(n=u[s],r=n.match(/^Start(\w+)/))o=r[1];else if(r=n.match(/^End(\w+)/))o="";else switch(o){case"FontMetrics":r=n.match(/(^\w+)\s+(.*)/),e=r[1],a=r[2],(t=this.attributes[e])?(Array.isArray(t)||(t=this.attributes[e]=[t]),t.push(a)):this.attributes[e]=a;break;case"CharMetrics":if(!/^CH?\s/.test(n))continue;i=n.match(/\bN\s+(\.?\w+)\s*;/)[1],this.glyphWidths[i]=+n.match(/\bWX\s+(\d+)\s*;/)[1]}},e={402:131,8211:150,8212:151,8216:145,8217:146,8218:130,8220:147,8221:148,8222:132,8224:134,8225:135,8226:149,8230:133,8364:128,8240:137,8249:139,8250:155,710:136,8482:153,338:140,339:156,732:152,352:138,353:154,376:159,381:142,382:158},t.prototype.encodeText=function(t){var n,r,i,o,a;for(i="",r=o=0,a=t.length;a>=0?a>o:o>a;r=a>=0?++o:--o)n=t.charCodeAt(r),n=e[n]||n,i+=String.fromCharCode(n);return i},t.prototype.characterToGlyph=function(t){return n[e[t]||t]},t.prototype.widthOfGlyph=function(t){return this.glyphWidths[t]},n=".notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n\nspace exclam quotedbl numbersign\ndollar percent ampersand quotesingle\nparenleft parenright asterisk plus\ncomma hyphen period slash\nzero one two three\nfour five six seven\neight nine colon semicolon\nless equal greater question\n\nat A B C\nD E F G\nH I J K\nL M N O\nP Q R S\nT U V W\nX Y Z bracketleft\nbackslash bracketright asciicircum underscore\n\ngrave a b c\nd e f g\nh i j k\nl m n o\np q r s\nt u v w\nx y z braceleft\nbar braceright asciitilde .notdef\n\nEuro .notdef quotesinglbase florin\nquotedblbase ellipsis dagger daggerdbl\ncircumflex perthousand Scaron guilsinglleft\nOE .notdef Zcaron .notdef\n.notdef quoteleft quoteright quotedblleft\nquotedblright bullet endash emdash\ntilde trademark scaron guilsinglright\noe .notdef zcaron ydieresis\n\nspace exclamdown cent sterling\ncurrency yen brokenbar section\ndieresis copyright ordfeminine guillemotleft\nlogicalnot hyphen registered macron\ndegree plusminus twosuperior threesuperior\nacute mu paragraph periodcentered\ncedilla onesuperior ordmasculine guillemotright\nonequarter onehalf threequarters questiondown\n\nAgrave Aacute Acircumflex Atilde\nAdieresis Aring AE Ccedilla\nEgrave Eacute Ecircumflex Edieresis\nIgrave Iacute Icircumflex Idieresis\nEth Ntilde Ograve Oacute\nOcircumflex Otilde Odieresis multiply\nOslash Ugrave Uacute Ucircumflex\nUdieresis Yacute Thorn germandbls\n\nagrave aacute acircumflex atilde\nadieresis aring ae ccedilla\negrave eacute ecircumflex edieresis\nigrave iacute icircumflex idieresis\neth ntilde ograve oacute\nocircumflex otilde odieresis divide\noslash ugrave uacute ucircumflex\nudieresis yacute thorn ydieresis".split(/\s+/),t}(),t.exports=e}).call(this)},function(t,e,n){(function(){var CmapTable,e,r,i=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};CmapTable=n(79),r=n(77),e=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.use=function(t){var e,n,r;{if("string"!=typeof t)return this.unicodes[t]?void 0:(this.subset[this.next]=t,this.unicodes[t]=this.next++);for(e=n=0,r=t.length;r>=0?r>n:n>r;e=r>=0?++n:--n)this.use(t.charCodeAt(e))}},t.prototype.encodeText=function(t){var e,n,r,i,o;for(r="",n=i=0,o=t.length;o>=0?o>i:i>o;n=o>=0?++i:--i)e=this.unicodes[t.charCodeAt(n)],r+=String.fromCharCode(e);return r},t.prototype.generateCmap=function(){var t,e,n,r,i;r=this.font.cmap.tables[0].codeMap,t={},i=this.subset;for(e in i)n=i[e],t[e]=r[n];return t},t.prototype.glyphIDs=function(){var t,e,n,r,o,a;r=this.font.cmap.tables[0].codeMap,t=[0],a=this.subset;for(e in a)n=a[e],o=r[n],null!=o&&i.call(t,o)<0&&t.push(o);return t.sort()},t.prototype.glyphsFor=function(t){var e,n,r,i,o,a,s;for(r={},o=0,a=t.length;a>o;o++)i=t[o],r[i]=this.font.glyf.glyphFor(i);e=[];for(i in r)n=r[i],(null!=n?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(e.length>0){s=this.glyphsFor(e);for(i in s)n=s[i],r[i]=n}return r},t.prototype.encode=function(){var t,e,n,i,o,a,s,h,u,c,l,f,d,p,g,v,m;t=CmapTable.encode(this.generateCmap(),"unicode"),i=this.glyphsFor(this.glyphIDs()),f={0:0},v=t.charMap;for(e in v)a=v[e],f[a.old]=a["new"];l=t.maxGlyphID;for(d in i)d in f||(f[d]=l++);u=r.invert(f),c=Object.keys(u).sort(function(t,e){return t-e}),p=function(){var t,e,n;for(n=[],t=0,e=c.length;e>t;t++)o=c[t],n.push(u[o]);return n}(),n=this.font.glyf.encode(i,p,f),s=this.font.loca.encode(n.offsets),h=this.font.name.encode(),this.postscriptName=h.postscriptName,this.cmap={},m=t.charMap;for(e in m)a=m[e],this.cmap[e]=a.old;return g={cmap:t.table,glyf:n.table,loca:s.table,hmtx:this.font.hmtx.encode(p),hhea:this.font.hhea.encode(p),maxp:this.font.maxp.encode(p),post:this.font.post.encode(p),name:h.table,head:this.font.head.encode(s)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},t}(),t.exports=e}).call(this)},function(t,e,n){(function(){var e;e=n(90),t.exports={initText:function(){return this.x=0,this.y=0,this._lineGap=0},lineGap:function(t){return this._lineGap=t,this},moveDown:function(t){return null==t&&(t=1),this.y+=this.currentLineHeight(!0)*t+this._lineGap,this},moveUp:function(t){return null==t&&(t=1),this.y-=this.currentLineHeight(!0)*t+this._lineGap,this},_text:function(t,n,r,i,o){var a,s,h,u,c;if(i=this._initOptions(n,r,i),t=""+t,i.wordSpacing&&(t=t.replace(/\s{2,}/g," ")),i.width)s=this._wrapper,s||(s=new e(this,i),s.on("line",o)),this._wrapper=i.continued?s:null,this._textOptions=i.continued?i:null,s.wrap(t,i);else for(c=t.split("\n"),h=0,u=c.length;u>h;h++)a=c[h],o(a,i);return this},text:function(t,e,n,r){return this._text(t,e,n,r,this._line.bind(this))},widthOfString:function(t,e){return null==e&&(e={}),this._font.widthOfString(t,this._fontSize)+(e.characterSpacing||0)*(t.length-1)},heightOfString:function(t,e){var n,r,i,o;return null==e&&(e={}),i=this.x,o=this.y,e=this._initOptions(e),e.height=1/0,r=e.lineGap||this._lineGap||0,this._text(t,this.x,this.y,e,function(t){return function(e,n){return t.y+=t.currentLineHeight(!0)+r}}(this)),n=this.y-o,this.x=i,this.y=o,n},list:function(t,n,r,i,o){var a,s,h,u,c,l,f,d;return i=this._initOptions(n,r,i),d=Math.round(this._font.ascender/1e3*this._fontSize/3),h=i.textIndent||5*d,u=i.bulletIndent||8*d,l=1,c=[],f=[],a=function(t){var e,n,r,i,o;for(o=[],e=r=0,i=t.length;i>r;e=++r)n=t[e],Array.isArray(n)?(l++,a(n),o.push(l--)):(c.push(n),o.push(f.push(l)));return o},a(t),o=new e(this,i),o.on("line",this._line.bind(this)),l=1,s=0,o.on("firstLine",function(t){return function(){var e,n;return(n=f[s++])!==l&&(e=u*(n-l),t.x+=e,o.lineWidth-=e,l=n),t.circle(t.x-h+d,t.y+d+d/2,d),t.fill()}}(this)),o.on("sectionStart",function(t){return function(){var e;return e=h+u*(l-1),t.x+=e,o.lineWidth-=e}}(this)),o.on("sectionEnd",function(t){return function(){var e;return e=h+u*(l-1),t.x-=e,o.lineWidth+=e}}(this)),o.wrap(c.join("\n"),i),this},_initOptions:function(t,e,n){var r,i,o,a;if(null==t&&(t={}),null==n&&(n={}),"object"==typeof t&&(n=t,t=null),n=function(){var t,e,r;e={};for(t in n)r=n[t],e[t]=r;return e}(),this._textOptions){a=this._textOptions;for(r in a)o=a[r],"continued"!==r&&null==n[r]&&(n[r]=o)}return null!=t&&(this.x=t),null!=e&&(this.y=e),n.lineBreak!==!1&&(i=this.page.margins,null==n.width&&(n.width=this.page.width-this.x-i.right)),n.columns||(n.columns=0),null==n.columnGap&&(n.columnGap=18),n},_line:function(t,e,n){var r;return null==e&&(e={}),this._fragment(t,this.x,this.y,e),r=e.lineGap||this._lineGap||0,n?this.y+=this.currentLineHeight(!0)+r:this.x+=this.widthOfString(t)},_fragment:function(t,e,n,r){var i,o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w,b,x;if(t=""+t,0!==t.length){if(i=r.align||"left",m=r.wordSpacing||0,o=r.characterSpacing||0,r.width)switch(i){case"right":g=this.widthOfString(t.replace(/\s+$/,""),r),e+=r.lineWidth-g;break;case"center":e+=r.lineWidth/2-r.textWidth/2;break;case"justify":y=t.trim().split(/\s+/),g=this.widthOfString(t.replace(/\s+/g,""),r),p=this.widthOfString(" ")+o,m=Math.max(0,(r.lineWidth-g)/Math.max(1,y.length-1)-p)}if(d=r.textWidth+m*(r.wordCount-1)+o*(t.length-1),r.link&&this.link(e,n,d,this.currentLineHeight(),r.link),(r.underline||r.strike)&&(this.save(),r.stroke||this.strokeColor.apply(this,this._fillColor),c=this._fontSize<10?.5:Math.floor(this._fontSize/10),this.lineWidth(c),s=r.underline?1:2,l=n+this.currentLineHeight()/s,r.underline&&(l-=c),this.moveTo(e,l),this.lineTo(e+d,l),this.stroke(),this.restore()),this.save(),this.transform(1,0,0,-1,0,this.page.height),n=this.page.height-n-this._font.ascender/1e3*this._fontSize,null==(_=this.page.fonts)[x=this._font.id]&&(_[x]=this._font.ref()),this._font.use(t),this.addContent("BT"),this.addContent(""+e+" "+n+" Td"),this.addContent("/"+this._font.id+" "+this._fontSize+" Tf"),f=r.fill&&r.stroke?2:r.stroke?1:0,f&&this.addContent(""+f+" Tr"),o&&this.addContent(""+o+" Tc"),m){for(y=t.trim().split(/\s+/),m+=this.widthOfString(" ")+o,m*=1e3/this._fontSize,a=[],w=0,b=y.length;b>w;w++)v=y[w],h=this._font.encode(v),h=function(){var t,e,n;for(n=[],u=t=0,e=h.length;e>t;u=t+=1)n.push(h.charCodeAt(u).toString(16));return n}().join(""),a.push("<"+h+"> "+-m);this.addContent("["+a.join(" ")+"] TJ")}else h=this._font.encode(t),h=function(){var t,e,n;for(n=[],u=t=0,e=h.length;e>t;u=t+=1)n.push(h.charCodeAt(u).toString(16));return n}().join(""),this.addContent("<"+h+"> Tj");return this.addContent("ET"),this.restore()}}}}).call(this)},function(t,e,n){(function(){var e,r,i,o={}.hasOwnProperty,a=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};e=n(26).EventEmitter,r=n(91),i=function(t){function e(t,e){var n;this.document=t,this.indent=e.indent||0,this.characterSpacing=e.characterSpacing||0,this.wordSpacing=0===e.wordSpacing,this.columns=e.columns||1,this.columnGap=null!=(n=e.columnGap)?n:18,this.lineWidth=(e.width-this.columnGap*(this.columns-1))/this.columns,this.spaceLeft=this.lineWidth,this.startX=this.document.x,this.startY=this.document.y,this.column=1,this.ellipsis=e.ellipsis,this.continuedX=0,null!=e.height?(this.height=e.height,this.maxY=this.startY+e.height):this.maxY=this.document.page.maxY(),this.on("firstLine",function(t){return function(e){var n;return n=t.continuedX||t.indent,t.document.x+=n,t.lineWidth-=n,t.once("line",function(){return t.document.x-=n,t.lineWidth+=n,e.continued&&!t.continuedX&&(t.continuedX=t.indent),e.continued?void 0:t.continuedX=0})}}(this)),this.on("lastLine",function(t){return function(e){var n;return n=e.align,"justify"===n&&(e.align="left"),t.lastLine=!0,t.once("line",function(){return t.document.y+=e.paragraphGap||0,e.align=n,t.lastLine=!1})}}(this))}return a(e,t),e.prototype.wordWidth=function(t){return this.document.widthOfString(t,this)+this.characterSpacing+this.wordSpacing},e.prototype.eachWord=function(t,e){var n,i,o,a,s,h,u,c,l,f;for(i=new r(t),s=null,f={};n=i.nextBreak();){if(l=t.slice((null!=s?s.position:void 0)||0,n.position),c=null!=f[l]?f[l]:f[l]=this.wordWidth(l),c>this.lineWidth+this.continuedX)for(h=s,o={};l.length;){for(a=l.length;c>this.spaceLeft;)c=this.wordWidth(l.slice(0,--a));if(o.required=athis.maxY||o>this.maxY)&&this.nextSection(),n="",a=0,s=0,i=0,h=this.document.y,r=function(t){return function(){return e.textWidth=a+t.wordSpacing*(s-1),e.wordCount=s,e.lineWidth=t.lineWidth,h=t.document.y,t.emit("line",n,e,t),i++}}(this),this.emit("sectionStart",e,this),this.eachWord(t,function(t){return function(i,o,h,u){var c,l;if((null==u||u.required)&&(t.emit("firstLine",e,t),t.spaceLeft=t.lineWidth),o<=t.spaceLeft&&(n+=i,a+=o,s++),h.required||o>t.spaceLeft){if(h.required&&t.emit("lastLine",e,t),c=t.document.currentLineHeight(!0),null!=t.height&&t.ellipsis&&t.document.y+2*c>t.maxY&&t.column>=t.columns){for(t.ellipsis===!0&&(t.ellipsis="…"),n=n.replace(/\s+$/,""),a=t.wordWidth(n+t.ellipsis);a>t.lineWidth;)n=n.slice(0,-1).replace(/\s+$/,""),a=t.wordWidth(n+t.ellipsis);n+=t.ellipsis}return r(),t.document.y+c>t.maxY&&(l=t.nextSection(),!l)?(s=0,n="",!1):h.required?(o>t.spaceLeft&&(n=i,a=o,s=1,r()),t.spaceLeft=t.lineWidth,n="",a=0,s=0):(t.spaceLeft=t.lineWidth-o,n=i,a=o,s=1)}return t.spaceLeft-=o}}(this)),s>0&&(this.emit("lastLine",e,this),r()),this.emit("sectionEnd",e,this),e.continued===!0?(i>1&&(this.continuedX=0),this.continuedX+=e.textWidth,this.document.y=h):this.document.x=this.startX},e.prototype.nextSection=function(t){var e;if(this.emit("sectionEnd",t,this),++this.column>this.columns){if(null!=this.height)return!1;this.document.addPage(),this.column=1,this.startY=this.document.page.margins.top,this.maxY=this.document.page.maxY(),this.document.x=this.startX,this.document._fillColor&&(e=this.document).fillColor.apply(e,this.document._fillColor),this.emit("pageBreak",t,this)}else this.document.x+=this.lineWidth+this.columnGap,this.document.y=this.startY,this.emit("columnBreak",t,this);return this.emit("sectionStart",t,this),!0},e}(e),t.exports=i}).call(this)},function(t,e,n){(function(){var e,r,i,o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w,b,x,S,k,E,C,I,A,L;x=n(92),C=new x(n(93)),A=n(94),o=A.BK,c=A.CR,p=A.LF,v=A.NL,a=A.CB,i=A.BA,b=A.SP,S=A.WJ,b=A.SP,o=A.BK,p=A.LF,v=A.NL,e=A.AI,r=A.AL,_=A.SA,w=A.SG,k=A.XX,h=A.CJ,f=A.ID,m=A.NS,E=A.characterClasses,L=n(95),l=L.DI_BRK,d=L.IN_BRK,s=L.CI_BRK,u=L.CP_BRK,y=L.PR_BRK,I=L.pairTable,g=function(){function t(t){this.string=t,this.pos=0,this.lastPos=0,this.curClass=null,this.nextClass=null}var n,f,g;return t.prototype.nextCodePoint=function(){var t,e;return t=this.string.charCodeAt(this.pos++),e=this.string.charCodeAt(this.pos),t>=55296&&56319>=t&&e>=56320&&57343>=e?(this.pos++,1024*(t-55296)+(e-56320)+65536):t},f=function(t){switch(t){case e:return r;case _:case w:case k:return r;case h:return m;default:return t}},g=function(t){switch(t){case p:case v:return o;case a:return i;case b:return S;default:return t}},t.prototype.nextCharClass=function(t){return null==t&&(t=!1),f(C.get(this.nextCodePoint()))},n=function(){function t(t,e){this.position=t,this.required=null!=e?e:!1}return t}(),t.prototype.nextBreak=function(){var t,e,r;for(null==this.curClass&&(this.curClass=g(this.nextCharClass()));this.pos=this.string.length?this.lastPos>d,a=1<>g,c=1024>>g,s=l+c,m=s,v=32,o=m+v,n=1<t||t>1114111?this.errorValue:55296>t||t>56319&&65535>=t?(e=(this.data[t>>g]<=t?(e=(this.data[l+(t-55296>>g)]<>d)],e=this.data[e+(t>>g&h)],e=(e<s?(d=h,u=h/f):(u=a,d=a*f),"center"===o.align?n=n+h/2-d/2:"right"===o.align&&(n=n+h-d),"center"===o.valign?i=i+a/2-u/2:"bottom"===o.valign&&(i=i+a-u)),this.y===i&&(this.y+=u),this.save(),this.transform(d,0,0,-u,n,i+u),this.addContent("/"+l.label+" Do"),this.restore(),this}}}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){(function(e){(function(){var r,i,o,a,s;s=n(44),r=n(72),i=n(98),a=n(99),o=function(){function t(){}return t.open=function(t,n){var r,o;if(e.isBuffer(t))r=t;else if(o=/^data:.+;base64,(.*)$/.exec(t))r=new e(o[1],"base64");else if(r=s.readFileSync(t),!r)return;if(255===r[0]&&216===r[1])return new i(r,n);if(137===r[0]&&"PNG"===r.toString("ascii",1,4))return new a(r,n);throw new Error("Unknown image format.")},t}(),t.exports=o}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){(function(){var e,r,i=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};r=n(44),e=function(){function t(t,n){var r,o,a;if(this.data=t,this.label=n,65496!==this.data.readUInt16BE(0))throw"SOI not found in JPEG";for(a=2;a=0));)a+=this.data.readUInt16BE(a);if(i.call(e,o)<0)throw"Invalid JPEG.";a+=2,this.bits=this.data[a++],this.height=this.data.readUInt16BE(a),a+=2,this.width=this.data.readUInt16BE(a),a+=2,r=this.data[a++],this.colorSpace=function(){switch(r){case 1:return"DeviceGray";case 3:return"DeviceRGB";case 4:return"DeviceCMYK"}}(),this.obj=null}var e;return e=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],t.prototype.embed=function(t){return this.obj?void 0:(this.obj=t.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:this.bits,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:"DCTDecode"}),"DeviceCMYK"===this.colorSpace&&(this.obj.data.Decode=[1,0,1,0,1,0,1,0]),this.obj.end(this.data),this.data=null)},t}(),t.exports=e}).call(this)},function(t,e,n){(function(e){(function(){var r,i,o;o=n(47),r=n(100),i=function(){function t(t,e){this.label=e,this.image=new r(t),this.width=this.image.width,this.height=this.image.height,this.imgData=this.image.imgData,this.obj=null}return t.prototype.embed=function(t){var n,r,i,o,a,s,h,u;if(this.document=t,!this.obj){if(this.obj=t.ref({Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bits,Width:this.width,Height:this.height,Filter:"FlateDecode"}),this.image.hasAlphaChannel||(i=t.ref({Predictor:15,Colors:this.image.colors,BitsPerComponent:this.image.bits,Columns:this.width}),this.obj.data.DecodeParms=i,i.end()),0===this.image.palette.length?this.obj.data.ColorSpace=this.image.colorSpace:(r=t.ref(),r.end(new e(this.image.palette)),this.obj.data.ColorSpace=["Indexed","DeviceRGB",this.image.palette.length/3-1,r]),this.image.transparency.grayscale)return a=this.image.transparency.greyscale,this.obj.data.Mask=[a,a];if(this.image.transparency.rgb){for(o=this.image.transparency.rgb,n=[],h=0,u=o.length;u>h;h++)s=o[h],n.push(s,s);return this.obj.data.Mask=n}return this.image.transparency.indexed?this.loadIndexedAlphaChannel():this.image.hasAlphaChannel?this.splitAlphaChannel():this.finalize()}},t.prototype.finalize=function(){var t;return this.alphaChannel&&(t=this.document.ref({Type:"XObject",Subtype:"Image",Height:this.height,Width:this.width,BitsPerComponent:8,Filter:"FlateDecode",ColorSpace:"DeviceGray",Decode:[0,1]}),t.end(this.alphaChannel),this.obj.data.SMask=t),this.obj.end(this.imgData),this.image=null,this.imgData=null},t.prototype.splitAlphaChannel=function(){return this.image.decodePixels(function(t){return function(n){var r,i,a,s,h,u,c,l,f;for(a=t.image.colors*t.image.bits/8,f=t.width*t.height,u=new e(f*a),i=new e(f),h=l=r=0,c=n.length;c>h;)u[l++]=n[h++],u[l++]=n[h++],u[l++]=n[h++],i[r++]=n[h++];return s=0,o.deflate(u,function(e,n){if(t.imgData=n,e)throw e;return 2===++s?t.finalize():void 0}),o.deflate(i,function(e,n){if(t.alphaChannel=n,e)throw e;return 2===++s?t.finalize():void 0})}}(this))},t.prototype.loadIndexedAlphaChannel=function(t){var n;return n=this.image.transparency.indexed,this.image.decodePixels(function(t){return function(r){var i,a,s,h,u;for(i=new e(t.width*t.height),a=0,s=h=0,u=r.length;u>h;s=h+=1)i[a++]=n[r[s]];return o.deflate(i,function(e,n){if(t.alphaChannel=n,e)throw e;return t.finalize()})}}(this))},t}(),t.exports=i}).call(this)}).call(e,n(2).Buffer)},function(t,e,n){(function(e){(function(){var r,i,o;i=n(44),o=n(47),t.exports=r=function(){function t(t){var n,r,i,o,a,s,h,u,c,l,f;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.text={};;){switch(n=this.readUInt32(),s=function(){var t,e;for(e=[],i=t=0;4>t;i=++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"PLTE":this.palette=this.read(n);break;case"IDAT":for(i=c=0;n>c;i=c+=1)this.imgData.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(n),h=255-this.transparency.indexed.length,h>0)for(i=l=0;h>=0?h>l:l>h;i=h>=0?++l:--l)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(n)[0];break;case 2:this.transparency.rgb=this.read(n)}break;case"tEXt":u=this.read(n),o=u.indexOf(0),a=String.fromCharCode.apply(String,u.slice(0,o)),this.text[a]=String.fromCharCode.apply(String,u.slice(o+1));break;case"IEND":return this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(f=this.colorType)||6===f,r=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*r,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new e(this.imgData));default:this.pos+=n}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return t.decode=function(e,n){return i.readFile(e,function(e,r){var i;return i=new t(r),i.decode(function(t){return n(t)})})},t.load=function(e){var n;return n=i.readFileSync(e),new t(n)},t.prototype.read=function(t){var e,n,r;for(r=[],e=n=0;t>=0?t>n:n>t;e=t>=0?++n:--n)r.push(this.data[this.pos++]);return r},t.prototype.readUInt32=function(){var t,e,n,r;return t=this.data[this.pos++]<<24,e=this.data[this.pos++]<<16,n=this.data[this.pos++]<<8,r=this.data[this.pos++],t|e|n|r},t.prototype.readUInt16=function(){var t,e;return t=this.data[this.pos++]<<8,e=this.data[this.pos++],t|e},t.prototype.decodePixels=function(t){var n=this;return o.inflate(this.imgData,function(r,i){var o,a,s,h,u,c,l,f,d,p,g,v,m,y,_,w,b,x,S,k,E,C,I;if(r)throw r;for(v=n.pixelBitlength/8,w=v*n.width,m=new e(w*n.height),c=i.length,_=0,y=0,a=0;c>y;){switch(i[y++]){case 0:for(h=S=0;w>S;h=S+=1)m[a++]=i[y++];break;case 1:for(h=k=0;w>k;h=k+=1)o=i[y++],u=v>h?0:m[a-v],m[a++]=(o+u)%256;break;case 2:for(h=E=0;w>E;h=E+=1)o=i[y++],s=(h-h%v)/v,b=_&&m[(_-1)*w+s*v+h%v],m[a++]=(b+o)%256;break;case 3:for(h=C=0;w>C;h=C+=1)o=i[y++],s=(h-h%v)/v,u=v>h?0:m[a-v],b=_&&m[(_-1)*w+s*v+h%v],m[a++]=(o+Math.floor((u+b)/2))%256;break;case 4:for(h=I=0;w>I;h=I+=1)o=i[y++],s=(h-h%v)/v,u=v>h?0:m[a-v],0===_?b=x=0:(b=m[(_-1)*w+s*v+h%v],x=s&&m[(_-1)*w+(s-1)*v+h%v]),l=u+b-x,f=Math.abs(l-u),p=Math.abs(l-b),g=Math.abs(l-x),d=p>=f&&g>=f?u:g>=p?b:x,m[a++]=(o+d)%256;break;default:throw new Error("Invalid filter algorithm: "+i[y-1])}_++}return t(m)})},t.prototype.decodePalette=function(){var t,n,r,i,o,a,s,h,u,c;for(i=this.palette,s=this.transparency.indexed||[],a=new e(s.length+i.length),o=0,r=i.length,t=0,n=h=0,u=i.length;u>h;n=h+=3)a[o++]=i[n],a[o++]=i[n+1],a[o++]=i[n+2],a[o++]=null!=(c=s[t++])?c:255;return a},t.prototype.copyToImageData=function(t,e){var n,r,i,o,a,s,h,u,c,l,f;if(r=this.colors,c=null,n=this.hasAlphaChannel,this.palette.length&&(c=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(),r=4,n=!0),i=(null!=t?t.data:void 0)||t,u=i.length,a=c||e,o=s=0,1===r)for(;u>o;)h=c?4*e[o/4]:s,l=a[h++],i[o++]=l,i[o++]=l,i[o++]=l,i[o++]=n?a[h++]:255,s=h;else for(;u>o;)h=c?4*e[o/4]:s,i[o++]=a[h++],i[o++]=a[h++],i[o++]=a[h++],i[o++]=n?a[h++]:255,s=h},t.prototype.decode=function(t){var n,r=this;return n=new e(this.width*this.height*4),this.decodePixels(function(e){return r.copyToImageData(n,e),t(n)})},t}()}).call(this)}).call(e,n(2).Buffer)},function(t,e){(function(){t.exports={annotate:function(t,e,n,r,i){var o,a,s;i.Type="Annot",i.Rect=this._convertRect(t,e,n,r),i.Border=[0,0,0],"Link"!==i.Subtype&&null==i.C&&(i.C=this._normalizeColor(i.color||[0,0,0])),delete i.color,"string"==typeof i.Dest&&(i.Dest=new String(i.Dest));for(o in i)s=i[o],i[o[0].toUpperCase()+o.slice(1)]=s;return a=this.ref(i),this.page.annotations.push(a),a.end(),this},note:function(t,e,n,r,i,o){return null==o&&(o={}),o.Subtype="Text",o.Contents=new String(i),o.Name="Comment",null==o.color&&(o.color=[243,223,92]),this.annotate(t,e,n,r,o)},link:function(t,e,n,r,i,o){return null==o&&(o={}),o.Subtype="Link",o.A=this.ref({S:"URI",URI:new String(i)}),o.A.end(),this.annotate(t,e,n,r,o)},_markup:function(t,e,n,r,i){var o,a,s,h,u;return null==i&&(i={}),u=this._convertRect(t,e,n,r),o=u[0],s=u[1],a=u[2],h=u[3],i.QuadPoints=[o,h,a,h,o,s,a,s],i.Contents=new String,this.annotate(t,e,n,r,i)},highlight:function(t,e,n,r,i){return null==i&&(i={}),i.Subtype="Highlight",null==i.color&&(i.color=[241,238,148]),this._markup(t,e,n,r,i)},underline:function(t,e,n,r,i){return null==i&&(i={}),i.Subtype="Underline",this._markup(t,e,n,r,i)},strike:function(t,e,n,r,i){return null==i&&(i={}),i.Subtype="StrikeOut",this._markup(t,e,n,r,i)},lineAnnotation:function(t,e,n,r,i){return null==i&&(i={}),i.Subtype="Line",i.Contents=new String,i.L=[t,this.page.height-e,n,this.page.height-r],this.annotate(t,e,n,r,i)},rectAnnotation:function(t,e,n,r,i){return null==i&&(i={}),i.Subtype="Square",i.Contents=new String,this.annotate(t,e,n,r,i)},ellipseAnnotation:function(t,e,n,r,i){return null==i&&(i={}),i.Subtype="Circle",i.Contents=new String,this.annotate(t,e,n,r,i)},textAnnotation:function(t,e,n,r,i,o){return null==o&&(o={}),o.Subtype="FreeText",o.Contents=new String(i),o.DA=new String,this.annotate(t,e,n,r,o)},_convertRect:function(t,e,n,r){var i,o,a,s,h,u,c,l,f;return l=e,e+=r,c=t+n,f=this._ctm,i=f[0],o=f[1],a=f[2],s=f[3],h=f[4],u=f[5],t=i*t+a*e+h,e=o*t+s*e+u,c=i*c+a*l+h,l=o*c+s*l+u,[t,e,c,l]}}}).call(this)},function(t,e){t.exports={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]}},function(t,e,n){(function(e){"use strict";function r(t,e){this.pdfDoc=t,this.imageDictionary=e||{}}var i=(n(24),n(97));r.prototype.measureImage=function(t){function n(t){var n=a.imageDictionary[t];if(!n)return t;var r=n.indexOf("base64,");if(0>r)throw"invalid image format, images dictionary should contain dataURL entries";return new e(n.substring(r+7),"base64")}var r,o,a=this;return this.pdfDoc._imageRegistry[t]?r=this.pdfDoc._imageRegistry[t]:(o="I"+ ++this.pdfDoc._imageCount,r=i.open(n(t),o),r.embed(this.pdfDoc),this.pdfDoc._imageRegistry[t]=r),{width:r.width,height:r.height}},t.exports=r}).call(e,n(2).Buffer)},function(t,e){"use strict";function n(t){for(var e=[],n=null,r=0,i=t.inlines.length;i>r;r++){var o=t.inlines[r],a=o.decoration;if(a){var s=o.decorationColor||o.color||"black",h=o.decorationStyle||"solid";a=Array.isArray(a)?a:[a];for(var u=0,c=a.length;c>u;u++){var l=a[u];n&&l===n.decoration&&h===n.decorationStyle&&s===n.decorationColor&&"lineThrough"!==l?n.inlines.push(o):(n={line:t,decoration:l,decorationColor:s,decorationStyle:h,inlines:[o]},e.push(n))}}else n=null}return e}function r(t,e,n,r){function i(){for(var e=0,n=0,r=t.inlines.length;r>n;n++){var i=t.inlines[n];e=i.fontSize>e?n:e}return t.inlines[e]}function o(){for(var e=0,n=0,r=t.inlines.length;r>n;n++)e+=t.inlines[n].width;return e}var a=t.inlines[0],s=i(),h=o(),u=t.line.getAscenderHeight(),c=s.font.ascender/1e3*s.fontSize,l=s.height,f=l-c,d=.5+.12*Math.floor(Math.max(s.fontSize-8,0)/2);switch(t.decoration){case"underline":n+=u+.45*f;break;case"overline":n+=u-.85*c;break;case"lineThrough":n+=u-.25*c;break;default:throw"Unkown decoration : "+t.decoration}if(r.save(),"double"===t.decorationStyle){var p=Math.max(.5,2*d);r.fillColor(t.decorationColor).rect(e+a.x,n-d/2,h,d/2).fill().rect(e+a.x,n+p-d/2,h,d/2).fill()}else if("dashed"===t.decorationStyle){var g=Math.ceil(h/6.8),v=e+a.x;r.rect(v,n,h,d).clip(),r.fillColor(t.decorationColor);for(var m=0;g>m;m++)r.rect(v,n-d/2,3.96,d).fill(),v+=6.8}else if("dotted"===t.decorationStyle){var y=Math.ceil(h/(3*d)),_=e+a.x;r.rect(_,n,h,d).clip(),r.fillColor(t.decorationColor);for(var w=0;y>w;w++)r.rect(_,n-d/2,d,d).fill(),_+=3*d}else if("wavy"===t.decorationStyle){var b=.7,x=1,S=Math.ceil(h/(2*b))+1,k=e+a.x-1;r.rect(e+a.x,n-x,h,n+x).clip(),r.lineWidth(.24),r.moveTo(k,n);for(var E=0;S>E;E++)r.bezierCurveTo(k+b,n-x,k+2*b,n-x,k+3*b,n).bezierCurveTo(k+4*b,n+x,k+5*b,n+x,k+6*b,n),k+=6*b;r.stroke(t.decorationColor)}else r.fillColor(t.decorationColor).rect(e+a.x,n-d/2,h,d).fill();r.restore()}function i(t,e,i,o){for(var a=n(t),s=0,h=a.length;h>s;s++)r(a[s],e,i,o)}function o(t,e,n,r){for(var i=t.getHeight(),o=0,a=t.inlines.length;a>o;o++){var s=t.inlines[o];s.background&&r.fillColor(s.background).rect(e+s.x,n,s.width,i).fill()}}t.exports={drawBackground:o,drawDecorations:i}},function(t,e,n){var r,i,o=o||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,o=function(t){var e=new MouseEvent("click");t.dispatchEvent(e)},a=t.webkitRequestFileSystem,s=t.requestFileSystem||a||t.mozRequestFileSystem,h=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},u="application/octet-stream",c=0,l=500,f=function(e){var r=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?r():setTimeout(r,l)},d=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(o){h(o)}}},p=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},g=function(e,h,l){l||(e=p(e));var g,v,m,y=this,_=e.type,w=!1,b=function(){d(y,"writestart progress write writeend".split(" "))},x=function(){if((w||!g)&&(g=n().createObjectURL(e)),v)v.location.href=g;else{var r=t.open(g,"_blank");void 0==r&&"undefined"!=typeof safari&&(t.location.href=g)}y.readyState=y.DONE,b(),f(g)},S=function(t){return function(){return y.readyState!==y.DONE?t.apply(this,arguments):void 0}},k={create:!0,exclusive:!1};return y.readyState=y.INIT,h||(h="download"),i?(g=n().createObjectURL(e),r.href=g,r.download=h,void setTimeout(function(){o(r),b(),f(g),y.readyState=y.DONE})):(t.chrome&&_&&_!==u&&(m=e.slice||e.webkitSlice,e=m.call(e,0,e.size,u),w=!0),a&&"download"!==h&&(h+=".download"),(_===u||a)&&(v=t),s?(c+=e.size,void s(t.TEMPORARY,c,S(function(t){t.root.getDirectory("saved",k,S(function(t){var n=function(){t.getFile(h,k,S(function(t){t.createWriter(S(function(n){n.onwriteend=function(e){v.location.href=t.toURL(),y.readyState=y.DONE,d(y,"writeend",e),f(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&x()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=y["on"+t]}),n.write(e),y.abort=function(){n.abort(),y.readyState=y.DONE},y.readyState=y.WRITING}),x)}),x)};t.getFile(h,{create:!1},S(function(t){t.remove(),n()}),S(function(t){t.code===t.NOT_FOUND_ERR?n():x()}))}),x)}),x)):void x())},v=g.prototype,m=function(t,e,n){return new g(t,e,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return n||(t=p(t)),navigator.msSaveOrOpenBlob(t,e||"download")}:(v.abort=function(){var t=this;t.readyState=t.DONE,d(t,"abort")},v.readyState=v.INIT=0,v.WRITING=1,v.DONE=2,v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null,m)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof t&&t.exports?t.exports.saveAs=o:null!==n(106)&&null!=n(107)&&(r=[],i=function(){return o}.apply(e,r),!(void 0!==i&&(t.exports=i)))},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e){(function(e){t.exports=e}).call(e,{})}]); +//# sourceMappingURL=pdfmake.min.js.map diff --git a/js/uikit.js b/js/uikit.js deleted file mode 100755 index cf8b403..0000000 --- a/js/uikit.js +++ /dev/null @@ -1,3814 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -(function(core) { - - if (typeof define == "function" && define.amd) { // AMD - - define("uikit", function(){ - - var uikit = window.UIkit || core(window, window.jQuery, window.document); - - uikit.load = function(res, req, onload, config) { - - var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, ""); - - if (!base) { - throw new Error( "Please define base path to UIkit in the requirejs config." ); - } - - for (i = 0; i < resources.length; i += 1) { - var resource = resources[i].replace(/\./g, '/'); - load.push(base+'/components/'+resource); - } - - req(load, function() { - onload(uikit); - }); - }; - - return uikit; - }); - } - - if (!window.jQuery) { - throw new Error( "UIkit requires jQuery" ); - } - - if (window && window.jQuery) { - core(window, window.jQuery, window.document); - } - - -})(function(global, $, doc) { - - "use strict"; - - var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined; - - UI.version = '2.26.4'; - - UI.noConflict = function() { - // restore UIkit version - if (_UI) { - global.UIkit = _UI; - $.UIkit = _UI; - $.fn.uk = _UI.fn; - } - - return UI; - }; - - UI.prefix = function(str) { - return str; - }; - - // cache jQuery - UI.$ = $; - - UI.$doc = UI.$(document); - UI.$win = UI.$(window); - UI.$html = UI.$('html'); - - UI.support = {}; - UI.support.transition = (function() { - - var transitionEnd = (function() { - - var element = doc.body || doc.documentElement, - transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' - }, name; - - for (name in transEndEventNames) { - if (element.style[name] !== undefined) return transEndEventNames[name]; - } - }()); - - return transitionEnd && { end: transitionEnd }; - })(); - - UI.support.animation = (function() { - - var animationEnd = (function() { - - var element = doc.body || doc.documentElement, - animEndEventNames = { - WebkitAnimation : 'webkitAnimationEnd', - MozAnimation : 'animationend', - OAnimation : 'oAnimationEnd oanimationend', - animation : 'animationend' - }, name; - - for (name in animEndEventNames) { - if (element.style[name] !== undefined) return animEndEventNames[name]; - } - }()); - - return animationEnd && { end: animationEnd }; - })(); - - // requestAnimationFrame polyfill - //https://github.com/darius/requestAnimationFrame - (function() { - - Date.now = Date.now || function() { return new Date().getTime(); }; - - var vendors = ['webkit', 'moz']; - for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { - var vp = vendors[i]; - window.requestAnimationFrame = window[vp+'RequestAnimationFrame']; - window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame'] - || window[vp+'CancelRequestAnimationFrame']); - } - if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) // iOS6 is buggy - || !window.requestAnimationFrame || !window.cancelAnimationFrame) { - var lastTime = 0; - window.requestAnimationFrame = function(callback) { - var now = Date.now(); - var nextTime = Math.max(lastTime + 16, now); - return setTimeout(function() { callback(lastTime = nextTime); }, - nextTime - now); - }; - window.cancelAnimationFrame = clearTimeout; - } - }()); - - UI.support.touch = ( - ('ontouchstart' in document) || - (global.DocumentTouch && document instanceof global.DocumentTouch) || - (global.navigator.msPointerEnabled && global.navigator.msMaxTouchPoints > 0) || //IE 10 - (global.navigator.pointerEnabled && global.navigator.maxTouchPoints > 0) || //IE >=11 - false - ); - - UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null); - - UI.Utils = {}; - - UI.Utils.isFullscreen = function() { - return document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.fullscreenElement || false; - }; - - UI.Utils.str2json = function(str, notevil) { - try { - if (notevil) { - return JSON.parse(str - // wrap keys without quote with valid double quote - .replace(/([\$\w]+)\s*:/g, function(_, $1){return '"'+$1+'":';}) - // replacing single quote wrapped ones to double quote - .replace(/'([^']+)'/g, function(_, $1){return '"'+$1+'"';}) - ); - } else { - return (new Function("", "var json = " + str + "; return JSON.parse(JSON.stringify(json));"))(); - } - } catch(e) { return false; } - }; - - UI.Utils.debounce = function(func, wait, immediate) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; - }; - - UI.Utils.throttle = function (func, limit) { - var wait = false; - return function () { - if (!wait) { - func.call(); - wait = true; - setTimeout(function () { - wait = false; - }, limit); - } - } - }; - - UI.Utils.removeCssRules = function(selectorRegEx) { - var idx, idxs, stylesheet, _i, _j, _k, _len, _len1, _len2, _ref; - - if(!selectorRegEx) return; - - setTimeout(function(){ - try { - _ref = document.styleSheets; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - stylesheet = _ref[_i]; - idxs = []; - stylesheet.cssRules = stylesheet.cssRules; - for (idx = _j = 0, _len1 = stylesheet.cssRules.length; _j < _len1; idx = ++_j) { - if (stylesheet.cssRules[idx].type === CSSRule.STYLE_RULE && selectorRegEx.test(stylesheet.cssRules[idx].selectorText)) { - idxs.unshift(idx); - } - } - for (_k = 0, _len2 = idxs.length; _k < _len2; _k++) { - stylesheet.deleteRule(idxs[_k]); - } - } - } catch (_error) {} - }, 0); - }; - - UI.Utils.isInView = function(element, options) { - - var $element = $(element); - - if (!$element.is(':visible')) { - return false; - } - - var window_left = UI.$win.scrollLeft(), window_top = UI.$win.scrollTop(), offset = $element.offset(), left = offset.left, top = offset.top; - - options = $.extend({topoffset:0, leftoffset:0}, options); - - if (top + $element.height() >= window_top && top - options.topoffset <= window_top + UI.$win.height() && - left + $element.width() >= window_left && left - options.leftoffset <= window_left + UI.$win.width()) { - return true; - } else { - return false; - } - }; - - UI.Utils.checkDisplay = function(context, initanimation) { - - var elements = UI.$('[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]', context || document), animated; - - if (context && !elements.length) { - elements = $(context); - } - - elements.trigger('display.uk.check'); - - // fix firefox / IE animations - if (initanimation) { - - if (typeof(initanimation)!='string') { - initanimation = '[class*="uk-animation-"]'; - } - - elements.find(initanimation).each(function(){ - - var ele = UI.$(this), - cls = ele.attr('class'), - anim = cls.match(/uk-animation-(.+)/); - - ele.removeClass(anim[0]).width(); - - ele.addClass(anim[0]); - }); - } - - return elements; - }; - - UI.Utils.options = function(string) { - - if ($.type(string)!='string') return string; - - if (string.indexOf(':') != -1 && string.trim().substr(-1) != '}') { - string = '{'+string+'}'; - } - - var start = (string ? string.indexOf("{") : -1), options = {}; - - if (start != -1) { - try { - options = UI.Utils.str2json(string.substr(start)); - } catch (e) {} - } - - return options; - }; - - UI.Utils.animate = function(element, cls) { - - var d = $.Deferred(); - - element = UI.$(element); - - element.css('display', 'none').addClass(cls).one(UI.support.animation.end, function() { - element.removeClass(cls); - d.resolve(); - }); - - element.css('display', ''); - - return d.promise(); - }; - - UI.Utils.uid = function(prefix) { - return (prefix || 'id') + (new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000)); - }; - - UI.Utils.template = function(str, data) { - - var tokens = str.replace(/\n/g, '\\n').replace(/\{\{\{\s*(.+?)\s*\}\}\}/g, "{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g), - i=0, toc, cmd, prop, val, fn, output = [], openblocks = 0; - - while(i < tokens.length) { - - toc = tokens[i]; - - if(toc.match(/\{\{\s*(.+?)\s*\}\}/)) { - i = i + 1; - toc = tokens[i]; - cmd = toc[0]; - prop = toc.substring(toc.match(/^(\^|\#|\!|\~|\:)/) ? 1:0); - - switch(cmd) { - case '~': - output.push("for(var $i=0;$i<"+prop+".length;$i++) { var $item = "+prop+"[$i];"); - openblocks++; - break; - case ':': - output.push("for(var $key in "+prop+") { var $val = "+prop+"[$key];"); - openblocks++; - break; - case '#': - output.push("if("+prop+") {"); - openblocks++; - break; - case '^': - output.push("if(!"+prop+") {"); - openblocks++; - break; - case '/': - output.push("}"); - openblocks--; - break; - case '!': - output.push("__ret.push("+prop+");"); - break; - default: - output.push("__ret.push(escape("+prop+"));"); - break; - } - } else { - output.push("__ret.push('"+toc.replace(/\'/g, "\\'")+"');"); - } - i = i + 1; - } - - fn = new Function('$data', [ - 'var __ret = [];', - 'try {', - 'with($data){', (!openblocks ? output.join('') : '__ret = ["Not all blocks are closed correctly."]'), '};', - '}catch(e){__ret = [e.message];}', - 'return __ret.join("").replace(/\\n\\n/g, "\\n");', - "function escape(html) { return String(html).replace(/&/g, '&').replace(/\"/g, '"').replace(//g, '>');}" - ].join("\n")); - - return data ? fn(data) : fn; - }; - - UI.Utils.events = {}; - UI.Utils.events.click = UI.support.touch ? 'tap' : 'click'; - - global.UIkit = UI; - - // deprecated - - UI.fn = function(command, options) { - - var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2]; - - if (!UI[component]) { - $.error("UIkit component [" + component + "] does not exist."); - return this; - } - - return this.each(function() { - var $this = $(this), data = $this.data(component); - if (!data) $this.data(component, (data = UI[component](this, method ? undefined : options))); - if (method) data[method].apply(data, Array.prototype.slice.call(args, 1)); - }); - }; - - $.UIkit = UI; - $.fn.uk = UI.fn; - - UI.langdirection = UI.$html.attr("dir") == "rtl" ? "right" : "left"; - - UI.components = {}; - - UI.component = function(name, def) { - - var fn = function(element, options) { - - var $this = this; - - this.UIkit = UI; - this.element = element ? UI.$(element) : null; - this.options = $.extend(true, {}, this.defaults, options); - this.plugins = {}; - - if (this.element) { - this.element.data(name, this); - } - - this.init(); - - (this.options.plugins.length ? this.options.plugins : Object.keys(fn.plugins)).forEach(function(plugin) { - - if (fn.plugins[plugin].init) { - fn.plugins[plugin].init($this); - $this.plugins[plugin] = true; - } - - }); - - this.trigger('init.uk.component', [name, this]); - - return this; - }; - - fn.plugins = {}; - - $.extend(true, fn.prototype, { - - defaults : {plugins: []}, - - boot: function(){}, - init: function(){}, - - on: function(a1,a2,a3){ - return UI.$(this.element || this).on(a1,a2,a3); - }, - - one: function(a1,a2,a3){ - return UI.$(this.element || this).one(a1,a2,a3); - }, - - off: function(evt){ - return UI.$(this.element || this).off(evt); - }, - - trigger: function(evt, params) { - return UI.$(this.element || this).trigger(evt, params); - }, - - find: function(selector) { - return UI.$(this.element ? this.element: []).find(selector); - }, - - proxy: function(obj, methods) { - - var $this = this; - - methods.split(' ').forEach(function(method) { - if (!$this[method]) $this[method] = function() { return obj[method].apply(obj, arguments); }; - }); - }, - - mixin: function(obj, methods) { - - var $this = this; - - methods.split(' ').forEach(function(method) { - if (!$this[method]) $this[method] = obj[method].bind($this); - }); - }, - - option: function() { - - if (arguments.length == 1) { - return this.options[arguments[0]] || undefined; - } else if (arguments.length == 2) { - this.options[arguments[0]] = arguments[1]; - } - } - - }, def); - - this.components[name] = fn; - - this[name] = function() { - - var element, options; - - if (arguments.length) { - - switch(arguments.length) { - case 1: - - if (typeof arguments[0] === "string" || arguments[0].nodeType || arguments[0] instanceof jQuery) { - element = $(arguments[0]); - } else { - options = arguments[0]; - } - - break; - case 2: - - element = $(arguments[0]); - options = arguments[1]; - break; - } - } - - if (element && element.data(name)) { - return element.data(name); - } - - return (new UI.components[name](element, options)); - }; - - if (UI.domready) { - UI.component.boot(name); - } - - return fn; - }; - - UI.plugin = function(component, name, def) { - this.components[component].plugins[name] = def; - }; - - UI.component.boot = function(name) { - - if (UI.components[name].prototype && UI.components[name].prototype.boot && !UI.components[name].booted) { - UI.components[name].prototype.boot.apply(UI, []); - UI.components[name].booted = true; - } - }; - - UI.component.bootComponents = function() { - - for (var component in UI.components) { - UI.component.boot(component); - } - }; - - - // DOM mutation save ready helper function - - UI.domObservers = []; - UI.domready = false; - - UI.ready = function(fn) { - - UI.domObservers.push(fn); - - if (UI.domready) { - fn(document); - } - }; - - UI.on = function(a1,a2,a3){ - - if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) { - a2.apply(UI.$doc); - } - - return UI.$doc.on(a1,a2,a3); - }; - - UI.one = function(a1,a2,a3){ - - if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) { - a2.apply(UI.$doc); - return UI.$doc; - } - - return UI.$doc.one(a1,a2,a3); - }; - - UI.trigger = function(evt, params) { - return UI.$doc.trigger(evt, params); - }; - - UI.domObserve = function(selector, fn) { - - if(!UI.support.mutationobserver) return; - - fn = fn || function() {}; - - UI.$(selector).each(function() { - - var element = this, - $element = UI.$(element); - - if ($element.data('observer')) { - return; - } - - try { - - var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) { - fn.apply(element, []); - $element.trigger('changed.uk.dom'); - }, 50), {childList: true, subtree: true}); - - // pass in the target node, as well as the observer options - observer.observe(element, { childList: true, subtree: true }); - - $element.data('observer', observer); - - } catch(e) {} - }); - }; - - UI.init = function(root) { - - root = root || document; - - UI.domObservers.forEach(function(fn){ - fn(root); - }); - }; - - UI.on('domready.uk.dom', function(){ - - UI.init(); - - if (UI.domready) UI.Utils.checkDisplay(); - }); - - document.addEventListener('DOMContentLoaded', function(){ - - var domReady = function() { - - UI.$body = UI.$('body'); - - UI.trigger('beforeready.uk.dom'); - - UI.component.bootComponents(); - - // custom scroll observer - var rafToken = requestAnimationFrame((function(){ - - var memory = {dir: {x:0, y:0}, x: window.pageXOffset, y:window.pageYOffset}; - - var fn = function(){ - // reading this (window.page[X|Y]Offset) causes a full page recalc of the layout in Chrome, - // so we only want to do this once - var wpxo = window.pageXOffset; - var wpyo = window.pageYOffset; - - // Did the scroll position change since the last time we were here? - if (memory.x != wpxo || memory.y != wpyo) { - - // Set the direction of the scroll and store the new position - if (wpxo != memory.x) {memory.dir.x = wpxo > memory.x ? 1:-1; } else { memory.dir.x = 0; } - if (wpyo != memory.y) {memory.dir.y = wpyo > memory.y ? 1:-1; } else { memory.dir.y = 0; } - - memory.x = wpxo; - memory.y = wpyo; - - // Trigger the scroll event, this could probably be sent using memory.clone() but this is - // more explicit and easier to see exactly what is being sent in the event. - UI.$doc.trigger('scrolling.uk.document', [{ - "dir": {"x": memory.dir.x, "y": memory.dir.y}, "x": wpxo, "y": wpyo - }]); - } - - cancelAnimationFrame(rafToken); - rafToken = requestAnimationFrame(fn); - }; - - if (UI.support.touch) { - UI.$html.on('touchmove touchend MSPointerMove MSPointerUp pointermove pointerup', fn); - } - - if (memory.x || memory.y) fn(); - - return fn; - - })()); - - // run component init functions on dom - UI.trigger('domready.uk.dom'); - - if (UI.support.touch) { - - // remove css hover rules for touch devices - // UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/); - - // viewport unit fix for uk-height-viewport - should be fixed in iOS 8 - if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { - - UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){ - - var fn = function() { - $('.uk-height-viewport').css('height', window.innerHeight); - return fn; - }; - - return fn(); - - })(), 100)); - } - } - - UI.trigger('afterready.uk.dom'); - - // mark that domready is left behind - UI.domready = true; - - // auto init js components - if (UI.support.mutationobserver) { - - var initFn = UI.Utils.debounce(function(){ - requestAnimationFrame(function(){ UI.init(document.body);}); - }, 10); - - (new UI.support.mutationobserver(function(mutations) { - - var init = false; - - mutations.every(function(mutation){ - - if (mutation.type != 'childList') return true; - - for (var i = 0, node; i < mutation.addedNodes.length; ++i) { - - node = mutation.addedNodes[i]; - - if (node.outerHTML && node.outerHTML.indexOf('data-uk-') !== -1) { - return (init = true) && false; - } - } - return true; - }); - - if (init) initFn(); - - })).observe(document.body, {childList: true, subtree: true}); - } - }; - - if (document.readyState == 'complete' || document.readyState == 'interactive') { - setTimeout(domReady); - } - - return domReady; - - }()); - - // add touch identifier class - UI.$html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch"); - - // add uk-hover class on tap to support overlays on touch devices - if (UI.support.touch) { - - var hoverset = false, - exclude, - hovercls = 'uk-hover', - selector = '.uk-overlay, .uk-overlay-hover, .uk-overlay-toggle, .uk-animation-hover, .uk-has-hover'; - - UI.$html.on('mouseenter touchstart MSPointerDown pointerdown', selector, function() { - - if (hoverset) $('.'+hovercls).removeClass(hovercls); - - hoverset = $(this).addClass(hovercls); - - }).on('mouseleave touchend MSPointerUp pointerup', function(e) { - - exclude = $(e.target).parents(selector); - - if (hoverset) { - hoverset.not(exclude).removeClass(hovercls); - } - }); - } - - return UI; -}); - -// Based on Zeptos touch.js -// https://raw.github.com/madrobby/zepto/master/src/touch.js -// Zepto.js may be freely distributed under the MIT license. - -;(function($){ - - if ($.fn.swipeLeft) { - return; - } - - - var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, longTapDelay = 750, gesture; - - function swipeDirection(x1, x2, y1, y2) { - return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down'); - } - - function longTap() { - longTapTimeout = null; - if (touch.last) { - if ( touch.el !== undefined ) touch.el.trigger('longTap'); - touch = {}; - } - } - - function cancelLongTap() { - if (longTapTimeout) clearTimeout(longTapTimeout); - longTapTimeout = null; - } - - function cancelAll() { - if (touchTimeout) clearTimeout(touchTimeout); - if (tapTimeout) clearTimeout(tapTimeout); - if (swipeTimeout) clearTimeout(swipeTimeout); - if (longTapTimeout) clearTimeout(longTapTimeout); - touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null; - touch = {}; - } - - function isPrimaryTouch(event){ - return event.pointerType == event.MSPOINTER_TYPE_TOUCH && event.isPrimary; - } - - $(function(){ - var now, delta, deltaX = 0, deltaY = 0, firstTouch; - - if ('MSGesture' in window) { - gesture = new MSGesture(); - gesture.target = document.body; - } - - $(document) - .on('MSGestureEnd gestureend', function(e){ - - var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null; - - if (swipeDirectionFromVelocity && touch.el !== undefined) { - touch.el.trigger('swipe'); - touch.el.trigger('swipe'+ swipeDirectionFromVelocity); - } - }) - // MSPointerDown: for IE10 - // pointerdown: for IE11 - .on('touchstart MSPointerDown pointerdown', function(e){ - - if(e.type == 'MSPointerDown' && !isPrimaryTouch(e.originalEvent)) return; - - firstTouch = (e.type == 'MSPointerDown' || e.type == 'pointerdown') ? e : e.originalEvent.touches[0]; - - now = Date.now(); - delta = now - (touch.last || now); - touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode); - - if(touchTimeout) clearTimeout(touchTimeout); - - touch.x1 = firstTouch.pageX; - touch.y1 = firstTouch.pageY; - - if (delta > 0 && delta <= 250) touch.isDoubleTap = true; - - touch.last = now; - longTapTimeout = setTimeout(longTap, longTapDelay); - - // adds the current touch contact for IE gesture recognition - if (gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) { - gesture.addPointer(e.originalEvent.pointerId); - } - - }) - // MSPointerMove: for IE10 - // pointermove: for IE11 - .on('touchmove MSPointerMove pointermove', function(e){ - - if (e.type == 'MSPointerMove' && !isPrimaryTouch(e.originalEvent)) return; - - firstTouch = (e.type == 'MSPointerMove' || e.type == 'pointermove') ? e : e.originalEvent.touches[0]; - - cancelLongTap(); - touch.x2 = firstTouch.pageX; - touch.y2 = firstTouch.pageY; - - deltaX += Math.abs(touch.x1 - touch.x2); - deltaY += Math.abs(touch.y1 - touch.y2); - }) - // MSPointerUp: for IE10 - // pointerup: for IE11 - .on('touchend MSPointerUp pointerup', function(e){ - - if (e.type == 'MSPointerUp' && !isPrimaryTouch(e.originalEvent)) return; - - cancelLongTap(); - - // swipe - if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){ - - swipeTimeout = setTimeout(function() { - if ( touch.el !== undefined ) { - touch.el.trigger('swipe'); - touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))); - } - touch = {}; - }, 0); - - // normal tap - } else if ('last' in touch) { - - // don't fire tap when delta position changed by more than 30 pixels, - // for instance when moving to a point and back to origin - if (isNaN(deltaX) || (deltaX < 30 && deltaY < 30)) { - // delay by one tick so we can cancel the 'tap' event if 'scroll' fires - // ('tap' fires before 'scroll') - tapTimeout = setTimeout(function() { - - // trigger universal 'tap' with the option to cancelTouch() - // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) - var event = $.Event('tap'); - event.cancelTouch = cancelAll; - if ( touch.el !== undefined ) touch.el.trigger(event); - - // trigger double tap immediately - if (touch.isDoubleTap) { - if ( touch.el !== undefined ) touch.el.trigger('doubleTap'); - touch = {}; - } - - // trigger single tap after 250ms of inactivity - else { - touchTimeout = setTimeout(function(){ - touchTimeout = null; - if ( touch.el !== undefined ) touch.el.trigger('singleTap'); - touch = {}; - }, 250); - } - }, 0); - } else { - touch = {}; - } - deltaX = deltaY = 0; - } - }) - // when the browser window loses focus, - // for example when a modal dialog is shown, - // cancel all ongoing events - .on('touchcancel MSPointerCancel', cancelAll); - - // scrolling the window indicates intention of the user - // to scroll, not tap or swipe, so cancel all ongoing events - $(window).on('scroll', cancelAll); - }); - - ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ - $.fn[eventName] = function(callback){ return $(this).on(eventName, callback); }; - }); -})(jQuery); - -(function(UI) { - - "use strict"; - - var stacks = []; - - UI.component('stackMargin', { - - defaults: { - cls: 'uk-margin-small-top', - rowfirst: false, - observe: false - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-margin]", context).each(function() { - - var ele = UI.$(this); - - if (!ele.data("stackMargin")) { - UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - UI.$win.on('resize orientationchange', (function() { - - var fn = function() { - $this.process(); - }; - - UI.$(function() { - fn(); - UI.$win.on("load", fn); - }); - - return UI.Utils.debounce(fn, 20); - })()); - - this.on("display.uk.check", function(e) { - if (this.element.is(":visible")) this.process(); - }.bind(this)); - - if (this.options.observe) { - - UI.domObserve(this.element, function(e) { - if ($this.element.is(":visible")) $this.process(); - }); - } - - stacks.push(this); - }, - - process: function() { - - var $this = this, columns = this.element.children(); - - UI.Utils.stackMargin(columns, this.options); - - if (!this.options.rowfirst || !columns.length) { - return this; - } - - // Mark first column elements - var group = {}, minleft = false; - - columns.removeClass(this.options.rowfirst).each(function(offset, $ele){ - - $ele = UI.$(this); - - if (this.style.display != 'none') { - offset = $ele.offset().left; - ((group[offset] = group[offset] || []) && group[offset]).push(this); - minleft = minleft === false ? offset : Math.min(minleft, offset); - } - }); - - UI.$(group[minleft]).addClass(this.options.rowfirst); - - return this; - } - - }); - - - // responsive element e.g. iframes - - (function(){ - - var elements = [], check = function(ele) { - - if (!ele.is(':visible')) return; - - var width = ele.parent().width(), - iwidth = ele.data('width'), - ratio = (width / iwidth), - height = Math.floor(ratio * ele.data('height')); - - ele.css({'height': (width < iwidth) ? height : ele.data('height')}); - }; - - UI.component('responsiveElement', { - - defaults: {}, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("iframe.uk-responsive-width, [data-uk-responsive]", context).each(function() { - - var ele = UI.$(this), obj; - - if (!ele.data("responsiveElement")) { - obj = UI.responsiveElement(ele, {}); - } - }); - }); - }, - - init: function() { - - var ele = this.element; - - if (ele.attr('width') && ele.attr('height')) { - - ele.data({ - - 'width' : ele.attr('width'), - 'height': ele.attr('height') - - }).on('display.uk.check', function(){ - check(ele); - }); - - check(ele); - - elements.push(ele); - } - } - }); - - UI.$win.on('resize load', UI.Utils.debounce(function(){ - - elements.forEach(function(ele){ - check(ele); - }); - - }, 15)); - - })(); - - - - // helper - - UI.Utils.stackMargin = function(elements, options) { - - options = UI.$.extend({ - 'cls': 'uk-margin-small-top' - }, options); - - elements = UI.$(elements).removeClass(options.cls); - - var min = false; - - elements.each(function(offset, height, pos, $ele){ - - $ele = UI.$(this); - - if ($ele.css('display') != 'none') { - - offset = $ele.offset(); - height = $ele.outerHeight(); - pos = offset.top + height; - - $ele.data({ - 'ukMarginPos': pos, - 'ukMarginTop': offset.top - }); - - if (min === false || (offset.top < min.top) ) { - - min = { - top : offset.top, - left : offset.left, - pos : pos - }; - } - } - - }).each(function($ele) { - - $ele = UI.$(this); - - if ($ele.css('display') != 'none' && $ele.data('ukMarginTop') > min.top && $ele.data('ukMarginPos') > min.pos) { - $ele.addClass(options.cls); - } - }); - }; - - UI.Utils.matchHeights = function(elements, options) { - - elements = UI.$(elements).css('min-height', ''); - options = UI.$.extend({ row : true }, options); - - var matchHeights = function(group){ - - if (group.length < 2) return; - - var max = 0; - - group.each(function() { - max = Math.max(max, UI.$(this).outerHeight()); - }).each(function() { - - var element = UI.$(this), - height = max - (element.css('box-sizing') == 'border-box' ? 0 : (element.outerHeight() - element.height())); - - element.css('min-height', height + 'px'); - }); - }; - - if (options.row) { - - elements.first().width(); // force redraw - - setTimeout(function(){ - - var lastoffset = false, group = []; - - elements.each(function() { - - var ele = UI.$(this), offset = ele.offset().top; - - if (offset != lastoffset && group.length) { - - matchHeights(UI.$(group)); - group = []; - offset = ele.offset().top; - } - - group.push(ele); - lastoffset = offset; - }); - - if (group.length) { - matchHeights(UI.$(group)); - } - - }, 0); - - } else { - matchHeights(elements); - } - }; - - (function(cacheSvgs){ - - UI.Utils.inlineSvg = function(selector, root) { - - var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){ - - var img = UI.$(this), - src = img.attr('src'); - - if (!cacheSvgs[src]) { - - var d = UI.$.Deferred(); - - UI.$.get(src, {nc: Math.random()}, function(data){ - d.resolve(UI.$(data).find('svg')); - }); - - cacheSvgs[src] = d.promise(); - } - - cacheSvgs[src].then(function(svg) { - - var $svg = UI.$(svg).clone(); - - if (img.attr('id')) $svg.attr('id', img.attr('id')); - if (img.attr('class')) $svg.attr('class', img.attr('class')); - if (img.attr('style')) $svg.attr('style', img.attr('style')); - - if (img.attr('width')) { - $svg.attr('width', img.attr('width')); - if (!img.attr('height')) $svg.removeAttr('height'); - } - - if (img.attr('height')){ - $svg.attr('height', img.attr('height')); - if (!img.attr('width')) $svg.removeAttr('width'); - } - - img.replaceWith($svg); - }); - }); - }; - - // init code - UI.ready(function(context) { - UI.Utils.inlineSvg('[data-uk-svg]', context); - }); - - })({}); - -})(UIkit); - -(function(UI) { - - "use strict"; - - UI.component('smoothScroll', { - - boot: function() { - - // init code - UI.$html.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) { - var ele = UI.$(this); - - if (!ele.data("smoothScroll")) { - var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr("data-uk-smooth-scroll"))); - ele.trigger("click"); - } - - return false; - }); - }, - - init: function() { - - var $this = this; - - this.on("click", function(e) { - e.preventDefault(); - scrollToElement(UI.$(this.hash).length ? UI.$(this.hash) : UI.$("body"), $this.options); - }); - } - }); - - function scrollToElement(ele, options) { - - options = UI.$.extend({ - duration: 1000, - transition: 'easeOutExpo', - offset: 0, - complete: function(){} - }, options); - - // get / set parameters - var target = ele.offset().top - options.offset, - docheight = UI.$doc.height(), - winheight = window.innerHeight; - - if ((target + winheight) > docheight) { - target = docheight - winheight; - } - - // animate to target, fire callback when done - UI.$("html,body").stop().animate({scrollTop: target}, options.duration, options.transition).promise().done(options.complete); - } - - UI.Utils.scrollToElement = scrollToElement; - - if (!UI.$.easing.easeOutExpo) { - UI.$.easing.easeOutExpo = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }; - } - -})(UIkit); - -(function(UI) { - - "use strict"; - - var $win = UI.$win, - $doc = UI.$doc, - scrollspies = [], - checkScrollSpy = function() { - for(var i=0; i < scrollspies.length; i++) { - window.requestAnimationFrame.apply(window, [scrollspies[i].check]); - } - }; - - UI.component('scrollspy', { - - defaults: { - "target" : false, - "cls" : "uk-scrollspy-inview", - "initcls" : "uk-scrollspy-init-inview", - "topoffset" : 0, - "leftoffset" : 0, - "repeat" : false, - "delay" : 0 - }, - - boot: function() { - - // listen to scroll and resize - $doc.on("scrolling.uk.document", checkScrollSpy); - $win.on("load resize orientationchange", UI.Utils.debounce(checkScrollSpy, 50)); - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-scrollspy]", context).each(function() { - - var element = UI.$(this); - - if (!element.data("scrollspy")) { - var obj = UI.scrollspy(element, UI.Utils.options(element.attr("data-uk-scrollspy"))); - } - }); - }); - }, - - init: function() { - - var $this = this, inviewstate, initinview, togglecls = this.options.cls.split(/,/), fn = function(){ - - var elements = $this.options.target ? $this.element.find($this.options.target) : $this.element, - delayIdx = elements.length === 1 ? 1 : 0, - toggleclsIdx = 0; - - elements.each(function(idx){ - - var element = UI.$(this), - inviewstate = element.data('inviewstate'), - inview = UI.Utils.isInView(element, $this.options), - toggle = element.data('ukScrollspyCls') || togglecls[toggleclsIdx].trim(); - - if (inview && !inviewstate && !element.data('scrollspy-idle')) { - - if (!initinview) { - element.addClass($this.options.initcls); - $this.offset = element.offset(); - initinview = true; - - element.trigger("init.uk.scrollspy"); - } - - element.data('scrollspy-idle', setTimeout(function(){ - - element.addClass("uk-scrollspy-inview").toggleClass(toggle).width(); - element.trigger("inview.uk.scrollspy"); - - element.data('scrollspy-idle', false); - element.data('inviewstate', true); - - }, $this.options.delay * delayIdx)); - - delayIdx++; - } - - if (!inview && inviewstate && $this.options.repeat) { - - if (element.data('scrollspy-idle')) { - clearTimeout(element.data('scrollspy-idle')); - element.data('scrollspy-idle', false); - } - - element.removeClass("uk-scrollspy-inview").toggleClass(toggle); - element.data('inviewstate', false); - - element.trigger("outview.uk.scrollspy"); - } - - toggleclsIdx = togglecls[toggleclsIdx + 1] ? (toggleclsIdx + 1) : 0; - - }); - }; - - fn(); - - this.check = fn; - - scrollspies.push(this); - } - }); - - - var scrollspynavs = [], - checkScrollSpyNavs = function() { - for(var i=0; i < scrollspynavs.length; i++) { - window.requestAnimationFrame.apply(window, [scrollspynavs[i].check]); - } - }; - - UI.component('scrollspynav', { - - defaults: { - "cls" : 'uk-active', - "closest" : false, - "topoffset" : 0, - "leftoffset" : 0, - "smoothscroll" : false - }, - - boot: function() { - - // listen to scroll and resize - $doc.on("scrolling.uk.document", checkScrollSpyNavs); - $win.on("resize orientationchange", UI.Utils.debounce(checkScrollSpyNavs, 50)); - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-scrollspy-nav]", context).each(function() { - - var element = UI.$(this); - - if (!element.data("scrollspynav")) { - var obj = UI.scrollspynav(element, UI.Utils.options(element.attr("data-uk-scrollspy-nav"))); - } - }); - }); - }, - - init: function() { - - var ids = [], - links = this.find("a[href^='#']").each(function(){ if(this.getAttribute("href").trim()!=='#') ids.push(this.getAttribute("href")); }), - targets = UI.$(ids.join(",")), - - clsActive = this.options.cls, - clsClosest = this.options.closest || this.options.closest; - - var $this = this, inviews, fn = function(){ - - inviews = []; - - for (var i=0 ; i < targets.length ; i++) { - if (UI.Utils.isInView(targets.eq(i), $this.options)) { - inviews.push(targets.eq(i)); - } - } - - if (inviews.length) { - - var navitems, - scrollTop = $win.scrollTop(), - target = (function(){ - for(var i=0; i< inviews.length;i++){ - if (inviews[i].offset().top - $this.options.topoffset >= scrollTop){ - return inviews[i]; - } - } - })(); - - if (!target) return; - - if ($this.options.closest) { - links.blur().closest(clsClosest).removeClass(clsActive); - navitems = links.filter("a[href='#"+target.attr("id")+"']").closest(clsClosest).addClass(clsActive); - } else { - navitems = links.removeClass(clsActive).filter("a[href='#"+target.attr("id")+"']").addClass(clsActive); - } - - $this.element.trigger("inview.uk.scrollspynav", [target, navitems]); - } - }; - - if (this.options.smoothscroll && UI.smoothScroll) { - links.each(function(){ - UI.smoothScroll(this, $this.options.smoothscroll); - }); - } - - fn(); - - this.element.data("scrollspynav", this); - - this.check = fn; - scrollspynavs.push(this); - - } - }); - -})(UIkit); - -(function(UI){ - - "use strict"; - - var toggles = []; - - UI.component('toggle', { - - defaults: { - target : false, - cls : 'uk-hidden', - animation : false, - duration : 200 - }, - - boot: function(){ - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-toggle]", context).each(function() { - var ele = UI.$(this); - - if (!ele.data("toggle")) { - var obj = UI.toggle(ele, UI.Utils.options(ele.attr("data-uk-toggle"))); - } - }); - - setTimeout(function(){ - - toggles.forEach(function(toggle){ - toggle.getToggles(); - }); - - }, 0); - }); - }, - - init: function() { - - var $this = this; - - this.aria = (this.options.cls.indexOf('uk-hidden') !== -1); - - this.getToggles(); - - this.on("click", function(e) { - if ($this.element.is('a[href="#"]')) e.preventDefault(); - $this.toggle(); - }); - - toggles.push(this); - }, - - toggle: function() { - - if(!this.totoggle.length) return; - - if (this.options.animation && UI.support.animation) { - - var $this = this, animations = this.options.animation.split(','); - - if (animations.length == 1) { - animations[1] = animations[0]; - } - - animations[0] = animations[0].trim(); - animations[1] = animations[1].trim(); - - this.totoggle.css('animation-duration', this.options.duration+'ms'); - - this.totoggle.each(function(){ - - var ele = UI.$(this); - - if (ele.hasClass($this.options.cls)) { - - ele.toggleClass($this.options.cls); - - UI.Utils.animate(ele, animations[0]).then(function(){ - ele.css('animation-duration', ''); - UI.Utils.checkDisplay(ele); - }); - - } else { - - UI.Utils.animate(this, animations[1]+' uk-animation-reverse').then(function(){ - ele.toggleClass($this.options.cls).css('animation-duration', ''); - UI.Utils.checkDisplay(ele); - }); - - } - - }); - - } else { - this.totoggle.toggleClass(this.options.cls); - UI.Utils.checkDisplay(this.totoggle); - } - - this.updateAria(); - - }, - - getToggles: function() { - this.totoggle = this.options.target ? UI.$(this.options.target):[]; - this.updateAria(); - }, - - updateAria: function() { - if (this.aria && this.totoggle.length) { - this.totoggle.each(function(){ - UI.$(this).attr('aria-hidden', UI.$(this).hasClass('uk-hidden')); - }); - } - } - }); - -})(UIkit); - -(function(UI) { - - "use strict"; - - UI.component('alert', { - - defaults: { - "fade": true, - "duration": 200, - "trigger": ".uk-alert-close" - }, - - boot: function() { - - // init code - UI.$html.on("click.alert.uikit", "[data-uk-alert]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("alert")) { - - var alert = UI.alert(ele, UI.Utils.options(ele.attr("data-uk-alert"))); - - if (UI.$(e.target).is(alert.options.trigger)) { - e.preventDefault(); - alert.close(); - } - } - }); - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.trigger, function(e) { - e.preventDefault(); - $this.close(); - }); - }, - - close: function() { - - var element = this.trigger("close.uk.alert"), - removeElement = function () { - this.trigger("closed.uk.alert").remove(); - }.bind(this); - - if (this.options.fade) { - element.css("overflow", "hidden").css("max-height", element.height()).animate({ - "height" : 0, - "opacity" : 0, - "padding-top" : 0, - "padding-bottom" : 0, - "margin-top" : 0, - "margin-bottom" : 0 - }, this.options.duration, removeElement); - } else { - removeElement(); - } - } - - }); - -})(UIkit); - -(function(UI) { - - "use strict"; - - UI.component('buttonRadio', { - - defaults: { - "activeClass": 'uk-active', - "target": ".uk-button" - }, - - boot: function() { - - // init code - UI.$html.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("buttonRadio")) { - - var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr("data-uk-button-radio"))), - target = UI.$(e.target); - - if (target.is(obj.options.target)) { - target.trigger("click"); - } - } - }); - }, - - init: function() { - - var $this = this; - - // Init ARIA - this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true'); - - this.on("click", this.options.target, function(e) { - - var ele = UI.$(this); - - if (ele.is('a[href="#"]')) e.preventDefault(); - - $this.find($this.options.target).not(ele).removeClass($this.options.activeClass).blur(); - ele.addClass($this.options.activeClass); - - // Update ARIA - $this.find($this.options.target).not(ele).attr('aria-checked', 'false'); - ele.attr('aria-checked', 'true'); - - $this.trigger("change.uk.button", [ele]); - }); - - }, - - getSelected: function() { - return this.find('.' + this.options.activeClass); - } - }); - - UI.component('buttonCheckbox', { - - defaults: { - "activeClass": 'uk-active', - "target": ".uk-button" - }, - - boot: function() { - - UI.$html.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) { - var ele = UI.$(this); - - if (!ele.data("buttonCheckbox")) { - - var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr("data-uk-button-checkbox"))), - target = UI.$(e.target); - - if (target.is(obj.options.target)) { - target.trigger("click"); - } - } - }); - }, - - init: function() { - - var $this = this; - - // Init ARIA - this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true'); - - this.on("click", this.options.target, function(e) { - var ele = UI.$(this); - - if (ele.is('a[href="#"]')) e.preventDefault(); - - ele.toggleClass($this.options.activeClass).blur(); - - // Update ARIA - ele.attr('aria-checked', ele.hasClass($this.options.activeClass)); - - $this.trigger("change.uk.button", [ele]); - }); - - }, - - getSelected: function() { - return this.find('.' + this.options.activeClass); - } - }); - - - UI.component('button', { - - defaults: {}, - - boot: function() { - - UI.$html.on("click.button.uikit", "[data-uk-button]", function(e) { - var ele = UI.$(this); - - if (!ele.data("button")) { - - var obj = UI.button(ele, UI.Utils.options(ele.attr("data-uk-button"))); - ele.trigger("click"); - } - }); - }, - - init: function() { - - var $this = this; - - // Init ARIA - this.element.attr('aria-pressed', this.element.hasClass("uk-active")); - - this.on("click", function(e) { - - if ($this.element.is('a[href="#"]')) e.preventDefault(); - - $this.toggle(); - $this.trigger("change.uk.button", [$this.element.blur().hasClass("uk-active")]); - }); - - }, - - toggle: function() { - this.element.toggleClass("uk-active"); - - // Update ARIA - this.element.attr('aria-pressed', this.element.hasClass("uk-active")); - } - }); - -})(UIkit); - - -(function(UI) { - - "use strict"; - - var active = false, hoverIdle, flips = { - 'x': { - "bottom-left" : 'bottom-right', - "bottom-right" : 'bottom-left', - "bottom-center" : 'bottom-center', - "top-left" : 'top-right', - "top-right" : 'top-left', - "top-center" : 'top-center', - "left-top" : 'right-top', - "left-bottom" : 'right-bottom', - "left-center" : 'right-center', - "right-top" : 'left-top', - "right-bottom" : 'left-bottom', - "right-center" : 'left-center' - }, - 'y': { - "bottom-left" : 'top-left', - "bottom-right" : 'top-right', - "bottom-center" : 'top-center', - "top-left" : 'bottom-left', - "top-right" : 'bottom-right', - "top-center" : 'bottom-center', - "left-top" : 'left-bottom', - "left-bottom" : 'left-top', - "left-center" : 'left-center', - "right-top" : 'right-bottom', - "right-bottom" : 'right-top', - "right-center" : 'right-center' - }, - 'xy': { - "bottom-left" : 'top-right', - "bottom-right" : 'top-left', - "bottom-center" : 'top-center', - "top-left" : 'bottom-right', - "top-right" : 'bottom-left', - "top-center" : 'bottom-center', - "left-top" : 'right-bottom', - "left-bottom" : 'right-top', - "left-center" : 'right-center', - "right-top" : 'left-bottom', - "right-bottom" : 'left-top', - "right-center" : 'left-center' - } - }; - - UI.component('dropdown', { - - defaults: { - 'mode' : 'hover', - 'pos' : 'bottom-left', - 'offset' : 0, - 'remaintime' : 800, - 'justify' : false, - 'boundary' : UI.$win, - 'delay' : 0, - 'dropdownSelector': '.uk-dropdown,.uk-dropdown-blank', - 'hoverDelayIdle' : 250, - 'preventflip' : false - }, - - remainIdle: false, - - boot: function() { - - var triggerevent = UI.support.touch ? "click" : "mouseenter"; - - // init code - UI.$html.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) { - - var ele = UI.$(this); - - if (!ele.data("dropdown")) { - - var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr("data-uk-dropdown"))); - - if (triggerevent=="click" || (triggerevent=="mouseenter" && dropdown.options.mode=="hover")) { - dropdown.element.trigger(triggerevent); - } - - if (dropdown.element.find(dropdown.options.dropdownSelector).length) { - e.preventDefault(); - } - } - }); - }, - - init: function() { - - var $this = this; - - this.dropdown = this.find(this.options.dropdownSelector); - this.offsetParent = this.dropdown.parents().filter(function() { - return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1; - }).slice(0,1); - - this.centered = this.dropdown.hasClass('uk-dropdown-center'); - this.justified = this.options.justify ? UI.$(this.options.justify) : false; - - this.boundary = UI.$(this.options.boundary); - - if (!this.boundary.length) { - this.boundary = UI.$win; - } - - // legacy DEPRECATED! - if (this.dropdown.hasClass('uk-dropdown-up')) { - this.options.pos = 'top-left'; - } - if (this.dropdown.hasClass('uk-dropdown-flip')) { - this.options.pos = this.options.pos.replace('left','right'); - } - if (this.dropdown.hasClass('uk-dropdown-center')) { - this.options.pos = this.options.pos.replace(/(left|right)/,'center'); - } - //-- end legacy - - // Init ARIA - this.element.attr('aria-haspopup', 'true'); - this.element.attr('aria-expanded', this.element.hasClass("uk-open")); - - if (this.options.mode == "click" || UI.support.touch) { - - this.on("click.uk.dropdown", function(e) { - - var $target = UI.$(e.target); - - if (!$target.parents($this.options.dropdownSelector).length) { - - if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){ - e.preventDefault(); - } - - $target.blur(); - } - - if (!$this.element.hasClass('uk-open')) { - - $this.show(); - - } else { - - if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) { - $this.hide(); - } - } - }); - - } else { - - this.on("mouseenter", function(e) { - - $this.trigger('pointerenter.uk.dropdown', [$this]); - - if ($this.remainIdle) { - clearTimeout($this.remainIdle); - } - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - if (active && active == $this) { - return; - } - - // pseudo manuAim - if (active && active != $this) { - - hoverIdle = setTimeout(function() { - hoverIdle = setTimeout($this.show.bind($this), $this.options.delay); - }, $this.options.hoverDelayIdle); - - } else { - - hoverIdle = setTimeout($this.show.bind($this), $this.options.delay); - } - - }).on("mouseleave", function() { - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - $this.remainIdle = setTimeout(function() { - if (active && active == $this) $this.hide(); - }, $this.options.remaintime); - - $this.trigger('pointerleave.uk.dropdown', [$this]); - - }).on("click", function(e){ - - var $target = UI.$(e.target); - - if ($this.remainIdle) { - clearTimeout($this.remainIdle); - } - - if (active && active == $this) { - if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) { - $this.hide(); - } - return; - } - - if ($target.is("a[href='#']") || $target.parent().is("a[href='#']")){ - e.preventDefault(); - } - - $this.show(); - }); - } - }, - - show: function(){ - - UI.$html.off("click.outer.dropdown"); - - if (active && active != this) { - active.hide(true); - } - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - this.trigger('beforeshow.uk.dropdown', [this]); - - this.checkDimensions(); - this.element.addClass('uk-open'); - - // Update ARIA - this.element.attr('aria-expanded', 'true'); - - this.trigger('show.uk.dropdown', [this]); - - UI.Utils.checkDisplay(this.dropdown, true); - active = this; - - this.registerOuterClick(); - }, - - hide: function(force) { - - this.trigger('beforehide.uk.dropdown', [this, force]); - - this.element.removeClass('uk-open'); - - if (this.remainIdle) { - clearTimeout(this.remainIdle); - } - - this.remainIdle = false; - - // Update ARIA - this.element.attr('aria-expanded', 'false'); - - this.trigger('hide.uk.dropdown', [this, force]); - - if (active == this) active = false; - }, - - registerOuterClick: function(){ - - var $this = this; - - UI.$html.off("click.outer.dropdown"); - - setTimeout(function() { - - UI.$html.on("click.outer.dropdown", function(e) { - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - var $target = UI.$(e.target); - - if (active == $this && !$this.element.find(e.target).length) { - $this.hide(true); - UI.$html.off("click.outer.dropdown"); - } - }); - }, 10); - }, - - checkDimensions: function() { - - if (!this.dropdown.length) return; - - // reset - this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({ - 'top-left':'', - 'left':'', - 'margin-left' :'', - 'margin-right':'' - }); - - if (this.justified && this.justified.length) { - this.dropdown.css("min-width", ""); - } - - var $this = this, - pos = UI.$.extend({}, this.offsetParent.offset(), {width: this.offsetParent[0].offsetWidth, height: this.offsetParent[0].offsetHeight}), - posoffset = this.options.offset, - dropdown = this.dropdown, - offset = dropdown.show().offset() || {left: 0, top: 0}, - width = dropdown.outerWidth(), - height = dropdown.outerHeight(), - boundarywidth = this.boundary.width(), - boundaryoffset = this.boundary[0] !== window && this.boundary.offset() ? this.boundary.offset(): {top:0, left:0}, - dpos = this.options.pos; - - var variants = { - "bottom-left" : {top: 0 + pos.height + posoffset, left: 0}, - "bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width}, - "bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2}, - "top-left" : {top: 0 - height - posoffset, left: 0}, - "top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width}, - "top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2}, - "left-top" : {top: 0, left: 0 - width - posoffset}, - "left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset}, - "left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset}, - "right-top" : {top: 0, left: 0 + pos.width + posoffset}, - "right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset}, - "right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset} - }, - css = {}, - pp; - - pp = dpos.split('-'); - css = variants[dpos] ? variants[dpos] : variants['bottom-left']; - - // justify dropdown - if (this.justified && this.justified.length) { - justify(dropdown.css({left:0}), this.justified, boundarywidth); - } else { - - if (this.options.preventflip !== true) { - - var fdpos; - - switch(this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) { - case "x": - if(this.options.preventflip !=='x') fdpos = flips['x'][dpos] || 'right-top'; - break; - case "y": - if(this.options.preventflip !=='y') fdpos = flips['y'][dpos] || 'top-left'; - break; - case "xy": - if(!this.options.preventflip) fdpos = flips['xy'][dpos] || 'right-bottom'; - break; - } - - if (fdpos) { - - pp = fdpos.split('-'); - css = variants[fdpos] ? variants[fdpos] : variants['bottom-left']; - - // check flipped - if (this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) { - pp = dpos.split('-'); - css = variants[dpos] ? variants[dpos] : variants['bottom-left']; - } - } - } - } - - if (width > boundarywidth) { - dropdown.addClass("uk-dropdown-stack"); - this.trigger('stack.uk.dropdown', [this]); - } - - dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]); - }, - - checkBoundary: function(left, top, width, height, boundarywidth) { - - var axis = ""; - - if (left < 0 || ((left - UI.$win.scrollLeft())+width) > boundarywidth) { - axis += "x"; - } - - if ((top - UI.$win.scrollTop()) < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) { - axis += "y"; - } - - return axis; - } - }); - - - UI.component('dropdownOverlay', { - - defaults: { - 'justify' : false, - 'cls' : '', - 'duration': 200 - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-dropdown-overlay]", context).each(function() { - var ele = UI.$(this); - - if (!ele.data("dropdownOverlay")) { - UI.dropdownOverlay(ele, UI.Utils.options(ele.attr("data-uk-dropdown-overlay"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.justified = this.options.justify ? UI.$(this.options.justify) : false; - this.overlay = this.element.find('uk-dropdown-overlay'); - - if (!this.overlay.length) { - this.overlay = UI.$('
              ').appendTo(this.element); - } - - this.overlay.addClass(this.options.cls); - - this.on({ - - 'beforeshow.uk.dropdown': function(e, dropdown) { - $this.dropdown = dropdown; - - if ($this.justified && $this.justified.length) { - justify($this.overlay.css({'display':'block', 'margin-left':'','margin-right':''}), $this.justified, $this.justified.outerWidth()); - } - }, - - 'show.uk.dropdown': function(e, dropdown) { - - var h = $this.dropdown.dropdown.outerHeight(true); - - $this.dropdown.element.removeClass('uk-open'); - - $this.overlay.stop().css('display', 'block').animate({height: h}, $this.options.duration, function() { - - $this.dropdown.dropdown.css('visibility', ''); - $this.dropdown.element.addClass('uk-open'); - - UI.Utils.checkDisplay($this.dropdown.dropdown, true); - }); - - $this.pointerleave = false; - }, - - 'hide.uk.dropdown': function() { - $this.overlay.stop().animate({height: 0}, $this.options.duration); - }, - - 'pointerenter.uk.dropdown': function(e, dropdown) { - clearTimeout($this.remainIdle); - }, - - 'pointerleave.uk.dropdown': function(e, dropdown) { - $this.pointerleave = true; - } - }); - - - this.overlay.on({ - - 'mouseenter': function() { - if ($this.remainIdle) { - clearTimeout($this.dropdown.remainIdle); - clearTimeout($this.remainIdle); - } - }, - - 'mouseleave': function(){ - - if ($this.pointerleave && active) { - - $this.remainIdle = setTimeout(function() { - if(active) active.hide(); - }, active.options.remaintime); - } - } - }) - } - - }); - - - function justify(ele, justifyTo, boundarywidth, offset) { - - ele = UI.$(ele); - justifyTo = UI.$(justifyTo); - boundarywidth = boundarywidth || window.innerWidth; - offset = offset || ele.offset(); - - if (justifyTo.length) { - - var jwidth = justifyTo.outerWidth(); - - ele.css("min-width", jwidth); - - if (UI.langdirection == 'right') { - - var right1 = boundarywidth - (justifyTo.offset().left + jwidth), - right2 = boundarywidth - (ele.offset().left + ele.outerWidth()); - - ele.css("margin-right", right1 - right2); - - } else { - ele.css("margin-left", justifyTo.offset().left - offset.left); - } - } - } - -})(UIkit); - -(function(UI) { - - "use strict"; - - var grids = []; - - UI.component('gridMatchHeight', { - - defaults: { - "target" : false, - "row" : true, - "ignorestacked" : false, - "observe" : false - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-grid-match]", context).each(function() { - var grid = UI.$(this), obj; - - if (!grid.data("gridMatchHeight")) { - obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.columns = this.element.children(); - this.elements = this.options.target ? this.find(this.options.target) : this.columns; - - if (!this.columns.length) return; - - UI.$win.on('load resize orientationchange', (function() { - - var fn = function() { - if ($this.element.is(":visible")) $this.match(); - }; - - UI.$(function() { fn(); }); - - return UI.Utils.debounce(fn, 50); - })()); - - if (this.options.observe) { - - UI.domObserve(this.element, function(e) { - if ($this.element.is(":visible")) $this.match(); - }); - } - - this.on("display.uk.check", function(e) { - if(this.element.is(":visible")) this.match(); - }.bind(this)); - - grids.push(this); - }, - - match: function() { - - var firstvisible = this.columns.filter(":visible:first"); - - if (!firstvisible.length) return; - - var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100; - - if (stacked && !this.options.ignorestacked) { - this.revert(); - } else { - UI.Utils.matchHeights(this.elements, this.options); - } - - return this; - }, - - revert: function() { - this.elements.css('min-height', ''); - return this; - } - }); - - UI.component('gridMargin', { - - defaults: { - cls : 'uk-grid-margin', - rowfirst : 'uk-row-first' - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-grid-margin]", context).each(function() { - var grid = UI.$(this), obj; - - if (!grid.data("gridMargin")) { - obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin"))); - } - }); - }); - }, - - init: function() { - - var stackMargin = UI.stackMargin(this.element, this.options); - } - }); - -})(UIkit); - -(function(UI) { - - "use strict"; - - var active = false, activeCount = 0, $html = UI.$html, body; - - UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){ - UI.$('.uk-modal.uk-open').each(function(){ - UI.$(this).data('modal').resize(); - }); - }, 150)); - - UI.component('modal', { - - defaults: { - keyboard: true, - bgclose: true, - minScrollHeight: 150, - center: false, - modal: true - }, - - scrollable: false, - transition: false, - hasTransitioned: true, - - init: function() { - - if (!body) body = UI.$('body'); - - if (!this.element.length) return; - - var $this = this; - - this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left"); - this.dialog = this.find(".uk-modal-dialog"); - - this.active = false; - - // Update ARIA - this.element.attr('aria-hidden', this.element.hasClass("uk-open")); - - this.on("click", ".uk-modal-close", function(e) { - e.preventDefault(); - $this.hide(); - }).on("click", function(e) { - - var target = UI.$(e.target); - - if (target[0] == $this.element[0] && $this.options.bgclose) { - $this.hide(); - } - }); - - UI.domObserve(this.element, function(e) { $this.resize(); }); - }, - - toggle: function() { - return this[this.isActive() ? "hide" : "show"](); - }, - - show: function() { - - if (!this.element.length) return; - - var $this = this; - - if (this.isActive()) return; - - if (this.options.modal && active) { - active.hide(true); - } - - this.element.removeClass("uk-open").show(); - this.resize(true); - - if (this.options.modal) { - active = this; - } - - this.active = true; - - activeCount++; - - if (UI.support.transition) { - this.hasTransitioned = false; - this.element.one(UI.support.transition.end, function(){ - $this.hasTransitioned = true; - }).addClass("uk-open"); - } else { - this.element.addClass("uk-open"); - } - - $html.addClass("uk-modal-page").height(); // force browser engine redraw - - // Update ARIA - this.element.attr('aria-hidden', 'false'); - - this.element.trigger("show.uk.modal"); - - UI.Utils.checkDisplay(this.dialog, true); - - return this; - }, - - hide: function(force) { - - if (!force && UI.support.transition && this.hasTransitioned) { - - var $this = this; - - this.one(UI.support.transition.end, function() { - $this._hide(); - }).removeClass("uk-open"); - - } else { - - this._hide(); - } - - return this; - }, - - resize: function(force) { - - if (!this.isActive() && !force) return; - - var bodywidth = body.width(); - - this.scrollbarwidth = window.innerWidth - bodywidth; - - body.css(this.paddingdir, this.scrollbarwidth); - - this.element.css('overflow-y', this.scrollbarwidth ? 'scroll' : 'auto'); - - if (!this.updateScrollable() && this.options.center) { - - var dh = this.dialog.outerHeight(), - pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10); - - if ((dh + pad) < window.innerHeight) { - this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad }); - } else { - this.dialog.css({'top': ''}); - } - } - }, - - updateScrollable: function() { - - // has scrollable? - var scrollable = this.dialog.find('.uk-overflow-container:visible:first'); - - if (scrollable.length) { - - scrollable.css('height', 0); - - var offset = Math.abs(parseInt(this.dialog.css('margin-top'), 10)), - dh = this.dialog.outerHeight(), - wh = window.innerHeight, - h = wh - 2*(offset < 20 ? 20:offset) - dh; - - scrollable.css({ - 'max-height': (h < this.options.minScrollHeight ? '':h), - 'height':'' - }); - - return true; - } - - return false; - }, - - _hide: function() { - - this.active = false; - if (activeCount > 0) activeCount--; - else activeCount = 0; - - this.element.hide().removeClass('uk-open'); - - // Update ARIA - this.element.attr('aria-hidden', 'true'); - - if (!activeCount) { - $html.removeClass('uk-modal-page'); - body.css(this.paddingdir, ""); - } - - if (active===this) active = false; - - this.trigger('hide.uk.modal'); - }, - - isActive: function() { - return this.element.hasClass('uk-open'); - } - - }); - - UI.component('modalTrigger', { - - boot: function() { - - // init code - UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) { - - var ele = UI.$(this); - - if (ele.is("a")) { - e.preventDefault(); - } - - if (!ele.data("modalTrigger")) { - var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal"))); - modal.show(); - } - - }); - - // close modal on esc button - UI.$html.on('keydown.modal.uikit', function (e) { - - if (active && e.keyCode === 27 && active.options.keyboard) { // ESC - e.preventDefault(); - active.hide(); - } - }); - }, - - init: function() { - - var $this = this; - - this.options = UI.$.extend({ - "target": $this.element.is("a") ? $this.element.attr("href") : false - }, this.options); - - this.modal = UI.modal(this.options.target, this.options); - - this.on("click", function(e) { - e.preventDefault(); - $this.show(); - }); - - //methods - this.proxy(this.modal, "show hide isActive"); - } - }); - - UI.modal.dialog = function(content, options) { - - var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options); - - modal.on("hide.uk.modal", function(){ - if (modal.persist) { - modal.persist.appendTo(modal.persist.data("modalPersistParent")); - modal.persist = false; - } - modal.element.remove(); - }); - - setContent(content, modal); - - return modal; - }; - - UI.modal.dialog.template = '
              '; - - UI.modal.alert = function(content, options) { - - options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options); - - var modal = UI.modal.dialog(([ - '
              '+String(content)+'
              ', - '' - ]).join(""), options); - - modal.on('show.uk.modal', function(){ - setTimeout(function(){ - modal.element.find('button:first').focus(); - }, 50); - }); - - return modal.show(); - }; - - UI.modal.confirm = function(content, onconfirm, oncancel) { - - var options = arguments.length > 1 && arguments[arguments.length-1] ? arguments[arguments.length-1] : {}; - - onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){}; - oncancel = UI.$.isFunction(oncancel) ? oncancel : function(){}; - options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, UI.$.isFunction(options) ? {}:options); - - var modal = UI.modal.dialog(([ - '
              '+String(content)+'
              ', - '' - ]).join(""), options); - - modal.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click", function(){ - UI.$(this).is('.js-modal-confirm') ? onconfirm() : oncancel(); - modal.hide(); - }); - - modal.on('show.uk.modal', function(){ - setTimeout(function(){ - modal.element.find('.js-modal-confirm').focus(); - }, 50); - }); - - return modal.show(); - }; - - UI.modal.prompt = function(text, value, onsubmit, options) { - - onsubmit = UI.$.isFunction(onsubmit) ? onsubmit : function(value){}; - options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options); - - var modal = UI.modal.dialog(([ - text ? '
              '+String(text)+'
              ':'', - '

              ', - '' - ]).join(""), options), - - input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){ - if (e.keyCode == 13) { - modal.element.find(".js-modal-ok").trigger('click'); - } - }); - - modal.element.find(".js-modal-ok").on("click", function(){ - if (onsubmit(input.val())!==false){ - modal.hide(); - } - }); - - modal.on('show.uk.modal', function(){ - setTimeout(function(){ - input.focus(); - }, 50); - }); - - return modal.show(); - }; - - UI.modal.blockUI = function(content, options) { - - var modal = UI.modal.dialog(([ - '
              '+String(content || '
              ...
              ')+'
              ' - ]).join(""), UI.$.extend({bgclose:false, keyboard:false, modal:false}, options)); - - modal.content = modal.element.find('.uk-modal-content:first'); - - return modal.show(); - }; - - - UI.modal.labels = { - 'Ok': 'Ok', - 'Cancel': 'Cancel' - }; - - - // helper functions - function setContent(content, modal){ - - if(!modal) return; - - if (typeof content === 'object') { - - // convert DOM object to a jQuery object - content = content instanceof jQuery ? content : UI.$(content); - - if(content.parent().length) { - modal.persist = content; - modal.persist.data("modalPersistParent", content.parent()); - } - }else if (typeof content === 'string' || typeof content === 'number') { - // just insert the data as innerHTML - content = UI.$('
              ').html(content); - }else { - // unsupported data type! - content = UI.$('
              ').html('UIkit.modal Error: Unsupported data type: ' + typeof content); - } - - content.appendTo(modal.element.find('.uk-modal-dialog')); - - return modal; - } - -})(UIkit); - -(function(UI) { - - "use strict"; - - UI.component('nav', { - - defaults: { - "toggle": ">li.uk-parent > a[href='#']", - "lists": ">li.uk-parent > ul", - "multiple": false - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-nav]", context).each(function() { - var nav = UI.$(this); - - if (!nav.data("nav")) { - var obj = UI.nav(nav, UI.Utils.options(nav.attr("data-uk-nav"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.on("click.uk.nav", this.options.toggle, function(e) { - e.preventDefault(); - var ele = UI.$(this); - $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li")); - }); - - this.find(this.options.lists).each(function() { - var $ele = UI.$(this), - parent = $ele.parent(), - active = parent.hasClass("uk-active"); - - $ele.wrap('
              '); - parent.data("list-container", $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden')); - - // Init ARIA - parent.attr('aria-expanded', parent.hasClass("uk-open")); - - if (active) $this.open(parent, true); - }); - - }, - - open: function(li, noanimation) { - - var $this = this, element = this.element, $li = UI.$(li), $container = $li.data('list-container'); - - if (!this.options.multiple) { - - element.children('.uk-open').not(li).each(function() { - - var ele = UI.$(this); - - if (ele.data('list-container')) { - ele.data('list-container').stop().animate({height: 0}, function() { - UI.$(this).parent().removeClass('uk-open').end().addClass('uk-hidden'); - }); - } - }); - } - - $li.toggleClass('uk-open'); - - // Update ARIA - $li.attr('aria-expanded', $li.hasClass('uk-open')); - - if ($container) { - - if ($li.hasClass('uk-open')) { - $container.removeClass('uk-hidden'); - } - - if (noanimation) { - - $container.stop().height($li.hasClass('uk-open') ? 'auto' : 0); - - if (!$li.hasClass('uk-open')) { - $container.addClass('uk-hidden'); - } - - this.trigger('display.uk.check'); - - } else { - - $container.stop().animate({ - height: ($li.hasClass('uk-open') ? getHeight($container.find('ul:first')) : 0) - }, function() { - - if (!$li.hasClass('uk-open')) { - $container.addClass('uk-hidden'); - } else { - $container.css('height', ''); - } - - $this.trigger('display.uk.check'); - }); - } - } - } - }); - - - // helper - - function getHeight(ele) { - var $ele = UI.$(ele), height = "auto"; - - if ($ele.is(":visible")) { - height = $ele.outerHeight(); - } else { - var tmp = { - position: $ele.css("position"), - visibility: $ele.css("visibility"), - display: $ele.css("display") - }; - - height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); - - $ele.css(tmp); // reset element - } - - return height; - } - -})(UIkit); - -(function(UI) { - - "use strict"; - - var scrollpos = {x: window.scrollX, y: window.scrollY}, - $win = UI.$win, - $doc = UI.$doc, - $html = UI.$html, - Offcanvas = { - - show: function(element) { - - element = UI.$(element); - - if (!element.length) return; - - var $body = UI.$('body'), - bar = element.find(".uk-offcanvas-bar:first"), - rtl = (UI.langdirection == "right"), - flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1, - dir = flip * (rtl ? -1 : 1), - - scrollbarwidth = window.innerWidth - $body.width(); - - scrollpos = {x: window.pageXOffset, y: window.pageYOffset}; - - element.addClass("uk-active"); - - $body.css({"width": window.innerWidth - scrollbarwidth, "height": window.innerHeight}).addClass("uk-offcanvas-page"); - $body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw - - $html.css('margin-top', scrollpos.y * -1); - - bar.addClass("uk-offcanvas-bar-show"); - - this._initElement(element); - - bar.trigger('show.uk.offcanvas', [element, bar]); - - // Update ARIA - element.attr('aria-hidden', 'false'); - }, - - hide: function(force) { - - var $body = UI.$('body'), - panel = UI.$(".uk-offcanvas.uk-active"), - rtl = (UI.langdirection == "right"), - bar = panel.find(".uk-offcanvas-bar:first"), - finalize = function() { - $body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""}); - panel.removeClass("uk-active"); - - bar.removeClass("uk-offcanvas-bar-show"); - $html.css('margin-top', ''); - window.scrollTo(scrollpos.x, scrollpos.y); - bar.trigger('hide.uk.offcanvas', [panel, bar]); - - // Update ARIA - panel.attr('aria-hidden', 'true'); - }; - - if (!panel.length) return; - - if (UI.support.transition && !force) { - - $body.one(UI.support.transition.end, function() { - finalize(); - }).css((rtl ? "margin-right" : "margin-left"), ""); - - setTimeout(function(){ - bar.removeClass("uk-offcanvas-bar-show"); - }, 0); - - } else { - finalize(); - } - }, - - _initElement: function(element) { - - if (element.data("OffcanvasInit")) return; - - element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas", function(e) { - - var target = UI.$(e.target); - - if (!e.type.match(/swipe/)) { - - if (!target.hasClass("uk-offcanvas-close")) { - if (target.hasClass("uk-offcanvas-bar")) return; - if (target.parents(".uk-offcanvas-bar:first").length) return; - } - } - - e.stopImmediatePropagation(); - Offcanvas.hide(); - }); - - element.on("click", "a[href*='#']", function(e){ - - var link = UI.$(this), - href = link.attr("href"); - - if (href == "#") { - return; - } - - UI.$doc.one('hide.uk.offcanvas', function() { - - var target; - - try { - target = UI.$(link[0].hash); - } catch (e){ - target = ''; - } - - if (!target.length) { - target = UI.$('[name="'+link[0].hash.replace('#','')+'"]'); - } - - if (target.length && UI.Utils.scrollToElement) { - UI.Utils.scrollToElement(target, UI.Utils.options(link.attr('data-uk-smooth-scroll') || '{}')); - } else { - window.location.href = href; - } - }); - - Offcanvas.hide(); - }); - - element.data("OffcanvasInit", true); - } - }; - - UI.component('offcanvasTrigger', { - - boot: function() { - - // init code - $html.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) { - - e.preventDefault(); - - var ele = UI.$(this); - - if (!ele.data("offcanvasTrigger")) { - var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-uk-offcanvas"))); - ele.trigger("click"); - } - }); - - $html.on('keydown.uk.offcanvas', function(e) { - - if (e.keyCode === 27) { // ESC - Offcanvas.hide(); - } - }); - }, - - init: function() { - - var $this = this; - - this.options = UI.$.extend({ - "target": $this.element.is("a") ? $this.element.attr("href") : false - }, this.options); - - this.on("click", function(e) { - e.preventDefault(); - Offcanvas.show($this.options.target); - }); - } - }); - - UI.offcanvas = Offcanvas; - -})(UIkit); - -(function(UI) { - - "use strict"; - - var Animations; - - UI.component('switcher', { - - defaults: { - connect : false, - toggle : ">*", - active : 0, - animation : false, - duration : 200, - swiping : true - }, - - animating: false, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-switcher]", context).each(function() { - var switcher = UI.$(this); - - if (!switcher.data("switcher")) { - var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr("data-uk-switcher"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.on("click.uk.switcher", this.options.toggle, function(e) { - e.preventDefault(); - $this.show(this); - }); - - if (this.options.connect) { - - this.connect = UI.$(this.options.connect); - - this.connect.children().removeClass("uk-active"); - - // delegate switch commands within container content - if (this.connect.length) { - - // Init ARIA for connect - this.connect.children().attr('aria-hidden', 'true'); - - this.connect.on("click", '[data-uk-switcher-item]', function(e) { - - e.preventDefault(); - - var item = UI.$(this).attr('data-uk-switcher-item'); - - if ($this.index == item) return; - - switch(item) { - case 'next': - case 'previous': - $this.show($this.index + (item=='next' ? 1:-1)); - break; - default: - $this.show(parseInt(item, 10)); - } - }); - - if (this.options.swiping) { - - this.connect.on('swipeRight swipeLeft', function(e) { - e.preventDefault(); - if(!window.getSelection().toString()) { - $this.show($this.index + (e.type == 'swipeLeft' ? 1 : -1)); - } - }); - } - } - - var toggles = this.find(this.options.toggle), - active = toggles.filter(".uk-active"); - - if (active.length) { - this.show(active, false); - } else { - - if (this.options.active===false) return; - - active = toggles.eq(this.options.active); - this.show(active.length ? active : toggles.eq(0), false); - } - - // Init ARIA for toggles - toggles.not(active).attr('aria-expanded', 'false'); - active.attr('aria-expanded', 'true'); - } - - }, - - show: function(tab, animate) { - - if (this.animating) { - return; - } - - if (isNaN(tab)) { - tab = UI.$(tab); - } else { - - var toggles = this.find(this.options.toggle); - - tab = tab < 0 ? toggles.length-1 : tab; - tab = toggles.eq(toggles[tab] ? tab : 0); - } - - var $this = this, - toggles = this.find(this.options.toggle), - active = UI.$(tab), - animation = Animations[this.options.animation] || function(current, next) { - - if (!$this.options.animation) { - return Animations.none.apply($this); - } - - var anim = $this.options.animation.split(','); - - if (anim.length == 1) { - anim[1] = anim[0]; - } - - anim[0] = anim[0].trim(); - anim[1] = anim[1].trim(); - - return coreAnimation.apply($this, [anim, current, next]); - }; - - if (animate===false || !UI.support.animation) { - animation = Animations.none; - } - - if (active.hasClass("uk-disabled")) return; - - // Update ARIA for Toggles - toggles.attr('aria-expanded', 'false'); - active.attr('aria-expanded', 'true'); - - toggles.filter(".uk-active").removeClass("uk-active"); - active.addClass("uk-active"); - - if (this.options.connect && this.connect.length) { - - this.index = this.find(this.options.toggle).index(active); - - if (this.index == -1 ) { - this.index = 0; - } - - this.connect.each(function() { - - var container = UI.$(this), - children = UI.$(container.children()), - current = UI.$(children.filter('.uk-active')), - next = UI.$(children.eq($this.index)); - - $this.animating = true; - - animation.apply($this, [current, next]).then(function(){ - - current.removeClass("uk-active"); - next.addClass("uk-active"); - - // Update ARIA for connect - current.attr('aria-hidden', 'true'); - next.attr('aria-hidden', 'false'); - - UI.Utils.checkDisplay(next, true); - - $this.animating = false; - - }); - }); - } - - this.trigger("show.uk.switcher", [active]); - } - }); - - Animations = { - - 'none': function() { - var d = UI.$.Deferred(); - d.resolve(); - return d.promise(); - }, - - 'fade': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-fade', current, next]); - }, - - 'slide-bottom': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-bottom', current, next]); - }, - - 'slide-top': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-top', current, next]); - }, - - 'slide-vertical': function(current, next, dir) { - - var anim = ['uk-animation-slide-top', 'uk-animation-slide-bottom']; - - if (current && current.index() > next.index()) { - anim.reverse(); - } - - return coreAnimation.apply(this, [anim, current, next]); - }, - - 'slide-left': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-left', current, next]); - }, - - 'slide-right': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-slide-right', current, next]); - }, - - 'slide-horizontal': function(current, next, dir) { - - var anim = ['uk-animation-slide-right', 'uk-animation-slide-left']; - - if (current && current.index() > next.index()) { - anim.reverse(); - } - - return coreAnimation.apply(this, [anim, current, next]); - }, - - 'scale': function(current, next) { - return coreAnimation.apply(this, ['uk-animation-scale-up', current, next]); - } - }; - - UI.switcher.animations = Animations; - - - // helpers - - function coreAnimation(cls, current, next) { - - var d = UI.$.Deferred(), clsIn = cls, clsOut = cls, release; - - if (next[0]===current[0]) { - d.resolve(); - return d.promise(); - } - - if (typeof(cls) == 'object') { - clsIn = cls[0]; - clsOut = cls[1] || cls[0]; - } - - UI.$body.css('overflow-x', 'hidden'); // fix scroll jumping in iOS - - release = function() { - - if (current) current.hide().removeClass('uk-active '+clsOut+' uk-animation-reverse'); - - next.addClass(clsIn).one(UI.support.animation.end, function() { - - setTimeout(function () { - next.removeClass(''+clsIn+'').css({opacity:'', display:''}); - }, 0); - - d.resolve(); - - UI.$body.css('overflow-x', ''); - - if (current) current.css({opacity:'', display:''}); - - }.bind(this)).show(); - }; - - next.css('animation-duration', this.options.duration+'ms'); - - if (current && current.length) { - - current.css('animation-duration', this.options.duration+'ms'); - - current.css('display', 'none').addClass(clsOut+' uk-animation-reverse').one(UI.support.animation.end, function() { - release(); - }.bind(this)).css('display', ''); - - } else { - next.addClass('uk-active'); - release(); - } - - return d.promise(); - } - -})(UIkit); - -(function(UI) { - - "use strict"; - - UI.component('tab', { - - defaults: { - 'target' : '>li:not(.uk-tab-responsive, .uk-disabled)', - 'connect' : false, - 'active' : 0, - 'animation' : false, - 'duration' : 200, - 'swiping' : true - }, - - boot: function() { - - // init code - UI.ready(function(context) { - - UI.$("[data-uk-tab]", context).each(function() { - - var tab = UI.$(this); - - if (!tab.data("tab")) { - var obj = UI.tab(tab, UI.Utils.options(tab.attr("data-uk-tab"))); - } - }); - }); - }, - - init: function() { - - var $this = this; - - this.current = false; - - this.on("click.uk.tab", this.options.target, function(e) { - - e.preventDefault(); - - if ($this.switcher && $this.switcher.animating) { - return; - } - - var current = $this.find($this.options.target).not(this); - - current.removeClass("uk-active").blur(); - - $this.trigger("change.uk.tab", [UI.$(this).addClass("uk-active"), $this.current]); - - $this.current = UI.$(this); - - // Update ARIA - if (!$this.options.connect) { - current.attr('aria-expanded', 'false'); - UI.$(this).attr('aria-expanded', 'true'); - } - }); - - if (this.options.connect) { - this.connect = UI.$(this.options.connect); - } - - // init responsive tab - this.responsivetab = UI.$('
            • ').append('
                '); - - this.responsivetab.dropdown = this.responsivetab.find('.uk-dropdown'); - this.responsivetab.lst = this.responsivetab.dropdown.find('ul'); - this.responsivetab.caption = this.responsivetab.find('a:first'); - - if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up"); - - // handle click - this.responsivetab.lst.on('click.uk.tab', 'a', function(e) { - - e.preventDefault(); - e.stopPropagation(); - - var link = UI.$(this); - - $this.element.children('li:not(.uk-tab-responsive)').eq(link.data('index')).trigger('click'); - }); - - this.on('show.uk.switcher change.uk.tab', function(e, tab) { - $this.responsivetab.caption.html(tab.text()); - }); - - this.element.append(this.responsivetab); - - // init UIkit components - if (this.options.connect) { - this.switcher = UI.switcher(this.element, { - 'toggle' : '>li:not(.uk-tab-responsive)', - 'connect' : this.options.connect, - 'active' : this.options.active, - 'animation' : this.options.animation, - 'duration' : this.options.duration, - 'swiping' : this.options.swiping - }); - } - - UI.dropdown(this.responsivetab, {"mode": "click", "preventflip": "y"}); - - // init - $this.trigger("change.uk.tab", [this.element.find(this.options.target).not('.uk-tab-responsive').filter('.uk-active')]); - - this.check(); - - UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){ - if ($this.element.is(":visible")) $this.check(); - }, 100)); - - this.on('display.uk.check', function(){ - if ($this.element.is(":visible")) $this.check(); - }); - }, - - check: function() { - - var children = this.element.children('li:not(.uk-tab-responsive)').removeClass('uk-hidden'); - - if (!children.length) { - this.responsivetab.addClass('uk-hidden'); - return; - } - - var top = (children.eq(0).offset().top + Math.ceil(children.eq(0).height()/2)), - doresponsive = false, - item, link, clone; - - this.responsivetab.lst.empty(); - - children.each(function(){ - - if (UI.$(this).offset().top > top) { - doresponsive = true; - } - }); - - if (doresponsive) { - - for (var i = 0; i < children.length; i++) { - - item = UI.$(children.eq(i)); - link = item.find('a'); - - if (item.css('float') != 'none' && !item.attr('uk-dropdown')) { - - if (!item.hasClass('uk-disabled')) { - - clone = item[0].outerHTML.replace(' -1 ? '&':'?'), 'enablejsapi=1&api=1'].join('')); - } - }, - - check: function() { - - this.element.css({ - 'width' : '', - 'height' : '' - }); - - this.dimension = {w: this.element.width(), h: this.element.height()}; - - if (this.element.attr('width') && !isNaN(this.element.attr('width'))) { - this.dimension.w = this.element.attr('width'); - } - - if (this.element.attr('height') && !isNaN(this.element.attr('height'))) { - this.dimension.h = this.element.attr('height'); - } - - this.ratio = this.dimension.w / this.dimension.h; - - var w = this.parent.width(), h = this.parent.height(), width, height; - - // if element height < parent height (gap underneath) - if ((w / this.ratio) < h) { - - width = Math.ceil(h * this.ratio); - height = h; - - // element width < parent width (gap to right) - } else { - - width = w; - height = Math.ceil(w / this.ratio); - } - - this.element.css({ - 'width' : width, - 'height' : height - }); - } - }); - -})(UIkit); diff --git a/js/uikit.min.js b/js/uikit.min.js deleted file mode 100755 index ce54d56..0000000 --- a/js/uikit.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ -!function(t){if("function"==typeof define&&define.amd&&define("uikit",function(){var i=window.UIkit||t(window,window.jQuery,window.document);return i.load=function(t,e,n,o){var s,a=t.split(","),r=[],l=(o.config&&o.config.uikit&&o.config.uikit.base?o.config.uikit.base:"").replace(/\/+$/g,"");if(!l)throw new Error("Please define base path to UIkit in the requirejs config.");for(s=0;s0||t.navigator.pointerEnabled&&t.navigator.maxTouchPoints>0||!1,n.support.mutationobserver=t.MutationObserver||t.WebKitMutationObserver||null,n.Utils={},n.Utils.isFullscreen=function(){return document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.fullscreenElement||!1},n.Utils.str2json=function(t,i){try{return i?JSON.parse(t.replace(/([\$\w]+)\s*:/g,function(t,i){return'"'+i+'":'}).replace(/'([^']+)'/g,function(t,i){return'"'+i+'"'})):new Function("","var json = "+t+"; return JSON.parse(JSON.stringify(json));")()}catch(e){return!1}},n.Utils.debounce=function(t,i,e){var n;return function(){var o=this,s=arguments,a=function(){n=null,e||t.apply(o,s)},r=e&&!n;clearTimeout(n),n=setTimeout(a,i),r&&t.apply(o,s)}},n.Utils.throttle=function(t,i){var e=!1;return function(){e||(t.call(),e=!0,setTimeout(function(){e=!1},i))}},n.Utils.removeCssRules=function(t){var i,e,n,o,s,a,r,l,c,u;t&&setTimeout(function(){try{for(u=document.styleSheets,o=0,r=u.length;r>o;o++){for(n=u[o],e=[],n.cssRules=n.cssRules,i=s=0,l=n.cssRules.length;l>s;i=++s)n.cssRules[i].type===CSSRule.STYLE_RULE&&t.test(n.cssRules[i].selectorText)&&e.unshift(i);for(a=0,c=e.length;c>a;a++)n.deleteRule(e[a])}}catch(h){}},0)},n.Utils.isInView=function(t,e){var o=i(t);if(!o.is(":visible"))return!1;var s=n.$win.scrollLeft(),a=n.$win.scrollTop(),r=o.offset(),l=r.left,c=r.top;return e=i.extend({topoffset:0,leftoffset:0},e),c+o.height()>=a&&c-e.topoffset<=a+n.$win.height()&&l+o.width()>=s&&l-e.leftoffset<=s+n.$win.width()?!0:!1},n.Utils.checkDisplay=function(t,e){var o=n.$("[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]",t||document);return t&&!o.length&&(o=i(t)),o.trigger("display.uk.check"),e&&("string"!=typeof e&&(e='[class*="uk-animation-"]'),o.find(e).each(function(){var t=n.$(this),i=t.attr("class"),e=i.match(/uk-animation-(.+)/);t.removeClass(e[0]).width(),t.addClass(e[0])})),o},n.Utils.options=function(t){if("string"!=i.type(t))return t;-1!=t.indexOf(":")&&"}"!=t.trim().substr(-1)&&(t="{"+t+"}");var e=t?t.indexOf("{"):-1,o={};if(-1!=e)try{o=n.Utils.str2json(t.substr(e))}catch(s){}return o},n.Utils.animate=function(t,e){var o=i.Deferred();return t=n.$(t),t.css("display","none").addClass(e).one(n.support.animation.end,function(){t.removeClass(e),o.resolve()}),t.css("display",""),o.promise()},n.Utils.uid=function(t){return(t||"id")+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random())},n.Utils.template=function(t,i){for(var e,n,o,s,a=t.replace(/\n/g,"\\n").replace(/\{\{\{\s*(.+?)\s*\}\}\}/g,"{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),r=0,l=[],c=0;r/g, '>');}"].join("\n")),i?s(i):s},n.Utils.events={},n.Utils.events.click=n.support.touch?"tap":"click",t.UIkit=n,n.fn=function(t,e){var o=arguments,s=t.match(/^([a-z\-]+)(?:\.([a-z]+))?/i),a=s[1],r=s[2];return n[a]?this.each(function(){var t=i(this),s=t.data(a);s||t.data(a,s=n[a](this,r?void 0:e)),r&&s[r].apply(s,Array.prototype.slice.call(o,1))}):(i.error("UIkit component ["+a+"] does not exist."),this)},i.UIkit=n,i.fn.uk=n.fn,n.langdirection="rtl"==n.$html.attr("dir")?"right":"left",n.components={},n.component=function(t,e){var o=function(e,s){var a=this;return this.UIkit=n,this.element=e?n.$(e):null,this.options=i.extend(!0,{},this.defaults,s),this.plugins={},this.element&&this.element.data(t,this),this.init(),(this.options.plugins.length?this.options.plugins:Object.keys(o.plugins)).forEach(function(t){o.plugins[t].init&&(o.plugins[t].init(a),a.plugins[t]=!0)}),this.trigger("init.uk.component",[t,this]),this};return o.plugins={},i.extend(!0,o.prototype,{defaults:{plugins:[]},boot:function(){},init:function(){},on:function(t,i,e){return n.$(this.element||this).on(t,i,e)},one:function(t,i,e){return n.$(this.element||this).one(t,i,e)},off:function(t){return n.$(this.element||this).off(t)},trigger:function(t,i){return n.$(this.element||this).trigger(t,i)},find:function(t){return n.$(this.element?this.element:[]).find(t)},proxy:function(t,i){var e=this;i.split(" ").forEach(function(i){e[i]||(e[i]=function(){return t[i].apply(t,arguments)})})},mixin:function(t,i){var e=this;i.split(" ").forEach(function(i){e[i]||(e[i]=t[i].bind(e))})},option:function(){return 1==arguments.length?this.options[arguments[0]]||void 0:(2==arguments.length&&(this.options[arguments[0]]=arguments[1]),void 0)}},e),this.components[t]=o,this[t]=function(){var e,o;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?e=i(arguments[0]):o=arguments[0];break;case 2:e=i(arguments[0]),o=arguments[1]}return e&&e.data(t)?e.data(t):new n.components[t](e,o)},n.domready&&n.component.boot(t),o},n.plugin=function(t,i,e){this.components[t].plugins[i]=e},n.component.boot=function(t){n.components[t].prototype&&n.components[t].prototype.boot&&!n.components[t].booted&&(n.components[t].prototype.boot.apply(n,[]),n.components[t].booted=!0)},n.component.bootComponents=function(){for(var t in n.components)n.component.boot(t)},n.domObservers=[],n.domready=!1,n.ready=function(t){n.domObservers.push(t),n.domready&&t(document)},n.on=function(t,i,e){return t&&t.indexOf("ready.uk.dom")>-1&&n.domready&&i.apply(n.$doc),n.$doc.on(t,i,e)},n.one=function(t,i,e){return t&&t.indexOf("ready.uk.dom")>-1&&n.domready?(i.apply(n.$doc),n.$doc):n.$doc.one(t,i,e)},n.trigger=function(t,i){return n.$doc.trigger(t,i)},n.domObserve=function(t,i){n.support.mutationobserver&&(i=i||function(){},n.$(t).each(function(){var t=this,e=n.$(t);if(!e.data("observer"))try{var o=new n.support.mutationobserver(n.Utils.debounce(function(){i.apply(t,[]),e.trigger("changed.uk.dom")},50),{childList:!0,subtree:!0});o.observe(t,{childList:!0,subtree:!0}),e.data("observer",o)}catch(s){}}))},n.init=function(t){t=t||document,n.domObservers.forEach(function(i){i(t)})},n.on("domready.uk.dom",function(){n.init(),n.domready&&n.Utils.checkDisplay()}),document.addEventListener("DOMContentLoaded",function(){var t=function(){n.$body=n.$("body"),n.trigger("beforeready.uk.dom"),n.component.bootComponents();var t=requestAnimationFrame(function(){var i={dir:{x:0,y:0},x:window.pageXOffset,y:window.pageYOffset},e=function(){var o=window.pageXOffset,s=window.pageYOffset;(i.x!=o||i.y!=s)&&(i.dir.x=o!=i.x?o>i.x?1:-1:0,i.dir.y=s!=i.y?s>i.y?1:-1:0,i.x=o,i.y=s,n.$doc.trigger("scrolling.uk.document",[{dir:{x:i.dir.x,y:i.dir.y},x:o,y:s}])),cancelAnimationFrame(t),t=requestAnimationFrame(e)};return n.support.touch&&n.$html.on("touchmove touchend MSPointerMove MSPointerUp pointermove pointerup",e),(i.x||i.y)&&e(),e}());if(n.trigger("domready.uk.dom"),n.support.touch&&navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&n.$win.on("load orientationchange resize",n.Utils.debounce(function(){var t=function(){return i(".uk-height-viewport").css("height",window.innerHeight),t};return t()}(),100)),n.trigger("afterready.uk.dom"),n.domready=!0,n.support.mutationobserver){var e=n.Utils.debounce(function(){requestAnimationFrame(function(){n.init(document.body)})},10);new n.support.mutationobserver(function(t){var i=!1;t.every(function(t){if("childList"!=t.type)return!0;for(var e,n=0;n=Math.abs(e-n)?t-i>0?"Left":"Right":e-n>0?"Up":"Down"}function e(){c=null,h.last&&(void 0!==h.el&&h.el.trigger("longTap"),h={})}function n(){c&&clearTimeout(c),c=null}function o(){a&&clearTimeout(a),r&&clearTimeout(r),l&&clearTimeout(l),c&&clearTimeout(c),a=r=l=c=null,h={}}function s(t){return t.pointerType==t.MSPOINTER_TYPE_TOUCH&&t.isPrimary}if(!t.fn.swipeLeft){var a,r,l,c,u,h={},d=750;t(function(){var p,f,m,g=0,v=0;"MSGesture"in window&&(u=new MSGesture,u.target=document.body),t(document).on("MSGestureEnd gestureend",function(t){var i=t.originalEvent.velocityX>1?"Right":t.originalEvent.velocityX<-1?"Left":t.originalEvent.velocityY>1?"Down":t.originalEvent.velocityY<-1?"Up":null;i&&void 0!==h.el&&(h.el.trigger("swipe"),h.el.trigger("swipe"+i))}).on("touchstart MSPointerDown pointerdown",function(i){("MSPointerDown"!=i.type||s(i.originalEvent))&&(m="MSPointerDown"==i.type||"pointerdown"==i.type?i:i.originalEvent.touches[0],p=Date.now(),f=p-(h.last||p),h.el=t("tagName"in m.target?m.target:m.target.parentNode),a&&clearTimeout(a),h.x1=m.pageX,h.y1=m.pageY,f>0&&250>=f&&(h.isDoubleTap=!0),h.last=p,c=setTimeout(e,d),!u||"MSPointerDown"!=i.type&&"pointerdown"!=i.type&&"touchstart"!=i.type||u.addPointer(i.originalEvent.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){("MSPointerMove"!=t.type||s(t.originalEvent))&&(m="MSPointerMove"==t.type||"pointermove"==t.type?t:t.originalEvent.touches[0],n(),h.x2=m.pageX,h.y2=m.pageY,g+=Math.abs(h.x1-h.x2),v+=Math.abs(h.y1-h.y2))}).on("touchend MSPointerUp pointerup",function(e){("MSPointerUp"!=e.type||s(e.originalEvent))&&(n(),h.x2&&Math.abs(h.x1-h.x2)>30||h.y2&&Math.abs(h.y1-h.y2)>30?l=setTimeout(function(){void 0!==h.el&&(h.el.trigger("swipe"),h.el.trigger("swipe"+i(h.x1,h.x2,h.y1,h.y2))),h={}},0):"last"in h&&(isNaN(g)||30>g&&30>v?r=setTimeout(function(){var i=t.Event("tap");i.cancelTouch=o,void 0!==h.el&&h.el.trigger(i),h.isDoubleTap?(void 0!==h.el&&h.el.trigger("doubleTap"),h={}):a=setTimeout(function(){a=null,void 0!==h.el&&h.el.trigger("singleTap"),h={}},250)},0):h={},g=v=0))}).on("touchcancel MSPointerCancel",o),t(window).on("scroll",o)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(i){t.fn[i]=function(e){return t(this).on(i,e)}})}}(jQuery),function(t){"use strict";var i=[];t.component("stackMargin",{defaults:{cls:"uk-margin-small-top",rowfirst:!1,observe:!1},boot:function(){t.ready(function(i){t.$("[data-uk-margin]",i).each(function(){var i=t.$(this);i.data("stackMargin")||t.stackMargin(i,t.Utils.options(i.attr("data-uk-margin")))})})},init:function(){var e=this;t.$win.on("resize orientationchange",function(){var i=function(){e.process()};return t.$(function(){i(),t.$win.on("load",i)}),t.Utils.debounce(i,20)}()),this.on("display.uk.check",function(){this.element.is(":visible")&&this.process()}.bind(this)),this.options.observe&&t.domObserve(this.element,function(){e.element.is(":visible")&&e.process()}),i.push(this)},process:function(){var i=this.element.children();if(t.Utils.stackMargin(i,this.options),!this.options.rowfirst||!i.length)return this;var e={},n=!1;return i.removeClass(this.options.rowfirst).each(function(i,o){o=t.$(this),"none"!=this.style.display&&(i=o.offset().left,((e[i]=e[i]||[])&&e[i]).push(this),n=n===!1?i:Math.min(n,i))}),t.$(e[n]).addClass(this.options.rowfirst),this}}),function(){var i=[],e=function(t){if(t.is(":visible")){var i=t.parent().width(),e=t.data("width"),n=i/e,o=Math.floor(n*t.data("height"));t.css({height:e>i?o:t.data("height")})}};t.component("responsiveElement",{defaults:{},boot:function(){t.ready(function(i){t.$("iframe.uk-responsive-width, [data-uk-responsive]",i).each(function(){var i,e=t.$(this);e.data("responsiveElement")||(i=t.responsiveElement(e,{}))})})},init:function(){var t=this.element;t.attr("width")&&t.attr("height")&&(t.data({width:t.attr("width"),height:t.attr("height")}).on("display.uk.check",function(){e(t)}),e(t),i.push(t))}}),t.$win.on("resize load",t.Utils.debounce(function(){i.forEach(function(t){e(t)})},15))}(),t.Utils.stackMargin=function(i,e){e=t.$.extend({cls:"uk-margin-small-top"},e),i=t.$(i).removeClass(e.cls);var n=!1;i.each(function(i,e,o,s){s=t.$(this),"none"!=s.css("display")&&(i=s.offset(),e=s.outerHeight(),o=i.top+e,s.data({ukMarginPos:o,ukMarginTop:i.top}),(n===!1||i.topn.top&&i.data("ukMarginPos")>n.pos&&i.addClass(e.cls)})},t.Utils.matchHeights=function(i,e){i=t.$(i).css("min-height",""),e=t.$.extend({row:!0},e);var n=function(i){if(!(i.length<2)){var e=0;i.each(function(){e=Math.max(e,t.$(this).outerHeight())}).each(function(){var i=t.$(this),n=e-("border-box"==i.css("box-sizing")?0:i.outerHeight()-i.height());i.css("min-height",n+"px")})}};e.row?(i.first().width(),setTimeout(function(){var e=!1,o=[];i.each(function(){var i=t.$(this),s=i.offset().top;s!=e&&o.length&&(n(t.$(o)),o=[],s=i.offset().top),o.push(i),e=s}),o.length&&n(t.$(o))},0)):n(i)},function(i){t.Utils.inlineSvg=function(e,n){t.$(e||'img[src$=".svg"]',n||document).each(function(){var e=t.$(this),n=e.attr("src");if(!i[n]){var o=t.$.Deferred();t.$.get(n,{nc:Math.random()},function(i){o.resolve(t.$(i).find("svg"))}),i[n]=o.promise()}i[n].then(function(i){var n=t.$(i).clone();e.attr("id")&&n.attr("id",e.attr("id")),e.attr("class")&&n.attr("class",e.attr("class")),e.attr("style")&&n.attr("style",e.attr("style")),e.attr("width")&&(n.attr("width",e.attr("width")),e.attr("height")||n.removeAttr("height")),e.attr("height")&&(n.attr("height",e.attr("height")),e.attr("width")||n.removeAttr("width")),e.replaceWith(n)})})},t.ready(function(i){t.Utils.inlineSvg("[data-uk-svg]",i)})}({})}(UIkit),function(t){"use strict";function i(i,e){e=t.$.extend({duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},e);var n=i.offset().top-e.offset,o=t.$doc.height(),s=window.innerHeight;n+s>o&&(n=o-s),t.$("html,body").stop().animate({scrollTop:n},e.duration,e.transition).promise().done(e.complete)}t.component("smoothScroll",{boot:function(){t.$html.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(){var i=t.$(this);if(!i.data("smoothScroll")){{t.smoothScroll(i,t.Utils.options(i.attr("data-uk-smooth-scroll")))}i.trigger("click")}return!1})},init:function(){var e=this;this.on("click",function(n){n.preventDefault(),i(t.$(this.hash).length?t.$(this.hash):t.$("body"),e.options)})}}),t.Utils.scrollToElement=i,t.$.easing.easeOutExpo||(t.$.easing.easeOutExpo=function(t,i,e,n,o){return i==o?e+n:n*(-Math.pow(2,-10*i/o)+1)+e})}(UIkit),function(t){"use strict";var i=t.$win,e=t.$doc,n=[],o=function(){for(var t=0;t=u)return e[t]}();if(!h)return;c.options.closest?(o.blur().closest(l).removeClass(r),s=o.filter("a[href='#"+h.attr("id")+"']").closest(l).addClass(r)):s=o.removeClass(r).filter("a[href='#"+h.attr("id")+"']").addClass(r),c.element.trigger("inview.uk.scrollspynav",[h,s])}};this.options.smoothscroll&&t.smoothScroll&&o.each(function(){t.smoothScroll(this,c.options.smoothscroll)}),u(),this.element.data("scrollspynav",this),this.check=u,s.push(this)}})}(UIkit),function(t){"use strict";var i=[];t.component("toggle",{defaults:{target:!1,cls:"uk-hidden",animation:!1,duration:200},boot:function(){t.ready(function(e){t.$("[data-uk-toggle]",e).each(function(){var i=t.$(this);if(!i.data("toggle")){t.toggle(i,t.Utils.options(i.attr("data-uk-toggle")))}}),setTimeout(function(){i.forEach(function(t){t.getToggles()})},0)})},init:function(){var t=this;this.aria=-1!==this.options.cls.indexOf("uk-hidden"),this.getToggles(),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle()}),i.push(this)},toggle:function(){if(this.totoggle.length){if(this.options.animation&&t.support.animation){var i=this,e=this.options.animation.split(",");1==e.length&&(e[1]=e[0]),e[0]=e[0].trim(),e[1]=e[1].trim(),this.totoggle.css("animation-duration",this.options.duration+"ms"),this.totoggle.each(function(){var n=t.$(this);n.hasClass(i.options.cls)?(n.toggleClass(i.options.cls),t.Utils.animate(n,e[0]).then(function(){n.css("animation-duration",""),t.Utils.checkDisplay(n)})):t.Utils.animate(this,e[1]+" uk-animation-reverse").then(function(){n.toggleClass(i.options.cls).css("animation-duration",""),t.Utils.checkDisplay(n)})})}else this.totoggle.toggleClass(this.options.cls),t.Utils.checkDisplay(this.totoggle);this.updateAria()}},getToggles:function(){this.totoggle=this.options.target?t.$(this.options.target):[],this.updateAria()},updateAria:function(){this.aria&&this.totoggle.length&&this.totoggle.each(function(){t.$(this).attr("aria-hidden",t.$(this).hasClass("uk-hidden"))})}})}(UIkit),function(t){"use strict";t.component("alert",{defaults:{fade:!0,duration:200,trigger:".uk-alert-close"},boot:function(){t.$html.on("click.alert.uikit","[data-uk-alert]",function(i){var e=t.$(this);if(!e.data("alert")){var n=t.alert(e,t.Utils.options(e.attr("data-uk-alert")));t.$(i.target).is(n.options.trigger)&&(i.preventDefault(),n.close())}})},init:function(){var t=this;this.on("click",this.options.trigger,function(i){i.preventDefault(),t.close()})},close:function(){var t=this.trigger("close.uk.alert"),i=function(){this.trigger("closed.uk.alert").remove()}.bind(this);this.options.fade?t.css("overflow","hidden").css("max-height",t.height()).animate({height:0,opacity:0,"padding-top":0,"padding-bottom":0,"margin-top":0,"margin-bottom":0},this.options.duration,i):i()}})}(UIkit),function(t){"use strict";t.component("buttonRadio",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttonradio.uikit","[data-uk-button-radio]",function(i){var e=t.$(this);if(!e.data("buttonRadio")){var n=t.buttonRadio(e,t.Utils.options(e.attr("data-uk-button-radio"))),o=t.$(i.target);o.is(n.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(e){var n=t.$(this);n.is('a[href="#"]')&&e.preventDefault(),i.find(i.options.target).not(n).removeClass(i.options.activeClass).blur(),n.addClass(i.options.activeClass),i.find(i.options.target).not(n).attr("aria-checked","false"),n.attr("aria-checked","true"),i.trigger("change.uk.button",[n])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("buttonCheckbox",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttoncheckbox.uikit","[data-uk-button-checkbox]",function(i){var e=t.$(this);if(!e.data("buttonCheckbox")){var n=t.buttonCheckbox(e,t.Utils.options(e.attr("data-uk-button-checkbox"))),o=t.$(i.target);o.is(n.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(e){var n=t.$(this);n.is('a[href="#"]')&&e.preventDefault(),n.toggleClass(i.options.activeClass).blur(),n.attr("aria-checked",n.hasClass(i.options.activeClass)),i.trigger("change.uk.button",[n])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("button",{defaults:{},boot:function(){t.$html.on("click.button.uikit","[data-uk-button]",function(){var i=t.$(this);if(!i.data("button")){{t.button(i,t.Utils.options(i.attr("data-uk-button")))}i.trigger("click")}})},init:function(){var t=this;this.element.attr("aria-pressed",this.element.hasClass("uk-active")),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle(),t.trigger("change.uk.button",[t.element.blur().hasClass("uk-active")])})},toggle:function(){this.element.toggleClass("uk-active"),this.element.attr("aria-pressed",this.element.hasClass("uk-active"))}})}(UIkit),function(t){"use strict";function i(i,e,n,o){if(i=t.$(i),e=t.$(e),n=n||window.innerWidth,o=o||i.offset(),e.length){var s=e.outerWidth();if(i.css("min-width",s),"right"==t.langdirection){var a=n-(e.offset().left+s),r=n-(i.offset().left+i.outerWidth());i.css("margin-right",a-r)}else i.css("margin-left",e.offset().left-o.left)}}var e,n=!1,o={x:{"bottom-left":"bottom-right","bottom-right":"bottom-left","bottom-center":"bottom-center","top-left":"top-right","top-right":"top-left","top-center":"top-center","left-top":"right-top","left-bottom":"right-bottom","left-center":"right-center","right-top":"left-top","right-bottom":"left-bottom","right-center":"left-center"},y:{"bottom-left":"top-left","bottom-right":"top-right","bottom-center":"top-center","top-left":"bottom-left","top-right":"bottom-right","top-center":"bottom-center","left-top":"left-bottom","left-bottom":"left-top","left-center":"left-center","right-top":"right-bottom","right-bottom":"right-top","right-center":"right-center"},xy:{"bottom-left":"top-right","bottom-right":"top-left","bottom-center":"top-center","top-left":"bottom-right","top-right":"bottom-left","top-center":"bottom-center","left-top":"right-bottom","left-bottom":"right-top","left-center":"right-center","right-top":"left-bottom","right-bottom":"left-top","right-center":"left-center"}};t.component("dropdown",{defaults:{mode:"hover",pos:"bottom-left",offset:0,remaintime:800,justify:!1,boundary:t.$win,delay:0,dropdownSelector:".uk-dropdown,.uk-dropdown-blank",hoverDelayIdle:250,preventflip:!1},remainIdle:!1,boot:function(){var i=t.support.touch?"click":"mouseenter";t.$html.on(i+".dropdown.uikit","[data-uk-dropdown]",function(e){var n=t.$(this);if(!n.data("dropdown")){var o=t.dropdown(n,t.Utils.options(n.attr("data-uk-dropdown")));("click"==i||"mouseenter"==i&&"hover"==o.options.mode)&&o.element.trigger(i),o.element.find(o.options.dropdownSelector).length&&e.preventDefault()}})},init:function(){var i=this;this.dropdown=this.find(this.options.dropdownSelector),this.offsetParent=this.dropdown.parents().filter(function(){return-1!==t.$.inArray(t.$(this).css("position"),["relative","fixed","absolute"])}).slice(0,1),this.centered=this.dropdown.hasClass("uk-dropdown-center"),this.justified=this.options.justify?t.$(this.options.justify):!1,this.boundary=t.$(this.options.boundary),this.boundary.length||(this.boundary=t.$win),this.dropdown.hasClass("uk-dropdown-up")&&(this.options.pos="top-left"),this.dropdown.hasClass("uk-dropdown-flip")&&(this.options.pos=this.options.pos.replace("left","right")),this.dropdown.hasClass("uk-dropdown-center")&&(this.options.pos=this.options.pos.replace(/(left|right)/,"center")),this.element.attr("aria-haspopup","true"),this.element.attr("aria-expanded",this.element.hasClass("uk-open")),"click"==this.options.mode||t.support.touch?this.on("click.uk.dropdown",function(e){var n=t.$(e.target);n.parents(i.options.dropdownSelector).length||((n.is("a[href='#']")||n.parent().is("a[href='#']")||i.dropdown.length&&!i.dropdown.is(":visible"))&&e.preventDefault(),n.blur()),i.element.hasClass("uk-open")?(!i.dropdown.find(e.target).length||n.is(".uk-dropdown-close")||n.parents(".uk-dropdown-close").length)&&i.hide():i.show()}):this.on("mouseenter",function(){i.trigger("pointerenter.uk.dropdown",[i]),i.remainIdle&&clearTimeout(i.remainIdle),e&&clearTimeout(e),n&&n==i||(e=n&&n!=i?setTimeout(function(){e=setTimeout(i.show.bind(i),i.options.delay)},i.options.hoverDelayIdle):setTimeout(i.show.bind(i),i.options.delay))}).on("mouseleave",function(){e&&clearTimeout(e),i.remainIdle=setTimeout(function(){n&&n==i&&i.hide()},i.options.remaintime),i.trigger("pointerleave.uk.dropdown",[i])}).on("click",function(e){var o=t.$(e.target);return i.remainIdle&&clearTimeout(i.remainIdle),n&&n==i?((!i.dropdown.find(e.target).length||o.is(".uk-dropdown-close")||o.parents(".uk-dropdown-close").length)&&i.hide(),void 0):((o.is("a[href='#']")||o.parent().is("a[href='#']"))&&e.preventDefault(),i.show(),void 0)})},show:function(){t.$html.off("click.outer.dropdown"),n&&n!=this&&n.hide(!0),e&&clearTimeout(e),this.trigger("beforeshow.uk.dropdown",[this]),this.checkDimensions(),this.element.addClass("uk-open"),this.element.attr("aria-expanded","true"),this.trigger("show.uk.dropdown",[this]),t.Utils.checkDisplay(this.dropdown,!0),n=this,this.registerOuterClick()},hide:function(t){this.trigger("beforehide.uk.dropdown",[this,t]),this.element.removeClass("uk-open"),this.remainIdle&&clearTimeout(this.remainIdle),this.remainIdle=!1,this.element.attr("aria-expanded","false"),this.trigger("hide.uk.dropdown",[this,t]),n==this&&(n=!1)},registerOuterClick:function(){var i=this;t.$html.off("click.outer.dropdown"),setTimeout(function(){t.$html.on("click.outer.dropdown",function(o){e&&clearTimeout(e);t.$(o.target);n!=i||i.element.find(o.target).length||(i.hide(!0),t.$html.off("click.outer.dropdown"))})},10)},checkDimensions:function(){if(this.dropdown.length){this.dropdown.removeClass("uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack").css({"top-left":"",left:"","margin-left":"","margin-right":""}),this.justified&&this.justified.length&&this.dropdown.css("min-width","");var e,n=t.$.extend({},this.offsetParent.offset(),{width:this.offsetParent[0].offsetWidth,height:this.offsetParent[0].offsetHeight}),s=this.options.offset,a=this.dropdown,r=(a.show().offset()||{left:0,top:0},a.outerWidth()),l=a.outerHeight(),c=this.boundary.width(),u=(this.boundary[0]!==window&&this.boundary.offset()?this.boundary.offset():{top:0,left:0},this.options.pos),h={"bottom-left":{top:0+n.height+s,left:0},"bottom-right":{top:0+n.height+s,left:0+n.width-r},"bottom-center":{top:0+n.height+s,left:0+n.width/2-r/2},"top-left":{top:0-l-s,left:0},"top-right":{top:0-l-s,left:0+n.width-r},"top-center":{top:0-l-s,left:0+n.width/2-r/2},"left-top":{top:0,left:0-r-s},"left-bottom":{top:0+n.height-l,left:0-r-s},"left-center":{top:0+n.height/2-l/2,left:0-r-s},"right-top":{top:0,left:0+n.width+s},"right-bottom":{top:0+n.height-l,left:0+n.width+s},"right-center":{top:0+n.height/2-l/2,left:0+n.width+s}},d={};if(e=u.split("-"),d=h[u]?h[u]:h["bottom-left"],this.justified&&this.justified.length)i(a.css({left:0}),this.justified,c);else if(this.options.preventflip!==!0){var p;switch(this.checkBoundary(n.left+d.left,n.top+d.top,r,l,c)){case"x":"x"!==this.options.preventflip&&(p=o.x[u]||"right-top");break;case"y":"y"!==this.options.preventflip&&(p=o.y[u]||"top-left");break;case"xy":this.options.preventflip||(p=o.xy[u]||"right-bottom")}p&&(e=p.split("-"),d=h[p]?h[p]:h["bottom-left"],this.checkBoundary(n.left+d.left,n.top+d.top,r,l,c)&&(e=u.split("-"),d=h[u]?h[u]:h["bottom-left"]))}r>c&&(a.addClass("uk-dropdown-stack"),this.trigger("stack.uk.dropdown",[this])),a.css(d).css("display","").addClass("uk-dropdown-"+e[0]) -}},checkBoundary:function(i,e,n,o,s){var a="";return(0>i||i-t.$win.scrollLeft()+n>s)&&(a+="x"),(e-t.$win.scrollTop()<0||e-t.$win.scrollTop()+o>window.innerHeight)&&(a+="y"),a}}),t.component("dropdownOverlay",{defaults:{justify:!1,cls:"",duration:200},boot:function(){t.ready(function(i){t.$("[data-uk-dropdown-overlay]",i).each(function(){var i=t.$(this);i.data("dropdownOverlay")||t.dropdownOverlay(i,t.Utils.options(i.attr("data-uk-dropdown-overlay")))})})},init:function(){var e=this;this.justified=this.options.justify?t.$(this.options.justify):!1,this.overlay=this.element.find("uk-dropdown-overlay"),this.overlay.length||(this.overlay=t.$('
                ').appendTo(this.element)),this.overlay.addClass(this.options.cls),this.on({"beforeshow.uk.dropdown":function(t,n){e.dropdown=n,e.justified&&e.justified.length&&i(e.overlay.css({display:"block","margin-left":"","margin-right":""}),e.justified,e.justified.outerWidth())},"show.uk.dropdown":function(){var i=e.dropdown.dropdown.outerHeight(!0);e.dropdown.element.removeClass("uk-open"),e.overlay.stop().css("display","block").animate({height:i},e.options.duration,function(){e.dropdown.dropdown.css("visibility",""),e.dropdown.element.addClass("uk-open"),t.Utils.checkDisplay(e.dropdown.dropdown,!0)}),e.pointerleave=!1},"hide.uk.dropdown":function(){e.overlay.stop().animate({height:0},e.options.duration)},"pointerenter.uk.dropdown":function(){clearTimeout(e.remainIdle)},"pointerleave.uk.dropdown":function(){e.pointerleave=!0}}),this.overlay.on({mouseenter:function(){e.remainIdle&&(clearTimeout(e.dropdown.remainIdle),clearTimeout(e.remainIdle))},mouseleave:function(){e.pointerleave&&n&&(e.remainIdle=setTimeout(function(){n&&n.hide()},n.options.remaintime))}})}})}(UIkit),function(t){"use strict";var i=[];t.component("gridMatchHeight",{defaults:{target:!1,row:!0,ignorestacked:!1,observe:!1},boot:function(){t.ready(function(i){t.$("[data-uk-grid-match]",i).each(function(){var i,e=t.$(this);e.data("gridMatchHeight")||(i=t.gridMatchHeight(e,t.Utils.options(e.attr("data-uk-grid-match"))))})})},init:function(){var e=this;this.columns=this.element.children(),this.elements=this.options.target?this.find(this.options.target):this.columns,this.columns.length&&(t.$win.on("load resize orientationchange",function(){var i=function(){e.element.is(":visible")&&e.match()};return t.$(function(){i()}),t.Utils.debounce(i,50)}()),this.options.observe&&t.domObserve(this.element,function(){e.element.is(":visible")&&e.match()}),this.on("display.uk.check",function(){this.element.is(":visible")&&this.match()}.bind(this)),i.push(this))},match:function(){var i=this.columns.filter(":visible:first");if(i.length){var e=Math.ceil(100*parseFloat(i.css("width"))/parseFloat(i.parent().css("width")))>=100;return e&&!this.options.ignorestacked?this.revert():t.Utils.matchHeights(this.elements,this.options),this}},revert:function(){return this.elements.css("min-height",""),this}}),t.component("gridMargin",{defaults:{cls:"uk-grid-margin",rowfirst:"uk-row-first"},boot:function(){t.ready(function(i){t.$("[data-uk-grid-margin]",i).each(function(){var i,e=t.$(this);e.data("gridMargin")||(i=t.gridMargin(e,t.Utils.options(e.attr("data-uk-grid-margin"))))})})},init:function(){t.stackMargin(this.element,this.options)}})}(UIkit),function(t){"use strict";function i(i,e){return e?("object"==typeof i?(i=i instanceof jQuery?i:t.$(i),i.parent().length&&(e.persist=i,e.persist.data("modalPersistParent",i.parent()))):i="string"==typeof i||"number"==typeof i?t.$("
                ").html(i):t.$("
                ").html("UIkit.modal Error: Unsupported data type: "+typeof i),i.appendTo(e.element.find(".uk-modal-dialog")),e):void 0}var e,n=!1,o=0,s=t.$html;t.$win.on("resize orientationchange",t.Utils.debounce(function(){t.$(".uk-modal.uk-open").each(function(){t.$(this).data("modal").resize()})},150)),t.component("modal",{defaults:{keyboard:!0,bgclose:!0,minScrollHeight:150,center:!1,modal:!0},scrollable:!1,transition:!1,hasTransitioned:!0,init:function(){if(e||(e=t.$("body")),this.element.length){var i=this;this.paddingdir="padding-"+("left"==t.langdirection?"right":"left"),this.dialog=this.find(".uk-modal-dialog"),this.active=!1,this.element.attr("aria-hidden",this.element.hasClass("uk-open")),this.on("click",".uk-modal-close",function(t){t.preventDefault(),i.hide()}).on("click",function(e){var n=t.$(e.target);n[0]==i.element[0]&&i.options.bgclose&&i.hide()}),t.domObserve(this.element,function(){i.resize()})}},toggle:function(){return this[this.isActive()?"hide":"show"]()},show:function(){if(this.element.length){var i=this;if(!this.isActive())return this.options.modal&&n&&n.hide(!0),this.element.removeClass("uk-open").show(),this.resize(!0),this.options.modal&&(n=this),this.active=!0,o++,t.support.transition?(this.hasTransitioned=!1,this.element.one(t.support.transition.end,function(){i.hasTransitioned=!0}).addClass("uk-open")):this.element.addClass("uk-open"),s.addClass("uk-modal-page").height(),this.element.attr("aria-hidden","false"),this.element.trigger("show.uk.modal"),t.Utils.checkDisplay(this.dialog,!0),this}},hide:function(i){if(!i&&t.support.transition&&this.hasTransitioned){var e=this;this.one(t.support.transition.end,function(){e._hide()}).removeClass("uk-open")}else this._hide();return this},resize:function(t){if(this.isActive()||t){var i=e.width();if(this.scrollbarwidth=window.innerWidth-i,e.css(this.paddingdir,this.scrollbarwidth),this.element.css("overflow-y",this.scrollbarwidth?"scroll":"auto"),!this.updateScrollable()&&this.options.center){var n=this.dialog.outerHeight(),o=parseInt(this.dialog.css("margin-top"),10)+parseInt(this.dialog.css("margin-bottom"),10);n+oi?20:i)-e;return t.css({"max-height":o0?o--:o=0,this.element.hide().removeClass("uk-open"),this.element.attr("aria-hidden","true"),o||(s.removeClass("uk-modal-page"),e.css(this.paddingdir,"")),n===this&&(n=!1),this.trigger("hide.uk.modal")},isActive:function(){return this.element.hasClass("uk-open")}}),t.component("modalTrigger",{boot:function(){t.$html.on("click.modal.uikit","[data-uk-modal]",function(i){var e=t.$(this);if(e.is("a")&&i.preventDefault(),!e.data("modalTrigger")){var n=t.modalTrigger(e,t.Utils.options(e.attr("data-uk-modal")));n.show()}}),t.$html.on("keydown.modal.uikit",function(t){n&&27===t.keyCode&&n.options.keyboard&&(t.preventDefault(),n.hide())})},init:function(){var i=this;this.options=t.$.extend({target:i.element.is("a")?i.element.attr("href"):!1},this.options),this.modal=t.modal(this.options.target,this.options),this.on("click",function(t){t.preventDefault(),i.show()}),this.proxy(this.modal,"show hide isActive")}}),t.modal.dialog=function(e,n){var o=t.modal(t.$(t.modal.dialog.template).appendTo("body"),n);return o.on("hide.uk.modal",function(){o.persist&&(o.persist.appendTo(o.persist.data("modalPersistParent")),o.persist=!1),o.element.remove()}),i(e,o),o},t.modal.dialog.template='
                ',t.modal.alert=function(i,e){e=t.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:t.modal.labels},e);var n=t.modal.dialog(['
                '+String(i)+"
                ",'"].join(""),e);return n.on("show.uk.modal",function(){setTimeout(function(){n.element.find("button:first").focus()},50)}),n.show()},t.modal.confirm=function(i,e,n){var o=arguments.length>1&&arguments[arguments.length-1]?arguments[arguments.length-1]:{};e=t.$.isFunction(e)?e:function(){},n=t.$.isFunction(n)?n:function(){},o=t.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:t.modal.labels},t.$.isFunction(o)?{}:o);var s=t.modal.dialog(['
                '+String(i)+"
                ",'"].join(""),o);return s.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click",function(){t.$(this).is(".js-modal-confirm")?e():n(),s.hide()}),s.on("show.uk.modal",function(){setTimeout(function(){s.element.find(".js-modal-confirm").focus()},50)}),s.show()},t.modal.prompt=function(i,e,n,o){n=t.$.isFunction(n)?n:function(){},o=t.$.extend(!0,{bgclose:!1,keyboard:!1,modal:!1,labels:t.modal.labels},o);var s=t.modal.dialog([i?'
                '+String(i)+"
                ":"",'

                ','"].join(""),o),a=s.element.find("input[type='text']").val(e||"").on("keyup",function(t){13==t.keyCode&&s.element.find(".js-modal-ok").trigger("click")});return s.element.find(".js-modal-ok").on("click",function(){n(a.val())!==!1&&s.hide()}),s.on("show.uk.modal",function(){setTimeout(function(){a.focus()},50)}),s.show()},t.modal.blockUI=function(i,e){var n=t.modal.dialog(['
                '+String(i||'
                ...
                ')+"
                "].join(""),t.$.extend({bgclose:!1,keyboard:!1,modal:!1},e));return n.content=n.element.find(".uk-modal-content:first"),n.show()},t.modal.labels={Ok:"Ok",Cancel:"Cancel"}}(UIkit),function(t){"use strict";function i(i){var e=t.$(i),n="auto";if(e.is(":visible"))n=e.outerHeight();else{var o={position:e.css("position"),visibility:e.css("visibility"),display:e.css("display")};n=e.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),e.css(o)}return n}t.component("nav",{defaults:{toggle:">li.uk-parent > a[href='#']",lists:">li.uk-parent > ul",multiple:!1},boot:function(){t.ready(function(i){t.$("[data-uk-nav]",i).each(function(){var i=t.$(this);if(!i.data("nav")){t.nav(i,t.Utils.options(i.attr("data-uk-nav")))}})})},init:function(){var i=this;this.on("click.uk.nav",this.options.toggle,function(e){e.preventDefault();var n=t.$(this);i.open(n.parent()[0]==i.element[0]?n:n.parent("li"))}),this.find(this.options.lists).each(function(){var e=t.$(this),n=e.parent(),o=n.hasClass("uk-active");e.wrap('
                '),n.data("list-container",e.parent()[o?"removeClass":"addClass"]("uk-hidden")),n.attr("aria-expanded",n.hasClass("uk-open")),o&&i.open(n,!0)})},open:function(e,n){var o=this,s=this.element,a=t.$(e),r=a.data("list-container");this.options.multiple||s.children(".uk-open").not(e).each(function(){var i=t.$(this);i.data("list-container")&&i.data("list-container").stop().animate({height:0},function(){t.$(this).parent().removeClass("uk-open").end().addClass("uk-hidden")})}),a.toggleClass("uk-open"),a.attr("aria-expanded",a.hasClass("uk-open")),r&&(a.hasClass("uk-open")&&r.removeClass("uk-hidden"),n?(r.stop().height(a.hasClass("uk-open")?"auto":0),a.hasClass("uk-open")||r.addClass("uk-hidden"),this.trigger("display.uk.check")):r.stop().animate({height:a.hasClass("uk-open")?i(r.find("ul:first")):0},function(){a.hasClass("uk-open")?r.css("height",""):r.addClass("uk-hidden"),o.trigger("display.uk.check")}))}})}(UIkit),function(t){"use strict";var i={x:window.scrollX,y:window.scrollY},e=(t.$win,t.$doc,t.$html),n={show:function(n){if(n=t.$(n),n.length){var o=t.$("body"),s=n.find(".uk-offcanvas-bar:first"),a="right"==t.langdirection,r=s.hasClass("uk-offcanvas-bar-flip")?-1:1,l=r*(a?-1:1),c=window.innerWidth-o.width();i={x:window.pageXOffset,y:window.pageYOffset},n.addClass("uk-active"),o.css({width:window.innerWidth-c,height:window.innerHeight}).addClass("uk-offcanvas-page"),o.css(a?"margin-right":"margin-left",(a?-1:1)*s.outerWidth()*l).width(),e.css("margin-top",-1*i.y),s.addClass("uk-offcanvas-bar-show"),this._initElement(n),s.trigger("show.uk.offcanvas",[n,s]),n.attr("aria-hidden","false")}},hide:function(n){var o=t.$("body"),s=t.$(".uk-offcanvas.uk-active"),a="right"==t.langdirection,r=s.find(".uk-offcanvas-bar:first"),l=function(){o.removeClass("uk-offcanvas-page").css({width:"",height:"","margin-left":"","margin-right":""}),s.removeClass("uk-active"),r.removeClass("uk-offcanvas-bar-show"),e.css("margin-top",""),window.scrollTo(i.x,i.y),r.trigger("hide.uk.offcanvas",[s,r]),s.attr("aria-hidden","true")};s.length&&(t.support.transition&&!n?(o.one(t.support.transition.end,function(){l()}).css(a?"margin-right":"margin-left",""),setTimeout(function(){r.removeClass("uk-offcanvas-bar-show")},0)):l())},_initElement:function(i){i.data("OffcanvasInit")||(i.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas",function(i){var e=t.$(i.target);if(!i.type.match(/swipe/)&&!e.hasClass("uk-offcanvas-close")){if(e.hasClass("uk-offcanvas-bar"))return;if(e.parents(".uk-offcanvas-bar:first").length)return}i.stopImmediatePropagation(),n.hide()}),i.on("click","a[href*='#']",function(){var i=t.$(this),e=i.attr("href");"#"!=e&&(t.$doc.one("hide.uk.offcanvas",function(){var n;try{n=t.$(i[0].hash)}catch(o){n=""}n.length||(n=t.$('[name="'+i[0].hash.replace("#","")+'"]')),n.length&&t.Utils.scrollToElement?t.Utils.scrollToElement(n,t.Utils.options(i.attr("data-uk-smooth-scroll")||"{}")):window.location.href=e}),n.hide())}),i.data("OffcanvasInit",!0))}};t.component("offcanvasTrigger",{boot:function(){e.on("click.offcanvas.uikit","[data-uk-offcanvas]",function(i){i.preventDefault();var e=t.$(this);if(!e.data("offcanvasTrigger")){{t.offcanvasTrigger(e,t.Utils.options(e.attr("data-uk-offcanvas")))}e.trigger("click")}}),e.on("keydown.uk.offcanvas",function(t){27===t.keyCode&&n.hide()})},init:function(){var i=this;this.options=t.$.extend({target:i.element.is("a")?i.element.attr("href"):!1},this.options),this.on("click",function(t){t.preventDefault(),n.show(i.options.target)})}}),t.offcanvas=n}(UIkit),function(t){"use strict";function i(i,e,n){var o,s=t.$.Deferred(),a=i,r=i;return n[0]===e[0]?(s.resolve(),s.promise()):("object"==typeof i&&(a=i[0],r=i[1]||i[0]),t.$body.css("overflow-x","hidden"),o=function(){e&&e.hide().removeClass("uk-active "+r+" uk-animation-reverse"),n.addClass(a).one(t.support.animation.end,function(){setTimeout(function(){n.removeClass(""+a).css({opacity:"",display:""})},0),s.resolve(),t.$body.css("overflow-x",""),e&&e.css({opacity:"",display:""})}.bind(this)).show()},n.css("animation-duration",this.options.duration+"ms"),e&&e.length?(e.css("animation-duration",this.options.duration+"ms"),e.css("display","none").addClass(r+" uk-animation-reverse").one(t.support.animation.end,function(){o()}.bind(this)).css("display","")):(n.addClass("uk-active"),o()),s.promise())}var e;t.component("switcher",{defaults:{connect:!1,toggle:">*",active:0,animation:!1,duration:200,swiping:!0},animating:!1,boot:function(){t.ready(function(i){t.$("[data-uk-switcher]",i).each(function(){var i=t.$(this);if(!i.data("switcher")){t.switcher(i,t.Utils.options(i.attr("data-uk-switcher")))}})})},init:function(){var i=this;if(this.on("click.uk.switcher",this.options.toggle,function(t){t.preventDefault(),i.show(this)}),this.options.connect){this.connect=t.$(this.options.connect),this.connect.children().removeClass("uk-active"),this.connect.length&&(this.connect.children().attr("aria-hidden","true"),this.connect.on("click","[data-uk-switcher-item]",function(e){e.preventDefault();var n=t.$(this).attr("data-uk-switcher-item");if(i.index!=n)switch(n){case"next":case"previous":i.show(i.index+("next"==n?1:-1));break;default:i.show(parseInt(n,10))}}),this.options.swiping&&this.connect.on("swipeRight swipeLeft",function(t){t.preventDefault(),window.getSelection().toString()||i.show(i.index+("swipeLeft"==t.type?1:-1))}));var e=this.find(this.options.toggle),n=e.filter(".uk-active");if(n.length)this.show(n,!1);else{if(this.options.active===!1)return;n=e.eq(this.options.active),this.show(n.length?n:e.eq(0),!1)}e.not(n).attr("aria-expanded","false"),n.attr("aria-expanded","true")}},show:function(n,o){if(!this.animating){if(isNaN(n))n=t.$(n);else{var s=this.find(this.options.toggle);n=0>n?s.length-1:n,n=s.eq(s[n]?n:0)}var a=this,s=this.find(this.options.toggle),r=t.$(n),l=e[this.options.animation]||function(t,n){if(!a.options.animation)return e.none.apply(a);var o=a.options.animation.split(",");return 1==o.length&&(o[1]=o[0]),o[0]=o[0].trim(),o[1]=o[1].trim(),i.apply(a,[o,t,n])};o!==!1&&t.support.animation||(l=e.none),r.hasClass("uk-disabled")||(s.attr("aria-expanded","false"),r.attr("aria-expanded","true"),s.filter(".uk-active").removeClass("uk-active"),r.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(r),-1==this.index&&(this.index=0),this.connect.each(function(){var i=t.$(this),e=t.$(i.children()),n=t.$(e.filter(".uk-active")),o=t.$(e.eq(a.index));a.animating=!0,l.apply(a,[n,o]).then(function(){n.removeClass("uk-active"),o.addClass("uk-active"),n.attr("aria-hidden","true"),o.attr("aria-hidden","false"),t.Utils.checkDisplay(o,!0),a.animating=!1})})),this.trigger("show.uk.switcher",[r]))}}}),e={none:function(){var i=t.$.Deferred();return i.resolve(),i.promise()},fade:function(t,e){return i.apply(this,["uk-animation-fade",t,e])},"slide-bottom":function(t,e){return i.apply(this,["uk-animation-slide-bottom",t,e])},"slide-top":function(t,e){return i.apply(this,["uk-animation-slide-top",t,e])},"slide-vertical":function(t,e){var n=["uk-animation-slide-top","uk-animation-slide-bottom"];return t&&t.index()>e.index()&&n.reverse(),i.apply(this,[n,t,e])},"slide-left":function(t,e){return i.apply(this,["uk-animation-slide-left",t,e])},"slide-right":function(t,e){return i.apply(this,["uk-animation-slide-right",t,e])},"slide-horizontal":function(t,e){var n=["uk-animation-slide-right","uk-animation-slide-left"];return t&&t.index()>e.index()&&n.reverse(),i.apply(this,[n,t,e])},scale:function(t,e){return i.apply(this,["uk-animation-scale-up",t,e])}},t.switcher.animations=e}(UIkit),function(t){"use strict";t.component("tab",{defaults:{target:">li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0,animation:!1,duration:200,swiping:!0},boot:function(){t.ready(function(i){t.$("[data-uk-tab]",i).each(function(){var i=t.$(this);if(!i.data("tab")){t.tab(i,t.Utils.options(i.attr("data-uk-tab")))}})})},init:function(){var i=this;this.current=!1,this.on("click.uk.tab",this.options.target,function(e){if(e.preventDefault(),!i.switcher||!i.switcher.animating){var n=i.find(i.options.target).not(this);n.removeClass("uk-active").blur(),i.trigger("change.uk.tab",[t.$(this).addClass("uk-active"),i.current]),i.current=t.$(this),i.options.connect||(n.attr("aria-expanded","false"),t.$(this).attr("aria-expanded","true"))}}),this.options.connect&&(this.connect=t.$(this.options.connect)),this.responsivetab=t.$('
              • ').append('
                  '),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click.uk.tab","a",function(e){e.preventDefault(),e.stopPropagation();var n=t.$(this);i.element.children("li:not(.uk-tab-responsive)").eq(n.data("index")).trigger("click")}),this.on("show.uk.switcher change.uk.tab",function(t,e){i.responsivetab.caption.html(e.text())}),this.element.append(this.responsivetab),this.options.connect&&(this.switcher=t.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active,animation:this.options.animation,duration:this.options.duration,swiping:this.options.swiping})),t.dropdown(this.responsivetab,{mode:"click",preventflip:"y"}),i.trigger("change.uk.tab",[this.element.find(this.options.target).not(".uk-tab-responsive").filter(".uk-active")]),this.check(),t.$win.on("resize orientationchange",t.Utils.debounce(function(){i.element.is(":visible")&&i.check()},100)),this.on("display.uk.check",function(){i.element.is(":visible")&&i.check()})},check:function(){var i=this.element.children("li:not(.uk-tab-responsive)").removeClass("uk-hidden");if(!i.length)return this.responsivetab.addClass("uk-hidden"),void 0;var e,n,o,s=i.eq(0).offset().top+Math.ceil(i.eq(0).height()/2),a=!1;if(this.responsivetab.lst.empty(),i.each(function(){t.$(this).offset().top>s&&(a=!0)}),a)for(var r=0;r-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){this.element.css({width:"",height:""}),this.dimension={w:this.element.width(),h:this.element.height()},this.element.attr("width")&&!isNaN(this.element.attr("width"))&&(this.dimension.w=this.element.attr("width")),this.element.attr("height")&&!isNaN(this.element.attr("height"))&&(this.dimension.h=this.element.attr("height")),this.ratio=this.dimension.w/this.dimension.h;var t,i,e=this.parent.width(),n=this.parent.height();e/this.ratio