PageSourceSearch

https://www.florafoodgroup.com/-/media/Base-Themes/Components-Them…92304dfe817b578e9e5fd2c3&t=20250521T030709Z

js florafoodgroup.com collected 2026-09-25 23:36:42 UTC 1,782,886 bytes, 31,040 lines download raw bytes

1/*  accessibility  */
2/**
3 * Component accessibility
4 * makes content more accessible to people with disabilities.
5 * @module Accessibility
6 * @param  {jQuery} $ Instance of jQuery
7 */
8XA.component.accessibility = (function ($) {
9    /**
10    * This object stores all public api methods
11    * @type {Object.<Methods>}
12    * @memberOf module:Accessibility
13    * */
14    var api = {};
15    /**
16        * getAllIndexedElement - returns elements that have tab index attribute
17        * @returns {jQuery<DOMElement>} elements that have tab index attribute
18    */
19    var getAllIndexedElement = function () {
20        return $("body").find("[tabindex]");
21    };
22
23    /**
24        * activateFirstElement - activate first element on a page that have tab index attribute
25        * active element
26        * @returns {String} component name 
27    */
28    api.activateFirstElement = function () {
29        api.indexedElements.eq(0).attr("tabindex", "0");
30    };
31    /**
32       * getComponentName - helper that provides component name based on 
33       * active element
34       * @returns {String} component name 
35   */
36    var getComponentName = function () {
37        var $activeElement = $(document.activeElement),
38            currComponent = $activeElement.closest(".initialized"),
39            componentName = currComponent.length
40                ? currComponent.attr("class").split(" ")[1]
41                : "";
42        return componentName;
43    };
44    /**
45        * getWrapper - helper that provides wrapper element for
46        * active element
47        * @param {String} selector selector of parent wrapper
48        * @returns {jQuery<DOMElement>} 
49    */
50    var getWrapper = function (selector) {
51        var $activeElement = $(document.activeElement);
52        return $activeElement.closest(selector);
53    };
54
55    /**
56        * activateTab - helper for Tabs component
57    */
58    var activateTab = function (direction, currTab) {
59        var activatedTab = currTab;
60        if (direction == "left" && currTab.prev()) {
61            currTab.attr("tabindex", "-1");
62            activatedTab = currTab.prev();
63        } else if (direction == "right" && currTab.next()) {
64            currTab.attr("tabindex", "-1");
65            activatedTab = currTab.next();
66        }
67        activatedTab
68            .attr("tabindex", "0")
69            .trigger("click")
70            .focus();
71    };
72
73    /**
74     * activateItem - helper for Accordion component
75    */
76    var activateItem = function (direction, currItem, event) {
77        var itemWrapper = currItem.closest("li.item"),
78            activatedTab = currItem,
79            nextItem = itemWrapper.next(),
80            prevItem = itemWrapper.prev();
81        if (direction == "down" && nextItem.length) {
82            event.preventDefault();
83            currItem.attr("tabindex", "-1");
84            activatedTab = nextItem;
85            
86        } else if (direction == "up" && prevItem.length) {
87            event.preventDefault();
88            currItem.attr("tabindex", "-1");
89            activatedTab = prevItem;
90        }
91        activatedTab
92            .find(".toggle-header")
93            .attr("tabindex", "0")
94            .focus();
95    };
96
97    /**
98     * toggleFlip - helper for Flip component
99    */
100    var toggleFlip = function (currItem) {
101        var nextItem = currItem.next().length ? currItem.next() : currItem.prev();
102        currItem.attr("tabindex", "-1");
103        nextItem
104            .trigger("click")
105            .attr("tabindex", "0")
106            .focus();
107    };
108
109    /**
110     * componentLogic - object that contains list of components as a object key
111     * and function with logic that make this component WCAG friendly
112     * @type {Object}
113     */
114    var componentLogic = {
115        tabs: function (keyCode) {
116            var currTab = getWrapper("li.active");
117            if (currTab) {
118                if (keyCode == api.keys.right) {
119                    activateTab("right", currTab);
120                } else if (keyCode == api.keys.left) {
121                    activateTab("left", currTab);
122                }
123            }
124        },
125        accordion: function (keyCode, isShiftPressed, event) {
126            var currItem = getWrapper("div.toggle-header");
127            if (currItem) {
128                if (keyCode == api.keys.down) {
129                    activateItem("down", currItem, event);
130                } else if (keyCode == api.keys.up) {
131                    activateItem("up", currItem, event);
132                } else if (!isShiftPressed && keyCode == api.keys.tab) {
133                    activateItem("down", currItem, event);
134                } else if (isShiftPressed && keyCode == api.keys.tab){
135                    activateItem("up", currItem, event);
136                }
137            }
138        },
139        flip: function (keyCode) {
140            var currItem = getWrapper("[class*='Side']");
141            if (currItem) {
142                if (keyCode == api.keys.right || keyCode == api.keys.left) {
143                    toggleFlip(currItem);
144                }
145            }
146        }
147    };
148    /**
149    * bindEvents method get component name by calling 
150    * ["getComponentName"]{@link module:Accessibility.getComponentName} method and running apropriate to
151    * component logic
152    * @memberOf module:Accessibility
153    * @param {number} keycode keycode of pressed button on keyboard
154    * @alias module:Accessibility.bindEvents
155    * @private
156    * */
157    var bindEvents = function (keyCode, isShiftPressed, event) {
158        var component = getComponentName();
159        if (componentLogic[component]) {
160            componentLogic[component](keyCode, isShiftPressed, event);
161        }
162    };
163
164    /**
165    * This object stores keycode of keyboard buttons
166    * @type {Object}
167    * @memberOf module:Accessibility 
168    * @alias module:Accessibility.keys
169    * */
170    api.keys = {
171        end: 35,
172        home: 36,
173        left: 37,
174        up: 38,
175        right: 39,
176        down: 40,
177        delete: 46,
178        enter: 13,
179        space: 32,
180        tab: 9
181    };
182    /**
183         * indexedElements variable take list of all Indexed Element on a page by calling
184         * ["getAllIndexedElement"]{@link module:Accessibility.getAllIndexedElement} method
185         * @memberOf module:Accessibility
186         * @param {Object} properties list of properties for accordion component
187         * @alias module:Accessibility.indexedElements
188    */
189    api.indexedElements = getAllIndexedElement();
190    /**
191     * watchEvents method bind keyup event on document and on each trigger calls
192     * ["bindEvents"]{@link module:Accessibility.bindEvents}
193     * @memberOf module:Accessibility
194     * @alias module:Accessibility.watchEvents
195     */
196    api.watchEvents = function () {
197        $(document).on("keydown", function (event) {
198            var keyCode = event.keyCode,
199                isShiftPressed = event.shiftKey;
200            bindEvents(keyCode, isShiftPressed, event);
201        });
202    };
203    /**
204    * registerLogic method register accessability logic to
205    * ["componentLogic"]{@link module:Accessibility.componentLogic} list
206    * @memberOf module:Accessibility
207    * @param {string} componentName name of component which logic should be registered
208    * @param {Function} componentFunc function for component that will be triggered for accessability support
209    * @alias module:Accessibility.registerLogic
210    */
211    api.registerLogic = function (componentName, componentFunc) {
212        componentLogic[componentName] = componentFunc;
213    }
214    /**
215    * unregisterLogic method delete accessability logic from
216    * ["unregisterLogic"]{@link module:Accessibility.unregisterLogic} list
217    * @memberOf module:Accessibility
218    * @param {string} componentName name of component which logic should be deleted
219    * @alias module:Accessibility.unregisterLogic
220    */
221    api.unregisterLogic = function (componentName) {
222        delete componentLogic[componentName]
223    }
224    /**
225    * getRegisteredLogic method return list of accessability logic
226    * ["unregisterLogic"]{@link module:Accessibility.unregisterLogic} list
227    * @memberOf module:Accessibility
228    * @returns {Object} list of registered components and their logic
229    * @alias module:Accessibility.getRegisteredLogic
230    */
231    api.getRegisteredLogic = function () {
232        return componentLogic
233    }
234    /**
235        * initInstance method call
236        * ["watchEvents"]{@link module:Accessibility.watchEvents} method
237        * and call
238        * ["activateFirstElement"]{@link module:Accessibility.activateFirstElement}
239        * @memberOf module:Accessibility
240        * @method
241        * @alias module:Accessibility.initInstance
242        */
243    api.initInstance = function () {
244        api.watchEvents();
245        api.activateFirstElement();
246    };
247    /**
248     * init method calls 
249     * [".initInstance"]{@link module:Accessibility.initInstance} method.
250     * @memberOf module:Accessibility
251     * @alias module:Accessibility.init
252     */
253    api.init = function () {
254        api.initInstance();
255    };
256
257    return api;
258})(jQuery, document);
259
260XA.register("accessibility", XA.component.accessibility);
261
262
263/*  component-accordions  */
264/* global _:true */
265/**
266 * Component Accordion
267 * @module Accordion
268 * @param  {jQuery} $ Instance of jQuery
269 * @return {Object} List of accordion methods
270 */
271XA.component.accordions = (function($) {
272    /**
273     * This object stores all public api methods
274     * @type {Object.<Methods>}
275     * @memberOf module:Accordion
276     * */
277    var api = {};
278    /**
279     * toogleEvents list of toggle events
280     * @memberOf module:Accordion
281     * @private
282     */
283    var toogleEvents = {
284        focus: function() {
285            $(this).addClass("show");
286        },
287        blur: function() {
288            $(this).removeClass("show");
289        }
290    };
291    /**
292     * headerBackground method set up background image for toggle-header
293     * @memberOf module:Accordion
294     * @param {DomElement} header toggle-header DOM element of accordion component
295     * @alias module:Accordion.headerBackground
296     * @private
297     */
298    function headerBackground(header) {
299        var backgroundIcon = $(header),
300            background = $(header).find("img"),
301            backgroundSrc = background.attr("src");
302
303        if (backgroundSrc) {
304            backgroundIcon.parents(".accordion").addClass("accordion-image");
305
306            backgroundIcon.css({
307                background: "url(" + backgroundSrc + ")",
308                "background-repeat": "no-repeat",
309                "background-size": "cover",
310                "background-position": "50% 100%"
311            });
312
313            background.hide();
314        }
315    }
316    /**
317     * calcSlideSize method calculate and set up width of accordion items
318     * @memberOf module:Accordion
319     * @param {DomElement} acc Root Dom element of accordion component
320     * @alias module:Accordion.calcSlideSize
321     * @private
322     */
323    function calcSlideSize(acc) {
324        var accordionWidth = $(acc).width(),
325            accordionItems = $(acc).find(".item"),
326            maxHeight = 0;
327
328        _.each(accordionItems, function(item) {
329            var itemContent = $(item).find(".toggle-content"),
330                itemHeader = $(item).find(".toggle-header"),
331                slideWidth =
332                    accordionWidth -
333                    accordionItems.length * itemHeader.outerWidth();
334
335            if ($(item).hasClass("active")) {
336                $(item).css({
337                    width: slideWidth
338                });
339            }
340
341            //width
342            itemContent.css({
343                width: $(acc).hasClass("accordion-image")
344                    ? slideWidth + itemHeader.outerWidth()
345                    : slideWidth -
346                      itemHeader.outerWidth() -
347                      parseInt(itemHeader.css("padding"))
348            });
349
350            //height
351            if (
352                $(item)
353                    .find(".toggle-content")
354                    .height() > maxHeight
355            ) {
356                maxHeight = $(item)
357                    .find(".toggle-content")
358                    .height();
359            }
360        });
361    }
362
363    /**
364     * animateHorizontal method set up animation for horizontally oriented
365     * accordion component
366     * @memberOf module:Accordion
367     * @param {Object} properties list of properties for accordion component
368     * @alias module:Accordion.animateHorizontal
369     */
370    api.animateHorizontal = function(properties) {
371        var accordion = $(this).parents(".accordion"),
372            panel = $(this).closest(".item"),
373            header = panel.find(".toggle-header"),
374            content = panel.find(".toggle-content"),
375            items = accordion.find(".item"),
376            siblings = panel.siblings(),
377            siblingsContent = siblings.find(".toggle-content");
378
379        panel.toggleClass("active");
380        siblings.removeClass("active");
381        siblings.stop(true).animate(
382            {
383                width: 0
384            },
385            properties.speed,
386            properties.easing,
387            function() {
388                siblingsContent.css({
389                    display: "none"
390                });
391            }
392        );
393
394        if (panel.hasClass("active")) {
395            var slideWidth = accordion.hasClass("accordion-image")
396                    ? content.outerWidth()
397                    : accordion.width() -
398                      ((items.length - 1) * panel.outerWidth() + 2),
399                contentWidth = accordion.hasClass("accordion-image")
400                    ? slideWidth
401                    : slideWidth - header.outerWidth();
402
403            panel.stop(true).animate(
404                {
405                    width: slideWidth
406                },
407                properties.speed,
408                properties.easing,
409                function() {}
410            );
411
412            content.css({
413                width: contentWidth,
414                display: "block"
415            });
416        } else {
417            panel.stop(true).animate(
418                {
419                    width: 0
420                },
421                properties.speed,
422                properties.easing,
423                function() {
424                    content.css({
425                        display: "none"
426                    });
427                }
428            );
429        }
430    };
431    /**
432     * getQueryParamKey get an Id of accordion component
433     * @memberOf module:Accordion
434     * @param {jQuery} accordions  Root Dom element of accordion component
435     * @private
436     * @return {null|string} return id of accordion component
437     */
438    function getQueryParamKey(accordions) {
439        var firstAccordionId = accordions[0].id;
440        if (accordions.length > 0 && firstAccordionId != "") {
441            return firstAccordionId.toLocaleLowerCase();
442        }
443        return null;
444    }
445    /**
446     * accordion method that sets up watchers that animate accordion slide
447     * @memberOf module:Accordion
448     * @method
449     * @private
450     * @param {jQuery} acc Root DOM element of archive component wrapped by jQuery
451     * @param {Object} prop list of properties for accordion component
452     * @alias module:Accordion.accordion
453     */
454    function accordion(acc, properties) {
455        var ev = "click",
456            toggleHeader = acc.find(".toggle-header").filter(function (index, element) {
457                return $(element).closest('.accordion').is(acc);
458            });
459
460        if (properties.expandOnHover) {
461            ev += " mouseenter";
462        }
463
464        toggleHeader.on("mouseover", toogleEvents.focus);
465        toggleHeader.on("mouseleave", toogleEvents.blur);
466        toggleHeader.on("focus", toogleEvents.focus);
467        toggleHeader.on("blur", toogleEvents.blur);
468        toggleHeader.on("keyup", function(e) {
469            if (e.keyCode == 13 || e.keyCode == 32) {
470                $(this).click();
471            }
472        });
473
474        if (acc.hasClass("accordion-horizontal")) {
475            //calc slide width
476            $(document).ready(function() {
477                calcSlideSize(acc);
478            });
479
480            _.each(toggleHeader, function(header) {
481                headerBackground(header);
482            });
483        }
484
485        toggleHeader.on(ev, function() {
486            var $this = $(this),
487                panel = $this.closest(".item"),
488                accordion = $this.parents(".accordion"),
489                content = panel.find(".toggle-content:first"),
490                siblings = panel.siblings(),
491                siblingsContent = siblings.find(".toggle-content");
492
493            // Horizontal animation
494            if (accordion.hasClass("accordion-horizontal")) {
495                api.animateHorizontal.call(this, properties);
496                // Vertical animation
497            } else {
498                // Closes all other items if open
499                // multiple option disabled
500                if (!properties.canOpenMultiple) {
501                    siblings.removeClass("active");
502                    siblingsContent.stop().slideUp({
503                        duration: properties.speed,
504                        easing: properties.easing
505                    });
506                }
507
508                panel.toggleClass("active");
509                // Toggle state of selected item
510                // If toggle state is enabled
511                if (properties.canToggle) {
512                    content.slideToggle({
513                        duration: properties.speed,
514                        easing: properties.easing
515                    });
516                } else {
517                    content.slideDown({
518                        duration: properties.speed,
519                        easing: properties.easing
520                    });
521                }
522            }
523        });
524    }
525    /**
526     * initInstance method prepare Dom elements according accordion setup
527     * and call ["accordion"]{@link module:Accordion.accordion} method
528     * @memberOf module:Acordion
529     * @method
530     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
531     * @param {Object} prop list of properties for accordion component
532     * @alias module:Accordion.initInstance
533     */
534    api.initInstance = function(component, prop) {
535        // Set tabindex=0 for first header
536        component.find("ul").attr("role","presentation");
537        if(component.find("li").length > 1){
538            component.find("li").attr("role","listitem");
539        }else{
540            component.find("li").attr("role","presentation");
541        }
542
543        component.find(".toggle-header").append("<div class=\"toggle-button\" aria-hidden=\"true\"><\/div>");
544        component.find(".toggle-header").attr("aria-describedby","toggle-button-label");
545
546        component
547            .find(".toggle-header")
548            .eq(0)
549            .attr("tabindex", "0");
550        //
551        if (component.hasClass("toggle")) {
552            $.extend(prop, {
553                canToggle: true
554            });
555        }
556        component.find(".toggle-content").hide();
557        var current = XA.queryString.getQueryParam(getQueryParamKey(component));
558        if (current != null) {
559            var arr = current.split(",");
560            var items = component.find("ul").first().children();
561            for (var index = 0; index < items.length; index++) {
562                var element = items[index];
563                if (arr.indexOf(index + "") > -1) {
564                    $(element).addClass("active");
565                    $(element)
566                        .find(".toggle-content")
567                        .show();
568                }
569            }
570        } else if (prop.expandedByDefault) {
571            component.find("li:first-child").addClass("active");
572            component
573                .find("li:first-child")
574                .find(".toggle-content")
575                .show();
576        }
577        accordion(component, prop);
578    };
579    /**
580     * init method calls in a loop for each
581     * accordions component on a page and run Accordions
582     * [".initInstance"]{@link module:Accordion.initInstance} method.
583     * @memberOf module:Accordion
584     * @alias module:Accordion.init
585     */
586    api.init = function() {
587        var accordions = $(".accordion:not(.initialized)");
588        accordions.each(function() {
589            var properties = $(this).data("properties"),
590                acc = $(this);
591			console.log(properties);
592			console.log(properties.expandOnHover);
593			if(properties.expandOnHover == undefined) {
594				properties = JSON.parse($('<div/>').html(properties).text());
595			}
596			console.log(properties);
597            api.initInstance(acc, properties);
598            acc.addClass("initialized");
599        });
600    };
601
602    return api;
603})(jQuery);
604
605XA.register("accordions", XA.component.accordions);
606
607
608/*  component-archive  */
609/**
610 * Component Archive
611 * @module Archive
612 * @param  {jQuery} $ Instance of jQuery
613 * @return {Object} List of archive methods
614 */
615XA.component.archive = (function($) {
616    /**
617     * This object stores all public api methods
618     * @type {Object.<Methods>}
619     * @memberOf module:Archive
620     * */
621    var api = {};
622    /**
623     * toggleClick method toggle childs visibility
624     * for archive items
625     * @memberOf module:Archive
626     * @param {eventObject} args
627     * @private
628     */
629    var toggleClick = function(args) {
630        var groupHeader = $(args.target);
631        groupHeader.siblings("ul").toggle();
632        groupHeader.toggleClass("opened");
633    };
634    /**
635     * initInstance method bindc toggling for
636     * an archive element
637     * @memberOf module:Archive
638     * @method
639     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
640     * @alias module:Archive.initInstance
641     */
642    api.initInstance = function(component) {
643        var toggles = component.find(".group-header");
644        toggles.on("click", toggleClick);
645    };
646
647    /**
648     * init method calls in a loop for each
649     * archive component on a page and runs Archive's
650     * ["initInstance"]{@link module:Archive.api.initInstance}  method.
651     * @memberOf module:Archive
652     * @alias module:Archive.init
653     */
654    api.init = function() {
655        var archives = $(".sxa-archive:not(.initialized)"),
656            archive;
657
658        for (var i = 0, l = archives.length; i < l; i++) {
659            archive = $(archives[i]);
660            api.initInstance(archive);
661            archive.addClass("initialized");
662        }
663    };
664
665    return api;
666})(jQuery, _);
667
668XA.register("archive", XA.component.archive);
669
670
671/*  component-breadcrumb  */
672/**
673 * Component Breadcrumb
674 * @module Breadcrumb
675 * @param  {jQuery} $ Instance of jQuery
676 * @return {Object} List of archive methods
677 */
678XA.component.breadcrumb = (function($) {
679    /**
680     * This object stores all public api methods
681     * @type {Object.<Methods>}
682     * @memberOf module:Breadcrumb
683     * */
684    var api = {};
685    /**
686     * This class is used by [Breadcrumb]{@link module:Breadcrumb} module
687     * @class BreadcrumbManager
688     * @memberOf module:Breadcrumb
689     * @param {jQuery} elem DOM Root element of
690     */
691    function BreadcrumbManager(elem) {
692        this.breadcrumb = elem;
693        this.hideHistory = [];
694        this.hideHistory.elems = [];
695        this.hideHistory.widths = [];
696    }
697
698    /**
699     * @method
700     * @alias getElements
701     * @memberOf module:Breadcrumb.BreadcrumbManager
702     * @param {$OrderedList} list Ordered List of 
703     * breadcrumb elements wrapped by jquery
704     */
705    BreadcrumbManager.prototype.getElements = function($list) {
706        var elements = [];
707
708        $list.find("li").each(function() {
709            elements.push(this);
710        });
711
712        return elements;
713    };
714    /**
715     * Calculates width of component elements
716     * @name calculateListElementsWidth
717     * @function
718     * @memberOf module:Breadcrumb.BreadcrumbManager
719     * @return {number} widthSum
720     */
721    BreadcrumbManager.prototype.calculateListElementsWidth = function($list) {
722        var widthSum = 0;
723
724        $list.find(">li").each(function() {
725            widthSum += $(this).width();
726        });
727
728        return widthSum;
729    };
730    /**
731     * In case breadcrumb elements do no fit the component width
732     * several breadcrum items will be replaced by "..."
733     * @name calculateWidth
734     * @function
735     * @memberOf module:Breadcrumb.BreadcrumbManager
736     */
737    BreadcrumbManager.prototype.calculateWidth = function() {
738        var inst = this,
739            $list = $(inst.breadcrumb).find("nav>ol"),
740            listWidth = $list.width(),
741            widthSum = this.calculateListElementsWidth($list),
742            elements = this.getElements($list),
743            $elementToHide,
744            removeIndx = 0;
745
746        var width = inst.hideHistory.widths[inst.hideHistory.widths.length - 1];
747        if (listWidth > widthSum + width) {
748            var elem = inst.hideHistory.elems.pop();
749            inst.hideHistory.widths.pop();
750            $(elem).removeClass("item-hide");
751        }
752
753        while (listWidth < widthSum && elements.length > 2) {
754            removeIndx = Math.round(elements.length / 2) - 1;
755            $elementToHide = $(elements[removeIndx]);
756
757            inst.hideHistory.elems.push(elements[removeIndx]);
758            inst.hideHistory.widths.push($elementToHide.width());
759            $elementToHide.addClass("item-hide");
760
761            widthSum = inst.calculateListElementsWidth($list);
762            elements.splice(removeIndx, 1);
763        }
764    };
765    /**
766     * Calls when "breadcrumb-hide" class is added.
767     * It does initial
768     * [calculation]{@link module:Breadcrumb.BreadcrumbManager.calculateWidth}
769     * of component width and also adds 
770     * [recalculation]{@link module:Breadcrumb.BreadcrumbManager.calculateWidth}
771     * to window resize event.
772     * @method
773     * @alias module:Breadcrumb.BreadcrumbManager.init
774     * @memberOf module:Breadcrumb.BreadcrumbManager
775     */
776    BreadcrumbManager.prototype.init = function() {
777        var inst = this;
778
779        inst.calculateWidth();
780        $(window).resize(function() {
781            inst.calculateWidth();
782        });
783    };
784    /**
785     * Default behavior of breadcrumb.
786     * If children exist, it adds
787     * "breadcrumb-navigation" class
788     * @method
789     * @alias makeNavigation
790     * @memberOf module:Breadcrumb.BreadcrumbManager
791     */
792    BreadcrumbManager.prototype.makeNavigation = function() {
793        var breadcrumb = $(this.breadcrumb),
794            children = breadcrumb.find("li > ol");
795
796        if (children.length > 0) {
797            breadcrumb.addClass("breadcrumb-navigation");
798        }
799    };
800    /**
801     * initIstance methods creates new instance of
802     * [BreadcrumbManager]{@link module:Breadcrumb.BreadcrumbManager}
803     * @memberOf module:Breadcrumb
804     * @method
805     * @param {jQuery} component Root DOM element of
806     * breadcrumb component wrapped by jQuery
807     * @alias module:Breadcrumb.initInstance
808     */
809    api.initInstance = function(component) {
810        var breadcrumb = new BreadcrumbManager(component),
811            $component = $(component);
812        /** breadcrumb-hide - can be added manually in component setups */
813        if ($component.hasClass("breadcrumb-hide")) {
814            breadcrumb.init();
815        } else {
816            breadcrumb.makeNavigation();
817        }
818    };
819    /**
820     * init method calls in a loop for each
821     * breadcrumb component on a page and runs Breadcrumb's
822     * [".initInstance"]{@link module:Breadcrumb.api.initInstance}  method.
823     * @memberOf module:Breadcrumb
824     * @alias module:Breadcrumb.init
825     */
826    api.init = function() {
827        var breadcrumb = $(".breadcrumb:not(.initialized)");
828        breadcrumb.each(function() {
829            api.initInstance($(this));
830            $(this).addClass("initialized");
831        });
832    };
833
834    return api;
835})(jQuery, document);
836
837XA.register("breadcrumb", XA.component.breadcrumb);
838
839
840/*  component-carousel  */
841/**
842 * XAContext
843 *
844 * XA.component.carousels module.
845 *
846 * Exposes register (selector, options) method that initializes Carousel
847 * for each element that matches the provided selector, with its given options.
848 * Element used as a carousel must contain a <ul class="slides"> tag.
849 * That tag must be filled with <li> elements. Each <li> element will be considered as a slide.
850 * For more details read the documentation of the register(selector, options) method.
851 *
852 * @requires jQuery JavaScript Library v1.4.4 or higher
853 */
854/* global Hammer:true */
855XA.component.carousels = (function ($) {
856  var pub = {},
857    NavigationBuilder = null,
858    SliderInitializer = null;
859
860  /**
861   * Timer class saves time stamp and counts time difference between
862   * current time (update() method) and saved time stamp.
863   * @constructor
864   */
865  function Timer() {
866    /**
867     * Time difference between last update() call and last set() call
868     *
869     * @member Timer
870     */
871    this.elapsed = 0;
872    /**
873     * Time stamp
874     *
875     * @member Timer
876     */
877    this.stamp = null;
878  }
879
880  /**
881   *  Counts time difference between current time and saved time stamp
882   *
883   * @member Timer
884   */
885  Timer.prototype.update = function () {
886    if (this.stamp !== null) {
887      this.elapsed += this.newStamp() - this.stamp;
888    }
889  };
890
891  /**
892   *  Saves new time stamp
893   *
894   * @member Timer
895   */
896  Timer.prototype.set = function () {
897    this.stamp = this.newStamp();
898  };
899
900  /**
901   *  Counts time difference between current time and saved time stamp
902   *
903   * @member Timer
904   * @return stamp of a current time
905   * @type Number
906   */
907  Timer.prototype.newStamp = function () {
908    return new Date().valueOf();
909  };
910
911  /**
912   *  Resets elapsed time.
913   *
914   * @member Timer
915   */
916  Timer.prototype.reset = function () {
917    this.elapsed = 0;
918  };
919  /**
920   * End of Timer class
921   */
922
923  /**
924   * TimeIndicator class extends Timer class
925   * @constructor
926   * @param {Object} $     a jQuery object
927   * @param {XA.component.carousels.IndicatorViews.View} view  a time indicator view.
928   * @param {Number} timeout   a view timeout
929   * @base Timer
930   */
931  function TimeIndicator($, view, timeout) {
932    /**
933     * A time indicator view.
934     *
935     * @member TimerIndicator
936     */
937    this.view = view;
938
939    this.view.init(timeout);
940  }
941  TimeIndicator.prototype = new Timer();
942  TimeIndicator.constructor = Timer;
943
944  /**
945   * Plays the attached view.
946   *
947   * @member TimerIndicator
948   */
949  TimeIndicator.prototype.play = function () {
950    this.view.play();
951  };
952
953  /**
954   * Pauses the attached view.
955   *
956   * @member TimerIndicator
957   */
958  TimeIndicator.prototype.pause = function () {
959    this.view.pause();
960  };
961
962  /**
963   * Resets elapsed time and resets the attached view.
964   *
965   * @member TimerIndicator
966   */
967  TimeIndicator.prototype.reset = function () {
968    Timer.prototype.reset.call(this);
969    this.view.reset();
970  };
971
972  /**
973   * Counts time difference between current time and saved time stamp
974   * and updates the attached view
975   *
976   * @member TimerIndicator
977   */
978  TimeIndicator.prototype.update = function () {
979    Timer.prototype.update.call(this);
980    this.view.update(this.elapsed);
981  };
982  /**
983   * end of TimeIndicator class
984   */
985
986  /**
987   * NavigationBuilder object creates navigation items
988   */
989  NavigationBuilder = (function ($) {
990    function createItem(settings) {
991      var text = settings.text,
992        $navItem = null;
993
994      settings.text = "";
995      settings.href = "#";
996
997      $navItem = $("<a>", settings);
998      $("<span>", {
999        text: text,
1000      }).appendTo($navItem);
1001
1002      return $navItem;
1003    }
1004
1005    return {
1006      /**
1007       * Returns the element(s) that match the provided selector or null
1008       *
1009       * @param {String} selector a selector used for searching
1010       * @return a jQuery object containing element(s) that match the provided selector or null if there is no element match
1011       * @type Object
1012       */
1013      getElement: function (selector) {
1014        var $element = $(selector);
1015
1016        if ($element.length === 0) {
1017          $element = null;
1018        }
1019
1020        return $element;
1021      },
1022      /**
1023       * Creates navigation items and appends them to $container.
1024       *
1025       * @param {Object} $container   navigation items container (jQuery object)
1026       * @param {String} label   navigation items label template
1027       * @param {Number} count    number of navigation items to create
1028       */
1029      createItems: function ($container, label, count) {
1030        var i,
1031          pattern = /#\{index\}/g,
1032          settings;
1033
1034        for (i = 0; i < count; i++) {
1035          settings = {
1036            text: label.replace(pattern, i + 1),
1037          };
1038          createItem(settings).appendTo($container);
1039        }
1040      },
1041      /**
1042       * Creates or selects 'previous'/'next' navigation item.
1043       * Mode of action depends on settings object:
1044       * var settings = {
1045       *     isContainer: Boolean value,
1046       *     label: String value,
1047       *     selector: String value,
1048       *     method: String value
1049       * };
1050       *
1051       * If settings.selector === null or if settings.selector !== null and settings.isContainer == true
1052       * navigation item is created and attached to $element.first() (using settings.method).
1053       * If settings.selector !== null and settings.isContainer == false
1054       * $element.first() is selected as navigation item
1055       *
1056       * @param {Object} settings settings of navigation item
1057       * @param {Object} itemSettings   html attributes of navigation item
1058       * @param {Object} $element    navigation items container (jQuery object)
1059       * @return The 'prev'/'next' navigation item
1060       * @type Object
1061       */
1062      createPrevNextItem: function (settings, itemSettings, $element) {
1063        var $item = null,
1064          isSelectorExists = settings.selector !== null;
1065
1066        if (isSelectorExists) {
1067          $element = this.getElement(settings.selector);
1068        }
1069
1070        if ($element !== null) {
1071          if (settings.isContainer || !isSelectorExists) {
1072            $item = createItem(
1073              $.extend(
1074                {},
1075                {
1076                  text: settings.label,
1077                },
1078                itemSettings
1079              )
1080            );
1081            $element.first()[settings.method]($item);
1082          } else {
1083            $item = $element.first();
1084          }
1085        }
1086
1087        return $item;
1088      },
1089    };
1090  })($);
1091  /**
1092   * end of NavigationBuilder object
1093   */
1094
1095  /**
1096   * Navigation class that contains navigation items.
1097   * @constructor
1098   */
1099  function Navigation($, $wrapper, options) {
1100    var defaults = {
1101        isEnabled: true,
1102        hasPrevNextItems: true,
1103        item: {
1104          label: "#{index}",
1105          selector: null,
1106        },
1107        prevItem: {
1108          label: "<",
1109          selector: null,
1110          isContainer: false,
1111        },
1112        nextItem: {
1113          label: ">",
1114          selector: null,
1115          isContainer: false,
1116        },
1117        slidesCount: 0,
1118      },
1119      settings = $.extend(true, {}, defaults, options);
1120
1121    /**
1122     * jQuery object
1123     *
1124     * @member Navigation
1125     */
1126    this.$ = $;
1127    /**
1128     * Navigation items (one for each slide if navigation is enabled).
1129     *
1130     * @member Navigation
1131     */
1132    this.$items = $();
1133    /**
1134     * Navigation 'next' item (if prev/next items are enabled).
1135     *
1136     * @member Navigation
1137     */
1138    this.$nextItem = $();
1139    /**
1140     * Navigation 'previous' item (if prev/next items are enabled).
1141     *
1142     * @member Navigation
1143     */
1144    this.$prevItem = $();
1145    /**
1146     * Selected item (one from this.$items or null).
1147     *
1148     * @member Navigation
1149     */
1150    this.$selectedItem = null;
1151
1152    //initialization
1153    if (settings.isEnabled) {
1154      var self = this;
1155      setTimeout(function () {
1156        self.prepareItems(settings.item, settings.slidesCount, $wrapper);
1157        //select first item on init
1158        self.selectItem(0);
1159      }, 1000);
1160
1161      $wrapper.find(".nav").trigger("navigation-created", this);
1162    }
1163  }
1164
1165  /**
1166   * CSS class used to mark selected item.
1167   *
1168   * @member Navigation
1169   */
1170  Navigation.prototype.selectedItemClass = "active";
1171
1172  /**
1173   * Mark navigation item with given index as selected.
1174   *
1175   * @member Navigation
1176   * @param {Number} index     index of navigation item
1177   */
1178  Navigation.prototype.selectItem = function (index) {
1179    if (this.$selectedItem !== null) {
1180      this.$selectedItem.removeClass(this.selectedItemClass);
1181    }
1182    this.$selectedItem = this.$items.eq(index).addClass(this.selectedItemClass);
1183  };
1184
1185  /**
1186   * Creates or selects navigation items container and fills it with navigation items.
1187   * If navigation items container is not empty, child elements are adopted as navigation items.
1188   * Mode of action depends on settings object:
1189   * var settings = {
1190   *     'label': '#{index}',
1191   *     'selector': null
1192   * };
1193   * If settings.selector === null navigation item container is created.
1194   * If settings.selector !== null element that match settings.selector is adapted as navigagation items container.
1195   *
1196   * @member Navigation
1197   * @param {Object} settings settings of navigation items
1198   * @param {Number} count   number of navigation items
1199   * @param {Object} $wrapper    wrapper of navigation items container (jQuery object)
1200   * @return The container filled with navigation items.
1201   * @type Object
1202   */
1203  Navigation.prototype.prepareItems = function (settings, count, $wrapper) {
1204    var $container = null;
1205
1206    if (settings.selector) {
1207      $container = NavigationBuilder.getElement(settings.selector);
1208    } else {
1209      $container = $("<div/>", {
1210        class: "nav",
1211      });
1212      $container.appendTo($wrapper);
1213    }
1214
1215    if ($container) {
1216      if ($container.children().length === 0) {
1217        NavigationBuilder.createItems($container, settings.label, count);
1218      }
1219
1220      this.$items = $container.children().slice(0, count);
1221    }
1222
1223    return $container;
1224  };
1225
1226  /**
1227   * Creates or selects navigation 'previous' and 'next' navigation items (@see NavigationBuilder.createPrevNextItem()).
1228   * If navigation items container is not empty, child elements are adopted as navigation items.
1229   *
1230   * @member Navigation
1231   * @param {Object} settings settings of navigation
1232   * @param {Object} $container    navigation items container (jQuery object)
1233   */
1234  Navigation.prototype.preparePrevNextItems = function (settings, $container) {
1235    var $item;
1236
1237    settings.prevItem.method = "prepend";
1238    $item = NavigationBuilder.createPrevNextItem(
1239      settings.prevItem,
1240      {
1241        class: "prev",
1242      },
1243      $container
1244    );
1245    this.$prevItem = $item === null ? this.$prevItem : $item;
1246
1247    settings.nextItem.method = "append";
1248    $item = NavigationBuilder.createPrevNextItem(
1249      settings.nextItem,
1250      {
1251        class: "next",
1252      },
1253      $container
1254    );
1255    this.$nextItem = $item === null ? this.$nextItem : $item;
1256  };
1257  /**
1258   * end of Navigation class
1259   */
1260
1261  /**
1262   * class Swiper you can define horizontal swipe for chosing element and set behavior of swipe(left/right).
1263   * You can extend this class with vertical swipe if it needs
1264   * @param target Element or query of querySelector
1265   */
1266  function Swiper(target) {
1267    let touchStartX = 0,
1268      touchStartY = 0,
1269      touchEndX = 0,
1270      touchEndY = 0,
1271      threshold = 50;
1272
1273    let onSwipeLeftAgent = null,
1274      onSwipeRightAgent = null,
1275      element = null;
1276
1277    element =
1278      target instanceof EventTarget ? target : document.querySelector(target);
1279
1280    onTouchStart = (event) => {
1281      touchStartX = event.changedTouches[0].screenX;
1282      touchStartY = event.changedTouches[0].screenY;
1283    };
1284
1285    onTouchEnd = (event) => {
1286      touchEndX = event.changedTouches[0].screenX;
1287      touchEndY = event.changedTouches[0].screenY;
1288      handleGesture(event);
1289    };
1290
1291    onMouseDown = (event) => {
1292      touchStartX = event.screenX;
1293      touchStartY = event.screenY;
1294    };
1295
1296    onMouseUp = (event) => {
1297      touchEndX = event.screenX;
1298      touchEndY = event.screenY;
1299      handleGesture(event);
1300    };
1301
1302    element.addEventListener("touchstart", onTouchStart, false);
1303
1304    element.addEventListener("touchend", onTouchEnd, false);
1305
1306    element.addEventListener("mousedown", onMouseDown, false);
1307
1308    element.addEventListener("mouseup", onMouseUp, false);
1309
1310    /**
1311     * method which defines swipe left
1312     * @param callback func
1313     */
1314    this.onSwipeLeft = (callback) => {
1315      onSwipeLeftAgent = (event) => callback.call(this, event);
1316    };
1317
1318    /**
1319     * method which defines swipe right
1320     * @param callback
1321     */
1322    this.onSwipeRight = (callback) => {
1323      onSwipeRightAgent = (event) => callback.call(this, event);
1324    };
1325
1326    this.destroy = () => {
1327      element.removeEventListener("touchstart", onTouchStart);
1328      element.removeEventListener("touchend", onTouchEnd);
1329      element.removeEventListener("mousedown", onMouseDown);
1330      element.removeEventListener("mouseup", onMouseUp);
1331    };
1332
1333    function handleGesture(event) {
1334      /**
1335       * swiped left
1336       */
1337      if (touchEndX + threshold <= touchStartX) {
1338        onSwipeLeftAgent && onSwipeLeftAgent(event);
1339      }
1340
1341      /**
1342       * swiped right
1343       */
1344      if (touchEndX - threshold >= touchStartX) {
1345        onSwipeRightAgent && onSwipeRightAgent(event);
1346      }
1347    }
1348  }
1349
1350  /**
1351   * SliderContext class is binded to a Slider class instance
1352   * and contains its properties.
1353   * @constructor
1354   */
1355  function SliderContext() {
1356    /**
1357     * Flag that determines if slide can or cannot be changed (for user request)
1358     *
1359     * @member SliderContext
1360     */
1361    this.canChangeSlide = true;
1362    /**
1363     * Default Slider setting object (@see Slider)
1364     *
1365     * @member SliderContext
1366     */
1367    this.defaults = null;
1368    /**
1369     * Navigation object (@see Navigation)
1370     *
1371     * @member SliderContext
1372     */
1373    this.navigation = null;
1374    /**
1375     * Slider object that this context is attached to.
1376     *
1377     * @member SliderContext
1378     */
1379    this.owner = null;
1380    /**
1381     * Flag that determines if change of a slide can or can not be scheduled.
1382     *
1383     * @member SliderContext
1384     */
1385    this.preventScheduling = false;
1386    /**
1387     * Slider setting object
1388     *
1389     * @member SliderContext
1390     */
1391    this.settings = null;
1392    /**
1393     * Instance of Timer class (@see Timer) that is used to store how much
1394     * time is left to change the slide.
1395     *
1396     * @member SliderContext
1397     */
1398    this.slideTimer = new Timer();
1399    /**
1400     * Instance of TimeIndicator class (@see TimeIndicator)
1401     *
1402     * @member SliderContext
1403     */
1404    this.timeIndicator = null;
1405    /**
1406     * Timers array.
1407     *
1408     * @member SliderContext
1409     */
1410    this.timers = [];
1411    /**
1412     * Last timeout identifier.
1413     *
1414     * @member SliderContext
1415     */
1416    this.timeoutId = null;
1417    /**
1418     * Transition (@see XA.component.carousels.Transitions.Transition) used while changing slides
1419     *
1420     * @member SliderContext
1421     */
1422    this.transition = null;
1423    /**
1424     * Transition settings object (@see XA.component.carousels.Transitions.TransitionSettings)
1425     *
1426     * @member SliderContext
1427     */
1428    this.transitionSettings =
1429      new XA.component.carousels.Transitions.TransitionSettings();
1430    /**
1431     * jQuery object that contains all slides
1432     *
1433     * @member SliderContext
1434     */
1435    this.$slides = null;
1436    /**
1437     * jQuery object that contains the element that wraps slides
1438     *
1439     * @member SliderContext
1440     */
1441    this.$wrapper = null;
1442    /**
1443     * Reference to method that should change current slide
1444     *
1445     * @member SliderContext
1446     */
1447    this.changeCurrentSlide = null;
1448    /**
1449     * Reference to method that should return jQuery object with current slide
1450     *
1451     * @member SliderContext
1452     */
1453    this.getCurrentSlide = null;
1454
1455    this.timers.push(this.slideTimer);
1456  }
1457  /**
1458   * end of SliderContext class
1459   */
1460
1461  /**
1462   * Slider class manages changing of slides.
1463   *
1464   * Options object:
1465   * {
1466   *     'navigation': Object value, //navigation settings object
1467   *     'timeout': Number value, //time between slides changing
1468   *     'transition': String value, //name of transition class (@see XA.component.carousels.Transitions.Transition)
1469   *     'isPauseEnabled': Boolean value, //flag that determines if pause feature is enabled
1470   *     'timeIndicator': {
1471   *         'isEnabled': Boolean value, //flag that determines if time indicator is enabled
1472   *         'selector': String value, //selector of time indicator html element
1473   *         'view': String value, //name of view class (@see XA.component.carousels.IndicatorViews.View
1474   *         'options': Object value //object with options that will be passed to a time indicator view
1475   *     }
1476   * }
1477   * @constructor
1478   * @param {Object} $     the jQuery object
1479   * @param {SliderContext} context    instance of SliderContext class; must be separate for each instance (@see SliderContext)
1480   * @param {Object} options    Slider options object
1481   */
1482  function Slider($, context, options) {
1483    var defaults = {
1484      navigation: {},
1485      timeout: 10000,
1486      transition: "BasicTransition",
1487      isPauseEnabled: true,
1488      timeIndicator: {
1489        isEnabled: false,
1490        selector: null,
1491        view: "View",
1492        options: {},
1493      },
1494    };
1495
1496    /**
1497     * Instance of SliderContext class (@see SliderContext)
1498     *
1499     * @member Navigation
1500     */
1501    this.context = context;
1502
1503    context.owner = this;
1504    context.defaults = defaults;
1505    context.settings = $.extend(true, {}, defaults, options);
1506    context.transitionSettings.$slides = context.$slides;
1507  }
1508
1509  /**
1510   * Executes method with given methodName on each Timer in context.timers (@see Timer)
1511   *
1512   * @member Slider
1513   * @param {String} methodName   name of a method that will be executed on timers
1514   * @param {SliderContext} context    current context
1515   */
1516  Slider.prototype.executeOnTimers = function (methodName, context) {
1517    var i = null,
1518      timer = null,
1519      timers = context.timers;
1520
1521    for (i = 0; i < timers.length; i++) {
1522      timer = timers[i];
1523      if (typeof timer[methodName] === "function") {
1524        timer[methodName]();
1525      }
1526    }
1527  };
1528
1529  /**
1530   * Deschedules change of a slide, by clearing timeout previously set by setTimeout() function.
1531   *
1532   * @member Slider
1533   * @param {SliderContext} context    current context
1534   */
1535  Slider.prototype.descheduleSlide = function (context) {
1536    if (context.timeoutId !== null) {
1537      clearTimeout(context.timeoutId);
1538      context.timeoutId = null;
1539    }
1540  };
1541
1542  /**
1543   * Schedules change of a slide, by setting timeout (using setTimeout() function) if it can.
1544   * If cannot, it tries again after short period of time.
1545   *
1546   * @member Slider
1547   * @param {SliderContext} context    current context
1548   */
1549  Slider.prototype.scheduleSlide = function (context) {
1550    var owner = context.owner;
1551
1552    owner.descheduleSlide(context);
1553
1554    if (!context.preventScheduling && context.$slides.length > 1) {
1555      owner.executeOnTimers("set", context);
1556
1557      if (context.canChangeSlide) {
1558        if (context.timeIndicator !== null) {
1559          context.timeIndicator.play();
1560        }
1561        context.timeoutId = setTimeout(function () {
1562          owner.changeCurrentSlideBy(1, context);
1563        }, context.settings.timeout - context.slideTimer.elapsed);
1564      } else {
1565        setTimeout(function () {
1566          owner.scheduleSlide(context);
1567        }, 100);
1568      }
1569    }
1570  };
1571
1572  /**
1573   * Changes current slide by offset performing context.transition
1574   * Any offset value is save (if it is an integer).
1575   *
1576   * @member Slider
1577   * @param {Number} offset    the offset to an index of a new slide
1578   * @param {SliderContext} context    current context
1579   */
1580  Slider.prototype.changeCurrentSlideBy = function (offset, context) {
1581    var settings = context.transitionSettings,
1582      $currentSlide = context.getCurrentSlide(),
1583      $slides = context.$slides;
1584
1585    if (offset % $slides.length !== 0) {
1586      context.canChangeSlide = false;
1587
1588      settings.offset = offset;
1589      settings.$currentSlide = $currentSlide;
1590      settings.$nextSlide = $slides.eq(
1591        ($currentSlide.index() + offset) % $slides.length
1592      );
1593
1594      context.changeCurrentSlide(settings.$nextSlide);
1595      context.transition.perform(context.transitionSettings, offset);
1596      context.owner.executeOnTimers("reset", context);
1597    }
1598
1599    var $carousel = $(context.$wrapper).parents(".carousel");
1600    $carousel.trigger("slide-changed");
1601  };
1602
1603  /**
1604   * Starts automatic slide changing
1605   *
1606   * @member Slider
1607   */
1608  Slider.prototype.run = function () {
1609    this.executeOnTimers("reset", this.context);
1610    this.scheduleSlide(this.context);
1611  };
1612
1613  /**
1614   * Cancel the default action of event and changes slides manually.
1615   *
1616   * @member Slider
1617   * @param {Object} event     the event
1618   * @param {Number} offset    the offset to an index of a new slide
1619   * @param {SliderContext} context    current context
1620   */
1621  Slider.prototype.onChangeCurrentSlide = function (event, offset, context) {
1622    var owner = context.owner;
1623
1624    event.preventDefault();
1625    if (context.canChangeSlide) {
1626      owner.descheduleSlide(context);
1627      owner.changeCurrentSlideBy(offset, context);
1628    }
1629  };
1630
1631  /**
1632   * Selects navigation item with given index.
1633   *
1634   * @member Slider
1635   * @param {Number} index     the index of navigation item
1636   */
1637  Slider.prototype.selectNavigationItem = function (index) {
1638    this.context.navigation.selectItem(index);
1639  };
1640  /**
1641   * end of Slider class
1642   */
1643
1644  /**
1645   * SliderInitializer object sets up instances of Slider class
1646   */
1647  SliderInitializer = (function ($) {
1648    var DIRECTION = {
1649      PREV: -1,
1650      NEXT: 1,
1651    };
1652
1653    /**
1654     * Attaches events to navigation items.
1655     *
1656     * @param {SliderContext} context   a context of a Slider class instance
1657     */
1658    function attachNavigationEvents(context) {
1659      var owner = context.owner,
1660        $navLinks = context.$wrapper.find(".nav-items"),
1661        $prevItemTxt = context.$wrapper.find(".prev-text"),
1662        $nextItemTxt = context.$wrapper.find(".next-text"),
1663        $carousel = context.$wrapper.parents(".carousel");
1664
1665      context.navigation.$items.each(function (index) {
1666        var $slide = context.$slides.eq(index);
1667
1668        $(this).click(function (event) {
1669          owner.onChangeCurrentSlide(
1670            event,
1671            $slide.index() - context.getCurrentSlide().index(),
1672            context
1673          );
1674        });
1675      });
1676
1677      $prevItemTxt.click(function (event) {
1678        switchSlide(event, context, DIRECTION.PREV);
1679      });
1680
1681      $nextItemTxt.click(function (event) {
1682        switchSlide(event, context, DIRECTION.NEXT);
1683      });
1684
1685      context.navigation.$prevItem.click(function (event) {
1686        switchSlide(event, context, DIRECTION.PREV);
1687      });
1688
1689      context.navigation.$nextItem.click(function (event) {
1690        switchSlide(event, context, DIRECTION.NEXT);
1691      });
1692
1693      $navLinks.on("keydown", function (event) {
1694        switch (event.keyCode) {
1695          case 37: //Letf arrow
1696            switchSlide(event, context, DIRECTION.PREV);
1697            $(this).parent().find(".active").focus();
1698            break;
1699          case 39: //Right arrow
1700            switchSlide(event, context, DIRECTION.NEXT);
1701            $(this).parent().find(".active").focus();
1702            break;
1703          case 13: //Enter
1704            focusFirstFocusableElement(owner.context.getCurrentSlide());
1705        }
1706      });
1707
1708      $carousel.on("slide-changed", function (event) {
1709        var $activeLink = $navLinks.find(".active");
1710        $activeLink.attr("tabindex", "0");
1711
1712        if ($navLinks.find(document.activeElement).length) {
1713          $activeLink.focus({ preventScroll: true });
1714        }
1715
1716        $navLinks.find(">div").not(".active").attr("tabindex", "-1");
1717      });
1718    }
1719
1720    /**
1721     * Switches slides back and foreward
1722     *
1723     * @param {Event} event              an event that caused switch slide action
1724     * @param {SliderContext} context    a context of a Slider class instance
1725     * @param {number} direction         switch slide direction. -1 - switch to prev slide. 1 - switch to the next slide
1726     */
1727    function switchSlide(event, context, direction) {
1728      var owner = context.owner,
1729        navLinks$ = context.$wrapper.find(".nav-items");
1730
1731      navLinks$.find(".active").attr("tabindex", "-1");
1732      owner.onChangeCurrentSlide(event, direction, context);
1733      navLinks$.find(".active").attr("tabindex", "0");
1734    }
1735
1736    /**
1737     * Focus the first focusable element inside container.
1738     *
1739     * @param {Container} container  a container element where the first focusable element will be focused
1740     */
1741    function focusFirstFocusableElement(container) {
1742      var focusableElementsString =
1743        'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
1744
1745      // Finds all focusable children
1746      var focusableElements = container.find(focusableElementsString);
1747
1748      // If there are focusable elements - select the first one.
1749      if (focusableElements.length !== 0) {
1750        var firstTabStop = focusableElements[0];
1751
1752        // Focus first
1753        firstTabStop.focus();
1754      }
1755    }
1756
1757    /**
1758     * Attaches pause event to navigation wrapper.
1759     *
1760     * @param {SliderContext} context   a context of a Slider class instance
1761     */
1762    function attachPauseEvent(context) {
1763      var owner = context.owner,
1764        $element = context.$wrapper,
1765        $navLinks = $element.find(".nav a");
1766
1767      var callbackMouseenter = function () {
1768        context.preventScheduling = true;
1769        owner.descheduleSlide(context);
1770
1771        owner.executeOnTimers("update", context);
1772        if (context.timeIndicator !== null) {
1773          context.timeIndicator.pause();
1774        }
1775      };
1776
1777      $element.mouseenter(callbackMouseenter);
1778      $navLinks.on("focus", callbackMouseenter);
1779
1780      var callbackMouseLeave = function () {
1781        context.preventScheduling = false;
1782        owner.scheduleSlide(context);
1783      };
1784
1785      $element.mouseleave(callbackMouseLeave);
1786      $navLinks.on("blur", callbackMouseLeave);
1787    }
1788
1789    /**
1790     * Creates time indicator view
1791     *
1792     * @param {SliderContext} context   a context of a Slider class instance
1793     */
1794    function createIndicator(context) {
1795      var settings = context.settings,
1796        timeIndicator = null,
1797        ViewConstructor =
1798          XA.component.carousels.IndicatorViews[settings.timeIndicator.view],
1799        view = null;
1800
1801      if (ViewConstructor !== null) {
1802        view = new ViewConstructor(
1803          settings.timeIndicator.selector,
1804          settings.timeIndicator.options
1805        );
1806        timeIndicator = new TimeIndicator($, view, settings.timeout);
1807        context.timeIndicator = timeIndicator;
1808        context.timers.push(timeIndicator);
1809      }
1810    }
1811
1812    /**
1813     * Attaches events to navigation.
1814     *
1815     * @param {SliderContext} context   a context of a Slider class instance
1816     */
1817    function initializeNavigation(context) {
1818      context.settings.navigation.slidesCount = context.$slides.length;
1819      context.navigation = new Navigation(
1820        $,
1821        context.$wrapper,
1822        context.settings.navigation
1823      );
1824
1825      setTimeout(function () {
1826        attachNavigationEvents(context);
1827      }, 1000);
1828
1829      if (context.settings.isPauseEnabled) {
1830        attachPauseEvent(context);
1831      }
1832    }
1833
1834    /**
1835     * Initializes transition for a given context.
1836     *
1837     * @param {SliderContext} context   a context of a Slider class instance
1838     */
1839    function initializeTransition(context) {
1840      var TransitionConstructor = null,
1841        owner = context.owner;
1842
1843      context.transitionSettings.callback = function () {
1844        context.canChangeSlide = true;
1845
1846        if (context.preventScheduling) {
1847          owner.executeOnTimers("reset", context);
1848        } else {
1849          owner.scheduleSlide(context);
1850        }
1851      };
1852
1853      TransitionConstructor =
1854        XA.component.carousels.Transitions[context.settings.transition];
1855      if (
1856        TransitionConstructor === null ||
1857        TransitionConstructor === undefined
1858      ) {
1859        TransitionConstructor =
1860          XA.component.carousels.Transitions[context.defaults.transition];
1861      }
1862      context.transition = new TransitionConstructor();
1863      context.transition.init(context.transitionSettings);
1864    }
1865
1866    return {
1867      /**
1868       * Initializes Slider object with a given context.
1869       *
1870       * @param {SliderContext} context   a context of a Slider class instance
1871       */
1872      initialize: function (context) {
1873        initializeNavigation(context);
1874        initializeTransition(context);
1875
1876        if (context.settings.timeIndicator.isEnabled) {
1877          createIndicator(context);
1878        }
1879      },
1880    };
1881  })($);
1882  /**
1883   * end of SliderInitializer
1884   */
1885
1886  /**
1887   * Carousel class displays one slide (some content) at the time.
1888   * Its behavior depends on settings (passed to init() method).
1889   * For more details @see Slider, @see SliderInitializer, @see Navigation,
1890   * @see NavigationBuilder, @see XA.component.carousels.Transitions.Transition,
1891   * @see XA.component.carousels.IndicatorViews.View
1892   *
1893   * @constructor
1894   */
1895  function Carousel() {
1896    var context = this;
1897
1898    /**
1899     * Instance of a Slider class (@see Slider).
1900     *
1901     * @member Carousel
1902     */
1903    this.slider = null;
1904    /**
1905     * Displayed slide (jQuery object).
1906     *
1907     * @member Carousel
1908     */
1909    this.$currentSlide = null;
1910    /**
1911     * All slides (jQuery object).
1912     *
1913     * @member Carousel
1914     */
1915    this.$slides = null;
1916
1917    /**
1918     * Changes current slide to a $newSlide.
1919     *
1920     * @member Carousel
1921     * @param {Object} $newSlide  the new slide (jQuery) object.
1922     */
1923    this.changeCurrentSlide = function ($newSlide) {
1924      context.$currentSlide = $newSlide;
1925      context.slider.selectNavigationItem($newSlide.index());
1926    };
1927
1928    /**
1929     * Returns current slide.
1930     *
1931     * @member Carousel
1932     * @return current slide (jQuery) object.
1933     * @type Object
1934     */
1935    this.getCurrentSlide = function () {
1936      return context.$currentSlide;
1937    };
1938
1939    this.data = {};
1940  }
1941
1942  /**
1943   * Resets the carousel.
1944   *
1945   * @member Carousel
1946   */
1947  Carousel.prototype.reset = function () {
1948    this.$slides.each(function () {
1949      $(this).hide();
1950    });
1951
1952    this.changeCurrentSlide(this.$slides.first());
1953    this.$currentSlide.show();
1954  };
1955
1956  /**
1957   * Initializes the carousel.
1958   * Wraps carousel content with <div class="wrapper" /> element,
1959   * selects slides (<li /> elements) from <ul class="slides" /> element,
1960   * initializes Slider class instance, resets the carousel, and starts automatic slides changing.
1961   *
1962   * @member Carousel
1963   * @param {Object} $container     jQuery object with a main html element of the carousel
1964   * @param {Object} options     carousel options object
1965   */
1966  Carousel.prototype.init = function ($container, options) {
1967    var $wrapper = $('.wrapper').length ? $('.wrapper') : $("<div/>", {
1968        class: "wrapper",
1969      }),
1970      sliderContext = null;
1971
1972    if (!$('.wrapper').length) {
1973      $wrapper.append($container.children().detach());
1974      $container.append($wrapper);
1975    }
1976    
1977    this.$slides = $wrapper.find(".slides li.slide");
1978
1979    sliderContext = new SliderContext();
1980    sliderContext.changeCurrentSlide = this.changeCurrentSlide;
1981    sliderContext.getCurrentSlide = this.getCurrentSlide;
1982    sliderContext.$slides = this.$slides;
1983    sliderContext.$wrapper = $wrapper;
1984
1985    this.slider = new Slider($, sliderContext, options);
1986    SliderInitializer.initialize(sliderContext);
1987
1988    this.reset();
1989    this.slider.run();
1990  };
1991  /**
1992   * end of Carousel class
1993   */
1994
1995  /* Carousel touch support */
1996  Carousel.prototype.swipeSlide = function () {
1997    var $wrapper = this.slider.context.$wrapper,
1998      swiper = new Swiper($wrapper[0]);
1999
2000    swiper.onSwipeLeft((e) =>
2001      this.slider.context.owner.onChangeCurrentSlide(e, 1, this.slider.context)
2002    );
2003    swiper.onSwipeRight((e) =>
2004      this.slider.context.owner.onChangeCurrentSlide(e, -1, this.slider.context)
2005    );
2006  };
2007
2008  Carousel.prototype.maxSlideInfoHeight = function () {
2009    var maxHeight = 0,
2010      slideInfo =
2011        this.$slides[0] && this.$slides[0].querySelector(".slide-info");
2012
2013    if (slideInfo) {
2014      maxHeight = slideInfo.offsetHeight;
2015    }
2016    for (var i = 1; i < this.$slides.length; i++) {
2017      var slideInfo = this.$slides[i].querySelector(".slide-info");
2018
2019      if (!slideInfo) {
2020        continue;
2021      }
2022
2023      var currSlideInfoHeight = slideInfo.offsetHeight;
2024
2025      if (maxHeight < currSlideInfoHeight) {
2026        maxHeight = currSlideInfoHeight;
2027      }
2028    }
2029    return maxHeight;
2030  };
2031
2032  Carousel.prototype.resizeWrapper = function () {
2033    var slideInfoHeight = this.maxSlideInfoHeight(),
2034      wrapper = this.slider.context.$wrapper;
2035    wrapper.find(".slide-info").css({
2036      "min-height": slideInfoHeight,
2037    });
2038  };
2039
2040  pub.initInstance = function (component) {
2041    const defaultProperties = {
2042      "timeout": 2147483647,
2043      "isPauseEnabled": true,
2044      "transition": "BasicTransition",
2045  };
2046    var properties = component.data("properties") || defaultProperties,
2047      component = component.find(".carousel-inner"),
2048      id = component.attr("data-id"),
2049      self = component.eq(0),
2050      querySlideIndex = parseInt(
2051        XA.queryString.getQueryParam(
2052          component.closest(".component.carousel").attr("id") || "carousel"
2053        )
2054      ),
2055      validQueryParam =
2056        typeof querySlideIndex !== "undefined" &&
2057        !isNaN(querySlideIndex) &&
2058        querySlideIndex < component.find(".sxa-numbers").length,
2059      context,
2060      settings,
2061      $currentSlide,
2062      $slides;
2063
2064    if (properties) {
2065      if (!properties.navigation) {
2066        properties.navigation = {
2067          item: {},
2068          prevItem: {},
2069          nextItem: {},
2070          isEnabled: validQueryParam ? false : true,
2071        };
2072      }
2073      properties.navigation.item.selector = "[data-id='" + id + "'] .nav-items"; //properties.navigation.item.selector;
2074      properties.navigation.prevItem.selector = "#" + id + " .nav";
2075      properties.navigation.nextItem.selector = "#" + id + " .nav";
2076
2077      var carousel = new Carousel($);
2078      carousel.init(component, properties);
2079
2080      $(document).ready(function () {
2081        carousel.resizeWrapper();
2082      });
2083
2084      if (validQueryParam) {
2085        (context = carousel.slider.context),
2086          (settings = context.transitionSettings),
2087          ($currentSlide = context.getCurrentSlide()),
2088          ($slides = context.$slides);
2089
2090        context.canChangeSlide = false;
2091        settings.$currentSlide = $currentSlide;
2092        settings.$nextSlide = $($slides[querySlideIndex]);
2093
2094        context.changeCurrentSlide(settings.$nextSlide);
2095        context.transition.perform(context.transitionSettings);
2096        context.owner.executeOnTimers("reset", context);
2097
2098        context.navigation.prepareItems(
2099          properties.navigation.item,
2100          $slides.length,
2101          $(context.$wrapper)
2102        );
2103        context.navigation.selectItem(querySlideIndex);
2104      } else {
2105        carousel.swipeSlide();
2106      }
2107    }
2108  };
2109
2110  pub.init = function () {
2111    $(".carousel").each(function () {
2112      pub.initInstance($(this));
2113    });
2114  };
2115
2116  return pub;
2117})(jQuery);
2118/**
2119 * end of XA.component.carousels module.
2120 */
2121
2122XA.register("carousels", XA.component.carousels);
2123
2124XA.component.carousels.Transitions = (function () {
2125  var pub = {};
2126
2127  /**
2128   * TransitionSettings class contains data needed for changing slides
2129   * @constructor
2130   */
2131  function TransitionSettings() {}
2132  /**
2133   * Current slide (currently displayed) jQuery object
2134   *
2135   * @member TransitionSettings
2136   */
2137  TransitionSettings.prototype.$currentSlide = null;
2138  /**
2139   * Next slide jQuery object
2140   *
2141   * @member TransitionSettings
2142   */
2143  TransitionSettings.prototype.$nextSlide = null;
2144  /**
2145   * All slides (jQuery object)
2146   *
2147   * @member TransitionSettings
2148   */
2149  TransitionSettings.prototype.$slides = null;
2150  /**
2151   * Offset between $currentSlide and $nextSlide
2152   *
2153   * @member TransitionSettings
2154   */
2155  TransitionSettings.prototype.offset = 0;
2156  /**
2157   * Callback function that must be called after animation.
2158   *
2159   * @member TransitionSettings
2160   */
2161  TransitionSettings.prototype.callback = null;
2162  /**
2163   * end of TransitionSettings class
2164   */
2165  pub.TransitionSettings = TransitionSettings;
2166
2167  /**
2168   * Transition class is a base class of all transitions.
2169   *
2170   * Important: settings.callback() (@see TransitionSettings) have to be called at the end of execution the perform() method.
2171   *
2172   * @constructor
2173   */
2174  function Transition() {}
2175  Transition.prototype = new Transition();
2176  /**
2177   * Initializes a transition with given settings (@see TransitionSettings).
2178   *
2179   * @member Transition
2180   * @param {TransitionSettings} settings  transition settings
2181   */
2182  /* eslint-disable */
2183  Transition.prototype.init = function (settings) {
2184    //implementation using settings
2185  };
2186  /* eslint-enable */
2187  /**
2188   * Returns a factor associated with settings.offset (@see TransitionSettings) that
2189   * can be usefull for some animations.
2190   *
2191   * @member Transition
2192   * @param {TransitionSettings} settings  transition settings
2193   * @return The factor; 1 if offset is higher than 0, -1 otherwise
2194   * @type Number
2195   */
2196  Transition.prototype.factor = function (settings) {
2197    return settings.offset > 0 ? 1 : -1;
2198  };
2199  /**
2200   * This method is called used by carousels to change slides.
2201   *
2202   * Important: settings.callback() (@see TransitionSettings) have to be called at the end of this method execution.
2203   *
2204   * @member Transition
2205   * @param {TransitionSettings} settings  transition settings
2206   */
2207  Transition.prototype.perform = function (settings) {
2208    settings.callback();
2209  };
2210  /**
2211   * End of Transition class
2212   */
2213  pub.Transition = Transition;
2214
2215  /**
2216   * BasicTransition class changes slides without any animation.
2217   * Do not remove this class, because carousels use it by default,
2218   * if requested transition cannot be found.
2219   * @constructor
2220   */
2221  function BasicTransition() {}
2222  BasicTransition.prototype = new Transition();
2223  BasicTransition.constructor = BasicTransition;
2224  /**
2225   * @member BasicTransition
2226   */
2227  BasicTransition.prototype.perform = function (settings) {
2228    settings.$currentSlide.hide();
2229    settings.$nextSlide.show();
2230
2231    settings.callback();
2232  };
2233  /**
2234   * End of BasicTransition class
2235   */
2236  pub.BasicTransition = BasicTransition;
2237
2238  /**
2239   * FadeInTransition class changes slides by fading in new slide.
2240   * This class can be removed if effect is not used.
2241   * @constructor
2242   */
2243  function FadeInTransition() {}
2244  FadeInTransition.prototype = new Transition();
2245  FadeInTransition.constructor = FadeInTransition;
2246  /**
2247   * @member FadeInTransition
2248   */
2249  FadeInTransition.prototype.init = function () {
2250    /*settings.$slides.css({
2251         'position': 'absolute',
2252         'top': '0px',
2253         'left': '0px'
2254         });*/
2255  };
2256  /**
2257   * @member FadeInTransition
2258   */
2259  FadeInTransition.prototype.perform = function (settings) {
2260    var zIndexAttrib = "z-index",
2261      $parent = settings.$slides.parent(),
2262      $nextSlide = settings.$nextSlide;
2263
2264    $parent.css(zIndexAttrib, 0);
2265    $nextSlide.css(zIndexAttrib, 1);
2266    settings.$slides.css({
2267      position: "relative",
2268    });
2269
2270    settings.$nextSlide.css({
2271      position: "absolute",
2272      top: "0",
2273      bottom: "0",
2274      left: "0",
2275      right: "0",
2276    });
2277
2278    $nextSlide.fadeIn(function () {
2279      settings.$currentSlide.hide();
2280
2281      settings.$nextSlide.css({
2282        position: "relative",
2283        left: "0",
2284        transform: "none",
2285      });
2286
2287      $nextSlide.css(zIndexAttrib, "");
2288      $parent.css(zIndexAttrib, "");
2289
2290      settings.callback();
2291    });
2292  };
2293  /**
2294   * End of FadeInTransition class
2295   */
2296  pub.FadeInTransition = FadeInTransition;
2297
2298  /**
2299   * SlideHorizontallyTransition class changes slides by sliding them horizontally.
2300   * This class can be removed if effect is not used.
2301   * If offset (difference between index of currently displayed slide and index of slide that will be shown)
2302   * is greater than 0, slides are sliding to the left. Otherwise (offset is lower than 0), slides are sliding
2303   * to the right.
2304   * When slide change is raised automatically, slides are always sliding to right (offset == 1).
2305   * If user raises slides change, slides are sliding:
2306   * - to left, if offset is greater than 0 (slide with higher index will be shown or user clicks 'next' navigation item),
2307   * - to right, if offset is lower than 0 (slide with lower index will be shown or user clicks 'prev' navigation item).
2308   * @constructor
2309   */
2310  function SlideHorizontallyTransition() {}
2311  SlideHorizontallyTransition.prototype = new Transition();
2312  SlideHorizontallyTransition.constructor = SlideHorizontallyTransition;
2313  /**
2314   * @member SlideHorizontallyTransition
2315   */
2316  SlideHorizontallyTransition.prototype.onAnimationComplete = function (
2317    settings,
2318    $parent
2319  ) {
2320    settings.$currentSlide.hide();
2321    settings.$nextSlide.css({
2322      top: "",
2323      bottom: "",
2324      left: "",
2325      position: "",
2326      width: "",
2327    });
2328
2329    $parent.css({
2330      left: "",
2331    });
2332
2333    $parent.css("margin-left", "");
2334
2335    settings.callback();
2336  };
2337  /**
2338   * @member SlideHorizontallyTransition
2339   */
2340  SlideHorizontallyTransition.prototype.perform = function (settings, offset) {
2341    var factor = this.factor(settings),
2342      onAnimationComplete = this.onAnimationComplete,
2343      width = settings.$currentSlide.width(),
2344      $parent = settings.$slides.parent();
2345
2346    settings.$nextSlide.css({
2347      top: "0",
2348      bottom: "0",
2349      left: "100%",
2350      position: "absolute",
2351      width: "100%",
2352    });
2353    if (offset > 0) {
2354      settings.$nextSlide.css({
2355        left: "100%",
2356      });
2357    } else {
2358      settings.$nextSlide.css({
2359        left: "-100%",
2360      });
2361    }
2362    settings.$nextSlide.show();
2363    $parent.animate(
2364      {
2365        left: -factor * width + "px",
2366      },
2367      function () {
2368        onAnimationComplete(settings, $parent);
2369      }
2370    );
2371  };
2372  /**
2373   * End of SlideHorizontallyTransition class
2374   */
2375  pub.SlideHorizontallyTransition = SlideHorizontallyTransition;
2376
2377  /**
2378   * SlideVerticallyTransition class changes slides by sliding them vertically.
2379   * This class can be removed if this effect is not used.
2380   * If offset (difference between index of currently displayed slide and index of next slide)
2381   * is greater than 0, slides are sliding from up to down. Otherwise (offset is lower than 0), slides are sliding
2382   * from down to up.
2383   * When slide change is raised automatically, slides are always sliding from up to down (offset == 1).
2384   * If user raises slides change, slides are sliding:
2385   * - from up to down, if offset is greater than 0 (slide with higher index will be shown or user clicks 'next' navigation item),
2386   * - from down to up, if offset is lower than 0 (slide with lower index will be shown or user clicks 'prev' navigation item).
2387   * @constructor
2388   */
2389  function SlideVerticallyTransition() {}
2390  SlideVerticallyTransition.prototype = new Transition();
2391  SlideVerticallyTransition.constructor = SlideVerticallyTransition;
2392  /**
2393   * @member SlideVerticallyTransition
2394   */
2395  SlideVerticallyTransition.prototype.onAnimationComplete = function (
2396    settings,
2397    $parent
2398  ) {
2399    settings.$currentSlide.hide();
2400    settings.$nextSlide.css({
2401      top: "",
2402      bottom: "",
2403      left: "",
2404      right: "",
2405      position: "",
2406      width: "",
2407    });
2408
2409    $parent.css("top", "");
2410    $parent.css("margin-top", "");
2411
2412    settings.callback();
2413  };
2414  /**
2415   * @member SlideVerticallyTransition
2416   */
2417  SlideVerticallyTransition.prototype.perform = function (settings, offset) {
2418    var factor = this.factor(settings),
2419      onAnimationComplete = this.onAnimationComplete,
2420      height = settings.$currentSlide.height(),
2421      $parent = settings.$slides.parent();
2422
2423    settings.$nextSlide.css({
2424      left: "0",
2425      right: "0",
2426      position: "absolute",
2427      width: "100%",
2428    });
2429    if (offset > 0) {
2430      settings.$nextSlide.css({
2431        top: "-100%",
2432        bottom: "100%",
2433      });
2434    } else {
2435      settings.$nextSlide.css({
2436        top: "100%",
2437        bottom: "-100%",
2438      });
2439    }
2440    settings.$nextSlide.show();
2441
2442    $parent.animate(
2443      {
2444        top: factor * height,
2445      },
2446      function () {
2447        onAnimationComplete(settings, $parent);
2448      }
2449    );
2450  };
2451  /**
2452   * SlideVerticallyTransition class
2453   */
2454  pub.SlideVerticallyTransition = SlideVerticallyTransition;
2455
2456  return pub;
2457})(jQuery);
2458/**
2459 * end of XA.component.carousels.Transitions module.
2460 */
2461
2462/**
2463 * XAContext
2464 *
2465 * XA.component.carousels.IndicatorViews module.
2466 *
2467 * Exposes View class, which is a base class of all 'time indicator' views used by carousels (@see XA.component.carousels, @see View).
2468 * Also exposes implementation of these 'time indicator' views:
2469 * - ProgressBarView - shows the progress of time with a progress bar,
2470 * - RotatorView - shows the progress of time with the filling up ring.
2471 * Carousel takes the class constructor by name from this module (it is given in options object of carousel; @see XA.component.carousels).
2472 * If there is a need to implement the new 'time indicator' view, create a new class
2473 * by inheriting from View class and add it to this module. During implementation of a new 'time indicator'
2474 * view the XA.component.carousels.IndicatorsView.Tools namespace. It contains:
2475 * - isCssSupported(props) function, which checks if any of CSS properties is supported (props - array of properties),
2476 * - isTransformSupported() function, which checks if CSS 3 'transform' is supported.
2477 *
2478 * Example view implementation (opacity increases with a progress of the time):
2479 * (function() {
2480 *     var View = XA.component.carousels.IndicatorViews.View;
2481 *
2482 *     function SampleView (selector, options) {
2483 *         //base constructor have to be called
2484 *         View.call(this, selector);
2485 *     }
2486 *
2487 *     SampleView.prototype = new View();
2488 *     SampleView.constructor = SampleView;
2489 *
2490 *     SampleView.prototype.init = function (timeout) {
2491 *         //base method have to be called
2492 *         View.prototype.init.call(this, timeout);
2493 *
2494 *         //initialization code - not needed in this example
2495 *     };
2496 *
2497 *     SampleView.prototype.reset = function () {
2498 *         //base method have to be called
2499 *         View.prototype.reset.call(this);
2500 *
2501 *         //reseting 'time indicator' view
2502 *         this.$indicator.stop(true);
2503 *         this.$indicator.css('opacity', 0);
2504 *     };
2505 *
2506 *     SampleView.prototype.pause = function () {
2507 *         //stoping 'time indicator' view animation
2508 *         this.$indicator.stop(true);
2509 *     };
2510 *
2511 *     SampleView.prototype.play = function () {
2512 *         //starting/resuming 'time indicator' view animation
2513 *         this.$indicator.animate({
2514 *             'opacity': 1
2515 *         }, this.timeout - this.timeElapsed, 'linear');
2516 *     };
2517 *
2518 *     XA.component.carousels.IndicatorViews.SampleView = SampleView;
2519 * }());
2520 *
2521 */
2522XA.component.carousels.IndicatorViews = (function ($) {
2523  var pub = {},
2524    supportElementStyle = null;
2525
2526  /**
2527   * Checks if the CSS properties are supported.
2528   *
2529   * @param {Array} props     array of properties to be checked
2530   * @return true if any of CSS properties is supported, false otherwise
2531   * @type Boolean
2532   */
2533  function isCssSupported(props) {
2534    var i,
2535      isSupported = false;
2536
2537    if (supportElementStyle === null) {
2538      supportElementStyle = document.createElement("supportElement").style;
2539    }
2540
2541    for (i = 0; i < props.length; i++) {
2542      if (supportElementStyle[props[i]] !== undefined) {
2543        isSupported = true;
2544        break;
2545      }
2546    }
2547
2548    return isSupported;
2549  }
2550
2551  /**
2552   * Checks if CSS 3 'transform' is supported.
2553   *
2554   * @return true if CSS 3 'transform' is supported, false otherwise
2555   * @type Boolean
2556   */
2557  function isTransformSupported() {
2558    return isCssSupported([
2559      "transformProperty",
2560      "WebkitTransform",
2561      "MozTransform",
2562      "OTransform",
2563      "msTransform",
2564    ]);
2565  }
2566
2567  /**
2568     * XA.component.carousels.IndicatorViews.Tools namespace
2569     *
2570     This namespace can be removed if RotatorView class is not used (@see RotatorView)
2571     */
2572  pub.Tools = {};
2573  pub.Tools.isCssSupported = isCssSupported;
2574  pub.Tools.isTransformSupported = isTransformSupported;
2575  /**
2576   * End of namespace
2577   */
2578
2579  /**
2580   * View class is a base class of all 'time indicator' views
2581   * @constructor
2582   * @param {String} selector a selector used for searching
2583   * @param {Object} options   View options object
2584   */
2585  /* eslint-disable */
2586  function View(selector, options) {
2587    /**
2588     * A jQuery object containing element that will be animated to show time progress.
2589     *
2590     * @member View
2591     */
2592
2593    this.$indicator = $(selector);
2594  }
2595  /* eslint-enable */
2596  /**
2597   * Initializes the view.
2598   *
2599   * @member Viewion
2600   * @param {Number} timeout   a timeout to the end of whole indicator animation
2601   */
2602  View.prototype.init = function (timeout) {
2603    this.timeElapsed = 0;
2604    this.timeout = timeout;
2605  };
2606  /**
2607   * Resets the view
2608   *
2609   * @member View
2610   */
2611  View.prototype.reset = function () {
2612    this.timeElapsed = 0;
2613  };
2614  /**
2615   * Starts/Renews the view animation.
2616   *
2617   * @member View
2618   */
2619  View.prototype.play = function () {};
2620  /**
2621   * Pauses the view animation.
2622   *
2623   * @member View
2624   */
2625  View.prototype.pause = function () {};
2626  /**
2627   * Updates the time that elapsed since animation began.
2628   *
2629   * @member View
2630   */
2631  View.prototype.update = function (timeElapsed) {
2632    this.timeElapsed = timeElapsed;
2633  };
2634  /**
2635   * end of View class
2636   */
2637  pub.View = View;
2638
2639  /**
2640   * ProgressBarView class provides a logic for animate a 'time indicator',
2641   * that looks like progress bar.
2642   *
2643   * Options object:
2644   * {
2645   *     'opacity': Number value //between 0 and 1; default is 0.8
2646   * }
2647   *
2648   * This class can be removed if this kind of view is not used.
2649   *
2650   * @constructor
2651   * @param {String} selector a selector used for searching
2652   * @param {Object} options   View options object
2653   */
2654  function ProgressBarView(selector, options) {
2655    View.call(this, selector);
2656
2657    var defaults = {
2658      opacity: 0.8,
2659    };
2660
2661    this.settings = $.extend(true, {}, defaults, options);
2662
2663    this.$container = this.$indicator;
2664    this.$indicator = this.$indicator.find("div");
2665  }
2666  ProgressBarView.prototype = new View();
2667  ProgressBarView.constructor = ProgressBarView;
2668  /**
2669   * @member ProgressBarView
2670   */
2671  ProgressBarView.prototype.init = function (timeout) {
2672    View.prototype.init.call(this, timeout);
2673
2674    var opacity = this.settings.opacity;
2675    this.$container.css("opacity", opacity);
2676    this.$indicator.css("opacity", opacity);
2677  };
2678  /**
2679   * @member ProgressBarView
2680   */
2681  ProgressBarView.prototype.reset = function () {
2682    View.prototype.reset.call(this);
2683
2684    this.$indicator.stop(true);
2685    this.$indicator.css("width", "0px");
2686  };
2687  /**
2688   * @member ProgressBarView
2689   */
2690  ProgressBarView.prototype.pause = function () {
2691    this.$indicator.stop(true);
2692  };
2693  /**
2694   * @member ProgressBarView
2695   */
2696  ProgressBarView.prototype.play = function () {
2697    this.$indicator.animate(
2698      {
2699        width: "100%",
2700      },
2701      this.timeout - this.timeElapsed,
2702      "linear"
2703    );
2704  };
2705  /**
2706   * end of ProgressBarView class
2707   */
2708  pub.ProgressBarView = ProgressBarView;
2709
2710  /**
2711   * RotatorView class provides a logic for animate a 'time indicator',
2712   * that shows the progress of time with the filling up ring
2713   *
2714   * Options object:
2715   * {
2716   *     'opacity': Number value //between 0 and 1; default is 0.5
2717   * }
2718   *
2719   * This class can be removed if this kind of view is not used.
2720   *
2721   * @constructor
2722   * @param {String} selector a selector used for searching
2723   * @param {Object} options   View options object
2724   */
2725  function RotatorView(selector, options) {
2726    View.call(this, selector);
2727
2728    var defaults = {
2729      opacity: 0.5,
2730    };
2731
2732    this.settings = $.extend(true, {}, defaults, options);
2733    this.$mask = this.$indicator.find("span.mask").first();
2734    this.$rotator = this.$indicator.find("span.rotator").first();
2735
2736    function rotateCss(deg) {
2737      var value = "rotate(" + deg + "deg)";
2738
2739      return {
2740        "-webkit-transform": value,
2741        "-moz-transform": value,
2742        "-o-transform": value,
2743        "-ms-transform": value,
2744        transform: value,
2745      };
2746    }
2747
2748    function animateRotator($rotator, options) {
2749      var defaults = {
2750          fontSize: "180px",
2751          animateOptions: {
2752            step: function (now) {
2753              $rotator.css(rotateCss(now));
2754            },
2755            easing: "linear",
2756          },
2757        },
2758        settings = $.extend(true, {}, defaults, options);
2759
2760      $rotator.animate(
2761        {
2762          "font-size": settings.fontSize,
2763        },
2764        settings.animateOptions
2765      );
2766    }
2767
2768    function phaseTwoAnimation($mask, $rotator, duration) {
2769      $rotator.addClass("half");
2770      $mask.addClass("half");
2771
2772      animateRotator($rotator, {
2773        fontSize: "360px",
2774        animateOptions: {
2775          duration: duration,
2776        },
2777      });
2778    }
2779
2780    function phaseOneAnimation($mask, $rotator, duration, phaseTwoDuration) {
2781      animateRotator($rotator, {
2782        animateOptions: {
2783          duration: duration,
2784          complete: function () {
2785            phaseTwoAnimation($mask, $rotator, phaseTwoDuration);
2786          },
2787        },
2788      });
2789    }
2790
2791    this.resetCss = function () {
2792      this.$rotator.removeClass("half");
2793      this.$rotator.css(rotateCss(0));
2794      this.$rotator.css("font-size", "0px");
2795
2796      this.$mask.removeClass("half");
2797    };
2798
2799    this.playPhaseOne = function () {
2800      var duration = this.timeout / 2 - this.timeElapsed;
2801      phaseOneAnimation(this.$mask, this.$rotator, duration, this.timeout / 2);
2802    };
2803
2804    this.playPhaseTwo = function () {
2805      var duration = this.timeout - this.timeElapsed;
2806      phaseTwoAnimation(this.$mask, this.$rotator, duration);
2807    };
2808  }
2809  RotatorView.prototype = new View();
2810  RotatorView.constructor = RotatorView;
2811  /**
2812   * @member RotatorView
2813   */
2814  RotatorView.prototype.init = function (timeout) {
2815    View.prototype.init.call(this, timeout);
2816
2817    if (isTransformSupported()) {
2818      this.$indicator.show();
2819      this.$mask.css("opacity", this.settings.opacity);
2820    }
2821  };
2822  /**
2823   * @member RotatorView
2824   */
2825  RotatorView.prototype.reset = function () {
2826    View.prototype.reset.call(this);
2827
2828    this.$rotator.stop(true);
2829    this.resetCss();
2830  };
2831  /**
2832   * @member RotatorView
2833   */
2834  RotatorView.prototype.pause = function () {
2835    this.$rotator.stop(true);
2836  };
2837  /**
2838   * @member RotatorView
2839   */
2840  RotatorView.prototype.play = function () {
2841    var phase = this.playPhaseOne;
2842    if (this.timeElapsed >= this.timeout / 2) {
2843      phase = this.playPhaseTwo;
2844    }
2845
2846    phase.call(this);
2847  };
2848  /**
2849   * end of RotatorView class
2850   */
2851  pub.RotatorView = RotatorView;
2852
2853  return pub;
2854})(jQuery);
2855/**
2856 * end of XA.component.carousels.IndicatorViews module.
2857 */
2858
2859
2860/*  component-container  */
2861/**
2862 * Component Container
2863 * @module Container
2864 * @param  {jQuery} $ Instance of jQuery
2865 * @param  {Underscore} _ Instance of Underscore
2866 * @return {Object} List of Container methods
2867 */
2868XA.component.parallax = (function($, _) {
2869    /**
2870     * This object stores all public api methods
2871     * @type {Object.<Methods>}
2872     * @memberOf module:Container
2873     * */
2874    var api = {};
2875    /**
2876     * Check if document size is less than 768px
2877     * @memberOf module:Container
2878     * @method
2879     * @private
2880     * @return {boolean} True|False
2881     */
2882    function checkMobile() {
2883        return $(window).width() < 768;
2884    }
2885     /**
2886     * Make parralax effect for container
2887     * @memberOf module:Container
2888     * @method
2889     * @param {jQuery.<Element>} $el 
2890     * @private
2891     */
2892    function makeParallax($el) {
2893        var $bg = $el.children(".component-content"),
2894            vHeight = $(window).height(),
2895            elOffset = $bg[0].offsetTop,
2896            elHeight = $bg[0].offsetHeight,
2897            isMobile = checkMobile();
2898
2899        function parallax() {
2900            if (isMobile) {
2901                return false;
2902            }
2903
2904            var offset = $(window).scrollTop();
2905
2906            if ((elOffset <= offset + vHeight) && (elOffset + elHeight >= offset)) {
2907                $bg.css("background-position", "50% " + Math.round((elOffset - offset) * 3 / 8) + "px");
2908            }
2909        }
2910
2911        parallax();
2912
2913        $(document).on("scroll", _.throttle(parallax, 10));
2914        $(window).on("resize", _.throttle(function() {
2915            isMobile = checkMobile();
2916            isMobile ? $bg.css("background-position", "50% 0") : parallax();
2917        }, 150));
2918    }
2919    /**
2920     * Call
2921     * ["makeParallax"]{@link  module:Container.makeParallax} method
2922     * @memberOf module:Container
2923     * @method
2924     * @param {jQuery} component Root DOM element of Container component wrapped by jQuery
2925     * of container component
2926     * @alias module:Container.initInstance
2927     */
2928    api.initInstance=function(component) {
2929        makeParallax(component);
2930    }
2931    /**
2932     * Finds all not-initialized Container
2933     * components and runs each container in a loop.
2934     * ["initInstance"]{@link module:Container.initInstance}
2935     * method.
2936     * @memberOf module:Container
2937     * @alias module:Container.init
2938     */
2939    api.init = function() {
2940        $('.parallax-background:not(.initialized)').each(function() {
2941            api.initInstance($(this));
2942            $(this).addClass('initialized');
2943        });
2944    };
2945
2946    return api;
2947
2948})(jQuery, _);
2949
2950XA.register('parallax-background', XA.component.parallax);
2951
2952/*  component-disqus  */
2953/**
2954 * Component Disqus
2955 * @module Disqus
2956 * @param  {jQuery} $ Instance of jQuery
2957 * @param  {Document} document Instance of Document
2958 * @return {Object} List of Disqus methods
2959 */
2960XA.component.disqus = (function($, document) {
2961    /**
2962     * This object stores all public api methods
2963     * @type {Object.<Methods>}
2964     * @memberOf module:Archive
2965     * */
2966    var api = {};
2967    /**
2968     * initDisqus method create script element  for discuss component
2969     * @memberOf module:Disqus
2970     * @method
2971     * @param {Object} prop option of disqus component
2972     * @alias module:Disqus.initDisqus
2973     * @private
2974     */
2975    function initDisqus(prop) {
2976        var dsq = document.createElement("script");
2977        dsq.type = "text/javascript";
2978        dsq.async = true;
2979        dsq.src = "//" + prop.disqus_shortname + ".disqus.com/embed.js";
2980        (
2981            document.getElementsByTagName("head")[0] ||
2982            document.getElementsByTagName("body")[0]
2983        ).appendChild(dsq);
2984    }
2985    /**
2986     * initInstance method sets up disqus_config and calls
2987     * [".initDisqus"]{@link module:Disqus.initDisqus}  method.
2988     * @memberOf module:Disqus
2989     * @method
2990     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
2991     * @param {Object} prop option of disqus component
2992     * @alias module:Disqus.initInstance
2993     */
2994    api.initInstance = function(component, prop) {
2995        window.disqus_config = function() {
2996            this.page.url = prop.disqus_url;
2997            this.page.identifier = prop.disqus_identifier;
2998            this.page.title = prop.disqus_title;
2999            this.page.category_id = prop.disqus_category_id;
3000        };
3001
3002        if (component.find("#disqus_thread").length > 0) {
3003            initDisqus(prop);
3004        }
3005    };
3006    /**
3007     * init method calls in a loop for each
3008     * disqus component on a page and runs Disqus's
3009     * [".initInstance"]{@link module:Disqus.initInstance}  method.
3010     * @memberOf module:Disqus
3011     * @alias module:Disqus.init
3012     */
3013    api.init = function() {
3014        var disqus = $(".disqus:not(.initialized)");
3015        disqus.each(function() {
3016            var properties = $(this).data("properties");
3017            api.initInstance($(this), properties);
3018            $(this).addClass("initialized");
3019        });
3020    };
3021
3022    return api;
3023})(jQuery, document);
3024
3025XA.register("disqus", XA.component.disqus);
3026
3027
3028/*  component-facebook  */
3029/**
3030 * Component facebook
3031 * @module Facebook
3032 * @param  {jQuery} $ Instance of jQuery
3033 * @param  {Document} document Instance of Document
3034 * @return {Object} List of Facebook methods
3035 */
3036XA.component.facebook = (function($, document) {
3037    /**
3038     * This object stores all public api methods
3039     * @type {Object.<Methods>}
3040     * @memberOf module:Facebook
3041     */
3042    var api = {};
3043    /**
3044     * initInstance method sets up facebook properties and
3045     * adds facebook script
3046     * @memberOf module:Facebook
3047     * @method
3048     * @alias module:Facebook.initInstance
3049     */
3050    api.initInstance = function() {
3051        (function(d, s, id) {
3052            var js,
3053                script = d.getElementsByTagName(s)[0];
3054            if (d.getElementById(id)) {
3055                return;
3056            }
3057            js = d.createElement(s);
3058            js.id = id;
3059            js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
3060            script.insertBefore(js, script.firstChild);
3061        })(document, "script", "facebook-jssdk");
3062    };
3063    /**
3064     * init method calls in a loop for each
3065     * facebook component on a page and runs Facebook's
3066     * [".initInstance"]{@link module:Facebook.initInstance}  method.
3067     * @memberOf module:Facebook
3068     * @alias module:Facebook.init
3069     */
3070    api.init = function() {
3071        var facebook = $(".fb-comments:not(.initialized)");
3072
3073        facebook.each(function() {
3074            api.initInstance();
3075            $(this).addClass("initialized");
3076        });
3077    };
3078
3079    return api;
3080})(jQuery, document);
3081
3082XA.register("facebook", XA.component.facebook);
3083
3084
3085/*  component-flip  */
3086/**
3087 * Component Flip
3088 * @module Flip
3089 * @param  {jQuery} $ Instance of jQuery
3090 * @return {Object} List of flip methods
3091 */
3092XA.component.flip = (function($) {
3093    var initialized = false;
3094
3095    /**
3096     * This object stores all public api methods
3097     * @type {Object.<Methods>}
3098     * @memberOf module:Flip
3099     * @
3100     * */
3101    var api = {
3102            /**
3103             * equalSideHeight set css "min-height" property with value that is
3104             * equal to size of bigger flip side 
3105             * @param {jQuery<DOMElement>} $el  Root DOM element of Flip component wrapped by jQuery 
3106             * @memberof module:Flip
3107             * @method equalSideHeight
3108             */
3109            equalSideHeight: function($el) {
3110                var side0 = $el.find(".Side0"),
3111                    side1 = $el.find(".Side1"),
3112                    slide0Height = this.calcSlideSizeInToggle(side0),
3113                    slide1Height = this.calcSlideSizeInToggle(side1),
3114                    maxHeight = Math.max(slide0Height, slide1Height);
3115                $el.find(".flipsides").css({ "min-height": maxHeight + "px" });
3116                side0.add(side1).css({ bottom: 0 });
3117            },
3118            /**
3119             * calcSlideSizeInToggle calculates size of slide content
3120             * @param {jQuery<DOMElement>} $slide Slide DOM Element of flip component
3121             * @memberof module:Flip
3122             * @method calcSlideSizeInToggle
3123             * @return {number} size
3124             */
3125            calcSlideSizeInToggle: function($slide) {
3126                var child = $slide.find(">div"),
3127                    size = 0;
3128                child.each(function(pos, el) {
3129                    size += $(el).outerHeight(true);
3130                });
3131                size += parseInt($slide.css("padding-top"));
3132                size += parseInt($slide.css("padding-bottom"));
3133                return size;
3134            },
3135            /**
3136             * equalSideHeightInToggle method that called from component toggle 
3137             * to make all slides inside same height
3138             * @param {jQuery<DOMElement>} $el  Root DOM element of Flip component wrapped by jQuery 
3139             * @memberof module:Flip
3140             * @method equalSideHeightInToggle
3141             */
3142            equalSideHeightInToggle: function($el) {
3143                var side0 = $el.find(".Side0"),
3144                    side1 = $el.find(".Side1"),
3145                    slide0Height = this.calcSlideSizeInToggle(side0),
3146                    slide1Height = this.calcSlideSizeInToggle(side1),
3147                    maxHeight = Math.max(slide0Height, slide1Height);
3148                $el.find(".flipsides").css({ "min-height": maxHeight + "px" });
3149                side0.add(side1).css({ bottom: 0 });
3150            }
3151        };
3152
3153    function detectMobile() {
3154        return "ontouchstart" in window;
3155    }
3156    /**
3157     * calcHeightOnResize method calls
3158     * ["equalSideHeight"]{@link module:Flip.equalSideHeight} method
3159     * for all initialized Flip components
3160     * @memberOf module:Flip
3161     * @method
3162     * @alias module:Flip.initInstance
3163     * @private
3164     */
3165    function calcHeightOnResize() {
3166        var flip = $(".flip.initialized");
3167        flip.each(function() {
3168            api.equalSideHeight($(this));
3169        });
3170    }
3171    /**
3172     * initInstance method binds toggling "active" class for component
3173     * an Flip element
3174     * @memberOf module:Flip
3175     * @method
3176     * @param {jQuery} component Root DOM element of flip component wrapped by jQuery
3177     * @alias module:Flip.initInstance
3178     */
3179    api.initInstance = function(component) {
3180        // Set tabindex=0 for first header
3181        component.find('[class*="Side0"]').attr("tabindex", "0");
3182        //
3183        if (component.hasClass("flip-hover") && !detectMobile()) {
3184            component.hover(
3185                function() {
3186                    component.addClass("active");
3187                },
3188                function() {
3189                    component.removeClass("active");
3190                }
3191            );
3192        } else {
3193            component.on("click", function() {
3194                component.toggleClass("active");
3195            });
3196        }
3197    };
3198
3199    api.initFlips = function() {
3200        var flip = $(".flip:not(.initialized)");
3201
3202        flip.each(function () {
3203            var $flipModule = $(this).find(".flipsides");
3204            $flipModule.find(".Side0").attr("tabindex", "0");
3205            api.initInstance($(this));
3206            $(this).addClass("initialized");
3207
3208            api.equalSideHeight($(this));
3209        });
3210    }
3211
3212    /**
3213     * init method calls in a loop for each
3214     * flip component on a page and runs Flip's
3215     * ["initInstance"]{@link module:Flip.api.initInstance},
3216     * ["equalSideHeight"]{@link module:Flip.equalSideHeight} methods.
3217     * Added watcher to "resize" event on window that call
3218     * ["calcHeightOnResize"]{@link module:Flip.calcHeightOnResize}
3219     *
3220     * @memberOf module:Flip
3221     * @alias module:Flip.init
3222     */
3223    api.init = function() {
3224        $(window).on("resize", function() {
3225            calcHeightOnResize();
3226        });
3227
3228        if (!initialized) {
3229            $(document).ready(function () {
3230                api.initFlips();
3231                initialized = true;
3232            })
3233        } else {
3234            api.initFlips();
3235        }
3236    };
3237    return api;
3238})(jQuery, document);
3239
3240XA.register("flip", XA.component.flip);
3241
3242
3243/*  component-fullcalendar  */
3244/* global googleCalendarApiKey:true */
3245/**
3246 * Component Fullcalendar
3247 * @module Fullcalendar
3248 * @param  {jQuery} $ Instance of jQuery
3249 * @return {Object} List of archive methods
3250 */
3251XA.component.calendar = (function($) {
3252    /**
3253     * This class is used by [Fullcalendar]{@link module:Fullcalendar} module for
3254     * storing events option
3255     * @class GetEvents
3256     * @memberOf module:Fullcalendar
3257     * @param {string} selector selector of event element
3258     * @param {Object} options options of component
3259     */
3260    function GetEvents(selector, options) {
3261        this.data = options.data;
3262        this.selector = selector;
3263        this.options = options;
3264        this.events = [];
3265
3266        this.checkSource();
3267    }
3268    /**
3269     * checkSource method calls ["getJson"]{@link module:Fullcalendar.GetEvents.getJson}
3270     * if "options.dataType" equal "json"
3271     * and creates instance of
3272     * ["InitCalendar"]{@link module:Fullcalendar.InitCalendar} class
3273     * @name checkSource
3274     * @function
3275     * @memberOf module:Fullcalendar.GetEvents
3276     */
3277    GetEvents.prototype.checkSource = function() {
3278        var inst = this;
3279
3280        switch (inst.options.dataType) {
3281            case "json":
3282                inst.getJson();
3283                new InitCalendar(inst.selector, inst.options, inst.events);
3284                break;
3285            case "gcalendar":
3286                new InitCalendar(inst.selector, inst.options, inst.events);
3287                break;
3288        }
3289    };
3290    /**
3291     * getJson method fills array of events with
3292     * new event
3293     * @name getJson
3294     * @function
3295     * @memberOf module:Fullcalendar.GetEvents
3296     */
3297    GetEvents.prototype.getJson = function() {
3298        var inst = this,
3299            date,
3300            dateEnd,
3301            allDay = false,
3302            tempObj = [];
3303
3304        $.each(inst.data, function() {
3305            date = new Date(this.eventStart);
3306            dateEnd = new Date(this.eventEnd);
3307
3308            if (date === dateEnd) {
3309                allDay = true;
3310            }
3311
3312            tempObj = {
3313                title: this.eventName,
3314                start: date,
3315                end: dateEnd,
3316                eventDescription: this.eventDescription,
3317                eventLink: this.eventLink,
3318                eventClass: this.eventClass
3319            };
3320
3321            inst.events.push(tempObj);
3322        });
3323    };
3324
3325    /**
3326     * This class is used by
3327     * [GetEvents]{@link module:Fullcalendar.GetEvents} module and
3328     * initializes instances of calendar with predefined list of options
3329     * @class InitCalendar
3330     * @memberOf module:Fullcalendar
3331     * @param {string} selector DOM Root element of
3332     * @param {Object} options options of component
3333     * @param {Array} events options of event calendar ["event object"]{@link https://fullcalendar.io/docs/event-object}
3334     */
3335    function InitCalendar(selector, options, events) {
3336        var inst = this,
3337            prevNext = "",
3338            title = "",
3339            calendarTypes = "";
3340
3341        if (options.dataType === "gcalendar") {
3342            googleCalendarApiKey = options.calendarApiKey;
3343            events = options.calendarId;
3344        } else {
3345            googleCalendarApiKey = null;
3346        }
3347
3348        options.showPrevNext ? (prevNext = "prev, next") : "";
3349        options.showMonthCaptions ? (title = "title") : "";
3350
3351        for (var i in options.calendarTypes) {
3352            if (options.calendarTypes[i] === "day") {
3353                options.calendarTypes[i] = "basicDay";
3354            } else if (options.calendarTypes[i] === "week") {
3355                options.calendarTypes[i] = "basicWeek";
3356            }
3357        }
3358
3359        if (options.calendarTypes.length > 1) {
3360            calendarTypes = options.calendarTypes.join();
3361        }
3362
3363        var scLocale = options.localization.locale.toLowerCase()
3364        if (!(scLocale in $.fullCalendar.locales)) {
3365            scLocale = scLocale.split("-")[0]
3366            if (!(scLocale in $.fullCalendar.locales)) {
3367                scLocale = "en"
3368            }
3369        }
3370
3371        $(selector).fullCalendar({
3372            locale: scLocale,
3373            nextDayThreshold: "00:00",
3374
3375            buttonText: {
3376                agendaDay: options.localization.agendaDay,
3377                agendaWeek: options.localization.agendaWeek
3378            },
3379
3380            header: {
3381                left: prevNext,
3382                center: title,
3383                right: calendarTypes
3384            },
3385
3386            googleCalendarApiKey: googleCalendarApiKey,
3387            events: events,
3388            renderEvent: false,
3389            eventRender: function(event, element) {
3390                if (options.compactView && options.dataType === "json") {
3391                    $(element).css("display", "none");
3392                } else {
3393                    if (options.dataType === "json") {
3394                        inst.attachTooltip(event, element, false);
3395                    }
3396                }
3397
3398                element.addClass(event.eventClass);
3399            },
3400            eventAfterAllRender: function() {
3401                if (options.compactView && options.dataType === "json") {
3402                    inst.renderCompactCalendarEvents(selector, events);
3403                }
3404            }
3405        });
3406    }
3407    /**
3408     * attachTooltip method creates, positions, and
3409     * animates tooltips for events.
3410     * @method
3411     * @alias attachTooltip
3412     * @memberOf module:Fullcalendar.InitCalendar
3413     * @param {Object} event options of event calendar ["event object"]{@link https://fullcalendar.io/docs/event-object}
3414     * @param {DOMElement} element DOM element of an event
3415     * @param {boolean} compactCalendar  is calendar in compact mode
3416     */
3417    InitCalendar.prototype.attachTooltip = function(
3418        event,
3419        element,
3420        compactCalendar
3421    ) {
3422        var $tooltip, tooltipContent;
3423
3424        $(element).on("mouseenter", function() {
3425            tooltipContent = "";
3426            $(".calendar-tooltip").fadeOut();
3427            $(".calendar-tooltip").remove();
3428
3429            if (compactCalendar) {
3430                tooltipContent = "";
3431                $.each(event, function() {
3432                    tooltipContent +=
3433                        "<div class='compact-event'>" +
3434                        "<span class='title'>" +
3435                        this.title +
3436                        "</span>" +
3437                        "<span class='description'>" +
3438                        this.eventDescription +
3439                        "</span>" +
3440                        "<span class='link'><a href='" +
3441                        this.eventLink +
3442                        "'>Link</a></span></div>";
3443                });
3444            } else {
3445                tooltipContent =
3446                    "<span class='description'>" +
3447                    event.eventDescription +
3448                    "</span>" +
3449                    "<span class='link'>" +
3450                    event.eventLink +
3451                    "</span>";
3452            }
3453            $tooltip = $(
3454                "<div style='border-radius:5px;border:1px solid #000;position:absolute;z-index:999; paading:5px;background:#FFF' class='calendar-tooltip'><div class='arrow'>" +
3455                    "</div><div class='events'>" +
3456                    tooltipContent +
3457                    "</div></div>"
3458            );
3459
3460            $tooltip.css({
3461                left: $(this).offset().left
3462            });
3463            $tooltip.css({
3464                top: $(this).offset().top - $(this).height()
3465            });
3466            $("body").append($tooltip);
3467
3468            var timeout;
3469            $(this).unbind("mouseleave");
3470            $(this).on("mouseleave", function() {
3471                timeout = setTimeout(function() {
3472                    $tooltip.fadeOut(function() {
3473                        $(this).remove();
3474                    });
3475                }, 300);
3476
3477                $tooltip.unbind("mouseenter");
3478                $tooltip.on("mouseenter", function() {
3479                    clearTimeout(timeout);
3480                });
3481            });
3482
3483            $tooltip.unbind("mouseleave");
3484            $tooltip.on("mouseleave", function() {
3485                $(this).fadeOut(function() {
3486                    $(this).remove();
3487                });
3488            });
3489        });
3490    };
3491
3492    /**
3493     * attaches events for single days - compact calendar
3494     * @method
3495     * @alias renderCompactCalendarEvents
3496     * @memberOf module:Fullcalendar.InitCalendar
3497     * @param {Array} events  ["event object"]{@link https://fullcalendar.io/docs/event-object}
3498     * @param {string} selector selector of an event in DOM
3499     */
3500    InitCalendar.prototype.renderCompactCalendarEvents = function(
3501        selector,
3502        events
3503    ) {
3504        var inst = this,
3505            currentDay,
3506            currentDate,
3507            currentEvent,
3508            dc,
3509            mc,
3510            yc,
3511            d,
3512            m,
3513            y,
3514            de,
3515            me,
3516            ye,
3517            he,
3518            startDate,
3519            endDate,
3520            dayEvents = [];
3521
3522        $(selector)
3523            .find(".fc-day")
3524            .each(function() {
3525                currentDay = this;
3526
3527                currentDate = new Date($(this).data("date"));
3528                dc = currentDate.getDate();
3529                mc = currentDate.getMonth();
3530                yc = currentDate.getFullYear();
3531
3532                dayEvents = [];
3533                $.each(events, function() {
3534                    currentEvent = this;
3535                    startDate = new Date(this.start);
3536                    d = startDate.getDate();
3537                    m = startDate.getMonth();
3538                    y = startDate.getFullYear();
3539
3540                    if (this.end) {
3541                        endDate = new Date(this.end);
3542                        de = endDate.getDate();
3543                        me = endDate.getMonth();
3544                        ye = endDate.getFullYear();
3545                        he = endDate.getHours();
3546                    }
3547
3548                    if (
3549                        yc >= y &&
3550                        yc <= ye &&
3551                        mc >= m &&
3552                        mc <= me &&
3553                        dc >= d &&
3554                        dc <= de
3555                    ) {
3556                        if (yc == ye && mc == me && dc == de && he < 9) {
3557                            // If last day and hour < 9 do nothing
3558                        } else {
3559                            $(currentDay).addClass("selected-day");
3560                            dayEvents.push(currentEvent);
3561                        }
3562                    }
3563                });
3564
3565                if (dayEvents.length) {
3566                    inst.attachTooltip(dayEvents, currentDay, true);
3567                }
3568            });
3569    };
3570    /**
3571     * resizeCalendar method runs render of a calendar
3572     * @memberOf module:Fullcalendar
3573     * @param {string} selector  Selector of a calendar component
3574     * @private
3575     */
3576    function resizeCalendar(selector) {
3577        $(selector).fullCalendar("render");
3578    }
3579    /**
3580     * This object stores all public api methods
3581     * @type {Object.<Methods>}
3582     * @memberOf module:Fullcalendar
3583     * */
3584    var api = {};
3585    /**
3586     * initInstance method creates instance of
3587     * ["GetEvents"]{@link module:Fullcalendar.GetEvents} class and bind
3588     * ["resizeCalendar"]{@link module:Fullcalendar.resizeCalendar} to window resize
3589     * event
3590     * @memberOf module:Fullcalendar
3591     * @alias module:Fullcalendar.initInstance
3592     */
3593    api.initInstance = function(component, prop) {
3594        var selector = "#" + component.find(".event-calendar-inner").attr("id");
3595        if (prop.compactView && prop.dataType === "json") {
3596            $(this).addClass("compact-mode");
3597        }
3598
3599        new GetEvents(selector, prop);
3600
3601        $(window).resize(function() {
3602            resizeCalendar(selector);
3603        });
3604    };
3605
3606    /**
3607     * init method calls in a loop for each
3608     * full calendar component on a page and run Full calendar's
3609     * ["initInstance"]{@link module:Fullcalendar.api.initInstance} method
3610     * @memberOf module:Fullcalendar
3611     * @alias module:Fullcalendar.init
3612     */
3613    api.init = function() {
3614        $(".event-calendar:not(.initialized)").each(function() {
3615            var properties = $(this).data("properties");
3616            api.initInstance($(this), properties);
3617            $(this).addClass("initialized");
3618        });
3619    };
3620
3621    return api;
3622})(jQuery, document);
3623
3624XA.register("calendar", XA.component.calendar);
3625
3626
3627/*  component-galleria  */
3628/**
3629 * Component Galleria
3630 * @module Galleria
3631 * @param  {jQuery} $ Instance of jQuery
3632 * @return {Object} List of Galleria component methods
3633 */
3634XA.component.galleria = (function($) {
3635    /**
3636     * This object stores all public api methods
3637     * @type {Object.<Methods>}
3638     * @memberOf module:Galleria
3639     * */
3640    /* global Galleria:false */
3641    var api = {};
3642    /**
3643     * Call "Galleria.loadTheme" and  "Galleria.run"
3644     * from [galleria.io]{@link https://galleria.io/}. More about this methods you can
3645     * read [here]{@link https://docs.galleria.io/article/131-static-methods}
3646     * @memberOf module:Galleria
3647     * @method
3648     * @param {jQuery} component Root DOM element of galleria component wrapped by jQuery
3649     * @param {Object} prop Properties set in data attribute
3650     *  of galleria component
3651     * @alias module:Galleria.initInstance
3652     */
3653    api.initInstance = function(component, prop) {
3654        var id = component.find(".gallery-inner").attr("id"),
3655            script = $('script[src="' + prop.theme + '"]');
3656
3657        // Galleria not iniitalize gallery in case
3658        // if Galleria script already exists
3659        if (script) {
3660            script.remove();
3661        }
3662
3663        $(document).ready(function () {
3664            var galleriaHeight  = prop.height? prop.height: "250px"
3665			var _prop = Object.assign({}, prop);
3666			delete _prop.theme
3667            jQuery("#" + id).css("height",galleriaHeight)
3668            Galleria.loadTheme(prop.theme);
3669            Galleria.run("#" + id,_prop);
3670            
3671            Galleria.ready(function () {
3672                this.bind('image', function (e) {
3673                    e.imageTarget.alt = e.galleriaData.title;
3674                });
3675            });
3676        })
3677    };
3678    /**
3679     * Finds all not-initialized 
3680     * Gallery components and in a loop for each of them
3681     * runs
3682     * ["initInstance"]{@link module:Galleria.initInstance}
3683     * method.
3684     * @memberOf module:Galleria
3685     * @alias module:Galleria.init
3686     */
3687    api.init = function() {
3688        var gallery = $(".gallery:not(.initialized)");
3689
3690        gallery.each(function() {
3691            var properties = $(this).data("properties");
3692            api.initInstance($(this), properties);
3693            $(this).addClass("initialized");
3694        });
3695    };
3696
3697    return api;
3698})(jQuery, document);
3699
3700XA.register("galleria", XA.component.galleria);
3701
3702
3703/*  component-language-selector  */
3704/**
3705 * Component Language Selector
3706 * @module LanguageSelector
3707 * @param  {jQuery} $ Instance of jQuery
3708 * @return {Object} List of language selector methods methods
3709 */
3710XA.component.languageSelector = (function($) {
3711    /**
3712     * This object stores all public api methods
3713     * @type {Object.<Methods>}
3714     * @memberOf module:LanguageSelector
3715     * */
3716    var api = {};
3717    /**
3718     * readDataAttributes function that return
3719     * name of a language flag in format
3720     * 'flags-'+language name
3721     * @memberOf module:LanguageSelector
3722     * @param {jQuery} item
3723     * @private
3724     */
3725    function readDataAttributes(item) {
3726        var country = item.data("country-code");
3727
3728        return "flags-" + country;
3729    }
3730    /**
3731     * initLanguageSelector sets up flag classes for laguage selector items
3732     * and bind 'click' event to drop-down item that toggle visibility
3733     * @memberOf module:LanguageSelector
3734     * @param {jQuery} instance Root DOM element of language selector
3735     * component
3736     */
3737    function initLanguageSelector(instance) {
3738        var el = $(instance),
3739            header = el.find(".language-selector-select-item"),
3740            dropDownList = el.find(".language-selector-item-container"),
3741            dropDownItem = dropDownList.find(".language-selector-item");
3742
3743        var className = readDataAttributes(header);
3744        header.find(">a").addClass(className);
3745
3746        dropDownList.find(".language-selector-item").each(function() {
3747            className = readDataAttributes($(this));
3748            $(this)
3749                .find(">a")
3750                .addClass(className);
3751        });
3752
3753        header.on("click", function() {
3754            dropDownList.slideToggle();
3755        });
3756
3757        dropDownItem.on("click", function() {
3758            var url = $(this)
3759                .find("a")
3760                .attr("href");
3761
3762            window.location.href = url;
3763        });
3764    }
3765    /**
3766     * initInstance method calls
3767     * [".initLanguageSelector"]{@link module:LanguageSelector.initLanguageSelector}  method.
3768     * @memberOf module:LanguageSelector
3769     * @method
3770     * @param {jQuery} component Root DOM element of language selector component
3771     * @alias module:LanguageSelector.initInstance
3772     */
3773    api.initInstance = function(component) {
3774        initLanguageSelector(component);
3775    };
3776
3777    /**
3778     * init method calls in a loop for each
3779     * language selector component on a page and runs LanguageSelector's
3780     * [".initInstance"]{@link module:LanguageSelector.api.initInstance}  method.
3781     * @memberOf module:LanguageSelector
3782     * @alias module:LanguageSelector.init
3783     */
3784    api.init = function() {
3785        var languageSelector = $(".language-selector:not(.initialized)");
3786
3787        languageSelector.each(function() {
3788            api.initInstance(this);
3789            $(this).addClass("initialized");
3790        });
3791    };
3792
3793    return api;
3794})(jQuery, document);
3795
3796XA.register("language-selector", XA.component.languageSelector);
3797
3798
3799/*  component-navigation  */
3800/**
3801 * Component Navigation
3802 * @module Navigation
3803 * @param  {jQuery} $ Instance of jQuery
3804 * @return {Object} List of navigation methods
3805 */
3806XA.component.navigation = (function($) {
3807    var timeout = 200,
3808        timer = 0,
3809        submenu,
3810        dropDownEvents = {
3811            show: function(sm) {
3812                this.debounce();
3813                submenu = sm;
3814                submenu.closest("li").addClass("show");
3815            },
3816            debounce: function() {
3817                if (timer) {
3818                    clearTimeout(timer);
3819                    timer = null;
3820                }
3821            },
3822            hide: function() {
3823                if (submenu) {
3824                    submenu.closest("li").removeClass("show");
3825                }
3826            },
3827            queueHide: function() {
3828                timer = setTimeout(function() {
3829                    dropDownEvents.hide();
3830                }, timeout);
3831            },
3832            focus: function() {
3833                $(this)
3834                    .closest("li")
3835                    .siblings()
3836                    .removeClass("show");
3837                $(this)
3838                    .closest("li")
3839                    .addClass("show");
3840            },
3841            blur: function() {
3842                if (
3843                    $(this)
3844                        .closest("li")
3845                        .is(".last")
3846                ) {
3847                    $(this)
3848                        .parents(".rel-level1")
3849                        .removeClass("show");
3850                }
3851            }
3852        };
3853
3854    /**
3855     * Prepares DOM structure of Navigation component and
3856     * adds Event listeners of showing and hiding
3857     * different levels of navigation.
3858     * @method
3859     * @alias module:Navigation.dropDownNavigation
3860     * @memberOf module:Navigation
3861     * breadcrum elements wrapped by jquery
3862     * @param {jQuery} navi Root DOM element of
3863     * navigation component wrapped by jQuery
3864     * @private
3865     */
3866    function dropDownNavigation(navi) {
3867        navi.on(
3868            "mouseover",
3869            ".rel-level1 > a, .rel-level1 >.navigation-title>a, .rel-level2 >.navigation-title>a",
3870            function() {
3871                $(this)
3872                    .closest("li")
3873                    .siblings()
3874                    .removeClass("show");
3875                $(this)
3876                    .closest("li.rel-level1")
3877                    .siblings()
3878                    .removeClass("show");
3879                $(this)
3880                    .closest("li.rel-level1")
3881                    .siblings()
3882                    .find(".show")
3883                    .removeClass("show");
3884                var elem = $(this)
3885                    .closest("li")
3886                    .find(">ul");
3887                dropDownEvents.show(elem);
3888            }
3889        );
3890        navi.on(
3891            "mouseleave",
3892            ".rel-level1 > a, .rel-level1 >.navigation-title",
3893            dropDownEvents.queueHide
3894        );
3895        navi.on("mouseover", ".rel-level1 > ul", dropDownEvents.debounce);
3896        navi.on("mouseleave", ".rel-level1 > ul", dropDownEvents.queueHide);
3897        navi.on(
3898            "focus",
3899            ".rel-level1 > a, .rel-level1 >.navigation-title, .rel-level1 >.navigation-title",
3900            dropDownEvents.focus
3901        );
3902        navi.on("blur", ".rel-level2 > a", dropDownEvents.blur);
3903        navi.on("mouseleave", function() {
3904            $(this)
3905                .find(".show")
3906                .removeClass("show");
3907        });
3908        navi.find(".rel-level1").each(function() {
3909            if ($(this).find("ul").length) {
3910                $(this).addClass("submenu");
3911            }
3912        });
3913
3914        navi.find(".rel-level2").each(function() {
3915            //if level2 menu has children
3916            if ($(this).parents("#header") > 0) {
3917                if ($(this).find("ul").length) {
3918                    $(this).addClass("submenu");
3919                    $(this)
3920                        .parents(".rel-level1")
3921                        .addClass("wide-nav");
3922                }
3923            }
3924
3925            //if level2 menu should be navigation-image variant
3926            if ($(this).find("> img").length) {
3927                $(this).addClass("submenu navigation-image");
3928            }
3929        });
3930
3931        navi.on("click", ".sxaToogleNavBtn", function() {
3932            var $this = jQuery(this);
3933            $this.find(".sxaWrappedList").toggleClass("hidden");
3934        });
3935    }
3936    /**
3937     * Prepares DOM structure of Mobile Navigation component and
3938     * adds Event listeners of showing and hiding
3939     * different levels of navigation.
3940     * @method
3941     * @alias module:Navigation.mobileNavigation
3942     * @memberOf module:Navigation
3943     * breadcrum elements wrapped by jquery
3944     * @param {jQuery} navi Root DOM element of
3945     * navigation component wrapped by jQuery
3946     * @private
3947     */
3948    function mobileNavigation(navi) {
3949        function checkChildren(nav) {
3950            nav.find(".rel-level1").each(function() {
3951                if (!$(this).find("ul").length) {
3952                    $(this).addClass("no-child");
3953                }
3954            });
3955        }
3956
3957        function bindEvents(nav) {
3958            nav.find(".navigation-title").on("click", function(e) {
3959                var navlvl = $(this).closest("li"),
3960                    menuParent = navlvl.parents(".navigation");
3961
3962                if (menuParent.hasClass("navigation-mobile")) {
3963                    if (!$(e.target).is("a")) {
3964                        if (navlvl.hasClass("active")) {
3965                            navlvl.find(">ul").slideToggle(function() {
3966                                navlvl.removeClass("active");
3967                            });
3968                        } else {
3969                            navlvl.find(">ul").slideToggle(function() {
3970                                navlvl.addClass("active");
3971                            });
3972                        }
3973                    }
3974                }
3975            });
3976
3977            nav.find(".rel-level1").on("focus", function() {
3978                $(this)
3979                    .siblings("ul")
3980                    .slideDown();
3981                $(this)
3982                    .closest("li")
3983                    .siblings()
3984                    .find("ul")
3985                    .slideUp();
3986            });
3987        }
3988        checkChildren(navi);
3989        bindEvents(navi);
3990    }
3991
3992    /**
3993     * @method
3994     * @alias module:Navigation.toggleIcon
3995     * @memberOf module:Navigation
3996     * @param {$} toggle
3997     * navigation elements wrapped by jquery
3998     * @private
3999     */
4000    function toggleIcon(toggle) {
4001        $(toggle).on("click", function() {
4002            $(this)
4003                .parents(".navigation")
4004                .toggleClass("active");
4005            $(this).toggleClass("active");
4006        });
4007    }
4008
4009    /**
4010     * This object stores all public api methods
4011     * @type {Object.<Methods>}
4012     * @memberOf module:Navigation
4013     * */
4014    var api = {};
4015
4016    /**
4017     * initIstance method. <br/>
4018     * If added <b>navigation-main</b> class
4019     * called [dropDownNavigation]{@link module:Navigation.dropDownNavigation},
4020     * [mobileNavigation]{@link module:Navigation.mobileNavigation} methods. <br/>
4021     * If added <b>navigation-mobile</b> class
4022     * called only [mobileNavigation]{@link module:Navigation.mobileNavigation},
4023     * @memberOf module:Navigation
4024     * @method
4025     * @param {jQuery} component Root DOM element of
4026     * navigation component wrapped by jQuery
4027     * @alias module:Navigation.initInstance
4028     */
4029    api.initInstance = function(component) {
4030        if (component.hasClass("navigation-main")) {
4031            dropDownNavigation(component);
4032            mobileNavigation(component);
4033        } else if (component.hasClass("navigation-mobile")) {
4034            mobileNavigation(component);
4035        }
4036    };
4037    /**
4038     * init method calls [initInstance]{@link module:Navigation.initInstance} method
4039     * in a loop for each navigation component on a page. <br/>
4040     *
4041     * For navigation with set <b>mobile-nav</b> class
4042     * calls [toggleIcon]{@link module:Navigation.toggleIcon} method
4043     *
4044     * @memberOf module:Navigation
4045     * @alias module:Navigation.init
4046     */
4047    api.init = function() {
4048        var navigation = $(".navigation:not(.initialized)");
4049        navigation.each(function() {
4050            api.initInstance($(this));
4051            $(this).addClass("initialized");
4052        });
4053
4054        var toggle = $(".mobile-nav:not(.initialized)");
4055        toggle.each(function() {
4056            toggleIcon(this);
4057            $(this).addClass("initialized");
4058        });
4059    };
4060
4061    return api;
4062})(jQuery, document);
4063
4064XA.register("navigation", XA.component.navigation);
4065
4066
4067/*  component-overlay  */
4068/* global mejs:false */
4069/**
4070 * open content in overlay
4071 * @module overlay
4072 * @param  {jQuery} $ Instance of jQuery
4073 * @return {Object} List of overlay methods
4074 */
4075XA.component.overlay = function ($) {
4076    /**
4077    * This object stores all public api methods
4078    * @type {Object.<Methods>}
4079    * @memberOf module:overlay
4080    * */
4081    var api = {},
4082        href = window.location.href,
4083        host = location.host,
4084        label,
4085        overlayPlaceholder = false,
4086        marginTop = 100,
4087        focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]',
4088        firstTabStop,
4089        lastTabStop,
4090        overlayClickSource,
4091        tempData,
4092		tempDataSplash,
4093		storeApiStatus=false,
4094		splashApiStatus=false;
4095    /**
4096    * isPreviewMode check if page in preview mode
4097    * @memberOf module:overlay
4098    * @private
4099    * @returns {Boolean} is page in a preview mode
4100    */
4101    function isPreviewMode() {
4102        if (href.indexOf("sc_mode=preview") > -1) {
4103            return true;
4104        }
4105        var $hdPageMode = $('#hdPageMode');
4106
4107        return $hdPageMode.length > 0 && $hdPageMode.attr('value') == 'preview';
4108    }
4109    /**
4110    * isEditMode check if page in edit mode
4111    * @memberOf module:overlay
4112    * @private
4113    * @returns {Boolean} is page in a edit mode
4114    */
4115    function isEditMode() {
4116        if (href.indexOf("sc_mode=edit") > -1) {
4117            return true;
4118        }
4119        var $hdPageMode = $('#hdPageMode');
4120
4121        return $hdPageMode.length > 0 && $hdPageMode.attr('value') == 'edit';
4122    }
4123    /**
4124     * isOverlayPage check if "#wrapper" element has class "overlay-page"
4125     * @memberOf module:overlay
4126     * @private
4127     * @returns {Boolean} is #wrapper an overlay page
4128     */
4129    function isOverlayPage() {
4130        return $('#wrapper').hasClass('overlay-page');
4131    }
4132    /**
4133     * hasOverlayContent check if "overlay-source" 
4134     * element present on a page
4135     * @memberOf module:overlay
4136     * @private
4137     * @returns {Boolean} is overlay-source present on a page
4138     */
4139    function hasOverlayContent() {
4140        return $(".overlay-source").length;
4141    }
4142    /**
4143    * resizeOverlay resize overlay
4144    * @memberOf module:overlay
4145    * @param {jQuery<Object>} inner ".overlay-inner"
4146    * @param {jQuery<Object>} content (".component-content"),
4147    * @param {Object} options contains size of overlay 
4148    * @param {number} [options.width] width of overlay
4149    * @param {number} [options.height] height of overlay
4150    * @param {string} [options.percent] units of width and height
4151    * @alias module:overlay.resizeOverlay
4152    */
4153    api.resizeOverlay = function (inner, content, options) {
4154        var unit = "px";
4155        var css = {
4156            "width": "",
4157            "height": ""
4158        };
4159        var wh = $(window).height();
4160
4161        if (options.percent) {
4162            unit = "%";
4163            inner.addClass("overlay-percent");
4164        } else {
4165            inner.removeClass("overlay-percent");
4166        }
4167
4168        if (options.width) {
4169            css["width"] = options.width + unit;
4170        }
4171        if (options.height) {
4172            css["height"] = options.height + unit;
4173        }
4174
4175        css["max-height"] = (wh - marginTop - 0.1 * wh) + "px";
4176
4177        content.css(css);
4178    }
4179    /**
4180    * getUrlVariables get variables provided in overlay url
4181    * @memberOf module:overlay
4182    * @param {String} url url of overlay content
4183    * @private
4184    * @returns {Object} list of get parameters
4185    */
4186    function getUrlVariables(url) {
4187        var q = url.split('?')[1],
4188            vars = [],
4189            hash;
4190
4191        if (q != undefined) {
4192            q = q.split('&');
4193            for (var i = 0; i < q.length; i++) {
4194                hash = q[i].split('=');
4195                vars.push(hash[1]);
4196                vars[hash[0]] = hash[1];
4197            }
4198        }
4199
4200        return vars;
4201    }
4202    /**
4203    * getSize check if overlay has width or height in url 
4204    * and set up this values  
4205    * @memberOf module:overlay
4206    * @param {String} vars variables from url of overlay content
4207    * @private
4208    * @returns {Object} sizes of overlay
4209    */
4210    function getSize(vars) {
4211        var obj = {};
4212
4213        if (vars["width"] !== null) {
4214            obj["width"] = vars["width"];
4215        }
4216
4217        if (vars["height"] !== null) {
4218            obj["height"] = vars["height"];
4219        }
4220
4221        return obj;
4222    }
4223    /**
4224    * checkInternal checks if overlay content is internal resource
4225    * @memberOf module:overlay
4226    * @param {String} url url of overlay content
4227    * @private
4228    * @returns {Boolean} true - content is internal| false - content is external
4229    */
4230    function checkInternal(url) {
4231        if (url.indexOf(host) > -1) {
4232            return true;
4233        }
4234        return false;
4235    }
4236    /**
4237    * checkImage checks if overlay content is an image
4238    * @memberOf module:overlay
4239    * @param {String} url url of overlay content
4240    * @private
4241    * @returns {Boolean} true - content is an image| false - content not an a image
4242    */
4243    function checkImage(url) {
4244        var ext = url.split("?")[0].split('.').pop();
4245        if ($.inArray(ext, ['gif', 'png', 'jpg', 'jpeg']) > -1) {
4246            return true;
4247        }
4248
4249        return false;
4250    }
4251
4252    /**
4253    * loadOverlay creates overlay content and show it
4254    * @memberOf module:overlay
4255    * @param {String} url url of overlay
4256    * @param {jQuery<DOMElement>} overlay overlay DOMElement
4257    * @private
4258    */
4259    function loadOverlay(url, overlay) {
4260        var content = overlay.find(".overlay-inner"),
4261            overlayContent = overlay.find(".component-content"),
4262            vars = getUrlVariables(url),
4263            internalLink = checkInternal(url),
4264            overlaySize = getSize(vars),
4265            suffix;
4266        overlayContent.addClass('overlayFullWidth');
4267        content.removeAttr('style');
4268        if (internalLink) {
4269            if (checkImage(url)) {
4270                content.empty().append($("<img>", { src: url }));
4271                content.css(overlaySize);
4272                overlayContent.removeClass('overlayFullWidth');
4273                showOverlay(overlay);
4274            } else if (url.indexOf("overlaytype=iframe") > -1) {
4275                content.empty().append($("<iframe>", { src: url, style: "width: 100%; height: 100%" }));
4276                content.css(overlaySize);
4277                showOverlay(overlay);
4278            } else {
4279                if (isPreviewMode()) {
4280                    suffix = "cf_overlay=1";
4281                    url = url.replace("sitecore/shell/");
4282                    url += (url.indexOf("?") == -1 ? "?" : "&") + suffix;
4283                }
4284
4285                if(url && url.includes("store"))
4286				{
4287                if(tempData)
4288                {
4289                    content.empty().append(tempData);
4290                }
4291                else
4292                {
4293
4294					if(storeApiStatus === false)
4295					{
4296						storeApiStatus=true;
4297                    $.get(url, function (data) {
4298                        tempData=data;
4299                        var overlayData = $(data).before().first();
4300    
4301                        api.resizeOverlay(content, overlayContent, {
4302                            width: overlayData.attr("data-width"),
4303                            height: overlayData.data("height"),
4304                            percent: overlayData.data("percent")
4305                        });
4306    
4307                        content.empty().append(data);
4308                    });
4309					}
4310                }
4311				}
4312				else
4313				{
4314					 if(tempDataSplash)
4315                {
4316                    content.empty().append(tempDataSplash);
4317                }
4318                else
4319                {
4320					if(splashApiStatus=== false)
4321					{
4322						splashApiStatus=true;
4323                    $.get(url, function (data) {
4324                        tempDataSplash=data;
4325                        var overlayData = $(data).before().first();
4326    
4327                        api.resizeOverlay(content, overlayContent, {
4328                            width: overlayData.attr("data-width"),
4329                            height: overlayData.data("height"),
4330                            percent: overlayData.data("percent")
4331                        });
4332    
4333                        content.empty().append(data);
4334                    });
4335					}
4336                }
4337				}
4338
4339                XA.init();
4340                showOverlay(overlay);
4341            }
4342        } else {
4343            if (checkImage(url)) {
4344                content.empty().append($("<img>", { src: url }));
4345            } else {
4346                content.empty().append($("<iframe >", { src: url, style: "width: 100%; height: 100%" }));
4347            }
4348            content.css(overlaySize);
4349            showOverlay(overlay);
4350        }
4351
4352    }
4353    /**
4354    * preShowOverlay sets opacity to 1 and shows overlay
4355    * @memberOf module:overlay
4356    * @param {jQuery<DOMElement>} overlay overlay DOMElement
4357    * @private
4358    */
4359    function preShowOverlay(overlay) {
4360        overlay.css({
4361            "opacity": 1
4362        }).show();
4363    }
4364    /**
4365    * showOverlay makes overlay visible
4366    * @memberOf module:overlay
4367    * @param {jQuery<DOMElement>} overlay overlay DOMElement
4368    * @private
4369    * @returns {jQuery<DOMElement>} overlay overlay DOMElement
4370    */
4371
4372    function showOverlay(overlay) {
4373        var close, content;
4374
4375        overlay.show();
4376
4377        // hides wrapper data from screen readers
4378        $("#wrapper").addClass("aria-hidden");
4379
4380        overlayClickSource = document.activeElement;
4381
4382        close = overlay.find(".overlay-close");
4383        setTimeout(function () { close.focus(); }, 0);
4384
4385        content = overlay.find(".overlay-inner");
4386        content.blur(function (args) {
4387            args.preventDefault();
4388            args.stopPropagation();
4389            setTimeout(function () { close.focus() }, 0);
4390        });
4391
4392        // Finds all focusable children
4393        var focusableElements = content.find(focusableElementsString);
4394
4395        // Converts NodeList to Array
4396        focusableElements = Array.prototype.slice.call(focusableElements);
4397        firstTabStop = focusableElements[0];
4398        lastTabStop = focusableElements[focusableElements.length - 1];
4399
4400        // Focus first
4401        if(firstTabStop){firstTabStop.focus()};
4402
4403        if (isPreviewMode() || isEditMode()) {
4404            overlay.find('> .component-content').css({
4405                top: 200,
4406                transform: 'translate(-50%, 0)'
4407            });
4408        }
4409
4410        return overlay;
4411    }
4412    /**
4413     * hideOverlay hide overlay
4414     * @memberOf module:overlay
4415     * @private
4416     */
4417    function hideOverlay(overlay) {
4418        $("#wrapper").removeClass("aria-hidden");
4419        var content = overlay.find(".overlay-inner");
4420
4421        overlay.hide();
4422        content.empty();
4423
4424        if (mejs) {
4425            for (var p in mejs.players) {
4426                if ($("#" + mejs.players[p].id).parents(".overlay").length == 1) {
4427                    $("#" + mejs.players[p].id + ' video').attr('src', '');
4428                    mejs.players[p].remove();
4429                    mejs.players.splice(p, 1);
4430                }
4431            }
4432        }
4433
4434        return overlay;
4435    }
4436    /**
4437     * createOverlay creates a markup for overlay and appends it to body 
4438     * @memberOf module:overlay
4439     * @private
4440     */
4441    function createOverlay() {
4442        var overlay = "<div class='overlay-wrapper'>" +
4443            "<div class='overlay component'>" +
4444            "<div class='component-content' role='dialog'>" +
4445            "<div class='overlay-inner'></div>" +
4446            "<div class='overlay-close' role='button' aria-label='Close dialog'></div>" +
4447            "</div>" +
4448            "</div>" +
4449            "</div>";
4450
4451        $("body").append(overlay);
4452    }
4453    /**
4454     * Init form conditions under overlay content
4455     * @memberOf module:overlay
4456     * @private
4457     */
4458    function initFormConditions() {
4459        setTimeout(function () {
4460            if (window.$ && window.$.fn.init_formConditions) {
4461                var forms = window.$(".overlay-inner form[data-sc-fxb]");
4462                if (forms.length) {
4463                    forms.each(function () {
4464                        var formEl = window.$(this);
4465                        var fromInitializer = window.$.fn.init_formConditions.bind(formEl);
4466                        fromInitializer();
4467                    }).parent().on("submit", "form[data-sc-fxb]", function () {
4468                        var $submitBtns = window.$(this).find("input[type='submit'], button[type='submit']");
4469                        if ($submitBtns.length) {
4470                            $submitBtns.on("click", function () {
4471                                return false;
4472                            });
4473                        }
4474                    });
4475                }
4476            }
4477        }, 0)
4478
4479    }
4480
4481    /**
4482    * initInstance method prevent event propagation and call 
4483    * ["preShowOverlay"]{@link module:overlay.preShowOverlay} and
4484    * ["loadOverlay"]{@link module:overlay.loadOverlay} methods
4485    * @memberOf module:overlay
4486    * @method
4487    * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
4488    * @param {jQuery<DOMElement>} overlay overlay DOMElement
4489    * @param {jQuery<DOMElement>} overlayContent overlay content DOMElement 
4490    * @alias module:overlay.initInstance
4491    */
4492    api.initInstance = function (component, overlay, overlayContent) {
4493        component.on("click",
4494            function (event) {
4495                event.preventDefault();
4496                event.stopPropagation();
4497                preShowOverlay(overlay, overlayContent);
4498
4499                var uri = this.href;
4500                loadOverlay(uri, overlay);
4501
4502                var href = this.href.split('/');
4503                for (var i = 0; i <= href.length; i++) {
4504                    label = href.pop();
4505                    if (label.length == 0) {
4506                        continue;
4507                    }
4508                    break;
4509                }
4510            });
4511        // Init forms if they exist inside overlay
4512        initFormConditions();
4513        component.addClass("initialized");
4514    }
4515    /**
4516    * init method makes preparation for overlay content, binds events
4517    * for proper work of overlay and
4518    * calls in a loop for each instance of overlay
4519    * [".initInstance"]{@link module:Accordion.initInstance} method.
4520    * @memberOf module:overlay
4521    * @alias module:overlay.init
4522    */
4523    api.init = function () {
4524        var overlayContent,
4525            overlaySource,
4526            overlayInner,
4527            overlayCloseLink,
4528            closeAction,
4529            page,
4530            overlay,
4531            content;
4532
4533        if (!overlayPlaceholder && hasOverlayContent()) {
4534            createOverlay();
4535        }
4536
4537        if (isOverlayPage()) {
4538
4539            page = $(".overlay-page");
4540            overlayContent = page.children(".component-content");
4541            overlay = $("#spnOverlay");
4542            content = overlayContent.children(".overlay-inner");
4543
4544            api.resizeOverlay(content, overlayContent, {
4545                width: overlayContent.data("width"),
4546                height: overlayContent.data("height"),
4547                percent: overlayContent.data("percent")
4548            });
4549            overlayContent.on("click", function (event) {
4550                if (event.target.type != 'submit') {
4551                    event.stopPropagation();
4552                }
4553            });
4554            page.on("click", function () {
4555                if (isPreviewMode()) {
4556                    location.href = location.href.replace("sc_mode=preview", "sc_mode=edit");
4557                }
4558            });
4559        }
4560        overlay = $(".overlay-wrapper > .overlay");
4561        overlayContent = overlay.find(".component-content");
4562        overlaySource = $(".overlay-source a:not(.initialized), a.overlay-source:not(.initialized)");
4563        overlayInner = $(".overlay-inner");
4564        overlayCloseLink = overlay.find(".overlay-close");
4565
4566        closeAction = function () {
4567            hideOverlay(overlay);
4568            overlayInner.off("blur");
4569            setTimeout(function () {
4570                if (overlayClickSource != null) {
4571                    overlayClickSource.focus();
4572                }
4573            }, 0);
4574        };
4575
4576        if (!overlayPlaceholder) {
4577            overlayContent.on("click", function (event) {
4578                if (event.target.type != 'submit') {
4579                    event.stopPropagation();
4580                }
4581            });
4582
4583            overlay.on("click", function (event) {
4584                if (event.target.type != 'submit') {
4585                    closeAction();
4586                }
4587
4588            });
4589
4590            overlayCloseLink.on("click", function (args) {
4591                args.preventDefault();
4592                closeAction();
4593            });
4594
4595            $("body").keydown(function (e) {
4596                // Check for TAB key press
4597                if (e.keyCode === 9) {
4598                    // SHIFT + TAB
4599                    if (e.shiftKey) {
4600                        if (document.activeElement === firstTabStop) {
4601                            e.preventDefault();
4602                            lastTabStop.focus();
4603                        }
4604
4605                        // TAB
4606                    } else if (document.activeElement === lastTabStop) {
4607                        e.preventDefault();
4608                        // firstTabStop.attr('tabindex', 0);
4609                        firstTabStop.focus();
4610                    }
4611                }
4612
4613                // ESCAPE
4614                if (e.keyCode === 27) {
4615                    e.stopPropagation();
4616                    closeAction();
4617                }
4618            });
4619
4620            $(window).on("resize", function () {
4621                var height = $(window).height();
4622                height = height - marginTop - 0.1 * height;
4623                overlayContent.css("max-height", height + "px");
4624            });
4625
4626            overlayPlaceholder = true;
4627        }
4628
4629
4630        overlaySource.each(function () {
4631            api.initInstance($(this), overlay, overlayContent);
4632        });
4633
4634
4635    };
4636
4637    return api;
4638
4639}(jQuery);
4640
4641XA.register("overlay", XA.component.overlay);
4642
4643function waitForElement(selector, timeout, interval,parentID) {
4644    const startTime = Date.now();
4645
4646    return new Promise((resolve, reject) => {
4647        const timer = setInterval(() => {
4648            const now = Date.now();
4649            const parent=document.getElementById(parentID);
4650
4651            if(parent) {
4652                let element = parent.querySelector(selector);
4653                if (element !== undefined && element !== null) {     
4654                    clearInterval(timer);
4655                    resolve(element); 
4656                    return;           
4657                } else if (timeout && now - startTime >= timeout) { 
4658                    clearInterval(timer);
4659                    reject();
4660                } else {
4661                    element = parent.querySelector(selector);
4662                }
4663            }           
4664        }, interval)
4665    });
4666  }
4667
4668[].forEach.call(document.querySelectorAll('.search-results.overlay-source'), function (e) {
4669    XA.dom.observeDOM(e, function () { XA.component.overlay.init(); });
4670});
4671
4672waitForElement('.search-results ul li', 10000, 100,'product-filter-options-results-container-new').then(() => {
4673    XA.component.overlay.init();
4674
4675}).catch(() => { console.log("Returning error from promise wait gs")});
4676
4677waitForElement('.search-results ul li', 10000, 100,'recipe-filter-options-results-container-new').then(() => {
4678    XA.component.overlay.init();
4679
4680}).catch(() => {});
4681
4682/*  component-snippet  */
4683/**
4684 * Component Snippet
4685 * @module Snippet
4686 * @param  {jQuery} $ Instance of jQuery
4687 * @return {Object} List of Snippet methods
4688 */
4689XA.component.snippet = (function($) {
4690     /**
4691     * This object stores all public api methods
4692     * @type {Object.<Methods>}
4693     * @memberOf module:Snippet
4694     * @
4695     * */
4696    var api = {},
4697        instance;
4698     /**
4699     * initInstance method of a Snippet element
4700     * @memberOf module:Snippet
4701     * @method
4702     * @param {jQuery} component Root DOM element of Snippet component wrapped by jQuery
4703     * @param {jQuery} snippetModule Snippet inner DOM element of Snippet component wrapped by jQuery
4704     * @alias module:Snippet.initInstance
4705     */
4706    api.initInstance = function(component, snippetModule) {};
4707    /**
4708     * init method calls in a loop for each
4709     * snippet component on a page and runs Snippet's
4710     * ["initInstance"]{@link module:Snippet.api.initInstance} methods.
4711     * @memberOf module:Snippet
4712     * @alias module:Snippet.init
4713     */
4714    api.init = function() {
4715        var $snippets = $(".snippet:not(.initialized)");
4716        $snippets.each(function() {
4717            var $snippetModule = $(this).find(".snippet-inner");
4718            instance = $(this);
4719            api.initInstance(instance, $snippetModule);
4720            $(this).addClass("initialized");
4721        });
4722    };
4723
4724    return api;
4725})(jQuery);
4726
4727XA.register("snippet", XA.component.snippet);
4728
4729
4730/*  component-social  */
4731/**
4732 * Component Social
4733 * @module Social
4734 * @param  {jQuery} $ Instance of jQuery
4735 * @param  {document} document document object
4736 * @return {Object} List of Social component methods
4737 */
4738XA.component.social = (function($, document) {
4739    /**
4740     * This object stores all public api methods
4741     * @type {Object.<Methods>}
4742     * @memberOf module:Social
4743     * @
4744     * */
4745    var api = {};
4746    api.shareProperties;
4747    /**
4748     * Creates connector for facebook
4749     * initInstance method of a Social component
4750     * @memberOf module:Social
4751     * @method
4752     * @alias module:Social.initFacebook
4753     */
4754    api.initFacebook = function() {
4755        (function(d, s, id) {
4756            var js,
4757                fjs = d.getElementsByTagName(s)[0];
4758            if (d.getElementById(id)) {
4759                return;
4760            }
4761            js = d.createElement(s);
4762            js.id = id;
4763            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
4764            fjs.parentNode.insertBefore(js, fjs);
4765        })(document, "script", "facebook-jssdk");
4766    };
4767    /**
4768     * Creates connector for facebook
4769     * initInstance method of a Social component
4770     * @memberOf module:Social
4771     * @param {Array} properties properties for external scripts
4772     * @method
4773     * @alias module:Social.initFacebook
4774     */
4775    var attachExternalScript = function(properties) {
4776        var component = $(".sharethis"),
4777            shareThisExternal;
4778        if (window.stLight === undefined) {
4779            shareThisExternal = document.createElement("script");
4780            shareThisExternal.type = "text/javascript";
4781            shareThisExternal.src = "//w.sharethis.com/button/buttons.js";
4782            $(window).on("load", function() {
4783                $(properties).each(function() {
4784                    try {
4785                        window.stLight.options(this);
4786                    } catch (e) {}
4787                });
4788            });
4789            $(component[0]).append(shareThisExternal);
4790        }
4791    };
4792    /**
4793     * initInstance method of a Social component
4794     * @memberOf module:Social
4795     * @method
4796     * @param {jQuery} component Root DOM element of Social component wrapped by jQuery
4797     * @param {Object} prop Social component properties
4798     * @alias module:Social.initInstance
4799     */
4800    api.initInstance = function(component, prop) {
4801        api.shareProperties.push(prop);
4802    };
4803    /**
4804     * init method calls in a loop for each
4805     * social component on a page and run
4806     * ["initInstance"]{@link module:Snippet.api.initInstance} methods.
4807     * @memberOf module:Social
4808     * @alias module:Social.init
4809     */
4810    api.init = function() {
4811        var shareThis = $(".sharethis:not(.initialized)");
4812        api.shareProperties = [];
4813        shareThis.each(function() {
4814            var properties = $(this).data("properties");
4815            api.initInstance($(this), properties);
4816            $(this).addClass("initialized");
4817        });
4818        attachExternalScript(api.shareProperties);
4819    };
4820    return api;
4821})(jQuery, document);
4822
4823XA.register("social", XA.component.social);
4824
4825
4826/*  component-tabs  */
4827/**
4828 * Component Tabs
4829 * @module Tabs
4830 * @param  {jQuery} $ Instance of jQuery
4831 * @return {Object} List of tabs methods
4832 */
4833XA.component.tabs = (function($) {
4834    /**
4835     * This object stores all public api methods
4836     * @type {Object.<Methods>}
4837     * @memberOf module:Tabs
4838     * @
4839     * */
4840    var api = {},
4841        instance;
4842    /**
4843     * isFlipInside chech if inside Tab component present Flip component
4844     * @memberOf module:Tab
4845     * @method
4846     * @param {jQuery} $instance Tabs Root DOM element of tab component wrapped by jQuery
4847     * @alias module:Tab.isFlipInside
4848     * @return {boolean}
4849     * @private
4850     */
4851    var isFlipInside = function(instance) {
4852        return !!instance.find(".component.flip").length;
4853    };
4854    /**
4855     * tabsScrollable modify tabs to support scroll for tabs header
4856     * @memberOf module:Tab
4857     * @method
4858     * @param {jQuery} $tabsScroll Tabs Root DOM element of tab component wrapped by jQuery
4859     * @alias module:Tab.tabsScrollable
4860     * @private
4861     */
4862    function tabsScrollable($tabsScroll) {
4863        var speed = 150; //tabs scroll speed
4864
4865        function initNavScroll($tabsNav) {
4866            var sum = 0,
4867                maxHeight = 0;
4868
4869            if ($tabsNav.length) {
4870                $tabsNav
4871                    .parent()
4872                    .find(".prev")
4873                    .remove();
4874                $tabsNav
4875                    .parent()
4876                    .find(".next")
4877                    .remove();
4878                $tabsNav.unwrap();
4879
4880                $tabsNav.css("width", "auto");
4881                $tabsNav.css("height", "auto");
4882                $tabsNav.css("left", 0);
4883            }
4884
4885            $tabsNav.find("li").each(function() {
4886                sum += $(this).outerWidth(true);
4887            });
4888
4889            $tabsNav.find("li").each(function() {
4890                maxHeight = Math.max(maxHeight, $(this).height());
4891            });
4892
4893            $tabsNav.wrap("<div class='wrapper'>");
4894            $("<div class='next tab-slider'>></div>").insertAfter($tabsNav);
4895            $("<div class='prev tab-slider'><</div>").insertBefore($tabsNav);
4896
4897            $tabsNav.parent().css("height", parseInt(maxHeight, 10));
4898            $tabsNav
4899                .parent()
4900                .find(".tab-slider")
4901                .css("height", parseInt(maxHeight, 10) - 2);
4902            //fix for 8111
4903            sum += 10;
4904            if (sum > $tabsNav.parent().width()) {
4905                $tabsNav
4906                    .parent()
4907                    .find(".prev")
4908                    .hide();
4909                $tabsNav.width(sum);
4910            } else {
4911                $tabsNav
4912                    .parent()
4913                    .find(".prev")
4914                    .hide();
4915                $tabsNav
4916                    .parent()
4917                    .find(".next")
4918                    .hide();
4919            }
4920        }
4921
4922        function bindPrevNextEvents(current, $tabsNav) {
4923            current.find(".prev").click(function() {
4924                var left = parseInt($tabsNav.css("left"), 10);
4925                left += speed;
4926
4927                if (left > 0) {
4928                    left = 0;
4929                    $tabsNav.stop().animate({
4930                        left: left
4931                    });
4932
4933                    $tabsNav
4934                        .parent()
4935                        .find(".prev")
4936                        .hide();
4937                    $tabsNav
4938                        .parent()
4939                        .find(".next")
4940                        .show();
4941                } else {
4942                    $tabsNav.stop().animate({
4943                        left: left
4944                    });
4945
4946                    $tabsNav
4947                        .parent()
4948                        .find(".prev")
4949                        .show();
4950                    $tabsNav
4951                        .parent()
4952                        .find(".next")
4953                        .show();
4954                }
4955            });
4956
4957            current.find(".next").click(function() {
4958                var left = parseInt($tabsNav.css("left"), 10),
4959                    navWidth = $tabsNav.width(),
4960                    navParentWidth = $tabsNav.parent().width();
4961
4962                left -= speed;
4963
4964                if (navWidth + left < navParentWidth) {
4965                    left = navWidth - navParentWidth + 20;
4966                    $tabsNav.stop().animate({
4967                        left: -left
4968                    });
4969
4970                    $tabsNav
4971                        .parent()
4972                        .find(".prev")
4973                        .show();
4974                    $tabsNav
4975                        .parent()
4976                        .find(".next")
4977                        .hide();
4978                } else {
4979                    $tabsNav.stop().animate({
4980                        left: left
4981                    });
4982
4983                    $tabsNav
4984                        .parent()
4985                        .find(".prev")
4986                        .show();
4987                    $tabsNav
4988                        .parent()
4989                        .find(".next")
4990                        .show();
4991                }
4992            });
4993        }
4994
4995        function bindChangeTabs($tabsNav, $tabsContainer) {
4996            $tabsNav.find("li").click(function(event) {
4997                var index = $(this).index(),
4998                    instance = $(this).closest(".component.tabs");
4999
5000                $(this).addClass("active");
5001                $(this)
5002                    .siblings()
5003                    .removeClass("active");
5004
5005                $tabsContainer.find(".tab").removeClass("active");
5006                $tabsContainer
5007                    .find(".tab:eq(" + index + ")")
5008                    .addClass("active");
5009
5010                if (isFlipInside(instance)) {
5011                    try {
5012                        XA.component.flip.equalSideHeight(instance);
5013                    } catch (e) {
5014                        /* eslint-disable no-console */
5015                        console.warn(
5016                            "Error during calculation height of Flip list in toggle"
5017                        ); // jshint ignore:line
5018                        /* eslint-enable no-console */
5019                    }
5020                }
5021                event.preventDefault();
5022            });
5023        }
5024
5025        function initTabsScrollable($tabs) {
5026            $tabs.each(function() {
5027                var $tabsNav = $(this).find(".tabs-heading"),
5028                    $tabsContainer = $(this).find(".tabs-container");
5029
5030                $tabsNav.find("li:first-child").addClass("active");
5031                $tabsContainer.find(".tab:eq(0)").addClass("active");
5032
5033                bindChangeTabs($tabsNav, $tabsContainer);
5034                initNavScroll($tabsNav);
5035                bindPrevNextEvents($(this), $tabsNav);
5036            });
5037        }
5038
5039        initTabsScrollable($tabsScroll);
5040        $(window).resize(function() {
5041            initTabsScrollable($tabsScroll);
5042        });
5043    }
5044    /**
5045     * selectActiveTab activate selected tab
5046     * @memberOf module:Tab
5047     * @method
5048     * @param {jQuery} $tabNav Tabs header DOM element of tab component wrapped by jQuery
5049     * @param {jQuery} $tabs Tabs content DOM element of tab component wrapped by jQuery
5050     * @alias module:Tab.selectActiveTab
5051     * @private
5052     */
5053    function selectActiveTab($tabNav, $tabs) {
5054        var tabRootId = $tabNav.closest(".component.tabs").attr("id");
5055        var tabToSelect = XA.queryString.getQueryParam(tabRootId || "tab");
5056
5057        if (
5058            tabToSelect != null &&
5059            !isNaN(parseInt(tabToSelect)) &&
5060            isFinite(tabToSelect)
5061        ) {
5062            tabToSelect = parseInt(tabToSelect);
5063            if ($tabNav.length > tabToSelect) {
5064                $($tabNav[tabToSelect]).addClass("active");
5065                $($tabs[tabToSelect]).addClass("active");
5066
5067                return;
5068            }
5069        }
5070        $tabNav.first().addClass("active");
5071        $tabNav.first().attr("tabindex", "0");
5072        $tabs.first().addClass("active");
5073    }
5074
5075    /**
5076     * initInstance initializes component according to his option
5077     * @memberOf module:Tabs
5078     * @method
5079     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
5080     * @alias module:Tabs.initInstance
5081     */
5082    api.initInstance = function(component) {
5083        var $tabModule = component.find(".tabs-inner");
5084        if (component.hasClass("tabs-scrollable")) {
5085            tabsScrollable(component);
5086        } else {
5087            $tabModule.each(function() {
5088                var $tabNav = $(this).find(".tabs-heading > li"),
5089                    $tabs = $(this).find("> .tabs-container > .tab");
5090
5091                selectActiveTab($tabNav, $tabs);
5092
5093                $tabNav
5094                    .click(function(event) {
5095                        var current = $(this),
5096                            index = current.index(),
5097                            tabInner = current.parent().parent();
5098
5099                        current.siblings().removeClass("active");
5100                        tabInner
5101                            .find("> .tabs-container > .tab")
5102                            .removeClass("active");
5103                        current.addClass("active");
5104                        $(
5105                            tabInner
5106                                .children(".tabs-container")
5107                                .children(".tab")
5108                                .eq(index)
5109                        ).addClass("active");
5110                        if (isFlipInside(component)) {
5111                            try {
5112                                XA.component.flip.equalSideHeight(component);
5113                            } catch (e) {
5114                                /* eslint-disable no-console */
5115                                console.warn(
5116                                    "Error during calculation height of Flip list in toggle"
5117                                ); // jshint ignore:line
5118                                /* eslint-enable no-console */
5119                            }
5120                        }
5121                        current.focus();
5122                        event.preventDefault();
5123                    })
5124                    .keyup(function(event) {
5125                        var currentHeading = $(this);
5126                        switch (event.keyCode) {
5127                            case 38: {
5128                                currentHeading.prev("li").click();
5129                                break;
5130                            }
5131                            case 40: {
5132                                currentHeading.next("li").click();
5133                                break;
5134                            }
5135                        }
5136                    });
5137            });
5138        }
5139
5140        if (isFlipInside(component)) {
5141            try {
5142                XA.component.flip.equalSideHeight(component);
5143            } catch (e) {
5144                /* eslint-disable no-console */
5145                console.warn(
5146                    "Error during calculation height of Flip list in toggle"
5147                ); // jshint ignore:line
5148                /* eslint-enable no-console */
5149            }
5150        }
5151    };
5152    /**
5153     * init method calls in a loop for each
5154     * tabs component on a page and runs Tab's
5155     * ["initInstance"]{@link module:Tabs.api.initInstance} method
5156     * @memberOf module:Tabs
5157     * @alias module:Tabs.init
5158     */
5159    api.init = function() {
5160        var $tabs = $(".tabs:not(.initialized)");
5161        $tabs.each(function() {
5162            var instance = $(this);
5163            api.initInstance(instance);
5164            $(this).addClass("initialized");
5165        });
5166    };
5167
5168    return api;
5169})(jQuery);
5170
5171XA.register("tabs", XA.component.tabs);
5172
5173
5174/*  component-toggle  */
5175/**
5176 * Component Toggle
5177 * @module Toggle
5178 * @param  {jQuery} $ Instance of jQuery
5179 * @return {Object} List of toggle methods
5180 */
5181XA.component.toggle = (function($) {
5182    /**
5183     * This object stores all public api methods
5184     * @type {Object.<Methods>}
5185     * @memberOf module:Toggle
5186     * */
5187    var api = {};
5188
5189    var properties, instance;
5190    /**
5191     * Returns list of flip components
5192     * @memberOf module:Toggle
5193     * @method
5194     * @param {DOMElement} instance Root DOM element of toggle component
5195     * @alias module:Toggle.openToggle
5196     * @private
5197     * @return {jQuery} list of flip components
5198     */
5199    var getFlipList = function(instance) {
5200        return $(instance).find(".component.flip");
5201    };
5202	/**
5203     * Adds attribute "open" for "details" tag.
5204     * If inside toggle event calendar is added, this method will trigger
5205     * "resize method"
5206     * If inside toggle flip component is added, it will call
5207     * ["Flip.equalSideHeightInToggle"]{@link  module:Flip.equalSideHeightInToggle}
5208     * @memberOf module:Toggle
5209     * @method
5210     * @param {DOMElement} instance Root DOM element of toggle component
5211     * @alias module:Toggle.openToggle
5212     * @private
5213     */
5214    var openToggle = function(instance) {
5215        var flipList = getFlipList(instance),
5216            eventCalendar = $(instance).find('.event-calendar');
5217        $(instance).find('details').attr('open', 'open');
5218        if (eventCalendar.length){
5219            eventCalendar.trigger('resize')
5220        }
5221        if (flipList.length) {
5222            try {
5223                XA.component.flip.equalSideHeightInToggle(instance)
5224            } catch (e) {
5225                /* eslint-disable no-console */
5226                console.warn('Error during calculation height of Flip list in toggle'); // jshint ignore:line
5227                /* eslint-enable no-console */
5228
5229            }
5230        }
5231
5232    }
5233	/**
5234     * Removes attribute "open" for "details" tag
5235     * @memberOf module:Toggle
5236     * @method
5237     * @param {DOMElement} instance Root DOM element of toggle component
5238     * @alias module:Toggle.closeToggle
5239     * @private
5240     */
5241    var closeToggle = function(instance) {
5242        $(instance).find('details').removeAttr('open');
5243    }
5244
5245	/**
5246     * Sets css animation for component-content of an component
5247     * @memberOf module:Toggle
5248     * @method
5249     * @param {DOMElement} instance Root DOM element of toggle component
5250     * @alias module:Toggle.setAnimation
5251     * @private
5252     */
5253    var setAnimation = function(instance) {
5254        var childComponents = $(instance).find('details summary~.component>.component-content, details summary~.row>.component>.component-content');
5255        childComponents.css({
5256            'animation-name': properties.easing,
5257            'animation-duration': (properties.speed || 500) + 'ms'
5258        });
5259    };
5260	/**
5261     * Checks value of properties.expandOnHover;
5262     * @memberOf module:Toggle
5263     * @method
5264     * @alias module:Toggle.isExpandOnHover
5265     * @private
5266     * @return {Boolean} properties.expandOnHover
5267     */
5268    var isExpandOnHover = function() {
5269        return properties.expandOnHover;
5270    };
5271    /**
5272     * Checks value of properties.expandedByDefault;
5273     * @memberOf module:Toggle
5274     * @method
5275     * @alias module:Toggle.isExpanded
5276     * @private
5277     * @return {Boolean} properties.expandedByDefault
5278     */
5279    var isExpanded = function() {
5280        return properties.expandedByDefault;
5281    };
5282    /**
5283     * Binds watchers on "summary" element that will call
5284     * ["openToggle"]{@link  module:Toggle.openToggle}
5285     * method
5286     * @memberOf module:Toggle
5287     * @method
5288     * @param {jQuery} instance Root DOM element of toggle component
5289     * @alias module:Toggle.bindEvents
5290     * @private
5291     */
5292	var bindEvents = function(instance) {
5293        var summary = $(instance).find('summary');
5294        if (isExpandOnHover()) {
5295            summary.on('mouseenter', function() {
5296                openToggle(instance);
5297            });
5298        }
5299        if (isExpanded()) {
5300            openToggle(instance);
5301        }
5302
5303        summary.on('click', function(event) {
5304            event.preventDefault();
5305            var details = $(this).closest('details')
5306            if (details.attr('open')) {
5307                closeToggle(instance);
5308            } else {
5309                openToggle(instance);
5310            }
5311        });
5312    };
5313	/**
5314     * Call
5315     * ["bindEvents"]{@link  module:Toggle.bindEvents}
5316     * ["setAnimation"]{@link  module:Toggle.setAnimation}
5317     * methods
5318     * @memberOf module:Toggle
5319     * @method
5320     * @param {jQuery} component Root DOM element of toggle component wrapped by jQuery
5321     * @alias module:Toggle.initToggle
5322     * @private
5323     */
5324    var initToggle = function(component) {
5325        bindEvents(component);
5326		setAnimation(component);
5327	};
5328    /**
5329     * Call
5330     * ["initToggle"]{@link  module:Toggle.initToggle}
5331     * method
5332     * @memberOf module:Toggle
5333     * @method
5334     * @param {jQuery} component Root DOM element of toggle component wrapped by jQuery
5335     * @alias module:Toggle.initInstance
5336     */
5337    api.initInstance = function(component) {
5338        initToggle(component);
5339    };
5340    /**
5341     * Finds all not-initialized 
5342     * Toggle components and in a loop for each of them
5343     * runs Toggle's
5344     * ["initInstance"]{@link module:Toggle.initInstance}
5345     * method.
5346     * @memberOf module:Toggle
5347     * @alias module:Toggle.init
5348     */
5349    api.init = function() {
5350        $('.toggle:not(.initialized)').each(function() {
5351            instance = $(this);
5352            properties = instance.data('properties');
5353            api.initInstance(this,properties);
5354            instance.addClass('initialized');
5355        });
5356    };
5357
5358    return api;
5359})(jQuery);
5360
5361XA.register('component-toggle', XA.component.toggle);
5362
5363/*  component-video  */
5364/* global MediaElementPlayer:false */
5365/**
5366 * Component Video
5367 * @module Video
5368 * @param  {jQuery} $ Instance of jQuery
5369 * @return {Object} List of Video component methods
5370 */
5371XA.component.video = (function($, document) {
5372    /**
5373     * This object stores all public api methods
5374     * @type {Object.<Methods>}
5375     * @memberOf module:Video
5376     * */
5377    var api = {};
5378    /**
5379     * Sets class name to video element depending 
5380     * on video width size. </br>
5381        <p>"video-small" - if videoWidth < 481 && videoWidth >= 321</p>
5382        <p>"hide-controls" - if videoWidth < 321</p>
5383     * @memberOf module:Video
5384     * @method
5385     * @param {jQuery.<Element>} video Video element
5386     */
5387    function checkSize(video) {
5388        var videoWidth = video.width();
5389        video.removeClass("video-small hide-controls");
5390
5391        if (videoWidth < 481 && videoWidth >= 321) {
5392            video.addClass("video-small");
5393        } else if (videoWidth < 321) {
5394            video.addClass("hide-controls");
5395        }
5396    }
5397
5398    /**
5399     * Initializes video component and creates instance of 
5400     * [MediaElementPlayer]{@link https://www.mediaelementjs.com/} that 
5401     * handles all work with video player.
5402     * @memberOf module:Video
5403     * @method
5404     * @param {jQuery.<Element>} video Video element
5405     * @param {Object} properties Video element properties
5406     * @return undefined;
5407     * 
5408     */
5409    function initVideo(video, properties) {
5410        var content = video.find("video");
5411
5412        if (!content.length) {
5413            return;
5414        }
5415       
5416        var callback = function(mediaElement) {
5417            mediaElement.movieName = "Movie";
5418
5419            $(mediaElement).on("ended", function() {
5420                if (properties.fromPlaylist) {
5421                    $(properties.playlist).trigger("change-video");
5422                }
5423            });
5424            $(mediaElement)
5425                .closest(".component-content")
5426                .find(".video-init")
5427                .hide();
5428        };
5429        // Possible youtube imageQuality values: `default`, `hqdefault`, `mqdefault`, `sddefault` and `maxresdefault`
5430        $.extend(properties, {
5431            plugins: ["youtube", "flash", "silverlight"],
5432            silverlightName: "silverlightmediaelement.xap",
5433            classPrefix: "mejs-",
5434            success: callback,
5435            stretching: "auto",
5436            pluginPath: "../other/",
5437            youtube: {
5438                imageQuality: 'hqdefault' 
5439          }
5440        });
5441
5442        content.each(function(key) {
5443            var $elem = $(content[key]),
5444                _this = this;
5445            if ($elem.attr("poster")) {
5446                var initBtn = $elem.parent().find(".video-init");
5447                $elem.add(initBtn).on("click", function() {
5448                    properties.success = (function(arg) {
5449                        return function() {
5450                            try {
5451                                arguments[0].load();
5452                                arguments[0].play();
5453                            } catch (e) {
5454                                /* eslint-disable */
5455                                console.warn("Error while loading video");
5456                                /* eslint-enable  */
5457                            }
5458
5459                            return arg.apply(this, arguments);
5460                        };
5461                    })(properties.success);
5462                    initBtn.hide();
5463                    new MediaElementPlayer(_this, properties);
5464                });
5465            } else {
5466                new MediaElementPlayer(content[key], properties);
5467            }
5468        });
5469        return;
5470    }
5471    /**
5472     * This method is called by 
5473     * [Playlist.replaceSource]{@link module:Playlist.Playlist.replaceSource}
5474     * and extends properties of video component.
5475     * @memberOf module:Video
5476     * @method
5477     * @param {jQuery} video Root DOM element of video component wrapped by jQuery
5478     * @param {Object} playlist set by playlist component
5479     * @alias module:Video.initVideoFromPlaylist
5480     */
5481    api.initVideoFromPlaylist = function(video, playlist) {
5482        var properties = $(video).data("properties");
5483
5484        $.extend(properties, {
5485            fromPlaylist: true,
5486            playlist: playlist
5487        });
5488
5489        return initVideo(video, properties);
5490    };
5491    /**
5492     * For each video component run
5493     * [initVideo]{@link module:Video.initVideo}
5493, [checkSize]{@link module:Video.checkSize}
5494     * methods and add [checkSize]{@link module:Video.checkSize} as a callback for
5495     * eventListener to <b>window.resize</b>
5496     * @memberOf module:Video
5497     * @method
5498     * @param {jQuery} component Root DOM element of video component wrapped by jQuery
5499     * @param {Object} prop Properties set in data attribute
5500     *  of video component
5501     * @alias module:Video.initInstance
5502     */
5503    api.initInstance = function(component, prop) {
5504        var $component = $(component);
5505        initVideo($component, prop);
5506        checkSize($component);
5507
5508        $(window).resize(function() {
5509            checkSize($component);
5510        });
5511    };
5512    /**
5513     * Finds all Video components that are not yet initialized and in a loop for each of them
5514     * runs ["initInstance"]{@link module:Video.initInstance} method.
5515     * If component has property "playlist installed" it calls
5516     * [XA.component.playlist.init]{@link module:Playlist.init}
5517     * @memberOf module:Video
5518     * @alias module:Video.init
5519     */
5520    api.init = function() {
5521        if (XA.component.hasOwnProperty("playlist")) {
5522            XA.component.playlist.init();
5523        }
5524
5525        var video = $(".video.component:not(.initialized)");
5526
5527        video.each(function() {
5528            var properties = $(this).data("properties");
5529
5530            api.initInstance(this, properties);
5531
5532            $(this).addClass("initialized");
5533        });
5534
5535        $(document).on("mozfullscreenchange", function() {
5536            setTimeout(function() {
5537                $(window).resize();
5538            }, 200); //mozilla bug fix
5539        });
5540    };
5541
5542    return api;
5543})(jQuery, document);
5544
5545XA.register("video", XA.component.video);
5546
5547
5548/*  component-video-playlist  */
5549/* global mejs:false */
5550/**
5551 * Component Playlist
5552 * @module Playlist
5553 * @param  {jQuery} $ Instance of jQuery
5554 * @return {Object} List of Playlist component methods
5555 */
5556XA.component.playlist = (function ($) {
5557    /**
5558     * This object stores all public api methods
5559     * @type {Object.<Methods>}
5560     * @memberOf module:Playlist
5561     * */
5562    var api = {};
5563    /**
5564     * This class is used by [Playlist]{@link module:Playlist} module
5565     * @class Playlist
5566     * @memberOf module:Playlist
5567     * @param {jQuery} playlist Root DOM element of playlist component wrapped by jQuery
5568     * @param {Object} properties Properties set in data attribute
5569     */
5570    function Playlist(playlist, properties) {
5571        this.properties = properties;
5572        this.playlist = playlist;
5573        this.activeVideo = 0;
5574        this.playlistItems = 0;
5575    }
5576    /**
5577     * Creates new source element, sets up it with type & src. Created element
5578     * append to Video container (take it from videoContainer parameter)
5579     * @method
5580     * @alias createNewSources
5581     * @memberOf module:Playlist.Playlist
5582     * @param {$OrderedList} source takes from properties.sources[itemIndex].src - 
5583     * source of playlist element
5584     * @param {$OrderedList} videoContainer container where source should be added
5585     */
5586    Playlist.prototype.createNewSources = function (source, videoContainer) {
5587        var newSource;
5588
5589        var sourceBuilder = function (path) {
5590            var newSource = $("<source>"),
5591                type;
5592
5593            if (path.match(/\.(mp4)$/)) {
5594                type = "video/mp4";
5595            } else if (path.match(/\.(webm)$/)) {
5596                type = "video/webm";
5597            } else if (path.match(/\.(ogv)$/)) {
5598                type = "video/ogg";
5599            } else {
5600                type = "video/youtube";
5601            }
5602
5603            newSource.attr({
5604                type: type,
5605                src: path
5606            });
5607
5608            return newSource;
5609        };
5610
5611        if (source instanceof Array) {
5612            for (var i = 0; i < source.length; i++) {
5613                newSource = sourceBuilder(source[i]);
5614                videoContainer.find("video").append(newSource);
5615            }
5616        } else {
5617            newSource = sourceBuilder(source);
5618            videoContainer.find("video").append(newSource);
5619        }
5620    };
5621    /**
5622     * Replaces source of each video element under play list component.
5623     * After replacing it re-initializes video component by calling 
5624     * [XA.component.video.initVideoFromPlaylist]{@link module:Video.initVideoFromPlaylist}
5625     * @name replaceSource
5626     * @function
5627     * @param {number} itemIndex position of active video in video list
5628     * @param {boolean} loadFromEvent
5629     * @memberOf module:Playlist.Playlist
5630     */
5631
5632    Playlist.prototype.replaceSource = function (itemIndex, loadFromEvent) {
5633        var inst = this,
5634            videoContainer,
5635            videoClone,
5636            newSrc = inst.properties.sources[itemIndex].src,
5637            sources,
5638            videoId,
5639            videoContainerHeight = 0;
5640
5641        $(inst.properties.playlistId).each(function () {
5642            videoContainer = $(this);
5643            videoId = inst.properties.playlistId;
5644
5645            if (videoContainer.is(videoId) && newSrc.length) {
5646                videoContainer.addClass("show");
5647
5648                sources = videoContainer.find("source");
5649                sources.remove();
5650                inst.createNewSources(newSrc, videoContainer);
5651                videoContainer
5652                    .find("video")
5653                    .attr({
5654                        src: ""
5655                    })
5656                    .show();
5657
5658                var autoplayVideo = false;
5659                if (loadFromEvent) {
5660                    if (inst.properties.autoPlaySelected) {
5661                        autoplayVideo = true;
5662                    }
5663                } else {
5664                    if (inst.properties.autoPlay) {
5665                        autoplayVideo = true;
5666                    }
5667                }
5668
5669                if (autoplayVideo) {
5670                    videoContainer.find("video").attr({
5671                        autoplay: ""
5672                    });
5673                }
5674
5675                videoClone = videoContainer.find("video").clone();
5676                videoContainerHeight = videoContainer.height();
5677                videoContainer.css({
5678                    height: videoContainerHeight
5679                });
5680
5681                var id = videoContainer.find(".mejs-container").attr("id");
5682                if (id) {
5683                    $("#" + id).remove();
5684                    delete mejs.players[id];
5685                    videoContainer
5686                        .find(".component-content")
5687                        .append(videoClone);
5688                }
5689
5690                XA.component.video.initVideoFromPlaylist(
5691                    videoContainer,
5692                    inst.playlist
5693                );
5694                videoContainer.css({
5695                    height: "auto"
5696                });
5697            }
5698        });
5699    };
5700
5701    /**
5702     * Initializes videos under component. On call and on
5703     * [change-video]{@link module:Playlist.Playlist#change-video} event
5704     * calls [replaceSource]{@link module:Playlist.Playlist.replaceSource}
5705     * @name loadPlaylistVideo
5706     * @function
5707     * @listeners module:Playlist.Playlist#change-video
5708     * @memberOf module:Playlist.Playlist
5709     */
5710
5711    Playlist.prototype.loadPlaylistVideo = function () {
5712        var inst = this,
5713            playlistItems = $(inst.playlist).find(".playlist-item"),
5714            activeListItem;
5715
5716        inst.playlistItems = playlistItems.length;
5717        var loadVideoFromPlaylist = function (loadFromEvent) {
5718            inst.replaceSource(inst.activeVideo, loadFromEvent);
5719            activeListItem = playlistItems.eq(inst.activeVideo);
5720            activeListItem.addClass("active");
5721            activeListItem.siblings().removeClass("active");
5722        };
5723
5724        loadVideoFromPlaylist();
5725        $(inst.playlist).on("change-video", function (event, properties) {
5726            var loadNewVideo = false;
5727            
5728            if (properties) {
5729                if (properties.hasOwnProperty("back")) {
5730                    inst.activeVideo--;
5731                    if (inst.activeVideo < 0) {
5732                        inst.activeVideo = 0;
5733                    } else {
5734                        loadNewVideo = true;
5735                    }
5736                } else {
5737                    inst.activeVideo++;
5738                    if (inst.activeVideo === inst.playlistItems) {
5739                        if (inst.properties.repeatAfterAll) {
5740                            inst.activeVideo = 0;
5741                            loadNewVideo = true;
5742                        } else {
5743                            inst.activeVideo = inst.playlistItems - 1;
5744                        }
5745                    } else {
5746                        loadNewVideo = true;
5747                    }
5748                }
5749            } else {
5750                if (inst.properties.playNext) {
5751                    if (inst.activeVideo + 1 <= inst.playlistItems) {
5752                        inst.activeVideo++;
5753
5754                        if (inst.activeVideo === inst.playlistItems) {
5755                            inst.activeVideo = 0;
5756
5757                            if (inst.properties.repeatAfterAll) {
5758                                loadNewVideo = true;
5759                            }
5760                        } else {
5761                            inst.actiVideo--;
5762                            loadNewVideo = true;
5763                        }
5764                    }
5765                }
5766            }
5767
5768            if (loadNewVideo) {
5769                loadVideoFromPlaylist(true);
5770            }
5771        });
5772    };
5773    /**
5774     * Attaches events to playlist-section and navigation items
5775     * @name attachEvents
5776     * @function
5777     * @fires module:Playlist.Playlist#change-video
5778     * @memberOf module:Playlist.Playlist
5779     */
5780    Playlist.prototype.attachEvents = function () {
5781        var inst = this,
5782            link = $(inst.playlist).find(".playlist-section"),
5783            navItems = $(inst.playlist).find(".playlist-nav a"),
5784            playlistItem;
5785        link.on("click", function (event) {
5786            event.preventDefault();
5787            if (!inst.locked) {
5788                inst.locked = true;
5789                playlistItem = $(this).parents(".playlist-item");
5790                var itemIndex = playlistItem.index();
5791
5792                if (itemIndex !== inst.activeVideo) {
5793                    playlistItem.addClass("active");
5794                    playlistItem.siblings().removeClass("active");
5795                    inst.replaceSource(itemIndex, true);
5796                    inst.activeVideo = itemIndex;
5797                }
5798                //Change video source not more often
5799                //than once per second
5800                setTimeout(function(){
5801                    inst.locked = false;
5802                },1000);
5803            }
5804
5805        });
5806
5807        navItems.on("click", function (event) {
5808            event.preventDefault();
5809            var properties = {};
5810
5811            if (
5812                $(this)
5813                    .parent()
5814                    .hasClass("playlist-prev")
5815            ) {
5816                properties.back = true;
5817            }
5818            /**
5819             * Change video event fires when user clicks
5820             * a ".playlist-nav a" element.
5821             *
5822             * @event module:Playlist.Playlist#change-video
5823             * @type {object}
5824             * @property {Object} properties - Indicates whether playlist has back button
5825             */
5826            $(inst.playlist).trigger("change-video", properties);
5827        });
5828    };
5829    /**
5830     * For each playlist component creates new instance of
5831     * ["Playlist"]{@link  module:Playlist.Playlist} and calls
5832     * ["loadPlaylistVideo"]{@link  module:Playlist.Playlist.loadPlaylistVideo},
5833     * ["attachEvents"]{@link  module:Playlist.Playlist.attachEvents}
5834     * methods
5835     * @memberOf module:Playlist
5836     * @method
5837     * @param {jQuery} component Root DOM element of playlist component wrapped by jQuery
5838     * @param {Object} prop Properties set in data attribute
5839     *  of playlist component
5840     * @alias module:Playlist.initInstance
5841     */
5842    api.initInstance = function (component, prop) {
5843        var playlist;
5844        $(prop.playlistId).addClass("initialized"); //prevents video init in component-video.js
5845        if (prop.sources.length) {
5846            playlist = new Playlist(component, prop);
5847            playlist.loadPlaylistVideo();
5848            playlist.attachEvents();
5849        }
5850    };
5851    /**
5852     * Finds all not initialized yet
5853     * Playlist components and in a loop for each of them
5854     * run ["initInstance"]{@link module:Playlist.initInstance}
5855     * method.
5856     * @memberOf module:Playlist
5857     * @alias module:Playlist.init
5858     */
5859    api.init = function () {
5860        var playlists = $(".playlist.component:not(.initialized)"),
5861            properties;
5862
5863        playlists.each(function () {
5864            properties = $(this).data("properties");
5865            api.initInstance(this, properties);
5866            $(this).addClass("initialized");
5867        });
5868    };
5869
5870    return api;
5871})(jQuery, document);
5872
5873XA.register("playlist", XA.component.playlist);
5874
5875
5876/*  details-polyfill  */
5877/*
5878Details Element Polyfill 2.0.0
5879Copyright © 2017 Javan Makhmali
5880 */
5881(function () { }).call(this),
5882    function () {
5883    if (document.querySelector('body').getAttribute('class') && document.querySelector('body').getAttribute('class').indexOf('on-page-editor') > -1) {
5884            return;
5885        }
5886        var t, e, n, r, u, o, i, a, s, l, c, d;
5887        l = {
5888            element: function () {
5889                var t, e, n, r, u;
5890                return e = document.createElement("details"), "open" in e ? (e.innerHTML = "<summary>a</summary>b", e.setAttribute("style", "position: absolute; left: -9999px"), r = null != (u = document.body) ? u : document.documentElement, r.appendChild(e), t = e.offsetHeight, e.open = !0, n = e.offsetHeight, r.removeChild(e), t !== n) : !1
5891            }(),
5892            toggleEvent: function () {
5893                var t;
5894                return t = document.createElement("details"), "ontoggle" in t
5895            }()
5896        }, l.element && l.toggleEvent || (i = function () {
5897            return document.head.insertAdjacentHTML("afterbegin", '<style>@charset"UTF-8";details:not([open])>*:not(summary){display:none;}
5897details>summary{display:block;}details>summary::before{content:"\u25ba";padding-right:0.3rem;font-size:0.6rem;cursor:default;}details[open]>summary::before{content:"\u25bc";}</style>')
5898        }, o = function () {
5899            var t, e, n, r, u;
5900            return t = document.createElement("details").constructor.prototype, r = t.setAttribute, n = t.removeAttribute, u = null != (e = Object.getOwnPropertyDescriptor(t, "open")) ? e.set : void 0, Object.defineProperties(t, {
5901                open: {
5902                    set: function (t) {
5903                        return "DETAILS" === this.tagName ? (t ? this.setAttribute("open", "") : this.removeAttribute("open"), t) : null != u ? u.call(this, t) : void 0
5904                    }
5905                },
5906                setAttribute: {
5907                    value: function (t, e) {
5908                        return d(this, function (n) {
5909                            return function () {
5910                                return r.call(n, t, e)
5911                            }
5912                        }(this))
5913                    }
5914                },
5915                removeAttribute: {
5916                    value: function (t) {
5917                        return d(this, function (e) {
5918                            return function () {
5919                                return n.call(e, t)
5920                            }
5921                        }(this))
5922                    }
5923                }
5924            })
5925        }, a = function () {
5926            return r(function (t) {
5927                var e;
5928                return e = t.querySelector("summary"), t.hasAttribute("open") ? (t.removeAttribute("open"), e.setAttribute("aria-expanded", !1)) : (t.setAttribute("open", ""), e.setAttribute("aria-expanded", !0))
5929            })
5930        }, u = function () {
5931            var e, n, r, u, o;
5932            for (u = document.querySelectorAll("summary"), e = 0, n = u.length; n > e; e++) o = u[e], t(o);
5933            return "undefined" != typeof MutationObserver && null !== MutationObserver ? (r = new MutationObserver(function (e) {
5934                var n, r, u, i, a;
5935                for (i = [], r = 0, u = e.length; u > r; r++) n = e[r].addedNodes, i.push(function () {
5936                    var e, r, u;
5937                    for (u = [], e = 0, r = n.length; r > e; e++) a = n[e], "DETAILS" === a.tagName && (o = a.querySelector("summary")) ? u.push(t(o, a)) : u.push(void 0);
5938                    return u
5939                }());
5940                return i
5941            }), r.observe(document.documentElement, {
5942                subtree: !0,
5943                childList: !0
5944            })) : document.addEventListener("DOMNodeInserted", function (e) {
5945                return "SUMMARY" === e.target.tagName ? t(e.target) : void 0
5946            })
5947        }, t = function (t, e) {
5948            return null == e && (e = n(t, "DETAILS")), t.setAttribute("aria-expanded", e.hasAttribute("open")), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"), t.hasAttribute("role") ? void 0 : t.setAttribute("role", "button")
5949        }, s = function () {
5950            var t;
5951            return "undefined" != typeof MutationObserver && null !== MutationObserver ? (t = new MutationObserver(function (t) {
5952                var e, n, r, u, o, i;
5953                for (o = [], n = 0, r = t.length; r > n; n++) u = t[n], i = u.target, e = u.attributeName, "DETAILS" === i.tagName && "open" === e ? o.push(c(i)) : o.push(void 0);
5954                return o
5955            }), t.observe(document.documentElement, {
5956                attributes: !0,
5957                subtree: !0
5958            })) : r(function (t) {
5959                var e;
5960                return e = t.getAttribute("open"), setTimeout(function () {
5961                    return t.getAttribute("open") !== e ? c(t) : void 0
5962                }, 1)
5963            })
5964        }, e = function (t) {
5965            return !(t.defaultPrevented || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || t.target.isContentEditable)
5966        }, r = function (t) {
5967            return addEventListener("click", function (r) {
5968                var u, o;
5969                return e(r) && r.which <= 1 && (u = n(r.target, "SUMMARY")) && "DETAILS" === (null != (o = u.parentElement) ? o.tagName : void 0) ? t(u.parentElement) : void 0
5970            }, !1), addEventListener("keydown", function (r) {
5971                var u, o, i;
5972                return e(r) && (13 === (o = r.keyCode) || 32 === o) && (u = n(r.target, "SUMMARY")) && "DETAILS" === (null != (i = u.parentElement) ? i.tagName : void 0) ? (t(u.parentElement), r.preventDefault()) : void 0
5973            }, !1)
5974        }, n = function () {
5975            return "function" == typeof Element.prototype.closest ? function (t, e) {
5976                return t.closest(e)
5977            } : function (t, e) {
5978                for (; t;) {
5979                    if (t.tagName === e) return t;
5980                    t = t.parentElement
5981                }
5982            }
5983        }(), c = function (t) {
5984            var e;
5985            return e = document.createEvent("Events"), e.initEvent("toggle", !0, !1), t.dispatchEvent(e)
5986        }, d = function (t, e) {
5987            var n, r;
5988            return n = t.getAttribute("open"), r = e(), t.getAttribute("open") !== n && c(t), r
5989        }, l.element || (i(), o(), a(), u()), l.element && !l.toggleEvent && s())
5990    }.call(this),
5991    function () { }.call(this);
5992
5993/*  fixheight  */
5994/**
5995 * Component equalHeight
5996 * makes the same height of content that 'equal' class or for flip sides
5997 * @module equalHeight
5998 * @param  {jQuery} $ Instance of jQuery
5999 * @return {Object} List of equalHeight methods
6000 */
6001XA.component.equalHeight = (function ($) {
6002    /**
6003    * List of selectors for calculating height functionality
6004    * @type {Object.<Methods>}
6005    * @memberOf module:equalHeight
6006    * */
6007    var settings = {
6008        parentSelector: '.equalized-content',
6009        selector: '.equal:not(.flip.component),.flip .Side0,.flip .Side1'
6010    };
6011    /**
6012     * This object stores all public api methods
6013     * @type {Object.<Methods>}
6014     * @memberOf module:equalHeight
6015     * */
6016    var api = {};
6017    /**
6018    * fixHeight method calculates height of bigger element 
6019    * and sets up the same size for other elements
6020    * @memberOf module:equalHeight
6021    * @alias module:equalHeight.fixHeight
6022    */
6023    api.fixHeight = function () {
6024
6025        $(settings.parentSelector).each(function () {
6026            var $elements = $(this).find(settings.selector),
6027                maxHeight = 0;
6028
6029
6030
6031            $elements.each(function () {
6032                var $element = $(this);
6033                $element.css('min-height', 'inherit');
6034                $element.find('>.component-content').css('min-height', 'inherit');
6035
6036                if ($element.outerHeight(true) > maxHeight) {
6037                    maxHeight = $element.outerHeight(true);
6038                }
6039            });
6040
6041            if (maxHeight > 0) {
6042                $elements.each(function () {
6043                    var $element = $(this);
6044                    if ($element.hasClass("Side0") || $element.hasClass("Side1")) {
6045                        $element.parent().attr('class', 'flip').css({ 'min-height': maxHeight });
6046                    }
6047                    $element.css({
6048                        'min-height': maxHeight
6049                    });
6050                    $element.find('>.component-content').css({
6051                        'min-height': maxHeight
6052                    });
6053                });
6054            }
6055        });
6056    }
6057    /**
6058      * init method binds call of 
6059      * ["fixHeight"]{@link module:equalHeight.fixHeight} method
6060      * for window load and resize events
6061      * @memberOf module:equalHeight
6062      * @alias module:equalHeight.init
6063      */
6064    api.init = function () {
6065        $(document).ready(function () {
6066            api.fixHeight();
6067        })
6068
6069        $(window).on('resize', function () {
6070            setTimeout(api.fixHeight, 0);
6071        });
6072    };
6073
6074    return api;
6075
6076}(jQuery, document));
6077
6078XA.register("equalHeight", XA.component.equalHeight);
6079
6080/*  html2pdfbundlemin  */
6081/**
6082 * html2pdf.js v0.9.3
6083 * Copyright (c) 2021 Erik Koopmans
6084 * Released under the MIT License.
6085 */
6086(function (global, factory) {
6087	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
6088	typeof define === 'function' && define.amd ? define(factory) :
6089	(global.html2pdf = factory());
6090}(this, (function () { 'use strict';
6091
6092var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6093
6094function commonjsRequire () {
6095	throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
6096}
6097
6098function unwrapExports (x) {
6099	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6100}
6101
6102function createCommonjsModule(fn, module) {
6103	return module = { exports: {} }, fn(module, module.exports), module.exports;
6104}
6105
6106var jspdf_min = createCommonjsModule(function (module, exports) {
6107!function(t,e){module.exports=e();}(commonjsGlobal,function(){var t,y,e,I,i,o,a,h,C,T,d,p,F,n,r,s,c,P,E,q,g,m,w,l,v,b,x,S,u,k,_,f,A,O,B,R,j,D,M,U,N,z,L,H,W,G,V,Y,X,J,K,Q,Z,vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$=function(pt){var gt="1.3",mt={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],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};function wt(o){var a={};this.subscribe=function(t,e,n){if("function"!=typeof e)return!1;a.hasOwnProperty(t)||(a[t]={});var r=Math.random().toString(35);return a[t][r]=[e,!!n], r}, this.unsubscribe=function(t){for(var e in a)if(a[e][t])return delete a[e][t], !0;return!1}, this.publish=function(t){if(a.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1
6107),n=[];for(var r in a[t]){var i=a[t][r];try{i[0].apply(o,e);}catch(t){pt.console&&console.error("jsPDF PubSub Error",t.message,t);}i[1]&&n.push(r);}n.length&&n.forEach(this.unsubscribe);}};}function yt(t,e,n,r){var i={};"object"===(void 0===t?"undefined":vt(t))&&(t=(i=t).orientation, e=i.unit||e, n=i.format||n, r=i.compress||i.compressPdf||r), e=e||"mm", n=n||"a4", t=(""+(t||"P")).toLowerCase();(""+n).toLowerCase();var K,w,y,o,u,v,a,s,h,c,l,f=!!r&&"function"==typeof Uint8Array,Q=i.textColor||"0 g",d=i.drawColor||"0 G",Z=i.fontSize||16,$=i.charSpace||0,tt=i.R2L||!1,et=i.lineHeight||1.15,p=i.lineWidth||.200025,g="00000000000000000000000000000000",m=2,b=!1,x=[],nt={},S={},k=0,_=[],A=[],I=[],C=[],T=[],F=0,P=0,E=0,q={title:"",subject:"",author:"",keywords:"",creator:""},O={},rt=new wt(O),B=i.hotfixes||[],R=function(t){var e,n=t.ch1,r=t.ch2,i=t.ch3,o=t.ch4,a=(t.precision, "draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof n&&"#"!==n.charAt(0)){var s=new RGBColor(n);s.ok&&(n=s.toHex());}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]), "string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var h=parseInt(n.substr(1),16);n=h>>16&255, r=h>>8&255, i=255&h;}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=N(n/255)+" "+a[0];break;case 3:default:e=z(n/255)+" "+a[0];}else if(void 0===o||"object"===(void 0===o?"undefined":vt(o))){if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[N(n/255),N(r/255),N(i/255),a[1]].join(" ");break;default:case 3:e=[z(n/255),z(r/255),z(i/255),a[1]].join(" ");}o&&0===o.a&&(e=["255","255","255",a[1]].join(" "));}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[N(n),N(r),N(i),N(o),a[2]].join(" ");break;case 3:default:e=[z(n),z(r),z(i),z(o),a[2]].join(" ");}return e},j=function(t){var e=function(t){return("0"+parseInt(t)).slice(-2)},n=t.getTimezoneOffset(),r=n<0?"+":"-",i=Math.floor(Math.abs(n/60)),o=Math.abs(n%60),a=[r,e(i),"'",e(o),"'"].join("");return["D:",t.getFullYear(),e(t.getMonth()+1),e(t.getDate()),e(t.getHours()),e(t.getMinutes()),e(t.getSeconds()),a].join("")},D=function(t){var e;return void 0===(void 0===t?"undefined":vt(t))&&(t=new Date), e="object"===(void 0===t?"undefined":vt(t))&&"[object Date]"===Object.prototype.toString.call(t)?j(t):/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t)?t:j(new Date), c=e},M=function(t){var e=c;return"jsDate"===t&&(e=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),a=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10), parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,a,0)}(c)), e},U=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""), g=t},N=function(t){return t.toFixed(2)},z=function(t){return t.toFixed(3)},it=function(t){t="string"==typeof t?t:t.toString(), b?_[o].push(t):(E+=t.length+1, C.push(t));},L=function(){return x[++m]=E, it(m+" 0 obj"), m},H=function(t){it("stream"), it(t), it("endstream");},W=function(){for(var t in it("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), it("/Font <<"), nt)nt.hasOwnProperty(t)&&it("/"+t+" "+nt[t].objectNumber+" 0 R");it(">>"), it("/XObject <<"), rt.publish("putXobjectDict"), it(">>");},G=function(){!function(){for(var t in nt)nt.hasOwnProperty(t)&&(e=nt[t], rt.publish("putFont",{font:e,out:it,newObject:L}), !0!==e.isAlreadyPutted&&(e.objectNumber=L(), it("<<"), it("/Type /Font"), it("/BaseFont /"+e.postScriptName), it("/Subtype /Type1"), "string"==typeof e.encoding&&it("/Encoding /"+e.encoding), it("/FirstChar 32"), it("/LastChar 255"), it(">>"), it("endobj")));var e;}(), rt.publish("putResources"), x[2]=E, it("2 0 obj"), it("<<"), W(), it(">>"), it("endobj"), rt.publish("postPutResources");},V=function(t,e,n){S.hasOwnProperty(e)||(S[e]={}), S[e][n]=t;},Y=function(t,e,n,r){var i="F"+(Object.keys(nt).length+1).toString(10),o=nt[i]={id:i,postScriptName:t,fontName:e,fontStyle:n,encoding:r,metadata:{}};return V(i,e,n), rt.publish("addFont",o), i},ot=function(t,e){return function(t,e){var n,r,i,o,a,s,h,c,l;if(i=(e=e||{}).sourceEncoding||"Unicode", a=e.outputEncoding, (e.autoencode||a)&&nt[K].metadata&&nt[K].metadata[i]&&nt[K].metadata[i].encoding&&(o=nt[K].metadata[i].encoding, !a&&nt[K].encoding&&(a=nt[K].encoding), !a&&o.codePages&&(a=o.c
6107odePages[0]), "string"==typeof a&&(a=o[a]), a)){for(h=!1, s=[], n=0, r=t.length;n<r;n++)(c=a[t.charCodeAt(n)])?s.push(String.fromCharCode(c)):s.push(t[n]), s[n].charCodeAt(0)>>8&&(h=!0);t=s.join("");}for(n=t.length;void 0===h&&0!==n;)t.charCodeAt(n-1)>>8&&(h=!0), n--;if(!h)return t;for(s=e.noBOM?[]:[254,255], n=0, r=t.length;n<r;n++){if((l=(c=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(l), s.push(c-(l<<8));}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},X=function(){(function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();mt.hasOwnProperty(r)&&(t=mt[r][0]/w, e=mt[r][1]/w);}if(Array.isArray(t)&&(e=t[1], t=t[0]), n){switch(n.substr(0,1)){case"l":t<e&&(n="s");break;case"p":e<t&&(n="s");}"s"===n&&(y=t, t=e, e=y);}b=!0, _[++k]=[], I[k]={width:Number(t)||u,height:Number(e)||v}, A[k]={}, J(k);}).apply(this,arguments), it(N(p*w)+" w"), it(d), 0!==F&&it(F+" J"), 0!==P&&it(P+" j"), rt.publish("addPage",{pageNumber:k});},J=function(t){0<t&&t<=k&&(u=I[o=t].width, v=I[t].height);},at=function(t,e,n){var r,i=void 0;return n=n||{}, t=void 0!==t?t:nt[K].fontName, e=void 0!==e?e:nt[K].fontStyle, r=t.toLowerCase(), void 0!==S[r]&&void 0!==S[r][e]?i=S[r][e]:void 0!==S[t]&&void 0!==S[t][e]?i=S[t][e]:!1===n.disableWarning&&console.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."), i||n.noFallback||null==(i=S.times[e])&&(i=S.times.normal), i},st=function(){b=!1, m=2, E=0, C=[], x=[], T=[], rt.publish("buildDocument"), it("%PDF-"+gt), it("%ºß¬à"), function(){var t,e,n,r,i,o,a,s,h,c=[];for(a=pt.adler32cs||yt.API.adler32cs, f&&void 0===a&&(f=!1), t=1;t<=k;t++){if(c.push(L()), s=(u=I[t].width)*w, h=(v=I[t].height)*w, it("<</Type /Page"), it("/Parent 1 0 R"), it("/Resources 2 0 R"), it("/MediaBox [0 0 "+N(s)+" "+N(h)+"]"), rt.publish("putPage",{pageNumber:t,page:_[t]}), it("/Contents "+(m+1)+" 0 R"), it(">>"), it("endobj"), e=_[t].join("\n"), L(), f){for(n=[], r=e.length;r--;)n[r]=e.charCodeAt(r);o=a.from(e), (i=new Deflater(6)).append(new Uint8Array(n)), e=i.flush(), (n=new Uint8Array(e.length+6)).set(new Uint8Array([120,156])), n.set(e,2), n.set(new Uint8Array([255&o,o>>8&255,o>>16&255,o>>24&255]),e.length+2), e=String.fromCharCode.apply(null,n), it("<</Length "+e.length+" /Filter [/FlateDecode]>>");}else it("<</Length "+e.length+">>");H(e), it("endobj");}x[1]=E, it("1 0 obj"), it("<</Type /Pages");var l="/Kids [";for(r=0;r<k;r++)l+=c[r]+" 0 R ";it(l+"]"), it("/Count "+k), it(">>"), it("endobj"), rt.publish("postPutPages");}(), function(){rt.publish("putAdditionalObjects");for(var t=0;t<T.length;t++){var e=T[t];x[e.objId]=E, it(e.objId+" 0 obj"), it(e.content), it("endobj");}m+=T.length, rt.publish("postPutAdditionalObjects");}(), G(), L(), it("<<"), function(){for(var t in it("/Producer (jsPDF "+yt.version+")"), q)q.hasOwnProperty(t)&&q[t]&&it("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+ot(q[t])+")");it("/CreationDate ("+c+")");}(), it(">>"), it("endobj"), L(), it("<<"), function(){switch(it("/Type /Catalog"), it("/Pages 1 0 R"), s||(s="fullwidth"), s){case"fullwidth":it("/OpenAction [3 0 R /FitH null]");break;case"fullheight":it("/OpenAction [3 0 R /FitV null]");break;case"fullpage":it("/OpenAction [3 0 R /Fit]");break;case"original":it("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+s;"%"===t.substr(t.length-1)&&(s=parseInt(s)/100), "number"==typeof s&&it("/OpenAction [3 0 R /XYZ null null "+N(s)+"]");}switch(h||(h="continuous"), h){case"continuous":it("/PageLayout /OneColumn");break;case"single":it("/PageLayout /SinglePage");break;case"two":case"twoleft":it("/PageLayout /TwoColumnLeft");break;case"tworight":it("/PageLayout /TwoColumnRight");}a&&it("/PageMode /"+a), rt.publish("putCatalog");}(), it(">>"), it("endobj");var t,e=E,n="0000000000";for(it("xref"), it("0 "+(m+1)), it(n+" 65535 f "), t=1;t<=m;t++){var r=x[t];it("function"==typeof r?(n+x[t]()).slice(-10)+" 00000 n ":(n+x[t]).slice(-10)+" 00000 n ");}return it("trailer"), it("<<"), it("/Size "+(m+1)), it("/Root "+m+" 0 R"), it("/Info "+(m-1)+" 0 R"), it("/ID [ <"+g+"> <"+g+"> ]"), it(">>
6107"), it("startxref"), it(""+e), it("%%EOF"), b=!0, C.join("\n")},ht=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t), e},ct=function(){for(var t=st(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},lt=function(){return new Blob([ct()],{type:"application/pdf"})},ut=((l=function(t,e){var n="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(st()):0;switch(t){case void 0:return st();case"save":if("object"===("undefined"==typeof navigator?"undefined":vt(navigator))&&navigator.getUserMedia&&(void 0===pt.URL||void 0===pt.URL.createObjectURL))return O.output("dataurlnewwindow");bt(lt(),e), "function"==typeof bt.unload&&pt.setTimeout&&setTimeout(bt.unload,911);break;case"arraybuffer":return ct();case"blob":return lt();case"bloburi":case"bloburl":return pt.URL&&pt.URL.createObjectURL(lt())||void 0;case"datauristring":case"dataurlstring":return n;case"dataurlnewwindow":var r=pt.open(n);if(r||"undefined"==typeof safari)return r;case"datauri":case"dataurl":return pt.document.location.href=n;default:throw new Error('Output type "'+t+'" is not supported.')}}).foo=function(){try{return l.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!pt.console)throw new Error(n);pt.console.error(n,t), pt.alert&&alert(n);}}, (l.foo.bar=l).foo),ft=function(t){return!0===Array.isArray(B)&&-1<B.indexOf(t)};switch(e){case"pt":w=1;break;case"mm":w=72/25.4;break;case"cm":w=72/2.54;break;case"in":w=72;break;case"px":w=1==ft("px_scaling")?.75:96/72;break;case"pc":case"em":w=12;break;case"ex":w=6;break;default:throw"Invalid unit: "+e}for(var dt in D(), U(), O.internal={pdfEscape:ot,getStyle:ht,getFont:function(){return nt[at.apply(O,arguments)]},getFontSize:function(){return Z},getCharSpace:function(){return $},getTextColor:function(){var t=Q.split(" ");if(2===t.length&&"g"===t[1]){var e=parseFloat(t[0]);t=[e,e,e,"r"];}for(var n="#",r=0;r<3;r++)n+=("0"+Math.floor(255*parseFloat(t[r])).toString(16)).slice(-2);return n},getLineHeight:function(){return Z*et},write:function(t){it(1===arguments.length?t:Array.prototype.join.call(arguments," "));},getCoordinateString:function(t){return N(t*w)},getVerticalCoordinateString:function(t){return N((v-t)*w)},collections:{},newObject:L,newAdditionalObject:function(){var t=2*_.length+1,e={objId:t+=T.length,content:""};return T.push(e), e},newObjectDeferred:function(){return x[++m]=function(){return E}, m},newObjectDeferredBegin:function(t){x[t]=E;},putStream:H,events:rt,scaleFactor:w,pageSize:{getWidth:function(){return u},getHeight:function(){return v}},output:function(t,e){return ut(t,e)},getNumberOfPages:function(){return _.length-1},pages:_,out:it,f2:N,getPageInfo:function(t){return{objId:2*(t-1)+3,pageNumber:t,pageContext:A[t]}},getCurrentPageInfo:function(){return{objId:2*(o-1)+3,pageNumber:o,pageContext:A[o]}},getPDFVersion:function(){return gt},hasHotfix:ft}, O.addPage=function(){return X.apply(this,arguments), this}, O.setPage=function(){return J.apply(this,arguments), this}, O.insertPage=function(t){return this.addPage(), this.movePage(o,t), this}, O.movePage=function(t,e){if(e<t){for(var n=_[t],r=I[t],i=A[t],o=t;e<o;o--)_[o]=_[o-1], I[o]=I[o-1], A[o]=A[o-1];_[e]=n, I[e]=r, A[e]=i, this.setPage(e);}else if(t<e){for(n=_[t], r=I[t], i=A[t], o=t;o<e;o++)_[o]=_[o+1], I[o]=I[o+1], A[o]=A[o+1];_[e]=n, I[e]=r, A[e]=i, this.setPage(e);}return this}, O.deletePage=function(){return function(t){0<t&&t<=k&&(_.splice(t,1), I.splice(t,1), --k<o&&(o=k), this.setPage(o));}.apply(this,arguments), this}, O.setCreationDate=function(t){return D(t), this}, O.getCreationDate=function(t){return M(t)}, O.setFileId=function(t){return U(t), this}, O.getFileId=function(){return g}, O.setDisplayMode=function(t,e,n){if(s=t, h=e, -1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(a=n))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+n+'" is not recognized.');return this}, O.text=function(t,e,n,i){var r,o,a="",s=et,h=this;function c(t){for(var e,n=t.concat(),r=[],i=n.length;i--;
6107)"string"==typeof(e=n.shift())?r.push(e):"[object Array]"===Object.prototype.toString.call(t)&&1===e.length?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function l(t,e){var n;if("string"==typeof t)n=e(t)[0];else if("[object Array]"===Object.prototype.toString.call(t)){for(var r,i,o=t.concat(),a=[],s=o.length;s--;)"string"==typeof(r=o.shift())?a.push(e(r)[0]):"[object Array]"===Object.prototype.toString.call(r)&&"string"===r[0]&&(i=e(r[0],r[1],r[2]), a.push([i[0],i[1],i[2]]));n=a;}return n}"number"==typeof t&&(o=n, n=e, e=t, t=o);var u=i,f=arguments[4],d=arguments[5];"object"===(void 0===u?"undefined":vt(u))&&null!==u||("string"==typeof f&&(d=f, f=null), "string"==typeof u&&(d=u, u=null), "number"==typeof u&&(f=u, u=null), i={flags:u,angle:f,align:d});var p=!1,g=!0;if("string"==typeof t)p=!0;else if("[object Array]"===Object.prototype.toString.call(t)){for(var m,w=t.concat(),y=[],v=w.length;v--;)("string"!=typeof(m=w.shift())||"[object Array]"===Object.prototype.toString.call(m)&&"string"!=typeof m[0])&&(g=!1);p=g;}if(!1===p)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');var b=nt[K].encoding;"WinAnsiEncoding"!==b&&"StandardEncoding"!==b||(t=l(t,function(t,e,n){return[(r=t, r=r.split("\t").join(Array(i.TabLen||9).join(" ")), ot(r,u)),e,n];var r;})), "string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]), 0<(j=i.maxWidth||0)&&("string"==typeof t?t=h.splitTextToSize(t,j):"[object Array]"===Object.prototype.toString.call(t)&&(t=h.splitTextToSize(t.join(" "),j)));var x={text:t,x:e,y:n,options:i,mutex:{pdfEscape:ot,activeFontKey:K,fonts:nt,activeFontSize:Z}};rt.publish("preProcessText",x), t=x.text;f=(i=x.options).angle;var S=h.internal.scaleFactor,k=(h.internal.pageSize.getHeight(), []);if(f){f*=Math.PI/180;var _=Math.cos(f),A=Math.sin(f),I=function(t){return t.toFixed(2)};k=[I(_),I(A),I(-1*A),I(_)];}void 0!==(R=i.charSpace)&&(a+=R+" Tc\n");i.lang;var C=-1,T=i.renderingMode||i.stroke,F=h.internal.getCurrentPageInfo().pageContext;switch(T){case 0:case!1:case"fill":C=0;break;case 1:case!0:case"stroke":C=1;break;case 2:case"fillThenStroke":C=2;break;case 3:case"invisible":C=3;break;case 4:case"fillAndAddForClipping":C=4;break;case 5:case"strokeAndAddPathForClipping":C=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":C=6;break;case 7:case"addToPathForClipping":C=7;}var P=F.usedRenderingMode||-1;-1!==C?a+=C+" Tr\n":-1!==P&&(a+="0 Tr\n"), -1!==C&&(F.usedRenderingMode=C);d=i.align||"left";var E=Z*s,q=h.internal.pageSize.getHeight(),O=h.internal.pageSize.getWidth(),B=(S=h.internal.scaleFactor, nt[K]),R=i.charSpace||$,j=i.maxWidth||0,D=(u={}, []);if("[object Array]"===Object.prototype.toString.call(t)){var M,U;y=c(t);"left"!==d&&(U=y.map(function(t){return h.getStringUnitWidth(t,{font:B,charSpace:R,fontSize:Z})*Z/S}));var N,z=Math.max.apply(Math,U),L=0;if("right"===d){e-=U[0], t=[];var H=0;for(v=y.length;H<v;H++)z-U[H], 0===H?(N=e*S, M=(q-n)*S):(N=(L-U[H])*S, M=-E), t.push([y[H],N,M]), L=U[H];}else if("center"===d){e-=U[0]/2, t=[];for(H=0, v=y.length;H<v;H++)(z-U[H])/2, 0===H?(N=e*S, M=(q-n)*S):(N=(L-U[H])/2*S, M=-E), t.push([y[H],N,M]), L=U[H];}else if("left"===d){t=[];for(H=0, v=y.length;H<v;H++)M=0===H?(q-n)*S:-E, N=0===H?e*S:0, t.push(y[H]);}else{if("justify"!==d)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[];for(j=0!==j?j:O, H=0, v=y.length;H<v;H++)M=0===H?(q-n)*S:-E, N=0===H?e*S:0, H<v-1&&D.push(((j-U[H])/(y[H].split(" ").length-1)*S).toFixed(2)), t.push([y[H],N,M]);}}!0===("boolean"==typeof i.R2L?i.R2L:tt)&&(t=l(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]}));x={text:t,x:e,y:n,options:i,mutex:{pdfEscape:ot,activeFontKey:K,fonts:nt,activeFontSize:Z}};rt.publish("postProcessText",x), t=x.text, r=x.mutex.isHex;y=c(t);t=[];var W,G,V,Y=0,X=(v=y.length, "");for(H=0;H<v;H++)X="", "[object Array]"!==Object.prototype.toString.call(y[H])?(W=parseFloat(e*S).toFixed(2), G=parseFloat((q-n)*S).toFixed(2), V=(r?"<":"(")+y[H]+(r?">":")")):"[object Array]"===Object.prototype.toString.call(y[H])&&(W=parseFloat(y[H][1]).toFixed(2), G=parseFloat(y[H][2]).toFixed(2), V=(r?"<":"(")+y[H][0]+(r?">":")"), Y=1), void 0!==D&&void 0!==D[H]&&(X=D[H]+" Tw\n"), 0!==k.length&&0===H?t.push(X+k.join(" ")+" "+W+" "+G+" Tm\n"+V):1===Y||0===Y&&0===H?t.push(X+W+" "+G+" Td\n"+V):t.push(X+V);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"), t+=" Tj\n";var J="BT\n/"+K+" "+Z+" Tf\n"+(Z*s).toFixed(2)+" TL\n"+Q+"\n";return J+=a, J+=t, it(J+="ET"), h}, O.lstext=function(t,e,n,r){console.warn("jsPDF.lstext is deprecated");for(var i=0,o=t.length;i<o;i++, e+=r)this.text(t[i],e,n);return this}, O.line=function(t,e,n,r){return this.lines([[n-t,r-e]],t,e)}
6107, O.clip=function(){it("W"), it("S");}, O.clip_fixed=function(t){it("evenodd"===t?"W*":"W"), it("n");}, O.lines=function(t,e,n,r,i,o){var a,s,h,c,l,u,f,d,p,g,m;for("number"==typeof t&&(y=n, n=e, e=t, t=y), r=r||[1,1], it(z(e*w)+" "+z((v-n)*w)+" m "), a=r[0], s=r[1], c=t.length, g=e, m=n, h=0;h<c;h++)2===(l=t[h]).length?(g=l[0]*a+g, m=l[1]*s+m, it(z(g*w)+" "+z((v-m)*w)+" l")):(u=l[0]*a+g, f=l[1]*s+m, d=l[2]*a+g, p=l[3]*s+m, g=l[4]*a+g, m=l[5]*s+m, it(z(u*w)+" "+z((v-f)*w)+" "+z(d*w)+" "+z((v-p)*w)+" "+z(g*w)+" "+z((v-m)*w)+" c"));return o&&it(" h"), null!==i&&it(ht(i)), this}, O.rect=function(t,e,n,r,i){ht(i);return it([N(t*w),N((v-e)*w),N(n*w),N(-r*w),"re"].join(" ")), null!==i&&it(ht(i)), this}, O.triangle=function(t,e,n,r,i,o,a){return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],a,!0), this}, O.roundedRect=function(t,e,n,r,i,o,a){var s=4/3*(Math.SQRT2-1);return this.lines([[n-2*i,0],[i*s,0,i,o-o*s,i,o],[0,r-2*o],[0,o*s,-i*s,o,-i,o],[2*i-n,0],[-i*s,0,-i,-o*s,-i,-o],[0,2*o-r],[0,-o*s,i*s,-o,i,-o]],t+i,e,[1,1],a), this}, O.ellipse=function(t,e,n,r,i){var o=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return it([N((t+n)*w),N((v-e)*w),"m",N((t+n)*w),N((v-(e-a))*w),N((t+o)*w),N((v-(e-r))*w),N(t*w),N((v-(e-r))*w),"c"].join(" ")), it([N((t-o)*w),N((v-(e-r))*w),N((t-n)*w),N((v-(e-a))*w),N((t-n)*w),N((v-e)*w),"c"].join(" ")), it([N((t-n)*w),N((v-(e+a))*w),N((t-o)*w),N((v-(e+r))*w),N(t*w),N((v-(e+r))*w),"c"].join(" ")), it([N((t+o)*w),N((v-(e+r))*w),N((t+n)*w),N((v-(e+a))*w),N((t+n)*w),N((v-e)*w),"c"].join(" ")), null!==i&&it(ht(i)), this}, O.circle=function(t,e,n,r){return this.ellipse(t,e,n,n,r)}, O.setProperties=function(t){for(var e in q)q.hasOwnProperty(e)&&t[e]&&(q[e]=t[e]);return this}, O.setFontSize=function(t){return Z=t, this}, O.setFont=function(t,e){return K=at(t,e), this}, O.setFontStyle=O.setFontType=function(t){return K=at(void 0,t), this}, O.getFontList=function(){var t,e,n,r={};for(t in S)if(S.hasOwnProperty(t))for(e in r[t]=n=[], S[t])S[t].hasOwnProperty(e)&&n.push(e);return r}, O.addFont=function(t,e,n,r){Y(t,e,n,r=r||"Identity-H");}, O.setLineWidth=function(t){return it((t*w).toFixed(2)+" w"), this}, O.setDrawColor=function(t,e,n,r){return it(R({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2})), this}, O.setFillColor=function(t,e,n,r){return it(R({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2})), this}, O.setTextColor=function(t,e,n,r){return Q=R({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}), this}, O.setCharSpace=function(t){return $=t, this}, O.setR2L=function(t){return tt=t, this}, O.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2}, O.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return it((F=e)+" J"), this}, O.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return it((P=e)+" j"), this}, O.output=ut, O.save=function(t){O.output("save",t);}, yt.API)yt.API.hasOwnProperty(dt)&&("events"===dt&&yt.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0], r=e[i][1], t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r));}(rt,yt.API.events):O[dt]=yt.API[dt]);return function(){for(var t="helvetica",e="times",n="courier",r="normal",i="bold",o="italic",a="bolditalic",s=[["Helvetica",t,r,"WinAnsiEncoding"],["Helvetica-Bold",t,i,"WinAnsiEncoding"],["Helvetica-Oblique",t,o,"WinAnsiEncoding"],["Helvetica-BoldOblique",t,a,"WinAnsiEncoding"],["Courier",n,r,"WinAnsiEncoding"],["Courier-Bold",n,i,"WinAnsiEncoding"],["Courier-Oblique",n,o,"WinAnsiEncoding"],["Courier-BoldOblique",n,a,"WinAnsiEncoding"],["Times-Roman",e,r,"WinAnsiEncoding"],["Times-Bold",e,i,"WinAnsiEncoding"],["Times-Italic",e,o,"WinAnsiEncoding"],["Times-BoldItalic",e,a,"WinAnsiEncoding"],["ZapfDingbats","zapfdingbats",r,null],["Symbol","symbol",r,null]],h=0,c=s.length;h<c;h++){var l=Y(s[h][0],s[h][1],s[h][2],s[h][3]),u=s[h][0].split("-");V(l,u[0],u[1]||"");}rt.publish("addFonts",{fonts:nt,dictionary:S});}(), K="F1", X(n,t), rt.publish("initialized"), O}return yt.API={events:[]}, yt.version="0.0.0", "function"==typeof undefined&&undefined.amd?undefined("jsPDF",function(){return yt}):"undefined"!='object'&&module.exports?(module.exports=yt, module.exports.jsPDF=yt):pt.jsPDF=yt, yt}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")());
6108/** @preserve
6109   * jsPDF - PDF Document creation from JavaScript
6110   * Version 1.4.1 Built on 2018-06-06T07:49:34.040Z
6111   *                           CommitID 3233f44044
6112   *
6113   * Copyright (c) 2010-2016 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
6114   *               2010 Aaron Spike, https://github.com/acspike
6115   *               2012 Willow Systems Corporation, willow-systems.com
6116   *               2012 Pablo Hess, https://github.com/pablohess
6117   *               2012 Florian Jenett, https://github.com/fjenett
6118   *               2013 Warren Weckesser, https://github.com/warrenweckesser
6119   *               2013 Youssef Beddad, https://github.com/lifof
6120   *               2013 Lee Driscoll, https://github.com/lsdriscoll
6121   *               2013 Stefan Slonevskiy, https://github.com/stefslon
6122   *               2013 Jeremy Morel, https://github.com/jmorel
6123   *               2013 Christoph Hartmann, https://github.com/chris-rock
6124   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
6125   *               2014 James Makes, https://github.com/dollaruw
6126   *               2014 Diego Casorran, https://github.com/diegocr
6127   *               2014 Steven Spungin, https://github.com/Flamenco
6128   *               2014 Kenneth Glassey, https://github.com/Gavver
6128s
6129   *
6130   * Licensed under the MIT License
6131   *
6132   * Contributor(s):
6133   *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
6134   *    kim3er, mfo, alnorth, Flamenco
6135   */
6136/**
6137   * jsPDF AcroForm Plugin Copyright (c) 2016 Alexander Weidt,
6138   * https://github.com/BiggA94
6139   * 
6140   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
6141   */
6142!function(n,t){var l,a,e=1,r=function(t,e){t.prototype=Object.create(e.prototype), t.prototype.constructor=t;},s=function(t){return t*(e/1)},h=function(t){var e=new I,n=N.internal.getHeight(t)||0,r=N.internal.getWidth(t)||0;return e.BBox=[0,0,r.toFixed(2),n.toFixed(2)], e},i=function(t,e,n){t=t||0;var r=1;if(r<<=e-1, 1==(n=n||1))t=t|r;else t=t&~r;return t},o=function(t,e,n){n=n||1.3, t=t||0;return 1==e.readOnly&&(t=i(t,1)), 1==e.required&&(t=i(t,2)), 1==e.noExport&&(t=i(t,3)), 1==e.multiline&&(t=i(t,13)), e.password&&(t=i(t,14)), e.noToggleToOff&&(t=i(t,15)), e.radio&&(t=i(t,16)), e.pushbutton&&(t=i(t,17)), e.combo&&(t=i(t,18)), e.edit&&(t=i(t,19)), e.sort&&(t=i(t,20)), e.fileSelect&&1.4<=n&&(t=i(t,21)), e.multiSelect&&1.4<=n&&(t=i(t,22)), e.doNotSpellCheck&&1.4<=n&&(t=i(t,23)), 1==e.doNotScroll&&1.4<=n&&(t=i(t,24)), e.richText&&1.4<=n&&(t=i(t,25)), t},u=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o={};return Array.isArray(e)?(e[0]=s(e[0]), e[1]=s(e[1]), e[2]=s(e[2]), e[3]=s(e[3])):(e=s(e), n=s(n), r=s(r), i=s(i)), o.lowerLeft_X=e||0, o.lowerLeft_Y=s(a)-n-i||0, o.upperRight_X=e+r||0, o.upperRight_Y=s(a)-n||0, [o.lowerLeft_X.toFixed(2),o.lowerLeft_Y.toFixed(2),o.upperRight_X.toFixed(2),o.upperRight_Y.toFixed(2)]},f=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=c(t,n);e.push("/Tx BMC"), e.push("q"), e.push("/F1 "+r.fontSize.toFixed(2)+" Tf"), e.push("1 0 0 1 0 0 Tm"), e.push("BT"), e.push(r.text), e.push("ET"), e.push("Q"), e.push("EMC");var i=new h(t);return i.stream=e.join("\n"), i}},c=function(t,e,i,n){n=n||12, i=i||"helvetica";var r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" "),a=n,s=N.internal.getHeight(t)||0;s=s<0?-s:s;var h=N.internal.getWidth(t)||0;h=h<0?-h:h;var c=function(t,e,n){if(t+1<o.length){var r=e+" "+o[t+1];return A(r,n+"px",i).width<=h-4}return!1};a++;t:for(;;){e="";var l=A("3",--a+"px",i).height,u=t.multiline?s-a:(s-l)/2,f=-2,d=u+=2,p=0,g=0,m=0;if(a<=0){a=12, e="(...) Tj\n", e+="% Width of Text: "+A(e,"1px").width+", FieldWidth:"+h+"\n";break}m=A(o[0]+" ",a+"px",i).width;var w="",y=0;for(var v in o){w=" "==(w+=o[v]+" ").substr(w.length-1)?w.substr(0,w.length-1):w;var b=parseInt(v);m=A(w+" ",a+"px",i).width;var x=c(b,w,a),S=v>=o.length-1;if(!x||S){if(x||S){if(S)g=b;else if(t.multiline&&s<(l+2)*(y+2)+2)continue t}else{if(!t.multiline)continue t;if(s<(l+2)*(y+2)+2)continue t;g=b;}for(var k="",_=p;_<=g;_++)k+=o[_]+" ";switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k, m=A(k,a+"px",i).width, t.Q){case 2:f=h-m-2;break;case 1:f=(h-m)/2;break;case 0:default:f=2;}e+=f.toFixed(2)+" "+d.toFixed(2)+" Td\n", e+="("+k+") Tj\n", e+=-f.toFixed(2)+" 0 Td\n", d=-(a+2), m=0, p=g+1, y++, w="";}else w+=" ";}break}return r.text=e, r.fontSize=a, r},A=function(t,e,n){n=n||"helvetica";var r=l.internal.getFont(n),i=l.getStringUnitWidth(t,{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e);return{height:l.getStringUnitWidth("3",{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e)*1.5,width:i}},d={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){for(var t in l.internal.acroformPlugin.acroFormDictionaryRoot.Fields){var e=l.internal.acroformPlugin.acroFormDictionaryRoot.Fields[t];e.hasAnnotation&&m.call(l,e);}},g=function(t){l.internal.acroformPlugin.printedOut&&(l.internal.acroformPlugin.printedOut=!1, l.internal.acroformPlugin.acroFormDictionaryRoot=null), l.internal.acroformPlugin.acroFormDictionaryRoot||x.call(l), l.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t);},m=function(t){var e={type:"reference",object:t};l.annotationPlugin.annotations[l.internal.getPageInfo(t.page).pageNumber].push(e);},w=function(){void 0!==l.internal.acroformPlugin.acroFormDictionaryRoot?l.internal.write("/AcroForm "+l.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...");},y=function(){l.internal.events.unsubscribe(l.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete l.internal.acroformPlugin.acroFormDictionaryRoot._eventID, l.internal.acroformPlugin.printedOut=!0;},v=function(t){var e=!t;t||(l.internal.newObjectDeferredBegin(l.internal.acroformPlugin.acroFormDictionaryRoot.objId), l.internal.out(l.internal.acroformPlugin.acroFormDictionaryRoot.getString()));t=t||l.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t){var r=t[n],i=r.Rect;r.Rect&&(r.Rect=u.call(this,r.Rect)), l.internal.newObjectDeferredBegin(r.objId);var o=r.objId+" 0 obj\n<<\n";if("object"===(void 0===r?"undefined":vt(r))&&"function"==typeof r.getContent&&(o+=r.getContent()), r.Rect=i, r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);o+="/AP << /N "+a+" >>\n", l.internal.acroformPlugin.xForms.push(a);}if(r.appearanceStreamContent){for(var s in o+="/AP << ", r.appearanceStreamContent){var h=r.appearanceStreamContent[s];if(o+="/"+s+" ", o+="<< ", 1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var c;"function"==typeof(c=h[n])&&(c=c.call(this,r)), o+="/"+n+" "+c+" ", 0<=l.internal.acroformPlugin.xForms.indexOf(c)||l.internal.acroformPlugin.xForms.push(c);}
6142else"function"==typeof(c=h)&&(c=c.call(this,r)), o+="/"+n+" "+c+" \n", 0<=l.internal.acroformPlugin.xForms.indexOf(c)||l.internal.acroformPlugin.xForms.push(c);o+=" >>\n";}o+=">>\n";}o+=">>\nendobj\n", l.internal.out(o);}e&&b.call(this,l.internal.acroformPlugin.xForms);},b=function(t){for(var e in t){var n=e,r=t[e];l.internal.newObjectDeferredBegin(r&&r.objId);var i="";"object"===(void 0===r?"undefined":vt(r))&&"function"==typeof r.getString&&(i=r.getString()), l.internal.out(i), delete t[n];}},x=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(l=this, T.FieldNum=0, this.internal.acroformPlugin=JSON.parse(JSON.stringify(d)), this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");e=l.internal.scaleFactor, a=l.internal.pageSize.getHeight(), l.internal.acroformPlugin.acroFormDictionaryRoot=new C, l.internal.acroformPlugin.acroFormDictionaryRoot._eventID=l.internal.events.subscribe("postPutResources",y), l.internal.events.subscribe("buildDocument",p), l.internal.events.subscribe("putCatalog",w), l.internal.events.subscribe("postPutPages",v), l.internal.acroformPlugin.isInitialized=!0;}},S=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){e+=t[n].toString(), e+=n<t.length-1?" ":"";}return e+="]"}},k=function(t){return 0!==(t=t||"").indexOf("(")&&(t="("+t), ")"!=t.substring(t.length-1)&&(t+=")"), t},_=function(){var t;Object.defineProperty(this,"objId",{get:function(){return t||(t=l.internal.newObjectDeferred()), t||console.log("Couldn't create Object ID"), t},configurable:!1});};_.prototype.toString=function(){return this.objId+" 0 R"}, _.prototype.getString=function(){var t=this.objId+" 0 obj\n<<";return t+=this.getContent()+">>\n", this.stream&&(t+="stream\n", t+=this.stream, t+="\nendstream\n"), t+="endobj\n"}, _.prototype.getContent=function(){var t="";return t+=function(t){var e="",n=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n){var i=n[r],o=t[i];o&&(Array.isArray(o)?e+="/"+i+" "+S(o)+"\n":e+=o instanceof _?"/"+i+" "+o.objId+" 0 R\n":"/"+i+" "+o+"\n");}return e}(this)};var I=function(){var e;_.call(this), this.Type="/XObject", this.Subtype="/Form", this.FormType=1, this.BBox, this.Matrix, this.Resources="2 0 R", this.PieceInfo, Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==e?e.length:0}}), Object.defineProperty(this,"stream",{enumerable:!1,set:function(t){e=t.trim();},get:function(){return e||null}});};r(I,_);var C=function(){_.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0<t.length?t:void 0}}), Object.defineProperty(this,"Fields",{enumerable:!0,configurable:!0,get:function(){return t}}), this.DA;};r(C,_);var T=function t(){var e;_.call(this), Object.defineProperty(this,"Rect",{enumerable:!0,configurable:!1,get:function(){if(e)return e},set:function(t){e=t;}});var n,r,i,o,a="";Object.defineProperty(this,"FT",{enumerable:!0,set:function(t){a=t;},get:function(){return a}}), Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,set:function(t){n=t;},get:function(){if(!n||n.length<1){if(this instanceof j)return;return"(FieldObject"+t.FieldNum+++")"}return"("==n.substring(0,1)&&n.substring(n.length-1)?n:"("+n+")"}}), Object.defineProperty(this,"DA",{enumerable:!0,get:function(){if(r)return"("+r+")"},set:function(t){r=t;}}), Object.defineProperty(this,"DV",{enumerable:!0,configurable:!0,get:function(){if(i)return i},set:function(t){i=t;}}), Object.defineProperty(this,"V",{enumerable:!0,configurable:!0,get:function(){if(o)return o},set:function(t){o=t;}}), Object.defineProperty(this,"Type",{enumerable:!0,get:function(){return this.hasAnnotation?"/Annot":null}}), Object.defineProperty(this,"Subtype",{enumerable:!0,get:function(){return this.hasAnnotation?"/Widget":null}}), this.BG, Object.defineProperty(this,"hasAnnotation",{enumerable:!1,get:function(){return!!(this.Rect||this.BC||this.BG)}}), Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,
6142configurable:!0,writable:!0}), Object.defineProperty(this,"page",{enumerable:!1,configurable:!0,writable:!0});};r(T,_);var F=function(){T.call(this), this.FT="/Ch", this.Opt=[], this.V="()", this.TI=0;var e=!1;Object.defineProperty(this,"combo",{enumerable:!1,get:function(){return e},set:function(t){e=t;}}), Object.defineProperty(this,"edit",{enumerable:!0,set:function(t){1==t?(this._edit=!0, this.combo=!0):this._edit=!1;},get:function(){return!!this._edit&&this._edit},configurable:!1}), this.hasAppearanceStream=!0;};r(F,T);var P=function(){F.call(this), this.combo=!1;};r(P,F);var E=function(){P.call(this), this.combo=!0;};r(E,P);var q=function(){E.call(this), this.edit=!0;};r(q,E);var O=function(){T.call(this), this.FT="/Btn";};r(O,T);var B=function(){O.call(this);var e=!0;Object.defineProperty(this,"pushbutton",{enumerable:!1,get:function(){return e},set:function(t){e=t;}});};r(B,O);var R=function(){O.call(this);var e=!0;Object.defineProperty(this,"radio",{enumerable:!1,get:function(){return e},set:function(t){e=t;}});var n,t=[];Object.defineProperty(this,"Kids",{enumerable:!0,get:function(){if(0<t.length)return t}}), Object.defineProperty(this,"__Kids",{get:function(){return t}}), Object.defineProperty(this,"noToggleToOff",{enumerable:!1,get:function(){return n},set:function(t){n=t;}});};r(R,O);var j=function(t,e){T.call(this), this.Parent=t, this._AppearanceType=N.RadioButton.Circle, this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(e), this.F=i(this.F,3,1), this.MK=this._AppearanceType.createMK(), this.AS="/Off", this._Name=e;};r(j,T), R.prototype.setAppearance=function(t){if("createAppearanceStream"in t&&"createMK"in t)for(var e in this.__Kids){var n=this.__Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n._Name), n.MK=t.createMK();}else console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");}, R.prototype.createOption=function(t){this.__Kids.length;var e=new j(this,t);return this.__Kids.push(e), n.addField(e), e};var D=function(){O.call(this), this.appearanceStreamContent=N.CheckBox.createAppearanceStream(), this.MK=N.CheckBox.createMK(), this.AS="/On", this.V="/On";};r(D,O);var M=function(){var e,n;T.call(this), this.DA=N.createDefaultAppearanceStream(), this.F=4, Object.defineProperty(this,"V",{get:function(){return e?k(e):e},enumerable:!0,set:function(t){e=t;}}), Object.defineProperty(this,"DV",{get:function(){return n?k(n):n},enumerable:!0,set:function(t){n=t;}});var r=!1;Object.defineProperty(this,"multiline",{enumerable:!1,get:function(){return r},set:function(t){r=t;}});var i=!1;Object.defineProperty(this,"fileSelect",{enumerable:!1,get:function(){return i},set:function(t){i=t;}});var o=!1;Object.defineProperty(this,"doNotSpellCheck",{enumerable:!1,get:function(){return o},set:function(t){o=t;}});var a=!1;Object.defineProperty(this,"doNotScroll",{enumerable:!1,get:function(){return a}
6142,set:function(t){a=t;}});var s=!1;Object.defineProperty(this,"MaxLen",{enumerable:!0,get:function(){return s},set:function(t){s=t;}}), Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,get:function(){return this.V||this.DV}});};r(M,T);var U=function(){M.call(this);var e=!0;Object.defineProperty(this,"password",{enumerable:!1,get:function(){return e},set:function(t){e=t;}});};r(U,M);var N={CheckBox:{createAppearanceStream:function(){return{N:{On:N.CheckBox.YesNormal},D:{On:N.CheckBox.YesPushDown,Off:N.CheckBox.OffPushDown}}},createMK:function(){return"<< /CA (3)>>"},YesPushDown:function(t){var e=h(t),n=[],r=l.internal.getFont("zapfdingbats","normal").id;t.Q=1;var i=c(t,"3","ZapfDingbats",50);return n.push("0.749023 g"), n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), n.push("f"), n.push("BMC"), n.push("q"), n.push("0 0 1 rg"), n.push("/"+r+" "+i.fontSize.toFixed(2)+" Tf 0 g"), n.push("BT"), n.push(i.text), n.push("ET"), n.push("Q"), n.push("EMC"), e.stream=n.join("\n"), e},YesNormal:function(t){var e=h(t),n=l.internal.getFont("zapfdingbats","normal").id,r=[];t.Q=1;var i=N.internal.getHeight(t),o=N.internal.getWidth(t),a=c(t,"3","ZapfDingbats",.9*i);return r.push("1 g"), r.push("0 0 "+o.toFixed(2)+" "+i.toFixed(2)+" re"), r.push("f"), r.push("q"), r.push("0 0 1 rg"), r.push("0 0 "+(o-1).toFixed(2)+" "+(i-1).toFixed(2)+" re"), r.push("W"), r.push("n"), r.push("0 g"), r.push("BT"), r.push("/"+n+" "+a.fontSize.toFixed(2)+" Tf 0 g"), r.push(a.text), r.push("ET"), r.push("Q"), e.stream=r.join("\n"), e},OffPushDown:function(t){var e=h(t),n=[];return n.push("0.749023 g"), n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), n.push("f"), e.stream=n.join("\n"), e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:N.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=N.RadioButton.Circle.YesNormal, e.D[t]=N.RadioButton.Circle.YesPushDown, e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4;r*=.9;var i=N.internal.Bezier_C;return n.push("q"), n.push("1 0 0 1 "+N.internal.getWidth(t)/2+" "+N.internal.getHeight(t)/2+" cm"), n.push(r+" 0 m"), n.push(r+" "+r*i+" "+r*i+" "+r+" 0 "+r+" c"), n.push("-"+r*i+" "+r+" -"+r+" "+r*i+" -"+r+" 0 c"), n.push("-"+r+" -"+r*i+" -"+r*i+" -"+r+" 0 -"+r+" c"), n.push(r*i+" -"+r+" "+r+" -"+r*i+" "+r+" 0 c"), n.push("f"), n.push("Q"), e.stream=n.join("\n"), e},YesPushDown:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4,i=2*(r*=.9),o=i*N.internal.Bezier_C,a=r*N.internal.Bezier_C;return n.push("0.749023 g"), n.push("q"), n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"), n.push(i+" 0 m"), n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"), n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"), n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"), n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"), n.push("f"), n.push("Q"), n.push("0 g"), n.push("q"), n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"), n.push(r+" 0 m"), n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"), n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"), n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"), n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"), n.push("f"), n.push("Q"), e.stream=n.join("\n"), e},OffPushDown:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4,i=2*(r*=.9),o=i*N.internal.Bezier_C;return n.push("0.749023 g"), n.push("q"), n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"), n.push(i+" 0 m"), n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"), n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"), n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"), n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"), n.push("f"), n.push("Q"), e.stream=n.join("\n"), e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:N.RadioButton.Cross.OffPushDown},N:{}}
6142;return e.N[t]=N.RadioButton.Cross.YesNormal, e.D[t]=N.RadioButton.Cross.YesPushDown, e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=h(t),n=[],r=N.internal.calculateCross(t);return n.push("q"), n.push("1 1 "+(N.internal.getWidth(t)-2).toFixed(2)+" "+(N.internal.getHeight(t)-2).toFixed(2)+" re"), n.push("W"), n.push("n"), n.push(r.x1.x.toFixed(2)+" "+r.x1.y.toFixed(2)+" m"), n.push(r.x2.x.toFixed(2)+" "+r.x2.y.toFixed(2)+" l"), n.push(r.x4.x.toFixed(2)+" "+r.x4.y.toFixed(2)+" m"), n.push(r.x3.x.toFixed(2)+" "+r.x3.y.toFixed(2)+" l"), n.push("s"), n.push("Q"), e.stream=n.join("\n"), e},YesPushDown:function(t){var e=h(t),n=N.internal.calculateCross(t),r=[];return r.push("0.749023 g"), r.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), r.push("f"), r.push("q"), r.push("1 1 "+(N.internal.getWidth(t)-2).toFixed(2)+" "+(N.internal.getHeight(t)-2).toFixed(2)+" re"), r.push("W"), r.push("n"), r.push(n.x1.x.toFixed(2)+" "+n.x1.y.toFixed(2)+" m"), r.push(n.x2.x.toFixed(2)+" "+n.x2.y.toFixed(2)+" l"), r.push(n.x4.x.toFixed(2)+" "+n.x4.y.toFixed(2)+" m"), r.push(n.x3.x.toFixed(2)+" "+n.x3.y.toFixed(2)+" l"), r.push("s"), r.push("Q"), e.stream=r.join("\n"), e},OffPushDown:function(t){var e=h(t),n=[];return n.push("0.749023 g"), n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), n.push("f"), e.stream=n.join("\n"), e}}},createDefaultAppearanceStream:function(t){return"/F1 0 Tf 0 g"}};N.internal={Bezier_C:.551915024494,calculateCross:function(t){var e,n,r=N.internal.getWidth(t),i=N.internal.getHeight(t),o=(n=i)<(e=r)?n:e;return{x1:{x:(r-o)/2,y:(i-o)/2+o},x2:{x:(r-o)/2+o,y:(i-o)/2},x3:{x:(r-o)/2,y:(i-o)/2},x4:{x:(r-o)/2+o,y:(i-o)/2+o}}}}, N.internal.getWidth=function(t){var e=0;return"object"===(void 0===t?"undefined":vt(t))&&(e=s(t.Rect[2])), e}, N.internal.getHeight=function(t){var e=0;return"object"===(void 0===t?"undefined":vt(t))&&(e=s(t.Rect[3])), e}, n.addField=function(t){return x.call(this), t instanceof M?this.addTextField.call(this,t):t instanceof F?this.addChoiceField.call(this,t):t instanceof O?this.addButton.call(this,t):t instanceof j?g.call(this,t):t&&g.call(this,t), t.page=l.internal.getCurrentPageInfo().pageNumber, this}, n.addButton=function(t){x.call(this);var e=t||new T;e.FT="/Btn", e.Ff=o(e.Ff,t,l.internal.getPDFVersion()), g.call(this,e);}, n.addTextField=function(t){x.call(this);var e=t||new T;e.FT="/Tx", e.Ff=o(e.Ff,t,l.internal.getPDFVersion()), g.call(this,e);}, n.addChoiceField=function(t){x.call(this);var e=t||new T;e.FT="/Ch", e.Ff=o(e.Ff,t,l.internal.getPDFVersion()), g.call(this,e);}, "object"==(void 0===t?"undefined":vt(t))&&(t.ChoiceField=F, t.ListBox=P, t.ComboBox=E, t.EditBox=q, t.Button=O, t.PushButton=B, t.RadioButton=R, t.CheckBox=D, t.TextField=M, t.PasswordField=U, t.AcroForm={Appearance:N}), n.AcroFormChoiceField=F, n.AcroFormListBox=P, n.AcroFormComboBox=E, n.AcroFormEditBox=q, n.AcroFormButton=O, n.AcroFormPushButton=B, n.AcroFormRadioButton=R, n.AcroFormCheckBox=D, n.AcroFormTextField=M, n.AcroFormPasswordField=U, n.AcroForm={ChoiceField:F,ListBox:P,ComboBox:E,EditBox:q,Button:O,PushButton:B,RadioButton:R,CheckBox:D,TextField:M,PasswordField:U};}($.API,"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal), $.API.addHTML=function(t,p,g,s,m){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof p&&(s=p, m=g), "function"==typeof s&&(m=s, s=null), "function"!=typeof m&&(m=function(){});var e=this.internal,w=e.scaleFactor,y=e.pageSize.getWidth(),v=e.pageSize.getHeight();if((s=s||{}).onrendered=function(h){p=parseInt(p)||0, g=parseInt(g)||0;var t=s.dim||{},c=Object.assign({top:0,right:0,bottom:0,left:0,useFor:"content"},s.margin),e=t.h||Math.min(v,h.height/w),l=t.w||Math.min(y,h.width/w)-p,u=s.format||"JPEG",f=s.imageCompression||"SLOW";if(h.height>v-c.top-c.bottom&&s.pagesplit){var d=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i, o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1, a.webkitImageSmoothingEnabled=!1, a.msImageSmoothingEnabled=!1, a.imageSmoothingEnabled=!1, a.fillStyle=s.backgroundColor||"#ffffff", a.fillRect(0,0,r,i), a.drawImage(t,e,n,r,i,0,0,r,i), o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;
6142if(r=0, i.top=0!==n?c.top:g, i.left=0!==n?c.left:p, o=(y-c.left-c.right)*w<h.width, "content"===c.useFor?0===n?(t=Math.min((y-c.left)*w,h.width), e=Math.min((v-c.top)*w,h.height-n)):(t=Math.min(y*w,h.width), e=Math.min(v*w,h.height-n), i.top=0):(t=Math.min((y-c.left-c.right)*w,h.width), e=Math.min((v-c.bottom-c.top)*w,h.height-n)), o)for(;;){"content"===c.useFor&&(0===r?t=Math.min((y-c.left)*w,h.width):(t=Math.min(y*w,h.width-r), i.left=0));var s=[a=d(h,r,n,t,e),i.left,i.top,a.width/w,a.height/w,u,null,f];if(this.addImage.apply(this,s), (r+=t)>=h.width)break;this.addPage();}else s=[a=d(h,0,n,t,e),i.left,i.top,a.width/w,a.height/w,u,null,f], this.addImage.apply(this,s);if((n+=e)>=h.height)break;this.addPage();}m(l,n,null,s);}.bind(this);if("CANVAS"===h.nodeName){var r=new Image;r.onload=n, r.src=h.toDataURL("image/png"), h=r;}else n();}else{var i=Math.random().toString(35),o=[h,p,g,l,e,u,i,f];this.addImage.apply(this,o), m(l,e,i,o);}}.bind(this), "undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"!=typeof rasterizeHTML){var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"), s.width=s.width||y*w, rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image);},function(t){m(null,t);})}return null}, function(b){var x="addImage_",h={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]};b.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in h)for(i=h[a], n=0;n<i.length;n+=1){for(o=!0, r=0;r<i[n].length;r+=1)if(void 0!==i[n][r]&&i[n][r]!==t.charCodeAt(r)){o=!1;break}if(!0===o){s=a;break}}return"UNKOWN"===s&&"UNKNOWN"!==e&&(console.warn('FileType of Image not recognized. Processing image as "'+e+'".'), s=e), s};var n=function t(e){var n=this.internal.newObject(),r=this.internal.write,i=this.internal.putStream;if(e.n=n, r("<</Type /XObject"), r("/Subtype /Image"), r("/Width "+e.w), r("/Height "+e.h), e.cs===this.color_spaces.INDEXED?r("/ColorSpace [/Indexed /DeviceRGB "+(e.pal.length/3-1)+" "+("smask"in e?n+2:n+1)+" 0 R]"):(r("/ColorSpace /"+e.cs), e.cs===this.color_spaces.DEVICE_CMYK&&r("/Decode [1 0 1 0 1 0 1 0]")), r("/BitsPerComponent "+e.bpc), "f"in e&&r("/Filter /"+e.f), "dp"in e&&r("/DecodeParms <<"+e.dp+">>"), "trns"in e&&e.trns.constructor==Array){for(var o="",a=0,s=e.trns.length;a<s;a++)o+=e.trns[a]+" "+e.trns[a]+" ";r("/Mask ["+o+"]");}if("smask"in e&&r("/SMask "+(n+1)+" 0 R"), r("/Length "+e.data.length+">>"), i(e.data), r("endobj"), "smask"in e){var h="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,c={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:h,data:e.smask};"f"in e&&(c.f=e.f), t.call(this,c);}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(), r("<< /Length "+e.pal.length+">>"), i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))), r("endobj"));},S=function(){var t=this.internal.collections[x+"images"];for(var e in t)n.call(this,t[e]);},k=function(){var t,e=this.internal.collections[x+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R");},_=function(t){return"function"==typeof b["process"+t.toUpperCase()]},A=function(t){return"object"===(void 0===t?"undefined":vt(t))&&1===t.nodeType},I=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return n;!e&&/\.png(?:[?#].*)?$/i.test(n)&&(e="png");}if("CANVAS"===t.nodeName)var r=t;else{(r=document.createElement("canvas")).width=t.clientWidth||t.width, r.height=t.clientHeight||t.height;var i=r.getContext("2d");if(!i)throw"addImage requires canvas to be supported by browser.";i.drawImage(t,0,0,r.width,r.height);}return r.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},C=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};b.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"}, b.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"}, b.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"}, b.sHashCode=function(t){return t=t||"", Array.prototype.reduce&&t.split("").reduce(function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t},0)}, b.isString=function(t){return"string"==typeof t}
6142, b.validateStringAsBase64=function(t){var e=!0;return(t=t||"").length%4!=0&&(e=!1), !1===/[A-Za-z0-9\/]+/.test(t.substr(0,t.length-2))&&(e=!1), !1===/[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==/.test(t.substr(-2))&&(e=!1), e}, b.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+)$/g.exec(t)}, b.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array}, b.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer}, b.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))}, b.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n}, b.arrayBufferToBinaryString=function(t){if("function"==typeof atob)return atob(this.arrayBufferToBase64(t));if("function"==typeof TextDecoder){var e=new TextDecoder("ascii");if("ascii"===e.encoding)return e.decode(t)}for(var n=this.isArrayBuffer(t)?t:new Uint8Array(t),r=20480,i="",o=Math.ceil(n.byteLength/r),a=0;a<o;a++)i+=String.fromCharCode.apply(null,n.slice(a*r,a*r+r));return i}, b.arrayBufferToBase64=function(t){for(var e,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(t),o=i.byteLength,a=o%3,s=o-a,h=0;h<s;h+=3)n+=r[(16515072&(e=i[h]<<16|i[h+1]<<8|i[h+2]))>>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="), n}, b.createImageInfo=function(t,e,n,r,i,o,a,s,h,c,l,u,f){var d={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(d.f=o), h&&(d.dp=h), c&&(d.trns=c), l&&(d.pal=l), u&&(d.smask=u), f&&(d.p=f), d}, b.addImage=function(t,e,n,r,i,o,a,s,h){var c="";if("string"!=typeof e){var l=o;o=i, i=r, r=n, n=e, e=l;}if("object"===(void 0===t?"undefined":vt(t))&&!A(t)&&"imageData"in t){var u=t;t=u.imageData, e=u.format||e, n=u.x||n||0, r=u.y||r||0, i=u.w||i, o=u.h||o, a=u.alias||a, s=u.compression||s, h=u.rotation||u.angle||h;}if(isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments), new Error("Invalid coordinates passed to jsPDF.addImage");var f,d,p,g,m,w,y,v=function(){var t=this.internal.collections[x+"images"];return t||(this.internal.collections[x+"images"]=t={}, this.internal.events.subscribe("putResources",S), this.internal.events.subscribe("putXobjectDict",k)), t}.call(this);if(!(f=C(t,v))&&(A(t)&&(t=I(t,e)), (null==(y=a)||0===y.length)&&(a="string"==typeof(w=t)&&b.sHashCode(w)), !(f=C(a,v)))){if(this.isString(t)&&(""!==(c=this.convertStringToImageData(t))?t=c:void 0!==(c=this.loadImageFile(t))&&(t=c)), e=this.getImageFileTypeByImageData(t,e), !_(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t, t=this.binaryStringToUint8Array(t))), !(f=this["process"+e.toUpperCase()](t,(m=0, (g=v)&&(m=Object.keys?Object.keys(g).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(g)), m),a,((p=s)&&"string"==typeof p&&(p=p.toUpperCase()), p in b.image_compression?p:b.image_compression.NONE),d)))throw new Error("An unkwown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var h=function(t,e,n){return t||e||(e=t=-96), t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor), e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor), 0===t&&(t=e*n.w/n.h), 0===e&&(e=t*n.h/n.w), [t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;if(n=h[0], r=h[1], a[o]=i, s){s*=Math.PI/180;var u=Math.cos(s),f=Math.sin(s),d=function(t){return t.toFixed(4)},p=[d(u),d(f),d(-1*f),d(u),0,0,"cm"];}this.internal.write("q"), s?(this.internal.write([1,"0","0",1,c(t),l(e+r),"cm"].join(" ")), this.internal.write(p.join(" ")), this.internal.write([c(n),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(n),"0","0",c(r),c(t),l(e+r),"cm"].join(" ")), this.internal.write("/I"+i.i+" Do"), this.internal.write("Q");}.call(this,n,r,i,o,f,f.i,v,h), this}, b.convertStringToImageData=function(t){var e,n="";this.isString(t)&&(null!==(e=this.extractInfoFromBase64DataURI(t))?b.validateStringAs
6142Base64(e[3])&&(n=atob(e[3])):b.validateStringAsBase64(t)&&(n=atob(t)));return n};var c=function(t,e){return t.subarray(e,e+5)};b.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r<i;){if(r+=n, 255!==t.charCodeAt(r))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(r+1)||193===t.charCodeAt(r+1)||194===t.charCodeAt(r+1)||195===t.charCodeAt(r+1)||196===t.charCodeAt(r+1)||197===t.charCodeAt(r+1)||198===t.charCodeAt(r+1)||199===t.charCodeAt(r+1))return e=256*t.charCodeAt(r+5)+t.charCodeAt(r+6), [256*t.charCodeAt(r+7)+t.charCodeAt(r+8),e,t.charCodeAt(r+9)];r+=2, n=256*t.charCodeAt(r)+t.charCodeAt(r+1);}}(t)), this.isArrayBuffer(t)&&(t=new Uint8Array(t)), this.isArrayBufferView(t)&&(a=function(t){if(65496!=(t[0]<<8|t[1]))throw new Error("Supplied data is not a JPEG");for(var e,n=t.length,r=(t[4]<<8)+t[5],i=4;i<n;){if(r=((e=c(t,i+=r))[2]<<8)+e[3], (192===e[1]||194===e[1])&&255===e[0]&&7<r)return{width:((e=c(t,i+5))[2]<<8)+e[3],height:(e[0]<<8)+e[1],numcomponents:e[4]};i+=2;}throw new Error("getJpegSizeFromBytes could not find the size of the image")}(t), t=i||this.arrayBufferToBinaryString(t)), void 0===o)switch(a.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;default:case 3:o=this.color_spaces.DEVICE_RGB;}return this.createImageInfo(t,a.width,a.height,o,8,s,e,n)}, b.processJPG=function(){return this.processJPEG.apply(this,arguments)}, b.loadImageFile=function(t,e,n){e=e||!0, n=n||function(){};Object.prototype.toString.call("undefined"!=typeof process?process:0);if(void 0!==("undefined"==typeof window?"undefined":vt(window))&&"object"===("undefined"==typeof location?"undefined":vt(location))&&"http"===location.protocol.substr(0,4))return function(t,e,n){var r=new XMLHttpRequest,i=[],o=0,a=function(t){var e=t.length,n=String.fromCharCode;for(o=0;o<e;o+=1)i.push(n(255&t.charCodeAt(o)));return i.join("")};if(r.open("GET",t,!e), r.overrideMimeType("text/plain; charset=x-user-defined"), !1===e&&(r.onload=function(){return a(this.responseText)}), r.send(null), 200===r.status)return e?a(r.responseText):void 0;console.warn('Unable to load file "'+t+'"');}(t,e)}, b.getImageProperties=function(t){var e,n,r="";if(A(t)&&(t=I(t)), this.isString(t)&&(""!==(r=this.convertStringToImageData(t))?t=r:void 0!==(r=this.loadImageFile(t))&&(t=r)), n=this.getImageFileTypeByImageData(t), !_(n))throw new Error("addImage does not support files of type '"+n+"', please ensure that a plugin for '"+n+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(t=this.binaryStringToUint8Array(t))), !(e=this["process"+n.toUpperCase()](t)))throw new Error("An unkwown error occurred whilst processing the image");return{fileType:n,width:e.w,height:e.h,colorSpace:e.cs,compressionMode:e.f,bitsPerComponent:e.bpc}};}($.API), t=$.API, y={annotations:[],f2:function(t){return t.toFixed(2)},notEmpty:function(t){if(void 0!==t&&""!=t)return!0}}, $.API.annotationPlugin=y, $.API.events.push(["addPage",function(t){this.annotationPlugin.annotations[t.pageNumber]=[];}]), t.events.push(["putPage",function(t){for(var e=this.annotationPlugin.annotations[t.pageNumber],n=!1,r=0;r<e.length&&!n;r++)switch((h=e[r]).type){case"link":if(y.notEmpty(h.options.url)||y.notEmpty(h.options.pageNumber)){n=!0;break}case"reference":case"text":case"freetext":n=!0;}if(0!=n){this.internal.write("/Annots [");var i=this.annotationPlugin.f2,o=this.internal.scaleFactor,a=this.internal.pageSize.getHeight(),s=this.internal.getPageInfo(t.pageNumber);for(r=0;r<e.length;r++){var h;
6142switch((h=e[r]).type){case"reference":this.internal.write(" "+h.object.objId+" 0 R ");break;case"text":var c=this.internal.newAdditionalObject(),l=this.internal.newAdditionalObject(),u=h.title||"Note";m="<</Type /Annot /Subtype /Text "+(d="/Rect ["+i(h.bounds.x*o)+" "+i(a-(h.bounds.y+h.bounds.h)*o)+" "+i((h.bounds.x+h.bounds.w)*o)+" "+i((a-h.bounds.y)*o)+"] ")+"/Contents ("+h.contents+")", m+=" /Popup "+l.objId+" 0 R", m+=" /P "+s.objId+" 0 R", m+=" /T ("+u+") >>", c.content=m;var f=c.objId+" 0 R";m="<</Type /Annot /Subtype /Popup "+(d="/Rect ["+i((h.bounds.x+30)*o)+" "+i(a-(h.bounds.y+h.bounds.h)*o)+" "+i((h.bounds.x+h.bounds.w+30)*o)+" "+i((a-h.bounds.y)*o)+"] ")+" /Parent "+f, h.open&&(m+=" /Open true"), m+=" >>", l.content=m, this.internal.write(c.objId,"0 R",l.objId,"0 R");break;case"freetext":var d="/Rect ["+i(h.bounds.x*o)+" "+i((a-h.bounds.y)*o)+" "+i(h.bounds.x+h.bounds.w*o)+" "+i(a-(h.bounds.y+h.bounds.h)*o)+"] ",p=h.color||"#000000";m="<</Type /Annot /Subtype /FreeText "+d+"/Contents ("+h.contents+")", m+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+p+")", m+=" /Border [0 0 0]", m+=" >>", this.internal.write(m);break;case"link":if(h.options.name){var g=this.annotations._nameMap[h.options.name];h.options.pageNumber=g.page, h.options.top=g.y;}else h.options.top||(h.options.top=0);d="/Rect ["+i(h.x*o)+" "+i((a-h.y)*o)+" "+i((h.x+h.w)*o)+" "+i((a-(h.y+h.h))*o)+"] ";var m="";if(h.options.url)m="<</Type /Annot /Subtype /Link "+d+"/Border [0 0 0] /A <</S /URI /URI ("+h.options.url+") >>";else if(h.options.pageNumber)switch(m="<</Type /Annot /Subtype /Link "+d+"/Border [0 0 0] /Dest ["+(t=this.internal.getPageInfo(h.options.pageNumber)).objId+" 0 R", h.options.magFactor=h.options.magFactor||"XYZ", h.options.magFactor){case"Fit":m+=" /Fit]";break;case"FitH":m+=" /FitH "+h.options.top+"]";break;case"FitV":h.options.left=h.options.left||0, m+=" /FitV "+h.options.left+"]";break;case"XYZ":default:var w=i((a-h.options.top)*o);h.options.left=h.options.left||0, void 0===h.options.zoom&&(h.options.zoom=0), m+=" /XYZ "+h.options.left+" "+w+" "+h.options.zoom+"]";}""!=m&&(m+=" >>", this.internal.write(m));}}this.internal.write("]");}}]), t.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t);}}, t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"});}, t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n), n+=.2*o, this.link(e,n-o,i,o,r), i}, t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}, t.getLineHeight=function(){return this.internal.getLineHeight()}, function(t){var a=Object.keys({ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",fa:"Persian","fa-IR":"Persian/Iran",ur:"Urdu"}),u={1569:[65152],1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1572:[65157,65158],1573:[65159,65160,65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166,65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,65193],1584:[65195,65196,65195],1585:[65197,65198,65197],1586:[65199,65200,65199],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,65261],1609:[65263,65264,64488,64489],1610:[65265,652
614266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395,64394],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},f={1570:[65269,65270,65269,65270],1571:[65271,65272,65271,65272],1573:[65273,65274,65273,65274],1575:[65275,65276,65275,65276]},d={1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1573:[65159,65160,65159,65160],1575:[65165,65166,65165,65166]},p={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},e=[1570,1571,1573,1575],n=[1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688],o=0,s=1,h=2,c=3;function g(t){return void 0!==t&&void 0!==u[t.charCodeAt(0)]}function l(t){return void 0!==t&&0<=n.indexOf(t.charCodeAt(0))}function m(t){return void 0!==t&&0<=e.indexOf(t.charCodeAt(0))}function w(t){return g(t)&&2<=u[t.charCodeAt(0)].length}function y(t,e,n,r){return g(t)?(r=r||{}, u=Object.assign(u,r), !w(t)||!g(e)&&!g(n)||!g(n)&&l(e)||l(t)&&!g(e)||l(t)&&m(e)||l(t)&&l(e)?(u=Object.assign(u,d), o):g(i=t)&&4==u[i.charCodeAt(0)].length&&g(e)&&!l(e)&&g(n)&&w(n)?(u=Object.assign(u,d), c):l(t)||!g(n)?(u=Object.assign(u,d), s):(u=Object.assign(u,d), h)):-1;var i;}var v=t.processArabic=function(t,e){t=t||"", e=e||!1;var n,r,i,o="",a=0,s=0,h="",c="",l="";for(a=0;a<t.length;a+=1)h=t[a], c=t[a-1], l=t[a+1], g(h)?void 0!==c&&1604===c.charCodeAt(0)&&m(h)?(s=y(h,t[a-2],t[a+1],f), n=String.fromCharCode(f[h.charCodeAt(0)][s]), o=o.substr(0,o.length-1)+n):void 0!==c&&1617===c.charCodeAt(0)&&(void 0!==(r=h)&&void 0!==p[r.charCodeAt(0)])?(s=y(h,t[a-2],t[a+1],d), n=String.fromCharCode(p[h.charCodeAt(0)][s]), o=o.substr(0,o.length-1)+n):(s=y(h,c,l,d), o+=String.fromCharCode(u[h.charCodeAt(0)][s])):o+=e?{"(":")",")":"("}[i=h]||i:h;return e?o.split("").reverse().join(""):o};t.events.push(["preProcessText",function(t){var e=t.text,n=(t.x, t.y, t.options||{}),r=(t.mutex, n.lang),i=[];if(0<=a.indexOf(r)){if("[object Array]"===Object.prototype.toString.call(e)){var o=0;for(i=[], o=0;o<e.length;o+=1)"[object Array]"===Object.prototype.toString.call(e[o])?i.push([v(e[o][0],!0),e[o][1],e[o][2]]):i.push([v(e[o],!0)]);t.text=i;}else t.text=v(e,!0);void 0===n.charSpace&&(t.options.charSpace=0), !0===n.R2L&&(t.options.R2L=!1);}}]);}($.API), $.API.autoPrint=function(t){var e;switch((t=t||{}).variant=t.variant||"non-conform", t.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");}), this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R");});}return this}, (
6143/**
6144   * jsPDF Canvas PlugIn
6145   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  [email protected]
6146   *
6147   * Licensed under the MIT License.
6148   * http://opensource.org/licenses/mit-license
6149   */
6150e=$.API).events.push(["initialized",function(){this.canvas.pdf=this;}]), e.canvas={getContext:function(t){return(this.pdf.context2d._canvas=this).pdf.context2d},childNodes:[]}, Object.defineProperty(e.canvas,"width",{get:function(){return this._width}
6150,set:function(t){this._width=t, this.getContext("2d").pageWrapX=t+1;}}), Object.defineProperty(e.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t, this.getContext("2d").pageWrapY=t+1;}}), I=$.API, C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0}, T=1, d=function(t,e,n,r,i){C={x:t,y:e,w:n,h:r,ln:i};}, p=function(){return C}, F={left:0,top:0,bottom:0}, I.setHeaderFunction=function(t){h=t;}, I.getTextDimensions=function(e){i=this.internal.getFont().fontName, o=this.table_font_size||this.internal.getFontSize(), a=this.internal.getFont().fontStyle;var t,n,r=19.049976/25.4;(n=document.createElement("font")).id="jsPDFCell";try{n.style.fontStyle=a;}catch(t){n.style.fontWeight=a;}n.style.fontSize=o+"pt", n.style.fontFamily=i;try{n.textContent=e;}catch(t){n.innerText=e;}return document.body.appendChild(n), t={w:(n.offsetWidth+1)*r,h:(n.offsetHeight+1)*r}, document.body.removeChild(n), t}, I.cellAddPage=function(){var t=this.margins||F;this.addPage(), d(t.left,t.top,void 0,void 0), T+=1;}, I.cellInitialize=function(){C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0}, T=1;}, I.cell=function(t,e,n,r,i,o,a){var s=p(),h=!1;if(void 0!==s.ln)if(s.ln===o)t=s.x+s.w, e=s.y;else{var c=this.margins||F;s.y+s.h+r+13>=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(), h=!0, this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)), e=p().y+p().h, h&&(e=23);}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r), "right"===a){i instanceof Array||(i=[i]);for(var l=0;l<i.length;l++){var u=i[l],f=this.getStringUnitWidth(u)*this.internal.getFontSize();this.text(u,t+n-f-3,e+this.internal.getLineHeight()*(l+1));}}else this.text(i,t+3,e+this.internal.getLineHeight());return d(t,e,n,r,o), this}, I.arrayMax=function(t,e){var n,r,i,o=t[0];for(n=0, r=t.length;n<r;n+=1)i=t[n], e?-1===e(o,i)&&(o=i):o<i&&(o=i);return o}, I.table=function(t,e,n,r,i){if(!n)throw"No data for PDF table";var o,a,s,h,c,l,u,f,d,p,g=[],m=[],w={},y={},v=[],b=[],x=!1,S=!0,k=12,_=F;if(_.width=this.internal.pageSize.getWidth(), i&&(!0===i.autoSize&&(x=!0), !1===i.printHeaders&&(S=!1), i.fontSize&&(k=i.fontSize), i.css&&void 0!==i.css["font-size"]&&(k=16*i.css["font-size"]), i.margins&&(_=i.margins)), this.lnMod=0, C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0}, T=1, this.printHeaders=S, this.margins=_, this.setFontSize(k), this.table_font_size=k, null==r)g=Object.keys(n[0]);else if(r[0]&&"string"!=typeof r[0])for(a=0, s=r.length;a<s;a+=1)o=r[a], g.push(o.name), m.push(o.prompt), y[o.name]=o.width*(19.049976/25.4);else g=r;if(x)for(p=function(t){return t[o]}, a=0, s=g.length;a<s;a+=1){for(w[o=g[a]]=n.map(p), v.push(this.getTextDimensions(m[a]||o).w), u=0, h=(l=w[o]).length;u<h;u+=1)c=l[u], v.push(this.getTextDimensions(c).w);y[o]=I.arrayMax(v), v=[];}if(S){var A=this.calculateLineHeight(g,y,m.length?m:g);for(a=0, s=g.length;a<s;a+=1)o=g[a], b.push([t,e,y[o],A,String(m.length?m[a]:o)]);this.setTableHeaderRow(b), this.printHeaderRow(1,!1);}for(a=0, s=n.length;a<s;a+=1)for(f=n[a], A=this.calculateLineHeight(g,y,f), u=0, d=g.length;u<d;u+=1)o=g[u], this.cell(t,e,y[o],A,f[o],a+2,o.align);return this.lastCellPos=C, this.table_x=t, this.table_y=e, this}, I.calculateLineHeight=function(t,e,n){for(var r,i=0,o=0;o<t.length;o++){n[r=t[o]]=this.splitTextToSize(String(n[r]),e[r]-3);var a=this.internal.getLineHeight()*n[r].length+3;i<a&&(i=a);}return i}, I.setTableHeaderRow=function(t){this.tableHeaderRow=t;}, I.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,i,o;if(this.printingHeaderRow=!0, void 0!==h){var a=h(this,T);d(a[0],a[1],a[2],a[3],-1);}this.setFontStyle("bold");var s=[];for(i=0, o=this.tableHeaderRow.length;i<o;i+=1)this.setFillColor(200,200,200), n=this.tableHeaderRow[i], e&&(this.margins.top=13, n[1]=this.margins&&this.margins.top||0, s.push(n)), r=[].concat(n), this.cell.apply(this,r.concat(t));0<s.length&&this.setTableHeaderRow(s), this.setFontStyle("normal"), this.printingHeaderRow=!1;}, function(t){t.events.push(["initialized",function(){((this.context2d.pdf=this).context2d.internal.pdf=this).context2d.ctx=new e, this.context2d.ctxStack=[], this.context2d.path=[];}]), t.context2d={pageWrapXEnabled:!1,pageWrapYEnabled:!1,pageWrapX:9999999,pageWrapY:9999999,ctx:new e,f2:function(t){return t.toFixed(2)}
6150,fillRect:function(t,e,n,r){if(!this._isFillTransparent()){t=this._wrapX(t), e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"f");}},strokeRect:function(t,e,n,r){if(!this._isStrokeTransparent()){t=this._wrapX(t), e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"s");}},clearRect:function(t,e,n,r){if(!this.ctx.ignoreClearRect){t=this._wrapX(t), e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.save(), this.setFillStyle("#ffffff"), this.pdf.rect(i.x,i.y,i.w,i.h,"f"), this.restore();}},save:function(){this.ctx._fontSize=this.pdf.internal.getFontSize();var t=new e;t.copy(this.ctx), this.ctxStack.push(this.ctx), this.ctx=t;},restore:function(){this.ctx=this.ctxStack.pop(), this.setFillStyle(this.ctx.fillStyle), this.setStrokeStyle(this.ctx.strokeStyle), this.setFont(this.ctx.font), this.pdf.setFontSize(this.ctx._fontSize), this.setLineCap(this.ctx.lineCap), this.setLineWidth(this.ctx.lineWidth), this.setLineJoin(this.ctx.lineJoin);},rect:function(t,e,n,r){this.moveTo(t,e), this.lineTo(t+n,e), this.lineTo(t+n,e+r), this.lineTo(t,e+r), this.lineTo(t,e), this.closePath();},beginPath:function(){this.path=[];},closePath:function(){this.path.push({type:"close"});},_getRGBA:function(t){var e,n,r,i,o=new RGBColor(t);if(!t)return{r:0,g:0,b:0,a:0,style:t};if(this.internal.rxTransparent.test(t))i=r=n=e=0;else{var a=this.internal.rxRgb.exec(t);null!=a?(e=parseInt(a[1]), n=parseInt(a[2]), r=parseInt(a[3]), i=1):null!=(a=this.internal.rxRgba.exec(t))?(e=parseInt(a[1]), n=parseInt(a[2]), r=parseInt(a[3]), i=parseFloat(a[4])):(i=1, "#"!=t.charAt(0)&&(t=o.ok?o.toHex():"#000000"), 4===t.length?(e=t.substring(1,2), e+=e, n=t.substring(2,3), n+=n, r=t.substring(3,4), r+=r):(e=t.substring(1,3), n=t.substring(3,5), r=t.substring(5,7)), e=parseInt(e,16), n=parseInt(n,16), r=parseInt(r,16));}return{r:e,g:n,b:r,a:i,style:t}},setFillStyle:function(t){var e=this._getRGBA(t);this.ctx.fillStyle=t, this.ctx._isFillTransparent=0===e.a, this.ctx._fillOpacity=e.a, this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}), this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a});},setStrokeStyle:function(t){var e=this._getRGBA(t);this.ctx.strokeStyle=e.style, this.ctx._isStrokeTransparent=0===e.a, this.ctx._strokeOpacity=e.a, 0===e.a?this.pdf.setDrawColor(255,255,255):(e.a, this.pdf.setDrawColor(e.r,e.g,e.b));},fillText:function(t,e,n,r){if(!this._isFillTransparent()){e=this._wrapX(e), n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0], n=i[1];var o=57.2958*this._matrix_rotation(this.ctx._transform);if(0<this.ctx._clip_path.length){var a;(a=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var s=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._fill(null,!0), this.ctx._clip_path=this.path, this.path=s;}var h=1;try{h=this._matrix_decompose(this._getTransform()).scale[0];}catch(t){console.warn(t);}if(h<.01)this.pdf.text(t,e,this._getBaseline(n),null,o);else{var c=this.pdf.internal.getFontSize();this.pdf.setFontSize(c*h), this.pdf.text(t,e,this._getBaseline(n),null,o), this.pdf.setFontSize(c);}0<this.ctx._clip_path.length&&a.push("Q");}}
6150,strokeText:function(t,e,n,r){if(!this._isStrokeTransparent()){e=this._wrapX(e), n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0], n=i[1];var o=57.2958*this._matrix_rotation(this.ctx._transform);if(0<this.ctx._clip_path.length){var a;(a=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var s=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._fill(null,!0), this.ctx._clip_path=this.path, this.path=s;}var h=1;try{h=this._matrix_decompose(this._getTransform()).scale[0];}catch(t){console.warn(t);}if(1===h)this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},o);else{var c=this.pdf.internal.getFontSize();this.pdf.setFontSize(c*h), this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},o), this.pdf.setFontSize(c);}0<this.ctx._clip_path.length&&a.push("Q");}},setFont:function(t){if(this.ctx.font=t, null!=(c=/\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+(.*)?/.exec(t))){var e=c[1],n=(c[2], c[3]),r=c[4],i=c[5],o=c[6];r="px"===i?Math.floor(parseFloat(r)):"em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(r)), this.pdf.setFontSize(r), "bold"===n||"700"===n?this.pdf.setFontStyle("bold"):"italic"===e?this.pdf.setFontStyle("italic"):this.pdf.setFontStyle("normal"), l="bold"===n||"700"===n?"italic"===e?"bolditalic":"bold":"italic"===e?"italic":"normal";for(var a=o.toLowerCase().split(/\s*,\s*/),s="Times",h=0;h<a.length;h++){if(void 0!==this.pdf.internal.getFont(a[h],l,{noFallback:!0,disableWarning:!0})){s=a[h];break}if("bolditalic"===l&&void 0!==this.pdf.internal.getFont(a[h],"bold",{noFallback:!0,disableWarning:!0}))s=a[h], l="bold";else if(void 0!==this.pdf.internal.getFont(a[h],"normal",{noFallback:!0,disableWarning:!0})){s=a[h], l="normal";break}}this.pdf.setFont(s,l);}else{var c=/\s*(\d+)(pt|px|em)\s+([\w "]+)\s*([\w "]+)?/.exec(t);if(null!=c){var l,u=c[1],f=(c[2], c[3]);(l=c[4])||(l="normal"), u="em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(u)), this.pdf.setFontSize(u), this.pdf.setFont(f,l);}}},setTextBaseline:function(t){this.ctx.textBaseline=t;},getTextBaseline:function(){return this.ctx.textBaseline},setTextAlign:function(t){this.ctx.textAlign=t;},getTextAlign:function(){return this.ctx.textAlign},setLineWidth:function(t){this.ctx.lineWidth=t, this.pdf.setLineWidth(t);},setLineCap:function(t){this.ctx.lineCap=t, this.pdf.setLineCap(t);},setLineJoin:function(t){this.ctx.lineJoin=t, this.pdf.setLineJoin(t);},moveTo:function(t,e){t=this._wrapX(t), e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"mt",x:t=n[0],y:e=n[1]};this.path.push(r);},_wrapX:function(t){return this.pageWrapXEnabled?t%this.pageWrapX:t},_wrapY:function(t){return this.pageWrapYEnabled?(this._gotoPage(this._page(t)), (t-this.lastBreak)%this.pageWrapY):t},transform:function(t,e,n,r,i,o){this.ctx._transform=this._matrix_multiply(this.ctx._transform,[t,e,n,r,i,o]);},setTransform:function(t,e,n,r,i,o){this.ctx._transform=[t,e,n,r,i,o];},_getTransform:function(){return this.ctx._transform},lastBreak:0,pageBreaks:[],_page:function(t){if(this.pageWrapYEnabled){for(var e=this.lastBreak=0,n=0,r=0;r<this.pageBreaks.length;r++)if(t>=this.pageBreaks[r]){e++, 0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r], n+=Math.floor(i/this.pageWrapY);}if(0===this.lastBreak)n+=Math.floor(t/this.pageWrapY)+1;return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t), e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"lt",x:t=n[0],y:e=n[1]};this.path.push(r);},bezierCurveTo:function(t,e,n,r,i,o){var a;t=this._wrapX(t), e=this._wrapY(e), n=this._wrapX(n), r=this._wrapY(r), i=this._wrapX(i), o=this._wrapY(o), i=(a=this._matrix_map_point(this.ctx._transform,[i,o]))[0], o=a[1];var s={type:"bct",x1:t=(a=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=a[1],x2:n=(a=this._matrix_map_point(this.ctx._transform,[n,r]))[0],y2:r=a[1],x:i,y:o};this.path.push(s);},quadraticCurveTo:function(t,e,n,r){var i;t=this._wrapX(t), e=this._wrapY(e), n=this._wrapX(n), r=this._wrapY(r), n=(i=this._matrix_map_point(this.ctx._transform,[n,r]))[0], r=i[1];var o={type:"qct",x1:t=(i=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=i[1],x:n,y:r};this.path.push(o);},arc:function(t,e,n,r,i,o){if(t=this._wrapX(t), e=this._wrapY(e), !this._matrix_is_identity(this.ctx._transform)){var a=this._matrix_map_point(this.ctx._transform,[t,e]);t=a[0], e=a[1];var s=this._matrix_map_point(this.ctx._transform,[0,0]),h=this._matrix_map_point(this.ctx._transform,[0,n]);n=Math.sqrt(Math.pow(h[0]-s[0],2)+Math.pow(h[1]-s[1],2));}
6150var c={type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,anticlockwise:o};this.path.push(c);},drawImage:function(t,e,n,r,i,o,a,s,h){void 0!==o&&(e=o, n=a, r=s, i=h), e=this._wrapX(e), n=this._wrapY(n);var c,l=this._matrix_map_rect(this.ctx._transform,{x:e,y:n,w:r,h:i}),u=(this._matrix_map_rect(this.ctx._transform,{x:o,y:a,w:s,h:h}), /data:image\/(\w+).*/i.exec(t));c=null!=u?u[1]:"png", this.pdf.addImage(t,c,l.x,l.y,l.w,l.h);},_matrix_multiply:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],h=n*t[0]+r*t[2],c=i*t[0]+o*t[2],l=a*t[0]+s*t[2]+t[4];return r=n*t[1]+r*t[3], o=i*t[1]+o*t[3], s=a*t[1]+s*t[3]+t[5], [n=h,r,i=c,o,a=l,s]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=Math.sqrt(e*e+n*n),a=(e/=o)*r+(n/=o)*i;r-=e*a, i-=n*a;var s=Math.sqrt(r*r+i*i);return a/=s, e*(i/=s)<n*(r/=s)&&(e=-e, n=-n, a=-a, o=-o), {scale:[o,0,0,s,0,0],translate:[1,0,0,1,t[4],t[5]],rotate:[e,n,-n,e,0,0],skew:[1,0,a,1,0,0]}},_matrix_map_point:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],h=e[0],c=e[1];return[h*n+c*i+a,h*r+c*o+s]},_matrix_map_point_obj:function(t,e){var n=this._matrix_map_point(t,[e.x,e.y]);return{x:n[0],y:n[1]}},_matrix_map_rect:function(t,e){var n=this._matrix_map_point(t,[e.x,e.y]),r=this._matrix_map_point(t,[e.x+e.w,e.y+e.h]);return{x:n[0],y:n[1],w:r[0]-n[0],h:r[1]-n[1]}},_matrix_is_identity:function(t){return 1==t[0]&&(0==t[1]&&(0==t[2]&&(1==t[3]&&(0==t[4]&&0==t[5]))))},rotate:function(t){var e=[Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0];this.ctx._transform=this._matrix_multiply(this.ctx._transform,e);},scale:function(t,e){var n=[t,0,0,e,0,0];this.ctx._transform=this._matrix_multiply(this.ctx._transform,n);},translate:function(t,e){var n=[1,0,0,1,t,e];this.ctx._transform=this._matrix_multiply(this.ctx._transform,n);},stroke:function(){if(0<this.ctx._clip_path.length){var t;(t=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var e=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._stroke(!0), this.ctx._clip_path=this.path, this.path=e, this._stroke(!1), t.push("Q");}else this._stroke(!1);}
6150,_stroke:function(t){if(t||!this._isStrokeTransparent()){for(var e=[],n=this.path,r=0;r<n.length;r++){var i=n[r];switch(i.type){case"mt":e.push({start:i,deltas:[],abs:[]});break;case"lt":var o=[i.x-n[r-1].x,i.y-n[r-1].y];e[e.length-1].deltas.push(o), e[e.length-1].abs.push(i);break;case"bct":o=[i.x1-n[r-1].x,i.y1-n[r-1].y,i.x2-n[r-1].x,i.y2-n[r-1].y,i.x-n[r-1].x,i.y-n[r-1].y];e[e.length-1].deltas.push(o);break;case"qct":var a=n[r-1].x+2/3*(i.x1-n[r-1].x),s=n[r-1].y+2/3*(i.y1-n[r-1].y),h=i.x+2/3*(i.x1-i.x),c=i.y+2/3*(i.y1-i.y),l=i.x,u=i.y;o=[a-n[r-1].x,s-n[r-1].y,h-n[r-1].x,c-n[r-1].y,l-n[r-1].x,u-n[r-1].y];e[e.length-1].deltas.push(o);break;case"arc":0==e.length&&e.push({start:{x:0,y:0},deltas:[],abs:[]}), e[e.length-1].arc=!0, Array.isArray(e[e.length-1].abs)&&e[e.length-1].abs.push(i);}}for(r=0;r<e.length;r++){var f;if(f=r==e.length-1?"s":null, e[r].arc)for(var d=e[r].abs,p=0;p<d.length;p++){var g=d[p],m=360*g.startAngle/(2*Math.PI),w=360*g.endAngle/(2*Math.PI),y=g.x,v=g.y;this.internal.arc2(this,y,v,g.radius,m,w,g.anticlockwise,f,t);}else{y=e[r].start.x, v=e[r].start.y;t?(this.pdf.lines(e[r].deltas,y,v,null,null), this.pdf.clip_fixed()):this.pdf.lines(e[r].deltas,y,v,null,f);}}}},_isFillTransparent:function(){return this.ctx._isFillTransparent||0==this.globalAlpha},_isStrokeTransparent:function(){return this.ctx._isStrokeTransparent||0==this.globalAlpha},fill:function(t){if(0<this.ctx._clip_path.length){var e;(e=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var n=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._fill(t,!0), this.ctx._clip_path=this.path, this.path=n, this._fill(t,!1), e.push("Q");}else this._fill(t,!1);},_fill:function(t,e){if(!this._isFillTransparent()){var n,r="function"==typeof this.pdf.internal.newObject2;n=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage();var i=[],o=window.outIntercept;if(r)switch(this.ctx.globalCompositeOperation){case"normal":case"source-over":break;case"destination-in":case"destination-out":var a=this.pdf.internal.newStreamObject(),s=this.pdf.internal.newObject2();s.push("<</Type /ExtGState"), s.push("/SMask <</S /Alpha /G "+a.objId+" 0 R>>"), s.push(">>");var h="MASK"+s.objId;this.pdf.internal.addGraphicsState(h,s.objId);var c="/"+h+" gs";n.splice(0,0,"q"), n.splice(1,0,c), n.push("Q"), window.outIntercept=a;break;default:var l="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];l&&this.pdf.internal.out(l+" gs");}var u=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(u=this.ctx._fillOpacity), r){var f=this.pdf.internal.newObject2();f.push("<</Type /ExtGState"), f.push("/CA "+u), f.push("/ca "+u), f.push(">>");h="GS_O_"+f.objId;this.pdf.internal.addGraphicsState(h,f.objId), this.pdf.internal.out("/"+h+" gs");}for(var d=this.path,p=0;p<d.length;p++){var g=d[p];switch(g.type){case"mt":i.push({start:g,deltas:[],abs:[]});break;case"lt":var m=[g.x-d[p-1].x,g.y-d[p-1].y];i[i.length-1].deltas.push(m), i[i.length-1].abs.push(g);break;case"bct":m=[g.x1-d[p-1].x,g.y1-d[p-1].y,g.x2-d[p-1].x,g.y2-d[p-1].y,g.x-d[p-1].x,g.y-d[p-1].y];i[i.length-1].deltas.push(m);break;case"qct":var w=d[p-1].x+2/3*(g.x1-d[p-1].x),y=d[p-1].y+2/3*(g.y1-d[p-1].y),v=g.x+2/3*(g.x1-g.x),b=g.y+2/3*(g.y1-g.y),x=g.x,S=g.y;m=[w-d[p-1].x,y-d[p-1].y,v-d[p-1].x,b-d[p-1].y,x-d[p-1].x,S-d[p-1].y];i[i.length-1].deltas.push(m);break;case"arc":0===i.length&&i.push({deltas:[],abs:[]}), i[i.length-1].arc=!0, Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(g);break;case"close":i.push({close:!0});}}for(p=0;p<i.length;p++){var k;if(p==i.length-1?(k="f", "evenodd"===t&&(k+="*")):k=null, i[p].close)this.pdf.internal.out("h"), k&&this.pdf.internal.out(k);else if(i[p].arc){i[p].start&&this.internal.move2(this,i[p].start.x,i[p].start.y);for(var _=i[p].abs,A=0;A<_.length;A++){var I=_[A];if(void 0!==I.startAngle){var C=360*I.startAngle/(2*Math.PI),T=360*I.endAngle/(2*Math.PI),F=I.x,P=I.y;if(0===A&&this.internal.move2(this,F,P), this.internal.arc2(this,F,P,I.radius,C,T,I.anticlockwise,null,e), A===_.length-1&&i[p].start){F=i[p].start.x, P=i[p].start.y;this.internal.line2(E,F,P);}}else this.internal.line2(E,I.x,I.y);}}else{F=i[p].start.x, P=i[p].start.y;
6150e?(this.pdf.lines(i[p].deltas,F,P,null,null), this.pdf.clip_fixed()):this.pdf.lines(i[p].deltas,F,P,null,k);}}window.outIntercept=o;}},pushMask:function(){if("function"==typeof this.pdf.internal.newObject2){var t=this.pdf.internal.newStreamObject(),e=this.pdf.internal.newObject2();e.push("<</Type /ExtGState"), e.push("/SMask <</S /Alpha /G "+t.objId+" 0 R>>"), e.push(">>");var n="MASK"+e.objId;this.pdf.internal.addGraphicsState(n,e.objId);var r="/"+n+" gs";this.pdf.internal.out(r);}else console.log("jsPDF v2 not enabled");},clip:function(){if(0<this.ctx._clip_path.length)for(var t=0;t<this.path.length;t++)this.ctx._clip_path.push(this.path[t]);else this.ctx._clip_path=this.path;this.path=[];},measureText:function(n){var r=this.pdf;return{getWidth:function(){var t=r.internal.getFontSize(),e=r.getStringUnitWidth(n)*t/r.internal.scaleFactor;return e*=1.3333},get width(){return this.getWidth(n)}}},_getBaseline:function(t){var e=parseInt(this.pdf.internal.getFontSize()),n=.25*e;switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+e;case"hanging":return t+e-n;case"middle":return t+e/2-n;case"ideographic":return t;case"alphabetic":default:return t}}};var E=t.context2d;function e(){this._isStrokeTransparent=!1, this._strokeOpacity=1, this.strokeStyle="#000000", this.fillStyle="#000000", this._isFillTransparent=!1, this._fillOpacity=1, this.font="12pt times", this.textBaseline="alphabetic", this.textAlign="start", this.lineWidth=1, this.lineJoin="miter", this.lineCap="butt", this._transform=[1,0,0,1,0,0], this.globalCompositeOperation="normal", this.globalAlpha=1, this._clip_path=[], this.ignoreClearRect=!1, this.copy=function(t){this._isStrokeTransparent=t._isStrokeTransparent, this._strokeOpacity=t._strokeOpacity, this.strokeStyle=t.strokeStyle, this._isFillTransparent=t._isFillTransparent, this._fillOpacity=t._fillOpacity, this.fillStyle=t.fillStyle, this.font=t.font, this.lineWidth=t.lineWidth, this.lineJoin=t.lineJoin, this.lineCap=t.lineCap, this.textBaseline=t.textBaseline, this.textAlign=t.textAlign, this._fontSize=t._fontSize, this._transform=t._transform.slice(0), this.globalCompositeOperation=t.globalCompositeOperation, this.globalAlpha=t.globalAlpha, this._clip_path=t._clip_path.slice(0), this.ignoreClearRect=t.ignoreClearRect;};}Object.defineProperty(E,"fillStyle",{set:function(t){this.setFillStyle(t);},get:function(){return this.ctx.fillStyle}}), Object.defineProperty(E,"strokeStyle",{set:function(t){this.setStrokeStyle(t);},get:function(){return this.ctx.strokeStyle}}), Object.defineProperty(E,"lineWidth",{set:function(t){this.setLineWidth(t);},get:function(){return this.ctx.lineWidth}}), Object.defineProperty(E,"lineCap",{set:function(t){this.setLineCap(t);},get:function(){return this.ctx.lineCap}}), Object.defineProperty(E,"lineJoin",{set:function(t){this.setLineJoin(t);},get:function(){return this.ctx.lineJoin}}), Object.defineProperty(E,"miterLimit",{set:function(t){this.ctx.miterLimit=t;},get:function(){return this.ctx.miterLimit}}), Object.defineProperty(E,"textBaseline",{set:function(t){this.setTextBaseline(t);},get:function(){return this.getTextBaseline()}}), Object.defineProperty(E,"textAlign",{set:function(t){this.setTextAlign(t);},get:function(){return this.getTextAlign()}}), Object.defineProperty(E,"font",{set:function(t){this.setFont(t);},get:function(){return this.ctx.font}}), Object.defineProperty(E,"globalCompositeOperation",{set:function(t){this.ctx.globalCompositeOperation=t;},get:function(){return this.ctx.globalCompositeOperation}}), Object.defineProperty(E,"globalAlpha",{set:function(t){this.ctx.globalAlpha=t;},get:function(){return this.ctx.globalAlpha}}), Object.defineProperty(E,"canvas",{get:function(){return{parentNode:!1,style:!1}}}), Object.defineProperty(E,"ignoreClearRect",{set:function(t){this.ctx.ignoreClearRect=t;},get:function(){return this.ctx.ignoreClearRect}}), E.internal={}, E.internal.rxRgb=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/, E.internal.rxRgba=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/, E.internal.rxTransparent=/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/, E.internal.arc=function(t,e,n,r,i,o,a,s){for(var h=this.pdf.internal.scaleFactor,c=this.pdf.internal.pageSize.getHeight(),l=this.pdf.internal.f2,u=i*(Math.PI/180),f=o*(Math.PI/180),d=this.createArc(r,u,f,a),p=0;p<d.length;p++){var g=d[p];0===p?this.pdf.internal.out([l((g.x1+e)*h),l((c-(g.y1+n))*h),"m",l((g.x2+e)*h),l((c-(g.y2+n))*h),l((g.x3+e)*h),l((c-(g.y3+n))*h),l((g.x4+e)*h),l((c-(g.y4
6150+n))*h),"c"].join(" ")):this.pdf.internal.out([l((g.x2+e)*h),l((c-(g.y2+n))*h),l((g.x3+e)*h),l((c-(g.y3+n))*h),l((g.x4+e)*h),l((c-(g.y4+n))*h),"c"].join(" ")), t._lastPoint={x:e,y:n};}null!==s&&this.pdf.internal.out(this.pdf.internal.getStyle(s));}, E.internal.arc2=function(t,e,n,r,i,o,a,s,h){var c=e,l=n;h?(this.arc(t,c,l,r,i,o,a,null), this.pdf.clip_fixed()):this.arc(t,c,l,r,i,o,a,s);}, E.internal.move2=function(t,e,n){var r=this.pdf.internal.scaleFactor,i=this.pdf.internal.pageSize.getHeight(),o=this.pdf.internal.f2;this.pdf.internal.out([o(e*r),o((i-n)*r),"m"].join(" ")), t._lastPoint={x:e,y:n};}, E.internal.line2=function(t,e,n){var r=this.pdf.internal.scaleFactor,i=this.pdf.internal.pageSize.getHeight(),o=this.pdf.internal.f2,a={x:e,y:n};this.pdf.internal.out([o(a.x*r),o((i-a.y)*r),"l"].join(" ")), t._lastPoint=a;}, E.internal.createArc=function(t,e,n,r){var i=2*Math.PI,o=Math.PI/2,a=e;for((a<i||i<a)&&(a%=i), a<0&&(a=i+a);n<e;)e-=i;var s=Math.abs(n-e);s<i&&r&&(s=i-s);for(var h=[],c=r?-1:1,l=a;1e-5<s;){var u=l+c*Math.min(s,o);h.push(this.createSmallArc(t,l,u)), s-=Math.abs(u-l), l=u;}return h}, E.internal.getCurrentPage=function(){return this.pdf.internal.pages[this.pdf.internal.getCurrentPageInfo().pageNumber]}, E.internal.createSmallArc=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),a=i,s=-o,h=a*a+s*s,c=h+a*i+s*o,l=4/3*(Math.sqrt(2*h*c)-c)/(a*o-s*i),u=a-l*s,f=s+l*a,d=u,p=-f,g=r+e,m=Math.cos(g),w=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:u*m-f*w,y2:u*w+f*m,x3:d*m-p*w,y3:d*w+p*m,x4:t*Math.cos(n),y4:t*Math.sin(n)}};}($.API,"undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), function(t){var T,F,i,a,s,h,c,l,P,v,f,u,d,n,E,q,p,g,m,O;T=function(){return function(t){return e.prototype=t, new e};function e(){}}(), v=function(t){var e,n,r,i,o,a,s;for(n=0, r=t.length, e=void 0, a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0), n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0), n--;for(o=/\s+$/g, s=!0, n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "), s&&(e=e.trimLeft()), e&&(s=o.test(e)), t[n]=e), n++;return t}, u=function(t){var e,n,r;for(e=void 0, n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()], n=r.shift();return e}, d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"), -1<t.indexOf("pt")&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"), (e=n[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])?n[t]=e/16:(e=parseFloat(t))?n[t]=e/16:(e=t.match(/([\d\.]+)(px)/), Array.isArray(e)&&3===e.length?n[t]=parseFloat(e[1])/16:n[t]=1)}, P=function(t){var e,n,r,i,o;return o=t, i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(o,null):o.currentStyle?o.currentStyle:o.style, n=void 0, (e={})["font-family"]=u((r=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}), i[t]})("font-family"))||"times", e["font-style"]=a[r("font-style")]||"normal", e["text-align"]=s[r("text-align")]||"left", "bold"===(n=h[r("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]), e["font-size"]=d(r("font-size"))||1, e["line-height"]=d(r("line-height"))||1, e.display="inline"===r("display")?"inline":"block", n="block"===e.display, e["margin-top"]=n&&d(r("margin-top"))||0, e["margin-bottom"]=n&&d(r("margin-bottom"))||0, e["padding-top"]=n&&d(r("padding-top"))||0, e["padding-bottom"]=n&&d(r("padding-bottom"))||0, e["margin-left"]=n&&d(r("margin-left"))||0, e["margin-right"]=n&&d(r("margin-right"))||0, e["padding-left"]=n&&d(r("padding-left"))||0, e["padding-right"]=n&&d(r("padding-right"))||0, e["page-break-before"]=r("page-break-before")||"auto", e.float=c[r("cssFloat")]||"none", e.clear=l[r("clear")]||"none", e.color=r("color"), e}, E=function(t,e,n){var r,i,o,a,s;if(o=!1, a=i=void 0, r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0, a=r.length;!o&&i!==a;)o=r[i](t,e), i++;if(r=n[t.nodeName], !o&&r)if("function"==typeof r)o=r(t,e);else for(i=0, a=r.length;!o&&i!==a;)o=r[i](t,e), i++;for(s="string"==typeof t.className?t.className.split(" "):[], i=0;i<s.length;i++)if(r=n["."+s[i]], !o&&r)if("function"==typeof r)o=r(t,e);else for(i=0, a=r.length;!o&&i!==a;)o=r[i](t,e), i++;return o}, O=function(t,e){var n,r,i,o,a,s,h,c,l;
6150for(n=[], r=[], i=0, l=t.rows[0].cells.length, h=t.clientWidth;i<l;)c=t.rows[0].cells[i], r[i]={name:c.textContent.toLowerCase().replace(/\s+/g,""),prompt:c.textContent.replace(/\r?\n/g,""),width:c.clientWidth/h*e.pdf.internal.pageSize.getWidth()}, i++;for(i=1;i<t.rows.length;){for(s=t.rows[i], a={}, o=0;o<s.cells.length;)a[r[o].name]=s.cells[o].textContent.replace(/\r?\n/g,""), o++;n.push(a), i++;}return{rows:n,headers:r}};var B={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},R=1;F=function(t,i,e){var n,r,o,a,s,h,c,l;for(r=t.childNodes, n=void 0, (s="block"===(o=P(t)).display)&&(i.setBlockBoundary(), i.setBlockStyle(o)), a=0, h=r.length;a<h;){if("object"===(void 0===(n=r[a])?"undefined":vt(n))){if(i.executeWatchFunctions(n), 1===n.nodeType&&"HEADER"===n.nodeName){var u=n,f=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=f, F(u,i,e), i.pdf.margins_doc.top=i.y+10, i.y+=10;},!1);}if(8===n.nodeType&&"#comment"===n.nodeName)~n.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(), i.y=i.pdf.margins_doc.top);else if(1!==n.nodeType||B[n.nodeName])if(3===n.nodeType){var d=n.nodeValue;if(n.nodeValue&&"LI"===n.parentNode.nodeName)if("OL"===n.parentNode.parentNode.nodeName)d=R+++". "+d;else{var p=o["font-size"],g=(3-.75*p)*i.pdf.internal.scaleFactor,m=.75*p*i.pdf.internal.scaleFactor,w=1.74*p/i.pdf.internal.scaleFactor;l=function(t,e){this.pdf.circle(t+g,e+m,w,"FD");};}16&n.ownerDocument.body.compareDocumentPosition(n)&&i.addText(d,o);}else"string"==typeof n&&i.addText(n,o);else{var y;if("IMG"===n.nodeName){var v=n.getAttribute("src");y=q[i.pdf.sHashCode(v)||v];}if(y){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+n.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(), i.y=i.pdf.margins_doc.top, i.executeWatchFunctions(n));var b=P(n),x=i.x,S=12/i.pdf.internal.scaleFactor,k=(b["margin-left"]+b["padding-left"])*S,_=(b["margin-right"]+b["padding-right"])*S,A=(b["margin-top"]+b["padding-top"])*S,I=(b["margin-bottom"]+b["padding-bottom"])*S;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-_:x+=k, i.pdf.addImage(y,x,i.y+A,n.width,n.height), y=void 0, "right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t, i.settings.width+=n, !0):!!(r&&1===r.nodeType&&!B[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t, i.y=e, i.settings.width+=n, !0)}.bind(this,"left"===b.float?-n.width-k-_:0,i.y+n.height+A+I,n.width)), i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===P(n).clear&&(i.y=t, !0)}.bind(this,i.y+n.height,i.pdf.internal.getNumberOfPages())), i.settings.width-=n.width+k+_, "left"===b.float&&(i.x+=n.width+k+_)):i.y+=n.height+A+I;}else if("TABLE"===n.nodeName)c=O(n,i), i.y+=10, i.pdf.table(i.x,i.y,c.rows,c.headers,{autoSize:!1,printHeaders:e.printHeaders,margins:i.pdf.margins_doc,css:P(n)}), i.y=i.pdf.lastCellPos.y+i.pdf.lastCellPos.h+20;else if("OL"===n.nodeName||"UL"===n.nodeName)R=1, E(n,i,e)||F(n,i,e), i.y+=10;else if("LI"===n.nodeName){var C=i.x;i.x+=20/i.pdf.internal.scaleFactor, i.y+=3, E(n,i,e)||F(n,i,e), i.x=C;}else"BR"===n.nodeName?(i.y+=o["font-size"]*i.pdf.internal.scaleFactor, i.addText("\u2028",T(o))):E(n,i,e)||F(n,i,e);}}a++;}if(e.outY=i.y, s)return i.setBlockBoundary(l)}, q={}, p=function(t,o,e,n){var a,r=t.getElementsByTagName("img"),i=r.length,s=0;function h(){o.pdf.internal.events.publish("imagesLoaded"), n(a);}function c(e,n,r){if(e){var i=new Image;a=++s, i.crossOrigin="", i.onerror=i.onload=function(){if(i.complete&&(0===i.src.indexOf("data:image/")&&(i.width=n||i.width||0, i.height=r||i.height||0), i.width+i.height)){var t=o.pdf.sHashCode(e)||e;q[t]=q[t]||i;}--s||h();}, i.src=e;}}for(;i--;)c(r[i].getAttribute("src"),r[i].width,r[i].height);return s||h()}, g=function(t,o,a){var s=t.getElementsByTagName("footer");if(0<s.length){s=s[0];var e=o.pdf.internal.write,n=o.y;o.pdf.internal.write=function(){}, F(s,o,a);var h=Math.ceil(o.y-n)+5;o.y=n, o.pdf.internal.write=e, o.pdf.margins_doc.bottom+=h;for(var r=function(t){var e=void 0!==t?t.pageNumber:1,n=o.y;o.y=o.pdf.internal.pageSize.getHeight()-o.pdf.margins_doc.bottom, o.pdf.margins_doc.bottom-=h;for(var r=s.getElementsByTagName("span"),i=0;i<r.length;++i)-1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")&&(r[i].innerHTML=e), -1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&(r[i].innerHTML="###jsPDFVarTotalPages###");F(s,o,a), o.pdf.margins_doc.bottom+=h, o.y=n;},i=s.getElementsByTagName("span"),c=0;c<i.length;++c)-1<(" "+i[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&o.pdf.internal.events.subscribe("htmlRenderingFinished",o.pdf.putTotalPages.bind(o.pdf,"###jsPDFVarTotalPages###"),!0);o.pdf.internal.events.subscribe("addPage",r,!1), r(), B.FOOTER=1;}}, m=function(t,e,n,r,i,o){if(!e)return!1;var a,s,h,c;"string"==typeof e||e.parentNode||(e=""+e.innerHTML), "string"==typeof e&&(a=e.replace(/<\/?script[^>]*?>/gi,""), c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0), (h=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;", h.innerHTML='<iframe style="height:1px;width:1px" name="'+c+'" />', document.body.appendChild(h), (s=window.frames[c]).document.open(), s.document.writeln(a), s.document.close(), e=s.document.body);var l,u=new f(t,n,r,i);return p.call(this,e,u,i.elementHandlers,function(t){g(e,u,i.elementHandlers), F(e,u,i.elementHandlers), u.pdf.internal.events.publish("htmlRenderingFinished"), l=u.dispose(), "function"==typeof o?o(l):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!");}), l||{x:u.x,y:u.y}}, (f=function(t,e,n,r){return this.pdf=t, this.x=e, this.y=n, this.settings=r, this.watchFunctions=[], this.init(), this}).prototype.init=function(){return this.paragraph={text:[],style:[]}, this.pdf.internal.write("q")}, f.prototype.dispose=function(){return this.pdf.internal.write("Q"), {x:this.x,y:this.y,ready:!0}}, f.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(0<this.watchFunctions.length){for(var r=0;r<this.watchFunctions.length;++r)!0===this.watchFunctions[r](t)?e=!0:n.push(this.watchFunctions[r]);this.watchFunctions=n;}return e}, f.prototype.splitFragmentsIntoLines=function(t,e){var n,r,i,o,a,s,h,c,l,u,f,d,p,g;for(u=this.pdf.internal.scaleFactor, o={}
6150, s=h=c=g=a=i=l=r=void 0, d=[f=[]], n=0, p=this.settings.width;t.length;)if(a=t.shift(), g=e.shift(), a)if((i=o[(r=g["font-family"])+(l=g["font-style"])])||(i=this.pdf.internal.getFont(r,l).metadata.Unicode, o[r+l]=i), c={widths:i.widths,kerning:i.kerning,fontSize:12*g["font-size"],textIndent:n}, h=this.pdf.getStringUnitWidth(a,c)*c.fontSize/u, "\u2028"==a)f=[], d.push(f);else if(p<n+h){for(s=this.pdf.splitTextToSize(a,p,c), f.push([s.shift(),g]);s.length;)f=[[s.shift(),g]], d.push(f);n=this.pdf.getStringUnitWidth(f[0][0],c)*c.fontSize/u;}else f.push([a,g]), n+=h;if(void 0!==g["text-align"]&&("center"===g["text-align"]||"right"===g["text-align"]||"justify"===g["text-align"]))for(var m=0;m<d.length;++m){var w=this.pdf.getStringUnitWidth(d[m][0][0],c)*c.fontSize/u;0<m&&(d[m][0][1]=T(d[m][0][1]));var y=p-w;if("right"===g["text-align"])d[m][0][1]["margin-left"]=y;else if("center"===g["text-align"])d[m][0][1]["margin-left"]=y/2;else if("justify"===g["text-align"]){var v=d[m][0][0].split(" ").length-1;d[m][0][1]["word-spacing"]=y/v, m===d.length-1&&(d[m][0][1]["word-spacing"]=0);}}return d}, f.prototype.RenderTextFragment=function(t,e){var n,r;r=0, this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()&&(this.pdf.internal.write("ET","Q"), this.pdf.addPage(), this.y=this.pdf.margins_doc.top, this.pdf.internal.write("q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"), r=Math.max(r,e["line-height"],e["font-size"]), this.pdf.internal.write(0,(-12*r).toFixed(2),"Td")), n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var i=this.getPdfColor(e.color);i!==this.lastTextColor&&(this.pdf.internal.write(i), this.lastTextColor=i), void 0!==e["word-spacing"]&&0<e["word-spacing"]&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw"), this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(t)+") Tj"), void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw");}, f.prototype.getPdfColor=function(t){var e,n,r,i=new RGBColor(t),o=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=o?(e=parseInt(o[1]), n=parseInt(o[2]), r=parseInt(o[3])):("#"!=t.charAt(0)&&(t=i.ok?i.toHex():"#000000"), e=t.substring(1,3), e=parseInt(e,16), n=t.substring(3,5), n=parseInt(n,16), r=t.substring(5,7), r=parseInt(r,16)), "string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var a=parseInt(e.substr(1),16);e=a>>16&255, n=a>>8&255, r=255&a;}var s=this.f3;return 0===e&&0===n&&0===r||void 0===n?s(e/255)+" g":[s(e/255),s(n/255),s(r/255),"rg"].join(" ")}, f.prototype.f3=function(t){return t.toFixed(3)}, f.prototype.renderParagraph=function(t){var e,n,r,i,o,a,s,h,c,l,u,f,d;if(r=v(this.paragraph.text), f=this.paragraph.style, e=this.paragraph.blockstyle, this.paragraph.priorblockstyle||{}, this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e}, r.join("").trim()){s=this.splitFragmentsIntoLines(r,f), h=a=void 0, n=12/this.pdf.internal.scaleFactor, this.priorMarginBottom=this.priorMarginBottom||0, u=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n, l=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n, this.priorMarginBottom=e["margin-bottom"]||0, "always"===e["page-break-before"]&&(this.pdf.addPage(), this.y=0, u=((e["margin-top"]||0)+(e["padding-top"]||0))*n), c=this.pdf.internal.write, o=i=void 0, this.y+=u, c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var p=0;s.length;){for(i=h=0, o=(a=s.shift()).length;i!==o;)a[i][0].trim()&&(h=Math.max(h,a[i][1]["line-height"],a[i][1]["font-size"]), d=7*a[i][1]["font-size"]), i++;var g=0,m=0;for(void 0!==a[0][1]["margin-left"]&&0<a[0][1]["margin-left"]&&(g=(m=this.pdf.internal.getCoordinateString(a[0][1]["margin-left"]))-p, p=m), c(g+Math.max(e["margin-left"]||0,0)*n,(-12*h).toFixed(2),"Td"), i=0, o=a.length;i!==o;)a[i][0]&&this.RenderTextFragment(a[i][0],a[i][1]), i++;if(this.y+=h*n, this.executeWatchFunctions(a[0][1])&&0<s.length){var w=[],y=[];
6150s.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(w.push(t[e][0]+" "), y.push(t[e][1])), ++e;}), s=this.splitFragmentsIntoLines(v(w),y), c("ET","Q"), c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-d/2), c("ET","Q"), this.y+=l}}, f.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)}, f.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t}, f.prototype.addText=function(t,e){return this.paragraph.text.push(t), this.paragraph.style.push(e)}, i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"}, h={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"}, a={normal:"normal",italic:"italic",oblique:"italic"}, s={left:"left",right:"right",center:"center",justify:"justify"}, c={none:"none",right:"right",left:"left"}, l={none:"none",both:"both"}, n={normal:1}, t.fromHTML=function(t,e,n,r,i,o){return this.margins_doc=o||{top:0,bottom:0}, r||(r={}), r.elementHandlers||(r.elementHandlers={}), m(this,t,isNaN(e)?4:e,isNaN(n)?4:n,r,i)};}($.API), $.API.addJS=function(t){return s=t, this.internal.events.subscribe("postPutResources",function(t){n=this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) "+(n+1)+" 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), r=this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS ("+s+")"), this.internal.out(">>"), this.internal.out("endobj");}), this.internal.events.subscribe("putCatalog",function(){void 0!==n&&void 0!==r&&this.internal.out("/Names <</JavaScript "+n+" 0 R>>");}), this}, (
6151/**
6152   * jsPDF Outline PlugIn
6153   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  [email protected]
6154   *
6155   * Licensed under the MIT License.
6156   * http://opensource.org/licenses/mit-license
6157   */
6158c=$.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0<this.outline.root.children.length)for(var n=t.outline.render().split(/\r\n/),r=0;r<n.length;r++){var i=n[r],o=e.exec(i);if(null!=o){var a=o[1];t.internal.newObjectDeferredBegin(a);}t.internal.write(i);}if(this.outline.createNamedDestinations){var s=this.internal.pages.length,h=[];for(r=0;r<s;r++){var c=t.internal.newObject();h.push(c);var l=t.internal.getPageInfo(r+1);t.internal.write("<< /D["+l.objId+" 0 R /XYZ null null null]>> endobj");}var u=t.internal.newObject();for(t.internal.write("<< /Names [ "), r=0;r<h.length;r++)t.internal.write("(page_"+(r+1)+")"+h[r]+" 0 R");t.internal.write(" ] >>","endobj"), t.internal.newObject(), t.internal.write("<< /Dests "+u+" 0 R"), t.internal.write(">>","endobj");}}]), c.events.push(["putCatalog",function(){0<this.outline.root.children.length&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations&&this.internal.write("/Names "+namesOid+" 0 R"));}]), c.events.push(["initialized",function(){var o=this;o.outline={createNamedDestinations:!1,root:{children:[]}}, o.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root), t.children.push(r), r}, o.outline.render=function(){return this.ctx={}, this.ctx.val="", this.ctx.pdf=o, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val}, o.outline.genIds_r=function(t){t.id=o.internal.newObjectDeferred();for(var e=0;e<t.children.length;e++)this.genIds_r(t.children[e]);}, o.outline.renderRoot=function(t){this.objStart(t), this.line("/Type /Outlines"), 0<t.children.length&&(this.line("/First "+this.makeRef(t.children[0])), this.line("/Last "+this.makeRef(t.children[t.children.length-1]))), this.line("/Count "+this.count_r({count:0},t)), this.objEnd();}, o.outline.renderItems=function(t){for(var e=0;e<t.children.length;e++){var n=t.children[e];this.objStart(n), this.line("/Title "+this.makeString(n.title)), this.line("/Parent "+this.makeRef(t)), 0<e&&this.line("/Prev "+this.makeRef(t.children[e-1])), e<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[e+1])), 0<n.children.length&&(this.line("/First "+this.makeRef(n.children[0])), this.line("/Last "+this.makeRef(n.children[n.children.length-1])));var r=this.count=this.count_r({count:0},n);if(0<r&&this.line("/Count "+r), n.options&&n.options.pageNumber){var i=o.internal.getPageInfo(n.options.pageNumber);this.line("/Dest ["+i.objId+" 0 R /XYZ 0 "+this.ctx.pdf.internal.pageSize.getHeight()*this.ctx.pdf.internal.scaleFactor+" 0]");}this.objEnd();}for(e=0;e<t.children.length;e++)n=t.children[e], this.renderItems(n);}
6158, o.outline.line=function(t){this.ctx.val+=t+"\r\n";}, o.outline.makeRef=function(t){return t.id+" 0 R"}, o.outline.makeString=function(t){return"("+o.internal.pdfEscape(t)+")"}, o.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n";}, o.outline.objEnd=function(t){this.ctx.val+=">> \r\nendobj\r\n";}, o.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++, this.count_r(t,e.children[n]);return t.count};}]), P=$.API, E=function(){var t="function"==typeof Deflater;if(!t)throw new Error("requires deflate.js for compression");return t}, q=function(t,e,n,r){var i=5,o=b;switch(r){case P.image_compression.FAST:i=3, o=v;break;case P.image_compression.MEDIUM:i=6, o=x;break;case P.image_compression.SLOW:i=9, o=S;}t=w(t,e,n,o);var a=new Uint8Array(g(i)),s=m(t),h=new Deflater(i),c=h.append(t),l=h.flush(),u=a.length+c.length+l.length,f=new Uint8Array(u+4);return f.set(a), f.set(c,a.length), f.set(l,a.length+c.length), f[u++]=s>>>24&255, f[u++]=s>>>16&255, f[u++]=s>>>8&255, f[u++]=255&s, P.arrayBufferToBinaryString(f)}, g=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6, r|=0, [n,255&(r+=31-r%31)]}, m=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0<o;){for(o-=n=e<o?e:o;i+=r+=t[a++], --n;);r%=65521, i%=65521;}return(i<<16|r)>>>0}, w=function(t,e,n,r){for(var i,o,a,s=t.length/e,h=new Uint8Array(t.length+s),c=k(),l=0;l<s;l++){if(a=l*e, i=t.subarray(a,a+e), r)h.set(r(i,n,o),a+l);else{for(var u=0,f=c.length,d=[];u<f;u++)d[u]=c[u](i,n,o);var p=_(d.concat());h.set(d[p],a+l);}o=i;}return h}, l=function(t,e,n){var r=Array.apply([],t);return r.unshift(0), r}, v=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=1;o<a;o++)r=t[o-e]||0, i[o+1]=t[o]-r+256&255;return i}, b=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=2;o<a;o++)r=n&&n[o]||0, i[o+1]=t[o]-r+256&255;return i}, x=function(t,e,n){var r,i,o=[],a=0,s=t.length;for(o[0]=3;a<s;a++)r=t[a-e]||0, i=n&&n[a]||0, o[a+1]=t[a]+256-(r+i>>>1)&255;return o}, S=function(t,e,n){var r,i,o,a,s=[],h=0,c=t.length;for(s[0]=4;h<c;h++)r=t[h-e]||0, i=n&&n[h]||0, o=n&&n[h-e]||0, a=u(r,i,o), s[h+1]=t[h]-a+256&255;return s}, u=function(t,e,n){var r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),a=Math.abs(r-n);return i<=o&&i<=a?t:o<=a?e:n}, k=function(){return[l,v,b,x,S]}, _=function(t){for(var e,n,r,i=0,o=t.length;i<o;)((e=f(t[i].slice(1)))<n||!n)&&(n=e, r=i), i++;return r}, f=function(t){for(var e=0,n=t.length,r=0;e<n;)r+=Math.abs(t[e++]);return r}, P.processPNG=function(t,e,n,r,i){var o,a,s,h,c,l,u=this.color_spaces.DEVICE_RGB,f=this.decode.FLATE_DECODE,d=8;if(this.isArrayBuffer(t)&&(t=new Uint8Array(t)), this.isArrayBufferView(t)){if("function"!=typeof PNG||"function"!=typeof kt)throw new Error("PNG support requires png.js and zlib.js");if(t=(o=new PNG(t)).imgData, d=o.bits, u=o.colorSpace, h=o.colors, -1!==[4,6].indexOf(o.colorType)){if(8===o.bits)for(var p,g=(I=32==o.pixelBitlength?new Uint32Array(o.decodePixels().buffer):16==o.pixelBitlength?new Uint16Array(o.decodePixels().buffer):new Uint8Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*o.colors),w=new Uint8Array(g),y=o.pixelBitlength-o.bits,v=0,b=0;v<g;v++){for(x=I[v], p=0;p<y;)m[b++]=x>>>p&255, p+=o.bits;w[v]=x>>>p&255;}if(16===o.bits){g=(I=new Uint32Array(o.decodePixels().buffer)).length, m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors), w=new Uint8Array(g*(32/o.pixelBitlength));for(var x,S=1<o.colors,k=b=v=0;v<g;)x=I[v++], m[b++]=x>>>0&255, S&&(m[b++]=x>>>16&255, x=I[v++], m[b++]=x>>>0&255), w[k++]=x>>>16&255;d=8;}r!==P.image_compression.NONE&&E()?(t=q(m,o.width*o.colors,o.colors,r), l=q(w,o.width,1,r)):(t=m, l=w, f=null);}if(3===o.colorType&&(u=this.color_spaces.INDEXED, c=o.palette, o.transparency.indexed)){var _=o.transparency.indexed,A=0;for(v=0, g=_.length;v<g;++v)A+=_[v];if((A/=255)==g-1&&-1!==_.indexOf(0))s=[_.indexOf(0)];else if(A!==g){var I=o.decodePixels();for(w=new Uint8Array(I.length), v=0, g=I.length;v<g;v++)w[v]=_[I[v]];l=q(w,o.width,1);}}var C=function(t){var e;switch(t){case P.image_compression.FAST:e=11;break;case P.image_compression.MEDIUM:e=13;break;case P.image_compression.SLOW:e=14;break;default:e=12;}return e}(r);return a=f===this.decode.FLATE_DECODE?"/Predictor "+C+" /Colors "+h+" /BitsPerComponent "+d+" /Columns "+o.width:"/Colors "+h+" /BitsPerComponent "+d+" /Columns "+o.width, (this.isArrayBuffer(t)||this.isArrayBufferView(t))&&(t=this.arrayBufferToBinaryString(t)), (l&&this.isArrayBuffer(l)||this.isArrayBufferView(l))&&(l=this.arrayBufferToBinaryString(l)), this.createImageInfo(t,o.width,o.height,u,d,f,e,n,a,s,c,l,C)}throw new Error("Unsupported PNG image data, try using JPEG instead.")}, (
6159/**
6160   * jsPDF gif Support PlugIn
6161   * Copyright (c) 2017 Aras Abbasi 
6162   *
6163   * Licensed under the MIT License.
6164   * http://opensource.org/licenses/mit-license
6165   */
6166A=$.API).processGIF89A=function(t,e,n,r,i){var o=new mt(t),a=o.width,s=o.height,h=[];o.decodeAndBlitFrameRGBA(0,h);var c={data:h,width:a,height:s},l=new yt(100).encode(c,100);return A.processJPEG.call(this,l,e,n,r)}, A.processGIF87A=A.processGIF89A, (
6167/**
6168   * jsPDF bmp Support PlugIn
6169   * Copyright (c) 2018 Aras Abbasi 
6170   *
6171   * Licensed under the MIT License.
6172   * http://opensource.org/licenses/mit-license
6173   */
6174O=$.API).processBMP=function(t,e,n,r,i){var o=new xt(t,!1),a=o.width,s=o.height,h={data:o.getData(),width:a,height:s},c=new yt(100).encode(h,100);return O.processJPEG.call(this,c,e,n,r)}, $.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={}, this.internal.languageSettings.isSubscribed=!1), void 0!=={af:"Afrikaans",sq
6174:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"FYRO Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]&&(this.internal.languageSettings.languageCode=t, !1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")");}), this.internal.languageSettings.isSubscribed=!0)), this}, B=$.API, R=B.getCharWidthsArray=function(t,e){var n,r,i,o=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),s=e.charSpace||this.internal.getCharSpace(),h=e.widths?e.widths:o.metadata.Unicode.widths,c=h.fof?h.fof:1,l=e.kerning?e.kerning:o.metadata.Unicode.kerning,u=l.fof?l.fof:1,f=0,d=h[0]||c,p=[];for(n=0, r=t.length;n<r;n++)i=t.charCodeAt(n), "function"==typeof o.metadata.widthOfString?p.push((o.metadata.widthOfGlyph(o.metadata.characterToGlyph(i))+s*(1e3/a)||0)/1e3):p.push((h[i]||d)/c+(l[i]&&l[i][f]||0)/u), f=i;return p}, j=B.getArraySum=function(t){for(var e=t.length,n=0;e;)n+=t[--e];return n}, D=B.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:j(R.apply(this,arguments))}, M=function(t,e,n,r){for(var i=[],o=0,a=t.length,s=0;o!==a&&s+e[o]<n;)s+=e[o], o++;i.push(t.slice(0,o));var h=o;for(s=0;o!==a;)s+e[o]>r&&(i.push(t.slice(h,o)), s=0, h=o), s+=e[o], o++;return h!==o&&i.push(t.slice(h,o)), i}, U=function(t,e,n){n||(n={});var r,i,o,a,s,h,c=[],l=[c],u=n.textIndent||0,f=0,d=0,p=t.split(" "),g=R.apply(this,[" ",n])[0];if(h=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(h).join(" "),w=[];p.map(function(t){1<(t=t.split(/\s*\n/)).length?w=w.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):w.push(t[0]);}), p=w, h=D.apply(this,[m,n]);}for(o=0, a=p.length;o<a;o++){var y=0;if(r=p[o], h&&"\n"==r[0]&&(r=r.substr(1), y=1), i=R.apply(this,[r,n]), e<u+f+(d=j(i))||y){if(e<d){for(s=M.apply(this,[r,i,e-(u+f),e]), c.push(s.shift()), c=[s.pop()];s.length;)l.push([s.shift()]);d=j(i.slice(r.length-(c[0]?c[0].length:0)));}else c=[r];l.push(c), u=d+h, f=g;}else c.push(r), u+=f+d, f=g;}if(h)var v=function(t,e){return(e?m:"")+t.join(" ")};else v=function(t){return t.join(" ")};return l.map(v)}, B.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),o=function(t){var e={0:1},n={};if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var r=this.internal.getFont(t.fontName,t.fontStyle),i="Unicode";return r.metadata[i]?{widths:r.metadata[i].widths||e,kerning:r.metadata[i].kerning||n}:{font:r.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(t)?t:t.split(/\r?\n/);var a=1*this.internal.scaleFactor*e/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0, o.lineIndent=n.lineIndent;var s,h,c=[];for(s=0, h=r.length;s<h;s++)c=c.concat(U.apply(this,[r[s],a,o]));return c}, N=$.API, L={codePages:["WinAnsiEncoding"],WinAnsiEncoding:(z=function(t){for(var e="klmnopqrstuvwxyz",n={},r=0;r<e.length;r++)n[e[r]]="0123456789abcdef"[r];var i,o,a,s,h,c={},l=1,u=c,f=[],d="",p="",g=t.length-1;for(r=1;r!=g;)h=t[r], r+=1, "'"==h?o?(s=o.join(""), o=i):o=[]:o?o.push(h):"{"==h?(f.push([u,s]), u={}, s=i):"}"==h?((a=f.pop())[0][a[1]]=u, s=i, u=a[0]):"-"==h?l=-1:s===i?n.hasOwnProperty(h)?(d+=n[h], s=parseInt(d,16)*l, l=1, d=""):d+=h:n.hasOwnProperty(h)?(p+=n[h], u[s]=parseInt(p,16)*l, l=1, s=i, p=""):p+=h;return c})("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")}, H={Unicode:{Courier:L,"Courier-Bold":L,"Courier-BoldOblique":L,"Courier-Oblique":L,Helvetica:L,"Helvetica-Bold":L,"Helvetica-BoldOblique":L,"Helvetica-Oblique":L,"Times-Roman":L,"Times-Bold":L,"Times-BoldItalic":L,"Times-Italic":L}
6175/** 
6176    Resources:
6177    Font metrics data is reprocessed derivative of contents of
6178    "Font Metrics for PDF Core 14 Fonts" package, which exhibits the following copyright and license:
6179    
6180    Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
6181    
6182    This file and the 14 PostScript(R) AFM files it accompanies may be used,
6183    copied, and distributed for any purpose and without charge, with or without
6184    modification, provided that all copyright notices are retained; that the AFM
6185    files are not distributed without this file; that all modifications to this
6186    file or any of the AFM files are prominently noted in the modified file(s);
6187    and that this paragraph is not modified. Adobe Systems has no responsibility
6188    or obligation to support the use of the AFM files.
6189    
6190    */}, W={Unicode:{"Courier-Oblique":z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":z("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":z("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
6190dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":z("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:z("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:z("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
6190dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":z("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
6190dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:z("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":z("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}
6190fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":z("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":z("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
6190dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}}, N.events.push(["addFont",function(t){var e,n,r,i="Unicode";(e=W[i][t.postScriptName])&&((n=t.metadata[i]?t.metadata[i]:t.metadata[i]={}).widths=e.widths, n.kerning=e.kerning), (r=H[i][t.postScriptName])&&((n=t.metadata[i]?t.metadata[i]:t.metadata[i]={}).encoding=r).codePages&&r.codePages.length&&(t.encoding=r.codePages[0]);}]), G=$, "undefined"!=typeof self&&self||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||"undefined"!=typeof window&&window||Function("return this")(), G.API.events.push(["addFont",function(t){G.API.existsFileInVFS(t.postScriptName)?(t.metadata=G.API.TTFFont.open(t.postScriptName,t.fontName,G.API.getFileFromVFS(t.postScriptName),t.encoding), t.metadata.Unicode=t.metadata.Unicode||{encoding:{},kerning:{},widths:[]}):14<t.id.slice(1)&&console.error("Font does not exist in FileInVFS, import fonts or remove declaration doc.addFont('"+t.postScriptName+"').");}]), (
6191/** @preserve
6192  jsPDF SVG plugin
6193  Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
6194  */
6195V=$.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function o(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,o=t.length;i<o;)"c"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2]),parseFloat(t[i+3]),parseFloat(t[i+4]),parseFloat(t[i+5]),parseFloat(t[i+6])]), i+=7):"l"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2])]), i+=3):i+=1;return[e,n,r]}var a,s,h,c,l,u,f,d,p=(c=document, d=c.createElement("iframe"), l=".jsPDF_sillysvg_iframe {display:none;position:absolute;}", (f=(u=c).createElement("style")).type="text/css", f.styleSheet?f.styleSheet.cssText=l:f.appendChild(u.createTextNode(l)), u.getElementsByTagName("head")[0].appendChild(f), d.name="childframe", d.setAttribute("width",0), d.setAttribute("height",0), d.setAttribute("frameborder","0"), d.setAttribute("scrolling","no"), d.setAttribute("seamless","seamless"), d.setAttribute("class","jsPDF_sillysvg_iframe"), c.body.appendChild(d), d),g=(a=t, (h=((s=p).contentWindow||s.contentDocument).document).write(a), h.close(), h.getElementsByTagName("svg")[0]),m=[1,1],w=parseFloat(g.getAttribute("width")),y=parseFloat(g.getAttribute("height"));w&&y&&(r&&i?m=[r/w,i/y]:r?m=[r/w,r/w]:i&&(m=[i/y,i/y]));var v,b,x,S,k=g.childNodes;for(v=0, b=k.length;v<b;v++)(x=k[v]).tagName&&"PATH"===x.tagName.toUpperCase()&&((S=o(x.getAttribute("d").split(" ")))[0]=S[0]*m[0]+e, S[1]=S[1]*m[1]+n, this.lines.call(this,S[2],S[0],S[1],m));return this}, V.addSVG=V.addSvg, V.addSvgAsImage=function(t,e,n,r,i,o,a,s){if
6195(isNaN(e)||isNaN(n))throw console.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addSvgAsImage: Invalid measurements",arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=r, h.height=i;var c=h.getContext("2d");return c.fillStyle="#fff", c.fillRect(0,0,h.width,h.height), canvg(h,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0}), this.addImage(h.toDataURL("image/jpeg",1),e,n,r,i,a,s), this}, $.API.putTotalPages=function(t){for(var e=new RegExp(t,"g"),n=1;n<=this.internal.getNumberOfPages();n++)for(var r=0;r<this.internal.pages[n].length;r++)this.internal.pages[n][r]=this.internal.pages[n][r].replace(e,this.internal.getNumberOfPages());return this}, $.API.viewerPreferences=function(t,e){var n;t=t||{}, e=e||!1;var r,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),s=[],h=0,c=0,l=0,u=!0;function f(t,e){var n,r=!1;for(n=0;n<t.length;n+=1)t[n]===e&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={}, this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)), this.internal.viewerpreferences.isSubscribed=!1), n=this.internal.viewerpreferences.configuration, "reset"===t||!0===e){var d=a.length;for(l=0;l<d;l+=1)n[a[l]].value=n[a[l]].defaultValue, n[a[l]].explicitSet=!1;}if("object"===(void 0===t?"undefined":vt(t)))for(r in t)if(i=t[r], f(a,r)&&void 0!==i){if("boolean"===n[r].type&&"boolean"==typeof i)n[r].value=i;else if("name"===n[r].type&&f(n[r].valueSet,i))n[r].value=i;else if("integer"===n[r].type&&Number.isInteger(i))n[r].value=i;else if("array"===n[r].type){for(h=0;h<i.length;h+=1)if(u=!0, 1===i[h].length&&"number"==typeof i[h][0])s.push(String(i[h]));else if(1<i[h].length){for(c=0;c<i[h].length;c+=1)"number"!=typeof i[h][c]&&(u=!1);!0===u&&s.push(String(i[h].join("-")));}n[r].value=String(s);}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0;}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");}), this.internal.viewerpreferences.isSubscribed=!0), this.internal.viewerpreferences.configuration=n, this}, Y=$.API, K=J=X="", Y.addMetadata=function(t,e){return J=e||"http://jspdf.default.namespaceuri/", X=t, this.internal.events.subscribe("postPutResources",function(){if(X){var t='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+J+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(X)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),o=unescape(encodeURIComponent("</x:xmpmeta>")),a=n.length+r.length+i.length+e.length+o.length;K=this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"), this.internal.write("stream"), this.internal.write(e+n+r+i+o), this.internal.write("endstream"), this.internal.write("endobj");}else K="";}), this.internal.events.subscribe("putCatalog",function(){K&&this.internal.write("/Metadata "+K+" 0 R");}), this}, function(l,t){var e=l.API,m=[0];e.events.push(["putFont",function(t){!function(t,e,n){if(t.metadata instanceof l.API.TTFFont&&"Identity-H"===t.encoding){for(var r=t.metadata.Unicode.widths,i=t.metadata.subset.encode(m),o="",a=0;a<i.length;a++)o+=String.fromCharCode(i[a]);var s=n();e("<<"), e("/Length "+o.length), e("/Length1 "+o.length), e(">>"), e("stream"), e(o), e("endstream"), e("endobj");var h=n();e("<<"), e("/Type /FontDescriptor"), e("/FontName /"+t.fontName), e("/FontFile2 "+s+" 0 R"), e("/FontBBox "+l.API.PDFObject.convert(t.metadata.bbox)), e("/Flags "+t.metadata.flags), e("/StemV "+t.metadata.stemV), e("/ItalicAngle "+t.metadata.italicAngle), e("/Asce
6195nt "+t.metadata.ascender), e("/Descent "+t.metadata.decender), e("/CapHeight "+t.metadata.capHeight), e(">>"), e("endobj");var c=n();e("<<"), e("/Type /Font"), e("/BaseFont /"+t.fontName), e("/FontDescriptor "+h+" 0 R"), e("/W "+l.API.PDFObject.convert(r)), e("/CIDToGIDMap /Identity"), e("/DW 1000"), e("/Subtype /CIDFontType2"), e("/CIDSystemInfo"), e("<<"), e("/Supplement 0"), e("/Registry (Adobe)"), e("/Ordering ("+t.encoding+")"), e(">>"), e(">>"), e("endobj"), t.objectNumber=n(), e("<<"), e("/Type /Font"), e("/Subtype /Type0"), e("/BaseFont /"+t.fontName), e("/Encoding /"+t.encoding), e("/DescendantFonts ["+c+" 0 R]"), e(">>"), e("endobj"), t.isAlreadyPutted=!0;}}(t.font,t.out,t.newObject);}]);e.events.push(["putFont",function(t){!function(t,e,n){if(t.metadata instanceof l.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var r=t.metadata.rawData,i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);var a=n();e("<<"), e("/Length "+i.length), e("/Length1 "+i.length), e(">>"), e("stream"), e(i), e("endstream"), e("endobj");var s=n();for(e("<<"), e("/Descent "+t.metadata.decender), e("/CapHeight "+t.metadata.capHeight), e("/StemV "+t.metadata.stemV), e("/Type /FontDescriptor"), e("/FontFile2 "+a+" 0 R"), e("/Flags 96"), e("/FontBBox "+l.API.PDFObject.convert(t.metadata.bbox)), e("/FontName /"+t.fontName), e("/ItalicAngle "+t.metadata.italicAngle), e("/Ascent "+t.metadata.ascender), e(">>"), e("endobj"), t.objectNumber=n(), o=0;o<t.metadata.hmtx.widths.length;o++)t.metadata.hmtx.widths[o]=parseInt(t.metadata.hmtx.widths[o]*(1e3/t.metadata.head.unitsPerEm));e("<</Subtype/TrueType/Type/Font/BaseFont/"+t.fontName+"/FontDescriptor "+s+" 0 R/Encoding/"+t.encoding+" /FirstChar 29 /LastChar 255 /Widths "+l.API.PDFObject.convert(t.metadata.hmtx.widths)+">>"), e("endobj"), t.isAlreadyPutted=!0;}}(t.font,t.out,t.newObject);}]);var c=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},h=s.pdfEscape,c=s.activeFontKey,l=s.fonts,u=(s.activeFontSize, ""),f=0,d="",p=l[n=c].encoding;if("Identity-H"!==l[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(d=r, n=c, "[object Array]"===Object.prototype.toString.call(r)&&(d=r[0]), f=0;f<d.length;f+=1)l[n].metadata.hasOwnProperty("cmap")&&(e=l[n].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]), e?u+=d[f]:d[f].charCodeAt(0)<256&&l[n].metadata.hasOwnProperty("Unicode")?u+=d[f]:u+="";var g="";return parseInt(n.slice(1))<14||"WinAnsiEncoding"===p?g=function(t){for(var e="",n=0;n<t.length;n++)e+=""+t.charCodeAt(n).toString(16);return e}(h(u,n)):"Identity-H"===p&&(g=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<s;++a){if(n=e.metadata.characterToGlyph(t.charCodeAt(a)), m.push(n), -1==r.indexOf(n)&&(r.push(n), r.push([parseInt(e.metadata.widthOfGlyph(n),10)])), "0"==n)return o.join("");n=n.toString(16), o.push(i[4-n.length],n);}return o.join("")}(u,l[n])), s.isHex=!0, {text:g,x:i,y:o,options:a,mutex:s}};e.events.push(["postProcessText",function(t){var e=t.text||"",n=t.x,r=t.y,i=t.options,o=t.mutex,a=(i.lang, []),s={text:e,x:n,y:r,options:i,mutex:o};if("[object Array]"===Object.prototype.toString.call(e)){var h=0;for(h=0;h<e.length;h+=1)"[object Array]"===Object.prototype.toString.call(e[h])&&3===e[h].length?a.push([c(Object.assign({},s,{text:e[h][0]})).text,e[h][1],e[h][2]]):a.push(c(Object.assign({},s,{text:e[h]})).text);t.text=a;}else t.text=c(Object.assign({},s,{text:e})).text;}]);}($,"undefined"!=typeof self&&self||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||"undefined"!=typeof window&&window||Function("return this")()), Q=$.API, Z={}, Q.existsFileInVFS=function(t){return Z.hasOwnProperty(t)}, Q.addFileToVFS=function(t,e){return Z[t]=e, this}, Q.getFileFromVFS=function(t){return Z.hasOwnProperty(t)?Z[t]:null}, function(t){if(t.URL=t.URL||t.webkitURL, t.Blob&&t.URL)try{return new Blob}catch(t){}var s=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var s=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},e=function(){this.data=[];},h=function(t,e,n){this.data=t, this.size=t.length, this.type=e, this.encoding=n;},n=e.prototype,r=h.prototype,c=t.FileReaderSync,l=function(t){this.co
6195de=this[this.name=t];},i="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),o=i.length,a=t.URL||t.webkitURL||t,u=a.createObjectURL,f=a.revokeObjectURL,d=a,p=t.btoa,g=t.atob,m=t.ArrayBuffer,w=t.Uint8Array,y=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(h.fake=r.fake=!0;o--;)l.prototype[i[o]]=o+1;return a.createObjectURL||(d=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t, "origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(y), n.origin=e&&e[1])), n}), d.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"), t instanceof h?(e="data:"+n, "base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):p?e+";base64,"+p(t.data):e+","+encodeURIComponent(t.data)):u?u.call(a,t):void 0}, d.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&f&&f.call(a,t);}, n.append=function(t){var e=this.data;if(w&&(t instanceof m||t instanceof w)){for(var n="",r=new w(t),i=0,o=r.length;i<o;i++)n+=String.fromCharCode(r[i]);e.push(n);}else if("Blob"===s(t)||"File"===s(t)){if(!c)throw new l("NOT_READABLE_ERR");var a=new c;e.push(a.readAsBinaryString(t));}else t instanceof h?"base64"===t.encoding&&g?e.push(g(t.data)):"URI"===t.encoding?e.push(decodeURIComponent(t.data)):"raw"===t.encoding&&e.push(t.data):("string"!=typeof t&&(t+=""), e.push(unescape(encodeURIComponent(t))));}, n.getBlob=function(t){return arguments.length||(t=null), new h(this.data.join(""),t,"raw")}, n.toString=function(){return"[object BlobBuilder]"}, r.slice=function(t,e,n){var r=arguments.length;return r<3&&(n=null), new h(this.data.slice(t,1<r?e:this.data.length),n,this.encoding)}, r.toString=function(){return"[object Blob]"}, r.close=function(){this.size=0, delete this.data;}, e}(t);t.Blob=function(t,e){var n=e&&e.type||"",r=new s;if(t)for(var i=0,o=t.length;i<o;i++)Uint8Array&&t[i]instanceof Uint8Array?r.append(t[i].buffer):r.append(t[i]);var a=r.getBlob(n);return!a.slice&&a.webkitSlice&&(a.slice=a.webkitSlice), a};var e=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=e(new t.Blob);}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||window.content||window);var tt,et,nt,rt,it,ot,at,st,ht,ct,lt,ut,ft,dt,pt,gt,bt=bt||function(s){if(!(void 0===s||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=s.document,h=function(){return s.URL||s.webkitURL||s},c=t.createElementNS("http://www.w3.org/1999/xhtml","a"),l="download"in c,u=/constructor/i.test(s.HTMLElement)||s.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),d=function(t){(s.setImmediate||s.setTimeout)(function(){throw t},0);},p=function(t){setTimeout(function(){"string"==typeof t?h().revokeObjectURL(t):t.remove();},4e4);},g=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},r=function(t,n,e){e||(t=g(t));var r,i=this,o="application/octet-stream"===t.type,a=function(){!function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t);}catch(t){d(t);}}}(i,"writestart progress write writeend".split(" "));};if(i.readyState=i.INIT, l)return r=h().createObjectURL(t), void setTimeout(function(){var t,e;c.href=r, c.download=n, t=c, e=new MouseEvent("click"), t.dispatchEvent(e), a(), p(r), i.readyState=i.DONE;});!function(){if((f||o&&u)&&s.FileReader){var e=new FileReader;return e.onloadend=function(){var t=f?e.result:e.result.replace(/^data:[^;]*;/,"data:attachment/file;");s.open(t,"_blank")||(s.location.href=t), t=void 0, i.readyState=i.DONE, a();}, e.readAsDataURL(t), i.readyState=i.INIT}r||(r=h().createObjectURL(t)), o?s.location.href=r:s.open(r,"_blank")||(s.location.href=r);i.readyState=i.DONE, a(), p(r);}();},e=r.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download", n||(t=g(t)), navigator.msSaveOrOpenBlob(t,e)}:(e.abort=function(){}, e.readyState=e.INIT=0, e.WRITING=1, e.DONE=2, e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null, function(t,e,n){return new r(t,e||t.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||window.content);function mt(x){var t=0;if(71!==x[t++]||73!==x[t++]||70!==x[t++]||56!==x[t++]||56!=(x[t++]+1&253)||97!==x[t++])throw"Invalid GIF 87a/89a header.";var S=x[t++]|x[t++]<<8,e=x[t++]|x[t++]<<8,n=x[t++],r=n>>7,i=1<<(7&n)+1;x[t++];x[t++];var o=null;r&&(o=t, t+=3*i);var a=!0,s=[],h=0,c=null,l=0,u=null;for(this.width=S, this.height=e;a&&t<x.length;)switch(x[t++]){case 33:switch(x[t++]){case 255:if(11!==x[t]||78==x[t+1]&&69==x[t+2]&&84==x[t+3]&&83==x[t+4]&&67==x[t+5]&&65==x[t+6]&&80==x[t+7]&&69==x[t+8]&&50==x[t+9]&&46==x[t+10]&&48==x[t+11]&&3==x[t+12]&&1==x[t+13]&&0==x[t+16]
6195)t+=14, u=x[t++]|x[t++]<<8, t++;else for(t+=12;;){if(0===(_=x[t++]))break;t+=_;}break;case 249:if(4!==x[t++]||0!==x[t+4])throw"Invalid graphics extension block.";var f=x[t++];h=x[t++]|x[t++]<<8, c=x[t++], 0==(1&f)&&(c=null), l=f>>2&7, t++;break;case 254:for(;;){if(0===(_=x[t++]))break;t+=_;}break;default:throw"Unknown graphic control label: 0x"+x[t-1].toString(16)}break;case 44:var d=x[t++]|x[t++]<<8,p=x[t++]|x[t++]<<8,g=x[t++]|x[t++]<<8,m=x[t++]|x[t++]<<8,w=x[t++],y=w>>6&1,v=o,b=!1;if(w>>7){b=!0;v=t, t+=3*(1<<(7&w)+1);}var k=t;for(t++;;){var _;if(0===(_=x[t++]))break;t+=_;}s.push({x:d,y:p,width:g,height:m,has_local_palette:b,palette_offset:v,data_offset:k,data_length:t-k,transparent_index:c,interlaced:!!y,delay:h,disposal:l});break;case 59:a=!1;break;default:throw"Unknown gif block: 0x"+x[t-1].toString(16)}this.numFrames=function(){return s.length}, this.loopCount=function(){return u}, this.frameInfo=function(t){if(t<0||t>=s.length)throw"Frame index out of range.";return s[t]}, this.decodeAndBlitFrameBGRA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);wt(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,h=S-s,c=s,l=4*(n.y*S+n.x),u=4*((n.y+n.height)*S+n.x),f=l,d=4*h;!0===n.interlaced&&(d+=4*(s+h)*7);for(var p=8,g=0,m=i.length;g<m;++g){var w=i[g];if(0===c&&(c=s, u<=(f+=d)&&(d=h+4*(s+h)*(p-1), f=l+(s+h)*(p<<1), p>>=1)), w===a)f+=4;else{var y=x[o+3*w],v=x[o+3*w+1],b=x[o+3*w+2];e[f++]=b, e[f++]=v, e[f++]=y, e[f++]=255;}--c;}}, this.decodeAndBlitFrameRGBA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);wt(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,h=S-s,c=s,l=4*(n.y*S+n.x),u=4*((n.y+n.height)*S+n.x),f=l,d=4*h;!0===n.interlaced&&(d+=4*(s+h)*7);for(var p=8,g=0,m=i.length;g<m;++g){var w=i[g];if(0===c&&(c=s, u<=(f+=d)&&(d=h+4*(s+h)*(p-1), f=l+(s+h)*(p<<1), p>>=1)), w===a)f+=4;else{var y=x[o+3*w],v=x[o+3*w+1],b=x[o+3*w+2];e[f++]=y, e[f++]=v, e[f++]=b, e[f++]=255;}--c;}};}function wt(t,e,n,r){for(var i=t[e++],o=1<<i,a=o+1,s=a+1,h=i+1,c=(1<<h)-1,l=0,u=0,f=0,d=t[e++],p=new Int32Array(4096),g=null;;){for(;l<16&&0!==d;)u|=t[e++]<<l, l+=8, 1===d?d=t[e++]:--d;if(l<h)break;var m=u&c;if(u>>=h, l-=h, m!==o){if(m===a)break;for(var w=m<s?m:g,y=0,v=w;o<v;)v=p[v]>>8, ++y;var b=v;if(r<f+y+(w!==m?1:0))return void console.log("Warning, gif stream longer than expected.");n[f++]=b;var x=f+=y;for(w!==m&&(n[f++]=b), v=w;y--;)v=p[v], n[--x]=255&v, v>>=8;null!==g&&s<4096&&(p[s++]=g<<8|b, c+1<=s&&h<12&&(++h, c=c<<1|1)), g=m;}else s=a+1, c=(1<<(h=i+1))-1, g=null;}return f!==r&&console.log("Warning, gif stream shorter than expected."), n}"undefined"!='object'&&module.exports?module.exports.saveAs=bt:"undefined"!=typeof undefined&&null!==undefined&&null!==undefined.amd&&undefined("FileSaver.js",function(){return bt}), $.API.adler32cs=(ot="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array, at=null, st=function(){if(!ot)return function(){return!1};try{var t={};"function"==typeof t.Buffer&&(at=t.Buffer);}catch(t){}return function(t){return t instanceof ArrayBuffer||null!==at&&t instanceof at}}(), ht=null!==at?function(t){return new at(t,"utf8").toString("binary")}:function(t){return unescape(encodeURIComponent(t))}, ct=65521, lt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+(255&e.charCodeAt(i)))%ct, r=(r+n)%ct;return(r<<16|n)>>>0}, ut=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+e[i])%ct, r=(r+n)%ct;return(r<<16|n)>>>0}, dt=(ft={}).Adler32=(((it=(rt=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0;}).prototype={}).constructor=rt).from=((tt=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=lt(1,t.toString());}).prototype=it, tt), rt.fromUtf8=((et=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");
6195if(null==t)throw new Error("First argument needs to be a string.");var e=ht(t.toString());this.checksum=lt(1,e);}).prototype=it, et), ot&&(rt.fromBuffer=((nt=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");if(!st(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=ut(1,e)}).prototype=it, nt)), it.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(), this.checksum=lt(this.checksum,t)}, it.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=ht(t.toString());return this.checksum=lt(this.checksum,e)}, ot&&(it.updateBuffer=function(t){if(!st(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=ut(this.checksum,e)}), it.clone=function(){return new dt(this.checksum)}, rt), ft.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return lt(1,t.toString())}, ft.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=ht(t.toString());return lt(1,e)}, ot&&(ft.fromBuffer=function(t){if(!st(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return ut(1,e)}), ft);try{exports.GifWriter=function(w,t,e,n){var y=0,r=void 0===(n=void 0===n?{}:n).loop?null:n.loop,v=void 0===n.palette?null:n.palette;if(t<=0||e<=0||65535<t||65535<e)throw"Width/Height invalid.";function b(t){var e=t.length;if(e<2||256<e||e&e-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return e}w[y++]=71, w[y++]=73, w[y++]=70, w[y++]=56, w[y++]=57, w[y++]=97;var i=0,o=0;if(null!==v){for(var a=b(v);a>>=1;)++i;if(a=1<<i, --i, void 0!==n.background){if(a<=(o=n.background))throw"Background index out of range.";if(0===o)throw"Background index explicitly passed as 0."}}if(w[y++]=255&t, w[y++]=t>>8&255, w[y++]=255&e, w[y++]=e>>8&255, w[y++]=(null!==v?128:0)|i, w[y++]=o, w[y++]=0, null!==v)for(var s=0,h=v.length;s<h;++s){var c=v[s];w[y++]=c>>16&255, w[y++]=c>>8&255, w[y++]=255&c;}if(null!==r){if(r<0||65535<r)throw"Loop count invalid.";w[y++]=33, w[y++]=255, w[y++]=11, w[y++]=78, w[y++]=69, w[y++]=84, w[y++]=83, w[y++]=67, w[y++]=65, w[y++]=80, w[y++]=69, w[y++]=50, w[y++]=46, w[y++]=48, w[y++]=3, w[y++]=1, w[y++]=255&r, w[y++]=r>>8&255, w[y++]=0;}var x=!1;this.addFrame=function(t,e,n,r,i,o){if(!0===x&&(--y, x=!1), o=void 0===o?{}
6195:o, t<0||e<0||65535<t||65535<e)throw"x/y invalid.";if(n<=0||r<=0||65535<n||65535<r)throw"Width/Height invalid.";if(i.length<n*r)throw"Not enough pixels for the frame size.";var a=!0,s=o.palette;if(null==s&&(a=!1, s=v), null==s)throw"Must supply either a local or global palette.";for(var h=b(s),c=0;h>>=1;)++c;h=1<<c;var l=void 0===o.delay?0:o.delay,u=void 0===o.disposal?0:o.disposal;if(u<0||3<u)throw"Disposal out of range.";var f=!1,d=0;if(void 0!==o.transparent&&null!==o.transparent&&(f=!0, (d=o.transparent)<0||h<=d))throw"Transparent color index.";if((0!==u||f||0!==l)&&(w[y++]=33, w[y++]=249, w[y++]=4, w[y++]=u<<2|(!0===f?1:0), w[y++]=255&l, w[y++]=l>>8&255, w[y++]=d, w[y++]=0), w[y++]=44, w[y++]=255&t, w[y++]=t>>8&255, w[y++]=255&e, w[y++]=e>>8&255, w[y++]=255&n, w[y++]=n>>8&255, w[y++]=255&r, w[y++]=r>>8&255, w[y++]=!0===a?128|c-1:0, !0===a)for(var p=0,g=s.length;p<g;++p){var m=s[p];w[y++]=m>>16&255, w[y++]=m>>8&255, w[y++]=255&m;}y=function(e,n,t,r){e[n++]=t;var i=n++,o=1<<t,a=o-1,s=o+1,h=s+1,c=t+1,l=0,u=0;function f(t){for(;t<=l;)e[n++]=255&u, u>>=8, l-=8, n===i+256&&(e[i]=255, i=n++);}function d(t){u|=t<<l, l+=c, f(8);}var p=r[0]&a,g={};d(o);for(var m=1,w=r.length;m<w;++m){var y=r[m]&a,v=p<<8|y,b=g[v];if(void 0===b){for(u|=p<<l, l+=c;8<=l;)e[n++]=255&u, u>>=8, l-=8, n===i+256&&(e[i]=255, i=n++);4096===h?(d(o), h=s+1, c=t+1, g={}):(1<<c<=h&&++c, g[v]=h++), p=y;}else p=b;}return d(p), d(s), f(1), i+1===n?e[i]=0:(e[i]=n-i-1, e[n++]=0), n}(w,y,c<2?2:c,i);}, this.end=function(){return!1===x&&(w[y++]=59, x=!0), y};}, exports.GifReader=mt;}catch(t){}
6196/*
6197    Copyright (c) 2008, Adobe Systems Incorporated
6198    All rights reserved.
6199
6200    Redistribution and use in source and binary forms, with or without 
6201    modification, are permitted provided that the following conditions are
6202    met:
6203
6204    * Redistributions of source code must retain the above copyright notice, 
6205      this list of conditions and the following disclaimer.
6206    
6207    * Redistributions in binary form must reproduce the above copyright
6208      notice, this list of conditions and the following disclaimer in the 
6209      documentation and/or other materials provided with the distribution.
6210    
6211    * Neither the name of Adobe Systems Incorporated nor the names of its 
6212      contributors may be used to endorse or promote products derived from 
6213      this software without specific prior written permission.
6214
6215    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
6216    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
6217    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
6218    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
6219    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
6220    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
6221    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
6222    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
6223    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
6224    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
6225    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6226  */function yt(t){var S,k,_,A,e,u=Math.floor,I=new Array(64),C=new Array(64),T=new Array(64),F=new Array(64),w=new Array(65535),y=new Array(65535),Q=new Array(64),v=new Array(64),P=[],E=0,q=7,O=new Array(64),B=new Array(64),R=new Array(64),n=new Array(256),j=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],D=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],N=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],z=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[], i[e[r]][0]=n, i[e[r]][1]=o, r++, n++;n*=2;}return i}function G(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(E|=1<<q), n--, --q<0&&(255==E?(V(255), V(0)):V(E), q=7, E=0);}function V(t){P.push(t);}function Y(t){V(t>>8&255), V(255&t);}function X(t,e,n,r,i){for(var o,a=i[0],s=i[240],h=function(t,e){var n,r,i,o,a,s,h,c,l,u,f=0;for(l=0;l<8;++l){n=t[f], r=t[f+1], i=t[f+2], o=t[f+3], a=t[f+4], s=t[f+5], h=t[f+6];var d=n+(c=t[f+7]),p=n-c,g=r+h,m=r-h,w=i+s,y=i-s,v=o+a,b=o-a,x=d+v,S=d-v,k=g+w,_=g-w;t[f]=x+k, t[f+4]=x-k;var A=.707106781*(_+S);t[f+2]=S+A, t[f+6]=S-A;var I=.382683433*((x=b+y)-(_=m+p)),C=.5411961*x+I,T=1.306562965*_+I,F=.707106781*(k=y+m),P=p+F,E=p-F;t[f+5]=E+C, t[f+3]=E-C, t[f+1]=P+T, t[f+7]=P-T, f+=8;}for(l=f=0;l<8;++l){n=t[f], r=t[f+8], i=t[f+16], o=t[f+24], a=t[f+32], s=t[f+40], h=t[f+48];var q=n+(c=t[f+56]),O=n-c,B=r+h,R=r-h,j=i+s,D=i-s,M=o+a,U=o-a,N=q+M,z=q-M,L=B+j,H=B-j;t[f]=N+L, t[f+32]=N-L;var W=.707106781*(H+z);t[f+16]=z+W, t[f+48]=z-W;var G=.382683433*((N=U+D)-(H=R+O)),V=.5411961*N+G,Y=1.306562965*H+G,X=.707106781*(L=D+R),J=O+X,K=O-X;t[f+40]=K+V, t[f+24]=K-V, t[f+8]=J+Y, t[f+56]=J-Y, f++;}for(l=0;l<64;++l)u=t[l]*e[l], Q[l]=0<u?u+.5|0:u-.5|0;return Q}(t,e),c=0;c<64;++c)v[b[c]]=h[c];var l=v[0]-n;n=v[0], 0==l?G(r[0]):(G(r[y[o=32767+l]]), G(w[o]));for(var u=63;0<u&&0==v[u];u--);if(0==u)return G(a), n;for(var f,d=1;d<=u;){for(var p=d;0==v[d]&&d<=u;++d);var g=d-p;if(16<=g){f=g>>4;
6226for(var m=1;m<=f;++m)G(s);g&=15;}o=32767+v[d], G(i[(g<<4)+y[o]]), G(w[o]), d++;}return 63!=u&&G(a), n}function J(t){if(t<=0&&(t=1), 100<t&&(t=100), e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=u((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255), I[b[n]]=r;}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=u((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255), C[b[o]]=a;}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],h=0,c=0;c<8;c++)for(var l=0;l<8;l++)T[h]=1/(I[b[h]]*s[c]*s[l]*8), F[h]=1/(C[b[h]]*s[c]*s[l]*8), h++;})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)), e=t;}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&J(e), P=new Array, E=0, q=7, Y(65496), Y(65504), Y(16), V(74), V(70), V(73), V(70), V(0), V(1), V(1), V(0), Y(1), Y(1), V(0), V(0), function(){Y(65499), Y(132), V(0);for(var t=0;t<64;t++)V(I[t]);V(1);for(var e=0;e<64;e++)V(C[e]);}(), n=t.width, r=t.height, Y(65472), Y(17), V(8), Y(r), Y(n), V(3), V(1), V(17), V(0), V(2), V(17), V(1), V(3), V(17), V(1), function(){Y(65476), Y(418), V(0);for(var t=0;t<16;t++)V(D[t+1]);for(var e=0;e<=11;e++)V(M[e]);V(16);for(var n=0;n<16;n++)V(U[n+1]);for(var r=0;r<=161;r++)V(N[r]);V(1);for(var i=0;i<16;i++)V(z[i+1]);for(var o=0;o<=11;o++)V(L[o]);V(17);for(var a=0;a<16;a++)V(H[a+1]);for(var s=0;s<=161;s++)V(W[s]);}(), Y(65498), Y(12), V(3), V(1), V(0), V(2), V(17), V(3), V(17), V(0), V(63), V(0);var i=0,o=0,a=0;E=0, q=7, this.encode.displayName="_encode_";for(var s,h,c,l,u,f,d,p,g,m=t.data,w=t.width,y=t.height,v=4*w,b=0;b<y;){for(s=0;s<v;){for(f=u=v*b+s, d=-1, g=p=0;g<64;g++)f=u+(p=g>>3)*v+(d=4*(7&g)), y<=b+p&&(f-=v*(b+1+p-y)), v<=s+d&&(f-=s+d-v+4), h=m[f++], c=m[f++], l=m[f++], O[g]=(j[h]+j[c+256>>0]+j[l+512>>0]>>16)-128, B[g]=(j[h+768>>0]+j[c+1024>>0]+j[l+1280>>0]>>16)-128, R[g]=(j[h+1280>>0]+j[c+1536>>0]+j[l+1792>>0]>>16)-128;i=X(O,T,i,S,_), o=X(B,F,o,k,A), a=X(R,F,a,k,A), s+=32;}b+=8;}if(0<=q){var x=[];x[1]=q+1, x[0]=(1<<q+1)-1, G(x);}return Y(65497), new Uint8Array(P)}, function(){(new Date).getTime();t||(t=50), function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e);}(), S=r(D,M), k=r(z,L), _=r(U,N), A=r(H,W), function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)y[32767+r]=n, w[32767+r]=[], w[32767+r][1]=n, w[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)y[32767+i]=n, w[32767+i]=[], w[32767+i][1]=n, w[32767+i][0]=e-1+i;t<<=1, e<<=1;}}(), function(){for(var t=0;t<256;t++)j[t]=19595*t, j[t+256>>0]=38470*t, j[t+512>>0]=7471*t+32768, j[t+768>>0]=-11059*t, j[t+1024>>0]=-21709*t, j[t+1280>>0]=32768*t+8421375, j[t+1536>>0]=-27439*t, j[t+1792>>0]=-5329*t;}(), J(t), (new Date).getTime();}();}try{module.exports=yt;}catch(t){}function xt(t,e){if(this.pos=0, this.buffer=t, this.datav=new DataView(t.buffer), this.is_with_alpha=!!e, this.bottom_up=!0, this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]), this.pos+=2, -1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(), this.parseBGR();}xt.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0), this.pos+=4, this.reserved=this.datav.getUint32(this.pos,!0), this.pos+=4, this.offset=this.datav.getUint32(this.pos,!0), this.pos+=4, this.headerSize=this.datav.getUint32(this.pos,!0), this.pos+=4, this.width=this.datav.getUint32(this.pos,!0), this.pos+=4, this.height=this.datav.getInt32(this.pos,!0), this.pos+=4, this.planes=this.datav.getUint16(this.pos,!0), this.pos+=2, this.bitPP=this.datav.getUint16(this.pos,!0), this.pos+=2, this.compress=this.datav.getUint32(this.pos,!0), this.pos+=4, this.rawSize=this.datav.getUint32(this.pos,!0), this.pos+=4, this.hr=this.datav.getUint32(this.pos,!0), this.pos+=4, this.vr=this.datav.getUint32(this.pos,!0), this.pos+=4, this.colors=this.datav.getUint32(this.pos,!0), this.pos+=4, this.importantColors=this.datav.getUint32(this.pos,!0), this.pos+=4, 16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15), this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:o};}}this.height<0&&(this.height*=-1, this.bottom_up=!1);}, xt.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e), this[t]();}catch(t){console.log("bit decode error:"+t);}}, xt.prototype.bit1=function(){var t=Math.ceil(this.width/8),e=t%4,n=0<=this.height?this.height-1:-this.height;for(n=this.height-1;0<=n;
vendor: 5,338 bytes, lines 6226-6271
6226n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var h=this.palette[o>>7-s&1];this.data[a+4*s]=h.blue, this.data[a+4*s+1]=h.green, this.data[a+4*s+2]=h.red, this.data[a+4*s+3]=255;}0!=e&&(this.pos+=4-e);}}, xt.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,s=o>>4,h=15&o,c=this.palette[s];if(this.data[a]=c.blue, this.data[a+1]=c.green, this.data[a+2]=c.red, this.data[a+3]=255, 2*i+1>=this.width)break;c=this.palette[h], this.data[a+4]=c.blue, this.data[a+4+1]=c.green, this.data[a+4+2]=c.red, this.data[a+4+3]=255;}0!=e&&(this.pos+=4-e);}}, xt.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;0<=e;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[o]=a.red, this.data[o+1]=a.green, this.data[o+2]=a.blue, this.data[o+3]=255;}else this.data[o]=255, this.data[o+1]=255, this.data[o+2]=255, this.data[o+3]=255;}0!=t&&(this.pos+=4-t);}}, xt.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&e)/e*255|0,s=(o>>5&e)/e*255|0,h=(o>>10&e)/e*255|0,c=o>>15?255:0,l=r*this.width*4+4*i;this.data[l]=h, this.data[l+1]=s, this.data[l+2]=a, this.data[l+3]=c;}this.pos+=t;}}, xt.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var i=this.bottom_up?r:this.height-1-r,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&e)/e*255|0,h=(a>>5&n)/n*255|0,c=(a>>11)/e*255|0,l=i*this.width*4+4*o;this.data[l]=c, this.data[l+1]=h, this.data[l+2]=s, this.data[l+3]=255;}this.pos+=t;}}, xt.prototype.bit24=function(){for(var t=this.height-1;0<=t;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*n;this.data[a]=o, this.data[a+1]=i, this.data[a+2]=r, this.data[a+3]=255;}this.pos+=this.width%4;}}, xt.prototype.bit32=function(){for(var t=this.height-1;0<=t;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=o, this.data[s+1]=i, this.data[s+2]=r, this.data[s+3]=a;}}, xt.prototype.getData=function(){return this.data};try{module.exports=function(t){var e=new xt(t);return{data:e.getData(),width:e.width,height:e.height}};}catch(t){}
6227/*
6228   Copyright (c) 2013 Gildas Lormeau. All rights reserved.
6229
6230   Redistribution and use in source and binary forms, with or without
6231   modification, are permitted provided that the following conditions are met:
6232
6233   1. Redistributions of source code must retain the above copyright notice,
6234   this list of conditions and the following disclaimer.
6235
6236   2. Redistributions in binary form must reproduce the above copyright 
6237   notice, this list of conditions and the following disclaimer in 
6238   the documentation and/or other materials provided with the distribution.
6239
6240   3. The names of the authors may not be used to endorse or promote products
6241   derived from this software without specific prior written permission.
6242
6243   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
6244   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
6245   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
6246   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
6247   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6248   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
6249   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
6250   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
6251   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
6252   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6253   */
6254/*
6255   Copyright (c) 2013 Gildas Lormeau. All rights reserved.
6256
6257   Redistribution and use in source and binary forms, with or without
6258   modification, are permitted provided that the following conditions are met:
6259
6260   1. Redistributions of source code must retain the above copyright notice,
6261   this list of conditions and the following disclaimer.
6262
6263   2. Redistributions in binary form must reproduce the above copyright 
6264   notice, this list of conditions and the following disclaimer in 
6265   the documentation and/or other materials provided with the distribution.
6266
6267   3. The names of the authors may not be used to endorse or promote products
6268   derived from this software without specific prior written permission.
6269
6270   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
6271   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
6272   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
6273   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
6274   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6275   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
6276   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
6277   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
6278   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
6279   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6280   */
6281!function(t){var p=15,g=573,e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ut(){var d=this;function h(t,e){for(var n=0;n|=1&t, t>>>=1, n<<=1, 0<--e;);return n>>>1}d.build_tree=function(t){var e,n,r,i=d.dyn_tree,o=d.stat_desc.static_tree,a=d.stat_desc.elems,s=-1;for(t.heap_len=0, t.heap_max=g, e=0;e<a;e++)0!==i[2*e]?(t.heap[++t.heap_len]=s=e, t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=s<2?++s:0)]=1, t.depth[r]=0, t.opt_len--, o&&(t.static_len-=o[2*r+1]);for(d.max_code=s, e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(r=a;e=t.heap[1], t.heap[1]=t.heap[t.heap_len--], t.pqdownheap(i,1), n=t.heap[1], t.heap[--t.heap_max]=e, t.heap[--t.heap_max]=n, i[2*r]=i[2*e]+i[2*n], t.depth[r]=Math.max(t.depth[e],t.depth[n])+1, i[2*e+1]=i[2*n+1]=r, t.heap[1]=r++, t.pqdownheap(i,1), 2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1], function(t){var e,n,r,i,o,a,s=d.dyn_tree,h=d.stat_desc.static_tree,c=d.stat_desc.extra_bits,l=d.stat_desc.extra_base,u=d.stat_desc.max_length,f=0;for(i=0;i<=p;i++)t.bl_count[i]=0;for(s[2*t.heap[t.heap_max]+1]=0, e=t.heap_max+1;e<g;e++)u<(i=s[2*s[2*(n=t.heap[e])+1]+1]+1)&&(i=u, f++), s[2*n+1]=i, n>d.max_code||(t.bl_count[i]++, o=0, l<=n&&(o=c[n-l]), a=s[2*n], t.opt_len+=a*(i+o), h&&(t.static_len+=a*(h[2*n+1]+o)));if(0!==f){do{for(i=u-1;0===t.bl_count[i];)i--;t.bl_count[i]--, t.bl_count[i+1]+=2, t.bl_count[u]--, f-=2;}while(0<f);for(i=u;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--e])>d.max_code||(s[2*r+1]!=i&&(t.opt_len+=(i-s[2*r+1])*s[2*r], s[2*r+1]=i), n--);}}(t), function(t,e,n){var r,i,o,a=[],s=0;for(r=1;r<=p;r++)a[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=h(a[o]++,o));}(i,d.max_code,t.bl_count);};}function ft(t,e,n,r,i){var o=this;o.static_tree=t, o.extra_bits=e, o.extra_base=n, o.elems=r, o.max_length=i;}ut._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28], ut.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0], ut.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576], ut.d_code=function(t){return t<256?e[t]:e[256+(t>>
6281>7)]}, ut.extra_lbits=[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], ut.extra_dbits=[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], ut.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7], ut.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15], ft.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8], ft.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5], ft.static_l_desc=new ft(ft.static_ltree,ut.extra_lbits,257,286,p), ft.static_d_desc=new ft(ft.static_dtree,ut.extra_dbits,0,30,p), ft.static_bl_desc=new ft(null,ut.extra_blbits,0,19,7);function n(t,e,n,r,i){var o=this;o.good_length=t, o.max_lazy=e, o.nice_length=n, o.max_chain=r, o.func=i;}var dt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],pt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],gt=262;function mt(t,e,n,r){var i=t[2*e],o=t[2*n];return i<o||i==o&&r[e]<=r[n]}function r(){var h,c,l,u,f,d,p,g,i,m,w,y,v,a,b,x,S,k,_,A,I,C,T,F,P,E,q,O,B,R,s,j,D,M,U,N,z,o,L,H,W,G=this,V=new ut,Y=new ut,X=new ut;function J(){var t;for(t=0;t<286;t++)s[2*t]=0;for(t=0;t<30;t++)j[2*t]=0;for(t=0;t<19;t++)D[2*t]=0;s[512]=1, G.opt_len=G.static_len=0, N=o=0;}function K(t,e){var n,r,i=-1,o=t[1],a=0,s=7,h=4;for(0===o&&(s=138, h=3), t[2*(e+1)+1]=65535, n=0;n<=e;n++)r=o, o=t[2*(n+1)+1], ++a<s&&r==o||(a<h?D[2*r]+=a:0!==r?(r!=i&&D[2*r]++, D[32]++):a<=10?D[34]++:D[36]++, i=r, (a=0)===o?(s=138, h=3):r==o?(s=6, h=3):(s=7, h=4));}function Q(t){G.pending_buf[G.pending++]=t;}function Z(t){Q(255&t), Q(t>>>8&255);}function $(t,e){var n,r=e;16-r<W?(Z(H|=(n=t)<<W&65535), H=n>>>16-W, W+=r-16):(H|=t<<W&65535, W+=r);}function tt(t,e){var n=2*t;$(65535&e[n],65535&e[n+1]);}function et(t,e){var n,r,i=-1,o=t[1],a=0,s=7,h=4;for(0===o&&(s=138, h=3), n=0;n<=e;n++)if(r=o, o=t[2*(n+1)+1], !(++a<s&&r==o)){if(a<h)for(;tt(r,D), 0!=--a;);else 0!==r?(r!=i&&(tt(r,D), a--), tt(16,D), $(a-3,2)):a<=10?(tt(17,D), $(a-3,3)):(tt(18,D), $(a-11,7));i=r, (a=0)===o?(s=138, h=3):r==o?(s=6, h=3):(s=7, h=4);}}function nt(){16==W?(Z(H), W=H=0):8<=W&&(Q(255&H), H>>>=8, W-=8);}function rt(t,e){var n,r,i;if(G.pending_buf[z+2*N]=t>>>8&255, G.pending_buf[z+2*N+1]=255&t, G.pending_buf[M+N]=255&e, N++, 0===t?s[2*e]++:(o++, t--, s[2*(ut._length_code[e]+256+1)]++, j[2*ut.d_code(t)]++), 0==(8191&N)&&2<q){for(n=8*N, r
6281=I-S, i=0;i<30;i++)n+=j[2*i]*(5+ut.extra_dbits[i]);if(n>>>=3, o<Math.floor(N/2)&&n<Math.floor(r/2))return!0}return N==U-1}function it(t,e){var n,r,i,o,a=0;if(0!==N)for(;n=G.pending_buf[z+2*a]<<8&65280|255&G.pending_buf[z+2*a+1], r=255&G.pending_buf[M+a], a++, 0===n?tt(r,t):(tt((i=ut._length_code[r])+256+1,t), 0!==(o=ut.extra_lbits[i])&&$(r-=ut.base_length[i],o), tt(i=ut.d_code(--n),e), 0!==(o=ut.extra_dbits[i])&&$(n-=ut.base_dist[i],o)), a<N;);tt(256,t), L=t[513];}function ot(){8<W?Z(H):0<W&&Q(255&H), W=H=0;}function at(t,e,n){var r,i,o;$(0+(n?1:0),3), r=t, i=e, o=!0, ot(), L=8, o&&(Z(i), Z(~i)), G.pending_buf.set(g.subarray(r,r+i),G.pending), G.pending+=i;}function e(t,e,n){var r,i,o=0;0<q?(V.build_tree(G), Y.build_tree(G), o=function(){var t;for(K(s,V.max_code), K(j,Y.max_code), X.build_tree(G), t=18;3<=t&&0===D[2*ut.bl_order[t]+1];t--);return G.opt_len+=3*(t+1)+5+5+4, t}(), r=G.opt_len+3+7>>>3, (i=G.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5, e+4<=r&&-1!=t?at(t,e,n):i==r?($(2+(n?1:0),3), it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3), function(t,e,n){var r;for($(t-257,5), $(e-1,5), $(n-4,4), r=0;r<n;r++)$(D[2*ut.bl_order[r]+1],3);et(s,t-1), et(j,e-1);}(V.max_code+1,Y.max_code+1,o+1), it(s,j)), J(), n&&ot();}function st(t){e(0<=S?S:-1,I-S,t), S=I, h.flush_pending();}function ht(){var t,e,n,r;do{if(0===(r=i-T-I)&&0===I&&0===T)r=f;else if(-1==r)r--;else if(f+f-gt<=I){for(g.set(g.subarray(f,f+f),0), C-=f, I-=f, S-=f, n=t=v;e=65535&w[--n], w[n]=f<=e?e-f:0, 0!=--t;);for(n=t=f;e=65535&m[--n], m[n]=f<=e?e-f:0, 0!=--t;);r+=f;}if(0===h.avail_in)return;t=h.read_buf(g,I+T,r), 3<=(T+=t)&&(y=((y=255&g[I])<<x^255&g[I+1])&b);}while(T<gt&&0!==h.avail_in)}function ct(t){var e,n,r=P,i=I,o=F,a=f-gt<I?I-(f-gt):0,s=R,h=p,c=I+258,l=g[i+o-1],u=g[i+o];B<=F&&(r>>=2), T<s&&(s=T);do{if(g[(e=t)+o]==u&&g[e+o-1]==l&&g[e]==g[i]&&g[++e]==g[i+1]){i+=2, e++;do{}while(g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&i<c);if(n=258-(c-i), i=c-258, o<n){if(C=t, s<=(o=n))break;l=g[i+o-1], u=g[i+o];}}}while((t=65535&m[t&h])>a&&0!=--r);return o<=T?o:T}function lt(t){return t.total_in=t.total_out=0, t.msg=null, G.pending=0, G.pending_out=0, c=113, u=0, V.dyn_tree=s, V.stat_desc=ft.static_l_desc, Y.dyn_tree=j, Y.stat_desc=ft.static_d_desc, X.dyn_tree=D, X.stat_desc=ft.static_bl_desc, W=H=0, L=8, J(), function(){var t;for(i=2*f, t=w[v-1]=0;t<v-1;t++)w[t]=0;E=dt[q].max_lazy, B=dt[q].good_length, R=dt[q].nice_length, P=dt[q].max_chain, k=F=2, y=A=T=S=I=0;}(), 0}G.depth=[], G.bl_count=[], G.heap=[], s=[], j=[], D=[], G.pqdownheap=function(t,e){for(var n=G.heap,r=n[e],i=e<<1;i<=G.heap_len&&(i<G.heap_len&&mt(t,n[i+1],n[i],G.depth)&&i++, !mt(t,r,n[i],G.depth));)n[e]=n[i], e=i, i<<=1;n[e]=r;}, G.deflateInit=function(t,e,n,r,i,o){return r||(r=8), i||(i=8), o||(o=0), t.msg=null, -1==e&&(e=6), i<1||9<i||8!=r||n<9||15<n||e<0||9<e||o<0||2<o?-2:(t.dstate=G, p=(f=1<<(d=n))-1, b=(v=1<<(a=i+7))-1, x=Math.floor((a+3-1)/3), g=new Uint8Array(2*f), m=[], w=[], U=1<<i+6, G.pending_buf=new Uint8Array(4*U), l=4*U, z=Math.floor(U/2), M=3*U, q=e, O=o, lt(t))}, G.deflateEnd=function(){return 42!=c&&113!=c&&666!=c?-2:(G.pending_buf=null, g=m=w=null, G.dstate=null, 113==c?-3:0)}, G.deflateParams=function(t,e,n){var r=0;return-1==e&&(e=6), e<0||9<e||n<0||2<n?-2:(dt[q].func!=dt[e].func&&0!==t.total_in&&(r=t.deflate(1)), q!=e&&(E=dt[q=e].max_lazy, B=dt[q].good_length, R=dt[q].nice_length, P=dt[q].max_chain), O=n, r)}, G.deflateSetDictionary=function(t,e,n){var r,i=n,o=0;if(!e||42!=c)return-2;if(i<3)return 0;for(f-gt<i&&(o=n-(i=f-gt)), g.set(e.subarray(o,o+i),0), S=I=i, y=((y=255&g[0])<<x^255&g[1])&b, r=0;r<=i-3;r++)y=(y<<x^255&g[r+2])&b, m[r&p]=w[y], w[y]=r;return 0}, G.deflate=function(t,e){var n,r,i,o,a,s;if(4<e||e<0)return-2;if(!t.next_out||!t.next_in&&0!==t.avail_in||666==c&&4!=e)return t.msg=pt[4], -2;if(0===t.avail_out)return t.msg=pt[7], -5;if(h=t, o=u, u=e, 42==c&&(r=8+(d-8<<4)<<8, 3<(i=(q-1&255)>>1)&&(i=3), r|=i<<6, 0!==I&&(r|=32), c=113, Q((s=r+=31-r%31)>>8&255), Q(255&s)), 0!==G.pending){if(h.flush_pending(), 0===h.avail_out)return u=-1, 0}else if(0===h.avail_in&&e<=o&&4!=e)return h.msg=pt[7], -5;if(666==c&&0!==h.avail_in)return t.msg=pt[7], -5;if(0!==h.avail_in||0!==T||0!=e&&666!=c){switch(a=-1, dt[q].func){case 0:a=function(t){var e,n=65535;for(l-5<n&&(n=l-5);;){if(T<=1){if(ht(), 0===T&&0==t)return 0;if(0===T)break}if(I+=T, e=S+n, ((T=0)===I||e<=I)&&(T=I-e, I=e, st(!1), 0===h.avail_out))return 0;if(f-gt<=I-S&&(st(!1), 0===h.avail_out))return 0}return st(4==t), 0===h.avail_out?4==t?2:0:4==t?3:1}(e);break;case 1:a=function(t){for(var e,n=0;;){if(T<gt){if(ht(), T<gt&&0==t)return 0;if(0===T)break}if(3<=T&&(y=(y<<x^255&g[I+2])&b, n=65535&w[y], m[I&p]=w[y], w[y]=I), 0!==n&&(I-n&65535)<=f-gt&&2!=O&&(k=ct(n)), 3<=k)if(e=rt(I-C,k-3), T-=k, k<=E&&3<=T){for(k--;y=(y<<x^255&g[++I+2])&b, n=65535&w[y], m[I&p]=w[y], w[y]=I, 0!=--k;);I++;}else I+=k, k=0, y=((y=255&g[I])<<x^255&g[I+1])&b;else e=rt(0,255&g[I]), T--, I++;if(e&&(st(!1), 0===h.avail_out))return 0}return st(4==t), 0===h.avail_out?4==t?2:0:4==t?3:1}(e);break;case 2:a=function(t){for(var e,n,r=0;;){if(T<gt){if(ht(), T<gt&&0==t)return 0;if(0===T)break}if(3<=T&&(y=(y<<x^255&g[I+2])&b, r=65535&w[y], m[I&p]=w[y], w[y]=I), F=k, _=C, k=2, 0!==r&&F<E&&(I-r&65535)<=f-gt&&(2!=O&&(k=ct(r)), k<=5&&(1==O||3==k&&4096<I-C)&&(k=2)), 3<=F&&k<=F){for(n=I+T-3, e=rt(I-1-_,F-3), T-=F-1, F-=2;++I<=n&&(y=(y<<x^255&g[I+2])&b, r=65535&w[y], m[I&p]=w[y], w[y]=I), 0!=--F;);if(A=0, k=2, I++, e&&(st(!1), 0===h.avail_out))return 0}else if(0!==A){if((e=rt(0,255&g[I-1]))&&st(!1), I++, T--, 0===h.avail_out)return 0}else A=1, I++, T--;}return 0!==A&&(e=rt(0,255&g[I-1]), A=0), st(4==t), 0===h.avail_out?4==t?2:0:4==t?3:1}(e);}if(2!=a&&3!=a||(c=666), 0==a||2==a)return 0===h.avail_out&&(u=-1), 0;if(1==a){if(1==e)$(2,3), tt(256,ft.static_ltree), nt(), 1+L+10-W<9&&($(2,3), tt(256,ft.static_ltree), nt()), L=7;else if(at(0,0,!1), 3==e)for(n=0;n<v;n++)w[n]=0;if(h.flush_pending(), 0===h.avail_out)return u=-1, 0}}return 4!=e?0:1};}function i(){var t=this;t.next_in_index=0, t.next_out_index=0, t.avail_in=0, t.total_in=0, t.avail_out=0, t.total_out=0;}i.prototype={deflateInit:function(t,e){return this.dstate=new r, e||(e=p), this.dstate.deflateInit(this,t,e)},deflate:function(t){return this.dstate?this.dstate.deflate(this,t):-2},deflateEnd:function(){if(!this.dstate)return-2;var t=this.dstate.deflateEnd();return this.dstate=null, t},deflateParams:function(t,e){return this.dstate?this.dstate.deflateParams(this,t,e):-2},deflateSetDictionary:function(t,e){return this.dstate?this.dstate.deflateSetDictionary(this,t,e):-2},read_buf:function(t,e,n){var r=this,i=r.avail_in;return n<i&&(i=n), 0===i?0:(r.avail_in-=i, t.set(r.next_in.subarray(r.next_in_index,r.next_in_index+i),e), r.next_in_index+=i, r.total_in+=i, i)},flush_pending:function(){var t=this,e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out), 0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index), t.next_out_index+=e, t.dstate.pending_out+=e, t.total_out+=e, t.avail_out-=e, t.dstate.pending-=e, 0===t.dstate.pending&&(t.dstate.pending_out=0));}};var o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var s=new i,h=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1), s.deflateInit(e), s.next_out=h, this.append=function(t,e){var n,r=[],i=0,o=0,a=0;if(t.length){s.next_in_index=0, s.next_in=t, s.avail_in=t.length;do{if(s.next_out_index=0, s.avail_out=512, 0!=s.deflate(0))throw new Error("deflating: "+s.msg);s.next_out_index&&(512==s.next_out_index?r.push(new Uint8Array(h)):r.push(new Uint8Array(h.subarray(0,s.next_out_index)))), a+=s.next_out_index, e&&0<s.next_in_index&&s.next_in_index!=i&&(e(s.next_in_index), i=s.next_in_index);}while(0<s.avail_in||0===s.avail_out);return n=new Uint8Array(a), r.forEach(function(t){n.set(t,o), o+=t.length;}), n}}, this.flush=function(){var t,e,n=[],r=0,i=0;do{if(s.next_out_index=0, s.avail_out=512, 1!=(t=s.deflate(4))&&0!=t)throw new Error("deflating: "+s.msg);0<512-s.avail_out&&n.push(new Uint8Array(h.subarray(0,s.next_out_index))), i+=s.next_out_index;}while(0<s.avail_in||0===s.avail_out);
6281return s.deflateEnd(), e=new Uint8Array(i), n.forEach(function(t){e.set(t,r), r+=t.length;}), e};};}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), function(t){function f(t){var e;this.ok=!1, "#"==t.charAt(0)&&(t=t.substr(1,6)), t=(t=t.replace(/ /g,"")).toLowerCase();var l={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee9
62810",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var n in l)t==n&&(t=l[n]);for(var u=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<u.length;r++){var i=u[r].re,o=u[r].process,a=i.exec(t);a&&(e=o(a), this.r=e[0], this.g=e[1], this.b=e[2], this.ok=!0);}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r, this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g, this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b, this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"}, this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t), 1==e.length&&(e="0"+e), 1==n.length&&(n="0"+n), "#"+t+e+n}, this.getHelpXML=function(){for(var t=new Array,e=0;e<u.length;e++)for(var n=u[e].example,r=0;r<n.length;r++)t[t.length]=n[r];for(var i in l)t[t.length]=i;var o=document.createElement("ul");o.setAttribute("id","rgbcolor-examples");for(e=0;e<t.length;e++)try{var a=document.createElement("li"),s=new f(t[e]),h=document.createElement("div");h.style.cssText="margin: 3px; border: 1px solid black; background:"+s.toHex()+"; color:"+s.toHex(), h.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+t[e]+" -> "+s.toRGB()+" -> "+s.toHex());a.appendChild(h), a.appendChild(c), o.appendChild(a);}catch(t){}return o};}"undefined"!=typeof undefined&&undefined.amd?undefined("RGBColor",function(){return f}):"undefined"!='object'&&module.exports&&(module.exports=f), t.RGBColor=f;}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), function(t){module.exports=t();}(function(){return function o(a,s,h){function c(n,t){if(!s[n]){if(!a[n]){var e="function"==typeof commonjsRequire&&commonjsRequire;if(!t&&e)return e(n,!0);if(l)return l(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND", r}var i=s[n]={exports:{}};a[n][0].call(i.exports,function(t){var e=a[n][1][t];return c(e||t)},i,i.exports,o,a,s,h);}return s[n].exports}for(var l="function"==typeof commonjsRequire&&commonjsRequire,t=0;t<h.length;t++)c(h[t]);return c}({1:[function(t,q,O){(function(E){!function(t){var e="object"==typeof O&&O,n="object"==typeof q&&q&&q.exports==e&&q,r="object"==typeof E&&E;r.global!==r&&r.window!==r||(t=r);var i,o,w=2147483647,y=36,v=1,b=26,a=38,s=700,x=72,S=128,k="-",h=/^xn--/,c=/[^ -~]/,l=/\x2E|\u3002|\uFF0E|\uFF61/g,u={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >
6281= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=y-v,_=Math.floor,A=String.fromCharCode;function I(t){throw RangeError(u[t])}function d(t,e){for(var n=t.length;n--;)t[n]=e(t[n]);return t}function p(t,e){return d(t.split(l),e).join(".")}function C(t){for(var e,n,r=[],i=0,o=t.length;i<o;)55296<=(e=t.charCodeAt(i++))&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e), i--):r.push(e);return r}function T(t){return d(t,function(t){var e="";return 65535<t&&(e+=A((t-=65536)>>>10&1023|55296), t=56320|1023&t), e+=A(t)}).join("")}function F(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function P(t,e,n){var r=0;for(t=n?_(t/s):t>>1, t+=_(t/e);f*b>>1<t;r+=y)t=_(t/f);return _(r+(f+1)*t/(t+a))}function g(t){var e,n,r,i,o,a,s,h,c,l,u,f=[],d=t.length,p=0,g=S,m=x;for((n=t.lastIndexOf(k))<0&&(n=0), r=0;r<n;++r)128<=t.charCodeAt(r)&&I("not-basic"), f.push(t.charCodeAt(r));for(i=0<n?n+1:0;i<d;){for(o=p, a=1, s=y;d<=i&&I("invalid-input"), u=t.charCodeAt(i++), (y<=(h=u-48<10?u-22:u-65<26?u-65:u-97<26?u-97:y)||h>_((w-p)/a))&&I("overflow"), p+=h*a, !(h<(c=s<=m?v:m+b<=s?b:s-m));s+=y)a>_(w/(l=y-c))&&I("overflow"), a*=l;m=P(p-o,e=f.length+1,0==o), _(p/e)>w-g&&I("overflow"), g+=_(p/e), p%=e, f.splice(p++,0,g);}return T(f)}function m(t){var e,n,r,i,o,a,s,h,c,l,u,f,d,p,g,m=[];for(f=(t=C(t)).length, e=S, o=x, a=n=0;a<f;++a)(u=t[a])<128&&m.push(A(u));for(r=i=m.length, i&&m.push(k);r<f;){for(s=w, a=0;a<f;++a)e<=(u=t[a])&&u<s&&(s=u);for(s-e>_((w-n)/(d=r+1))&&I("overflow"), n+=(s-e)*d, e=s, a=0;a<f;++a)if((u=t[a])<e&&++n>w&&I("overflow"), u==e){for(h=n, c=y;!(h<(l=c<=o?v:o+b<=c?b:c-o));c+=y)g=h-l, p=y-l, m.push(A(F(l+g%p,0))), h=_(g/p);m.push(A(F(h,0))), o=P(n,d,r==i), n=0, ++r;}++n, ++e;}return m.join("")}if(i={version:"1.2.4",ucs2:{decode:C,encode:T},decode:g,encode:m,toASCII:function(t){return p(t,function(t){return c.test(t)?"xn--"+m(t):t})},toUnicode:function(t){return p(t,function(t){return h.test(t)?g(t.slice(4).toLowerCase()):t})}}, e&&!e.nodeType)if(n)n.exports=i;else for(o in i)i.hasOwnProperty(o)&&(e[o]=i[o]);else t.punycode=i;}(this);}).call(this,"undefined"!=typeof commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}],2:[function(t,e,n){var i=t("./log");function u(t,e){for(var n=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),r=t.firstChild;r;)!0!==e&&1===r.nodeType&&"SCRIPT"===r.nodeName||n.appendChild(u(r,e)), r=r.nextSibling;return 1===t.nodeType&&(n._scrollTop=t.scrollTop, n._scrollLeft=t.scrollLeft, "CANVAS"===t.nodeName?function(e,t){try{t&&(t.width=e.width, t.height=e.height, t.getContext("2d").putImageData(e.getContext("2d").getImageData(0,0,e.width,e.height),0,0));}catch(t){i("Unable to copy canvas content from",e,t);}}(t,n):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(n.value=t.value)), n}e.exports=function(o,t,e,n,a,s,h){var c=u(o.documentElement,a.javascriptEnabled),l=t.createElement("iframe");return l.className="html2canvas-container", l.style.visibility="hidden", l.style.position="fixed", l.style.left="-10000px", l.style.top="0px", l.style.border="0", l.width=e, l.height=n, l.scrolling="no", t.body.appendChild(l), new Promise(function(e){var t,n,r,i=l.contentWindow.document;l.contentWindow.onload=l.onload=function(){var t=setInterval(function(){0<i.body.childNodes.length&&(!function t(e){if(1===e.nodeType){e.scrollTop=e._scrollTop, e.scrollLeft=e._scrollLeft;for(var n=e.firstChild;n;)t(n), n=n.nextSibling;}}(i.documentElement), clearInterval(t), "view"===a.type&&(l.contentWindow.scrollTo(s,h), !/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||l.contentWindow.scrollY===h&&l.contentWindow.scrollX===s||(i.documentElement.style.top=-h+"px", i.documentElement.style.left=-s+"px", i.documentElement.style.position="absolute")), e(l));},50);}, i.open(), i.write("<!DOCTYPE html><html></html>"), n=s, r=h, !(t=o).defaultView||n===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(n,r), i.replaceChild(i.adoptNode(c),i.documentElement), i.close();})};},{"./log":13}],3:[function(t,e,n){function r(t){this.r=0, this.g=0, this.b=0, this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t);}r.prototype.darken=function(t){var e=1-t;return new r([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])}, r.prototype.isTransparent=function(){return 0===this.a}, r.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b}, r.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255), this.g=Math.min(t[1],255), this.b=Math.min(t[2],255), 3<t.length&&(this.a=t[3])), Array.isArray(t)};var i=/^#([a-f0-9]{3})$/i;r.prototype.hex3=function(t){var e;return null!==(e=t.match(i))&&(this.r=parseInt(e[1][0]+e[1][0],16), this.g=parseInt(e[1][1]+e[1][1],16), this.b=parseInt(e[1][2]+e[1][2],16)), null!==e};var o=/^#([a-f0-9]{6})$/i;r.prototype.hex6=function(t){var e=null;
6281return null!==(e=t.match(o))&&(this.r=parseInt(e[1].substring(0,2),16), this.g=parseInt(e[1].substring(2,4),16), this.b=parseInt(e[1].substring(4,6),16)), null!==e};var a=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;r.prototype.rgb=function(t){var e;return null!==(e=t.match(a))&&(this.r=Number(e[1]), this.g=Number(e[2]), this.b=Number(e[3])), null!==e};var s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;r.prototype.rgba=function(t){var e;return null!==(e=t.match(s))&&(this.r=Number(e[1]), this.g=Number(e[2]), this.b=Number(e[3]), this.a=Number(e[4])), null!==e}, r.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"}, r.prototype.namedColor=function(t){t=t.toLowerCase();var e=h[t];if(e)this.r=e[0], this.g=e[1], this.b=e[2];else if("transparent"===t)return this.r=this.g=this.b=this.a=0, !0;return!!e}, r.prototype.isColor=!0;var h={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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],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],rebeccapurple:[102,51,153],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]};e.exports=r;},{}],4:[function(t,e,n){var p=t("./support"),d=t("./renderers/canvas"),g=t("./imageloader"),m=t("./nodeparser"),r=t("./nodecontainer"),w=t("./log"),i=t("./utils"),y=t("./clone"),v=t("./proxy").loadUrlDocument,b=i.getBounds,x="data-html2canvas-node",S=0;function o(t,e){var n,r,i=S++;if((e=e||{}).logging&&(w.options.logging=!0, w.options.start=Date.now()), e.async=void 0===e.async||e.async, e.allowTaint=void 0!==e.allowTaint&&e.allowTaint, e.removeContainer=void 0===e.removeContainer||e.removeContainer, e.javascriptEnabled=void 0!==e.javascriptEnabled&&e.javascriptEnabled, e.imageTimeout=void 0===e.imageTimeout?1e4:e.imageTimeout, e.renderer="function"==typeof e.renderer?e.renderer:d, e.strict=!!e.strict, "string"==typeof t){if("string"!=typeof e.proxy)return Promise.reject("Proxy must be used when rendering url");var o=null!=e.width?e.width:window.innerWidth,a=null!=e.height?e.height:window.innerHeight;return v((n=t, r=document.createElement("a"), r.href=n, r.href=r.href, r),e.proxy,document,o,a,e).then(function(t){return k(t.contentWindow.document.documentElement,t,e,o,a)})}var s,h,c,l,u,f=(void 0===t?[document.documentElement]:t.length?t:[t])[0];return f.setAttribute(x+i,i), (s=f.ownerDocument, h=e, c=f.ownerDocument.defaultView.innerWidth, l=f.ownerDocument.defaultView.innerHeight, u=i, y(s,s,c,l,h,s.defaultView.pageXOffset,s.defaultView.pageYOffset).then(function(t){w("Document cloned");var e=x+u,n="["+e+"='"+u+"']";s.querySelector(n).removeAttribute(e);var r=t.contentWindow,i=r.document.querySelector(n),o="function"==typeof h.onclone?Promise.resolve(h.onclone(r.document)):Promise.resolve(!0);return o.then(function(){return k(i,t,h,c,l)})})).then(function(t){return"function"==typeof e.onrendered&&(w("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"), e.onrendered(t)), t})}o.CanvasRenderer=d, o.NodeContainer=r, o.log=w, o.utils=i;var a="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return Promise.reject("No canvas support")}:o;function k(n,r,i,t,e){var o,a,s=r.contentWindow,h=new p(s.document),c=new g(i,h),l=b(n),u="view"===i.type?t:(o=s.document, Math.max(Math.max(o.body.scrollWidth,o.documentElement.scrollWidth),Math.max(o.body.offsetWidth,o.documentElement.offsetWidth),Math.max(o.body.clientWidth,o.documentElement.clientWidth))),f="view"===i.type?e:(a=s.document, Math.max(Math.max(a.body.scrollHeight,a.documentElement.scrollHeight),Math.max(a.body.offsetHeight,a.documentElement.offsetHeight),Math.max(a.body.clientHeight,a.documentElement.clientHeight))),d=new i.renderer(u,f,c,i,document);return new m(n,d,h,c,i).ready.then(function(){var t,e;return w("Finished rendering"), t="view"===i.type?_(d.canvas,{width:d.canvas.width,height:d.canvas.height,top:0,left:0,x:0,y:0}):n===s.document.body||n===s.document.documentElement||null!=i.canvas?d.canvas:_(d.canvas,{width:null!=i.width?i.width:l.width,height:null!=i.height?i.height:l.height,top:l.top,left
6281:l.left,x:0,y:0}), e=r, i.removeContainer&&(e.parentNode.removeChild(e), w("Cleaned up container")), t})}function _(t,e){var n=document.createElement("canvas"),r=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),a=Math.min(t.height,Math.max(1,e.top+e.height));n.width=e.width, n.height=e.height;var s=i-r,h=a-o;return w("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",s,"height:",h), w("Resulting crop with width",e.width,"and height",e.height,"with x",r,"and y",o), n.getContext("2d").drawImage(t,r,o,s,h,e.x,e.y,s,h), n}e.exports=a;},{"./clone":2,"./imageloader":11,"./log":13,"./nodecontainer":14,"./nodeparser":15,"./proxy":16,"./renderers/canvas":20,"./support":22,"./utils":26}],5:[function(t,e,n){var r=t("./log"),i=t("./utils").smallImage;e.exports=function t(e){if(this.src=e, r("DummyImageContainer for",e), !this.promise||!this.image){r("Initiating DummyImageContainer"), t.prototype.image=new Image;var n=this.image;t.prototype.promise=new Promise(function(t,e){n.onload=t, n.onerror=e, n.src=i(), !0===n.complete&&t(n);});}};},{"./log":13,"./utils":26}],6:[function(t,e,n){var h=t("./utils").smallImage;e.exports=function(t,e){var n,r,i=document.createElement("div"),o=document.createElement("img"),a=document.createElement("span"),s="Hidden Text";i.style.visibility="hidden", i.style.fontFamily=t, i.style.fontSize=e, i.style.margin=0, i.style.padding=0, document.body.appendChild(i), o.src=h(), o.width=1, o.height=1, o.style.margin=0, o.style.padding=0, o.style.verticalAlign="baseline", a.style.fontFamily=t, a.style.fontSize=e, a.style.margin=0, a.style.padding=0, a.appendChild(document.createTextNode(s)), i.appendChild(a), i.appendChild(o), n=o.offsetTop-a.offsetTop+1, i.removeChild(a), i.appendChild(document.createTextNode(s)), i.style.lineHeight="normal", o.style.verticalAlign="super", r=o.offsetTop-i.offsetTop+1, document.body.removeChild(i), this.baseline=n, this.lineWidth=1, this.middle=r;};},{"./utils":26}],7:[function(t,e,n){var r=t("./font");function i(){this.data={};}i.prototype.getMetrics=function(t,e){return void 0===this.data[t+"-"+e]&&(this.data[t+"-"+e]=new r(t,e)), this.data[t+"-"+e]}, e.exports=i;},{"./font":6}],8:[function(o,t,e){var a=o("./utils").getBounds,i=o("./proxy").loadUrlDocument;function n(e,t,n){this.image=null, this.src=e;var r=this,i=a(e);this.promise=(t?new Promise(function(t){"about:blank"===e.contentWindow.document.URL||null==e.contentWindow.document.documentElement?e.contentWindow.onload=e.onload=function(){t(e);}:t(e);}):this.proxyLoad(n.proxy,i,n)).then(function(t){return o("./core")(t.contentWindow.document.documentElement,{type:"view",width:t.width,height:t.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return r.image=t});}n.prototype.proxyLoad=function(t,e,n){var r=this.src;return i(r.src,t,r.ownerDocument,e.width,e.height,n)}, t.exports=n;},{"./core":4,"./proxy":16,"./utils":26}],9:[function(t,e,n){function r(t){this.src=t.value, this.colorStops=[], this.type=null, this.x0=.5, this.y0=.5, this.x1=.5, this.y1=.5, this.promise=Promise.resolve(!0);}r.TYPES={LINEAR:1,RADIAL:2}, r.REGEXP_COLORSTOP=/^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i, e.exports=r;},{}],10:[function(t,e,n){e.exports=function(n,r){this.src=n, this.image=new Image;var i=this;this.tainted=null, this.promise=new Promise(function(t,e){i.image.onload=t, i.image.onerror=e, r&&(i.image.crossOrigin="anonymous"), i.image.src=n, !0===i.image.complete&&t(i.image);});};},{}],11:[function(t,e,n){var o=t("./log"),r=t("./imagecontainer"),i=t("./dummyimagecontainer"),a=t("./proxyimagecontainer"),s=t("./framecontainer"),h=t("./svgcontainer"),c=t("./svgnodecontainer"),l=t("./lineargradientcontainer"),u=t("./webkitgradientcontainer"),f=t("./utils").bind;function d(t,e){this.link=null, this.options=t, this.support=e, this.origin=this.getOrigin(window.location.href);}d.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t}
6281,[]).forEach(this.addImage(e,this.loadImage),this), e}, d.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this), t}, d.prototype.addImage=function(n,r){return function(e){e.args.forEach(function(t){this.imageExists(n,t)||(n.splice(0,0,r.call(this,e)), o("Added image #"+n.length,"string"==typeof t?t.substring(0,100):t));},this);}}, d.prototype.hasImageBackground=function(t){return"none"!==t.method}, d.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new r(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||!0===this.options.allowTaint||this.isSVG(e)?new r(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new r(e,!0):this.options.proxy?new a(e,this.options.proxy):new i(e):new h(e)}return"linear-gradient"===t.method?new l(t):"gradient"===t.method?new u(t):"svg"===t.method?new c(t.args[0],this.support.svg):"IFRAME"===t.method?new s(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new i(t)}, d.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||h.prototype.isInline(t)}, d.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})}, d.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin}, d.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));return e.href=t, e.href=e.href, e.protocol+e.hostname+e.port}, d.prototype.getPromise=function(e){return this.timeout(e,this.options.imageTimeout).catch(function(){return new i(e.src).promise.then(function(t){e.image=t;})})}, d.prototype.get=function(e){var n=null;return this.images.some(function(t){return(n=t).src===e})?n:null}, d.prototype.fetch=function(t){return this.images=t.reduce(f(this.findBackgroundImage,this),this.findImages(t)), this.images.forEach(function(e,n){e.promise.then(function(){o("Succesfully loaded image #"+(n+1),e);},function(t){o("Failed loading image #"+(n+1),e,t);});}), this.ready=Promise.all(this.images.map(this.getPromise,this)), o("Finished searching images"), this}, d.prototype.timeout=function(n,r){var i,t=Promise.race([n.promise,new Promise(function(t,e){i=setTimeout(function(){o("Timed out loading image",n), e(n);},r);})]).then(function(t){return clearTimeout(i), t});return t.catch(function(){clearTimeout(i);}), t}, e.exports=d;},{"./dummyimagecontainer":5,"./framecontainer":8,"./imagecontainer":10,"./lineargradientcontainer":12,"./log":13,"./proxyimagecontainer":17,"./svgcontainer":23,"./svgnodecontainer":24,"./utils":26,"./webkitgradientcontainer":27}],12:[function(t,e,n){var i=t("./gradientcontainer"),o=t("./color");function r(t){i.apply(this,arguments), this.type=i.TYPES.LINEAR;var e=r.REGEXP_DIRECTION.test(t.args[0])||!i.REGEXP_COLORSTOP.test(t.args[0]);e?t.args[0].split(/\s+/).reverse().forEach(function(t,e){switch(t){case"left":this.x0=0, this.x1=1;break;case"top":this.y0=0, this.y1=1;break;case"right":this.x0=1, this.x1=0;break;case"bottom":this.y0=1, this.y1=0;break;case"to":var n=this.y0,r=this.x0;this.y0=this.y1, this.x0=this.x1, this.x1=r, this.y1=n;break;case"center":break;default:var i=.01*parseFloat(t,10);if(isNaN(i))break;0===e?(this.y0=i, this.y1=1-this.y0):(this.x0=i, this.x1=1-this.x0);}},this):(this.y0=0, this.y1=1), this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(i.REGEXP_COLORSTOP),n=+e[2],r=0===n?"%":e[3];return{color:new o(e[1]),stop:"%"===r?n/100:null}}), null===this.colorStops[0].stop&&(this.colorStops[0].stop=0), null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1), this.colorStops.forEach(function(n,r){null===n.stop&&this.colorStops.slice(r).some(function(t,e){return null!==t.stop&&(n.stop=(t.stop-this.colorStops[r-1].stop)/(e+1)+this.colorStops[r-1].stop, !0)},this);},this);}r.prototype=Object.create(i.prototype), r.REGEXP_DIRECTION=/^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i, e.exports=r;},{"./color":3,"./gradientcontainer":9}],13:[function(t,e,n){var r=function(){r.options.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-r.options.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)));};r.options={logging:!1}, e.exports=r;},{}],14:[function(t,e,n){var o=t("./color"),r=t("./utils"),i=r.getBounds,a=r.parseBackgroun
6281ds,s=r.offsetBounds;function h(t,e){this.node=t, this.parent=e, this.stack=null, this.bounds=null, this.borders=null, this.clip=[], this.backgroundClip=[], this.offsetBounds=null, this.visible=null, this.computedStyles=null, this.colors={}, this.styles={}, this.backgroundImages=null, this.transformData=null, this.transformMatrix=null, this.isPseudoElement=!1, this.opacity=null;}function c(t){return-1!==t.toString().indexOf("%")}function l(t){return t.replace("px","")}function u(t){return parseFloat(t)}h.prototype.cloneTo=function(t){t.visible=this.visible, t.borders=this.borders, t.bounds=this.bounds, t.clip=this.clip, t.backgroundClip=this.backgroundClip, t.computedStyles=this.computedStyles, t.styles=this.styles, t.backgroundImages=this.backgroundImages, t.opacity=this.opacity;}, h.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity}, h.prototype.assignStack=function(t){(this.stack=t).children.push(this);}, h.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))}, h.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)), this.styles[t]||(this.styles[t]=this.computedStyles[t])}, h.prototype.prefixedCss=function(e){var n=this.css(e);return void 0===n&&["webkit","moz","ms","o"].some(function(t){return void 0!==(n=this.css(t+e.substr(0,1).toUpperCase()+e.substr(1)))},this), void 0===n?null:n}, h.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)}, h.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e}, h.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new o(this.css(t)))}, h.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e}, h.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal";}return t}, h.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null}, h.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=a(this.css("backgroundImage")))}, h.prototype.cssList=function(t,e){var n=(this.css(t)||"").split(",");return 1===(n=(n=n[e||0]||n[0]||"auto").trim().split(" ")).length&&(n=[n[0],c(n[0])?"auto":n[0]]), n}, h.prototype.parseBackgroundSize=function(t,e,n){var r,i,o=this.cssList("backgroundSize",n);if(c(o[0]))r=t.width*parseFloat(o[0])/100;else{if(/contain|cover/.test(o[0])){var a=t.width/t.height,s=e.width/e.height;return a<s^"contain"===o[0]?{width:t.height*s,height:t.height}:{width:t.width,height:t.width/s}}r=parseInt(o[0],10);}return i="auto"===o[0]&&"auto"===o[1]?e.height:"auto"===o[1]?r/e.width*e.height:c(o[1])?t.height*parseFloat(o[1])/100:parseInt(o[1],10), "auto"===o[0]&&(r=i/e.height*e.width), {width:r,height:i}}, h.prototype.parseBackgroundPosition=function(t,e,n,r){var i,o,a=this.cssList("backgroundPosition",n);return i=c(a[0])?(t.width-(r||e).width)*(parseFloat(a[0])/100):parseInt(a[0],10), o="auto"===a[1]?i/e.width*e.height:c(a[1])?(t.height-(r||e).height)*parseFloat(a[1])/100:parseInt(a[1],10), "auto"===a[0]&&(i=o/e.height*e.width), {left:i,top:o}}, h.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]}, h.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var n=t.match(this.TEXT_SHADOW_PROPERTY),r=0;n&&r<n.length;r++){var i=n[r].match(this.TEXT_SHADOW_VALUES);e.push({color:new o(i[0]),offsetX:i[1]?parseFloat(i[1].replace("px","")):0,offsetY:i[2]?parseFloat(i[2].replace("px","")):0,blur:i[3]?i[3].replace("px",""):0});}return e}, h.prototype.parseTransform=function(){if(!this.transformData)if(this.hasTransform()){var t=this.parseBounds(),e=this.prefixedCss("transformOrigin").split(" ").map(l).map(u);e[0]+=t.left, e[1]+=t.top, this.transformData={origin:e,matrix:this.parseTransformMatrix()};}else this.transformData={origin:[0,0],matrix:[1,0,0,1,0,0]};return this.transformData}, h.prototype.parseTransformMatrix=function(){if(!this.transformMatrix){var t=this.prefixedCss("transform"),e=t?function(t){{if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim())});if(t&&"matrix3d"===t[1]){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}}(t.match(this.MATRIX_PROPERTY)):null;this.transformMatrix=e||[1,0,0,1,0,0];}return this.transformMatrix}, h.prototype.parseBounds=function(){return this.bounds||(this.bounds=this.hasTransform()?s(this.node):i(this.node))}, h.prototype.hasTransform=function(){return"1,0,0,1,0,0"!==this.parseTransformMatrix().join(",")||this.parent&&this.parent.hasTransform()}, h.prototype.getValue=function(){var t,e,n=this.node.value||"";return"SELECT"===this.node.tagName?(t=this.node, n=(e=t.options[t.selectedIndex||0])&&e.text||""):"password"===this.node.type&&(n=Array(n.length+1).join("•")), 0===n.length?this.node.placeholder||"":n}, h.prototype.MATRIX_PROPERTY=/(matrix|matrix3d)\((.+)\)/, h.prototype.TEXT_SHADOW_PROPERTY=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g, h.prototype.TEXT_SHADOW_VALUES=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g, h.prototype.CLIP=/^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/, e.exports=h;},{"./color":3,"./utils":26}],15:[function(t,e,n){var s=t("./log"),h=t("punycode"),c=t("./nodecontainer"),f=t("./textcontainer"),d=t("./pseudoelementcontainer"),l=t("./fontmetrics"),u=t("./color"),p=t("./stackingcontext"),r=t("./utils"),g=r.bind,a=r.getBounds,m=r.parseBackgroun
6281ds,w=r.offsetBounds;function i(t,e,n,r,i){s("Starting NodeParser"), this.renderer=e, this.options=i, this.range=null, this.support=n, this.renderQueue=[], this.stack=new p(!0,1,t.ownerDocument,null);var o=new c(t,null);if(i.background&&e.rectangle(0,0,e.width,e.height,new u(i.background)), t===t.ownerDocument.documentElement){var a=new c(o.color("backgroundColor").isTransparent()?t.ownerDocument.body:t.ownerDocument.documentElement,null);e.rectangle(0,0,e.width,e.height,a.color("backgroundColor"));}o.visibile=o.isElementVisible(), this.createPseudoHideStyles(t.ownerDocument), this.disableAnimations(t.ownerDocument), this.nodes=L([o].concat(this.getChildren(o)).filter(function(t){return t.visible=t.isElementVisible()}).map(this.getPseudoElements,this)), this.fontMetrics=new l, s("Fetched nodes, total:",this.nodes.length), s("Calculate overflow clips"), this.calculateOverflowClips(), s("Start fetching images"), this.images=r.fetch(this.nodes.filter(j)), this.ready=this.images.ready.then(g(function(){return s("Images loaded, starting parsing"), s("Creating stacking contexts"), this.createStackingContexts(), s("Sorting stacking contexts"), this.sortStackingContexts(this.stack), this.parse(this.stack), s("Render queue created with "+this.renderQueue.length+" items"), new Promise(g(function(t){i.async?"function"==typeof i.async?i.async.call(this,this.renderQueue,t):0<this.renderQueue.length?(this.renderIndex=0, this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this), t());},this))},this));}function o(t){return t.parent&&t.parent.clip.length}function y(){}i.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(j(t)){D(t)&&t.appendToDOM(), t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],n=t.parseClip();n&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+n.left,t.bounds.top+n.top,n.right-n.left,n.bottom-n.top]]), t.clip=o(t)?t.parent.clip.concat(e):e, t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip, D(t)&&t.cleanDOM();}else M(t)&&(t.clip=o(t)?t.parent.clip:[]);D(t)||(t.bounds=null);},this);}, i.prototype.asyncRenderer=function(t,e,n){n=n||Date.now(), this.paint(t[this.renderIndex++]), t.length===this.renderIndex?e():n+20>Date.now()?this.asyncRenderer(t,e,n):setTimeout(g(function(){this.asyncRenderer(t,e);},this),0);}, i.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }');}, i.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}");}, i.prototype.createStyles=function(t,e){var n=t.createElement("style");n.innerHTML=e, t.body.appendChild(n);}, i.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var n=this.getPseudoElement(t,":before"),r=this.getPseudoElement(t,":after");n&&e.push(n), r&&e.push(r);}return L(e)}, i.prototype.getPseudoElement=function(t,e){var n=t.computedStyle(e);if(!n||!n.content||"none"===n.content||"-moz-alt-content"===n.content||"none"===n.display)return null;for(var r,i,o=(r=n.content, (i=r.substr(0,1))===r.substr(r.length-1)&&i.match(/'|"/)?r.substr(1,r.length-2):r),a="url"===o.substr(0,3),s=document.createElement(a?"img":"html2canvaspseudoelement"),h=new d(s,t,e),c=n.length-1;0<=c;c--){var l=n.item(c).replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")});s.style[l]=n[l];}if(s.className=d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER, a)return s.src=m(o)[0].args[0], [h];var u=document.createTextNode(o);return s.appendChild(u), [h,new f(u,h)]}, i.prototype.getChildren=function(n){return L([].filter.call(n.node.childNodes,q).map(function(t){var e=[t.nodeType===Node.TEXT_NODE?new f(t,n):new c(t,n)].filter(z);return t.nodeType===Node.ELEMENT_NODE&&e.length&&"TEXTAREA"!==t.tagName?e[0].isElementVisible()?e.concat(this.getChildren(e[0])):[]:e},this))}, i.prototype.newStackingContext=function(t,e){var n=new p(e,t.getOpacity(),t.node,t.parent);t.cloneTo(n), (e?n.getParentStack(this):n.parent.stack).contexts.push(n), t.stack=n;}, i.prototype.createStackingContexts=function(){this.nodes.forEac
6281h(function(t){var e,n;j(t)&&(this.isRootElement(t)||t.getOpacity()<1||(n=(e=t).css("position"), "auto"!==(-1!==["absolute","relative","fixed"].indexOf(n)?e.css("zIndex"):"auto"))||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):j(t)&&(O(t)&&T(t)||-1!==["inline-block","inline-table"].indexOf(t.css("display"))||B(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack);},this);}, i.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent()}, i.prototype.isRootElement=function(t){return null===t.parent}, i.prototype.sortStackingContexts=function(t){var n;t.contexts.sort((n=t.contexts.slice(0), function(t,e){return t.cssInt("zIndex")+n.indexOf(t)/n.length-(e.cssInt("zIndex")+n.indexOf(e)/n.length)})), t.contexts.forEach(this.sortStackingContexts,this);}, i.prototype.parseTextBounds=function(a){return function(t,e,n){if("none"!==a.parent.css("textDecoration").substr(0,4)||0!==t.trim().length){if(this.support.rangeBounds&&!a.parent.hasTransform()){var r=n.slice(0,e).join("").length;return this.getRangeBounds(a.node,r,t.length)}if(a.node&&"string"==typeof a.node.data){var i=a.node.splitText(t.length),o=this.getWrapperBounds(a.node,a.parent.hasTransform());return a.node=i, o}}else this.support.rangeBounds&&!a.parent.hasTransform()||(a.node=a.node.splitText(t.length));return{}}}, i.prototype.getWrapperBounds=function(t,e){var n=t.ownerDocument.createElement("html2canvaswrapper"),r=t.parentNode,i=t.cloneNode(!0);n.appendChild(t.cloneNode(!0)), r.replaceChild(n,t);var o=e?w(n):a(n);return r.replaceChild(i,n), o}, i.prototype.getRangeBounds=function(t,e,n){var r=this.range||(this.range=t.ownerDocument.createRange());return r.setStart(t,e), r.setEnd(t,e+n), r.getBoundingClientRect()}, i.prototype.parse=function(t){var e=t.contexts.filter(I),n=t.children.filter(j),r=n.filter(R(B)),i=r.filter(R(O)).filter(R(F)),o=n.filter(R(O)).filter(B),a=r.filter(R(O)).filter(F),s=t.contexts.concat(r.filter(O)).filter(T),h=t.children.filter(M).filter(E),c=t.contexts.filter(C);e.concat(i).concat(o).concat(a).concat(s).concat(h).concat(c).forEach(function(t){this.renderQueue.push(t), P(t)&&(this.parse(t), this.renderQueue.push(new y));},this);}, i.prototype.paint=function(t){try{t instanceof y?this.renderer.ctx.restore():M(t)?(D(t.parent)&&t.parent.appendToDOM(), this.paintText(t), D(t.parent)&&t.parent.cleanDOM()):this.paintNode(t);}catch(t){if(s(t), this.options.strict)throw t}}, i.prototype.paintNode=function(t){P(t)&&(this.renderer.setOpacity(t.opacity), this.renderer.ctx.save(), t.hasTransform()&&this.renderer.setTransform(t.parseTransform())), "INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t);}, i.prototype.paintElement=function(n){var r=n.parseBounds();this.renderer.clip(n.backgroundClip,function(){this.renderer.renderBackground(n,r,n.borders.borders.map(N));},this), this.renderer.clip(n.clip,function(){this.renderer.renderBorders(n.borders.borders);},this), this.renderer.clip(n.backgroundClip,function(){switch(n.node.nodeName){case"svg":case"IFRAME":var t=this.images.get(n.node);t?this.renderer.renderImage(n,r,n.borders,t):s("Error loading <"+n.node.nodeName+">",n.node);break;case"IMG":var e=this.images.get(n.node.src);e?this.renderer.renderImage(n,r,n.borders,e):s("Error loading <img>",n.node.src);break;case"CANVAS":this.renderer.renderImage(n,r,n.borders,{image:n.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(n);}},this);}, i.prototype.paintCheckbox=function(t){var e=t.parseBounds(),n=Math.min(e.width,e.height),r={width:n-1,height:n-1,top:e.top,left:e.left},i=[3,3],o=[i,i,i,i],a=[1,1,1,1].map(function(t){return{color:new u("#A5A5A5"),width:t}}),s=S(r,o,a);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(r.left+1,r.top+1,r.width-2,r.height-2,new u("#DEDEDE")), this.renderer.renderBorders(b(a,r,s,o)), t.node.checked&&(this.renderer.font(new u("#424242"),"normal","normal","bold",n-3+"px","arial"), this.renderer.text("✔",r.left+n/6,r.top+n-1));},this);}, i.prototype.paintRadio=function(t){var e=t.parseBounds(),n=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,n,new u("#DEDEDE"),1,new u("#A5A5A5")), t.node.checked&&this.renderer.circle(Math.ceil(e.left+n/4)+1,Math.ceil(e.top+n/4)+1,Math.floor(n/2),new u("#424242"));},this);}, i.prototype.paintFormValue=function(e){var t=e.getValue();if(0<t.length){var n=e.node.ownerDocument,r=n.createElement("html2canvaswrapper");["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"].forEach(function(t){try{r.style[t]=e.css(t);}catch(t){s("html2canvas: Parse: Exception caught in renderFormValue: "+t.message);}});var i=e.parseBounds();r.style.position="fixed", r.style.left=i.left+"px", r.style.top=i.top+"px", r.textContent=t, n.body.appendChild(r), this.paintText(new f(r.firstChild,e)), n.body.removeChild(r);}}, i.prototype.paintText=function(n){n.applyTextTransform();var t,e=h.ucs2.decode(n.node.data),r=this.options.letterRendering&&!/^(normal|none|0px)$/.test(n.parent.css("letterSpacing"))||(t=n.node.data, /[^\u0000-\u00ff]/.test(t))?e.map(function(t){return h.ucs2.encode([t])}):function(t){var e,n=[],r=0,i=!1;for(;t.length;)o=t[r], -1!==[32,13,10,9,45].indexOf(o)===i?((e=t.splice(0,r)).length&&n.push(h.ucs2.encode(e)), i=!i, r=0):r++, r>=t.length&&(e=t.splice(0,r)).length&&n.push(h.ucs2.encode(e));var o;return n}(e),i=n.parent.fontWeight(),o=n.parent.css("fontSize"),a=n.parent.css("fontFamily"),s=n.parent.parseTextShadows();this.renderer.font(n.parent.color("color"),n.parent.css("fontStyle"),n.parent.css("fontVariant"),i,o,a), s.length?this.renderer.fontShadow(s[0].color,s[0].offsetX,s[0].offsetY,s[0].blur):this.renderer.clearShadow(), this.renderer.clip(n.parent.clip,function(){r.map(this.parseTextBounds(n),this).forEac
vendor: 5,354 bytes, line 6281
6281h(function(t,e){t&&!1===/^\s*$/.test(r[e])&&(this.renderer.text(r[e],t.left,t.bottom), this.renderTextDecoration(n.parent,t,this.fontMetrics.getMetrics(a,o)));},this);},this);}, i.prototype.renderTextDecoration=function(t,e,n){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+n.baseline+n.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+n.middle+n.lineWidth),e.width,1,t.color("color"));}};var v={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};function b(a,s,h,c){return a.map(function(t,e){if(0<t.width){var n=s.left,r=s.top,i=s.width,o=s.height-a[2].width;switch(e){case 0:o=a[0].width, t.args=_({c1:[n,r],c2:[n+i,r],c3:[n+i-a[1].width,r+o],c4:[n+a[3].width,r+o]},c[0],c[1],h.topLeftOuter,h.topLeftInner,h.topRightOuter,h.topRightInner);break;case 1:n=s.left+s.width-a[1].width, i=a[1].width, t.args=_({c1:[n+i,r],c2:[n+i,r+o+a[2].width],c3:[n,r+o],c4:[n,r+a[0].width]},c[1],c[2],h.topRightOuter,h.topRightInner,h.bottomRightOuter,h.bottomRightInner);break;case 2:r=r+s.height-a[2].width, o=a[2].width, t.args=_({c1:[n+i,r+o],c2:[n,r+o],c3:[n+a[3].width,r],c4:[n+i-a[3].width,r]},c[2],c[3],h.bottomRightOuter,h.bottomRightInner,h.bottomLeftOuter,h.bottomLeftInner);break;case 3:i=a[3].width, t.args=_({c1:[n,r+o+a[2].width],c2:[n,r],c3:[n+i,r+a[0].width],c4:[n+i,r+o]},c[3],c[0],h.bottomLeftOuter,h.bottomLeftInner,h.topLeftOuter,h.topLeftInner);}}return t})}function x(t,e,n,r){var i=(Math.sqrt(2)-1)/3*4,o=n*i,a=r*i,s=t+n,h=e+r;return{topLeft:k({x:t,y:h},{x:t,y:h-a},{x:s-o,y:e},{x:s,y:e}),topRight:k({x:t,y:e},{x:t+o,y:e},{x:s,y:h-a},{x:s,y:h}),bottomRight:k({x:s,y:e},{x:s,y:e+a},{x:t+o,y:h},{x:t,y:h}),bottomLeft:k({x:s,y:h},{x:s-o,y:h},{x:t,y:e+a},{x:t,y:e})}}function S(t,e,n){var r=t.left,i=t.top,o=t.width,a=t.height,s=e[0][0]<o/2?e[0][0]:o/2,h=e[0][1]<a/2?e[0][1]:a/2,c=e[1][0]<o/2?e[1][0]:o/2,l=e[1][1]<a/2?e[1][1]:a/2,u=e[2][0]<o/2?e[2][0]:o/2,f=e[2][1]<a/2?e[2][1]:a/2,d=e[3][0]<o/2?e[3][0]:o/2,p=e[3][1]<a/2?e[3][1]:a/2,g=o-c,m=a-f,w=o-u,y=a-p;return{topLeftOuter:x(r,i,s,h).topLeft.subdivide(.5),topLeftInner:x(r+n[3].width,i+n[0].width,Math.max(0,s-n[3].width),Math.max(0,h-n[0].width)).topLeft.subdivide(.5),topRightOuter:x(r+g,i,c,l).topRight.subdivide(.5),topRightInner:x(r+Math.min(g,o+n[3].width),i+n[0].width,g>o+n[3].width?0:c-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:x(r+w,i+m,u,f).bottomRight.subdivide(.5),bottomRightInner:x(r+Math.min(w,o-n[3].width),i+Math.min(m,a+n[0].width),Math.max(0,u-n[1].width),f-n[2].width).bottomRight.subdivide(.5),bottomLeftOuter:x(r,i+y,d,p).bottomLeft.subdivide(.5),bottomLeftInner:x(r+n[3].width,i+y,Math.max(0,d-n[3].width),p-n[2].width).bottomLeft.subdivide(.5)}}function k(s,h,c,l){var u=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:s,startControl:h,endControl:c,end:l,subdivide:function(t){var e=u(s,h,t),n=u(h,c,t),r=u(c,l,t),i=u(e,n,t),o=u(n,r,t),a=u(i,o,t);return[k(s,e,i,a),k(a,o,r,l)]},curveTo:function(t){t.push(["bezierCurve",h.x,h.y,c.x,c.y,l.x,l.y]);},curveToReversed:function(t){t.push(["bezierCurve",c.x,c.y,h.x,h.y,s.x,s.y]);}}}function _(t,e,n,r,i,o,a){var s=[];return 0<e[0]||0<e[1]?(s.push(["line",r[1].start.x,r[1].start.y]), r[1].curveTo(s)):s.push(["line",t.c1[0],t.c1[1]]), 0<n[0]||0<n[1]?(s.push(["line",o[0].start.x,o[0].start.y]), o[0].curveTo(s), s.push(["line",a[0].end.x,a[0].end.y]), a[0].curveToReversed(s)):(s.push(["line",t.c2[0],t.c2[1]]), s.push(["line",t.c3[0],t.c3[1]])), 0<e[0]||0<e[1]?(s.push(["line",i[1].end.x,i[1].end.y]), i[1].curveToReversed(s)):s.push(["line",t.c4[0],t.c4[1]]), s}function A(t,e,n,r,i,o,a){0<e[0]||0<e[1]?(t.push(["line",r[0].start.x,r[0].start.y]), r[0].curveTo(t), r[1].curveTo(t)):t.push(["line",o,a]), (0<n[0]||0<n[1])&&t.push(["line",i[0].start.x,i[0].start.y]);}function I(t){return t.cssInt("zIndex")<0}function C(t){return 0<t.cssInt("zIndex")}function T(t){return 0===t.cssInt("zIndex")}function F(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function P(t){return t instanceof p}function E(t){return 0<t.node.data.trim().length}function q(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function O(t){return"static"!==t.css("position")}function B(t){return"none"!==t.css("float")}function R(t){var e=this;return function(){return!t.apply(e,arguments)}}function j(t){return t.node.nodeType===Node.ELEMENT_NODE}function D(t){return!0===t.isPseudoElement}function M(t){return t.node.nodeType===Node.TEXT_NODE}function U(t){return parseInt(t,10)}function N(t){return t.width}function z(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function L(t){return[].concat.apply([],t)}i.prototype.parseBorders=function(o){var r,t=o.parseBounds(),e=(r=o, ["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(t){var e=r.css("border"+t+"Radius"),n=e.split(" ");return n.length<=1&&(n[1]=n[0]), n.map(U)})),n=["Top","Right","Bottom","Left"].map(function(t,e){var n=o.css("border"+t+"Style"),r=o.color("border"+t+"Color");"inset"===n&&r.isBlack()&&(r=new u([255,255,255,r.a]));var i=v[n]?v[n][e]:null;
6281return{width:o.cssInt("border"+t+"Width"),color:i?r[i[0]](i[1]):r,args:null}}),i=S(t,e,n);return{clip:this.parseBackgroundClip(o,i,n,e,t),borders:b(n,t,i,e)}}, i.prototype.parseBackgroundClip=function(t,e,n,r,i){var o=[];switch(t.css("backgroundClip")){case"content-box":case"padding-box":A(o,r[0],r[1],e.topLeftInner,e.topRightInner,i.left+n[3].width,i.top+n[0].width), A(o,r[1],r[2],e.topRightInner,e.bottomRightInner,i.left+i.width-n[1].width,i.top+n[0].width), A(o,r[2],r[3],e.bottomRightInner,e.bottomLeftInner,i.left+i.width-n[1].width,i.top+i.height-n[2].width), A(o,r[3],r[0],e.bottomLeftInner,e.topLeftInner,i.left+n[3].width,i.top+i.height-n[2].width);break;default:A(o,r[0],r[1],e.topLeftOuter,e.topRightOuter,i.left,i.top), A(o,r[1],r[2],e.topRightOuter,e.bottomRightOuter,i.left+i.width,i.top), A(o,r[2],r[3],e.bottomRightOuter,e.bottomLeftOuter,i.left+i.width,i.top+i.height), A(o,r[3],r[0],e.bottomLeftOuter,e.topLeftOuter,i.left,i.top+i.height);}return o}, e.exports=i;},{"./color":3,"./fontmetrics":7,"./log":13,"./nodecontainer":14,"./pseudoelementcontainer":18,"./stackingcontext":21,"./textcontainer":25,"./utils":26,punycode:1}],16:[function(t,e,n){var a=t("./xhr"),r=t("./utils"),s=t("./log"),h=t("./clone"),c=r.decode64;function l(t,e,n){var r="withCredentials"in new XMLHttpRequest;if(!e)return Promise.reject("No proxy configured");var i=f(r),o=d(e,t,i);return r?a(o):u(n,o,i).then(function(t){return c(t.content)})}var i=0;function u(i,o,a){return new Promise(function(e,n){var t=i.createElement("script"),r=function(){delete window.html2canvas.proxy[a], i.body.removeChild(t);};window.html2canvas.proxy[a]=function(t){r(), e(t);}, t.src=o, t.onerror=function(t){r(), n(t);}, i.body.appendChild(t);})}function f(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++i+"_"+Math.round(1e5*Math.random())}function d(t,e,n){return t+"?url="+encodeURIComponent(e)+(n.length?"&callback=html2canvas.proxy."+n:"")}n.Proxy=l, n.ProxyURL=function(t,e,n){var r="crossOrigin"in new Image,i=f(r),o=d(e,t,i);return r?Promise.resolve(o):u(n,o,i).then(function(t){return"data:"+t.type+";base64,"+t.content})}, n.loadUrlDocument=function(t,e,n,r,i,o){return new l(t,e,window.document).then((a=t, function(e){var n,t=new DOMParser;try{n=t.parseFromString(e,"text/html");}catch(t){s("DOMParser not supported, falling back to createHTMLDocument"), n=document.implementation.createHTMLDocument("");try{n.open(), n.write(e), n.close();}catch(t){s("createHTMLDocument write not supported, falling back to document.body.innerHTML"), n.body.innerHTML=e;}}var r=n.querySelector("base");if(!r||!r.href.host){var i=n.createElement("base");i.href=a, n.head.insertBefore(i,n.head.firstChild);}return n})).then(function(t){return h(t,n,r,i,o,0,0)});var a;};},{"./clone":2,"./log":13,"./utils":26,"./xhr":28}],17:[function(t,e,n){var o=t("./proxy").ProxyURL;e.exports=function(n,r){var t=document.createElement("a");t.href=n, n=t.href, this.src=n, this.image=new Image;var i=this;this.promise=new Promise(function(t,e){i.image.crossOrigin="Anonymous", i.image.onload=t, i.image.onerror=e, new o(n,r,document).then(function(t){i.image.src=t;}).catch(e);});};},{"./proxy":16}],18:[function(t,e,n){var r=t("./nodecontainer");function i(t,e,n){r.call(this,t,e), this.isPseudoElement=!0, this.before=":before"===n;}i.prototype.cloneTo=function(t){i.prototype.cloneTo.call(this,t), t.isPseudoElement=!0, t.before=this.before;}, (i.prototype=Object.create(r.prototype)).appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node), this.parent.node.className+=" "+this.getHideClass();}, i.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node), this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"");}, i.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]}, i.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before", i.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after", e.exports=i;},{"./nodecontainer":14}],19:[function(t,e,n){var h=t("./log");function r(t,e,n,r,i){this.width=t, this.height=e, this.images=n, this.options=r, this.document=i;}r.prototype.renderImage=function(t,e,n,r){var i=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),a=t.cssInt("paddingRight"),s=t.cssInt("paddingBottom"),h=n.borders,c=e.width-(h[1].width+h[3].width+i+a),l=e.height-(h[0].width+h[2].width+o+s);this.drawImage(r,0,0,r.image.width||c,r.image.height||l,e.left+i+h[3].width,e.top+o+h[0].width,c,l);}
6281, r.prototype.renderBackground=function(t,e,n){0<e.height&&0<e.width&&(this.renderBackgroundColor(t,e), this.renderBackgroundImage(t,e,n));}, r.prototype.renderBackgroundColor=function(t,e){var n=t.color("backgroundColor");n.isTransparent()||this.rectangle(e.left,e.top,e.width,e.height,n);}, r.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this);}, r.prototype.renderBorder=function(t){t.color.isTransparent()||null===t.args||this.drawShape(t.args,t.color);}, r.prototype.renderBackgroundImage=function(o,a,s){o.parseBackgroundImages().reverse().forEach(function(t,e,n){switch(t.method){case"url":var r=this.images.get(t.args[0]);r?this.renderBackgroundRepeating(o,a,r,n.length-(e+1),s):h("Error loading background-image",t.args[0]);break;case"linear-gradient":case"gradient":var i=this.images.get(t.value);i?this.renderBackgroundGradient(i,a,s):h("Error loading background-image",t.args[0]);break;case"none":break;default:h("Unknown background-image type",t.args[0]);}},this);}, r.prototype.renderBackgroundRepeating=function(t,e,n,r,i){var o=t.parseBackgroundSize(e,n.image,r),a=t.parseBackgroundPosition(e,n.image,r,o);switch(t.parseBackgroundRepeat(r)){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(n,a,o,e,e.left+i[3],e.top+a.top+i[0],99999,o.height,i);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(n,a,o,e,e.left+a.left+i[3],e.top+i[0],o.width,99999,i);break;case"no-repeat":this.backgroundRepeatShape(n,a,o,e,e.left+a.left+i[3],e.top+a.top+i[0],o.width,o.height,i);break;default:this.renderBackgroundRepeat(n,a,o,{top:e.top,left:e.left},i[3],i[0]);}}, e.exports=r;},{"./log":13}],20:[function(t,e,n){var r=t("../renderer"),i=t("../lineargradientcontainer"),o=t("../log");function a(t,e){r.apply(this,arguments), this.canvas=this.options.canvas||this.document.createElement("canvas"), this.options.canvas||(this.canvas.width=t, this.canvas.height=e), this.ctx=this.canvas.getContext("2d"), this.taintCtx=this.document.createElement("canvas").getContext("2d"), this.ctx.textBaseline="bottom", this.variables={}, o("Initialized CanvasRenderer with size",t,"x",e);}function s(t){return 0<t.length}(a.prototype=Object.create(r.prototype)).setFillStyle=function(t){return this.ctx.fillStyle="object"==typeof t&&t.isColor?t.toString():t, this.ctx}, a.prototype.rectangle=function(t,e,n,r,i){this.setFillStyle(i).fillRect(t,e,n,r);}, a.prototype.circle=function(t,e,n,r){this.setFillStyle(r), this.ctx.beginPath(), this.ctx.arc(t+n/2,e+n/2,n/2,0,2*Math.PI,!0), this.ctx.closePath(), this.ctx.fill();}, a.prototype.circleStroke=function(t,e,n,r,i,o){this.circle(t,e,n,r), this.ctx.strokeStyle=o.toString(), this.ctx.stroke();}, a.prototype.drawShape=function(t,e){this.shape(t), this.setFillStyle(e).fill();}, a.prototype.taints=function(e){if(null===e.tainted){this.taintCtx.drawImage(e.image,0,0);try{this.taintCtx.getImageData(0,0,1,1), e.tainted=!1;}catch(t){this.taintCtx=document.createElement("canvas").getContext("2d"), e.tainted=!0;}}return e.tainted}, a.prototype.drawImage=function(t,e,n,r,i,o,a,s,h){this.taints(t)&&!this.options.allowTaint||this.ctx.drawImage(t.image,e,n,r,i,o,a,s,h);}, a.prototype.clip=function(t,e,n){this.ctx.save(), t.filter(s).forEach(function(t){this.shape(t).clip();},this), e.call(n), this.ctx.restore();}, a.prototype.shape=function(t){return this.ctx.beginPath(), t.forEach(function(t,e){"rect"===t[0]?this.ctx.rect.apply(this.ctx,t.slice(1)):this.ctx[0===e?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1));},this), this.ctx.closePath(), this.ctx}, a.prototype.font=function(t,e,n,r,i,o){this.setFillStyle(t).font=[e,n,r,i,o].join(" ").split(",")[0];}, a.prototype.fontShadow=function(t,e,n,r){this.setVariable("shadowColor",t.toString()).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",n).setVariable("shadowBlur",r);}, a.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)");}, a.prototype.setOpacity=function(t){this.ctx.globalAlpha=t;}, a.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]), this.ctx.transform.apply(this.ctx,t.matrix), this.ctx.translate(-t.origin[0],-t.origin[1]);}, a.prototype.setVariable=function(t,e){return this.variables[t]!==e&&(this.variables[t]=this.ctx[t]=e), this}, a.prototype.text=function(t,e,n){this.ctx.fillText(t,e,n);}, a.prototype.backgroundRepeatShape=function(t,e,n,r,i,o,a,s,h){var c=[["line",Math.round(i),Math.round(o)],["line",Math.round(i+a),Math.round(o)],["line",Math.round(i+a),Math.round(s+o)],["line",Math.round(i),Math.round(s+o)]];
6281this.clip([c],function(){this.renderBackgroundRepeat(t,e,n,r,h[3],h[0]);},this);}, a.prototype.renderBackgroundRepeat=function(t,e,n,r,i,o){var a=Math.round(r.left+e.left+i),s=Math.round(r.top+e.top+o);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,n),"repeat")), this.ctx.translate(a,s), this.ctx.fill(), this.ctx.translate(-a,-s);}, a.prototype.renderBackgroundGradient=function(t,e){if(t instanceof i){var n=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){n.addColorStop(t.stop,t.color.toString());}), this.rectangle(e.left,e.top,e.width,e.height,n);}}, a.prototype.resizeImage=function(t,e){var n=t.image;if(n.width===e.width&&n.height===e.height)return n;var r=document.createElement("canvas");return r.width=e.width, r.height=e.height, r.getContext("2d").drawImage(n,0,0,n.width,n.height,0,0,e.width,e.height), r}, e.exports=a;},{"../lineargradientcontainer":12,"../log":13,"../renderer":19}],21:[function(t,e,n){var i=t("./nodecontainer");function r(t,e,n,r){i.call(this,n,r), this.ownStacking=t, this.contexts=[], this.children=[], this.opacity=(this.parent?this.parent.stack.opacity:1)*e;}(r.prototype=Object.create(i.prototype)).getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack}, e.exports=r;},{"./nodecontainer":14}],22:[function(t,e,n){function r(t){this.rangeBounds=this.testRangeBounds(t), this.cors=this.testCORS(), this.svg=this.testSVG();}r.prototype.testRangeBounds=function(t){var e,n,r=!1;return t.createRange&&(e=t.createRange()).getBoundingClientRect&&((n=t.createElement("boundtest")).style.height="123px", n.style.display="block", t.body.appendChild(n), e.selectNode(n), 123===e.getBoundingClientRect().height&&(r=!0), t.body.removeChild(n)), r}, r.prototype.testCORS=function(){return void 0!==(new Image).crossOrigin}, r.prototype.testSVG=function(){var t=new Image,e=document.createElement("canvas"),n=e.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(t,0,0), e.toDataURL();}catch(t){return!1}return!0}, e.exports=r;},{}],23:[function(t,e,n){var r=t("./xhr"),i=t("./utils").decode64;function o(t){this.src=t, this.image=null;var n=this;this.promise=this.hasFabric().then(function(){return n.isInline(t)?Promise.resolve(n.inlineFormatting(t)):r(t)}).then(function(e){return new Promise(function(t){window.html2canvas.svg.fabric.loadSVGFromString(e,n.createCanvas.call(n,t));})});}o.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?Promise.resolve():Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))}, o.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)}, o.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")}, o.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)}, o.prototype.createCanvas=function(r){var i=this;return function(t,e){var n=new window.html2canvas.svg.fabric.StaticCanvas("c");i.image=n.lowerCanvasEl, n.setWidth(e.width).setHeight(e.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(t,e)).renderAll(), r(n.lowerCanvasEl);}}, o.prototype.decode64=function(t){return"function"==typeof window.atob?window.atob(t):i(t)}, e.exports=o;},{"./utils":26,"./xhr":28}],24:[function(t,e,n){var r=t("./svgcontainer");function i(n,t){this.src=n, this.image=null;var r=this;this.promise=t?new Promise(function(t,e){r.image=new Image, r.image.onload=t, r.image.onerror=e, r.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(n), !0===r.image.complete&&t(r.image);}):this.hasFabric().then(function(){return new Promise(function(t){window.html2canvas.svg.fabric.parseSVGDocument(n,r.createCanvas.call(r,t));})});}i.prototype=Object.create(r.prototype), e.exports=i;},{"./svgcontainer":23}],25:[function(t,e,n){var r=t("./nodecontainer");function i(t,e){r.call(this,t,e);}function o(t,e,n){if(0<t.length)return e+n.toUpperCase()}(i.prototype=Object.create(r.prototype)).applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"));}, i.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,o);case"uppercase":return e.toUpperCase();default:return e}}, e.exports=i;},{"./nodecontainer":14}],26:[function(t,e,n){n.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}, n.bind=function(t,e){return function(){return t.apply(e,arguments)}}, n.decode64=function(t){var e,n,r,i,o,a,s,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
6281+/",c=t.length,l="";for(e=0;e<c;e+=4)o=h.indexOf(t[e])<<2|(n=h.indexOf(t[e+1]))>>4, a=(15&n)<<4|(r=h.indexOf(t[e+2]))>>2, s=(3&r)<<6|(i=h.indexOf(t[e+3])), l+=64===r?String.fromCharCode(o):64===i||-1===i?String.fromCharCode(o,a):String.fromCharCode(o,a,s);return l}, n.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),n=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+n,left:e.left,width:n,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}}, n.offsetBounds=function(t){var e=t.offsetParent?n.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}}, n.parseBackgrounds=function(t){var e,n,r,i,o,a,s,h=[],c=0,l=0,u=function(){e&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)), n&&s.push(n), "-"===e.substr(0,1)&&0<(i=e.indexOf("-",1)+1)&&(r=e.substr(0,i), e=e.substr(i)), h.push({prefix:r,method:e.toLowerCase(),value:o,args:s,image:null})), s=[], e=r=n=o="";};return s=[], e=r=n=o="", t.split("").forEach(function(t){if(!(0===c&&-1<" \r\n\t".indexOf(t))){switch(t){case'"':a?a===t&&(a=null):a=t;break;case"(":if(a)break;if(0===c)return c=1, void(o+=t);l++;break;case")":if(a)break;if(1===c){if(0===l)return c=0, o+=t, void u();l--;}break;case",":if(a)break;if(0===c)return void u();if(1===c&&0===l&&!e.match(/^url$/i))return s.push(n), n="", void(o+=t)}o+=t, 0===c?e+=t:n+=t;}}), u(), h};},{}],27:[function(t,e,n){var r=t("./gradientcontainer");function i(t){r.apply(this,arguments), this.type="linear"===t.args[0]?r.TYPES.LINEAR:r.TYPES.RADIAL;}i.prototype=Object.create(r.prototype), e.exports=i;},{"./gradientcontainer":9}],28:[function(t,e,n){e.exports=function(r){return new Promise(function(t,e){var n=new XMLHttpRequest;n.open("GET",r), n.onload=function(){200===n.status?t(n.responseText):e(new Error(n.statusText));}, n.onerror=function(){e(new Error("Network Error"));}, n.send();})};},{}]},{},[4])(4)}), function(t){var n="+".charCodeAt(0),r="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),a="A".charCodeAt(0),s="-".charCodeAt(0),h="_".charCodeAt(0),l=function(t){var e=t.charCodeAt(0);return e===n||e===s?62:e===r||e===h?63:e<i?-1:e<i+10?e-i+26+26:e<a+26?e-a:e<o+26?e-o+26:void 0};t.API.TTFFont=function(){function i(t,e,n){var r;if(this.rawData=t, r=this.contents=new X(t), this.contents.pos=4, "ttcf"===r.readString(4)){if(!e)throw new Error("Mu
6281st specify a font name for TTC files.");throw new Error("Font "+e+" not found in TTC file.")}r.pos=0, this.parse(), this.subset=new T(this), this.registerTTF();}return i.open=function(t,e,n,r){return new i(function(t){var e,n,r,i,o,a;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var s=t.length;o="="===t.charAt(s-2)?2:"="===t.charAt(s-1)?1:0, a=new Uint8Array(3*t.length/4-o), r=0<o?t.length-4:t.length;var h=0;function c(t){a[h++]=t;}for(n=e=0;e<r;e+=4, n+=3)c((16711680&(i=l(t.charAt(e))<<18|l(t.charAt(e+1))<<12|l(t.charAt(e+2))<<6|l(t.charAt(e+3))))>>16), c((65280&i)>>8), c(255&i);return 2===o?c(255&(i=l(t.charAt(e))<<2|l(t.charAt(e+1))>>4)):1===o&&(c((i=l(t.charAt(e))<<10|l(t.charAt(e+1))<<4|l(t.charAt(e+2))>>2)>>8&255), c(255&i)), a}(n),e,r)}, i.prototype.parse=function(){return this.directory=new e(this.contents), this.head=new d(this), this.name=new b(this), this.cmap=new m(this), this.hhea=new g(this), this.maxp=new x(this), this.hmtx=new S(this), this.post=new y(this), this.os2=new w(this), this.loca=new C(this), this.glyf=new _(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]}, i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm, this.bbox=function(){var t,e,n,r;for(r=[], t=0, e=(n=this.bbox).length;t<e;t++)i=n[t], r.push(Math.round(i*this.scaleFactor));return r}.call(this), this.stemV=0, this.post.exists?(e=255&(n=this.post.italic_angle), !0&(t=n>>16)&&(t=-(1+(65535^t))), this.italicAngle=+(t+"."+e)):this.italicAngle=0, this.ascender=Math.round(this.ascender*this.scaleFactor), this.decender=Math.round(this.decender*this.scaleFactor), this.lineGap=Math.round(this.lineGap*this.scaleFactor), this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender, this.xHeight=this.os2.exists&&this.os2.xHeight||0, this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8, this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r, this.isScript=10===this.familyClass, this.flags=0, this.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.cmap.unicode)throw new Error("No unicode cmap for font")}, i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0}, i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm, this.hmtx.forGlyph(t).advance*e}, i.prototype.widthOfString=function(t,e,n){var r,i,o,a,s;for(i=a=o=0, s=(t=""+t).length;0<=s?a<s:s<a;i=0<=s?++a:--a)r=t.charCodeAt(i), o+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/e)||0;return o*(e/1e3)}, i.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1), n=e?this.lineGap:0, (this.ascender+n-this.decender)/1e3*t}, i}();var c,X=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.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}, 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 2147483648<=(t=this.readUInt32())?t-4294967296:t}, t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296), this.writeUInt32(t)}, t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()}, t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255), this.writeByte(255&t)}, t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t}, t.prototype.writeInt16=function(t){return t<0&&(t+=65536), this.writeUInt16(t)}, t.prototype.readString=function(t){var e,n,r;for(n=[], e=r=0;0<=t?r<t:t<r;e=0<=t?++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;0<=r?n<r:r<n;e=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(e)));return i}, 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.readInt=function(){return this.readInt32()}, t.prototype.writeInt=function(t){return this.writeInt32(t)}, t.prototype.read=function(t){var e,n;for(e=[], n=0;0<=t?n<t:t<n;0<=t?++n:--n)e.push(this.readByte());return e}, t.prototype.write=function(t){var e,n,r,i;for(i=[], n=0, r=t.length;n<r;n++)e=t[n], i.push(this.writeByte(e));return i}, t}(),e=function(){var p;function t(t){var e,n,r;for(this.scalarType=t.readInt(), this.tableCount=t.readShort(), this.searchRange=t.readShort(), this.entrySelector=t.readShort(), this.rangeShift=t.readShort(), this.tables={}, n=0, r=this.tableCount;0<=r?n<r:r<n;0<=r?++n:--n)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()}, this.tables[e.tag]=e;}return t.prototype.encode=function(t){var e,n,r,i,o,a,s,h,c,l,u,f,d;for(d in u=Object.keys(t).length, a=Math.log(2), c=16*Math.floor(Math.log(u)/a), i=Math.floor(c/a), h=16*u-c, (n=new X).writeInt(this.scalarType), n.writeShort(u), n.writeShort(c), n.writeShort(i), n.writeShort(h), r=16*u, s=n.pos+r, o=null, f=[], t)for(l=t[d], n.writeString(d), n.writeInt(p(l)), n.writeInt(s), n.writeInt(l.length), f=f.concat(l), "head"===d&&(o=s), s+=l.length;s%4;)f.push(0), s++;return n.write(f), e=2981146554-p(n.data), n.pos=o+8, n.writeUInt32(e), n.data}, p=function(t){var e,n,r,i;for(t=k.call(t);t.length%4;)t.push(0);for(n=new X(t), r=e=0, i=t.length;r<i;r+=4)e+=n.readUInt32();return 4294967295&e}, t}(),u={}.hasOwnProperty,f=function(t,e){for(var n in e)u.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t;}return r.prototype=e.prototype, t.prototype=new r, t.__super__=e.prototype, t};c=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}();var d=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="head", e.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()}, e}(),p=function(){function t(n,t){var e,r,i,o,a,s,h,c,l,u,f,d,p,g,m,w,y,v;switch(this.platformID=n.readUInt16(), this.encodingID=n.readShort(), this.offset=t+n.readInt(), l=n.pos, n.pos=this.offset, this.format=n.readUInt16(), this.length=n.readUInt16(), this.language=n.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;m<256;s=++m)this.codeMap[s]=n.readByte();break;case 4:for(f=n.readUInt16(), u=f/2, n.pos+=6, i=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), n.pos+=2, p=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), h=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), c=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), r=(this.length-n.pos+this.offset)/2, a=function(){var t,e;for(e=[], s=t=0;0<=r?t<r:r<t;s=0<=r?++t:--t)e.push(n.readUInt16());return e}(), s=w=0, v=i.length;w<v;s=++w)for(g=i[s], e=y=d=p[s];d<=g?y<=g:g<=y;e=d<=g?++y:--y)0===c[s]?o=e+h[s]:0!==(o=a[c[s]/2+(e-d)-(u-s)]||0)&&(o+=h[s]), this.codeMap[e]=65535&o;}n.pos=l;}return t.encode=function(t,e){var n,r,i,o,a,s,h,c,l,u,f,d,p,g,m,w,y,v,b,x,S,k,_,A,I,C,T,F,P,E,q,O,B,R,j,D,M,U,N,z,L,H,W,G,V,Y;switch(F=new X, o=Object.keys(t).sort(function(t,e){return t-e}), e){case"macroman":for(p=0, g=function(){var t,e;for(e=[], d=t=0;t<256;d=++t)e.push(0);return e}(), w={0:0}, i={}, P=0, B=o.length;P<B;P++)null==w[W=t[r=o[P]]]&&(w[W]=++p), i[r]={old:t[r],new:w[t[r]]}, g[r]=w[t[r]];return F.writeUInt16(1), F.writeUInt16(0), F.writeUInt32(12), F.writeUInt16(0), F.writeUInt16(262), F.writeUInt16(0), F.write(g), {charMap:i,subtable:F.data,maxGlyphID:p+1};case"unicode":for(C=[], l=[], w={}, n={}, m=h=null, E=y=0, R=o.length;E<R;E++)null==w[b=t[r=o[E]]]&&(w[b]=++y), n[r]={old:b,new:w[b]}, a=w[b]-r, null!=m&&a===h||(m&&l.push(m), C.push(r), h=a), m=r;
6281for(m&&l.push(m), l.push(65535), C.push(65535), A=2*(_=C.length), k=2*Math.pow(Math.log(_)/Math.LN2,2), u=Math.log(k/2)/Math.LN2, S=2*_-k, s=[], x=[], f=[], d=q=0, j=C.length;q<j;d=++q){if(I=C[d], c=l[d], 65535===I){s.push(0), x.push(0);break}if(32768<=I-(T=n[I].new))for(s.push(0), x.push(2*(f.length+_-d)), r=O=I;I<=c?O<=c:c<=O;r=I<=c?++O:--O)f.push(n[r].new);else s.push(T-I), x.push(0);}for(F.writeUInt16(3), F.writeUInt16(1), F.writeUInt32(12), F.writeUInt16(4), F.writeUInt16(16+8*_+2*f.length), F.writeUInt16(0), F.writeUInt16(A), F.writeUInt16(k), F.writeUInt16(u), F.writeUInt16(S), L=0, D=l.length;L<D;L++)r=l[L], F.writeUInt16(r);for(F.writeUInt16(0), H=0, M=C.length;H<M;H++)r=C[H], F.writeUInt16(r);for(G=0, U=s.length;G<U;G++)a=s[G], F.writeUInt16(a);for(V=0, N=x.length;V<N;V++)v=x[V], F.writeUInt16(v);for(Y=0, z=f.length;Y<z;Y++)p=f[Y], F.writeUInt16(p);return{charMap:n,subtable:F.data,maxGlyphID:y+1}}}, t}(),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="cmap", e.prototype.parse=function(t){var e,n,r;for(t.pos=this.offset, this.version=t.readUInt16(), n=t.readUInt16(), this.tables=[], this.unicode=null, r=0;0<=n?r<n:n<r;0<=n?++r:--r)e=new p(t,this.offset), this.tables.push(e), e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0}, e.encode=function(t,e){var n,r;return null==e&&(e="macroman"), n=p.encode(t,e), (r=new X).writeUInt16(0), r.writeUInt16(1), n.table=r.data.concat(n.subtable), n}, e}(),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="hhea", e.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()}, e}(),w=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="OS/2", e.prototype.parse=function(n){if(n.pos=this.offset, this.version=n.readUInt16(), this.averageCharWidth=n.readShort(), this.weightClass=n.readUInt16(), this.widthClass=n.readUInt16(), this.type=n.readShort(), this.ySubscriptXSize=n.readShort(), this.ySubscriptYSize=n.readShort(), this.ySubscriptXOffset=n.readShort(), this.ySubscriptYOffset=n.readShort(), this.ySuperscriptXSize=n.readShort(), this.ySuperscriptYSize=n.readShort(), this.ySuperscriptXOffset=n.readShort(), this.ySuperscriptYOffset=n.readShort(), this.yStrikeoutSize=n.readShort(), this.yStrikeoutPosition=n.readShort(), this.familyClass=n.readShort(), this.panose=function(){var t,e;for(e=[], t=0;t<10;++t)e.push(n.readByte());return e}(), this.charRange=function(){var t,e;for(e=[], t=0;t<4;++t)e.push(n.readInt());return e}(), this.vendorID=n.readString(4), this.selection=n.readShort(), this.firstCharIndex=n.readShort(), this.lastCharIndex=n.readShort(), 0<this.version&&(this.ascent=n.readShort(), this.descent=n.readShort(), this.lineGap=n.readShort(), this.winAscent=n.readShort(), this.winDescent=n.readShort(), this.codePageRange=function(){var t,e;for(e=[], t=0;t<2;++t)e.push(n.readInt());return e}(), 1<this.version))return this.xHeight=n.readShort(), this.capHeight=n.readShort(), this.defaultChar=n.readShort(), this.breakChar=n.readShort(), this.maxContext=n.readShort()}, e}(),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="post", e.prototype.parse=function(r){var t,e,n,i;switch(r.pos=this.offset, this.format=r.readInt(), this.italicAngle=r.readInt(), this.underlinePosition=r.readShort(), this.underlineThickness=r.readShort(), this.isFixedPitch=r.readInt(), this.minMemType42=r.readInt(), this.maxMemType42=r.readInt(), this.minMemType1=r.readInt(), this.maxMemType1=r.readInt(), this.format){case 65536:break;case 131072:for(e=r.readUInt16(), this.glyphNameIndex=[], n=0;0<=e?n<e:e<n;0<=e?++n:--n)this.glyphNameIndex.push(r.readUInt16());for(this.names=[], i=[];r.pos<this.offset+this.length;)t=r.readByte(), i.push(this.names.push(r.readString(t)));return i;case 151552:return e=r.readUInt16(), this.offsets=r.read(e);case 196608:break;case 262144:return this.map=function(){var t,e,n;for(n=[], t=0, e=this.file.maxp.numGlyphs;0<=e?t<e:e<t;0<=e?++t:--t)n.push(r.readUInt32());return n}.call(this)}}, e}(),v=function(t,e){this.raw=t, this.length=t.length, this.platformID=e.platformID, this.encodingID=e.encodingID, this.languageID=e.languageID;},b=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="name", e.prototype.parse=function(t){var e,n,r,i,o,a,s,h,c,l,u,f;for(t.pos=this.offset, t.readShort(), e=t.readShort(), a=t.readShort(), n=[], i=c=0;0<=e?c<e:e<c;i=0<=e?++c:--c)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+a+t.readShort()});for(s={}, i=l=0, u=n.length;l<u;i=++l)r=n[i], t.pos=r.offset, h=t.readString(r.length), o=new v(h,r), null==s[f=r.nameID]&&(s[f]=[]), s[r.nameID].push(o);return this.strings=s, this.copyright=s[0], this.fontFamily=s[1], this.fontSubfam
6281ily=s[2], this.uniqueSubfamily=s[3], this.fontName=s[4], this.version=s[5], this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,""), this.trademark=s[7], this.manufacturer=s[8], this.designer=s[9], this.description=s[10], this.vendorUrl=s[11], this.designerUrl=s[12], this.license=s[13], this.licenseUrl=s[14], this.preferredFamily=s[15], this.preferredSubfamily=s[17], this.compatibleFull=s[18], this.sampleText=s[19]}, e}(),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="maxp", e.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()}, e}(),S=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="hmtx", e.prototype.parse=function(n){var t,r,i,e,o,a,s;for(n.pos=this.offset, this.metrics=[], e=0, a=this.file.hhea.numberOfMetrics;0<=a?e<a:a<e;0<=a?++e:--e)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics, this.leftSideBearings=function(){var t,e;for(e=[], t=0;0<=r?t<r:r<t;0<=r?++t:--t)e.push(n.readInt16());return e}(), this.widths=function(){var t,e,n,r;for(r=[], t=0, e=(n=this.metrics).length;t<e;t++)i=n[t], r.push(i.advance);return r}.call(this), t=this.widths[this.widths.length-1], s=[], o=0;0<=r?o<r:r<o;0<=r?++o:--o)s.push(this.widths.push(t));return s}, e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}}, e}(),k=[].slice,_=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="glyf", e.prototype.parse=function(t){return this.cache={}}, e.prototype.glyphFor=function(t){var e,n,r,i,o,a,s,h,c,l;return(t=t)in this.cache?this.cache[t]:(i=this.file.loca, e=this.file.contents, n=i.indexOf(t), 0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n, o=(a=new X(e.read(r))).readShort(), h=a.readShort(), l=a.readShort(), s=a.readShort(), c=a.readShort(), this.cache[t]=-1===o?new I(a,h,l,s,c):new A(a,o,h,l,s,c), this.cache[t]))}, e.prototype.encode=function(t,e,n){var r,i,o,a,s;for(o=[], i=[], a=0, s=e.length;a<s;a++)r=t[e[a]], i.push(o.length), r&&(o=o.concat(r.encode(n)));return i.push(o.length), {table:o,offsets:i}}, e}(),A=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}(),I=function(){function t(t,e,n,r,i){var o,a;for(this.raw=t, this.xMin=e, this.yMin=n, this.xMax=r, this.yMax=i, this.compound=!0, this.glyphIDs=[], this.glyphOffsets=[], o=this.raw;a=o.readShort(), this.glyphOffsets.push(o.pos), this.glyphIDs.push(o.readShort()), 32&a;)o.pos+=1&a?4:2, 128&a?o.pos+=8:64&a?o.pos+=4:8&a&&(o.pos+=2);}return t.prototype.encode=function(t){var e,n,r,i,o;for(n=new X(k.call(this.raw.data)), e=r=0, i=(o=this.glyphIDs).length;r<i;e=++r)o[e], n.pos=this.glyphOffsets[e];return n.data}, t}(),C=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="loca", e.prototype.parse=function(r){var t;return r.pos=this.offset, t=this.file.head.indexToLocFormat, this.offsets=0===t?function(){var t,e,n;for(n=[], t=0, e=this.length;t<e;t+=2)n.push(2*r.readUInt16());return n}.call(this):function(){var t,e,n;for(n=[], t=0, e=this.length;t<e;t+=4)n.push(r.readUInt32());return n}.call(this)}, e.prototype.indexOf=function(t){return this.offsets[t]}, e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]}, e.prototype.encode=function(t,e){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,o=0;o<n.length;++o)if(n[o]=r, i<e.length&&e[i]==o){++i, n[o]=r;var a=this.offsets[o],s=this.offsets[o+1]-a;0<s&&(r+=s);}for(var h=new Array(4*n.length),c=0;c<n.length;
6281++c)h[4*c+3]=255&n[c], h[4*c+2]=(65280&n[c])>>8, h[4*c+1]=(16711680&n[c])>>16, h[4*c]=(4278190080&n[c])>>24;return h}, e}(),T=function(){function t(t){this.font=t, this.subset={}, this.unicodes={}, this.next=33;}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap, t={}, i=this.subset)n=i[e], t[e]=r[n];return t}, t.prototype.glyphsFor=function(t){var e,n,r,i,o,a,s;for(r={}, o=0, a=t.length;o<a;o++)r[i=t[o]]=this.font.glyf.glyphFor(i);for(i in e=[], r)(null!=(n=r[i])?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(0<e.length)for(i in s=this.glyphsFor(e))n=s[i], r[i]=n;return r}, t.prototype.encode=function(t){var e,n,r,i,o,a,s,h,c,l,u,f,d,p,g;for(n in e=m.encode(this.generateCmap(),"unicode"), i=this.glyphsFor(t), u={0:0}, g=e.charMap)u[(a=g[n]).old]=a.new;for(f in l=e.maxGlyphID, i)f in u||(u[f]=l++);return h=function(t){var e,n;for(e in n={}, t)n[t[e]]=e;return n}(u), c=Object.keys(h).sort(function(t,e){return t-e}), d=function(){var t,e,n;for(n=[], t=0, e=c.length;t<e;t++)o=c[t], n.push(h[o]);return n}(), r=this.font.glyf.encode(i,d,u), s=this.font.loca.encode(r.offsets,d), p={cmap:this.font.cmap.raw(),glyf:r.table,loca:s,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.raw()}, this.font.os2.exists&&(p["OS/2"]=this.font.os2.raw()), this.font.directory.encode(p)}, t}();t.API.PDFObject=function(){var o;function a(){}return o=function(t,e){return(Array(e+1).join("0")+t).slice(-e)}, a.convert=function(r){var i,t,e,n;if(Array.isArray(r))return"["+function(){var t,e,n;for(n=[], t=0, e=r.length;t<e;t++)i=r[t], n.push(a.convert(i));return n}().join(" ")+"]";if("string"==typeof r)return"/"+r;if(null!=r?r.isString:void 0)return"("+r+")";if(r instanceof Date)return"(D:"+o(r.getUTCFullYear(),4)+o(r.getUTCMonth(),2)+o(r.getUTCDate(),2)+o(r.getUTCHours(),2)+o(r.getUTCMinutes(),2)+o(r.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(r)){for(t in e=["<<"], r)n=r[t], e.push("/"+t+" "+a.convert(n));return e.push(">>"), e.join("\n")}return""+r}, a}();}($), pt="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")(), gt=function(){var c,n,r;function i(t){var e,n,r,i,o,a,s,h,c,l,u,f,d,p;for(this.data=t, this.pos=8, this.palette=[], this.imgData=[], this.transparency={}, this.animation=null, this.text={}, a=null;;){switch(e=this.readUInt32(), c=function(){var t,e;for(e=[], t=0;t<4;++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"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":a&&this.animation.frames.push(a), this.pos+=4, a={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()}, o=this.readUInt16(), i=this.readUInt16()||100, a.delay=1e3*o/i, a.disposeOp=this.data[this.pos++], a.blendOp=this.data[this.pos++], a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===c&&(this.pos+=4, e-=4), t=(null!=a?a.data:void 0)||this.imgData, f=0;0<=e?f<e:e<f;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={}, this.colorType){case 3:if(r=this.palette.length/3, this.transparency.indexed=this.read(e), this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(l=r-this.transparency.indexed.length))for(d=0;0<=l?d<l:l<d;0<=l?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e);}break;case"tEXt":s=(u=this.read(e)).indexOf(0), h=String.fromCharCode.apply(String,u.slice(0,s)), this.text[h]=String.fromCharCode.apply(String,u.slice(s+1));break;case"IEND":return a&&this.animation.frames.push(a), 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===(p=this.colorType)||6===p, n=this.colors+(this.hasAlphaChannel?1:0), this.pixelBitlength=this.bits*n, this.colorSpace
6281=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this), void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e;}if(this.pos+=4, this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e), (r=new XMLHttpRequest).open("GET",t,!0), r.responseType="arraybuffer", r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)), "function"==typeof(null!=e?e.getContext:void 0)&&t.render(e), "function"==typeof n?n(t):void 0}, r.send(null)}, i.prototype.read=function(t){var e,n;for(n=[], e=0;0<=t?e<t:t<e;0<=t?++e:--e)n.push(this.data[this.pos++]);return n}, i.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]}, i.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]}, i.prototype.decodePixels=function(E){var q=this.pixelBitlength/8,O=new Uint8Array(this.width*this.height*q),B=0,R=this;if(null==E&&(E=this.imgData), 0===E.length)return new Uint8Array(0);function t(t,e,n,r){var i,o,a,s,h,c,l,u,f,d,p,g,m,w,y,v,b,x,S,k,_,A=Math.ceil((R.width-t)/n),I=Math.ceil((R.height-e)/r),C=R.width==A&&R.height==I;for(w=q*A, g=C?O:new Uint8Array(w*I), c=E.length, o=m=0;m<I&&B<c;){switch(E[B++]){case 0:for(s=b=0;b<w;s=b+=1)g[o++]=E[B++];break;case 1:for(s=x=0;x<w;s=x+=1)i=E[B++], h=s<q?0:g[o-q], g[o++]=(i+h)%256;break;case 2:for(s=S=0;S<w;s=S+=1)i=E[B++], a=(s-s%q)/q, y=m&&g[(m-1)*w+a*q+s%q], g[o++]=(y+i)%256;break;case 3:for(s=k=0;k<w;s=k+=1)i=E[B++], a=(s-s%q)/q, h=s<q?0:g[o-q], y=m&&g[(m-1)*w+a*q+s%q], g[o++]=(i+Math.floor((h+y)/2))%256;break;case 4:for(s=_=0;_<w;s=_+=1)i=E[B++], a=(s-s%q)/q, h=s<q?0:g[o-q], 0===m?y=v=0:(y=g[(m-1)*w+a*q+s%q], v=a&&g[(m-1)*w+(a-1)*q+s%q]), l=h+y-v, u=Math.abs(l-h), d=Math.abs(l-y), p=Math.abs(l-v), f=u<=d&&u<=p?h:d<=p?y:v, g[o++]=(i+f)%256;break;default:throw new Error("Invalid filter algorithm: "+E[B-1])}if(!C){var T=((e+m*r)*R.width+t)*q,F=m*w;for(s=0;s<A;s+=1){for(var P=0;P<q;P+=1)O[T++]=g[F++];T+=(n-1)*q;}}m++;}}return E=(E=new kt(E)).getBytes(), 1==R.interlaceMethod?(t(0,0,8,8), t(4,0,8,8), t(0,4,4,8), t(2,0,4,4), t(0,2,2,4), t(1,0,2,2), t(0,1,1,2)):t(0,0,1,1), O}, i.prototype.decodePalette=function(){var t,e,n,r,i,o,a,s,h;for(n=this.palette, o=this.transparency.indexed||[], i=new Uint8Array((o.length||0)+n.length), r=0, n.length, e=a=t=0, s=n.length;a<s;e=a+=3)i[r++]=n[e], i[r++]=n[e+1], i[r++]=n[e+2], i[r++]=null!=(h=o[t++])?h:255;return i}, i.prototype.copyToImageData=function(t,e){var n,r,i,o,a,s,h,c,l,u,f;if(r=this.colors, l=null, n=this.hasAlphaChannel, this.palette.length&&(l=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(), r=4, n=!0), c=(i=t.data||t).length, a=l||e, o=s=0, 1===r)for(;o<c;)h=l?4*e[o/4]:s, u=a[h++], i[o++]=u, i[o++]=u, i[o++]=u, i[o++]=n?a[h++]:255, s=h;else for(;o<c;)h=l?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;}, i.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4), this.copyToImageData(t,this.decodePixels()), t};try{n=pt.document.createElement("canvas"), r=n.getContext("2d");}catch(t){return-1}return c=function(t){var e;return r.width=t.width, r.height=t.height, r.clearRect(0,0,t.width,t.height), r.putImageData(t,0,0), (e=new Image).src=n.toDataURL(), e}, i.prototype.decodeFrames=function(t){var e,n,r,i,o,a,s,h;if(this.animation){for(h=[], n=o=0, a=(s=this.animation.frames).length;o<a;n=++o)e=s[n], r=t.createImageData(e.width,e.height), i=this.decodePixels(new Uint8Array(e.data)), this.copyToImageData(r,i), e.imageData=r, h.push(e.image=c(r));return h}}, i.prototype.renderFrame=function(t,e){var n,r,i;return n=(r=this.animation.frames)[e], i=r[e-1], 0===e&&t.clearRect(0,0,this.width,this.height), 1===(null!=i?i.disposeOp:void 0)?t.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&t.putImageData(i.imageData,i.xOffset,i.yOffset), 0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height), t.drawImage(n.image,n.xOffset,n.yOffset)}, i.prototype.animate=function(n){var r,i,o,a,s,t,h=this;return i=0, t=this.animation, a=t.numFrames, o=t.frames, s=t.numPlays, (r=function(){var t,e;if(t=i++%a, e=o[t], h.renderFrame(n,t), 1<a&&i/a<s)return h.animation._timeout=setTimeout(r,e.delay)})()}, i.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)}, i.prototype.render=function(t){var e,n;return t._png&&t._png.stopAnimation(), t._png=this, t.width=this.width, t.height=this.height, e=t.getContext("2d"), this.animation?(this.decodeFrames(e), this.animate(e)):(n=e.createImageData(this.width,this.height), this.copyToImageData(n,this.decodePixels()), e.putImageData(n,0,0))}, i}(), pt.PNG=gt;
6282/*
6283   * Extracted from pdf.js
6284   * https://github.com/andreasgal/pdf.js
6285   *
6286   * Copyright (c) 2011 Mozilla Foundation
6287   *
6288   * Contributors: Andreas Gal <[email protected]>
6289   *               Chris G Jones <[email protected]>
6290   *               Shaon Barman <[email protected]>
6291   *               Vivien Nicolas <[email protected]>
6292   *               Justin D'Arcangelo <[email protected]>
6293   *               Yury Delendik
6294   *
6295   * 
6296   */
6297var St=function(){function t(){this.pos=0, this.bufferLength=0, this.eof=!1, this.buffer=null;}return t.prototype={ensureBuffer:function(t){var e=this.buffer,n=e?e.byteLength:0;if(t<n)return e;for(var r=512;r<t;)r<<=1;for(var i=new Uint8Array(r),o=0;o<n;++o)i[o]=e[o];return this.buffer=i},getByte:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock();}return this.buffer[this.pos++]},getBytes:function(t){var e=this.pos;if(t){this.ensureBuffer(e+t);for(var n=e+t;!this.eof&&this.bufferLength<n;)this.readBlock();var r=this.bufferLength;r<n&&(n=r);}else{for(;!this.eof;)this.readBlock();n=this.bufferLength;}return this.pos=n, this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock();}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock();}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1), this.pos+=t;},reset:function(){this.pos=0;}}, t}(),kt=function(){if("undefined"!=typeof Uint32Array){var F=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),P=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),E=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),q=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,5243
629769,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],O=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return(t.prototype=Object.create(St.prototype)).getBits=function(t){for(var e,n=this.codeSize,r=this.codeBuf,i=this.bytes,o=this.bytesPos;n<t;)void 0===(e=i[o++])&&B("Bad encoding in flate stream"), r|=e<<n, n+=8;return e=r&(1<<t)-1, this.codeBuf=r>>t, this.codeSize=n-=t, this.bytesPos=o, e}, t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,a=this.bytesPos;r<n;){var s;void 0===(s=o[a++])&&B("Bad encoding in flate stream"), i|=s<<r, r+=8;}var h=e[i&(1<<n)-1],c=h>>16,l=65535&h;return(0==r||r<c||0==c)&&B("Bad encoding in flate stream"), this.codeBuf=i>>c, this.codeSize=r-c, this.bytesPos=a, l}, t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;r<e;++r)t[r]>n&&(n=t[r]);for(var i=1<<n,o=new Uint32Array(i),a=1,s=0,h=2;a<=n;++a, s<<=1, h<<=1)for(var c=0;c<e;++c)if(t[c]==a){var l=0,u=s;for(r=0;r<a;++r)l=l<<1|1&u, u>>=1;for(r=l;r<i;r+=h)o[r]=a<<16|c;++s;}return[o,n]}, t.prototype.readBlock=function(){function t(t,e,n,r,i){for(var o=t.getBits(n)+r;0<o--;)e[h++]=i;}var e=this.getBits(3);if(1&e&&(this.eof=!0), 0!=(e>>=1)){var n,r;if(1==e)n=q, r=O;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,a=this.getBits(4)+4,s=Array(F.length),h=0;h<a;)s[F[h++]]=this.getBits(3);for(var c=this.generateHuffmanTable(s),l=0,u=(h=0, i+o),f=new Array(u);h<u;){var d=this.getCode(c);16==d?t(this,f,2,3,l):17==d?t(this,f,3,3,l=0):18==d?t(this,f,7,11,l=0):f[h++]=l=d;}n=this.generateHuffmanTable(f.slice(0,i)), r=this.generateHuffmanTable(f.slice(i,u));}else B("Unknown block type in flate stream");for(var p=(I=this.buffer)?I.length:0,g=this.bufferLength;;){var m=this.getCode(n);if(m<256)p<=g+1&&(p=(I=this.ensureBuffer(g+1)).length), I[g++]=m;else{if(256==m)return void(this.bufferLength=g);var w=(m=P[m-=257])>>16;0<w&&(w=this.getBits(w));l=(65535&m)+w;m=this.getCode(r), 0<(w=(m=E[m])>>16)&&(w=this.getBits(w));var y=(65535&m)+w;p<=g+l&&(p=(I=this.ensureBuffer(g+l)).length);for(var v=0;v<l;++v, ++g)I[g]=I[g-y];}}}else{var b,x=this.bytes,S=this.bytesPos;void 0===(b=x[S++])&&B("Bad block header in flate stream");var k=b;void 0===(b=x[S++])&&B("Bad block header in flate stream"), k|=b<<8, void 0===(b=x[S++])&&B("Bad block header in flate stream");var _=b;void 0===(b=x[S++])&&B("Bad block header in flate stream"), (_|=b<<8)!=(65535&~k)&&B("Bad uncompressed block length in flate stream"), this.codeBuf=0, this.codeSize=0;var A=this.bufferLength,I=this.ensureBuffer(A+k),C=A+k;this.bufferLength=C;for(var T=A;T<C;++T){if(void 0===(b=x[S++])){this.eof=!0;break}I[T]=b;}this.bytesPos=S;}}, t}function B(t){throw new Error(t)}function t(t){var e=0,n=t[e++],r=t[e++];-1!=n&&-1!=r||B("Invalid header in flate stream"), 8!=(15&n)&&B("Unknown compression method in flate stream"), ((n<<8)+r)%31!=0&&B("Bad FCHECK in flate stream"), 32&r&&B("FDICT bit set in flate stream"), this.bytes=t, this.bytesPos=2, this.codeSize=0, this.codeBuf=0, St.call(this);}}();return function(t){if("object"!=typeof t.console){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i);}var s,h,c,l,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
6297+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,h="",c=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63, n=o>>12&63, r=o>>6&63, i=63&o, c[s++]=u.charAt(e)+u.charAt(n)+u.charAt(r)+u.charAt(i), a<t.length;);h=c.join("");var l=t.length%3;return(l?h.slice(0,l-3):h)+"===".slice(l||3)}), void 0===t.atob&&(t.atob=function(t){var e,n,r,i,o,a,s=0,h=0,c=[];if(!t)return t;for(t+="";e=(a=u.indexOf(t.charAt(s++))<<18|u.indexOf(t.charAt(s++))<<12|(i=u.indexOf(t.charAt(s++)))<<6|(o=u.indexOf(t.charAt(s++))))>>16&255, n=a>>8&255, r=255&a, c[h++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r), s<t.length;);return c.join("")}), Array.prototype.map||(Array.prototype.map=function(t){if(null==this||"function"!=typeof t)throw new TypeError;for(var e=Object(this),n=e.length>>>0,r=new Array(n),i=1<arguments.length?arguments[1]:void 0,o=0;o<n;o++)o in e&&(r[o]=t.call(i,e[o],o,e));return r}), Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}), Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(null==this||"function"!=typeof t)throw new TypeError;for(var n=Object(this),r=n.length>>>0,i=0;i<r;i++)i in n&&t.call(e,n[i],i,n);}), Object.keys||(Object.keys=(s=Object.prototype.hasOwnProperty, h=!{toString:null}.propertyIsEnumerable("toString"), l=(c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length, function(t){if("object"!=typeof t&&("function"!=typeof t||null===t))throw new TypeError;var e,n,r=[];for(e in t)s.call(t,e)&&r.push(e);if(h)for(n=0;n<l;n++)s.call(t,c[n])&&r.push(c[n]);return r})), "function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var n=arguments[e];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t}), String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}), String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}), String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")});}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), $});
6298});
6299
6300var jspdf_min_1 = jspdf_min.jsPDF;
6301var jspdf_min_2 = jspdf_min.saveAs;
6302var jspdf_min_3 = jspdf_min.GifWriter;
6303var jspdf_min_4 = jspdf_min.GifReader;
6304
6305var Path = createCommonjsModule(function (module, exports) {
6306Object.defineProperty(exports, "__esModule", {
6307    value: true
6308});
6309var PATH = exports.PATH = {
6310    VECTOR: 0,
6311    BEZIER_CURVE: 1,
6312    CIRCLE: 2
6313};
6314});
6315
6316unwrapExports(Path);
6317var Path_1 = Path.PATH;
6318
6319var Color_1 = createCommonjsModule(function (module, exports) {
6320Object.defineProperty(exports, "__esModule", {
6321    value: true
6322});
6323
6324var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
6325
6326var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
6327
6328function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6329
6330var HEX3 = /^#([a-f0-9]{3})$/i;
6331var hex3 = function hex3(value) {
6332    var match = value.match(HEX3);
6333    if (match) {
6334        return [parseInt(match[1][0] + match[1][0], 16), parseInt(match[1][1] + match[1][1], 16), parseInt(match[1][2] + match[1][2], 16), null];
6335    }
6336    return false;
6337};
6338
6339var HEX6 = /^#([a-f0-9]{6})$/i;
6340var hex6 = function hex6(value) {
6341    var match = value.match(HEX6);
6342    if (match) {
6343        return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
6344    }
6345    return false;
6346};
6347
6348var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
6349var rgb = function rgb(value) {
6350    var match = value.match(RGB);
6351    if (match) {
6352        return [Number(match[1]), Number(match[2]), Number(match[3]), null];
6353    }
6354    return false;
6355};
6356
6357var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
6358var rgba = function rgba(value) {
6359    var match = value.match(RGBA);
6360    if (match && match.length > 4) {
6361        return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
6362    }
6363    return false;
6364};
6365
6366var fromArray = function fromArray(array) {
6367    return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
6368};
6369
6370var namedColor = function namedColor(name) {
6371    var color = NAMED_COLORS[name.toLowerCase()];
6372    return color ? color : false;
6373};
6374
6375var Color = function () {
6376    function Color(value) {
6377        _classCallCheck(this, Color);
6378
6379        var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
6380            _ref2 = _slicedToArray(_ref, 4),
6381            r = _ref2[0],
6382            g = _ref2[1],
6383            b = _ref2[2],
6384            a = _ref2[3];
6385
6386        this.r = r;
6387        this.g = g;
6388        this.b = b;
6389        this.a = a;
6390    }
6391
6392    _createClass(Color, [{
6393        key: 'isTransparent',
6394        value: function isTransparent() {
6395            return this.a === 0;
6396        }
6397    }, {
6398        key: 'toString',
6399        value: function toString() {
6400            return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
6401        }
6402    }]);
6403
6404    return Color;
6405}();
6406
6407exports.default = Color;
6408
6409
6410var NAMED_COLORS = {
6411    transparent: [0, 0, 0, 0],
6412    aliceblue: [240, 248, 255, null],
6413    antiquewhite: [250, 235, 215, null],
6414    aqua: [0, 255, 255, null],
6415    aquamarine: [127, 255, 212, null],
6416    azure: [240, 255, 255, null],
6417    beige: [245, 245, 220, null],
6418    bisque: [255, 228, 196, null],
6419    black: [0, 0, 0, null],
6420    blanchedalmond: [255, 235, 205, null],
6421    blue: [0, 0, 255, null],
6422    blueviolet: [138, 43, 226, null],
6423    brown: [165, 42, 42, null],
6424    burlywood: [222, 184, 135, null],
6425    cadetblue: [95, 158, 160, null],
6426    chartreuse: [127, 255, 0, null],
6427    chocolate: [210, 105, 30, null],
6428    coral: [255, 127, 80, null],
6429    cornflowerblue: [100, 149, 237, null],
6430    cornsilk: [255, 248, 220, null],
6431    crimson: [220, 20, 60, null],
6432    cyan: [0, 255, 255, null],
6433    darkblue: [0, 0, 139, null],
6434    darkcyan: [0, 139, 139, null],
6435    darkgoldenrod: [184, 134, 11, null],
6436    darkgray: [169, 169, 169, null],
6437    darkgreen: [0, 100, 0, null],
6438    darkgrey: [169, 169, 169, null],
6439    darkkhaki: [189, 183, 107, null],
6440    darkmagenta: [139, 0, 139, null],
6441    darkolivegreen: [85, 107, 47, null],
6442    darkorange: [255, 140, 0, null],
6443    darkorchid: [153, 50, 204, null],
6444    darkred: [139, 0, 0, null],
6445    darksalmon: [233, 150, 122, null],
6446    darkseagreen: [143, 188, 143, null],
6447    darkslateblue: [72, 61, 139, null],
6448    darkslategray: [47, 79, 79, null],
6449    darkslategrey: [47, 79, 79, null],
6450    darkturquoise: [0, 206, 209, null],
6451    darkviolet: [148, 0, 211, null],
6452    deeppink: [255, 20, 147, null],
6453    deepskyblue: [0, 191, 255, null],
6454    dimgray: [105, 105, 105, null],
6455    dimgrey: [105, 105, 105, null],
6456    dodgerblue: [30, 144, 255, null],
6457    firebrick: [178, 34, 34, null],
6458    floralwhite: [255, 250, 240, null],
6459    forestgreen: [34, 139, 34, null],
6460    fuchsia: [255, 0, 255, null],
6461    gainsboro: [220, 220, 220, null],
6462    ghostwhite: [248, 248, 255, null],
6463    gold: [255, 215, 0, null],
6464    goldenrod: [218, 165, 32, null],
6465    gray: [128, 128, 128, null],
6466    green: [0, 128, 0, null],
6467    greenyellow: [173, 255, 47, null],
6468    grey: [128, 128, 128, null],
6469    honeydew: [240, 255, 240, null],
6470    hotpink: [255, 105, 180, null],
6471    indianred: [205, 92, 92, null],
6472    indigo: [75, 0, 130, null],
6473    ivory: [255, 255, 240, null],
6474    khaki: [240, 230, 140, null],
6475    lavender: [230, 230, 250, null],
6476    lavenderblush: [255, 240, 245, null],
6477    lawngreen: [124, 252, 0, null],
6478    lemonchiffon: [255, 250, 205, null],
6479    lightblue: [173, 216, 230, null],
6480    lightcoral: [240, 128, 128, null],
6481    lightcyan: [224, 255, 255, null],
6482    lightgoldenrodyellow: [250, 250, 210, null],
6483    lightgray: [211, 211, 211, null],
6484    lightgreen: [144, 238, 144, null],
6485    lightgrey: [211, 211, 211, null],
6486    lightpink: [255, 182, 193, null],
6487    lightsalmon: [255, 160, 122, null],
6488    lightseagreen: [32, 178, 170, null],
6489    lightskyblue: [135, 206, 250, null],
6490    lightslategray: [119, 136, 153, null],
6491    lightslategrey: [119, 136, 153, null],
6492    lightsteelblue: [176, 196, 222, null],
6493    lightyellow: [255, 255, 224, null],
6494    lime: [0, 255, 0, null],
6495    limegreen: [50, 205, 50, null],
6496    linen: [250, 240, 230, null],
6497    magenta: [255, 0, 255, null],
6498    maroon: [128, 0, 0, null],
6499    mediumaquamarine: [102, 205, 170, null],
6500    mediumblue: [0, 0, 205, null],
6501    mediumorchid: [186, 85, 211, null],
6502    mediumpurple: [147, 112, 219, null],
6503    mediumseagreen: [60, 179, 113, null],
6504    mediumslateblue: [123, 104, 238, null],
6505    mediumspringgreen: [0, 250, 154, null],
6506    mediumturquoise: [72, 209, 204, null],
6507    mediumvioletred: [199, 21, 133, null],
6508    midnightblue: [25, 25, 112, null],
6509    mintcream: [245, 255, 250, null],
6510    mistyrose: [255, 228, 225, null],
6511    moccasin: [255, 228, 181, null],
6512    navajowhite: [255, 222, 173, null],
6513    navy: [0, 0, 128, null],
6514    oldlace: [253, 245, 230, null],
6515    olive: [128, 128, 0, null],
6516    olivedrab: [107, 142, 35, null],
6517    orange: [255, 165, 0, null],
6518    orangered: [255, 69, 0, null],
6519    orchid: [218, 112, 214, null],
6520    palegoldenrod: [238, 232, 170, null],
6521    palegreen: [152, 251, 152, null],
6522    paleturquoise: [175, 238, 238, null],
6523    palevioletred: [219, 112, 147, null],
6524    papayawhip: [255, 239, 213, null],
6525    peachpuff: [255, 218, 185, null],
6526    peru: [205, 133, 63, null],
6527    pink: [255, 192, 203, null],
6528    plum: [221, 160, 221, null],
6529    powderblue: [176, 224, 230, null],
6530    purple: [128, 0, 128, null],
6531    rebeccapurple: [102, 51, 153, null],
6532    red: [255, 0, 0, null],
6533    rosybrown: [188, 143, 143, null],
6534    royalblue: [65, 105, 225, null],
6535    saddlebrown: [139, 69, 19, null],
6536    salmon: [250, 128, 114, null],
6537    sandybrown: [244, 164, 96, null],
6538    seagreen: [46, 139, 87, null],
6539    seashell: [255, 245, 238, null],
6540    sienna: [160, 82, 45, null],
6541    silver: [192, 192, 192, null],
6542    skyblue: [135, 206, 235, null],
6543    slateblue: [106, 90, 205, null],
6544    slategray: [112, 128, 144, null],
6545    slategrey: [112, 128, 144, null],
6546    snow: [255, 250, 250, null],
6547    springgreen: [0, 255, 127, null],
6548    steelblue: [70, 130, 180, null],
6549    tan: [210, 180, 140, null],
6550    teal: [0, 128, 128, null],
6551    thistle: [216, 191, 216, null],
6552    tomato: [255, 99, 71, null],
6553    turquoise: [64, 224, 208, null],
6554    violet: [238, 130, 238, null],
6555    wheat: [245, 222, 179, null],
6556    white: [255, 255, 255, null],
6557    whitesmoke: [245, 245, 245, null],
6558    yellow: [255, 255, 0, null],
6559    yellowgreen: [154, 205, 50, null]
6560};
6561
6562var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
6563});
6564
6565unwrapExports(Color_1);
6566var Color_2 = Color_1.TRANSPARENT;
6567
6568var textDecoration = createCommonjsModule(function (module, exports
6568) {
6569Object.defineProperty(exports, "__esModule", {
6570    value: true
6571});
6572exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
6573
6574
6575
6576var _Color2 = _interopRequireDefault(Color_1);
6577
6578function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6579
6580var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
6581    SOLID: 0,
6582    DOUBLE: 1,
6583    DOTTED: 2,
6584    DASHED: 3,
6585    WAVY: 4
6586};
6587
6588var TEXT_DECORATION = exports.TEXT_DECORATION = {
6589    NONE: null
6590};
6591
6592var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
6593    UNDERLINE: 1,
6594    OVERLINE: 2,
6595    LINE_THROUGH: 3,
6596    BLINK: 4
6597};
6598
6599var parseLine = function parseLine(line) {
6600    switch (line) {
6601        case 'underline':
6602            return TEXT_DECORATION_LINE.UNDERLINE;
6603        case 'overline':
6604            return TEXT_DECORATION_LINE.OVERLINE;
6605        case 'line-through':
6606            return TEXT_DECORATION_LINE.LINE_THROUGH;
6607    }
6608    return TEXT_DECORATION_LINE.BLINK;
6609};
6610
6611var parseTextDecorationLine = function parseTextDecorationLine(line) {
6612    if (line === 'none') {
6613        return null;
6614    }
6615
6616    return line.split(' ').map(parseLine);
6617};
6618
6619var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
6620    switch (style) {
6621        case 'double':
6622            return TEXT_DECORATION_STYLE.DOUBLE;
6623        case 'dotted':
6624            return TEXT_DECORATION_STYLE.DOTTED;
6625        case 'dashed':
6626            return TEXT_DECORATION_STYLE.DASHED;
6627        case 'wavy':
6628            return TEXT_DECORATION_STYLE.WAVY;
6629    }
6630    return TEXT_DECORATION_STYLE.SOLID;
6631};
6632
6633var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
6634    var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
6635    if (textDecorationLine === null) {
6636        return TEXT_DECORATION.NONE;
6637    }
6638
6639    var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
6640    var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
6641
6642    return {
6643        textDecorationLine: textDecorationLine,
6644        textDecorationColor: textDecorationColor,
6645        textDecorationStyle: textDecorationStyle
6646    };
6647};
6648});
6649
6650unwrapExports(textDecoration);
6651var textDecoration_1 = textDecoration.parseTextDecoration;
6652var textDecoration_2 = textDecoration.TEXT_DECORATION_LINE;
6653var textDecoration_3 = textDecoration.TEXT_DECORATION;
6654var textDecoration_4 = textDecoration.TEXT_DECORATION_STYLE;
6655
6656var CanvasRenderer_1 = createCommonjsModule(function (module, exports) {
6657Object.defineProperty(exports, "__esModule", {
6658    value: true
6659});
6660
6661var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
6662
6663
6664
6665
6666
6667function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6668
6669var addColorStops = function addColorStops(gradient, canvasGradient) {
6670    var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
6671        return colorStop.stop;
6672    }));
6673    var f = 1 / Math.max(1, maxStop);
6674    gradient.colorStops.forEach(function (colorStop) {
6675        canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
6676    });
6677};
6678
6679var CanvasRenderer = function () {
6680    function CanvasRenderer(canvas) {
6681        _classCallCheck(this, CanvasRenderer);
6682
6683        this.canvas = canvas ? canvas : document.createElement('canvas');
6684    }
6685
6686    _createClass(CanvasRenderer, [{
6687        key: 'render',
6688        value: function render(options) {
6689            this.ctx = this.canvas.getContext('2d');
6690            this.options = options;
6691            this.canvas.width = Math.floor(options.width * options.scale);
6692            this.canvas.height = Math.floor(options.height * options.scale);
6693            this.canvas.style.width = options.width + 'px';
6694            this.canvas.style.height = options.height + 'px';
6695
6696            this.ctx.scale(this.options.scale, this.options.scale);
6697            this.ctx.translate(-options.x, -options.y);
6698            this.ctx.textBaseline = 'bottom';
6699            options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
6700        }
6701    }, {
6702        key: 'clip',
6703        value: function clip(clipPaths, callback) {
6704            var _this = this;
6705
6706            if (clipPaths.length) {
6707                this.ctx.save();
6708                clipPaths.forEach(function (path) {
6709                    _this.path(path);
6710                    _this.ctx.clip();
6711                });
6712            }
6713
6714            callback();
6715
6716            if (clipPaths.length) {
6717                this.ctx.restore();
6718            }
6719        }
6720    }, {
6721        key: 'drawImage',
6722        value: function drawImage(image, source, destination) {
6723            this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
6724        }
6725    }, {
6726        key: 'drawShape',
6727        value: function drawShape(path, color) {
6728            this.path(path);
6729            this.ctx.fillStyle = color.toString();
6730            this.ctx.fill();
6731        }
6732    }, {
6733        key: 'fill',
6734        value: function fill(color) {
6735            this.ctx.fillStyle = color.toString();
6736            this.ctx.fill();
6737        }
6738    }, {
6739        key: 'getTarget',
6740        value: function getTarget() {
6741            this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
6742            return Promise.resolve(this.canvas);
6743        }
6744    }, {
6745        key: 'path',
6746        value: function path(_path) {
6747            var _this2 = this;
6748
6749            this.ctx.beginPath();
6750            if (Array.isArray(_path)) {
6751                _path.forEach(function (point, index) {
6752                    var start = point.type === Path.PATH.VECTOR ? point : point.start;
6753                    if (index === 0) {
6754                        _this2.ctx.moveTo(start.x, start.y);
6755                    } else {
6756                        _this2.ctx.lineTo(start.x, start.y);
6757                    }
6758
6759                    if (point.type === Path.PATH.BEZIER_CURVE) {
6760                        _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
6761                    }
6762                });
6763            } else {
6764                this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
6765            }
6766
6767            this.ctx.closePath();
6768        }
6769    }, {
6770        key: 'rectangle',
6771        value: function rectangle(x, y, width, height, color) {
6772            this.ctx.fillStyle = color.toString();
6773            this.ctx.fillRect(x, y, width, height);
6774        }
6775    }, {
6776        key: 'renderLinearGradient',
6777        value: function renderLinearGradient(bounds, gradient) {
6778            var linearGradient = this.ctx.createLinearGradient(bounds.left + gradient.direction.x1, bounds.top + gradient.direction.y1, bounds.left + gradient.direction.x0, bounds.top + gradient.direction.y0);
6779
6780            addColorStops(gradient, linearGradient);
6781            this.ctx.fillStyle = linearGradient;
6782            this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
6783        }
6784    }, {
6785        key: 'renderRadialGradient',
6786        value: function renderRadialGradient(bounds, gradient) {
6787            var _this3 = this;
6788
6789            var x = bounds.left + gradient.center.x;
6790            var y = bounds.top + gradient.center.y;
6791
6792            var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
6793            if (!radialGradient) {
6794                return;
6795            }
6796
6797            addColorStops(gradient, radialGradient);
6798            this.ctx.fillStyle = radialGradient;
6799
6800            if (gradient.radius.x !== gradient.radius.y) {
6801                // transforms for elliptical radial gradient
6802                var midX = bounds.left + 0.5 * bounds.width;
6803                var midY = bounds.top + 0.5 * bounds.height;
6804                var f = gradient.radius.y / gradient.radius.x;
6805                var invF = 1 / f;
6806
6807                this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
6808                    return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
6809                });
6810            } else {
6811                this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
6812            }
6813        }
6814    }, {
6815        key: 'renderRepeat',
6816        value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
6817            this.path(path);
6818            this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
6819            this.ctx.translate(offsetX, offsetY);
6820            this.ctx.fill();
6821            this.ctx.translate(-offsetX, -offsetY);
6822        }
6823    }, {
6824        key: 'renderTextNode',
6825        value: function renderTextNode(textBounds, color, font, textDecoration$$1, textShadows) {
6826            var _this4 = this;
6827
6828            this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
6829
6830            textBounds.forEach(function (text) {
6831                _this4.ctx.fillStyle = color.toString();
6832                if (textShadows && text.text.trim().length) {
6833                    textShadows.slice(0).reverse().forEach(function (textShadow) {
6834                        _this4.ctx.shadowColor = textShadow.color.toString();
6835                        _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
6836                        _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
6837                        _this4.ctx.shadowBlur = textShadow.blur;
6838
6839                        _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
6840                    });
6841                } else {
6842                    _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
6843                }
6844
6845                if (textDecoration$$1 !== null) {
6846                    var textDecorationColor = textDecoration$$1.textDecorationColor || color;
6847                    textDecoration$$1.textDecorationLine.forEach(function (textDecorationLine) {
6848                        switch (textDecorationLine) {
6849                            case textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
6850                                // Draws a line at the baseline of the font
6851                                // TODO As some browsers display the line as more than 1px if the font-size is big,
6852                                // need to take that into account both in position and size
6853                                var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
6854                                    baseline = _options$fontMetrics$.baseline;
6855
6856                                _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
6857                                break;
6858                            case textDecoration.TEXT_DECORATION_LINE.OVERLINE:
6859                                _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
6860                                break;
6861                            case textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
6862                                // TODO try and find exact position for line-through
6863                                var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
6864                                    middle = _options$fontMetrics$2.middle;
6865
6866                                _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
6867                                break;
6868                        }
6869                    });
6870                }
6871            });
6872        }
6873    }, {
6874        key: 'resizeImage',
6875        value: function resizeImage(image, size) {
6876            if (image.width === size.width && image.height === size.height) {
6877                return image;
6878            }
6879
6880            var canvas = this.canvas.ownerDocument.createElement('canvas');
6881            canvas.width = size.width;
6882            canvas.height = size.height;
6883            var ctx = canvas.getContext('2d');
6884            ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
6885            return canvas;
6886        }
6887    }, {
6888        key: 'setOpacity',
6889        value: function setOpacity(opacity) {
6890            this.ctx.globalAlpha = opacity;
6891        }
6892    }, {
6893        key: 'transform',
6894        value: function transform(offsetX, offsetY, matrix, callback) {
6895            this.ctx.save();
6896            this.ctx.translate(offsetX, offsetY);
6897            this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
6898            this.ctx.translate(-offsetX, -offsetY);
6899
6900            callback();
6901
6902            this.ctx.restore();
6903        }
6904    }]);
6905
6906    return CanvasRenderer;
6907}();
6908
6909exports.default = CanvasRenderer;
6910});
6911
6912unwrapExports(CanvasRenderer_1);
6913
6914var Logger_1 = createCommonjsModule(function (module, exports) {
6915Object.defineProperty(exports, "__esModule", {
6916    value: true
6917});
6918
6919var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
6920
6921function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6922
6923var Logger = function () {
6924    function Logger(enabled, id, start) {
6925        _classCallCheck(this, Logger);
6926
6927        this.enabled = typeof window !== 'undefined' && enabled;
6928        this.start = start ? start : Date.now();
6929        this.id = id;
6930    }
6931
6932    _createClass(Logger, [{
6933        key: 'child',
6934        value: function child(id) {
6935            return new Logger(this.enabled, id, this.start);
6936        }
6937
6938        // eslint-disable-next-line flowtype/no-weak-types
6939
6940    }, {
6941        key: 'log',
6942        value: function log() {
6943            if (this.enabled && window.console && window.console.log) {
6944                for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
6945                    args[_key] = arguments[_key];
6946                }
6947
6948                Function.prototype.bind.call(window.console.log, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0)));
6949            }
6950        }
6951
6952        // eslint-disable-next-line flowtype/no-weak-types
6953
6954    }, {
6955        key: 'error',
6956        value: function error() {
6957            if (this.enabled && window.console && window.console.error) {
6958                for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6959                    args[_key2] = arguments[_key2];
6960                }
6961
6962                Function.prototype.bind.call(window.console.error, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0)));
6963            }
6964        }
6965    }]);
6966
6967    return Logger;
6968}();
6969
6970exports.default = Logger;
6971});
6972
6973unwrapExports(Logger_1);
6974
6975var Util = createCommonjsModule(function (module, exports) {
6976Object.defineProperty(exports, "__esModule", {
6977    value: true
6978});
6979var contains = exports.contains = function contains(bit, value) {
6980    return (bit & value) !== 0;
6981};
6982
6983var distance = exports.distance = function distance(a, b) {
6984    return Math.sqrt(a * a + b * b);
6985};
6986
6987var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
6988    // Edge does not provide value for cssText
6989    for (var i = style.length - 1; i >= 0; i--) {
6990        var property = style.item(i);
6991        // Safari shows pseudoelements if content is set
6992        if (property !== 'content') {
6993            target.style.setProperty(property, style.getPropertyValue(property));
6994        }
6995    }
6996    return target;
6997};
6998
6999var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
7000});
7001
7002unwrapExports(Util);
7003var Util_1 = Util.contains;
7004var Util_2 = Util.distance;
7005var Util_3 = Util.copyCSSStyles;
7006var Util_4 = Util.SMALL_IMAGE;
7007
7008var Length_1 = createCommonjsModule(function (module, exports) {
7009Object.defineProperty(exports, "__esModule", {
7010    value: true
7011});
7012exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
7013
7014var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
7015
7016
7017
7018var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
7019
7020function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7021
7022function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7023
7024var LENGTH_TYPE = exports.LENGTH_TYPE = {
7025    PX: 0,
7026    PERCENTAGE: 1
7027};
7028
7029var Length = function () {
7030    function Length(value) {
7031        _classCallCheck(this, Length);
7032
7033        this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
7034        var parsedValue = parseFloat(value);
7035        this.value = isNaN(parsedValue) ? 0 : parsedValue;
7036    }
7037
7038    _createClass(Length, [{
7039        key: 'isPercentage',
7040        value: function isPercentage() {
7041            return this.type === LENGTH_TYPE.PERCENTAGE;
7042        }
7043    }, {
7044        key: 'getAbsoluteValue',
7045        value: function getAbsoluteValue(parentLength) {
7046            return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
7047        }
7048    }], [{
7049        key: 'create',
7050        value: function create(v) {
7051            return new Length(v);
7052        }
7053    }]);
7054
7055    return Length;
7056}();
7057
7058exports.default = Length;
7059
7060
7061var getRootFontSize = function getRootFontSize(container) {
7062    var parent = container.parent;
7063    return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
7064};
7065
7066var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
7067    switch (unit) {
7068        case 'px':
7069        case '%':
7070            return new Length(value + unit);
7071        case 'em':
7072        case 'rem':
7073            var length = new Length(value);
7074            length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
7075            return length;
7076        default:
7077            // TODO: handle correctly if unknown unit is used
7078            return new Length('0');
7079    }
7080};
7081});
7082
7083unwrapExports(Length_1);
7084var Length_2 = Length_1.calculateLengthFromValueWithUnit;
7085var Length_3 = Length_1.LENGTH_TYPE;
7086
7087var Size_1 = createCommonjsModule(function (module, exports) {
7088Object.defineProperty(exports, "__esModule", {
7089    value: true
7090});
7091
7092function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7093
7094var Size = function Size(width, height) {
7095    _classCallCheck(this, Size);
7096
7097    this.width = width;
7098    this.height = height;
7099};
7100
7101exports.default = Size;
7102});
7103
7104unwrapExports(Size_1);
7105
7106var Vector_1 = createCommonjsModule(function (module, exports) {
7107Object.defineProperty(exports, "__esModule", {
7108    value: true
7109});
7110
7111
7112
7113function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7114
7115var Vector = function Vector(x, y) {
7116    _classCallCheck(this, Vector);
7117
7118    this.type = Path.PATH.VECTOR;
7119    this.x = x;
7120    this.y = y;
7121    
7122};
7123
7124exports.default = Vector;
7125});
7126
7127unwrapExports(Vector_1);
7128
7129var BezierCurve_1 = createCommonjsModule(function (module, exports) {
7130Object.defineProperty(exports, "__esModule", {
7131    value: true
7132});
7133
7134var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
7135
7136
7137
7138
7139
7140var _Vector2 = _interopRequireDefault(Vector_1);
7141
7142function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7143
7144function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7145
7146var lerp = function lerp(a, b, t) {
7147    return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
7148};
7149
7150var BezierCurve = function () {
7151    function BezierCurve(start, startControl, endControl, end) {
7152        _classCallCheck(this, BezierCurve);
7153
7154        this.type = Path.PATH.BEZIER_CURVE;
7155        this.start = start;
7156        this.startControl = startControl;
7157        this.endControl = endControl;
7158        this.end = end;
7159    }
7160
7161    _createClass(BezierCurve, [{
7162        key: 'subdivide',
7163        value: function subdivide(t, firstHalf) {
7164            var ab = lerp(this.start, this.startControl, t);
7165            var bc = lerp(this.startControl, this.endControl, t);
7166            var cd = lerp(this.endControl, this.end, t);
7167            var abbc = lerp(ab, bc, t);
7168            var bccd = lerp(bc, cd, t);
7169            var dest = lerp(abbc, bccd, t);
7170            return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
7171        }
7172    }, {
7173        key: 'reverse',
7174        value: function reverse() {
7175            return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
7176        }
7177    }]);
7178
7179    return BezierCurve;
7180}();
7181
7182exports.default = BezierCurve;
7183});
7184
7185unwrapExports(BezierCurve_1);
7186
7187var Bounds_1 = createCommonjsModule(function (module, exports) {
7188Object.defineProperty(exports, "__esModule", {
7189    value: true
7190});
7191exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
7192
7193var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
7194
7195
7196
7197var _Vector2 = _interopRequireDefault(Vector_1);
7198
7199
7200
7201var _BezierCurve2 = _interopRequireDefault(BezierCurve_1);
7202
7203function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7204
7205function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7206
7207var TOP = 0;
7208var RIGHT = 1;
7209var BOTTOM = 2;
7210var LEFT = 3;
7211
7212var H = 0;
7213var V = 1;
7214
7215var Bounds = exports.Bounds = function () {
7216    function Bounds(x, y, w, h) {
7217        _classCallCheck(this, Bounds);
7218
7219        this.left = x;
7220        this.top = y;
7221        this.width = w;
7222        this.height = h;
7223    }
7224
7225    _createClass(Bounds, null, [{
7226        key: 'fromClientRect',
7227        value: function fromClientRect(clientRect, scrollX, scrollY) {
7228            return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
7229        }
7230    }]);
7231
7232    return Bounds;
7233}();
7234
7235var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
7236    return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
7237};
7238
7239var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
7240    return new Bounds(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth));
7241};
7242
7243var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
7244    // TODO support percentage paddings
7245    var paddingTop = padding[TOP].value;
7246    var paddingRight = padding[RIGHT].value;
7247    var paddingBottom = padding[BOTTOM].value;
7248    var paddingLeft = padding[LEFT].value;
7249
7250    return new Bounds(bounds.left + paddingLeft + borders[LEFT].borderWidth, bounds.top + paddingTop + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth + paddingLeft + paddingRight), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth + paddingTop + paddingBottom));
7251};
7252
7253var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
7254    var body = document.body;
7255    var documentElement = document.documentElement;
7256
7257    if (!body || !documentElement) {
7258        throw new Error('');
7259    }
7260    var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
7261
7262    var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
7263
7264    return new Bounds(0, 0, width, height);
7265};
7266
7267var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
7268    switch (borderSide) {
7269        case TOP:
7270            return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
7271        case RIGHT:
7272            return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
7273        case BOTTOM:
7274            return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
7275        case LEFT:
7276        default:
7277            return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
7278    }
7279};
7280
7281var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
7282    var path = [];
7283    if (outer1 instanceof _BezierCurve2.default) {
7284        path.push(outer1.subdivide(0.5, false));
7285    } else {
7286        path.push(outer1);
7287    }
7288
7289    if (outer2 instanceof _BezierCurve2.default) {
7290        path.push(outer2.subdivide(0.5, true));
7291    } else {
7292        path.push(outer2);
7293    }
7294
7295    if (inner2 instanceof _BezierCurve2.default) {
7296        path.push(inner2.subdivide(0.5, true).reverse());
7297    } else {
7298        path.push(inner2);
7299    }
7300
7301    if (inner1 instanceof _BezierCurve2.default) {
7302        path.push(inner1.subdivide(0.5, false).reverse());
7303    } else {
7304        path.push(inner1);
7305    }
7306
7307    return path;
7308};
7309
7310var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
7311    return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
7312};
7313
7314var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
7315    return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
7316};
7317
7318var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
7319    var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
7320    var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
7321    var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
7322    var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
7323    var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
7324    var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
7325    var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
7326    var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
7327
7328    var factors = [];
7329    factors.push((tlh + trh) / bounds.width);
7330    factors.push((blh + brh) / bounds.width);
7331    factors.push((tlv + blv) / bounds.height);
7332    factors.push((trv + brv) / bounds.height);
7333    var maxFactor = Math.max.apply(Math, factors);
7334
7335    if (maxFactor > 1) {
7336        tlh /= maxFactor;
7337        tlv /= maxFactor;
7338        trh /= maxFactor;
7339        trv /= maxFactor;
7340        brh /= maxFactor;
7341        brv /= maxFactor;
7342        blh /= maxFactor;
7343        blv /= maxFactor;
7344    }
7345
7346    var topWidth = bounds.width - trh;
7347    var rightHeight = bounds.height - brv;
7348    var bottomWidth = bounds.width - brh;
7349    var leftHeight = bounds.height - blv;
7350
7351    return {
7352        topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
7353        topLeftInner: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, Math.max(0, tlh - borders[LEFT].borderWidth), Math.max(0, tlv - borders[TOP].borderWidth), CORNER.TOP_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth),
7354        topRightOuter: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top),
7355        topRightInner: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borders[LEFT].borderWidth), bounds.top + borders[TOP].borderWidth, topWidth > bounds.width + borders[LEFT].borderWidth ? 0 : trh - borders[LEFT].borderWidth, trv - borders[TOP].borderWidth, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + borders[TOP].borderWidth),
7356        bottomRightOuter: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top + bounds.height),
7357        bottomRightInner: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borders[LEFT].borderWidth), bounds.top + Math.min(rightHeight, bounds.height + borders[TOP].borderWidth), Math.max(0, brh - borders[RIGHT].borderWidth), brv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth),
7358        bottomLeftOuter: blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left, bounds.top + bounds.height),
7359        bottomLeftInner: blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + leftHeight, Math.max(0, blh - borders[LEFT].borderWidth), blv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth)
7360    };
7361};
7362
7363var CORNER = {
7364    TOP_LEFT: 0,
7365    TOP_RIGHT: 1,
7366    BOTTOM_RIGHT: 2,
7367    BOTTOM_LEFT: 3
7368};
7369
7370var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
7371    var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
7372    var ox = r1 * kappa; // control point offset horizontal
7373    var oy = r2 * kappa; // control point offset vertical
7374    var xm = x + r1; // x-middle
7375    var ym = y + r2; // y-middle
7376
7377    switch (position) {
7378        case CORNER.TOP_LEFT:
7379            return new _BezierCurve2.default(new _Vector2.default(x, ym), new _Vector2.default(x, ym - oy), new _Vector2.default(xm - ox, y), new _Vector2.default(xm, y));
7380        case CORNER.TOP_RIGHT:
7381            return new _BezierCurve2.default(new _Vector2.default(x, y), new _Vector2.default(x + ox, y), new _Vector2.default(xm, ym - oy), new _Vector2.default(xm, ym));
7382        case CORNER.BOTTOM_RIGHT:
7383            return new _BezierCurve2.default(new _Vector2.default(xm, y), new _Vector2.default(xm, y + oy), new _Vector2.default(x + ox, ym), new _Vector2.default(x, ym));
7384        case CORNER.BOTTOM_LEFT:
7385        default:
7386            return new _BezierCurve2.default(new _Vector2.default(xm, ym), new _Vector2.default(xm - ox, ym), new _Vector2.default(x, y + oy), new _Vector2.default(x, y));
7387    }
7388};
7389});
7390
7391unwrapExports(Bounds_1);
7392var Bounds_2 = Bounds_1.parseBoundCurves;
7393var Bounds_3 = Bounds_1.calculatePaddingBoxPath;
7394var Bounds_4 = Bounds_1.calculateBorderBoxPath;
7395var Bounds_5 = Bounds_1.parsePathForBorder;
7396var Bounds_6 = Bounds_1.parseDocumentSize;
7397var Bounds_7 = Bounds_1.calculateContentBox;
7398var Bounds_8 = Bounds_1.calculatePaddingBox;
7399var Bounds_9 = Bounds_1.parseBounds;
7400var Bounds_10 = Bounds_1.Bounds;
7401
7402var padding = createCommonjsModule(function (module, exports) {
7403Object.defineProperty(exports, "__esModule", {
7404    value: true
7405});
7406exports.parsePadding = exports.PADDING_SIDES = undefined;
7407
7408
7409
7410var _Length2 = _interopRequireDefault(Length_1);
7411
7412function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7413
7414var PADDING_SIDES = exports.PADDING_SIDES = {
7415    TOP: 0,
7416    RIGHT: 1,
7417    BOTTOM: 2,
7418    LEFT: 3
7419};
7420
7421var SIDES = ['top', 'right', 'bottom', 'left'];
7422
7423var parsePadding = exports.parsePadding = function parsePadding(style) {
7424    return SIDES.map(function (side) {
7425        return new _Length2.default(style.getPropertyValue('padding-' + side));
7426    });
7427};
7428});
7429
7430unwrapExports(padding);
7431var padding_1 = padding.parsePadding;
7432var padding_2 = padding.PADDING_SIDES;
7433
7434var background = createCommonjsModule(function (module, exports) {
7435Object.defineProperty(exports, "__esModule", {
7436    value: true
7437});
7438exports.parseBackgroundImage = exports.parseBackground = exports.calculateBackgroundRepeatPath = exports.calculateBackgroundPosition = exports.calculateBackgroungPositioningArea = exports.calculateBackgroungPaintingArea = exports.calculateGradientBackgroundSize = exports.calculateBackgroundSize = exports.BACKGROUND_ORIGIN = exports.BACKGROUND_CLIP = exports.BACKGROUND_SIZE = exports.BACKGROUND_REPEAT = undefined;
7439
7440
7441
7442var _Color2 = _interopRequireDefault(Color_1);
7443
7444
7445
7446var _Length2 = _interopRequireDefault(Length_1);
7447
7448
7449
7450var _Size2 = _interopRequireDefault(Size_1);
7451
7452
7453
7454var _Vector2 = _interopRequireDefault(Vector_1);
7455
7456
7457
7458
7459
7460function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7461
7462function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7463
7464var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
7465    REPEAT: 0,
7466    NO_REPEAT: 1,
7467    REPEAT_X: 2,
7468    REPEAT_Y: 3
7469};
7470
7471var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
7472    AUTO: 0,
7473    CONTAIN: 1,
7474    COVER: 2,
7475    LENGTH: 3
7476};
7477
7478var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
7479    BORDER_BOX: 0,
7480    PADDING_BOX: 1,
7481    CONTENT_BOX: 2
7482};
7483
7484var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
7485
7486var AUTO = 'auto';
7487
7488var BackgroundSize = function BackgroundSize(size) {
7489    _classCallCheck(this, BackgroundSize);
7490
7491    switch (size) {
7492        case 'contain':
7493            this.size = BACKGROUND_SIZE.CONTAIN;
7494            break;
7495        case 'cover':
7496            this.size = BACKGROUND_SIZE.COVER;
7497            break;
7498        case 'auto':
7499            this.size = BACKGROUND_SIZE.AUTO;
7500            break;
7501        default:
7502            this.value = new _Length2.default(size);
7503    }
7504};
7505
7506var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
7507    var width = 0;
7508    var height = 0;
7509    var size = backgroundImage.size;
7510    if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
7511        var targetRatio = bounds.width / bounds.height;
7512        var currentRatio = image.width / image.height;
7513        return targetRatio < currentRatio !== (size[0].size === BACKGROUND_SIZE.COVER) ? new _Size2.default(bounds.width, bounds.width / currentRatio) : new _Size2.default(bounds.height * currentRatio, bounds.height);
7514    }
7515
7516    if (size[0].value) {
7517        width = size[0].value.getAbsoluteValue(bounds.width);
7518    }
7519
7520    if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
7521        height = image.height;
7522    } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
7523        height = width / image.width * image.height;
7524    } else if (size[1].value) {
7525        height = size[1].value.getAbsoluteValue(bounds.height);
7526    }
7527
7528    if (size[0].size === BACKGROUND_SIZE.AUTO) {
7529        width = height / image.height * image.width;
7530    }
7531
7532    return new _Size2.default(width, height);
7533};
7534
7535var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
7536    var size = backgroundImage.size;
7537    var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
7538    var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
7539
7540    return new _Size2.default(width, height);
7541};
7542
7543var AUTO_SIZE = new BackgroundSize(AUTO);
7544
7545var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
7546    switch (clip) {
7547        case BACKGROUND_CLIP.BORDER_BOX:
7548            return (0, Bounds_1.calculateBorderBoxPath)(curves);
7549        case BACKGROUND_CLIP.PADDING_BOX:
7550        default:
7551            return (0, Bounds_1.calculatePaddingBoxPath)(curves);
7552    }
7553};
7554
7555var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding$$1, border) {
7556    var paddingBox = (0, Bounds_1.calculatePaddingBox)(bounds, border);
7557
7558    switch (backgroundOrigin) {
7559        case BACKGROUND_ORIGIN.BORDER_BOX:
7560            return bounds;
7561        case BACKGROUND_ORIGIN.CONTENT_BOX:
7562            var paddingLeft = padding$$1[padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
7563            var paddingRight = padding$$1[padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
7564            var paddingTop = padding$$1[padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
7565            var paddingBottom = padding$$1[padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
7566            return new Bounds_1.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
7567        case BACKGROUND_ORIGIN.PADDING_BOX:
7568        default:
7569            return paddingBox;
7570    }
7571};
7572
7573var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
7574    return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
7575};
7576
7577var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
7578    var repeat = background.repeat;
7579    switch (repeat) {
7580        case BACKGROUND_REPEAT.REPEAT_X:
7581            return [new _Vector2.default(Math.round(bounds.left), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(size.height + backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left), Math.round(size.height + backgroundPositioningArea.top + position.y))];
7582        case BACKGROUND_REPEAT.REPEAT_Y:
7583            return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.height + bounds.top))];
7584        case BACKGROUND_REPEAT.NO_REPEAT:
7585            return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y + size.height)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y + size.height))];
7586        default:
7587            return [new _Vector2.default(Math.round(bounds.left), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(bounds.left), Math.round(bounds.height + bounds.top))];
7588    }
7589};
7590
7591var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
7592    return {
7593        backgroundColor: new _Color2.default(style.backgroundColor),
7594        backgroundImage: parseBackgroundImages(style, resourceLoader),
7595        backgroundClip: parseBackgroundClip(style.backgroundClip),
7596        backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
7597    };
7598};
7599
7600var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
7601    switch (backgroundClip) {
7602        case 'padding-box':
7603            return BACKGROUND_CLIP.PADDING_BOX;
7604        case 'content-box':
7605            return BACKGROUND_CLIP.CONTENT_BOX;
7606    }
7607    return BACKGROUND_CLIP.BORDER_BOX;
7608};
7609
7610var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
7611    switch (backgroundOrigin) {
7612        case 'padding-box':
7613            return BACKGROUND_ORIGIN.PADDING_BOX;
7614        case 'content-box':
7615            return BACKGROUND_ORIGIN.CONTENT_BOX;
7616    }
7617    return BACKGROUND_ORIGIN.BORDER_BOX;
7618};
7619
7620var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
7621    switch (backgroundRepeat.trim()) {
7622        case 'no-repeat':
7623            return BACKGROUND_REPEAT.NO_REPEAT;
7624        case 'repeat-x':
7625        case 'repeat no-repeat':
7626            return BACKGROUND_REPEAT.REPEAT_X;
7627        case 'repeat-y':
7628        case 'no-repeat repeat':
7629            return BACKGROUND_REPEAT.REPEAT_Y;
7630        case 'repeat':
7631            return BACKGROUND_REPEAT.REPEAT;
7632    }
7633
7634    return BACKGROUND_REPEAT.REPEAT;
7635};
7636
7637var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
7638    var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
7639        if (backgroundImage.method === 'url') {
7640            var key = resourceLoader.loadImage(backgroundImage.args[0]);
7641            backgroundImage.args = key ? [key] : [];
7642        }
7643        return backgroundImage;
7644    });
7645    var positions = style.backgroundPosition.split(',');
7646    var repeats = style.backgroundRepeat.split(',');
7647    var sizes = style.backgroundSize.split(',');
7648
7649    return sources.map(function (source, index) {
7650        var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
7651        var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
7652
7653        return {
7654            source: source,
7655            repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
7656            size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
7657            position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
7658        };
7659    });
7660};
7661
7662var parseBackgroundSize = function parseBackgroundSize(size) {
7663    return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
7664};
7665
7666var parseBackgoundPosition = function parseBackgoundPosition(position) {
7667    switch (position) {
7668        case 'bottom':
7669        case 'right':
7670            return new _Length2.default('100%');
7671        case 'left':
7672        case 'top':
7673            return new _Length2.default('0%');
7674        case 'auto':
7675            return new _Length2.default('0');
7676    }
7677    return new _Length2.default(position);
7678};
7679
7680var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
7681    var whitespace = /^\s$/;
7682    var results = [];
7683
7684    var args = [];
7685    var method = '';
7686    var quote = null;
7687    var definition = '';
7688    var mode = 0;
7689    var numParen = 0;
7690
7691    var appendResult = function appendResult() {
7692        var prefix = '';
7693        if (method) {
7694            if (definition.substr(0, 1) === '"') {
7695                definition = definition.substr(1, definition.length - 2);
7696            }
7697
7698            if (definition) {
7699                args.push(definition.trim());
7700            }
7701
7702            var prefix_i = method.indexOf('-', 1) + 1;
7703            if (method.substr(0, 1) === '-' && prefix_i > 0) {
7704                prefix = method.substr(0, prefix_i).toLowerCase();
7705                method = method.substr(prefix_i);
7706            }
7707            method = method.toLowerCase();
7708            if (method !== 'none') {
7709                results.push({
7710                    prefix: prefix,
7711                    method: method,
7712                    args: args
7713                });
7714            }
7715        }
7716        args = [];
7717        method = definition = '';
7718    };
7719
7720    image.split('').forEach(function (c) {
7721        if (mode === 0 && whitespace.test(c)) {
7722            return;
7723        }
7724        switch (c) {
7725            case '"':
7726                if (!quote) {
7727                    quote = c;
7728                } else if (quote === c) {
7729                    quote = null;
7730                }
7731                break;
7732            case '(':
7733                if (quote) {
7734                    break;
7735                } else if (mode === 0) {
7736                    mode = 1;
7737                    return;
7738                } else {
7739                    numParen++;
7740                }
7741                break;
7742            case ')':
7743                if (quote) {
7744                    break;
7745                } else if (mode === 1) {
7746                    if (numParen === 0) {
7747                        mode = 0;
7748                        appendResult();
7749                        return;
7750                    } else {
7751                        numParen--;
7752                    }
7753                }
7754                break;
7755
7756            case ',':
7757                if (quote) {
7758                    break;
7759                } else if (mode === 0) {
7760                    appendResult();
7761                    return;
7762                } else if (mode === 1) {
7763                    if (numParen === 0 && !method.match(/^url$/i)) {
7764                        args.push(definition.trim());
7765                        definition = '';
7766                        return;
7767                    }
7768                }
7769                break;
7770        }
7771
7772        if (mode === 0) {
7773            method += c;
7774        } else {
7775            definition += c;
7776        }
7777    });
7778
7779    appendResult();
7780    return results;
7781};
7782});
7783
7784unwrapExports(background);
7785var background_1 = background.parseBackgroundImage;
7786var background_2 = background.parseBackground;
7787var background_3 = background.calculateBackgroundRepeatPath;
7788var background_4 = background.calculateBackgroundPosition;
7789var background_5 = background.calculateBackgroungPositioningArea;
7790var background_6 = background.calculateBackgroungPaintingArea;
7791var background_7 = background.calculateGradientBackgroundSize;
7792var background_8 = background.calculateBackgroundSize;
7793var background_9 = background.BACKGROUND_ORIGIN;
7794var background_10 = background.BACKGROUND_CLIP;
7795var background_11 = background.BACKGROUND_SIZE;
7796var background_12 = background.BACKGROUND_REPEAT;
7797
7798var border = createCommonjsModule(function (module, exports) {
7799Object.defineProperty(exports, "__esModule", {
7800    value: true
7801});
7802exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
7803
7804
7805
7806var _Color2 = _interopRequireDefault(Color_1);
7807
7808function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7809
7810var BORDER_STYLE = exports.BORDER_STYLE = {
7811    NONE: 0,
7812    SOLID: 1
7813};
7814
7815var BORDER_SIDES = exports.BORDER_SIDES = {
7816    TOP: 0,
7817    RIGHT: 1,
7818    BOTTOM: 2,
7819    LEFT: 3
7820};
7821
7822var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
7823    return s.toLowerCase();
7824});
7825
7826var parseBorderStyle = function parseBorderStyle(style) {
7827    switch (style) {
7828        case 'none':
7829            return BORDER_STYLE.NONE;
7830    }
7831    return BORDER_STYLE.SOLID;
7832};
7833
7834var parseBorder = exports.parseBorder = function parseBorder(style) {
7835    return SIDES.map(function (side) {
7836        var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
7837        var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
7838        var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
7839        return {
7840            borderColor: borderColor,
7841            borderStyle: borderStyle,
7842            borderWidth: isNaN(borderWidth) ? 0 : borderWidth
7843        };
7844    });
7845};
7846});
7847
7848unwrapExports(border);
7849var border_1 = border.parseBorder;
7850var border_2 = border.BORDER_SIDES;
7851var border_3 = border.BORDER_STYLE;
7852
7853var borderRadius = createCommonjsModule(function (module, exports
7853) {
7854Object.defineProperty(exports, "__esModule", {
7855    value: true
7856});
7857exports.parseBorderRadius = undefined;
7858
7859var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
7860
7861
7862
7863var _Length2 = _interopRequireDefault(Length_1);
7864
7865function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7866
7867var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
7868
7869var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
7870    return SIDES.map(function (side) {
7871        var value = style.getPropertyValue('border-' + side + '-radius');
7872
7873        var _value$split$map = value.split(' ').map(_Length2.default.create),
7874            _value$split$map2 = _slicedToArray(_value$split$map, 2),
7875            horizontal = _value$split$map2[0],
7876            vertical = _value$split$map2[1];
7877
7878        return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
7879    });
7880};
7881});
7882
7883unwrapExports(borderRadius);
7884var borderRadius_1 = borderRadius.parseBorderRadius;
7885
7886var display = createCommonjsModule(function (module, exports) {
7887Object.defineProperty(exports, "__esModule", {
7888    value: true
7889});
7890var DISPLAY = exports.DISPLAY = {
7891    NONE: 1 << 0,
7892    BLOCK: 1 << 1,
7893    INLINE: 1 << 2,
7894    RUN_IN: 1 << 3,
7895    FLOW: 1 << 4,
7896    FLOW_ROOT: 1 << 5,
7897    TABLE: 1 << 6,
7898    FLEX: 1 << 7,
7899    GRID: 1 << 8,
7900    RUBY: 1 << 9,
7901    SUBGRID: 1 << 10,
7902    LIST_ITEM: 1 << 11,
7903    TABLE_ROW_GROUP: 1 << 12,
7904    TABLE_HEADER_GROUP: 1 << 13,
7905    TABLE_FOOTER_GROUP: 1 << 14,
7906    TABLE_ROW: 1 << 15,
7907    TABLE_CELL: 1 << 16,
7908    TABLE_COLUMN_GROUP: 1 << 17,
7909    TABLE_COLUMN: 1 << 18,
7910    TABLE_CAPTION: 1 << 19,
7911    RUBY_BASE: 1 << 20,
7912    RUBY_TEXT: 1 << 21,
7913    RUBY_BASE_CONTAINER: 1 << 22,
7914    RUBY_TEXT_CONTAINER: 1 << 23,
7915    CONTENTS: 1 << 24,
7916    INLINE_BLOCK: 1 << 25,
7917    INLINE_LIST_ITEM: 1 << 26,
7918    INLINE_TABLE: 1 << 27,
7919    INLINE_FLEX: 1 << 28,
7920    INLINE_GRID: 1 << 29
7921};
7922
7923var parseDisplayValue = function parseDisplayValue(display) {
7924    switch (display) {
7925        case 'block':
7926            return DISPLAY.BLOCK;
7927        case 'inline':
7928            return DISPLAY.INLINE;
7929        case 'run-in':
7930            return DISPLAY.RUN_IN;
7931        case 'flow':
7932            return DISPLAY.FLOW;
7933        case 'flow-root':
7934            return DISPLAY.FLOW_ROOT;
7935        case 'table':
7936            return DISPLAY.TABLE;
7937        case 'flex':
7938            return DISPLAY.FLEX;
7939        case 'grid':
7940            return DISPLAY.GRID;
7941        case 'ruby':
7942            return DISPLAY.RUBY;
7943        case 'subgrid':
7944            return DISPLAY.SUBGRID;
7945        case 'list-item':
7946            return DISPLAY.LIST_ITEM;
7947        case 'table-row-group':
7948            return DISPLAY.TABLE_ROW_GROUP;
7949        case 'table-header-group':
7950            return DISPLAY.TABLE_HEADER_GROUP;
7951        case 'table-footer-group':
7952            return DISPLAY.TABLE_FOOTER_GROUP;
7953        case 'table-row':
7954            return DISPLAY.TABLE_ROW;
7955        case 'table-cell':
7956            return DISPLAY.TABLE_CELL;
7957        case 'table-column-group':
7958            return DISPLAY.TABLE_COLUMN_GROUP;
7959        case 'table-column':
7960            return DISPLAY.TABLE_COLUMN;
7961        case 'table-caption':
7962            return DISPLAY.TABLE_CAPTION;
7963        case 'ruby-base':
7964            return DISPLAY.RUBY_BASE;
7965        case 'ruby-text':
7966            return DISPLAY.RUBY_TEXT;
7967        case 'ruby-base-container':
7968            return DISPLAY.RUBY_BASE_CONTAINER;
7969        case 'ruby-text-container':
7970            return DISPLAY.RUBY_TEXT_CONTAINER;
7971        case 'contents':
7972            return DISPLAY.CONTENTS;
7973        case 'inline-block':
7974            return DISPLAY.INLINE_BLOCK;
7975        case 'inline-list-item':
7976            return DISPLAY.INLINE_LIST_ITEM;
7977        case 'inline-table':
7978            return DISPLAY.INLINE_TABLE;
7979        case 'inline-flex':
7980            return DISPLAY.INLINE_FLEX;
7981        case 'inline-grid':
7982            return DISPLAY.INLINE_GRID;
7983    }
7984
7985    return DISPLAY.NONE;
7986};
7987
7988var setDisplayBit = function setDisplayBit(bit, display) {
7989    return bit | parseDisplayValue(display);
7990};
7991
7992var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
7993    return display.split(' ').reduce(setDisplayBit, 0);
7994};
7995});
7996
7997unwrapExports(display);
7998var display_1 = display.DISPLAY;
7999var display_2 = display.parseDisplay;
8000
8001var float_1 = createCommonjsModule(function (module, exports) {
8002Object.defineProperty(exports, "__esModule", {
8003    value: true
8004});
8005var FLOAT = exports.FLOAT = {
8006    NONE: 0,
8007    LEFT: 1,
8008    RIGHT: 2,
8009    INLINE_START: 3,
8010    INLINE_END: 4
8011};
8012
8013var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
8014    switch (float) {
8015        case 'left':
8016            return FLOAT.LEFT;
8017        case 'right':
8018            return FLOAT.RIGHT;
8019        case 'inline-start':
8020            return FLOAT.INLINE_START;
8021        case 'inline-end':
8022            return FLOAT.INLINE_END;
8023    }
8024    return FLOAT.NONE;
8025};
8026});
8027
8028unwrapExports(float_1);
8029var float_2 = float_1.FLOAT;
8030var float_3 = float_1.parseCSSFloat;
8031
8032var font = createCommonjsModule(function (module, exports) {
8033Object.defineProperty(exports, "__esModule", {
8034    value: true
8035});
8036
8037
8038var parseFontWeight = function parseFontWeight(weight) {
8039    switch (weight) {
8040        case 'normal':
8041            return 400;
8042        case 'bold':
8043            return 700;
8044    }
8045
8046    var value = parseInt(weight, 10);
8047    return isNaN(value) ? 400 : value;
8048};
8049
8050var parseFont = exports.parseFont = function parseFont(style) {
8051    var fontFamily = style.fontFamily;
8052    var fontSize = style.fontSize;
8053    var fontStyle = style.fontStyle;
8054    var fontVariant = style.fontVariant;
8055    var fontWeight = parseFontWeight(style.fontWeight);
8056
8057    return {
8058        fontFamily: fontFamily,
8059        fontSize: fontSize,
8060        fontStyle: fontStyle,
8061        fontVariant: fontVariant,
8062        fontWeight: fontWeight
8063    };
8064};
8065});
8066
8067unwrapExports(font);
8068var font_1 = font.parseFont;
8069
8070var letterSpacing = createCommonjsModule(function (module, exports) {
8071Object.defineProperty(exports, "__esModule", {
8072    value: true
8073});
8074var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
8075    if (letterSpacing === 'normal') {
8076        return 0;
8077    }
8078    var value = parseFloat(letterSpacing);
8079    return isNaN(value) ? 0 : value;
8080};
8081});
8082
8083unwrapExports(letterSpacing);
8084var letterSpacing_1 = letterSpacing.parseLetterSpacing;
8085
8086var lineBreak = createCommonjsModule(function (module, exports) {
8087Object.defineProperty(exports, "__esModule", {
8088    value: true
8089});
8090var LINE_BREAK = exports.LINE_BREAK = {
8091    NORMAL: 'normal',
8092    STRICT: 'strict'
8093};
8094
8095var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
8096    switch (wordBreak) {
8097        case 'strict':
8098            return LINE_BREAK.STRICT;
8099        case 'normal':
8100        default:
8101            return LINE_BREAK.NORMAL;
8102    }
8103};
8104});
8105
8106unwrapExports(lineBreak);
8107var lineBreak_1 = lineBreak.LINE_BREAK;
8108var lineBreak_2 = lineBreak.parseLineBreak;
8109
8110var listStyle = createCommonjsModule(function (module, exports) {
8111Object.defineProperty(exports, "__esModule", {
8112    value: true
8113});
8114exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
8115
8116
8117
8118var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
8119    INSIDE: 0,
8120    OUTSIDE: 1
8121};
8122
8123var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
8124    NONE: -1,
8125    DISC: 0,
8126    CIRCLE: 1,
8127    SQUARE: 2,
8128    DECIMAL: 3,
8129    CJK_DECIMAL: 4,
8130    DECIMAL_LEADING_ZERO: 5,
8131    LOWER_ROMAN: 6,
8132    UPPER_ROMAN: 7,
8133    LOWER_GREEK: 8,
8134    LOWER_ALPHA: 9,
8135    UPPER_ALPHA: 10,
8136    ARABIC_INDIC: 11,
8137    ARMENIAN: 12,
8138    BENGALI: 13,
8139    CAMBODIAN: 14,
8140    CJK_EARTHLY_BRANCH: 15,
8141    CJK_HEAVENLY_STEM: 16,
8142    CJK_IDEOGRAPHIC: 17,
8143    DEVANAGARI: 18,
8144    ETHIOPIC_NUMERIC: 19,
8145    GEORGIAN: 20,
8146    GUJARATI: 21,
8147    GURMUKHI: 22,
8148    HEBREW: 22,
8149    HIRAGANA: 23,
8150    HIRAGANA_IROHA: 24,
8151    JAPANESE_FORMAL: 25,
8152    JAPANESE_INFORMAL: 26,
8153    KANNADA: 27,
8154    KATAKANA: 28,
8155    KATAKANA_IROHA: 29,
8156    KHMER: 30,
8157    KOREAN_HANGUL_FORMAL: 31,
8158    KOREAN_HANJA_FORMAL: 32,
8159    KOREAN_HANJA_INFORMAL: 33,
8160    LAO: 34,
8161    LOWER_ARMENIAN: 35,
8162    MALAYALAM: 36,
8163    MONGOLIAN: 37,
8164    MYANMAR: 38,
8165    ORIYA: 39,
8166    PERSIAN: 40,
8167    SIMP_CHINESE_FORMAL: 41,
8168    SIMP_CHINESE_INFORMAL: 42,
8169    TAMIL: 43,
8170    TELUGU: 44,
8171    THAI: 45,
8172    TIBETAN: 46,
8173    TRAD_CHINESE_FORMAL: 47,
8174    TRAD_CHINESE_INFORMAL: 48,
8175    UPPER_ARMENIAN: 49,
8176    DISCLOSURE_OPEN: 50,
8177    DISCLOSURE_CLOSED: 51
8178};
8179
8180var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
8181    switch (type) {
8182        case 'disc':
8183            return LIST_STYLE_TYPE.DISC;
8184        case 'circle':
8185            return LIST_STYLE_TYPE.CIRCLE;
8186        case 'square':
8187            return LIST_STYLE_TYPE.SQUARE;
8188        case 'decimal':
8189            return LIST_STYLE_TYPE.DECIMAL;
8190        case 'cjk-decimal':
8191            return LIST_STYLE_TYPE.CJK_DECIMAL;
8192        case 'decimal-leading-zero':
8193            return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
8194        case 'lower-roman':
8195            return LIST_STYLE_TYPE.LOWER_ROMAN;
8196        case 'upper-roman':
8197            return LIST_STYLE_TYPE.UPPER_ROMAN;
8198        case 'lower-greek':
8199            return LIST_STYLE_TYPE.LOWER_GREEK;
8200        case 'lower-alpha':
8201            return LIST_STYLE_TYPE.LOWER_ALPHA;
8202        case 'upper-alpha':
8203            return LIST_STYLE_TYPE.UPPER_ALPHA;
8204        case 'arabic-indic':
8205            return LIST_STYLE_TYPE.ARABIC_INDIC;
8206        case 'armenian':
8207            return LIST_STYLE_TYPE.ARMENIAN;
8208        case 'bengali':
8209            return LIST_STYLE_TYPE.BENGALI;
8210        case 'cambodian':
8211            return LIST_STYLE_TYPE.CAMBODIAN;
8212        case 'cjk-earthly-branch':
8213            return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
8214        case 'cjk-heavenly-stem':
8215            return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
8216        case 'cjk-ideographic':
8217            return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
8218        case 'devanagari':
8219            return LIST_STYLE_TYPE.DEVANAGARI;
8220        case 'ethiopic-numeric':
8221            return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
8222        case 'georgian':
8223            return LIST_STYLE_TYPE.GEORGIAN;
8224        case 'gujarati':
8225            return LIST_STYLE_TYPE.GUJARATI;
8226        case 'gurmukhi':
8227            return LIST_STYLE_TYPE.GURMUKHI;
8228        case 'hebrew':
8229            return LIST_STYLE_TYPE.HEBREW;
8230        case 'hiragana':
8231            return LIST_STYLE_TYPE.HIRAGANA;
8232        case 'hiragana-iroha':
8233            return LIST_STYLE_TYPE.HIRAGANA_IROHA;
8234        case 'japanese-formal':
8235            return LIST_STYLE_TYPE.JAPANESE_FORMAL;
8236        case 'japanese-informal':
8237            return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
8238        case 'kannada':
8239            return LIST_STYLE_TYPE.KANNADA;
8240        case 'katakana':
8241            return LIST_STYLE_TYPE.KATAKANA;
8242        case 'katakana-iroha':
8243            return LIST_STYLE_TYPE.KATAKANA_IROHA;
8244        case 'khmer':
8245            return LIST_STYLE_TYPE.KHMER;
8246        case 'korean-hangul-formal':
8247            return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
8248        case 'korean-hanja-formal':
8249            return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
8250        case 'korean-hanja-informal':
8251            return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
8252        case 'lao':
8253            return LIST_STYLE_TYPE.LAO;
8254        case 'lower-armenian':
8255            return LIST_STYLE_TYPE.LOWER_ARMENIAN;
8256        case 'malayalam':
8257            return LIST_STYLE_TYPE.MALAYALAM;
8258        case 'mongolian':
8259            return LIST_STYLE_TYPE.MONGOLIAN;
8260        case 'myanmar':
8261            return LIST_STYLE_TYPE.MYANMAR;
8262        case 'oriya':
8263            return LIST_STYLE_TYPE.ORIYA;
8264        case 'persian':
8265            return LIST_STYLE_TYPE.PERSIAN;
8266        case 'simp-chinese-formal':
8267            return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
8268        case 'simp-chinese-informal':
8269            return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
8270        case 'tamil':
8271            return LIST_STYLE_TYPE.TAMIL;
8272        case 'telugu':
8273            return LIST_STYLE_TYPE.TELUGU;
8274        case 'thai':
8275            return LIST_STYLE_TYPE.THAI;
8276        case 'tibetan':
8277            return LIST_STYLE_TYPE.TIBETAN;
8278        case 'trad-chinese-formal':
8279            return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
8280        case 'trad-chinese-informal':
8281            return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
8282        case 'upper-armenian':
8283            return LIST_STYLE_TYPE.UPPER_ARMENIAN;
8284        case 'disclosure-open':
8285            return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
8286        case 'disclosure-closed':
8287            return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
8288        case 'none':
8289        default:
8290            return LIST_STYLE_TYPE.NONE;
8291    }
8292};
8293
8294var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
8295    var listStyleImage = (0, background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
8296    return {
8297        listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
8298        listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
8299        listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
8300    };
8301};
8302
8303var parseListStylePosition = function parseListStylePosition(position) {
8304    switch (position) {
8305        case 'inside':
8306            return LIST_STYLE_POSITION.INSIDE;
8307        case 'outside':
8308        default:
8309            return LIST_STYLE_POSITION.OUTSIDE;
8310    }
8311};
8312});
8313
8314unwrapExports(listStyle);
8315var listStyle_1 = listStyle.parseListStyle;
8316var listStyle_2 = listStyle.parseListStyleType;
8317var listStyle_3 = listStyle.LIST_STYLE_TYPE;
8318var listStyle_4 = listStyle.LIST_STYLE_POSITION;
8319
8320var margin = createCommonjsModule(function (module, exports) {
8321Object.defineProperty(exports, "__esModule", {
8322    value: true
8323});
8324exports.parseMargin = undefined;
8325
8326
8327
8328var _Length2 = _interopRequireDefault(Length_1);
8329
8330function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8331
8332var SIDES = ['top', 'right', 'bottom', 'left'];
8333
8334var parseMargin = exports.parseMargin = function parseMargin(style) {
8335    return SIDES.map(function (side) {
8336        return new _Length2.default(style.getPropertyValue('margin-' + side));
8337    });
8338};
8339});
8340
8341unwrapExports(margin);
8342var margin_1 = margin.parseMargin;
8343
8344var overflow = createCommonjsModule(function (module, exports) {
8345Object.defineProperty(exports, "__esModule", {
8346    value: true
8347});
8348var OVERFLOW = exports.OVERFLOW = {
8349    VISIBLE: 0,
8350    HIDDEN: 1,
8351    SCROLL: 2,
8352    AUTO: 3
8353};
8354
8355var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
8356    switch (overflow) {
8357        case 'hidden':
8358            return OVERFLOW.HIDDEN;
8359        case 'scroll':
8360            return OVERFLOW.SCROLL;
8361        case 'auto':
8362            return OVERFLOW.AUTO;
8363        case 'visible':
8364        default:
8365            return OVERFLOW.VISIBLE;
8366    }
8367};
8368});
8369
8370unwrapExports(overflow);
8371var overflow_1 = overflow.OVERFLOW;
8372var overflow_2 = overflow.parseOverflow;
8373
8374var overflowWrap = createCommonjsModule(function (module, exports) {
8375Object.defineProperty(exports, "__esModule", {
8376    value: true
8377});
8378var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
8379    NORMAL: 0,
8380    BREAK_WORD: 1
8381};
8382
8383var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
8384    switch (overflow) {
8385        case 'break-word':
8386            return OVERFLOW_WRAP.BREAK_WORD;
8387        case 'normal':
8388        default:
8389            return OVERFLOW_WRAP.NORMAL;
8390    }
8391};
8392});
8393
8394unwrapExports(overflowWrap);
8395var overflowWrap_1 = overflowWrap.OVERFLOW_WRAP;
8396var overflowWrap_2 = overflowWrap.parseOverflowWrap;
8397
8398var position = createCommonjsModule(function (module, exports) {
8399Object.defineProperty(exports, "__esModule", {
8400    value: true
8401});
8402var POSITION = exports.POSITION = {
8403    STATIC: 0,
8404    RELATIVE: 1,
8405    ABSOLUTE: 2,
8406    FIXED: 3,
8407    STICKY: 4
8408};
8409
8410var parsePosition = exports.parsePosition = function parsePosition(position) {
8411    switch (position) {
8412        case 'relative':
8413            return POSITION.RELATIVE;
8414        case 'absolute':
8415            return POSITION.ABSOLUTE;
8416        case 'fixed':
8417            return POSITION.FIXED;
8418        case 'sticky':
8419            return POSITION.STICKY;
8420    }
8421
8422    return POSITION.STATIC;
8423};
8424});
8425
8426unwrapExports(position);
8427var position_1 = position.POSITION;
8428var position_2 = position.parsePosition;
8429
8430var textShadow = createCommonjsModule(function (module, exports) {
8431Object.defineProperty(exports, "__esModule", {
8432    value: true
8433});
8434exports.parseTextShadow = undefined;
8435
8436
8437
8438var _Color2 = _interopRequireDefault(Color_1);
8439
8440function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8441
8442var NUMBER = /^([+-]|\d|\.)$/i;
8443
8444var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
8445    if (textShadow === 'none' || typeof textShadow !== 'string') {
8446        return null;
8447    }
8448
8449    var currentValue = '';
8450    var isLength = false;
8451    var values = [];
8452    var shadows = [];
8453    var numParens = 0;
8454    var color = null;
8455
8456    var appendValue = function appendValue() {
8457        if (currentValue.length) {
8458            if (isLength) {
8459                values.push(parseFloat(currentValue));
8460            } else {
8461                color = new _Color2.default(currentValue);
8462            }
8463        }
8464        isLength = false;
8465        currentValue = '';
8466    };
8467
8468    var appendShadow = function appendShadow() {
8469        if (values.length && color !== null) {
8470            shadows.push({
8471                color: color,
8472                offsetX: values[0] || 0,
8473                offsetY: values[1] || 0,
8474                blur: values[2] || 0
8475            });
8476        }
8477        values.splice(0, values.length);
8478        color = null;
8479    };
8480
8481    for (var i = 0; i < textShadow.length; i++) {
8482        var c = textShadow[i];
8483        switch (c) {
8484            case '(':
8485                currentValue += c;
8486                numParens++;
8487                break;
8488            case ')':
8489                currentValue += c;
8490                numParens--;
8491                break;
8492            case ',':
8493                if (numParens === 0) {
8494                    appendValue();
8495                    appendShadow();
8496                } else {
8497                    currentValue += c;
8498                }
8499                break;
8500            case ' ':
8501                if (numParens === 0) {
8502                    appendValue();
8503                } else {
8504                    currentValue += c;
8505                }
8506                break;
8507            default:
8508                if (currentValue.length === 0 && NUMBER.test(c)) {
8509                    isLength = true;
8510                }
8511                currentValue += c;
8512        }
8513    }
8514
8515    appendValue();
8516    appendShadow();
8517
8518    if (shadows.length === 0) {
8519        return null;
8520    }
8521
8522    return shadows;
8523};
8524});
8525
8526unwrapExports(textShadow);
8527var textShadow_1 = textShadow.parseTextShadow;
8528
8529var textTransform = createCommonjsModule(function (module, exports
8529) {
8530Object.defineProperty(exports, "__esModule", {
8531    value: true
8532});
8533var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
8534    NONE: 0,
8535    LOWERCASE: 1,
8536    UPPERCASE: 2,
8537    CAPITALIZE: 3
8538};
8539
8540var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
8541    switch (textTransform) {
8542        case 'uppercase':
8543            return TEXT_TRANSFORM.UPPERCASE;
8544        case 'lowercase':
8545            return TEXT_TRANSFORM.LOWERCASE;
8546        case 'capitalize':
8547            return TEXT_TRANSFORM.CAPITALIZE;
8548    }
8549
8550    return TEXT_TRANSFORM.NONE;
8551};
8552});
8553
8554unwrapExports(textTransform);
8555var textTransform_1 = textTransform.TEXT_TRANSFORM;
8556var textTransform_2 = textTransform.parseTextTransform;
8557
8558var transform = createCommonjsModule(function (module, exports) {
8559Object.defineProperty(exports, "__esModule", {
8560    value: true
8561});
8562exports.parseTransform = undefined;
8563
8564
8565
8566var _Length2 = _interopRequireDefault(Length_1);
8567
8568function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8569
8570var toFloat = function toFloat(s) {
8571    return parseFloat(s.trim());
8572};
8573
8574var MATRIX = /(matrix|matrix3d)\((.+)\)/;
8575
8576var parseTransform = exports.parseTransform = function parseTransform(style) {
8577    var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
8578    // $FlowFixMe
8579    style.msTransform ||
8580    // $FlowFixMe
8581    style.oTransform);
8582    if (transform === null) {
8583        return null;
8584    }
8585
8586    return {
8587        transform: transform,
8588        transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
8589        // $FlowFixMe
8590        style.msTransformOrigin ||
8591        // $FlowFixMe
8592        style.oTransformOrigin)
8593    };
8594};
8595
8596// $FlowFixMe
8597var parseTransformOrigin = function parseTransformOrigin(origin) {
8598    if (typeof origin !== 'string') {
8599        var v = new _Length2.default('0');
8600        return [v, v];
8601    }
8602    var values = origin.split(' ').map(_Length2.default.create);
8603    return [values[0], values[1]];
8604};
8605
8606// $FlowFixMe
8607var parseTransformMatrix = function parseTransformMatrix(transform) {
8608    if (transform === 'none' || typeof transform !== 'string') {
8609        return null;
8610    }
8611
8612    var match = transform.match(MATRIX);
8613    if (match) {
8614        if (match[1] === 'matrix') {
8615            var matrix = match[2].split(',').map(toFloat);
8616            return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
8617        } else {
8618            var matrix3d = match[2].split(',').map(toFloat);
8619            return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
8620        }
8621    }
8622    return null;
8623};
8624});
8625
8626unwrapExports(transform);
8627var transform_1 = transform.parseTransform;
8628
8629var visibility = createCommonjsModule(function (module, exports) {
8630Object.defineProperty(exports, "__esModule", {
8631    value: true
8632});
8633var VISIBILITY = exports.VISIBILITY = {
8634    VISIBLE: 0,
8635    HIDDEN: 1,
8636    COLLAPSE: 2
8637};
8638
8639var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
8640    switch (visibility) {
8641        case 'hidden':
8642            return VISIBILITY.HIDDEN;
8643        case 'collapse':
8644            return VISIBILITY.COLLAPSE;
8645        case 'visible':
8646        default:
8647            return VISIBILITY.VISIBLE;
8648    }
8649};
8650});
8651
8652unwrapExports(visibility);
8653var visibility_1 = visibility.VISIBILITY;
8654var visibility_2 = visibility.parseVisibility;
8655
8656var wordBreak = createCommonjsModule(function (module, exports) {
8657Object.defineProperty(exports, "__esModule", {
8658    value: true
8659});
8660var WORD_BREAK = exports.WORD_BREAK = {
8661    NORMAL: 'normal',
8662    BREAK_ALL: 'break-all',
8663    KEEP_ALL: 'keep-all'
8664};
8665
8666var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
8667    switch (wordBreak) {
8668        case 'break-all':
8669            return WORD_BREAK.BREAK_ALL;
8670        case 'keep-all':
8671            return WORD_BREAK.KEEP_ALL;
8672        case 'normal':
8673        default:
8674            return WORD_BREAK.NORMAL;
8675    }
8676};
8677});
8678
8679unwrapExports(wordBreak);
8680var wordBreak_1 = wordBreak.WORD_BREAK;
8681var wordBreak_2 = wordBreak.parseWordBreak;
8682
8683var zIndex = createCommonjsModule(function (module, exports) {
8684Object.defineProperty(exports, "__esModule", {
8685    value: true
8686});
8687var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
8688    var auto = zIndex === 'auto';
8689    return {
8690        auto: auto,
8691        order: auto ? 0 : parseInt(zIndex, 10)
8692    };
8693};
8694});
8695
8696unwrapExports(zIndex);
8697var zIndex_1 = zIndex.parseZIndex;
8698
8699var ForeignObjectRenderer_1 = createCommonjsModule(function (module, exports) {
8700Object.defineProperty(exports, "__esModule", {
8701    value: true
8702});
8703
8704var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8705
8706function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8707
8708var ForeignObjectRenderer = function () {
8709    function ForeignObjectRenderer(element) {
8710        _classCallCheck(this, ForeignObjectRenderer);
8711
8712        this.element = element;
8713    }
8714
8715    _createClass(ForeignObjectRenderer, [{
8716        key: 'render',
8717        value: function render(options) {
8718            var _this = this;
8719
8720            this.options = options;
8721            this.canvas = document.createElement('canvas');
8722            this.ctx = this.canvas.getContext('2d');
8723            this.canvas.width = Math.floor(options.width) * options.scale;
8724            this.canvas.height = Math.floor(options.height) * options.scale;
8725            this.canvas.style.width = options.width + 'px';
8726            this.canvas.style.height = options.height + 'px';
8727
8728            options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
8729            var svg = createForeignObjectSVG(Math.max(options.windowWidth, options.width) * options.scale, Math.max(options.windowHeight, options.height) * options.scale, options.scrollX * options.scale, options.scrollY * options.scale, this.element);
8730
8731            return loadSerializedSVG(svg).then(function (img) {
8732                if (options.backgroundColor) {
8733                    _this.ctx.fillStyle = options.backgroundColor.toString();
8734                    _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
8735                }
8736
8737                _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
8738                return _this.canvas;
8739            });
8740        }
8741    }]);
8742
8743    return ForeignObjectRenderer;
8744}();
8745
8746exports.default = ForeignObjectRenderer;
8747var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
8748    var xmlns = 'http://www.w3.org/2000/svg';
8749    var svg = document.createElementNS(xmlns, 'svg');
8750    var foreignObject = document.createElementNS(xmlns, 'foreignObject');
8751    svg.setAttributeNS(null, 'width', width);
8752    svg.setAttributeNS(null, 'height', height);
8753
8754    foreignObject.setAttributeNS(null, 'width', '100%');
8755    foreignObject.setAttributeNS(null, 'height', '100%');
8756    foreignObject.setAttributeNS(null, 'x', x);
8757    foreignObject.setAttributeNS(null, 'y', y);
8758    foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
8759    svg.appendChild(foreignObject);
8760
8761    foreignObject.appendChild(node);
8762
8763    return svg;
8764};
8765
8766var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
8767    return new Promise(function (resolve, reject) {
8768        var img = new Image();
8769        img.onload = function () {
8770            return resolve(img);
8771        };
8772        img.onerror = reject;
8773
8774        img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
8775    });
8776};
8777});
8778
8779unwrapExports(ForeignObjectRenderer_1);
8780var ForeignObjectRenderer_2 = ForeignObjectRenderer_1.createForeignObjectSVG;
8781var ForeignObjectRenderer_3 = ForeignObjectRenderer_1.loadSerializedSVG;
8782
8783var Feature = createCommonjsModule(function (module, exports) {
8784Object.defineProperty(exports, "__esModule", {
8785    value: true
8786});
8787
8788
8789
8790var testRangeBounds = function testRangeBounds(document) {
8791    var TEST_HEIGHT = 123;
8792
8793    if (document.createRange) {
8794        var range = document.createRange();
8795        if (range.getBoundingClientRect) {
8796            var testElement = document.createElement('boundtest');
8797            testElement.style.height = TEST_HEIGHT + 'px';
8798            testElement.style.display = 'block';
8799            document.body.appendChild(testElement);
8800
8801            range.selectNode(testElement);
8802            var rangeBounds = range.getBoundingClientRect();
8803            var rangeHeight = Math.round(rangeBounds.height);
8804            document.body.removeChild(testElement);
8805            if (rangeHeight === TEST_HEIGHT) {
8806                return true;
8807            }
8808        }
8809    }
8810
8811    return false;
8812};
8813
8814// iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
8815var testBase64 = function testBase64(document, src) {
8816    var img = new Image();
8817    var canvas = document.createElement('canvas');
8818    var ctx = canvas.getContext('2d');
8819
8820    return new Promise(function (resolve) {
8821        // Single pixel base64 image renders fine on iOS 10.3???
8822        img.src = src;
8823
8824        var onload = function onload() {
8825            try {
8826                ctx.drawImage(img, 0, 0);
8827                canvas.toDataURL();
8828            } catch (e) {
8829                return resolve(false);
8830            }
8831
8832            return resolve(true);
8833        };
8834
8835        img.onload = onload;
8836        img.onerror = function () {
8837            return resolve(false);
8838        };
8839
8840        if (img.complete === true) {
8841            setTimeout(function () {
8842                onload();
8843            }, 500);
8844        }
8845    });
8846};
8847
8848var testCORS = function testCORS() {
8849    return typeof new Image().crossOrigin !== 'undefined';
8850};
8851
8852var testResponseType = function testResponseType() {
8853    return typeof new XMLHttpRequest().responseType === 'string';
8854};
8855
8856var testSVG = function testSVG(document) {
8857    var img = new Image();
8858    var canvas = document.createElement('canvas');
8859    var ctx = canvas.getContext('2d');
8860    img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
8861
8862    try {
8863        ctx.drawImage(img, 0, 0);
8864        canvas.toDataURL();
8865    } catch (e) {
8866        return false;
8867    }
8868    return true;
8869};
8870
8871var isGreenPixel = function isGreenPixel(data) {
8872    return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
8873};
8874
8875var testForeignObject = function testForeignObject(document) {
8876    var canvas = document.createElement('canvas');
8877    var size = 100;
8878    canvas.width = size;
8879    canvas.height = size;
8880    var ctx = canvas.getContext('2d');
8881    ctx.fillStyle = 'rgb(0, 255, 0)';
8882    ctx.fillRect(0, 0, size, size);
8883
8884    var img = new Image();
8885    var greenImageSrc = canvas.toDataURL();
8886    img.src = greenImageSrc;
8887    var svg = (0, ForeignObjectRenderer_1.createForeignObjectSVG)(size, size, 0, 0, img);
8888    ctx.fillStyle = 'red';
8889    ctx.fillRect(0, 0, size, size);
8890
8891    return (0, ForeignObjectRenderer_1.loadSerializedSVG)(svg).then(function (img) {
8892        ctx.drawImage(img, 0, 0);
8893        var data = ctx.getImageData(0, 0, size, size).data;
8894        ctx.fillStyle = 'red';
8895        ctx.fillRect(0, 0, size, size);
8896
8897        var node = document.createElement('div');
8898        node.style.backgroundImage = 'url(' + greenImageSrc + ')';
8899        node.style.height = size + 'px';
8900        // Firefox 55 does not render inline <img /> tags
8901        return isGreenPixel(data) ? (0, ForeignObjectRenderer_1.loadSerializedSVG)((0, ForeignObjectRenderer_1.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
8902    }).then(function (img) {
8903        ctx.drawImage(img, 0, 0);
8904        // Edge does not render background-images
8905        return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
8906    }).catch(function (e) {
8907        return false;
8908    });
8909};
8910
8911var FEATURES = {
8912    // $FlowFixMe - get/set properties not yet supported
8913    get SUPPORT_RANGE_BOUNDS() {
8914        var value = testRangeBounds(document);
8915        Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
8916        return value;
8917    },
8918    // $FlowFixMe - get/set properties not yet supported
8919    get SUPPORT_SVG_DRAWING() {
8920        var value = testSVG(document);
8921        Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
8922        return value;
8923    },
8924    // $FlowFixMe - get/set properties not yet supported
8925    get SUPPORT_BASE64_DRAWING() {
8926        return function (src) {
8927            var _value = testBase64(document, src);
8928            Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
8929                    return _value;
8930                } });
8931            return _value;
8932        };
8933    },
8934    // $FlowFixMe - get/set properties not yet supported
8935    get SUPPORT_FOREIGNOBJECT_DRAWING() {
8936        var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
8937        Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
8938        return value;
8939    },
8940    // $FlowFixMe - get/set properties not yet supported
8941    get SUPPORT_CORS_IMAGES() {
8942        var value = testCORS();
8943        Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
8944        return value;
8945    },
8946    // $FlowFixMe - get/set properties not yet supported
8947    get SUPPORT_RESPONSE_TYPE() {
8948        var value = testResponseType();
8949        Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
8950        return value;
8951    },
8952    // $FlowFixMe - get/set properties not yet supported
8953    get SUPPORT_CORS_XHR() {
8954        var value = 'withCredentials' in new XMLHttpRequest();
8955        Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
8956        return value;
8957    }
8958};
8959
8960exports.default = FEATURES;
8961});
8962
8963unwrapExports(Feature);
8964
8965var Util$2 = createCommonjsModule(function (module, exports) {
8966Object.defineProperty(exports, "__esModule", {
8967    value: true
8968});
8969var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
8970    var codePoints = [];
8971    var i = 0;
8972    var length = str.length;
8973    while (i < length) {
8974        var value = str.charCodeAt(i++);
8975        if (value >= 0xd800 && value <= 0xdbff && i < length) {
8976            var extra = str.charCodeAt(i++);
8977            if ((extra & 0xfc00) === 0xdc00) {
8978                codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
8979            } else {
8980                codePoints.push(value);
8981                i--;
8982            }
8983        } else {
8984            codePoints.push(value);
8985        }
8986    }
8987    return codePoints;
8988};
8989
8990var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
8991    if (String.fromCodePoint) {
8992        return String.fromCodePoint.apply(String, arguments);
8993    }
8994
8995    var length = arguments.length;
8996    if (!length) {
8997        return '';
8998    }
8999
9000    var codeUnits = [];
9001
9002    var index = -1;
9003    var result = '';
9004    while (++index < length) {
9005        var codePoint = arguments.length <= index ? undefined : arguments[index];
9006        if (codePoint <= 0xffff) {
9007            codeUnits.push(codePoint);
9008        } else {
9009            codePoint -= 0x10000;
9010            codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
9011        }
9012        if (index + 1 === length || codeUnits.length > 0x4000) {
9013            result += String.fromCharCode.apply(String, codeUnits);
9014            codeUnits.length = 0;
9015        }
9016    }
9017    return result;
9018};
9019
9020var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
9021
9022// Use a lookup table to find the index.
9023var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
9024for (var i = 0; i < chars.length; i++) {
9025    lookup[chars.charCodeAt(i)] = i;
9026}
9027
9028var decode = exports.decode = function decode(base64) {
9029    var bufferLength = base64.length * 0.75,
9030        len = base64.length,
9031        i = void 0,
9032        p = 0,
9033        encoded1 = void 0,
9034        encoded2 = void 0,
9035        encoded3 = void 0,
9036        encoded4 = void 0;
9037
9038    if (base64[base64.length - 1] === '=') {
9039        bufferLength--;
9040        if (base64[base64.length - 2] === '=') {
9041            bufferLength--;
9042        }
9043    }
9044
9045    var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
9046    var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
9047
9048    for (i = 0; i < len; i += 4) {
9049        encoded1 = lookup[base64.charCodeAt(i)];
9050        encoded2 = lookup[base64.charCodeAt(i + 1)];
9051        encoded3 = lookup[base64.charCodeAt(i + 2)];
9052        encoded4 = lookup[base64.charCodeAt(i + 3)];
9053
9054        bytes[p++] = encoded1 << 2 | encoded2 >> 4;
9055        bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
9056        bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
9057    }
9058
9059    return buffer;
9060};
9061
9062var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
9063    var length = buffer.length;
9064    var bytes = [];
9065    for (var _i = 0; _i < length; _i += 2) {
9066        bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
9067    }
9068    return bytes;
9069};
9070
9071var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
9072    var length = buffer.length;
9073    var bytes = [];
9074    for (var _i2 = 0; _i2 < length; _i2 += 4) {
9075        bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
9076    }
9077    return bytes;
9078};
9079});
9080
9081unwrapExports(Util$2);
9082var Util_1$1 = Util$2.toCodePoints;
9083var Util_2$1 = Util$2.fromCodePoint;
9084var Util_3$1 = Util$2.decode;
9085var Util_4$1 = Util$2.polyUint16Array;
9086var Util_5 = Util$2.polyUint32Array;
9087
9088var Trie_1 = createCommonjsModule(function (module, exports) {
9089Object.defineProperty(exports, "__esModule", {
9090    value: true
9091});
9092exports.Trie = exports.createTrieFromBase64 = exports.UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_DATA_MASK = exports.UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_SHIFT_1_2 = exports.UTRIE2_INDEX_SHIFT = exports.UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_2 = undefined;
9093
9094var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9095
9096
9097
9098function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9099
9100/** Shift size for getting the index-2 table offset. */
9101var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
9102
9103/** Shift size for getting the index-1 table offset. */
9104var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
9105
9106/**
9107 * Shift size for shifting left the index array values.
9108 * Increases possible data size with 16-bit index values at the cost
9109 * of compactability.
9110 * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
9111 */
9112var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
9113
9114/**
9115 * Difference between the two shift sizes,
9116 * for getting an index-1 offset from an index-2 offset. 6=11-5
9117 */
9118var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
9119
9120/**
9121 * The part of the index-2 table for U+D800..U+DBFF stores values for
9122 * lead surrogate code _units_ not code _points_.
9123 * Values for lead surrogate code _points_ are indexed with this portion of the table.
9124 * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
9125 */
9126var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
9127
9128/** Number of entries in a data block. 32=0x20 */
9129var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
9130/** Mask for getting the lower bits for the in-data-block offset. */
9131var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
9132
9133var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
9134/** Count the lengths of both BMP pieces. 2080=0x820 */
9135var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
9136/**
9137 * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
9138 * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
9139 */
9140var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
9141var UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */
9142/**
9143 * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
9144 * Variable length, for code points up to highStart, where the last single-value range starts.
9145 * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
9146 * (For 0x100000 supplementary code points U+10000..U+10ffff.)
9147 *
9148 * The part of the index-2 table for supplementary code points starts
9149 * after this index-1 table.
9150 *
9151 * Both the index-1 table and the following part of the index-2 table
9152 * are omitted completely if there is only BMP data.
9153 */
9154var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
9155
9156/**
9157 * Number of index-1 entries for the BMP. 32=0x20
9158 * This part of the index-1 table is omitted from the serialized form.
9159 */
9160var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
9161
9162/** Number of entries in an index-2 block. 64=0x40 */
9163var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
9164/** Mask for getting the lower bits for the in-index-2-block offset. */
9165var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
9166
9167var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
9168    var buffer = (0, Util$2.decode)(base64);
9169    var view32 = Array.isArray(buffer) ? (0, Util$2.polyUint32Array)(buffer) : new Uint32Array(buffer);
9170    var view16 = Array.isArray(buffer) ? (0, Util$2.polyUint16Array)(buffer) : new Uint16Array(buffer);
9171    var headerLength = 24;
9172
9173    var index = view16.slice(headerLength / 2, view32[4] / 2);
9174    var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
9175
9176    return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
9177};
9178
9179var Trie = exports.Trie = function () {
9180    function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
9181        _classCallCheck(this, Trie);
9182
9183        this.initialValue = initialValue;
9184        this.errorValue = errorValue;
9185        this.highStart = highStart;
9186        this.highValueIndex = highValueIndex;
9187        this.index = index;
9188        this.data = data;
9189    }
9190
9191    /**
9192     * Get the value for a code point as stored in the Trie.
9193     *
9194     * @param codePoint the code point
9195     * @return the value
9196     */
9197
9198
9199    _createClass(Trie, [{
9200        key: 'get',
9201        value: function get(codePoint) {
9202            var ix = void 0;
9203            if (codePoint >= 0) {
9204                if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
9205                    // Ordinary BMP code point, excluding leading surrogates.
9206                    // BMP uses a single level lookup.  BMP index starts at offset 0 in the Trie2 index.
9207                    // 16 bit data is stored in the index array itself.
9208                    ix = this.index[codePoint >> UTRIE2_SHIFT_2];
9209                    ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
9210                    return this.data[ix];
9211                }
9212
9213                if (codePoint <= 0xffff) {
9214                    // Lead Surrogate Code Point.  A Separate index section is stored for
9215                    // lead surrogate code units and code points.
9216                    //   The main index has the code unit data.
9217                    //   For this function, we need the code point data.
9218                    // Note: this expression could be refactored for slightly improved efficie
9218ncy, but
9219                    //       surrogate code points will be so rare in practice that it's not worth it.
9220                    ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
9221                    ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
9222                    return this.data[ix];
9223                }
9224
9225                if (codePoint < this.highStart) {
9226                    // Supplemental code point, use two-level lookup.
9227                    ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
9228                    ix = this.index[ix];
9229                    ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
9230                    ix = this.index[ix];
9231                    ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
9232                    return this.data[ix];
9233                }
9234                if (codePoint <= 0x10ffff) {
9235                    return this.data[this.highValueIndex];
9236                }
9237            }
9238
9239            // Fall through.  The code point is outside of the legal range of 0..0x10ffff.
9240            return this.errorValue;
9241        }
9242    }]);
9243
9244    return Trie;
9245}();
9246});
9247
9248unwrapExports(Trie_1);
9249var Trie_2 = Trie_1.Trie;
9250var Trie_3 = Trie_1.createTrieFromBase64;
9251var Trie_4 = Trie_1.UTRIE2_INDEX_2_MASK;
9252var Trie_5 = Trie_1.UTRIE2_INDEX_2_BLOCK_LENGTH;
9253var Trie_6 = Trie_1.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH;
9254var Trie_7 = Trie_1.UTRIE2_INDEX_1_OFFSET;
9255var Trie_8 = Trie_1.UTRIE2_UTF8_2B_INDEX_2_LENGTH;
9256var Trie_9 = Trie_1.UTRIE2_UTF8_2B_INDEX_2_OFFSET;
9257var Trie_10 = Trie_1.UTRIE2_INDEX_2_BMP_LENGTH;
9258var Trie_11 = Trie_1.UTRIE2_LSCP_INDEX_2_LENGTH;
9259var Trie_12 = Trie_1.UTRIE2_DATA_MASK;
9260var Trie_13 = Trie_1.UTRIE2_DATA_BLOCK_LENGTH;
9261var Trie_14 = Trie_1.UTRIE2_LSCP_INDEX_2_OFFSET;
9262var Trie_15 = Trie_1.UTRIE2_SHIFT_1_2;
9263var Trie_16 = Trie_1.UTRIE2_INDEX_SHIFT;
9264var Trie_17 = Trie_1.UTRIE2_SHIFT_1;
9265var Trie_18 = Trie_1.UTRIE2_SHIFT_2;
9266
9267var linebreakTrie = '
vendor: 50,624 bytes, line 9267
9267KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA
vendor: 1,559 bytes, lines 9267-9277
9267';
9268
9269var LineBreak = createCommonjsModule(function (module, exports) {
9270Object.defineProperty(exports, "__esModule", {
9271    value: true
9272});
9273exports.LineBreaker = exports.inlineBreakOpportunities = exports.lineBreakAtIndex = exports.codePointsToCharacterClasses = exports.UnicodeTrie = exports.BREAK_ALLOWED = exports.BREAK_NOT_ALLOWED = exports.BREAK_MANDATORY = exports.classes = exports.LETTER_NUMBER_MODIFIER = undefined;
9274
9275var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9276
9277var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); }
9277 else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
9278
9279
9280
9281
9282
9283var _linebreakTrie2 = _interopRequireDefault(linebreakTrie);
9284
9285
9286
9287function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9288
9289function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
9290
9291function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9292
9293var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
9294
9295// Non-tailorable Line Breaking Classes
9296var BK = 1; //  Cause a line break (after)
9297var CR = 2; //  Cause a line break (after), except between CR and LF
9298var LF = 3; //  Cause a line break (after)
9299var CM = 4; //  Prohibit a line break between the character and the preceding character
9300var NL = 5; //  Cause a line break (after)
9301var SG = 6; //  Do not occur in well-formed text
9302var WJ = 7; //  Prohibit line breaks before and after
9303var ZW = 8; //  Provide a break opportunity
9304var GL = 9; //  Prohibit line breaks before and after
9305var SP = 10; // Enable indirect line breaks
9306var ZWJ = 11; // Prohibit line breaks within joiner sequences
9307// Break Opportunities
9308var B2 = 12; //  Provide a line break opportunity before and after the character
9309var BA = 13; //  Generally provide a line break opportunity after the character
9310var BB = 14; //  Generally provide a line break opportunity before the character
9311var HY = 15; //  Provide a line break opportunity after the character, except in numeric context
9312var CB = 16; //   Provide a line break opportunity contingent on additional information
9313// Characters Prohibiting Certain Breaks
9314var CL = 17; //  Prohibit line breaks before
9315var CP = 18; //  Prohibit line breaks before
9316var EX = 19; //  Prohibit line breaks before
9317var IN = 20; //  Allow only indirect line breaks between pairs
9318var NS = 21; //  Allow only indirect line breaks before
9319var OP = 22; //  Prohibit line breaks after
9320var QU = 23; //  Act like they are both opening and closing
9321// Numeric Context
9322var IS = 24; //  Prevent breaks after any and before numeric
9323var NU = 25; //  Form numeric expressions for line breaking purposes
9324var PO = 26; //  Do not break following a numeric expression
9325var PR = 27; //  Do not break in front of a numeric expression
9326var SY = 28; //  Prevent a break before; and allow a break after
9327// Other Characters
9328var AI = 29; //  Act like AL when the resolvedEAW is N; otherwise; act as ID
9329var AL = 30; //  Are alphabetic characters or symbols that are used with alphabetic characters
9330var CJ = 31; //  Treat as NS or ID for strict or normal breaking.
9331var EB = 32; //  Do not break from following Emoji Modifier
9332var EM = 33; //  Do not break from preceding Emoji Base
9333var H2 = 34; //  Form Korean syllable blocks
9334var H3 = 35; //  Form Korean syllable blocks
9335var HL = 36; //  Do not break around a following hyphen; otherwise act as Alphabetic
9336var ID = 37; //  Break before or after; except in some numeric context
9337var JL = 38; //  Form Korean syllable blocks
9338var JV = 39; //  Form Korean syllable blocks
9339var JT = 40; //  Form Korean syllable blocks
9340var RI = 41; //  Keep pairs together. For pairs; break before and after other classes
9341var SA = 42; //  Provide a line break opportunity contingent on additional, language-specific context analysis
9342var XX = 43; //  Have as yet unknown line breaking behavior or unassigned code positions
9343
9344var classes = exports.classes = {
9345    BK: BK,
9346    CR: CR,
9347    LF: LF,
9348    CM: CM,
9349    NL: NL,
9350    SG: SG,
9351    WJ: WJ,
9352    ZW: ZW,
9353    GL: GL,
9354    SP: SP,
9355    ZWJ: ZWJ,
9356    B2: B2,
9357    BA: BA,
9358    BB: BB,
9359    HY: HY,
9360    CB: CB,
9361    CL: CL,
9362    CP: CP,
9363    EX: EX,
9364    IN: IN,
9365    NS: NS,
9366    OP: OP,
9367    QU: QU,
9368    IS: IS,
9369    NU: NU,
9370    PO: PO,
9371    PR: PR,
9372    SY: SY,
9373    AI: AI,
9374    AL: AL,
9375    CJ: CJ,
9376    EB: EB,
9377    EM: EM,
9378    H2: H2,
9379    H3: H3,
9380    HL: HL,
9381    ID: ID,
9382    JL: JL,
9383    JV: JV,
9384    JT: JT,
9385    RI: RI,
9386    SA: SA,
9387    XX: XX
9388};
9389
9390var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
9391var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
9392var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
9393var UnicodeTrie = exports.UnicodeTrie = (0, Trie_1.createTrieFromBase64)(_linebreakTrie2.default);
9394
9395var ALPHABETICS = [AL, HL];
9396var HARD_LINE_BREAKS = [BK, CR, LF, NL];
9397var SPACE = [SP, ZW];
9398var PREFIX_POSTFIX = [PR, PO];
9399var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
9400var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
9401var HYPHEN = [HY, BA];
9402
vendor: 11,440 bytes, lines 9403-9734
9403var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
9404    var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
9405
9406    var types = [];
9407    var indicies = [];
9408    var categories = [];
9409    codePoints.forEach(function (codePoint, index) {
9410        var classType = UnicodeTrie.get(codePoint);
9411        if (classType > LETTER_NUMBER_MODIFIER) {
9412            categories.push(true);
9413            classType -= LETTER_NUMBER_MODIFIER;
9414        } else {
9415            categories.push(false);
9416        }
9417
9418        if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
9419            // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
9420            if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
9421                indicies.push(index);
9422                return types.push(CB);
9423            }
9424        }
9425
9426        if (classType === CM || classType === ZWJ) {
9427            // LB10 Treat any remaining combining mark or ZWJ as AL.
9428            if (index === 0) {
9429                indicies.push(index);
9430                return types.push(AL);
9431            }
9432
9433            // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
9434            // the base character in all of the following rules. Treat ZWJ as if it were CM.
9435            var prev = types[index - 1];
9436            if (LINE_BREAKS.indexOf(prev) === -1) {
9437                indicies.push(indicies[index - 1]);
9438                return types.push(prev);
9439            }
9440            indicies.push(index);
9441            return types.push(AL);
9442        }
9443
9444        indicies.push(index);
9445
9446        if (classType === CJ) {
9447            return types.push(lineBreak === 'strict' ? NS : ID);
9448        }
9449
9450        if (classType === SA) {
9451            return types.push(AL);
9452        }
9453
9454        if (classType === AI) {
9455            return types.push(AL);
9456        }
9457
9458        // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
9459        // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
9460        // to take into account the actual line breaking properties for these characters.
9461        if (classType === XX) {
9462            if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
9463                return types.push(ID);
9464            } else {
9465                return types.push(AL);
9466            }
9467        }
9468
9469        types.push(classType);
9470    });
9471
9472    return [indicies, types, categories];
9473};
9474
9475var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
9476    var current = classTypes[currentIndex];
9477    if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
9478        var i = currentIndex;
9479        while (i <= classTypes.length) {
9480            i++;
9481            var next = classTypes[i];
9482
9483            if (next === b) {
9484                return true;
9485            }
9486
9487            if (next !== SP) {
9488                break;
9489            }
9490        }
9491    }
9492
9493    if (current === SP) {
9494        var _i = currentIndex;
9495
9496        while (_i > 0) {
9497            _i--;
9498            var prev = classTypes[_i];
9499
9500            if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
9501                var n = currentIndex;
9502                while (n <= classTypes.length) {
9503                    n++;
9504                    var _next = classTypes[n];
9505
9506                    if (_next === b) {
9507                        return true;
9508                    }
9509
9510                    if (_next !== SP) {
9511                        break;
9512                    }
9513                }
9514            }
9515
9516            if (prev !== SP) {
9517                break;
9518            }
9519        }
9520    }
9521    return false;
9522};
9523
9524var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
9525    var i = currentIndex;
9526    while (i >= 0) {
9527        var type = classTypes[i];
9528        if (type === SP) {
9529            i--;
9530        } else {
9531            return type;
9532        }
9533    }
9534    return 0;
9535};
9536
9537var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
9538    if (indicies[index] === 0) {
9539        return BREAK_NOT_ALLOWED;
9540    }
9541
9542    var currentIndex = index - 1;
9543    if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
9544        return BREAK_NOT_ALLOWED;
9545    }
9546
9547    var beforeIndex = currentIndex - 1;
9548    var afterIndex = currentIndex + 1;
9549    var current = classTypes[currentIndex];
9550
9551    // LB4 Always break after hard line breaks.
9552    // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
9553    var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
9554    var next = classTypes[afterIndex];
9555
9556    if (current === CR && next === LF) {
9557        return BREAK_NOT_ALLOWED;
9558    }
9559
9560    if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
9561        return BREAK_MANDATORY;
9562    }
9563
9564    // LB6 Do not break before hard line breaks.
9565    if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
9566        return BREAK_NOT_ALLOWED;
9567    }
9568
9569    // LB7 Do not break before spaces or zero width space.
9570    if (SPACE.indexOf(next) !== -1) {
9571        return BREAK_NOT_ALLOWED;
9572    }
9573
9574    // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
9575    if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
9576        return BREAK_ALLOWED;
9577    }
9578
9579    // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
9580    if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
9581        return BREAK_NOT_ALLOWED;
9582    }
9583
9584    // LB11 Do not break before or after Word joiner and related characters.
9585    if (current === WJ || next === WJ) {
9586        return BREAK_NOT_ALLOWED;
9587    }
9588
9589    // LB12 Do not break after NBSP and related characters.
9590    if (current === GL) {
9591        return BREAK_NOT_ALLOWED;
9592    }
9593
9594    // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
9595    if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
9596        return BREAK_NOT_ALLOWED;
9597    }
9598
9599    // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
9600    if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
9601        return BREAK_NOT_ALLOWED;
9602    }
9603
9604    // LB14 Do not break after ‘[’, even after spaces.
9605    if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
9606        return BREAK_NOT_ALLOWED;
9607    }
9608
9609    // LB15 Do not break within ‘”[’, even with intervening spaces.
9610    if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
9611        return BREAK_NOT_ALLOWED;
9612    }
9613
9614    // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
9615    if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
9616        return BREAK_NOT_ALLOWED;
9617    }
9618
9619    // LB17 Do not break within ‘——’, even with intervening spaces.
9620    if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
9621        return BREAK_NOT_ALLOWED;
9622    }
9623
9624    // LB18 Break after spaces.
9625    if (current === SP) {
9626        return BREAK_ALLOWED;
9627    }
9628
9629    // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
9630    if (current === QU || next === QU) {
9631        return BREAK_NOT_ALLOWED;
9632    }
9633
9634    // LB20 Break before and after unresolved CB.
9635    if (next === CB || current === CB) {
9636        return BREAK_ALLOWED;
9637    }
9638
9639    // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
9640    if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
9641        return BREAK_NOT_ALLOWED;
9642    }
9643
9644    // LB21a Don't break after Hebrew + Hyphen.
9645    if (before === HL && HYPHEN.indexOf(current) !== -1) {
9646        return BREAK_NOT_ALLOWED;
9647    }
9648
9649    // LB21b Don’t break between Solidus and Hebrew letters.
9650    if (current === SY && next === HL) {
9651        return BREAK_NOT_ALLOWED;
9652    }
9653
9654    // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
9655    if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
9656        return BREAK_NOT_ALLOWED;
9657    }
9658
9659    // LB23 Do not break between digits and letters.
9660    if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
9661        return BREAK_NOT_ALLOWED;
9662    }
9663
9664    // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
9665    if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
9666        return BREAK_NOT_ALLOWED;
9667    }
9668
9669    // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
9670    if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
9671        return BREAK_NOT_ALLOWED;
9672    }
9673
9674    // LB25 Do not break between the following pairs of classes relevant to numbers:
9675    if (
9676    // (PR | PO) × ( OP | HY )? NU
9677    [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
9678    // ( OP | HY ) × NU
9679    [OP, HY].indexOf(current) !== -1 && next === NU ||
9680    // NU ×	(NU | SY | IS)
9681    current === NU && [NU, SY, IS].indexOf(next) !== -1) {
9682        return BREAK_NOT_ALLOWED;
9683    }
9684
9685    // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
9686    if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
9687        var prevIndex = currentIndex;
9688        while (prevIndex >= 0) {
9689            var type = classTypes[prevIndex];
9690            if (type === NU) {
9691                return BREAK_NOT_ALLOWED;
9692            } else if ([SY, IS].indexOf(type) !== -1) {
9693                prevIndex--;
9694            } else {
9695                break;
9696            }
9697        }
9698    }
9699
9700    // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
9701    if ([PR, PO].indexOf(next) !== -1) {
9702        var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
9703        while (_prevIndex >= 0) {
9704            var _type = classTypes[_prevIndex];
9705            if (_type === NU) {
9706                return BREAK_NOT_ALLOWED;
9707            } else if ([SY, IS].indexOf(_type) !== -1) {
9708                _prevIndex--;
9709            } else {
9710                break;
9711            }
9712        }
9713    }
9714
9715    // LB26 Do not break a Korean syllable.
9716    if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) {
9717        return BREAK_NOT_ALLOWED;
9718    }
9719
9720    // LB27 Treat a Korean Syllable Block the same as ID.
9721    if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
9722        return BREAK_NOT_ALLOWED;
9723    }
9724
9725    // LB28 Do not break between alphabetics (“at”).
9726    if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
9727        return BREAK_NOT_ALLOWED;
9728    }
9729
9730    // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
9731    if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
9732        return BREAK_NOT_ALLOWED;
9733    }
9734
9735    // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
9736    if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
9737        return BREAK_NOT_ALLOWED;
9738    }
9739
9740    // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
9741    // indicators preceding the position of the break.
9742    if (current === RI && next === RI) {
9743        var i = indicies[currentIndex];
9744        var count = 1;
9745        while (i > 0) {
9746            i--;
9747            if (classTypes[i] === RI) {
9748                count++;
9749            } else {
9750                break;
9751            }
9752        }
9753        if (count % 2 !== 0) {
9754            return BREAK_NOT_ALLOWED;
9755        }
9756    }
9757
9758    // LB30b Do not break between an emoji base and an emoji modifier.
9759    if (current === EB && next === EM) {
9760        return BREAK_NOT_ALLOWED;
9761    }
9762
9763    return BREAK_ALLOWED;
9764};
9765
9766var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
9767    // LB2 Never break at the start of text.
9768    if (index === 0) {
9769        return BREAK_NOT_ALLOWED;
9770    }
9771
9772    // LB3 Always break at the end of text.
9773    if (index >= codePoints.length) {
9774        return BREAK_MANDATORY;
9775    }
9776
9777    var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
9778        _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
9779        indicies = _codePointsToCharacte2[0],
9780        classTypes = _codePointsToCharacte2[1];
9781
9782    return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
9783};
9784
9785var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
9786    if (!options) {
9787        options = { lineBreak: 'normal', wordBreak: 'normal' };
9788    }
9789
9790    var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
9791        _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
9792        indicies = _codePointsToCharacte4[0],
9793        classTypes = _codePointsToCharacte4[1],
9794        isLetterNumber = _codePointsToCharacte4[2];
9795
9796    if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
9797        classTypes = classTypes.map(function (type) {
9798            return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
9799        });
9800    }
9801
9802    var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
9803        return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
9804    }) : null;
9805
9806    return [indicies, classTypes, forbiddenBreakpoints];
9807};
9808
9809var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
9810    var codePoints = (0, Util$2.toCodePoints)(str);
9811    var output = BREAK_NOT_ALLOWED;
9812
9813    var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
9814        _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
9815        indicies = _cssFormattedClasses2[0],
9816        classTypes = _cssFormattedClasses2[1],
9817        forbiddenBreakpoints = _cssFormattedClasses2[2];
9818
9819    codePoints.forEach(function (codePoint, i) {
9820        output += (0, Util$2.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
9821    });
9822
9823    return output;
9824};
9825
9826var Break = function () {
9827    function Break(codePoints, lineBreak, start, end) {
9828        _classCallCheck(this, Break);
9829
9830        this._codePoints = codePoints;
9831        this.required = lineBreak === BREAK_MANDATORY;
9832        this.start = start;
9833        this.end = end;
9834    }
9835
9836    _createClass(Break, [{
9837        key: 'slice',
9838        value: function slice() {
9839            return Util$2.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
9840        }
9841    }]);
9842
9843    return Break;
9844}();
9845
9846var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
9847    var codePoints = (0, Util$2.toCodePoints)(str);
9848
9849    var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
9850        _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
9851        indicies = _cssFormattedClasses4[0],
9852        classTypes = _cssFormattedClasses4[1],
9853        forbiddenBreakpoints = _cssFormattedClasses4[2];
9854
9855    var length = codePoints.length;
9856    var lastEnd = 0;
9857    var nextIndex = 0;
9858
9859    return {
9860        next: function next() {
9861            if (nextIndex >= length) {
9862                return { done: true };
9863            }
9864            var lineBreak = BREAK_NOT_ALLOWED;
9865            while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
9866
9867            if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
9868                var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
9869                lastEnd = nextIndex;
9870                return { value: value, done: false };
9871            }
9872
9873            return { done: true };
9874        }
9875    };
9876};
9877});
9878
9879unwrapExports(LineBreak);
9880var LineBreak_1 = LineBreak.LineBreaker;
9881var LineBreak_2 = LineBreak.inlineBreakOpportunities;
9882var LineBreak_3 = LineBreak.lineBreakAtIndex;
9883var LineBreak_4 = LineBreak.codePointsToCharacterClasses;
9884var LineBreak_5 = LineBreak.UnicodeTrie;
9885var LineBreak_6 = LineBreak.BREAK_ALLOWED;
9886var LineBreak_7 = LineBreak.BREAK_NOT_ALLOWED;
9887var LineBreak_8 = LineBreak.BREAK_MANDATORY;
9888var LineBreak_9 = LineBreak.classes;
9889var LineBreak_10 = LineBreak.LETTER_NUMBER_MODIFIER;
9890
9891var dist = createCommonjsModule(function (module, exports) {
9892Object.defineProperty(exports, "__esModule", {
9893  value: true
9894});
9895
9896
9897
9898Object.defineProperty(exports, 'toCodePoints', {
9899  enumerable: true,
9900  get: function get() {
9901    return Util$2.toCodePoints;
9902  }
9903});
9904Object.defineProperty(exports, 'fromCodePoint', {
9905  enumerable: true,
9906  get: function get() {
9907    return Util$2.fromCodePoint;
9908  }
9909});
9910
9911
9912
9913Object.defineProperty(exports, 'LineBreaker', {
9914  enumerable: true,
9915  get: function get() {
9916    return LineBreak.LineBreaker;
9917  }
9918});
9919});
9920
9921unwrapExports(dist);
9922
9923var Unicode = createCommonjsModule(function (module, exports) {
9924Object.defineProperty(exports, "__esModule", {
9925    value: true
9926});
9927exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
9928
9929
9930
9931Object.defineProperty(exports, 'toCodePoints', {
9932    enumerable: true,
9933    get: function get() {
9934        return dist.toCodePoints;
9935    }
9936});
9937Object.defineProperty(exports, 'fromCodePoint', {
9938    enumerable: true,
9939    get: function get() {
9940        return dist.fromCodePoint;
9941    }
9942});
9943
9944
9945
9946var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
9947
9948
9949
9950function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9951
9952var breakWords = exports.breakWords = function breakWords(str, parent) {
9953    var breaker = (0, dist.LineBreaker)(str, {
9954        lineBreak: parent.style.lineBreak,
9955        wordBreak: parent.style.overflowWrap === overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
9956    });
9957
9958    var words = [];
9959    var bk = void 0;
9960
9961    while (!(bk = breaker.next()).done) {
9962        words.push(bk.value.slice());
9963    }
9964
9965    return words;
9966};
9967});
9968
9969unwrapExports(Unicode);
9970var Unicode_1 = Unicode.breakWords;
9971var Unicode_2 = Unicode.fromCodePoint;
9972var Unicode_3 = Unicode.toCodePoints;
9973
9974var TextBounds_1 = createCommonjsModule(function (module, exports) {
9975Object.defineProperty(exports, "__esModule", {
9976    value: true
9977});
9978exports.parseTextBounds = exports.TextBounds = undefined;
9979
9980
9981
9982
9983
9984
9985
9986var _Feature2 = _interopRequireDefault(Feature);
9987
9988
9989
9990function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9991
9992function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9993
9994var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
9995    _classCallCheck(this, TextBounds);
9996
9997    this.text = text;
9998    this.bounds = bounds;
9999};
10000
10001var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
10002    var letterRendering = parent.style.letterSpacing !== 0;
10003    var textList = letterRendering ? (0, Unicode.toCodePoints)(value).map(function (i) {
10004        return (0, Unicode.fromCodePoint)(i);
10005    }) : (0, Unicode.breakWords)(value, parent);
10006    var length = textList.length;
10007    var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
10008    var scrollX = defaultView ? defaultView.pageXOffset : 0;
10009    var scrollY = defaultView ? defaultView.pageYOffset : 0;
10010    var textBounds = [];
10011    var offset = 0;
10012    for (var i = 0; i < length; i++) {
10013        var text = textList[i];
10014        if (parent.style.textDecoration !== textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
10015            if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
10016                textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
10017            } else {
10018                var replacementNode = node.splitText(text.length);
10019                textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
10020                node = replacementNode;
10021            }
10022        } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
10023            node = node.splitText(text.length);
10024        }
10025        offset += text.length;
10026    }
10027    return textBounds;
10028};
10029
10030var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
10031    var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
10032    wrapper.appendChild(node.cloneNode(true));
10033    var parentNode = node.parentNode;
10034    if (parentNode) {
10035        parentNode.replaceChild(wrapper, node);
10036        var bounds = (0, Bounds_1.parseBounds)(wrapper, scrollX, scrollY);
10037        if (wrapper.firstChild) {
10038            parentNode.replaceChild(wrapper.firstChild, wrapper);
10039        }
10040        return bounds;
10041    }
10042    return new Bounds_1.Bounds(0, 0, 0, 0);
10043};
10044
10045var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
10046    var range = node.ownerDocument.createRange();
10047    range.setStart(node, offset);
10048    range.setEnd(node, offset + length);
10049    return Bounds_1.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
10050};
10051});
10052
10053unwrapExports(TextBounds_1);
10054var TextBounds_2 = TextBounds_1.parseTextBounds;
10055var TextBounds_3 = TextBounds_1.TextBounds;
10056
10057var TextContainer_1 = createCommonjsModule(function (module, exports
10057) {
10058Object.defineProperty(exports, "__esModule", {
10059    value: true
10060});
10061
10062var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10063
10064
10065
10066
10067
10068function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10069
10070var TextContainer = function () {
10071    function TextContainer(text, parent, bounds) {
10072        _classCallCheck(this, TextContainer);
10073
10074        this.text = text;
10075        this.parent = parent;
10076        this.bounds = bounds;
10077    }
10078
10079    _createClass(TextContainer, null, [{
10080        key: 'fromTextNode',
10081        value: function fromTextNode(node, parent) {
10082            var text = transform(node.data, parent.style.textTransform);
10083            return new TextContainer(text, parent, (0, TextBounds_1.parseTextBounds)(text, parent, node));
10084        }
10085    }]);
10086
10087    return TextContainer;
10088}();
10089
10090exports.default = TextContainer;
10091
10092
10093var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
10094
10095var transform = function transform(text, _transform) {
10096    switch (_transform) {
10097        case textTransform.TEXT_TRANSFORM.LOWERCASE:
10098            return text.toLowerCase();
10099        case textTransform.TEXT_TRANSFORM.CAPITALIZE:
10100            return text.replace(CAPITALIZE, capitalize);
10101        case textTransform.TEXT_TRANSFORM.UPPERCASE:
10102            return text.toUpperCase();
10103        default:
10104            return text;
10105    }
10106};
10107
10108function capitalize(m, p1, p2) {
10109    if (m.length > 0) {
10110        return p1 + p2.toUpperCase();
10111    }
10112
10113    return m;
10114}
10115});
10116
10117unwrapExports(TextContainer_1);
10118
10119var Circle_1 = createCommonjsModule(function (module, exports) {
10120Object.defineProperty(exports, "__esModule", {
10121    value: true
10122});
10123
10124
10125
10126function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10127
10128var Circle = function Circle(x, y, radius) {
10129    _classCallCheck(this, Circle);
10130
10131    this.type = Path.PATH.CIRCLE;
10132    this.x = x;
10133    this.y = y;
10134    this.radius = radius;
10135    
10136};
10137
10138exports.default = Circle;
10139});
10140
10141unwrapExports(Circle_1);
10142
10143var Input = createCommonjsModule(function (module, exports) {
10144Object.defineProperty(exports, "__esModule", {
10145    value: true
10146});
10147exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exp
10147orts.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
10148
10149
10150
10151var _TextContainer2 = _interopRequireDefault(TextContainer_1);
10152
10153
10154
10155
10156
10157
10158
10159var _Circle2 = _interopRequireDefault(Circle_1);
10160
10161
10162
10163var _Vector2 = _interopRequireDefault(Vector_1);
10164
10165
10166
10167var _Color2 = _interopRequireDefault(Color_1);
10168
10169
10170
10171var _Length2 = _interopRequireDefault(Length_1);
10172
10173
10174
10175
10176
10177
10178
10179function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10180
10181var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
10182var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
10183var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
10184var INPUT_BORDER = {
10185    borderWidth: 1,
10186    borderColor: INPUT_BORDER_COLOR,
10187    borderStyle: border.BORDER_STYLE.SOLID
10188};
10189var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
10190var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
10191    backgroundColor: INPUT_BACKGROUND_COLOR,
10192    backgroundImage: [],
10193    backgroundClip: background.BACKGROUND_CLIP.PADDING_BOX,
10194    backgroundOrigin: background.BACKGROUND_ORIGIN.PADDING_BOX
10195};
10196
10197var RADIO_BORDER_RADIUS = new _Length2.default('50%');
10198var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
10199var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
10200
10201var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
10202var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
10203var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
10204
10205var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
10206    return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
10207};
10208
10209var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
10210    if (node.type === 'radio' || node.type === 'checkbox') {
10211        if (node.checked) {
10212            var size = Math.min(container.bounds.width, container.bounds.height);
10213            container.childNodes.push(node.type === 'checkbox' ? [new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79), new _Vector2.default(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549), new _Vector2.default(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071), new _Vector2.default(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649), new _Vector2.default(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23), new _Vector2.default(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085), new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)] : new _Circle2.default(container.bounds.left + size / 4, container.bounds.top + size / 4, size / 4));
10214        }
10215    } else {
10216        inlineFormElement(getInputValue(node), node, container, false);
10217    }
10218};
10219
10220var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
10221    inlineFormElement(node.value, node, container, true);
10222};
10223
10224var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
10225    var option = node.options[node.selectedIndex || 0];
10226    inlineFormElement(option ? option.text || '' : '', node, container, false);
10227};
10228
10229var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
10230    if (bounds.width > bounds.height) {
10231        bounds.left += (bounds.width - bounds.height) / 2;
10232        bounds.width = bounds.height;
10233    } else if (bounds.width < bounds.height) {
10234        bounds.top += (bounds.height - bounds.width) / 2;
10235        bounds.height = bounds.width;
10236    }
10237    return bounds;
10238};
10239
10240var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
10241    var body = node.ownerDocument.body;
10242    if (value.length > 0 && body) {
10243        var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
10244        (0, Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
10245        wrapper.style.position = 'absolute';
10246        wrapper.style.left = container.bounds.left + 'px';
10247        wrapper.style.top = container.bounds.top + 'px';
10248        if (!allowLinebreak) {
10249            wrapper.style.whiteSpace = 'nowrap';
10250        }
10251        var text = node.ownerDocument.createTextNode(value);
10252        wrapper.appendChild(text);
10253        body.appendChild(wrapper);
10254        container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
10255        body.removeChild(wrapper);
10256    }
10257};
10258
10259var getInputValue = function getInputValue(node) {
10260    var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
10261
10262    return value.length === 0 ? node.placeholder || '' : value;
10263};
10264});
10265
10266unwrapExports(Input);
10267var Input_1 = Input.reformatInputBounds;
10268var Input_2 = Input.inlineSelectElement;
10269var Input_3 = Input.inlineTextAreaElement;
10270var Input_4 = Input.inlineInputElement;
10271var Input_5 = Input.getInputBorderRadius;
10272var Input_6 = Input.INPUT_BACKGROUND;
10273var Input_7 = Input.INPUT_BORDERS;
10274var Input_8 = Input.INPUT_COLOR;
10275
10276var ListItem = createCommonjsModule(function (module, exports) {
10277Object.defineProperty(exports, "__esModule", {
10278    value: true
10279});
10280exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
10281
10282
10283
10284
10285
10286var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
10287
10288
10289
10290var _TextContainer2 = _interopRequireDefault(TextContainer_1);
10291
10292
10293
10294
10295
10296function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10297
10298// Margin between the enumeration and the list item content
10299var MARGIN_RIGHT = 7;
10300
10301var ancestorTypes = ['OL', 'UL', 'MENU'];
10302
10303var getListOwner = exports.getListOwner = function getListOwner(container) {
10304    var parent = container.parent;
10305    if (!parent) {
10306        return null;
10307    }
10308
10309    do {
10310        var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
10311        if (isAncestor) {
10312            return parent;
10313        }
10314        parent = parent.parent;
10315    } while (parent);
10316
10317    return container.parent;
10318};
10319
10320var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
10321    var listStyle$$1 = container.style.listStyle;
10322
10323    if (!listStyle$$1) {
10324        return;
10325    }
10326
10327    var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
10328    var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
10329    (0, Util.copyCSSStyles)(style, wrapper);
10330
10331    wrapper.style.position = 'absolute';
10332    wrapper.style.bottom = 'auto';
10333    wrapper.style.display = 'block';
10334    wrapper.style.letterSpacing = 'normal';
10335
10336    switch (listStyle$$1.listStylePosition) {
10337        case listStyle.LIST_STYLE_POSITION.OUTSIDE:
10338            wrapper.style.left = 'auto';
10339            wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
10340            wrapper.style.textAlign = 'right';
10341            break;
10342        case listStyle.LIST_STYLE_POSITION.INSIDE:
10343            wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
10344            wrapper.style.right = 'auto';
10345            wrapper.style.textAlign = 'left';
10346            break;
10347    }
10348
10349    var text = void 0;
10350    var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
10351    var styleImage = listStyle$$1.listStyleImage;
10352    if (styleImage) {
10353        if (styleImage.method === 'url') {
10354            var image = node.ownerDocument.createElement('img');
10355            image.src = styleImage.args[0];
10356            wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
10357            wrapper.style.width = 'auto';
10358            wrapper.style.height = 'auto';
10359            wrapper.appendChild(image);
10360        } else {
10361            var size = parseFloat(container.style.font.fontSize) * 0.5;
10362            wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
10363            wrapper.style.width = size + 'px';
10364            wrapper.style.height = size + 'px';
10365            wrapper.style.backgroundImage = style.listStyleImage;
10366        }
10367    } else if (typeof container.listIndex === 'number') {
10368        text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle$$1.listStyleType, true));
10369        wrapper.appendChild(text);
10370        wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
10371    }
10372
10373    // $FlowFixMe
10374    var body = node.ownerDocument.body;
10375    body.appendChild(wrapper);
10376
10377    if (text) {
10378        container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
10379        body.removeChild(wrapper);
10380    } else {
10381        // $FlowFixMe
10382        container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
10383    }
10384};
10385
10386var ROMAN_UPPER = {
10387    integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
10388    values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
10389};
10390
10391var ARMENIAN = {
10392    integers: [9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
10393    values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
10394};
10395
10396var HEBREW = {
10397    integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
10398    values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
10399};
10400
10401var GEORGIAN = {
10402    integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
10403    values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
10404};
10405
10406var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
10407    if (value < min || value > max) {
10408        return createCounterText(value, fallback, suffix.length > 0);
10409    }
10410
10411    return symbols.integers.reduce(function (string, integer, index) {
10412        while (value >= integer) {
10413            value -= integer;
10414            string += symbols.values[index];
10415        }
10416        return string;
10417    }, '') + suffix;
10418};
10419
10420var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
10421    var string = '';
10422
10423    do {
10424        if (!isNumeric) {
10425            value--;
10426        }
10427        string = resolver(value) + string;
10428        value /= codePointRangeLength;
10429    } while (value * codePointRangeLength >= codePointRangeLength);
10430
10431    return string;
10432};
10433
10434var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
10435    var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
10436
10437    return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
10438        return (0, Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
10439    }) + suffix);
10440};
10441
10442var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
10443    var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
10444
10445    var codePointRangeLength = symbols.length;
10446    return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
10447        return symbols[Math.floor(codePoint % codePointRangeLength)];
10448    }) + suffix;
10449};
10450
10451var CJK_ZEROS = 1 << 0;
10452var CJK_TEN_COEFFICIENTS = 1 << 1;
10453var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
10454var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
10455
10456var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
10457    if (value < -9999 || value > 9999) {
10458        return createCounterText(value, listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
10459    }
10460    var tmp = Math.abs(value);
10461    var string = suffix;
10462
10463    if (tmp === 0) {
10464        return numbers[0] + string;
10465    }
10466
10467    for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
10468        var coefficient = tmp % 10;
10469
10470        if (coefficient === 0 && (0, Util.contains)(flags, CJK_ZEROS) && string !== '') {
10471            string = numbers[coefficient] + string;
10472        } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && (0, Util.contains)(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && (0, Util.contains)(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && (0, Util.contains)(flags, CJK_HUNDRED_COEFFICIENTS)) {
10473            string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
10474        } else if (coefficient === 1 && digit > 0) {
10475            string = multipliers[digit - 1] + string;
10476        }
10477        tmp = Math.floor(tmp / 10);
10478    }
10479
10480    return (value < 0 ? negativeSign : '') + string;
10481};
10482
10483var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
10484var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
10485var JAPANESE_NEGATIVE = 'マイナス';
10486var KOREAN_NEGATIVE = '마이너스 ';
10487
10488var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
10489    var defaultSuffix = appendSuffix ? '. ' : '';
10490    var cjkSuffix = appendSuffix ? '、' : '';
10491    var koreanSuffix = appendSuffix ? ', ' : '';
10492    switch (type) {
10493        case listStyle.LIST_STYLE_TYPE.DISC:
10494            return '•';
10495        case listStyle.LIST_STYLE_TYPE.CIRCLE:
10496            return '◦';
10497        case listStyle.LIST_STYLE_TYPE.SQUARE:
10498            return '◾';
10499        case listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
10500            var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
10501            return string.length < 4 ? '0' + string : string;
10502        case listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
10503            return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
10504        case listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
10505            return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
10506        case listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
10507            return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
10508        case listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
10509            return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
10510        case listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
10511            return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
10512        case listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
10513            return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
10514        case listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
10515            return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
10516        case listStyle.LIST_STYLE_TYPE.ARMENIAN:
10517        case listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
10518            return createAdditiveCounter(value, 1, 9999, ARMENIAN, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
10519        case listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
10520            return createAdditiveCounter(value, 1, 9999, ARMENIAN, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
10521        case listStyle.LIST_STYLE_TYPE.BENGALI:
10522            return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
10523        case listStyle.LIST_STYLE_TYPE.CAMBODIAN:
10524        case listStyle.LIST_STYLE_TYPE.KHMER:
10525            return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
10526        case listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
10527            return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
10528        case listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
10529            return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
10530        case listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
10531        case listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
10532            return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
10533        case listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
10534            return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
10535        case listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
10536            return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
10537        case listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
10538            return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
10539        case listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL:
10540            return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
10541        case listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
10542            return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
10543        case listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
10544            return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
10545        case listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
10546            return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
10547        case listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
10548            return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
10549        case listStyle.LIST_STYLE_TYPE.DEVANAGARI:
10550            return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
10551        case listStyle.LIST_STYLE_TYPE.GEORGIAN:
10552            return createAdditiveCounter(value, 1, 19999, GEORGIAN, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
10553        case listStyle.LIST_STYLE_TYPE.GUJARATI:
10554            return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
10555        case listStyle.LIST_STYLE_TYPE.GURMUKHI:
10556            return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
10557        case listStyle.LIST_STYLE_TYPE.HEBREW:
10558            return createAdditiveCounter(value, 1, 10999, HEBREW, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
10559        case listStyle.LIST_STYLE_TYPE.HIRAGANA:
10560            return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
10561        case listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
10562            return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
10563        case listStyle.LIST_STYLE_TYPE.KANNADA:
10564            return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
10565        case listStyle.LIST_STYLE_TYPE.KATAKANA:
10566            return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
10567        case listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
10568            return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
10569        case listStyle.LIST_STYLE_TYPE.LAO:
10570            return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
10571        case listStyle.LIST_STYLE_TYPE.MONGOLIAN:
10572            return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
10573        case listStyle.LIST_STYLE_TYPE.MYANMAR:
10574            return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
10575        case listStyle.LIST_STYLE_TYPE.ORIYA:
10576            return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
10577        case listStyle.LIST_STYLE_TYPE.PERSIAN:
10578            return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
10579        case listStyle.LIST_STYLE_TYPE.TAMIL:
10580            return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
10581        case listStyle.LIST_STYLE_TYPE.TELUGU:
10582            return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
10583        case listStyle.LIST_STYLE_TYPE.THAI:
10584            return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
10585        case listStyle.LIST_STYLE_TYPE.TIBETAN:
10586            return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
10587        case listStyle.LIST_STYLE_TYPE.DECIMAL:
10588        default:
10589            return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
10590    }
10591};
10592});
10593
10594unwrapExports(ListItem);
10595var ListItem_1 = ListItem.createCounterText;
10596var ListItem_2 = ListItem.inlineListItemElement;
10597var ListItem_3 = ListItem.getListOwner;
10598
10599var NodeContainer_1 = createCommonjsModule(function (module, exports) {
10600Object.defineProperty(exports, "__esModule", {
10601    value: true
10602});
10603
10604var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10605
10606
10607
10608var _Color2 = _interopRequireDefault(Color_1);
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10661
10662function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10663
10664var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
10665
10666var NodeContainer = function () {
10667    function NodeContainer(node, parent, resourceLoader, index) {
10668        var _this = this;
10669
10670        _classCallCheck(this, NodeContainer);
10671
10672        this.parent = parent;
10673        this.tagName = node.tagName;
10674        this.index = index;
10675        this.childNodes = [];
10676        this.listItems = [];
10677        if (typeof node.start === 'number') {
10678            this.listStart = node.start;
10679        }
10680        var defaultView = node.ownerDocument.defaultView;
10681        var scrollX = defaultView.pageXOffset;
10682        var scrollY = defaultView.pageYOffset;
10683        var style = defaultView.getComputedStyle(node, null);
10684        var display$$1 = (0, display.parseDisplay)(style.display);
10685
10686        var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
10687
10688        var position$$1 = (0, position.parsePosition)(style.position);
10689
10690        this.style = {
10691            background: IS_INPUT ? Input.INPUT_BACKGROUND : (0, background.parseBackgroun
10691d)(style, resourceLoader),
10692            border: IS_INPUT ? Input.INPUT_BORDERS : (0, border.parseBorder)(style),
10693            borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, Input.getInputBorderRadius)(node) : (0, borderRadius.parseBorderRadius)(style),
10694            color: IS_INPUT ? Input.INPUT_COLOR : new _Color2.default(style.color),
10695            display: display$$1,
10696            float: (0, float_1.parseCSSFloat)(style.float),
10697            font: (0, font.parseFont)(style),
10698            letterSpacing: (0, letterSpacing.parseLetterSpacing)(style.letterSpacing),
10699            listStyle: display$$1 === display.DISPLAY.LIST_ITEM ? (0, listStyle.parseListStyle)(style) : null,
10700            lineBreak: (0, lineBreak.parseLineBreak)(style.lineBreak),
10701            margin: (0, margin.parseMargin)(style),
10702            opacity: parseFloat(style.opacity),
10703            overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, overflow.parseOverflow)(style.overflow) : overflow.OVERFLOW.HIDDEN,
10704            overflowWrap: (0, overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
10705            padding: (0, padding.parsePadding)(style),
10706            position: position$$1,
10707            textDecoration: (0, textDecoration.parseTextDecoration)(style),
10708            textShadow: (0, textShadow.parseTextShadow)(style.textShadow),
10709            textTransform: (0, textTransform.parseTextTransform)(style.textTransform),
10710            transform: (0, transform.parseTransform)(style),
10711            visibility: (0, visibility.parseVisibility)(style.visibility),
10712            wordBreak: (0, wordBreak.parseWordBreak)(style.wordBreak),
10713            zIndex: (0, zIndex.parseZIndex)(position$$1 !== position.POSITION.STATIC ? style.zIndex : 'auto')
10714        };
10715
10716        if (this.isTransformed()) {
10717            // getBoundingClientRect provides values post-transform, we want them without the transformation
10718            node.style.transform = 'matrix(1,0,0,1,0,0)';
10719        }
10720
10721        if (display$$1 === display.DISPLAY.LIST_ITEM) {
10722            var listOwner = (0, ListItem.getListOwner)(this);
10723            if (listOwner) {
10724                var listIndex = listOwner.listItems.length;
10725                listOwner.listItems.push(this);
10726                this.listIndex = node.hasAttribute('value') && typeof node.value === 'number' ? node.value : listIndex === 0 ? typeof listOwner.listStart === 'number' ? listOwner.listStart : 1 : listOwner.listItems[listIndex - 1].listIndex + 1;
10727            }
10728        }
10729
10730        // TODO move bound retrieval for all nodes to a later stage?
10731        if (node.tagName === 'IMG') {
10732            node.addEventListener('load', function () {
10733                _this.bounds = (0, Bounds_1.parseBounds)(node, scrollX, scrollY);
10734                _this.curvedBounds = (0, Bounds_1.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
10735            });
10736        }
10737        this.image = getImage(node, resourceLoader);
10738        this.bounds = IS_INPUT ? (0, Input.reformatInputBounds)((0, Bounds_1.parseBounds)(node, scrollX, scrollY)) : (0, Bounds_1.parseBounds)(node, scrollX, scrollY);
10739        this.curvedBounds = (0, Bounds_1.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
10740
10741        
10742    }
10743
10744    _createClass(NodeContainer, [{
10745        key: 'getClipPaths',
10746        value: function getClipPaths() {
10747            var parentClips = this.parent ? this.parent.getClipPaths() : [];
10748            var isClipped = this.style.overflow !== overflow.OVERFLOW.VISIBLE;
10749
10750            return isClipped ? parentClips.concat([(0, Bounds_1.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
10751        }
10752    }, {
10753        key: 'isInFlow',
10754        value: function isInFlow() {
10755            return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
10756        }
10757    }, {
10758        key: 'isVisible',
10759        value: function isVisible() {
10760            return !(0, Util.contains)(this.style.display, display.DISPLAY.NONE) && this.style.opacity >
10760 0 && this.style.visibility === visibility.VISIBILITY.VISIBLE;
10761        }
10762    }, {
10763        key: 'isAbsolutelyPositioned',
10764        value: function isAbsolutelyPositioned() {
10765            return this.style.position !== position.POSITION.STATIC && this.style.position !== position.POSITION.RELATIVE;
10766        }
10767    }, {
10768        key: 'isPositioned',
10769        value: function isPositioned() {
10770            return this.style.position !== position.POSITION.STATIC;
10771        }
10772    }, {
10773        key: 'isFloating',
10774        value: function isFloating() {
10775            return this.style.float !== float_1.FLOAT.NONE;
10776        }
10777    }, {
10778        key: 'isRootElement',
10779        value: function isRootElement() {
10780            return this.parent === null;
10781        }
10782    }, {
10783        key: 'isTransformed',
10784        value: function isTransformed() {
10785            return this.style.transform !== null;
10786        }
10787    }, {
10788        key: 'isPositionedWithZIndex',
10789        value: function isPositionedWithZIndex() {
10790            return this.isPositioned() && !this.style.zIndex.auto;
10791        }
10792    }, {
10793        key: 'isInlineLevel',
10794        value: function isInlineLevel() {
10795            return (0, Util.contains)(this.style.display, display.DISPLAY.INLINE) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_BLOCK) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_FLEX) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_GRID) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_LIST_ITEM) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_TABLE);
10796        }
10797    }, {
10798        key: 'isInlineBlockOrInlineTable',
10799        value: function isInlineBlockOrInlineTable() {
10800            return (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_BLOCK) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_TABLE);
10801        }
10802    }]);
10803
10804    return NodeContainer;
10805}();
10806
10807exports.default = NodeContainer;
10808
10809
10810var getImage = function getImage(node, resourceLoader) {
10811    if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
10812        var s = new XMLSerializer();
10813        return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
10814    }
10815    switch (node.tagName) {
10816        case 'IMG':
10817            // $FlowFixMe
10818            var img = node;
10819            return resourceLoader.loadImage(img.currentSrc || img.src);
10820        case 'CANVAS':
10821            // $FlowFixMe
10822            var canvas = node;
10823            return resourceLoader.loadCanvas(canvas);
10824        case 'IFRAME':
10825            var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
10826            if (iframeKey) {
10827                return iframeKey;
10828            }
10829            break;
10830    }
10831
10832    return null;
10833};
10834});
10835
10836unwrapExports(NodeContainer_1);
10837
10838var StackingContext_1 = createCommonjsModule(function (module, exports) {
10839Object.defineProperty(exports, "__esModule", {
10840    value: true
10841});
10842
10843var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10844
10845
10846
10847var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
10848
10849
10850
10851function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10852
10853function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10854
10855var StackingContext = function () {
10856    function StackingContext(container, parent, treatAsRealStackingContext) {
10857        _classCallCheck(this, StackingContext);
10858
10859        this.container = container;
10860        this.parent = parent;
10861        this.contexts = [];
10862        this.children = [];
10863        this.treatAsRealStackingContext = treatAsRealStackingContext;
10864    }
10865
10866    _createClass(StackingContext, [{
10867        key: 'getOpacity',
10868        value: function getOpacity() {
10869            return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
10870        }
10871    }, {
10872        key: 'getRealParentStackingContext',
10873        value: function getRealParentStackingContext() {
10874            return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
10875        }
10876    }]);
10877
10878    return StackingContext;
10879}();
10880
10881exports.default = StackingContext;
10882});
10883
10884unwrapExports(StackingContext_1);
10885
10886var NodeParser_1 = createCommonjsModule(function (module, exports) {
10887Object.defineProperty(exports, "__esModule", {
10888    value: true
10889});
10890exports.NodeParser = undefined;
10891
10892
10893
10894var _StackingContext2 = _interopRequireDefault(StackingContext_1);
10895
10896
10897
10898var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
10899
10900
10901
10902var _TextContainer2 = _interopRequireDefault(TextContainer_1);
10903
10904
10905
10906
10907
10908
10909
10910function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10911
10912var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
10913    var index = 0;
10914
10915    var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
10916    var stack = new _StackingContext2.default(container, null, true);
10917
10918    parseNodeTree(node, container, stack, resourceLoader, index);
10919
10920    return stack;
10921};
10922
10923var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
10924
10925var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
10926    for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
10927        nextNode = childNode.nextSibling;
10928        var defaultView = childNode.ownerDocument.defaultView;
10929        if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
10930            if (childNode.data.trim().length > 0) {
10931                parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
10932            }
10933        } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
10934            if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
10935                var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
10936                if (container.isVisible()) {
10937                    if (childNode.tagName === 'INPUT') {
10938                        // $FlowFixMe
10939                        (0, Input.inlineInputElement)(childNode, container);
10940                    } else if (childNode.tagName === 'TEXTAREA') {
10941                        // $FlowFixMe
10942                        (0, Input.inlineTextAreaElement)(childNode, container);
10943                    } else if (childNode.tagName === 'SELECT') {
10944                        // $FlowFixMe
10945                        (0, Input.inlineSelectElement)(childNode, container);
10946                    } else if (container.style.listStyle && container.style.listStyle.listStyleType !== listStyle.LIST_STYLE_TYPE.NONE) {
10947                        (0, ListItem.inlineListItemElement)(childNode, container, resourceLoader);
10948                    }
10949
10950                    var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
10951                    var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
10952                    if (treatAsRealStackingContext || createsStackingContext(container)) {
10953                        // for treatAsRealStackingContext:false, any positioned descendants and descendants
10954                        // which actually create a new stacking context should be considered part of the parent stacking context
10955                        var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
10956                        var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
10957                        parentStack.contexts.push(childStack);
10958                        if (SHOULD_TRAVERSE_CHILDREN) {
10959                            parseNodeTree(childNode, container, childStack, resourceLoader, index);
10960                        }
10961                    } else {
10962                        stack.children.push(container);
10963                        if (SHOULD_TRAVERSE_CHILDREN) {
10964                            parseNodeTree(childNode, container, stack, resourceLoader, index);
10965                        }
10966                    }
10967                }
10968            }
10969        } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
10970            var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
10971            var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
10972            if (_treatAsRealStackingContext || createsStackingContext(_container)) {
10973                // for treatAsRealStackingContext:false, any positioned descendants and desce
10973ndants
10974                // which actually create a new stacking context should be considered part of the parent stacking context
10975                var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
10976                var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
10977                _parentStack.contexts.push(_childStack);
10978            } else {
10979                stack.children.push(_container);
10980            }
10981        }
10982    }
10983};
10984
10985var createsRealStackingContext = function createsRealStackingContext(container, node) {
10986    return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
10987};
10988
10989var createsStackingContext = function createsStackingContext(container) {
10990    return container.isPositioned() || container.isFloating();
10991};
10992
10993var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
10994    return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
10995};
10996});
10997
10998unwrapExports(NodeParser_1);
10999var NodeParser_2 = NodeParser_1.NodeParser;
11000
11001var Font = createCommonjsModule(function (module, exports) {
11002Object.defineProperty(exports, "__esModule", {
11003    value: true
11004});
11005exports.FontMetrics = undefined;
11006
11007var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
11008
11009
11010
11011function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11012
11013var SAMPLE_TEXT = 'Hidden Text';
11014
11015var FontMetrics = exports.FontMetrics = function () {
11016    function FontMetrics(document) {
11017        _classCallCheck(this, FontMetrics);
11018
11019        this._data = {};
11020        this._document = document;
11021    }
11022
11023    _createClass(FontMetrics, [{
11024        key: '_parseMetrics',
11025        value: function _parseMetrics(font) {
11026            var container = this._document.createElement('div');
11027            var img = this._document.createElement('img');
11028            var span = this._document.createElement('span');
11029
11030            var body = this._document.body;
11031            if (!body) {
11032                throw new Error('');
11033            }
11034
11035            container.style.visibility = 'hidden';
11036            container.style.fontFamily = font.fontFamily;
11037            container.style.fontSize = font.fontSize;
11038            container.style.margin = '0';
11039            container.style.padding = '0';
11040
11041            body.appendChild(container);
11042
11043            img.src = Util.SMALL_IMAGE;
11044            img.width = 1;
11045            img.height = 1;
11046
11047            img.style.margin = '0';
11048            img.style.padding = '0';
11049            img.style.verticalAlign = 'baseline';
11050
11051            span.style.fontFamily = font.fontFamily;
11052            span.style.fontSize = font.fontSize;
11053            span.style.margin = '0';
11054            span.style.padding = '0';
11055
11056            span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
11057            container.appendChild(span);
11058            container.appendChild(img);
11059            var baseline = img.offsetTop - span.offsetTop + 2;
11060
11061            container.removeChild(span);
11062            container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
11063
11064            container.style.lineHeight = 'normal';
11065            img.style.verticalAlign = 'super';
11066
11067            var middle = img.offsetTop - container.offsetTop + 2;
11068
11069            body.removeChild(container);
11070
11071            return { baseline: baseline, middle: middle };
11072        }
11073    }, {
11074        key: 'getMetrics',
11075        value: function getMetrics(font) {
11076            var key = font.fontFamily + ' ' + font.fontSize;
11077            if (this._data[key] === undefined) {
11078                this._data[key] = this._parseMetrics(font);
11079            }
11080
11081            return this._data[key];
11082        }
11083    }]);
11084
11085    return FontMetrics;
11086}();
11087});
11088
11089unwrapExports(Font);
11090var Font_1 = Font.FontMetrics;
11091
11092var Angle = createCommonjsModule(function (module, exports) {
11093Object.defineProperty(exports, "__esModule", {
11094    value: true
11095});
11096var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;
11097
11098var parseAngle = exports.parseAngle = function parseAngle(angle) {
11099    var match = angle.match(ANGLE);
11100
11101    if (match) {
11102        var value = parseFloat(match[1]);
11103        switch (match[2].toLowerCase()) {
11104            case 'deg':
11105                return Math.PI * value / 180;
11106            case 'grad':
11107                return Math.PI / 200 * value;
11108            case 'rad':
11109                return value;
11110            case 'turn':
11111                return Math.PI * 2 * value;
11112        }
11113    }
11114
11115    return null;
11116};
11117});
11118
11119unwrapExports(Angle);
11120var Angle_1 = Angle.parseAngle;
11121
11122var Gradient = createCommonjsModule(function (module, exports) {
11123Object.defineProperty(exports, "__esModule", {
11124    value: true
11125});
11126exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined;
11127
11128var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
11129
11130
11131
11132var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
11133
11134
11135
11136
11137
11138var _Color2 = _interopRequireDefault(Color_1);
11139
11140
11141
11142var _Length2 = _interopRequireDefault(Length_1);
11143
11144
11145
11146function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11147
11148function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11149
11150var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i;
11151var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i;
11152var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i;
11153var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i;
11154var RADIAL_SHAPE_DEFINITION = /^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i;
11155
11156var GRADIENT_TYPE = exports.GRADIENT_TYPE = {
11157    LINEAR_GRADIENT: 0,
11158    RADIAL_GRADIENT: 1
11159};
11160
11161var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = {
11162    CIRCLE: 0,
11163    ELLIPSE: 1
11164};
11165
11166var LENGTH_FOR_POSITION = {
11167    left: new _Length2.default('0%'),
11168    top: new _Length2.default('0%'),
11169    center: new _Length2.default('50%'),
11170    right: new _Length2.default('100%'),
11171    bottom: new _Length2.default('100%')
11172};
11173
11174var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) {
11175    _classCallCheck(this, LinearGradient);
11176
11177    this.type = GRADIENT_TYPE.LINEAR_GRADIENT;
11178    this.colorStops = colorStops;
11179    this.direction = direction;
11180};
11181
11182var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) {
11183    _classCallCheck(this, RadialGradient);
11184
11185    this.type = GRADIENT_TYPE.RADIAL_GRADIENT;
11186    this.colorStops = colorStops;
11187    this.shape = shape;
11188    this.center = center;
11189    this.radius = radius;
11190};
11191
11192var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) {
11193    var args = _ref.args,
11194        method = _ref.method,
11195        prefix = _ref.prefix;
11196
11197    if (method === 'linear-gradient') {
11198        return parseLinearGradient(args, bounds, !!prefix);
11199    } else if (method === 'gradient' && args[0] === 'linear') {
11200        // TODO handle correct angle
11201        return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix);
11202    } else if (method === 'radial-gradient') {
11203        return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds);
11204    } else if (method === 'gradient' && args[0] === 'radial') {
11205        return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds);
11206    }
11207};
11208
11209var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) {
11210    var colorStops = [];
11211
11212    for (var i = firstColorStopIndex; i < args.length; i++) {
11213        var value = args[i];
11214        var HAS_LENGTH = ENDS_WITH_LENGTH.test(value);
11215        var lastSpaceIndex = value.lastIndexOf(' ');
11216        var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value);
11217        var _stop = HAS_LENGTH ? new _Length2.default(value.substring(lastSpaceIndex + 1)) : i === firstColorStopIndex ? new _Length2.default('0%') : i === args.length - 1 ? new _Length2.default('100%') : null;
11218        colorStops.push({ color: _color, stop: _stop });
11219    }
11220
11221    var absoluteValuedColorStops = colorStops.map(function (_ref2) {
11222        var color = _ref2.color,
11223            stop = _ref2.stop;
11224
11225        var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null;
11226
11227        return {
11228            color: color,
11229            // $FlowFixMe
11230            stop: absoluteStop
11231        };
11232    });
11233
11234    var previousColorStop = absoluteValuedColorStops[0].stop;
11235    for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) {
11236        if (previousColorStop !== null) {
11237            var _stop2 = absoluteValuedColorStops[_i].stop;
11238            if (_stop2 === null) {
11239                var n = _i;
11240                while (absoluteValuedColorStops[n].stop === null) {
11241                    n++;
11242                }
11243                var steps = n - _i + 1;
11244                var nextColorStep = absoluteValuedColorStops[n].stop;
11245                var stepSize = (nextColorStep - previousColorStop) / steps;
11246                for (; _i < n; _i++) {
11247                    previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize;
11248                }
11249            } else {
11250                previousColorStop = _stop2;
11251            }
11252        }
11253    }
11254
11255    return absoluteValuedColorStops;
11256};
11257
11258var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) {
11259    var angle = (0, Angle.parseAngle)(args[0]);
11260    var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]);
11261    var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]);
11262    var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection(
11263    // if there is a prefix, the 0° angle points due East (instead of North per W3C)
11264    hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds);
11265    var firstColorStopIndex = HAS_DIRECTION ? 1 : 0;
11266
11267    // TODO: Fix some inaccuracy with color stops with px values
11268    var lineLength = Math.min((0, Util.distance)(Math.abs(direction.x0) + Math.abs(direction.x1), Math.abs(direction.y0) + Math.abs(direction.y1)), bounds.width * 2, bounds.height * 2);
11269
11270    return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction);
11271};
11272
11273var parseRadialGradient = function parseRadialGradient(container, args, bounds) {
11274    var m = args[0].match(RADIAL_SHAPE_DEFINITION);
11275    var shape = m && (m[1] === 'circle' || // explicit shape specification
11276    m[3] !== undefined && m[5] === undefined) // only one radius coordinate
11277    ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE;
11278    var radius = {};
11279    var center = {};
11280
11281    if (m) {
11282        // Radius
11283        if (m[3] !== undefined) {
11284            radius.x = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width);
11285        }
11286
11287        if (m[5] !== undefined) {
11288            radius.y = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height);
11289        }
11290
11291        // Position
11292        if (m[7]) {
11293            center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()];
11294        } else if (m[8] !== undefined) {
11295            center.x = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[8], m[9]);
11296        }
11297
11298        if (m[10]) {
11299            center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()];
11300        } else if (m[11] !== undefined) {
11301            center.y = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[11], m[12]);
11302        }
11303    }
11304
11305    var gradientCenter = {
11306        x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width),
11307        y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height)
11308    };
11309    var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds);
11310
11311    return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius);
11312};
11313
11314var calculateGradientDirection = function calculateGradientDirection(radian, bounds) {
11315    var width = bounds.width;
11316    var height = bounds.height;
11317    var HALF_WIDTH = width * 0.5;
11318    var HALF_HEIGHT = height * 0.5;
11319    var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
11320    var HALF_LINE_LENGTH = lineLength / 2;
11321
11322    var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH;
11323    var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH;
11324    var x1 = width - x0;
11325    var y1 = height - y0;
11326
11327    return { x0: x0, x1: x1, y0: y0, y1: y1 };
11328};
11329
11330var parseTopRight = function parseTopRight(bounds) {
11331    return Math.acos(bounds.width / 2 / ((0, Util.distance)(bounds.width, bounds.height) / 2));
11332};
11333
11334var parseSideOrCorner = function parseSideOrCorner(side, bounds) {
11335    switch (side) {
11336        case 'bottom':
11337        case 'to top':
11338            return calculateGradientDirection(0, bounds);
11339        case 'left':
11340        case 'to right':
11341            return calculateGradientDirection(Math.PI / 2, bounds);
11342        case 'right':
11343        case 'to left':
11344            return calculateGradientDirection(3 * Math.PI / 2, bounds);
11345        case 'top right':
11346        case 'right top':
11347        case 'to bottom left':
11348        case 'to left bottom':
11349            return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds);
11350        case 'top left':
11351        case 'left top':
11352        case 'to bottom right':
11353        case 'to right bottom':
11354            return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds);
11355        case 'bottom left':
11356        case 'left bottom':
11357        case 'to top right':
11358        case 'to right top':
11359            return calculateGradientDirection(parseTopRight(bounds), bounds);
11360        case 'bottom right':
11361        case 'right bottom':
11362        case 'to top left':
11363        case 'to left top':
11364            return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds);
11365        case 'top':
11366        case 'to bottom':
11367        default:
11368            return calculateGradientDirection(Math.PI, bounds);
11369    }
11370};
11371
11372var parsePercentageAngle = function parsePercentageAngle(angle, bounds) {
11373    var _angle$split$map = angle.split(' ').map(parseFloat),
11374        _angle$split$map2 = _slicedToArray(_angle$split$map, 2),
11375        left = _angle$split$map2[0],
11376        top = _angle$split$map2[1];
11377
11378    var ratio = left / 100 * bounds.width / (top / 100 * bounds.height);
11379
11380    return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds);
11381};
11382
11383var findCorner = function findCorner(bounds, x, y, closest) {
11384    var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }];
11385
11386    // $FlowFixMe
11387    return corners.reduce(function (stat, corner) {
11388        var d = (0, Util.distance)(x - corner.x, y - corner.y);
11389        if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
11390            return {
11391                optimumCorner: corner,
11392                optimumDistance: d
11393            };
11394        }
11395
11396        return stat;
11397    }, {
11398        optimumDistance: closest ? Infinity : -Infinity,
11399        optimumCorner: null
11400    }).optimumCorner;
11401};
11402
11403var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) {
11404    var x = center.x;
11405    var y = center.y;
11406    var rx = 0;
11407    var ry = 0;
11408
11409    switch (extent) {
11410        case 'closest-side':
11411            // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
11412            // If the shape is an ellipse, it exactly meets the closest side in each dimension.
11413            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11414                rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
11415            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11416                rx = Math.min(Math.abs(x), Math.abs(x - bounds.width));
11417                ry = Math.min(Math.abs(y), Math.abs(y - bounds.height));
11418            }
11419            break;
11420
11421        case 'closest-corner':
11422            // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
11423            // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
11424            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11425                rx = ry = Math.min((0, Util.distance)(x, y), (0, Util.distance)(x, y - bounds.height), (0, Util.distance)(x - bounds.width, y), (0, Util.distance)(x - bounds.width, y - bounds.height));
11426            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11427                // Compute the ratio ry/rx (which is to be the same as for "closest-side")
11428                var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width));
11429                var corner = findCorner(bounds, x, y, true);
11430                rx = (0, Util.distance)(corner.x - x, (corner.y - y) / c);
11431                ry = c * rx;
11432            }
11433            break;
11434
11435        case 'farthest-side':
11436            // Same as closest-side, except the ending shape is sized based on the farthest side(s)
11437            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11438                rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
11439            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11440                rx = Math.max(Math.abs(x), Math.abs(x - bounds.width));
11441                ry = Math.max(Math.abs(y), Math.abs(y - bounds.height));
11442            }
11443            break;
11444
11445        case 'farthest-corner':
11446            // Same as closest-corner, except the ending shape is sized based on the farthest corner.
11447            // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
11448            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
11449                rx = ry = Math.max((0, Util.distance)(x, y), (0, Util.distance)(x, y - bounds.height), (0, Util.distance)(x - bounds.width, y), (0, Util.distance)(x - bounds.width, y - bounds.height));
11450            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
11451                // Compute the ratio ry/rx (which is to be the same as for "farthest-side")
11452                var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width));
11453                var _corner = findCorner(bounds, x, y, false);
11454                rx = (0, Util.distance)(_corner.x - x, (_corner.y - y) / _c);
11455                ry = _c * rx;
11456            }
11457            break;
11458
11459        default:
11460            // pixel or percentage values
11461            rx = radius.x || 0;
11462            ry = radius.y !== undefined ? radius.y : rx;
11463            break;
11464    }
11465
11466    return {
11467        x: rx,
11468        y: ry
11469    };
11470};
11471
11472var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) {
11473    var shape = '';
11474    var radius = '';
11475    var extent = '';
11476    var position = '';
11477    var idx = 0;
11478
11479    var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i;
11480    var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i;
11481    var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i;
11482
11483    var matchStartPosition = args[idx].match(POSITION);
11484    if (matchStartPosition) {
11485        idx++;
11486    }
11487
11488    var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT);
11489    if (matchShapeExtent) {
11490        shape = matchShapeExtent[1] || '';
11491        extent = matchShapeExtent[2] || '';
11492        if (extent === 'contain') {
11493            extent = 'closest-side';
11494        } else if (extent === 'cover') {
11495            extent = 'farthest-corner';
11496        }
11497        idx++;
11498    }
11499
11500    var matchStartRadius = args[idx].match(RADIUS);
11501    if (matchStartRadius) {
11502        idx++;
11503    }
11504
11505    var matchEndPosition = args[idx].match(POSITION);
11506    if (matchEndPosition) {
11507        idx++;
11508    }
11509
11510    var matchEndRadius = args[idx].match(RADIUS);
11511    if (matchEndRadius) {
11512        idx++;
11513    }
11514
11515    var matchPosition = matchEndPosition || matchStartPosition;
11516    if (matchPosition && matchPosition[1]) {
11517        position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : '');
11518        if (matchPosition[2]) {
11519            position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : '');
11520        }
11521    }
11522
11523    var matchRadius = matchEndRadius || matchStartRadius;
11524    if (matchRadius) {
11525        radius = matchRadius[0];
11526        if (!matchRadius[1]) {
11527            radius += 'px';
11528        }
11529    }
11530
11531    if (position && !shape && !radius && !extent) {
11532        radius = position;
11533        position = '';
11534    }
11535
11536    if (position) {
11537        position = 'at ' + position;
11538    }
11539
11540    return [[shape, extent, radius, position].filter(function (s) {
11541        return !!s;
11542    }).join(' ')].concat(args.slice(idx));
11543};
11544
11545var transformObsoleteColorStops = function transformObsoleteColorStops(args) {
11546    return args.map(function (color) {
11547        return color.match(FROM_TO_COLORSTOP);
11548    })
11549    // $FlowFixMe
11550    .map(function (v, index) {
11551        if (!v) {
11552            return args[index];
11553        }
11554
11555        switch (v[1]) {
11556            case 'from':
11557                return v[4] + ' 0%';
11558            case 'to':
11559                return v[4] + ' 100%';
11560            case 'color-stop':
11561                if (v[3] === '%') {
11562                    return v[4] + ' ' + v[2];
11563                }
11564                return v[4] + ' ' + parseFloat(v[2]) * 100 + '%';
11565        }
11566    });
11567};
11568});
11569
11570unwrapExports(Gradient);
11571var Gradient_1 = Gradient.transformWebkitRadialGradientArgs;
11572var Gradient_2 = Gradient.parseGradient;
11573var Gradient_3 = Gradient.RadialGradient;
11574var Gradient_4 = Gradient.LinearGradient;
11575var Gradient_5 = Gradient.RADIAL_GRADIENT_SHAPE;
11576var Gradient_6 = Gradient.GRADIENT_TYPE;
11577
11578var Renderer_1 = createCommonjsModule(function (module, exports) {
11579Object.defineProperty(exports, "__esModule", {
11580    value: true
11581});
11582
11583var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
11584
11585var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595var _TextContainer2 = _interopRequireDefault(TextContainer_1);
11596
11597
11598
11599
11600
11601function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11602
11603function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11604
11605var Renderer = function () {
11606    function Renderer(target, options) {
11607        _classCallCheck(this, Renderer);
11608
11609        this.target = target;
11610        this.options = options;
11611        target.render(options);
11612    }
11613
11614    _createClass(Renderer, [{
11615        key: 'renderNode',
11616        value: function renderNode(container) {
11617            if (container.isVisible()) {
11618                this.renderNodeBackgroundAndBorders(container);
11619                this.renderNodeContent(container);
11620            }
11621        }
11622    }, {
11623        key: 'renderNodeContent',
11624        value: function renderNodeContent(container) {
11625            var _this = this;
11626
11627            var callback = function callback() {
11628                if (container.childNodes.length) {
11629                    container.childNodes.forEach(function (child) {
11630                        if (child instanceof _TextContainer2.default) {
11631                            var style = child.parent.style;
11632                            _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow);
11633                        } else {
11634                            _this.target.drawShape(child, container.style.color);
11635                        }
11636                    });
11637                }
11638
11639                if (container.image) {
11640                    var _image = _this.options.imageStore.get(container.image);
11641                    if (_image) {
11642                        var contentBox = (0, Bounds_1.calculateContentBox)(container.bounds, container.style.padding, container.style.border);
11643                        var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width;
11644                        var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height;
11645                        if (_width > 0 && _height > 0) {
11646                            _this.target.clip([(0, Bounds_1.calculatePaddingBoxPath)(container.curvedBounds)], function () {
11647                                _this.target.drawImage(_image, new Bounds_1.Bounds(0, 0, _width, _height), contentBox);
11648                            });
11649                        }
11650                    }
11651                }
11652            };
11653            var paths = container.getClipPaths();
11654            if (paths.length) {
11655                this.target.clip(paths, callback);
11656            } else {
11657                callback();
11658            }
11659        }
11660    }, {
11661        key: 'renderNodeBackgroundAndBorders',
11662        value: function renderNodeBackgroundAndBorders(container) {
11663            var _this2 = this;
11664
11665            var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length;
11666
11667            var hasRenderableBorders = container.style.border.some(function (border$$2) {
11668                return border$$2.borderStyle !== border.BORDER_STYLE.NONE && !border$$2.borderColor.isTransparent();
11669            });
11670
11671            var callback = function callback() {
11672                var backgroundPaintingArea = (0, background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip);
11673
11674                if (HAS_BACKGROUND) {
11675                    _this2.target.clip([backgroundPaintingArea], function () {
11676                        if (!container.style.background.backgroundColor.isTransparent()) {
11677                            _this2.target.fill(container.style.background.backgroundColor);
11678                        }
11679
11680                        _this2.renderBackgroundImage(container);
11681                    });
11682                }
11683
11684                container.style.border.forEach(function (border$$2, side) {
11685                    if (border$$2.borderStyle !== border.BORDER_STYLE.NONE && !border$$2.borderColor.isTransparent()) {
11686                        _this2.renderBorder(border$$2, side, container.curvedBounds);
11687                    }
11688                });
11689            };
11690
11691            if (HAS_BACKGROUND || hasRenderableBorders) {
11692                var paths = container.parent ? container.parent.getClipPaths() : [];
11693                if (paths.length) {
11694                    this.target.clip(paths, callback);
11695                } else {
11696                    callback();
11697                }
11698            }
11699        }
11700    }, {
11701        key: 'renderBackgroundImage',
11702        value: function renderBackgroundImage(container) {
11703            var _this3 = this;
11704
11705            container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) {
11706                if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) {
11707                    _this3.renderBackgroundRepeat(container, backgroundImage);
11708                } else if (/gradient/i.test(backgroundImage.source.method)) {
11709                    _this3.renderBackgroundGradient(container, backgroundImage);
11710                }
11711            });
11712        }
11713    }, {
11714        key: 'renderBackgroundRepeat',
11715        value: function renderBackgroundRepeat(container, background$$2) {
11716            var image = this.options.imageStore.get(background$$2.source.args[0]);
11717            if (image) {
11718                var backgroundPositioningArea = (0, background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
11719                var backgroundImageSize = (0, background.calculateBackgroundSize)(background$$2, image, backgroundPositioningArea);
11720                var position = (0, background.calculateBackgroundPosition)(background$$2.position, backgroundImageSize, backgroundPositioningArea);
11721                var _path = (0, background.calculateBackgroundRepeatPath)(background$$2, position, backgroundImageSize, backgroundPositioningArea, container.bounds);
11722
11723                var _offsetX = Math.round(backgroundPositioningArea.left + position.x);
11724                var _offsetY = Math.round(backgroundPositioningArea.top + position.y);
11725                this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY);
11726            }
11727        }
11728    }, {
11729        key: 'renderBackgroundGradient',
11730        value: function renderBackgroundGradient(container, background$$2) {
11731            var backgroundPositioningArea = (0, background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
11732            var backgroundImageSize = (0, background.calculateGradientBackgroundSize)(background$$2, backgroundPositioningArea);
11733            var position = (0, background.calculateBackgroundPosition)(background$$2.position, backgroundImageSize, backgroundPositioningArea);
11734            var gradientBounds = new Bounds_1.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height);
11735
11736            var gradient = (0, Gradient.parseGradient)(container, background$$2.source, gradientBounds);
11737            if (gradient) {
11738                switch (gradient.type) {
11739                    case Gradient.GRADIENT_TYPE.LINEAR_GRADIENT:
11740                        // $FlowFixMe
11741                        this.target.renderLinearGradient(gradientBounds, gradient);
11742                        break;
11743                    case Gradient.GRADIENT_TYPE.RADIAL_GRADIENT:
11744                        // $FlowFixMe
11745                        this.target.renderRadialGradient(gradientBounds, gradient);
11746                        break;
11747                }
11748            }
11749        }
11750    }, {
11751        key: 'renderBorder',
11752        value: function renderBorder(border$$2, side, curvePoints) {
11753            this.target.drawShape((0, Bounds_1.parsePathForBorder)(curvePoints, side), border$$2.borderColor);
11754        }
11755    }, {
11756        key: 'renderStack',
11757        value: function renderStack(stack) {
11758            var _this4 = this;
11759
11760            if (stack.container.isVisible()) {
11761                var _opacity = stack.getOpacity();
11762                if (_opacity !== this._opacity) {
11763                    this.target.setOpacity(stack.getOpacity());
11764                    this._opacity = _opacity;
11765                }
11766
11767                var _transform = stack.container.style.transform;
11768                if (_transform !== null) {
11769                    this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () {
11770                        return _this4.renderStackContent(stack);
11771                    });
11772                } else {
11773                    this.renderStackContent(stack);
11774                }
11775            }
11776        }
11777    }, {
11778        key: 'renderStackContent',
11779        value: function renderStackContent(stack) {
11780            var _splitStackingContext = splitStackingContexts(stack),
11781                _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5),
11782                negativeZIndex = _splitStackingContext2[0],
11783                zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1],
11784                positiveZIndex = _splitStackingContext2[2],
11785                nonPositionedFloats = _splitStackingContext2[3],
11786                nonPositionedInlineLevel = _splitStackingContext2[4];
11787
11788            var _splitDescendants = splitDescendants(stack),
11789                _splitDescendants2 = _slicedToArray(_splitDescendants, 2),
11790                inlineLevel = _splitDescendants2[0],
11791                nonInlineLevel = _splitDescendants2[1];
11792
11793            // https://www.w3.org/TR/css-position-3/#painting-order
11794            // 1. the background and borders of the element forming the stacking context.
11795
11796
11797            this.renderNodeBackgroundAndBorders(stack.container);
11798            // 2. the child stacking contexts with negative stack levels (most negative first).
11799            negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
11800            // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
11801            this.renderNodeContent(stack.container);
11802            nonInlineLevel.forEach(this.renderNode, this);
11803            // 4. All non-positioned floating descendants, in tree order. For each one of these,
11804            // treat the element as if it created a new stacking context, but any positioned descendants and descendants
11805            // which actually create a new stacking context should be considered part of the parent stacking context,
11806            // not this new one.
11807            nonPositionedFloats.forEach(this.renderStack, this);
11808            // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
11809            nonPositionedInlineLevel.forEach(this.renderStack, this);
11810            inlineLevel.forEach(this.renderNode, this);
11811            // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:
11812            //  All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.
11813            //  For those with 'z-index: auto', treat the element as if it created a new stacking context,
11814            //  but any positioned descendants and descendants which actually create a new stacking context should be
11815            //  considered part of the parent stacking context, not this new one. For those with 'z-index: 0',
11816            //  treat the stacking context generated atomically.
11817            //
11818            //  All opacity descendants with opacity less than 1
11819            //
11820            //  All transform descendants with transform other than none
11821            zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this);
11822            // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index
11823            // order (smallest first) then tree order.
11824            positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
11825        }
11826    }, {
11827        key: 'render',
11828        value: function render(stack) {
11829            if (this.options.backgroundColor) {
11830                this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor);
11831            }
11832            this.renderStack(stack);
11833            var target = this.target.getTarget();
11834            return target;
11835        }
11836    }]);
11837
11838    return Renderer;
11839}();
11840
11841exports.default = Renderer;
11842
11843
11844var splitDescendants = function splitDescendants(stack) {
11845    var inlineLevel = [];
11846    var nonInlineLevel = [];
11847
11848    var length = stack.children.length;
11849    for (var i = 0; i < length; i++) {
11850        var child = stack.children[i];
11851        if (child.isInlineLevel()) {
11852            inlineLevel.push(child);
11853        } else {
11854            nonInlineLevel.push(child);
11855        }
11856    }
11857    return [inlineLevel, nonInlineLevel];
11858};
11859
11860var splitStackingContexts = function splitStackingContexts(stack) {
11861    var negativeZIndex = [];
11862    var zeroOrAutoZIndexOrTransformedOrOpacity = [];
11863    var positiveZIndex = [];
11864    var nonPositionedFloats = [];
11865    var nonPositionedInlineLevel = [];
11866    var length = stack.contexts.length;
11867    for (var i = 0; i < length; i++) {
11868        var child = stack.contexts[i];
11869        if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) {
11870            if (child.container.style.zIndex.order < 0) {
11871                negativeZIndex.push(child);
11872            } else if (child.container.style.zIndex.order > 0) {
11873                positiveZIndex.push(child);
11874            } else {
11875                zeroOrAutoZIndexOrTransformedOrOpacity.push(child);
11876            }
11877        } else {
11878            if (child.container.isFloating()) {
11879                nonPositionedFloats.push(child);
11880            } else {
11881                nonPositionedInlineLevel.push(child);
11882            }
11883        }
11884    }
11885    return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel];
11886};
11887
11888var sortByZIndex = function sortByZIndex(a, b) {
11889    if (a.container.style.zIndex.order > b.container.style.zIndex.order) {
11890        return 1;
11891    } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) {
11892        return -1;
11893    }
11894
11895    return a.container.index > b.container.index ? 1 : -1;
11896};
11897});
11898
11899unwrapExports(Renderer_1);
11900
11901var _Proxy = createCommonjsModule(function (module, exports) {
11902Object.defineProperty(exports, "__esModule", {
11903    value: true
11904});
11905exports.Proxy = undefined;
11906
11907
11908
11909var _Feature2 = _interopRequireDefault(Feature);
11910
11911function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11912
11913var Proxy = exports.Proxy = function Proxy(src, options) {
11914    if (!options.proxy) {
11915        return Promise.reject(null);
11916    }
11917    var proxy = options.proxy;
11918
11919    return new Promise(function (resolve, reject) {
11920        var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
11921        var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
11922        xhr.onload = function () {
11923            if (xhr instanceof XMLHttpRequest) {
11924                if (xhr.status === 200) {
11925                    if (responseType === 'text') {
11926                        resolve(xhr.response);
11927                    } else {
11928                        var reader = new FileReader();
11929                        // $FlowFixMe
11930                        reader.addEventListener('load', function () {
11931                            return resolve(reader.result);
11932                        }, false);
11933                        // $FlowFixMe
11934                        reader.addEventListener('error', function (e) {
11935                            return reject(e);
11936                        }, false);
11937                        reader.readAsDataURL(xhr.response);
11938                    }
11939                } else {
11940                    reject('');
11941                }
11942            } else {
11943                resolve(xhr.responseText);
11944            }
11945        };
11946
11947        xhr.onerror = reject;
11948        xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
11949
11950        if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
11951            xhr.responseType = responseType;
11952        }
11953
11954        if (options.imageTimeout) {
11955            var timeout = options.imageTimeout;
11956            xhr.timeout = timeout;
11957            xhr.ontimeout = function () {
11958                return reject('');
11959            };
11960        }
11961
11962        xhr.send();
11963    });
11964};
11965});
11966
11967unwrapExports(_Proxy);
11968var _Proxy_1 = _Proxy.Proxy;
11969
11970var ResourceLoader_1 = createCommonjsModule(function (module, exports
11970) {
11971Object.defineProperty(exports, "__esModule", {
11972    value: true
11973});
11974exports.ResourceStore = undefined;
11975
11976var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
11977
11978
11979
11980var _Feature2 = _interopRequireDefault(Feature);
11981
11982
11983
11984function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11985
11986function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11987
11988var ResourceLoader = function () {
11989    function ResourceLoader(options, logger, window) {
11990        _classCallCheck(this, ResourceLoader);
11991
11992        this.options = options;
11993        this._window = window;
11994        this.origin = this.getOrigin(window.location.href);
11995        this.cache = {};
11996        this.logger = logger;
11997        this._index = 0;
11998    }
11999
12000    _createClass(ResourceLoader, [{
12001        key: 'loadImage',
12002        value: function loadImage(src) {
12003            var _this = this;
12004
12005            if (this.hasResourceInCache(src)) {
12006                return src;
12007            }
12008            if (isBlobImage(src)) {
12009                this.cache[src] = _loadImage(src, this.options.imageTimeout || 0);
12010                return src;
12011            }
12012
12013            if (!isSVG(src) || _Feature2.default.SUPPORT_SVG_DRAWING) {
12014                if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
12015                    return this.addImage(src, src, false);
12016                } else if (!this.isSameOrigin(src)) {
12017                    if (typeof this.options.proxy === 'string') {
12018                        this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
12019                            return _loadImage(src, _this.options.imageTimeout || 0);
12020                        });
12021                        return src;
12022                    } else if (this.options.useCORS === true && _Feature2.default.SUPPORT_CORS_IMAGES) {
12023                        return this.addImage(src, src, true);
12024                    }
12025                }
12026            }
12027        }
12028    }, {
12029        key: 'inlineImage',
12030        value: function inlineImage(src) {
12031            var _this2 = this;
12032
12033            if (isInlineImage(src)) {
12034                return _loadImage(src, this.options.imageTimeout || 0);
12035            }
12036            if (this.hasResourceInCache(src)) {
12037                return this.cache[src];
12038            }
12039            if (!this.isSameOrigin(src) && typeof this.options.proxy === 'string') {
12040                return this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
12041                    return _loadImage(src, _this2.options.imageTimeout || 0);
12042                });
12043            }
12044
12045            return this.xhrImage(src);
12046        }
12047    }, {
12048        key: 'xhrImage',
12049        value: function xhrImage(src) {
12050            var _this3 = this;
12051
12052            this.cache[src] = new Promise(function (resolve, reject) {
12053                var xhr = new XMLHttpRequest();
12054                xhr.onreadystatechange = function () {
12055                    if (xhr.readyState === 4) {
12056                        if (xhr.status !== 200) {
12057                            reject('Failed to fetch image ' + src.substring(0, 256) + ' with status code ' + xhr.status);
12058                        } else {
12059                            var reader = new FileReader();
12060                            reader.addEventListener('load', function () {
12061                                // $FlowFixMe
12062                                var result = reader.result;
12063                                resolve(result);
12064                            }, false);
12065                            reader.addEventListener('error', function (e) {
12066                                return reject(e);
12067                            }, false);
12068                            reader.readAsDataURL(xhr.response);
12069                        }
12070                    }
12071                };
12072                xhr.responseType = 'blob';
12073                if (_this3.options.imageTimeout) {
12074                    var timeout = _this3.options.imageTimeout;
12075                    xhr.timeout = timeout;
12076                    xhr.ontimeout = function () {
12077                        return reject('');
12078                    };
12079                }
12080                xhr.open('GET', src, true);
12081                xhr.send();
12082            }).then(function (src) {
12083                return _loadImage(src, _this3.options.imageTimeout || 0);
12084            });
12085
12086            return this.cache[src];
12087        }
12088    }, {
12089        key: 'loadCanvas',
12090        value: function loadCanvas(node) {
12091            var key = String(this._index++);
12092            this.cache[key] = Promise.resolve(node);
12093            return key;
12094        }
12095    }, {
12096        key: 'hasResourceInCache',
12097        value: function hasResourceInCache(key) {
12098            return typeof this.cache[key] !== 'undefined';
12099        }
12100    }, {
12101        key: 'addImage',
12102        value: function addImage(key, src, useCORS) {
12103            var _this4 = this;
12104
12105            var imageLoadHandler = function imageLoadHandler(supportsDataImages) {
12106                return new Promise(function (resolve, reject) {
12107                    var img = new Image();
12108                    img.onload = function () {
12109                        return resolve(img);
12110                    };
12111                    //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
12112                    if (!supportsDataImages || useCORS) {
12113                        img.crossOrigin = 'anonymous';
12114                    }
12115
12116                    img.onerror = reject;
12117                    img.src = src;
12118                    if (img.complete === true) {
12119                        // Inline XML images may fail to parse, throwing an Error later on
12120                        setTimeout(function () {
12121                            resolve(img);
12122                        }, 500);
12123                    }
12124                    if (_this4.options.imageTimeout) {
12125                        var timeout = _this4.options.imageTimeout;
12126                        setTimeout(function () {
12127                            return reject('');
12128                        }, timeout);
12129                    }
12130                });
12131            };
12132
12133            this.cache[key] = isInlineBase64Image(src) && !isSVG(src) ? // $FlowFixMe
12134            _Feature2.default.SUPPORT_BASE64_DRAWING(src).then(imageLoadHandler) : imageLoadHandler(true);
12135            return key;
12136        }
12137    }, {
12138        key: 'isSameOrigin',
12139        value: function isSameOrigin(url) {
12140            return this.getOrigin(url) === this.origin;
12141        }
12142    }, {
12143        key: 'getOrigin',
12144        value: function getOrigin(url) {
12145            var link = this._link || (this._link = this._window.document.createElement('a'));
12146            link.href = url;
12147            link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
12148            return link.protocol + link.hostname + link.port;
12149        }
12150    }, {
12151        key: 'ready',
12152        value: function ready() {
12153            var _this5 = this;
12154
12155            var keys = Object.keys(this.cache);
12156            var values = keys.map(function (str) {
12157                return _this5.cache[str].catch(function (e) {
12158                    return null;
12159                });
12160            });
12161            return Promise.all(values).then(function (images) {
12162                return new ResourceStore(keys, images);
12163            });
12164        }
12165    }]);
12166
12167    return ResourceLoader;
12168}();
12169
12170exports.default = ResourceLoader;
12171
12172var ResourceStore = exports.ResourceStore = function () {
12173    function ResourceStore(keys, resources) {
12174        _classCallCheck(this, ResourceStore);
12175
12176        this._keys = keys;
12177        this._resources = resources;
12178    }
12179
12180    _createClass(ResourceStore, [{
12181        key: 'get',
12182        value: function get(key) {
12183            var index = this._keys.indexOf(key);
12184            return index === -1 ? null : this._resources[index];
12185        }
12186    }]);
12187
12188    return ResourceStore;
12189}();
12190
12191var INLINE_SVG = /^data:image\/svg\+xml/i;
12192var INLINE_BASE64 = /^data:image\/.*;base64,/i;
12193var INLINE_IMG = /^data:image\/.*/i;
12194
12195var isInlineImage = function isInlineImage(src) {
12196    return INLINE_IMG.test(src);
12197};
12198var isInlineBase64Image = function isInlineBase64Image(src) {
12199    return INLINE_BASE64.test(src);
12200};
12201var isBlobImage = function isBlobImage(src) {
12202    return src.substr(0, 4) === 'blob';
12203};
12204
12205var isSVG = function isSVG(src) {
12206    return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
12207};
12208
12209var _loadImage = function _loadImage(src, timeout) {
12210    return new Promise(function (resolve, reject) {
12211        var img = new Image();
12212        img.onload = function () {
12213            return resolve(img);
12214        };
12215        img.onerror = reject;
12216        img.src = src;
12217        if (img.complete === true) {
12218            // Inline XML images may fail to parse, throwing an Error later on
12219            setTimeout(function () {
12220                resolve(img);
12221            }, 500);
12222        }
12223        if (timeout) {
12224            setTimeout(function () {
12225                return reject('');
12226            }, timeout);
12227        }
12228    });
12229};
12230});
12231
12232unwrapExports(ResourceLoader_1);
12233var ResourceLoader_2 = ResourceLoader_1.ResourceStore;
12234
12235var PseudoNodeContent = createCommonjsModule(function (module, exports
12235) {
12236Object.defineProperty(exports, "__esModule", {
12237    value: true
12238});
12239exports.parseContent = exports.resolvePseudoContent = exports.popCounters = exports.parseCounterReset = exports.TOKEN_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = undefined;
12240
12241var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
12242
12243
12244
12245
12246
12247var PSEUDO_CONTENT_ITEM_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = {
12248    TEXT: 0,
12249    IMAGE: 1
12250};
12251
12252var TOKEN_TYPE = exports.TOKEN_TYPE = {
12253    STRING: 0,
12254    ATTRIBUTE: 1,
12255    URL: 2,
12256    COUNTER: 3,
12257    COUNTERS: 4,
12258    OPENQUOTE: 5,
12259    CLOSEQUOTE: 6
12260};
12261
12262var parseCounterReset = exports.parseCounterReset = function parseCounterReset(style, data) {
12263    if (!style || !style.counterReset || style.counterReset === 'none') {
12264        return [];
12265    }
12266
12267    var counterNames = [];
12268    var counterResets = style.counterReset.split(/\s*,\s*/);
12269    var lenCounterResets = counterResets.length;
12270
12271    for (var i = 0; i < lenCounterResets; i++) {
12272        var _counterResets$i$spli = counterResets[i].split(/\s+/),
12273            _counterResets$i$spli2 = _slicedToArray(_counterResets$i$spli, 2),
12274            counterName = _counterResets$i$spli2[0],
12275            initialValue = _counterResets$i$spli2[1];
12276
12277        counterNames.push(counterName);
12278        var counter = data.counters[counterName];
12279        if (!counter) {
12280            counter = data.counters[counterName] = [];
12281        }
12282        counter.push(parseInt(initialValue || 0, 10));
12283    }
12284
12285    return counterNames;
12286};
12287
12288var popCounters = exports.popCounters = function popCounters(counterNames, data) {
12289    var lenCounters = counterNames.length;
12290    for (var i = 0; i < lenCounters; i++) {
12291        data.counters[counterNames[i]].pop();
12292    }
12293};
12294
12295var resolvePseudoContent = exports.resolvePseudoContent = function resolvePseudoContent(node, style, data) {
12296    if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
12297        return null;
12298    }
12299
12300    var tokens = parseContent(style.content);
12301
12302    var len = tokens.length;
12303    var contentItems = [];
12304    var s = '';
12305
12306    // increment the counter (if there is a "counter-increment" declaration)
12307    var counterIncrement = style.counterIncrement;
12308    if (counterIncrement && counterIncrement !== 'none') {
12309        var _counterIncrement$spl = counterIncrement.split(/\s+/),
12310            _counterIncrement$spl2 = _slicedToArray(_counterIncrement$spl, 2),
12311            counterName = _counterIncrement$spl2[0],
12312            incrementValue = _counterIncrement$spl2[1];
12313
12314        var counter = data.counters[counterName];
12315        if (counter) {
12316            counter[counter.length - 1] += incrementValue === undefined ? 1 : parseInt(incrementValue, 10);
12317        }
12318    }
12319
12320    // build the content string
12321    for (var i = 0; i < len; i++) {
12322        var token = tokens[i];
12323        switch (token.type) {
12324            case TOKEN_TYPE.STRING:
12325                s += token.value || '';
12326                break;
12327
12328            case TOKEN_TYPE.ATTRIBUTE:
12329                if (node instanceof HTMLElement && token.value) {
12330                    s += node.getAttribute(token.value) || '';
12331                }
12332                break;
12333
12334            case TOKEN_TYPE.COUNTER:
12335                var _counter = data.counters[token.name || ''];
12336                if (_counter) {
12337                    s += formatCounterValue([_counter[_counter.length - 1]], '', token.format);
12338                }
12339                break;
12340
12341            case TOKEN_TYPE.COUNTERS:
12342                var _counters = data.counters[token.name || ''];
12343                if (_counters) {
12344                    s += formatCounterValue(_counters, token.glue, token.format);
12345                }
12346                break;
12347
12348            case TOKEN_TYPE.OPENQUOTE:
12349                s += getQuote(style, true, data.quoteDepth);
12350                data.quoteDepth++;
12351                break;
12352
12353            case TOKEN_TYPE.CLOSEQUOTE:
12354                data.quoteDepth--;
12355                s += getQuote(style, false, data.quoteDepth);
12356                break;
12357
12358            case TOKEN_TYPE.URL:
12359                if (s) {
12360                    contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
12361                    s = '';
12362                }
12363                contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.IMAGE, value: token.value || '' });
12364                break;
12365        }
12366    }
12367
12368    if (s) {
12369        contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
12370    }
12371
12372    return contentItems;
12373};
12374
12375var parseContent = exports.parseContent = function parseContent(content, cache) {
12376    if (cache && cache[content]) {
12377        return cache[content];
12378    }
12379
12380    var tokens = [];
12381    var len = content.length;
12382
12383    var isString = false;
12384    var isEscaped = false;
12385    var isFunction = false;
12386    var str = '';
12387    var functionName = '';
12388    var args = [];
12389
12390    for (var i = 0; i < len; i++) {
12391        var c = content.charAt(i);
12392
12393        switch (c) {
12394            case "'":
12395            case '"':
12396                if (isEscaped) {
12397                    str += c;
12398                } else {
12399                    isString = !isString;
12400                    if (!isFunction && !isString) {
12401                        tokens.push({ type: TOKEN_TYPE.STRING, value: str });
12402                        str = '';
12403                    }
12404                }
12405                break;
12406
12407            case '\\':
12408                if (isEscaped) {
12409                    str += c;
12410                    isEscaped = false;
12411                } else {
12412                    isEscaped = true;
12413                }
12414                break;
12415
12416            case '(':
12417                if (isString) {
12418                    str += c;
12419                } else {
12420                    isFunction = true;
12421                    functionName = str;
12422                    str = '';
12423                    args = [];
12424                }
12425                break;
12426
12427            case ')':
12428                if (isString) {
12429                    str += c;
12430                } else if (isFunction) {
12431                    if (str) {
12432                        args.push(str);
12433                    }
12434
12435                    switch (functionName) {
12436                        case 'attr':
12437                            if (args.length > 0) {
12438                                tokens.push({ type: TOKEN_TYPE.ATTRIBUTE, value: args[0] });
12439                            }
12440                            break;
12441
12442                        case 'counter':
12443                            if (args.length > 0) {
12444                                var counter = {
12445                                    type: TOKEN_TYPE.COUNTER,
12446                                    name: args[0]
12447                                };
12448                                if (args.length > 1) {
12449                                    counter.format = args[1];
12450                                }
12451                                tokens.push(counter);
12452                            }
12453                            break;
12454
12455                        case 'counters':
12456                            if (args.length > 0) {
12457                                var _counters2 = {
12458                                    type: TOKEN_TYPE.COUNTERS,
12459                                    name: args[0]
12460                                };
12461                                if (args.length > 1) {
12462                                    _counters2.glue = args[1];
12463                                }
12464                                if (args.length > 2) {
12465                                    _counters2.format = args[2];
12466                                }
12467                                tokens.push(_counters2);
12468                            }
12469                            break;
12470
12471                        case 'url':
12472                            if (args.length > 0) {
12473                                tokens.push({ type: TOKEN_TYPE.URL, value: args[0] });
12474                            }
12475                            break;
12476                    }
12477
12478                    isFunction = false;
12479                    str = '';
12480                }
12481                break;
12482
12483            case ',':
12484                if (isString) {
12485                    str += c;
12486                } else if (isFunction) {
12487                    args.push(str);
12488                    str = '';
12489                }
12490                break;
12491
12492            case ' ':
12493            case '\t':
12494                if (isString) {
12495                    str += c;
12496                } else if (str) {
12497                    addOtherToken(tokens, str);
12498                    str = '';
12499                }
12500                break;
12501
12502            default:
12503                str += c;
12504        }
12505
12506        if (c !== '\\') {
12507            isEscaped = false;
12508        }
12509    }
12510
12511    if (str) {
12512        addOtherToken(tokens, str);
12513    }
12514
12515    if (cache) {
12516        cache[content] = tokens;
12517    }
12518
12519    return tokens;
12520};
12521
12522var addOtherToken = function addOtherToken(tokens, identifier) {
12523    switch (identifier) {
12524        case 'open-quote':
12525            tokens.push({ type: TOKEN_TYPE.OPENQUOTE });
12526            break;
12527        case 'close-quote':
12528            tokens.push({ type: TOKEN_TYPE.CLOSEQUOTE });
12529            break;
12530    }
12531};
12532
12533var getQuote = function getQuote(style, isOpening, quoteDepth) {
12534    var quotes = style.quotes ? style.quotes.split(/\s+/) : ["'\"'", "'\"'"];
12535    var idx = quoteDepth * 2;
12536    if (idx >= quotes.length) {
12537        idx = quotes.length - 2;
12538    }
12539    if (!isOpening) {
12540        ++idx;
12541    }
12542    return quotes[idx].replace(/^["']|["']$/g, '');
12543};
12544
12545var formatCounterValue = function formatCounterValue(counter, glue, format) {
12546    var len = counter.length;
12547    var result = '';
12548
12549    for (var i = 0; i < len; i++) {
12550        if (i > 0) {
12551            result += glue || '';
12552        }
12553        result += (0, ListItem.createCounterText)(counter[i], (0, listStyle.parseListStyleType)(format || 'decimal'), false);
12554    }
12555
12556    return result;
12557};
12558});
12559
12560unwrapExports(PseudoNodeContent);
12561var PseudoNodeContent_1 = PseudoNodeContent.parseContent;
12562var PseudoNodeContent_2 = PseudoNodeContent.resolvePseudoContent;
12563var PseudoNodeContent_3 = PseudoNodeContent.popCounters;
12564var PseudoNodeContent_4 = PseudoNodeContent.parseCounterReset;
12565var PseudoNodeContent_5 = PseudoNodeContent.TOKEN_TYPE;
12566var PseudoNodeContent_6 = PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE;
12567
12568var Clone = createCommonjsModule(function (module, exports) {
12569Object.defineProperty(exports, "__esModule", {
12570    value: true
12571});
12572exports.cloneWindow = exports.DocumentCloner = undefined;
12573
12574var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
12575
12576var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
12577
12578
12579
12580
12581
12582
12583
12584var _ResourceLoader2 = _interopRequireDefault(ResourceLoader_1);
12585
12586
12587
12588
12589
12590
12591
12592var _CanvasRenderer2 = _interopRequireDefault(CanvasRenderer_1);
12593
12594
12595
12596function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12597
12598function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12599
12600var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
12601
12602var DocumentCloner = exports.DocumentCloner = function () {
12603    function DocumentCloner(element, options, logger, copyInline, renderer) {
12604        _classCallCheck(this, DocumentCloner);
12605
12606        this.referenceElement = element;
12607        this.scrolledElements = [];
12608        this.copyStyles = copyInline;
12609        this.inlineImages = copyInline;
12610        this.logger = logger;
12611        this.options = options;
12612        this.renderer = renderer;
12613        this.resourceLoader = new _ResourceLoader2.default(options, logger, window);
12614        this.pseudoContentData = {
12615            counters: {},
12616            quoteDepth: 0
12617        };
12618        // $FlowFixMe
12619        this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
12620    }
12621
12622    _createClass(DocumentCloner, [{
12623        key: 'inlineAllImages',
12624        value: function inlineAllImages(node) {
12625            var _this = this;
12626
12627            if (this.inlineImages && node) {
12628                var style = node.style;
12629                Promise.all((0, background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) {
12630                    if (backgroundImage.method === 'url') {
12631                        return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) {
12632                            return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none';
12633                        }).catch(function (e) {
12634                            
12635                        });
12636                    }
12637                    return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')');
12638                })).then(function (backgroundImages) {
12639                    if (backgroundImages.length > 1) {
12640                        // TODO Multiple backgrounds somehow broken in Chrome
12641                        style.backgroundColor = '';
12642                    }
12643                    style.backgroundImage = backgroundImages.join(',');
12644                });
12645
12646                if (node instanceof HTMLImageElement) {
12647                    this.resourceLoader.inlineImage(node.src).then(function (img) {
12648                        if (img && node instanceof HTMLImageElement && node.parentNode) {
12649                            var parentNode = node.parentNode;
12650                            var clonedChild = (0, Util.copyCSSStyles)(node.style, img.cloneNode(false));
12651                            parentNode.replaceChild(clonedChild, node);
12652                        }
12653                    }).catch(function (e) {
12654                        
12655                    });
12656                }
12657            }
12658        }
12659    }, {
12660        key: 'inlineFonts',
12661        value: function inlineFonts(document) {
12662            var _this2 = this;
12663
12664            return Promise.all(Array.from(document.styleSheets).map(function (sheet) {
12665                if (sheet.href) {
12666                    return fetch(sheet.href).then(function (res) {
12667                        return res.text();
12668                    }).then(function (text) {
12669                        return createStyleSheetFontsFromText(text, sheet.href);
12670                    }).catch(function (e) {
12671                        return [];
12672                    });
12673                }
12674                return getSheetFonts(sheet, document);
12675            })).then(function (fonts) {
12676                return fonts.reduce(function (acc, font) {
12677                    return acc.concat(font);
12678                }, []);
12679            }).then(function (fonts) {
12680                return Promise.all(fonts.map(function (font) {
12681                    return fetch(font.formats[0].src).then(function (response) {
12682                        return response.blob();
12683                    }).then(function (blob) {
12684                        return new Promise(function (resolve, reject) {
12685                            var reader = new FileReader();
12686                            reader.onerror = reject;
12687                            reader.onload = function () {
12688                                // $FlowFixMe
12689                                var result = reader.result;
12690                                resolve(result);
12691                            };
12692                            reader.readAsDataURL(blob);
12693                        });
12694                    }).then(function (dataUri) {
12695                        font.fontFace.setProperty('src', 'url("' + dataUri + '")');
12696                        return '@font-face {' + font.fontFace.cssText + ' ';
12697                    });
12698                }));
12699            }).then(function (fontCss) {
12700                var style = document.createElement('style');
12701                style.textContent = fontCss.join('\n');
12702                _this2.documentElement.appendChild(style);
12703            });
12704        }
12705    }, {
12706        key: 'createElementClone',
12707        value: function createElementClone(node) {
12708            var _this3 = this;
12709
12710            if (this.copyStyles && node instanceof HTMLCanvasElement) {
12711                var img = node.ownerDocument.createElement('img');
12712                try {
12713                    img.src = node.toDataURL();
12714                    return img;
12715                } catch (e) {
12716                    
12717                }
12718            }
12719
12720            if (node instanceof HTMLIFrameElement) {
12721                var tempIframe = node.cloneNode(false);
12722                var iframeKey = generateIframeKey();
12723                tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);
12724
12725                var _parseBounds = (0, Bounds_1.parseBounds)(node, 0, 0),
12726                    width = _parseBounds.width,
12727                    height = _parseBounds.height;
12728
12729                this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {
12730                    return _this3.renderer(documentElement, {
12731                        async: _this3.options.async,
12732                        allowTaint: _this3.options.allowTaint,
12733                        backgroundColor: '#ffffff',
12734                        canvas: null,
12735                        imageTimeout: _this3.options.imageTimeout,
12736                        logging: _this3.options.logging,
12737                        proxy: _this3.options.proxy,
12738                        removeContainer: _this3.options.removeContainer,
12739                        scale: _this3.options.scale,
12740                        foreignObjectRendering: _this3.options.foreignObjectRendering,
12741                        useCORS: _this3.options.useCORS,
12742                        target: new _CanvasRenderer2.default(),
12743                        width: width,
12744                        height: height,
12745                        x: 0,
12746                        y: 0,
12747                        windowWidth: documentElement.ownerDocument.defaultView.innerWidth,
12748                        windowHeight: documentElement.ownerDocument.defaultView.innerHeight,
12749                        scrollX: documentElement.ownerDocument.defaultView.pageXOffset,
12750                        scrollY: documentElement.ownerDocument.defaultView.pageYOffset
12751                    }, _this3.logger.child(iframeKey));
12752                }).then(function (canvas) {
12753                    return new Promise(function (resolve, reject) {
12754                        var iframeCanvas = document.createElement('img');
12755                        iframeCanvas.onload = function () {
12756                            return resolve(canvas);
12757                        };
12758                        iframeCanvas.onerror = reject;
12759                        iframeCanvas.src = canvas.toDataURL();
12760                        if (tempIframe.parentNode) {
12761                            tempIframe.parentNode.replaceChild((0, Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe);
12762                        }
12763                    });
12764                });
12765                return tempIframe;
12766            }
12767
12768            if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
12769                var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) {
12770                    try {
12771                        if (rule && rule.cssText) {
12772                            return css + rule.cssText;
12773                        }
12774                        return css;
12775                    } catch (err) {
12776                        _this3.logger.log('Unable to access cssText property', rule.name);
12777                        return css;
12778                    }
12779                }, '');
12780                var style = node.cloneNode(false);
12781                style.textContent = css;
12782                return style;
12783            }
12784
12785            return node.cloneNode(false);
12786        }
12787    }, {
12788        key: 'cloneNode',
12789        value: function cloneNode(node) {
12790            var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node);
12791
12792            var window = node.ownerDocument.defaultView;
12793            var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null;
12794            var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null;
12795            var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null;
12796
12797            if (this.referenceElement === node && clone instanceof window.HTMLElement) {
12798                this.clonedReferenceElement = clone;
12799            }
12800
12801            if (clone instanceof window.HTMLBodyElement) {
12802                createPseudoHideStyles(clone);
12803            }
12804
12805            var counters = (0, PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData);
12806            var contentBefore = (0, PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData);
12807
12808            for (var child = node.firstChild; child; child = child.nextSibling) {
12809                if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' &&
12810                // $FlowFixMe
12811                !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' ||
12812                // $FlowFixMe
12813                !this.options.ignoreElements(child))) {
12814                    if (!this.copyStyles || child.nodeName !== 'STYLE') {
12815                        clone.appendChild(this.cloneNode(child));
12816                    }
12817                }
12818            }
12819
12820            var contentAfter = (0, PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData);
12821            (0, PseudoNodeContent.popCounters)(counters, this.pseudoContentData);
12822
12823            if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) {
12824                if (styleBefore) {
12825                    this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE));
12826                }
12827                if (styleAfter) {
12828                    this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER));
12829                }
12830                if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) {
12831                    (0, Util.copyCSSStyles)(style, clone);
12832                }
12833                this.inlineAllImages(clone);
12834                if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
12835                    this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
12836                }
12837                switch (node.nodeName) {
12838                    case 'CANVAS':
12839                        if (!this.copyStyles) {
12840                            cloneCanvasContents(node, clone);
12841                        }
12842                        break;
12843                    case 'TEXTAREA':
12844                    case 'SELECT':
12845                        clone.value = node.value;
12846                        break;
12847                }
12848            }
12849            return clone;
12850        }
12851    }]);
12852
12853    return DocumentCloner;
12854}();
12855
12856var getSheetFonts = function getSheetFonts(sheet, document) {
12857    // $FlowFixMe
12858    return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) {
12859        return rule.type === CSSRule.FONT_FACE_RULE;
12860    }).map(function (rule) {
12861        var src = (0, background.parseBackgroundImage)(rule.style.getPropertyValue('src'));
12862        var formats = [];
12863        for (var i = 0; i < src.length; i++) {
12864            if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') {
12865                var a = document.createElement('a');
12866                a.href = src[i].args[0];
12867                if (document.body) {
12868                    document.body.appendChild(a);
12869                }
12870
12871                var font = {
12872                    src: a.href,
12873                    format: src[i + 1].args[0]
12874                };
12875                formats.push(font);
12876            }
12877        }
12878
12879        return {
12880            // TODO select correct format for browser),
12881
12882            formats: formats.filter(function (font) {
12883                return (/^woff/i.test(font.format)
12884                );
12885            }),
12886            fontFace: rule.style
12887        };
12888    }).filter(function (font) {
12889        return font.formats.length;
12890    });
12891};
12892
12893var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) {
12894    var doc = document.implementation.createHTMLDocument('');
12895    var base = document.createElement('base');
12896    // $FlowFixMe
12897    base.href = baseHref;
12898    var style = document.createElement('style');
12899
12900    style.textContent = text;
12901    if (doc.head) {
12902        doc.head.appendChild(base);
12903    }
12904    if (doc.body) {
12905        doc.body.appendChild(style);
12906    }
12907
12908    return style.sheet ? getSheetFonts(style.sheet, doc) : [];
12909};
12910
12911var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) {
12912    if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
12913        ownerDocument.defaultView.scrollTo(x, y);
12914    }
12915};
12916
12917var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) {
12918    try {
12919        if (clonedCanvas) {
12920            clonedCanvas.width = canvas.width;
12921            clonedCanvas.height = canvas.height;
12922            var ctx = canvas.getContext('2d');
12923            var clonedCtx = clonedCanvas.getContext('2d');
12924            if (ctx) {
12925                clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
12926            } else {
12927                clonedCtx.drawImage(canvas, 0, 0);
12928            }
12929        }
12930    } catch (e) {}
12931};
12932
12933var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) {
12934    if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
12935        return;
12936    }
12937
12938    var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement');
12939    (0, Util.copyCSSStyles)(style, anonymousReplacedElement);
12940
12941    if (contentItems) {
12942        var len = contentItems.length;
12943        for (var i = 0; i < len; i++) {
12944            var item = contentItems[i];
12945            switch (item.type) {
12946                case PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:
12947                    var img = clone.ownerDocument.createElement('img');
12948                    img.src = (0, background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0];
12949                    img.style.opacity = '1';
12950                    anonymousReplacedElement.appendChild(img);
12951                    break;
12952                case PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT:
12953                    anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value));
12954                    break;
12955            }
12956        }
12957    }
12958
12959    anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
12960    clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
12961    if (pseudoElt === PSEUDO_BEFORE) {
12962        clone.insertBefore(anonymousReplacedElement, clone.firstChild);
12963    } else {
12964        clone.appendChild(anonymousReplacedElement);
12965    }
12966
12967    return anonymousReplacedElement;
12968};
12969
12970var PSEUDO_BEFORE = ':before';
12971var PSEUDO_AFTER = ':after';
12972var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
12973var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
12974
12975var PSEUDO_HIDE_ELEMENT_STYLE = '{\n    content: "" !important;\n    display: none !important;\n}';
12976
12977var createPseudoHideStyles = function createPseudoHideStyles(body) {
12978    createStyles(body, '.' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + '\n         .' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
12979};
12980
12981var createStyles = function createStyles(body, styles) {
12982    var style = body.ownerDocument.createElement('style');
12983    style.innerHTML = styles;
12984    body.appendChild(style);
12985};
12986
12987var initNode = function initNode(_ref) {
12988    var _ref2 = _slicedToArray(_ref, 3),
12989        element = _ref2[0],
12990        x = _ref2[1],
12991        y = _ref2[2];
12992
12993    element.scrollLeft = x;
12994    element.scrollTop = y;
12995};
12996
12997var generateIframeKey = function generateIframeKey() {
12998    return Math.ceil(Date.now() + Math.random() * 10000000).toString(16);
12999};
13000
13001var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i;
13002
13003var getIframeDocumentElement = function getIframeDocumentElement(node, options) {
13004    try {
13005        return Promise.resolve(node.contentWindow.document.documentElement);
13006    } catch (e) {
13007        return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) {
13008            var match = html.match(DATA_URI_REGEXP);
13009            if (!match) {
13010                return Promise.reject();
13011            }
13012
13013            return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]);
13014        }).then(function (html) {
13015            return createIframeContainer(node.ownerDocument, (0, Bounds_1.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) {
13016                var cloneWindow = cloneIframeContainer.contentWindow;
13017                var documentClone = cloneWindow.document;
13018
13019                documentClone.open();
13020                documentClone.write(html);
13021                var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
13022                    return documentClone.documentElement;
13023                });
13024
13025                documentClone.close();
13026                return iframeLoad;
13027            });
13028        }) : Promise.reject();
13029    }
13030};
13031
13032var createIframeContainer = function createIframeContainer(ownerDocument, bounds) {
13033    var cloneIframeContainer = ownerDocument.createElement('iframe');
13034
13035    cloneIframeContainer.className = 'html2canvas-container';
13036    cloneIframeContainer.style.visibility = 'hidden';
13037    cloneIframeContainer.style.position = 'fixed';
13038    cloneIframeContainer.style.left = '-10000px';
13039    cloneIframeContainer.style.top = '0px';
13040    cloneIframeContainer.style.border = '0';
13041    cloneIframeContainer.width = bounds.width.toString();
13042    cloneIframeContainer.height = bounds.height.toString();
13043    cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
13044    cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
13045    if (!ownerDocument.body) {
13046        return Promise.reject('');
13047    }
13048
13049    ownerDocument.body.appendChild(cloneIframeContainer);
13050
13051    return Promise.resolve(cloneIframeContainer);
13052};
13053
13054var iframeLoader = function iframeLoader(cloneIframeContainer) {
13055    var cloneWindow = cloneIframeContainer.contentWindow;
13056    var documentClone = cloneWindow.document;
13057
13058    return new Promise(function (resolve, reject) {
13059        cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () {
13060            var interval = setInterval(function () {
13061                if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
13062                    clearInterval(interval);
13063                    resolve(cloneIframeContainer);
13064                }
13065            }, 50);
13066        };
13067    });
13068};
13069
13070var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) {
13071    var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer);
13072    var scrollX = ownerDocument.defaultView.pageXOffset;
13073    var scrollY = ownerDocument.defaultView.pageYOffset;
13074
13075    return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) {
13076        var cloneWindow = cloneIframeContainer.contentWindow;
13077        var documentClone = cloneWindow.document;
13078
13079        /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
13080             if window url is about:blank, we can assign the url to current by writing onto the document
13081             */
13082
13083        var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
13084            cloner.scrolledElements.forEach(initNode);
13085            cloneWindow.scrollTo(bounds.left, bounds.top);
13086            if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== bounds.top || cloneWindow.scrollX !== bounds.left)) {
13087                documentClone.documentElement.style.top = -bounds.top + 'px';
13088                documentClone.documentElement.style.left = -bounds.left + 'px';
13089                documentClone.documentElement.style.position = 'absolute';
13090            }
13091
13092            var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]);
13093
13094            var onclone = options.onclone;
13095
13096            return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () {
13097                return onclone(documentClone);
13098            }).then(function () {
13099                return result;
13100            }) : result : Promise.reject('');
13101        });
13102
13103        documentClone.open();
13104        documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
13105        // Chrome scrolls the parent document for some reason after the write to the cloned window???
13106        restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY);
13107        documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);
13108        documentClone.close();
13109
13110        return iframeLoad;
13111    });
13112};
13113
13114var serializeDoctype = function serializeDoctype(doctype) {
13115    var str = '';
13116    if (doctype) {
13117        str += '<!DOCTYPE ';
13118        if (doctype.name) {
13119            str += doctype.name;
13120        }
13121
13122        if (doctype.internalSubset) {
13123            str += doctype.internalSubset;
13124        }
13125
13126        if (doctype.publicId) {
13127            str += '"' + doctype.publicId + '"';
13128        }
13129
13130        if (doctype.systemId) {
13131            str += '"' + doctype.systemId + '"';
13132        }
13133
13134        str += '>';
13135    }
13136
13137    return str;
13138};
13139});
13140
13141unwrapExports(Clone);
13142var Clone_1 = Clone.cloneWindow;
13143var Clone_2 = Clone.DocumentCloner;
13144
13145var Window = createCommonjsModule(function (module, exports) {
13146Object.defineProperty(exports, "__esModule", {
13147    value: true
13148});
13149exports.renderElement = undefined;
13150
13151var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
13152
13153
13154
13155var _Logger2 = _interopRequireDefault(Logger_1);
13156
13157
13158
13159
13160
13161var _Renderer2 = _interopRequireDefault(Renderer_1);
13162
13163
13164
13165var _ForeignObjectRenderer2 = _interopRequireDefault(ForeignObjectRenderer_1);
13166
13167
13168
13169var _Feature2 = _interopRequireDefault(Feature);
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179var _Color2 = _interopRequireDefault(Color_1);
13180
13181function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13182
13183var renderElement = exports.renderElement = function renderElement(element, options, logger) {
13184    var ownerDocument = element.ownerDocument;
13185
13186    var windowBounds = new Bounds_1.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
13187
13188    // http://www.w3.org/TR/css3-background/#special-backgrounds
13189    var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : Color_1.TRANSPARENT;
13190    var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : Color_1.TRANSPARENT;
13191
13192    var backgroundColor = element === ownerDocument.documentElement ? documentBackgroun
13192dColor.isTransparent() ? bodyBackgroundColor.isTransparent() ? options.backgroundColor ? new _Color2.default(options.backgroundColor) : null : bodyBackgroundColor : documentBackgroundColor : options.backgroundColor ? new _Color2.default(options.backgroundColor) : null;
13193
13194    return (options.foreignObjectRendering ? // $FlowFixMe
13195    _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
13196        return supportForeignObject ? function (cloner) {
13197            return cloner.inlineFonts(ownerDocument).then(function () {
13198                return cloner.resourceLoader.ready();
13199            }).then(function () {
13200                var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
13201
13202                var defaultView = ownerDocument.defaultView;
13203                var scrollX = defaultView.pageXOffset;
13204                var scrollY = defaultView.pageYOffset;
13205
13206                var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
13207
13208                var _ref = isDocument ? (0, Bounds_1.parseDocumentSize)(ownerDocument) : (0, Bounds_1.parseBounds)(element, scrollX, scrollY),
13209                    width = _ref.width,
13210                    height = _ref.height,
13211                    left = _ref.left,
13212                    top = _ref.top;
13213
13214                return renderer.render({
13215                    backgroundColor: backgroundColor,
13216                    logger: logger,
13217                    scale: options.scale,
13218                    x: typeof options.x === 'number' ? options.x : left,
13219                    y: typeof options.y === 'number' ? options.y : top,
13220                    width: typeof options.width === 'number' ? options.width : Math.ceil(width),
13221                    height: typeof options.height === 'number' ? options.height : Math.ceil(height),
13222                    windowWidth: options.windowWidth,
13223                    windowHeight: options.windowHeight,
13224                    scrollX: options.scrollX,
13225                    scrollY: options.scrollY
13226                });
13227            });
13228        }(new Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) {
13229            var _ref3 = _slicedToArray(_ref2, 3),
13230                container = _ref3[0],
13231                clonedElement = _ref3[1],
13232                resourceLoader = _ref3[2];
13233
13234            var stack = (0, NodeParser_1.NodeParser)(clonedElement, resourceLoader, logger);
13235            var clonedDocument = clonedElement.ownerDocument;
13236
13237            if (backgroundColor === stack.container.style.background.backgroundColor) {
13238                stack.container.style.background.backgroundColor = Color_1.TRANSPARENT;
13239            }
13240
13241            return resourceLoader.ready().then(function (imageStore) {
13242                var fontMetrics = new Font.FontMetrics(clonedDocument);
13243                var defaultView = clonedDocument.defaultView;
13244                var scrollX = defaultView.pageXOffset;
13245                var scrollY = defaultView.pageYOffset;
13246
13247                var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY';
13248
13249                var _ref4 = isDocument ? (0, Bounds_1.parseDocumentSize)(ownerDocument) : (0, Bounds_1.parseBounds)(clonedElement, scrollX, scrollY),
13250                    width = _ref4.width,
13251                    height = _ref4.height,
13252                    left = _ref4.left,
13253                    top = _ref4.top;
13254
13255                var renderOptions = {
13256                    backgroundColor: backgroundColor,
13257                    fontMetrics: fontMetrics,
13258                    imageStore: imageStore,
13259                    logger: logger,
13260                    scale: options.scale,
13261                    x: typeof options.x === 'number' ? options.x : left,
13262                    y: typeof options.y === 'number' ? options.y : top,
13263                    width: typeof options.width === 'number' ? options.width : Math.ceil(width),
13264                    height: typeof options.height === 'number' ? options.height : Math.
13264ceil(height)
13265                };
13266
13267                if (Array.isArray(options.target)) {
13268                    return Promise.all(options.target.map(function (target) {
13269                        var renderer = new _Renderer2.default(target, renderOptions);
13270                        return renderer.render(stack);
13271                    }));
13272                } else {
13273                    var renderer = new _Renderer2.default(options.target, renderOptions);
13274                    var canvas = renderer.render(stack);
13275                    if (options.removeContainer === true) {
13276                        if (container.parentNode) {
13277                            container.parentNode.removeChild(container);
13278                        } else {}
13279                    }
13280
13281                    return canvas;
13282                }
13283            });
13284        });
13285    });
13286};
13287});
13288
13289unwrapExports(Window);
13290var Window_1 = Window.renderElement;
13291
13292var npm = createCommonjsModule(function (module) {
13293var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
13294
13295
13296
13297var _CanvasRenderer2 = _interopRequireDefault(CanvasRenderer_1);
13298
13299
13300
13301var _Logger2 = _interopRequireDefault(Logger_1);
13302
13303
13304
13305function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13306
13307var html2canvas = function html2canvas(element, conf) {
13308    var config = conf || {};
13309    var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
13310    logger.log('html2canvas ' + "$npm_package_version");
13311
13312    var ownerDocument = element.ownerDocument;
13313    if (!ownerDocument) {
13314        return Promise.reject('Provided element is not within a Document');
13315    }
13316    var defaultView = ownerDocument.defaultView;
13317
13318    var defaultOptions = {
13319        async: true,
13320        allowTaint: false,
13321        backgroundColor: '#ffffff',
13322        imageTimeout: 15000,
13323        logging: true,
13324        proxy: null,
13325        removeContainer: true,
13326        foreignObjectRendering: false,
13327        scale: defaultView.devicePixelRatio || 1,
13328        target: new _CanvasRenderer2.default(config.canvas),
13329        useCORS: false,
13330        windowWidth: defaultView.innerWidth,
13331        windowHeight: defaultView.innerHeight,
13332        scrollX: defaultView.pageXOffset,
13333        scrollY: defaultView.pageYOffset
13334    };
13335
13336    var result = (0, Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
13337
13338    return result;
13339};
13340
13341html2canvas.CanvasRenderer = _CanvasRenderer2.default;
13342
13343module.exports = html2canvas;
13344});
13345
13346var html2canvas$1 = unwrapExports(npm);
13347
13348var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
13349  return typeof obj;
13350} : function (obj) {
13351  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
13352};
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374var _extends = Object.assign || function (target) {
13375  for (var i = 1; i < arguments.length; i++) {
13376    var source = arguments[i];
13377
13378    for (var key in source) {
13379      if (Object.prototype.hasOwnProperty.call(source, key)) {
13380        target[key] = source[key];
13381      }
13382    }
13383  }
13384
13385  return target;
13386};
13387
13388// Determine the type of a variable/object.
13389var objType = function objType(obj) {
13390  var type = typeof obj === 'undefined' ? 'undefined' : _typeof(obj);
13391  if (type === 'undefined') return 'undefined';else if (type === 'string' || obj instanceof String) return 'string';else if (type === 'number' || obj instanceof Number) return 'number';else if (type === 'function' || obj instanceof Function) return 'function';else if (!!obj && obj.constructor === Array) return 'array';else if (obj && obj.nodeType === 1) return 'element';else if (type === 'object') return 'object';else return 'unknown';
13392};
13393
13394// Create an HTML element with optional className, innerHTML, and style.
13395var createElement = function createElement(tagName, opt) {
13396  var el = document.createElement(tagName);
13397  if (opt.className) el.className = opt.className;
13398  if (opt.innerHTML) {
13399    el.innerHTML = opt.innerHTML;
13400    var scripts = el.getElementsByTagName('script');
13401    for (var i = scripts.length; i-- > 0; null) {
13402      scripts[i].parentNode.removeChild(scripts[i]);
13403    }
13404  }
13405  for (var key in opt.style) {
13406    el.style[key] = opt.style[key];
13407  }
13408  return el;
13409};
13410
13411// Deep-clone a node and preserve contents/properties.
13412var cloneNode = function cloneNode(node, javascriptEnabled) {
13413  // Recursively clone the node.
13414  var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);
13415  for (var child = node.firstChild; child; child = child.nextSibling) {
13416    if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') {
13417      clone.appendChild(cloneNode(child, javascriptEnabled));
13418    }
13419  }
13420
13421  if (node.nodeType === 1) {
13422    // Preserve contents/properties of special nodes.
13423    if (node.nodeName === 'CANVAS') {
13424      clone.width = node.width;
13425      clone.height = node.height;
13426      clone.getContext('2d').drawImage(node, 0, 0);
13427    } else if (node.nodeName === 'TEXTAREA' || node.nodeName === 'SELECT') {
13428      clone.value = node.value;
13429    }
13430
13431    // Preserve the node's scroll position when it loads.
13432    clone.addEventListener('load', function () {
13433      clone.scrollTop = node.scrollTop;
13434      clone.scrollLeft = node.scrollLeft;
13435    }, true);
13436  }
13437
13438  // Return the cloned node.
13439  return clone;
13440};
13441
13442// Convert units from px using the conversion value 'k' from jsPDF.
13443var unitConvert = function unitConvert(obj, k) {
13444  if (objType(obj) === 'number') {
13445    return obj * 72 / 96 / k;
13446  } else {
13447    var newObj = {};
13448    for (var key in obj) {
13449      newObj[key] = obj[key] * 72 / 96 / k;
13450    }
13451    return newObj;
13452  }
13453};
13454
13455// Convert units to px using the conversion value 'k' from jsPDF.
13456var toPx = function toPx(val, k) {
13457  return Math.floor(val * k / 72 * 96);
13458};
13459
13460var es6Promise = createCommonjsModule(function (module, exports) {
13461/*!
13462 * @overview es6-promise - a tiny implementation of Promises/A+.
13463 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
13464 * @license   Licensed under MIT license
13465 *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
13466 * @version   v4.2.5+7f2b526d
13467 */
13468
13469(function (global, factory) {
13470	module.exports = factory();
13471}(commonjsGlobal, (function () { function objectOrFunction(x) {
13472  var type = typeof x;
13473  return x !== null && (type === 'object' || type === 'function');
13474}
13475
13476function isFunction(x) {
13477  return typeof x === 'function';
13478}
13479
13480
13481
13482var _isArray = void 0;
13483if (Array.isArray) {
13484  _isArray = Array.isArray;
13485} else {
13486  _isArray = function (x) {
13487    return Object.prototype.toString.call(x) === '[object Array]';
13488  };
13489}
13490
13491var isArray = _isArray;
13492
13493var len = 0;
13494var vertxNext = void 0;
13495var customSchedulerFn = void 0;
13496
13497var asap = function asap(callback, arg) {
13498  queue[len] = callback;
13499  queue[len + 1] = arg;
13500  len += 2;
13501  if (len === 2) {
13502    // If len is 2, that means that we need to schedule an async flush.
13503    // If additional callbacks are queued before the queue is flushed, they
13504    // will be processed by this flush that we are scheduling.
13505    if (customSchedulerFn) {
13506      customSchedulerFn(flush);
13507    } else {
13508      scheduleFlush();
13509    }
13510  }
13511};
13512
13513function setScheduler(scheduleFn) {
13514  customSchedulerFn = scheduleFn;
13515}
13516
13517function setAsap(asapFn) {
13518  asap = asapFn;
13519}
13520
13521var browserWindow = typeof window !== 'undefined' ? window : undefined;
13522var browserGlobal = browserWindow || {};
13523var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
13524var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
13525
13526// test for web worker but not in IE10
13527var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
13528
13529// node
13530function useNextTick() {
13531  // node version 0.10.x displays a deprecation warning when nextTick is used recursively
13532  // see https://github.com/cujojs/when/issues/410 for details
13533  return function () {
13534    return process.nextTick(flush);
13535  };
13536}
13537
13538// vertx
13539function useVertxTimer() {
13540  if (typeof vertxNext !== 'undefined') {
13541    return function () {
13542      vertxNext(flush);
13543    };
13544  }
13545
13546  return useSetTimeout();
13547}
13548
13549function useMutationObserver() {
13550  var iterations = 0;
13551  var observer = new BrowserMutationObserver(flush);
13552  var node = document.createTextNode('');
13553  observer.observe(node, { characterData: true });
13554
13555  return function () {
13556    node.data = iterations = ++iterations % 2;
13557  };
13558}
13559
13560// web worker
13561function useMessageChannel() {
13562  var channel = new MessageChannel();
13563  channel.port1.onmessage = flush;
13564  return function () {
13565    return channel.port2.postMessage(0);
13566  };
13567}
13568
13569function useSetTimeout() {
13570  // Store setTimeout reference so es6-promise will be unaffected by
13571  // other code modifying setTimeout (like sinon.useFakeTimers())
13572  var globalSetTimeout = setTimeout;
13573  return function () {
13574    return globalSetTimeout(flush, 1);
13575  };
13576}
13577
13578var queue = new Array(1000);
13579function flush() {
13580  for (var i = 0; i < len; i += 2) {
13581    var callback = queue[i];
13582    var arg = queue[i + 1];
13583
13584    callback(arg);
13585
13586    queue[i] = undefined;
13587    queue[i + 1] = undefined;
13588  }
13589
13590  len = 0;
13591}
13592
13593function attemptVertx() {
13594  try {
13595    var vertx = Function('return this')().require('vertx');
13596    vertxNext = vertx.runOnLoop || vertx.runOnContext;
13597    return useVertxTimer();
13598  } catch (e) {
13599    return useSetTimeout();
13600  }
13601}
13602
13603var scheduleFlush = void 0;
13604// Decide what async method to use to triggering processing of queued callbacks:
13605if (isNode) {
13606  scheduleFlush = useNextTick();
13607} else if (BrowserMutationObserver) {
13608  scheduleFlush = useMutationObserver();
13609} else if (isWorker) {
13610  scheduleFlush = useMessageChannel();
13611} else if (browserWindow === undefined && typeof commonjsRequire
vendor: 8,702 bytes, lines 13611-13992
13611 === 'function') {
13612  scheduleFlush = attemptVertx();
13613} else {
13614  scheduleFlush = useSetTimeout();
13615}
13616
13617function then(onFulfillment, onRejection) {
13618  var parent = this;
13619
13620  var child = new this.constructor(noop);
13621
13622  if (child[PROMISE_ID] === undefined) {
13623    makePromise(child);
13624  }
13625
13626  var _state = parent._state;
13627
13628
13629  if (_state) {
13630    var callback = arguments[_state - 1];
13631    asap(function () {
13632      return invokeCallback(_state, child, callback, parent._result);
13633    });
13634  } else {
13635    subscribe(parent, child, onFulfillment, onRejection);
13636  }
13637
13638  return child;
13639}
13640
13641/**
13642  `Promise.resolve` returns a promise that will become resolved with the
13643  passed `value`. It is shorthand for the following:
13644
13645  ```javascript
13646  let promise = new Promise(function(resolve, reject){
13647    resolve(1);
13648  });
13649
13650  promise.then(function(value){
13651    // value === 1
13652  });
13653  ```
13654
13655  Instead of writing the above, your code now simply becomes the following:
13656
13657  ```javascript
13658  let promise = Promise.resolve(1);
13659
13660  promise.then(function(value){
13661    // value === 1
13662  });
13663  ```
13664
13665  @method resolve
13666  @static
13667  @param {Any} value value that the returned promise will be resolved with
13668  Useful for tooling.
13669  @return {Promise} a promise that will become fulfilled with the given
13670  `value`
13671*/
13672function resolve$1(object) {
13673  /*jshint validthis:true */
13674  var Constructor = this;
13675
13676  if (object && typeof object === 'object' && object.constructor === Constructor) {
13677    return object;
13678  }
13679
13680  var promise = new Constructor(noop);
13681  resolve(promise, object);
13682  return promise;
13683}
13684
13685var PROMISE_ID = Math.random().toString(36).substring(2);
13686
13687function noop() {}
13688
13689var PENDING = void 0;
13690var FULFILLED = 1;
13691var REJECTED = 2;
13692
13693var TRY_CATCH_ERROR = { error: null };
13694
13695function selfFulfillment() {
13696  return new TypeError("You cannot resolve a promise with itself");
13697}
13698
13699function cannotReturnOwn() {
13700  return new TypeError('A promises callback cannot return that same promise.');
13701}
13702
13703function getThen(promise) {
13704  try {
13705    return promise.then;
13706  } catch (error) {
13707    TRY_CATCH_ERROR.error = error;
13708    return TRY_CATCH_ERROR;
13709  }
13710}
13711
13712function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
13713  try {
13714    then$$1.call(value, fulfillmentHandler, rejectionHandler);
13715  } catch (e) {
13716    return e;
13717  }
13718}
13719
13720function handleForeignThenable(promise, thenable, then$$1) {
13721  asap(function (promise) {
13722    var sealed = false;
13723    var error = tryThen(then$$1, thenable, function (value) {
13724      if (sealed) {
13725        return;
13726      }
13727      sealed = true;
13728      if (thenable !== value) {
13729        resolve(promise, value);
13730      } else {
13731        fulfill(promise, value);
13732      }
13733    }, function (reason) {
13734      if (sealed) {
13735        return;
13736      }
13737      sealed = true;
13738
13739      reject(promise, reason);
13740    }, 'Settle: ' + (promise._label || ' unknown promise'));
13741
13742    if (!sealed && error) {
13743      sealed = true;
13744      reject(promise, error);
13745    }
13746  }, promise);
13747}
13748
13749function handleOwnThenable(promise, thenable) {
13750  if (thenable._state === FULFILLED) {
13751    fulfill(promise, thenable._result);
13752  } else if (thenable._state === REJECTED) {
13753    reject(promise, thenable._result);
13754  } else {
13755    subscribe(thenable, undefined, function (value) {
13756      return resolve(promise, value);
13757    }, function (reason) {
13758      return reject(promise, reason);
13759    });
13760  }
13761}
13762
13763function handleMaybeThenable(promise, maybeThenable, then$$1) {
13764  if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
13765    handleOwnThenable(promise, maybeThenable);
13766  } else {
13767    if (then$$1 === TRY_CATCH_ERROR) {
13768      reject(promise, TRY_CATCH_ERROR.error);
13769      TRY_CATCH_ERROR.error = null;
13770    } else if (then$$1 === undefined) {
13771      fulfill(promise, maybeThenable);
13772    } else if (isFunction(then$$1)) {
13773      handleForeignThenable(promise, maybeThenable, then$$1);
13774    } else {
13775      fulfill(promise, maybeThenable);
13776    }
13777  }
13778}
13779
13780function resolve(promise, value) {
13781  if (promise === value) {
13782    reject(promise, selfFulfillment());
13783  } else if (objectOrFunction(value)) {
13784    handleMaybeThenable(promise, value, getThen(value));
13785  } else {
13786    fulfill(promise, value);
13787  }
13788}
13789
13790function publishRejection(promise) {
13791  if (promise._onerror) {
13792    promise._onerror(promise._result);
13793  }
13794
13795  publish(promise);
13796}
13797
13798function fulfill(promise, value) {
13799  if (promise._state !== PENDING) {
13800    return;
13801  }
13802
13803  promise._result = value;
13804  promise._state = FULFILLED;
13805
13806  if (promise._subscribers.length !== 0) {
13807    asap(publish, promise);
13808  }
13809}
13810
13811function reject(promise, reason) {
13812  if (promise._state !== PENDING) {
13813    return;
13814  }
13815  promise._state = REJECTED;
13816  promise._result = reason;
13817
13818  asap(publishRejection, promise);
13819}
13820
13821function subscribe(parent, child, onFulfillment, onRejection) {
13822  var _subscribers = parent._subscribers;
13823  var length = _subscribers.length;
13824
13825
13826  parent._onerror = null;
13827
13828  _subscribers[length] = child;
13829  _subscribers[length + FULFILLED] = onFulfillment;
13830  _subscribers[length + REJECTED] = onRejection;
13831
13832  if (length === 0 && parent._state) {
13833    asap(publish, parent);
13834  }
13835}
13836
13837function publish(promise) {
13838  var subscribers = promise._subscribers;
13839  var settled = promise._state;
13840
13841  if (subscribers.length === 0) {
13842    return;
13843  }
13844
13845  var child = void 0,
13846      callback = void 0,
13847      detail = promise._result;
13848
13849  for (var i = 0; i < subscribers.length; i += 3) {
13850    child = subscribers[i];
13851    callback = subscribers[i + settled];
13852
13853    if (child) {
13854      invokeCallback(settled, child, callback, detail);
13855    } else {
13856      callback(detail);
13857    }
13858  }
13859
13860  promise._subscribers.length = 0;
13861}
13862
13863function tryCatch(callback, detail) {
13864  try {
13865    return callback(detail);
13866  } catch (e) {
13867    TRY_CATCH_ERROR.error = e;
13868    return TRY_CATCH_ERROR;
13869  }
13870}
13871
13872function invokeCallback(settled, promise, callback, detail) {
13873  var hasCallback = isFunction(callback),
13874      value = void 0,
13875      error = void 0,
13876      succeeded = void 0,
13877      failed = void 0;
13878
13879  if (hasCallback) {
13880    value = tryCatch(callback, detail);
13881
13882    if (value === TRY_CATCH_ERROR) {
13883      failed = true;
13884      error = value.error;
13885      value.error = null;
13886    } else {
13887      succeeded = true;
13888    }
13889
13890    if (promise === value) {
13891      reject(promise, cannotReturnOwn());
13892      return;
13893    }
13894  } else {
13895    value = detail;
13896    succeeded = true;
13897  }
13898
13899  if (promise._state !== PENDING) {
13900    // noop
13901  } else if (hasCallback && succeeded) {
13902    resolve(promise, value);
13903  } else if (failed) {
13904    reject(promise, error);
13905  } else if (settled === FULFILLED) {
13906    fulfill(promise, value);
13907  } else if (settled === REJECTED) {
13908    reject(promise, value);
13909  }
13910}
13911
13912function initializePromise(promise, resolver) {
13913  try {
13914    resolver(function resolvePromise(value) {
13915      resolve(promise, value);
13916    }, function rejectPromise(reason) {
13917      reject(promise, reason);
13918    });
13919  } catch (e) {
13920    reject(promise, e);
13921  }
13922}
13923
13924var id = 0;
13925function nextId() {
13926  return id++;
13927}
13928
13929function makePromise(promise) {
13930  promise[PROMISE_ID] = id++;
13931  promise._state = undefined;
13932  promise._result = undefined;
13933  promise._subscribers = [];
13934}
13935
13936function validationError() {
13937  return new Error('Array Methods must be provided an Array');
13938}
13939
13940var Enumerator = function () {
13941  function Enumerator(Constructor, input) {
13942    this._instanceConstructor = Constructor;
13943    this.promise = new Constructor(noop);
13944
13945    if (!this.promise[PROMISE_ID]) {
13946      makePromise(this.promise);
13947    }
13948
13949    if (isArray(input)) {
13950      this.length = input.length;
13951      this._remaining = input.length;
13952
13953      this._result = new Array(this.length);
13954
13955      if (this.length === 0) {
13956        fulfill(this.promise, this._result);
13957      } else {
13958        this.length = this.length || 0;
13959        this._enumerate(input);
13960        if (this._remaining === 0) {
13961          fulfill(this.promise, this._result);
13962        }
13963      }
13964    } else {
13965      reject(this.promise, validationError());
13966    }
13967  }
13968
13969  Enumerator.prototype._enumerate = function _enumerate(input) {
13970    for (var i = 0; this._state === PENDING && i < input.length; i++) {
13971      this._eachEntry(input[i], i);
13972    }
13973  };
13974
13975  Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
13976    var c = this._instanceConstructor;
13977    var resolve$$1 = c.resolve;
13978
13979
13980    if (resolve$$1 === resolve$1) {
13981      var _then = getThen(entry);
13982
13983      if (_then === then && entry._state !== PENDING) {
13984        this._settledAt(entry._state, i, entry._result);
13985      } else if (typeof _then !== 'function') {
13986        this._remaining--;
13987        this._result[i] = entry;
13988      } else if (c === Promise$1) {
13989        var promise = new c(noop);
13990        handleMaybeThenable(promise, entry, _then);
13991        this._willSettleAt(promise, i);
13992      } else {
vendor: 15,768 bytes, lines 13993-14599
13993        this._willSettleAt(new c(function (resolve$$1) {
13994          return resolve$$1(entry);
13995        }), i);
13996      }
13997    } else {
13998      this._willSettleAt(resolve$$1(entry), i);
13999    }
14000  };
14001
14002  Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
14003    var promise = this.promise;
14004
14005
14006    if (promise._state === PENDING) {
14007      this._remaining--;
14008
14009      if (state === REJECTED) {
14010        reject(promise, value);
14011      } else {
14012        this._result[i] = value;
14013      }
14014    }
14015
14016    if (this._remaining === 0) {
14017      fulfill(promise, this._result);
14018    }
14019  };
14020
14021  Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
14022    var enumerator = this;
14023
14024    subscribe(promise, undefined, function (value) {
14025      return enumerator._settledAt(FULFILLED, i, value);
14026    }, function (reason) {
14027      return enumerator._settledAt(REJECTED, i, reason);
14028    });
14029  };
14030
14031  return Enumerator;
14032}();
14033
14034/**
14035  `Promise.all` accepts an array of promises, and returns a new promise which
14036  is fulfilled with an array of fulfillment values for the passed promises, or
14037  rejected with the reason of the first passed promise to be rejected. It casts all
14038  elements of the passed iterable to promises as it runs this algorithm.
14039
14040  Example:
14041
14042  ```javascript
14043  let promise1 = resolve(1);
14044  let promise2 = resolve(2);
14045  let promise3 = resolve(3);
14046  let promises = [ promise1, promise2, promise3 ];
14047
14048  Promise.all(promises).then(function(array){
14049    // The array here would be [ 1, 2, 3 ];
14050  });
14051  ```
14052
14053  If any of the `promises` given to `all` are rejected, the first promise
14054  that is rejected will be given as an argument to the returned promises's
14055  rejection handler. For example:
14056
14057  Example:
14058
14059  ```javascript
14060  let promise1 = resolve(1);
14061  let promise2 = reject(new Error("2"));
14062  let promise3 = reject(new Error("3"));
14063  let promises = [ promise1, promise2, promise3 ];
14064
14065  Promise.all(promises).then(function(array){
14066    // Code here never runs because there are rejected promises!
14067  }, function(error) {
14068    // error.message === "2"
14069  });
14070  ```
14071
14072  @method all
14073  @static
14074  @param {Array} entries array of promises
14075  @param {String} label optional string for labeling the promise.
14076  Useful for tooling.
14077  @return {Promise} promise that is fulfilled when all `promises` have been
14078  fulfilled, or rejected if any of them become rejected.
14079  @static
14080*/
14081function all(entries) {
14082  return new Enumerator(this, entries).promise;
14083}
14084
14085/**
14086  `Promise.race` returns a new promise which is settled in the same way as the
14087  first passed promise to settle.
14088
14089  Example:
14090
14091  ```javascript
14092  let promise1 = new Promise(function(resolve, reject){
14093    setTimeout(function(){
14094      resolve('promise 1');
14095    }, 200);
14096  });
14097
14098  let promise2 = new Promise(function(resolve, reject){
14099    setTimeout(function(){
14100      resolve('promise 2');
14101    }, 100);
14102  });
14103
14104  Promise.race([promise1, promise2]).then(function(result){
14105    // result === 'promise 2' because it was resolved before promise1
14106    // was resolved.
14107  });
14108  ```
14109
14110  `Promise.race` is deterministic in that only the state of the first
14111  settled promise matters. For example, even if other promises given to the
14112  `promises` array argument are resolved, but the first settled promise has
14113  become rejected before the other promises became fulfilled, the returned
14114  promise will become rejected:
14115
14116  ```javascript
14117  let promise1 = new Promise(function(resolve, reject){
14118    setTimeout(function(){
14119      resolve('promise 1');
14120    }, 200);
14121  });
14122
14123  let promise2 = new Promise(function(resolve, reject){
14124    setTimeout(function(){
14125      reject(new Error('promise 2'));
14126    }, 100);
14127  });
14128
14129  Promise.race([promise1, promise2]).then(function(result){
14130    // Code here never runs
14131  }, function(reason){
14132    // reason.message === 'promise 2' because promise 2 became rejected before
14133    // promise 1 became fulfilled
14134  });
14135  ```
14136
14137  An example real-world use case is implementing timeouts:
14138
14139  ```javascript
14140  Promise.race([ajax('foo.json'), timeout(5000)])
14141  ```
14142
14143  @method race
14144  @static
14145  @param {Array} promises array of promises to observe
14146  Useful for tooling.
14147  @return {Promise} a promise which settles in the same way as the first passed
14148  promise to settle.
14149*/
14150function race(entries) {
14151  /*jshint validthis:true */
14152  var Constructor = this;
14153
14154  if (!isArray(entries)) {
14155    return new Constructor(function (_, reject) {
14156      return reject(new TypeError('You must pass an array to race.'));
14157    });
14158  } else {
14159    return new Constructor(function (resolve, reject) {
14160      var length = entries.length;
14161      for (var i = 0; i < length; i++) {
14162        Constructor.resolve(entries[i]).then(resolve, reject);
14163      }
14164    });
14165  }
14166}
14167
14168/**
14169  `Promise.reject` returns a promise rejected with the passed `reason`.
14170  It is shorthand for the following:
14171
14172  ```javascript
14173  let promise = new Promise(function(resolve, reject){
14174    reject(new Error('WHOOPS'));
14175  });
14176
14177  promise.then(function(value){
14178    // Code here doesn't run because the promise is rejected!
14179  }, function(reason){
14180    // reason.message === 'WHOOPS'
14181  });
14182  ```
14183
14184  Instead of writing the above, your code now simply becomes the following:
14185
14186  ```javascript
14187  let promise = Promise.reject(new Error('WHOOPS'));
14188
14189  promise.then(function(value){
14190    // Code here doesn't run because the promise is rejected!
14191  }, function(reason){
14192    // reason.message === 'WHOOPS'
14193  });
14194  ```
14195
14196  @method reject
14197  @static
14198  @param {Any} reason value that the returned promise will be rejected with.
14199  Useful for tooling.
14200  @return {Promise} a promise rejected with the given `reason`.
14201*/
14202function reject$1(reason) {
14203  /*jshint validthis:true */
14204  var Constructor = this;
14205  var promise = new Constructor(noop);
14206  reject(promise, reason);
14207  return promise;
14208}
14209
14210function needsResolver() {
14211  throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
14212}
14213
14214function needsNew() {
14215  throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
14216}
14217
14218/**
14219  Promise objects represent the eventual result of an asynchronous operation. The
14220  primary way of interacting with a promise is through its `then` method, which
14221  registers callbacks to receive either a promise's eventual value or the reason
14222  why the promise cannot be fulfilled.
14223
14224  Terminology
14225  -----------
14226
14227  - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
14228  - `thenable` is an object or function that defines a `then` method.
14229  - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
14230  - `exception` is a value that is thrown using the throw statement.
14231  - `reason` is a value that indicates why a promise was rejected.
14232  - `settled` the final resting state of a promise, fulfilled or rejected.
14233
14234  A promise can be in one of three states: pending, fulfilled, or rejected.
14235
14236  Promises that are fulfilled have a fulfillment value and are in the fulfilled
14237  state.  Promises that are rejected have a rejection reason and are in the
14238  rejected state.  A fulfillment value is never a thenable.
14239
14240  Promises can also be said to *resolve* a value.  If this value is also a
14241  promise, then the original promise's settled state will match the value's
14242  settled state.  So a promise that *resolves* a promise that rejects will
14243  itself reject, and a promise that *resolves* a promise that fulfills will
14244  itself fulfill.
14245
14246
14247  Basic Usage:
14248  ------------
14249
14250  ```js
14251  let promise = new Promise(function(resolve, reject) {
14252    // on success
14253    resolve(value);
14254
14255    // on failure
14256    reject(reason);
14257  });
14258
14259  promise.then(function(value) {
14260    // on fulfillment
14261  }, function(reason) {
14262    // on rejection
14263  });
14264  ```
14265
14266  Advanced Usage:
14267  ---------------
14268
14269  Promises shine when abstracting away asynchronous interactions such as
14270  `XMLHttpRequest`s.
14271
14272  ```js
14273  function getJSON(url) {
14274    return new Promise(function(resolve, reject){
14275      let xhr = new XMLHttpRequest();
14276
14277      xhr.open('GET', url);
14278      xhr.onreadystatechange = handler;
14279      xhr.responseType = 'json';
14280      xhr.setRequestHeader('Accept', 'application/json');
14281      xhr.send();
14282
14283      function handler() {
14284        if (this.readyState === this.DONE) {
14285          if (this.status === 200) {
14286            resolve(this.response);
14287          } else {
14288            reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
14289          }
14290        }
14291      };
14292    });
14293  }
14294
14295  getJSON('/posts.json').then(function(json) {
14296    // on fulfillment
14297  }, function(reason) {
14298    // on rejection
14299  });
14300  ```
14301
14302  Unlike callbacks, promises are great composable primitives.
14303
14304  ```js
14305  Promise.all([
14306    getJSON('/posts'),
14307    getJSON('/comments')
14308  ]).then(function(values){
14309    values[0] // => postsJSON
14310    values[1] // => commentsJSON
14311
14312    return values;
14313  });
14314  ```
14315
14316  @class Promise
14317  @param {Function} resolver
14318  Useful for tooling.
14319  @constructor
14320*/
14321
14322var Promise$1 = function () {
14323  function Promise(resolver) {
14324    this[PROMISE_ID] = nextId();
14325    this._result = this._state = undefined;
14326    this._subscribers = [];
14327
14328    if (noop !== resolver) {
14329      typeof resolver !== 'function' && needsResolver();
14330      this instanceof Promise ? initializePromise(this, resolver) : needsNew();
14331    }
14332  }
14333
14334  /**
14335  The primary way of interacting with a promise is through its `then` method,
14336  which registers callbacks to receive either a promise's eventual value or the
14337  reason why the promise cannot be fulfilled.
14338   ```js
14339  findUser().then(function(user){
14340    // user is available
14341  }, function(reason){
14342    // user is unavailable, and you are given the reason why
14343  });
14344  ```
14345   Chaining
14346  --------
14347   The return value of `then` is itself a promise.  This second, 'downstream'
14348  promise is resolved with the return value of the first promise's fulfillment
14349  or rejection handler, or rejected if the handler throws an exception.
14350   ```js
14351  findUser().then(function (user) {
14352    return user.name;
14353  }, function (reason) {
14354    return 'default name';
14355  }).then(function (userName) {
14356    // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
14357    // will be `'default name'`
14358  });
14359   findUser().then(function (user) {
14360    throw new Error('Found user, but still unhappy');
14361  }, function (reason) {
14362    throw new Error('`findUser` rejected and we're unhappy');
14363  }).then(function (value) {
14364    // never reached
14365  }, function (reason) {
14366    // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
14367    // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
14368  });
14369  ```
14370  If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
14371   ```js
14372  findUser().then(function (user) {
14373    throw new PedagogicalException('Upstream error');
14374  }).then(function (value) {
14375    // never reached
14376  }).then(function (value) {
14377    // never reached
14378  }, function (reason) {
14379    // The `PedgagocialException` is propagated all the way down to here
14380  });
14381  ```
14382   Assimilation
14383  ------------
14384   Sometimes the value you want to propagate to a downstream promise can only be
14385  retrieved asynchronously. This can be achieved by returning a promise in the
14386  fulfillment or rejection handler. The downstream promise will then be pending
14387  until the returned promise is settled. This is called *assimilation*.
14388   ```js
14389  findUser().then(function (user) {
14390    return findCommentsByAuthor(user);
14391  }).then(function (comments) {
14392    // The user's comments are now available
14393  });
14394  ```
14395   If the assimliated promise rejects, then the downstream promise will also reject.
14396   ```js
14397  findUser().then(function (user) {
14398    return findCommentsByAuthor(user);
14399  }).then(function (comments) {
14400    // If `findCommentsByAuthor` fulfills, we'll have the value here
14401  }, function (reason) {
14402    // If `findCommentsByAuthor` rejects, we'll have the reason here
14403  });
14404  ```
14405   Simple Example
14406  --------------
14407   Synchronous Example
14408   ```javascript
14409  let result;
14410   try {
14411    result = findResult();
14412    // success
14413  } catch(reason) {
14414    // failure
14415  }
14416  ```
14417   Errback Example
14418   ```js
14419  findResult(function(result, err){
14420    if (err) {
14421      // failure
14422    } else {
14423      // success
14424    }
14425  });
14426  ```
14427   Promise Example;
14428   ```javascript
14429  findResult().then(function(result){
14430    // success
14431  }, function(reason){
14432    // failure
14433  });
14434  ```
14435   Advanced Example
14436  --------------
14437   Synchronous Example
14438   ```javascript
14439  let author, books;
14440   try {
14441    author = findAuthor();
14442    books  = findBooksByAuthor(author);
14443    // success
14444  } catch(reason) {
14445    // failure
14446  }
14447  ```
14448   Errback Example
14449   ```js
14450   function foundBooks(books) {
14451   }
14452   function failure(reason) {
14453   }
14454   findAuthor(function(author, err){
14455    if (err) {
14456      failure(err);
14457      // failure
14458    } else {
14459      try {
14460        findBoooksByAuthor(author, function(books, err) {
14461          if (err) {
14462            failure(err);
14463          } else {
14464            try {
14465              foundBooks(books);
14466            } catch(reason) {
14467              failure(reason);
14468            }
14469          }
14470        });
14471      } catch(error) {
14472        failure(err);
14473      }
14474      // success
14475    }
14476  });
14477  ```
14478   Promise Example;
14479   ```javascript
14480  findAuthor().
14481    then(findBooksByAuthor).
14482    then(function(books){
14483      // found books
14484  }).catch(function(reason){
14485    // something went wrong
14486  });
14487  ```
14488   @method then
14489  @param {Function} onFulfilled
14490  @param {Function} onRejected
14491  Useful for tooling.
14492  @return {Promise}
14493  */
14494
14495  /**
14496  `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
14497  as the catch block of a try/catch statement.
14498  ```js
14499  function findAuthor(){
14500  throw new Error('couldn't find that author');
14501  }
14502  // synchronous
14503  try {
14504  findAuthor();
14505  } catch(reason) {
14506  // something went wrong
14507  }
14508  // async with promises
14509  findAuthor().catch(function(reason){
14510  // something went wrong
14511  });
14512  ```
14513  @method catch
14514  @param {Function} onRejection
14515  Useful for tooling.
14516  @return {Promise}
14517  */
14518
14519
14520  Promise.prototype.catch = function _catch(onRejection) {
14521    return this.then(null, onRejection);
14522  };
14523
14524  /**
14525    `finally` will be invoked regardless of the promise's fate just as native
14526    try/catch/finally behaves
14527  
14528    Synchronous example:
14529  
14530    ```js
14531    findAuthor() {
14532      if (Math.random() > 0.5) {
14533        throw new Error();
14534      }
14535      return new Author();
14536    }
14537  
14538    try {
14539      return findAuthor(); // succeed or fail
14540    } catch(error) {
14541      return findOtherAuther();
14542    } finally {
14543      // always runs
14544      // doesn't affect the return value
14545    }
14546    ```
14547  
14548    Asynchronous example:
14549  
14550    ```js
14551    findAuthor().catch(function(reason){
14552      return findOtherAuther();
14553    }).finally(function(){
14554      // author was either found, or not
14555    });
14556    ```
14557  
14558    @method finally
14559    @param {Function} callback
14560    @return {Promise}
14561  */
14562
14563
14564  Promise.prototype.finally = function _finally(callback) {
14565    var promise = this;
14566    var constructor = promise.constructor;
14567
14568    if (isFunction(callback)) {
14569      return promise.then(function (value) {
14570        return constructor.resolve(callback()).then(function () {
14571          return value;
14572        });
14573      }, function (reason) {
14574        return constructor.resolve(callback()).then(function () {
14575          throw reason;
14576        });
14577      });
14578    }
14579
14580    return promise.then(callback, callback);
14581  };
14582
14583  return Promise;
14584}();
14585
14586Promise$1.prototype.then = then;
14587Promise$1.all = all;
14588Promise$1.race = race;
14589Promise$1.resolve = resolve$1;
14590Promise$1.reject = reject$1;
14591Promise$1._setScheduler = setScheduler;
14592Promise$1._setAsap = setAsap;
14593Promise$1._asap = asap;
14594
14595/*global self*/
14596function polyfill() {
14597  var local = void 0;
14598
14599  if (typeof 
vendor: 748 bytes, lines 14599-14641
14599commonjsGlobal !== 'undefined') {
14600    local = commonjsGlobal;
14601  } else if (typeof self !== 'undefined') {
14602    local = self;
14603  } else {
14604    try {
14605      local = Function('return this')();
14606    } catch (e) {
14607      throw new Error('polyfill failed because global object is unavailable in this environment');
14608    }
14609  }
14610
14611  var P = local.Promise;
14612
14613  if (P) {
14614    var promiseToString = null;
14615    try {
14616      promiseToString = Object.prototype.toString.call(P.resolve());
14617    } catch (e) {
14618      // silently ignored
14619    }
14620
14621    if (promiseToString === '[object Promise]' && !P.cast) {
14622      return;
14623    }
14624  }
14625
14626  local.Promise = Promise$1;
14627}
14628
14629// Strange compat..
14630Promise$1.polyfill = polyfill;
14631Promise$1.Promise = Promise$1;
14632
14633return Promise$1;
14634
14635})));
14636
14637
14638
14639
14640});
14641
vendor: 10,711 bytes, lines 14642-14979
14642var Promise$1 = es6Promise.Promise;
14643
14644/* ----- CONSTRUCTOR ----- */
14645
14646var Worker = function Worker(opt) {
14647  // Create the root parent for the proto chain, and the starting Worker.
14648  var root = _extends(Worker.convert(Promise$1.resolve()), JSON.parse(JSON.stringify(Worker.template)));
14649  var self = Worker.convert(Promise$1.resolve(), root);
14650
14651  // Set progress, optional settings, and return.
14652  self = self.setProgress(1, Worker, 1, [Worker]);
14653  self = self.set(opt);
14654  return self;
14655};
14656
14657// Boilerplate for subclassing Promise.
14658Worker.prototype = Object.create(Promise$1.prototype);
14659Worker.prototype.constructor = Worker;
14660
14661// Converts/casts promises into Workers.
14662Worker.convert = function convert(promise, inherit) {
14663  // Uses prototypal inheritance to receive changes made to ancestors' properties.
14664  promise.__proto__ = inherit || Worker.prototype;
14665  return promise;
14666};
14667
14668Worker.template = {
14669  prop: {
14670    src: null,
14671    container: null,
14672    overlay: null,
14673    canvas: null,
14674    img: null,
14675    pdf: null,
14676    pageSize: null
14677  },
14678  progress: {
14679    val: 0,
14680    state: null,
14681    n: 0,
14682    stack: []
14683  },
14684  opt: {
14685    filename: 'file.pdf',
14686    margin: [0, 0, 0, 0],
14687    image: { type: 'jpeg', quality: 0.95 },
14688    enableLinks: true,
14689    html2canvas: {},
14690    jsPDF: {}
14691  }
14692};
14693
14694/* ----- FROM / TO ----- */
14695
14696Worker.prototype.from = function from(src, type) {
14697  function getType(src) {
14698    switch (objType(src)) {
14699      case 'string':
14700        return 'string';
14701      case 'element':
14702        return src.nodeName.toLowerCase === 'canvas' ? 'canvas' : 'element';
14703      default:
14704        return 'unknown';
14705    }
14706  }
14707
14708  return this.then(function from_main() {
14709    type = type || getType(src);
14710    switch (type) {
14711      case 'string':
14712        return this.set({ src: createElement('div', { innerHTML: src }) });
14713      case 'element':
14714        return this.set({ src: src });
14715      case 'canvas':
14716        return this.set({ canvas: src });
14717      case 'img':
14718        return this.set({ img: src });
14719      default:
14720        return this.error('Unknown source type.');
14721    }
14722  });
14723};
14724
14725Worker.prototype.to = function to(target) {
14726  // Route the 'to' request to the appropriate method.
14727  switch (target) {
14728    case 'container':
14729      return this.toContainer();
14730    case 'canvas':
14731      return this.toCanvas();
14732    case 'img':
14733      return this.toImg();
14734    case 'pdf':
14735      return this.toPdf();
14736    default:
14737      return this.error('Invalid target.');
14738  }
14739};
14740
14741Worker.prototype.toContainer = function toContainer() {
14742  // Set up function prerequisites.
14743  var prereqs = [function checkSrc() {
14744    return this.prop.src || this.error('Cannot duplicate - no source HTML.');
14745  }, function checkPageSize() {
14746    return this.prop.pageSize || this.setPageSize();
14747  }];
14748
14749  return this.thenList(prereqs).then(function toContainer_main() {
14750    // Define the CSS styles for the container and its overlay parent.
14751    var overlayCSS = {
14752      position: 'fixed', overflow: 'hidden', zIndex: 1000,
14753      left: 0, right: 0, bottom: 0, top: 0,
14754      backgroundColor: 'rgba(0,0,0,0.8)'
14755    };
14756    var containerCSS = {
14757      position: 'absolute', width: this.prop.pageSize.inner.width + this.prop.pageSize.unit,
14758      left: 0, right: 0, top: 0, height: 'auto', margin: 'auto',
14759      backgroundColor: 'white'
14760    };
14761
14762    // Set the overlay to hidden (could be changed in the future to provide a print preview).
14763    overlayCSS.opacity = 0;
14764
14765    // Create and attach the elements.
14766    var source = cloneNode(this.prop.src, this.opt.html2canvas.javascriptEnabled);
14767    this.prop.overlay = createElement('div', { className: 'html2pdf__overlay', style: overlayCSS });
14768    this.prop.container = createElement('div', { className: 'html2pdf__container', style: containerCSS });
14769    this.prop.container.appendChild(source);
14770    this.prop.overlay.appendChild(this.prop.container);
14771    document.body.appendChild(this.prop.overlay);
14772  });
14773};
14774
14775Worker.prototype.toCanvas = function toCanvas() {
14776  // Set up function prerequisites.
14777  var prereqs = [function checkContainer() {
14778    return document.body.contains(this.prop.container) || this.toContainer();
14779  }];
14780
14781  // Fulfill prereqs then create the canvas.
14782  return this.thenList(prereqs).then(function toCanvas_main() {
14783    // Handle old-fashioned 'onrendered' argument.
14784    var options = _extends({}, this.opt.html2canvas);
14785    delete options.onrendered;
14786
14787    return html2canvas$1(this.prop.container, options);
14788  }).then(function toCanvas_post(canvas) {
14789    // Handle old-fashioned 'onrendered' argument.
14790    var onRendered = this.opt.html2canvas.onrendered || function () {};
14791    onRendered(canvas);
14792
14793    this.prop.canvas = canvas;
14794    document.body.removeChild(this.prop.overlay);
14795  });
14796};
14797
14798Worker.prototype.toImg = function toImg() {
14799  // Set up function prerequisites.
14800  var prereqs = [function checkCanvas() {
14801    return this.prop.canvas || this.toCanvas();
14802  }];
14803
14804  // Fulfill prereqs then create the image.
14805  return this.thenList(prereqs).then(function toImg_main() {
14806    var imgData = this.prop.canvas.toDataURL('image/' + this.opt.image.type, this.opt.image.quality);
14807    this.prop.img = document.createElement('img');
14808    this.prop.img.src = imgData;
14809  });
14810};
14811
14812Worker.prototype.toPdf = function toPdf() {
14813  // Set up function prerequisites.
14814  var prereqs = [function checkCanvas() {
14815    return this.prop.canvas || this.toCanvas();
14816  }];
14817
14818  // Fulfill prereqs then create the image.
14819  return this.thenList(prereqs).then(function toPdf_main() {
14820    // Create local copies of frequently used properties.
14821    var canvas = this.prop.canvas;
14822    var opt = this.opt;
14823
14824    // Calculate the number of pages.
14825    var pxFullHeight = canvas.height;
14826    var pxPageHeight = Math.floor(canvas.width * this.prop.pageSize.inner.ratio);
14827    var nPages = Math.ceil(pxFullHeight / pxPageHeight);
14828
14829    // Define pageHeight separately so it can be trimmed on the final page.
14830    var pageHeight = this.prop.pageSize.inner.height;
14831
14832    // Create a one-page canvas to split up the full image.
14833    var pageCanvas = document.createElement('canvas');
14834    var pageCtx = pageCanvas.getContext('2d');
14835    pageCanvas.width = canvas.width;
14836    pageCanvas.height = pxPageHeight;
14837
14838    // Initialize the PDF.
14839    this.prop.pdf = this.prop.pdf || new jspdf_min(opt.jsPDF);
14840
14841    for (var page = 0; page < nPages; page++) {
14842      // Trim the final page to reduce file size.
14843      if (page === nPages - 1 && pxFullHeight % pxPageHeight !== 0) {
14844        pageCanvas.height = pxFullHeight % pxPageHeight;
14845        pageHeight = pageCanvas.height * this.prop.pageSize.inner.width / pageCanvas.width;
14846      }
14847
14848      // Display the page.
14849      var w = pageCanvas.width;
14850      var h = pageCanvas.height;
14851      pageCtx.fillStyle = 'white';
14852      pageCtx.fillRect(0, 0, w, h);
14853      pageCtx.drawImage(canvas, 0, page * pxPageHeight, w, h, 0, 0, w, h);
14854
14855      // Add the page to the PDF.
14856      if (page) this.prop.pdf.addPage();
14857      var imgData = pageCanvas.toDataURL('image/' + opt.image.type, opt.image.quality);
14858      this.prop.pdf.addImage(imgData, opt.image.type, opt.margin[1], opt.margin[0], this.prop.pageSize.inner.width, pageHeight);
14859    }
14860  });
14861};
14862
14863/* ----- OUTPUT / SAVE ----- */
14864
14865Worker.prototype.output = function output(type, options, src) {
14866  // Redirect requests to the correct function (outputPdf / outputImg).
14867  src = src || 'pdf';
14868  if (src.toLowerCase() === 'img' || src.toLowerCase() === 'image') {
14869    return this.outputImg(type, options);
14870  } else {
14871    return this.outputPdf(type, options);
14872  }
14873};
14874
14875Worker.prototype.outputPdf = function outputPdf(type, options) {
14876  // Set up function prerequisites.
14877  var prereqs = [function checkPdf() {
14878    return this.prop.pdf || this.toPdf();
14879  }];
14880
14881  // Fulfill prereqs then perform the appropriate output.
14882  return this.thenList(prereqs).then(function outputPdf_main() {
14883    /* Currently implemented output types:
14884     *    https://rawgit.com/MrRio/jsPDF/master/docs/jspdf.js.html#line992
14885     *  save(options), arraybuffer, blob, bloburi/bloburl,
14886     *  datauristring/dataurlstring, dataurlnewwindow, datauri/dataurl
14887     */
14888    return this.prop.pdf.output(type, options);
14889  });
14890};
14891
14892Worker.prototype.outputImg = function outputImg(type, options) {
14893  // Set up function prerequisites.
14894  var prereqs = [function checkImg() {
14895    return this.prop.img || this.toImg();
14896  }];
14897
14898  // Fulfill prereqs then perform the appropriate output.
14899  return this.thenList(prereqs).then(function outputImg_main() {
14900    switch (type) {
14901      case undefined:
14902      case 'img':
14903        return this.prop.img;
14904      case 'datauristring':
14905      case 'dataurlstring':
14906        return this.prop.img.src;
14907      case 'datauri':
14908      case 'dataurl':
14909        return document.location.href = this.prop.img.src;
14910      default:
14911        throw 'Image output type "' + type + '" is not supported.';
14912    }
14913  });
14914};
14915
14916Worker.prototype.save = function save(filename) {
14917  // Set up function prerequisites.
14918  var prereqs = [function checkPdf() {
14919    return this.prop.pdf || this.toPdf();
14920  }];
14921
14922  // Fulfill prereqs, update the filename (if provided), and save the PDF.
14923  return this.thenList(prereqs).set(filename ? { filename: filename } : null).then(function save_main() {
14924    this.prop.pdf.save(this.opt.filename);
14925  });
14926};
14927
14928/* ----- SET / GET ----- */
14929
14930Worker.prototype.set = function set$$1(opt) {
14931  // TODO: Implement ordered pairs?
14932
14933  // Silently ignore invalid or empty input.
14934  if (objType(opt) !== 'object') {
14935    return this;
14936  }
14937
14938  // Build an array of setter functions to queue.
14939  var fns = Object.keys(opt || {}).map(function (key) {
14940    if (key in Worker.template.prop) {
14941      // Set pre-defined properties.
14942      return function set_prop() {
14943        this.prop[key] = opt[key];
14944      };
14945    } else {
14946      switch (key) {
14947        case 'margin':
14948          return this.setMargin.bind(this, opt.margin);
14949        case 'jsPDF':
14950          return function set_jsPDF() {
14951            this.opt.jsPDF = opt.jsPDF;return this.setPageSize();
14952          };
14953        case 'pageSize':
14954          return this.setPageSize.bind(this, opt.pageSize);
14955        default:
14956          // Set any other properties in opt.
14957          return function set_opt() {
14958            this.opt[key] = opt[key];
14959          };
14960      }
14961    }
14962  }, this);
14963
14964  // Set properties within the promise chain.
14965  return this.then(function set_main() {
14966    return this.thenList(fns);
14967  });
14968};
14969
14970Worker.prototype.get = function get$$1(key, cbk) {
14971  return this.then(function get_main() {
14972    // Fetch the requested property, either as a predefined prop or in opt.
14973    var val = key in Worker.template.prop ? this.prop[key] : this.opt[key];
14974    return cbk ? cbk(val) : val;
14975  });
14976};
14977
14978Worker.prototype.setMargin = function setMargin(margin) {
14979  return this.then(function setMargin_main() {
vendor: 1,750 bytes, lines 14980-15030
14980    // Parse the margin property: [top, left, bottom, right].
14981    switch (objType(margin)) {
14982      case 'number':
14983        margin = [margin, margin, margin, margin];
14984      case 'array':
14985        if (margin.length === 2) {
14986          margin = [margin[0], margin[1], margin[0], margin[1]];
14987        }
14988        if (margin.length === 4) {
14989          break;
14990        }
14991      default:
14992        return this.error('Invalid margin array.');
14993    }
14994
14995    // Set the margin property, then update pageSize.
14996    this.opt.margin = margin;
14997  }).then(this.setPageSize);
14998};
14999
15000Worker.prototype.setPageSize = function setPageSize(pageSize) {
15001  return this.then(function setPageSize_main() {
15002    // Retrieve page-size based on jsPDF settings, if not explicitly provided.
15003    pageSize = pageSize || jspdf_min.getPageSize(this.opt.jsPDF);
15004
15005    // Add 'inner' field if not present.
15006    if (!pageSize.hasOwnProperty('inner')) {
15007      pageSize.inner = {
15008        width: pageSize.width - this.opt.margin[1] - this.opt.margin[3],
15009        height: pageSize.height - this.opt.margin[0] - this.opt.margin[2]
15010      };
15011      pageSize.inner.px = {
15012        width: toPx(pageSize.inner.width, pageSize.k),
15013        height: toPx(pageSize.inner.height, pageSize.k)
15014      };
15015      pageSize.inner.ratio = pageSize.inner.height / pageSize.inner.width;
15016    }
15017
15018    // Attach pageSize to this.
15019    this.prop.pageSize = pageSize;
15020  });
15021};
15022
15023Worker.prototype.setProgress = function setProgress(val, state, n, stack) {
15024  // Immediately update all progress values.
15025  if (val != null) this.progress.val = val;
15026  if (state != null) this.progress.state = state;
15027  if (n != null) this.progress.n = n;
15028  if (stack != null) this.progress.stack = stack;
15029  this.progress.ratio = this.progress.val / this.progress.state;
15030
vendor: 8,736 bytes, lines 15031-15287
15031  // Return this for command chaining.
15032  return this;
15033};
15034
15035Worker.prototype.updateProgress = function updateProgress(val, state, n, stack) {
15036  // Immediately update all progress values, using setProgress.
15037  return this.setProgress(val ? this.progress.val + val : null, state ? state : null, n ? this.progress.n + n : null, stack ? this.progress.stack.concat(stack) : null);
15038};
15039
15040/* ----- PROMISE MAPPING ----- */
15041
15042Worker.prototype.then = function then(onFulfilled, onRejected) {
15043  // Wrap `this` for encapsulation.
15044  var self = this;
15045
15046  return this.thenCore(onFulfilled, onRejected, function then_main(onFulfilled, onRejected) {
15047    // Update progress while queuing, calling, and resolving `then`.
15048    self.updateProgress(null, null, 1, [onFulfilled]);
15049    return Promise$1.prototype.then.call(this, function then_pre(val) {
15050      self.updateProgress(null, onFulfilled);
15051      return val;
15052    }).then(onFulfilled, onRejected).then(function then_post(val) {
15053      self.updateProgress(1);
15054      return val;
15055    });
15056  });
15057};
15058
15059Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected, thenBase) {
15060  // Handle optional thenBase parameter.
15061  thenBase = thenBase || Promise$1.prototype.then;
15062
15063  // Wrap `this` for encapsulation and bind it to the promise handlers.
15064  var self = this;
15065  if (onFulfilled) {
15066    onFulfilled = onFulfilled.bind(self);
15067  }
15068  if (onRejected) {
15069    onRejected = onRejected.bind(self);
15070  }
15071
15072  // Cast self into a Promise to avoid polyfills recursively defining `then`.
15073  var isNative = Promise$1.toString().indexOf('[native code]') !== -1 && Promise$1.name === 'Promise';
15074  var selfPromise = isNative ? self : Worker.convert(_extends({}, self), Promise$1.prototype);
15075
15076  // Return the promise, after casting it into a Worker and preserving props.
15077  var returnVal = thenBase.call(selfPromise, onFulfilled, onRejected);
15078  return Worker.convert(returnVal, self.__proto__);
15079};
15080
15081Worker.prototype.thenExternal = function thenExternal(onFulfilled, onRejected) {
15082  // Call `then` and return a standard promise (exits the Worker chain).
15083  return Promise$1.prototype.then.call(this, onFulfilled, onRejected);
15084};
15085
15086Worker.prototype.thenList = function thenList(fns) {
15087  // Queue a series of promise 'factories' into the promise chain.
15088  var self = this;
15089  fns.forEach(function thenList_forEach(fn) {
15090    self = self.thenCore(fn);
15091  });
15092  return self;
15093};
15094
15095Worker.prototype['catch'] = function (onRejected) {
15096  // Bind `this` to the promise handler, call `catch`, and return a Worker.
15097  if (onRejected) {
15098    onRejected = onRejected.bind(this);
15099  }
15100  var returnVal = Promise$1.prototype['catch'].call(this, onRejected);
15101  return Worker.convert(returnVal, this);
15102};
15103
15104Worker.prototype.catchExternal = function catchExternal(onRejected) {
15105  // Call `catch` and return a standard promise (exits the Worker chain).
15106  return Promise$1.prototype['catch'].call(this, onRejected);
15107};
15108
15109Worker.prototype.error = function error(msg) {
15110  // Throw the error in the Promise chain.
15111  return this.then(function error_main() {
15112    throw new Error(msg);
15113  });
15114};
15115
15116/* ----- ALIASES ----- */
15117
15118Worker.prototype.using = Worker.prototype.set;
15119Worker.prototype.saveAs = Worker.prototype.save;
15120Worker.prototype.export = Worker.prototype.output;
15121Worker.prototype.run = Worker.prototype.then;
15122
15123// Import dependencies.
15124// Get dimensions of a PDF page, as determined by jsPDF.
15125jspdf_min.getPageSize = function (orientation, unit, format) {
15126  // Decode options object
15127  if ((typeof orientation === 'undefined' ? 'undefined' : _typeof(orientation)) === 'object') {
15128    var options = orientation;
15129    orientation = options.orientation;
15130    unit = options.unit || unit;
15131    format = options.format || format;
15132  }
15133
15134  // Default options
15135  unit = unit || 'mm';
15136  format = format || 'a4';
15137  orientation = ('' + (orientation || 'P')).toLowerCase();
15138  var format_as_string = ('' + format).toLowerCase();
15139
15140  // Size in pt of various paper formats
15141  var pageFormats = {
15142    'a0': [2383.94, 3370.39], 'a1': [1683.78, 2383.94],
15143    'a2': [1190.55, 1683.78], 'a3': [841.89, 1190.55],
15144    'a4': [595.28, 841.89], 'a5': [419.53, 595.28],
15145    'a6': [297.64, 419.53], 'a7': [209.76, 297.64],
15146    'a8': [147.40, 209.76], 'a9': [104.88, 147.40],
15147    'a10': [73.70, 104.88], 'b0': [2834.65, 4008.19],
15148    'b1': [2004.09, 2834.65], 'b2': [1417.32, 2004.09],
15149    'b3': [1000.63, 1417.32], 'b4': [708.66, 1000.63],
15150    'b5': [498.90, 708.66], 'b6': [354.33, 498.90],
15151    'b7': [249.45, 354.33], 'b8': [175.75, 249.45],
15152    'b9': [124.72, 175.75], 'b10': [87.87, 124.72],
15153    'c0': [2599.37, 3676.54], 'c1': [1836.85, 2599.37],
15154    'c2': [1298.27, 1836.85], 'c3': [918.43, 1298.27],
15155    'c4': [649.13, 918.43], 'c5': [459.21, 649.13],
15156    'c6': [323.15, 459.21], 'c7': [229.61, 323.15],
15157    'c8': [161.57, 229.61], 'c9': [113.39, 161.57],
15158    'c10': [79.37, 113.39], 'dl': [311.81, 623.62],
15159    'letter': [612, 792],
15160    'government-letter': [576, 756],
15161    'legal': [612, 1008],
15162    'junior-legal': [576, 360],
15163    'ledger': [1224, 792],
15164    'tabloid': [792, 1224],
15165    'credit-card': [153, 243]
15166  };
15167
15168  // Unit conversion
15169  switch (unit) {
15170    case 'pt':
15171      var k = 1;break;
15172    case 'mm':
15173      var k = 72 / 25.4;break;
15174    case 'cm':
15175      var k = 72 / 2.54;break;
15176    case 'in':
15177      var k = 72;break;
15178    case 'px':
15179      var k = 72 / 96;break;
15180    case 'pc':
15181      var k = 12;break;
15182    case 'em':
15183      var k = 12;break;
15184    case 'ex':
15185      var k = 6;break;
15186    default:
15187      throw 'Invalid unit: ' + unit;
15188  }
15189
15190  // Dimensions are stored as user units and converted to points on output
15191  if (pageFormats.hasOwnProperty(format_as_string)) {
15192    var pageHeight = pageFormats[format_as_string][1] / k;
15193    var pageWidth = pageFormats[format_as_string][0] / k;
15194  } else {
15195    try {
15196      var pageHeight = format[1];
15197      var pageWidth = format[0];
15198    } catch (err) {
15199      throw new Error('Invalid format: ' + format);
15200    }
15201  }
15202
15203  // Handle page orientation
15204  if (orientation === 'p' || orientation === 'portrait') {
15205    orientation = 'p';
15206    if (pageWidth > pageHeight) {
15207      var tmp = pageWidth;
15208      pageWidth = pageHeight;
15209      pageHeight = tmp;
15210    }
15211  } else if (orientation === 'l' || orientation === 'landscape') {
15212    orientation = 'l';
15213    if (pageHeight > pageWidth) {
15214      var tmp = pageWidth;
15215      pageWidth = pageHeight;
15216      pageHeight = tmp;
15217    }
15218  } else {
15219    throw 'Invalid orientation: ' + orientation;
15220  }
15221
15222  // Return information (k is the unit conversion ratio from pts)
15223  var info = { 'width': pageWidth, 'height': pageHeight, 'unit': unit, 'k': k };
15224  return info;
15225};
15226
15227/* Pagebreak plugin:
15228
15229    Adds page-break functionality to the html2pdf library. Page-breaks can be
15230    enabled by CSS styles, set on individual elements using selectors, or
15231    avoided from breaking inside all elements.
15232
15233    Options on the `opt.pagebreak` object:
15234
15235    mode:   String or array of strings: 'avoid-all', 'css', and/or 'legacy'
15236            Default: ['css', 'legacy']
15237
15238    before: String or array of CSS selectors for which to add page-breaks
15239            before each element. Can be a specific element with an ID
15240            ('#myID'), all elements of a type (e.g. 'img'), all of a class
15241            ('.myClass'), or even '*' to match every element.
15242
15243    after:  Like 'before', but adds a page-break immediately after the element.
15244
15245    avoid:  Like 'before', but avoids page-breaks on these elements. You can
15246            enable this feature on every element using the 'avoid-all' mode.
15247*/
15248
15249// Refs to original functions.
15250var orig = {
15251  toContainer: Worker.prototype.toContainer
15252};
15253
15254// Add pagebreak default options to the Worker template.
15255Worker.template.opt.pagebreak = {
15256  mode: ['css', 'legacy'],
15257  before: [],
15258  after: [],
15259  avoid: []
15260};
15261
15262Worker.prototype.toContainer = function toContainer() {
15263  return orig.toContainer.call(this).then(function toContainer_pagebreak() {
15264    // Setup root element and inner page height.
15265    var root = this.prop.container;
15266    var pxPageHeight = this.prop.pageSize.inner.px.height;
15267
15268    // Check all requested modes.
15269    var modeSrc = [].concat(this.opt.pagebreak.mode);
15270    var mode = {
15271      avoidAll: modeSrc.indexOf('avoid-all') !== -1,
15272      css: modeSrc.indexOf('css') !== -1,
15273      legacy: modeSrc.indexOf('legacy') !== -1
15274    };
15275
15276    // Get arrays of all explicitly requested elements.
15277    var select = {};
15278    var self = this;
15279    ['before', 'after', 'avoid'].forEach(function (key) {
15280      var all = mode.avoidAll && key === 'avoid';
15281      select[key] = all ? [] : [].concat(self.opt.pagebreak[key] || []);
15282      if (select[key].length > 0) {
15283        select[key] = Array.prototype.slice.call(root.querySelectorAll(select[key].join(', ')));
15284      }
15285    });
15286
15287    // Get all legacy page-break elements.
15288    var legacyEls = root.querySelectorAll('.html2pdf__page-break');
15289    legacyEls = Array.prototype.slice.call(legacyEls);
15290
15291    // Loop through all elements.
15292    var els = root.querySelectorAll('*');
15293    Array.prototype.forEach.call(els, function pagebreak_loop(el) {
15294      // Setup pagebreak rules based on legacy and avoidAll modes.
15295      var rules = {
15296        before: false,
15297        after: mode.legacy && legacyEls.indexOf(el) !== -1,
15298        avoid: mode.avoidAll
15299      };
15300
15301      // Add rules for css mode.
15302      if (mode.css) {
15303        // TODO: Check if this is valid with iFrames.
15304        var style = window.getComputedStyle(el);
15305        // TODO: Handle 'left' and 'right' correctly.
15306        // TODO: Add support for 'avoid' on breakBefore/After.
15307        var breakOpt = ['always', 'page', 'left', 'right'];
15308        var avoidOpt = ['avoid', 'avoid-page'];
15309        rules = {
15310          before: rules.before || breakOpt.indexOf(style.breakBefore || style.pageBreakBefore) !== -1,
15311          after: rules.after || breakOpt.indexOf(style.breakAfter || style.pageBreakAfter) !== -1,
15312          avoid: rules.avoid || avoidOpt.indexOf(style.breakInside || style.pageBreakInside) !== -1
15313        };
15314      }
15315
15316      // Add rules for explicit requests.
15317      Object.keys(rules).forEach(function (key) {
15318        rules[key] = rules[key] || select[key].indexOf(el) !== -1;
15319      });
15320
15321      // Get element position on the screen.
15322      // TODO: Subtract the top of the container from clientRect.top/bottom?
15323      var clientRect = el.getBoundingClientRect();
15324
15325      // Avoid: Check if a break happens mid-element.
15326      if (rules.avoid && !rules.before) {
15327        var startPage = Math.floor(clientRect.top / pxPageHeight);
15328        var endPage = Math.floor(clientRect.bottom / pxPageHeight);
15329        var nPages = Math.abs(clientRect.bottom - clientRect.top) / pxPageHeight;
15330
15331        // Turn on rules.before if the el is broken and is at most one page long.
15332        if (endPage !== startPage && nPages <= 1) {
15333          rules.before = true;
15334        }
15335      }
15336
15337      // Before: Create a padding div to push the element to the next page.
15338      if (rules.before) {
15339        var pad = createElement('div', { style: {
15340            display: 'block',
15341            height: pxPageHeight - clientRect.top % pxPageHeight + 'px'
15342          } });
15343        el.parentNode.insertBefore(pad, el);
15344      }
15345
15346      // After: Create a padding div to fill the remaining page.
15347      if (rules.after) {
15348        var pad = createElement('div', { style: {
15349            display: 'block',
15350            height: pxPageHeight - clientRect.bottom % pxPageHeight + 'px'
15351          } });
15352        el.parentNode.insertBefore(pad, el.nextSibling);
15353      }
15354    });
15355  });
15356};
15357
15358// Add hyperlink functionality to the PDF creation.
15359
15360// Main link array, and refs to original functions.
15361var linkInfo = [];
15362var orig$1 = {
15363  toContainer: Worker.prototype.toContainer,
15364  toPdf: Worker.prototype.toPdf
15365};
15366
15367Worker.prototype.toContainer = function toContainer() {
15368  return orig$1.toContainer.call(this).then(function toContainer_hyperlink() {
15369    // Retrieve hyperlink info if the option is enabled.
15370    if (this.opt.enableLinks) {
15371      // Find all anchor tags and get the container's bounds for reference.
15372      var container = this.prop.container;
15373      var links = container.querySelectorAll('a');
15374      var containerRect = unitConvert(container.getBoundingClientRect(), this.prop.pageSize.k);
15375      linkInfo = [];
15376
15377      // Loop through each anchor tag.
15378      Array.prototype.forEach.call(links, function (link) {
15379        // Treat each client rect as a separate link (for text-wrapping).
15380        var clientRects = link.getClientRects();
15381        for (var i = 0; i < clientRects.length; i++) {
15382          var clientRect = unitConvert(clientRects[i], this.prop.pageSize.k);
15383          clientRect.left -= containerRect.left;
15384          clientRect.top -= containerRect.top;
15385
15386          var page = Math.floor(clientRect.top / this.prop.pageSize.inner.height) + 1;
15387          var top = this.opt.margin[0] + clientRect.top % this.prop.pageSize.inner.height;
15388          var left = this.opt.margin[1] + clientRect.left;
15389
15390          linkInfo.push({ page: page, top: top, left: left, clientRect: clientRect, link: link });
15391        }
15392      }, this);
15393    }
15394  });
15395};
15396
15397Worker.prototype.toPdf = function toPdf() {
15398  return orig$1.toPdf.call(this).then(function toPdf_hyperlink() {
15399    // Add hyperlinks if the option is enabled.
15400    if (this.opt.enableLinks) {
15401      // Attach each anchor tag based on info from toContainer().
15402      linkInfo.forEach(function (l) {
15403        this.prop.pdf.setPage(l.page);
15404        this.prop.pdf.link(l.left, l.top, l.clientRect.width, l.clientRect.height, { url: l.link.href });
15405      }, this);
15406
15407      // Reset the active page of the PDF to the final page.
15408      var nPages = this.prop.pdf.internal.getNumberOfPages();
15409      this.prop.pdf.setPage(nPages);
15410    }
15411  });
15412};
15413
15414/**
15415 * Generate a PDF from an HTML element or string using html2canvas and jsPDF.
15416 *
15417 * @param {Element|string} source The source element or HTML string.
15418 * @param {Object=} opt An object of optional settings: 'margin', 'filename',
15419 *    'image' ('type' and 'quality'), and 'html2canvas' / 'jspdf', which are
15420 *    sent as settings to their corresponding functions.
15421 */
15422var html2pdf = function html2pdf(src, opt) {
15423  // Create a new worker with the given options.
15424  var worker = new html2pdf.Worker(opt);
15425
15426  if (src) {
15427    // If src is specified, perform the traditional 'simple' operation.
15428    return worker.from(src).save();
15429  } else {
15430    // Otherwise, return the worker for new Promise-based operation.
15431    return worker;
15432  }
15433};
15434html2pdf.Worker = Worker;
15435
15436return html2pdf;
15437
15438})));
15439
15440/*  search-fixheight  */
15441/**
15442 * Component searchEqualHeight
15443 * makes height of search results elements the same
15444 * @deprecated Latest Theme version use flexboxes.
15445 * @module searchEqualHeight
15446 * @param  {jQuery} $ Instance of jQuery
15447 * @return {Object} List of searchEqualHeight methods
15448 */
15449XA.component.searchEqualHeight = (function ($) {
15450    /**
15451    * List of selectors for calculating height functionality
15452    * @type {Object.<Methods>}
15453    * @memberOf module:searchEqualHeight
15454    */
15455    var settings = {
15456        parentSelector: '.search-results.components',
15457        selector: 'li'
15458    };
15459    /**
15460    * This object stores all public api methods
15461    * @type {Object.<Methods>}
15462    * @memberOf module:searchEqualHeight
15463    */
15464    var api = {};
15465    /**
15466    * fixHeight method calculates height of bigger element 
15467    * and sets up the same size for other elements
15468    * @memberOf module:searchEqualHeight
15469    * @alias module:searchEqualHeight.fixHeight
15470    */
15471    function fixHeight() {
15472
15473        $(settings.parentSelector).each(function () {
15474            var $elements = $(this).find(settings.selector),
15475                maxHeight = 0,
15476                maxPadding = 0;
15477
15478            $elements.each(function () {
15479                $(this).css('min-height', 'inherit');
15480
15481                if ($(this).height() > maxHeight) {
15482                    maxHeight = $(this).outerHeight(true);
15483                }
15484
15485            });
15486
15487            if (maxHeight > 0) {
15488                $elements.css({
15489                    'padding-bottom': maxPadding,
15490                    'min-height': maxHeight
15491                });
15492            }
15493        });
15494    }
15495    /**
15496    * init method binds call of 
15497    * ["fixHeight"]{@link module:searchEqualHeight.fixHeight} method
15498    * for window load and resize events
15499    * @memberOf module:searchEqualHeight
15500    * @alias module:searchEqualHeight.init
15501     */
15502    api.init = function () {
15503        //Latest Theme version use flexboxes.
15504        //If you don`t want use flex, you must 
15505        //uncomment code below
15506
15507        /* $(document).ready(function() {
15508             setTimeout(fixHeight, 0);
15509         });
15510 
15511         $(window).bind('resize', function() {
15512             fixHeight();
15513         });
15514         */
15515    };
15516    return api;
15517}(jQuery, document));
15518
15519XA.register("searchEqualHeight", XA.component.searchEqualHeight);
15520
15521/*  accessibility  */
15522/**
15523 * Component accessibility
15524 * makes content more accessible to people with disabilities.
15525 * @module Accessibility
15526 * @param  {jQuery} $ Instance of jQuery
15527 */
15528XA.component.accessibility = (function ($) {
15529    /**
15530    * This object stores all public api methods
15531    * @type {Object.<Methods>}
15532    * @memberOf module:Accessibility
15533    * */
15534    var api = {};
15535    /**
15536        * getAllIndexedElement - returns elements that have tab index attribute
15537        * @returns {jQuery<DOMElement>} elements that have tab index attribute
15538    */
15539    var getAllIndexedElement = function () {
15540        return $("body").find("[tabindex]");
15541    };
15542
15543    /**
15544        * activateFirstElement - activate first element on a page that have tab index attribute
15545        * active element
15546        * @returns {String} component name 
15547    */
15548    api.activateFirstElement = function () {
15549        api.indexedElements.eq(0).attr("tabindex", "0");
15550    };
15551    /**
15552       * getComponentName - helper that provides component name based on 
15553       * active element
15554       * @returns {String} component name 
15555   */
15556    var getComponentName = function () {
15557        var $activeElement = $(document.activeElement),
15558            currComponent = $activeElement.closest(".initialized"),
15559            componentName = currComponent.length
15560                ? currComponent.attr("class").split(" ")[1]
15561                : "";
15562        return componentName;
15563    };
15564    /**
15565        * getWrapper - helper that provides wrapper element for
15566        * active element
15567        * @param {String} selector selector of parent wrapper
15568        * @returns {jQuery<DOMElement>} 
15569    */
15570    var getWrapper = function (selector) {
15571        var $activeElement = $(document.activeElement);
15572        return $activeElement.closest(selector);
15573    };
15574
15575    /**
15576        * activateTab - helper for Tabs component
15577    */
15578    var activateTab = function (direction, currTab) {
15579        var activatedTab = currTab;
15580        if (direction == "left" && currTab.prev()) {
15581            currTab.attr("tabindex", "-1");
15582            activatedTab = currTab.prev();
15583        } else if (direction == "right" && currTab.next()) {
15584            currTab.attr("tabindex", "-1");
15585            activatedTab = currTab.next();
15586        }
15587        activatedTab
15588            .attr("tabindex", "0")
15589            .trigger("click")
15590            .focus();
15591    };
15592
15593    /**
15594     * activateItem - helper for Accordion component
15595    */
15596    var activateItem = function (direction, currItem, event) {
15597        var itemWrapper = currItem.closest("li.item"),
15598            activatedTab = currItem,
15599            nextItem = itemWrapper.next(),
15600            prevItem = itemWrapper.prev();
15601        if (direction == "down" && nextItem.length) {
15602            event.preventDefault();
15603            currItem.attr("tabindex", "-1");
15604            activatedTab = nextItem;
15605            
15606        } else if (direction == "up" && prevItem.length) {
15607            event.preventDefault();
15608            currItem.attr("tabindex", "-1");
15609            activatedTab = prevItem;
15610        }
15611        activatedTab
15612            .find(".toggle-header")
15613            .attr("tabindex", "0")
15614            .focus();
15615    };
15616
15617    /**
15618     * toggleFlip - helper for Flip component
15619    */
15620    var toggleFlip = function (currItem) {
15621        var nextItem = currItem.next().length ? currItem.next() : currItem.prev();
15622        currItem.attr("tabindex", "-1");
15623        nextItem
15624            .trigger("click")
15625            .attr("tabindex", "0")
15626            .focus();
15627    };
15628
15629    /**
15630     * componentLogic - object that contains list of components as a object key
15631     * and function with logic that make this component WCAG friendly
15632     * @type {Object}
15633     */
15634    var componentLogic = {
15635        tabs: function (keyCode) {
15636            var currTab = getWrapper("li.active");
15637            if (currTab) {
15638                if (keyCode == api.keys.right) {
15639                    activateTab("right", currTab);
15640                } else if (keyCode == api.keys.left) {
15641                    activateTab("left", currTab);
15642                }
15643            }
15644        },
15645        accordion: function (keyCode, isShiftPressed, event) {
15646            var currItem = getWrapper("div.toggle-header");
15647            if (currItem) {
15648                if (keyCode == api.keys.down) {
15649                    activateItem("down", currItem, event);
15650                } else if (keyCode == api.keys.up) {
15651                    activateItem("up", currItem, event);
15652                } else if (!isShiftPressed && keyCode == api.keys.tab) {
15653                    activateItem("down", currItem, event);
15654                } else if (isShiftPressed && keyCode == api.keys.tab){
15655                    activateItem("up", currItem, event);
15656                }
15657            }
15658        },
15659        flip: function (keyCode) {
15660            var currItem = getWrapper("[class*='Side']");
15661            if (currItem) {
15662                if (keyCode == api.keys.right || keyCode == api.keys.left) {
15663                    toggleFlip(currItem);
15664                }
15665            }
15666        }
15667    };
15668    /**
15669    * bindEvents method get component name by calling 
15670    * ["getComponentName"]{@link module:Accessibility.getComponentName} method and running apropriate to
15671    * component logic
15672    * @memberOf module:Accessibility
15673    * @param {number} keycode keycode of pressed button on keyboard
15674    * @alias module:Accessibility.bindEvents
15675    * @private
15676    * */
15677    var bindEvents = function (keyCode, isShiftPressed, event) {
15678        var component = getComponentName();
15679        if (componentLogic[component]) {
15680            componentLogic[component](keyCode, isShiftPressed, event);
15681        }
15682    };
15683
15684    /**
15685    * This object stores keycode of keyboard buttons
15686    * @type {Object}
15687    * @memberOf module:Accessibility 
15688    * @alias module:Accessibility.keys
15689    * */
15690    api.keys = {
15691        end: 35,
15692        home: 36,
15693        left: 37,
15694        up: 38,
15695        right: 39,
15696        down: 40,
15697        delete: 46,
15698        enter: 13,
15699        space: 32,
15700        tab: 9
15701    };
15702    /**
15703         * indexedElements variable take list of all Indexed Element on a page by calling
15704         * ["getAllIndexedElement"]{@link module:Accessibility.getAllIndexedElement} method
15705         * @memberOf module:Accessibility
15706         * @param {Object} properties list of properties for accordion component
15707         * @alias module:Accessibility.indexedElements
15708    */
15709    api.indexedElements = getAllIndexedElement();
15710    /**
15711     * watchEvents method bind keyup event on document and on each trigger calls
15712     * ["bindEvents"]{@link module:Accessibility.bindEvents}
15713     * @memberOf module:Accessibility
15714     * @alias module:Accessibility.watchEvents
15715     */
15716    api.watchEvents = function () {
15717        $(document).on("keydown", function (event) {
15718            var keyCode = event.keyCode,
15719                isShiftPressed = event.shiftKey;
15720            bindEvents(keyCode, isShiftPressed, event);
15721        });
15722    };
15723    /**
15724    * registerLogic method register accessability logic to
15725    * ["componentLogic"]{@link module:Accessibility.componentLogic} list
15726    * @memberOf module:Accessibility
15727    * @param {string} componentName name of component which logic should be registered
15728    * @param {Function} componentFunc function for component that will be triggered for accessability support
15729    * @alias module:Accessibility.registerLogic
15730    */
15731    api.registerLogic = function (componentName, componentFunc) {
15732        componentLogic[componentName] = componentFunc;
15733    }
15734    /**
15735    * unregisterLogic method delete accessability logic from
15736    * ["unregisterLogic"]{@link module:Accessibility.unregisterLogic} list
15737    * @memberOf module:Accessibility
15738    * @param {string} componentName name of component which logic should be deleted
15739    * @alias module:Accessibility.unregisterLogic
15740    */
15741    api.unregisterLogic = function (componentName) {
15742        delete componentLogic[componentName]
15743    }
15744    /**
15745    * getRegisteredLogic method return list of accessability logic
15746    * ["unregisterLogic"]{@link module:Accessibility.unregisterLogic} list
15747    * @memberOf module:Accessibility
15748    * @returns {Object} list of registered components and their logic
15749    * @alias module:Accessibility.getRegisteredLogic
15750    */
15751    api.getRegisteredLogic = function () {
15752        return componentLogic
15753    }
15754    /**
15755        * initInstance method call
15756        * ["watchEvents"]{@link module:Accessibility.watchEvents} method
15757        * and call
15758        * ["activateFirstElement"]{@link module:Accessibility.activateFirstElement}
15759        * @memberOf module:Accessibility
15760        * @method
15761        * @alias module:Accessibility.initInstance
15762        */
15763    api.initInstance = function () {
15764        api.watchEvents();
15765        api.activateFirstElement();
15766    };
15767    /**
15768     * init method calls 
15769     * [".initInstance"]{@link module:Accessibility.initInstance} method.
15770     * @memberOf module:Accessibility
15771     * @alias module:Accessibility.init
15772     */
15773    api.init = function () {
15774        api.initInstance();
15775    };
15776
15777    return api;
15778})(jQuery, document);
15779
15780XA.register("accessibility", XA.component.accessibility);
15781
15782
15783/*  component-accordions  */
15784/* global _:true */
15785/**
15786 * Component Accordion
15787 * @module Accordion
15788 * @param  {jQuery} $ Instance of jQuery
15789 * @return {Object} List of accordion methods
15790 */
15791XA.component.accordions = (function($) {
15792    /**
15793     * This object stores all public api methods
15794     * @type {Object.<Methods>}
15795     * @memberOf module:Accordion
15796     * */
15797    var api = {};
15798    /**
15799     * toogleEvents list of toggle events
15800     * @memberOf module:Accordion
15801     * @private
15802     */
15803    var toogleEvents = {
15804        focus: function() {
15805            $(this).addClass("show");
15806        },
15807        blur: function() {
15808            $(this).removeClass("show");
15809        }
15810    };
15811    /**
15812     * headerBackground method set up background image for toggle-header
15813     * @memberOf module:Accordion
15814     * @param {DomElement} header toggle-header DOM element of accordion component
15815     * @alias module:Accordion.headerBackground
15816     * @private
15817     */
15818    function headerBackground(header) {
15819        var backgroundIcon = $(header),
15820            background = $(header).find("img"),
15821            backgroundSrc = background.attr("src");
15822
15823        if (backgroundSrc) {
15824            backgroundIcon.parents(".accordion").addClass("accordion-image");
15825
15826            backgroundIcon.css({
15827                background: "url(" + backgroundSrc + ")",
15828                "background-repeat": "no-repeat",
15829                "background-size": "cover",
15830                "background-position": "50% 100%"
15831            });
15832
15833            background.hide();
15834        }
15835    }
15836    /**
15837     * calcSlideSize method calculate and set up width of accordion items
15838     * @memberOf module:Accordion
15839     * @param {DomElement} acc Root Dom element of accordion component
15840     * @alias module:Accordion.calcSlideSize
15841     * @private
15842     */
15843    function calcSlideSize(acc) {
15844        var accordionWidth = $(acc).width(),
15845            accordionItems = $(acc).find(".item"),
15846            maxHeight = 0;
15847
15848        _.each(accordionItems, function(item) {
15849            var itemContent = $(item).find(".toggle-content"),
15850                itemHeader = $(item).find(".toggle-header"),
15851                slideWidth =
15852                    accordionWidth -
15853                    accordionItems.length * itemHeader.outerWidth();
15854
15855            if ($(item).hasClass("active")) {
15856                $(item).css({
15857                    width: slideWidth
15858                });
15859            }
15860
15861            //width
15862            itemContent.css({
15863                width: $(acc).hasClass("accordion-image")
15864                    ? slideWidth + itemHeader.outerWidth()
15865                    : slideWidth -
15866                      itemHeader.outerWidth() -
15867                      parseInt(itemHeader.css("padding"))
15868            });
15869
15870            //height
15871            if (
15872                $(item)
15873                    .find(".toggle-content")
15874                    .height() > maxHeight
15875            ) {
15876                maxHeight = $(item)
15877                    .find(".toggle-content")
15878                    .height();
15879            }
15880        });
15881    }
15882
15883    /**
15884     * animateHorizontal method set up animation for horizontally oriented
15885     * accordion component
15886     * @memberOf module:Accordion
15887     * @param {Object} properties list of properties for accordion component
15888     * @alias module:Accordion.animateHorizontal
15889     */
15890    api.animateHorizontal = function(properties) {
15891        var accordion = $(this).parents(".accordion"),
15892            panel = $(this).closest(".item"),
15893            header = panel.find(".toggle-header"),
15894            content = panel.find(".toggle-content"),
15895            items = accordion.find(".item"),
15896            siblings = panel.siblings(),
15897            siblingsContent = siblings.find(".toggle-content");
15898
15899        panel.toggleClass("active");
15900        siblings.removeClass("active");
15901        siblings.stop(true).animate(
15902            {
15903                width: 0
15904            },
15905            properties.speed,
15906            properties.easing,
15907            function() {
15908                siblingsContent.css({
15909                    display: "none"
15910                });
15911            }
15912        );
15913
15914        if (panel.hasClass("active")) {
15915            var slideWidth = accordion.hasClass("accordion-image")
15916                    ? content.outerWidth()
15917                    : accordion.width() -
15918                      ((items.length - 1) * panel.outerWidth() + 2),
15919                contentWidth = accordion.hasClass("accordion-image")
15920                    ? slideWidth
15921                    : slideWidth - header.outerWidth();
15922
15923            panel.stop(true).animate(
15924                {
15925                    width: slideWidth
15926                },
15927                properties.speed,
15928                properties.easing,
15929                function() {}
15930            );
15931
15932            content.css({
15933                width: contentWidth,
15934                display: "block"
15935            });
15936        } else {
15937            panel.stop(true).animate(
15938                {
15939                    width: 0
15940                },
15941                properties.speed,
15942                properties.easing,
15943                function() {
15944                    content.css({
15945                        display: "none"
15946                    });
15947                }
15948            );
15949        }
15950    };
15951    /**
15952     * getQueryParamKey get an Id of accordion component
15953     * @memberOf module:Accordion
15954     * @param {jQuery} accordions  Root Dom element of accordion component
15955     * @private
15956     * @return {null|string} return id of accordion component
15957     */
15958    function getQueryParamKey(accordions) {
15959        var firstAccordionId = accordions[0].id;
15960        if (accordions.length > 0 && firstAccordionId != "") {
15961            return firstAccordionId.toLocaleLowerCase();
15962        }
15963        return null;
15964    }
15965    /**
15966     * accordion method that sets up watchers that animate accordion slide
15967     * @memberOf module:Accordion
15968     * @method
15969     * @private
15970     * @param {jQuery} acc Root DOM element of archive component wrapped by jQuery
15971     * @param {Object} prop list of properties for accordion component
15972     * @alias module:Accordion.accordion
15973     */
15974    function accordion(acc, properties) {
15975        var ev = "click",
15976            toggleHeader = acc.find(".toggle-header").filter(function (index, element) {
15977                return $(element).closest('.accordion').is(acc);
15978            });
15979
15980        if (properties.expandOnHover) {
15981            ev += " mouseenter";
15982        }
15983
15984        toggleHeader.on("mouseover", toogleEvents.focus);
15985        toggleHeader.on("mouseleave", toogleEvents.blur);
15986        toggleHeader.on("focus", toogleEvents.focus);
15987        toggleHeader.on("blur", toogleEvents.blur);
15988        toggleHeader.on("keyup", function(e) {
15989            if (e.keyCode == 13 || e.keyCode == 32) {
15990                $(this).click();
15991            }
15992        });
15993
15994        if (acc.hasClass("accordion-horizontal")) {
15995            //calc slide width
15996            $(document).ready(function() {
15997                calcSlideSize(acc);
15998            });
15999
16000            _.each(toggleHeader, function(header) {
16001                headerBackground(header);
16002            });
16003        }
16004
16005        toggleHeader.on(ev, function() {
16006            var $this = $(this),
16007                panel = $this.closest(".item"),
16008                accordion = $this.parents(".accordion"),
16009                content = panel.find(".toggle-content:first"),
16010                siblings = panel.siblings(),
16011                siblingsContent = siblings.find(".toggle-content");
16012
16013            // Horizontal animation
16014            if (accordion.hasClass("accordion-horizontal")) {
16015                api.animateHorizontal.call(this, properties);
16016                // Vertical animation
16017            } else {
16018                // Closes all other items if open
16019                // multiple option disabled
16020                if (!properties.canOpenMultiple) {
16021                    siblings.removeClass("active");
16022                    siblingsContent.stop().slideUp({
16023                        duration: properties.speed,
16024                        easing: properties.easing
16025                    });
16026                }
16027
16028                panel.toggleClass("active");
16029                // Toggle state of selected item
16030                // If toggle state is enabled
16031                if (properties.canToggle) {
16032                    content.slideToggle({
16033                        duration: properties.speed,
16034                        easing: properties.easing
16035                    });
16036                } else {
16037                    content.slideDown({
16038                        duration: properties.speed,
16039                        easing: properties.easing
16040                    });
16041                }
16042            }
16043        });
16044    }
16045    /**
16046     * initInstance method prepare Dom elements according accordion setup
16047     * and call ["accordion"]{@link module:Accordion.accordion} method
16048     * @memberOf module:Acordion
16049     * @method
16050     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
16051     * @param {Object} prop list of properties for accordion component
16052     * @alias module:Accordion.initInstance
16053     */
16054    api.initInstance = function(component, prop) {
16055        // Set tabindex=0 for first header
16056        component.find("ul").attr("role","presentation");
16057        if(component.find("li").length > 1){
16058            component.find("li").attr("role","listitem");
16059        }else{
16060            component.find("li").attr("role","presentation");
16061        }
16062
16063        component.find(".toggle-header").append("<div class=\"toggle-button\" aria-hidden=\"true\"><\/div>");
16064        component.find(".toggle-header").attr("aria-describedby","toggle-button-label");
16065
16066        component
16067            .find(".toggle-header")
16068            .eq(0)
16069            .attr("tabindex", "0");
16070        //
16071        if (component.hasClass("toggle")) {
16072            $.extend(prop, {
16073                canToggle: true
16074            });
16075        }
16076        component.find(".toggle-content").hide();
16077        var current = XA.queryString.getQueryParam(getQueryParamKey(component));
16078        if (current != null) {
16079            var arr = current.split(",");
16080            var items = component.find("ul").first().children();
16081            for (var index = 0; index < items.length; index++) {
16082                var element = items[index];
16083                if (arr.indexOf(index + "") > -1) {
16084                    $(element).addClass("active");
16085                    $(element)
16086                        .find(".toggle-content")
16087                        .show();
16088                }
16089            }
16090        } else if (prop.expandedByDefault) {
16091            component.find("li:first-child").addClass("active");
16092            component
16093                .find("li:first-child")
16094                .find(".toggle-content")
16095                .show();
16096        }
16097        accordion(component, prop);
16098    };
16099    /**
16100     * init method calls in a loop for each
16101     * accordions component on a page and run Accordions
16102     * [".initInstance"]{@link module:Accordion.initInstance} method.
16103     * @memberOf module:Accordion
16104     * @alias module:Accordion.init
16105     */
16106    api.init = function() {
16107        var accordions = $(".accordion:not(.initialized)");
16108        accordions.each(function() {
16109            var properties = $(this).data("properties"),
16110                acc = $(this);
16111			console.log(properties);
16112			console.log(properties.expandOnHover);
16113			if(properties.expandOnHover == undefined) {
16114				properties = JSON.parse($('<div/>').html(properties).text());
16115			}
16116			console.log(properties);
16117            api.initInstance(acc, properties);
16118            acc.addClass("initialized");
16119        });
16120    };
16121
16122    return api;
16123})(jQuery);
16124
16125XA.register("accordions", XA.component.accordions);
16126
16127
16128/*  component-archive  */
16129/**
16130 * Component Archive
16131 * @module Archive
16132 * @param  {jQuery} $ Instance of jQuery
16133 * @return {Object} List of archive methods
16134 */
16135XA.component.archive = (function($) {
16136    /**
16137     * This object stores all public api methods
16138     * @type {Object.<Methods>}
16139     * @memberOf module:Archive
16140     * */
16141    var api = {};
16142    /**
16143     * toggleClick method toggle childs visibility
16144     * for archive items
16145     * @memberOf module:Archive
16146     * @param {eventObject} args
16147     * @private
16148     */
16149    var toggleClick = function(args) {
16150        var groupHeader = $(args.target);
16151        groupHeader.siblings("ul").toggle();
16152        groupHeader.toggleClass("opened");
16153    };
16154    /**
16155     * initInstance method bindc toggling for
16156     * an archive element
16157     * @memberOf module:Archive
16158     * @method
16159     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
16160     * @alias module:Archive.initInstance
16161     */
16162    api.initInstance = function(component) {
16163        var toggles = component.find(".group-header");
16164        toggles.on("click", toggleClick);
16165    };
16166
16167    /**
16168     * init method calls in a loop for each
16169     * archive component on a page and runs Archive's
16170     * ["initInstance"]{@link module:Archive.api.initInstance}  method.
16171     * @memberOf module:Archive
16172     * @alias module:Archive.init
16173     */
16174    api.init = function() {
16175        var archives = $(".sxa-archive:not(.initialized)"),
16176            archive;
16177
16178        for (var i = 0, l = archives.length; i < l; i++) {
16179            archive = $(archives[i]);
16180            api.initInstance(archive);
16181            archive.addClass("initialized");
16182        }
16183    };
16184
16185    return api;
16186})(jQuery, _);
16187
16188XA.register("archive", XA.component.archive);
16189
16190
16191/*  component-breadcrumb  */
16192/**
16193 * Component Breadcrumb
16194 * @module Breadcrumb
16195 * @param  {jQuery} $ Instance of jQuery
16196 * @return {Object} List of archive methods
16197 */
16198XA.component.breadcrumb = (function($) {
16199    /**
16200     * This object stores all public api methods
16201     * @type {Object.<Methods>}
16202     * @memberOf module:Breadcrumb
16203     * */
16204    var api = {};
16205    /**
16206     * This class is used by [Breadcrumb]{@link module:Breadcrumb} module
16207     * @class BreadcrumbManager
16208     * @memberOf module:Breadcrumb
16209     * @param {jQuery} elem DOM Root element of
16210     */
16211    function BreadcrumbManager(elem) {
16212        this.breadcrumb = elem;
16213        this.hideHistory = [];
16214        this.hideHistory.elems = [];
16215        this.hideHistory.widths = [];
16216    }
16217
16218    /**
16219     * @method
16220     * @alias getElements
16221     * @memberOf module:Breadcrumb.BreadcrumbManager
16222     * @param {$OrderedList} list Ordered List of 
16223     * breadcrumb elements wrapped by jquery
16224     */
16225    BreadcrumbManager.prototype.getElements = function($list) {
16226        var elements = [];
16227
16228        $list.find("li").each(function() {
16229            elements.push(this);
16230        });
16231
16232        return elements;
16233    };
16234    /**
16235     * Calculates width of component elements
16236     * @name calculateListElementsWidth
16237     * @function
16238     * @memberOf module:Breadcrumb.BreadcrumbManager
16239     * @return {number} widthSum
16240     */
16241    BreadcrumbManager.prototype.calculateListElementsWidth = function($list) {
16242        var widthSum = 0;
16243
16244        $list.find(">li").each(function() {
16245            widthSum += $(this).width();
16246        });
16247
16248        return widthSum;
16249    };
16250    /**
16251     * In case breadcrumb elements do no fit the component width
16252     * several breadcrum items will be replaced by "..."
16253     * @name calculateWidth
16254     * @function
16255     * @memberOf module:Breadcrumb.BreadcrumbManager
16256     */
16257    BreadcrumbManager.prototype.calculateWidth = function() {
16258        var inst = this,
16259            $list = $(inst.breadcrumb).find("nav>ol"),
16260            listWidth = $list.width(),
16261            widthSum = this.calculateListElementsWidth($list),
16262            elements = this.getElements($list),
16263            $elementToHide,
16264            removeIndx = 0;
16265
16266        var width = inst.hideHistory.widths[inst.hideHistory.widths.length - 1];
16267        if (listWidth > widthSum + width) {
16268            var elem = inst.hideHistory.elems.pop();
16269            inst.hideHistory.widths.pop();
16270            $(elem).removeClass("item-hide");
16271        }
16272
16273        while (listWidth < widthSum && elements.length > 2) {
16274            removeIndx = Math.round(elements.length / 2) - 1;
16275            $elementToHide = $(elements[removeIndx]);
16276
16277            inst.hideHistory.elems.push(elements[removeIndx]);
16278            inst.hideHistory.widths.push($elementToHide.width());
16279            $elementToHide.addClass("item-hide");
16280
16281            widthSum = inst.calculateListElementsWidth($list);
16282            elements.splice(removeIndx, 1);
16283        }
16284    };
16285    /**
16286     * Calls when "breadcrumb-hide" class is added.
16287     * It does initial
16288     * [calculation]{@link module:Breadcrumb.BreadcrumbManager.calculateWidth}
16289     * of component width and also adds 
16290     * [recalculation]{@link module:Breadcrumb.BreadcrumbManager.calculateWidth}
16291     * to window resize event.
16292     * @method
16293     * @alias module:Breadcrumb.BreadcrumbManager.init
16294     * @memberOf module:Breadcrumb.BreadcrumbManager
16295     */
16296    BreadcrumbManager.prototype.init = function() {
16297        var inst = this;
16298
16299        inst.calculateWidth();
16300        $(window).resize(function() {
16301            inst.calculateWidth();
16302        });
16303    };
16304    /**
16305     * Default behavior of breadcrumb.
16306     * If children exist, it adds
16307     * "breadcrumb-navigation" class
16308     * @method
16309     * @alias makeNavigation
16310     * @memberOf module:Breadcrumb.BreadcrumbManager
16311     */
16312    BreadcrumbManager.prototype.makeNavigation = function() {
16313        var breadcrumb = $(this.breadcrumb),
16314            children = breadcrumb.find("li > ol");
16315
16316        if (children.length > 0) {
16317            breadcrumb.addClass("breadcrumb-navigation");
16318        }
16319    };
16320    /**
16321     * initIstance methods creates new instance of
16322     * [BreadcrumbManager]{@link module:Breadcrumb.BreadcrumbManager}
16323     * @memberOf module:Breadcrumb
16324     * @method
16325     * @param {jQuery} component Root DOM element of
16326     * breadcrumb component wrapped by jQuery
16327     * @alias module:Breadcrumb.initInstance
16328     */
16329    api.initInstance = function(component) {
16330        var breadcrumb = new BreadcrumbManager(component),
16331            $component = $(component);
16332        /** breadcrumb-hide - can be added manually in component setups */
16333        if ($component.hasClass("breadcrumb-hide")) {
16334            breadcrumb.init();
16335        } else {
16336            breadcrumb.makeNavigation();
16337        }
16338    };
16339    /**
16340     * init method calls in a loop for each
16341     * breadcrumb component on a page and runs Breadcrumb's
16342     * [".initInstance"]{@link module:Breadcrumb.api.initInstance}  method.
16343     * @memberOf module:Breadcrumb
16344     * @alias module:Breadcrumb.init
16345     */
16346    api.init = function() {
16347        var breadcrumb = $(".breadcrumb:not(.initialized)");
16348        breadcrumb.each(function() {
16349            api.initInstance($(this));
16350            $(this).addClass("initialized");
16351        });
16352    };
16353
16354    return api;
16355})(jQuery, document);
16356
16357XA.register("breadcrumb", XA.component.breadcrumb);
16358
16359
16360/*  component-carousel  */
16361/**
16362 * XAContext
16363 *
16364 * XA.component.carousels module.
16365 *
16366 * Exposes register (selector, options) method that initializes Carousel
16367 * for each element that matches the provided selector, with its given options.
16368 * Element used as a carousel must contain a <ul class="slides"> tag.
16369 * That tag must be filled with <li> elements. Each <li> element will be considered as a slide.
16370 * For more details read the documentation of the register(selector, options) method.
16371 *
16372 * @requires jQuery JavaScript Library v1.4.4 or higher
16373 */
16374/* global Hammer:true */
16375XA.component.carousels = (function ($) {
16376  var pub = {},
16377    NavigationBuilder = null,
16378    SliderInitializer = null;
16379
16380  /**
16381   * Timer class saves time stamp and counts time difference between
16382   * current time (update() method) and saved time stamp.
16383   * @constructor
16384   */
16385  function Timer() {
16386    /**
16387     * Time difference between last update() call and last set() call
16388     *
16389     * @member Timer
16390     */
16391    this.elapsed = 0;
16392    /**
16393     * Time stamp
16394     *
16395     * @member Timer
16396     */
16397    this.stamp = null;
16398  }
16399
16400  /**
16401   *  Counts time difference between current time and saved time stamp
16402   *
16403   * @member Timer
16404   */
16405  Timer.prototype.update = function () {
16406    if (this.stamp !== null) {
16407      this.elapsed += this.newStamp() - this.stamp;
16408    }
16409  };
16410
16411  /**
16412   *  Saves new time stamp
16413   *
16414   * @member Timer
16415   */
16416  Timer.prototype.set = function () {
16417    this.stamp = this.newStamp();
16418  };
16419
16420  /**
16421   *  Counts time difference between current time and saved time stamp
16422   *
16423   * @member Timer
16424   * @return stamp of a current time
16425   * @type Number
16426   */
16427  Timer.prototype.newStamp = function () {
16428    return new Date().valueOf();
16429  };
16430
16431  /**
16432   *  Resets elapsed time.
16433   *
16434   * @member Timer
16435   */
16436  Timer.prototype.reset = function () {
16437    this.elapsed = 0;
16438  };
16439  /**
16440   * End of Timer class
16441   */
16442
16443  /**
16444   * TimeIndicator class extends Timer class
16445   * @constructor
16446   * @param {Object} $     a jQuery object
16447   * @param {XA.component.carousels.IndicatorViews.View} view  a time indicator view.
16448   * @param {Number} timeout   a view timeout
16449   * @base Timer
16450   */
16451  function TimeIndicator($, view, timeout) {
16452    /**
16453     * A time indicator view.
16454     *
16455     * @member TimerIndicator
16456     */
16457    this.view = view;
16458
16459    this.view.init(timeout);
16460  }
16461  TimeIndicator.prototype = new Timer();
16462  TimeIndicator.constructor = Timer;
16463
16464  /**
16465   * Plays the attached view.
16466   *
16467   * @member TimerIndicator
16468   */
16469  TimeIndicator.prototype.play = function () {
16470    this.view.play();
16471  };
16472
16473  /**
16474   * Pauses the attached view.
16475   *
16476   * @member TimerIndicator
16477   */
16478  TimeIndicator.prototype.pause = function () {
16479    this.view.pause();
16480  };
16481
16482  /**
16483   * Resets elapsed time and resets the attached view.
16484   *
16485   * @member TimerIndicator
16486   */
16487  TimeIndicator.prototype.reset = function () {
16488    Timer.prototype.reset.call(this);
16489    this.view.reset();
16490  };
16491
16492  /**
16493   * Counts time difference between current time and saved time stamp
16494   * and updates the attached view
16495   *
16496   * @member TimerIndicator
16497   */
16498  TimeIndicator.prototype.update = function () {
16499    Timer.prototype.update.call(this);
16500    this.view.update(this.elapsed);
16501  };
16502  /**
16503   * end of TimeIndicator class
16504   */
16505
16506  /**
16507   * NavigationBuilder object creates navigation items
16508   */
16509  NavigationBuilder = (function ($) {
16510    function createItem(settings) {
16511      var text = settings.text,
16512        $navItem = null;
16513
16514      settings.text = "";
16515      settings.href = "#";
16516
16517      $navItem = $("<a>", settings);
16518      $("<span>", {
16519        text: text,
16520      }).appendTo($navItem);
16521
16522      return $navItem;
16523    }
16524
16525    return {
16526      /**
16527       * Returns the element(s) that match the provided selector or null
16528       *
16529       * @param {String} selector a selector used for searching
16530       * @return a jQuery object containing element(s) that match the provided selector or null if there is no element match
16531       * @type Object
16532       */
16533      getElement: function (selector) {
16534        var $element = $(selector);
16535
16536        if ($element.length === 0) {
16537          $element = null;
16538        }
16539
16540        return $element;
16541      },
16542      /**
16543       * Creates navigation items and appends them to $container.
16544       *
16545       * @param {Object} $container   navigation items container (jQuery object)
16546       * @param {String} label   navigation items label template
16547       * @param {Number} count    number of navigation items to create
16548       */
16549      createItems: function ($container, label, count) {
16550        var i,
16551          pattern = /#\{index\}/g,
16552          settings;
16553
16554        for (i = 0; i < count; i++) {
16555          settings = {
16556            text: label.replace(pattern, i + 1),
16557          };
16558          createItem(settings).appendTo($container);
16559        }
16560      },
16561      /**
16562       * Creates or selects 'previous'/'next' navigation item.
16563       * Mode of action depends on settings object:
16564       * var settings = {
16565       *     isContainer: Boolean value,
16566       *     label: String value,
16567       *     selector: String value,
16568       *     method: String value
16569       * };
16570       *
16571       * If settings.selector === null or if settings.selector !== null and settings.isContainer == true
16572       * navigation item is created and attached to $element.first() (using settings.method).
16573       * If settings.selector !== null and settings.isContainer == false
16574       * $element.first() is selected as navigation item
16575       *
16576       * @param {Object} settings settings of navigation item
16577       * @param {Object} itemSettings   html attributes of navigation item
16578       * @param {Object} $element    navigation items container (jQuery object)
16579       * @return The 'prev'/'next' navigation item
16580       * @type Object
16581       */
16582      createPrevNextItem: function (settings, itemSettings, $element) {
16583        var $item = null,
16584          isSelectorExists = settings.selector !== null;
16585
16586        if (isSelectorExists) {
16587          $element = this.getElement(settings.selector);
16588        }
16589
16590        if ($element !== null) {
16591          if (settings.isContainer || !isSelectorExists) {
16592            $item = createItem(
16593              $.extend(
16594                {},
16595                {
16596                  text: settings.label,
16597                },
16598                itemSettings
16599              )
16600            );
16601            $element.first()[settings.method]($item);
16602          } else {
16603            $item = $element.first();
16604          }
16605        }
16606
16607        return $item;
16608      },
16609    };
16610  })($);
16611  /**
16612   * end of NavigationBuilder object
16613   */
16614
16615  /**
16616   * Navigation class that contains navigation items.
16617   * @constructor
16618   */
16619  function Navigation($, $wrapper, options) {
16620    var defaults = {
16621        isEnabled: true,
16622        hasPrevNextItems: true,
16623        item: {
16624          label: "#{index}",
16625          selector: null,
16626        },
16627        prevItem: {
16628          label: "<",
16629          selector: null,
16630          isContainer: false,
16631        },
16632        nextItem: {
16633          label: ">",
16634          selector: null,
16635          isContainer: false,
16636        },
16637        slidesCount: 0,
16638      },
16639      settings = $.extend(true, {}, defaults, options);
16640
16641    /**
16642     * jQuery object
16643     *
16644     * @member Navigation
16645     */
16646    this.$ = $;
16647    /**
16648     * Navigation items (one for each slide if navigation is enabled).
16649     *
16650     * @member Navigation
16651     */
16652    this.$items = $();
16653    /**
16654     * Navigation 'next' item (if prev/next items are enabled).
16655     *
16656     * @member Navigation
16657     */
16658    this.$nextItem = $();
16659    /**
16660     * Navigation 'previous' item (if prev/next items are enabled).
16661     *
16662     * @member Navigation
16663     */
16664    this.$prevItem = $();
16665    /**
16666     * Selected item (one from this.$items or null).
16667     *
16668     * @member Navigation
16669     */
16670    this.$selectedItem = null;
16671
16672    //initialization
16673    if (settings.isEnabled) {
16674      var self = this;
16675      setTimeout(function () {
16676        self.prepareItems(settings.item, settings.slidesCount, $wrapper);
16677        //select first item on init
16678        self.selectItem(0);
16679      }, 1000);
16680
16681      $wrapper.find(".nav").trigger("navigation-created", this);
16682    }
16683  }
16684
16685  /**
16686   * CSS class used to mark selected item.
16687   *
16688   * @member Navigation
16689   */
16690  Navigation.prototype.selectedItemClass = "active";
16691
16692  /**
16693   * Mark navigation item with given index as selected.
16694   *
16695   * @member Navigation
16696   * @param {Number} index     index of navigation item
16697   */
16698  Navigation.prototype.selectItem = function (index) {
16699    if (this.$selectedItem !== null) {
16700      this.$selectedItem.removeClass(this.selectedItemClass);
16701    }
16702    this.$selectedItem = this.$items.eq(index).addClass(this.selectedItemClass);
16703  };
16704
16705  /**
16706   * Creates or selects navigation items container and fills it with navigation items.
16707   * If navigation items container is not empty, child elements are adopted as navigation items.
16708   * Mode of action depends on settings object:
16709   * var settings = {
16710   *     'label': '#{index}',
16711   *     'selector': null
16712   * };
16713   * If settings.selector === null navigation item container is created.
16714   * If settings.selector !== null element that match settings.selector is adapted as navigagation items container.
16715   *
16716   * @member Navigation
16717   * @param {Object} settings settings of navigation items
16718   * @param {Number} count   number of navigation items
16719   * @param {Object} $wrapper    wrapper of navigation items container (jQuery object)
16720   * @return The container filled with navigation items.
16721   * @type Object
16722   */
16723  Navigation.prototype.prepareItems = function (settings, count, $wrapper) {
16724    var $container = null;
16725
16726    if (settings.selector) {
16727      $container = NavigationBuilder.getElement(settings.selector);
16728    } else {
16729      $container = $("<div/>", {
16730        class: "nav",
16731      });
16732      $container.appendTo($wrapper);
16733    }
16734
16735    if ($container) {
16736      if ($container.children().length === 0) {
16737        NavigationBuilder.createItems($container, settings.label, count);
16738      }
16739
16740      this.$items = $container.children().slice(0, count);
16741    }
16742
16743    return $container;
16744  };
16745
16746  /**
16747   * Creates or selects navigation 'previous' and 'next' navigation items (@see NavigationBuilder.createPrevNextItem()).
16748   * If navigation items container is not empty, child elements are adopted as navigation items.
16749   *
16750   * @member Navigation
16751   * @param {Object} settings settings of navigation
16752   * @param {Object} $container    navigation items container (jQuery object)
16753   */
16754  Navigation.prototype.preparePrevNextItems = function (settings, $container) {
16755    var $item;
16756
16757    settings.prevItem.method = "prepend";
16758    $item = NavigationBuilder.createPrevNextItem(
16759      settings.prevItem,
16760      {
16761        class: "prev",
16762      },
16763      $container
16764    );
16765    this.$prevItem = $item === null ? this.$prevItem : $item;
16766
16767    settings.nextItem.method = "append";
16768    $item = NavigationBuilder.createPrevNextItem(
16769      settings.nextItem,
16770      {
16771        class: "next",
16772      },
16773      $container
16774    );
16775    this.$nextItem = $item === null ? this.$nextItem : $item;
16776  };
16777  /**
16778   * end of Navigation class
16779   */
16780
16781  /**
16782   * class Swiper you can define horizontal swipe for chosing element and set behavior of swipe(left/right).
16783   * You can extend this class with vertical swipe if it needs
16784   * @param target Element or query of querySelector
16785   */
16786  function Swiper(target) {
16787    let touchStartX = 0,
16788      touchStartY = 0,
16789      touchEndX = 0,
16790      touchEndY = 0,
16791      threshold = 50;
16792
16793    let onSwipeLeftAgent = null,
16794      onSwipeRightAgent = null,
16795      element = null;
16796
16797    element =
16798      target instanceof EventTarget ? target : document.querySelector(target);
16799
16800    onTouchStart = (event) => {
16801      touchStartX = event.changedTouches[0].screenX;
16802      touchStartY = event.changedTouches[0].screenY;
16803    };
16804
16805    onTouchEnd = (event) => {
16806      touchEndX = event.changedTouches[0].screenX;
16807      touchEndY = event.changedTouches[0].screenY;
16808      handleGesture(event);
16809    };
16810
16811    onMouseDown = (event) => {
16812      touchStartX = event.screenX;
16813      touchStartY = event.screenY;
16814    };
16815
16816    onMouseUp = (event) => {
16817      touchEndX = event.screenX;
16818      touchEndY = event.screenY;
16819      handleGesture(event);
16820    };
16821
16822    element.addEventListener("touchstart", onTouchStart, false);
16823
16824    element.addEventListener("touchend", onTouchEnd, false);
16825
16826    element.addEventListener("mousedown", onMouseDown, false);
16827
16828    element.addEventListener("mouseup", onMouseUp, false);
16829
16830    /**
16831     * method which defines swipe left
16832     * @param callback func
16833     */
16834    this.onSwipeLeft = (callback) => {
16835      onSwipeLeftAgent = (event) => callback.call(this, event);
16836    };
16837
16838    /**
16839     * method which defines swipe right
16840     * @param callback
16841     */
16842    this.onSwipeRight = (callback) => {
16843      onSwipeRightAgent = (event) => callback.call(this, event);
16844    };
16845
16846    this.destroy = () => {
16847      element.removeEventListener("touchstart", onTouchStart);
16848      element.removeEventListener("touchend", onTouchEnd);
16849      element.removeEventListener("mousedown", onMouseDown);
16850      element.removeEventListener("mouseup", onMouseUp);
16851    };
16852
16853    function handleGesture(event) {
16854      /**
16855       * swiped left
16856       */
16857      if (touchEndX + threshold <= touchStartX) {
16858        onSwipeLeftAgent && onSwipeLeftAgent(event);
16859      }
16860
16861      /**
16862       * swiped right
16863       */
16864      if (touchEndX - threshold >= touchStartX) {
16865        onSwipeRightAgent && onSwipeRightAgent(event);
16866      }
16867    }
16868  }
16869
16870  /**
16871   * SliderContext class is binded to a Slider class instance
16872   * and contains its properties.
16873   * @constructor
16874   */
16875  function SliderContext() {
16876    /**
16877     * Flag that determines if slide can or cannot be changed (for user request)
16878     *
16879     * @member SliderContext
16880     */
16881    this.canChangeSlide = true;
16882    /**
16883     * Default Slider setting object (@see Slider)
16884     *
16885     * @member SliderContext
16886     */
16887    this.defaults = null;
16888    /**
16889     * Navigation object (@see Navigation)
16890     *
16891     * @member SliderContext
16892     */
16893    this.navigation = null;
16894    /**
16895     * Slider object that this context is attached to.
16896     *
16897     * @member SliderContext
16898     */
16899    this.owner = null;
16900    /**
16901     * Flag that determines if change of a slide can or can not be scheduled.
16902     *
16903     * @member SliderContext
16904     */
16905    this.preventScheduling = false;
16906    /**
16907     * Slider setting object
16908     *
16909     * @member SliderContext
16910     */
16911    this.settings = null;
16912    /**
16913     * Instance of Timer class (@see Timer) that is used to store how much
16914     * time is left to change the slide.
16915     *
16916     * @member SliderContext
16917     */
16918    this.slideTimer = new Timer();
16919    /**
16920     * Instance of TimeIndicator class (@see TimeIndicator)
16921     *
16922     * @member SliderContext
16923     */
16924    this.timeIndicator = null;
16925    /**
16926     * Timers array.
16927     *
16928     * @member SliderContext
16929     */
16930    this.timers = [];
16931    /**
16932     * Last timeout identifier.
16933     *
16934     * @member SliderContext
16935     */
16936    this.timeoutId = null;
16937    /**
16938     * Transition (@see XA.component.carousels.Transitions.Transition) used while changing slides
16939     *
16940     * @member SliderContext
16941     */
16942    this.transition = null;
16943    /**
16944     * Transition settings object (@see XA.component.carousels.Transitions.TransitionSettings)
16945     *
16946     * @member SliderContext
16947     */
16948    this.transitionSettings =
16949      new XA.component.carousels.Transitions.TransitionSettings();
16950    /**
16951     * jQuery object that contains all slides
16952     *
16953     * @member SliderContext
16954     */
16955    this.$slides = null;
16956    /**
16957     * jQuery object that contains the element that wraps slides
16958     *
16959     * @member SliderContext
16960     */
16961    this.$wrapper = null;
16962    /**
16963     * Reference to method that should change current slide
16964     *
16965     * @member SliderContext
16966     */
16967    this.changeCurrentSlide = null;
16968    /**
16969     * Reference to method that should return jQuery object with current slide
16970     *
16971     * @member SliderContext
16972     */
16973    this.getCurrentSlide = null;
16974
16975    this.timers.push(this.slideTimer);
16976  }
16977  /**
16978   * end of SliderContext class
16979   */
16980
16981  /**
16982   * Slider class manages changing of slides.
16983   *
16984   * Options object:
16985   * {
16986   *     'navigation': Object value, //navigation settings object
16987   *     'timeout': Number value, //time between slides changing
16988   *     'transition': String value, //name of transition class (@see XA.component.carousels.Transitions.Transition)
16989   *     'isPauseEnabled': Boolean value, //flag that determines if pause feature is enabled
16990   *     'timeIndicator': {
16991   *         'isEnabled': Boolean value, //flag that determines if time indicator is enabled
16992   *         'selector': String value, //selector of time indicator html element
16993   *         'view': String value, //name of view class (@see XA.component.carousels.IndicatorViews.View
16994   *         'options': Object value //object with options that will be passed to a time indicator view
16995   *     }
16996   * }
16997   * @constructor
16998   * @param {Object} $     the jQuery object
16999   * @param {SliderContext} context    instance of SliderContext class; must be separate for each instance (@see SliderContext)
17000   * @param {Object} options    Slider options object
17001   */
17002  function Slider($, context, options) {
17003    var defaults = {
17004      navigation: {},
17005      timeout: 10000,
17006      transition: "BasicTransition",
17007      isPauseEnabled: true,
17008      timeIndicator: {
17009        isEnabled: false,
17010        selector: null,
17011        view: "View",
17012        options: {},
17013      },
17014    };
17015
17016    /**
17017     * Instance of SliderContext class (@see SliderContext)
17018     *
17019     * @member Navigation
17020     */
17021    this.context = context;
17022
17023    context.owner = this;
17024    context.defaults = defaults;
17025    context.settings = $.extend(true, {}, defaults, options);
17026    context.transitionSettings.$slides = context.$slides;
17027  }
17028
17029  /**
17030   * Executes method with given methodName on each Timer in context.timers (@see Timer)
17031   *
17032   * @member Slider
17033   * @param {String} methodName   name of a method that will be executed on timers
17034   * @param {SliderContext} context    current context
17035   */
17036  Slider.prototype.executeOnTimers = function (methodName, context) {
17037    var i = null,
17038      timer = null,
17039      timers = context.timers;
17040
17041    for (i = 0; i < timers.length; i++) {
17042      timer = timers[i];
17043      if (typeof timer[methodName] === "function") {
17044        timer[methodName]();
17045      }
17046    }
17047  };
17048
17049  /**
17050   * Deschedules change of a slide, by clearing timeout previously set by setTimeout() function.
17051   *
17052   * @member Slider
17053   * @param {SliderContext} context    current context
17054   */
17055  Slider.prototype.descheduleSlide = function (context) {
17056    if (context.timeoutId !== null) {
17057      clearTimeout(context.timeoutId);
17058      context.timeoutId = null;
17059    }
17060  };
17061
17062  /**
17063   * Schedules change of a slide, by setting timeout (using setTimeout() function) if it can.
17064   * If cannot, it tries again after short period of time.
17065   *
17066   * @member Slider
17067   * @param {SliderContext} context    current context
17068   */
17069  Slider.prototype.scheduleSlide = function (context) {
17070    var owner = context.owner;
17071
17072    owner.descheduleSlide(context);
17073
17074    if (!context.preventScheduling && context.$slides.length > 1) {
17075      owner.executeOnTimers("set", context);
17076
17077      if (context.canChangeSlide) {
17078        if (context.timeIndicator !== null) {
17079          context.timeIndicator.play();
17080        }
17081        context.timeoutId = setTimeout(function () {
17082          owner.changeCurrentSlideBy(1, context);
17083        }, context.settings.timeout - context.slideTimer.elapsed);
17084      } else {
17085        setTimeout(function () {
17086          owner.scheduleSlide(context);
17087        }, 100);
17088      }
17089    }
17090  };
17091
17092  /**
17093   * Changes current slide by offset performing context.transition
17094   * Any offset value is save (if it is an integer).
17095   *
17096   * @member Slider
17097   * @param {Number} offset    the offset to an index of a new slide
17098   * @param {SliderContext} context    current context
17099   */
17100  Slider.prototype.changeCurrentSlideBy = function (offset, context) {
17101    var settings = context.transitionSettings,
17102      $currentSlide = context.getCurrentSlide(),
17103      $slides = context.$slides;
17104
17105    if (offset % $slides.length !== 0) {
17106      context.canChangeSlide = false;
17107
17108      settings.offset = offset;
17109      settings.$currentSlide = $currentSlide;
17110      settings.$nextSlide = $slides.eq(
17111        ($currentSlide.index() + offset) % $slides.length
17112      );
17113
17114      context.changeCurrentSlide(settings.$nextSlide);
17115      context.transition.perform(context.transitionSettings, offset);
17116      context.owner.executeOnTimers("reset", context);
17117    }
17118
17119    var $carousel = $(context.$wrapper).parents(".carousel");
17120    $carousel.trigger("slide-changed");
17121  };
17122
17123  /**
17124   * Starts automatic slide changing
17125   *
17126   * @member Slider
17127   */
17128  Slider.prototype.run = function () {
17129    this.executeOnTimers("reset", this.context);
17130    this.scheduleSlide(this.context);
17131  };
17132
17133  /**
17134   * Cancel the default action of event and changes slides manually.
17135   *
17136   * @member Slider
17137   * @param {Object} event     the event
17138   * @param {Number} offset    the offset to an index of a new slide
17139   * @param {SliderContext} context    current context
17140   */
17141  Slider.prototype.onChangeCurrentSlide = function (event, offset, context) {
17142    var owner = context.owner;
17143
17144    event.preventDefault();
17145    if (context.canChangeSlide) {
17146      owner.descheduleSlide(context);
17147      owner.changeCurrentSlideBy(offset, context);
17148    }
17149  };
17150
17151  /**
17152   * Selects navigation item with given index.
17153   *
17154   * @member Slider
17155   * @param {Number} index     the index of navigation item
17156   */
17157  Slider.prototype.selectNavigationItem = function (index) {
17158    this.context.navigation.selectItem(index);
17159  };
17160  /**
17161   * end of Slider class
17162   */
17163
17164  /**
17165   * SliderInitializer object sets up instances of Slider class
17166   */
17167  SliderInitializer = (function ($) {
17168    var DIRECTION = {
17169      PREV: -1,
17170      NEXT: 1,
17171    };
17172
17173    /**
17174     * Attaches events to navigation items.
17175     *
17176     * @param {SliderContext} context   a context of a Slider class instance
17177     */
17178    function attachNavigationEvents(context) {
17179      var owner = context.owner,
17180        $navLinks = context.$wrapper.find(".nav-items"),
17181        $prevItemTxt = context.$wrapper.find(".prev-text"),
17182        $nextItemTxt = context.$wrapper.find(".next-text"),
17183        $carousel = context.$wrapper.parents(".carousel");
17184
17185      context.navigation.$items.each(function (index) {
17186        var $slide = context.$slides.eq(index);
17187
17188        $(this).click(function (event) {
17189          owner.onChangeCurrentSlide(
17190            event,
17191            $slide.index() - context.getCurrentSlide().index(),
17192            context
17193          );
17194        });
17195      });
17196
17197      $prevItemTxt.click(function (event) {
17198        switchSlide(event, context, DIRECTION.PREV);
17199      });
17200
17201      $nextItemTxt.click(function (event) {
17202        switchSlide(event, context, DIRECTION.NEXT);
17203      });
17204
17205      context.navigation.$prevItem.click(function (event) {
17206        switchSlide(event, context, DIRECTION.PREV);
17207      });
17208
17209      context.navigation.$nextItem.click(function (event) {
17210        switchSlide(event, context, DIRECTION.NEXT);
17211      });
17212
17213      $navLinks.on("keydown", function (event) {
17214        switch (event.keyCode) {
17215          case 37: //Letf arrow
17216            switchSlide(event, context, DIRECTION.PREV);
17217            $(this).parent().find(".active").focus();
17218            break;
17219          case 39: //Right arrow
17220            switchSlide(event, context, DIRECTION.NEXT);
17221            $(this).parent().find(".active").focus();
17222            break;
17223          case 13: //Enter
17224            focusFirstFocusableElement(owner.context.getCurrentSlide());
17225        }
17226      });
17227
17228      $carousel.on("slide-changed", function (event) {
17229        var $activeLink = $navLinks.find(".active");
17230        $activeLink.attr("tabindex", "0");
17231
17232        if ($navLinks.find(document.activeElement).length) {
17233          $activeLink.focus({ preventScroll: true });
17234        }
17235
17236        $navLinks.find(">div").not(".active").attr("tabindex", "-1");
17237      });
17238    }
17239
17240    /**
17241     * Switches slides back and foreward
17242     *
17243     * @param {Event} event              an event that caused switch slide action
17244     * @param {SliderContext} context    a context of a Slider class instance
17245     * @param {number} direction         switch slide direction. -1 - switch to prev slide. 1 - switch to the next slide
17246     */
17247    function switchSlide(event, context, direction) {
17248      var owner = context.owner,
17249        navLinks$ = context.$wrapper.find(".nav-items");
17250
17251      navLinks$.find(".active").attr("tabindex", "-1");
17252      owner.onChangeCurrentSlide(event, direction, context);
17253      navLinks$.find(".active").attr("tabindex", "0");
17254    }
17255
17256    /**
17257     * Focus the first focusable element inside container.
17258     *
17259     * @param {Container} container  a container element where the first focusable element will be focused
17260     */
17261    function focusFirstFocusableElement(container) {
17262      var focusableElementsString =
17263        'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
17264
17265      // Finds all focusable children
17266      var focusableElements = container.find(focusableElementsString);
17267
17268      // If there are focusable elements - select the first one.
17269      if (focusableElements.length !== 0) {
17270        var firstTabStop = focusableElements[0];
17271
17272        // Focus first
17273        firstTabStop.focus();
17274      }
17275    }
17276
17277    /**
17278     * Attaches pause event to navigation wrapper.
17279     *
17280     * @param {SliderContext} context   a context of a Slider class instance
17281     */
17282    function attachPauseEvent(context) {
17283      var owner = context.owner,
17284        $element = context.$wrapper,
17285        $navLinks = $element.find(".nav a");
17286
17287      var callbackMouseenter = function () {
17288        context.preventScheduling = true;
17289        owner.descheduleSlide(context);
17290
17291        owner.executeOnTimers("update", context);
17292        if (context.timeIndicator !== null) {
17293          context.timeIndicator.pause();
17294        }
17295      };
17296
17297      $element.mouseenter(callbackMouseenter);
17298      $navLinks.on("focus", callbackMouseenter);
17299
17300      var callbackMouseLeave = function () {
17301        context.preventScheduling = false;
17302        owner.scheduleSlide(context);
17303      };
17304
17305      $element.mouseleave(callbackMouseLeave);
17306      $navLinks.on("blur", callbackMouseLeave);
17307    }
17308
17309    /**
17310     * Creates time indicator view
17311     *
17312     * @param {SliderContext} context   a context of a Slider class instance
17313     */
17314    function createIndicator(context) {
17315      var settings = context.settings,
17316        timeIndicator = null,
17317        ViewConstructor =
17318          XA.component.carousels.IndicatorViews[settings.timeIndicator.view],
17319        view = null;
17320
17321      if (ViewConstructor !== null) {
17322        view = new ViewConstructor(
17323          settings.timeIndicator.selector,
17324          settings.timeIndicator.options
17325        );
17326        timeIndicator = new TimeIndicator($, view, settings.timeout);
17327        context.timeIndicator = timeIndicator;
17328        context.timers.push(timeIndicator);
17329      }
17330    }
17331
17332    /**
17333     * Attaches events to navigation.
17334     *
17335     * @param {SliderContext} context   a context of a Slider class instance
17336     */
17337    function initializeNavigation(context) {
17338      context.settings.navigation.slidesCount = context.$slides.length;
17339      context.navigation = new Navigation(
17340        $,
17341        context.$wrapper,
17342        context.settings.navigation
17343      );
17344
17345      setTimeout(function () {
17346        attachNavigationEvents(context);
17347      }, 1000);
17348
17349      if (context.settings.isPauseEnabled) {
17350        attachPauseEvent(context);
17351      }
17352    }
17353
17354    /**
17355     * Initializes transition for a given context.
17356     *
17357     * @param {SliderContext} context   a context of a Slider class instance
17358     */
17359    function initializeTransition(context) {
17360      var TransitionConstructor = null,
17361        owner = context.owner;
17362
17363      context.transitionSettings.callback = function () {
17364        context.canChangeSlide = true;
17365
17366        if (context.preventScheduling) {
17367          owner.executeOnTimers("reset", context);
17368        } else {
17369          owner.scheduleSlide(context);
17370        }
17371      };
17372
17373      TransitionConstructor =
17374        XA.component.carousels.Transitions[context.settings.transition];
17375      if (
17376        TransitionConstructor === null ||
17377        TransitionConstructor === undefined
17378      ) {
17379        TransitionConstructor =
17380          XA.component.carousels.Transitions[context.defaults.transition];
17381      }
17382      context.transition = new TransitionConstructor();
17383      context.transition.init(context.transitionSettings);
17384    }
17385
17386    return {
17387      /**
17388       * Initializes Slider object with a given context.
17389       *
17390       * @param {SliderContext} context   a context of a Slider class instance
17391       */
17392      initialize: function (context) {
17393        initializeNavigation(context);
17394        initializeTransition(context);
17395
17396        if (context.settings.timeIndicator.isEnabled) {
17397          createIndicator(context);
17398        }
17399      },
17400    };
17401  })($);
17402  /**
17403   * end of SliderInitializer
17404   */
17405
17406  /**
17407   * Carousel class displays one slide (some content) at the time.
17408   * Its behavior depends on settings (passed to init() method).
17409   * For more details @see Slider, @see SliderInitializer, @see Navigation,
17410   * @see NavigationBuilder, @see XA.component.carousels.Transitions.Transition,
17411   * @see XA.component.carousels.IndicatorViews.View
17412   *
17413   * @constructor
17414   */
17415  function Carousel() {
17416    var context = this;
17417
17418    /**
17419     * Instance of a Slider class (@see Slider).
17420     *
17421     * @member Carousel
17422     */
17423    this.slider = null;
17424    /**
17425     * Displayed slide (jQuery object).
17426     *
17427     * @member Carousel
17428     */
17429    this.$currentSlide = null;
17430    /**
17431     * All slides (jQuery object).
17432     *
17433     * @member Carousel
17434     */
17435    this.$slides = null;
17436
17437    /**
17438     * Changes current slide to a $newSlide.
17439     *
17440     * @member Carousel
17441     * @param {Object} $newSlide  the new slide (jQuery) object.
17442     */
17443    this.changeCurrentSlide = function ($newSlide) {
17444      context.$currentSlide = $newSlide;
17445      context.slider.selectNavigationItem($newSlide.index());
17446    };
17447
17448    /**
17449     * Returns current slide.
17450     *
17451     * @member Carousel
17452     * @return current slide (jQuery) object.
17453     * @type Object
17454     */
17455    this.getCurrentSlide = function () {
17456      return context.$currentSlide;
17457    };
17458
17459    this.data = {};
17460  }
17461
17462  /**
17463   * Resets the carousel.
17464   *
17465   * @member Carousel
17466   */
17467  Carousel.prototype.reset = function () {
17468    this.$slides.each(function () {
17469      $(this).hide();
17470    });
17471
17472    this.changeCurrentSlide(this.$slides.first());
17473    this.$currentSlide.show();
17474  };
17475
17476  /**
17477   * Initializes the carousel.
17478   * Wraps carousel content with <div class="wrapper" /> element,
17479   * selects slides (<li /> elements) from <ul class="slides" /> element,
17480   * initializes Slider class instance, resets the carousel, and starts automatic slides changing.
17481   *
17482   * @member Carousel
17483   * @param {Object} $container     jQuery object with a main html element of the carousel
17484   * @param {Object} options     carousel options object
17485   */
17486  Carousel.prototype.init = function ($container, options) {
17487    var $wrapper = $('.wrapper').length ? $('.wrapper') : $("<div/>", {
17488        class: "wrapper",
17489      }),
17490      sliderContext = null;
17491
17492    if (!$('.wrapper').length) {
17493      $wrapper.append($container.children().detach());
17494      $container.append($wrapper);
17495    }
17496    
17497    this.$slides = $wrapper.find(".slides li.slide");
17498
17499    sliderContext = new SliderContext();
17500    sliderContext.changeCurrentSlide = this.changeCurrentSlide;
17501    sliderContext.getCurrentSlide = this.getCurrentSlide;
17502    sliderContext.$slides = this.$slides;
17503    sliderContext.$wrapper = $wrapper;
17504
17505    this.slider = new Slider($, sliderContext, options);
17506    SliderInitializer.initialize(sliderContext);
17507
17508    this.reset();
17509    this.slider.run();
17510  };
17511  /**
17512   * end of Carousel class
17513   */
17514
17515  /* Carousel touch support */
17516  Carousel.prototype.swipeSlide = function () {
17517    var $wrapper = this.slider.context.$wrapper,
17518      swiper = new Swiper($wrapper[0]);
17519
17520    swiper.onSwipeLeft((e) =>
17521      this.slider.context.owner.onChangeCurrentSlide(e, 1, this.slider.context)
17522    );
17523    swiper.onSwipeRight((e) =>
17524      this.slider.context.owner.onChangeCurrentSlide(e, -1, this.slider.context)
17525    );
17526  };
17527
17528  Carousel.prototype.maxSlideInfoHeight = function () {
17529    var maxHeight = 0,
17530      slideInfo =
17531        this.$slides[0] && this.$slides[0].querySelector(".slide-info");
17532
17533    if (slideInfo) {
17534      maxHeight = slideInfo.offsetHeight;
17535    }
17536    for (var i = 1; i < this.$slides.length; i++) {
17537      var slideInfo = this.$slides[i].querySelector(".slide-info");
17538
17539      if (!slideInfo) {
17540        continue;
17541      }
17542
17543      var currSlideInfoHeight = slideInfo.offsetHeight;
17544
17545      if (maxHeight < currSlideInfoHeight) {
17546        maxHeight = currSlideInfoHeight;
17547      }
17548    }
17549    return maxHeight;
17550  };
17551
17552  Carousel.prototype.resizeWrapper = function () {
17553    var slideInfoHeight = this.maxSlideInfoHeight(),
17554      wrapper = this.slider.context.$wrapper;
17555    wrapper.find(".slide-info").css({
17556      "min-height": slideInfoHeight,
17557    });
17558  };
17559
17560  pub.initInstance = function (component) {
17561    const defaultProperties = {
17562      "timeout": 2147483647,
17563      "isPauseEnabled": true,
17564      "transition": "BasicTransition",
17565  };
17566    var properties = component.data("properties") || defaultProperties,
17567      component = component.find(".carousel-inner"),
17568      id = component.attr("data-id"),
17569      self = component.eq(0),
17570      querySlideIndex = parseInt(
17571        XA.queryString.getQueryParam(
17572          component.closest(".component.carousel").attr("id") || "carousel"
17573        )
17574      ),
17575      validQueryParam =
17576        typeof querySlideIndex !== "undefined" &&
17577        !isNaN(querySlideIndex) &&
17578        querySlideIndex < component.find(".sxa-numbers").length,
17579      context,
17580      settings,
17581      $currentSlide,
17582      $slides;
17583
17584    if (properties) {
17585      if (!properties.navigation) {
17586        properties.navigation = {
17587          item: {},
17588          prevItem: {},
17589          nextItem: {},
17590          isEnabled: validQueryParam ? false : true,
17591        };
17592      }
17593      properties.navigation.item.selector = "[data-id='" + id + "'] .nav-items"; //properties.navigation.item.selector;
17594      properties.navigation.prevItem.selector = "#" + id + " .nav";
17595      properties.navigation.nextItem.selector = "#" + id + " .nav";
17596
17597      var carousel = new Carousel($);
17598      carousel.init(component, properties);
17599
17600      $(document).ready(function () {
17601        carousel.resizeWrapper();
17602      });
17603
17604      if (validQueryParam) {
17605        (context = carousel.slider.context),
17606          (settings = context.transitionSettings),
17607          ($currentSlide = context.getCurrentSlide()),
17608          ($slides = context.$slides);
17609
17610        context.canChangeSlide = false;
17611        settings.$currentSlide = $currentSlide;
17612        settings.$nextSlide = $($slides[querySlideIndex]);
17613
17614        context.changeCurrentSlide(settings.$nextSlide);
17615        context.transition.perform(context.transitionSettings);
17616        context.owner.executeOnTimers("reset", context);
17617
17618        context.navigation.prepareItems(
17619          properties.navigation.item,
17620          $slides.length,
17621          $(context.$wrapper)
17622        );
17623        context.navigation.selectItem(querySlideIndex);
17624      } else {
17625        carousel.swipeSlide();
17626      }
17627    }
17628  };
17629
17630  pub.init = function () {
17631    $(".carousel").each(function () {
17632      pub.initInstance($(this));
17633    });
17634  };
17635
17636  return pub;
17637})(jQuery);
17638/**
17639 * end of XA.component.carousels module.
17640 */
17641
17642XA.register("carousels", XA.component.carousels);
17643
17644XA.component.carousels.Transitions = (function () {
17645  var pub = {};
17646
17647  /**
17648   * TransitionSettings class contains data needed for changing slides
17649   * @constructor
17650   */
17651  function TransitionSettings() {}
17652  /**
17653   * Current slide (currently displayed) jQuery object
17654   *
17655   * @member TransitionSettings
17656   */
17657  TransitionSettings.prototype.$currentSlide = null;
17658  /**
17659   * Next slide jQuery object
17660   *
17661   * @member TransitionSettings
17662   */
17663  TransitionSettings.prototype.$nextSlide = null;
17664  /**
17665   * All slides (jQuery object)
17666   *
17667   * @member TransitionSettings
17668   */
17669  TransitionSettings.prototype.$slides = null;
17670  /**
17671   * Offset between $currentSlide and $nextSlide
17672   *
17673   * @member TransitionSettings
17674   */
17675  TransitionSettings.prototype.offset = 0;
17676  /**
17677   * Callback function that must be called after animation.
17678   *
17679   * @member TransitionSettings
17680   */
17681  TransitionSettings.prototype.callback = null;
17682  /**
17683   * end of TransitionSettings class
17684   */
17685  pub.TransitionSettings = TransitionSettings;
17686
17687  /**
17688   * Transition class is a base class of all transitions.
17689   *
17690   * Important: settings.callback() (@see TransitionSettings) have to be called at the end of execution the perform() method.
17691   *
17692   * @constructor
17693   */
17694  function Transition() {}
17695  Transition.prototype = new Transition();
17696  /**
17697   * Initializes a transition with given settings (@see TransitionSettings).
17698   *
17699   * @member Transition
17700   * @param {TransitionSettings} settings  transition settings
17701   */
17702  /* eslint-disable */
17703  Transition.prototype.init = function (settings) {
17704    //implementation using settings
17705  };
17706  /* eslint-enable */
17707  /**
17708   * Returns a factor associated with settings.offset (@see TransitionSettings) that
17709   * can be usefull for some animations.
17710   *
17711   * @member Transition
17712   * @param {TransitionSettings} settings  transition settings
17713   * @return The factor; 1 if offset is higher than 0, -1 otherwise
17714   * @type Number
17715   */
17716  Transition.prototype.factor = function (settings) {
17717    return settings.offset > 0 ? 1 : -1;
17718  };
17719  /**
17720   * This method is called used by carousels to change slides.
17721   *
17722   * Important: settings.callback() (@see TransitionSettings) have to be called at the end of this method execution.
17723   *
17724   * @member Transition
17725   * @param {TransitionSettings} settings  transition settings
17726   */
17727  Transition.prototype.perform = function (settings) {
17728    settings.callback();
17729  };
17730  /**
17731   * End of Transition class
17732   */
17733  pub.Transition = Transition;
17734
17735  /**
17736   * BasicTransition class changes slides without any animation.
17737   * Do not remove this class, because carousels use it by default,
17738   * if requested transition cannot be found.
17739   * @constructor
17740   */
17741  function BasicTransition() {}
17742  BasicTransition.prototype = new Transition();
17743  BasicTransition.constructor = BasicTransition;
17744  /**
17745   * @member BasicTransition
17746   */
17747  BasicTransition.prototype.perform = function (settings) {
17748    settings.$currentSlide.hide();
17749    settings.$nextSlide.show();
17750
17751    settings.callback();
17752  };
17753  /**
17754   * End of BasicTransition class
17755   */
17756  pub.BasicTransition = BasicTransition;
17757
17758  /**
17759   * FadeInTransition class changes slides by fading in new slide.
17760   * This class can be removed if effect is not used.
17761   * @constructor
17762   */
17763  function FadeInTransition() {}
17764  FadeInTransition.prototype = new Transition();
17765  FadeInTransition.constructor = FadeInTransition;
17766  /**
17767   * @member FadeInTransition
17768   */
17769  FadeInTransition.prototype.init = function () {
17770    /*settings.$slides.css({
17771         'position': 'absolute',
17772         'top': '0px',
17773         'left': '0px'
17774         });*/
17775  };
17776  /**
17777   * @member FadeInTransition
17778   */
17779  FadeInTransition.prototype.perform = function (settings) {
17780    var zIndexAttrib = "z-index",
17781      $parent = settings.$slides.parent(),
17782      $nextSlide = settings.$nextSlide;
17783
17784    $parent.css(zIndexAttrib, 0);
17785    $nextSlide.css(zIndexAttrib, 1);
17786    settings.$slides.css({
17787      position: "relative",
17788    });
17789
17790    settings.$nextSlide.css({
17791      position: "absolute",
17792      top: "0",
17793      bottom: "0",
17794      left: "0",
17795      right: "0",
17796    });
17797
17798    $nextSlide.fadeIn(function () {
17799      settings.$currentSlide.hide();
17800
17801      settings.$nextSlide.css({
17802        position: "relative",
17803        left: "0",
17804        transform: "none",
17805      });
17806
17807      $nextSlide.css(zIndexAttrib, "");
17808      $parent.css(zIndexAttrib, "");
17809
17810      settings.callback();
17811    });
17812  };
17813  /**
17814   * End of FadeInTransition class
17815   */
17816  pub.FadeInTransition = FadeInTransition;
17817
17818  /**
17819   * SlideHorizontallyTransition class changes slides by sliding them horizontally.
17820   * This class can be removed if effect is not used.
17821   * If offset (difference between index of currently displayed slide and index of slide that will be shown)
17822   * is greater than 0, slides are sliding to the left. Otherwise (offset is lower than 0), slides are sliding
17823   * to the right.
17824   * When slide change is raised automatically, slides are always sliding to right (offset == 1).
17825   * If user raises slides change, slides are sliding:
17826   * - to left, if offset is greater than 0 (slide with higher index will be shown or user clicks 'next' navigation item),
17827   * - to right, if offset is lower than 0 (slide with lower index will be shown or user clicks 'prev' navigation item).
17828   * @constructor
17829   */
17830  function SlideHorizontallyTransition() {}
17831  SlideHorizontallyTransition.prototype = new Transition();
17832  SlideHorizontallyTransition.constructor = SlideHorizontallyTransition;
17833  /**
17834   * @member SlideHorizontallyTransition
17835   */
17836  SlideHorizontallyTransition.prototype.onAnimationComplete = function (
17837    settings,
17838    $parent
17839  ) {
17840    settings.$currentSlide.hide();
17841    settings.$nextSlide.css({
17842      top: "",
17843      bottom: "",
17844      left: "",
17845      position: "",
17846      width: "",
17847    });
17848
17849    $parent.css({
17850      left: "",
17851    });
17852
17853    $parent.css("margin-left", "");
17854
17855    settings.callback();
17856  };
17857  /**
17858   * @member SlideHorizontallyTransition
17859   */
17860  SlideHorizontallyTransition.prototype.perform = function (settings, offset) {
17861    var factor = this.factor(settings),
17862      onAnimationComplete = this.onAnimationComplete,
17863      width = settings.$currentSlide.width(),
17864      $parent = settings.$slides.parent();
17865
17866    settings.$nextSlide.css({
17867      top: "0",
17868      bottom: "0",
17869      left: "100%",
17870      position: "absolute",
17871      width: "100%",
17872    });
17873    if (offset > 0) {
17874      settings.$nextSlide.css({
17875        left: "100%",
17876      });
17877    } else {
17878      settings.$nextSlide.css({
17879        left: "-100%",
17880      });
17881    }
17882    settings.$nextSlide.show();
17883    $parent.animate(
17884      {
17885        left: -factor * width + "px",
17886      },
17887      function () {
17888        onAnimationComplete(settings, $parent);
17889      }
17890    );
17891  };
17892  /**
17893   * End of SlideHorizontallyTransition class
17894   */
17895  pub.SlideHorizontallyTransition = SlideHorizontallyTransition;
17896
17897  /**
17898   * SlideVerticallyTransition class changes slides by sliding them vertically.
17899   * This class can be removed if this effect is not used.
17900   * If offset (difference between index of currently displayed slide and index of next slide)
17901   * is greater than 0, slides are sliding from up to down. Otherwise (offset is lower than 0), slides are sliding
17902   * from down to up.
17903   * When slide change is raised automatically, slides are always sliding from up to down (offset == 1).
17904   * If user raises slides change, slides are sliding:
17905   * - from up to down, if offset is greater than 0 (slide with higher index will be shown or user clicks 'next' navigation item),
17906   * - from down to up, if offset is lower than 0 (slide with lower index will be shown or user clicks 'prev' navigation item).
17907   * @constructor
17908   */
17909  function SlideVerticallyTransition() {}
17910  SlideVerticallyTransition.prototype = new Transition();
17911  SlideVerticallyTransition.constructor = SlideVerticallyTransition;
17912  /**
17913   * @member SlideVerticallyTransition
17914   */
17915  SlideVerticallyTransition.prototype.onAnimationComplete = function (
17916    settings,
17917    $parent
17918  ) {
17919    settings.$currentSlide.hide();
17920    settings.$nextSlide.css({
17921      top: "",
17922      bottom: "",
17923      left: "",
17924      right: "",
17925      position: "",
17926      width: "",
17927    });
17928
17929    $parent.css("top", "");
17930    $parent.css("margin-top", "");
17931
17932    settings.callback();
17933  };
17934  /**
17935   * @member SlideVerticallyTransition
17936   */
17937  SlideVerticallyTransition.prototype.perform = function (settings, offset) {
17938    var factor = this.factor(settings),
17939      onAnimationComplete = this.onAnimationComplete,
17940      height = settings.$currentSlide.height(),
17941      $parent = settings.$slides.parent();
17942
17943    settings.$nextSlide.css({
17944      left: "0",
17945      right: "0",
17946      position: "absolute",
17947      width: "100%",
17948    });
17949    if (offset > 0) {
17950      settings.$nextSlide.css({
17951        top: "-100%",
17952        bottom: "100%",
17953      });
17954    } else {
17955      settings.$nextSlide.css({
17956        top: "100%",
17957        bottom: "-100%",
17958      });
17959    }
17960    settings.$nextSlide.show();
17961
17962    $parent.animate(
17963      {
17964        top: factor * height,
17965      },
17966      function () {
17967        onAnimationComplete(settings, $parent);
17968      }
17969    );
17970  };
17971  /**
17972   * SlideVerticallyTransition class
17973   */
17974  pub.SlideVerticallyTransition = SlideVerticallyTransition;
17975
17976  return pub;
17977})(jQuery);
17978/**
17979 * end of XA.component.carousels.Transitions module.
17980 */
17981
17982/**
17983 * XAContext
17984 *
17985 * XA.component.carousels.IndicatorViews module.
17986 *
17987 * Exposes View class, which is a base class of all 'time indicator' views used by carousels (@see XA.component.carousels, @see View).
17988 * Also exposes implementation of these 'time indicator' views:
17989 * - ProgressBarView - shows the progress of time with a progress bar,
17990 * - RotatorView - shows the progress of time with the filling up ring.
17991 * Carousel takes the class constructor by name from this module (it is given in options object of carousel; @see XA.component.carousels).
17992 * If there is a need to implement the new 'time indicator' view, create a new class
17993 * by inheriting from View class and add it to this module. During implementation of a new 'time indicator'
17994 * view the XA.component.carousels.IndicatorsView.Tools namespace. It contains:
17995 * - isCssSupported(props) function, which checks if any of CSS properties is supported (props - array of properties),
17996 * - isTransformSupported() function, which checks if CSS 3 'transform' is supported.
17997 *
17998 * Example view implementation (opacity increases with a progress of the time):
17999 * (function() {
18000 *     var View = XA.component.carousels.IndicatorViews.View;
18001 *
18002 *     function SampleView (selector, options) {
18003 *         //base constructor have to be called
18004 *         View.call(this, selector);
18005 *     }
18006 *
18007 *     SampleView.prototype = new View();
18008 *     SampleView.constructor = SampleView;
18009 *
18010 *     SampleView.prototype.init = function (timeout) {
18011 *         //base method have to be called
18012 *         View.prototype.init.call(this, timeout);
18013 *
18014 *         //initialization code - not needed in this example
18015 *     };
18016 *
18017 *     SampleView.prototype.reset = function () {
18018 *         //base method have to be called
18019 *         View.prototype.reset.call(this);
18020 *
18021 *         //reseting 'time indicator' view
18022 *         this.$indicator.stop(true);
18023 *         this.$indicator.css('opacity', 0);
18024 *     };
18025 *
18026 *     SampleView.prototype.pause = function () {
18027 *         //stoping 'time indicator' view animation
18028 *         this.$indicator.stop(true);
18029 *     };
18030 *
18031 *     SampleView.prototype.play = function () {
18032 *         //starting/resuming 'time indicator' view animation
18033 *         this.$indicator.animate({
18034 *             'opacity': 1
18035 *         }, this.timeout - this.timeElapsed, 'linear');
18036 *     };
18037 *
18038 *     XA.component.carousels.IndicatorViews.SampleView = SampleView;
18039 * }());
18040 *
18041 */
18042XA.component.carousels.IndicatorViews = (function ($) {
18043  var pub = {},
18044    supportElementStyle = null;
18045
18046  /**
18047   * Checks if the CSS properties are supported.
18048   *
18049   * @param {Array} props     array of properties to be checked
18050   * @return true if any of CSS properties is supported, false otherwise
18051   * @type Boolean
18052   */
18053  function isCssSupported(props) {
18054    var i,
18055      isSupported = false;
18056
18057    if (supportElementStyle === null) {
18058      supportElementStyle = document.createElement("supportElement").style;
18059    }
18060
18061    for (i = 0; i < props.length; i++) {
18062      if (supportElementStyle[props[i]] !== undefined) {
18063        isSupported = true;
18064        break;
18065      }
18066    }
18067
18068    return isSupported;
18069  }
18070
18071  /**
18072   * Checks if CSS 3 'transform' is supported.
18073   *
18074   * @return true if CSS 3 'transform' is supported, false otherwise
18075   * @type Boolean
18076   */
18077  function isTransformSupported() {
18078    return isCssSupported([
18079      "transformProperty",
18080      "WebkitTransform",
18081      "MozTransform",
18082      "OTransform",
18083      "msTransform",
18084    ]);
18085  }
18086
18087  /**
18088     * XA.component.carousels.IndicatorViews.Tools namespace
18089     *
18090     This namespace can be removed if RotatorView class is not used (@see RotatorView)
18091     */
18092  pub.Tools = {};
18093  pub.Tools.isCssSupported = isCssSupported;
18094  pub.Tools.isTransformSupported = isTransformSupported;
18095  /**
18096   * End of namespace
18097   */
18098
18099  /**
18100   * View class is a base class of all 'time indicator' views
18101   * @constructor
18102   * @param {String} selector a selector used for searching
18103   * @param {Object} options   View options object
18104   */
18105  /* eslint-disable */
18106  function View(selector, options) {
18107    /**
18108     * A jQuery object containing element that will be animated to show time progress.
18109     *
18110     * @member View
18111     */
18112
18113    this.$indicator = $(selector);
18114  }
18115  /* eslint-enable */
18116  /**
18117   * Initializes the view.
18118   *
18119   * @member Viewion
18120   * @param {Number} timeout   a timeout to the end of whole indicator animation
18121   */
18122  View.prototype.init = function (timeout) {
18123    this.timeElapsed = 0;
18124    this.timeout = timeout;
18125  };
18126  /**
18127   * Resets the view
18128   *
18129   * @member View
18130   */
18131  View.prototype.reset = function () {
18132    this.timeElapsed = 0;
18133  };
18134  /**
18135   * Starts/Renews the view animation.
18136   *
18137   * @member View
18138   */
18139  View.prototype.play = function () {};
18140  /**
18141   * Pauses the view animation.
18142   *
18143   * @member View
18144   */
18145  View.prototype.pause = function () {};
18146  /**
18147   * Updates the time that elapsed since animation began.
18148   *
18149   * @member View
18150   */
18151  View.prototype.update = function (timeElapsed) {
18152    this.timeElapsed = timeElapsed;
18153  };
18154  /**
18155   * end of View class
18156   */
18157  pub.View = View;
18158
18159  /**
18160   * ProgressBarView class provides a logic for animate a 'time indicator',
18161   * that looks like progress bar.
18162   *
18163   * Options object:
18164   * {
18165   *     'opacity': Number value //between 0 and 1; default is 0.8
18166   * }
18167   *
18168   * This class can be removed if this kind of view is not used.
18169   *
18170   * @constructor
18171   * @param {String} selector a selector used for searching
18172   * @param {Object} options   View options object
18173   */
18174  function ProgressBarView(selector, options) {
18175    View.call(this, selector);
18176
18177    var defaults = {
18178      opacity: 0.8,
18179    };
18180
18181    this.settings = $.extend(true, {}, defaults, options);
18182
18183    this.$container = this.$indicator;
18184    this.$indicator = this.$indicator.find("div");
18185  }
18186  ProgressBarView.prototype = new View();
18187  ProgressBarView.constructor = ProgressBarView;
18188  /**
18189   * @member ProgressBarView
18190   */
18191  ProgressBarView.prototype.init = function (timeout) {
18192    View.prototype.init.call(this, timeout);
18193
18194    var opacity = this.settings.opacity;
18195    this.$container.css("opacity", opacity);
18196    this.$indicator.css("opacity", opacity);
18197  };
18198  /**
18199   * @member ProgressBarView
18200   */
18201  ProgressBarView.prototype.reset = function () {
18202    View.prototype.reset.call(this);
18203
18204    this.$indicator.stop(true);
18205    this.$indicator.css("width", "0px");
18206  };
18207  /**
18208   * @member ProgressBarView
18209   */
18210  ProgressBarView.prototype.pause = function () {
18211    this.$indicator.stop(true);
18212  };
18213  /**
18214   * @member ProgressBarView
18215   */
18216  ProgressBarView.prototype.play = function () {
18217    this.$indicator.animate(
18218      {
18219        width: "100%",
18220      },
18221      this.timeout - this.timeElapsed,
18222      "linear"
18223    );
18224  };
18225  /**
18226   * end of ProgressBarView class
18227   */
18228  pub.ProgressBarView = ProgressBarView;
18229
18230  /**
18231   * RotatorView class provides a logic for animate a 'time indicator',
18232   * that shows the progress of time with the filling up ring
18233   *
18234   * Options object:
18235   * {
18236   *     'opacity': Number value //between 0 and 1; default is 0.5
18237   * }
18238   *
18239   * This class can be removed if this kind of view is not used.
18240   *
18241   * @constructor
18242   * @param {String} selector a selector used for searching
18243   * @param {Object} options   View options object
18244   */
18245  function RotatorView(selector, options) {
18246    View.call(this, selector);
18247
18248    var defaults = {
18249      opacity: 0.5,
18250    };
18251
18252    this.settings = $.extend(true, {}, defaults, options);
18253    this.$mask = this.$indicator.find("span.mask").first();
18254    this.$rotator = this.$indicator.find("span.rotator").first();
18255
18256    function rotateCss(deg) {
18257      var value = "rotate(" + deg + "deg)";
18258
18259      return {
18260        "-webkit-transform": value,
18261        "-moz-transform": value,
18262        "-o-transform": value,
18263        "-ms-transform": value,
18264        transform: value,
18265      };
18266    }
18267
18268    function animateRotator($rotator, options) {
18269      var defaults = {
18270          fontSize: "180px",
18271          animateOptions: {
18272            step: function (now) {
18273              $rotator.css(rotateCss(now));
18274            },
18275            easing: "linear",
18276          },
18277        },
18278        settings = $.extend(true, {}, defaults, options);
18279
18280      $rotator.animate(
18281        {
18282          "font-size": settings.fontSize,
18283        },
18284        settings.animateOptions
18285      );
18286    }
18287
18288    function phaseTwoAnimation($mask, $rotator, duration) {
18289      $rotator.addClass("half");
18290      $mask.addClass("half");
18291
18292      animateRotator($rotator, {
18293        fontSize: "360px",
18294        animateOptions: {
18295          duration: duration,
18296        },
18297      });
18298    }
18299
18300    function phaseOneAnimation($mask, $rotator, duration, phaseTwoDuration) {
18301      animateRotator($rotator, {
18302        animateOptions: {
18303          duration: duration,
18304          complete: function () {
18305            phaseTwoAnimation($mask, $rotator, phaseTwoDuration);
18306          },
18307        },
18308      });
18309    }
18310
18311    this.resetCss = function () {
18312      this.$rotator.removeClass("half");
18313      this.$rotator.css(rotateCss(0));
18314      this.$rotator.css("font-size", "0px");
18315
18316      this.$mask.removeClass("half");
18317    };
18318
18319    this.playPhaseOne = function () {
18320      var duration = this.timeout / 2 - this.timeElapsed;
18321      phaseOneAnimation(this.$mask, this.$rotator, duration, this.timeout / 2);
18322    };
18323
18324    this.playPhaseTwo = function () {
18325      var duration = this.timeout - this.timeElapsed;
18326      phaseTwoAnimation(this.$mask, this.$rotator, duration);
18327    };
18328  }
18329  RotatorView.prototype = new View();
18330  RotatorView.constructor = RotatorView;
18331  /**
18332   * @member RotatorView
18333   */
18334  RotatorView.prototype.init = function (timeout) {
18335    View.prototype.init.call(this, timeout);
18336
18337    if (isTransformSupported()) {
18338      this.$indicator.show();
18339      this.$mask.css("opacity", this.settings.opacity);
18340    }
18341  };
18342  /**
18343   * @member RotatorView
18344   */
18345  RotatorView.prototype.reset = function () {
18346    View.prototype.reset.call(this);
18347
18348    this.$rotator.stop(true);
18349    this.resetCss();
18350  };
18351  /**
18352   * @member RotatorView
18353   */
18354  RotatorView.prototype.pause = function () {
18355    this.$rotator.stop(true);
18356  };
18357  /**
18358   * @member RotatorView
18359   */
18360  RotatorView.prototype.play = function () {
18361    var phase = this.playPhaseOne;
18362    if (this.timeElapsed >= this.timeout / 2) {
18363      phase = this.playPhaseTwo;
18364    }
18365
18366    phase.call(this);
18367  };
18368  /**
18369   * end of RotatorView class
18370   */
18371  pub.RotatorView = RotatorView;
18372
18373  return pub;
18374})(jQuery);
18375/**
18376 * end of XA.component.carousels.IndicatorViews module.
18377 */
18378
18379
18380/*  component-container  */
18381/**
18382 * Component Container
18383 * @module Container
18384 * @param  {jQuery} $ Instance of jQuery
18385 * @param  {Underscore} _ Instance of Underscore
18386 * @return {Object} List of Container methods
18387 */
18388XA.component.parallax = (function($, _) {
18389    /**
18390     * This object stores all public api methods
18391     * @type {Object.<Methods>}
18392     * @memberOf module:Container
18393     * */
18394    var api = {};
18395    /**
18396     * Check if document size is less than 768px
18397     * @memberOf module:Container
18398     * @method
18399     * @private
18400     * @return {boolean} True|False
18401     */
18402    function checkMobile() {
18403        return $(window).width() < 768;
18404    }
18405     /**
18406     * Make parralax effect for container
18407     * @memberOf module:Container
18408     * @method
18409     * @param {jQuery.<Element>} $el 
18410     * @private
18411     */
18412    function makeParallax($el) {
18413        var $bg = $el.children(".component-content"),
18414            vHeight = $(window).height(),
18415            elOffset = $bg[0].offsetTop,
18416            elHeight = $bg[0].offsetHeight,
18417            isMobile = checkMobile();
18418
18419        function parallax() {
18420            if (isMobile) {
18421                return false;
18422            }
18423
18424            var offset = $(window).scrollTop();
18425
18426            if ((elOffset <= offset + vHeight) && (elOffset + elHeight >= offset)) {
18427                $bg.css("background-position", "50% " + Math.round((elOffset - offset) * 3 / 8) + "px");
18428            }
18429        }
18430
18431        parallax();
18432
18433        $(document).on("scroll", _.throttle(parallax, 10));
18434        $(window).on("resize", _.throttle(function() {
18435            isMobile = checkMobile();
18436            isMobile ? $bg.css("background-position", "50% 0") : parallax();
18437        }, 150));
18438    }
18439    /**
18440     * Call
18441     * ["makeParallax"]{@link  module:Container.makeParallax} method
18442     * @memberOf module:Container
18443     * @method
18444     * @param {jQuery} component Root DOM element of Container component wrapped by jQuery
18445     * of container component
18446     * @alias module:Container.initInstance
18447     */
18448    api.initInstance=function(component) {
18449        makeParallax(component);
18450    }
18451    /**
18452     * Finds all not-initialized Container
18453     * components and runs each container in a loop.
18454     * ["initInstance"]{@link module:Container.initInstance}
18455     * method.
18456     * @memberOf module:Container
18457     * @alias module:Container.init
18458     */
18459    api.init = function() {
18460        $('.parallax-background:not(.initialized)').each(function() {
18461            api.initInstance($(this));
18462            $(this).addClass('initialized');
18463        });
18464    };
18465
18466    return api;
18467
18468})(jQuery, _);
18469
18470XA.register('parallax-background', XA.component.parallax);
18471
18472/*  component-disqus  */
18473/**
18474 * Component Disqus
18475 * @module Disqus
18476 * @param  {jQuery} $ Instance of jQuery
18477 * @param  {Document} document Instance of Document
18478 * @return {Object} List of Disqus methods
18479 */
18480XA.component.disqus = (function($, document) {
18481    /**
18482     * This object stores all public api methods
18483     * @type {Object.<Methods>}
18484     * @memberOf module:Archive
18485     * */
18486    var api = {};
18487    /**
18488     * initDisqus method create script element  for discuss component
18489     * @memberOf module:Disqus
18490     * @method
18491     * @param {Object} prop option of disqus component
18492     * @alias module:Disqus.initDisqus
18493     * @private
18494     */
18495    function initDisqus(prop) {
18496        var dsq = document.createElement("script");
18497        dsq.type = "text/javascript";
18498        dsq.async = true;
18499        dsq.src = "//" + prop.disqus_shortname + ".disqus.com/embed.js";
18500        (
18501            document.getElementsByTagName("head")[0] ||
18502            document.getElementsByTagName("body")[0]
18503        ).appendChild(dsq);
18504    }
18505    /**
18506     * initInstance method sets up disqus_config and calls
18507     * [".initDisqus"]{@link module:Disqus.initDisqus}  method.
18508     * @memberOf module:Disqus
18509     * @method
18510     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
18511     * @param {Object} prop option of disqus component
18512     * @alias module:Disqus.initInstance
18513     */
18514    api.initInstance = function(component, prop) {
18515        window.disqus_config = function() {
18516            this.page.url = prop.disqus_url;
18517            this.page.identifier = prop.disqus_identifier;
18518            this.page.title = prop.disqus_title;
18519            this.page.category_id = prop.disqus_category_id;
18520        };
18521
18522        if (component.find("#disqus_thread").length > 0) {
18523            initDisqus(prop);
18524        }
18525    };
18526    /**
18527     * init method calls in a loop for each
18528     * disqus component on a page and runs Disqus's
18529     * [".initInstance"]{@link module:Disqus.initInstance}  method.
18530     * @memberOf module:Disqus
18531     * @alias module:Disqus.init
18532     */
18533    api.init = function() {
18534        var disqus = $(".disqus:not(.initialized)");
18535        disqus.each(function() {
18536            var properties = $(this).data("properties");
18537            api.initInstance($(this), properties);
18538            $(this).addClass("initialized");
18539        });
18540    };
18541
18542    return api;
18543})(jQuery, document);
18544
18545XA.register("disqus", XA.component.disqus);
18546
18547
18548/*  component-facebook  */
18549/**
18550 * Component facebook
18551 * @module Facebook
18552 * @param  {jQuery} $ Instance of jQuery
18553 * @param  {Document} document Instance of Document
18554 * @return {Object} List of Facebook methods
18555 */
18556XA.component.facebook = (function($, document) {
18557    /**
18558     * This object stores all public api methods
18559     * @type {Object.<Methods>}
18560     * @memberOf module:Facebook
18561     */
18562    var api = {};
18563    /**
18564     * initInstance method sets up facebook properties and
18565     * adds facebook script
18566     * @memberOf module:Facebook
18567     * @method
18568     * @alias module:Facebook.initInstance
18569     */
18570    api.initInstance = function() {
18571        (function(d, s, id) {
18572            var js,
18573                script = d.getElementsByTagName(s)[0];
18574            if (d.getElementById(id)) {
18575                return;
18576            }
18577            js = d.createElement(s);
18578            js.id = id;
18579            js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
18580            script.insertBefore(js, script.firstChild);
18581        })(document, "script", "facebook-jssdk");
18582    };
18583    /**
18584     * init method calls in a loop for each
18585     * facebook component on a page and runs Facebook's
18586     * [".initInstance"]{@link module:Facebook.initInstance}  method.
18587     * @memberOf module:Facebook
18588     * @alias module:Facebook.init
18589     */
18590    api.init = function() {
18591        var facebook = $(".fb-comments:not(.initialized)");
18592
18593        facebook.each(function() {
18594            api.initInstance();
18595            $(this).addClass("initialized");
18596        });
18597    };
18598
18599    return api;
18600})(jQuery, document);
18601
18602XA.register("facebook", XA.component.facebook);
18603
18604
18605/*  component-flip  */
18606/**
18607 * Component Flip
18608 * @module Flip
18609 * @param  {jQuery} $ Instance of jQuery
18610 * @return {Object} List of flip methods
18611 */
18612XA.component.flip = (function($) {
18613    var initialized = false;
18614
18615    /**
18616     * This object stores all public api methods
18617     * @type {Object.<Methods>}
18618     * @memberOf module:Flip
18619     * @
18620     * */
18621    var api = {
18622            /**
18623             * equalSideHeight set css "min-height" property with value that is
18624             * equal to size of bigger flip side 
18625             * @param {jQuery<DOMElement>} $el  Root DOM element of Flip component wrapped by jQuery 
18626             * @memberof module:Flip
18627             * @method equalSideHeight
18628             */
18629            equalSideHeight: function($el) {
18630                var side0 = $el.find(".Side0"),
18631                    side1 = $el.find(".Side1"),
18632                    slide0Height = this.calcSlideSizeInToggle(side0),
18633                    slide1Height = this.calcSlideSizeInToggle(side1),
18634                    maxHeight = Math.max(slide0Height, slide1Height);
18635                $el.find(".flipsides").css({ "min-height": maxHeight + "px" });
18636                side0.add(side1).css({ bottom: 0 });
18637            },
18638            /**
18639             * calcSlideSizeInToggle calculates size of slide content
18640             * @param {jQuery<DOMElement>} $slide Slide DOM Element of flip component
18641             * @memberof module:Flip
18642             * @method calcSlideSizeInToggle
18643             * @return {number} size
18644             */
18645            calcSlideSizeInToggle: function($slide) {
18646                var child = $slide.find(">div"),
18647                    size = 0;
18648                child.each(function(pos, el) {
18649                    size += $(el).outerHeight(true);
18650                });
18651                size += parseInt($slide.css("padding-top"));
18652                size += parseInt($slide.css("padding-bottom"));
18653                return size;
18654            },
18655            /**
18656             * equalSideHeightInToggle method that called from component toggle 
18657             * to make all slides inside same height
18658             * @param {jQuery<DOMElement>} $el  Root DOM element of Flip component wrapped by jQuery 
18659             * @memberof module:Flip
18660             * @method equalSideHeightInToggle
18661             */
18662            equalSideHeightInToggle: function($el) {
18663                var side0 = $el.find(".Side0"),
18664                    side1 = $el.find(".Side1"),
18665                    slide0Height = this.calcSlideSizeInToggle(side0),
18666                    slide1Height = this.calcSlideSizeInToggle(side1),
18667                    maxHeight = Math.max(slide0Height, slide1Height);
18668                $el.find(".flipsides").css({ "min-height": maxHeight + "px" });
18669                side0.add(side1).css({ bottom: 0 });
18670            }
18671        };
18672
18673    function detectMobile() {
18674        return "ontouchstart" in window;
18675    }
18676    /**
18677     * calcHeightOnResize method calls
18678     * ["equalSideHeight"]{@link module:Flip.equalSideHeight} method
18679     * for all initialized Flip components
18680     * @memberOf module:Flip
18681     * @method
18682     * @alias module:Flip.initInstance
18683     * @private
18684     */
18685    function calcHeightOnResize() {
18686        var flip = $(".flip.initialized");
18687        flip.each(function() {
18688            api.equalSideHeight($(this));
18689        });
18690    }
18691    /**
18692     * initInstance method binds toggling "active" class for component
18693     * an Flip element
18694     * @memberOf module:Flip
18695     * @method
18696     * @param {jQuery} component Root DOM element of flip component wrapped by jQuery
18697     * @alias module:Flip.initInstance
18698     */
18699    api.initInstance = function(component) {
18700        // Set tabindex=0 for first header
18701        component.find('[class*="Side0"]').attr("tabindex", "0");
18702        //
18703        if (component.hasClass("flip-hover") && !detectMobile()) {
18704            component.hover(
18705                function() {
18706                    component.addClass("active");
18707                },
18708                function() {
18709                    component.removeClass("active");
18710                }
18711            );
18712        } else {
18713            component.on("click", function() {
18714                component.toggleClass("active");
18715            });
18716        }
18717    };
18718
18719    api.initFlips = function() {
18720        var flip = $(".flip:not(.initialized)");
18721
18722        flip.each(function () {
18723            var $flipModule = $(this).find(".flipsides");
18724            $flipModule.find(".Side0").attr("tabindex", "0");
18725            api.initInstance($(this));
18726            $(this).addClass("initialized");
18727
18728            api.equalSideHeight($(this));
18729        });
18730    }
18731
18732    /**
18733     * init method calls in a loop for each
18734     * flip component on a page and runs Flip's
18735     * ["initInstance"]{@link module:Flip.api.initInstance},
18736     * ["equalSideHeight"]{@link module:Flip.equalSideHeight} methods.
18737     * Added watcher to "resize" event on window that call
18738     * ["calcHeightOnResize"]{@link module:Flip.calcHeightOnResize}
18739     *
18740     * @memberOf module:Flip
18741     * @alias module:Flip.init
18742     */
18743    api.init = function() {
18744        $(window).on("resize", function() {
18745            calcHeightOnResize();
18746        });
18747
18748        if (!initialized) {
18749            $(document).ready(function () {
18750                api.initFlips();
18751                initialized = true;
18752            })
18753        } else {
18754            api.initFlips();
18755        }
18756    };
18757    return api;
18758})(jQuery, document);
18759
18760XA.register("flip", XA.component.flip);
18761
18762
18763/*  component-fullcalendar  */
18764/* global googleCalendarApiKey:true */
18765/**
18766 * Component Fullcalendar
18767 * @module Fullcalendar
18768 * @param  {jQuery} $ Instance of jQuery
18769 * @return {Object} List of archive methods
18770 */
18771XA.component.calendar = (function($) {
18772    /**
18773     * This class is used by [Fullcalendar]{@link module:Fullcalendar} module for
18774     * storing events option
18775     * @class GetEvents
18776     * @memberOf module:Fullcalendar
18777     * @param {string} selector selector of event element
18778     * @param {Object} options options of component
18779     */
18780    function GetEvents(selector, options) {
18781        this.data = options.data;
18782        this.selector = selector;
18783        this.options = options;
18784        this.events = [];
18785
18786        this.checkSource();
18787    }
18788    /**
18789     * checkSource method calls ["getJson"]{@link module:Fullcalendar.GetEvents.getJson}
18790     * if "options.dataType" equal "json"
18791     * and creates instance of
18792     * ["InitCalendar"]{@link module:Fullcalendar.InitCalendar} class
18793     * @name checkSource
18794     * @function
18795     * @memberOf module:Fullcalendar.GetEvents
18796     */
18797    GetEvents.prototype.checkSource = function() {
18798        var inst = this;
18799
18800        switch (inst.options.dataType) {
18801            case "json":
18802                inst.getJson();
18803                new InitCalendar(inst.selector, inst.options, inst.events);
18804                break;
18805            case "gcalendar":
18806                new InitCalendar(inst.selector, inst.options, inst.events);
18807                break;
18808        }
18809    };
18810    /**
18811     * getJson method fills array of events with
18812     * new event
18813     * @name getJson
18814     * @function
18815     * @memberOf module:Fullcalendar.GetEvents
18816     */
18817    GetEvents.prototype.getJson = function() {
18818        var inst = this,
18819            date,
18820            dateEnd,
18821            allDay = false,
18822            tempObj = [];
18823
18824        $.each(inst.data, function() {
18825            date = new Date(this.eventStart);
18826            dateEnd = new Date(this.eventEnd);
18827
18828            if (date === dateEnd) {
18829                allDay = true;
18830            }
18831
18832            tempObj = {
18833                title: this.eventName,
18834                start: date,
18835                end: dateEnd,
18836                eventDescription: this.eventDescription,
18837                eventLink: this.eventLink,
18838                eventClass: this.eventClass
18839            };
18840
18841            inst.events.push(tempObj);
18842        });
18843    };
18844
18845    /**
18846     * This class is used by
18847     * [GetEvents]{@link module:Fullcalendar.GetEvents} module and
18848     * initializes instances of calendar with predefined list of options
18849     * @class InitCalendar
18850     * @memberOf module:Fullcalendar
18851     * @param {string} selector DOM Root element of
18852     * @param {Object} options options of component
18853     * @param {Array} events options of event calendar ["event object"]{@link https://fullcalendar.io/docs/event-object}
18854     */
18855    function InitCalendar(selector, options, events) {
18856        var inst = this,
18857            prevNext = "",
18858            title = "",
18859            calendarTypes = "";
18860
18861        if (options.dataType === "gcalendar") {
18862            googleCalendarApiKey = options.calendarApiKey;
18863            events = options.calendarId;
18864        } else {
18865            googleCalendarApiKey = null;
18866        }
18867
18868        options.showPrevNext ? (prevNext = "prev, next") : "";
18869        options.showMonthCaptions ? (title = "title") : "";
18870
18871        for (var i in options.calendarTypes) {
18872            if (options.calendarTypes[i] === "day") {
18873                options.calendarTypes[i] = "basicDay";
18874            } else if (options.calendarTypes[i] === "week") {
18875                options.calendarTypes[i] = "basicWeek";
18876            }
18877        }
18878
18879        if (options.calendarTypes.length > 1) {
18880            calendarTypes = options.calendarTypes.join();
18881        }
18882
18883        var scLocale = options.localization.locale.toLowerCase()
18884        if (!(scLocale in $.fullCalendar.locales)) {
18885            scLocale = scLocale.split("-")[0]
18886            if (!(scLocale in $.fullCalendar.locales)) {
18887                scLocale = "en"
18888            }
18889        }
18890
18891        $(selector).fullCalendar({
18892            locale: scLocale,
18893            nextDayThreshold: "00:00",
18894
18895            buttonText: {
18896                agendaDay: options.localization.agendaDay,
18897                agendaWeek: options.localization.agendaWeek
18898            },
18899
18900            header: {
18901                left: prevNext,
18902                center: title,
18903                right: calendarTypes
18904            },
18905
18906            googleCalendarApiKey: googleCalendarApiKey,
18907            events: events,
18908            renderEvent: false,
18909            eventRender: function(event, element) {
18910                if (options.compactView && options.dataType === "json") {
18911                    $(element).css("display", "none");
18912                } else {
18913                    if (options.dataType === "json") {
18914                        inst.attachTooltip(event, element, false);
18915                    }
18916                }
18917
18918                element.addClass(event.eventClass);
18919            },
18920            eventAfterAllRender: function() {
18921                if (options.compactView && options.dataType === "json") {
18922                    inst.renderCompactCalendarEvents(selector, events);
18923                }
18924            }
18925        });
18926    }
18927    /**
18928     * attachTooltip method creates, positions, and
18929     * animates tooltips for events.
18930     * @method
18931     * @alias attachTooltip
18932     * @memberOf module:Fullcalendar.InitCalendar
18933     * @param {Object} event options of event calendar ["event object"]{@link https://fullcalendar.io/docs/event-object}
18934     * @param {DOMElement} element DOM element of an event
18935     * @param {boolean} compactCalendar  is calendar in compact mode
18936     */
18937    InitCalendar.prototype.attachTooltip = function(
18938        event,
18939        element,
18940        compactCalendar
18941    ) {
18942        var $tooltip, tooltipContent;
18943
18944        $(element).on("mouseenter", function() {
18945            tooltipContent = "";
18946            $(".calendar-tooltip").fadeOut();
18947            $(".calendar-tooltip").remove();
18948
18949            if (compactCalendar) {
18950                tooltipContent = "";
18951                $.each(event, function() {
18952                    tooltipContent +=
18953                        "<div class='compact-event'>" +
18954                        "<span class='title'>" +
18955                        this.title +
18956                        "</span>" +
18957                        "<span class='description'>" +
18958                        this.eventDescription +
18959                        "</span>" +
18960                        "<span class='link'><a href='" +
18961                        this.eventLink +
18962                        "'>Link</a></span></div>";
18963                });
18964            } else {
18965                tooltipContent =
18966                    "<span class='description'>" +
18967                    event.eventDescription +
18968                    "</span>" +
18969                    "<span class='link'>" +
18970                    event.eventLink +
18971                    "</span>";
18972            }
18973            $tooltip = $(
18974                "<div style='border-radius:5px;border:1px solid #000;position:absolute;z-index:999; paading:5px;background:#FFF' class='calendar-tooltip'><div class='arrow'>" +
18975                    "</div><div class='events'>" +
18976                    tooltipContent +
18977                    "</div></div>"
18978            );
18979
18980            $tooltip.css({
18981                left: $(this).offset().left
18982            });
18983            $tooltip.css({
18984                top: $(this).offset().top - $(this).height()
18985            });
18986            $("body").append($tooltip);
18987
18988            var timeout;
18989            $(this).unbind("mouseleave");
18990            $(this).on("mouseleave", function() {
18991                timeout = setTimeout(function() {
18992                    $tooltip.fadeOut(function() {
18993                        $(this).remove();
18994                    });
18995                }, 300);
18996
18997                $tooltip.unbind("mouseenter");
18998                $tooltip.on("mouseenter", function() {
18999                    clearTimeout(timeout);
19000                });
19001            });
19002
19003            $tooltip.unbind("mouseleave");
19004            $tooltip.on("mouseleave", function() {
19005                $(this).fadeOut(function() {
19006                    $(this).remove();
19007                });
19008            });
19009        });
19010    };
19011
19012    /**
19013     * attaches events for single days - compact calendar
19014     * @method
19015     * @alias renderCompactCalendarEvents
19016     * @memberOf module:Fullcalendar.InitCalendar
19017     * @param {Array} events  ["event object"]{@link https://fullcalendar.io/docs/event-object}
19018     * @param {string} selector selector of an event in DOM
19019     */
19020    InitCalendar.prototype.renderCompactCalendarEvents = function(
19021        selector,
19022        events
19023    ) {
19024        var inst = this,
19025            currentDay,
19026            currentDate,
19027            currentEvent,
19028            dc,
19029            mc,
19030            yc,
19031            d,
19032            m,
19033            y,
19034            de,
19035            me,
19036            ye,
19037            he,
19038            startDate,
19039            endDate,
19040            dayEvents = [];
19041
19042        $(selector)
19043            .find(".fc-day")
19044            .each(function() {
19045                currentDay = this;
19046
19047                currentDate = new Date($(this).data("date"));
19048                dc = currentDate.getDate();
19049                mc = currentDate.getMonth();
19050                yc = currentDate.getFullYear();
19051
19052                dayEvents = [];
19053                $.each(events, function() {
19054                    currentEvent = this;
19055                    startDate = new Date(this.start);
19056                    d = startDate.getDate();
19057                    m = startDate.getMonth();
19058                    y = startDate.getFullYear();
19059
19060                    if (this.end) {
19061                        endDate = new Date(this.end);
19062                        de = endDate.getDate();
19063                        me = endDate.getMonth();
19064                        ye = endDate.getFullYear();
19065                        he = endDate.getHours();
19066                    }
19067
19068                    if (
19069                        yc >= y &&
19070                        yc <= ye &&
19071                        mc >= m &&
19072                        mc <= me &&
19073                        dc >= d &&
19074                        dc <= de
19075                    ) {
19076                        if (yc == ye && mc == me && dc == de && he < 9) {
19077                            // If last day and hour < 9 do nothing
19078                        } else {
19079                            $(currentDay).addClass("selected-day");
19080                            dayEvents.push(currentEvent);
19081                        }
19082                    }
19083                });
19084
19085                if (dayEvents.length) {
19086                    inst.attachTooltip(dayEvents, currentDay, true);
19087                }
19088            });
19089    };
19090    /**
19091     * resizeCalendar method runs render of a calendar
19092     * @memberOf module:Fullcalendar
19093     * @param {string} selector  Selector of a calendar component
19094     * @private
19095     */
19096    function resizeCalendar(selector) {
19097        $(selector).fullCalendar("render");
19098    }
19099    /**
19100     * This object stores all public api methods
19101     * @type {Object.<Methods>}
19102     * @memberOf module:Fullcalendar
19103     * */
19104    var api = {};
19105    /**
19106     * initInstance method creates instance of
19107     * ["GetEvents"]{@link module:Fullcalendar.GetEvents} class and bind
19108     * ["resizeCalendar"]{@link module:Fullcalendar.resizeCalendar} to window resize
19109     * event
19110     * @memberOf module:Fullcalendar
19111     * @alias module:Fullcalendar.initInstance
19112     */
19113    api.initInstance = function(component, prop) {
19114        var selector = "#" + component.find(".event-calendar-inner").attr("id");
19115        if (prop.compactView && prop.dataType === "json") {
19116            $(this).addClass("compact-mode");
19117        }
19118
19119        new GetEvents(selector, prop);
19120
19121        $(window).resize(function() {
19122            resizeCalendar(selector);
19123        });
19124    };
19125
19126    /**
19127     * init method calls in a loop for each
19128     * full calendar component on a page and run Full calendar's
19129     * ["initInstance"]{@link module:Fullcalendar.api.initInstance} method
19130     * @memberOf module:Fullcalendar
19131     * @alias module:Fullcalendar.init
19132     */
19133    api.init = function() {
19134        $(".event-calendar:not(.initialized)").each(function() {
19135            var properties = $(this).data("properties");
19136            api.initInstance($(this), properties);
19137            $(this).addClass("initialized");
19138        });
19139    };
19140
19141    return api;
19142})(jQuery, document);
19143
19144XA.register("calendar", XA.component.calendar);
19145
19146
19147/*  component-galleria  */
19148/**
19149 * Component Galleria
19150 * @module Galleria
19151 * @param  {jQuery} $ Instance of jQuery
19152 * @return {Object} List of Galleria component methods
19153 */
19154XA.component.galleria = (function($) {
19155    /**
19156     * This object stores all public api methods
19157     * @type {Object.<Methods>}
19158     * @memberOf module:Galleria
19159     * */
19160    /* global Galleria:false */
19161    var api = {};
19162    /**
19163     * Call "Galleria.loadTheme" and  "Galleria.run"
19164     * from [galleria.io]{@link https://galleria.io/}. More about this methods you can
19165     * read [here]{@link https://docs.galleria.io/article/131-static-methods}
19166     * @memberOf module:Galleria
19167     * @method
19168     * @param {jQuery} component Root DOM element of galleria component wrapped by jQuery
19169     * @param {Object} prop Properties set in data attribute
19170     *  of galleria component
19171     * @alias module:Galleria.initInstance
19172     */
19173    api.initInstance = function(component, prop) {
19174        var id = component.find(".gallery-inner").attr("id"),
19175            script = $('script[src="' + prop.theme + '"]');
19176
19177        // Galleria not iniitalize gallery in case
19178        // if Galleria script already exists
19179        if (script) {
19180            script.remove();
19181        }
19182
19183        $(document).ready(function () {
19184            var galleriaHeight  = prop.height? prop.height: "250px"
19185			var _prop = Object.assign({}, prop);
19186			delete _prop.theme
19187            jQuery("#" + id).css("height",galleriaHeight)
19188            Galleria.loadTheme(prop.theme);
19189            Galleria.run("#" + id,_prop);
19190            
19191            Galleria.ready(function () {
19192                this.bind('image', function (e) {
19193                    e.imageTarget.alt = e.galleriaData.title;
19194                });
19195            });
19196        })
19197    };
19198    /**
19199     * Finds all not-initialized 
19200     * Gallery components and in a loop for each of them
19201     * runs
19202     * ["initInstance"]{@link module:Galleria.initInstance}
19203     * method.
19204     * @memberOf module:Galleria
19205     * @alias module:Galleria.init
19206     */
19207    api.init = function() {
19208        var gallery = $(".gallery:not(.initialized)");
19209
19210        gallery.each(function() {
19211            var properties = $(this).data("properties");
19212            api.initInstance($(this), properties);
19213            $(this).addClass("initialized");
19214        });
19215    };
19216
19217    return api;
19218})(jQuery, document);
19219
19220XA.register("galleria", XA.component.galleria);
19221
19222
19223/*  component-language-selector  */
19224/**
19225 * Component Language Selector
19226 * @module LanguageSelector
19227 * @param  {jQuery} $ Instance of jQuery
19228 * @return {Object} List of language selector methods methods
19229 */
19230XA.component.languageSelector = (function($) {
19231    /**
19232     * This object stores all public api methods
19233     * @type {Object.<Methods>}
19234     * @memberOf module:LanguageSelector
19235     * */
19236    var api = {};
19237    /**
19238     * readDataAttributes function that return
19239     * name of a language flag in format
19240     * 'flags-'+language name
19241     * @memberOf module:LanguageSelector
19242     * @param {jQuery} item
19243     * @private
19244     */
19245    function readDataAttributes(item) {
19246        var country = item.data("country-code");
19247
19248        return "flags-" + country;
19249    }
19250    /**
19251     * initLanguageSelector sets up flag classes for laguage selector items
19252     * and bind 'click' event to drop-down item that toggle visibility
19253     * @memberOf module:LanguageSelector
19254     * @param {jQuery} instance Root DOM element of language selector
19255     * component
19256     */
19257    function initLanguageSelector(instance) {
19258        var el = $(instance),
19259            header = el.find(".language-selector-select-item"),
19260            dropDownList = el.find(".language-selector-item-container"),
19261            dropDownItem = dropDownList.find(".language-selector-item");
19262
19263        var className = readDataAttributes(header);
19264        header.find(">a").addClass(className);
19265
19266        dropDownList.find(".language-selector-item").each(function() {
19267            className = readDataAttributes($(this));
19268            $(this)
19269                .find(">a")
19270                .addClass(className);
19271        });
19272
19273        header.on("click", function() {
19274            dropDownList.slideToggle();
19275        });
19276
19277        dropDownItem.on("click", function() {
19278            var url = $(this)
19279                .find("a")
19280                .attr("href");
19281
19282            window.location.href = url;
19283        });
19284    }
19285    /**
19286     * initInstance method calls
19287     * [".initLanguageSelector"]{@link module:LanguageSelector.initLanguageSelector}  method.
19288     * @memberOf module:LanguageSelector
19289     * @method
19290     * @param {jQuery} component Root DOM element of language selector component
19291     * @alias module:LanguageSelector.initInstance
19292     */
19293    api.initInstance = function(component) {
19294        initLanguageSelector(component);
19295    };
19296
19297    /**
19298     * init method calls in a loop for each
19299     * language selector component on a page and runs LanguageSelector's
19300     * [".initInstance"]{@link module:LanguageSelector.api.initInstance}  method.
19301     * @memberOf module:LanguageSelector
19302     * @alias module:LanguageSelector.init
19303     */
19304    api.init = function() {
19305        var languageSelector = $(".language-selector:not(.initialized)");
19306
19307        languageSelector.each(function() {
19308            api.initInstance(this);
19309            $(this).addClass("initialized");
19310        });
19311    };
19312
19313    return api;
19314})(jQuery, document);
19315
19316XA.register("language-selector", XA.component.languageSelector);
19317
19318
19319/*  component-navigation  */
19320/**
19321 * Component Navigation
19322 * @module Navigation
19323 * @param  {jQuery} $ Instance of jQuery
19324 * @return {Object} List of navigation methods
19325 */
19326XA.component.navigation = (function($) {
19327    var timeout = 200,
19328        timer = 0,
19329        submenu,
19330        dropDownEvents = {
19331            show: function(sm) {
19332                this.debounce();
19333                submenu = sm;
19334                submenu.closest("li").addClass("show");
19335            },
19336            debounce: function() {
19337                if (timer) {
19338                    clearTimeout(timer);
19339                    timer = null;
19340                }
19341            },
19342            hide: function() {
19343                if (submenu) {
19344                    submenu.closest("li").removeClass("show");
19345                }
19346            },
19347            queueHide: function() {
19348                timer = setTimeout(function() {
19349                    dropDownEvents.hide();
19350                }, timeout);
19351            },
19352            focus: function() {
19353                $(this)
19354                    .closest("li")
19355                    .siblings()
19356                    .removeClass("show");
19357                $(this)
19358                    .closest("li")
19359                    .addClass("show");
19360            },
19361            blur: function() {
19362                if (
19363                    $(this)
19364                        .closest("li")
19365                        .is(".last")
19366                ) {
19367                    $(this)
19368                        .parents(".rel-level1")
19369                        .removeClass("show");
19370                }
19371            }
19372        };
19373
19374    /**
19375     * Prepares DOM structure of Navigation component and
19376     * adds Event listeners of showing and hiding
19377     * different levels of navigation.
19378     * @method
19379     * @alias module:Navigation.dropDownNavigation
19380     * @memberOf module:Navigation
19381     * breadcrum elements wrapped by jquery
19382     * @param {jQuery} navi Root DOM element of
19383     * navigation component wrapped by jQuery
19384     * @private
19385     */
19386    function dropDownNavigation(navi) {
19387        navi.on(
19388            "mouseover",
19389            ".rel-level1 > a, .rel-level1 >.navigation-title>a, .rel-level2 >.navigation-title>a",
19390            function() {
19391                $(this)
19392                    .closest("li")
19393                    .siblings()
19394                    .removeClass("show");
19395                $(this)
19396                    .closest("li.rel-level1")
19397                    .siblings()
19398                    .removeClass("show");
19399                $(this)
19400                    .closest("li.rel-level1")
19401                    .siblings()
19402                    .find(".show")
19403                    .removeClass("show");
19404                var elem = $(this)
19405                    .closest("li")
19406                    .find(">ul");
19407                dropDownEvents.show(elem);
19408            }
19409        );
19410        navi.on(
19411            "mouseleave",
19412            ".rel-level1 > a, .rel-level1 >.navigation-title",
19413            dropDownEvents.queueHide
19414        );
19415        navi.on("mouseover", ".rel-level1 > ul", dropDownEvents.debounce);
19416        navi.on("mouseleave", ".rel-level1 > ul", dropDownEvents.queueHide);
19417        navi.on(
19418            "focus",
19419            ".rel-level1 > a, .rel-level1 >.navigation-title, .rel-level1 >.navigation-title",
19420            dropDownEvents.focus
19421        );
19422        navi.on("blur", ".rel-level2 > a", dropDownEvents.blur);
19423        navi.on("mouseleave", function() {
19424            $(this)
19425                .find(".show")
19426                .removeClass("show");
19427        });
19428        navi.find(".rel-level1").each(function() {
19429            if ($(this).find("ul").length) {
19430                $(this).addClass("submenu");
19431            }
19432        });
19433
19434        navi.find(".rel-level2").each(function() {
19435            //if level2 menu has children
19436            if ($(this).parents("#header") > 0) {
19437                if ($(this).find("ul").length) {
19438                    $(this).addClass("submenu");
19439                    $(this)
19440                        .parents(".rel-level1")
19441                        .addClass("wide-nav");
19442                }
19443            }
19444
19445            //if level2 menu should be navigation-image variant
19446            if ($(this).find("> img").length) {
19447                $(this).addClass("submenu navigation-image");
19448            }
19449        });
19450
19451        navi.on("click", ".sxaToogleNavBtn", function() {
19452            var $this = jQuery(this);
19453            $this.find(".sxaWrappedList").toggleClass("hidden");
19454        });
19455    }
19456    /**
19457     * Prepares DOM structure of Mobile Navigation component and
19458     * adds Event listeners of showing and hiding
19459     * different levels of navigation.
19460     * @method
19461     * @alias module:Navigation.mobileNavigation
19462     * @memberOf module:Navigation
19463     * breadcrum elements wrapped by jquery
19464     * @param {jQuery} navi Root DOM element of
19465     * navigation component wrapped by jQuery
19466     * @private
19467     */
19468    function mobileNavigation(navi) {
19469        function checkChildren(nav) {
19470            nav.find(".rel-level1").each(function() {
19471                if (!$(this).find("ul").length) {
19472                    $(this).addClass("no-child");
19473                }
19474            });
19475        }
19476
19477        function bindEvents(nav) {
19478            nav.find(".navigation-title").on("click", function(e) {
19479                var navlvl = $(this).closest("li"),
19480                    menuParent = navlvl.parents(".navigation");
19481
19482                if (menuParent.hasClass("navigation-mobile")) {
19483                    if (!$(e.target).is("a")) {
19484                        if (navlvl.hasClass("active")) {
19485                            navlvl.find(">ul").slideToggle(function() {
19486                                navlvl.removeClass("active");
19487                            });
19488                        } else {
19489                            navlvl.find(">ul").slideToggle(function() {
19490                                navlvl.addClass("active");
19491                            });
19492                        }
19493                    }
19494                }
19495            });
19496
19497            nav.find(".rel-level1").on("focus", function() {
19498                $(this)
19499                    .siblings("ul")
19500                    .slideDown();
19501                $(this)
19502                    .closest("li")
19503                    .siblings()
19504                    .find("ul")
19505                    .slideUp();
19506            });
19507        }
19508        checkChildren(navi);
19509        bindEvents(navi);
19510    }
19511
19512    /**
19513     * @method
19514     * @alias module:Navigation.toggleIcon
19515     * @memberOf module:Navigation
19516     * @param {$} toggle
19517     * navigation elements wrapped by jquery
19518     * @private
19519     */
19520    function toggleIcon(toggle) {
19521        $(toggle).on("click", function() {
19522            $(this)
19523                .parents(".navigation")
19524                .toggleClass("active");
19525            $(this).toggleClass("active");
19526        });
19527    }
19528
19529    /**
19530     * This object stores all public api methods
19531     * @type {Object.<Methods>}
19532     * @memberOf module:Navigation
19533     * */
19534    var api = {};
19535
19536    /**
19537     * initIstance method. <br/>
19538     * If added <b>navigation-main</b> class
19539     * called [dropDownNavigation]{@link module:Navigation.dropDownNavigation},
19540     * [mobileNavigation]{@link module:Navigation.mobileNavigation} methods. <br/>
19541     * If added <b>navigation-mobile</b> class
19542     * called only [mobileNavigation]{@link module:Navigation.mobileNavigation},
19543     * @memberOf module:Navigation
19544     * @method
19545     * @param {jQuery} component Root DOM element of
19546     * navigation component wrapped by jQuery
19547     * @alias module:Navigation.initInstance
19548     */
19549    api.initInstance = function(component) {
19550        if (component.hasClass("navigation-main")) {
19551            dropDownNavigation(component);
19552            mobileNavigation(component);
19553        } else if (component.hasClass("navigation-mobile")) {
19554            mobileNavigation(component);
19555        }
19556    };
19557    /**
19558     * init method calls [initInstance]{@link module:Navigation.initInstance} method
19559     * in a loop for each navigation component on a page. <br/>
19560     *
19561     * For navigation with set <b>mobile-nav</b> class
19562     * calls [toggleIcon]{@link module:Navigation.toggleIcon} method
19563     *
19564     * @memberOf module:Navigation
19565     * @alias module:Navigation.init
19566     */
19567    api.init = function() {
19568        var navigation = $(".navigation:not(.initialized)");
19569        navigation.each(function() {
19570            api.initInstance($(this));
19571            $(this).addClass("initialized");
19572        });
19573
19574        var toggle = $(".mobile-nav:not(.initialized)");
19575        toggle.each(function() {
19576            toggleIcon(this);
19577            $(this).addClass("initialized");
19578        });
19579    };
19580
19581    return api;
19582})(jQuery, document);
19583
19584XA.register("navigation", XA.component.navigation);
19585
19586
19587/*  component-overlay  */
19588/* global mejs:false */
19589/**
19590 * open content in overlay
19591 * @module overlay
19592 * @param  {jQuery} $ Instance of jQuery
19593 * @return {Object} List of overlay methods
19594 */
19595XA.component.overlay = function ($) {
19596    /**
19597    * This object stores all public api methods
19598    * @type {Object.<Methods>}
19599    * @memberOf module:overlay
19600    * */
19601    var api = {},
19602        href = window.location.href,
19603        host = location.host,
19604        label,
19605        overlayPlaceholder = false,
19606        marginTop = 100,
19607        focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]',
19608        firstTabStop,
19609        lastTabStop,
19610        overlayClickSource,
19611        tempData,
19612		tempDataSplash,
19613		storeApiStatus=false,
19614		splashApiStatus=false;
19615    /**
19616    * isPreviewMode check if page in preview mode
19617    * @memberOf module:overlay
19618    * @private
19619    * @returns {Boolean} is page in a preview mode
19620    */
19621    function isPreviewMode() {
19622        if (href.indexOf("sc_mode=preview") > -1) {
19623            return true;
19624        }
19625        var $hdPageMode = $('#hdPageMode');
19626
19627        return $hdPageMode.length > 0 && $hdPageMode.attr('value') == 'preview';
19628    }
19629    /**
19630    * isEditMode check if page in edit mode
19631    * @memberOf module:overlay
19632    * @private
19633    * @returns {Boolean} is page in a edit mode
19634    */
19635    function isEditMode() {
19636        if (href.indexOf("sc_mode=edit") > -1) {
19637            return true;
19638        }
19639        var $hdPageMode = $('#hdPageMode');
19640
19641        return $hdPageMode.length > 0 && $hdPageMode.attr('value') == 'edit';
19642    }
19643    /**
19644     * isOverlayPage check if "#wrapper" element has class "overlay-page"
19645     * @memberOf module:overlay
19646     * @private
19647     * @returns {Boolean} is #wrapper an overlay page
19648     */
19649    function isOverlayPage() {
19650        return $('#wrapper').hasClass('overlay-page');
19651    }
19652    /**
19653     * hasOverlayContent check if "overlay-source" 
19654     * element present on a page
19655     * @memberOf module:overlay
19656     * @private
19657     * @returns {Boolean} is overlay-source present on a page
19658     */
19659    function hasOverlayContent() {
19660        return $(".overlay-source").length;
19661    }
19662    /**
19663    * resizeOverlay resize overlay
19664    * @memberOf module:overlay
19665    * @param {jQuery<Object>} inner ".overlay-inner"
19666    * @param {jQuery<Object>} content (".component-content"),
19667    * @param {Object} options contains size of overlay 
19668    * @param {number} [options.width] width of overlay
19669    * @param {number} [options.height] height of overlay
19670    * @param {string} [options.percent] units of width and height
19671    * @alias module:overlay.resizeOverlay
19672    */
19673    api.resizeOverlay = function (inner, content, options) {
19674        var unit = "px";
19675        var css = {
19676            "width": "",
19677            "height": ""
19678        };
19679        var wh = $(window).height();
19680
19681        if (options.percent) {
19682            unit = "%";
19683            inner.addClass("overlay-percent");
19684        } else {
19685            inner.removeClass("overlay-percent");
19686        }
19687
19688        if (options.width) {
19689            css["width"] = options.width + unit;
19690        }
19691        if (options.height) {
19692            css["height"] = options.height + unit;
19693        }
19694
19695        css["max-height"] = (wh - marginTop - 0.1 * wh) + "px";
19696
19697        content.css(css);
19698    }
19699    /**
19700    * getUrlVariables get variables provided in overlay url
19701    * @memberOf module:overlay
19702    * @param {String} url url of overlay content
19703    * @private
19704    * @returns {Object} list of get parameters
19705    */
19706    function getUrlVariables(url) {
19707        var q = url.split('?')[1],
19708            vars = [],
19709            hash;
19710
19711        if (q != undefined) {
19712            q = q.split('&');
19713            for (var i = 0; i < q.length; i++) {
19714                hash = q[i].split('=');
19715                vars.push(hash[1]);
19716                vars[hash[0]] = hash[1];
19717            }
19718        }
19719
19720        return vars;
19721    }
19722    /**
19723    * getSize check if overlay has width or height in url 
19724    * and set up this values  
19725    * @memberOf module:overlay
19726    * @param {String} vars variables from url of overlay content
19727    * @private
19728    * @returns {Object} sizes of overlay
19729    */
19730    function getSize(vars) {
19731        var obj = {};
19732
19733        if (vars["width"] !== null) {
19734            obj["width"] = vars["width"];
19735        }
19736
19737        if (vars["height"] !== null) {
19738            obj["height"] = vars["height"];
19739        }
19740
19741        return obj;
19742    }
19743    /**
19744    * checkInternal checks if overlay content is internal resource
19745    * @memberOf module:overlay
19746    * @param {String} url url of overlay content
19747    * @private
19748    * @returns {Boolean} true - content is internal| false - content is external
19749    */
19750    function checkInternal(url) {
19751        if (url.indexOf(host) > -1) {
19752            return true;
19753        }
19754        return false;
19755    }
19756    /**
19757    * checkImage checks if overlay content is an image
19758    * @memberOf module:overlay
19759    * @param {String} url url of overlay content
19760    * @private
19761    * @returns {Boolean} true - content is an image| false - content not an a image
19762    */
19763    function checkImage(url) {
19764        var ext = url.split("?")[0].split('.').pop();
19765        if ($.inArray(ext, ['gif', 'png', 'jpg', 'jpeg']) > -1) {
19766            return true;
19767        }
19768
19769        return false;
19770    }
19771
19772    /**
19773    * loadOverlay creates overlay content and show it
19774    * @memberOf module:overlay
19775    * @param {String} url url of overlay
19776    * @param {jQuery<DOMElement>} overlay overlay DOMElement
19777    * @private
19778    */
19779    function loadOverlay(url, overlay) {
19780        var content = overlay.find(".overlay-inner"),
19781            overlayContent = overlay.find(".component-content"),
19782            vars = getUrlVariables(url),
19783            internalLink = checkInternal(url),
19784            overlaySize = getSize(vars),
19785            suffix;
19786        overlayContent.addClass('overlayFullWidth');
19787        content.removeAttr('style');
19788        if (internalLink) {
19789            if (checkImage(url)) {
19790                content.empty().append($("<img>", { src: url }));
19791                content.css(overlaySize);
19792                overlayContent.removeClass('overlayFullWidth');
19793                showOverlay(overlay);
19794            } else if (url.indexOf("overlaytype=iframe") > -1) {
19795                content.empty().append($("<iframe>", { src: url, style: "width: 100%; height: 100%" }));
19796                content.css(overlaySize);
19797                showOverlay(overlay);
19798            } else {
19799                if (isPreviewMode()) {
19800                    suffix = "cf_overlay=1";
19801                    url = url.replace("sitecore/shell/");
19802                    url += (url.indexOf("?") == -1 ? "?" : "&") + suffix;
19803                }
19804
19805                if(url && url.includes("store"))
19806				{
19807                if(tempData)
19808                {
19809                    content.empty().append(tempData);
19810                }
19811                else
19812                {
19813
19814					if(storeApiStatus === false)
19815					{
19816						storeApiStatus=true;
19817                    $.get(url, function (data) {
19818                        tempData=data;
19819                        var overlayData = $(data).before().first();
19820    
19821                        api.resizeOverlay(content, overlayContent, {
19822                            width: overlayData.attr("data-width"),
19823                            height: overlayData.data("height"),
19824                            percent: overlayData.data("percent")
19825                        });
19826    
19827                        content.empty().append(data);
19828                    });
19829					}
19830                }
19831				}
19832				else
19833				{
19834					 if(tempDataSplash)
19835                {
19836                    content.empty().append(tempDataSplash);
19837                }
19838                else
19839                {
19840					if(splashApiStatus=== false)
19841					{
19842						splashApiStatus=true;
19843                    $.get(url, function (data) {
19844                        tempDataSplash=data;
19845                        var overlayData = $(data).before().first();
19846    
19847                        api.resizeOverlay(content, overlayContent, {
19848                            width: overlayData.attr("data-width"),
19849                            height: overlayData.data("height"),
19850                            percent: overlayData.data("percent")
19851                        });
19852    
19853                        content.empty().append(data);
19854                    });
19855					}
19856                }
19857				}
19858
19859                XA.init();
19860                showOverlay(overlay);
19861            }
19862        } else {
19863            if (checkImage(url)) {
19864                content.empty().append($("<img>", { src: url }));
19865            } else {
19866                content.empty().append($("<iframe >", { src: url, style: "width: 100%; height: 100%" }));
19867            }
19868            content.css(overlaySize);
19869            showOverlay(overlay);
19870        }
19871
19872    }
19873    /**
19874    * preShowOverlay sets opacity to 1 and shows overlay
19875    * @memberOf module:overlay
19876    * @param {jQuery<DOMElement>} overlay overlay DOMElement
19877    * @private
19878    */
19879    function preShowOverlay(overlay) {
19880        overlay.css({
19881            "opacity": 1
19882        }).show();
19883    }
19884    /**
19885    * showOverlay makes overlay visible
19886    * @memberOf module:overlay
19887    * @param {jQuery<DOMElement>} overlay overlay DOMElement
19888    * @private
19889    * @returns {jQuery<DOMElement>} overlay overlay DOMElement
19890    */
19891
19892    function showOverlay(overlay) {
19893        var close, content;
19894
19895        overlay.show();
19896
19897        // hides wrapper data from screen readers
19898        $("#wrapper").addClass("aria-hidden");
19899
19900        overlayClickSource = document.activeElement;
19901
19902        close = overlay.find(".overlay-close");
19903        setTimeout(function () { close.focus(); }, 0);
19904
19905        content = overlay.find(".overlay-inner");
19906        content.blur(function (args) {
19907            args.preventDefault();
19908            args.stopPropagation();
19909            setTimeout(function () { close.focus() }, 0);
19910        });
19911
19912        // Finds all focusable children
19913        var focusableElements = content.find(focusableElementsString);
19914
19915        // Converts NodeList to Array
19916        focusableElements = Array.prototype.slice.call(focusableElements);
19917        firstTabStop = focusableElements[0];
19918        lastTabStop = focusableElements[focusableElements.length - 1];
19919
19920        // Focus first
19921        if(firstTabStop){firstTabStop.focus()};
19922
19923        if (isPreviewMode() || isEditMode()) {
19924            overlay.find('> .component-content').css({
19925                top: 200,
19926                transform: 'translate(-50%, 0)'
19927            });
19928        }
19929
19930        return overlay;
19931    }
19932    /**
19933     * hideOverlay hide overlay
19934     * @memberOf module:overlay
19935     * @private
19936     */
19937    function hideOverlay(overlay) {
19938        $("#wrapper").removeClass("aria-hidden");
19939        var content = overlay.find(".overlay-inner");
19940
19941        overlay.hide();
19942        content.empty();
19943
19944        if (mejs) {
19945            for (var p in mejs.players) {
19946                if ($("#" + mejs.players[p].id).parents(".overlay").length == 1) {
19947                    $("#" + mejs.players[p].id + ' video').attr('src', '');
19948                    mejs.players[p].remove();
19949                    mejs.players.splice(p, 1);
19950                }
19951            }
19952        }
19953
19954        return overlay;
19955    }
19956    /**
19957     * createOverlay creates a markup for overlay and appends it to body 
19958     * @memberOf module:overlay
19959     * @private
19960     */
19961    function createOverlay() {
19962        var overlay = "<div class='overlay-wrapper'>" +
19963            "<div class='overlay component'>" +
19964            "<div class='component-content' role='dialog'>" +
19965            "<div class='overlay-inner'></div>" +
19966            "<div class='overlay-close' role='button' aria-label='Close dialog'></div>" +
19967            "</div>" +
19968            "</div>" +
19969            "</div>";
19970
19971        $("body").append(overlay);
19972    }
19973    /**
19974     * Init form conditions under overlay content
19975     * @memberOf module:overlay
19976     * @private
19977     */
19978    function initFormConditions() {
19979        setTimeout(function () {
19980            if (window.$ && window.$.fn.init_formConditions) {
19981                var forms = window.$(".overlay-inner form[data-sc-fxb]");
19982                if (forms.length) {
19983                    forms.each(function () {
19984                        var formEl = window.$(this);
19985                        var fromInitializer = window.$.fn.init_formConditions.bind(formEl);
19986                        fromInitializer();
19987                    }).parent().on("submit", "form[data-sc-fxb]", function () {
19988                        var $submitBtns = window.$(this).find("input[type='submit'], button[type='submit']");
19989                        if ($submitBtns.length) {
19990                            $submitBtns.on("click", function () {
19991                                return false;
19992                            });
19993                        }
19994                    });
19995                }
19996            }
19997        }, 0)
19998
19999    }
20000
20001    /**
20002    * initInstance method prevent event propagation and call 
20003    * ["preShowOverlay"]{@link module:overlay.preShowOverlay} and
20004    * ["loadOverlay"]{@link module:overlay.loadOverlay} methods
20005    * @memberOf module:overlay
20006    * @method
20007    * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
20008    * @param {jQuery<DOMElement>} overlay overlay DOMElement
20009    * @param {jQuery<DOMElement>} overlayContent overlay content DOMElement 
20010    * @alias module:overlay.initInstance
20011    */
20012    api.initInstance = function (component, overlay, overlayContent) {
20013        component.on("click",
20014            function (event) {
20015                event.preventDefault();
20016                event.stopPropagation();
20017                preShowOverlay(overlay, overlayContent);
20018
20019                var uri = this.href;
20020                loadOverlay(uri, overlay);
20021
20022                var href = this.href.split('/');
20023                for (var i = 0; i <= href.length; i++) {
20024                    label = href.pop();
20025                    if (label.length == 0) {
20026                        continue;
20027                    }
20028                    break;
20029                }
20030            });
20031        // Init forms if they exist inside overlay
20032        initFormConditions();
20033        component.addClass("initialized");
20034    }
20035    /**
20036    * init method makes preparation for overlay content, binds events
20037    * for proper work of overlay and
20038    * calls in a loop for each instance of overlay
20039    * [".initInstance"]{@link module:Accordion.initInstance} method.
20040    * @memberOf module:overlay
20041    * @alias module:overlay.init
20042    */
20043    api.init = function () {
20044        var overlayContent,
20045            overlaySource,
20046            overlayInner,
20047            overlayCloseLink,
20048            closeAction,
20049            page,
20050            overlay,
20051            content;
20052
20053        if (!overlayPlaceholder && hasOverlayContent()) {
20054            createOverlay();
20055        }
20056
20057        if (isOverlayPage()) {
20058
20059            page = $(".overlay-page");
20060            overlayContent = page.children(".component-content");
20061            overlay = $("#spnOverlay");
20062            content = overlayContent.children(".overlay-inner");
20063
20064            api.resizeOverlay(content, overlayContent, {
20065                width: overlayContent.data("width"),
20066                height: overlayContent.data("height"),
20067                percent: overlayContent.data("percent")
20068            });
20069            overlayContent.on("click", function (event) {
20070                if (event.target.type != 'submit') {
20071                    event.stopPropagation();
20072                }
20073            });
20074            page.on("click", function () {
20075                if (isPreviewMode()) {
20076                    location.href = location.href.replace("sc_mode=preview", "sc_mode=edit");
20077                }
20078            });
20079        }
20080        overlay = $(".overlay-wrapper > .overlay");
20081        overlayContent = overlay.find(".component-content");
20082        overlaySource = $(".overlay-source a:not(.initialized), a.overlay-source:not(.initialized)");
20083        overlayInner = $(".overlay-inner");
20084        overlayCloseLink = overlay.find(".overlay-close");
20085
20086        closeAction = function () {
20087            hideOverlay(overlay);
20088            overlayInner.off("blur");
20089            setTimeout(function () {
20090                if (overlayClickSource != null) {
20091                    overlayClickSource.focus();
20092                }
20093            }, 0);
20094        };
20095
20096        if (!overlayPlaceholder) {
20097            overlayContent.on("click", function (event) {
20098                if (event.target.type != 'submit') {
20099                    event.stopPropagation();
20100                }
20101            });
20102
20103            overlay.on("click", function (event) {
20104                if (event.target.type != 'submit') {
20105                    closeAction();
20106                }
20107
20108            });
20109
20110            overlayCloseLink.on("click", function (args) {
20111                args.preventDefault();
20112                closeAction();
20113            });
20114
20115            $("body").keydown(function (e) {
20116                // Check for TAB key press
20117                if (e.keyCode === 9) {
20118                    // SHIFT + TAB
20119                    if (e.shiftKey) {
20120                        if (document.activeElement === firstTabStop) {
20121                            e.preventDefault();
20122                            lastTabStop.focus();
20123                        }
20124
20125                        // TAB
20126                    } else if (document.activeElement === lastTabStop) {
20127                        e.preventDefault();
20128                        // firstTabStop.attr('tabindex', 0);
20129                        firstTabStop.focus();
20130                    }
20131                }
20132
20133                // ESCAPE
20134                if (e.keyCode === 27) {
20135                    e.stopPropagation();
20136                    closeAction();
20137                }
20138            });
20139
20140            $(window).on("resize", function () {
20141                var height = $(window).height();
20142                height = height - marginTop - 0.1 * height;
20143                overlayContent.css("max-height", height + "px");
20144            });
20145
20146            overlayPlaceholder = true;
20147        }
20148
20149
20150        overlaySource.each(function () {
20151            api.initInstance($(this), overlay, overlayContent);
20152        });
20153
20154
20155    };
20156
20157    return api;
20158
20159}(jQuery);
20160
20161XA.register("overlay", XA.component.overlay);
20162
20163function waitForElement(selector, timeout, interval,parentID) {
20164    const startTime = Date.now();
20165
20166    return new Promise((resolve, reject) => {
20167        const timer = setInterval(() => {
20168            const now = Date.now();
20169            const parent=document.getElementById(parentID);
20170
20171            if(parent) {
20172                let element = parent.querySelector(selector);
20173                if (element !== undefined && element !== null) {     
20174                    clearInterval(timer);
20175                    resolve(element); 
20176                    return;           
20177                } else if (timeout && now - startTime >= timeout) { 
20178                    clearInterval(timer);
20179                    reject();
20180                } else {
20181                    element = parent.querySelector(selector);
20182                }
20183            }           
20184        }, interval)
20185    });
20186  }
20187
20188[].forEach.call(document.querySelectorAll('.search-results.overlay-source'), function (e) {
20189    XA.dom.observeDOM(e, function () { XA.component.overlay.init(); });
20190});
20191
20192waitForElement('.search-results ul li', 10000, 100,'product-filter-options-results-container-new').then(() => {
20193    XA.component.overlay.init();
20194
20195}).catch(() => { console.log("Returning error from promise wait gs")});
20196
20197waitForElement('.search-results ul li', 10000, 100,'recipe-filter-options-results-container-new').then(() => {
20198    XA.component.overlay.init();
20199
20200}).catch(() => {});
20201
20202/*  component-snippet  */
20203/**
20204 * Component Snippet
20205 * @module Snippet
20206 * @param  {jQuery} $ Instance of jQuery
20207 * @return {Object} List of Snippet methods
20208 */
20209XA.component.snippet = (function($) {
20210     /**
20211     * This object stores all public api methods
20212     * @type {Object.<Methods>}
20213     * @memberOf module:Snippet
20214     * @
20215     * */
20216    var api = {},
20217        instance;
20218     /**
20219     * initInstance method of a Snippet element
20220     * @memberOf module:Snippet
20221     * @method
20222     * @param {jQuery} component Root DOM element of Snippet component wrapped by jQuery
20223     * @param {jQuery} snippetModule Snippet inner DOM element of Snippet component wrapped by jQuery
20224     * @alias module:Snippet.initInstance
20225     */
20226    api.initInstance = function(component, snippetModule) {};
20227    /**
20228     * init method calls in a loop for each
20229     * snippet component on a page and runs Snippet's
20230     * ["initInstance"]{@link module:Snippet.api.initInstance} methods.
20231     * @memberOf module:Snippet
20232     * @alias module:Snippet.init
20233     */
20234    api.init = function() {
20235        var $snippets = $(".snippet:not(.initialized)");
20236        $snippets.each(function() {
20237            var $snippetModule = $(this).find(".snippet-inner");
20238            instance = $(this);
20239            api.initInstance(instance, $snippetModule);
20240            $(this).addClass("initialized");
20241        });
20242    };
20243
20244    return api;
20245})(jQuery);
20246
20247XA.register("snippet", XA.component.snippet);
20248
20249
20250/*  component-social  */
20251/**
20252 * Component Social
20253 * @module Social
20254 * @param  {jQuery} $ Instance of jQuery
20255 * @param  {document} document document object
20256 * @return {Object} List of Social component methods
20257 */
20258XA.component.social = (function($, document) {
20259    /**
20260     * This object stores all public api methods
20261     * @type {Object.<Methods>}
20262     * @memberOf module:Social
20263     * @
20264     * */
20265    var api = {};
20266    api.shareProperties;
20267    /**
20268     * Creates connector for facebook
20269     * initInstance method of a Social component
20270     * @memberOf module:Social
20271     * @method
20272     * @alias module:Social.initFacebook
20273     */
20274    api.initFacebook = function() {
20275        (function(d, s, id) {
20276            var js,
20277                fjs = d.getElementsByTagName(s)[0];
20278            if (d.getElementById(id)) {
20279                return;
20280            }
20281            js = d.createElement(s);
20282            js.id = id;
20283            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
20284            fjs.parentNode.insertBefore(js, fjs);
20285        })(document, "script", "facebook-jssdk");
20286    };
20287    /**
20288     * Creates connector for facebook
20289     * initInstance method of a Social component
20290     * @memberOf module:Social
20291     * @param {Array} properties properties for external scripts
20292     * @method
20293     * @alias module:Social.initFacebook
20294     */
20295    var attachExternalScript = function(properties) {
20296        var component = $(".sharethis"),
20297            shareThisExternal;
20298        if (window.stLight === undefined) {
20299            shareThisExternal = document.createElement("script");
20300            shareThisExternal.type = "text/javascript";
20301            shareThisExternal.src = "//w.sharethis.com/button/buttons.js";
20302            $(window).on("load", function() {
20303                $(properties).each(function() {
20304                    try {
20305                        window.stLight.options(this);
20306                    } catch (e) {}
20307                });
20308            });
20309            $(component[0]).append(shareThisExternal);
20310        }
20311    };
20312    /**
20313     * initInstance method of a Social component
20314     * @memberOf module:Social
20315     * @method
20316     * @param {jQuery} component Root DOM element of Social component wrapped by jQuery
20317     * @param {Object} prop Social component properties
20318     * @alias module:Social.initInstance
20319     */
20320    api.initInstance = function(component, prop) {
20321        api.shareProperties.push(prop);
20322    };
20323    /**
20324     * init method calls in a loop for each
20325     * social component on a page and run
20326     * ["initInstance"]{@link module:Snippet.api.initInstance} methods.
20327     * @memberOf module:Social
20328     * @alias module:Social.init
20329     */
20330    api.init = function() {
20331        var shareThis = $(".sharethis:not(.initialized)");
20332        api.shareProperties = [];
20333        shareThis.each(function() {
20334            var properties = $(this).data("properties");
20335            api.initInstance($(this), properties);
20336            $(this).addClass("initialized");
20337        });
20338        attachExternalScript(api.shareProperties);
20339    };
20340    return api;
20341})(jQuery, document);
20342
20343XA.register("social", XA.component.social);
20344
20345
20346/*  component-tabs  */
20347/**
20348 * Component Tabs
20349 * @module Tabs
20350 * @param  {jQuery} $ Instance of jQuery
20351 * @return {Object} List of tabs methods
20352 */
20353XA.component.tabs = (function($) {
20354    /**
20355     * This object stores all public api methods
20356     * @type {Object.<Methods>}
20357     * @memberOf module:Tabs
20358     * @
20359     * */
20360    var api = {},
20361        instance;
20362    /**
20363     * isFlipInside chech if inside Tab component present Flip component
20364     * @memberOf module:Tab
20365     * @method
20366     * @param {jQuery} $instance Tabs Root DOM element of tab component wrapped by jQuery
20367     * @alias module:Tab.isFlipInside
20368     * @return {boolean}
20369     * @private
20370     */
20371    var isFlipInside = function(instance) {
20372        return !!instance.find(".component.flip").length;
20373    };
20374    /**
20375     * tabsScrollable modify tabs to support scroll for tabs header
20376     * @memberOf module:Tab
20377     * @method
20378     * @param {jQuery} $tabsScroll Tabs Root DOM element of tab component wrapped by jQuery
20379     * @alias module:Tab.tabsScrollable
20380     * @private
20381     */
20382    function tabsScrollable($tabsScroll) {
20383        var speed = 150; //tabs scroll speed
20384
20385        function initNavScroll($tabsNav) {
20386            var sum = 0,
20387                maxHeight = 0;
20388
20389            if ($tabsNav.length) {
20390                $tabsNav
20391                    .parent()
20392                    .find(".prev")
20393                    .remove();
20394                $tabsNav
20395                    .parent()
20396                    .find(".next")
20397                    .remove();
20398                $tabsNav.unwrap();
20399
20400                $tabsNav.css("width", "auto");
20401                $tabsNav.css("height", "auto");
20402                $tabsNav.css("left", 0);
20403            }
20404
20405            $tabsNav.find("li").each(function() {
20406                sum += $(this).outerWidth(true);
20407            });
20408
20409            $tabsNav.find("li").each(function() {
20410                maxHeight = Math.max(maxHeight, $(this).height());
20411            });
20412
20413            $tabsNav.wrap("<div class='wrapper'>");
20414            $("<div class='next tab-slider'>></div>").insertAfter($tabsNav);
20415            $("<div class='prev tab-slider'><</div>").insertBefore($tabsNav);
20416
20417            $tabsNav.parent().css("height", parseInt(maxHeight, 10));
20418            $tabsNav
20419                .parent()
20420                .find(".tab-slider")
20421                .css("height", parseInt(maxHeight, 10) - 2);
20422            //fix for 8111
20423            sum += 10;
20424            if (sum > $tabsNav.parent().width()) {
20425                $tabsNav
20426                    .parent()
20427                    .find(".prev")
20428                    .hide();
20429                $tabsNav.width(sum);
20430            } else {
20431                $tabsNav
20432                    .parent()
20433                    .find(".prev")
20434                    .hide();
20435                $tabsNav
20436                    .parent()
20437                    .find(".next")
20438                    .hide();
20439            }
20440        }
20441
20442        function bindPrevNextEvents(current, $tabsNav) {
20443            current.find(".prev").click(function() {
20444                var left = parseInt($tabsNav.css("left"), 10);
20445                left += speed;
20446
20447                if (left > 0) {
20448                    left = 0;
20449                    $tabsNav.stop().animate({
20450                        left: left
20451                    });
20452
20453                    $tabsNav
20454                        .parent()
20455                        .find(".prev")
20456                        .hide();
20457                    $tabsNav
20458                        .parent()
20459                        .find(".next")
20460                        .show();
20461                } else {
20462                    $tabsNav.stop().animate({
20463                        left: left
20464                    });
20465
20466                    $tabsNav
20467                        .parent()
20468                        .find(".prev")
20469                        .show();
20470                    $tabsNav
20471                        .parent()
20472                        .find(".next")
20473                        .show();
20474                }
20475            });
20476
20477            current.find(".next").click(function() {
20478                var left = parseInt($tabsNav.css("left"), 10),
20479                    navWidth = $tabsNav.width(),
20480                    navParentWidth = $tabsNav.parent().width();
20481
20482                left -= speed;
20483
20484                if (navWidth + left < navParentWidth) {
20485                    left = navWidth - navParentWidth + 20;
20486                    $tabsNav.stop().animate({
20487                        left: -left
20488                    });
20489
20490                    $tabsNav
20491                        .parent()
20492                        .find(".prev")
20493                        .show();
20494                    $tabsNav
20495                        .parent()
20496                        .find(".next")
20497                        .hide();
20498                } else {
20499                    $tabsNav.stop().animate({
20500                        left: left
20501                    });
20502
20503                    $tabsNav
20504                        .parent()
20505                        .find(".prev")
20506                        .show();
20507                    $tabsNav
20508                        .parent()
20509                        .find(".next")
20510                        .show();
20511                }
20512            });
20513        }
20514
20515        function bindChangeTabs($tabsNav, $tabsContainer) {
20516            $tabsNav.find("li").click(function(event) {
20517                var index = $(this).index(),
20518                    instance = $(this).closest(".component.tabs");
20519
20520                $(this).addClass("active");
20521                $(this)
20522                    .siblings()
20523                    .removeClass("active");
20524
20525                $tabsContainer.find(".tab").removeClass("active");
20526                $tabsContainer
20527                    .find(".tab:eq(" + index + ")")
20528                    .addClass("active");
20529
20530                if (isFlipInside(instance)) {
20531                    try {
20532                        XA.component.flip.equalSideHeight(instance);
20533                    } catch (e) {
20534                        /* eslint-disable no-console */
20535                        console.warn(
20536                            "Error during calculation height of Flip list in toggle"
20537                        ); // jshint ignore:line
20538                        /* eslint-enable no-console */
20539                    }
20540                }
20541                event.preventDefault();
20542            });
20543        }
20544
20545        function initTabsScrollable($tabs) {
20546            $tabs.each(function() {
20547                var $tabsNav = $(this).find(".tabs-heading"),
20548                    $tabsContainer = $(this).find(".tabs-container");
20549
20550                $tabsNav.find("li:first-child").addClass("active");
20551                $tabsContainer.find(".tab:eq(0)").addClass("active");
20552
20553                bindChangeTabs($tabsNav, $tabsContainer);
20554                initNavScroll($tabsNav);
20555                bindPrevNextEvents($(this), $tabsNav);
20556            });
20557        }
20558
20559        initTabsScrollable($tabsScroll);
20560        $(window).resize(function() {
20561            initTabsScrollable($tabsScroll);
20562        });
20563    }
20564    /**
20565     * selectActiveTab activate selected tab
20566     * @memberOf module:Tab
20567     * @method
20568     * @param {jQuery} $tabNav Tabs header DOM element of tab component wrapped by jQuery
20569     * @param {jQuery} $tabs Tabs content DOM element of tab component wrapped by jQuery
20570     * @alias module:Tab.selectActiveTab
20571     * @private
20572     */
20573    function selectActiveTab($tabNav, $tabs) {
20574        var tabRootId = $tabNav.closest(".component.tabs").attr("id");
20575        var tabToSelect = XA.queryString.getQueryParam(tabRootId || "tab");
20576
20577        if (
20578            tabToSelect != null &&
20579            !isNaN(parseInt(tabToSelect)) &&
20580            isFinite(tabToSelect)
20581        ) {
20582            tabToSelect = parseInt(tabToSelect);
20583            if ($tabNav.length > tabToSelect) {
20584                $($tabNav[tabToSelect]).addClass("active");
20585                $($tabs[tabToSelect]).addClass("active");
20586
20587                return;
20588            }
20589        }
20590        $tabNav.first().addClass("active");
20591        $tabNav.first().attr("tabindex", "0");
20592        $tabs.first().addClass("active");
20593    }
20594
20595    /**
20596     * initInstance initializes component according to his option
20597     * @memberOf module:Tabs
20598     * @method
20599     * @param {jQuery} component Root DOM element of archive component wrapped by jQuery
20600     * @alias module:Tabs.initInstance
20601     */
20602    api.initInstance = function(component) {
20603        var $tabModule = component.find(".tabs-inner");
20604        if (component.hasClass("tabs-scrollable")) {
20605            tabsScrollable(component);
20606        } else {
20607            $tabModule.each(function() {
20608                var $tabNav = $(this).find(".tabs-heading > li"),
20609                    $tabs = $(this).find("> .tabs-container > .tab");
20610
20611                selectActiveTab($tabNav, $tabs);
20612
20613                $tabNav
20614                    .click(function(event) {
20615                        var current = $(this),
20616                            index = current.index(),
20617                            tabInner = current.parent().parent();
20618
20619                        current.siblings().removeClass("active");
20620                        tabInner
20621                            .find("> .tabs-container > .tab")
20622                            .removeClass("active");
20623                        current.addClass("active");
20624                        $(
20625                            tabInner
20626                                .children(".tabs-container")
20627                                .children(".tab")
20628                                .eq(index)
20629                        ).addClass("active");
20630                        if (isFlipInside(component)) {
20631                            try {
20632                                XA.component.flip.equalSideHeight(component);
20633                            } catch (e) {
20634                                /* eslint-disable no-console */
20635                                console.warn(
20636                                    "Error during calculation height of Flip list in toggle"
20637                                ); // jshint ignore:line
20638                                /* eslint-enable no-console */
20639                            }
20640                        }
20641                        current.focus();
20642                        event.preventDefault();
20643                    })
20644                    .keyup(function(event) {
20645                        var currentHeading = $(this);
20646                        switch (event.keyCode) {
20647                            case 38: {
20648                                currentHeading.prev("li").click();
20649                                break;
20650                            }
20651                            case 40: {
20652                                currentHeading.next("li").click();
20653                                break;
20654                            }
20655                        }
20656                    });
20657            });
20658        }
20659
20660        if (isFlipInside(component)) {
20661            try {
20662                XA.component.flip.equalSideHeight(component);
20663            } catch (e) {
20664                /* eslint-disable no-console */
20665                console.warn(
20666                    "Error during calculation height of Flip list in toggle"
20667                ); // jshint ignore:line
20668                /* eslint-enable no-console */
20669            }
20670        }
20671    };
20672    /**
20673     * init method calls in a loop for each
20674     * tabs component on a page and runs Tab's
20675     * ["initInstance"]{@link module:Tabs.api.initInstance} method
20676     * @memberOf module:Tabs
20677     * @alias module:Tabs.init
20678     */
20679    api.init = function() {
20680        var $tabs = $(".tabs:not(.initialized)");
20681        $tabs.each(function() {
20682            var instance = $(this);
20683            api.initInstance(instance);
20684            $(this).addClass("initialized");
20685        });
20686    };
20687
20688    return api;
20689})(jQuery);
20690
20691XA.register("tabs", XA.component.tabs);
20692
20693
20694/*  component-toggle  */
20695/**
20696 * Component Toggle
20697 * @module Toggle
20698 * @param  {jQuery} $ Instance of jQuery
20699 * @return {Object} List of toggle methods
20700 */
20701XA.component.toggle = (function($) {
20702    /**
20703     * This object stores all public api methods
20704     * @type {Object.<Methods>}
20705     * @memberOf module:Toggle
20706     * */
20707    var api = {};
20708
20709    var properties, instance;
20710    /**
20711     * Returns list of flip components
20712     * @memberOf module:Toggle
20713     * @method
20714     * @param {DOMElement} instance Root DOM element of toggle component
20715     * @alias module:Toggle.openToggle
20716     * @private
20717     * @return {jQuery} list of flip components
20718     */
20719    var getFlipList = function(instance) {
20720        return $(instance).find(".component.flip");
20721    };
20722	/**
20723     * Adds attribute "open" for "details" tag.
20724     * If inside toggle event calendar is added, this method will trigger
20725     * "resize method"
20726     * If inside toggle flip component is added, it will call
20727     * ["Flip.equalSideHeightInToggle"]{@link  module:Flip.equalSideHeightInToggle}
20728     * @memberOf module:Toggle
20729     * @method
20730     * @param {DOMElement} instance Root DOM element of toggle component
20731     * @alias module:Toggle.openToggle
20732     * @private
20733     */
20734    var openToggle = function(instance) {
20735        var flipList = getFlipList(instance),
20736            eventCalendar = $(instance).find('.event-calendar');
20737        $(instance).find('details').attr('open', 'open');
20738        if (eventCalendar.length){
20739            eventCalendar.trigger('resize')
20740        }
20741        if (flipList.length) {
20742            try {
20743                XA.component.flip.equalSideHeightInToggle(instance)
20744            } catch (e) {
20745                /* eslint-disable no-console */
20746                console.warn('Error during calculation height of Flip list in toggle'); // jshint ignore:line
20747                /* eslint-enable no-console */
20748
20749            }
20750        }
20751
20752    }
20753	/**
20754     * Removes attribute "open" for "details" tag
20755     * @memberOf module:Toggle
20756     * @method
20757     * @param {DOMElement} instance Root DOM element of toggle component
20758     * @alias module:Toggle.closeToggle
20759     * @private
20760     */
20761    var closeToggle = function(instance) {
20762        $(instance).find('details').removeAttr('open');
20763    }
20764
20765	/**
20766     * Sets css animation for component-content of an component
20767     * @memberOf module:Toggle
20768     * @method
20769     * @param {DOMElement} instance Root DOM element of toggle component
20770     * @alias module:Toggle.setAnimation
20771     * @private
20772     */
20773    var setAnimation = function(instance) {
20774        var childComponents = $(instance).find('details summary~.component>.component-content, details summary~.row>.component>.component-content');
20775        childComponents.css({
20776            'animation-name': properties.easing,
20777            'animation-duration': (properties.speed || 500) + 'ms'
20778        });
20779    };
20780	/**
20781     * Checks value of properties.expandOnHover;
20782     * @memberOf module:Toggle
20783     * @method
20784     * @alias module:Toggle.isExpandOnHover
20785     * @private
20786     * @return {Boolean} properties.expandOnHover
20787     */
20788    var isExpandOnHover = function() {
20789        return properties.expandOnHover;
20790    };
20791    /**
20792     * Checks value of properties.expandedByDefault;
20793     * @memberOf module:Toggle
20794     * @method
20795     * @alias module:Toggle.isExpanded
20796     * @private
20797     * @return {Boolean} properties.expandedByDefault
20798     */
20799    var isExpanded = function() {
20800        return properties.expandedByDefault;
20801    };
20802    /**
20803     * Binds watchers on "summary" element that will call
20804     * ["openToggle"]{@link  module:Toggle.openToggle}
20805     * method
20806     * @memberOf module:Toggle
20807     * @method
20808     * @param {jQuery} instance Root DOM element of toggle component
20809     * @alias module:Toggle.bindEvents
20810     * @private
20811     */
20812	var bindEvents = function(instance) {
20813        var summary = $(instance).find('summary');
20814        if (isExpandOnHover()) {
20815            summary.on('mouseenter', function() {
20816                openToggle(instance);
20817            });
20818        }
20819        if (isExpanded()) {
20820            openToggle(instance);
20821        }
20822
20823        summary.on('click', function(event) {
20824            event.preventDefault();
20825            var details = $(this).closest('details')
20826            if (details.attr('open')) {
20827                closeToggle(instance);
20828            } else {
20829                openToggle(instance);
20830            }
20831        });
20832    };
20833	/**
20834     * Call
20835     * ["bindEvents"]{@link  module:Toggle.bindEvents}
20836     * ["setAnimation"]{@link  module:Toggle.setAnimation}
20837     * methods
20838     * @memberOf module:Toggle
20839     * @method
20840     * @param {jQuery} component Root DOM element of toggle component wrapped by jQuery
20841     * @alias module:Toggle.initToggle
20842     * @private
20843     */
20844    var initToggle = function(component) {
20845        bindEvents(component);
20846		setAnimation(component);
20847	};
20848    /**
20849     * Call
20850     * ["initToggle"]{@link  module:Toggle.initToggle}
20851     * method
20852     * @memberOf module:Toggle
20853     * @method
20854     * @param {jQuery} component Root DOM element of toggle component wrapped by jQuery
20855     * @alias module:Toggle.initInstance
20856     */
20857    api.initInstance = function(component) {
20858        initToggle(component);
20859    };
20860    /**
20861     * Finds all not-initialized 
20862     * Toggle components and in a loop for each of them
20863     * runs Toggle's
20864     * ["initInstance"]{@link module:Toggle.initInstance}
20865     * method.
20866     * @memberOf module:Toggle
20867     * @alias module:Toggle.init
20868     */
20869    api.init = function() {
20870        $('.toggle:not(.initialized)').each(function() {
20871            instance = $(this);
20872            properties = instance.data('properties');
20873            api.initInstance(this,properties);
20874            instance.addClass('initialized');
20875        });
20876    };
20877
20878    return api;
20879})(jQuery);
20880
20881XA.register('component-toggle', XA.component.toggle);
20882
20883/*  component-video  */
20884/* global MediaElementPlayer:false */
20885/**
20886 * Component Video
20887 * @module Video
20888 * @param  {jQuery} $ Instance of jQuery
20889 * @return {Object} List of Video component methods
20890 */
20891XA.component.video = (function($, document) {
20892    /**
20893     * This object stores all public api methods
20894     * @type {Object.<Methods>}
20895     * @memberOf module:Video
20896     * */
20897    var api = {};
20898    /**
20899     * Sets class name to video element depending 
20900     * on video width size. </br>
20901        <p>"video-small" - if videoWidth < 481 && videoWidth >= 321</p>
20902        <p>"hide-controls" - if videoWidth < 321</p>
20903     * @memberOf module:Video
20904     * @method
20905     * @param {jQuery.<Element>} video Video element
20906     */
20907    function checkSize(video) {
20908        var videoWidth = video.width();
20909        video.removeClass("video-small hide-controls");
20910
20911        if (videoWidth < 481 && videoWidth >= 321) {
20912            video.addClass("video-small");
20913        } else if (videoWidth < 321) {
20914            video.addClass("hide-controls");
20915        }
20916    }
20917
20918    /**
20919     * Initializes video component and creates instance of 
20920     * [MediaElementPlayer]{@link https://www.mediaelementjs.com/} that 
20921     * handles all work with video player.
20922     * @memberOf module:Video
20923     * @method
20924     * @param {jQuery.<Element>} video Video element
20925     * @param {Object} properties Video element properties
20926     * @return undefined;
20927     * 
20928     */
20929    function initVideo(video, properties) {
20930        var content = video.find("video");
20931
20932        if (!content.length) {
20933            return;
20934        }
20935       
20936        var callback = function(mediaElement) {
20937            mediaElement.movieName = "Movie";
20938
20939            $(mediaElement).on("ended", function() {
20940                if (properties.fromPlaylist) {
20941                    $(properties.playlist).trigger("change-video");
20942                }
20943            });
20944            $(mediaElement)
20945                .closest(".component-content")
20946                .find(".video-init")
20947                .hide();
20948        };
20949        // Possible youtube imageQuality values: `default`, `hqdefault`, `mqdefault`, `sddefault` and `maxresdefault`
20950        $.extend(properties, {
20951            plugins: ["youtube", "flash", "silverlight"],
20952            silverlightName: "silverlightmediaelement.xap",
20953            classPrefix: "mejs-",
20954            success: callback,
20955            stretching: "auto",
20956            pluginPath: "../other/",
20957            youtube: {
20958                imageQuality: 'hqdefault' 
20959          }
20960        });
20961
20962        content.each(function(key) {
20963            var $elem = $(content[key]),
20964                _this = this;
20965            if ($elem.attr("poster")) {
20966                var initBtn = $elem.parent().find(".video-init");
20967                $elem.add(initBtn).on("click", function() {
20968                    properties.success = (function(arg) {
20969                        return function() {
20970                            try {
20971                                arguments[0].load();
20972                                arguments[0].play();
20973                            } catch (e) {
20974                                /* eslint-disable */
20975                                console.warn("Error while loading video");
20976                                /* eslint-enable  */
20977                            }
20978
20979                            return arg.apply(this, arguments);
20980                        };
20981                    })(properties.success);
20982                    initBtn.hide();
20983                    new MediaElementPlayer(_this, properties);
20984                });
20985            } else {
20986                new MediaElementPlayer(content[key], properties);
20987            }
20988        });
20989        return;
20990    }
20991    /**
20992     * This method is called by 
20993     * [Playlist.replaceSource]{@link module:Playlist.Playlist.replaceSource}
20994     * and extends properties of video component.
20995     * @memberOf module:Video
20996     * @method
20997     * @param {jQuery} video Root DOM element of video component wrapped by jQuery
20998     * @param {Object} playlist set by playlist component
20999     * @alias module:Video.initVideoFromPlaylist
21000     */
21001    api.initVideoFromPlaylist = function(video, playlist) {
21002        var properties = $(video).data("properties");
21003
21004        $.extend(properties, {
21005            fromPlaylist: true,
21006            playlist: playlist
21007        });
21008
21009        return initVideo(video, properties);
21010    };
21011    /**
21012     * For each video component run
21013     * [initVideo]{@link module:Video.initVideo}
21013, [checkSize]{@link module:Video.checkSize}
21014     * methods and add [checkSize]{@link module:Video.checkSize} as a callback for
21015     * eventListener to <b>window.resize</b>
21016     * @memberOf module:Video
21017     * @method
21018     * @param {jQuery} component Root DOM element of video component wrapped by jQuery
21019     * @param {Object} prop Properties set in data attribute
21020     *  of video component
21021     * @alias module:Video.initInstance
21022     */
21023    api.initInstance = function(component, prop) {
21024        var $component = $(component);
21025        initVideo($component, prop);
21026        checkSize($component);
21027
21028        $(window).resize(function() {
21029            checkSize($component);
21030        });
21031    };
21032    /**
21033     * Finds all Video components that are not yet initialized and in a loop for each of them
21034     * runs ["initInstance"]{@link module:Video.initInstance} method.
21035     * If component has property "playlist installed" it calls
21036     * [XA.component.playlist.init]{@link module:Playlist.init}
21037     * @memberOf module:Video
21038     * @alias module:Video.init
21039     */
21040    api.init = function() {
21041        if (XA.component.hasOwnProperty("playlist")) {
21042            XA.component.playlist.init();
21043        }
21044
21045        var video = $(".video.component:not(.initialized)");
21046
21047        video.each(function() {
21048            var properties = $(this).data("properties");
21049
21050            api.initInstance(this, properties);
21051
21052            $(this).addClass("initialized");
21053        });
21054
21055        $(document).on("mozfullscreenchange", function() {
21056            setTimeout(function() {
21057                $(window).resize();
21058            }, 200); //mozilla bug fix
21059        });
21060    };
21061
21062    return api;
21063})(jQuery, document);
21064
21065XA.register("video", XA.component.video);
21066
21067
21068/*  component-video-playlist  */
21069/* global mejs:false */
21070/**
21071 * Component Playlist
21072 * @module Playlist
21073 * @param  {jQuery} $ Instance of jQuery
21074 * @return {Object} List of Playlist component methods
21075 */
21076XA.component.playlist = (function ($) {
21077    /**
21078     * This object stores all public api methods
21079     * @type {Object.<Methods>}
21080     * @memberOf module:Playlist
21081     * */
21082    var api = {};
21083    /**
21084     * This class is used by [Playlist]{@link module:Playlist} module
21085     * @class Playlist
21086     * @memberOf module:Playlist
21087     * @param {jQuery} playlist Root DOM element of playlist component wrapped by jQuery
21088     * @param {Object} properties Properties set in data attribute
21089     */
21090    function Playlist(playlist, properties) {
21091        this.properties = properties;
21092        this.playlist = playlist;
21093        this.activeVideo = 0;
21094        this.playlistItems = 0;
21095    }
21096    /**
21097     * Creates new source element, sets up it with type & src. Created element
21098     * append to Video container (take it from videoContainer parameter)
21099     * @method
21100     * @alias createNewSources
21101     * @memberOf module:Playlist.Playlist
21102     * @param {$OrderedList} source takes from properties.sources[itemIndex].src - 
21103     * source of playlist element
21104     * @param {$OrderedList} videoContainer container where source should be added
21105     */
21106    Playlist.prototype.createNewSources = function (source, videoContainer) {
21107        var newSource;
21108
21109        var sourceBuilder = function (path) {
21110            var newSource = $("<source>"),
21111                type;
21112
21113            if (path.match(/\.(mp4)$/)) {
21114                type = "video/mp4";
21115            } else if (path.match(/\.(webm)$/)) {
21116                type = "video/webm";
21117            } else if (path.match(/\.(ogv)$/)) {
21118                type = "video/ogg";
21119            } else {
21120                type = "video/youtube";
21121            }
21122
21123            newSource.attr({
21124                type: type,
21125                src: path
21126            });
21127
21128            return newSource;
21129        };
21130
21131        if (source instanceof Array) {
21132            for (var i = 0; i < source.length; i++) {
21133                newSource = sourceBuilder(source[i]);
21134                videoContainer.find("video").append(newSource);
21135            }
21136        } else {
21137            newSource = sourceBuilder(source);
21138            videoContainer.find("video").append(newSource);
21139        }
21140    };
21141    /**
21142     * Replaces source of each video element under play list component.
21143     * After replacing it re-initializes video component by calling 
21144     * [XA.component.video.initVideoFromPlaylist]{@link module:Video.initVideoFromPlaylist}
21145     * @name replaceSource
21146     * @function
21147     * @param {number} itemIndex position of active video in video list
21148     * @param {boolean} loadFromEvent
21149     * @memberOf module:Playlist.Playlist
21150     */
21151
21152    Playlist.prototype.replaceSource = function (itemIndex, loadFromEvent) {
21153        var inst = this,
21154            videoContainer,
21155            videoClone,
21156            newSrc = inst.properties.sources[itemIndex].src,
21157            sources,
21158            videoId,
21159            videoContainerHeight = 0;
21160
21161        $(inst.properties.playlistId).each(function () {
21162            videoContainer = $(this);
21163            videoId = inst.properties.playlistId;
21164
21165            if (videoContainer.is(videoId) && newSrc.length) {
21166                videoContainer.addClass("show");
21167
21168                sources = videoContainer.find("source");
21169                sources.remove();
21170                inst.createNewSources(newSrc, videoContainer);
21171                videoContainer
21172                    .find("video")
21173                    .attr({
21174                        src: ""
21175                    })
21176                    .show();
21177
21178                var autoplayVideo = false;
21179                if (loadFromEvent) {
21180                    if (inst.properties.autoPlaySelected) {
21181                        autoplayVideo = true;
21182                    }
21183                } else {
21184                    if (inst.properties.autoPlay) {
21185                        autoplayVideo = true;
21186                    }
21187                }
21188
21189                if (autoplayVideo) {
21190                    videoContainer.find("video").attr({
21191                        autoplay: ""
21192                    });
21193                }
21194
21195                videoClone = videoContainer.find("video").clone();
21196                videoContainerHeight = videoContainer.height();
21197                videoContainer.css({
21198                    height: videoContainerHeight
21199                });
21200
21201                var id = videoContainer.find(".mejs-container").attr("id");
21202                if (id) {
21203                    $("#" + id).remove();
21204                    delete mejs.players[id];
21205                    videoContainer
21206                        .find(".component-content")
21207                        .append(videoClone);
21208                }
21209
21210                XA.component.video.initVideoFromPlaylist(
21211                    videoContainer,
21212                    inst.playlist
21213                );
21214                videoContainer.css({
21215                    height: "auto"
21216                });
21217            }
21218        });
21219    };
21220
21221    /**
21222     * Initializes videos under component. On call and on
21223     * [change-video]{@link module:Playlist.Playlist#change-video} event
21224     * calls [replaceSource]{@link module:Playlist.Playlist.replaceSource}
21225     * @name loadPlaylistVideo
21226     * @function
21227     * @listeners module:Playlist.Playlist#change-video
21228     * @memberOf module:Playlist.Playlist
21229     */
21230
21231    Playlist.prototype.loadPlaylistVideo = function () {
21232        var inst = this,
21233            playlistItems = $(inst.playlist).find(".playlist-item"),
21234            activeListItem;
21235
21236        inst.playlistItems = playlistItems.length;
21237        var loadVideoFromPlaylist = function (loadFromEvent) {
21238            inst.replaceSource(inst.activeVideo, loadFromEvent);
21239            activeListItem = playlistItems.eq(inst.activeVideo);
21240            activeListItem.addClass("active");
21241            activeListItem.siblings().removeClass("active");
21242        };
21243
21244        loadVideoFromPlaylist();
21245        $(inst.playlist).on("change-video", function (event, properties) {
21246            var loadNewVideo = false;
21247            
21248            if (properties) {
21249                if (properties.hasOwnProperty("back")) {
21250                    inst.activeVideo--;
21251                    if (inst.activeVideo < 0) {
21252                        inst.activeVideo = 0;
21253                    } else {
21254                        loadNewVideo = true;
21255                    }
21256                } else {
21257                    inst.activeVideo++;
21258                    if (inst.activeVideo === inst.playlistItems) {
21259                        if (inst.properties.repeatAfterAll) {
21260                            inst.activeVideo = 0;
21261                            loadNewVideo = true;
21262                        } else {
21263                            inst.activeVideo = inst.playlistItems - 1;
21264                        }
21265                    } else {
21266                        loadNewVideo = true;
21267                    }
21268                }
21269            } else {
21270                if (inst.properties.playNext) {
21271                    if (inst.activeVideo + 1 <= inst.playlistItems) {
21272                        inst.activeVideo++;
21273
21274                        if (inst.activeVideo === inst.playlistItems) {
21275                            inst.activeVideo = 0;
21276
21277                            if (inst.properties.repeatAfterAll) {
21278                                loadNewVideo = true;
21279                            }
21280                        } else {
21281                            inst.actiVideo--;
21282                            loadNewVideo = true;
21283                        }
21284                    }
21285                }
21286            }
21287
21288            if (loadNewVideo) {
21289                loadVideoFromPlaylist(true);
21290            }
21291        });
21292    };
21293    /**
21294     * Attaches events to playlist-section and navigation items
21295     * @name attachEvents
21296     * @function
21297     * @fires module:Playlist.Playlist#change-video
21298     * @memberOf module:Playlist.Playlist
21299     */
21300    Playlist.prototype.attachEvents = function () {
21301        var inst = this,
21302            link = $(inst.playlist).find(".playlist-section"),
21303            navItems = $(inst.playlist).find(".playlist-nav a"),
21304            playlistItem;
21305        link.on("click", function (event) {
21306            event.preventDefault();
21307            if (!inst.locked) {
21308                inst.locked = true;
21309                playlistItem = $(this).parents(".playlist-item");
21310                var itemIndex = playlistItem.index();
21311
21312                if (itemIndex !== inst.activeVideo) {
21313                    playlistItem.addClass("active");
21314                    playlistItem.siblings().removeClass("active");
21315                    inst.replaceSource(itemIndex, true);
21316                    inst.activeVideo = itemIndex;
21317                }
21318                //Change video source not more often
21319                //than once per second
21320                setTimeout(function(){
21321                    inst.locked = false;
21322                },1000);
21323            }
21324
21325        });
21326
21327        navItems.on("click", function (event) {
21328            event.preventDefault();
21329            var properties = {};
21330
21331            if (
21332                $(this)
21333                    .parent()
21334                    .hasClass("playlist-prev")
21335            ) {
21336                properties.back = true;
21337            }
21338            /**
21339             * Change video event fires when user clicks
21340             * a ".playlist-nav a" element.
21341             *
21342             * @event module:Playlist.Playlist#change-video
21343             * @type {object}
21344             * @property {Object} properties - Indicates whether playlist has back button
21345             */
21346            $(inst.playlist).trigger("change-video", properties);
21347        });
21348    };
21349    /**
21350     * For each playlist component creates new instance of
21351     * ["Playlist"]{@link  module:Playlist.Playlist} and calls
21352     * ["loadPlaylistVideo"]{@link  module:Playlist.Playlist.loadPlaylistVideo},
21353     * ["attachEvents"]{@link  module:Playlist.Playlist.attachEvents}
21354     * methods
21355     * @memberOf module:Playlist
21356     * @method
21357     * @param {jQuery} component Root DOM element of playlist component wrapped by jQuery
21358     * @param {Object} prop Properties set in data attribute
21359     *  of playlist component
21360     * @alias module:Playlist.initInstance
21361     */
21362    api.initInstance = function (component, prop) {
21363        var playlist;
21364        $(prop.playlistId).addClass("initialized"); //prevents video init in component-video.js
21365        if (prop.sources.length) {
21366            playlist = new Playlist(component, prop);
21367            playlist.loadPlaylistVideo();
21368            playlist.attachEvents();
21369        }
21370    };
21371    /**
21372     * Finds all not initialized yet
21373     * Playlist components and in a loop for each of them
21374     * run ["initInstance"]{@link module:Playlist.initInstance}
21375     * method.
21376     * @memberOf module:Playlist
21377     * @alias module:Playlist.init
21378     */
21379    api.init = function () {
21380        var playlists = $(".playlist.component:not(.initialized)"),
21381            properties;
21382
21383        playlists.each(function () {
21384            properties = $(this).data("properties");
21385            api.initInstance(this, properties);
21386            $(this).addClass("initialized");
21387        });
21388    };
21389
21390    return api;
21391})(jQuery, document);
21392
21393XA.register("playlist", XA.component.playlist);
21394
21395
21396/*  details-polyfill  */
21397/*
21398Details Element Polyfill 2.0.0
21399Copyright © 2017 Javan Makhmali
21400 */
21401(function () { }).call(this),
21402    function () {
21403    if (document.querySelector('body').getAttribute('class') && document.querySelector('body').getAttribute('class').indexOf('on-page-editor') > -1) {
21404            return;
21405        }
21406        var t, e, n, r, u, o, i, a, s, l, c, d;
21407        l = {
21408            element: function () {
21409                var t, e, n, r, u;
21410                return e = document.createElement("details"), "open" in e ? (e.innerHTML = "<summary>a</summary>b", e.setAttribute("style", "position: absolute; left: -9999px"), r = null != (u = document.body) ? u : document.documentElement, r.appendChild(e), t = e.offsetHeight, e.open = !0, n = e.offsetHeight, r.removeChild(e), t !== n) : !1
21411            }(),
21412            toggleEvent: function () {
21413                var t;
21414                return t = document.createElement("details"), "ontoggle" in t
21415            }()
21416        }, l.element && l.toggleEvent || (i = function () {
21417            return document.head.insertAdjacentHTML("afterbegin", '<style>@charset"UTF-8";details:not([open])>*:not(summary){display:none;}
21417details>summary{display:block;}details>summary::before{content:"\u25ba";padding-right:0.3rem;font-size:0.6rem;cursor:default;}details[open]>summary::before{content:"\u25bc";}</style>')
21418        }, o = function () {
21419            var t, e, n, r, u;
21420            return t = document.createElement("details").constructor.prototype, r = t.setAttribute, n = t.removeAttribute, u = null != (e = Object.getOwnPropertyDescriptor(t, "open")) ? e.set : void 0, Object.defineProperties(t, {
21421                open: {
21422                    set: function (t) {
21423                        return "DETAILS" === this.tagName ? (t ? this.setAttribute("open", "") : this.removeAttribute("open"), t) : null != u ? u.call(this, t) : void 0
21424                    }
21425                },
21426                setAttribute: {
21427                    value: function (t, e) {
21428                        return d(this, function (n) {
21429                            return function () {
21430                                return r.call(n, t, e)
21431                            }
21432                        }(this))
21433                    }
21434                },
21435                removeAttribute: {
21436                    value: function (t) {
21437                        return d(this, function (e) {
21438                            return function () {
21439                                return n.call(e, t)
21440                            }
21441                        }(this))
21442                    }
21443                }
21444            })
21445        }, a = function () {
21446            return r(function (t) {
21447                var e;
21448                return e = t.querySelector("summary"), t.hasAttribute("open") ? (t.removeAttribute("open"), e.setAttribute("aria-expanded", !1)) : (t.setAttribute("open", ""), e.setAttribute("aria-expanded", !0))
21449            })
21450        }, u = function () {
21451            var e, n, r, u, o;
21452            for (u = document.querySelectorAll("summary"), e = 0, n = u.length; n > e; e++) o = u[e], t(o);
21453            return "undefined" != typeof MutationObserver && null !== MutationObserver ? (r = new MutationObserver(function (e) {
21454                var n, r, u, i, a;
21455                for (i = [], r = 0, u = e.length; u > r; r++) n = e[r].addedNodes, i.push(function () {
21456                    var e, r, u;
21457                    for (u = [], e = 0, r = n.length; r > e; e++) a = n[e], "DETAILS" === a.tagName && (o = a.querySelector("summary")) ? u.push(t(o, a)) : u.push(void 0);
21458                    return u
21459                }());
21460                return i
21461            }), r.observe(document.documentElement, {
21462                subtree: !0,
21463                childList: !0
21464            })) : document.addEventListener("DOMNodeInserted", function (e) {
21465                return "SUMMARY" === e.target.tagName ? t(e.target) : void 0
21466            })
21467        }, t = function (t, e) {
21468            return null == e && (e = n(t, "DETAILS")), t.setAttribute("aria-expanded", e.hasAttribute("open")), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"), t.hasAttribute("role") ? void 0 : t.setAttribute("role", "button")
21469        }, s = function () {
21470            var t;
21471            return "undefined" != typeof MutationObserver && null !== MutationObserver ? (t = new MutationObserver(function (t) {
21472                var e, n, r, u, o, i;
21473                for (o = [], n = 0, r = t.length; r > n; n++) u = t[n], i = u.target, e = u.attributeName, "DETAILS" === i.tagName && "open" === e ? o.push(c(i)) : o.push(void 0);
21474                return o
21475            }), t.observe(document.documentElement, {
21476                attributes: !0,
21477                subtree: !0
21478            })) : r(function (t) {
21479                var e;
21480                return e = t.getAttribute("open"), setTimeout(function () {
21481                    return t.getAttribute("open") !== e ? c(t) : void 0
21482                }, 1)
21483            })
21484        }, e = function (t) {
21485            return !(t.defaultPrevented || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || t.target.isContentEditable)
21486        }, r = function (t) {
21487            return addEventListener("click", function (r) {
21488                var u, o;
21489                return e(r) && r.which <= 1 && (u = n(r.target, "SUMMARY")) && "DETAILS" === (null != (o = u.parentElement) ? o.tagName : void 0) ? t(u.parentElement) : void 0
21490            }, !1), addEventListener("keydown", function (r) {
21491                var u, o, i;
21492                return e(r) && (13 === (o = r.keyCode) || 32 === o) && (u = n(r.target, "SUMMARY")) && "DETAILS" === (null != (i = u.parentElement) ? i.tagName : void 0) ? (t(u.parentElement), r.preventDefault()) : void 0
21493            }, !1)
21494        }, n = function () {
21495            return "function" == typeof Element.prototype.closest ? function (t, e) {
21496                return t.closest(e)
21497            } : function (t, e) {
21498                for (; t;) {
21499                    if (t.tagName === e) return t;
21500                    t = t.parentElement
21501                }
21502            }
21503        }(), c = function (t) {
21504            var e;
21505            return e = document.createEvent("Events"), e.initEvent("toggle", !0, !1), t.dispatchEvent(e)
21506        }, d = function (t, e) {
21507            var n, r;
21508            return n = t.getAttribute("open"), r = e(), t.getAttribute("open") !== n && c(t), r
21509        }, l.element || (i(), o(), a(), u()), l.element && !l.toggleEvent && s())
21510    }.call(this),
21511    function () { }.call(this);
21512
21513/*  fixheight  */
21514/**
21515 * Component equalHeight
21516 * makes the same height of content that 'equal' class or for flip sides
21517 * @module equalHeight
21518 * @param  {jQuery} $ Instance of jQuery
21519 * @return {Object} List of equalHeight methods
21520 */
21521XA.component.equalHeight = (function ($) {
21522    /**
21523    * List of selectors for calculating height functionality
21524    * @type {Object.<Methods>}
21525    * @memberOf module:equalHeight
21526    * */
21527    var settings = {
21528        parentSelector: '.equalized-content',
21529        selector: '.equal:not(.flip.component),.flip .Side0,.flip .Side1'
21530    };
21531    /**
21532     * This object stores all public api methods
21533     * @type {Object.<Methods>}
21534     * @memberOf module:equalHeight
21535     * */
21536    var api = {};
21537    /**
21538    * fixHeight method calculates height of bigger element 
21539    * and sets up the same size for other elements
21540    * @memberOf module:equalHeight
21541    * @alias module:equalHeight.fixHeight
21542    */
21543    api.fixHeight = function () {
21544
21545        $(settings.parentSelector).each(function () {
21546            var $elements = $(this).find(settings.selector),
21547                maxHeight = 0;
21548
21549
21550
21551            $elements.each(function () {
21552                var $element = $(this);
21553                $element.css('min-height', 'inherit');
21554                $element.find('>.component-content').css('min-height', 'inherit');
21555
21556                if ($element.outerHeight(true) > maxHeight) {
21557                    maxHeight = $element.outerHeight(true);
21558                }
21559            });
21560
21561            if (maxHeight > 0) {
21562                $elements.each(function () {
21563                    var $element = $(this);
21564                    if ($element.hasClass("Side0") || $element.hasClass("Side1")) {
21565                        $element.parent().attr('class', 'flip').css({ 'min-height': maxHeight });
21566                    }
21567                    $element.css({
21568                        'min-height': maxHeight
21569                    });
21570                    $element.find('>.component-content').css({
21571                        'min-height': maxHeight
21572                    });
21573                });
21574            }
21575        });
21576    }
21577    /**
21578      * init method binds call of 
21579      * ["fixHeight"]{@link module:equalHeight.fixHeight} method
21580      * for window load and resize events
21581      * @memberOf module:equalHeight
21582      * @alias module:equalHeight.init
21583      */
21584    api.init = function () {
21585        $(document).ready(function () {
21586            api.fixHeight();
21587        })
21588
21589        $(window).on('resize', function () {
21590            setTimeout(api.fixHeight, 0);
21591        });
21592    };
21593
21594    return api;
21595
21596}(jQuery, document));
21597
21598XA.register("equalHeight", XA.component.equalHeight);
21599
21600/*  html2pdfbundlemin  */
21601/**
21602 * html2pdf.js v0.9.3
21603 * Copyright (c) 2021 Erik Koopmans
21604 * Released under the MIT License.
21605 */
21606(function (global, factory) {
21607	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
21608	typeof define === 'function' && define.amd ? define(factory) :
21609	(global.html2pdf = factory());
21610}(this, (function () { 'use strict';
21611
21612var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
21613
21614function commonjsRequire () {
21615	throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
21616}
21617
21618function unwrapExports (x) {
21619	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
21620}
21621
21622function createCommonjsModule(fn, module) {
21623	return module = { exports: {} }, fn(module, module.exports), module.exports;
21624}
21625
21626var jspdf_min = createCommonjsModule(function (module, exports) {
21627!function(t,e){module.exports=e();}(commonjsGlobal,function(){var t,y,e,I,i,o,a,h,C,T,d,p,F,n,r,s,c,P,E,q,g,m,w,l,v,b,x,S,u,k,_,f,A,O,B,R,j,D,M,U,N,z,L,H,W,G,V,Y,X,J,K,Q,Z,vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$=function(pt){var gt="1.3",mt={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],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};function wt(o){var a={};this.subscribe=function(t,e,n){if("function"!=typeof e)return!1;a.hasOwnProperty(t)||(a[t]={});var r=Math.random().toString(35);return a[t][r]=[e,!!n], r}, this.unsubscribe=function(t){for(var e in a)if(a[e][t])return delete a[e][t], !0;return!1}, this.publish=function(t){if(a.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1
21627),n=[];for(var r in a[t]){var i=a[t][r];try{i[0].apply(o,e);}catch(t){pt.console&&console.error("jsPDF PubSub Error",t.message,t);}i[1]&&n.push(r);}n.length&&n.forEach(this.unsubscribe);}};}function yt(t,e,n,r){var i={};"object"===(void 0===t?"undefined":vt(t))&&(t=(i=t).orientation, e=i.unit||e, n=i.format||n, r=i.compress||i.compressPdf||r), e=e||"mm", n=n||"a4", t=(""+(t||"P")).toLowerCase();(""+n).toLowerCase();var K,w,y,o,u,v,a,s,h,c,l,f=!!r&&"function"==typeof Uint8Array,Q=i.textColor||"0 g",d=i.drawColor||"0 G",Z=i.fontSize||16,$=i.charSpace||0,tt=i.R2L||!1,et=i.lineHeight||1.15,p=i.lineWidth||.200025,g="00000000000000000000000000000000",m=2,b=!1,x=[],nt={},S={},k=0,_=[],A=[],I=[],C=[],T=[],F=0,P=0,E=0,q={title:"",subject:"",author:"",keywords:"",creator:""},O={},rt=new wt(O),B=i.hotfixes||[],R=function(t){var e,n=t.ch1,r=t.ch2,i=t.ch3,o=t.ch4,a=(t.precision, "draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof n&&"#"!==n.charAt(0)){var s=new RGBColor(n);s.ok&&(n=s.toHex());}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]), "string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var h=parseInt(n.substr(1),16);n=h>>16&255, r=h>>8&255, i=255&h;}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=N(n/255)+" "+a[0];break;case 3:default:e=z(n/255)+" "+a[0];}else if(void 0===o||"object"===(void 0===o?"undefined":vt(o))){if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[N(n/255),N(r/255),N(i/255),a[1]].join(" ");break;default:case 3:e=[z(n/255),z(r/255),z(i/255),a[1]].join(" ");}o&&0===o.a&&(e=["255","255","255",a[1]].join(" "));}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[N(n),N(r),N(i),N(o),a[2]].join(" ");break;case 3:default:e=[z(n),z(r),z(i),z(o),a[2]].join(" ");}return e},j=function(t){var e=function(t){return("0"+parseInt(t)).slice(-2)},n=t.getTimezoneOffset(),r=n<0?"+":"-",i=Math.floor(Math.abs(n/60)),o=Math.abs(n%60),a=[r,e(i),"'",e(o),"'"].join("");return["D:",t.getFullYear(),e(t.getMonth()+1),e(t.getDate()),e(t.getHours()),e(t.getMinutes()),e(t.getSeconds()),a].join("")},D=function(t){var e;return void 0===(void 0===t?"undefined":vt(t))&&(t=new Date), e="object"===(void 0===t?"undefined":vt(t))&&"[object Date]"===Object.prototype.toString.call(t)?j(t):/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t)?t:j(new Date), c=e},M=function(t){var e=c;return"jsDate"===t&&(e=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),a=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10), parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,a,0)}(c)), e},U=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""), g=t},N=function(t){return t.toFixed(2)},z=function(t){return t.toFixed(3)},it=function(t){t="string"==typeof t?t:t.toString(), b?_[o].push(t):(E+=t.length+1, C.push(t));},L=function(){return x[++m]=E, it(m+" 0 obj"), m},H=function(t){it("stream"), it(t), it("endstream");},W=function(){for(var t in it("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), it("/Font <<"), nt)nt.hasOwnProperty(t)&&it("/"+t+" "+nt[t].objectNumber+" 0 R");it(">>"), it("/XObject <<"), rt.publish("putXobjectDict"), it(">>");},G=function(){!function(){for(var t in nt)nt.hasOwnProperty(t)&&(e=nt[t], rt.publish("putFont",{font:e,out:it,newObject:L}), !0!==e.isAlreadyPutted&&(e.objectNumber=L(), it("<<"), it("/Type /Font"), it("/BaseFont /"+e.postScriptName), it("/Subtype /Type1"), "string"==typeof e.encoding&&it("/Encoding /"+e.encoding), it("/FirstChar 32"), it("/LastChar 255"), it(">>"), it("endobj")));var e;}(), rt.publish("putResources"), x[2]=E, it("2 0 obj"), it("<<"), W(), it(">>"), it("endobj"), rt.publish("postPutResources");},V=function(t,e,n){S.hasOwnProperty(e)||(S[e]={}), S[e][n]=t;},Y=function(t,e,n,r){var i="F"+(Object.keys(nt).length+1).toString(10),o=nt[i]={id:i,postScriptName:t,fontName:e,fontStyle:n,encoding:r,metadata:{}};return V(i,e,n), rt.publish("addFont",o), i},ot=function(t,e){return function(t,e){var n,r,i,o,a,s,h,c,l;if(i=(e=e||{}).sourceEncoding||"Unicode", a=e.outputEncoding, (e.autoencode||a)&&nt[K].metadata&&nt[K].metadata[i]&&nt[K].metadata[i].encoding&&(o=nt[K].metadata[i].encoding, !a&&nt[K].encoding&&(a=nt[K].encoding), !a&&o.codePages&&(a=o.c
21627odePages[0]), "string"==typeof a&&(a=o[a]), a)){for(h=!1, s=[], n=0, r=t.length;n<r;n++)(c=a[t.charCodeAt(n)])?s.push(String.fromCharCode(c)):s.push(t[n]), s[n].charCodeAt(0)>>8&&(h=!0);t=s.join("");}for(n=t.length;void 0===h&&0!==n;)t.charCodeAt(n-1)>>8&&(h=!0), n--;if(!h)return t;for(s=e.noBOM?[]:[254,255], n=0, r=t.length;n<r;n++){if((l=(c=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(l), s.push(c-(l<<8));}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},X=function(){(function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();mt.hasOwnProperty(r)&&(t=mt[r][0]/w, e=mt[r][1]/w);}if(Array.isArray(t)&&(e=t[1], t=t[0]), n){switch(n.substr(0,1)){case"l":t<e&&(n="s");break;case"p":e<t&&(n="s");}"s"===n&&(y=t, t=e, e=y);}b=!0, _[++k]=[], I[k]={width:Number(t)||u,height:Number(e)||v}, A[k]={}, J(k);}).apply(this,arguments), it(N(p*w)+" w"), it(d), 0!==F&&it(F+" J"), 0!==P&&it(P+" j"), rt.publish("addPage",{pageNumber:k});},J=function(t){0<t&&t<=k&&(u=I[o=t].width, v=I[t].height);},at=function(t,e,n){var r,i=void 0;return n=n||{}, t=void 0!==t?t:nt[K].fontName, e=void 0!==e?e:nt[K].fontStyle, r=t.toLowerCase(), void 0!==S[r]&&void 0!==S[r][e]?i=S[r][e]:void 0!==S[t]&&void 0!==S[t][e]?i=S[t][e]:!1===n.disableWarning&&console.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."), i||n.noFallback||null==(i=S.times[e])&&(i=S.times.normal), i},st=function(){b=!1, m=2, E=0, C=[], x=[], T=[], rt.publish("buildDocument"), it("%PDF-"+gt), it("%ºß¬à"), function(){var t,e,n,r,i,o,a,s,h,c=[];for(a=pt.adler32cs||yt.API.adler32cs, f&&void 0===a&&(f=!1), t=1;t<=k;t++){if(c.push(L()), s=(u=I[t].width)*w, h=(v=I[t].height)*w, it("<</Type /Page"), it("/Parent 1 0 R"), it("/Resources 2 0 R"), it("/MediaBox [0 0 "+N(s)+" "+N(h)+"]"), rt.publish("putPage",{pageNumber:t,page:_[t]}), it("/Contents "+(m+1)+" 0 R"), it(">>"), it("endobj"), e=_[t].join("\n"), L(), f){for(n=[], r=e.length;r--;)n[r]=e.charCodeAt(r);o=a.from(e), (i=new Deflater(6)).append(new Uint8Array(n)), e=i.flush(), (n=new Uint8Array(e.length+6)).set(new Uint8Array([120,156])), n.set(e,2), n.set(new Uint8Array([255&o,o>>8&255,o>>16&255,o>>24&255]),e.length+2), e=String.fromCharCode.apply(null,n), it("<</Length "+e.length+" /Filter [/FlateDecode]>>");}else it("<</Length "+e.length+">>");H(e), it("endobj");}x[1]=E, it("1 0 obj"), it("<</Type /Pages");var l="/Kids [";for(r=0;r<k;r++)l+=c[r]+" 0 R ";it(l+"]"), it("/Count "+k), it(">>"), it("endobj"), rt.publish("postPutPages");}(), function(){rt.publish("putAdditionalObjects");for(var t=0;t<T.length;t++){var e=T[t];x[e.objId]=E, it(e.objId+" 0 obj"), it(e.content), it("endobj");}m+=T.length, rt.publish("postPutAdditionalObjects");}(), G(), L(), it("<<"), function(){for(var t in it("/Producer (jsPDF "+yt.version+")"), q)q.hasOwnProperty(t)&&q[t]&&it("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+ot(q[t])+")");it("/CreationDate ("+c+")");}(), it(">>"), it("endobj"), L(), it("<<"), function(){switch(it("/Type /Catalog"), it("/Pages 1 0 R"), s||(s="fullwidth"), s){case"fullwidth":it("/OpenAction [3 0 R /FitH null]");break;case"fullheight":it("/OpenAction [3 0 R /FitV null]");break;case"fullpage":it("/OpenAction [3 0 R /Fit]");break;case"original":it("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+s;"%"===t.substr(t.length-1)&&(s=parseInt(s)/100), "number"==typeof s&&it("/OpenAction [3 0 R /XYZ null null "+N(s)+"]");}switch(h||(h="continuous"), h){case"continuous":it("/PageLayout /OneColumn");break;case"single":it("/PageLayout /SinglePage");break;case"two":case"twoleft":it("/PageLayout /TwoColumnLeft");break;case"tworight":it("/PageLayout /TwoColumnRight");}a&&it("/PageMode /"+a), rt.publish("putCatalog");}(), it(">>"), it("endobj");var t,e=E,n="0000000000";for(it("xref"), it("0 "+(m+1)), it(n+" 65535 f "), t=1;t<=m;t++){var r=x[t];it("function"==typeof r?(n+x[t]()).slice(-10)+" 00000 n ":(n+x[t]).slice(-10)+" 00000 n ");}return it("trailer"), it("<<"), it("/Size "+(m+1)), it("/Root "+m+" 0 R"), it("/Info "+(m-1)+" 0 R"), it("/ID [ <"+g+"> <"+g+"> ]"), it(">>
21627"), it("startxref"), it(""+e), it("%%EOF"), b=!0, C.join("\n")},ht=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t), e},ct=function(){for(var t=st(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},lt=function(){return new Blob([ct()],{type:"application/pdf"})},ut=((l=function(t,e){var n="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(st()):0;switch(t){case void 0:return st();case"save":if("object"===("undefined"==typeof navigator?"undefined":vt(navigator))&&navigator.getUserMedia&&(void 0===pt.URL||void 0===pt.URL.createObjectURL))return O.output("dataurlnewwindow");bt(lt(),e), "function"==typeof bt.unload&&pt.setTimeout&&setTimeout(bt.unload,911);break;case"arraybuffer":return ct();case"blob":return lt();case"bloburi":case"bloburl":return pt.URL&&pt.URL.createObjectURL(lt())||void 0;case"datauristring":case"dataurlstring":return n;case"dataurlnewwindow":var r=pt.open(n);if(r||"undefined"==typeof safari)return r;case"datauri":case"dataurl":return pt.document.location.href=n;default:throw new Error('Output type "'+t+'" is not supported.')}}).foo=function(){try{return l.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!pt.console)throw new Error(n);pt.console.error(n,t), pt.alert&&alert(n);}}, (l.foo.bar=l).foo),ft=function(t){return!0===Array.isArray(B)&&-1<B.indexOf(t)};switch(e){case"pt":w=1;break;case"mm":w=72/25.4;break;case"cm":w=72/2.54;break;case"in":w=72;break;case"px":w=1==ft("px_scaling")?.75:96/72;break;case"pc":case"em":w=12;break;case"ex":w=6;break;default:throw"Invalid unit: "+e}for(var dt in D(), U(), O.internal={pdfEscape:ot,getStyle:ht,getFont:function(){return nt[at.apply(O,arguments)]},getFontSize:function(){return Z},getCharSpace:function(){return $},getTextColor:function(){var t=Q.split(" ");if(2===t.length&&"g"===t[1]){var e=parseFloat(t[0]);t=[e,e,e,"r"];}for(var n="#",r=0;r<3;r++)n+=("0"+Math.floor(255*parseFloat(t[r])).toString(16)).slice(-2);return n},getLineHeight:function(){return Z*et},write:function(t){it(1===arguments.length?t:Array.prototype.join.call(arguments," "));},getCoordinateString:function(t){return N(t*w)},getVerticalCoordinateString:function(t){return N((v-t)*w)},collections:{},newObject:L,newAdditionalObject:function(){var t=2*_.length+1,e={objId:t+=T.length,content:""};return T.push(e), e},newObjectDeferred:function(){return x[++m]=function(){return E}, m},newObjectDeferredBegin:function(t){x[t]=E;},putStream:H,events:rt,scaleFactor:w,pageSize:{getWidth:function(){return u},getHeight:function(){return v}},output:function(t,e){return ut(t,e)},getNumberOfPages:function(){return _.length-1},pages:_,out:it,f2:N,getPageInfo:function(t){return{objId:2*(t-1)+3,pageNumber:t,pageContext:A[t]}},getCurrentPageInfo:function(){return{objId:2*(o-1)+3,pageNumber:o,pageContext:A[o]}},getPDFVersion:function(){return gt},hasHotfix:ft}, O.addPage=function(){return X.apply(this,arguments), this}, O.setPage=function(){return J.apply(this,arguments), this}, O.insertPage=function(t){return this.addPage(), this.movePage(o,t), this}, O.movePage=function(t,e){if(e<t){for(var n=_[t],r=I[t],i=A[t],o=t;e<o;o--)_[o]=_[o-1], I[o]=I[o-1], A[o]=A[o-1];_[e]=n, I[e]=r, A[e]=i, this.setPage(e);}else if(t<e){for(n=_[t], r=I[t], i=A[t], o=t;o<e;o++)_[o]=_[o+1], I[o]=I[o+1], A[o]=A[o+1];_[e]=n, I[e]=r, A[e]=i, this.setPage(e);}return this}, O.deletePage=function(){return function(t){0<t&&t<=k&&(_.splice(t,1), I.splice(t,1), --k<o&&(o=k), this.setPage(o));}.apply(this,arguments), this}, O.setCreationDate=function(t){return D(t), this}, O.getCreationDate=function(t){return M(t)}, O.setFileId=function(t){return U(t), this}, O.getFileId=function(){return g}, O.setDisplayMode=function(t,e,n){if(s=t, h=e, -1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(a=n))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+n+'" is not recognized.');return this}, O.text=function(t,e,n,i){var r,o,a="",s=et,h=this;function c(t){for(var e,n=t.concat(),r=[],i=n.length;i--;
21627)"string"==typeof(e=n.shift())?r.push(e):"[object Array]"===Object.prototype.toString.call(t)&&1===e.length?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function l(t,e){var n;if("string"==typeof t)n=e(t)[0];else if("[object Array]"===Object.prototype.toString.call(t)){for(var r,i,o=t.concat(),a=[],s=o.length;s--;)"string"==typeof(r=o.shift())?a.push(e(r)[0]):"[object Array]"===Object.prototype.toString.call(r)&&"string"===r[0]&&(i=e(r[0],r[1],r[2]), a.push([i[0],i[1],i[2]]));n=a;}return n}"number"==typeof t&&(o=n, n=e, e=t, t=o);var u=i,f=arguments[4],d=arguments[5];"object"===(void 0===u?"undefined":vt(u))&&null!==u||("string"==typeof f&&(d=f, f=null), "string"==typeof u&&(d=u, u=null), "number"==typeof u&&(f=u, u=null), i={flags:u,angle:f,align:d});var p=!1,g=!0;if("string"==typeof t)p=!0;else if("[object Array]"===Object.prototype.toString.call(t)){for(var m,w=t.concat(),y=[],v=w.length;v--;)("string"!=typeof(m=w.shift())||"[object Array]"===Object.prototype.toString.call(m)&&"string"!=typeof m[0])&&(g=!1);p=g;}if(!1===p)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');var b=nt[K].encoding;"WinAnsiEncoding"!==b&&"StandardEncoding"!==b||(t=l(t,function(t,e,n){return[(r=t, r=r.split("\t").join(Array(i.TabLen||9).join(" ")), ot(r,u)),e,n];var r;})), "string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]), 0<(j=i.maxWidth||0)&&("string"==typeof t?t=h.splitTextToSize(t,j):"[object Array]"===Object.prototype.toString.call(t)&&(t=h.splitTextToSize(t.join(" "),j)));var x={text:t,x:e,y:n,options:i,mutex:{pdfEscape:ot,activeFontKey:K,fonts:nt,activeFontSize:Z}};rt.publish("preProcessText",x), t=x.text;f=(i=x.options).angle;var S=h.internal.scaleFactor,k=(h.internal.pageSize.getHeight(), []);if(f){f*=Math.PI/180;var _=Math.cos(f),A=Math.sin(f),I=function(t){return t.toFixed(2)};k=[I(_),I(A),I(-1*A),I(_)];}void 0!==(R=i.charSpace)&&(a+=R+" Tc\n");i.lang;var C=-1,T=i.renderingMode||i.stroke,F=h.internal.getCurrentPageInfo().pageContext;switch(T){case 0:case!1:case"fill":C=0;break;case 1:case!0:case"stroke":C=1;break;case 2:case"fillThenStroke":C=2;break;case 3:case"invisible":C=3;break;case 4:case"fillAndAddForClipping":C=4;break;case 5:case"strokeAndAddPathForClipping":C=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":C=6;break;case 7:case"addToPathForClipping":C=7;}var P=F.usedRenderingMode||-1;-1!==C?a+=C+" Tr\n":-1!==P&&(a+="0 Tr\n"), -1!==C&&(F.usedRenderingMode=C);d=i.align||"left";var E=Z*s,q=h.internal.pageSize.getHeight(),O=h.internal.pageSize.getWidth(),B=(S=h.internal.scaleFactor, nt[K]),R=i.charSpace||$,j=i.maxWidth||0,D=(u={}, []);if("[object Array]"===Object.prototype.toString.call(t)){var M,U;y=c(t);"left"!==d&&(U=y.map(function(t){return h.getStringUnitWidth(t,{font:B,charSpace:R,fontSize:Z})*Z/S}));var N,z=Math.max.apply(Math,U),L=0;if("right"===d){e-=U[0], t=[];var H=0;for(v=y.length;H<v;H++)z-U[H], 0===H?(N=e*S, M=(q-n)*S):(N=(L-U[H])*S, M=-E), t.push([y[H],N,M]), L=U[H];}else if("center"===d){e-=U[0]/2, t=[];for(H=0, v=y.length;H<v;H++)(z-U[H])/2, 0===H?(N=e*S, M=(q-n)*S):(N=(L-U[H])/2*S, M=-E), t.push([y[H],N,M]), L=U[H];}else if("left"===d){t=[];for(H=0, v=y.length;H<v;H++)M=0===H?(q-n)*S:-E, N=0===H?e*S:0, t.push(y[H]);}else{if("justify"!==d)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[];for(j=0!==j?j:O, H=0, v=y.length;H<v;H++)M=0===H?(q-n)*S:-E, N=0===H?e*S:0, H<v-1&&D.push(((j-U[H])/(y[H].split(" ").length-1)*S).toFixed(2)), t.push([y[H],N,M]);}}!0===("boolean"==typeof i.R2L?i.R2L:tt)&&(t=l(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]}));x={text:t,x:e,y:n,options:i,mutex:{pdfEscape:ot,activeFontKey:K,fonts:nt,activeFontSize:Z}};rt.publish("postProcessText",x), t=x.text, r=x.mutex.isHex;y=c(t);t=[];var W,G,V,Y=0,X=(v=y.length, "");for(H=0;H<v;H++)X="", "[object Array]"!==Object.prototype.toString.call(y[H])?(W=parseFloat(e*S).toFixed(2), G=parseFloat((q-n)*S).toFixed(2), V=(r?"<":"(")+y[H]+(r?">":")")):"[object Array]"===Object.prototype.toString.call(y[H])&&(W=parseFloat(y[H][1]).toFixed(2), G=parseFloat(y[H][2]).toFixed(2), V=(r?"<":"(")+y[H][0]+(r?">":")"), Y=1), void 0!==D&&void 0!==D[H]&&(X=D[H]+" Tw\n"), 0!==k.length&&0===H?t.push(X+k.join(" ")+" "+W+" "+G+" Tm\n"+V):1===Y||0===Y&&0===H?t.push(X+W+" "+G+" Td\n"+V):t.push(X+V);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"), t+=" Tj\n";var J="BT\n/"+K+" "+Z+" Tf\n"+(Z*s).toFixed(2)+" TL\n"+Q+"\n";return J+=a, J+=t, it(J+="ET"), h}, O.lstext=function(t,e,n,r){console.warn("jsPDF.lstext is deprecated");for(var i=0,o=t.length;i<o;i++, e+=r)this.text(t[i],e,n);return this}, O.line=function(t,e,n,r){return this.lines([[n-t,r-e]],t,e)}
21627, O.clip=function(){it("W"), it("S");}, O.clip_fixed=function(t){it("evenodd"===t?"W*":"W"), it("n");}, O.lines=function(t,e,n,r,i,o){var a,s,h,c,l,u,f,d,p,g,m;for("number"==typeof t&&(y=n, n=e, e=t, t=y), r=r||[1,1], it(z(e*w)+" "+z((v-n)*w)+" m "), a=r[0], s=r[1], c=t.length, g=e, m=n, h=0;h<c;h++)2===(l=t[h]).length?(g=l[0]*a+g, m=l[1]*s+m, it(z(g*w)+" "+z((v-m)*w)+" l")):(u=l[0]*a+g, f=l[1]*s+m, d=l[2]*a+g, p=l[3]*s+m, g=l[4]*a+g, m=l[5]*s+m, it(z(u*w)+" "+z((v-f)*w)+" "+z(d*w)+" "+z((v-p)*w)+" "+z(g*w)+" "+z((v-m)*w)+" c"));return o&&it(" h"), null!==i&&it(ht(i)), this}, O.rect=function(t,e,n,r,i){ht(i);return it([N(t*w),N((v-e)*w),N(n*w),N(-r*w),"re"].join(" ")), null!==i&&it(ht(i)), this}, O.triangle=function(t,e,n,r,i,o,a){return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],a,!0), this}, O.roundedRect=function(t,e,n,r,i,o,a){var s=4/3*(Math.SQRT2-1);return this.lines([[n-2*i,0],[i*s,0,i,o-o*s,i,o],[0,r-2*o],[0,o*s,-i*s,o,-i,o],[2*i-n,0],[-i*s,0,-i,-o*s,-i,-o],[0,2*o-r],[0,-o*s,i*s,-o,i,-o]],t+i,e,[1,1],a), this}, O.ellipse=function(t,e,n,r,i){var o=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return it([N((t+n)*w),N((v-e)*w),"m",N((t+n)*w),N((v-(e-a))*w),N((t+o)*w),N((v-(e-r))*w),N(t*w),N((v-(e-r))*w),"c"].join(" ")), it([N((t-o)*w),N((v-(e-r))*w),N((t-n)*w),N((v-(e-a))*w),N((t-n)*w),N((v-e)*w),"c"].join(" ")), it([N((t-n)*w),N((v-(e+a))*w),N((t-o)*w),N((v-(e+r))*w),N(t*w),N((v-(e+r))*w),"c"].join(" ")), it([N((t+o)*w),N((v-(e+r))*w),N((t+n)*w),N((v-(e+a))*w),N((t+n)*w),N((v-e)*w),"c"].join(" ")), null!==i&&it(ht(i)), this}, O.circle=function(t,e,n,r){return this.ellipse(t,e,n,n,r)}, O.setProperties=function(t){for(var e in q)q.hasOwnProperty(e)&&t[e]&&(q[e]=t[e]);return this}, O.setFontSize=function(t){return Z=t, this}, O.setFont=function(t,e){return K=at(t,e), this}, O.setFontStyle=O.setFontType=function(t){return K=at(void 0,t), this}, O.getFontList=function(){var t,e,n,r={};for(t in S)if(S.hasOwnProperty(t))for(e in r[t]=n=[], S[t])S[t].hasOwnProperty(e)&&n.push(e);return r}, O.addFont=function(t,e,n,r){Y(t,e,n,r=r||"Identity-H");}, O.setLineWidth=function(t){return it((t*w).toFixed(2)+" w"), this}, O.setDrawColor=function(t,e,n,r){return it(R({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2})), this}, O.setFillColor=function(t,e,n,r){return it(R({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2})), this}, O.setTextColor=function(t,e,n,r){return Q=R({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}), this}, O.setCharSpace=function(t){return $=t, this}, O.setR2L=function(t){return tt=t, this}, O.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2}, O.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return it((F=e)+" J"), this}, O.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return it((P=e)+" j"), this}, O.output=ut, O.save=function(t){O.output("save",t);}, yt.API)yt.API.hasOwnProperty(dt)&&("events"===dt&&yt.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0], r=e[i][1], t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r));}(rt,yt.API.events):O[dt]=yt.API[dt]);return function(){for(var t="helvetica",e="times",n="courier",r="normal",i="bold",o="italic",a="bolditalic",s=[["Helvetica",t,r,"WinAnsiEncoding"],["Helvetica-Bold",t,i,"WinAnsiEncoding"],["Helvetica-Oblique",t,o,"WinAnsiEncoding"],["Helvetica-BoldOblique",t,a,"WinAnsiEncoding"],["Courier",n,r,"WinAnsiEncoding"],["Courier-Bold",n,i,"WinAnsiEncoding"],["Courier-Oblique",n,o,"WinAnsiEncoding"],["Courier-BoldOblique",n,a,"WinAnsiEncoding"],["Times-Roman",e,r,"WinAnsiEncoding"],["Times-Bold",e,i,"WinAnsiEncoding"],["Times-Italic",e,o,"WinAnsiEncoding"],["Times-BoldItalic",e,a,"WinAnsiEncoding"],["ZapfDingbats","zapfdingbats",r,null],["Symbol","symbol",r,null]],h=0,c=s.length;h<c;h++){var l=Y(s[h][0],s[h][1],s[h][2],s[h][3]),u=s[h][0].split("-");V(l,u[0],u[1]||"");}rt.publish("addFonts",{fonts:nt,dictionary:S});}(), K="F1", X(n,t), rt.publish("initialized"), O}return yt.API={events:[]}, yt.version="0.0.0", "function"==typeof undefined&&undefined.amd?undefined("jsPDF",function(){return yt}):"undefined"!='object'&&module.exports?(module.exports=yt, module.exports.jsPDF=yt):pt.jsPDF=yt, yt}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")());
21628/** @preserve
21629   * jsPDF - PDF Document creation from JavaScript
21630   * Version 1.4.1 Built on 2018-06-06T07:49:34.040Z
21631   *                           CommitID 3233f44044
21632   *
21633   * Copyright (c) 2010-2016 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
21634   *               2010 Aaron Spike, https://github.com/acspike
21635   *               2012 Willow Systems Corporation, willow-systems.com
21636   *               2012 Pablo Hess, https://github.com/pablohess
21637   *               2012 Florian Jenett, https://github.com/fjenett
21638   *               2013 Warren Weckesser, https://github.com/warrenweckesser
21639   *               2013 Youssef Beddad, https://github.com/lifof
21640   *               2013 Lee Driscoll, https://github.com/lsdriscoll
21641   *               2013 Stefan Slonevskiy, https://github.com/stefslon
21642   *               2013 Jeremy Morel, https://github.com/jmorel
21643   *               2013 Christoph Hartmann, https://github.com/chris-rock
21644   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
21645   *               2014 James Makes, https://github.com/dollaruw
21646   *               2014 Diego Casorran, https://github.com/diegocr
21647   *               2014 Steven Spungin, https://github.com/Flamenco
21648   *               2014 Kenneth Glassey, https://github.com/Gavver
21648s
21649   *
21650   * Licensed under the MIT License
21651   *
21652   * Contributor(s):
21653   *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
21654   *    kim3er, mfo, alnorth, Flamenco
21655   */
21656/**
21657   * jsPDF AcroForm Plugin Copyright (c) 2016 Alexander Weidt,
21658   * https://github.com/BiggA94
21659   * 
21660   * Licensed under the MIT License. http://opensource.org/licenses/mit-license
21661   */
21662!function(n,t){var l,a,e=1,r=function(t,e){t.prototype=Object.create(e.prototype), t.prototype.constructor=t;},s=function(t){return t*(e/1)},h=function(t){var e=new I,n=N.internal.getHeight(t)||0,r=N.internal.getWidth(t)||0;return e.BBox=[0,0,r.toFixed(2),n.toFixed(2)], e},i=function(t,e,n){t=t||0;var r=1;if(r<<=e-1, 1==(n=n||1))t=t|r;else t=t&~r;return t},o=function(t,e,n){n=n||1.3, t=t||0;return 1==e.readOnly&&(t=i(t,1)), 1==e.required&&(t=i(t,2)), 1==e.noExport&&(t=i(t,3)), 1==e.multiline&&(t=i(t,13)), e.password&&(t=i(t,14)), e.noToggleToOff&&(t=i(t,15)), e.radio&&(t=i(t,16)), e.pushbutton&&(t=i(t,17)), e.combo&&(t=i(t,18)), e.edit&&(t=i(t,19)), e.sort&&(t=i(t,20)), e.fileSelect&&1.4<=n&&(t=i(t,21)), e.multiSelect&&1.4<=n&&(t=i(t,22)), e.doNotSpellCheck&&1.4<=n&&(t=i(t,23)), 1==e.doNotScroll&&1.4<=n&&(t=i(t,24)), e.richText&&1.4<=n&&(t=i(t,25)), t},u=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o={};return Array.isArray(e)?(e[0]=s(e[0]), e[1]=s(e[1]), e[2]=s(e[2]), e[3]=s(e[3])):(e=s(e), n=s(n), r=s(r), i=s(i)), o.lowerLeft_X=e||0, o.lowerLeft_Y=s(a)-n-i||0, o.upperRight_X=e+r||0, o.upperRight_Y=s(a)-n||0, [o.lowerLeft_X.toFixed(2),o.lowerLeft_Y.toFixed(2),o.upperRight_X.toFixed(2),o.upperRight_Y.toFixed(2)]},f=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=c(t,n);e.push("/Tx BMC"), e.push("q"), e.push("/F1 "+r.fontSize.toFixed(2)+" Tf"), e.push("1 0 0 1 0 0 Tm"), e.push("BT"), e.push(r.text), e.push("ET"), e.push("Q"), e.push("EMC");var i=new h(t);return i.stream=e.join("\n"), i}},c=function(t,e,i,n){n=n||12, i=i||"helvetica";var r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" "),a=n,s=N.internal.getHeight(t)||0;s=s<0?-s:s;var h=N.internal.getWidth(t)||0;h=h<0?-h:h;var c=function(t,e,n){if(t+1<o.length){var r=e+" "+o[t+1];return A(r,n+"px",i).width<=h-4}return!1};a++;t:for(;;){e="";var l=A("3",--a+"px",i).height,u=t.multiline?s-a:(s-l)/2,f=-2,d=u+=2,p=0,g=0,m=0;if(a<=0){a=12, e="(...) Tj\n", e+="% Width of Text: "+A(e,"1px").width+", FieldWidth:"+h+"\n";break}m=A(o[0]+" ",a+"px",i).width;var w="",y=0;for(var v in o){w=" "==(w+=o[v]+" ").substr(w.length-1)?w.substr(0,w.length-1):w;var b=parseInt(v);m=A(w+" ",a+"px",i).width;var x=c(b,w,a),S=v>=o.length-1;if(!x||S){if(x||S){if(S)g=b;else if(t.multiline&&s<(l+2)*(y+2)+2)continue t}else{if(!t.multiline)continue t;if(s<(l+2)*(y+2)+2)continue t;g=b;}for(var k="",_=p;_<=g;_++)k+=o[_]+" ";switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k, m=A(k,a+"px",i).width, t.Q){case 2:f=h-m-2;break;case 1:f=(h-m)/2;break;case 0:default:f=2;}e+=f.toFixed(2)+" "+d.toFixed(2)+" Td\n", e+="("+k+") Tj\n", e+=-f.toFixed(2)+" 0 Td\n", d=-(a+2), m=0, p=g+1, y++, w="";}else w+=" ";}break}return r.text=e, r.fontSize=a, r},A=function(t,e,n){n=n||"helvetica";var r=l.internal.getFont(n),i=l.getStringUnitWidth(t,{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e);return{height:l.getStringUnitWidth("3",{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e)*1.5,width:i}},d={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){for(var t in l.internal.acroformPlugin.acroFormDictionaryRoot.Fields){var e=l.internal.acroformPlugin.acroFormDictionaryRoot.Fields[t];e.hasAnnotation&&m.call(l,e);}},g=function(t){l.internal.acroformPlugin.printedOut&&(l.internal.acroformPlugin.printedOut=!1, l.internal.acroformPlugin.acroFormDictionaryRoot=null), l.internal.acroformPlugin.acroFormDictionaryRoot||x.call(l), l.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t);},m=function(t){var e={type:"reference",object:t};l.annotationPlugin.annotations[l.internal.getPageInfo(t.page).pageNumber].push(e);},w=function(){void 0!==l.internal.acroformPlugin.acroFormDictionaryRoot?l.internal.write("/AcroForm "+l.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...");},y=function(){l.internal.events.unsubscribe(l.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete l.internal.acroformPlugin.acroFormDictionaryRoot._eventID, l.internal.acroformPlugin.printedOut=!0;},v=function(t){var e=!t;t||(l.internal.newObjectDeferredBegin(l.internal.acroformPlugin.acroFormDictionaryRoot.objId), l.internal.out(l.internal.acroformPlugin.acroFormDictionaryRoot.getString()));t=t||l.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t){var r=t[n],i=r.Rect;r.Rect&&(r.Rect=u.call(this,r.Rect)), l.internal.newObjectDeferredBegin(r.objId);var o=r.objId+" 0 obj\n<<\n";if("object"===(void 0===r?"undefined":vt(r))&&"function"==typeof r.getContent&&(o+=r.getContent()), r.Rect=i, r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);o+="/AP << /N "+a+" >>\n", l.internal.acroformPlugin.xForms.push(a);}if(r.appearanceStreamContent){for(var s in o+="/AP << ", r.appearanceStreamContent){var h=r.appearanceStreamContent[s];if(o+="/"+s+" ", o+="<< ", 1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var c;"function"==typeof(c=h[n])&&(c=c.call(this,r)), o+="/"+n+" "+c+" ", 0<=l.internal.acroformPlugin.xForms.indexOf(c)||l.internal.acroformPlugin.xForms.push(c);}
21662else"function"==typeof(c=h)&&(c=c.call(this,r)), o+="/"+n+" "+c+" \n", 0<=l.internal.acroformPlugin.xForms.indexOf(c)||l.internal.acroformPlugin.xForms.push(c);o+=" >>\n";}o+=">>\n";}o+=">>\nendobj\n", l.internal.out(o);}e&&b.call(this,l.internal.acroformPlugin.xForms);},b=function(t){for(var e in t){var n=e,r=t[e];l.internal.newObjectDeferredBegin(r&&r.objId);var i="";"object"===(void 0===r?"undefined":vt(r))&&"function"==typeof r.getString&&(i=r.getString()), l.internal.out(i), delete t[n];}},x=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(l=this, T.FieldNum=0, this.internal.acroformPlugin=JSON.parse(JSON.stringify(d)), this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");e=l.internal.scaleFactor, a=l.internal.pageSize.getHeight(), l.internal.acroformPlugin.acroFormDictionaryRoot=new C, l.internal.acroformPlugin.acroFormDictionaryRoot._eventID=l.internal.events.subscribe("postPutResources",y), l.internal.events.subscribe("buildDocument",p), l.internal.events.subscribe("putCatalog",w), l.internal.events.subscribe("postPutPages",v), l.internal.acroformPlugin.isInitialized=!0;}},S=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){e+=t[n].toString(), e+=n<t.length-1?" ":"";}return e+="]"}},k=function(t){return 0!==(t=t||"").indexOf("(")&&(t="("+t), ")"!=t.substring(t.length-1)&&(t+=")"), t},_=function(){var t;Object.defineProperty(this,"objId",{get:function(){return t||(t=l.internal.newObjectDeferred()), t||console.log("Couldn't create Object ID"), t},configurable:!1});};_.prototype.toString=function(){return this.objId+" 0 R"}, _.prototype.getString=function(){var t=this.objId+" 0 obj\n<<";return t+=this.getContent()+">>\n", this.stream&&(t+="stream\n", t+=this.stream, t+="\nendstream\n"), t+="endobj\n"}, _.prototype.getContent=function(){var t="";return t+=function(t){var e="",n=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n){var i=n[r],o=t[i];o&&(Array.isArray(o)?e+="/"+i+" "+S(o)+"\n":e+=o instanceof _?"/"+i+" "+o.objId+" 0 R\n":"/"+i+" "+o+"\n");}return e}(this)};var I=function(){var e;_.call(this), this.Type="/XObject", this.Subtype="/Form", this.FormType=1, this.BBox, this.Matrix, this.Resources="2 0 R", this.PieceInfo, Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==e?e.length:0}}), Object.defineProperty(this,"stream",{enumerable:!1,set:function(t){e=t.trim();},get:function(){return e||null}});};r(I,_);var C=function(){_.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0<t.length?t:void 0}}), Object.defineProperty(this,"Fields",{enumerable:!0,configurable:!0,get:function(){return t}}), this.DA;};r(C,_);var T=function t(){var e;_.call(this), Object.defineProperty(this,"Rect",{enumerable:!0,configurable:!1,get:function(){if(e)return e},set:function(t){e=t;}});var n,r,i,o,a="";Object.defineProperty(this,"FT",{enumerable:!0,set:function(t){a=t;},get:function(){return a}}), Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,set:function(t){n=t;},get:function(){if(!n||n.length<1){if(this instanceof j)return;return"(FieldObject"+t.FieldNum+++")"}return"("==n.substring(0,1)&&n.substring(n.length-1)?n:"("+n+")"}}), Object.defineProperty(this,"DA",{enumerable:!0,get:function(){if(r)return"("+r+")"},set:function(t){r=t;}}), Object.defineProperty(this,"DV",{enumerable:!0,configurable:!0,get:function(){if(i)return i},set:function(t){i=t;}}), Object.defineProperty(this,"V",{enumerable:!0,configurable:!0,get:function(){if(o)return o},set:function(t){o=t;}}), Object.defineProperty(this,"Type",{enumerable:!0,get:function(){return this.hasAnnotation?"/Annot":null}}), Object.defineProperty(this,"Subtype",{enumerable:!0,get:function(){return this.hasAnnotation?"/Widget":null}}), this.BG, Object.defineProperty(this,"hasAnnotation",{enumerable:!1,get:function(){return!!(this.Rect||this.BC||this.BG)}}), Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,
21662configurable:!0,writable:!0}), Object.defineProperty(this,"page",{enumerable:!1,configurable:!0,writable:!0});};r(T,_);var F=function(){T.call(this), this.FT="/Ch", this.Opt=[], this.V="()", this.TI=0;var e=!1;Object.defineProperty(this,"combo",{enumerable:!1,get:function(){return e},set:function(t){e=t;}}), Object.defineProperty(this,"edit",{enumerable:!0,set:function(t){1==t?(this._edit=!0, this.combo=!0):this._edit=!1;},get:function(){return!!this._edit&&this._edit},configurable:!1}), this.hasAppearanceStream=!0;};r(F,T);var P=function(){F.call(this), this.combo=!1;};r(P,F);var E=function(){P.call(this), this.combo=!0;};r(E,P);var q=function(){E.call(this), this.edit=!0;};r(q,E);var O=function(){T.call(this), this.FT="/Btn";};r(O,T);var B=function(){O.call(this);var e=!0;Object.defineProperty(this,"pushbutton",{enumerable:!1,get:function(){return e},set:function(t){e=t;}});};r(B,O);var R=function(){O.call(this);var e=!0;Object.defineProperty(this,"radio",{enumerable:!1,get:function(){return e},set:function(t){e=t;}});var n,t=[];Object.defineProperty(this,"Kids",{enumerable:!0,get:function(){if(0<t.length)return t}}), Object.defineProperty(this,"__Kids",{get:function(){return t}}), Object.defineProperty(this,"noToggleToOff",{enumerable:!1,get:function(){return n},set:function(t){n=t;}});};r(R,O);var j=function(t,e){T.call(this), this.Parent=t, this._AppearanceType=N.RadioButton.Circle, this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(e), this.F=i(this.F,3,1), this.MK=this._AppearanceType.createMK(), this.AS="/Off", this._Name=e;};r(j,T), R.prototype.setAppearance=function(t){if("createAppearanceStream"in t&&"createMK"in t)for(var e in this.__Kids){var n=this.__Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n._Name), n.MK=t.createMK();}else console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");}, R.prototype.createOption=function(t){this.__Kids.length;var e=new j(this,t);return this.__Kids.push(e), n.addField(e), e};var D=function(){O.call(this), this.appearanceStreamContent=N.CheckBox.createAppearanceStream(), this.MK=N.CheckBox.createMK(), this.AS="/On", this.V="/On";};r(D,O);var M=function(){var e,n;T.call(this), this.DA=N.createDefaultAppearanceStream(), this.F=4, Object.defineProperty(this,"V",{get:function(){return e?k(e):e},enumerable:!0,set:function(t){e=t;}}), Object.defineProperty(this,"DV",{get:function(){return n?k(n):n},enumerable:!0,set:function(t){n=t;}});var r=!1;Object.defineProperty(this,"multiline",{enumerable:!1,get:function(){return r},set:function(t){r=t;}});var i=!1;Object.defineProperty(this,"fileSelect",{enumerable:!1,get:function(){return i},set:function(t){i=t;}});var o=!1;Object.defineProperty(this,"doNotSpellCheck",{enumerable:!1,get:function(){return o},set:function(t){o=t;}});var a=!1;Object.defineProperty(this,"doNotScroll",{enumerable:!1,get:function(){return a}
21662,set:function(t){a=t;}});var s=!1;Object.defineProperty(this,"MaxLen",{enumerable:!0,get:function(){return s},set:function(t){s=t;}}), Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,get:function(){return this.V||this.DV}});};r(M,T);var U=function(){M.call(this);var e=!0;Object.defineProperty(this,"password",{enumerable:!1,get:function(){return e},set:function(t){e=t;}});};r(U,M);var N={CheckBox:{createAppearanceStream:function(){return{N:{On:N.CheckBox.YesNormal},D:{On:N.CheckBox.YesPushDown,Off:N.CheckBox.OffPushDown}}},createMK:function(){return"<< /CA (3)>>"},YesPushDown:function(t){var e=h(t),n=[],r=l.internal.getFont("zapfdingbats","normal").id;t.Q=1;var i=c(t,"3","ZapfDingbats",50);return n.push("0.749023 g"), n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), n.push("f"), n.push("BMC"), n.push("q"), n.push("0 0 1 rg"), n.push("/"+r+" "+i.fontSize.toFixed(2)+" Tf 0 g"), n.push("BT"), n.push(i.text), n.push("ET"), n.push("Q"), n.push("EMC"), e.stream=n.join("\n"), e},YesNormal:function(t){var e=h(t),n=l.internal.getFont("zapfdingbats","normal").id,r=[];t.Q=1;var i=N.internal.getHeight(t),o=N.internal.getWidth(t),a=c(t,"3","ZapfDingbats",.9*i);return r.push("1 g"), r.push("0 0 "+o.toFixed(2)+" "+i.toFixed(2)+" re"), r.push("f"), r.push("q"), r.push("0 0 1 rg"), r.push("0 0 "+(o-1).toFixed(2)+" "+(i-1).toFixed(2)+" re"), r.push("W"), r.push("n"), r.push("0 g"), r.push("BT"), r.push("/"+n+" "+a.fontSize.toFixed(2)+" Tf 0 g"), r.push(a.text), r.push("ET"), r.push("Q"), e.stream=r.join("\n"), e},OffPushDown:function(t){var e=h(t),n=[];return n.push("0.749023 g"), n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), n.push("f"), e.stream=n.join("\n"), e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:N.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=N.RadioButton.Circle.YesNormal, e.D[t]=N.RadioButton.Circle.YesPushDown, e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4;r*=.9;var i=N.internal.Bezier_C;return n.push("q"), n.push("1 0 0 1 "+N.internal.getWidth(t)/2+" "+N.internal.getHeight(t)/2+" cm"), n.push(r+" 0 m"), n.push(r+" "+r*i+" "+r*i+" "+r+" 0 "+r+" c"), n.push("-"+r*i+" "+r+" -"+r+" "+r*i+" -"+r+" 0 c"), n.push("-"+r+" -"+r*i+" -"+r*i+" -"+r+" 0 -"+r+" c"), n.push(r*i+" -"+r+" "+r+" -"+r*i+" "+r+" 0 c"), n.push("f"), n.push("Q"), e.stream=n.join("\n"), e},YesPushDown:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4,i=2*(r*=.9),o=i*N.internal.Bezier_C,a=r*N.internal.Bezier_C;return n.push("0.749023 g"), n.push("q"), n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"), n.push(i+" 0 m"), n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"), n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"), n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"), n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"), n.push("f"), n.push("Q"), n.push("0 g"), n.push("q"), n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"), n.push(r+" 0 m"), n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"), n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"), n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"), n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"), n.push("f"), n.push("Q"), e.stream=n.join("\n"), e},OffPushDown:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4,i=2*(r*=.9),o=i*N.internal.Bezier_C;return n.push("0.749023 g"), n.push("q"), n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"), n.push(i+" 0 m"), n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"), n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"), n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"), n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"), n.push("f"), n.push("Q"), e.stream=n.join("\n"), e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:N.RadioButton.Cross.OffPushDown},N:{}}
21662;return e.N[t]=N.RadioButton.Cross.YesNormal, e.D[t]=N.RadioButton.Cross.YesPushDown, e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=h(t),n=[],r=N.internal.calculateCross(t);return n.push("q"), n.push("1 1 "+(N.internal.getWidth(t)-2).toFixed(2)+" "+(N.internal.getHeight(t)-2).toFixed(2)+" re"), n.push("W"), n.push("n"), n.push(r.x1.x.toFixed(2)+" "+r.x1.y.toFixed(2)+" m"), n.push(r.x2.x.toFixed(2)+" "+r.x2.y.toFixed(2)+" l"), n.push(r.x4.x.toFixed(2)+" "+r.x4.y.toFixed(2)+" m"), n.push(r.x3.x.toFixed(2)+" "+r.x3.y.toFixed(2)+" l"), n.push("s"), n.push("Q"), e.stream=n.join("\n"), e},YesPushDown:function(t){var e=h(t),n=N.internal.calculateCross(t),r=[];return r.push("0.749023 g"), r.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), r.push("f"), r.push("q"), r.push("1 1 "+(N.internal.getWidth(t)-2).toFixed(2)+" "+(N.internal.getHeight(t)-2).toFixed(2)+" re"), r.push("W"), r.push("n"), r.push(n.x1.x.toFixed(2)+" "+n.x1.y.toFixed(2)+" m"), r.push(n.x2.x.toFixed(2)+" "+n.x2.y.toFixed(2)+" l"), r.push(n.x4.x.toFixed(2)+" "+n.x4.y.toFixed(2)+" m"), r.push(n.x3.x.toFixed(2)+" "+n.x3.y.toFixed(2)+" l"), r.push("s"), r.push("Q"), e.stream=r.join("\n"), e},OffPushDown:function(t){var e=h(t),n=[];return n.push("0.749023 g"), n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"), n.push("f"), e.stream=n.join("\n"), e}}},createDefaultAppearanceStream:function(t){return"/F1 0 Tf 0 g"}};N.internal={Bezier_C:.551915024494,calculateCross:function(t){var e,n,r=N.internal.getWidth(t),i=N.internal.getHeight(t),o=(n=i)<(e=r)?n:e;return{x1:{x:(r-o)/2,y:(i-o)/2+o},x2:{x:(r-o)/2+o,y:(i-o)/2},x3:{x:(r-o)/2,y:(i-o)/2},x4:{x:(r-o)/2+o,y:(i-o)/2+o}}}}, N.internal.getWidth=function(t){var e=0;return"object"===(void 0===t?"undefined":vt(t))&&(e=s(t.Rect[2])), e}, N.internal.getHeight=function(t){var e=0;return"object"===(void 0===t?"undefined":vt(t))&&(e=s(t.Rect[3])), e}, n.addField=function(t){return x.call(this), t instanceof M?this.addTextField.call(this,t):t instanceof F?this.addChoiceField.call(this,t):t instanceof O?this.addButton.call(this,t):t instanceof j?g.call(this,t):t&&g.call(this,t), t.page=l.internal.getCurrentPageInfo().pageNumber, this}, n.addButton=function(t){x.call(this);var e=t||new T;e.FT="/Btn", e.Ff=o(e.Ff,t,l.internal.getPDFVersion()), g.call(this,e);}, n.addTextField=function(t){x.call(this);var e=t||new T;e.FT="/Tx", e.Ff=o(e.Ff,t,l.internal.getPDFVersion()), g.call(this,e);}, n.addChoiceField=function(t){x.call(this);var e=t||new T;e.FT="/Ch", e.Ff=o(e.Ff,t,l.internal.getPDFVersion()), g.call(this,e);}, "object"==(void 0===t?"undefined":vt(t))&&(t.ChoiceField=F, t.ListBox=P, t.ComboBox=E, t.EditBox=q, t.Button=O, t.PushButton=B, t.RadioButton=R, t.CheckBox=D, t.TextField=M, t.PasswordField=U, t.AcroForm={Appearance:N}), n.AcroFormChoiceField=F, n.AcroFormListBox=P, n.AcroFormComboBox=E, n.AcroFormEditBox=q, n.AcroFormButton=O, n.AcroFormPushButton=B, n.AcroFormRadioButton=R, n.AcroFormCheckBox=D, n.AcroFormTextField=M, n.AcroFormPasswordField=U, n.AcroForm={ChoiceField:F,ListBox:P,ComboBox:E,EditBox:q,Button:O,PushButton:B,RadioButton:R,CheckBox:D,TextField:M,PasswordField:U};}($.API,"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal), $.API.addHTML=function(t,p,g,s,m){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof p&&(s=p, m=g), "function"==typeof s&&(m=s, s=null), "function"!=typeof m&&(m=function(){});var e=this.internal,w=e.scaleFactor,y=e.pageSize.getWidth(),v=e.pageSize.getHeight();if((s=s||{}).onrendered=function(h){p=parseInt(p)||0, g=parseInt(g)||0;var t=s.dim||{},c=Object.assign({top:0,right:0,bottom:0,left:0,useFor:"content"},s.margin),e=t.h||Math.min(v,h.height/w),l=t.w||Math.min(y,h.width/w)-p,u=s.format||"JPEG",f=s.imageCompression||"SLOW";if(h.height>v-c.top-c.bottom&&s.pagesplit){var d=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i, o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1, a.webkitImageSmoothingEnabled=!1, a.msImageSmoothingEnabled=!1, a.imageSmoothingEnabled=!1, a.fillStyle=s.backgroundColor||"#ffffff", a.fillRect(0,0,r,i), a.drawImage(t,e,n,r,i,0,0,r,i), o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;
21662if(r=0, i.top=0!==n?c.top:g, i.left=0!==n?c.left:p, o=(y-c.left-c.right)*w<h.width, "content"===c.useFor?0===n?(t=Math.min((y-c.left)*w,h.width), e=Math.min((v-c.top)*w,h.height-n)):(t=Math.min(y*w,h.width), e=Math.min(v*w,h.height-n), i.top=0):(t=Math.min((y-c.left-c.right)*w,h.width), e=Math.min((v-c.bottom-c.top)*w,h.height-n)), o)for(;;){"content"===c.useFor&&(0===r?t=Math.min((y-c.left)*w,h.width):(t=Math.min(y*w,h.width-r), i.left=0));var s=[a=d(h,r,n,t,e),i.left,i.top,a.width/w,a.height/w,u,null,f];if(this.addImage.apply(this,s), (r+=t)>=h.width)break;this.addPage();}else s=[a=d(h,0,n,t,e),i.left,i.top,a.width/w,a.height/w,u,null,f], this.addImage.apply(this,s);if((n+=e)>=h.height)break;this.addPage();}m(l,n,null,s);}.bind(this);if("CANVAS"===h.nodeName){var r=new Image;r.onload=n, r.src=h.toDataURL("image/png"), h=r;}else n();}else{var i=Math.random().toString(35),o=[h,p,g,l,e,u,i,f];this.addImage.apply(this,o), m(l,e,i,o);}}.bind(this), "undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"!=typeof rasterizeHTML){var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"), s.width=s.width||y*w, rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image);},function(t){m(null,t);})}return null}, function(b){var x="addImage_",h={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]};b.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in h)for(i=h[a], n=0;n<i.length;n+=1){for(o=!0, r=0;r<i[n].length;r+=1)if(void 0!==i[n][r]&&i[n][r]!==t.charCodeAt(r)){o=!1;break}if(!0===o){s=a;break}}return"UNKOWN"===s&&"UNKNOWN"!==e&&(console.warn('FileType of Image not recognized. Processing image as "'+e+'".'), s=e), s};var n=function t(e){var n=this.internal.newObject(),r=this.internal.write,i=this.internal.putStream;if(e.n=n, r("<</Type /XObject"), r("/Subtype /Image"), r("/Width "+e.w), r("/Height "+e.h), e.cs===this.color_spaces.INDEXED?r("/ColorSpace [/Indexed /DeviceRGB "+(e.pal.length/3-1)+" "+("smask"in e?n+2:n+1)+" 0 R]"):(r("/ColorSpace /"+e.cs), e.cs===this.color_spaces.DEVICE_CMYK&&r("/Decode [1 0 1 0 1 0 1 0]")), r("/BitsPerComponent "+e.bpc), "f"in e&&r("/Filter /"+e.f), "dp"in e&&r("/DecodeParms <<"+e.dp+">>"), "trns"in e&&e.trns.constructor==Array){for(var o="",a=0,s=e.trns.length;a<s;a++)o+=e.trns[a]+" "+e.trns[a]+" ";r("/Mask ["+o+"]");}if("smask"in e&&r("/SMask "+(n+1)+" 0 R"), r("/Length "+e.data.length+">>"), i(e.data), r("endobj"), "smask"in e){var h="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,c={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:h,data:e.smask};"f"in e&&(c.f=e.f), t.call(this,c);}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(), r("<< /Length "+e.pal.length+">>"), i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))), r("endobj"));},S=function(){var t=this.internal.collections[x+"images"];for(var e in t)n.call(this,t[e]);},k=function(){var t,e=this.internal.collections[x+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R");},_=function(t){return"function"==typeof b["process"+t.toUpperCase()]},A=function(t){return"object"===(void 0===t?"undefined":vt(t))&&1===t.nodeType},I=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return n;!e&&/\.png(?:[?#].*)?$/i.test(n)&&(e="png");}if("CANVAS"===t.nodeName)var r=t;else{(r=document.createElement("canvas")).width=t.clientWidth||t.width, r.height=t.clientHeight||t.height;var i=r.getContext("2d");if(!i)throw"addImage requires canvas to be supported by browser.";i.drawImage(t,0,0,r.width,r.height);}return r.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},C=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};b.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"}, b.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"}, b.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"}, b.sHashCode=function(t){return t=t||"", Array.prototype.reduce&&t.split("").reduce(function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t},0)}, b.isString=function(t){return"string"==typeof t}
21662, b.validateStringAsBase64=function(t){var e=!0;return(t=t||"").length%4!=0&&(e=!1), !1===/[A-Za-z0-9\/]+/.test(t.substr(0,t.length-2))&&(e=!1), !1===/[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==/.test(t.substr(-2))&&(e=!1), e}, b.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+)$/g.exec(t)}, b.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array}, b.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer}, b.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))}, b.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n}, b.arrayBufferToBinaryString=function(t){if("function"==typeof atob)return atob(this.arrayBufferToBase64(t));if("function"==typeof TextDecoder){var e=new TextDecoder("ascii");if("ascii"===e.encoding)return e.decode(t)}for(var n=this.isArrayBuffer(t)?t:new Uint8Array(t),r=20480,i="",o=Math.ceil(n.byteLength/r),a=0;a<o;a++)i+=String.fromCharCode.apply(null,n.slice(a*r,a*r+r));return i}, b.arrayBufferToBase64=function(t){for(var e,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(t),o=i.byteLength,a=o%3,s=o-a,h=0;h<s;h+=3)n+=r[(16515072&(e=i[h]<<16|i[h+1]<<8|i[h+2]))>>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="), n}, b.createImageInfo=function(t,e,n,r,i,o,a,s,h,c,l,u,f){var d={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(d.f=o), h&&(d.dp=h), c&&(d.trns=c), l&&(d.pal=l), u&&(d.smask=u), f&&(d.p=f), d}, b.addImage=function(t,e,n,r,i,o,a,s,h){var c="";if("string"!=typeof e){var l=o;o=i, i=r, r=n, n=e, e=l;}if("object"===(void 0===t?"undefined":vt(t))&&!A(t)&&"imageData"in t){var u=t;t=u.imageData, e=u.format||e, n=u.x||n||0, r=u.y||r||0, i=u.w||i, o=u.h||o, a=u.alias||a, s=u.compression||s, h=u.rotation||u.angle||h;}if(isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments), new Error("Invalid coordinates passed to jsPDF.addImage");var f,d,p,g,m,w,y,v=function(){var t=this.internal.collections[x+"images"];return t||(this.internal.collections[x+"images"]=t={}, this.internal.events.subscribe("putResources",S), this.internal.events.subscribe("putXobjectDict",k)), t}.call(this);if(!(f=C(t,v))&&(A(t)&&(t=I(t,e)), (null==(y=a)||0===y.length)&&(a="string"==typeof(w=t)&&b.sHashCode(w)), !(f=C(a,v)))){if(this.isString(t)&&(""!==(c=this.convertStringToImageData(t))?t=c:void 0!==(c=this.loadImageFile(t))&&(t=c)), e=this.getImageFileTypeByImageData(t,e), !_(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t, t=this.binaryStringToUint8Array(t))), !(f=this["process"+e.toUpperCase()](t,(m=0, (g=v)&&(m=Object.keys?Object.keys(g).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(g)), m),a,((p=s)&&"string"==typeof p&&(p=p.toUpperCase()), p in b.image_compression?p:b.image_compression.NONE),d)))throw new Error("An unkwown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var h=function(t,e,n){return t||e||(e=t=-96), t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor), e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor), 0===t&&(t=e*n.w/n.h), 0===e&&(e=t*n.h/n.w), [t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;if(n=h[0], r=h[1], a[o]=i, s){s*=Math.PI/180;var u=Math.cos(s),f=Math.sin(s),d=function(t){return t.toFixed(4)},p=[d(u),d(f),d(-1*f),d(u),0,0,"cm"];}this.internal.write("q"), s?(this.internal.write([1,"0","0",1,c(t),l(e+r),"cm"].join(" ")), this.internal.write(p.join(" ")), this.internal.write([c(n),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(n),"0","0",c(r),c(t),l(e+r),"cm"].join(" ")), this.internal.write("/I"+i.i+" Do"), this.internal.write("Q");}.call(this,n,r,i,o,f,f.i,v,h), this}, b.convertStringToImageData=function(t){var e,n="";this.isString(t)&&(null!==(e=this.extractInfoFromBase64DataURI(t))?b.validateStringAs
21662Base64(e[3])&&(n=atob(e[3])):b.validateStringAsBase64(t)&&(n=atob(t)));return n};var c=function(t,e){return t.subarray(e,e+5)};b.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r<i;){if(r+=n, 255!==t.charCodeAt(r))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(r+1)||193===t.charCodeAt(r+1)||194===t.charCodeAt(r+1)||195===t.charCodeAt(r+1)||196===t.charCodeAt(r+1)||197===t.charCodeAt(r+1)||198===t.charCodeAt(r+1)||199===t.charCodeAt(r+1))return e=256*t.charCodeAt(r+5)+t.charCodeAt(r+6), [256*t.charCodeAt(r+7)+t.charCodeAt(r+8),e,t.charCodeAt(r+9)];r+=2, n=256*t.charCodeAt(r)+t.charCodeAt(r+1);}}(t)), this.isArrayBuffer(t)&&(t=new Uint8Array(t)), this.isArrayBufferView(t)&&(a=function(t){if(65496!=(t[0]<<8|t[1]))throw new Error("Supplied data is not a JPEG");for(var e,n=t.length,r=(t[4]<<8)+t[5],i=4;i<n;){if(r=((e=c(t,i+=r))[2]<<8)+e[3], (192===e[1]||194===e[1])&&255===e[0]&&7<r)return{width:((e=c(t,i+5))[2]<<8)+e[3],height:(e[0]<<8)+e[1],numcomponents:e[4]};i+=2;}throw new Error("getJpegSizeFromBytes could not find the size of the image")}(t), t=i||this.arrayBufferToBinaryString(t)), void 0===o)switch(a.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;default:case 3:o=this.color_spaces.DEVICE_RGB;}return this.createImageInfo(t,a.width,a.height,o,8,s,e,n)}, b.processJPG=function(){return this.processJPEG.apply(this,arguments)}, b.loadImageFile=function(t,e,n){e=e||!0, n=n||function(){};Object.prototype.toString.call("undefined"!=typeof process?process:0);if(void 0!==("undefined"==typeof window?"undefined":vt(window))&&"object"===("undefined"==typeof location?"undefined":vt(location))&&"http"===location.protocol.substr(0,4))return function(t,e,n){var r=new XMLHttpRequest,i=[],o=0,a=function(t){var e=t.length,n=String.fromCharCode;for(o=0;o<e;o+=1)i.push(n(255&t.charCodeAt(o)));return i.join("")};if(r.open("GET",t,!e), r.overrideMimeType("text/plain; charset=x-user-defined"), !1===e&&(r.onload=function(){return a(this.responseText)}), r.send(null), 200===r.status)return e?a(r.responseText):void 0;console.warn('Unable to load file "'+t+'"');}(t,e)}, b.getImageProperties=function(t){var e,n,r="";if(A(t)&&(t=I(t)), this.isString(t)&&(""!==(r=this.convertStringToImageData(t))?t=r:void 0!==(r=this.loadImageFile(t))&&(t=r)), n=this.getImageFileTypeByImageData(t), !_(n))throw new Error("addImage does not support files of type '"+n+"', please ensure that a plugin for '"+n+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(t=this.binaryStringToUint8Array(t))), !(e=this["process"+n.toUpperCase()](t)))throw new Error("An unkwown error occurred whilst processing the image");return{fileType:n,width:e.w,height:e.h,colorSpace:e.cs,compressionMode:e.f,bitsPerComponent:e.bpc}};}($.API), t=$.API, y={annotations:[],f2:function(t){return t.toFixed(2)},notEmpty:function(t){if(void 0!==t&&""!=t)return!0}}, $.API.annotationPlugin=y, $.API.events.push(["addPage",function(t){this.annotationPlugin.annotations[t.pageNumber]=[];}]), t.events.push(["putPage",function(t){for(var e=this.annotationPlugin.annotations[t.pageNumber],n=!1,r=0;r<e.length&&!n;r++)switch((h=e[r]).type){case"link":if(y.notEmpty(h.options.url)||y.notEmpty(h.options.pageNumber)){n=!0;break}case"reference":case"text":case"freetext":n=!0;}if(0!=n){this.internal.write("/Annots [");var i=this.annotationPlugin.f2,o=this.internal.scaleFactor,a=this.internal.pageSize.getHeight(),s=this.internal.getPageInfo(t.pageNumber);for(r=0;r<e.length;r++){var h;
21662switch((h=e[r]).type){case"reference":this.internal.write(" "+h.object.objId+" 0 R ");break;case"text":var c=this.internal.newAdditionalObject(),l=this.internal.newAdditionalObject(),u=h.title||"Note";m="<</Type /Annot /Subtype /Text "+(d="/Rect ["+i(h.bounds.x*o)+" "+i(a-(h.bounds.y+h.bounds.h)*o)+" "+i((h.bounds.x+h.bounds.w)*o)+" "+i((a-h.bounds.y)*o)+"] ")+"/Contents ("+h.contents+")", m+=" /Popup "+l.objId+" 0 R", m+=" /P "+s.objId+" 0 R", m+=" /T ("+u+") >>", c.content=m;var f=c.objId+" 0 R";m="<</Type /Annot /Subtype /Popup "+(d="/Rect ["+i((h.bounds.x+30)*o)+" "+i(a-(h.bounds.y+h.bounds.h)*o)+" "+i((h.bounds.x+h.bounds.w+30)*o)+" "+i((a-h.bounds.y)*o)+"] ")+" /Parent "+f, h.open&&(m+=" /Open true"), m+=" >>", l.content=m, this.internal.write(c.objId,"0 R",l.objId,"0 R");break;case"freetext":var d="/Rect ["+i(h.bounds.x*o)+" "+i((a-h.bounds.y)*o)+" "+i(h.bounds.x+h.bounds.w*o)+" "+i(a-(h.bounds.y+h.bounds.h)*o)+"] ",p=h.color||"#000000";m="<</Type /Annot /Subtype /FreeText "+d+"/Contents ("+h.contents+")", m+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+p+")", m+=" /Border [0 0 0]", m+=" >>", this.internal.write(m);break;case"link":if(h.options.name){var g=this.annotations._nameMap[h.options.name];h.options.pageNumber=g.page, h.options.top=g.y;}else h.options.top||(h.options.top=0);d="/Rect ["+i(h.x*o)+" "+i((a-h.y)*o)+" "+i((h.x+h.w)*o)+" "+i((a-(h.y+h.h))*o)+"] ";var m="";if(h.options.url)m="<</Type /Annot /Subtype /Link "+d+"/Border [0 0 0] /A <</S /URI /URI ("+h.options.url+") >>";else if(h.options.pageNumber)switch(m="<</Type /Annot /Subtype /Link "+d+"/Border [0 0 0] /Dest ["+(t=this.internal.getPageInfo(h.options.pageNumber)).objId+" 0 R", h.options.magFactor=h.options.magFactor||"XYZ", h.options.magFactor){case"Fit":m+=" /Fit]";break;case"FitH":m+=" /FitH "+h.options.top+"]";break;case"FitV":h.options.left=h.options.left||0, m+=" /FitV "+h.options.left+"]";break;case"XYZ":default:var w=i((a-h.options.top)*o);h.options.left=h.options.left||0, void 0===h.options.zoom&&(h.options.zoom=0), m+=" /XYZ "+h.options.left+" "+w+" "+h.options.zoom+"]";}""!=m&&(m+=" >>", this.internal.write(m));}}this.internal.write("]");}}]), t.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t);}}, t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"});}, t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n), n+=.2*o, this.link(e,n-o,i,o,r), i}, t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}, t.getLineHeight=function(){return this.internal.getLineHeight()}, function(t){var a=Object.keys({ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",fa:"Persian","fa-IR":"Persian/Iran",ur:"Urdu"}),u={1569:[65152],1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1572:[65157,65158],1573:[65159,65160,65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166,65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,65193],1584:[65195,65196,65195],1585:[65197,65198,65197],1586:[65199,65200,65199],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,65261],1609:[65263,65264,64488,64489],1610:[65265,652
2166266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395,64394],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},f={1570:[65269,65270,65269,65270],1571:[65271,65272,65271,65272],1573:[65273,65274,65273,65274],1575:[65275,65276,65275,65276]},d={1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1573:[65159,65160,65159,65160],1575:[65165,65166,65165,65166]},p={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},e=[1570,1571,1573,1575],n=[1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688],o=0,s=1,h=2,c=3;function g(t){return void 0!==t&&void 0!==u[t.charCodeAt(0)]}function l(t){return void 0!==t&&0<=n.indexOf(t.charCodeAt(0))}function m(t){return void 0!==t&&0<=e.indexOf(t.charCodeAt(0))}function w(t){return g(t)&&2<=u[t.charCodeAt(0)].length}function y(t,e,n,r){return g(t)?(r=r||{}, u=Object.assign(u,r), !w(t)||!g(e)&&!g(n)||!g(n)&&l(e)||l(t)&&!g(e)||l(t)&&m(e)||l(t)&&l(e)?(u=Object.assign(u,d), o):g(i=t)&&4==u[i.charCodeAt(0)].length&&g(e)&&!l(e)&&g(n)&&w(n)?(u=Object.assign(u,d), c):l(t)||!g(n)?(u=Object.assign(u,d), s):(u=Object.assign(u,d), h)):-1;var i;}var v=t.processArabic=function(t,e){t=t||"", e=e||!1;var n,r,i,o="",a=0,s=0,h="",c="",l="";for(a=0;a<t.length;a+=1)h=t[a], c=t[a-1], l=t[a+1], g(h)?void 0!==c&&1604===c.charCodeAt(0)&&m(h)?(s=y(h,t[a-2],t[a+1],f), n=String.fromCharCode(f[h.charCodeAt(0)][s]), o=o.substr(0,o.length-1)+n):void 0!==c&&1617===c.charCodeAt(0)&&(void 0!==(r=h)&&void 0!==p[r.charCodeAt(0)])?(s=y(h,t[a-2],t[a+1],d), n=String.fromCharCode(p[h.charCodeAt(0)][s]), o=o.substr(0,o.length-1)+n):(s=y(h,c,l,d), o+=String.fromCharCode(u[h.charCodeAt(0)][s])):o+=e?{"(":")",")":"("}[i=h]||i:h;return e?o.split("").reverse().join(""):o};t.events.push(["preProcessText",function(t){var e=t.text,n=(t.x, t.y, t.options||{}),r=(t.mutex, n.lang),i=[];if(0<=a.indexOf(r)){if("[object Array]"===Object.prototype.toString.call(e)){var o=0;for(i=[], o=0;o<e.length;o+=1)"[object Array]"===Object.prototype.toString.call(e[o])?i.push([v(e[o][0],!0),e[o][1],e[o][2]]):i.push([v(e[o],!0)]);t.text=i;}else t.text=v(e,!0);void 0===n.charSpace&&(t.options.charSpace=0), !0===n.R2L&&(t.options.R2L=!1);}}]);}($.API), $.API.autoPrint=function(t){var e;switch((t=t||{}).variant=t.variant||"non-conform", t.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");}), this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R");});}return this}, (
21663/**
21664   * jsPDF Canvas PlugIn
21665   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  [email protected]
21666   *
21667   * Licensed under the MIT License.
21668   * http://opensource.org/licenses/mit-license
21669   */
21670e=$.API).events.push(["initialized",function(){this.canvas.pdf=this;}]), e.canvas={getContext:function(t){return(this.pdf.context2d._canvas=this).pdf.context2d},childNodes:[]}, Object.defineProperty(e.canvas,"width",{get:function(){return this._width}
21670,set:function(t){this._width=t, this.getContext("2d").pageWrapX=t+1;}}), Object.defineProperty(e.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t, this.getContext("2d").pageWrapY=t+1;}}), I=$.API, C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0}, T=1, d=function(t,e,n,r,i){C={x:t,y:e,w:n,h:r,ln:i};}, p=function(){return C}, F={left:0,top:0,bottom:0}, I.setHeaderFunction=function(t){h=t;}, I.getTextDimensions=function(e){i=this.internal.getFont().fontName, o=this.table_font_size||this.internal.getFontSize(), a=this.internal.getFont().fontStyle;var t,n,r=19.049976/25.4;(n=document.createElement("font")).id="jsPDFCell";try{n.style.fontStyle=a;}catch(t){n.style.fontWeight=a;}n.style.fontSize=o+"pt", n.style.fontFamily=i;try{n.textContent=e;}catch(t){n.innerText=e;}return document.body.appendChild(n), t={w:(n.offsetWidth+1)*r,h:(n.offsetHeight+1)*r}, document.body.removeChild(n), t}, I.cellAddPage=function(){var t=this.margins||F;this.addPage(), d(t.left,t.top,void 0,void 0), T+=1;}, I.cellInitialize=function(){C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0}, T=1;}, I.cell=function(t,e,n,r,i,o,a){var s=p(),h=!1;if(void 0!==s.ln)if(s.ln===o)t=s.x+s.w, e=s.y;else{var c=this.margins||F;s.y+s.h+r+13>=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(), h=!0, this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)), e=p().y+p().h, h&&(e=23);}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r), "right"===a){i instanceof Array||(i=[i]);for(var l=0;l<i.length;l++){var u=i[l],f=this.getStringUnitWidth(u)*this.internal.getFontSize();this.text(u,t+n-f-3,e+this.internal.getLineHeight()*(l+1));}}else this.text(i,t+3,e+this.internal.getLineHeight());return d(t,e,n,r,o), this}, I.arrayMax=function(t,e){var n,r,i,o=t[0];for(n=0, r=t.length;n<r;n+=1)i=t[n], e?-1===e(o,i)&&(o=i):o<i&&(o=i);return o}, I.table=function(t,e,n,r,i){if(!n)throw"No data for PDF table";var o,a,s,h,c,l,u,f,d,p,g=[],m=[],w={},y={},v=[],b=[],x=!1,S=!0,k=12,_=F;if(_.width=this.internal.pageSize.getWidth(), i&&(!0===i.autoSize&&(x=!0), !1===i.printHeaders&&(S=!1), i.fontSize&&(k=i.fontSize), i.css&&void 0!==i.css["font-size"]&&(k=16*i.css["font-size"]), i.margins&&(_=i.margins)), this.lnMod=0, C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0}, T=1, this.printHeaders=S, this.margins=_, this.setFontSize(k), this.table_font_size=k, null==r)g=Object.keys(n[0]);else if(r[0]&&"string"!=typeof r[0])for(a=0, s=r.length;a<s;a+=1)o=r[a], g.push(o.name), m.push(o.prompt), y[o.name]=o.width*(19.049976/25.4);else g=r;if(x)for(p=function(t){return t[o]}, a=0, s=g.length;a<s;a+=1){for(w[o=g[a]]=n.map(p), v.push(this.getTextDimensions(m[a]||o).w), u=0, h=(l=w[o]).length;u<h;u+=1)c=l[u], v.push(this.getTextDimensions(c).w);y[o]=I.arrayMax(v), v=[];}if(S){var A=this.calculateLineHeight(g,y,m.length?m:g);for(a=0, s=g.length;a<s;a+=1)o=g[a], b.push([t,e,y[o],A,String(m.length?m[a]:o)]);this.setTableHeaderRow(b), this.printHeaderRow(1,!1);}for(a=0, s=n.length;a<s;a+=1)for(f=n[a], A=this.calculateLineHeight(g,y,f), u=0, d=g.length;u<d;u+=1)o=g[u], this.cell(t,e,y[o],A,f[o],a+2,o.align);return this.lastCellPos=C, this.table_x=t, this.table_y=e, this}, I.calculateLineHeight=function(t,e,n){for(var r,i=0,o=0;o<t.length;o++){n[r=t[o]]=this.splitTextToSize(String(n[r]),e[r]-3);var a=this.internal.getLineHeight()*n[r].length+3;i<a&&(i=a);}return i}, I.setTableHeaderRow=function(t){this.tableHeaderRow=t;}, I.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,i,o;if(this.printingHeaderRow=!0, void 0!==h){var a=h(this,T);d(a[0],a[1],a[2],a[3],-1);}this.setFontStyle("bold");var s=[];for(i=0, o=this.tableHeaderRow.length;i<o;i+=1)this.setFillColor(200,200,200), n=this.tableHeaderRow[i], e&&(this.margins.top=13, n[1]=this.margins&&this.margins.top||0, s.push(n)), r=[].concat(n), this.cell.apply(this,r.concat(t));0<s.length&&this.setTableHeaderRow(s), this.setFontStyle("normal"), this.printingHeaderRow=!1;}, function(t){t.events.push(["initialized",function(){((this.context2d.pdf=this).context2d.internal.pdf=this).context2d.ctx=new e, this.context2d.ctxStack=[], this.context2d.path=[];}]), t.context2d={pageWrapXEnabled:!1,pageWrapYEnabled:!1,pageWrapX:9999999,pageWrapY:9999999,ctx:new e,f2:function(t){return t.toFixed(2)}
21670,fillRect:function(t,e,n,r){if(!this._isFillTransparent()){t=this._wrapX(t), e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"f");}},strokeRect:function(t,e,n,r){if(!this._isStrokeTransparent()){t=this._wrapX(t), e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"s");}},clearRect:function(t,e,n,r){if(!this.ctx.ignoreClearRect){t=this._wrapX(t), e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.save(), this.setFillStyle("#ffffff"), this.pdf.rect(i.x,i.y,i.w,i.h,"f"), this.restore();}},save:function(){this.ctx._fontSize=this.pdf.internal.getFontSize();var t=new e;t.copy(this.ctx), this.ctxStack.push(this.ctx), this.ctx=t;},restore:function(){this.ctx=this.ctxStack.pop(), this.setFillStyle(this.ctx.fillStyle), this.setStrokeStyle(this.ctx.strokeStyle), this.setFont(this.ctx.font), this.pdf.setFontSize(this.ctx._fontSize), this.setLineCap(this.ctx.lineCap), this.setLineWidth(this.ctx.lineWidth), this.setLineJoin(this.ctx.lineJoin);},rect:function(t,e,n,r){this.moveTo(t,e), this.lineTo(t+n,e), this.lineTo(t+n,e+r), this.lineTo(t,e+r), this.lineTo(t,e), this.closePath();},beginPath:function(){this.path=[];},closePath:function(){this.path.push({type:"close"});},_getRGBA:function(t){var e,n,r,i,o=new RGBColor(t);if(!t)return{r:0,g:0,b:0,a:0,style:t};if(this.internal.rxTransparent.test(t))i=r=n=e=0;else{var a=this.internal.rxRgb.exec(t);null!=a?(e=parseInt(a[1]), n=parseInt(a[2]), r=parseInt(a[3]), i=1):null!=(a=this.internal.rxRgba.exec(t))?(e=parseInt(a[1]), n=parseInt(a[2]), r=parseInt(a[3]), i=parseFloat(a[4])):(i=1, "#"!=t.charAt(0)&&(t=o.ok?o.toHex():"#000000"), 4===t.length?(e=t.substring(1,2), e+=e, n=t.substring(2,3), n+=n, r=t.substring(3,4), r+=r):(e=t.substring(1,3), n=t.substring(3,5), r=t.substring(5,7)), e=parseInt(e,16), n=parseInt(n,16), r=parseInt(r,16));}return{r:e,g:n,b:r,a:i,style:t}},setFillStyle:function(t){var e=this._getRGBA(t);this.ctx.fillStyle=t, this.ctx._isFillTransparent=0===e.a, this.ctx._fillOpacity=e.a, this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}), this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a});},setStrokeStyle:function(t){var e=this._getRGBA(t);this.ctx.strokeStyle=e.style, this.ctx._isStrokeTransparent=0===e.a, this.ctx._strokeOpacity=e.a, 0===e.a?this.pdf.setDrawColor(255,255,255):(e.a, this.pdf.setDrawColor(e.r,e.g,e.b));},fillText:function(t,e,n,r){if(!this._isFillTransparent()){e=this._wrapX(e), n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0], n=i[1];var o=57.2958*this._matrix_rotation(this.ctx._transform);if(0<this.ctx._clip_path.length){var a;(a=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var s=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._fill(null,!0), this.ctx._clip_path=this.path, this.path=s;}var h=1;try{h=this._matrix_decompose(this._getTransform()).scale[0];}catch(t){console.warn(t);}if(h<.01)this.pdf.text(t,e,this._getBaseline(n),null,o);else{var c=this.pdf.internal.getFontSize();this.pdf.setFontSize(c*h), this.pdf.text(t,e,this._getBaseline(n),null,o), this.pdf.setFontSize(c);}0<this.ctx._clip_path.length&&a.push("Q");}}
21670,strokeText:function(t,e,n,r){if(!this._isStrokeTransparent()){e=this._wrapX(e), n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0], n=i[1];var o=57.2958*this._matrix_rotation(this.ctx._transform);if(0<this.ctx._clip_path.length){var a;(a=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var s=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._fill(null,!0), this.ctx._clip_path=this.path, this.path=s;}var h=1;try{h=this._matrix_decompose(this._getTransform()).scale[0];}catch(t){console.warn(t);}if(1===h)this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},o);else{var c=this.pdf.internal.getFontSize();this.pdf.setFontSize(c*h), this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},o), this.pdf.setFontSize(c);}0<this.ctx._clip_path.length&&a.push("Q");}},setFont:function(t){if(this.ctx.font=t, null!=(c=/\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+(.*)?/.exec(t))){var e=c[1],n=(c[2], c[3]),r=c[4],i=c[5],o=c[6];r="px"===i?Math.floor(parseFloat(r)):"em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(r)), this.pdf.setFontSize(r), "bold"===n||"700"===n?this.pdf.setFontStyle("bold"):"italic"===e?this.pdf.setFontStyle("italic"):this.pdf.setFontStyle("normal"), l="bold"===n||"700"===n?"italic"===e?"bolditalic":"bold":"italic"===e?"italic":"normal";for(var a=o.toLowerCase().split(/\s*,\s*/),s="Times",h=0;h<a.length;h++){if(void 0!==this.pdf.internal.getFont(a[h],l,{noFallback:!0,disableWarning:!0})){s=a[h];break}if("bolditalic"===l&&void 0!==this.pdf.internal.getFont(a[h],"bold",{noFallback:!0,disableWarning:!0}))s=a[h], l="bold";else if(void 0!==this.pdf.internal.getFont(a[h],"normal",{noFallback:!0,disableWarning:!0})){s=a[h], l="normal";break}}this.pdf.setFont(s,l);}else{var c=/\s*(\d+)(pt|px|em)\s+([\w "]+)\s*([\w "]+)?/.exec(t);if(null!=c){var l,u=c[1],f=(c[2], c[3]);(l=c[4])||(l="normal"), u="em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(u)), this.pdf.setFontSize(u), this.pdf.setFont(f,l);}}},setTextBaseline:function(t){this.ctx.textBaseline=t;},getTextBaseline:function(){return this.ctx.textBaseline},setTextAlign:function(t){this.ctx.textAlign=t;},getTextAlign:function(){return this.ctx.textAlign},setLineWidth:function(t){this.ctx.lineWidth=t, this.pdf.setLineWidth(t);},setLineCap:function(t){this.ctx.lineCap=t, this.pdf.setLineCap(t);},setLineJoin:function(t){this.ctx.lineJoin=t, this.pdf.setLineJoin(t);},moveTo:function(t,e){t=this._wrapX(t), e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"mt",x:t=n[0],y:e=n[1]};this.path.push(r);},_wrapX:function(t){return this.pageWrapXEnabled?t%this.pageWrapX:t},_wrapY:function(t){return this.pageWrapYEnabled?(this._gotoPage(this._page(t)), (t-this.lastBreak)%this.pageWrapY):t},transform:function(t,e,n,r,i,o){this.ctx._transform=this._matrix_multiply(this.ctx._transform,[t,e,n,r,i,o]);},setTransform:function(t,e,n,r,i,o){this.ctx._transform=[t,e,n,r,i,o];},_getTransform:function(){return this.ctx._transform},lastBreak:0,pageBreaks:[],_page:function(t){if(this.pageWrapYEnabled){for(var e=this.lastBreak=0,n=0,r=0;r<this.pageBreaks.length;r++)if(t>=this.pageBreaks[r]){e++, 0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r], n+=Math.floor(i/this.pageWrapY);}if(0===this.lastBreak)n+=Math.floor(t/this.pageWrapY)+1;return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t), e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"lt",x:t=n[0],y:e=n[1]};this.path.push(r);},bezierCurveTo:function(t,e,n,r,i,o){var a;t=this._wrapX(t), e=this._wrapY(e), n=this._wrapX(n), r=this._wrapY(r), i=this._wrapX(i), o=this._wrapY(o), i=(a=this._matrix_map_point(this.ctx._transform,[i,o]))[0], o=a[1];var s={type:"bct",x1:t=(a=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=a[1],x2:n=(a=this._matrix_map_point(this.ctx._transform,[n,r]))[0],y2:r=a[1],x:i,y:o};this.path.push(s);},quadraticCurveTo:function(t,e,n,r){var i;t=this._wrapX(t), e=this._wrapY(e), n=this._wrapX(n), r=this._wrapY(r), n=(i=this._matrix_map_point(this.ctx._transform,[n,r]))[0], r=i[1];var o={type:"qct",x1:t=(i=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=i[1],x:n,y:r};this.path.push(o);},arc:function(t,e,n,r,i,o){if(t=this._wrapX(t), e=this._wrapY(e), !this._matrix_is_identity(this.ctx._transform)){var a=this._matrix_map_point(this.ctx._transform,[t,e]);t=a[0], e=a[1];var s=this._matrix_map_point(this.ctx._transform,[0,0]),h=this._matrix_map_point(this.ctx._transform,[0,n]);n=Math.sqrt(Math.pow(h[0]-s[0],2)+Math.pow(h[1]-s[1],2));}
21670var c={type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,anticlockwise:o};this.path.push(c);},drawImage:function(t,e,n,r,i,o,a,s,h){void 0!==o&&(e=o, n=a, r=s, i=h), e=this._wrapX(e), n=this._wrapY(n);var c,l=this._matrix_map_rect(this.ctx._transform,{x:e,y:n,w:r,h:i}),u=(this._matrix_map_rect(this.ctx._transform,{x:o,y:a,w:s,h:h}), /data:image\/(\w+).*/i.exec(t));c=null!=u?u[1]:"png", this.pdf.addImage(t,c,l.x,l.y,l.w,l.h);},_matrix_multiply:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],h=n*t[0]+r*t[2],c=i*t[0]+o*t[2],l=a*t[0]+s*t[2]+t[4];return r=n*t[1]+r*t[3], o=i*t[1]+o*t[3], s=a*t[1]+s*t[3]+t[5], [n=h,r,i=c,o,a=l,s]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=Math.sqrt(e*e+n*n),a=(e/=o)*r+(n/=o)*i;r-=e*a, i-=n*a;var s=Math.sqrt(r*r+i*i);return a/=s, e*(i/=s)<n*(r/=s)&&(e=-e, n=-n, a=-a, o=-o), {scale:[o,0,0,s,0,0],translate:[1,0,0,1,t[4],t[5]],rotate:[e,n,-n,e,0,0],skew:[1,0,a,1,0,0]}},_matrix_map_point:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],h=e[0],c=e[1];return[h*n+c*i+a,h*r+c*o+s]},_matrix_map_point_obj:function(t,e){var n=this._matrix_map_point(t,[e.x,e.y]);return{x:n[0],y:n[1]}},_matrix_map_rect:function(t,e){var n=this._matrix_map_point(t,[e.x,e.y]),r=this._matrix_map_point(t,[e.x+e.w,e.y+e.h]);return{x:n[0],y:n[1],w:r[0]-n[0],h:r[1]-n[1]}},_matrix_is_identity:function(t){return 1==t[0]&&(0==t[1]&&(0==t[2]&&(1==t[3]&&(0==t[4]&&0==t[5]))))},rotate:function(t){var e=[Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0];this.ctx._transform=this._matrix_multiply(this.ctx._transform,e);},scale:function(t,e){var n=[t,0,0,e,0,0];this.ctx._transform=this._matrix_multiply(this.ctx._transform,n);},translate:function(t,e){var n=[1,0,0,1,t,e];this.ctx._transform=this._matrix_multiply(this.ctx._transform,n);},stroke:function(){if(0<this.ctx._clip_path.length){var t;(t=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var e=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._stroke(!0), this.ctx._clip_path=this.path, this.path=e, this._stroke(!1), t.push("Q");}else this._stroke(!1);}
21670,_stroke:function(t){if(t||!this._isStrokeTransparent()){for(var e=[],n=this.path,r=0;r<n.length;r++){var i=n[r];switch(i.type){case"mt":e.push({start:i,deltas:[],abs:[]});break;case"lt":var o=[i.x-n[r-1].x,i.y-n[r-1].y];e[e.length-1].deltas.push(o), e[e.length-1].abs.push(i);break;case"bct":o=[i.x1-n[r-1].x,i.y1-n[r-1].y,i.x2-n[r-1].x,i.y2-n[r-1].y,i.x-n[r-1].x,i.y-n[r-1].y];e[e.length-1].deltas.push(o);break;case"qct":var a=n[r-1].x+2/3*(i.x1-n[r-1].x),s=n[r-1].y+2/3*(i.y1-n[r-1].y),h=i.x+2/3*(i.x1-i.x),c=i.y+2/3*(i.y1-i.y),l=i.x,u=i.y;o=[a-n[r-1].x,s-n[r-1].y,h-n[r-1].x,c-n[r-1].y,l-n[r-1].x,u-n[r-1].y];e[e.length-1].deltas.push(o);break;case"arc":0==e.length&&e.push({start:{x:0,y:0},deltas:[],abs:[]}), e[e.length-1].arc=!0, Array.isArray(e[e.length-1].abs)&&e[e.length-1].abs.push(i);}}for(r=0;r<e.length;r++){var f;if(f=r==e.length-1?"s":null, e[r].arc)for(var d=e[r].abs,p=0;p<d.length;p++){var g=d[p],m=360*g.startAngle/(2*Math.PI),w=360*g.endAngle/(2*Math.PI),y=g.x,v=g.y;this.internal.arc2(this,y,v,g.radius,m,w,g.anticlockwise,f,t);}else{y=e[r].start.x, v=e[r].start.y;t?(this.pdf.lines(e[r].deltas,y,v,null,null), this.pdf.clip_fixed()):this.pdf.lines(e[r].deltas,y,v,null,f);}}}},_isFillTransparent:function(){return this.ctx._isFillTransparent||0==this.globalAlpha},_isStrokeTransparent:function(){return this.ctx._isStrokeTransparent||0==this.globalAlpha},fill:function(t){if(0<this.ctx._clip_path.length){var e;(e=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var n=this.path;this.path=this.ctx._clip_path, this.ctx._clip_path=[], this._fill(t,!0), this.ctx._clip_path=this.path, this.path=n, this._fill(t,!1), e.push("Q");}else this._fill(t,!1);},_fill:function(t,e){if(!this._isFillTransparent()){var n,r="function"==typeof this.pdf.internal.newObject2;n=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage();var i=[],o=window.outIntercept;if(r)switch(this.ctx.globalCompositeOperation){case"normal":case"source-over":break;case"destination-in":case"destination-out":var a=this.pdf.internal.newStreamObject(),s=this.pdf.internal.newObject2();s.push("<</Type /ExtGState"), s.push("/SMask <</S /Alpha /G "+a.objId+" 0 R>>"), s.push(">>");var h="MASK"+s.objId;this.pdf.internal.addGraphicsState(h,s.objId);var c="/"+h+" gs";n.splice(0,0,"q"), n.splice(1,0,c), n.push("Q"), window.outIntercept=a;break;default:var l="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];l&&this.pdf.internal.out(l+" gs");}var u=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(u=this.ctx._fillOpacity), r){var f=this.pdf.internal.newObject2();f.push("<</Type /ExtGState"), f.push("/CA "+u), f.push("/ca "+u), f.push(">>");h="GS_O_"+f.objId;this.pdf.internal.addGraphicsState(h,f.objId), this.pdf.internal.out("/"+h+" gs");}for(var d=this.path,p=0;p<d.length;p++){var g=d[p];switch(g.type){case"mt":i.push({start:g,deltas:[],abs:[]});break;case"lt":var m=[g.x-d[p-1].x,g.y-d[p-1].y];i[i.length-1].deltas.push(m), i[i.length-1].abs.push(g);break;case"bct":m=[g.x1-d[p-1].x,g.y1-d[p-1].y,g.x2-d[p-1].x,g.y2-d[p-1].y,g.x-d[p-1].x,g.y-d[p-1].y];i[i.length-1].deltas.push(m);break;case"qct":var w=d[p-1].x+2/3*(g.x1-d[p-1].x),y=d[p-1].y+2/3*(g.y1-d[p-1].y),v=g.x+2/3*(g.x1-g.x),b=g.y+2/3*(g.y1-g.y),x=g.x,S=g.y;m=[w-d[p-1].x,y-d[p-1].y,v-d[p-1].x,b-d[p-1].y,x-d[p-1].x,S-d[p-1].y];i[i.length-1].deltas.push(m);break;case"arc":0===i.length&&i.push({deltas:[],abs:[]}), i[i.length-1].arc=!0, Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(g);break;case"close":i.push({close:!0});}}for(p=0;p<i.length;p++){var k;if(p==i.length-1?(k="f", "evenodd"===t&&(k+="*")):k=null, i[p].close)this.pdf.internal.out("h"), k&&this.pdf.internal.out(k);else if(i[p].arc){i[p].start&&this.internal.move2(this,i[p].start.x,i[p].start.y);for(var _=i[p].abs,A=0;A<_.length;A++){var I=_[A];if(void 0!==I.startAngle){var C=360*I.startAngle/(2*Math.PI),T=360*I.endAngle/(2*Math.PI),F=I.x,P=I.y;if(0===A&&this.internal.move2(this,F,P), this.internal.arc2(this,F,P,I.radius,C,T,I.anticlockwise,null,e), A===_.length-1&&i[p].start){F=i[p].start.x, P=i[p].start.y;this.internal.line2(E,F,P);}}else this.internal.line2(E,I.x,I.y);}}else{F=i[p].start.x, P=i[p].start.y;
21670e?(this.pdf.lines(i[p].deltas,F,P,null,null), this.pdf.clip_fixed()):this.pdf.lines(i[p].deltas,F,P,null,k);}}window.outIntercept=o;}},pushMask:function(){if("function"==typeof this.pdf.internal.newObject2){var t=this.pdf.internal.newStreamObject(),e=this.pdf.internal.newObject2();e.push("<</Type /ExtGState"), e.push("/SMask <</S /Alpha /G "+t.objId+" 0 R>>"), e.push(">>");var n="MASK"+e.objId;this.pdf.internal.addGraphicsState(n,e.objId);var r="/"+n+" gs";this.pdf.internal.out(r);}else console.log("jsPDF v2 not enabled");},clip:function(){if(0<this.ctx._clip_path.length)for(var t=0;t<this.path.length;t++)this.ctx._clip_path.push(this.path[t]);else this.ctx._clip_path=this.path;this.path=[];},measureText:function(n){var r=this.pdf;return{getWidth:function(){var t=r.internal.getFontSize(),e=r.getStringUnitWidth(n)*t/r.internal.scaleFactor;return e*=1.3333},get width(){return this.getWidth(n)}}},_getBaseline:function(t){var e=parseInt(this.pdf.internal.getFontSize()),n=.25*e;switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+e;case"hanging":return t+e-n;case"middle":return t+e/2-n;case"ideographic":return t;case"alphabetic":default:return t}}};var E=t.context2d;function e(){this._isStrokeTransparent=!1, this._strokeOpacity=1, this.strokeStyle="#000000", this.fillStyle="#000000", this._isFillTransparent=!1, this._fillOpacity=1, this.font="12pt times", this.textBaseline="alphabetic", this.textAlign="start", this.lineWidth=1, this.lineJoin="miter", this.lineCap="butt", this._transform=[1,0,0,1,0,0], this.globalCompositeOperation="normal", this.globalAlpha=1, this._clip_path=[], this.ignoreClearRect=!1, this.copy=function(t){this._isStrokeTransparent=t._isStrokeTransparent, this._strokeOpacity=t._strokeOpacity, this.strokeStyle=t.strokeStyle, this._isFillTransparent=t._isFillTransparent, this._fillOpacity=t._fillOpacity, this.fillStyle=t.fillStyle, this.font=t.font, this.lineWidth=t.lineWidth, this.lineJoin=t.lineJoin, this.lineCap=t.lineCap, this.textBaseline=t.textBaseline, this.textAlign=t.textAlign, this._fontSize=t._fontSize, this._transform=t._transform.slice(0), this.globalCompositeOperation=t.globalCompositeOperation, this.globalAlpha=t.globalAlpha, this._clip_path=t._clip_path.slice(0), this.ignoreClearRect=t.ignoreClearRect;};}Object.defineProperty(E,"fillStyle",{set:function(t){this.setFillStyle(t);},get:function(){return this.ctx.fillStyle}}), Object.defineProperty(E,"strokeStyle",{set:function(t){this.setStrokeStyle(t);},get:function(){return this.ctx.strokeStyle}}), Object.defineProperty(E,"lineWidth",{set:function(t){this.setLineWidth(t);},get:function(){return this.ctx.lineWidth}}), Object.defineProperty(E,"lineCap",{set:function(t){this.setLineCap(t);},get:function(){return this.ctx.lineCap}}), Object.defineProperty(E,"lineJoin",{set:function(t){this.setLineJoin(t);},get:function(){return this.ctx.lineJoin}}), Object.defineProperty(E,"miterLimit",{set:function(t){this.ctx.miterLimit=t;},get:function(){return this.ctx.miterLimit}}), Object.defineProperty(E,"textBaseline",{set:function(t){this.setTextBaseline(t);},get:function(){return this.getTextBaseline()}}), Object.defineProperty(E,"textAlign",{set:function(t){this.setTextAlign(t);},get:function(){return this.getTextAlign()}}), Object.defineProperty(E,"font",{set:function(t){this.setFont(t);},get:function(){return this.ctx.font}}), Object.defineProperty(E,"globalCompositeOperation",{set:function(t){this.ctx.globalCompositeOperation=t;},get:function(){return this.ctx.globalCompositeOperation}}), Object.defineProperty(E,"globalAlpha",{set:function(t){this.ctx.globalAlpha=t;},get:function(){return this.ctx.globalAlpha}}), Object.defineProperty(E,"canvas",{get:function(){return{parentNode:!1,style:!1}}}), Object.defineProperty(E,"ignoreClearRect",{set:function(t){this.ctx.ignoreClearRect=t;},get:function(){return this.ctx.ignoreClearRect}}), E.internal={}, E.internal.rxRgb=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/, E.internal.rxRgba=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/, E.internal.rxTransparent=/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/, E.internal.arc=function(t,e,n,r,i,o,a,s){for(var h=this.pdf.internal.scaleFactor,c=this.pdf.internal.pageSize.getHeight(),l=this.pdf.internal.f2,u=i*(Math.PI/180),f=o*(Math.PI/180),d=this.createArc(r,u,f,a),p=0;p<d.length;p++){var g=d[p];0===p?this.pdf.internal.out([l((g.x1+e)*h),l((c-(g.y1+n))*h),"m",l((g.x2+e)*h),l((c-(g.y2+n))*h),l((g.x3+e)*h),l((c-(g.y3+n))*h),l((g.x4+e)*h),l((c-(g.y4
21670+n))*h),"c"].join(" ")):this.pdf.internal.out([l((g.x2+e)*h),l((c-(g.y2+n))*h),l((g.x3+e)*h),l((c-(g.y3+n))*h),l((g.x4+e)*h),l((c-(g.y4+n))*h),"c"].join(" ")), t._lastPoint={x:e,y:n};}null!==s&&this.pdf.internal.out(this.pdf.internal.getStyle(s));}, E.internal.arc2=function(t,e,n,r,i,o,a,s,h){var c=e,l=n;h?(this.arc(t,c,l,r,i,o,a,null), this.pdf.clip_fixed()):this.arc(t,c,l,r,i,o,a,s);}, E.internal.move2=function(t,e,n){var r=this.pdf.internal.scaleFactor,i=this.pdf.internal.pageSize.getHeight(),o=this.pdf.internal.f2;this.pdf.internal.out([o(e*r),o((i-n)*r),"m"].join(" ")), t._lastPoint={x:e,y:n};}, E.internal.line2=function(t,e,n){var r=this.pdf.internal.scaleFactor,i=this.pdf.internal.pageSize.getHeight(),o=this.pdf.internal.f2,a={x:e,y:n};this.pdf.internal.out([o(a.x*r),o((i-a.y)*r),"l"].join(" ")), t._lastPoint=a;}, E.internal.createArc=function(t,e,n,r){var i=2*Math.PI,o=Math.PI/2,a=e;for((a<i||i<a)&&(a%=i), a<0&&(a=i+a);n<e;)e-=i;var s=Math.abs(n-e);s<i&&r&&(s=i-s);for(var h=[],c=r?-1:1,l=a;1e-5<s;){var u=l+c*Math.min(s,o);h.push(this.createSmallArc(t,l,u)), s-=Math.abs(u-l), l=u;}return h}, E.internal.getCurrentPage=function(){return this.pdf.internal.pages[this.pdf.internal.getCurrentPageInfo().pageNumber]}, E.internal.createSmallArc=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),a=i,s=-o,h=a*a+s*s,c=h+a*i+s*o,l=4/3*(Math.sqrt(2*h*c)-c)/(a*o-s*i),u=a-l*s,f=s+l*a,d=u,p=-f,g=r+e,m=Math.cos(g),w=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:u*m-f*w,y2:u*w+f*m,x3:d*m-p*w,y3:d*w+p*m,x4:t*Math.cos(n),y4:t*Math.sin(n)}};}($.API,"undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), function(t){var T,F,i,a,s,h,c,l,P,v,f,u,d,n,E,q,p,g,m,O;T=function(){return function(t){return e.prototype=t, new e};function e(){}}(), v=function(t){var e,n,r,i,o,a,s;for(n=0, r=t.length, e=void 0, a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0), n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0), n--;for(o=/\s+$/g, s=!0, n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "), s&&(e=e.trimLeft()), e&&(s=o.test(e)), t[n]=e), n++;return t}, u=function(t){var e,n,r;for(e=void 0, n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()], n=r.shift();return e}, d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"), -1<t.indexOf("pt")&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"), (e=n[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])?n[t]=e/16:(e=parseFloat(t))?n[t]=e/16:(e=t.match(/([\d\.]+)(px)/), Array.isArray(e)&&3===e.length?n[t]=parseFloat(e[1])/16:n[t]=1)}, P=function(t){var e,n,r,i,o;return o=t, i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(o,null):o.currentStyle?o.currentStyle:o.style, n=void 0, (e={})["font-family"]=u((r=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}), i[t]})("font-family"))||"times", e["font-style"]=a[r("font-style")]||"normal", e["text-align"]=s[r("text-align")]||"left", "bold"===(n=h[r("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]), e["font-size"]=d(r("font-size"))||1, e["line-height"]=d(r("line-height"))||1, e.display="inline"===r("display")?"inline":"block", n="block"===e.display, e["margin-top"]=n&&d(r("margin-top"))||0, e["margin-bottom"]=n&&d(r("margin-bottom"))||0, e["padding-top"]=n&&d(r("padding-top"))||0, e["padding-bottom"]=n&&d(r("padding-bottom"))||0, e["margin-left"]=n&&d(r("margin-left"))||0, e["margin-right"]=n&&d(r("margin-right"))||0, e["padding-left"]=n&&d(r("padding-left"))||0, e["padding-right"]=n&&d(r("padding-right"))||0, e["page-break-before"]=r("page-break-before")||"auto", e.float=c[r("cssFloat")]||"none", e.clear=l[r("clear")]||"none", e.color=r("color"), e}, E=function(t,e,n){var r,i,o,a,s;if(o=!1, a=i=void 0, r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0, a=r.length;!o&&i!==a;)o=r[i](t,e), i++;if(r=n[t.nodeName], !o&&r)if("function"==typeof r)o=r(t,e);else for(i=0, a=r.length;!o&&i!==a;)o=r[i](t,e), i++;for(s="string"==typeof t.className?t.className.split(" "):[], i=0;i<s.length;i++)if(r=n["."+s[i]], !o&&r)if("function"==typeof r)o=r(t,e);else for(i=0, a=r.length;!o&&i!==a;)o=r[i](t,e), i++;return o}, O=function(t,e){var n,r,i,o,a,s,h,c,l;
21670for(n=[], r=[], i=0, l=t.rows[0].cells.length, h=t.clientWidth;i<l;)c=t.rows[0].cells[i], r[i]={name:c.textContent.toLowerCase().replace(/\s+/g,""),prompt:c.textContent.replace(/\r?\n/g,""),width:c.clientWidth/h*e.pdf.internal.pageSize.getWidth()}, i++;for(i=1;i<t.rows.length;){for(s=t.rows[i], a={}, o=0;o<s.cells.length;)a[r[o].name]=s.cells[o].textContent.replace(/\r?\n/g,""), o++;n.push(a), i++;}return{rows:n,headers:r}};var B={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},R=1;F=function(t,i,e){var n,r,o,a,s,h,c,l;for(r=t.childNodes, n=void 0, (s="block"===(o=P(t)).display)&&(i.setBlockBoundary(), i.setBlockStyle(o)), a=0, h=r.length;a<h;){if("object"===(void 0===(n=r[a])?"undefined":vt(n))){if(i.executeWatchFunctions(n), 1===n.nodeType&&"HEADER"===n.nodeName){var u=n,f=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=f, F(u,i,e), i.pdf.margins_doc.top=i.y+10, i.y+=10;},!1);}if(8===n.nodeType&&"#comment"===n.nodeName)~n.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(), i.y=i.pdf.margins_doc.top);else if(1!==n.nodeType||B[n.nodeName])if(3===n.nodeType){var d=n.nodeValue;if(n.nodeValue&&"LI"===n.parentNode.nodeName)if("OL"===n.parentNode.parentNode.nodeName)d=R+++". "+d;else{var p=o["font-size"],g=(3-.75*p)*i.pdf.internal.scaleFactor,m=.75*p*i.pdf.internal.scaleFactor,w=1.74*p/i.pdf.internal.scaleFactor;l=function(t,e){this.pdf.circle(t+g,e+m,w,"FD");};}16&n.ownerDocument.body.compareDocumentPosition(n)&&i.addText(d,o);}else"string"==typeof n&&i.addText(n,o);else{var y;if("IMG"===n.nodeName){var v=n.getAttribute("src");y=q[i.pdf.sHashCode(v)||v];}if(y){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+n.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(), i.y=i.pdf.margins_doc.top, i.executeWatchFunctions(n));var b=P(n),x=i.x,S=12/i.pdf.internal.scaleFactor,k=(b["margin-left"]+b["padding-left"])*S,_=(b["margin-right"]+b["padding-right"])*S,A=(b["margin-top"]+b["padding-top"])*S,I=(b["margin-bottom"]+b["padding-bottom"])*S;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-_:x+=k, i.pdf.addImage(y,x,i.y+A,n.width,n.height), y=void 0, "right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t, i.settings.width+=n, !0):!!(r&&1===r.nodeType&&!B[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t, i.y=e, i.settings.width+=n, !0)}.bind(this,"left"===b.float?-n.width-k-_:0,i.y+n.height+A+I,n.width)), i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===P(n).clear&&(i.y=t, !0)}.bind(this,i.y+n.height,i.pdf.internal.getNumberOfPages())), i.settings.width-=n.width+k+_, "left"===b.float&&(i.x+=n.width+k+_)):i.y+=n.height+A+I;}else if("TABLE"===n.nodeName)c=O(n,i), i.y+=10, i.pdf.table(i.x,i.y,c.rows,c.headers,{autoSize:!1,printHeaders:e.printHeaders,margins:i.pdf.margins_doc,css:P(n)}), i.y=i.pdf.lastCellPos.y+i.pdf.lastCellPos.h+20;else if("OL"===n.nodeName||"UL"===n.nodeName)R=1, E(n,i,e)||F(n,i,e), i.y+=10;else if("LI"===n.nodeName){var C=i.x;i.x+=20/i.pdf.internal.scaleFactor, i.y+=3, E(n,i,e)||F(n,i,e), i.x=C;}else"BR"===n.nodeName?(i.y+=o["font-size"]*i.pdf.internal.scaleFactor, i.addText("\u2028",T(o))):E(n,i,e)||F(n,i,e);}}a++;}if(e.outY=i.y, s)return i.setBlockBoundary(l)}, q={}, p=function(t,o,e,n){var a,r=t.getElementsByTagName("img"),i=r.length,s=0;function h(){o.pdf.internal.events.publish("imagesLoaded"), n(a);}function c(e,n,r){if(e){var i=new Image;a=++s, i.crossOrigin="", i.onerror=i.onload=function(){if(i.complete&&(0===i.src.indexOf("data:image/")&&(i.width=n||i.width||0, i.height=r||i.height||0), i.width+i.height)){var t=o.pdf.sHashCode(e)||e;q[t]=q[t]||i;}--s||h();}, i.src=e;}}for(;i--;)c(r[i].getAttribute("src"),r[i].width,r[i].height);return s||h()}, g=function(t,o,a){var s=t.getElementsByTagName("footer");if(0<s.length){s=s[0];var e=o.pdf.internal.write,n=o.y;o.pdf.internal.write=function(){}, F(s,o,a);var h=Math.ceil(o.y-n)+5;o.y=n, o.pdf.internal.write=e, o.pdf.margins_doc.bottom+=h;for(var r=function(t){var e=void 0!==t?t.pageNumber:1,n=o.y;o.y=o.pdf.internal.pageSize.getHeight()-o.pdf.margins_doc.bottom, o.pdf.margins_doc.bottom-=h;for(var r=s.getElementsByTagName("span"),i=0;i<r.length;++i)-1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")&&(r[i].innerHTML=e), -1<(" "+r[i].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&(r[i].innerHTML="###jsPDFVarTotalPages###");F(s,o,a), o.pdf.margins_doc.bottom+=h, o.y=n;},i=s.getElementsByTagName("span"),c=0;c<i.length;++c)-1<(" "+i[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&o.pdf.internal.events.subscribe("htmlRenderingFinished",o.pdf.putTotalPages.bind(o.pdf,"###jsPDFVarTotalPages###"),!0);o.pdf.internal.events.subscribe("addPage",r,!1), r(), B.FOOTER=1;}}, m=function(t,e,n,r,i,o){if(!e)return!1;var a,s,h,c;"string"==typeof e||e.parentNode||(e=""+e.innerHTML), "string"==typeof e&&(a=e.replace(/<\/?script[^>]*?>/gi,""), c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0), (h=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;", h.innerHTML='<iframe style="height:1px;width:1px" name="'+c+'" />', document.body.appendChild(h), (s=window.frames[c]).document.open(), s.document.writeln(a), s.document.close(), e=s.document.body);var l,u=new f(t,n,r,i);return p.call(this,e,u,i.elementHandlers,function(t){g(e,u,i.elementHandlers), F(e,u,i.elementHandlers), u.pdf.internal.events.publish("htmlRenderingFinished"), l=u.dispose(), "function"==typeof o?o(l):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!");}), l||{x:u.x,y:u.y}}, (f=function(t,e,n,r){return this.pdf=t, this.x=e, this.y=n, this.settings=r, this.watchFunctions=[], this.init(), this}).prototype.init=function(){return this.paragraph={text:[],style:[]}, this.pdf.internal.write("q")}, f.prototype.dispose=function(){return this.pdf.internal.write("Q"), {x:this.x,y:this.y,ready:!0}}, f.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(0<this.watchFunctions.length){for(var r=0;r<this.watchFunctions.length;++r)!0===this.watchFunctions[r](t)?e=!0:n.push(this.watchFunctions[r]);this.watchFunctions=n;}return e}, f.prototype.splitFragmentsIntoLines=function(t,e){var n,r,i,o,a,s,h,c,l,u,f,d,p,g;for(u=this.pdf.internal.scaleFactor, o={}
21670, s=h=c=g=a=i=l=r=void 0, d=[f=[]], n=0, p=this.settings.width;t.length;)if(a=t.shift(), g=e.shift(), a)if((i=o[(r=g["font-family"])+(l=g["font-style"])])||(i=this.pdf.internal.getFont(r,l).metadata.Unicode, o[r+l]=i), c={widths:i.widths,kerning:i.kerning,fontSize:12*g["font-size"],textIndent:n}, h=this.pdf.getStringUnitWidth(a,c)*c.fontSize/u, "\u2028"==a)f=[], d.push(f);else if(p<n+h){for(s=this.pdf.splitTextToSize(a,p,c), f.push([s.shift(),g]);s.length;)f=[[s.shift(),g]], d.push(f);n=this.pdf.getStringUnitWidth(f[0][0],c)*c.fontSize/u;}else f.push([a,g]), n+=h;if(void 0!==g["text-align"]&&("center"===g["text-align"]||"right"===g["text-align"]||"justify"===g["text-align"]))for(var m=0;m<d.length;++m){var w=this.pdf.getStringUnitWidth(d[m][0][0],c)*c.fontSize/u;0<m&&(d[m][0][1]=T(d[m][0][1]));var y=p-w;if("right"===g["text-align"])d[m][0][1]["margin-left"]=y;else if("center"===g["text-align"])d[m][0][1]["margin-left"]=y/2;else if("justify"===g["text-align"]){var v=d[m][0][0].split(" ").length-1;d[m][0][1]["word-spacing"]=y/v, m===d.length-1&&(d[m][0][1]["word-spacing"]=0);}}return d}, f.prototype.RenderTextFragment=function(t,e){var n,r;r=0, this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()&&(this.pdf.internal.write("ET","Q"), this.pdf.addPage(), this.y=this.pdf.margins_doc.top, this.pdf.internal.write("q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"), r=Math.max(r,e["line-height"],e["font-size"]), this.pdf.internal.write(0,(-12*r).toFixed(2),"Td")), n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var i=this.getPdfColor(e.color);i!==this.lastTextColor&&(this.pdf.internal.write(i), this.lastTextColor=i), void 0!==e["word-spacing"]&&0<e["word-spacing"]&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw"), this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(t)+") Tj"), void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw");}, f.prototype.getPdfColor=function(t){var e,n,r,i=new RGBColor(t),o=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=o?(e=parseInt(o[1]), n=parseInt(o[2]), r=parseInt(o[3])):("#"!=t.charAt(0)&&(t=i.ok?i.toHex():"#000000"), e=t.substring(1,3), e=parseInt(e,16), n=t.substring(3,5), n=parseInt(n,16), r=t.substring(5,7), r=parseInt(r,16)), "string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var a=parseInt(e.substr(1),16);e=a>>16&255, n=a>>8&255, r=255&a;}var s=this.f3;return 0===e&&0===n&&0===r||void 0===n?s(e/255)+" g":[s(e/255),s(n/255),s(r/255),"rg"].join(" ")}, f.prototype.f3=function(t){return t.toFixed(3)}, f.prototype.renderParagraph=function(t){var e,n,r,i,o,a,s,h,c,l,u,f,d;if(r=v(this.paragraph.text), f=this.paragraph.style, e=this.paragraph.blockstyle, this.paragraph.priorblockstyle||{}, this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e}, r.join("").trim()){s=this.splitFragmentsIntoLines(r,f), h=a=void 0, n=12/this.pdf.internal.scaleFactor, this.priorMarginBottom=this.priorMarginBottom||0, u=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n, l=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n, this.priorMarginBottom=e["margin-bottom"]||0, "always"===e["page-break-before"]&&(this.pdf.addPage(), this.y=0, u=((e["margin-top"]||0)+(e["padding-top"]||0))*n), c=this.pdf.internal.write, o=i=void 0, this.y+=u, c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var p=0;s.length;){for(i=h=0, o=(a=s.shift()).length;i!==o;)a[i][0].trim()&&(h=Math.max(h,a[i][1]["line-height"],a[i][1]["font-size"]), d=7*a[i][1]["font-size"]), i++;var g=0,m=0;for(void 0!==a[0][1]["margin-left"]&&0<a[0][1]["margin-left"]&&(g=(m=this.pdf.internal.getCoordinateString(a[0][1]["margin-left"]))-p, p=m), c(g+Math.max(e["margin-left"]||0,0)*n,(-12*h).toFixed(2),"Td"), i=0, o=a.length;i!==o;)a[i][0]&&this.RenderTextFragment(a[i][0],a[i][1]), i++;if(this.y+=h*n, this.executeWatchFunctions(a[0][1])&&0<s.length){var w=[],y=[];
21670s.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(w.push(t[e][0]+" "), y.push(t[e][1])), ++e;}), s=this.splitFragmentsIntoLines(v(w),y), c("ET","Q"), c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-d/2), c("ET","Q"), this.y+=l}}, f.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)}, f.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t}, f.prototype.addText=function(t,e){return this.paragraph.text.push(t), this.paragraph.style.push(e)}, i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"}, h={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"}, a={normal:"normal",italic:"italic",oblique:"italic"}, s={left:"left",right:"right",center:"center",justify:"justify"}, c={none:"none",right:"right",left:"left"}, l={none:"none",both:"both"}, n={normal:1}, t.fromHTML=function(t,e,n,r,i,o){return this.margins_doc=o||{top:0,bottom:0}, r||(r={}), r.elementHandlers||(r.elementHandlers={}), m(this,t,isNaN(e)?4:e,isNaN(n)?4:n,r,i)};}($.API), $.API.addJS=function(t){return s=t, this.internal.events.subscribe("postPutResources",function(t){n=this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) "+(n+1)+" 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), r=this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS ("+s+")"), this.internal.out(">>"), this.internal.out("endobj");}), this.internal.events.subscribe("putCatalog",function(){void 0!==n&&void 0!==r&&this.internal.out("/Names <</JavaScript "+n+" 0 R>>");}), this}, (
21671/**
21672   * jsPDF Outline PlugIn
21673   * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  [email protected]
21674   *
21675   * Licensed under the MIT License.
21676   * http://opensource.org/licenses/mit-license
21677   */
21678c=$.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0<this.outline.root.children.length)for(var n=t.outline.render().split(/\r\n/),r=0;r<n.length;r++){var i=n[r],o=e.exec(i);if(null!=o){var a=o[1];t.internal.newObjectDeferredBegin(a);}t.internal.write(i);}if(this.outline.createNamedDestinations){var s=this.internal.pages.length,h=[];for(r=0;r<s;r++){var c=t.internal.newObject();h.push(c);var l=t.internal.getPageInfo(r+1);t.internal.write("<< /D["+l.objId+" 0 R /XYZ null null null]>> endobj");}var u=t.internal.newObject();for(t.internal.write("<< /Names [ "), r=0;r<h.length;r++)t.internal.write("(page_"+(r+1)+")"+h[r]+" 0 R");t.internal.write(" ] >>","endobj"), t.internal.newObject(), t.internal.write("<< /Dests "+u+" 0 R"), t.internal.write(">>","endobj");}}]), c.events.push(["putCatalog",function(){0<this.outline.root.children.length&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations&&this.internal.write("/Names "+namesOid+" 0 R"));}]), c.events.push(["initialized",function(){var o=this;o.outline={createNamedDestinations:!1,root:{children:[]}}, o.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root), t.children.push(r), r}, o.outline.render=function(){return this.ctx={}, this.ctx.val="", this.ctx.pdf=o, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val}, o.outline.genIds_r=function(t){t.id=o.internal.newObjectDeferred();for(var e=0;e<t.children.length;e++)this.genIds_r(t.children[e]);}, o.outline.renderRoot=function(t){this.objStart(t), this.line("/Type /Outlines"), 0<t.children.length&&(this.line("/First "+this.makeRef(t.children[0])), this.line("/Last "+this.makeRef(t.children[t.children.length-1]))), this.line("/Count "+this.count_r({count:0},t)), this.objEnd();}, o.outline.renderItems=function(t){for(var e=0;e<t.children.length;e++){var n=t.children[e];this.objStart(n), this.line("/Title "+this.makeString(n.title)), this.line("/Parent "+this.makeRef(t)), 0<e&&this.line("/Prev "+this.makeRef(t.children[e-1])), e<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[e+1])), 0<n.children.length&&(this.line("/First "+this.makeRef(n.children[0])), this.line("/Last "+this.makeRef(n.children[n.children.length-1])));var r=this.count=this.count_r({count:0},n);if(0<r&&this.line("/Count "+r), n.options&&n.options.pageNumber){var i=o.internal.getPageInfo(n.options.pageNumber);this.line("/Dest ["+i.objId+" 0 R /XYZ 0 "+this.ctx.pdf.internal.pageSize.getHeight()*this.ctx.pdf.internal.scaleFactor+" 0]");}this.objEnd();}for(e=0;e<t.children.length;e++)n=t.children[e], this.renderItems(n);}
21678, o.outline.line=function(t){this.ctx.val+=t+"\r\n";}, o.outline.makeRef=function(t){return t.id+" 0 R"}, o.outline.makeString=function(t){return"("+o.internal.pdfEscape(t)+")"}, o.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n";}, o.outline.objEnd=function(t){this.ctx.val+=">> \r\nendobj\r\n";}, o.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++, this.count_r(t,e.children[n]);return t.count};}]), P=$.API, E=function(){var t="function"==typeof Deflater;if(!t)throw new Error("requires deflate.js for compression");return t}, q=function(t,e,n,r){var i=5,o=b;switch(r){case P.image_compression.FAST:i=3, o=v;break;case P.image_compression.MEDIUM:i=6, o=x;break;case P.image_compression.SLOW:i=9, o=S;}t=w(t,e,n,o);var a=new Uint8Array(g(i)),s=m(t),h=new Deflater(i),c=h.append(t),l=h.flush(),u=a.length+c.length+l.length,f=new Uint8Array(u+4);return f.set(a), f.set(c,a.length), f.set(l,a.length+c.length), f[u++]=s>>>24&255, f[u++]=s>>>16&255, f[u++]=s>>>8&255, f[u++]=255&s, P.arrayBufferToBinaryString(f)}, g=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6, r|=0, [n,255&(r+=31-r%31)]}, m=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0<o;){for(o-=n=e<o?e:o;i+=r+=t[a++], --n;);r%=65521, i%=65521;}return(i<<16|r)>>>0}, w=function(t,e,n,r){for(var i,o,a,s=t.length/e,h=new Uint8Array(t.length+s),c=k(),l=0;l<s;l++){if(a=l*e, i=t.subarray(a,a+e), r)h.set(r(i,n,o),a+l);else{for(var u=0,f=c.length,d=[];u<f;u++)d[u]=c[u](i,n,o);var p=_(d.concat());h.set(d[p],a+l);}o=i;}return h}, l=function(t,e,n){var r=Array.apply([],t);return r.unshift(0), r}, v=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=1;o<a;o++)r=t[o-e]||0, i[o+1]=t[o]-r+256&255;return i}, b=function(t,e,n){var r,i=[],o=0,a=t.length;for(i[0]=2;o<a;o++)r=n&&n[o]||0, i[o+1]=t[o]-r+256&255;return i}, x=function(t,e,n){var r,i,o=[],a=0,s=t.length;for(o[0]=3;a<s;a++)r=t[a-e]||0, i=n&&n[a]||0, o[a+1]=t[a]+256-(r+i>>>1)&255;return o}, S=function(t,e,n){var r,i,o,a,s=[],h=0,c=t.length;for(s[0]=4;h<c;h++)r=t[h-e]||0, i=n&&n[h]||0, o=n&&n[h-e]||0, a=u(r,i,o), s[h+1]=t[h]-a+256&255;return s}, u=function(t,e,n){var r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),a=Math.abs(r-n);return i<=o&&i<=a?t:o<=a?e:n}, k=function(){return[l,v,b,x,S]}, _=function(t){for(var e,n,r,i=0,o=t.length;i<o;)((e=f(t[i].slice(1)))<n||!n)&&(n=e, r=i), i++;return r}, f=function(t){for(var e=0,n=t.length,r=0;e<n;)r+=Math.abs(t[e++]);return r}, P.processPNG=function(t,e,n,r,i){var o,a,s,h,c,l,u=this.color_spaces.DEVICE_RGB,f=this.decode.FLATE_DECODE,d=8;if(this.isArrayBuffer(t)&&(t=new Uint8Array(t)), this.isArrayBufferView(t)){if("function"!=typeof PNG||"function"!=typeof kt)throw new Error("PNG support requires png.js and zlib.js");if(t=(o=new PNG(t)).imgData, d=o.bits, u=o.colorSpace, h=o.colors, -1!==[4,6].indexOf(o.colorType)){if(8===o.bits)for(var p,g=(I=32==o.pixelBitlength?new Uint32Array(o.decodePixels().buffer):16==o.pixelBitlength?new Uint16Array(o.decodePixels().buffer):new Uint8Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*o.colors),w=new Uint8Array(g),y=o.pixelBitlength-o.bits,v=0,b=0;v<g;v++){for(x=I[v], p=0;p<y;)m[b++]=x>>>p&255, p+=o.bits;w[v]=x>>>p&255;}if(16===o.bits){g=(I=new Uint32Array(o.decodePixels().buffer)).length, m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors), w=new Uint8Array(g*(32/o.pixelBitlength));for(var x,S=1<o.colors,k=b=v=0;v<g;)x=I[v++], m[b++]=x>>>0&255, S&&(m[b++]=x>>>16&255, x=I[v++], m[b++]=x>>>0&255), w[k++]=x>>>16&255;d=8;}r!==P.image_compression.NONE&&E()?(t=q(m,o.width*o.colors,o.colors,r), l=q(w,o.width,1,r)):(t=m, l=w, f=null);}if(3===o.colorType&&(u=this.color_spaces.INDEXED, c=o.palette, o.transparency.indexed)){var _=o.transparency.indexed,A=0;for(v=0, g=_.length;v<g;++v)A+=_[v];if((A/=255)==g-1&&-1!==_.indexOf(0))s=[_.indexOf(0)];else if(A!==g){var I=o.decodePixels();for(w=new Uint8Array(I.length), v=0, g=I.length;v<g;v++)w[v]=_[I[v]];l=q(w,o.width,1);}}var C=function(t){var e;switch(t){case P.image_compression.FAST:e=11;break;case P.image_compression.MEDIUM:e=13;break;case P.image_compression.SLOW:e=14;break;default:e=12;}return e}(r);return a=f===this.decode.FLATE_DECODE?"/Predictor "+C+" /Colors "+h+" /BitsPerComponent "+d+" /Columns "+o.width:"/Colors "+h+" /BitsPerComponent "+d+" /Columns "+o.width, (this.isArrayBuffer(t)||this.isArrayBufferView(t))&&(t=this.arrayBufferToBinaryString(t)), (l&&this.isArrayBuffer(l)||this.isArrayBufferView(l))&&(l=this.arrayBufferToBinaryString(l)), this.createImageInfo(t,o.width,o.height,u,d,f,e,n,a,s,c,l,C)}throw new Error("Unsupported PNG image data, try using JPEG instead.")}, (
21679/**
21680   * jsPDF gif Support PlugIn
21681   * Copyright (c) 2017 Aras Abbasi 
21682   *
21683   * Licensed under the MIT License.
21684   * http://opensource.org/licenses/mit-license
21685   */
21686A=$.API).processGIF89A=function(t,e,n,r,i){var o=new mt(t),a=o.width,s=o.height,h=[];o.decodeAndBlitFrameRGBA(0,h);var c={data:h,width:a,height:s},l=new yt(100).encode(c,100);return A.processJPEG.call(this,l,e,n,r)}, A.processGIF87A=A.processGIF89A, (
21687/**
21688   * jsPDF bmp Support PlugIn
21689   * Copyright (c) 2018 Aras Abbasi 
21690   *
21691   * Licensed under the MIT License.
21692   * http://opensource.org/licenses/mit-license
21693   */
21694O=$.API).processBMP=function(t,e,n,r,i){var o=new xt(t,!1),a=o.width,s=o.height,h={data:o.getData(),width:a,height:s},c=new yt(100).encode(h,100);return O.processJPEG.call(this,c,e,n,r)}, $.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={}, this.internal.languageSettings.isSubscribed=!1), void 0!=={af:"Afrikaans",sq
21694:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"FYRO Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]&&(this.internal.languageSettings.languageCode=t, !1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")");}), this.internal.languageSettings.isSubscribed=!0)), this}, B=$.API, R=B.getCharWidthsArray=function(t,e){var n,r,i,o=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),s=e.charSpace||this.internal.getCharSpace(),h=e.widths?e.widths:o.metadata.Unicode.widths,c=h.fof?h.fof:1,l=e.kerning?e.kerning:o.metadata.Unicode.kerning,u=l.fof?l.fof:1,f=0,d=h[0]||c,p=[];for(n=0, r=t.length;n<r;n++)i=t.charCodeAt(n), "function"==typeof o.metadata.widthOfString?p.push((o.metadata.widthOfGlyph(o.metadata.characterToGlyph(i))+s*(1e3/a)||0)/1e3):p.push((h[i]||d)/c+(l[i]&&l[i][f]||0)/u), f=i;return p}, j=B.getArraySum=function(t){for(var e=t.length,n=0;e;)n+=t[--e];return n}, D=B.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:j(R.apply(this,arguments))}, M=function(t,e,n,r){for(var i=[],o=0,a=t.length,s=0;o!==a&&s+e[o]<n;)s+=e[o], o++;i.push(t.slice(0,o));var h=o;for(s=0;o!==a;)s+e[o]>r&&(i.push(t.slice(h,o)), s=0, h=o), s+=e[o], o++;return h!==o&&i.push(t.slice(h,o)), i}, U=function(t,e,n){n||(n={});var r,i,o,a,s,h,c=[],l=[c],u=n.textIndent||0,f=0,d=0,p=t.split(" "),g=R.apply(this,[" ",n])[0];if(h=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(h).join(" "),w=[];p.map(function(t){1<(t=t.split(/\s*\n/)).length?w=w.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):w.push(t[0]);}), p=w, h=D.apply(this,[m,n]);}for(o=0, a=p.length;o<a;o++){var y=0;if(r=p[o], h&&"\n"==r[0]&&(r=r.substr(1), y=1), i=R.apply(this,[r,n]), e<u+f+(d=j(i))||y){if(e<d){for(s=M.apply(this,[r,i,e-(u+f),e]), c.push(s.shift()), c=[s.pop()];s.length;)l.push([s.shift()]);d=j(i.slice(r.length-(c[0]?c[0].length:0)));}else c=[r];l.push(c), u=d+h, f=g;}else c.push(r), u+=f+d, f=g;}if(h)var v=function(t,e){return(e?m:"")+t.join(" ")};else v=function(t){return t.join(" ")};return l.map(v)}, B.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),o=function(t){var e={0:1},n={};if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var r=this.internal.getFont(t.fontName,t.fontStyle),i="Unicode";return r.metadata[i]?{widths:r.metadata[i].widths||e,kerning:r.metadata[i].kerning||n}:{font:r.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(t)?t:t.split(/\r?\n/);var a=1*this.internal.scaleFactor*e/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0, o.lineIndent=n.lineIndent;var s,h,c=[];for(s=0, h=r.length;s<h;s++)c=c.concat(U.apply(this,[r[s],a,o]));return c}, N=$.API, L={codePages:["WinAnsiEncoding"],WinAnsiEncoding:(z=function(t){for(var e="klmnopqrstuvwxyz",n={},r=0;r<e.length;r++)n[e[r]]="0123456789abcdef"[r];var i,o,a,s,h,c={},l=1,u=c,f=[],d="",p="",g=t.length-1;for(r=1;r!=g;)h=t[r], r+=1, "'"==h?o?(s=o.join(""), o=i):o=[]:o?o.push(h):"{"==h?(f.push([u,s]), u={}, s=i):"}"==h?((a=f.pop())[0][a[1]]=u, s=i, u=a[0]):"-"==h?l=-1:s===i?n.hasOwnProperty(h)?(d+=n[h], s=parseInt(d,16)*l, l=1, d=""):d+=h:n.hasOwnProperty(h)?(p+=n[h], u[s]=parseInt(p,16)*l, l=1, s=i, p=""):p+=h;return c})("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")}, H={Unicode:{Courier:L,"Courier-Bold":L,"Courier-BoldOblique":L,"Courier-Oblique":L,Helvetica:L,"Helvetica-Bold":L,"Helvetica-BoldOblique":L,"Helvetica-Oblique":L,"Times-Roman":L,"Times-Bold":L,"Times-BoldItalic":L,"Times-Italic":L}
21695/** 
21696    Resources:
21697    Font metrics data is reprocessed derivative of contents of
21698    "Font Metrics for PDF Core 14 Fonts" package, which exhibits the following copyright and license:
21699    
21700    Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
21701    
21702    This file and the 14 PostScript(R) AFM files it accompanies may be used,
21703    copied, and distributed for any purpose and without charge, with or without
21704    modification, provided that all copyright notices are retained; that the AFM
21705    files are not distributed without this file; that all modifications to this
21706    file or any of the AFM files are prominently noted in the modified file(s);
21707    and that this paragraph is not modified. Adobe Systems has no responsibility
21708    or obligation to support the use of the AFM files.
21709    
21710    */}, W={Unicode:{"Courier-Oblique":z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":z("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":z("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
21710dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":z("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:z("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:z("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
21710dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":z("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
21710dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:z("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":z("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":z("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}
21710fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":z("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":z("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
21710dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}}, N.events.push(["addFont",function(t){var e,n,r,i="Unicode";(e=W[i][t.postScriptName])&&((n=t.metadata[i]?t.metadata[i]:t.metadata[i]={}).widths=e.widths, n.kerning=e.kerning), (r=H[i][t.postScriptName])&&((n=t.metadata[i]?t.metadata[i]:t.metadata[i]={}).encoding=r).codePages&&r.codePages.length&&(t.encoding=r.codePages[0]);}]), G=$, "undefined"!=typeof self&&self||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||"undefined"!=typeof window&&window||Function("return this")(), G.API.events.push(["addFont",function(t){G.API.existsFileInVFS(t.postScriptName)?(t.metadata=G.API.TTFFont.open(t.postScriptName,t.fontName,G.API.getFileFromVFS(t.postScriptName),t.encoding), t.metadata.Unicode=t.metadata.Unicode||{encoding:{},kerning:{},widths:[]}):14<t.id.slice(1)&&console.error("Font does not exist in FileInVFS, import fonts or remove declaration doc.addFont('"+t.postScriptName+"').");}]), (
21711/** @preserve
21712  jsPDF SVG plugin
21713  Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
21714  */
21715V=$.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function o(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,o=t.length;i<o;)"c"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2]),parseFloat(t[i+3]),parseFloat(t[i+4]),parseFloat(t[i+5]),parseFloat(t[i+6])]), i+=7):"l"===t[i]?(r.push([parseFloat(t[i+1]),parseFloat(t[i+2])]), i+=3):i+=1;return[e,n,r]}var a,s,h,c,l,u,f,d,p=(c=document, d=c.createElement("iframe"), l=".jsPDF_sillysvg_iframe {display:none;position:absolute;}", (f=(u=c).createElement("style")).type="text/css", f.styleSheet?f.styleSheet.cssText=l:f.appendChild(u.createTextNode(l)), u.getElementsByTagName("head")[0].appendChild(f), d.name="childframe", d.setAttribute("width",0), d.setAttribute("height",0), d.setAttribute("frameborder","0"), d.setAttribute("scrolling","no"), d.setAttribute("seamless","seamless"), d.setAttribute("class","jsPDF_sillysvg_iframe"), c.body.appendChild(d), d),g=(a=t, (h=((s=p).contentWindow||s.contentDocument).document).write(a), h.close(), h.getElementsByTagName("svg")[0]),m=[1,1],w=parseFloat(g.getAttribute("width")),y=parseFloat(g.getAttribute("height"));w&&y&&(r&&i?m=[r/w,i/y]:r?m=[r/w,r/w]:i&&(m=[i/y,i/y]));var v,b,x,S,k=g.childNodes;for(v=0, b=k.length;v<b;v++)(x=k[v]).tagName&&"PATH"===x.tagName.toUpperCase()&&((S=o(x.getAttribute("d").split(" ")))[0]=S[0]*m[0]+e, S[1]=S[1]*m[1]+n, this.lines.call(this,S[2],S[0],S[1],m));return this}, V.addSVG=V.addSvg, V.addSvgAsImage=function(t,e,n,r,i,o,a,s){if
21715(isNaN(e)||isNaN(n))throw console.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addSvgAsImage: Invalid measurements",arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=r, h.height=i;var c=h.getContext("2d");return c.fillStyle="#fff", c.fillRect(0,0,h.width,h.height), canvg(h,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0}), this.addImage(h.toDataURL("image/jpeg",1),e,n,r,i,a,s), this}, $.API.putTotalPages=function(t){for(var e=new RegExp(t,"g"),n=1;n<=this.internal.getNumberOfPages();n++)for(var r=0;r<this.internal.pages[n].length;r++)this.internal.pages[n][r]=this.internal.pages[n][r].replace(e,this.internal.getNumberOfPages());return this}, $.API.viewerPreferences=function(t,e){var n;t=t||{}, e=e||!1;var r,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),s=[],h=0,c=0,l=0,u=!0;function f(t,e){var n,r=!1;for(n=0;n<t.length;n+=1)t[n]===e&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={}, this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)), this.internal.viewerpreferences.isSubscribed=!1), n=this.internal.viewerpreferences.configuration, "reset"===t||!0===e){var d=a.length;for(l=0;l<d;l+=1)n[a[l]].value=n[a[l]].defaultValue, n[a[l]].explicitSet=!1;}if("object"===(void 0===t?"undefined":vt(t)))for(r in t)if(i=t[r], f(a,r)&&void 0!==i){if("boolean"===n[r].type&&"boolean"==typeof i)n[r].value=i;else if("name"===n[r].type&&f(n[r].valueSet,i))n[r].value=i;else if("integer"===n[r].type&&Number.isInteger(i))n[r].value=i;else if("array"===n[r].type){for(h=0;h<i.length;h+=1)if(u=!0, 1===i[h].length&&"number"==typeof i[h][0])s.push(String(i[h]));else if(1<i[h].length){for(c=0;c<i[h].length;c+=1)"number"!=typeof i[h][c]&&(u=!1);!0===u&&s.push(String(i[h].join("-")));}n[r].value=String(s);}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0;}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");}), this.internal.viewerpreferences.isSubscribed=!0), this.internal.viewerpreferences.configuration=n, this}, Y=$.API, K=J=X="", Y.addMetadata=function(t,e){return J=e||"http://jspdf.default.namespaceuri/", X=t, this.internal.events.subscribe("postPutResources",function(){if(X){var t='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+J+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(X)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),o=unescape(encodeURIComponent("</x:xmpmeta>")),a=n.length+r.length+i.length+e.length+o.length;K=this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"), this.internal.write("stream"), this.internal.write(e+n+r+i+o), this.internal.write("endstream"), this.internal.write("endobj");}else K="";}), this.internal.events.subscribe("putCatalog",function(){K&&this.internal.write("/Metadata "+K+" 0 R");}), this}, function(l,t){var e=l.API,m=[0];e.events.push(["putFont",function(t){!function(t,e,n){if(t.metadata instanceof l.API.TTFFont&&"Identity-H"===t.encoding){for(var r=t.metadata.Unicode.widths,i=t.metadata.subset.encode(m),o="",a=0;a<i.length;a++)o+=String.fromCharCode(i[a]);var s=n();e("<<"), e("/Length "+o.length), e("/Length1 "+o.length), e(">>"), e("stream"), e(o), e("endstream"), e("endobj");var h=n();e("<<"), e("/Type /FontDescriptor"), e("/FontName /"+t.fontName), e("/FontFile2 "+s+" 0 R"), e("/FontBBox "+l.API.PDFObject.convert(t.metadata.bbox)), e("/Flags "+t.metadata.flags), e("/StemV "+t.metadata.stemV), e("/ItalicAngle "+t.metadata.italicAngle), e("/Asce
21715nt "+t.metadata.ascender), e("/Descent "+t.metadata.decender), e("/CapHeight "+t.metadata.capHeight), e(">>"), e("endobj");var c=n();e("<<"), e("/Type /Font"), e("/BaseFont /"+t.fontName), e("/FontDescriptor "+h+" 0 R"), e("/W "+l.API.PDFObject.convert(r)), e("/CIDToGIDMap /Identity"), e("/DW 1000"), e("/Subtype /CIDFontType2"), e("/CIDSystemInfo"), e("<<"), e("/Supplement 0"), e("/Registry (Adobe)"), e("/Ordering ("+t.encoding+")"), e(">>"), e(">>"), e("endobj"), t.objectNumber=n(), e("<<"), e("/Type /Font"), e("/Subtype /Type0"), e("/BaseFont /"+t.fontName), e("/Encoding /"+t.encoding), e("/DescendantFonts ["+c+" 0 R]"), e(">>"), e("endobj"), t.isAlreadyPutted=!0;}}(t.font,t.out,t.newObject);}]);e.events.push(["putFont",function(t){!function(t,e,n){if(t.metadata instanceof l.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var r=t.metadata.rawData,i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);var a=n();e("<<"), e("/Length "+i.length), e("/Length1 "+i.length), e(">>"), e("stream"), e(i), e("endstream"), e("endobj");var s=n();for(e("<<"), e("/Descent "+t.metadata.decender), e("/CapHeight "+t.metadata.capHeight), e("/StemV "+t.metadata.stemV), e("/Type /FontDescriptor"), e("/FontFile2 "+a+" 0 R"), e("/Flags 96"), e("/FontBBox "+l.API.PDFObject.convert(t.metadata.bbox)), e("/FontName /"+t.fontName), e("/ItalicAngle "+t.metadata.italicAngle), e("/Ascent "+t.metadata.ascender), e(">>"), e("endobj"), t.objectNumber=n(), o=0;o<t.metadata.hmtx.widths.length;o++)t.metadata.hmtx.widths[o]=parseInt(t.metadata.hmtx.widths[o]*(1e3/t.metadata.head.unitsPerEm));e("<</Subtype/TrueType/Type/Font/BaseFont/"+t.fontName+"/FontDescriptor "+s+" 0 R/Encoding/"+t.encoding+" /FirstChar 29 /LastChar 255 /Widths "+l.API.PDFObject.convert(t.metadata.hmtx.widths)+">>"), e("endobj"), t.isAlreadyPutted=!0;}}(t.font,t.out,t.newObject);}]);var c=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},h=s.pdfEscape,c=s.activeFontKey,l=s.fonts,u=(s.activeFontSize, ""),f=0,d="",p=l[n=c].encoding;if("Identity-H"!==l[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(d=r, n=c, "[object Array]"===Object.prototype.toString.call(r)&&(d=r[0]), f=0;f<d.length;f+=1)l[n].metadata.hasOwnProperty("cmap")&&(e=l[n].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]), e?u+=d[f]:d[f].charCodeAt(0)<256&&l[n].metadata.hasOwnProperty("Unicode")?u+=d[f]:u+="";var g="";return parseInt(n.slice(1))<14||"WinAnsiEncoding"===p?g=function(t){for(var e="",n=0;n<t.length;n++)e+=""+t.charCodeAt(n).toString(16);return e}(h(u,n)):"Identity-H"===p&&(g=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<s;++a){if(n=e.metadata.characterToGlyph(t.charCodeAt(a)), m.push(n), -1==r.indexOf(n)&&(r.push(n), r.push([parseInt(e.metadata.widthOfGlyph(n),10)])), "0"==n)return o.join("");n=n.toString(16), o.push(i[4-n.length],n);}return o.join("")}(u,l[n])), s.isHex=!0, {text:g,x:i,y:o,options:a,mutex:s}};e.events.push(["postProcessText",function(t){var e=t.text||"",n=t.x,r=t.y,i=t.options,o=t.mutex,a=(i.lang, []),s={text:e,x:n,y:r,options:i,mutex:o};if("[object Array]"===Object.prototype.toString.call(e)){var h=0;for(h=0;h<e.length;h+=1)"[object Array]"===Object.prototype.toString.call(e[h])&&3===e[h].length?a.push([c(Object.assign({},s,{text:e[h][0]})).text,e[h][1],e[h][2]]):a.push(c(Object.assign({},s,{text:e[h]})).text);t.text=a;}else t.text=c(Object.assign({},s,{text:e})).text;}]);}($,"undefined"!=typeof self&&self||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||"undefined"!=typeof window&&window||Function("return this")()), Q=$.API, Z={}, Q.existsFileInVFS=function(t){return Z.hasOwnProperty(t)}, Q.addFileToVFS=function(t,e){return Z[t]=e, this}, Q.getFileFromVFS=function(t){return Z.hasOwnProperty(t)?Z[t]:null}, function(t){if(t.URL=t.URL||t.webkitURL, t.Blob&&t.URL)try{return new Blob}catch(t){}var s=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var s=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},e=function(){this.data=[];},h=function(t,e,n){this.data=t, this.size=t.length, this.type=e, this.encoding=n;},n=e.prototype,r=h.prototype,c=t.FileReaderSync,l=function(t){this.co
21715de=this[this.name=t];},i="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),o=i.length,a=t.URL||t.webkitURL||t,u=a.createObjectURL,f=a.revokeObjectURL,d=a,p=t.btoa,g=t.atob,m=t.ArrayBuffer,w=t.Uint8Array,y=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(h.fake=r.fake=!0;o--;)l.prototype[i[o]]=o+1;return a.createObjectURL||(d=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t, "origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(y), n.origin=e&&e[1])), n}), d.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"), t instanceof h?(e="data:"+n, "base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):p?e+";base64,"+p(t.data):e+","+encodeURIComponent(t.data)):u?u.call(a,t):void 0}, d.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&f&&f.call(a,t);}, n.append=function(t){var e=this.data;if(w&&(t instanceof m||t instanceof w)){for(var n="",r=new w(t),i=0,o=r.length;i<o;i++)n+=String.fromCharCode(r[i]);e.push(n);}else if("Blob"===s(t)||"File"===s(t)){if(!c)throw new l("NOT_READABLE_ERR");var a=new c;e.push(a.readAsBinaryString(t));}else t instanceof h?"base64"===t.encoding&&g?e.push(g(t.data)):"URI"===t.encoding?e.push(decodeURIComponent(t.data)):"raw"===t.encoding&&e.push(t.data):("string"!=typeof t&&(t+=""), e.push(unescape(encodeURIComponent(t))));}, n.getBlob=function(t){return arguments.length||(t=null), new h(this.data.join(""),t,"raw")}, n.toString=function(){return"[object BlobBuilder]"}, r.slice=function(t,e,n){var r=arguments.length;return r<3&&(n=null), new h(this.data.slice(t,1<r?e:this.data.length),n,this.encoding)}, r.toString=function(){return"[object Blob]"}, r.close=function(){this.size=0, delete this.data;}, e}(t);t.Blob=function(t,e){var n=e&&e.type||"",r=new s;if(t)for(var i=0,o=t.length;i<o;i++)Uint8Array&&t[i]instanceof Uint8Array?r.append(t[i].buffer):r.append(t[i]);var a=r.getBlob(n);return!a.slice&&a.webkitSlice&&(a.slice=a.webkitSlice), a};var e=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=e(new t.Blob);}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||window.content||window);var tt,et,nt,rt,it,ot,at,st,ht,ct,lt,ut,ft,dt,pt,gt,bt=bt||function(s){if(!(void 0===s||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=s.document,h=function(){return s.URL||s.webkitURL||s},c=t.createElementNS("http://www.w3.org/1999/xhtml","a"),l="download"in c,u=/constructor/i.test(s.HTMLElement)||s.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),d=function(t){(s.setImmediate||s.setTimeout)(function(){throw t},0);},p=function(t){setTimeout(function(){"string"==typeof t?h().revokeObjectURL(t):t.remove();},4e4);},g=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},r=function(t,n,e){e||(t=g(t));var r,i=this,o="application/octet-stream"===t.type,a=function(){!function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t);}catch(t){d(t);}}}(i,"writestart progress write writeend".split(" "));};if(i.readyState=i.INIT, l)return r=h().createObjectURL(t), void setTimeout(function(){var t,e;c.href=r, c.download=n, t=c, e=new MouseEvent("click"), t.dispatchEvent(e), a(), p(r), i.readyState=i.DONE;});!function(){if((f||o&&u)&&s.FileReader){var e=new FileReader;return e.onloadend=function(){var t=f?e.result:e.result.replace(/^data:[^;]*;/,"data:attachment/file;");s.open(t,"_blank")||(s.location.href=t), t=void 0, i.readyState=i.DONE, a();}, e.readAsDataURL(t), i.readyState=i.INIT}r||(r=h().createObjectURL(t)), o?s.location.href=r:s.open(r,"_blank")||(s.location.href=r);i.readyState=i.DONE, a(), p(r);}();},e=r.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download", n||(t=g(t)), navigator.msSaveOrOpenBlob(t,e)}:(e.abort=function(){}, e.readyState=e.INIT=0, e.WRITING=1, e.DONE=2, e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null, function(t,e,n){return new r(t,e||t.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||window.content);function mt(x){var t=0;if(71!==x[t++]||73!==x[t++]||70!==x[t++]||56!==x[t++]||56!=(x[t++]+1&253)||97!==x[t++])throw"Invalid GIF 87a/89a header.";var S=x[t++]|x[t++]<<8,e=x[t++]|x[t++]<<8,n=x[t++],r=n>>7,i=1<<(7&n)+1;x[t++];x[t++];var o=null;r&&(o=t, t+=3*i);var a=!0,s=[],h=0,c=null,l=0,u=null;for(this.width=S, this.height=e;a&&t<x.length;)switch(x[t++]){case 33:switch(x[t++]){case 255:if(11!==x[t]||78==x[t+1]&&69==x[t+2]&&84==x[t+3]&&83==x[t+4]&&67==x[t+5]&&65==x[t+6]&&80==x[t+7]&&69==x[t+8]&&50==x[t+9]&&46==x[t+10]&&48==x[t+11]&&3==x[t+12]&&1==x[t+13]&&0==x[t+16]
21715)t+=14, u=x[t++]|x[t++]<<8, t++;else for(t+=12;;){if(0===(_=x[t++]))break;t+=_;}break;case 249:if(4!==x[t++]||0!==x[t+4])throw"Invalid graphics extension block.";var f=x[t++];h=x[t++]|x[t++]<<8, c=x[t++], 0==(1&f)&&(c=null), l=f>>2&7, t++;break;case 254:for(;;){if(0===(_=x[t++]))break;t+=_;}break;default:throw"Unknown graphic control label: 0x"+x[t-1].toString(16)}break;case 44:var d=x[t++]|x[t++]<<8,p=x[t++]|x[t++]<<8,g=x[t++]|x[t++]<<8,m=x[t++]|x[t++]<<8,w=x[t++],y=w>>6&1,v=o,b=!1;if(w>>7){b=!0;v=t, t+=3*(1<<(7&w)+1);}var k=t;for(t++;;){var _;if(0===(_=x[t++]))break;t+=_;}s.push({x:d,y:p,width:g,height:m,has_local_palette:b,palette_offset:v,data_offset:k,data_length:t-k,transparent_index:c,interlaced:!!y,delay:h,disposal:l});break;case 59:a=!1;break;default:throw"Unknown gif block: 0x"+x[t-1].toString(16)}this.numFrames=function(){return s.length}, this.loopCount=function(){return u}, this.frameInfo=function(t){if(t<0||t>=s.length)throw"Frame index out of range.";return s[t]}, this.decodeAndBlitFrameBGRA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);wt(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,h=S-s,c=s,l=4*(n.y*S+n.x),u=4*((n.y+n.height)*S+n.x),f=l,d=4*h;!0===n.interlaced&&(d+=4*(s+h)*7);for(var p=8,g=0,m=i.length;g<m;++g){var w=i[g];if(0===c&&(c=s, u<=(f+=d)&&(d=h+4*(s+h)*(p-1), f=l+(s+h)*(p<<1), p>>=1)), w===a)f+=4;else{var y=x[o+3*w],v=x[o+3*w+1],b=x[o+3*w+2];e[f++]=b, e[f++]=v, e[f++]=y, e[f++]=255;}--c;}}, this.decodeAndBlitFrameRGBA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);wt(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,h=S-s,c=s,l=4*(n.y*S+n.x),u=4*((n.y+n.height)*S+n.x),f=l,d=4*h;!0===n.interlaced&&(d+=4*(s+h)*7);for(var p=8,g=0,m=i.length;g<m;++g){var w=i[g];if(0===c&&(c=s, u<=(f+=d)&&(d=h+4*(s+h)*(p-1), f=l+(s+h)*(p<<1), p>>=1)), w===a)f+=4;else{var y=x[o+3*w],v=x[o+3*w+1],b=x[o+3*w+2];e[f++]=y, e[f++]=v, e[f++]=b, e[f++]=255;}--c;}};}function wt(t,e,n,r){for(var i=t[e++],o=1<<i,a=o+1,s=a+1,h=i+1,c=(1<<h)-1,l=0,u=0,f=0,d=t[e++],p=new Int32Array(4096),g=null;;){for(;l<16&&0!==d;)u|=t[e++]<<l, l+=8, 1===d?d=t[e++]:--d;if(l<h)break;var m=u&c;if(u>>=h, l-=h, m!==o){if(m===a)break;for(var w=m<s?m:g,y=0,v=w;o<v;)v=p[v]>>8, ++y;var b=v;if(r<f+y+(w!==m?1:0))return void console.log("Warning, gif stream longer than expected.");n[f++]=b;var x=f+=y;for(w!==m&&(n[f++]=b), v=w;y--;)v=p[v], n[--x]=255&v, v>>=8;null!==g&&s<4096&&(p[s++]=g<<8|b, c+1<=s&&h<12&&(++h, c=c<<1|1)), g=m;}else s=a+1, c=(1<<(h=i+1))-1, g=null;}return f!==r&&console.log("Warning, gif stream shorter than expected."), n}"undefined"!='object'&&module.exports?module.exports.saveAs=bt:"undefined"!=typeof undefined&&null!==undefined&&null!==undefined.amd&&undefined("FileSaver.js",function(){return bt}), $.API.adler32cs=(ot="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array, at=null, st=function(){if(!ot)return function(){return!1};try{var t={};"function"==typeof t.Buffer&&(at=t.Buffer);}catch(t){}return function(t){return t instanceof ArrayBuffer||null!==at&&t instanceof at}}(), ht=null!==at?function(t){return new at(t,"utf8").toString("binary")}:function(t){return unescape(encodeURIComponent(t))}, ct=65521, lt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+(255&e.charCodeAt(i)))%ct, r=(r+n)%ct;return(r<<16|n)>>>0}, ut=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i<o;i++)n=(n+e[i])%ct, r=(r+n)%ct;return(r<<16|n)>>>0}, dt=(ft={}).Adler32=(((it=(rt=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0;}).prototype={}).constructor=rt).from=((tt=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=lt(1,t.toString());}).prototype=it, tt), rt.fromUtf8=((et=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");
21715if(null==t)throw new Error("First argument needs to be a string.");var e=ht(t.toString());this.checksum=lt(1,e);}).prototype=it, et), ot&&(rt.fromBuffer=((nt=function(t){if(!(this instanceof rt))throw new TypeError("Constructor cannot called be as a function.");if(!st(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=ut(1,e)}).prototype=it, nt)), it.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(), this.checksum=lt(this.checksum,t)}, it.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=ht(t.toString());return this.checksum=lt(this.checksum,e)}, ot&&(it.updateBuffer=function(t){if(!st(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=ut(this.checksum,e)}), it.clone=function(){return new dt(this.checksum)}, rt), ft.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return lt(1,t.toString())}, ft.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=ht(t.toString());return lt(1,e)}, ot&&(ft.fromBuffer=function(t){if(!st(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return ut(1,e)}), ft);try{exports.GifWriter=function(w,t,e,n){var y=0,r=void 0===(n=void 0===n?{}:n).loop?null:n.loop,v=void 0===n.palette?null:n.palette;if(t<=0||e<=0||65535<t||65535<e)throw"Width/Height invalid.";function b(t){var e=t.length;if(e<2||256<e||e&e-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return e}w[y++]=71, w[y++]=73, w[y++]=70, w[y++]=56, w[y++]=57, w[y++]=97;var i=0,o=0;if(null!==v){for(var a=b(v);a>>=1;)++i;if(a=1<<i, --i, void 0!==n.background){if(a<=(o=n.background))throw"Background index out of range.";if(0===o)throw"Background index explicitly passed as 0."}}if(w[y++]=255&t, w[y++]=t>>8&255, w[y++]=255&e, w[y++]=e>>8&255, w[y++]=(null!==v?128:0)|i, w[y++]=o, w[y++]=0, null!==v)for(var s=0,h=v.length;s<h;++s){var c=v[s];w[y++]=c>>16&255, w[y++]=c>>8&255, w[y++]=255&c;}if(null!==r){if(r<0||65535<r)throw"Loop count invalid.";w[y++]=33, w[y++]=255, w[y++]=11, w[y++]=78, w[y++]=69, w[y++]=84, w[y++]=83, w[y++]=67, w[y++]=65, w[y++]=80, w[y++]=69, w[y++]=50, w[y++]=46, w[y++]=48, w[y++]=3, w[y++]=1, w[y++]=255&r, w[y++]=r>>8&255, w[y++]=0;}var x=!1;this.addFrame=function(t,e,n,r,i,o){if(!0===x&&(--y, x=!1), o=void 0===o?{}
21715:o, t<0||e<0||65535<t||65535<e)throw"x/y invalid.";if(n<=0||r<=0||65535<n||65535<r)throw"Width/Height invalid.";if(i.length<n*r)throw"Not enough pixels for the frame size.";var a=!0,s=o.palette;if(null==s&&(a=!1, s=v), null==s)throw"Must supply either a local or global palette.";for(var h=b(s),c=0;h>>=1;)++c;h=1<<c;var l=void 0===o.delay?0:o.delay,u=void 0===o.disposal?0:o.disposal;if(u<0||3<u)throw"Disposal out of range.";var f=!1,d=0;if(void 0!==o.transparent&&null!==o.transparent&&(f=!0, (d=o.transparent)<0||h<=d))throw"Transparent color index.";if((0!==u||f||0!==l)&&(w[y++]=33, w[y++]=249, w[y++]=4, w[y++]=u<<2|(!0===f?1:0), w[y++]=255&l, w[y++]=l>>8&255, w[y++]=d, w[y++]=0), w[y++]=44, w[y++]=255&t, w[y++]=t>>8&255, w[y++]=255&e, w[y++]=e>>8&255, w[y++]=255&n, w[y++]=n>>8&255, w[y++]=255&r, w[y++]=r>>8&255, w[y++]=!0===a?128|c-1:0, !0===a)for(var p=0,g=s.length;p<g;++p){var m=s[p];w[y++]=m>>16&255, w[y++]=m>>8&255, w[y++]=255&m;}y=function(e,n,t,r){e[n++]=t;var i=n++,o=1<<t,a=o-1,s=o+1,h=s+1,c=t+1,l=0,u=0;function f(t){for(;t<=l;)e[n++]=255&u, u>>=8, l-=8, n===i+256&&(e[i]=255, i=n++);}function d(t){u|=t<<l, l+=c, f(8);}var p=r[0]&a,g={};d(o);for(var m=1,w=r.length;m<w;++m){var y=r[m]&a,v=p<<8|y,b=g[v];if(void 0===b){for(u|=p<<l, l+=c;8<=l;)e[n++]=255&u, u>>=8, l-=8, n===i+256&&(e[i]=255, i=n++);4096===h?(d(o), h=s+1, c=t+1, g={}):(1<<c<=h&&++c, g[v]=h++), p=y;}else p=b;}return d(p), d(s), f(1), i+1===n?e[i]=0:(e[i]=n-i-1, e[n++]=0), n}(w,y,c<2?2:c,i);}, this.end=function(){return!1===x&&(w[y++]=59, x=!0), y};}, exports.GifReader=mt;}catch(t){}
21716/*
21717    Copyright (c) 2008, Adobe Systems Incorporated
21718    All rights reserved.
21719
21720    Redistribution and use in source and binary forms, with or without 
21721    modification, are permitted provided that the following conditions are
21722    met:
21723
21724    * Redistributions of source code must retain the above copyright notice, 
21725      this list of conditions and the following disclaimer.
21726    
21727    * Redistributions in binary form must reproduce the above copyright
21728      notice, this list of conditions and the following disclaimer in the 
21729      documentation and/or other materials provided with the distribution.
21730    
21731    * Neither the name of Adobe Systems Incorporated nor the names of its 
21732      contributors may be used to endorse or promote products derived from 
21733      this software without specific prior written permission.
21734
21735    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21736    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21737    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21738    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
21739    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21740    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21741    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21742    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21743    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21744    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21745    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21746  */function yt(t){var S,k,_,A,e,u=Math.floor,I=new Array(64),C=new Array(64),T=new Array(64),F=new Array(64),w=new Array(65535),y=new Array(65535),Q=new Array(64),v=new Array(64),P=[],E=0,q=7,O=new Array(64),B=new Array(64),R=new Array(64),n=new Array(256),j=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],D=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],N=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],z=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[], i[e[r]][0]=n, i[e[r]][1]=o, r++, n++;n*=2;}return i}function G(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(E|=1<<q), n--, --q<0&&(255==E?(V(255), V(0)):V(E), q=7, E=0);}function V(t){P.push(t);}function Y(t){V(t>>8&255), V(255&t);}function X(t,e,n,r,i){for(var o,a=i[0],s=i[240],h=function(t,e){var n,r,i,o,a,s,h,c,l,u,f=0;for(l=0;l<8;++l){n=t[f], r=t[f+1], i=t[f+2], o=t[f+3], a=t[f+4], s=t[f+5], h=t[f+6];var d=n+(c=t[f+7]),p=n-c,g=r+h,m=r-h,w=i+s,y=i-s,v=o+a,b=o-a,x=d+v,S=d-v,k=g+w,_=g-w;t[f]=x+k, t[f+4]=x-k;var A=.707106781*(_+S);t[f+2]=S+A, t[f+6]=S-A;var I=.382683433*((x=b+y)-(_=m+p)),C=.5411961*x+I,T=1.306562965*_+I,F=.707106781*(k=y+m),P=p+F,E=p-F;t[f+5]=E+C, t[f+3]=E-C, t[f+1]=P+T, t[f+7]=P-T, f+=8;}for(l=f=0;l<8;++l){n=t[f], r=t[f+8], i=t[f+16], o=t[f+24], a=t[f+32], s=t[f+40], h=t[f+48];var q=n+(c=t[f+56]),O=n-c,B=r+h,R=r-h,j=i+s,D=i-s,M=o+a,U=o-a,N=q+M,z=q-M,L=B+j,H=B-j;t[f]=N+L, t[f+32]=N-L;var W=.707106781*(H+z);t[f+16]=z+W, t[f+48]=z-W;var G=.382683433*((N=U+D)-(H=R+O)),V=.5411961*N+G,Y=1.306562965*H+G,X=.707106781*(L=D+R),J=O+X,K=O-X;t[f+40]=K+V, t[f+24]=K-V, t[f+8]=J+Y, t[f+56]=J-Y, f++;}for(l=0;l<64;++l)u=t[l]*e[l], Q[l]=0<u?u+.5|0:u-.5|0;return Q}(t,e),c=0;c<64;++c)v[b[c]]=h[c];var l=v[0]-n;n=v[0], 0==l?G(r[0]):(G(r[y[o=32767+l]]), G(w[o]));for(var u=63;0<u&&0==v[u];u--);if(0==u)return G(a), n;for(var f,d=1;d<=u;){for(var p=d;0==v[d]&&d<=u;++d);var g=d-p;if(16<=g){f=g>>4;
21746for(var m=1;m<=f;++m)G(s);g&=15;}o=32767+v[d], G(i[(g<<4)+y[o]]), G(w[o]), d++;}return 63!=u&&G(a), n}function J(t){if(t<=0&&(t=1), 100<t&&(t=100), e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=u((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255), I[b[n]]=r;}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=u((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255), C[b[o]]=a;}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],h=0,c=0;c<8;c++)for(var l=0;l<8;l++)T[h]=1/(I[b[h]]*s[c]*s[l]*8), F[h]=1/(C[b[h]]*s[c]*s[l]*8), h++;})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)), e=t;}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&J(e), P=new Array, E=0, q=7, Y(65496), Y(65504), Y(16), V(74), V(70), V(73), V(70), V(0), V(1), V(1), V(0), Y(1), Y(1), V(0), V(0), function(){Y(65499), Y(132), V(0);for(var t=0;t<64;t++)V(I[t]);V(1);for(var e=0;e<64;e++)V(C[e]);}(), n=t.width, r=t.height, Y(65472), Y(17), V(8), Y(r), Y(n), V(3), V(1), V(17), V(0), V(2), V(17), V(1), V(3), V(17), V(1), function(){Y(65476), Y(418), V(0);for(var t=0;t<16;t++)V(D[t+1]);for(var e=0;e<=11;e++)V(M[e]);V(16);for(var n=0;n<16;n++)V(U[n+1]);for(var r=0;r<=161;r++)V(N[r]);V(1);for(var i=0;i<16;i++)V(z[i+1]);for(var o=0;o<=11;o++)V(L[o]);V(17);for(var a=0;a<16;a++)V(H[a+1]);for(var s=0;s<=161;s++)V(W[s]);}(), Y(65498), Y(12), V(3), V(1), V(0), V(2), V(17), V(3), V(17), V(0), V(63), V(0);var i=0,o=0,a=0;E=0, q=7, this.encode.displayName="_encode_";for(var s,h,c,l,u,f,d,p,g,m=t.data,w=t.width,y=t.height,v=4*w,b=0;b<y;){for(s=0;s<v;){for(f=u=v*b+s, d=-1, g=p=0;g<64;g++)f=u+(p=g>>3)*v+(d=4*(7&g)), y<=b+p&&(f-=v*(b+1+p-y)), v<=s+d&&(f-=s+d-v+4), h=m[f++], c=m[f++], l=m[f++], O[g]=(j[h]+j[c+256>>0]+j[l+512>>0]>>16)-128, B[g]=(j[h+768>>0]+j[c+1024>>0]+j[l+1280>>0]>>16)-128, R[g]=(j[h+1280>>0]+j[c+1536>>0]+j[l+1792>>0]>>16)-128;i=X(O,T,i,S,_), o=X(B,F,o,k,A), a=X(R,F,a,k,A), s+=32;}b+=8;}if(0<=q){var x=[];x[1]=q+1, x[0]=(1<<q+1)-1, G(x);}return Y(65497), new Uint8Array(P)}, function(){(new Date).getTime();t||(t=50), function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e);}(), S=r(D,M), k=r(z,L), _=r(U,N), A=r(H,W), function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)y[32767+r]=n, w[32767+r]=[], w[32767+r][1]=n, w[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)y[32767+i]=n, w[32767+i]=[], w[32767+i][1]=n, w[32767+i][0]=e-1+i;t<<=1, e<<=1;}}(), function(){for(var t=0;t<256;t++)j[t]=19595*t, j[t+256>>0]=38470*t, j[t+512>>0]=7471*t+32768, j[t+768>>0]=-11059*t, j[t+1024>>0]=-21709*t, j[t+1280>>0]=32768*t+8421375, j[t+1536>>0]=-27439*t, j[t+1792>>0]=-5329*t;}(), J(t), (new Date).getTime();}();}try{module.exports=yt;}catch(t){}function xt(t,e){if(this.pos=0, this.buffer=t, this.datav=new DataView(t.buffer), this.is_with_alpha=!!e, this.bottom_up=!0, this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]), this.pos+=2, -1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(), this.parseBGR();}xt.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0), this.pos+=4, this.reserved=this.datav.getUint32(this.pos,!0), this.pos+=4, this.offset=this.datav.getUint32(this.pos,!0), this.pos+=4, this.headerSize=this.datav.getUint32(this.pos,!0), this.pos+=4, this.width=this.datav.getUint32(this.pos,!0), this.pos+=4, this.height=this.datav.getInt32(this.pos,!0), this.pos+=4, this.planes=this.datav.getUint16(this.pos,!0), this.pos+=2, this.bitPP=this.datav.getUint16(this.pos,!0), this.pos+=2, this.compress=this.datav.getUint32(this.pos,!0), this.pos+=4, this.rawSize=this.datav.getUint32(this.pos,!0), this.pos+=4, this.hr=this.datav.getUint32(this.pos,!0), this.pos+=4, this.vr=this.datav.getUint32(this.pos,!0), this.pos+=4, this.colors=this.datav.getUint32(this.pos,!0), this.pos+=4, this.importantColors=this.datav.getUint32(this.pos,!0), this.pos+=4, 16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15), this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:o};}}this.height<0&&(this.height*=-1, this.bottom_up=!1);}, xt.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e), this[t]();}catch(t){console.log("bit decode error:"+t);}}, xt.prototype.bit1=function(){var t=Math.ceil(this.width/8),e=t%4,n=0<=this.height?this.height-1:-this.height;for(n=this.height-1;0<=n;
vendor: 5,338 bytes, lines 21746-21791
21746n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var h=this.palette[o>>7-s&1];this.data[a+4*s]=h.blue, this.data[a+4*s+1]=h.green, this.data[a+4*s+2]=h.red, this.data[a+4*s+3]=255;}0!=e&&(this.pos+=4-e);}}, xt.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,s=o>>4,h=15&o,c=this.palette[s];if(this.data[a]=c.blue, this.data[a+1]=c.green, this.data[a+2]=c.red, this.data[a+3]=255, 2*i+1>=this.width)break;c=this.palette[h], this.data[a+4]=c.blue, this.data[a+4+1]=c.green, this.data[a+4+2]=c.red, this.data[a+4+3]=255;}0!=e&&(this.pos+=4-e);}}, xt.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;0<=e;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[o]=a.red, this.data[o+1]=a.green, this.data[o+2]=a.blue, this.data[o+3]=255;}else this.data[o]=255, this.data[o+1]=255, this.data[o+2]=255, this.data[o+3]=255;}0!=t&&(this.pos+=4-t);}}, xt.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&e)/e*255|0,s=(o>>5&e)/e*255|0,h=(o>>10&e)/e*255|0,c=o>>15?255:0,l=r*this.width*4+4*i;this.data[l]=h, this.data[l+1]=s, this.data[l+2]=a, this.data[l+3]=c;}this.pos+=t;}}, xt.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var i=this.bottom_up?r:this.height-1-r,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&e)/e*255|0,h=(a>>5&n)/n*255|0,c=(a>>11)/e*255|0,l=i*this.width*4+4*o;this.data[l]=c, this.data[l+1]=h, this.data[l+2]=s, this.data[l+3]=255;}this.pos+=t;}}, xt.prototype.bit24=function(){for(var t=this.height-1;0<=t;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*n;this.data[a]=o, this.data[a+1]=i, this.data[a+2]=r, this.data[a+3]=255;}this.pos+=this.width%4;}}, xt.prototype.bit32=function(){for(var t=this.height-1;0<=t;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=o, this.data[s+1]=i, this.data[s+2]=r, this.data[s+3]=a;}}, xt.prototype.getData=function(){return this.data};try{module.exports=function(t){var e=new xt(t);return{data:e.getData(),width:e.width,height:e.height}};}catch(t){}
21747/*
21748   Copyright (c) 2013 Gildas Lormeau. All rights reserved.
21749
21750   Redistribution and use in source and binary forms, with or without
21751   modification, are permitted provided that the following conditions are met:
21752
21753   1. Redistributions of source code must retain the above copyright notice,
21754   this list of conditions and the following disclaimer.
21755
21756   2. Redistributions in binary form must reproduce the above copyright 
21757   notice, this list of conditions and the following disclaimer in 
21758   the documentation and/or other materials provided with the distribution.
21759
21760   3. The names of the authors may not be used to endorse or promote products
21761   derived from this software without specific prior written permission.
21762
21763   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
21764   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21765   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21766   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21767   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21768   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21769   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21770   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21771   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21772   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21773   */
21774/*
21775   Copyright (c) 2013 Gildas Lormeau. All rights reserved.
21776
21777   Redistribution and use in source and binary forms, with or without
21778   modification, are permitted provided that the following conditions are met:
21779
21780   1. Redistributions of source code must retain the above copyright notice,
21781   this list of conditions and the following disclaimer.
21782
21783   2. Redistributions in binary form must reproduce the above copyright 
21784   notice, this list of conditions and the following disclaimer in 
21785   the documentation and/or other materials provided with the distribution.
21786
21787   3. The names of the authors may not be used to endorse or promote products
21788   derived from this software without specific prior written permission.
21789
21790   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
21791   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21792   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21793   INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21794   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21795   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21796   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21797   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21798   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21799   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21800   */
21801!function(t){var p=15,g=573,e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ut(){var d=this;function h(t,e){for(var n=0;n|=1&t, t>>>=1, n<<=1, 0<--e;);return n>>>1}d.build_tree=function(t){var e,n,r,i=d.dyn_tree,o=d.stat_desc.static_tree,a=d.stat_desc.elems,s=-1;for(t.heap_len=0, t.heap_max=g, e=0;e<a;e++)0!==i[2*e]?(t.heap[++t.heap_len]=s=e, t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=s<2?++s:0)]=1, t.depth[r]=0, t.opt_len--, o&&(t.static_len-=o[2*r+1]);for(d.max_code=s, e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(r=a;e=t.heap[1], t.heap[1]=t.heap[t.heap_len--], t.pqdownheap(i,1), n=t.heap[1], t.heap[--t.heap_max]=e, t.heap[--t.heap_max]=n, i[2*r]=i[2*e]+i[2*n], t.depth[r]=Math.max(t.depth[e],t.depth[n])+1, i[2*e+1]=i[2*n+1]=r, t.heap[1]=r++, t.pqdownheap(i,1), 2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1], function(t){var e,n,r,i,o,a,s=d.dyn_tree,h=d.stat_desc.static_tree,c=d.stat_desc.extra_bits,l=d.stat_desc.extra_base,u=d.stat_desc.max_length,f=0;for(i=0;i<=p;i++)t.bl_count[i]=0;for(s[2*t.heap[t.heap_max]+1]=0, e=t.heap_max+1;e<g;e++)u<(i=s[2*s[2*(n=t.heap[e])+1]+1]+1)&&(i=u, f++), s[2*n+1]=i, n>d.max_code||(t.bl_count[i]++, o=0, l<=n&&(o=c[n-l]), a=s[2*n], t.opt_len+=a*(i+o), h&&(t.static_len+=a*(h[2*n+1]+o)));if(0!==f){do{for(i=u-1;0===t.bl_count[i];)i--;t.bl_count[i]--, t.bl_count[i+1]+=2, t.bl_count[u]--, f-=2;}while(0<f);for(i=u;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--e])>d.max_code||(s[2*r+1]!=i&&(t.opt_len+=(i-s[2*r+1])*s[2*r], s[2*r+1]=i), n--);}}(t), function(t,e,n){var r,i,o,a=[],s=0;for(r=1;r<=p;r++)a[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=h(a[o]++,o));}(i,d.max_code,t.bl_count);};}function ft(t,e,n,r,i){var o=this;o.static_tree=t, o.extra_bits=e, o.extra_base=n, o.elems=r, o.max_length=i;}ut._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28], ut.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0], ut.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576], ut.d_code=function(t){return t<256?e[t]:e[256+(t>>
21801>7)]}, ut.extra_lbits=[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], ut.extra_dbits=[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], ut.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7], ut.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15], ft.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8], ft.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5], ft.static_l_desc=new ft(ft.static_ltree,ut.extra_lbits,257,286,p), ft.static_d_desc=new ft(ft.static_dtree,ut.extra_dbits,0,30,p), ft.static_bl_desc=new ft(null,ut.extra_blbits,0,19,7);function n(t,e,n,r,i){var o=this;o.good_length=t, o.max_lazy=e, o.nice_length=n, o.max_chain=r, o.func=i;}var dt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],pt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],gt=262;function mt(t,e,n,r){var i=t[2*e],o=t[2*n];return i<o||i==o&&r[e]<=r[n]}function r(){var h,c,l,u,f,d,p,g,i,m,w,y,v,a,b,x,S,k,_,A,I,C,T,F,P,E,q,O,B,R,s,j,D,M,U,N,z,o,L,H,W,G=this,V=new ut,Y=new ut,X=new ut;function J(){var t;for(t=0;t<286;t++)s[2*t]=0;for(t=0;t<30;t++)j[2*t]=0;for(t=0;t<19;t++)D[2*t]=0;s[512]=1, G.opt_len=G.static_len=0, N=o=0;}function K(t,e){var n,r,i=-1,o=t[1],a=0,s=7,h=4;for(0===o&&(s=138, h=3), t[2*(e+1)+1]=65535, n=0;n<=e;n++)r=o, o=t[2*(n+1)+1], ++a<s&&r==o||(a<h?D[2*r]+=a:0!==r?(r!=i&&D[2*r]++, D[32]++):a<=10?D[34]++:D[36]++, i=r, (a=0)===o?(s=138, h=3):r==o?(s=6, h=3):(s=7, h=4));}function Q(t){G.pending_buf[G.pending++]=t;}function Z(t){Q(255&t), Q(t>>>8&255);}function $(t,e){var n,r=e;16-r<W?(Z(H|=(n=t)<<W&65535), H=n>>>16-W, W+=r-16):(H|=t<<W&65535, W+=r);}function tt(t,e){var n=2*t;$(65535&e[n],65535&e[n+1]);}function et(t,e){var n,r,i=-1,o=t[1],a=0,s=7,h=4;for(0===o&&(s=138, h=3), n=0;n<=e;n++)if(r=o, o=t[2*(n+1)+1], !(++a<s&&r==o)){if(a<h)for(;tt(r,D), 0!=--a;);else 0!==r?(r!=i&&(tt(r,D), a--), tt(16,D), $(a-3,2)):a<=10?(tt(17,D), $(a-3,3)):(tt(18,D), $(a-11,7));i=r, (a=0)===o?(s=138, h=3):r==o?(s=6, h=3):(s=7, h=4);}}function nt(){16==W?(Z(H), W=H=0):8<=W&&(Q(255&H), H>>>=8, W-=8);}function rt(t,e){var n,r,i;if(G.pending_buf[z+2*N]=t>>>8&255, G.pending_buf[z+2*N+1]=255&t, G.pending_buf[M+N]=255&e, N++, 0===t?s[2*e]++:(o++, t--, s[2*(ut._length_code[e]+256+1)]++, j[2*ut.d_code(t)]++), 0==(8191&N)&&2<q){for(n=8*N, r
21801=I-S, i=0;i<30;i++)n+=j[2*i]*(5+ut.extra_dbits[i]);if(n>>>=3, o<Math.floor(N/2)&&n<Math.floor(r/2))return!0}return N==U-1}function it(t,e){var n,r,i,o,a=0;if(0!==N)for(;n=G.pending_buf[z+2*a]<<8&65280|255&G.pending_buf[z+2*a+1], r=255&G.pending_buf[M+a], a++, 0===n?tt(r,t):(tt((i=ut._length_code[r])+256+1,t), 0!==(o=ut.extra_lbits[i])&&$(r-=ut.base_length[i],o), tt(i=ut.d_code(--n),e), 0!==(o=ut.extra_dbits[i])&&$(n-=ut.base_dist[i],o)), a<N;);tt(256,t), L=t[513];}function ot(){8<W?Z(H):0<W&&Q(255&H), W=H=0;}function at(t,e,n){var r,i,o;$(0+(n?1:0),3), r=t, i=e, o=!0, ot(), L=8, o&&(Z(i), Z(~i)), G.pending_buf.set(g.subarray(r,r+i),G.pending), G.pending+=i;}function e(t,e,n){var r,i,o=0;0<q?(V.build_tree(G), Y.build_tree(G), o=function(){var t;for(K(s,V.max_code), K(j,Y.max_code), X.build_tree(G), t=18;3<=t&&0===D[2*ut.bl_order[t]+1];t--);return G.opt_len+=3*(t+1)+5+5+4, t}(), r=G.opt_len+3+7>>>3, (i=G.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5, e+4<=r&&-1!=t?at(t,e,n):i==r?($(2+(n?1:0),3), it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3), function(t,e,n){var r;for($(t-257,5), $(e-1,5), $(n-4,4), r=0;r<n;r++)$(D[2*ut.bl_order[r]+1],3);et(s,t-1), et(j,e-1);}(V.max_code+1,Y.max_code+1,o+1), it(s,j)), J(), n&&ot();}function st(t){e(0<=S?S:-1,I-S,t), S=I, h.flush_pending();}function ht(){var t,e,n,r;do{if(0===(r=i-T-I)&&0===I&&0===T)r=f;else if(-1==r)r--;else if(f+f-gt<=I){for(g.set(g.subarray(f,f+f),0), C-=f, I-=f, S-=f, n=t=v;e=65535&w[--n], w[n]=f<=e?e-f:0, 0!=--t;);for(n=t=f;e=65535&m[--n], m[n]=f<=e?e-f:0, 0!=--t;);r+=f;}if(0===h.avail_in)return;t=h.read_buf(g,I+T,r), 3<=(T+=t)&&(y=((y=255&g[I])<<x^255&g[I+1])&b);}while(T<gt&&0!==h.avail_in)}function ct(t){var e,n,r=P,i=I,o=F,a=f-gt<I?I-(f-gt):0,s=R,h=p,c=I+258,l=g[i+o-1],u=g[i+o];B<=F&&(r>>=2), T<s&&(s=T);do{if(g[(e=t)+o]==u&&g[e+o-1]==l&&g[e]==g[i]&&g[++e]==g[i+1]){i+=2, e++;do{}while(g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&g[++i]==g[++e]&&i<c);if(n=258-(c-i), i=c-258, o<n){if(C=t, s<=(o=n))break;l=g[i+o-1], u=g[i+o];}}}while((t=65535&m[t&h])>a&&0!=--r);return o<=T?o:T}function lt(t){return t.total_in=t.total_out=0, t.msg=null, G.pending=0, G.pending_out=0, c=113, u=0, V.dyn_tree=s, V.stat_desc=ft.static_l_desc, Y.dyn_tree=j, Y.stat_desc=ft.static_d_desc, X.dyn_tree=D, X.stat_desc=ft.static_bl_desc, W=H=0, L=8, J(), function(){var t;for(i=2*f, t=w[v-1]=0;t<v-1;t++)w[t]=0;E=dt[q].max_lazy, B=dt[q].good_length, R=dt[q].nice_length, P=dt[q].max_chain, k=F=2, y=A=T=S=I=0;}(), 0}G.depth=[], G.bl_count=[], G.heap=[], s=[], j=[], D=[], G.pqdownheap=function(t,e){for(var n=G.heap,r=n[e],i=e<<1;i<=G.heap_len&&(i<G.heap_len&&mt(t,n[i+1],n[i],G.depth)&&i++, !mt(t,r,n[i],G.depth));)n[e]=n[i], e=i, i<<=1;n[e]=r;}, G.deflateInit=function(t,e,n,r,i,o){return r||(r=8), i||(i=8), o||(o=0), t.msg=null, -1==e&&(e=6), i<1||9<i||8!=r||n<9||15<n||e<0||9<e||o<0||2<o?-2:(t.dstate=G, p=(f=1<<(d=n))-1, b=(v=1<<(a=i+7))-1, x=Math.floor((a+3-1)/3), g=new Uint8Array(2*f), m=[], w=[], U=1<<i+6, G.pending_buf=new Uint8Array(4*U), l=4*U, z=Math.floor(U/2), M=3*U, q=e, O=o, lt(t))}, G.deflateEnd=function(){return 42!=c&&113!=c&&666!=c?-2:(G.pending_buf=null, g=m=w=null, G.dstate=null, 113==c?-3:0)}, G.deflateParams=function(t,e,n){var r=0;return-1==e&&(e=6), e<0||9<e||n<0||2<n?-2:(dt[q].func!=dt[e].func&&0!==t.total_in&&(r=t.deflate(1)), q!=e&&(E=dt[q=e].max_lazy, B=dt[q].good_length, R=dt[q].nice_length, P=dt[q].max_chain), O=n, r)}, G.deflateSetDictionary=function(t,e,n){var r,i=n,o=0;if(!e||42!=c)return-2;if(i<3)return 0;for(f-gt<i&&(o=n-(i=f-gt)), g.set(e.subarray(o,o+i),0), S=I=i, y=((y=255&g[0])<<x^255&g[1])&b, r=0;r<=i-3;r++)y=(y<<x^255&g[r+2])&b, m[r&p]=w[y], w[y]=r;return 0}, G.deflate=function(t,e){var n,r,i,o,a,s;if(4<e||e<0)return-2;if(!t.next_out||!t.next_in&&0!==t.avail_in||666==c&&4!=e)return t.msg=pt[4], -2;if(0===t.avail_out)return t.msg=pt[7], -5;if(h=t, o=u, u=e, 42==c&&(r=8+(d-8<<4)<<8, 3<(i=(q-1&255)>>1)&&(i=3), r|=i<<6, 0!==I&&(r|=32), c=113, Q((s=r+=31-r%31)>>8&255), Q(255&s)), 0!==G.pending){if(h.flush_pending(), 0===h.avail_out)return u=-1, 0}else if(0===h.avail_in&&e<=o&&4!=e)return h.msg=pt[7], -5;if(666==c&&0!==h.avail_in)return t.msg=pt[7], -5;if(0!==h.avail_in||0!==T||0!=e&&666!=c){switch(a=-1, dt[q].func){case 0:a=function(t){var e,n=65535;for(l-5<n&&(n=l-5);;){if(T<=1){if(ht(), 0===T&&0==t)return 0;if(0===T)break}if(I+=T, e=S+n, ((T=0)===I||e<=I)&&(T=I-e, I=e, st(!1), 0===h.avail_out))return 0;if(f-gt<=I-S&&(st(!1), 0===h.avail_out))return 0}return st(4==t), 0===h.avail_out?4==t?2:0:4==t?3:1}(e);break;case 1:a=function(t){for(var e,n=0;;){if(T<gt){if(ht(), T<gt&&0==t)return 0;if(0===T)break}if(3<=T&&(y=(y<<x^255&g[I+2])&b, n=65535&w[y], m[I&p]=w[y], w[y]=I), 0!==n&&(I-n&65535)<=f-gt&&2!=O&&(k=ct(n)), 3<=k)if(e=rt(I-C,k-3), T-=k, k<=E&&3<=T){for(k--;y=(y<<x^255&g[++I+2])&b, n=65535&w[y], m[I&p]=w[y], w[y]=I, 0!=--k;);I++;}else I+=k, k=0, y=((y=255&g[I])<<x^255&g[I+1])&b;else e=rt(0,255&g[I]), T--, I++;if(e&&(st(!1), 0===h.avail_out))return 0}return st(4==t), 0===h.avail_out?4==t?2:0:4==t?3:1}(e);break;case 2:a=function(t){for(var e,n,r=0;;){if(T<gt){if(ht(), T<gt&&0==t)return 0;if(0===T)break}if(3<=T&&(y=(y<<x^255&g[I+2])&b, r=65535&w[y], m[I&p]=w[y], w[y]=I), F=k, _=C, k=2, 0!==r&&F<E&&(I-r&65535)<=f-gt&&(2!=O&&(k=ct(r)), k<=5&&(1==O||3==k&&4096<I-C)&&(k=2)), 3<=F&&k<=F){for(n=I+T-3, e=rt(I-1-_,F-3), T-=F-1, F-=2;++I<=n&&(y=(y<<x^255&g[I+2])&b, r=65535&w[y], m[I&p]=w[y], w[y]=I), 0!=--F;);if(A=0, k=2, I++, e&&(st(!1), 0===h.avail_out))return 0}else if(0!==A){if((e=rt(0,255&g[I-1]))&&st(!1), I++, T--, 0===h.avail_out)return 0}else A=1, I++, T--;}return 0!==A&&(e=rt(0,255&g[I-1]), A=0), st(4==t), 0===h.avail_out?4==t?2:0:4==t?3:1}(e);}if(2!=a&&3!=a||(c=666), 0==a||2==a)return 0===h.avail_out&&(u=-1), 0;if(1==a){if(1==e)$(2,3), tt(256,ft.static_ltree), nt(), 1+L+10-W<9&&($(2,3), tt(256,ft.static_ltree), nt()), L=7;else if(at(0,0,!1), 3==e)for(n=0;n<v;n++)w[n]=0;if(h.flush_pending(), 0===h.avail_out)return u=-1, 0}}return 4!=e?0:1};}function i(){var t=this;t.next_in_index=0, t.next_out_index=0, t.avail_in=0, t.total_in=0, t.avail_out=0, t.total_out=0;}i.prototype={deflateInit:function(t,e){return this.dstate=new r, e||(e=p), this.dstate.deflateInit(this,t,e)},deflate:function(t){return this.dstate?this.dstate.deflate(this,t):-2},deflateEnd:function(){if(!this.dstate)return-2;var t=this.dstate.deflateEnd();return this.dstate=null, t},deflateParams:function(t,e){return this.dstate?this.dstate.deflateParams(this,t,e):-2},deflateSetDictionary:function(t,e){return this.dstate?this.dstate.deflateSetDictionary(this,t,e):-2},read_buf:function(t,e,n){var r=this,i=r.avail_in;return n<i&&(i=n), 0===i?0:(r.avail_in-=i, t.set(r.next_in.subarray(r.next_in_index,r.next_in_index+i),e), r.next_in_index+=i, r.total_in+=i, i)},flush_pending:function(){var t=this,e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out), 0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index), t.next_out_index+=e, t.dstate.pending_out+=e, t.total_out+=e, t.avail_out-=e, t.dstate.pending-=e, 0===t.dstate.pending&&(t.dstate.pending_out=0));}};var o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var s=new i,h=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1), s.deflateInit(e), s.next_out=h, this.append=function(t,e){var n,r=[],i=0,o=0,a=0;if(t.length){s.next_in_index=0, s.next_in=t, s.avail_in=t.length;do{if(s.next_out_index=0, s.avail_out=512, 0!=s.deflate(0))throw new Error("deflating: "+s.msg);s.next_out_index&&(512==s.next_out_index?r.push(new Uint8Array(h)):r.push(new Uint8Array(h.subarray(0,s.next_out_index)))), a+=s.next_out_index, e&&0<s.next_in_index&&s.next_in_index!=i&&(e(s.next_in_index), i=s.next_in_index);}while(0<s.avail_in||0===s.avail_out);return n=new Uint8Array(a), r.forEach(function(t){n.set(t,o), o+=t.length;}), n}}, this.flush=function(){var t,e,n=[],r=0,i=0;do{if(s.next_out_index=0, s.avail_out=512, 1!=(t=s.deflate(4))&&0!=t)throw new Error("deflating: "+s.msg);0<512-s.avail_out&&n.push(new Uint8Array(h.subarray(0,s.next_out_index))), i+=s.next_out_index;}while(0<s.avail_in||0===s.avail_out);
21801return s.deflateEnd(), e=new Uint8Array(i), n.forEach(function(t){e.set(t,r), r+=t.length;}), e};};}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), function(t){function f(t){var e;this.ok=!1, "#"==t.charAt(0)&&(t=t.substr(1,6)), t=(t=t.replace(/ /g,"")).toLowerCase();var l={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee9
218010",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var n in l)t==n&&(t=l[n]);for(var u=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<u.length;r++){var i=u[r].re,o=u[r].process,a=i.exec(t);a&&(e=o(a), this.r=e[0], this.g=e[1], this.b=e[2], this.ok=!0);}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r, this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g, this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b, this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"}, this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t), 1==e.length&&(e="0"+e), 1==n.length&&(n="0"+n), "#"+t+e+n}, this.getHelpXML=function(){for(var t=new Array,e=0;e<u.length;e++)for(var n=u[e].example,r=0;r<n.length;r++)t[t.length]=n[r];for(var i in l)t[t.length]=i;var o=document.createElement("ul");o.setAttribute("id","rgbcolor-examples");for(e=0;e<t.length;e++)try{var a=document.createElement("li"),s=new f(t[e]),h=document.createElement("div");h.style.cssText="margin: 3px; border: 1px solid black; background:"+s.toHex()+"; color:"+s.toHex(), h.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+t[e]+" -> "+s.toRGB()+" -> "+s.toHex());a.appendChild(h), a.appendChild(c), o.appendChild(a);}catch(t){}return o};}"undefined"!=typeof undefined&&undefined.amd?undefined("RGBColor",function(){return f}):"undefined"!='object'&&module.exports&&(module.exports=f), t.RGBColor=f;}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), function(t){module.exports=t();}(function(){return function o(a,s,h){function c(n,t){if(!s[n]){if(!a[n]){var e="function"==typeof commonjsRequire&&commonjsRequire;if(!t&&e)return e(n,!0);if(l)return l(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND", r}var i=s[n]={exports:{}};a[n][0].call(i.exports,function(t){var e=a[n][1][t];return c(e||t)},i,i.exports,o,a,s,h);}return s[n].exports}for(var l="function"==typeof commonjsRequire&&commonjsRequire,t=0;t<h.length;t++)c(h[t]);return c}({1:[function(t,q,O){(function(E){!function(t){var e="object"==typeof O&&O,n="object"==typeof q&&q&&q.exports==e&&q,r="object"==typeof E&&E;r.global!==r&&r.window!==r||(t=r);var i,o,w=2147483647,y=36,v=1,b=26,a=38,s=700,x=72,S=128,k="-",h=/^xn--/,c=/[^ -~]/,l=/\x2E|\u3002|\uFF0E|\uFF61/g,u={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >
21801= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=y-v,_=Math.floor,A=String.fromCharCode;function I(t){throw RangeError(u[t])}function d(t,e){for(var n=t.length;n--;)t[n]=e(t[n]);return t}function p(t,e){return d(t.split(l),e).join(".")}function C(t){for(var e,n,r=[],i=0,o=t.length;i<o;)55296<=(e=t.charCodeAt(i++))&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e), i--):r.push(e);return r}function T(t){return d(t,function(t){var e="";return 65535<t&&(e+=A((t-=65536)>>>10&1023|55296), t=56320|1023&t), e+=A(t)}).join("")}function F(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function P(t,e,n){var r=0;for(t=n?_(t/s):t>>1, t+=_(t/e);f*b>>1<t;r+=y)t=_(t/f);return _(r+(f+1)*t/(t+a))}function g(t){var e,n,r,i,o,a,s,h,c,l,u,f=[],d=t.length,p=0,g=S,m=x;for((n=t.lastIndexOf(k))<0&&(n=0), r=0;r<n;++r)128<=t.charCodeAt(r)&&I("not-basic"), f.push(t.charCodeAt(r));for(i=0<n?n+1:0;i<d;){for(o=p, a=1, s=y;d<=i&&I("invalid-input"), u=t.charCodeAt(i++), (y<=(h=u-48<10?u-22:u-65<26?u-65:u-97<26?u-97:y)||h>_((w-p)/a))&&I("overflow"), p+=h*a, !(h<(c=s<=m?v:m+b<=s?b:s-m));s+=y)a>_(w/(l=y-c))&&I("overflow"), a*=l;m=P(p-o,e=f.length+1,0==o), _(p/e)>w-g&&I("overflow"), g+=_(p/e), p%=e, f.splice(p++,0,g);}return T(f)}function m(t){var e,n,r,i,o,a,s,h,c,l,u,f,d,p,g,m=[];for(f=(t=C(t)).length, e=S, o=x, a=n=0;a<f;++a)(u=t[a])<128&&m.push(A(u));for(r=i=m.length, i&&m.push(k);r<f;){for(s=w, a=0;a<f;++a)e<=(u=t[a])&&u<s&&(s=u);for(s-e>_((w-n)/(d=r+1))&&I("overflow"), n+=(s-e)*d, e=s, a=0;a<f;++a)if((u=t[a])<e&&++n>w&&I("overflow"), u==e){for(h=n, c=y;!(h<(l=c<=o?v:o+b<=c?b:c-o));c+=y)g=h-l, p=y-l, m.push(A(F(l+g%p,0))), h=_(g/p);m.push(A(F(h,0))), o=P(n,d,r==i), n=0, ++r;}++n, ++e;}return m.join("")}if(i={version:"1.2.4",ucs2:{decode:C,encode:T},decode:g,encode:m,toASCII:function(t){return p(t,function(t){return c.test(t)?"xn--"+m(t):t})},toUnicode:function(t){return p(t,function(t){return h.test(t)?g(t.slice(4).toLowerCase()):t})}}, e&&!e.nodeType)if(n)n.exports=i;else for(o in i)i.hasOwnProperty(o)&&(e[o]=i[o]);else t.punycode=i;}(this);}).call(this,"undefined"!=typeof commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}],2:[function(t,e,n){var i=t("./log");function u(t,e){for(var n=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),r=t.firstChild;r;)!0!==e&&1===r.nodeType&&"SCRIPT"===r.nodeName||n.appendChild(u(r,e)), r=r.nextSibling;return 1===t.nodeType&&(n._scrollTop=t.scrollTop, n._scrollLeft=t.scrollLeft, "CANVAS"===t.nodeName?function(e,t){try{t&&(t.width=e.width, t.height=e.height, t.getContext("2d").putImageData(e.getContext("2d").getImageData(0,0,e.width,e.height),0,0));}catch(t){i("Unable to copy canvas content from",e,t);}}(t,n):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(n.value=t.value)), n}e.exports=function(o,t,e,n,a,s,h){var c=u(o.documentElement,a.javascriptEnabled),l=t.createElement("iframe");return l.className="html2canvas-container", l.style.visibility="hidden", l.style.position="fixed", l.style.left="-10000px", l.style.top="0px", l.style.border="0", l.width=e, l.height=n, l.scrolling="no", t.body.appendChild(l), new Promise(function(e){var t,n,r,i=l.contentWindow.document;l.contentWindow.onload=l.onload=function(){var t=setInterval(function(){0<i.body.childNodes.length&&(!function t(e){if(1===e.nodeType){e.scrollTop=e._scrollTop, e.scrollLeft=e._scrollLeft;for(var n=e.firstChild;n;)t(n), n=n.nextSibling;}}(i.documentElement), clearInterval(t), "view"===a.type&&(l.contentWindow.scrollTo(s,h), !/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||l.contentWindow.scrollY===h&&l.contentWindow.scrollX===s||(i.documentElement.style.top=-h+"px", i.documentElement.style.left=-s+"px", i.documentElement.style.position="absolute")), e(l));},50);}, i.open(), i.write("<!DOCTYPE html><html></html>"), n=s, r=h, !(t=o).defaultView||n===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(n,r), i.replaceChild(i.adoptNode(c),i.documentElement), i.close();})};},{"./log":13}],3:[function(t,e,n){function r(t){this.r=0, this.g=0, this.b=0, this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t);}r.prototype.darken=function(t){var e=1-t;return new r([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])}, r.prototype.isTransparent=function(){return 0===this.a}, r.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b}, r.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255), this.g=Math.min(t[1],255), this.b=Math.min(t[2],255), 3<t.length&&(this.a=t[3])), Array.isArray(t)};var i=/^#([a-f0-9]{3})$/i;r.prototype.hex3=function(t){var e;return null!==(e=t.match(i))&&(this.r=parseInt(e[1][0]+e[1][0],16), this.g=parseInt(e[1][1]+e[1][1],16), this.b=parseInt(e[1][2]+e[1][2],16)), null!==e};var o=/^#([a-f0-9]{6})$/i;r.prototype.hex6=function(t){var e=null;
21801return null!==(e=t.match(o))&&(this.r=parseInt(e[1].substring(0,2),16), this.g=parseInt(e[1].substring(2,4),16), this.b=parseInt(e[1].substring(4,6),16)), null!==e};var a=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;r.prototype.rgb=function(t){var e;return null!==(e=t.match(a))&&(this.r=Number(e[1]), this.g=Number(e[2]), this.b=Number(e[3])), null!==e};var s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;r.prototype.rgba=function(t){var e;return null!==(e=t.match(s))&&(this.r=Number(e[1]), this.g=Number(e[2]), this.b=Number(e[3]), this.a=Number(e[4])), null!==e}, r.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"}, r.prototype.namedColor=function(t){t=t.toLowerCase();var e=h[t];if(e)this.r=e[0], this.g=e[1], this.b=e[2];else if("transparent"===t)return this.r=this.g=this.b=this.a=0, !0;return!!e}, r.prototype.isColor=!0;var h={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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],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],rebeccapurple:[102,51,153],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]};e.exports=r;},{}],4:[function(t,e,n){var p=t("./support"),d=t("./renderers/canvas"),g=t("./imageloader"),m=t("./nodeparser"),r=t("./nodecontainer"),w=t("./log"),i=t("./utils"),y=t("./clone"),v=t("./proxy").loadUrlDocument,b=i.getBounds,x="data-html2canvas-node",S=0;function o(t,e){var n,r,i=S++;if((e=e||{}).logging&&(w.options.logging=!0, w.options.start=Date.now()), e.async=void 0===e.async||e.async, e.allowTaint=void 0!==e.allowTaint&&e.allowTaint, e.removeContainer=void 0===e.removeContainer||e.removeContainer, e.javascriptEnabled=void 0!==e.javascriptEnabled&&e.javascriptEnabled, e.imageTimeout=void 0===e.imageTimeout?1e4:e.imageTimeout, e.renderer="function"==typeof e.renderer?e.renderer:d, e.strict=!!e.strict, "string"==typeof t){if("string"!=typeof e.proxy)return Promise.reject("Proxy must be used when rendering url");var o=null!=e.width?e.width:window.innerWidth,a=null!=e.height?e.height:window.innerHeight;return v((n=t, r=document.createElement("a"), r.href=n, r.href=r.href, r),e.proxy,document,o,a,e).then(function(t){return k(t.contentWindow.document.documentElement,t,e,o,a)})}var s,h,c,l,u,f=(void 0===t?[document.documentElement]:t.length?t:[t])[0];return f.setAttribute(x+i,i), (s=f.ownerDocument, h=e, c=f.ownerDocument.defaultView.innerWidth, l=f.ownerDocument.defaultView.innerHeight, u=i, y(s,s,c,l,h,s.defaultView.pageXOffset,s.defaultView.pageYOffset).then(function(t){w("Document cloned");var e=x+u,n="["+e+"='"+u+"']";s.querySelector(n).removeAttribute(e);var r=t.contentWindow,i=r.document.querySelector(n),o="function"==typeof h.onclone?Promise.resolve(h.onclone(r.document)):Promise.resolve(!0);return o.then(function(){return k(i,t,h,c,l)})})).then(function(t){return"function"==typeof e.onrendered&&(w("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"), e.onrendered(t)), t})}o.CanvasRenderer=d, o.NodeContainer=r, o.log=w, o.utils=i;var a="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return Promise.reject("No canvas support")}:o;function k(n,r,i,t,e){var o,a,s=r.contentWindow,h=new p(s.document),c=new g(i,h),l=b(n),u="view"===i.type?t:(o=s.document, Math.max(Math.max(o.body.scrollWidth,o.documentElement.scrollWidth),Math.max(o.body.offsetWidth,o.documentElement.offsetWidth),Math.max(o.body.clientWidth,o.documentElement.clientWidth))),f="view"===i.type?e:(a=s.document, Math.max(Math.max(a.body.scrollHeight,a.documentElement.scrollHeight),Math.max(a.body.offsetHeight,a.documentElement.offsetHeight),Math.max(a.body.clientHeight,a.documentElement.clientHeight))),d=new i.renderer(u,f,c,i,document);return new m(n,d,h,c,i).ready.then(function(){var t,e;return w("Finished rendering"), t="view"===i.type?_(d.canvas,{width:d.canvas.width,height:d.canvas.height,top:0,left:0,x:0,y:0}):n===s.document.body||n===s.document.documentElement||null!=i.canvas?d.canvas:_(d.canvas,{width:null!=i.width?i.width:l.width,height:null!=i.height?i.height:l.height,top:l.top,left
21801:l.left,x:0,y:0}), e=r, i.removeContainer&&(e.parentNode.removeChild(e), w("Cleaned up container")), t})}function _(t,e){var n=document.createElement("canvas"),r=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),a=Math.min(t.height,Math.max(1,e.top+e.height));n.width=e.width, n.height=e.height;var s=i-r,h=a-o;return w("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",s,"height:",h), w("Resulting crop with width",e.width,"and height",e.height,"with x",r,"and y",o), n.getContext("2d").drawImage(t,r,o,s,h,e.x,e.y,s,h), n}e.exports=a;},{"./clone":2,"./imageloader":11,"./log":13,"./nodecontainer":14,"./nodeparser":15,"./proxy":16,"./renderers/canvas":20,"./support":22,"./utils":26}],5:[function(t,e,n){var r=t("./log"),i=t("./utils").smallImage;e.exports=function t(e){if(this.src=e, r("DummyImageContainer for",e), !this.promise||!this.image){r("Initiating DummyImageContainer"), t.prototype.image=new Image;var n=this.image;t.prototype.promise=new Promise(function(t,e){n.onload=t, n.onerror=e, n.src=i(), !0===n.complete&&t(n);});}};},{"./log":13,"./utils":26}],6:[function(t,e,n){var h=t("./utils").smallImage;e.exports=function(t,e){var n,r,i=document.createElement("div"),o=document.createElement("img"),a=document.createElement("span"),s="Hidden Text";i.style.visibility="hidden", i.style.fontFamily=t, i.style.fontSize=e, i.style.margin=0, i.style.padding=0, document.body.appendChild(i), o.src=h(), o.width=1, o.height=1, o.style.margin=0, o.style.padding=0, o.style.verticalAlign="baseline", a.style.fontFamily=t, a.style.fontSize=e, a.style.margin=0, a.style.padding=0, a.appendChild(document.createTextNode(s)), i.appendChild(a), i.appendChild(o), n=o.offsetTop-a.offsetTop+1, i.removeChild(a), i.appendChild(document.createTextNode(s)), i.style.lineHeight="normal", o.style.verticalAlign="super", r=o.offsetTop-i.offsetTop+1, document.body.removeChild(i), this.baseline=n, this.lineWidth=1, this.middle=r;};},{"./utils":26}],7:[function(t,e,n){var r=t("./font");function i(){this.data={};}i.prototype.getMetrics=function(t,e){return void 0===this.data[t+"-"+e]&&(this.data[t+"-"+e]=new r(t,e)), this.data[t+"-"+e]}, e.exports=i;},{"./font":6}],8:[function(o,t,e){var a=o("./utils").getBounds,i=o("./proxy").loadUrlDocument;function n(e,t,n){this.image=null, this.src=e;var r=this,i=a(e);this.promise=(t?new Promise(function(t){"about:blank"===e.contentWindow.document.URL||null==e.contentWindow.document.documentElement?e.contentWindow.onload=e.onload=function(){t(e);}:t(e);}):this.proxyLoad(n.proxy,i,n)).then(function(t){return o("./core")(t.contentWindow.document.documentElement,{type:"view",width:t.width,height:t.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return r.image=t});}n.prototype.proxyLoad=function(t,e,n){var r=this.src;return i(r.src,t,r.ownerDocument,e.width,e.height,n)}, t.exports=n;},{"./core":4,"./proxy":16,"./utils":26}],9:[function(t,e,n){function r(t){this.src=t.value, this.colorStops=[], this.type=null, this.x0=.5, this.y0=.5, this.x1=.5, this.y1=.5, this.promise=Promise.resolve(!0);}r.TYPES={LINEAR:1,RADIAL:2}, r.REGEXP_COLORSTOP=/^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i, e.exports=r;},{}],10:[function(t,e,n){e.exports=function(n,r){this.src=n, this.image=new Image;var i=this;this.tainted=null, this.promise=new Promise(function(t,e){i.image.onload=t, i.image.onerror=e, r&&(i.image.crossOrigin="anonymous"), i.image.src=n, !0===i.image.complete&&t(i.image);});};},{}],11:[function(t,e,n){var o=t("./log"),r=t("./imagecontainer"),i=t("./dummyimagecontainer"),a=t("./proxyimagecontainer"),s=t("./framecontainer"),h=t("./svgcontainer"),c=t("./svgnodecontainer"),l=t("./lineargradientcontainer"),u=t("./webkitgradientcontainer"),f=t("./utils").bind;function d(t,e){this.link=null, this.options=t, this.support=e, this.origin=this.getOrigin(window.location.href);}d.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t}
21801,[]).forEach(this.addImage(e,this.loadImage),this), e}, d.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this), t}, d.prototype.addImage=function(n,r){return function(e){e.args.forEach(function(t){this.imageExists(n,t)||(n.splice(0,0,r.call(this,e)), o("Added image #"+n.length,"string"==typeof t?t.substring(0,100):t));},this);}}, d.prototype.hasImageBackground=function(t){return"none"!==t.method}, d.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new r(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||!0===this.options.allowTaint||this.isSVG(e)?new r(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new r(e,!0):this.options.proxy?new a(e,this.options.proxy):new i(e):new h(e)}return"linear-gradient"===t.method?new l(t):"gradient"===t.method?new u(t):"svg"===t.method?new c(t.args[0],this.support.svg):"IFRAME"===t.method?new s(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new i(t)}, d.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||h.prototype.isInline(t)}, d.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})}, d.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin}, d.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));return e.href=t, e.href=e.href, e.protocol+e.hostname+e.port}, d.prototype.getPromise=function(e){return this.timeout(e,this.options.imageTimeout).catch(function(){return new i(e.src).promise.then(function(t){e.image=t;})})}, d.prototype.get=function(e){var n=null;return this.images.some(function(t){return(n=t).src===e})?n:null}, d.prototype.fetch=function(t){return this.images=t.reduce(f(this.findBackgroundImage,this),this.findImages(t)), this.images.forEach(function(e,n){e.promise.then(function(){o("Succesfully loaded image #"+(n+1),e);},function(t){o("Failed loading image #"+(n+1),e,t);});}), this.ready=Promise.all(this.images.map(this.getPromise,this)), o("Finished searching images"), this}, d.prototype.timeout=function(n,r){var i,t=Promise.race([n.promise,new Promise(function(t,e){i=setTimeout(function(){o("Timed out loading image",n), e(n);},r);})]).then(function(t){return clearTimeout(i), t});return t.catch(function(){clearTimeout(i);}), t}, e.exports=d;},{"./dummyimagecontainer":5,"./framecontainer":8,"./imagecontainer":10,"./lineargradientcontainer":12,"./log":13,"./proxyimagecontainer":17,"./svgcontainer":23,"./svgnodecontainer":24,"./utils":26,"./webkitgradientcontainer":27}],12:[function(t,e,n){var i=t("./gradientcontainer"),o=t("./color");function r(t){i.apply(this,arguments), this.type=i.TYPES.LINEAR;var e=r.REGEXP_DIRECTION.test(t.args[0])||!i.REGEXP_COLORSTOP.test(t.args[0]);e?t.args[0].split(/\s+/).reverse().forEach(function(t,e){switch(t){case"left":this.x0=0, this.x1=1;break;case"top":this.y0=0, this.y1=1;break;case"right":this.x0=1, this.x1=0;break;case"bottom":this.y0=1, this.y1=0;break;case"to":var n=this.y0,r=this.x0;this.y0=this.y1, this.x0=this.x1, this.x1=r, this.y1=n;break;case"center":break;default:var i=.01*parseFloat(t,10);if(isNaN(i))break;0===e?(this.y0=i, this.y1=1-this.y0):(this.x0=i, this.x1=1-this.x0);}},this):(this.y0=0, this.y1=1), this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(i.REGEXP_COLORSTOP),n=+e[2],r=0===n?"%":e[3];return{color:new o(e[1]),stop:"%"===r?n/100:null}}), null===this.colorStops[0].stop&&(this.colorStops[0].stop=0), null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1), this.colorStops.forEach(function(n,r){null===n.stop&&this.colorStops.slice(r).some(function(t,e){return null!==t.stop&&(n.stop=(t.stop-this.colorStops[r-1].stop)/(e+1)+this.colorStops[r-1].stop, !0)},this);},this);}r.prototype=Object.create(i.prototype), r.REGEXP_DIRECTION=/^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i, e.exports=r;},{"./color":3,"./gradientcontainer":9}],13:[function(t,e,n){var r=function(){r.options.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-r.options.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)));};r.options={logging:!1}, e.exports=r;},{}],14:[function(t,e,n){var o=t("./color"),r=t("./utils"),i=r.getBounds,a=r.parseBackgroun
21801ds,s=r.offsetBounds;function h(t,e){this.node=t, this.parent=e, this.stack=null, this.bounds=null, this.borders=null, this.clip=[], this.backgroundClip=[], this.offsetBounds=null, this.visible=null, this.computedStyles=null, this.colors={}, this.styles={}, this.backgroundImages=null, this.transformData=null, this.transformMatrix=null, this.isPseudoElement=!1, this.opacity=null;}function c(t){return-1!==t.toString().indexOf("%")}function l(t){return t.replace("px","")}function u(t){return parseFloat(t)}h.prototype.cloneTo=function(t){t.visible=this.visible, t.borders=this.borders, t.bounds=this.bounds, t.clip=this.clip, t.backgroundClip=this.backgroundClip, t.computedStyles=this.computedStyles, t.styles=this.styles, t.backgroundImages=this.backgroundImages, t.opacity=this.opacity;}, h.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity}, h.prototype.assignStack=function(t){(this.stack=t).children.push(this);}, h.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))}, h.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)), this.styles[t]||(this.styles[t]=this.computedStyles[t])}, h.prototype.prefixedCss=function(e){var n=this.css(e);return void 0===n&&["webkit","moz","ms","o"].some(function(t){return void 0!==(n=this.css(t+e.substr(0,1).toUpperCase()+e.substr(1)))},this), void 0===n?null:n}, h.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)}, h.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e}, h.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new o(this.css(t)))}, h.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e}, h.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal";}return t}, h.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null}, h.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=a(this.css("backgroundImage")))}, h.prototype.cssList=function(t,e){var n=(this.css(t)||"").split(",");return 1===(n=(n=n[e||0]||n[0]||"auto").trim().split(" ")).length&&(n=[n[0],c(n[0])?"auto":n[0]]), n}, h.prototype.parseBackgroundSize=function(t,e,n){var r,i,o=this.cssList("backgroundSize",n);if(c(o[0]))r=t.width*parseFloat(o[0])/100;else{if(/contain|cover/.test(o[0])){var a=t.width/t.height,s=e.width/e.height;return a<s^"contain"===o[0]?{width:t.height*s,height:t.height}:{width:t.width,height:t.width/s}}r=parseInt(o[0],10);}return i="auto"===o[0]&&"auto"===o[1]?e.height:"auto"===o[1]?r/e.width*e.height:c(o[1])?t.height*parseFloat(o[1])/100:parseInt(o[1],10), "auto"===o[0]&&(r=i/e.height*e.width), {width:r,height:i}}, h.prototype.parseBackgroundPosition=function(t,e,n,r){var i,o,a=this.cssList("backgroundPosition",n);return i=c(a[0])?(t.width-(r||e).width)*(parseFloat(a[0])/100):parseInt(a[0],10), o="auto"===a[1]?i/e.width*e.height:c(a[1])?(t.height-(r||e).height)*parseFloat(a[1])/100:parseInt(a[1],10), "auto"===a[0]&&(i=o/e.height*e.width), {left:i,top:o}}, h.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]}, h.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var n=t.match(this.TEXT_SHADOW_PROPERTY),r=0;n&&r<n.length;r++){var i=n[r].match(this.TEXT_SHADOW_VALUES);e.push({color:new o(i[0]),offsetX:i[1]?parseFloat(i[1].replace("px","")):0,offsetY:i[2]?parseFloat(i[2].replace("px","")):0,blur:i[3]?i[3].replace("px",""):0});}return e}, h.prototype.parseTransform=function(){if(!this.transformData)if(this.hasTransform()){var t=this.parseBounds(),e=this.prefixedCss("transformOrigin").split(" ").map(l).map(u);e[0]+=t.left, e[1]+=t.top, this.transformData={origin:e,matrix:this.parseTransformMatrix()};}else this.transformData={origin:[0,0],matrix:[1,0,0,1,0,0]};return this.transformData}, h.prototype.parseTransformMatrix=function(){if(!this.transformMatrix){var t=this.prefixedCss("transform"),e=t?function(t){{if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim())});if(t&&"matrix3d"===t[1]){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}}(t.match(this.MATRIX_PROPERTY)):null;this.transformMatrix=e||[1,0,0,1,0,0];}return this.transformMatrix}, h.prototype.parseBounds=function(){return this.bounds||(this.bounds=this.hasTransform()?s(this.node):i(this.node))}, h.prototype.hasTransform=function(){return"1,0,0,1,0,0"!==this.parseTransformMatrix().join(",")||this.parent&&this.parent.hasTransform()}, h.prototype.getValue=function(){var t,e,n=this.node.value||"";return"SELECT"===this.node.tagName?(t=this.node, n=(e=t.options[t.selectedIndex||0])&&e.text||""):"password"===this.node.type&&(n=Array(n.length+1).join("•")), 0===n.length?this.node.placeholder||"":n}, h.prototype.MATRIX_PROPERTY=/(matrix|matrix3d)\((.+)\)/, h.prototype.TEXT_SHADOW_PROPERTY=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g, h.prototype.TEXT_SHADOW_VALUES=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g, h.prototype.CLIP=/^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/, e.exports=h;},{"./color":3,"./utils":26}],15:[function(t,e,n){var s=t("./log"),h=t("punycode"),c=t("./nodecontainer"),f=t("./textcontainer"),d=t("./pseudoelementcontainer"),l=t("./fontmetrics"),u=t("./color"),p=t("./stackingcontext"),r=t("./utils"),g=r.bind,a=r.getBounds,m=r.parseBackgroun
21801ds,w=r.offsetBounds;function i(t,e,n,r,i){s("Starting NodeParser"), this.renderer=e, this.options=i, this.range=null, this.support=n, this.renderQueue=[], this.stack=new p(!0,1,t.ownerDocument,null);var o=new c(t,null);if(i.background&&e.rectangle(0,0,e.width,e.height,new u(i.background)), t===t.ownerDocument.documentElement){var a=new c(o.color("backgroundColor").isTransparent()?t.ownerDocument.body:t.ownerDocument.documentElement,null);e.rectangle(0,0,e.width,e.height,a.color("backgroundColor"));}o.visibile=o.isElementVisible(), this.createPseudoHideStyles(t.ownerDocument), this.disableAnimations(t.ownerDocument), this.nodes=L([o].concat(this.getChildren(o)).filter(function(t){return t.visible=t.isElementVisible()}).map(this.getPseudoElements,this)), this.fontMetrics=new l, s("Fetched nodes, total:",this.nodes.length), s("Calculate overflow clips"), this.calculateOverflowClips(), s("Start fetching images"), this.images=r.fetch(this.nodes.filter(j)), this.ready=this.images.ready.then(g(function(){return s("Images loaded, starting parsing"), s("Creating stacking contexts"), this.createStackingContexts(), s("Sorting stacking contexts"), this.sortStackingContexts(this.stack), this.parse(this.stack), s("Render queue created with "+this.renderQueue.length+" items"), new Promise(g(function(t){i.async?"function"==typeof i.async?i.async.call(this,this.renderQueue,t):0<this.renderQueue.length?(this.renderIndex=0, this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this), t());},this))},this));}function o(t){return t.parent&&t.parent.clip.length}function y(){}i.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(j(t)){D(t)&&t.appendToDOM(), t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],n=t.parseClip();n&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+n.left,t.bounds.top+n.top,n.right-n.left,n.bottom-n.top]]), t.clip=o(t)?t.parent.clip.concat(e):e, t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip, D(t)&&t.cleanDOM();}else M(t)&&(t.clip=o(t)?t.parent.clip:[]);D(t)||(t.bounds=null);},this);}, i.prototype.asyncRenderer=function(t,e,n){n=n||Date.now(), this.paint(t[this.renderIndex++]), t.length===this.renderIndex?e():n+20>Date.now()?this.asyncRenderer(t,e,n):setTimeout(g(function(){this.asyncRenderer(t,e);},this),0);}, i.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }');}, i.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}");}, i.prototype.createStyles=function(t,e){var n=t.createElement("style");n.innerHTML=e, t.body.appendChild(n);}, i.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var n=this.getPseudoElement(t,":before"),r=this.getPseudoElement(t,":after");n&&e.push(n), r&&e.push(r);}return L(e)}, i.prototype.getPseudoElement=function(t,e){var n=t.computedStyle(e);if(!n||!n.content||"none"===n.content||"-moz-alt-content"===n.content||"none"===n.display)return null;for(var r,i,o=(r=n.content, (i=r.substr(0,1))===r.substr(r.length-1)&&i.match(/'|"/)?r.substr(1,r.length-2):r),a="url"===o.substr(0,3),s=document.createElement(a?"img":"html2canvaspseudoelement"),h=new d(s,t,e),c=n.length-1;0<=c;c--){var l=n.item(c).replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")});s.style[l]=n[l];}if(s.className=d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER, a)return s.src=m(o)[0].args[0], [h];var u=document.createTextNode(o);return s.appendChild(u), [h,new f(u,h)]}, i.prototype.getChildren=function(n){return L([].filter.call(n.node.childNodes,q).map(function(t){var e=[t.nodeType===Node.TEXT_NODE?new f(t,n):new c(t,n)].filter(z);return t.nodeType===Node.ELEMENT_NODE&&e.length&&"TEXTAREA"!==t.tagName?e[0].isElementVisible()?e.concat(this.getChildren(e[0])):[]:e},this))}, i.prototype.newStackingContext=function(t,e){var n=new p(e,t.getOpacity(),t.node,t.parent);t.cloneTo(n), (e?n.getParentStack(this):n.parent.stack).contexts.push(n), t.stack=n;}, i.prototype.createStackingContexts=function(){this.nodes.forEac
21801h(function(t){var e,n;j(t)&&(this.isRootElement(t)||t.getOpacity()<1||(n=(e=t).css("position"), "auto"!==(-1!==["absolute","relative","fixed"].indexOf(n)?e.css("zIndex"):"auto"))||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):j(t)&&(O(t)&&T(t)||-1!==["inline-block","inline-table"].indexOf(t.css("display"))||B(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack);},this);}, i.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent()}, i.prototype.isRootElement=function(t){return null===t.parent}, i.prototype.sortStackingContexts=function(t){var n;t.contexts.sort((n=t.contexts.slice(0), function(t,e){return t.cssInt("zIndex")+n.indexOf(t)/n.length-(e.cssInt("zIndex")+n.indexOf(e)/n.length)})), t.contexts.forEach(this.sortStackingContexts,this);}, i.prototype.parseTextBounds=function(a){return function(t,e,n){if("none"!==a.parent.css("textDecoration").substr(0,4)||0!==t.trim().length){if(this.support.rangeBounds&&!a.parent.hasTransform()){var r=n.slice(0,e).join("").length;return this.getRangeBounds(a.node,r,t.length)}if(a.node&&"string"==typeof a.node.data){var i=a.node.splitText(t.length),o=this.getWrapperBounds(a.node,a.parent.hasTransform());return a.node=i, o}}else this.support.rangeBounds&&!a.parent.hasTransform()||(a.node=a.node.splitText(t.length));return{}}}, i.prototype.getWrapperBounds=function(t,e){var n=t.ownerDocument.createElement("html2canvaswrapper"),r=t.parentNode,i=t.cloneNode(!0);n.appendChild(t.cloneNode(!0)), r.replaceChild(n,t);var o=e?w(n):a(n);return r.replaceChild(i,n), o}, i.prototype.getRangeBounds=function(t,e,n){var r=this.range||(this.range=t.ownerDocument.createRange());return r.setStart(t,e), r.setEnd(t,e+n), r.getBoundingClientRect()}, i.prototype.parse=function(t){var e=t.contexts.filter(I),n=t.children.filter(j),r=n.filter(R(B)),i=r.filter(R(O)).filter(R(F)),o=n.filter(R(O)).filter(B),a=r.filter(R(O)).filter(F),s=t.contexts.concat(r.filter(O)).filter(T),h=t.children.filter(M).filter(E),c=t.contexts.filter(C);e.concat(i).concat(o).concat(a).concat(s).concat(h).concat(c).forEach(function(t){this.renderQueue.push(t), P(t)&&(this.parse(t), this.renderQueue.push(new y));},this);}, i.prototype.paint=function(t){try{t instanceof y?this.renderer.ctx.restore():M(t)?(D(t.parent)&&t.parent.appendToDOM(), this.paintText(t), D(t.parent)&&t.parent.cleanDOM()):this.paintNode(t);}catch(t){if(s(t), this.options.strict)throw t}}, i.prototype.paintNode=function(t){P(t)&&(this.renderer.setOpacity(t.opacity), this.renderer.ctx.save(), t.hasTransform()&&this.renderer.setTransform(t.parseTransform())), "INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t);}, i.prototype.paintElement=function(n){var r=n.parseBounds();this.renderer.clip(n.backgroundClip,function(){this.renderer.renderBackground(n,r,n.borders.borders.map(N));},this), this.renderer.clip(n.clip,function(){this.renderer.renderBorders(n.borders.borders);},this), this.renderer.clip(n.backgroundClip,function(){switch(n.node.nodeName){case"svg":case"IFRAME":var t=this.images.get(n.node);t?this.renderer.renderImage(n,r,n.borders,t):s("Error loading <"+n.node.nodeName+">",n.node);break;case"IMG":var e=this.images.get(n.node.src);e?this.renderer.renderImage(n,r,n.borders,e):s("Error loading <img>",n.node.src);break;case"CANVAS":this.renderer.renderImage(n,r,n.borders,{image:n.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(n);}},this);}, i.prototype.paintCheckbox=function(t){var e=t.parseBounds(),n=Math.min(e.width,e.height),r={width:n-1,height:n-1,top:e.top,left:e.left},i=[3,3],o=[i,i,i,i],a=[1,1,1,1].map(function(t){return{color:new u("#A5A5A5"),width:t}}),s=S(r,o,a);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(r.left+1,r.top+1,r.width-2,r.height-2,new u("#DEDEDE")), this.renderer.renderBorders(b(a,r,s,o)), t.node.checked&&(this.renderer.font(new u("#424242"),"normal","normal","bold",n-3+"px","arial"), this.renderer.text("✔",r.left+n/6,r.top+n-1));},this);}, i.prototype.paintRadio=function(t){var e=t.parseBounds(),n=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,n,new u("#DEDEDE"),1,new u("#A5A5A5")), t.node.checked&&this.renderer.circle(Math.ceil(e.left+n/4)+1,Math.ceil(e.top+n/4)+1,Math.floor(n/2),new u("#424242"));},this);}, i.prototype.paintFormValue=function(e){var t=e.getValue();if(0<t.length){var n=e.node.ownerDocument,r=n.createElement("html2canvaswrapper");["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"].forEach(function(t){try{r.style[t]=e.css(t);}catch(t){s("html2canvas: Parse: Exception caught in renderFormValue: "+t.message);}});var i=e.parseBounds();r.style.position="fixed", r.style.left=i.left+"px", r.style.top=i.top+"px", r.textContent=t, n.body.appendChild(r), this.paintText(new f(r.firstChild,e)), n.body.removeChild(r);}}, i.prototype.paintText=function(n){n.applyTextTransform();var t,e=h.ucs2.decode(n.node.data),r=this.options.letterRendering&&!/^(normal|none|0px)$/.test(n.parent.css("letterSpacing"))||(t=n.node.data, /[^\u0000-\u00ff]/.test(t))?e.map(function(t){return h.ucs2.encode([t])}):function(t){var e,n=[],r=0,i=!1;for(;t.length;)o=t[r], -1!==[32,13,10,9,45].indexOf(o)===i?((e=t.splice(0,r)).length&&n.push(h.ucs2.encode(e)), i=!i, r=0):r++, r>=t.length&&(e=t.splice(0,r)).length&&n.push(h.ucs2.encode(e));var o;return n}(e),i=n.parent.fontWeight(),o=n.parent.css("fontSize"),a=n.parent.css("fontFamily"),s=n.parent.parseTextShadows();this.renderer.font(n.parent.color("color"),n.parent.css("fontStyle"),n.parent.css("fontVariant"),i,o,a), s.length?this.renderer.fontShadow(s[0].color,s[0].offsetX,s[0].offsetY,s[0].blur):this.renderer.clearShadow(), this.renderer.clip(n.parent.clip,function(){r.map(this.parseTextBounds(n),this).forEac
vendor: 5,354 bytes, line 21801
21801h(function(t,e){t&&!1===/^\s*$/.test(r[e])&&(this.renderer.text(r[e],t.left,t.bottom), this.renderTextDecoration(n.parent,t,this.fontMetrics.getMetrics(a,o)));},this);},this);}, i.prototype.renderTextDecoration=function(t,e,n){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+n.baseline+n.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+n.middle+n.lineWidth),e.width,1,t.color("color"));}};var v={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};function b(a,s,h,c){return a.map(function(t,e){if(0<t.width){var n=s.left,r=s.top,i=s.width,o=s.height-a[2].width;switch(e){case 0:o=a[0].width, t.args=_({c1:[n,r],c2:[n+i,r],c3:[n+i-a[1].width,r+o],c4:[n+a[3].width,r+o]},c[0],c[1],h.topLeftOuter,h.topLeftInner,h.topRightOuter,h.topRightInner);break;case 1:n=s.left+s.width-a[1].width, i=a[1].width, t.args=_({c1:[n+i,r],c2:[n+i,r+o+a[2].width],c3:[n,r+o],c4:[n,r+a[0].width]},c[1],c[2],h.topRightOuter,h.topRightInner,h.bottomRightOuter,h.bottomRightInner);break;case 2:r=r+s.height-a[2].width, o=a[2].width, t.args=_({c1:[n+i,r+o],c2:[n,r+o],c3:[n+a[3].width,r],c4:[n+i-a[3].width,r]},c[2],c[3],h.bottomRightOuter,h.bottomRightInner,h.bottomLeftOuter,h.bottomLeftInner);break;case 3:i=a[3].width, t.args=_({c1:[n,r+o+a[2].width],c2:[n,r],c3:[n+i,r+a[0].width],c4:[n+i,r+o]},c[3],c[0],h.bottomLeftOuter,h.bottomLeftInner,h.topLeftOuter,h.topLeftInner);}}return t})}function x(t,e,n,r){var i=(Math.sqrt(2)-1)/3*4,o=n*i,a=r*i,s=t+n,h=e+r;return{topLeft:k({x:t,y:h},{x:t,y:h-a},{x:s-o,y:e},{x:s,y:e}),topRight:k({x:t,y:e},{x:t+o,y:e},{x:s,y:h-a},{x:s,y:h}),bottomRight:k({x:s,y:e},{x:s,y:e+a},{x:t+o,y:h},{x:t,y:h}),bottomLeft:k({x:s,y:h},{x:s-o,y:h},{x:t,y:e+a},{x:t,y:e})}}function S(t,e,n){var r=t.left,i=t.top,o=t.width,a=t.height,s=e[0][0]<o/2?e[0][0]:o/2,h=e[0][1]<a/2?e[0][1]:a/2,c=e[1][0]<o/2?e[1][0]:o/2,l=e[1][1]<a/2?e[1][1]:a/2,u=e[2][0]<o/2?e[2][0]:o/2,f=e[2][1]<a/2?e[2][1]:a/2,d=e[3][0]<o/2?e[3][0]:o/2,p=e[3][1]<a/2?e[3][1]:a/2,g=o-c,m=a-f,w=o-u,y=a-p;return{topLeftOuter:x(r,i,s,h).topLeft.subdivide(.5),topLeftInner:x(r+n[3].width,i+n[0].width,Math.max(0,s-n[3].width),Math.max(0,h-n[0].width)).topLeft.subdivide(.5),topRightOuter:x(r+g,i,c,l).topRight.subdivide(.5),topRightInner:x(r+Math.min(g,o+n[3].width),i+n[0].width,g>o+n[3].width?0:c-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:x(r+w,i+m,u,f).bottomRight.subdivide(.5),bottomRightInner:x(r+Math.min(w,o-n[3].width),i+Math.min(m,a+n[0].width),Math.max(0,u-n[1].width),f-n[2].width).bottomRight.subdivide(.5),bottomLeftOuter:x(r,i+y,d,p).bottomLeft.subdivide(.5),bottomLeftInner:x(r+n[3].width,i+y,Math.max(0,d-n[3].width),p-n[2].width).bottomLeft.subdivide(.5)}}function k(s,h,c,l){var u=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:s,startControl:h,endControl:c,end:l,subdivide:function(t){var e=u(s,h,t),n=u(h,c,t),r=u(c,l,t),i=u(e,n,t),o=u(n,r,t),a=u(i,o,t);return[k(s,e,i,a),k(a,o,r,l)]},curveTo:function(t){t.push(["bezierCurve",h.x,h.y,c.x,c.y,l.x,l.y]);},curveToReversed:function(t){t.push(["bezierCurve",c.x,c.y,h.x,h.y,s.x,s.y]);}}}function _(t,e,n,r,i,o,a){var s=[];return 0<e[0]||0<e[1]?(s.push(["line",r[1].start.x,r[1].start.y]), r[1].curveTo(s)):s.push(["line",t.c1[0],t.c1[1]]), 0<n[0]||0<n[1]?(s.push(["line",o[0].start.x,o[0].start.y]), o[0].curveTo(s), s.push(["line",a[0].end.x,a[0].end.y]), a[0].curveToReversed(s)):(s.push(["line",t.c2[0],t.c2[1]]), s.push(["line",t.c3[0],t.c3[1]])), 0<e[0]||0<e[1]?(s.push(["line",i[1].end.x,i[1].end.y]), i[1].curveToReversed(s)):s.push(["line",t.c4[0],t.c4[1]]), s}function A(t,e,n,r,i,o,a){0<e[0]||0<e[1]?(t.push(["line",r[0].start.x,r[0].start.y]), r[0].curveTo(t), r[1].curveTo(t)):t.push(["line",o,a]), (0<n[0]||0<n[1])&&t.push(["line",i[0].start.x,i[0].start.y]);}function I(t){return t.cssInt("zIndex")<0}function C(t){return 0<t.cssInt("zIndex")}function T(t){return 0===t.cssInt("zIndex")}function F(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function P(t){return t instanceof p}function E(t){return 0<t.node.data.trim().length}function q(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function O(t){return"static"!==t.css("position")}function B(t){return"none"!==t.css("float")}function R(t){var e=this;return function(){return!t.apply(e,arguments)}}function j(t){return t.node.nodeType===Node.ELEMENT_NODE}function D(t){return!0===t.isPseudoElement}function M(t){return t.node.nodeType===Node.TEXT_NODE}function U(t){return parseInt(t,10)}function N(t){return t.width}function z(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function L(t){return[].concat.apply([],t)}i.prototype.parseBorders=function(o){var r,t=o.parseBounds(),e=(r=o, ["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(t){var e=r.css("border"+t+"Radius"),n=e.split(" ");return n.length<=1&&(n[1]=n[0]), n.map(U)})),n=["Top","Right","Bottom","Left"].map(function(t,e){var n=o.css("border"+t+"Style"),r=o.color("border"+t+"Color");"inset"===n&&r.isBlack()&&(r=new u([255,255,255,r.a]));var i=v[n]?v[n][e]:null;
21801return{width:o.cssInt("border"+t+"Width"),color:i?r[i[0]](i[1]):r,args:null}}),i=S(t,e,n);return{clip:this.parseBackgroundClip(o,i,n,e,t),borders:b(n,t,i,e)}}, i.prototype.parseBackgroundClip=function(t,e,n,r,i){var o=[];switch(t.css("backgroundClip")){case"content-box":case"padding-box":A(o,r[0],r[1],e.topLeftInner,e.topRightInner,i.left+n[3].width,i.top+n[0].width), A(o,r[1],r[2],e.topRightInner,e.bottomRightInner,i.left+i.width-n[1].width,i.top+n[0].width), A(o,r[2],r[3],e.bottomRightInner,e.bottomLeftInner,i.left+i.width-n[1].width,i.top+i.height-n[2].width), A(o,r[3],r[0],e.bottomLeftInner,e.topLeftInner,i.left+n[3].width,i.top+i.height-n[2].width);break;default:A(o,r[0],r[1],e.topLeftOuter,e.topRightOuter,i.left,i.top), A(o,r[1],r[2],e.topRightOuter,e.bottomRightOuter,i.left+i.width,i.top), A(o,r[2],r[3],e.bottomRightOuter,e.bottomLeftOuter,i.left+i.width,i.top+i.height), A(o,r[3],r[0],e.bottomLeftOuter,e.topLeftOuter,i.left,i.top+i.height);}return o}, e.exports=i;},{"./color":3,"./fontmetrics":7,"./log":13,"./nodecontainer":14,"./pseudoelementcontainer":18,"./stackingcontext":21,"./textcontainer":25,"./utils":26,punycode:1}],16:[function(t,e,n){var a=t("./xhr"),r=t("./utils"),s=t("./log"),h=t("./clone"),c=r.decode64;function l(t,e,n){var r="withCredentials"in new XMLHttpRequest;if(!e)return Promise.reject("No proxy configured");var i=f(r),o=d(e,t,i);return r?a(o):u(n,o,i).then(function(t){return c(t.content)})}var i=0;function u(i,o,a){return new Promise(function(e,n){var t=i.createElement("script"),r=function(){delete window.html2canvas.proxy[a], i.body.removeChild(t);};window.html2canvas.proxy[a]=function(t){r(), e(t);}, t.src=o, t.onerror=function(t){r(), n(t);}, i.body.appendChild(t);})}function f(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++i+"_"+Math.round(1e5*Math.random())}function d(t,e,n){return t+"?url="+encodeURIComponent(e)+(n.length?"&callback=html2canvas.proxy."+n:"")}n.Proxy=l, n.ProxyURL=function(t,e,n){var r="crossOrigin"in new Image,i=f(r),o=d(e,t,i);return r?Promise.resolve(o):u(n,o,i).then(function(t){return"data:"+t.type+";base64,"+t.content})}, n.loadUrlDocument=function(t,e,n,r,i,o){return new l(t,e,window.document).then((a=t, function(e){var n,t=new DOMParser;try{n=t.parseFromString(e,"text/html");}catch(t){s("DOMParser not supported, falling back to createHTMLDocument"), n=document.implementation.createHTMLDocument("");try{n.open(), n.write(e), n.close();}catch(t){s("createHTMLDocument write not supported, falling back to document.body.innerHTML"), n.body.innerHTML=e;}}var r=n.querySelector("base");if(!r||!r.href.host){var i=n.createElement("base");i.href=a, n.head.insertBefore(i,n.head.firstChild);}return n})).then(function(t){return h(t,n,r,i,o,0,0)});var a;};},{"./clone":2,"./log":13,"./utils":26,"./xhr":28}],17:[function(t,e,n){var o=t("./proxy").ProxyURL;e.exports=function(n,r){var t=document.createElement("a");t.href=n, n=t.href, this.src=n, this.image=new Image;var i=this;this.promise=new Promise(function(t,e){i.image.crossOrigin="Anonymous", i.image.onload=t, i.image.onerror=e, new o(n,r,document).then(function(t){i.image.src=t;}).catch(e);});};},{"./proxy":16}],18:[function(t,e,n){var r=t("./nodecontainer");function i(t,e,n){r.call(this,t,e), this.isPseudoElement=!0, this.before=":before"===n;}i.prototype.cloneTo=function(t){i.prototype.cloneTo.call(this,t), t.isPseudoElement=!0, t.before=this.before;}, (i.prototype=Object.create(r.prototype)).appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node), this.parent.node.className+=" "+this.getHideClass();}, i.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node), this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"");}, i.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]}, i.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before", i.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after", e.exports=i;},{"./nodecontainer":14}],19:[function(t,e,n){var h=t("./log");function r(t,e,n,r,i){this.width=t, this.height=e, this.images=n, this.options=r, this.document=i;}r.prototype.renderImage=function(t,e,n,r){var i=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),a=t.cssInt("paddingRight"),s=t.cssInt("paddingBottom"),h=n.borders,c=e.width-(h[1].width+h[3].width+i+a),l=e.height-(h[0].width+h[2].width+o+s);this.drawImage(r,0,0,r.image.width||c,r.image.height||l,e.left+i+h[3].width,e.top+o+h[0].width,c,l);}
21801, r.prototype.renderBackground=function(t,e,n){0<e.height&&0<e.width&&(this.renderBackgroundColor(t,e), this.renderBackgroundImage(t,e,n));}, r.prototype.renderBackgroundColor=function(t,e){var n=t.color("backgroundColor");n.isTransparent()||this.rectangle(e.left,e.top,e.width,e.height,n);}, r.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this);}, r.prototype.renderBorder=function(t){t.color.isTransparent()||null===t.args||this.drawShape(t.args,t.color);}, r.prototype.renderBackgroundImage=function(o,a,s){o.parseBackgroundImages().reverse().forEach(function(t,e,n){switch(t.method){case"url":var r=this.images.get(t.args[0]);r?this.renderBackgroundRepeating(o,a,r,n.length-(e+1),s):h("Error loading background-image",t.args[0]);break;case"linear-gradient":case"gradient":var i=this.images.get(t.value);i?this.renderBackgroundGradient(i,a,s):h("Error loading background-image",t.args[0]);break;case"none":break;default:h("Unknown background-image type",t.args[0]);}},this);}, r.prototype.renderBackgroundRepeating=function(t,e,n,r,i){var o=t.parseBackgroundSize(e,n.image,r),a=t.parseBackgroundPosition(e,n.image,r,o);switch(t.parseBackgroundRepeat(r)){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(n,a,o,e,e.left+i[3],e.top+a.top+i[0],99999,o.height,i);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(n,a,o,e,e.left+a.left+i[3],e.top+i[0],o.width,99999,i);break;case"no-repeat":this.backgroundRepeatShape(n,a,o,e,e.left+a.left+i[3],e.top+a.top+i[0],o.width,o.height,i);break;default:this.renderBackgroundRepeat(n,a,o,{top:e.top,left:e.left},i[3],i[0]);}}, e.exports=r;},{"./log":13}],20:[function(t,e,n){var r=t("../renderer"),i=t("../lineargradientcontainer"),o=t("../log");function a(t,e){r.apply(this,arguments), this.canvas=this.options.canvas||this.document.createElement("canvas"), this.options.canvas||(this.canvas.width=t, this.canvas.height=e), this.ctx=this.canvas.getContext("2d"), this.taintCtx=this.document.createElement("canvas").getContext("2d"), this.ctx.textBaseline="bottom", this.variables={}, o("Initialized CanvasRenderer with size",t,"x",e);}function s(t){return 0<t.length}(a.prototype=Object.create(r.prototype)).setFillStyle=function(t){return this.ctx.fillStyle="object"==typeof t&&t.isColor?t.toString():t, this.ctx}, a.prototype.rectangle=function(t,e,n,r,i){this.setFillStyle(i).fillRect(t,e,n,r);}, a.prototype.circle=function(t,e,n,r){this.setFillStyle(r), this.ctx.beginPath(), this.ctx.arc(t+n/2,e+n/2,n/2,0,2*Math.PI,!0), this.ctx.closePath(), this.ctx.fill();}, a.prototype.circleStroke=function(t,e,n,r,i,o){this.circle(t,e,n,r), this.ctx.strokeStyle=o.toString(), this.ctx.stroke();}, a.prototype.drawShape=function(t,e){this.shape(t), this.setFillStyle(e).fill();}, a.prototype.taints=function(e){if(null===e.tainted){this.taintCtx.drawImage(e.image,0,0);try{this.taintCtx.getImageData(0,0,1,1), e.tainted=!1;}catch(t){this.taintCtx=document.createElement("canvas").getContext("2d"), e.tainted=!0;}}return e.tainted}, a.prototype.drawImage=function(t,e,n,r,i,o,a,s,h){this.taints(t)&&!this.options.allowTaint||this.ctx.drawImage(t.image,e,n,r,i,o,a,s,h);}, a.prototype.clip=function(t,e,n){this.ctx.save(), t.filter(s).forEach(function(t){this.shape(t).clip();},this), e.call(n), this.ctx.restore();}, a.prototype.shape=function(t){return this.ctx.beginPath(), t.forEach(function(t,e){"rect"===t[0]?this.ctx.rect.apply(this.ctx,t.slice(1)):this.ctx[0===e?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1));},this), this.ctx.closePath(), this.ctx}, a.prototype.font=function(t,e,n,r,i,o){this.setFillStyle(t).font=[e,n,r,i,o].join(" ").split(",")[0];}, a.prototype.fontShadow=function(t,e,n,r){this.setVariable("shadowColor",t.toString()).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",n).setVariable("shadowBlur",r);}, a.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)");}, a.prototype.setOpacity=function(t){this.ctx.globalAlpha=t;}, a.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]), this.ctx.transform.apply(this.ctx,t.matrix), this.ctx.translate(-t.origin[0],-t.origin[1]);}, a.prototype.setVariable=function(t,e){return this.variables[t]!==e&&(this.variables[t]=this.ctx[t]=e), this}, a.prototype.text=function(t,e,n){this.ctx.fillText(t,e,n);}, a.prototype.backgroundRepeatShape=function(t,e,n,r,i,o,a,s,h){var c=[["line",Math.round(i),Math.round(o)],["line",Math.round(i+a),Math.round(o)],["line",Math.round(i+a),Math.round(s+o)],["line",Math.round(i),Math.round(s+o)]];
21801this.clip([c],function(){this.renderBackgroundRepeat(t,e,n,r,h[3],h[0]);},this);}, a.prototype.renderBackgroundRepeat=function(t,e,n,r,i,o){var a=Math.round(r.left+e.left+i),s=Math.round(r.top+e.top+o);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,n),"repeat")), this.ctx.translate(a,s), this.ctx.fill(), this.ctx.translate(-a,-s);}, a.prototype.renderBackgroundGradient=function(t,e){if(t instanceof i){var n=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){n.addColorStop(t.stop,t.color.toString());}), this.rectangle(e.left,e.top,e.width,e.height,n);}}, a.prototype.resizeImage=function(t,e){var n=t.image;if(n.width===e.width&&n.height===e.height)return n;var r=document.createElement("canvas");return r.width=e.width, r.height=e.height, r.getContext("2d").drawImage(n,0,0,n.width,n.height,0,0,e.width,e.height), r}, e.exports=a;},{"../lineargradientcontainer":12,"../log":13,"../renderer":19}],21:[function(t,e,n){var i=t("./nodecontainer");function r(t,e,n,r){i.call(this,n,r), this.ownStacking=t, this.contexts=[], this.children=[], this.opacity=(this.parent?this.parent.stack.opacity:1)*e;}(r.prototype=Object.create(i.prototype)).getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack}, e.exports=r;},{"./nodecontainer":14}],22:[function(t,e,n){function r(t){this.rangeBounds=this.testRangeBounds(t), this.cors=this.testCORS(), this.svg=this.testSVG();}r.prototype.testRangeBounds=function(t){var e,n,r=!1;return t.createRange&&(e=t.createRange()).getBoundingClientRect&&((n=t.createElement("boundtest")).style.height="123px", n.style.display="block", t.body.appendChild(n), e.selectNode(n), 123===e.getBoundingClientRect().height&&(r=!0), t.body.removeChild(n)), r}, r.prototype.testCORS=function(){return void 0!==(new Image).crossOrigin}, r.prototype.testSVG=function(){var t=new Image,e=document.createElement("canvas"),n=e.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(t,0,0), e.toDataURL();}catch(t){return!1}return!0}, e.exports=r;},{}],23:[function(t,e,n){var r=t("./xhr"),i=t("./utils").decode64;function o(t){this.src=t, this.image=null;var n=this;this.promise=this.hasFabric().then(function(){return n.isInline(t)?Promise.resolve(n.inlineFormatting(t)):r(t)}).then(function(e){return new Promise(function(t){window.html2canvas.svg.fabric.loadSVGFromString(e,n.createCanvas.call(n,t));})});}o.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?Promise.resolve():Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))}, o.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)}, o.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")}, o.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)}, o.prototype.createCanvas=function(r){var i=this;return function(t,e){var n=new window.html2canvas.svg.fabric.StaticCanvas("c");i.image=n.lowerCanvasEl, n.setWidth(e.width).setHeight(e.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(t,e)).renderAll(), r(n.lowerCanvasEl);}}, o.prototype.decode64=function(t){return"function"==typeof window.atob?window.atob(t):i(t)}, e.exports=o;},{"./utils":26,"./xhr":28}],24:[function(t,e,n){var r=t("./svgcontainer");function i(n,t){this.src=n, this.image=null;var r=this;this.promise=t?new Promise(function(t,e){r.image=new Image, r.image.onload=t, r.image.onerror=e, r.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(n), !0===r.image.complete&&t(r.image);}):this.hasFabric().then(function(){return new Promise(function(t){window.html2canvas.svg.fabric.parseSVGDocument(n,r.createCanvas.call(r,t));})});}i.prototype=Object.create(r.prototype), e.exports=i;},{"./svgcontainer":23}],25:[function(t,e,n){var r=t("./nodecontainer");function i(t,e){r.call(this,t,e);}function o(t,e,n){if(0<t.length)return e+n.toUpperCase()}(i.prototype=Object.create(r.prototype)).applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"));}, i.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,o);case"uppercase":return e.toUpperCase();default:return e}}, e.exports=i;},{"./nodecontainer":14}],26:[function(t,e,n){n.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}, n.bind=function(t,e){return function(){return t.apply(e,arguments)}}, n.decode64=function(t){var e,n,r,i,o,a,s,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
21801+/",c=t.length,l="";for(e=0;e<c;e+=4)o=h.indexOf(t[e])<<2|(n=h.indexOf(t[e+1]))>>4, a=(15&n)<<4|(r=h.indexOf(t[e+2]))>>2, s=(3&r)<<6|(i=h.indexOf(t[e+3])), l+=64===r?String.fromCharCode(o):64===i||-1===i?String.fromCharCode(o,a):String.fromCharCode(o,a,s);return l}, n.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),n=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+n,left:e.left,width:n,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}}, n.offsetBounds=function(t){var e=t.offsetParent?n.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}}, n.parseBackgrounds=function(t){var e,n,r,i,o,a,s,h=[],c=0,l=0,u=function(){e&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)), n&&s.push(n), "-"===e.substr(0,1)&&0<(i=e.indexOf("-",1)+1)&&(r=e.substr(0,i), e=e.substr(i)), h.push({prefix:r,method:e.toLowerCase(),value:o,args:s,image:null})), s=[], e=r=n=o="";};return s=[], e=r=n=o="", t.split("").forEach(function(t){if(!(0===c&&-1<" \r\n\t".indexOf(t))){switch(t){case'"':a?a===t&&(a=null):a=t;break;case"(":if(a)break;if(0===c)return c=1, void(o+=t);l++;break;case")":if(a)break;if(1===c){if(0===l)return c=0, o+=t, void u();l--;}break;case",":if(a)break;if(0===c)return void u();if(1===c&&0===l&&!e.match(/^url$/i))return s.push(n), n="", void(o+=t)}o+=t, 0===c?e+=t:n+=t;}}), u(), h};},{}],27:[function(t,e,n){var r=t("./gradientcontainer");function i(t){r.apply(this,arguments), this.type="linear"===t.args[0]?r.TYPES.LINEAR:r.TYPES.RADIAL;}i.prototype=Object.create(r.prototype), e.exports=i;},{"./gradientcontainer":9}],28:[function(t,e,n){e.exports=function(r){return new Promise(function(t,e){var n=new XMLHttpRequest;n.open("GET",r), n.onload=function(){200===n.status?t(n.responseText):e(new Error(n.statusText));}, n.onerror=function(){e(new Error("Network Error"));}, n.send();})};},{}]},{},[4])(4)}), function(t){var n="+".charCodeAt(0),r="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),a="A".charCodeAt(0),s="-".charCodeAt(0),h="_".charCodeAt(0),l=function(t){var e=t.charCodeAt(0);return e===n||e===s?62:e===r||e===h?63:e<i?-1:e<i+10?e-i+26+26:e<a+26?e-a:e<o+26?e-o+26:void 0};t.API.TTFFont=function(){function i(t,e,n){var r;if(this.rawData=t, r=this.contents=new X(t), this.contents.pos=4, "ttcf"===r.readString(4)){if(!e)throw new Error("Mu
21801st specify a font name for TTC files.");throw new Error("Font "+e+" not found in TTC file.")}r.pos=0, this.parse(), this.subset=new T(this), this.registerTTF();}return i.open=function(t,e,n,r){return new i(function(t){var e,n,r,i,o,a;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var s=t.length;o="="===t.charAt(s-2)?2:"="===t.charAt(s-1)?1:0, a=new Uint8Array(3*t.length/4-o), r=0<o?t.length-4:t.length;var h=0;function c(t){a[h++]=t;}for(n=e=0;e<r;e+=4, n+=3)c((16711680&(i=l(t.charAt(e))<<18|l(t.charAt(e+1))<<12|l(t.charAt(e+2))<<6|l(t.charAt(e+3))))>>16), c((65280&i)>>8), c(255&i);return 2===o?c(255&(i=l(t.charAt(e))<<2|l(t.charAt(e+1))>>4)):1===o&&(c((i=l(t.charAt(e))<<10|l(t.charAt(e+1))<<4|l(t.charAt(e+2))>>2)>>8&255), c(255&i)), a}(n),e,r)}, i.prototype.parse=function(){return this.directory=new e(this.contents), this.head=new d(this), this.name=new b(this), this.cmap=new m(this), this.hhea=new g(this), this.maxp=new x(this), this.hmtx=new S(this), this.post=new y(this), this.os2=new w(this), this.loca=new C(this), this.glyf=new _(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]}, i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm, this.bbox=function(){var t,e,n,r;for(r=[], t=0, e=(n=this.bbox).length;t<e;t++)i=n[t], r.push(Math.round(i*this.scaleFactor));return r}.call(this), this.stemV=0, this.post.exists?(e=255&(n=this.post.italic_angle), !0&(t=n>>16)&&(t=-(1+(65535^t))), this.italicAngle=+(t+"."+e)):this.italicAngle=0, this.ascender=Math.round(this.ascender*this.scaleFactor), this.decender=Math.round(this.decender*this.scaleFactor), this.lineGap=Math.round(this.lineGap*this.scaleFactor), this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender, this.xHeight=this.os2.exists&&this.os2.xHeight||0, this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8, this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r, this.isScript=10===this.familyClass, this.flags=0, this.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.cmap.unicode)throw new Error("No unicode cmap for font")}, i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0}, i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm, this.hmtx.forGlyph(t).advance*e}, i.prototype.widthOfString=function(t,e,n){var r,i,o,a,s;for(i=a=o=0, s=(t=""+t).length;0<=s?a<s:s<a;i=0<=s?++a:--a)r=t.charCodeAt(i), o+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/e)||0;return o*(e/1e3)}, i.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1), n=e?this.lineGap:0, (this.ascender+n-this.decender)/1e3*t}, i}();var c,X=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.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}, 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 2147483648<=(t=this.readUInt32())?t-4294967296:t}, t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296), this.writeUInt32(t)}, t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()}, t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255), this.writeByte(255&t)}, t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t}, t.prototype.writeInt16=function(t){return t<0&&(t+=65536), this.writeUInt16(t)}, t.prototype.readString=function(t){var e,n,r;for(n=[], e=r=0;0<=t?r<t:t<r;e=0<=t?++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;0<=r?n<r:r<n;e=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(e)));return i}, 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.readInt=function(){return this.readInt32()}, t.prototype.writeInt=function(t){return this.writeInt32(t)}, t.prototype.read=function(t){var e,n;for(e=[], n=0;0<=t?n<t:t<n;0<=t?++n:--n)e.push(this.readByte());return e}, t.prototype.write=function(t){var e,n,r,i;for(i=[], n=0, r=t.length;n<r;n++)e=t[n], i.push(this.writeByte(e));return i}, t}(),e=function(){var p;function t(t){var e,n,r;for(this.scalarType=t.readInt(), this.tableCount=t.readShort(), this.searchRange=t.readShort(), this.entrySelector=t.readShort(), this.rangeShift=t.readShort(), this.tables={}, n=0, r=this.tableCount;0<=r?n<r:r<n;0<=r?++n:--n)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()}, this.tables[e.tag]=e;}return t.prototype.encode=function(t){var e,n,r,i,o,a,s,h,c,l,u,f,d;for(d in u=Object.keys(t).length, a=Math.log(2), c=16*Math.floor(Math.log(u)/a), i=Math.floor(c/a), h=16*u-c, (n=new X).writeInt(this.scalarType), n.writeShort(u), n.writeShort(c), n.writeShort(i), n.writeShort(h), r=16*u, s=n.pos+r, o=null, f=[], t)for(l=t[d], n.writeString(d), n.writeInt(p(l)), n.writeInt(s), n.writeInt(l.length), f=f.concat(l), "head"===d&&(o=s), s+=l.length;s%4;)f.push(0), s++;return n.write(f), e=2981146554-p(n.data), n.pos=o+8, n.writeUInt32(e), n.data}, p=function(t){var e,n,r,i;for(t=k.call(t);t.length%4;)t.push(0);for(n=new X(t), r=e=0, i=t.length;r<i;r+=4)e+=n.readUInt32();return 4294967295&e}, t}(),u={}.hasOwnProperty,f=function(t,e){for(var n in e)u.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t;}return r.prototype=e.prototype, t.prototype=new r, t.__super__=e.prototype, t};c=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}();var d=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="head", e.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()}, e}(),p=function(){function t(n,t){var e,r,i,o,a,s,h,c,l,u,f,d,p,g,m,w,y,v;switch(this.platformID=n.readUInt16(), this.encodingID=n.readShort(), this.offset=t+n.readInt(), l=n.pos, n.pos=this.offset, this.format=n.readUInt16(), this.length=n.readUInt16(), this.language=n.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;m<256;s=++m)this.codeMap[s]=n.readByte();break;case 4:for(f=n.readUInt16(), u=f/2, n.pos+=6, i=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), n.pos+=2, p=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), h=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), c=function(){var t,e;for(e=[], s=t=0;0<=u?t<u:u<t;s=0<=u?++t:--t)e.push(n.readUInt16());return e}(), r=(this.length-n.pos+this.offset)/2, a=function(){var t,e;for(e=[], s=t=0;0<=r?t<r:r<t;s=0<=r?++t:--t)e.push(n.readUInt16());return e}(), s=w=0, v=i.length;w<v;s=++w)for(g=i[s], e=y=d=p[s];d<=g?y<=g:g<=y;e=d<=g?++y:--y)0===c[s]?o=e+h[s]:0!==(o=a[c[s]/2+(e-d)-(u-s)]||0)&&(o+=h[s]), this.codeMap[e]=65535&o;}n.pos=l;}return t.encode=function(t,e){var n,r,i,o,a,s,h,c,l,u,f,d,p,g,m,w,y,v,b,x,S,k,_,A,I,C,T,F,P,E,q,O,B,R,j,D,M,U,N,z,L,H,W,G,V,Y;switch(F=new X, o=Object.keys(t).sort(function(t,e){return t-e}), e){case"macroman":for(p=0, g=function(){var t,e;for(e=[], d=t=0;t<256;d=++t)e.push(0);return e}(), w={0:0}, i={}, P=0, B=o.length;P<B;P++)null==w[W=t[r=o[P]]]&&(w[W]=++p), i[r]={old:t[r],new:w[t[r]]}, g[r]=w[t[r]];return F.writeUInt16(1), F.writeUInt16(0), F.writeUInt32(12), F.writeUInt16(0), F.writeUInt16(262), F.writeUInt16(0), F.write(g), {charMap:i,subtable:F.data,maxGlyphID:p+1};case"unicode":for(C=[], l=[], w={}, n={}, m=h=null, E=y=0, R=o.length;E<R;E++)null==w[b=t[r=o[E]]]&&(w[b]=++y), n[r]={old:b,new:w[b]}, a=w[b]-r, null!=m&&a===h||(m&&l.push(m), C.push(r), h=a), m=r;
21801for(m&&l.push(m), l.push(65535), C.push(65535), A=2*(_=C.length), k=2*Math.pow(Math.log(_)/Math.LN2,2), u=Math.log(k/2)/Math.LN2, S=2*_-k, s=[], x=[], f=[], d=q=0, j=C.length;q<j;d=++q){if(I=C[d], c=l[d], 65535===I){s.push(0), x.push(0);break}if(32768<=I-(T=n[I].new))for(s.push(0), x.push(2*(f.length+_-d)), r=O=I;I<=c?O<=c:c<=O;r=I<=c?++O:--O)f.push(n[r].new);else s.push(T-I), x.push(0);}for(F.writeUInt16(3), F.writeUInt16(1), F.writeUInt32(12), F.writeUInt16(4), F.writeUInt16(16+8*_+2*f.length), F.writeUInt16(0), F.writeUInt16(A), F.writeUInt16(k), F.writeUInt16(u), F.writeUInt16(S), L=0, D=l.length;L<D;L++)r=l[L], F.writeUInt16(r);for(F.writeUInt16(0), H=0, M=C.length;H<M;H++)r=C[H], F.writeUInt16(r);for(G=0, U=s.length;G<U;G++)a=s[G], F.writeUInt16(a);for(V=0, N=x.length;V<N;V++)v=x[V], F.writeUInt16(v);for(Y=0, z=f.length;Y<z;Y++)p=f[Y], F.writeUInt16(p);return{charMap:n,subtable:F.data,maxGlyphID:y+1}}}, t}(),m=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="cmap", e.prototype.parse=function(t){var e,n,r;for(t.pos=this.offset, this.version=t.readUInt16(), n=t.readUInt16(), this.tables=[], this.unicode=null, r=0;0<=n?r<n:n<r;0<=n?++r:--r)e=new p(t,this.offset), this.tables.push(e), e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0}, e.encode=function(t,e){var n,r;return null==e&&(e="macroman"), n=p.encode(t,e), (r=new X).writeUInt16(0), r.writeUInt16(1), n.table=r.data.concat(n.subtable), n}, e}(),g=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="hhea", e.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()}, e}(),w=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="OS/2", e.prototype.parse=function(n){if(n.pos=this.offset, this.version=n.readUInt16(), this.averageCharWidth=n.readShort(), this.weightClass=n.readUInt16(), this.widthClass=n.readUInt16(), this.type=n.readShort(), this.ySubscriptXSize=n.readShort(), this.ySubscriptYSize=n.readShort(), this.ySubscriptXOffset=n.readShort(), this.ySubscriptYOffset=n.readShort(), this.ySuperscriptXSize=n.readShort(), this.ySuperscriptYSize=n.readShort(), this.ySuperscriptXOffset=n.readShort(), this.ySuperscriptYOffset=n.readShort(), this.yStrikeoutSize=n.readShort(), this.yStrikeoutPosition=n.readShort(), this.familyClass=n.readShort(), this.panose=function(){var t,e;for(e=[], t=0;t<10;++t)e.push(n.readByte());return e}(), this.charRange=function(){var t,e;for(e=[], t=0;t<4;++t)e.push(n.readInt());return e}(), this.vendorID=n.readString(4), this.selection=n.readShort(), this.firstCharIndex=n.readShort(), this.lastCharIndex=n.readShort(), 0<this.version&&(this.ascent=n.readShort(), this.descent=n.readShort(), this.lineGap=n.readShort(), this.winAscent=n.readShort(), this.winDescent=n.readShort(), this.codePageRange=function(){var t,e;for(e=[], t=0;t<2;++t)e.push(n.readInt());return e}(), 1<this.version))return this.xHeight=n.readShort(), this.capHeight=n.readShort(), this.defaultChar=n.readShort(), this.breakChar=n.readShort(), this.maxContext=n.readShort()}, e}(),y=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="post", e.prototype.parse=function(r){var t,e,n,i;switch(r.pos=this.offset, this.format=r.readInt(), this.italicAngle=r.readInt(), this.underlinePosition=r.readShort(), this.underlineThickness=r.readShort(), this.isFixedPitch=r.readInt(), this.minMemType42=r.readInt(), this.maxMemType42=r.readInt(), this.minMemType1=r.readInt(), this.maxMemType1=r.readInt(), this.format){case 65536:break;case 131072:for(e=r.readUInt16(), this.glyphNameIndex=[], n=0;0<=e?n<e:e<n;0<=e?++n:--n)this.glyphNameIndex.push(r.readUInt16());for(this.names=[], i=[];r.pos<this.offset+this.length;)t=r.readByte(), i.push(this.names.push(r.readString(t)));return i;case 151552:return e=r.readUInt16(), this.offsets=r.read(e);case 196608:break;case 262144:return this.map=function(){var t,e,n;for(n=[], t=0, e=this.file.maxp.numGlyphs;0<=e?t<e:e<t;0<=e?++t:--t)n.push(r.readUInt32());return n}.call(this)}}, e}(),v=function(t,e){this.raw=t, this.length=t.length, this.platformID=e.platformID, this.encodingID=e.encodingID, this.languageID=e.languageID;},b=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="name", e.prototype.parse=function(t){var e,n,r,i,o,a,s,h,c,l,u,f;for(t.pos=this.offset, t.readShort(), e=t.readShort(), a=t.readShort(), n=[], i=c=0;0<=e?c<e:e<c;i=0<=e?++c:--c)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+a+t.readShort()});for(s={}, i=l=0, u=n.length;l<u;i=++l)r=n[i], t.pos=r.offset, h=t.readString(r.length), o=new v(h,r), null==s[f=r.nameID]&&(s[f]=[]), s[r.nameID].push(o);return this.strings=s, this.copyright=s[0], this.fontFamily=s[1], this.fontSubfam
21801ily=s[2], this.uniqueSubfamily=s[3], this.fontName=s[4], this.version=s[5], this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,""), this.trademark=s[7], this.manufacturer=s[8], this.designer=s[9], this.description=s[10], this.vendorUrl=s[11], this.designerUrl=s[12], this.license=s[13], this.licenseUrl=s[14], this.preferredFamily=s[15], this.preferredSubfamily=s[17], this.compatibleFull=s[18], this.sampleText=s[19]}, e}(),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="maxp", e.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()}, e}(),S=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="hmtx", e.prototype.parse=function(n){var t,r,i,e,o,a,s;for(n.pos=this.offset, this.metrics=[], e=0, a=this.file.hhea.numberOfMetrics;0<=a?e<a:a<e;0<=a?++e:--e)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics, this.leftSideBearings=function(){var t,e;for(e=[], t=0;0<=r?t<r:r<t;0<=r?++t:--t)e.push(n.readInt16());return e}(), this.widths=function(){var t,e,n,r;for(r=[], t=0, e=(n=this.metrics).length;t<e;t++)i=n[t], r.push(i.advance);return r}.call(this), t=this.widths[this.widths.length-1], s=[], o=0;0<=r?o<r:r<o;0<=r?++o:--o)s.push(this.widths.push(t));return s}, e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}}, e}(),k=[].slice,_=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="glyf", e.prototype.parse=function(t){return this.cache={}}, e.prototype.glyphFor=function(t){var e,n,r,i,o,a,s,h,c,l;return(t=t)in this.cache?this.cache[t]:(i=this.file.loca, e=this.file.contents, n=i.indexOf(t), 0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n, o=(a=new X(e.read(r))).readShort(), h=a.readShort(), l=a.readShort(), s=a.readShort(), c=a.readShort(), this.cache[t]=-1===o?new I(a,h,l,s,c):new A(a,o,h,l,s,c), this.cache[t]))}, e.prototype.encode=function(t,e,n){var r,i,o,a,s;for(o=[], i=[], a=0, s=e.length;a<s;a++)r=t[e[a]], i.push(o.length), r&&(o=o.concat(r.encode(n)));return i.push(o.length), {table:o,offsets:i}}, e}(),A=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}(),I=function(){function t(t,e,n,r,i){var o,a;for(this.raw=t, this.xMin=e, this.yMin=n, this.xMax=r, this.yMax=i, this.compound=!0, this.glyphIDs=[], this.glyphOffsets=[], o=this.raw;a=o.readShort(), this.glyphOffsets.push(o.pos), this.glyphIDs.push(o.readShort()), 32&a;)o.pos+=1&a?4:2, 128&a?o.pos+=8:64&a?o.pos+=4:8&a&&(o.pos+=2);}return t.prototype.encode=function(t){var e,n,r,i,o;for(n=new X(k.call(this.raw.data)), e=r=0, i=(o=this.glyphIDs).length;r<i;e=++r)o[e], n.pos=this.glyphOffsets[e];return n.data}, t}(),C=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return f(e,c), e.prototype.tag="loca", e.prototype.parse=function(r){var t;return r.pos=this.offset, t=this.file.head.indexToLocFormat, this.offsets=0===t?function(){var t,e,n;for(n=[], t=0, e=this.length;t<e;t+=2)n.push(2*r.readUInt16());return n}.call(this):function(){var t,e,n;for(n=[], t=0, e=this.length;t<e;t+=4)n.push(r.readUInt32());return n}.call(this)}, e.prototype.indexOf=function(t){return this.offsets[t]}, e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]}, e.prototype.encode=function(t,e){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,o=0;o<n.length;++o)if(n[o]=r, i<e.length&&e[i]==o){++i, n[o]=r;var a=this.offsets[o],s=this.offsets[o+1]-a;0<s&&(r+=s);}for(var h=new Array(4*n.length),c=0;c<n.length;
21801++c)h[4*c+3]=255&n[c], h[4*c+2]=(65280&n[c])>>8, h[4*c+1]=(16711680&n[c])>>16, h[4*c]=(4278190080&n[c])>>24;return h}, e}(),T=function(){function t(t){this.font=t, this.subset={}, this.unicodes={}, this.next=33;}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap, t={}, i=this.subset)n=i[e], t[e]=r[n];return t}, t.prototype.glyphsFor=function(t){var e,n,r,i,o,a,s;for(r={}, o=0, a=t.length;o<a;o++)r[i=t[o]]=this.font.glyf.glyphFor(i);for(i in e=[], r)(null!=(n=r[i])?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(0<e.length)for(i in s=this.glyphsFor(e))n=s[i], r[i]=n;return r}, t.prototype.encode=function(t){var e,n,r,i,o,a,s,h,c,l,u,f,d,p,g;for(n in e=m.encode(this.generateCmap(),"unicode"), i=this.glyphsFor(t), u={0:0}, g=e.charMap)u[(a=g[n]).old]=a.new;for(f in l=e.maxGlyphID, i)f in u||(u[f]=l++);return h=function(t){var e,n;for(e in n={}, t)n[t[e]]=e;return n}(u), c=Object.keys(h).sort(function(t,e){return t-e}), d=function(){var t,e,n;for(n=[], t=0, e=c.length;t<e;t++)o=c[t], n.push(h[o]);return n}(), r=this.font.glyf.encode(i,d,u), s=this.font.loca.encode(r.offsets,d), p={cmap:this.font.cmap.raw(),glyf:r.table,loca:s,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.raw()}, this.font.os2.exists&&(p["OS/2"]=this.font.os2.raw()), this.font.directory.encode(p)}, t}();t.API.PDFObject=function(){var o;function a(){}return o=function(t,e){return(Array(e+1).join("0")+t).slice(-e)}, a.convert=function(r){var i,t,e,n;if(Array.isArray(r))return"["+function(){var t,e,n;for(n=[], t=0, e=r.length;t<e;t++)i=r[t], n.push(a.convert(i));return n}().join(" ")+"]";if("string"==typeof r)return"/"+r;if(null!=r?r.isString:void 0)return"("+r+")";if(r instanceof Date)return"(D:"+o(r.getUTCFullYear(),4)+o(r.getUTCMonth(),2)+o(r.getUTCDate(),2)+o(r.getUTCHours(),2)+o(r.getUTCMinutes(),2)+o(r.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(r)){for(t in e=["<<"], r)n=r[t], e.push("/"+t+" "+a.convert(n));return e.push(">>"), e.join("\n")}return""+r}, a}();}($), pt="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")(), gt=function(){var c,n,r;function i(t){var e,n,r,i,o,a,s,h,c,l,u,f,d,p;for(this.data=t, this.pos=8, this.palette=[], this.imgData=[], this.transparency={}, this.animation=null, this.text={}, a=null;;){switch(e=this.readUInt32(), c=function(){var t,e;for(e=[], t=0;t<4;++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"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":a&&this.animation.frames.push(a), this.pos+=4, a={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()}, o=this.readUInt16(), i=this.readUInt16()||100, a.delay=1e3*o/i, a.disposeOp=this.data[this.pos++], a.blendOp=this.data[this.pos++], a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===c&&(this.pos+=4, e-=4), t=(null!=a?a.data:void 0)||this.imgData, f=0;0<=e?f<e:e<f;0<=e?++f:--f)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={}, this.colorType){case 3:if(r=this.palette.length/3, this.transparency.indexed=this.read(e), this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(l=r-this.transparency.indexed.length))for(d=0;0<=l?d<l:l<d;0<=l?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e);}break;case"tEXt":s=(u=this.read(e)).indexOf(0), h=String.fromCharCode.apply(String,u.slice(0,s)), this.text[h]=String.fromCharCode.apply(String,u.slice(s+1));break;case"IEND":return a&&this.animation.frames.push(a), 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===(p=this.colorType)||6===p, n=this.colors+(this.hasAlphaChannel?1:0), this.pixelBitlength=this.bits*n, this.colorSpace
21801=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this), void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e;}if(this.pos+=4, this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e), (r=new XMLHttpRequest).open("GET",t,!0), r.responseType="arraybuffer", r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)), "function"==typeof(null!=e?e.getContext:void 0)&&t.render(e), "function"==typeof n?n(t):void 0}, r.send(null)}, i.prototype.read=function(t){var e,n;for(n=[], e=0;0<=t?e<t:t<e;0<=t?++e:--e)n.push(this.data[this.pos++]);return n}, i.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]}, i.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]}, i.prototype.decodePixels=function(E){var q=this.pixelBitlength/8,O=new Uint8Array(this.width*this.height*q),B=0,R=this;if(null==E&&(E=this.imgData), 0===E.length)return new Uint8Array(0);function t(t,e,n,r){var i,o,a,s,h,c,l,u,f,d,p,g,m,w,y,v,b,x,S,k,_,A=Math.ceil((R.width-t)/n),I=Math.ceil((R.height-e)/r),C=R.width==A&&R.height==I;for(w=q*A, g=C?O:new Uint8Array(w*I), c=E.length, o=m=0;m<I&&B<c;){switch(E[B++]){case 0:for(s=b=0;b<w;s=b+=1)g[o++]=E[B++];break;case 1:for(s=x=0;x<w;s=x+=1)i=E[B++], h=s<q?0:g[o-q], g[o++]=(i+h)%256;break;case 2:for(s=S=0;S<w;s=S+=1)i=E[B++], a=(s-s%q)/q, y=m&&g[(m-1)*w+a*q+s%q], g[o++]=(y+i)%256;break;case 3:for(s=k=0;k<w;s=k+=1)i=E[B++], a=(s-s%q)/q, h=s<q?0:g[o-q], y=m&&g[(m-1)*w+a*q+s%q], g[o++]=(i+Math.floor((h+y)/2))%256;break;case 4:for(s=_=0;_<w;s=_+=1)i=E[B++], a=(s-s%q)/q, h=s<q?0:g[o-q], 0===m?y=v=0:(y=g[(m-1)*w+a*q+s%q], v=a&&g[(m-1)*w+(a-1)*q+s%q]), l=h+y-v, u=Math.abs(l-h), d=Math.abs(l-y), p=Math.abs(l-v), f=u<=d&&u<=p?h:d<=p?y:v, g[o++]=(i+f)%256;break;default:throw new Error("Invalid filter algorithm: "+E[B-1])}if(!C){var T=((e+m*r)*R.width+t)*q,F=m*w;for(s=0;s<A;s+=1){for(var P=0;P<q;P+=1)O[T++]=g[F++];T+=(n-1)*q;}}m++;}}return E=(E=new kt(E)).getBytes(), 1==R.interlaceMethod?(t(0,0,8,8), t(4,0,8,8), t(0,4,4,8), t(2,0,4,4), t(0,2,2,4), t(1,0,2,2), t(0,1,1,2)):t(0,0,1,1), O}, i.prototype.decodePalette=function(){var t,e,n,r,i,o,a,s,h;for(n=this.palette, o=this.transparency.indexed||[], i=new Uint8Array((o.length||0)+n.length), r=0, n.length, e=a=t=0, s=n.length;a<s;e=a+=3)i[r++]=n[e], i[r++]=n[e+1], i[r++]=n[e+2], i[r++]=null!=(h=o[t++])?h:255;return i}, i.prototype.copyToImageData=function(t,e){var n,r,i,o,a,s,h,c,l,u,f;if(r=this.colors, l=null, n=this.hasAlphaChannel, this.palette.length&&(l=null!=(f=this._decodedPalette)?f:this._decodedPalette=this.decodePalette(), r=4, n=!0), c=(i=t.data||t).length, a=l||e, o=s=0, 1===r)for(;o<c;)h=l?4*e[o/4]:s, u=a[h++], i[o++]=u, i[o++]=u, i[o++]=u, i[o++]=n?a[h++]:255, s=h;else for(;o<c;)h=l?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;}, i.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4), this.copyToImageData(t,this.decodePixels()), t};try{n=pt.document.createElement("canvas"), r=n.getContext("2d");}catch(t){return-1}return c=function(t){var e;return r.width=t.width, r.height=t.height, r.clearRect(0,0,t.width,t.height), r.putImageData(t,0,0), (e=new Image).src=n.toDataURL(), e}, i.prototype.decodeFrames=function(t){var e,n,r,i,o,a,s,h;if(this.animation){for(h=[], n=o=0, a=(s=this.animation.frames).length;o<a;n=++o)e=s[n], r=t.createImageData(e.width,e.height), i=this.decodePixels(new Uint8Array(e.data)), this.copyToImageData(r,i), e.imageData=r, h.push(e.image=c(r));return h}}, i.prototype.renderFrame=function(t,e){var n,r,i;return n=(r=this.animation.frames)[e], i=r[e-1], 0===e&&t.clearRect(0,0,this.width,this.height), 1===(null!=i?i.disposeOp:void 0)?t.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&t.putImageData(i.imageData,i.xOffset,i.yOffset), 0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height), t.drawImage(n.image,n.xOffset,n.yOffset)}, i.prototype.animate=function(n){var r,i,o,a,s,t,h=this;return i=0, t=this.animation, a=t.numFrames, o=t.frames, s=t.numPlays, (r=function(){var t,e;if(t=i++%a, e=o[t], h.renderFrame(n,t), 1<a&&i/a<s)return h.animation._timeout=setTimeout(r,e.delay)})()}, i.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)}, i.prototype.render=function(t){var e,n;return t._png&&t._png.stopAnimation(), t._png=this, t.width=this.width, t.height=this.height, e=t.getContext("2d"), this.animation?(this.decodeFrames(e), this.animate(e)):(n=e.createImageData(this.width,this.height), this.copyToImageData(n,this.decodePixels()), e.putImageData(n,0,0))}, i}(), pt.PNG=gt;
21802/*
21803   * Extracted from pdf.js
21804   * https://github.com/andreasgal/pdf.js
21805   *
21806   * Copyright (c) 2011 Mozilla Foundation
21807   *
21808   * Contributors: Andreas Gal <[email protected]>
21809   *               Chris G Jones <[email protected]>
21810   *               Shaon Barman <[email protected]>
21811   *               Vivien Nicolas <[email protected]>
21812   *               Justin D'Arcangelo <[email protected]>
21813   *               Yury Delendik
21814   *
21815   * 
21816   */
21817var St=function(){function t(){this.pos=0, this.bufferLength=0, this.eof=!1, this.buffer=null;}return t.prototype={ensureBuffer:function(t){var e=this.buffer,n=e?e.byteLength:0;if(t<n)return e;for(var r=512;r<t;)r<<=1;for(var i=new Uint8Array(r),o=0;o<n;++o)i[o]=e[o];return this.buffer=i},getByte:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock();}return this.buffer[this.pos++]},getBytes:function(t){var e=this.pos;if(t){this.ensureBuffer(e+t);for(var n=e+t;!this.eof&&this.bufferLength<n;)this.readBlock();var r=this.bufferLength;r<n&&(n=r);}else{for(;!this.eof;)this.readBlock();n=this.bufferLength;}return this.pos=n, this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock();}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock();}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1), this.pos+=t;},reset:function(){this.pos=0;}}, t}(),kt=function(){if("undefined"!=typeof Uint32Array){var F=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),P=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),E=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),q=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,5243
2181769,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],O=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return(t.prototype=Object.create(St.prototype)).getBits=function(t){for(var e,n=this.codeSize,r=this.codeBuf,i=this.bytes,o=this.bytesPos;n<t;)void 0===(e=i[o++])&&B("Bad encoding in flate stream"), r|=e<<n, n+=8;return e=r&(1<<t)-1, this.codeBuf=r>>t, this.codeSize=n-=t, this.bytesPos=o, e}, t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,a=this.bytesPos;r<n;){var s;void 0===(s=o[a++])&&B("Bad encoding in flate stream"), i|=s<<r, r+=8;}var h=e[i&(1<<n)-1],c=h>>16,l=65535&h;return(0==r||r<c||0==c)&&B("Bad encoding in flate stream"), this.codeBuf=i>>c, this.codeSize=r-c, this.bytesPos=a, l}, t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;r<e;++r)t[r]>n&&(n=t[r]);for(var i=1<<n,o=new Uint32Array(i),a=1,s=0,h=2;a<=n;++a, s<<=1, h<<=1)for(var c=0;c<e;++c)if(t[c]==a){var l=0,u=s;for(r=0;r<a;++r)l=l<<1|1&u, u>>=1;for(r=l;r<i;r+=h)o[r]=a<<16|c;++s;}return[o,n]}, t.prototype.readBlock=function(){function t(t,e,n,r,i){for(var o=t.getBits(n)+r;0<o--;)e[h++]=i;}var e=this.getBits(3);if(1&e&&(this.eof=!0), 0!=(e>>=1)){var n,r;if(1==e)n=q, r=O;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,a=this.getBits(4)+4,s=Array(F.length),h=0;h<a;)s[F[h++]]=this.getBits(3);for(var c=this.generateHuffmanTable(s),l=0,u=(h=0, i+o),f=new Array(u);h<u;){var d=this.getCode(c);16==d?t(this,f,2,3,l):17==d?t(this,f,3,3,l=0):18==d?t(this,f,7,11,l=0):f[h++]=l=d;}n=this.generateHuffmanTable(f.slice(0,i)), r=this.generateHuffmanTable(f.slice(i,u));}else B("Unknown block type in flate stream");for(var p=(I=this.buffer)?I.length:0,g=this.bufferLength;;){var m=this.getCode(n);if(m<256)p<=g+1&&(p=(I=this.ensureBuffer(g+1)).length), I[g++]=m;else{if(256==m)return void(this.bufferLength=g);var w=(m=P[m-=257])>>16;0<w&&(w=this.getBits(w));l=(65535&m)+w;m=this.getCode(r), 0<(w=(m=E[m])>>16)&&(w=this.getBits(w));var y=(65535&m)+w;p<=g+l&&(p=(I=this.ensureBuffer(g+l)).length);for(var v=0;v<l;++v, ++g)I[g]=I[g-y];}}}else{var b,x=this.bytes,S=this.bytesPos;void 0===(b=x[S++])&&B("Bad block header in flate stream");var k=b;void 0===(b=x[S++])&&B("Bad block header in flate stream"), k|=b<<8, void 0===(b=x[S++])&&B("Bad block header in flate stream");var _=b;void 0===(b=x[S++])&&B("Bad block header in flate stream"), (_|=b<<8)!=(65535&~k)&&B("Bad uncompressed block length in flate stream"), this.codeBuf=0, this.codeSize=0;var A=this.bufferLength,I=this.ensureBuffer(A+k),C=A+k;this.bufferLength=C;for(var T=A;T<C;++T){if(void 0===(b=x[S++])){this.eof=!0;break}I[T]=b;}this.bytesPos=S;}}, t}function B(t){throw new Error(t)}function t(t){var e=0,n=t[e++],r=t[e++];-1!=n&&-1!=r||B("Invalid header in flate stream"), 8!=(15&n)&&B("Unknown compression method in flate stream"), ((n<<8)+r)%31!=0&&B("Bad FCHECK in flate stream"), 32&r&&B("FDICT bit set in flate stream"), this.bytes=t, this.bytesPos=2, this.codeSize=0, this.codeBuf=0, St.call(this);}}();return function(t){if("object"!=typeof t.console){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i);}var s,h,c,l,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
21817+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,h="",c=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63, n=o>>12&63, r=o>>6&63, i=63&o, c[s++]=u.charAt(e)+u.charAt(n)+u.charAt(r)+u.charAt(i), a<t.length;);h=c.join("");var l=t.length%3;return(l?h.slice(0,l-3):h)+"===".slice(l||3)}), void 0===t.atob&&(t.atob=function(t){var e,n,r,i,o,a,s=0,h=0,c=[];if(!t)return t;for(t+="";e=(a=u.indexOf(t.charAt(s++))<<18|u.indexOf(t.charAt(s++))<<12|(i=u.indexOf(t.charAt(s++)))<<6|(o=u.indexOf(t.charAt(s++))))>>16&255, n=a>>8&255, r=255&a, c[h++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r), s<t.length;);return c.join("")}), Array.prototype.map||(Array.prototype.map=function(t){if(null==this||"function"!=typeof t)throw new TypeError;for(var e=Object(this),n=e.length>>>0,r=new Array(n),i=1<arguments.length?arguments[1]:void 0,o=0;o<n;o++)o in e&&(r[o]=t.call(i,e[o],o,e));return r}), Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}), Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(null==this||"function"!=typeof t)throw new TypeError;for(var n=Object(this),r=n.length>>>0,i=0;i<r;i++)i in n&&t.call(e,n[i],i,n);}), Object.keys||(Object.keys=(s=Object.prototype.hasOwnProperty, h=!{toString:null}.propertyIsEnumerable("toString"), l=(c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length, function(t){if("object"!=typeof t&&("function"!=typeof t||null===t))throw new TypeError;var e,n,r=[];for(e in t)s.call(t,e)&&r.push(e);if(h)for(n=0;n<l;n++)s.call(t,c[n])&&r.push(c[n]);return r})), "function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var n=arguments[e];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t}), String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}), String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}), String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")});}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof commonjsGlobal&&commonjsGlobal||Function('return typeof this === "object" && this.content')()||Function("return this")()), $});
21818});
21819
21820var jspdf_min_1 = jspdf_min.jsPDF;
21821var jspdf_min_2 = jspdf_min.saveAs;
21822var jspdf_min_3 = jspdf_min.GifWriter;
21823var jspdf_min_4 = jspdf_min.GifReader;
21824
21825var Path = createCommonjsModule(function (module, exports) {
21826Object.defineProperty(exports, "__esModule", {
21827    value: true
21828});
21829var PATH = exports.PATH = {
21830    VECTOR: 0,
21831    BEZIER_CURVE: 1,
21832    CIRCLE: 2
21833};
21834});
21835
21836unwrapExports(Path);
21837var Path_1 = Path.PATH;
21838
21839var Color_1 = createCommonjsModule(function (module, exports) {
21840Object.defineProperty(exports, "__esModule", {
21841    value: true
21842});
21843
21844var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
21845
21846var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
21847
21848function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21849
21850var HEX3 = /^#([a-f0-9]{3})$/i;
21851var hex3 = function hex3(value) {
21852    var match = value.match(HEX3);
21853    if (match) {
21854        return [parseInt(match[1][0] + match[1][0], 16), parseInt(match[1][1] + match[1][1], 16), parseInt(match[1][2] + match[1][2], 16), null];
21855    }
21856    return false;
21857};
21858
21859var HEX6 = /^#([a-f0-9]{6})$/i;
21860var hex6 = function hex6(value) {
21861    var match = value.match(HEX6);
21862    if (match) {
21863        return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
21864    }
21865    return false;
21866};
21867
21868var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
21869var rgb = function rgb(value) {
21870    var match = value.match(RGB);
21871    if (match) {
21872        return [Number(match[1]), Number(match[2]), Number(match[3]), null];
21873    }
21874    return false;
21875};
21876
21877var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
21878var rgba = function rgba(value) {
21879    var match = value.match(RGBA);
21880    if (match && match.length > 4) {
21881        return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
21882    }
21883    return false;
21884};
21885
21886var fromArray = function fromArray(array) {
21887    return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
21888};
21889
21890var namedColor = function namedColor(name) {
21891    var color = NAMED_COLORS[name.toLowerCase()];
21892    return color ? color : false;
21893};
21894
21895var Color = function () {
21896    function Color(value) {
21897        _classCallCheck(this, Color);
21898
21899        var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
21900            _ref2 = _slicedToArray(_ref, 4),
21901            r = _ref2[0],
21902            g = _ref2[1],
21903            b = _ref2[2],
21904            a = _ref2[3];
21905
21906        this.r = r;
21907        this.g = g;
21908        this.b = b;
21909        this.a = a;
21910    }
21911
21912    _createClass(Color, [{
21913        key: 'isTransparent',
21914        value: function isTransparent() {
21915            return this.a === 0;
21916        }
21917    }, {
21918        key: 'toString',
21919        value: function toString() {
21920            return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
21921        }
21922    }]);
21923
21924    return Color;
21925}();
21926
21927exports.default = Color;
21928
21929
21930var NAMED_COLORS = {
21931    transparent: [0, 0, 0, 0],
21932    aliceblue: [240, 248, 255, null],
21933    antiquewhite: [250, 235, 215, null],
21934    aqua: [0, 255, 255, null],
21935    aquamarine: [127, 255, 212, null],
21936    azure: [240, 255, 255, null],
21937    beige: [245, 245, 220, null],
21938    bisque: [255, 228, 196, null],
21939    black: [0, 0, 0, null],
21940    blanchedalmond: [255, 235, 205, null],
21941    blue: [0, 0, 255, null],
21942    blueviolet: [138, 43, 226, null],
21943    brown: [165, 42, 42, null],
21944    burlywood: [222, 184, 135, null],
21945    cadetblue: [95, 158, 160, null],
21946    chartreuse: [127, 255, 0, null],
21947    chocolate: [210, 105, 30, null],
21948    coral: [255, 127, 80, null],
21949    cornflowerblue: [100, 149, 237, null],
21950    cornsilk: [255, 248, 220, null],
21951    crimson: [220, 20, 60, null],
21952    cyan: [0, 255, 255, null],
21953    darkblue: [0, 0, 139, null],
21954    darkcyan: [0, 139, 139, null],
21955    darkgoldenrod: [184, 134, 11, null],
21956    darkgray: [169, 169, 169, null],
21957    darkgreen: [0, 100, 0, null],
21958    darkgrey: [169, 169, 169, null],
21959    darkkhaki: [189, 183, 107, null],
21960    darkmagenta: [139, 0, 139, null],
21961    darkolivegreen: [85, 107, 47, null],
21962    darkorange: [255, 140, 0, null],
21963    darkorchid: [153, 50, 204, null],
21964    darkred: [139, 0, 0, null],
21965    darksalmon: [233, 150, 122, null],
21966    darkseagreen: [143, 188, 143, null],
21967    darkslateblue: [72, 61, 139, null],
21968    darkslategray: [47, 79, 79, null],
21969    darkslategrey: [47, 79, 79, null],
21970    darkturquoise: [0, 206, 209, null],
21971    darkviolet: [148, 0, 211, null],
21972    deeppink: [255, 20, 147, null],
21973    deepskyblue: [0, 191, 255, null],
21974    dimgray: [105, 105, 105, null],
21975    dimgrey: [105, 105, 105, null],
21976    dodgerblue: [30, 144, 255, null],
21977    firebrick: [178, 34, 34, null],
21978    floralwhite: [255, 250, 240, null],
21979    forestgreen: [34, 139, 34, null],
21980    fuchsia: [255, 0, 255, null],
21981    gainsboro: [220, 220, 220, null],
21982    ghostwhite: [248, 248, 255, null],
21983    gold: [255, 215, 0, null],
21984    goldenrod: [218, 165, 32, null],
21985    gray: [128, 128, 128, null],
21986    green: [0, 128, 0, null],
21987    greenyellow: [173, 255, 47, null],
21988    grey: [128, 128, 128, null],
21989    honeydew: [240, 255, 240, null],
21990    hotpink: [255, 105, 180, null],
21991    indianred: [205, 92, 92, null],
21992    indigo: [75, 0, 130, null],
21993    ivory: [255, 255, 240, null],
21994    khaki: [240, 230, 140, null],
21995    lavender: [230, 230, 250, null],
21996    lavenderblush: [255, 240, 245, null],
21997    lawngreen: [124, 252, 0, null],
21998    lemonchiffon: [255, 250, 205, null],
21999    lightblue: [173, 216, 230, null],
22000    lightcoral: [240, 128, 128, null],
22001    lightcyan: [224, 255, 255, null],
22002    lightgoldenrodyellow: [250, 250, 210, null],
22003    lightgray: [211, 211, 211, null],
22004    lightgreen: [144, 238, 144, null],
22005    lightgrey: [211, 211, 211, null],
22006    lightpink: [255, 182, 193, null],
22007    lightsalmon: [255, 160, 122, null],
22008    lightseagreen: [32, 178, 170, null],
22009    lightskyblue: [135, 206, 250, null],
22010    lightslategray: [119, 136, 153, null],
22011    lightslategrey: [119, 136, 153, null],
22012    lightsteelblue: [176, 196, 222, null],
22013    lightyellow: [255, 255, 224, null],
22014    lime: [0, 255, 0, null],
22015    limegreen: [50, 205, 50, null],
22016    linen: [250, 240, 230, null],
22017    magenta: [255, 0, 255, null],
22018    maroon: [128, 0, 0, null],
22019    mediumaquamarine: [102, 205, 170, null],
22020    mediumblue: [0, 0, 205, null],
22021    mediumorchid: [186, 85, 211, null],
22022    mediumpurple: [147, 112, 219, null],
22023    mediumseagreen: [60, 179, 113, null],
22024    mediumslateblue: [123, 104, 238, null],
22025    mediumspringgreen: [0, 250, 154, null],
22026    mediumturquoise: [72, 209, 204, null],
22027    mediumvioletred: [199, 21, 133, null],
22028    midnightblue: [25, 25, 112, null],
22029    mintcream: [245, 255, 250, null],
22030    mistyrose: [255, 228, 225, null],
22031    moccasin: [255, 228, 181, null],
22032    navajowhite: [255, 222, 173, null],
22033    navy: [0, 0, 128, null],
22034    oldlace: [253, 245, 230, null],
22035    olive: [128, 128, 0, null],
22036    olivedrab: [107, 142, 35, null],
22037    orange: [255, 165, 0, null],
22038    orangered: [255, 69, 0, null],
22039    orchid: [218, 112, 214, null],
22040    palegoldenrod: [238, 232, 170, null],
22041    palegreen: [152, 251, 152, null],
22042    paleturquoise: [175, 238, 238, null],
22043    palevioletred: [219, 112, 147, null],
22044    papayawhip: [255, 239, 213, null],
22045    peachpuff: [255, 218, 185, null],
22046    peru: [205, 133, 63, null],
22047    pink: [255, 192, 203, null],
22048    plum: [221, 160, 221, null],
22049    powderblue: [176, 224, 230, null],
22050    purple: [128, 0, 128, null],
22051    rebeccapurple: [102, 51, 153, null],
22052    red: [255, 0, 0, null],
22053    rosybrown: [188, 143, 143, null],
22054    royalblue: [65, 105, 225, null],
22055    saddlebrown: [139, 69, 19, null],
22056    salmon: [250, 128, 114, null],
22057    sandybrown: [244, 164, 96, null],
22058    seagreen: [46, 139, 87, null],
22059    seashell: [255, 245, 238, null],
22060    sienna: [160, 82, 45, null],
22061    silver: [192, 192, 192, null],
22062    skyblue: [135, 206, 235, null],
22063    slateblue: [106, 90, 205, null],
22064    slategray: [112, 128, 144, null],
22065    slategrey: [112, 128, 144, null],
22066    snow: [255, 250, 250, null],
22067    springgreen: [0, 255, 127, null],
22068    steelblue: [70, 130, 180, null],
22069    tan: [210, 180, 140, null],
22070    teal: [0, 128, 128, null],
22071    thistle: [216, 191, 216, null],
22072    tomato: [255, 99, 71, null],
22073    turquoise: [64, 224, 208, null],
22074    violet: [238, 130, 238, null],
22075    wheat: [245, 222, 179, null],
22076    white: [255, 255, 255, null],
22077    whitesmoke: [245, 245, 245, null],
22078    yellow: [255, 255, 0, null],
22079    yellowgreen: [154, 205, 50, null]
22080};
22081
22082var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
22083});
22084
22085unwrapExports(Color_1);
22086var Color_2 = Color_1.TRANSPARENT;
22087
22088var textDecoration = createCommonjsModule(function (module, exports
22088) {
22089Object.defineProperty(exports, "__esModule", {
22090    value: true
22091});
22092exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
22093
22094
22095
22096var _Color2 = _interopRequireDefault(Color_1);
22097
22098function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22099
22100var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
22101    SOLID: 0,
22102    DOUBLE: 1,
22103    DOTTED: 2,
22104    DASHED: 3,
22105    WAVY: 4
22106};
22107
22108var TEXT_DECORATION = exports.TEXT_DECORATION = {
22109    NONE: null
22110};
22111
22112var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
22113    UNDERLINE: 1,
22114    OVERLINE: 2,
22115    LINE_THROUGH: 3,
22116    BLINK: 4
22117};
22118
22119var parseLine = function parseLine(line) {
22120    switch (line) {
22121        case 'underline':
22122            return TEXT_DECORATION_LINE.UNDERLINE;
22123        case 'overline':
22124            return TEXT_DECORATION_LINE.OVERLINE;
22125        case 'line-through':
22126            return TEXT_DECORATION_LINE.LINE_THROUGH;
22127    }
22128    return TEXT_DECORATION_LINE.BLINK;
22129};
22130
22131var parseTextDecorationLine = function parseTextDecorationLine(line) {
22132    if (line === 'none') {
22133        return null;
22134    }
22135
22136    return line.split(' ').map(parseLine);
22137};
22138
22139var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
22140    switch (style) {
22141        case 'double':
22142            return TEXT_DECORATION_STYLE.DOUBLE;
22143        case 'dotted':
22144            return TEXT_DECORATION_STYLE.DOTTED;
22145        case 'dashed':
22146            return TEXT_DECORATION_STYLE.DASHED;
22147        case 'wavy':
22148            return TEXT_DECORATION_STYLE.WAVY;
22149    }
22150    return TEXT_DECORATION_STYLE.SOLID;
22151};
22152
22153var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
22154    var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
22155    if (textDecorationLine === null) {
22156        return TEXT_DECORATION.NONE;
22157    }
22158
22159    var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
22160    var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
22161
22162    return {
22163        textDecorationLine: textDecorationLine,
22164        textDecorationColor: textDecorationColor,
22165        textDecorationStyle: textDecorationStyle
22166    };
22167};
22168});
22169
22170unwrapExports(textDecoration);
22171var textDecoration_1 = textDecoration.parseTextDecoration;
22172var textDecoration_2 = textDecoration.TEXT_DECORATION_LINE;
22173var textDecoration_3 = textDecoration.TEXT_DECORATION;
22174var textDecoration_4 = textDecoration.TEXT_DECORATION_STYLE;
22175
22176var CanvasRenderer_1 = createCommonjsModule(function (module, exports) {
22177Object.defineProperty(exports, "__esModule", {
22178    value: true
22179});
22180
22181var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
22182
22183
22184
22185
22186
22187function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22188
22189var addColorStops = function addColorStops(gradient, canvasGradient) {
22190    var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
22191        return colorStop.stop;
22192    }));
22193    var f = 1 / Math.max(1, maxStop);
22194    gradient.colorStops.forEach(function (colorStop) {
22195        canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
22196    });
22197};
22198
22199var CanvasRenderer = function () {
22200    function CanvasRenderer(canvas) {
22201        _classCallCheck(this, CanvasRenderer);
22202
22203        this.canvas = canvas ? canvas : document.createElement('canvas');
22204    }
22205
22206    _createClass(CanvasRenderer, [{
22207        key: 'render',
22208        value: function render(options) {
22209            this.ctx = this.canvas.getContext('2d');
22210            this.options = options;
22211            this.canvas.width = Math.floor(options.width * options.scale);
22212            this.canvas.height = Math.floor(options.height * options.scale);
22213            this.canvas.style.width = options.width + 'px';
22214            this.canvas.style.height = options.height + 'px';
22215
22216            this.ctx.scale(this.options.scale, this.options.scale);
22217            this.ctx.translate(-options.x, -options.y);
22218            this.ctx.textBaseline = 'bottom';
22219            options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
22220        }
22221    }, {
22222        key: 'clip',
22223        value: function clip(clipPaths, callback) {
22224            var _this = this;
22225
22226            if (clipPaths.length) {
22227                this.ctx.save();
22228                clipPaths.forEach(function (path) {
22229                    _this.path(path);
22230                    _this.ctx.clip();
22231                });
22232            }
22233
22234            callback();
22235
22236            if (clipPaths.length) {
22237                this.ctx.restore();
22238            }
22239        }
22240    }, {
22241        key: 'drawImage',
22242        value: function drawImage(image, source, destination) {
22243            this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
22244        }
22245    }, {
22246        key: 'drawShape',
22247        value: function drawShape(path, color) {
22248            this.path(path);
22249            this.ctx.fillStyle = color.toString();
22250            this.ctx.fill();
22251        }
22252    }, {
22253        key: 'fill',
22254        value: function fill(color) {
22255            this.ctx.fillStyle = color.toString();
22256            this.ctx.fill();
22257        }
22258    }, {
22259        key: 'getTarget',
22260        value: function getTarget() {
22261            this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0);
22262            return Promise.resolve(this.canvas);
22263        }
22264    }, {
22265        key: 'path',
22266        value: function path(_path) {
22267            var _this2 = this;
22268
22269            this.ctx.beginPath();
22270            if (Array.isArray(_path)) {
22271                _path.forEach(function (point, index) {
22272                    var start = point.type === Path.PATH.VECTOR ? point : point.start;
22273                    if (index === 0) {
22274                        _this2.ctx.moveTo(start.x, start.y);
22275                    } else {
22276                        _this2.ctx.lineTo(start.x, start.y);
22277                    }
22278
22279                    if (point.type === Path.PATH.BEZIER_CURVE) {
22280                        _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
22281                    }
22282                });
22283            } else {
22284                this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
22285            }
22286
22287            this.ctx.closePath();
22288        }
22289    }, {
22290        key: 'rectangle',
22291        value: function rectangle(x, y, width, height, color) {
22292            this.ctx.fillStyle = color.toString();
22293            this.ctx.fillRect(x, y, width, height);
22294        }
22295    }, {
22296        key: 'renderLinearGradient',
22297        value: function renderLinearGradient(bounds, gradient) {
22298            var linearGradient = this.ctx.createLinearGradient(bounds.left + gradient.direction.x1, bounds.top + gradient.direction.y1, bounds.left + gradient.direction.x0, bounds.top + gradient.direction.y0);
22299
22300            addColorStops(gradient, linearGradient);
22301            this.ctx.fillStyle = linearGradient;
22302            this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
22303        }
22304    }, {
22305        key: 'renderRadialGradient',
22306        value: function renderRadialGradient(bounds, gradient) {
22307            var _this3 = this;
22308
22309            var x = bounds.left + gradient.center.x;
22310            var y = bounds.top + gradient.center.y;
22311
22312            var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
22313            if (!radialGradient) {
22314                return;
22315            }
22316
22317            addColorStops(gradient, radialGradient);
22318            this.ctx.fillStyle = radialGradient;
22319
22320            if (gradient.radius.x !== gradient.radius.y) {
22321                // transforms for elliptical radial gradient
22322                var midX = bounds.left + 0.5 * bounds.width;
22323                var midY = bounds.top + 0.5 * bounds.height;
22324                var f = gradient.radius.y / gradient.radius.x;
22325                var invF = 1 / f;
22326
22327                this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
22328                    return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
22329                });
22330            } else {
22331                this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
22332            }
22333        }
22334    }, {
22335        key: 'renderRepeat',
22336        value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
22337            this.path(path);
22338            this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
22339            this.ctx.translate(offsetX, offsetY);
22340            this.ctx.fill();
22341            this.ctx.translate(-offsetX, -offsetY);
22342        }
22343    }, {
22344        key: 'renderTextNode',
22345        value: function renderTextNode(textBounds, color, font, textDecoration$$1, textShadows) {
22346            var _this4 = this;
22347
22348            this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
22349
22350            textBounds.forEach(function (text) {
22351                _this4.ctx.fillStyle = color.toString();
22352                if (textShadows && text.text.trim().length) {
22353                    textShadows.slice(0).reverse().forEach(function (textShadow) {
22354                        _this4.ctx.shadowColor = textShadow.color.toString();
22355                        _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
22356                        _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
22357                        _this4.ctx.shadowBlur = textShadow.blur;
22358
22359                        _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
22360                    });
22361                } else {
22362                    _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
22363                }
22364
22365                if (textDecoration$$1 !== null) {
22366                    var textDecorationColor = textDecoration$$1.textDecorationColor || color;
22367                    textDecoration$$1.textDecorationLine.forEach(function (textDecorationLine) {
22368                        switch (textDecorationLine) {
22369                            case textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
22370                                // Draws a line at the baseline of the font
22371                                // TODO As some browsers display the line as more than 1px if the font-size is big,
22372                                // need to take that into account both in position and size
22373                                var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
22374                                    baseline = _options$fontMetrics$.baseline;
22375
22376                                _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
22377                                break;
22378                            case textDecoration.TEXT_DECORATION_LINE.OVERLINE:
22379                                _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
22380                                break;
22381                            case textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
22382                                // TODO try and find exact position for line-through
22383                                var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
22384                                    middle = _options$fontMetrics$2.middle;
22385
22386                                _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
22387                                break;
22388                        }
22389                    });
22390                }
22391            });
22392        }
22393    }, {
22394        key: 'resizeImage',
22395        value: function resizeImage(image, size) {
22396            if (image.width === size.width && image.height === size.height) {
22397                return image;
22398            }
22399
22400            var canvas = this.canvas.ownerDocument.createElement('canvas');
22401            canvas.width = size.width;
22402            canvas.height = size.height;
22403            var ctx = canvas.getContext('2d');
22404            ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
22405            return canvas;
22406        }
22407    }, {
22408        key: 'setOpacity',
22409        value: function setOpacity(opacity) {
22410            this.ctx.globalAlpha = opacity;
22411        }
22412    }, {
22413        key: 'transform',
22414        value: function transform(offsetX, offsetY, matrix, callback) {
22415            this.ctx.save();
22416            this.ctx.translate(offsetX, offsetY);
22417            this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
22418            this.ctx.translate(-offsetX, -offsetY);
22419
22420            callback();
22421
22422            this.ctx.restore();
22423        }
22424    }]);
22425
22426    return CanvasRenderer;
22427}();
22428
22429exports.default = CanvasRenderer;
22430});
22431
22432unwrapExports(CanvasRenderer_1);
22433
22434var Logger_1 = createCommonjsModule(function (module, exports) {
22435Object.defineProperty(exports, "__esModule", {
22436    value: true
22437});
22438
22439var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
22440
22441function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22442
22443var Logger = function () {
22444    function Logger(enabled, id, start) {
22445        _classCallCheck(this, Logger);
22446
22447        this.enabled = typeof window !== 'undefined' && enabled;
22448        this.start = start ? start : Date.now();
22449        this.id = id;
22450    }
22451
22452    _createClass(Logger, [{
22453        key: 'child',
22454        value: function child(id) {
22455            return new Logger(this.enabled, id, this.start);
22456        }
22457
22458        // eslint-disable-next-line flowtype/no-weak-types
22459
22460    }, {
22461        key: 'log',
22462        value: function log() {
22463            if (this.enabled && window.console && window.console.log) {
22464                for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
22465                    args[_key] = arguments[_key];
22466                }
22467
22468                Function.prototype.bind.call(window.console.log, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0)));
22469            }
22470        }
22471
22472        // eslint-disable-next-line flowtype/no-weak-types
22473
22474    }, {
22475        key: 'error',
22476        value: function error() {
22477            if (this.enabled && window.console && window.console.error) {
22478                for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
22479                    args[_key2] = arguments[_key2];
22480                }
22481
22482                Function.prototype.bind.call(window.console.error, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0)));
22483            }
22484        }
22485    }]);
22486
22487    return Logger;
22488}();
22489
22490exports.default = Logger;
22491});
22492
22493unwrapExports(Logger_1);
22494
22495var Util = createCommonjsModule(function (module, exports) {
22496Object.defineProperty(exports, "__esModule", {
22497    value: true
22498});
22499var contains = exports.contains = function contains(bit, value) {
22500    return (bit & value) !== 0;
22501};
22502
22503var distance = exports.distance = function distance(a, b) {
22504    return Math.sqrt(a * a + b * b);
22505};
22506
22507var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
22508    // Edge does not provide value for cssText
22509    for (var i = style.length - 1; i >= 0; i--) {
22510        var property = style.item(i);
22511        // Safari shows pseudoelements if content is set
22512        if (property !== 'content') {
22513            target.style.setProperty(property, style.getPropertyValue(property));
22514        }
22515    }
22516    return target;
22517};
22518
22519var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
22520});
22521
22522unwrapExports(Util);
22523var Util_1 = Util.contains;
22524var Util_2 = Util.distance;
22525var Util_3 = Util.copyCSSStyles;
22526var Util_4 = Util.SMALL_IMAGE;
22527
22528var Length_1 = createCommonjsModule(function (module, exports) {
22529Object.defineProperty(exports, "__esModule", {
22530    value: true
22531});
22532exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
22533
22534var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
22535
22536
22537
22538var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
22539
22540function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22541
22542function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22543
22544var LENGTH_TYPE = exports.LENGTH_TYPE = {
22545    PX: 0,
22546    PERCENTAGE: 1
22547};
22548
22549var Length = function () {
22550    function Length(value) {
22551        _classCallCheck(this, Length);
22552
22553        this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
22554        var parsedValue = parseFloat(value);
22555        this.value = isNaN(parsedValue) ? 0 : parsedValue;
22556    }
22557
22558    _createClass(Length, [{
22559        key: 'isPercentage',
22560        value: function isPercentage() {
22561            return this.type === LENGTH_TYPE.PERCENTAGE;
22562        }
22563    }, {
22564        key: 'getAbsoluteValue',
22565        value: function getAbsoluteValue(parentLength) {
22566            return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
22567        }
22568    }], [{
22569        key: 'create',
22570        value: function create(v) {
22571            return new Length(v);
22572        }
22573    }]);
22574
22575    return Length;
22576}();
22577
22578exports.default = Length;
22579
22580
22581var getRootFontSize = function getRootFontSize(container) {
22582    var parent = container.parent;
22583    return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
22584};
22585
22586var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
22587    switch (unit) {
22588        case 'px':
22589        case '%':
22590            return new Length(value + unit);
22591        case 'em':
22592        case 'rem':
22593            var length = new Length(value);
22594            length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
22595            return length;
22596        default:
22597            // TODO: handle correctly if unknown unit is used
22598            return new Length('0');
22599    }
22600};
22601});
22602
22603unwrapExports(Length_1);
22604var Length_2 = Length_1.calculateLengthFromValueWithUnit;
22605var Length_3 = Length_1.LENGTH_TYPE;
22606
22607var Size_1 = createCommonjsModule(function (module, exports) {
22608Object.defineProperty(exports, "__esModule", {
22609    value: true
22610});
22611
22612function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22613
22614var Size = function Size(width, height) {
22615    _classCallCheck(this, Size);
22616
22617    this.width = width;
22618    this.height = height;
22619};
22620
22621exports.default = Size;
22622});
22623
22624unwrapExports(Size_1);
22625
22626var Vector_1 = createCommonjsModule(function (module, exports) {
22627Object.defineProperty(exports, "__esModule", {
22628    value: true
22629});
22630
22631
22632
22633function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22634
22635var Vector = function Vector(x, y) {
22636    _classCallCheck(this, Vector);
22637
22638    this.type = Path.PATH.VECTOR;
22639    this.x = x;
22640    this.y = y;
22641    
22642};
22643
22644exports.default = Vector;
22645});
22646
22647unwrapExports(Vector_1);
22648
22649var BezierCurve_1 = createCommonjsModule(function (module, exports) {
22650Object.defineProperty(exports, "__esModule", {
22651    value: true
22652});
22653
22654var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
22655
22656
22657
22658
22659
22660var _Vector2 = _interopRequireDefault(Vector_1);
22661
22662function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22663
22664function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22665
22666var lerp = function lerp(a, b, t) {
22667    return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
22668};
22669
22670var BezierCurve = function () {
22671    function BezierCurve(start, startControl, endControl, end) {
22672        _classCallCheck(this, BezierCurve);
22673
22674        this.type = Path.PATH.BEZIER_CURVE;
22675        this.start = start;
22676        this.startControl = startControl;
22677        this.endControl = endControl;
22678        this.end = end;
22679    }
22680
22681    _createClass(BezierCurve, [{
22682        key: 'subdivide',
22683        value: function subdivide(t, firstHalf) {
22684            var ab = lerp(this.start, this.startControl, t);
22685            var bc = lerp(this.startControl, this.endControl, t);
22686            var cd = lerp(this.endControl, this.end, t);
22687            var abbc = lerp(ab, bc, t);
22688            var bccd = lerp(bc, cd, t);
22689            var dest = lerp(abbc, bccd, t);
22690            return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
22691        }
22692    }, {
22693        key: 'reverse',
22694        value: function reverse() {
22695            return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
22696        }
22697    }]);
22698
22699    return BezierCurve;
22700}();
22701
22702exports.default = BezierCurve;
22703});
22704
22705unwrapExports(BezierCurve_1);
22706
22707var Bounds_1 = createCommonjsModule(function (module, exports) {
22708Object.defineProperty(exports, "__esModule", {
22709    value: true
22710});
22711exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
22712
22713var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
22714
22715
22716
22717var _Vector2 = _interopRequireDefault(Vector_1);
22718
22719
22720
22721var _BezierCurve2 = _interopRequireDefault(BezierCurve_1);
22722
22723function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22724
22725function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22726
22727var TOP = 0;
22728var RIGHT = 1;
22729var BOTTOM = 2;
22730var LEFT = 3;
22731
22732var H = 0;
22733var V = 1;
22734
22735var Bounds = exports.Bounds = function () {
22736    function Bounds(x, y, w, h) {
22737        _classCallCheck(this, Bounds);
22738
22739        this.left = x;
22740        this.top = y;
22741        this.width = w;
22742        this.height = h;
22743    }
22744
22745    _createClass(Bounds, null, [{
22746        key: 'fromClientRect',
22747        value: function fromClientRect(clientRect, scrollX, scrollY) {
22748            return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
22749        }
22750    }]);
22751
22752    return Bounds;
22753}();
22754
22755var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
22756    return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
22757};
22758
22759var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
22760    return new Bounds(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth));
22761};
22762
22763var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
22764    // TODO support percentage paddings
22765    var paddingTop = padding[TOP].value;
22766    var paddingRight = padding[RIGHT].value;
22767    var paddingBottom = padding[BOTTOM].value;
22768    var paddingLeft = padding[LEFT].value;
22769
22770    return new Bounds(bounds.left + paddingLeft + borders[LEFT].borderWidth, bounds.top + paddingTop + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth + paddingLeft + paddingRight), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth + paddingTop + paddingBottom));
22771};
22772
22773var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
22774    var body = document.body;
22775    var documentElement = document.documentElement;
22776
22777    if (!body || !documentElement) {
22778        throw new Error('');
22779    }
22780    var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
22781
22782    var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
22783
22784    return new Bounds(0, 0, width, height);
22785};
22786
22787var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
22788    switch (borderSide) {
22789        case TOP:
22790            return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
22791        case RIGHT:
22792            return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
22793        case BOTTOM:
22794            return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
22795        case LEFT:
22796        default:
22797            return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
22798    }
22799};
22800
22801var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
22802    var path = [];
22803    if (outer1 instanceof _BezierCurve2.default) {
22804        path.push(outer1.subdivide(0.5, false));
22805    } else {
22806        path.push(outer1);
22807    }
22808
22809    if (outer2 instanceof _BezierCurve2.default) {
22810        path.push(outer2.subdivide(0.5, true));
22811    } else {
22812        path.push(outer2);
22813    }
22814
22815    if (inner2 instanceof _BezierCurve2.default) {
22816        path.push(inner2.subdivide(0.5, true).reverse());
22817    } else {
22818        path.push(inner2);
22819    }
22820
22821    if (inner1 instanceof _BezierCurve2.default) {
22822        path.push(inner1.subdivide(0.5, false).reverse());
22823    } else {
22824        path.push(inner1);
22825    }
22826
22827    return path;
22828};
22829
22830var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
22831    return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
22832};
22833
22834var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
22835    return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
22836};
22837
22838var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
22839    var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
22840    var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
22841    var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
22842    var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
22843    var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
22844    var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
22845    var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
22846    var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
22847
22848    var factors = [];
22849    factors.push((tlh + trh) / bounds.width);
22850    factors.push((blh + brh) / bounds.width);
22851    factors.push((tlv + blv) / bounds.height);
22852    factors.push((trv + brv) / bounds.height);
22853    var maxFactor = Math.max.apply(Math, factors);
22854
22855    if (maxFactor > 1) {
22856        tlh /= maxFactor;
22857        tlv /= maxFactor;
22858        trh /= maxFactor;
22859        trv /= maxFactor;
22860        brh /= maxFactor;
22861        brv /= maxFactor;
22862        blh /= maxFactor;
22863        blv /= maxFactor;
22864    }
22865
22866    var topWidth = bounds.width - trh;
22867    var rightHeight = bounds.height - brv;
22868    var bottomWidth = bounds.width - brh;
22869    var leftHeight = bounds.height - blv;
22870
22871    return {
22872        topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
22873        topLeftInner: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, Math.max(0, tlh - borders[LEFT].borderWidth), Math.max(0, tlv - borders[TOP].borderWidth), CORNER.TOP_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth),
22874        topRightOuter: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top),
22875        topRightInner: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borders[LEFT].borderWidth), bounds.top + borders[TOP].borderWidth, topWidth > bounds.width + borders[LEFT].borderWidth ? 0 : trh - borders[LEFT].borderWidth, trv - borders[TOP].borderWidth, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + borders[TOP].borderWidth),
22876        bottomRightOuter: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top + bounds.height),
22877        bottomRightInner: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borders[LEFT].borderWidth), bounds.top + Math.min(rightHeight, bounds.height + borders[TOP].borderWidth), Math.max(0, brh - borders[RIGHT].borderWidth), brv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth),
22878        bottomLeftOuter: blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left, bounds.top + bounds.height),
22879        bottomLeftInner: blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + leftHeight, Math.max(0, blh - borders[LEFT].borderWidth), blv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth)
22880    };
22881};
22882
22883var CORNER = {
22884    TOP_LEFT: 0,
22885    TOP_RIGHT: 1,
22886    BOTTOM_RIGHT: 2,
22887    BOTTOM_LEFT: 3
22888};
22889
22890var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
22891    var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
22892    var ox = r1 * kappa; // control point offset horizontal
22893    var oy = r2 * kappa; // control point offset vertical
22894    var xm = x + r1; // x-middle
22895    var ym = y + r2; // y-middle
22896
22897    switch (position) {
22898        case CORNER.TOP_LEFT:
22899            return new _BezierCurve2.default(new _Vector2.default(x, ym), new _Vector2.default(x, ym - oy), new _Vector2.default(xm - ox, y), new _Vector2.default(xm, y));
22900        case CORNER.TOP_RIGHT:
22901            return new _BezierCurve2.default(new _Vector2.default(x, y), new _Vector2.default(x + ox, y), new _Vector2.default(xm, ym - oy), new _Vector2.default(xm, ym));
22902        case CORNER.BOTTOM_RIGHT:
22903            return new _BezierCurve2.default(new _Vector2.default(xm, y), new _Vector2.default(xm, y + oy), new _Vector2.default(x + ox, ym), new _Vector2.default(x, ym));
22904        case CORNER.BOTTOM_LEFT:
22905        default:
22906            return new _BezierCurve2.default(new _Vector2.default(xm, ym), new _Vector2.default(xm - ox, ym), new _Vector2.default(x, y + oy), new _Vector2.default(x, y));
22907    }
22908};
22909});
22910
22911unwrapExports(Bounds_1);
22912var Bounds_2 = Bounds_1.parseBoundCurves;
22913var Bounds_3 = Bounds_1.calculatePaddingBoxPath;
22914var Bounds_4 = Bounds_1.calculateBorderBoxPath;
22915var Bounds_5 = Bounds_1.parsePathForBorder;
22916var Bounds_6 = Bounds_1.parseDocumentSize;
22917var Bounds_7 = Bounds_1.calculateContentBox;
22918var Bounds_8 = Bounds_1.calculatePaddingBox;
22919var Bounds_9 = Bounds_1.parseBounds;
22920var Bounds_10 = Bounds_1.Bounds;
22921
22922var padding = createCommonjsModule(function (module, exports) {
22923Object.defineProperty(exports, "__esModule", {
22924    value: true
22925});
22926exports.parsePadding = exports.PADDING_SIDES = undefined;
22927
22928
22929
22930var _Length2 = _interopRequireDefault(Length_1);
22931
22932function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22933
22934var PADDING_SIDES = exports.PADDING_SIDES = {
22935    TOP: 0,
22936    RIGHT: 1,
22937    BOTTOM: 2,
22938    LEFT: 3
22939};
22940
22941var SIDES = ['top', 'right', 'bottom', 'left'];
22942
22943var parsePadding = exports.parsePadding = function parsePadding(style) {
22944    return SIDES.map(function (side) {
22945        return new _Length2.default(style.getPropertyValue('padding-' + side));
22946    });
22947};
22948});
22949
22950unwrapExports(padding);
22951var padding_1 = padding.parsePadding;
22952var padding_2 = padding.PADDING_SIDES;
22953
22954var background = createCommonjsModule(function (module, exports) {
22955Object.defineProperty(exports, "__esModule", {
22956    value: true
22957});
22958exports.parseBackgroundImage = exports.parseBackground = exports.calculateBackgroundRepeatPath = exports.calculateBackgroundPosition = exports.calculateBackgroungPositioningArea = exports.calculateBackgroungPaintingArea = exports.calculateGradientBackgroundSize = exports.calculateBackgroundSize = exports.BACKGROUND_ORIGIN = exports.BACKGROUND_CLIP = exports.BACKGROUND_SIZE = exports.BACKGROUND_REPEAT = undefined;
22959
22960
22961
22962var _Color2 = _interopRequireDefault(Color_1);
22963
22964
22965
22966var _Length2 = _interopRequireDefault(Length_1);
22967
22968
22969
22970var _Size2 = _interopRequireDefault(Size_1);
22971
22972
22973
22974var _Vector2 = _interopRequireDefault(Vector_1);
22975
22976
22977
22978
22979
22980function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22981
22982function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22983
22984var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
22985    REPEAT: 0,
22986    NO_REPEAT: 1,
22987    REPEAT_X: 2,
22988    REPEAT_Y: 3
22989};
22990
22991var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
22992    AUTO: 0,
22993    CONTAIN: 1,
22994    COVER: 2,
22995    LENGTH: 3
22996};
22997
22998var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
22999    BORDER_BOX: 0,
23000    PADDING_BOX: 1,
23001    CONTENT_BOX: 2
23002};
23003
23004var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
23005
23006var AUTO = 'auto';
23007
23008var BackgroundSize = function BackgroundSize(size) {
23009    _classCallCheck(this, BackgroundSize);
23010
23011    switch (size) {
23012        case 'contain':
23013            this.size = BACKGROUND_SIZE.CONTAIN;
23014            break;
23015        case 'cover':
23016            this.size = BACKGROUND_SIZE.COVER;
23017            break;
23018        case 'auto':
23019            this.size = BACKGROUND_SIZE.AUTO;
23020            break;
23021        default:
23022            this.value = new _Length2.default(size);
23023    }
23024};
23025
23026var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
23027    var width = 0;
23028    var height = 0;
23029    var size = backgroundImage.size;
23030    if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
23031        var targetRatio = bounds.width / bounds.height;
23032        var currentRatio = image.width / image.height;
23033        return targetRatio < currentRatio !== (size[0].size === BACKGROUND_SIZE.COVER) ? new _Size2.default(bounds.width, bounds.width / currentRatio) : new _Size2.default(bounds.height * currentRatio, bounds.height);
23034    }
23035
23036    if (size[0].value) {
23037        width = size[0].value.getAbsoluteValue(bounds.width);
23038    }
23039
23040    if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
23041        height = image.height;
23042    } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
23043        height = width / image.width * image.height;
23044    } else if (size[1].value) {
23045        height = size[1].value.getAbsoluteValue(bounds.height);
23046    }
23047
23048    if (size[0].size === BACKGROUND_SIZE.AUTO) {
23049        width = height / image.height * image.width;
23050    }
23051
23052    return new _Size2.default(width, height);
23053};
23054
23055var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
23056    var size = backgroundImage.size;
23057    var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
23058    var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
23059
23060    return new _Size2.default(width, height);
23061};
23062
23063var AUTO_SIZE = new BackgroundSize(AUTO);
23064
23065var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
23066    switch (clip) {
23067        case BACKGROUND_CLIP.BORDER_BOX:
23068            return (0, Bounds_1.calculateBorderBoxPath)(curves);
23069        case BACKGROUND_CLIP.PADDING_BOX:
23070        default:
23071            return (0, Bounds_1.calculatePaddingBoxPath)(curves);
23072    }
23073};
23074
23075var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding$$1, border) {
23076    var paddingBox = (0, Bounds_1.calculatePaddingBox)(bounds, border);
23077
23078    switch (backgroundOrigin) {
23079        case BACKGROUND_ORIGIN.BORDER_BOX:
23080            return bounds;
23081        case BACKGROUND_ORIGIN.CONTENT_BOX:
23082            var paddingLeft = padding$$1[padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
23083            var paddingRight = padding$$1[padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
23084            var paddingTop = padding$$1[padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
23085            var paddingBottom = padding$$1[padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
23086            return new Bounds_1.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
23087        case BACKGROUND_ORIGIN.PADDING_BOX:
23088        default:
23089            return paddingBox;
23090    }
23091};
23092
23093var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
23094    return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
23095};
23096
23097var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
23098    var repeat = background.repeat;
23099    switch (repeat) {
23100        case BACKGROUND_REPEAT.REPEAT_X:
23101            return [new _Vector2.default(Math.round(bounds.left), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(size.height + backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left), Math.round(size.height + backgroundPositioningArea.top + position.y))];
23102        case BACKGROUND_REPEAT.REPEAT_Y:
23103            return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.height + bounds.top))];
23104        case BACKGROUND_REPEAT.NO_REPEAT:
23105            return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y + size.height)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y + size.height))];
23106        default:
23107            return [new _Vector2.default(Math.round(bounds.left), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(bounds.left), Math.round(bounds.height + bounds.top))];
23108    }
23109};
23110
23111var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
23112    return {
23113        backgroundColor: new _Color2.default(style.backgroundColor),
23114        backgroundImage: parseBackgroundImages(style, resourceLoader),
23115        backgroundClip: parseBackgroundClip(style.backgroundClip),
23116        backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
23117    };
23118};
23119
23120var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
23121    switch (backgroundClip) {
23122        case 'padding-box':
23123            return BACKGROUND_CLIP.PADDING_BOX;
23124        case 'content-box':
23125            return BACKGROUND_CLIP.CONTENT_BOX;
23126    }
23127    return BACKGROUND_CLIP.BORDER_BOX;
23128};
23129
23130var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
23131    switch (backgroundOrigin) {
23132        case 'padding-box':
23133            return BACKGROUND_ORIGIN.PADDING_BOX;
23134        case 'content-box':
23135            return BACKGROUND_ORIGIN.CONTENT_BOX;
23136    }
23137    return BACKGROUND_ORIGIN.BORDER_BOX;
23138};
23139
23140var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
23141    switch (backgroundRepeat.trim()) {
23142        case 'no-repeat':
23143            return BACKGROUND_REPEAT.NO_REPEAT;
23144        case 'repeat-x':
23145        case 'repeat no-repeat':
23146            return BACKGROUND_REPEAT.REPEAT_X;
23147        case 'repeat-y':
23148        case 'no-repeat repeat':
23149            return BACKGROUND_REPEAT.REPEAT_Y;
23150        case 'repeat':
23151            return BACKGROUND_REPEAT.REPEAT;
23152    }
23153
23154    return BACKGROUND_REPEAT.REPEAT;
23155};
23156
23157var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
23158    var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
23159        if (backgroundImage.method === 'url') {
23160            var key = resourceLoader.loadImage(backgroundImage.args[0]);
23161            backgroundImage.args = key ? [key] : [];
23162        }
23163        return backgroundImage;
23164    });
23165    var positions = style.backgroundPosition.split(',');
23166    var repeats = style.backgroundRepeat.split(',');
23167    var sizes = style.backgroundSize.split(',');
23168
23169    return sources.map(function (source, index) {
23170        var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
23171        var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
23172
23173        return {
23174            source: source,
23175            repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
23176            size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
23177            position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
23178        };
23179    });
23180};
23181
23182var parseBackgroundSize = function parseBackgroundSize(size) {
23183    return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
23184};
23185
23186var parseBackgoundPosition = function parseBackgoundPosition(position) {
23187    switch (position) {
23188        case 'bottom':
23189        case 'right':
23190            return new _Length2.default('100%');
23191        case 'left':
23192        case 'top':
23193            return new _Length2.default('0%');
23194        case 'auto':
23195            return new _Length2.default('0');
23196    }
23197    return new _Length2.default(position);
23198};
23199
23200var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
23201    var whitespace = /^\s$/;
23202    var results = [];
23203
23204    var args = [];
23205    var method = '';
23206    var quote = null;
23207    var definition = '';
23208    var mode = 0;
23209    var numParen = 0;
23210
23211    var appendResult = function appendResult() {
23212        var prefix = '';
23213        if (method) {
23214            if (definition.substr(0, 1) === '"') {
23215                definition = definition.substr(1, definition.length - 2);
23216            }
23217
23218            if (definition) {
23219                args.push(definition.trim());
23220            }
23221
23222            var prefix_i = method.indexOf('-', 1) + 1;
23223            if (method.substr(0, 1) === '-' && prefix_i > 0) {
23224                prefix = method.substr(0, prefix_i).toLowerCase();
23225                method = method.substr(prefix_i);
23226            }
23227            method = method.toLowerCase();
23228            if (method !== 'none') {
23229                results.push({
23230                    prefix: prefix,
23231                    method: method,
23232                    args: args
23233                });
23234            }
23235        }
23236        args = [];
23237        method = definition = '';
23238    };
23239
23240    image.split('').forEach(function (c) {
23241        if (mode === 0 && whitespace.test(c)) {
23242            return;
23243        }
23244        switch (c) {
23245            case '"':
23246                if (!quote) {
23247                    quote = c;
23248                } else if (quote === c) {
23249                    quote = null;
23250                }
23251                break;
23252            case '(':
23253                if (quote) {
23254                    break;
23255                } else if (mode === 0) {
23256                    mode = 1;
23257                    return;
23258                } else {
23259                    numParen++;
23260                }
23261                break;
23262            case ')':
23263                if (quote) {
23264                    break;
23265                } else if (mode === 1) {
23266                    if (numParen === 0) {
23267                        mode = 0;
23268                        appendResult();
23269                        return;
23270                    } else {
23271                        numParen--;
23272                    }
23273                }
23274                break;
23275
23276            case ',':
23277                if (quote) {
23278                    break;
23279                } else if (mode === 0) {
23280                    appendResult();
23281                    return;
23282                } else if (mode === 1) {
23283                    if (numParen === 0 && !method.match(/^url$/i)) {
23284                        args.push(definition.trim());
23285                        definition = '';
23286                        return;
23287                    }
23288                }
23289                break;
23290        }
23291
23292        if (mode === 0) {
23293            method += c;
23294        } else {
23295            definition += c;
23296        }
23297    });
23298
23299    appendResult();
23300    return results;
23301};
23302});
23303
23304unwrapExports(background);
23305var background_1 = background.parseBackgroundImage;
23306var background_2 = background.parseBackground;
23307var background_3 = background.calculateBackgroundRepeatPath;
23308var background_4 = background.calculateBackgroundPosition;
23309var background_5 = background.calculateBackgroungPositioningArea;
23310var background_6 = background.calculateBackgroungPaintingArea;
23311var background_7 = background.calculateGradientBackgroundSize;
23312var background_8 = background.calculateBackgroundSize;
23313var background_9 = background.BACKGROUND_ORIGIN;
23314var background_10 = background.BACKGROUND_CLIP;
23315var background_11 = background.BACKGROUND_SIZE;
23316var background_12 = background.BACKGROUND_REPEAT;
23317
23318var border = createCommonjsModule(function (module, exports) {
23319Object.defineProperty(exports, "__esModule", {
23320    value: true
23321});
23322exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
23323
23324
23325
23326var _Color2 = _interopRequireDefault(Color_1);
23327
23328function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23329
23330var BORDER_STYLE = exports.BORDER_STYLE = {
23331    NONE: 0,
23332    SOLID: 1
23333};
23334
23335var BORDER_SIDES = exports.BORDER_SIDES = {
23336    TOP: 0,
23337    RIGHT: 1,
23338    BOTTOM: 2,
23339    LEFT: 3
23340};
23341
23342var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
23343    return s.toLowerCase();
23344});
23345
23346var parseBorderStyle = function parseBorderStyle(style) {
23347    switch (style) {
23348        case 'none':
23349            return BORDER_STYLE.NONE;
23350    }
23351    return BORDER_STYLE.SOLID;
23352};
23353
23354var parseBorder = exports.parseBorder = function parseBorder(style) {
23355    return SIDES.map(function (side) {
23356        var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
23357        var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
23358        var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
23359        return {
23360            borderColor: borderColor,
23361            borderStyle: borderStyle,
23362            borderWidth: isNaN(borderWidth) ? 0 : borderWidth
23363        };
23364    });
23365};
23366});
23367
23368unwrapExports(border);
23369var border_1 = border.parseBorder;
23370var border_2 = border.BORDER_SIDES;
23371var border_3 = border.BORDER_STYLE;
23372
23373var borderRadius = createCommonjsModule(function (module, exports
23373) {
23374Object.defineProperty(exports, "__esModule", {
23375    value: true
23376});
23377exports.parseBorderRadius = undefined;
23378
23379var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
23380
23381
23382
23383var _Length2 = _interopRequireDefault(Length_1);
23384
23385function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23386
23387var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
23388
23389var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
23390    return SIDES.map(function (side) {
23391        var value = style.getPropertyValue('border-' + side + '-radius');
23392
23393        var _value$split$map = value.split(' ').map(_Length2.default.create),
23394            _value$split$map2 = _slicedToArray(_value$split$map, 2),
23395            horizontal = _value$split$map2[0],
23396            vertical = _value$split$map2[1];
23397
23398        return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
23399    });
23400};
23401});
23402
23403unwrapExports(borderRadius);
23404var borderRadius_1 = borderRadius.parseBorderRadius;
23405
23406var display = createCommonjsModule(function (module, exports) {
23407Object.defineProperty(exports, "__esModule", {
23408    value: true
23409});
23410var DISPLAY = exports.DISPLAY = {
23411    NONE: 1 << 0,
23412    BLOCK: 1 << 1,
23413    INLINE: 1 << 2,
23414    RUN_IN: 1 << 3,
23415    FLOW: 1 << 4,
23416    FLOW_ROOT: 1 << 5,
23417    TABLE: 1 << 6,
23418    FLEX: 1 << 7,
23419    GRID: 1 << 8,
23420    RUBY: 1 << 9,
23421    SUBGRID: 1 << 10,
23422    LIST_ITEM: 1 << 11,
23423    TABLE_ROW_GROUP: 1 << 12,
23424    TABLE_HEADER_GROUP: 1 << 13,
23425    TABLE_FOOTER_GROUP: 1 << 14,
23426    TABLE_ROW: 1 << 15,
23427    TABLE_CELL: 1 << 16,
23428    TABLE_COLUMN_GROUP: 1 << 17,
23429    TABLE_COLUMN: 1 << 18,
23430    TABLE_CAPTION: 1 << 19,
23431    RUBY_BASE: 1 << 20,
23432    RUBY_TEXT: 1 << 21,
23433    RUBY_BASE_CONTAINER: 1 << 22,
23434    RUBY_TEXT_CONTAINER: 1 << 23,
23435    CONTENTS: 1 << 24,
23436    INLINE_BLOCK: 1 << 25,
23437    INLINE_LIST_ITEM: 1 << 26,
23438    INLINE_TABLE: 1 << 27,
23439    INLINE_FLEX: 1 << 28,
23440    INLINE_GRID: 1 << 29
23441};
23442
23443var parseDisplayValue = function parseDisplayValue(display) {
23444    switch (display) {
23445        case 'block':
23446            return DISPLAY.BLOCK;
23447        case 'inline':
23448            return DISPLAY.INLINE;
23449        case 'run-in':
23450            return DISPLAY.RUN_IN;
23451        case 'flow':
23452            return DISPLAY.FLOW;
23453        case 'flow-root':
23454            return DISPLAY.FLOW_ROOT;
23455        case 'table':
23456            return DISPLAY.TABLE;
23457        case 'flex':
23458            return DISPLAY.FLEX;
23459        case 'grid':
23460            return DISPLAY.GRID;
23461        case 'ruby':
23462            return DISPLAY.RUBY;
23463        case 'subgrid':
23464            return DISPLAY.SUBGRID;
23465        case 'list-item':
23466            return DISPLAY.LIST_ITEM;
23467        case 'table-row-group':
23468            return DISPLAY.TABLE_ROW_GROUP;
23469        case 'table-header-group':
23470            return DISPLAY.TABLE_HEADER_GROUP;
23471        case 'table-footer-group':
23472            return DISPLAY.TABLE_FOOTER_GROUP;
23473        case 'table-row':
23474            return DISPLAY.TABLE_ROW;
23475        case 'table-cell':
23476            return DISPLAY.TABLE_CELL;
23477        case 'table-column-group':
23478            return DISPLAY.TABLE_COLUMN_GROUP;
23479        case 'table-column':
23480            return DISPLAY.TABLE_COLUMN;
23481        case 'table-caption':
23482            return DISPLAY.TABLE_CAPTION;
23483        case 'ruby-base':
23484            return DISPLAY.RUBY_BASE;
23485        case 'ruby-text':
23486            return DISPLAY.RUBY_TEXT;
23487        case 'ruby-base-container':
23488            return DISPLAY.RUBY_BASE_CONTAINER;
23489        case 'ruby-text-container':
23490            return DISPLAY.RUBY_TEXT_CONTAINER;
23491        case 'contents':
23492            return DISPLAY.CONTENTS;
23493        case 'inline-block':
23494            return DISPLAY.INLINE_BLOCK;
23495        case 'inline-list-item':
23496            return DISPLAY.INLINE_LIST_ITEM;
23497        case 'inline-table':
23498            return DISPLAY.INLINE_TABLE;
23499        case 'inline-flex':
23500            return DISPLAY.INLINE_FLEX;
23501        case 'inline-grid':
23502            return DISPLAY.INLINE_GRID;
23503    }
23504
23505    return DISPLAY.NONE;
23506};
23507
23508var setDisplayBit = function setDisplayBit(bit, display) {
23509    return bit | parseDisplayValue(display);
23510};
23511
23512var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
23513    return display.split(' ').reduce(setDisplayBit, 0);
23514};
23515});
23516
23517unwrapExports(display);
23518var display_1 = display.DISPLAY;
23519var display_2 = display.parseDisplay;
23520
23521var float_1 = createCommonjsModule(function (module, exports) {
23522Object.defineProperty(exports, "__esModule", {
23523    value: true
23524});
23525var FLOAT = exports.FLOAT = {
23526    NONE: 0,
23527    LEFT: 1,
23528    RIGHT: 2,
23529    INLINE_START: 3,
23530    INLINE_END: 4
23531};
23532
23533var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
23534    switch (float) {
23535        case 'left':
23536            return FLOAT.LEFT;
23537        case 'right':
23538            return FLOAT.RIGHT;
23539        case 'inline-start':
23540            return FLOAT.INLINE_START;
23541        case 'inline-end':
23542            return FLOAT.INLINE_END;
23543    }
23544    return FLOAT.NONE;
23545};
23546});
23547
23548unwrapExports(float_1);
23549var float_2 = float_1.FLOAT;
23550var float_3 = float_1.parseCSSFloat;
23551
23552var font = createCommonjsModule(function (module, exports) {
23553Object.defineProperty(exports, "__esModule", {
23554    value: true
23555});
23556
23557
23558var parseFontWeight = function parseFontWeight(weight) {
23559    switch (weight) {
23560        case 'normal':
23561            return 400;
23562        case 'bold':
23563            return 700;
23564    }
23565
23566    var value = parseInt(weight, 10);
23567    return isNaN(value) ? 400 : value;
23568};
23569
23570var parseFont = exports.parseFont = function parseFont(style) {
23571    var fontFamily = style.fontFamily;
23572    var fontSize = style.fontSize;
23573    var fontStyle = style.fontStyle;
23574    var fontVariant = style.fontVariant;
23575    var fontWeight = parseFontWeight(style.fontWeight);
23576
23577    return {
23578        fontFamily: fontFamily,
23579        fontSize: fontSize,
23580        fontStyle: fontStyle,
23581        fontVariant: fontVariant,
23582        fontWeight: fontWeight
23583    };
23584};
23585});
23586
23587unwrapExports(font);
23588var font_1 = font.parseFont;
23589
23590var letterSpacing = createCommonjsModule(function (module, exports) {
23591Object.defineProperty(exports, "__esModule", {
23592    value: true
23593});
23594var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
23595    if (letterSpacing === 'normal') {
23596        return 0;
23597    }
23598    var value = parseFloat(letterSpacing);
23599    return isNaN(value) ? 0 : value;
23600};
23601});
23602
23603unwrapExports(letterSpacing);
23604var letterSpacing_1 = letterSpacing.parseLetterSpacing;
23605
23606var lineBreak = createCommonjsModule(function (module, exports) {
23607Object.defineProperty(exports, "__esModule", {
23608    value: true
23609});
23610var LINE_BREAK = exports.LINE_BREAK = {
23611    NORMAL: 'normal',
23612    STRICT: 'strict'
23613};
23614
23615var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
23616    switch (wordBreak) {
23617        case 'strict':
23618            return LINE_BREAK.STRICT;
23619        case 'normal':
23620        default:
23621            return LINE_BREAK.NORMAL;
23622    }
23623};
23624});
23625
23626unwrapExports(lineBreak);
23627var lineBreak_1 = lineBreak.LINE_BREAK;
23628var lineBreak_2 = lineBreak.parseLineBreak;
23629
23630var listStyle = createCommonjsModule(function (module, exports) {
23631Object.defineProperty(exports, "__esModule", {
23632    value: true
23633});
23634exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
23635
23636
23637
23638var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
23639    INSIDE: 0,
23640    OUTSIDE: 1
23641};
23642
23643var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
23644    NONE: -1,
23645    DISC: 0,
23646    CIRCLE: 1,
23647    SQUARE: 2,
23648    DECIMAL: 3,
23649    CJK_DECIMAL: 4,
23650    DECIMAL_LEADING_ZERO: 5,
23651    LOWER_ROMAN: 6,
23652    UPPER_ROMAN: 7,
23653    LOWER_GREEK: 8,
23654    LOWER_ALPHA: 9,
23655    UPPER_ALPHA: 10,
23656    ARABIC_INDIC: 11,
23657    ARMENIAN: 12,
23658    BENGALI: 13,
23659    CAMBODIAN: 14,
23660    CJK_EARTHLY_BRANCH: 15,
23661    CJK_HEAVENLY_STEM: 16,
23662    CJK_IDEOGRAPHIC: 17,
23663    DEVANAGARI: 18,
23664    ETHIOPIC_NUMERIC: 19,
23665    GEORGIAN: 20,
23666    GUJARATI: 21,
23667    GURMUKHI: 22,
23668    HEBREW: 22,
23669    HIRAGANA: 23,
23670    HIRAGANA_IROHA: 24,
23671    JAPANESE_FORMAL: 25,
23672    JAPANESE_INFORMAL: 26,
23673    KANNADA: 27,
23674    KATAKANA: 28,
23675    KATAKANA_IROHA: 29,
23676    KHMER: 30,
23677    KOREAN_HANGUL_FORMAL: 31,
23678    KOREAN_HANJA_FORMAL: 32,
23679    KOREAN_HANJA_INFORMAL: 33,
23680    LAO: 34,
23681    LOWER_ARMENIAN: 35,
23682    MALAYALAM: 36,
23683    MONGOLIAN: 37,
23684    MYANMAR: 38,
23685    ORIYA: 39,
23686    PERSIAN: 40,
23687    SIMP_CHINESE_FORMAL: 41,
23688    SIMP_CHINESE_INFORMAL: 42,
23689    TAMIL: 43,
23690    TELUGU: 44,
23691    THAI: 45,
23692    TIBETAN: 46,
23693    TRAD_CHINESE_FORMAL: 47,
23694    TRAD_CHINESE_INFORMAL: 48,
23695    UPPER_ARMENIAN: 49,
23696    DISCLOSURE_OPEN: 50,
23697    DISCLOSURE_CLOSED: 51
23698};
23699
23700var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
23701    switch (type) {
23702        case 'disc':
23703            return LIST_STYLE_TYPE.DISC;
23704        case 'circle':
23705            return LIST_STYLE_TYPE.CIRCLE;
23706        case 'square':
23707            return LIST_STYLE_TYPE.SQUARE;
23708        case 'decimal':
23709            return LIST_STYLE_TYPE.DECIMAL;
23710        case 'cjk-decimal':
23711            return LIST_STYLE_TYPE.CJK_DECIMAL;
23712        case 'decimal-leading-zero':
23713            return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
23714        case 'lower-roman':
23715            return LIST_STYLE_TYPE.LOWER_ROMAN;
23716        case 'upper-roman':
23717            return LIST_STYLE_TYPE.UPPER_ROMAN;
23718        case 'lower-greek':
23719            return LIST_STYLE_TYPE.LOWER_GREEK;
23720        case 'lower-alpha':
23721            return LIST_STYLE_TYPE.LOWER_ALPHA;
23722        case 'upper-alpha':
23723            return LIST_STYLE_TYPE.UPPER_ALPHA;
23724        case 'arabic-indic':
23725            return LIST_STYLE_TYPE.ARABIC_INDIC;
23726        case 'armenian':
23727            return LIST_STYLE_TYPE.ARMENIAN;
23728        case 'bengali':
23729            return LIST_STYLE_TYPE.BENGALI;
23730        case 'cambodian':
23731            return LIST_STYLE_TYPE.CAMBODIAN;
23732        case 'cjk-earthly-branch':
23733            return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
23734        case 'cjk-heavenly-stem':
23735            return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
23736        case 'cjk-ideographic':
23737            return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
23738        case 'devanagari':
23739            return LIST_STYLE_TYPE.DEVANAGARI;
23740        case 'ethiopic-numeric':
23741            return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
23742        case 'georgian':
23743            return LIST_STYLE_TYPE.GEORGIAN;
23744        case 'gujarati':
23745            return LIST_STYLE_TYPE.GUJARATI;
23746        case 'gurmukhi':
23747            return LIST_STYLE_TYPE.GURMUKHI;
23748        case 'hebrew':
23749            return LIST_STYLE_TYPE.HEBREW;
23750        case 'hiragana':
23751            return LIST_STYLE_TYPE.HIRAGANA;
23752        case 'hiragana-iroha':
23753            return LIST_STYLE_TYPE.HIRAGANA_IROHA;
23754        case 'japanese-formal':
23755            return LIST_STYLE_TYPE.JAPANESE_FORMAL;
23756        case 'japanese-informal':
23757            return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
23758        case 'kannada':
23759            return LIST_STYLE_TYPE.KANNADA;
23760        case 'katakana':
23761            return LIST_STYLE_TYPE.KATAKANA;
23762        case 'katakana-iroha':
23763            return LIST_STYLE_TYPE.KATAKANA_IROHA;
23764        case 'khmer':
23765            return LIST_STYLE_TYPE.KHMER;
23766        case 'korean-hangul-formal':
23767            return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
23768        case 'korean-hanja-formal':
23769            return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
23770        case 'korean-hanja-informal':
23771            return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
23772        case 'lao':
23773            return LIST_STYLE_TYPE.LAO;
23774        case 'lower-armenian':
23775            return LIST_STYLE_TYPE.LOWER_ARMENIAN;
23776        case 'malayalam':
23777            return LIST_STYLE_TYPE.MALAYALAM;
23778        case 'mongolian':
23779            return LIST_STYLE_TYPE.MONGOLIAN;
23780        case 'myanmar':
23781            return LIST_STYLE_TYPE.MYANMAR;
23782        case 'oriya':
23783            return LIST_STYLE_TYPE.ORIYA;
23784        case 'persian':
23785            return LIST_STYLE_TYPE.PERSIAN;
23786        case 'simp-chinese-formal':
23787            return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
23788        case 'simp-chinese-informal':
23789            return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
23790        case 'tamil':
23791            return LIST_STYLE_TYPE.TAMIL;
23792        case 'telugu':
23793            return LIST_STYLE_TYPE.TELUGU;
23794        case 'thai':
23795            return LIST_STYLE_TYPE.THAI;
23796        case 'tibetan':
23797            return LIST_STYLE_TYPE.TIBETAN;
23798        case 'trad-chinese-formal':
23799            return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
23800        case 'trad-chinese-informal':
23801            return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
23802        case 'upper-armenian':
23803            return LIST_STYLE_TYPE.UPPER_ARMENIAN;
23804        case 'disclosure-open':
23805            return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
23806        case 'disclosure-closed':
23807            return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
23808        case 'none':
23809        default:
23810            return LIST_STYLE_TYPE.NONE;
23811    }
23812};
23813
23814var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
23815    var listStyleImage = (0, background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
23816    return {
23817        listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
23818        listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
23819        listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
23820    };
23821};
23822
23823var parseListStylePosition = function parseListStylePosition(position) {
23824    switch (position) {
23825        case 'inside':
23826            return LIST_STYLE_POSITION.INSIDE;
23827        case 'outside':
23828        default:
23829            return LIST_STYLE_POSITION.OUTSIDE;
23830    }
23831};
23832});
23833
23834unwrapExports(listStyle);
23835var listStyle_1 = listStyle.parseListStyle;
23836var listStyle_2 = listStyle.parseListStyleType;
23837var listStyle_3 = listStyle.LIST_STYLE_TYPE;
23838var listStyle_4 = listStyle.LIST_STYLE_POSITION;
23839
23840var margin = createCommonjsModule(function (module, exports) {
23841Object.defineProperty(exports, "__esModule", {
23842    value: true
23843});
23844exports.parseMargin = undefined;
23845
23846
23847
23848var _Length2 = _interopRequireDefault(Length_1);
23849
23850function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23851
23852var SIDES = ['top', 'right', 'bottom', 'left'];
23853
23854var parseMargin = exports.parseMargin = function parseMargin(style) {
23855    return SIDES.map(function (side) {
23856        return new _Length2.default(style.getPropertyValue('margin-' + side));
23857    });
23858};
23859});
23860
23861unwrapExports(margin);
23862var margin_1 = margin.parseMargin;
23863
23864var overflow = createCommonjsModule(function (module, exports) {
23865Object.defineProperty(exports, "__esModule", {
23866    value: true
23867});
23868var OVERFLOW = exports.OVERFLOW = {
23869    VISIBLE: 0,
23870    HIDDEN: 1,
23871    SCROLL: 2,
23872    AUTO: 3
23873};
23874
23875var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
23876    switch (overflow) {
23877        case 'hidden':
23878            return OVERFLOW.HIDDEN;
23879        case 'scroll':
23880            return OVERFLOW.SCROLL;
23881        case 'auto':
23882            return OVERFLOW.AUTO;
23883        case 'visible':
23884        default:
23885            return OVERFLOW.VISIBLE;
23886    }
23887};
23888});
23889
23890unwrapExports(overflow);
23891var overflow_1 = overflow.OVERFLOW;
23892var overflow_2 = overflow.parseOverflow;
23893
23894var overflowWrap = createCommonjsModule(function (module, exports) {
23895Object.defineProperty(exports, "__esModule", {
23896    value: true
23897});
23898var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
23899    NORMAL: 0,
23900    BREAK_WORD: 1
23901};
23902
23903var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
23904    switch (overflow) {
23905        case 'break-word':
23906            return OVERFLOW_WRAP.BREAK_WORD;
23907        case 'normal':
23908        default:
23909            return OVERFLOW_WRAP.NORMAL;
23910    }
23911};
23912});
23913
23914unwrapExports(overflowWrap);
23915var overflowWrap_1 = overflowWrap.OVERFLOW_WRAP;
23916var overflowWrap_2 = overflowWrap.parseOverflowWrap;
23917
23918var position = createCommonjsModule(function (module, exports) {
23919Object.defineProperty(exports, "__esModule", {
23920    value: true
23921});
23922var POSITION = exports.POSITION = {
23923    STATIC: 0,
23924    RELATIVE: 1,
23925    ABSOLUTE: 2,
23926    FIXED: 3,
23927    STICKY: 4
23928};
23929
23930var parsePosition = exports.parsePosition = function parsePosition(position) {
23931    switch (position) {
23932        case 'relative':
23933            return POSITION.RELATIVE;
23934        case 'absolute':
23935            return POSITION.ABSOLUTE;
23936        case 'fixed':
23937            return POSITION.FIXED;
23938        case 'sticky':
23939            return POSITION.STICKY;
23940    }
23941
23942    return POSITION.STATIC;
23943};
23944});
23945
23946unwrapExports(position);
23947var position_1 = position.POSITION;
23948var position_2 = position.parsePosition;
23949
23950var textShadow = createCommonjsModule(function (module, exports) {
23951Object.defineProperty(exports, "__esModule", {
23952    value: true
23953});
23954exports.parseTextShadow = undefined;
23955
23956
23957
23958var _Color2 = _interopRequireDefault(Color_1);
23959
23960function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23961
23962var NUMBER = /^([+-]|\d|\.)$/i;
23963
23964var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
23965    if (textShadow === 'none' || typeof textShadow !== 'string') {
23966        return null;
23967    }
23968
23969    var currentValue = '';
23970    var isLength = false;
23971    var values = [];
23972    var shadows = [];
23973    var numParens = 0;
23974    var color = null;
23975
23976    var appendValue = function appendValue() {
23977        if (currentValue.length) {
23978            if (isLength) {
23979                values.push(parseFloat(currentValue));
23980            } else {
23981                color = new _Color2.default(currentValue);
23982            }
23983        }
23984        isLength = false;
23985        currentValue = '';
23986    };
23987
23988    var appendShadow = function appendShadow() {
23989        if (values.length && color !== null) {
23990            shadows.push({
23991                color: color,
23992                offsetX: values[0] || 0,
23993                offsetY: values[1] || 0,
23994                blur: values[2] || 0
23995            });
23996        }
23997        values.splice(0, values.length);
23998        color = null;
23999    };
24000
24001    for (var i = 0; i < textShadow.length; i++) {
24002        var c = textShadow[i];
24003        switch (c) {
24004            case '(':
24005                currentValue += c;
24006                numParens++;
24007                break;
24008            case ')':
24009                currentValue += c;
24010                numParens--;
24011                break;
24012            case ',':
24013                if (numParens === 0) {
24014                    appendValue();
24015                    appendShadow();
24016                } else {
24017                    currentValue += c;
24018                }
24019                break;
24020            case ' ':
24021                if (numParens === 0) {
24022                    appendValue();
24023                } else {
24024                    currentValue += c;
24025                }
24026                break;
24027            default:
24028                if (currentValue.length === 0 && NUMBER.test(c)) {
24029                    isLength = true;
24030                }
24031                currentValue += c;
24032        }
24033    }
24034
24035    appendValue();
24036    appendShadow();
24037
24038    if (shadows.length === 0) {
24039        return null;
24040    }
24041
24042    return shadows;
24043};
24044});
24045
24046unwrapExports(textShadow);
24047var textShadow_1 = textShadow.parseTextShadow;
24048
24049var textTransform = createCommonjsModule(function (module, exports
24049) {
24050Object.defineProperty(exports, "__esModule", {
24051    value: true
24052});
24053var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
24054    NONE: 0,
24055    LOWERCASE: 1,
24056    UPPERCASE: 2,
24057    CAPITALIZE: 3
24058};
24059
24060var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
24061    switch (textTransform) {
24062        case 'uppercase':
24063            return TEXT_TRANSFORM.UPPERCASE;
24064        case 'lowercase':
24065            return TEXT_TRANSFORM.LOWERCASE;
24066        case 'capitalize':
24067            return TEXT_TRANSFORM.CAPITALIZE;
24068    }
24069
24070    return TEXT_TRANSFORM.NONE;
24071};
24072});
24073
24074unwrapExports(textTransform);
24075var textTransform_1 = textTransform.TEXT_TRANSFORM;
24076var textTransform_2 = textTransform.parseTextTransform;
24077
24078var transform = createCommonjsModule(function (module, exports) {
24079Object.defineProperty(exports, "__esModule", {
24080    value: true
24081});
24082exports.parseTransform = undefined;
24083
24084
24085
24086var _Length2 = _interopRequireDefault(Length_1);
24087
24088function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24089
24090var toFloat = function toFloat(s) {
24091    return parseFloat(s.trim());
24092};
24093
24094var MATRIX = /(matrix|matrix3d)\((.+)\)/;
24095
24096var parseTransform = exports.parseTransform = function parseTransform(style) {
24097    var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
24098    // $FlowFixMe
24099    style.msTransform ||
24100    // $FlowFixMe
24101    style.oTransform);
24102    if (transform === null) {
24103        return null;
24104    }
24105
24106    return {
24107        transform: transform,
24108        transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
24109        // $FlowFixMe
24110        style.msTransformOrigin ||
24111        // $FlowFixMe
24112        style.oTransformOrigin)
24113    };
24114};
24115
24116// $FlowFixMe
24117var parseTransformOrigin = function parseTransformOrigin(origin) {
24118    if (typeof origin !== 'string') {
24119        var v = new _Length2.default('0');
24120        return [v, v];
24121    }
24122    var values = origin.split(' ').map(_Length2.default.create);
24123    return [values[0], values[1]];
24124};
24125
24126// $FlowFixMe
24127var parseTransformMatrix = function parseTransformMatrix(transform) {
24128    if (transform === 'none' || typeof transform !== 'string') {
24129        return null;
24130    }
24131
24132    var match = transform.match(MATRIX);
24133    if (match) {
24134        if (match[1] === 'matrix') {
24135            var matrix = match[2].split(',').map(toFloat);
24136            return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
24137        } else {
24138            var matrix3d = match[2].split(',').map(toFloat);
24139            return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
24140        }
24141    }
24142    return null;
24143};
24144});
24145
24146unwrapExports(transform);
24147var transform_1 = transform.parseTransform;
24148
24149var visibility = createCommonjsModule(function (module, exports) {
24150Object.defineProperty(exports, "__esModule", {
24151    value: true
24152});
24153var VISIBILITY = exports.VISIBILITY = {
24154    VISIBLE: 0,
24155    HIDDEN: 1,
24156    COLLAPSE: 2
24157};
24158
24159var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
24160    switch (visibility) {
24161        case 'hidden':
24162            return VISIBILITY.HIDDEN;
24163        case 'collapse':
24164            return VISIBILITY.COLLAPSE;
24165        case 'visible':
24166        default:
24167            return VISIBILITY.VISIBLE;
24168    }
24169};
24170});
24171
24172unwrapExports(visibility);
24173var visibility_1 = visibility.VISIBILITY;
24174var visibility_2 = visibility.parseVisibility;
24175
24176var wordBreak = createCommonjsModule(function (module, exports) {
24177Object.defineProperty(exports, "__esModule", {
24178    value: true
24179});
24180var WORD_BREAK = exports.WORD_BREAK = {
24181    NORMAL: 'normal',
24182    BREAK_ALL: 'break-all',
24183    KEEP_ALL: 'keep-all'
24184};
24185
24186var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
24187    switch (wordBreak) {
24188        case 'break-all':
24189            return WORD_BREAK.BREAK_ALL;
24190        case 'keep-all':
24191            return WORD_BREAK.KEEP_ALL;
24192        case 'normal':
24193        default:
24194            return WORD_BREAK.NORMAL;
24195    }
24196};
24197});
24198
24199unwrapExports(wordBreak);
24200var wordBreak_1 = wordBreak.WORD_BREAK;
24201var wordBreak_2 = wordBreak.parseWordBreak;
24202
24203var zIndex = createCommonjsModule(function (module, exports) {
24204Object.defineProperty(exports, "__esModule", {
24205    value: true
24206});
24207var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
24208    var auto = zIndex === 'auto';
24209    return {
24210        auto: auto,
24211        order: auto ? 0 : parseInt(zIndex, 10)
24212    };
24213};
24214});
24215
24216unwrapExports(zIndex);
24217var zIndex_1 = zIndex.parseZIndex;
24218
24219var ForeignObjectRenderer_1 = createCommonjsModule(function (module, exports) {
24220Object.defineProperty(exports, "__esModule", {
24221    value: true
24222});
24223
24224var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
24225
24226function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24227
24228var ForeignObjectRenderer = function () {
24229    function ForeignObjectRenderer(element) {
24230        _classCallCheck(this, ForeignObjectRenderer);
24231
24232        this.element = element;
24233    }
24234
24235    _createClass(ForeignObjectRenderer, [{
24236        key: 'render',
24237        value: function render(options) {
24238            var _this = this;
24239
24240            this.options = options;
24241            this.canvas = document.createElement('canvas');
24242            this.ctx = this.canvas.getContext('2d');
24243            this.canvas.width = Math.floor(options.width) * options.scale;
24244            this.canvas.height = Math.floor(options.height) * options.scale;
24245            this.canvas.style.width = options.width + 'px';
24246            this.canvas.style.height = options.height + 'px';
24247
24248            options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
24249            var svg = createForeignObjectSVG(Math.max(options.windowWidth, options.width) * options.scale, Math.max(options.windowHeight, options.height) * options.scale, options.scrollX * options.scale, options.scrollY * options.scale, this.element);
24250
24251            return loadSerializedSVG(svg).then(function (img) {
24252                if (options.backgroundColor) {
24253                    _this.ctx.fillStyle = options.backgroundColor.toString();
24254                    _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
24255                }
24256
24257                _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
24258                return _this.canvas;
24259            });
24260        }
24261    }]);
24262
24263    return ForeignObjectRenderer;
24264}();
24265
24266exports.default = ForeignObjectRenderer;
24267var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
24268    var xmlns = 'http://www.w3.org/2000/svg';
24269    var svg = document.createElementNS(xmlns, 'svg');
24270    var foreignObject = document.createElementNS(xmlns, 'foreignObject');
24271    svg.setAttributeNS(null, 'width', width);
24272    svg.setAttributeNS(null, 'height', height);
24273
24274    foreignObject.setAttributeNS(null, 'width', '100%');
24275    foreignObject.setAttributeNS(null, 'height', '100%');
24276    foreignObject.setAttributeNS(null, 'x', x);
24277    foreignObject.setAttributeNS(null, 'y', y);
24278    foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
24279    svg.appendChild(foreignObject);
24280
24281    foreignObject.appendChild(node);
24282
24283    return svg;
24284};
24285
24286var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
24287    return new Promise(function (resolve, reject) {
24288        var img = new Image();
24289        img.onload = function () {
24290            return resolve(img);
24291        };
24292        img.onerror = reject;
24293
24294        img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
24295    });
24296};
24297});
24298
24299unwrapExports(ForeignObjectRenderer_1);
24300var ForeignObjectRenderer_2 = ForeignObjectRenderer_1.createForeignObjectSVG;
24301var ForeignObjectRenderer_3 = ForeignObjectRenderer_1.loadSerializedSVG;
24302
24303var Feature = createCommonjsModule(function (module, exports) {
24304Object.defineProperty(exports, "__esModule", {
24305    value: true
24306});
24307
24308
24309
24310var testRangeBounds = function testRangeBounds(document) {
24311    var TEST_HEIGHT = 123;
24312
24313    if (document.createRange) {
24314        var range = document.createRange();
24315        if (range.getBoundingClientRect) {
24316            var testElement = document.createElement('boundtest');
24317            testElement.style.height = TEST_HEIGHT + 'px';
24318            testElement.style.display = 'block';
24319            document.body.appendChild(testElement);
24320
24321            range.selectNode(testElement);
24322            var rangeBounds = range.getBoundingClientRect();
24323            var rangeHeight = Math.round(rangeBounds.height);
24324            document.body.removeChild(testElement);
24325            if (rangeHeight === TEST_HEIGHT) {
24326                return true;
24327            }
24328        }
24329    }
24330
24331    return false;
24332};
24333
24334// iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
24335var testBase64 = function testBase64(document, src) {
24336    var img = new Image();
24337    var canvas = document.createElement('canvas');
24338    var ctx = canvas.getContext('2d');
24339
24340    return new Promise(function (resolve) {
24341        // Single pixel base64 image renders fine on iOS 10.3???
24342        img.src = src;
24343
24344        var onload = function onload() {
24345            try {
24346                ctx.drawImage(img, 0, 0);
24347                canvas.toDataURL();
24348            } catch (e) {
24349                return resolve(false);
24350            }
24351
24352            return resolve(true);
24353        };
24354
24355        img.onload = onload;
24356        img.onerror = function () {
24357            return resolve(false);
24358        };
24359
24360        if (img.complete === true) {
24361            setTimeout(function () {
24362                onload();
24363            }, 500);
24364        }
24365    });
24366};
24367
24368var testCORS = function testCORS() {
24369    return typeof new Image().crossOrigin !== 'undefined';
24370};
24371
24372var testResponseType = function testResponseType() {
24373    return typeof new XMLHttpRequest().responseType === 'string';
24374};
24375
24376var testSVG = function testSVG(document) {
24377    var img = new Image();
24378    var canvas = document.createElement('canvas');
24379    var ctx = canvas.getContext('2d');
24380    img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
24381
24382    try {
24383        ctx.drawImage(img, 0, 0);
24384        canvas.toDataURL();
24385    } catch (e) {
24386        return false;
24387    }
24388    return true;
24389};
24390
24391var isGreenPixel = function isGreenPixel(data) {
24392    return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
24393};
24394
24395var testForeignObject = function testForeignObject(document) {
24396    var canvas = document.createElement('canvas');
24397    var size = 100;
24398    canvas.width = size;
24399    canvas.height = size;
24400    var ctx = canvas.getContext('2d');
24401    ctx.fillStyle = 'rgb(0, 255, 0)';
24402    ctx.fillRect(0, 0, size, size);
24403
24404    var img = new Image();
24405    var greenImageSrc = canvas.toDataURL();
24406    img.src = greenImageSrc;
24407    var svg = (0, ForeignObjectRenderer_1.createForeignObjectSVG)(size, size, 0, 0, img);
24408    ctx.fillStyle = 'red';
24409    ctx.fillRect(0, 0, size, size);
24410
24411    return (0, ForeignObjectRenderer_1.loadSerializedSVG)(svg).then(function (img) {
24412        ctx.drawImage(img, 0, 0);
24413        var data = ctx.getImageData(0, 0, size, size).data;
24414        ctx.fillStyle = 'red';
24415        ctx.fillRect(0, 0, size, size);
24416
24417        var node = document.createElement('div');
24418        node.style.backgroundImage = 'url(' + greenImageSrc + ')';
24419        node.style.height = size + 'px';
24420        // Firefox 55 does not render inline <img /> tags
24421        return isGreenPixel(data) ? (0, ForeignObjectRenderer_1.loadSerializedSVG)((0, ForeignObjectRenderer_1.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
24422    }).then(function (img) {
24423        ctx.drawImage(img, 0, 0);
24424        // Edge does not render background-images
24425        return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
24426    }).catch(function (e) {
24427        return false;
24428    });
24429};
24430
24431var FEATURES = {
24432    // $FlowFixMe - get/set properties not yet supported
24433    get SUPPORT_RANGE_BOUNDS() {
24434        var value = testRangeBounds(document);
24435        Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
24436        return value;
24437    },
24438    // $FlowFixMe - get/set properties not yet supported
24439    get SUPPORT_SVG_DRAWING() {
24440        var value = testSVG(document);
24441        Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
24442        return value;
24443    },
24444    // $FlowFixMe - get/set properties not yet supported
24445    get SUPPORT_BASE64_DRAWING() {
24446        return function (src) {
24447            var _value = testBase64(document, src);
24448            Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
24449                    return _value;
24450                } });
24451            return _value;
24452        };
24453    },
24454    // $FlowFixMe - get/set properties not yet supported
24455    get SUPPORT_FOREIGNOBJECT_DRAWING() {
24456        var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
24457        Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
24458        return value;
24459    },
24460    // $FlowFixMe - get/set properties not yet supported
24461    get SUPPORT_CORS_IMAGES() {
24462        var value = testCORS();
24463        Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
24464        return value;
24465    },
24466    // $FlowFixMe - get/set properties not yet supported
24467    get SUPPORT_RESPONSE_TYPE() {
24468        var value = testResponseType();
24469        Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
24470        return value;
24471    },
24472    // $FlowFixMe - get/set properties not yet supported
24473    get SUPPORT_CORS_XHR() {
24474        var value = 'withCredentials' in new XMLHttpRequest();
24475        Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
24476        return value;
24477    }
24478};
24479
24480exports.default = FEATURES;
24481});
24482
24483unwrapExports(Feature);
24484
24485var Util$2 = createCommonjsModule(function (module, exports) {
24486Object.defineProperty(exports, "__esModule", {
24487    value: true
24488});
24489var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
24490    var codePoints = [];
24491    var i = 0;
24492    var length = str.length;
24493    while (i < length) {
24494        var value = str.charCodeAt(i++);
24495        if (value >= 0xd800 && value <= 0xdbff && i < length) {
24496            var extra = str.charCodeAt(i++);
24497            if ((extra & 0xfc00) === 0xdc00) {
24498                codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
24499            } else {
24500                codePoints.push(value);
24501                i--;
24502            }
24503        } else {
24504            codePoints.push(value);
24505        }
24506    }
24507    return codePoints;
24508};
24509
24510var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
24511    if (String.fromCodePoint) {
24512        return String.fromCodePoint.apply(String, arguments);
24513    }
24514
24515    var length = arguments.length;
24516    if (!length) {
24517        return '';
24518    }
24519
24520    var codeUnits = [];
24521
24522    var index = -1;
24523    var result = '';
24524    while (++index < length) {
24525        var codePoint = arguments.length <= index ? undefined : arguments[index];
24526        if (codePoint <= 0xffff) {
24527            codeUnits.push(codePoint);
24528        } else {
24529            codePoint -= 0x10000;
24530            codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
24531        }
24532        if (index + 1 === length || codeUnits.length > 0x4000) {
24533            result += String.fromCharCode.apply(String, codeUnits);
24534            codeUnits.length = 0;
24535        }
24536    }
24537    return result;
24538};
24539
24540var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
24541
24542// Use a lookup table to find the index.
24543var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
24544for (var i = 0; i < chars.length; i++) {
24545    lookup[chars.charCodeAt(i)] = i;
24546}
24547
24548var decode = exports.decode = function decode(base64) {
24549    var bufferLength = base64.length * 0.75,
24550        len = base64.length,
24551        i = void 0,
24552        p = 0,
24553        encoded1 = void 0,
24554        encoded2 = void 0,
24555        encoded3 = void 0,
24556        encoded4 = void 0;
24557
24558    if (base64[base64.length - 1] === '=') {
24559        bufferLength--;
24560        if (base64[base64.length - 2] === '=') {
24561            bufferLength--;
24562        }
24563    }
24564
24565    var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
24566    var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
24567
24568    for (i = 0; i < len; i += 4) {
24569        encoded1 = lookup[base64.charCodeAt(i)];
24570        encoded2 = lookup[base64.charCodeAt(i + 1)];
24571        encoded3 = lookup[base64.charCodeAt(i + 2)];
24572        encoded4 = lookup[base64.charCodeAt(i + 3)];
24573
24574        bytes[p++] = encoded1 << 2 | encoded2 >> 4;
24575        bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
24576        bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
24577    }
24578
24579    return buffer;
24580};
24581
24582var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
24583    var length = buffer.length;
24584    var bytes = [];
24585    for (var _i = 0; _i < length; _i += 2) {
24586        bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
24587    }
24588    return bytes;
24589};
24590
24591var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
24592    var length = buffer.length;
24593    var bytes = [];
24594    for (var _i2 = 0; _i2 < length; _i2 += 4) {
24595        bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
24596    }
24597    return bytes;
24598};
24599});
24600
24601unwrapExports(Util$2);
24602var Util_1$1 = Util$2.toCodePoints;
24603var Util_2$1 = Util$2.fromCodePoint;
24604var Util_3$1 = Util$2.decode;
24605var Util_4$1 = Util$2.polyUint16Array;
24606var Util_5 = Util$2.polyUint32Array;
24607
24608var Trie_1 = createCommonjsModule(function (module, exports) {
24609Object.defineProperty(exports, "__esModule", {
24610    value: true
24611});
24612exports.Trie = exports.createTrieFromBase64 = exports.UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_DATA_MASK = exports.UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_SHIFT_1_2 = exports.UTRIE2_INDEX_SHIFT = exports.UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_2 = undefined;
24613
24614var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
24615
24616
24617
24618function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24619
24620/** Shift size for getting the index-2 table offset. */
24621var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
24622
24623/** Shift size for getting the index-1 table offset. */
24624var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
24625
24626/**
24627 * Shift size for shifting left the index array values.
24628 * Increases possible data size with 16-bit index values at the cost
24629 * of compactability.
24630 * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
24631 */
24632var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
24633
24634/**
24635 * Difference between the two shift sizes,
24636 * for getting an index-1 offset from an index-2 offset. 6=11-5
24637 */
24638var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
24639
24640/**
24641 * The part of the index-2 table for U+D800..U+DBFF stores values for
24642 * lead surrogate code _units_ not code _points_.
24643 * Values for lead surrogate code _points_ are indexed with this portion of the table.
24644 * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
24645 */
24646var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
24647
24648/** Number of entries in a data block. 32=0x20 */
24649var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
24650/** Mask for getting the lower bits for the in-data-block offset. */
24651var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
24652
24653var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
24654/** Count the lengths of both BMP pieces. 2080=0x820 */
24655var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
24656/**
24657 * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
24658 * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
24659 */
24660var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
24661var UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */
24662/**
24663 * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
24664 * Variable length, for code points up to highStart, where the last single-value range starts.
24665 * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
24666 * (For 0x100000 supplementary code points U+10000..U+10ffff.)
24667 *
24668 * The part of the index-2 table for supplementary code points starts
24669 * after this index-1 table.
24670 *
24671 * Both the index-1 table and the following part of the index-2 table
24672 * are omitted completely if there is only BMP data.
24673 */
24674var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
24675
24676/**
24677 * Number of index-1 entries for the BMP. 32=0x20
24678 * This part of the index-1 table is omitted from the serialized form.
24679 */
24680var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
24681
24682/** Number of entries in an index-2 block. 64=0x40 */
24683var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
24684/** Mask for getting the lower bits for the in-index-2-block offset. */
24685var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
24686
24687var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
24688    var buffer = (0, Util$2.decode)(base64);
24689    var view32 = Array.isArray(buffer) ? (0, Util$2.polyUint32Array)(buffer) : new Uint32Array(buffer);
24690    var view16 = Array.isArray(buffer) ? (0, Util$2.polyUint16Array)(buffer) : new Uint16Array(buffer);
24691    var headerLength = 24;
24692
24693    var index = view16.slice(headerLength / 2, view32[4] / 2);
24694    var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
24695
24696    return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
24697};
24698
24699var Trie = exports.Trie = function () {
24700    function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
24701        _classCallCheck(this, Trie);
24702
24703        this.initialValue = initialValue;
24704        this.errorValue = errorValue;
24705        this.highStart = highStart;
24706        this.highValueIndex = highValueIndex;
24707        this.index = index;
24708        this.data = data;
24709    }
24710
24711    /**
24712     * Get the value for a code point as stored in the Trie.
24713     *
24714     * @param codePoint the code point
24715     * @return the value
24716     */
24717
24718
24719    _createClass(Trie, [{
24720        key: 'get',
24721        value: function get(codePoint) {
24722            var ix = void 0;
24723            if (codePoint >= 0) {
24724                if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
24725                    // Ordinary BMP code point, excluding leading surrogates.
24726                    // BMP uses a single level lookup.  BMP index starts at offset 0 in the Trie2 index.
24727                    // 16 bit data is stored in the index array itself.
24728                    ix = this.index[codePoint >> UTRIE2_SHIFT_2];
24729                    ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
24730                    return this.data[ix];
24731                }
24732
24733                if (codePoint <= 0xffff) {
24734                    // Lead Surrogate Code Point.  A Separate index section is stored for
24735                    // lead surrogate code units and code points.
24736                    //   The main index has the code unit data.
24737                    //   For this function, we need the code point data.
24738                    // Note: this expression could be refactored for slightly improved efficie
24738ncy, but
24739                    //       surrogate code points will be so rare in practice that it's not worth it.
24740                    ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
24741                    ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
24742                    return this.data[ix];
24743                }
24744
24745                if (codePoint < this.highStart) {
24746                    // Supplemental code point, use two-level lookup.
24747                    ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
24748                    ix = this.index[ix];
24749                    ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
24750                    ix = this.index[ix];
24751                    ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
24752                    return this.data[ix];
24753                }
24754                if (codePoint <= 0x10ffff) {
24755                    return this.data[this.highValueIndex];
24756                }
24757            }
24758
24759            // Fall through.  The code point is outside of the legal range of 0..0x10ffff.
24760            return this.errorValue;
24761        }
24762    }]);
24763
24764    return Trie;
24765}();
24766});
24767
24768unwrapExports(Trie_1);
24769var Trie_2 = Trie_1.Trie;
24770var Trie_3 = Trie_1.createTrieFromBase64;
24771var Trie_4 = Trie_1.UTRIE2_INDEX_2_MASK;
24772var Trie_5 = Trie_1.UTRIE2_INDEX_2_BLOCK_LENGTH;
24773var Trie_6 = Trie_1.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH;
24774var Trie_7 = Trie_1.UTRIE2_INDEX_1_OFFSET;
24775var Trie_8 = Trie_1.UTRIE2_UTF8_2B_INDEX_2_LENGTH;
24776var Trie_9 = Trie_1.UTRIE2_UTF8_2B_INDEX_2_OFFSET;
24777var Trie_10 = Trie_1.UTRIE2_INDEX_2_BMP_LENGTH;
24778var Trie_11 = Trie_1.UTRIE2_LSCP_INDEX_2_LENGTH;
24779var Trie_12 = Trie_1.UTRIE2_DATA_MASK;
24780var Trie_13 = Trie_1.UTRIE2_DATA_BLOCK_LENGTH;
24781var Trie_14 = Trie_1.UTRIE2_LSCP_INDEX_2_OFFSET;
24782var Trie_15 = Trie_1.UTRIE2_SHIFT_1_2;
24783var Trie_16 = Trie_1.UTRIE2_INDEX_SHIFT;
24784var Trie_17 = Trie_1.UTRIE2_SHIFT_1;
24785var Trie_18 = Trie_1.UTRIE2_SHIFT_2;
24786
24787var linebreakTrie = '
vendor: 50,624 bytes, line 24787
24787KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA
vendor: 1,559 bytes, lines 24787-24797
24787';
24788
24789var LineBreak = createCommonjsModule(function (module, exports) {
24790Object.defineProperty(exports, "__esModule", {
24791    value: true
24792});
24793exports.LineBreaker = exports.inlineBreakOpportunities = exports.lineBreakAtIndex = exports.codePointsToCharacterClasses = exports.UnicodeTrie = exports.BREAK_ALLOWED = exports.BREAK_NOT_ALLOWED = exports.BREAK_MANDATORY = exports.classes = exports.LETTER_NUMBER_MODIFIER = undefined;
24794
24795var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
24796
24797var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); }
24797 else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
24798
24799
24800
24801
24802
24803var _linebreakTrie2 = _interopRequireDefault(linebreakTrie);
24804
24805
24806
24807function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24808
24809function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
24810
24811function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24812
24813var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
24814
24815// Non-tailorable Line Breaking Classes
24816var BK = 1; //  Cause a line break (after)
24817var CR = 2; //  Cause a line break (after), except between CR and LF
24818var LF = 3; //  Cause a line break (after)
24819var CM = 4; //  Prohibit a line break between the character and the preceding character
24820var NL = 5; //  Cause a line break (after)
24821var SG = 6; //  Do not occur in well-formed text
24822var WJ = 7; //  Prohibit line breaks before and after
24823var ZW = 8; //  Provide a break opportunity
24824var GL = 9; //  Prohibit line breaks before and after
24825var SP = 10; // Enable indirect line breaks
24826var ZWJ = 11; // Prohibit line breaks within joiner sequences
24827// Break Opportunities
24828var B2 = 12; //  Provide a line break opportunity before and after the character
24829var BA = 13; //  Generally provide a line break opportunity after the character
24830var BB = 14; //  Generally provide a line break opportunity before the character
24831var HY = 15; //  Provide a line break opportunity after the character, except in numeric context
24832var CB = 16; //   Provide a line break opportunity contingent on additional information
24833// Characters Prohibiting Certain Breaks
24834var CL = 17; //  Prohibit line breaks before
24835var CP = 18; //  Prohibit line breaks before
24836var EX = 19; //  Prohibit line breaks before
24837var IN = 20; //  Allow only indirect line breaks between pairs
24838var NS = 21; //  Allow only indirect line breaks before
24839var OP = 22; //  Prohibit line breaks after
24840var QU = 23; //  Act like they are both opening and closing
24841// Numeric Context
24842var IS = 24; //  Prevent breaks after any and before numeric
24843var NU = 25; //  Form numeric expressions for line breaking purposes
24844var PO = 26; //  Do not break following a numeric expression
24845var PR = 27; //  Do not break in front of a numeric expression
24846var SY = 28; //  Prevent a break before; and allow a break after
24847// Other Characters
24848var AI = 29; //  Act like AL when the resolvedEAW is N; otherwise; act as ID
24849var AL = 30; //  Are alphabetic characters or symbols that are used with alphabetic characters
24850var CJ = 31; //  Treat as NS or ID for strict or normal breaking.
24851var EB = 32; //  Do not break from following Emoji Modifier
24852var EM = 33; //  Do not break from preceding Emoji Base
24853var H2 = 34; //  Form Korean syllable blocks
24854var H3 = 35; //  Form Korean syllable blocks
24855var HL = 36; //  Do not break around a following hyphen; otherwise act as Alphabetic
24856var ID = 37; //  Break before or after; except in some numeric context
24857var JL = 38; //  Form Korean syllable blocks
24858var JV = 39; //  Form Korean syllable blocks
24859var JT = 40; //  Form Korean syllable blocks
24860var RI = 41; //  Keep pairs together. For pairs; break before and after other classes
24861var SA = 42; //  Provide a line break opportunity contingent on additional, language-specific context analysis
24862var XX = 43; //  Have as yet unknown line breaking behavior or unassigned code positions
24863
24864var classes = exports.classes = {
24865    BK: BK,
24866    CR: CR,
24867    LF: LF,
24868    CM: CM,
24869    NL: NL,
24870    SG: SG,
24871    WJ: WJ,
24872    ZW: ZW,
24873    GL: GL,
24874    SP: SP,
24875    ZWJ: ZWJ,
24876    B2: B2,
24877    BA: BA,
24878    BB: BB,
24879    HY: HY,
24880    CB: CB,
24881    CL: CL,
24882    CP: CP,
24883    EX: EX,
24884    IN: IN,
24885    NS: NS,
24886    OP: OP,
24887    QU: QU,
24888    IS: IS,
24889    NU: NU,
24890    PO: PO,
24891    PR: PR,
24892    SY: SY,
24893    AI: AI,
24894    AL: AL,
24895    CJ: CJ,
24896    EB: EB,
24897    EM: EM,
24898    H2: H2,
24899    H3: H3,
24900    HL: HL,
24901    ID: ID,
24902    JL: JL,
24903    JV: JV,
24904    JT: JT,
24905    RI: RI,
24906    SA: SA,
24907    XX: XX
24908};
24909
24910var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
24911var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
24912var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
24913var UnicodeTrie = exports.UnicodeTrie = (0, Trie_1.createTrieFromBase64)(_linebreakTrie2.default);
24914
24915var ALPHABETICS = [AL, HL];
24916var HARD_LINE_BREAKS = [BK, CR, LF, NL];
24917var SPACE = [SP, ZW];
24918var PREFIX_POSTFIX = [PR, PO];
24919var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
24920var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
24921var HYPHEN = [HY, BA];
24922
vendor: 11,440 bytes, lines 24923-25254
24923var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
24924    var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
24925
24926    var types = [];
24927    var indicies = [];
24928    var categories = [];
24929    codePoints.forEach(function (codePoint, index) {
24930        var classType = UnicodeTrie.get(codePoint);
24931        if (classType > LETTER_NUMBER_MODIFIER) {
24932            categories.push(true);
24933            classType -= LETTER_NUMBER_MODIFIER;
24934        } else {
24935            categories.push(false);
24936        }
24937
24938        if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
24939            // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
24940            if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
24941                indicies.push(index);
24942                return types.push(CB);
24943            }
24944        }
24945
24946        if (classType === CM || classType === ZWJ) {
24947            // LB10 Treat any remaining combining mark or ZWJ as AL.
24948            if (index === 0) {
24949                indicies.push(index);
24950                return types.push(AL);
24951            }
24952
24953            // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
24954            // the base character in all of the following rules. Treat ZWJ as if it were CM.
24955            var prev = types[index - 1];
24956            if (LINE_BREAKS.indexOf(prev) === -1) {
24957                indicies.push(indicies[index - 1]);
24958                return types.push(prev);
24959            }
24960            indicies.push(index);
24961            return types.push(AL);
24962        }
24963
24964        indicies.push(index);
24965
24966        if (classType === CJ) {
24967            return types.push(lineBreak === 'strict' ? NS : ID);
24968        }
24969
24970        if (classType === SA) {
24971            return types.push(AL);
24972        }
24973
24974        if (classType === AI) {
24975            return types.push(AL);
24976        }
24977
24978        // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
24979        // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
24980        // to take into account the actual line breaking properties for these characters.
24981        if (classType === XX) {
24982            if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
24983                return types.push(ID);
24984            } else {
24985                return types.push(AL);
24986            }
24987        }
24988
24989        types.push(classType);
24990    });
24991
24992    return [indicies, types, categories];
24993};
24994
24995var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
24996    var current = classTypes[currentIndex];
24997    if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
24998        var i = currentIndex;
24999        while (i <= classTypes.length) {
25000            i++;
25001            var next = classTypes[i];
25002
25003            if (next === b) {
25004                return true;
25005            }
25006
25007            if (next !== SP) {
25008                break;
25009            }
25010        }
25011    }
25012
25013    if (current === SP) {
25014        var _i = currentIndex;
25015
25016        while (_i > 0) {
25017            _i--;
25018            var prev = classTypes[_i];
25019
25020            if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
25021                var n = currentIndex;
25022                while (n <= classTypes.length) {
25023                    n++;
25024                    var _next = classTypes[n];
25025
25026                    if (_next === b) {
25027                        return true;
25028                    }
25029
25030                    if (_next !== SP) {
25031                        break;
25032                    }
25033                }
25034            }
25035
25036            if (prev !== SP) {
25037                break;
25038            }
25039        }
25040    }
25041    return false;
25042};
25043
25044var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
25045    var i = currentIndex;
25046    while (i >= 0) {
25047        var type = classTypes[i];
25048        if (type === SP) {
25049            i--;
25050        } else {
25051            return type;
25052        }
25053    }
25054    return 0;
25055};
25056
25057var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
25058    if (indicies[index] === 0) {
25059        return BREAK_NOT_ALLOWED;
25060    }
25061
25062    var currentIndex = index - 1;
25063    if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
25064        return BREAK_NOT_ALLOWED;
25065    }
25066
25067    var beforeIndex = currentIndex - 1;
25068    var afterIndex = currentIndex + 1;
25069    var current = classTypes[currentIndex];
25070
25071    // LB4 Always break after hard line breaks.
25072    // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
25073    var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
25074    var next = classTypes[afterIndex];
25075
25076    if (current === CR && next === LF) {
25077        return BREAK_NOT_ALLOWED;
25078    }
25079
25080    if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
25081        return BREAK_MANDATORY;
25082    }
25083
25084    // LB6 Do not break before hard line breaks.
25085    if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
25086        return BREAK_NOT_ALLOWED;
25087    }
25088
25089    // LB7 Do not break before spaces or zero width space.
25090    if (SPACE.indexOf(next) !== -1) {
25091        return BREAK_NOT_ALLOWED;
25092    }
25093
25094    // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
25095    if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
25096        return BREAK_ALLOWED;
25097    }
25098
25099    // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
25100    if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
25101        return BREAK_NOT_ALLOWED;
25102    }
25103
25104    // LB11 Do not break before or after Word joiner and related characters.
25105    if (current === WJ || next === WJ) {
25106        return BREAK_NOT_ALLOWED;
25107    }
25108
25109    // LB12 Do not break after NBSP and related characters.
25110    if (current === GL) {
25111        return BREAK_NOT_ALLOWED;
25112    }
25113
25114    // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
25115    if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
25116        return BREAK_NOT_ALLOWED;
25117    }
25118
25119    // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
25120    if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
25121        return BREAK_NOT_ALLOWED;
25122    }
25123
25124    // LB14 Do not break after ‘[’, even after spaces.
25125    if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
25126        return BREAK_NOT_ALLOWED;
25127    }
25128
25129    // LB15 Do not break within ‘”[’, even with intervening spaces.
25130    if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
25131        return BREAK_NOT_ALLOWED;
25132    }
25133
25134    // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
25135    if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
25136        return BREAK_NOT_ALLOWED;
25137    }
25138
25139    // LB17 Do not break within ‘——’, even with intervening spaces.
25140    if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
25141        return BREAK_NOT_ALLOWED;
25142    }
25143
25144    // LB18 Break after spaces.
25145    if (current === SP) {
25146        return BREAK_ALLOWED;
25147    }
25148
25149    // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
25150    if (current === QU || next === QU) {
25151        return BREAK_NOT_ALLOWED;
25152    }
25153
25154    // LB20 Break before and after unresolved CB.
25155    if (next === CB || current === CB) {
25156        return BREAK_ALLOWED;
25157    }
25158
25159    // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
25160    if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
25161        return BREAK_NOT_ALLOWED;
25162    }
25163
25164    // LB21a Don't break after Hebrew + Hyphen.
25165    if (before === HL && HYPHEN.indexOf(current) !== -1) {
25166        return BREAK_NOT_ALLOWED;
25167    }
25168
25169    // LB21b Don’t break between Solidus and Hebrew letters.
25170    if (current === SY && next === HL) {
25171        return BREAK_NOT_ALLOWED;
25172    }
25173
25174    // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
25175    if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
25176        return BREAK_NOT_ALLOWED;
25177    }
25178
25179    // LB23 Do not break between digits and letters.
25180    if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
25181        return BREAK_NOT_ALLOWED;
25182    }
25183
25184    // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
25185    if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
25186        return BREAK_NOT_ALLOWED;
25187    }
25188
25189    // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
25190    if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
25191        return BREAK_NOT_ALLOWED;
25192    }
25193
25194    // LB25 Do not break between the following pairs of classes relevant to numbers:
25195    if (
25196    // (PR | PO) × ( OP | HY )? NU
25197    [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
25198    // ( OP | HY ) × NU
25199    [OP, HY].indexOf(current) !== -1 && next === NU ||
25200    // NU ×	(NU | SY | IS)
25201    current === NU && [NU, SY, IS].indexOf(next) !== -1) {
25202        return BREAK_NOT_ALLOWED;
25203    }
25204
25205    // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
25206    if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
25207        var prevIndex = currentIndex;
25208        while (prevIndex >= 0) {
25209            var type = classTypes[prevIndex];
25210            if (type === NU) {
25211                return BREAK_NOT_ALLOWED;
25212            } else if ([SY, IS].indexOf(type) !== -1) {
25213                prevIndex--;
25214            } else {
25215                break;
25216            }
25217        }
25218    }
25219
25220    // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
25221    if ([PR, PO].indexOf(next) !== -1) {
25222        var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
25223        while (_prevIndex >= 0) {
25224            var _type = classTypes[_prevIndex];
25225            if (_type === NU) {
25226                return BREAK_NOT_ALLOWED;
25227            } else if ([SY, IS].indexOf(_type) !== -1) {
25228                _prevIndex--;
25229            } else {
25230                break;
25231            }
25232        }
25233    }
25234
25235    // LB26 Do not break a Korean syllable.
25236    if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) {
25237        return BREAK_NOT_ALLOWED;
25238    }
25239
25240    // LB27 Treat a Korean Syllable Block the same as ID.
25241    if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
25242        return BREAK_NOT_ALLOWED;
25243    }
25244
25245    // LB28 Do not break between alphabetics (“at”).
25246    if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
25247        return BREAK_NOT_ALLOWED;
25248    }
25249
25250    // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
25251    if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
25252        return BREAK_NOT_ALLOWED;
25253    }
25254
25255    // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
25256    if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
25257        return BREAK_NOT_ALLOWED;
25258    }
25259
25260    // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
25261    // indicators preceding the position of the break.
25262    if (current === RI && next === RI) {
25263        var i = indicies[currentIndex];
25264        var count = 1;
25265        while (i > 0) {
25266            i--;
25267            if (classTypes[i] === RI) {
25268                count++;
25269            } else {
25270                break;
25271            }
25272        }
25273        if (count % 2 !== 0) {
25274            return BREAK_NOT_ALLOWED;
25275        }
25276    }
25277
25278    // LB30b Do not break between an emoji base and an emoji modifier.
25279    if (current === EB && next === EM) {
25280        return BREAK_NOT_ALLOWED;
25281    }
25282
25283    return BREAK_ALLOWED;
25284};
25285
25286var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
25287    // LB2 Never break at the start of text.
25288    if (index === 0) {
25289        return BREAK_NOT_ALLOWED;
25290    }
25291
25292    // LB3 Always break at the end of text.
25293    if (index >= codePoints.length) {
25294        return BREAK_MANDATORY;
25295    }
25296
25297    var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
25298        _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
25299        indicies = _codePointsToCharacte2[0],
25300        classTypes = _codePointsToCharacte2[1];
25301
25302    return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
25303};
25304
25305var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
25306    if (!options) {
25307        options = { lineBreak: 'normal', wordBreak: 'normal' };
25308    }
25309
25310    var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
25311        _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
25312        indicies = _codePointsToCharacte4[0],
25313        classTypes = _codePointsToCharacte4[1],
25314        isLetterNumber = _codePointsToCharacte4[2];
25315
25316    if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
25317        classTypes = classTypes.map(function (type) {
25318            return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
25319        });
25320    }
25321
25322    var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
25323        return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
25324    }) : null;
25325
25326    return [indicies, classTypes, forbiddenBreakpoints];
25327};
25328
25329var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
25330    var codePoints = (0, Util$2.toCodePoints)(str);
25331    var output = BREAK_NOT_ALLOWED;
25332
25333    var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
25334        _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
25335        indicies = _cssFormattedClasses2[0],
25336        classTypes = _cssFormattedClasses2[1],
25337        forbiddenBreakpoints = _cssFormattedClasses2[2];
25338
25339    codePoints.forEach(function (codePoint, i) {
25340        output += (0, Util$2.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
25341    });
25342
25343    return output;
25344};
25345
25346var Break = function () {
25347    function Break(codePoints, lineBreak, start, end) {
25348        _classCallCheck(this, Break);
25349
25350        this._codePoints = codePoints;
25351        this.required = lineBreak === BREAK_MANDATORY;
25352        this.start = start;
25353        this.end = end;
25354    }
25355
25356    _createClass(Break, [{
25357        key: 'slice',
25358        value: function slice() {
25359            return Util$2.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
25360        }
25361    }]);
25362
25363    return Break;
25364}();
25365
25366var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
25367    var codePoints = (0, Util$2.toCodePoints)(str);
25368
25369    var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
25370        _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
25371        indicies = _cssFormattedClasses4[0],
25372        classTypes = _cssFormattedClasses4[1],
25373        forbiddenBreakpoints = _cssFormattedClasses4[2];
25374
25375    var length = codePoints.length;
25376    var lastEnd = 0;
25377    var nextIndex = 0;
25378
25379    return {
25380        next: function next() {
25381            if (nextIndex >= length) {
25382                return { done: true };
25383            }
25384            var lineBreak = BREAK_NOT_ALLOWED;
25385            while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
25386
25387            if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
25388                var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
25389                lastEnd = nextIndex;
25390                return { value: value, done: false };
25391            }
25392
25393            return { done: true };
25394        }
25395    };
25396};
25397});
25398
25399unwrapExports(LineBreak);
25400var LineBreak_1 = LineBreak.LineBreaker;
25401var LineBreak_2 = LineBreak.inlineBreakOpportunities;
25402var LineBreak_3 = LineBreak.lineBreakAtIndex;
25403var LineBreak_4 = LineBreak.codePointsToCharacterClasses;
25404var LineBreak_5 = LineBreak.UnicodeTrie;
25405var LineBreak_6 = LineBreak.BREAK_ALLOWED;
25406var LineBreak_7 = LineBreak.BREAK_NOT_ALLOWED;
25407var LineBreak_8 = LineBreak.BREAK_MANDATORY;
25408var LineBreak_9 = LineBreak.classes;
25409var LineBreak_10 = LineBreak.LETTER_NUMBER_MODIFIER;
25410
25411var dist = createCommonjsModule(function (module, exports) {
25412Object.defineProperty(exports, "__esModule", {
25413  value: true
25414});
25415
25416
25417
25418Object.defineProperty(exports, 'toCodePoints', {
25419  enumerable: true,
25420  get: function get() {
25421    return Util$2.toCodePoints;
25422  }
25423});
25424Object.defineProperty(exports, 'fromCodePoint', {
25425  enumerable: true,
25426  get: function get() {
25427    return Util$2.fromCodePoint;
25428  }
25429});
25430
25431
25432
25433Object.defineProperty(exports, 'LineBreaker', {
25434  enumerable: true,
25435  get: function get() {
25436    return LineBreak.LineBreaker;
25437  }
25438});
25439});
25440
25441unwrapExports(dist);
25442
25443var Unicode = createCommonjsModule(function (module, exports) {
25444Object.defineProperty(exports, "__esModule", {
25445    value: true
25446});
25447exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
25448
25449
25450
25451Object.defineProperty(exports, 'toCodePoints', {
25452    enumerable: true,
25453    get: function get() {
25454        return dist.toCodePoints;
25455    }
25456});
25457Object.defineProperty(exports, 'fromCodePoint', {
25458    enumerable: true,
25459    get: function get() {
25460        return dist.fromCodePoint;
25461    }
25462});
25463
25464
25465
25466var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
25467
25468
25469
25470function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25471
25472var breakWords = exports.breakWords = function breakWords(str, parent) {
25473    var breaker = (0, dist.LineBreaker)(str, {
25474        lineBreak: parent.style.lineBreak,
25475        wordBreak: parent.style.overflowWrap === overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
25476    });
25477
25478    var words = [];
25479    var bk = void 0;
25480
25481    while (!(bk = breaker.next()).done) {
25482        words.push(bk.value.slice());
25483    }
25484
25485    return words;
25486};
25487});
25488
25489unwrapExports(Unicode);
25490var Unicode_1 = Unicode.breakWords;
25491var Unicode_2 = Unicode.fromCodePoint;
25492var Unicode_3 = Unicode.toCodePoints;
25493
25494var TextBounds_1 = createCommonjsModule(function (module, exports) {
25495Object.defineProperty(exports, "__esModule", {
25496    value: true
25497});
25498exports.parseTextBounds = exports.TextBounds = undefined;
25499
25500
25501
25502
25503
25504
25505
25506var _Feature2 = _interopRequireDefault(Feature);
25507
25508
25509
25510function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25511
25512function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25513
25514var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
25515    _classCallCheck(this, TextBounds);
25516
25517    this.text = text;
25518    this.bounds = bounds;
25519};
25520
25521var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
25522    var letterRendering = parent.style.letterSpacing !== 0;
25523    var textList = letterRendering ? (0, Unicode.toCodePoints)(value).map(function (i) {
25524        return (0, Unicode.fromCodePoint)(i);
25525    }) : (0, Unicode.breakWords)(value, parent);
25526    var length = textList.length;
25527    var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
25528    var scrollX = defaultView ? defaultView.pageXOffset : 0;
25529    var scrollY = defaultView ? defaultView.pageYOffset : 0;
25530    var textBounds = [];
25531    var offset = 0;
25532    for (var i = 0; i < length; i++) {
25533        var text = textList[i];
25534        if (parent.style.textDecoration !== textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
25535            if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
25536                textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
25537            } else {
25538                var replacementNode = node.splitText(text.length);
25539                textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
25540                node = replacementNode;
25541            }
25542        } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
25543            node = node.splitText(text.length);
25544        }
25545        offset += text.length;
25546    }
25547    return textBounds;
25548};
25549
25550var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
25551    var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
25552    wrapper.appendChild(node.cloneNode(true));
25553    var parentNode = node.parentNode;
25554    if (parentNode) {
25555        parentNode.replaceChild(wrapper, node);
25556        var bounds = (0, Bounds_1.parseBounds)(wrapper, scrollX, scrollY);
25557        if (wrapper.firstChild) {
25558            parentNode.replaceChild(wrapper.firstChild, wrapper);
25559        }
25560        return bounds;
25561    }
25562    return new Bounds_1.Bounds(0, 0, 0, 0);
25563};
25564
25565var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
25566    var range = node.ownerDocument.createRange();
25567    range.setStart(node, offset);
25568    range.setEnd(node, offset + length);
25569    return Bounds_1.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
25570};
25571});
25572
25573unwrapExports(TextBounds_1);
25574var TextBounds_2 = TextBounds_1.parseTextBounds;
25575var TextBounds_3 = TextBounds_1.TextBounds;
25576
25577var TextContainer_1 = createCommonjsModule(function (module, exports
25577) {
25578Object.defineProperty(exports, "__esModule", {
25579    value: true
25580});
25581
25582var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
25583
25584
25585
25586
25587
25588function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25589
25590var TextContainer = function () {
25591    function TextContainer(text, parent, bounds) {
25592        _classCallCheck(this, TextContainer);
25593
25594        this.text = text;
25595        this.parent = parent;
25596        this.bounds = bounds;
25597    }
25598
25599    _createClass(TextContainer, null, [{
25600        key: 'fromTextNode',
25601        value: function fromTextNode(node, parent) {
25602            var text = transform(node.data, parent.style.textTransform);
25603            return new TextContainer(text, parent, (0, TextBounds_1.parseTextBounds)(text, parent, node));
25604        }
25605    }]);
25606
25607    return TextContainer;
25608}();
25609
25610exports.default = TextContainer;
25611
25612
25613var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
25614
25615var transform = function transform(text, _transform) {
25616    switch (_transform) {
25617        case textTransform.TEXT_TRANSFORM.LOWERCASE:
25618            return text.toLowerCase();
25619        case textTransform.TEXT_TRANSFORM.CAPITALIZE:
25620            return text.replace(CAPITALIZE, capitalize);
25621        case textTransform.TEXT_TRANSFORM.UPPERCASE:
25622            return text.toUpperCase();
25623        default:
25624            return text;
25625    }
25626};
25627
25628function capitalize(m, p1, p2) {
25629    if (m.length > 0) {
25630        return p1 + p2.toUpperCase();
25631    }
25632
25633    return m;
25634}
25635});
25636
25637unwrapExports(TextContainer_1);
25638
25639var Circle_1 = createCommonjsModule(function (module, exports) {
25640Object.defineProperty(exports, "__esModule", {
25641    value: true
25642});
25643
25644
25645
25646function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25647
25648var Circle = function Circle(x, y, radius) {
25649    _classCallCheck(this, Circle);
25650
25651    this.type = Path.PATH.CIRCLE;
25652    this.x = x;
25653    this.y = y;
25654    this.radius = radius;
25655    
25656};
25657
25658exports.default = Circle;
25659});
25660
25661unwrapExports(Circle_1);
25662
25663var Input = createCommonjsModule(function (module, exports) {
25664Object.defineProperty(exports, "__esModule", {
25665    value: true
25666});
25667exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exp
25667orts.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
25668
25669
25670
25671var _TextContainer2 = _interopRequireDefault(TextContainer_1);
25672
25673
25674
25675
25676
25677
25678
25679var _Circle2 = _interopRequireDefault(Circle_1);
25680
25681
25682
25683var _Vector2 = _interopRequireDefault(Vector_1);
25684
25685
25686
25687var _Color2 = _interopRequireDefault(Color_1);
25688
25689
25690
25691var _Length2 = _interopRequireDefault(Length_1);
25692
25693
25694
25695
25696
25697
25698
25699function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25700
25701var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
25702var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
25703var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
25704var INPUT_BORDER = {
25705    borderWidth: 1,
25706    borderColor: INPUT_BORDER_COLOR,
25707    borderStyle: border.BORDER_STYLE.SOLID
25708};
25709var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
25710var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
25711    backgroundColor: INPUT_BACKGROUND_COLOR,
25712    backgroundImage: [],
25713    backgroundClip: background.BACKGROUND_CLIP.PADDING_BOX,
25714    backgroundOrigin: background.BACKGROUND_ORIGIN.PADDING_BOX
25715};
25716
25717var RADIO_BORDER_RADIUS = new _Length2.default('50%');
25718var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
25719var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
25720
25721var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
25722var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
25723var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
25724
25725var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
25726    return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
25727};
25728
25729var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
25730    if (node.type === 'radio' || node.type === 'checkbox') {
25731        if (node.checked) {
25732            var size = Math.min(container.bounds.width, container.bounds.height);
25733            container.childNodes.push(node.type === 'checkbox' ? [new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79), new _Vector2.default(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549), new _Vector2.default(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071), new _Vector2.default(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649), new _Vector2.default(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23), new _Vector2.default(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085), new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)] : new _Circle2.default(container.bounds.left + size / 4, container.bounds.top + size / 4, size / 4));
25734        }
25735    } else {
25736        inlineFormElement(getInputValue(node), node, container, false);
25737    }
25738};
25739
25740var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
25741    inlineFormElement(node.value, node, container, true);
25742};
25743
25744var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
25745    var option = node.options[node.selectedIndex || 0];
25746    inlineFormElement(option ? option.text || '' : '', node, container, false);
25747};
25748
25749var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
25750    if (bounds.width > bounds.height) {
25751        bounds.left += (bounds.width - bounds.height) / 2;
25752        bounds.width = bounds.height;
25753    } else if (bounds.width < bounds.height) {
25754        bounds.top += (bounds.height - bounds.width) / 2;
25755        bounds.height = bounds.width;
25756    }
25757    return bounds;
25758};
25759
25760var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
25761    var body = node.ownerDocument.body;
25762    if (value.length > 0 && body) {
25763        var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
25764        (0, Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
25765        wrapper.style.position = 'absolute';
25766        wrapper.style.left = container.bounds.left + 'px';
25767        wrapper.style.top = container.bounds.top + 'px';
25768        if (!allowLinebreak) {
25769            wrapper.style.whiteSpace = 'nowrap';
25770        }
25771        var text = node.ownerDocument.createTextNode(value);
25772        wrapper.appendChild(text);
25773        body.appendChild(wrapper);
25774        container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
25775        body.removeChild(wrapper);
25776    }
25777};
25778
25779var getInputValue = function getInputValue(node) {
25780    var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
25781
25782    return value.length === 0 ? node.placeholder || '' : value;
25783};
25784});
25785
25786unwrapExports(Input);
25787var Input_1 = Input.reformatInputBounds;
25788var Input_2 = Input.inlineSelectElement;
25789var Input_3 = Input.inlineTextAreaElement;
25790var Input_4 = Input.inlineInputElement;
25791var Input_5 = Input.getInputBorderRadius;
25792var Input_6 = Input.INPUT_BACKGROUND;
25793var Input_7 = Input.INPUT_BORDERS;
25794var Input_8 = Input.INPUT_COLOR;
25795
25796var ListItem = createCommonjsModule(function (module, exports) {
25797Object.defineProperty(exports, "__esModule", {
25798    value: true
25799});
25800exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
25801
25802
25803
25804
25805
25806var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
25807
25808
25809
25810var _TextContainer2 = _interopRequireDefault(TextContainer_1);
25811
25812
25813
25814
25815
25816function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25817
25818// Margin between the enumeration and the list item content
25819var MARGIN_RIGHT = 7;
25820
25821var ancestorTypes = ['OL', 'UL', 'MENU'];
25822
25823var getListOwner = exports.getListOwner = function getListOwner(container) {
25824    var parent = container.parent;
25825    if (!parent) {
25826        return null;
25827    }
25828
25829    do {
25830        var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
25831        if (isAncestor) {
25832            return parent;
25833        }
25834        parent = parent.parent;
25835    } while (parent);
25836
25837    return container.parent;
25838};
25839
25840var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
25841    var listStyle$$1 = container.style.listStyle;
25842
25843    if (!listStyle$$1) {
25844        return;
25845    }
25846
25847    var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
25848    var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
25849    (0, Util.copyCSSStyles)(style, wrapper);
25850
25851    wrapper.style.position = 'absolute';
25852    wrapper.style.bottom = 'auto';
25853    wrapper.style.display = 'block';
25854    wrapper.style.letterSpacing = 'normal';
25855
25856    switch (listStyle$$1.listStylePosition) {
25857        case listStyle.LIST_STYLE_POSITION.OUTSIDE:
25858            wrapper.style.left = 'auto';
25859            wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
25860            wrapper.style.textAlign = 'right';
25861            break;
25862        case listStyle.LIST_STYLE_POSITION.INSIDE:
25863            wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
25864            wrapper.style.right = 'auto';
25865            wrapper.style.textAlign = 'left';
25866            break;
25867    }
25868
25869    var text = void 0;
25870    var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
25871    var styleImage = listStyle$$1.listStyleImage;
25872    if (styleImage) {
25873        if (styleImage.method === 'url') {
25874            var image = node.ownerDocument.createElement('img');
25875            image.src = styleImage.args[0];
25876            wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
25877            wrapper.style.width = 'auto';
25878            wrapper.style.height = 'auto';
25879            wrapper.appendChild(image);
25880        } else {
25881            var size = parseFloat(container.style.font.fontSize) * 0.5;
25882            wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
25883            wrapper.style.width = size + 'px';
25884            wrapper.style.height = size + 'px';
25885            wrapper.style.backgroundImage = style.listStyleImage;
25886        }
25887    } else if (typeof container.listIndex === 'number') {
25888        text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle$$1.listStyleType, true));
25889        wrapper.appendChild(text);
25890        wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
25891    }
25892
25893    // $FlowFixMe
25894    var body = node.ownerDocument.body;
25895    body.appendChild(wrapper);
25896
25897    if (text) {
25898        container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
25899        body.removeChild(wrapper);
25900    } else {
25901        // $FlowFixMe
25902        container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
25903    }
25904};
25905
25906var ROMAN_UPPER = {
25907    integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
25908    values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
25909};
25910
25911var ARMENIAN = {
25912    integers: [9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
25913    values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
25914};
25915
25916var HEBREW = {
25917    integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
25918    values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
25919};
25920
25921var GEORGIAN = {
25922    integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
25923    values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
25924};
25925
25926var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
25927    if (value < min || value > max) {
25928        return createCounterText(value, fallback, suffix.length > 0);
25929    }
25930
25931    return symbols.integers.reduce(function (string, integer, index) {
25932        while (value >= integer) {
25933            value -= integer;
25934            string += symbols.values[index];
25935        }
25936        return string;
25937    }, '') + suffix;
25938};
25939
25940var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
25941    var string = '';
25942
25943    do {
25944        if (!isNumeric) {
25945            value--;
25946        }
25947        string = resolver(value) + string;
25948        value /= codePointRangeLength;
25949    } while (value * codePointRangeLength >= codePointRangeLength);
25950
25951    return string;
25952};
25953
25954var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
25955    var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
25956
25957    return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
25958        return (0, Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
25959    }) + suffix);
25960};
25961
25962var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
25963    var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
25964
25965    var codePointRangeLength = symbols.length;
25966    return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
25967        return symbols[Math.floor(codePoint % codePointRangeLength)];
25968    }) + suffix;
25969};
25970
25971var CJK_ZEROS = 1 << 0;
25972var CJK_TEN_COEFFICIENTS = 1 << 1;
25973var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
25974var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
25975
25976var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
25977    if (value < -9999 || value > 9999) {
25978        return createCounterText(value, listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
25979    }
25980    var tmp = Math.abs(value);
25981    var string = suffix;
25982
25983    if (tmp === 0) {
25984        return numbers[0] + string;
25985    }
25986
25987    for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
25988        var coefficient = tmp % 10;
25989
25990        if (coefficient === 0 && (0, Util.contains)(flags, CJK_ZEROS) && string !== '') {
25991            string = numbers[coefficient] + string;
25992        } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && (0, Util.contains)(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && (0, Util.contains)(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && (0, Util.contains)(flags, CJK_HUNDRED_COEFFICIENTS)) {
25993            string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
25994        } else if (coefficient === 1 && digit > 0) {
25995            string = multipliers[digit - 1] + string;
25996        }
25997        tmp = Math.floor(tmp / 10);
25998    }
25999
26000    return (value < 0 ? negativeSign : '') + string;
26001};
26002
26003var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
26004var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
26005var JAPANESE_NEGATIVE = 'マイナス';
26006var KOREAN_NEGATIVE = '마이너스 ';
26007
26008var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
26009    var defaultSuffix = appendSuffix ? '. ' : '';
26010    var cjkSuffix = appendSuffix ? '、' : '';
26011    var koreanSuffix = appendSuffix ? ', ' : '';
26012    switch (type) {
26013        case listStyle.LIST_STYLE_TYPE.DISC:
26014            return '•';
26015        case listStyle.LIST_STYLE_TYPE.CIRCLE:
26016            return '◦';
26017        case listStyle.LIST_STYLE_TYPE.SQUARE:
26018            return '◾';
26019        case listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
26020            var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
26021            return string.length < 4 ? '0' + string : string;
26022        case listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
26023            return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
26024        case listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
26025            return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
26026        case listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
26027            return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
26028        case listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
26029            return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
26030        case listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
26031            return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
26032        case listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
26033            return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
26034        case listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
26035            return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
26036        case listStyle.LIST_STYLE_TYPE.ARMENIAN:
26037        case listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
26038            return createAdditiveCounter(value, 1, 9999, ARMENIAN, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
26039        case listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
26040            return createAdditiveCounter(value, 1, 9999, ARMENIAN, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
26041        case listStyle.LIST_STYLE_TYPE.BENGALI:
26042            return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
26043        case listStyle.LIST_STYLE_TYPE.CAMBODIAN:
26044        case listStyle.LIST_STYLE_TYPE.KHMER:
26045            return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
26046        case listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
26047            return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
26048        case listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
26049            return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
26050        case listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
26051        case listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
26052            return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
26053        case listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
26054            return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
26055        case listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
26056            return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
26057        case listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
26058            return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
26059        case listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL:
26060            return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
26061        case listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
26062            return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
26063        case listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
26064            return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
26065        case listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
26066            return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
26067        case listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
26068            return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
26069        case listStyle.LIST_STYLE_TYPE.DEVANAGARI:
26070            return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
26071        case listStyle.LIST_STYLE_TYPE.GEORGIAN:
26072            return createAdditiveCounter(value, 1, 19999, GEORGIAN, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
26073        case listStyle.LIST_STYLE_TYPE.GUJARATI:
26074            return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
26075        case listStyle.LIST_STYLE_TYPE.GURMUKHI:
26076            return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
26077        case listStyle.LIST_STYLE_TYPE.HEBREW:
26078            return createAdditiveCounter(value, 1, 10999, HEBREW, listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
26079        case listStyle.LIST_STYLE_TYPE.HIRAGANA:
26080            return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
26081        case listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
26082            return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
26083        case listStyle.LIST_STYLE_TYPE.KANNADA:
26084            return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
26085        case listStyle.LIST_STYLE_TYPE.KATAKANA:
26086            return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
26087        case listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
26088            return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
26089        case listStyle.LIST_STYLE_TYPE.LAO:
26090            return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
26091        case listStyle.LIST_STYLE_TYPE.MONGOLIAN:
26092            return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
26093        case listStyle.LIST_STYLE_TYPE.MYANMAR:
26094            return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
26095        case listStyle.LIST_STYLE_TYPE.ORIYA:
26096            return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
26097        case listStyle.LIST_STYLE_TYPE.PERSIAN:
26098            return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
26099        case listStyle.LIST_STYLE_TYPE.TAMIL:
26100            return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
26101        case listStyle.LIST_STYLE_TYPE.TELUGU:
26102            return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
26103        case listStyle.LIST_STYLE_TYPE.THAI:
26104            return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
26105        case listStyle.LIST_STYLE_TYPE.TIBETAN:
26106            return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
26107        case listStyle.LIST_STYLE_TYPE.DECIMAL:
26108        default:
26109            return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
26110    }
26111};
26112});
26113
26114unwrapExports(ListItem);
26115var ListItem_1 = ListItem.createCounterText;
26116var ListItem_2 = ListItem.inlineListItemElement;
26117var ListItem_3 = ListItem.getListOwner;
26118
26119var NodeContainer_1 = createCommonjsModule(function (module, exports) {
26120Object.defineProperty(exports, "__esModule", {
26121    value: true
26122});
26123
26124var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
26125
26126
26127
26128var _Color2 = _interopRequireDefault(Color_1);
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26181
26182function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26183
26184var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
26185
26186var NodeContainer = function () {
26187    function NodeContainer(node, parent, resourceLoader, index) {
26188        var _this = this;
26189
26190        _classCallCheck(this, NodeContainer);
26191
26192        this.parent = parent;
26193        this.tagName = node.tagName;
26194        this.index = index;
26195        this.childNodes = [];
26196        this.listItems = [];
26197        if (typeof node.start === 'number') {
26198            this.listStart = node.start;
26199        }
26200        var defaultView = node.ownerDocument.defaultView;
26201        var scrollX = defaultView.pageXOffset;
26202        var scrollY = defaultView.pageYOffset;
26203        var style = defaultView.getComputedStyle(node, null);
26204        var display$$1 = (0, display.parseDisplay)(style.display);
26205
26206        var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
26207
26208        var position$$1 = (0, position.parsePosition)(style.position);
26209
26210        this.style = {
26211            background: IS_INPUT ? Input.INPUT_BACKGROUND : (0, background.parseBackgroun
26211d)(style, resourceLoader),
26212            border: IS_INPUT ? Input.INPUT_BORDERS : (0, border.parseBorder)(style),
26213            borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, Input.getInputBorderRadius)(node) : (0, borderRadius.parseBorderRadius)(style),
26214            color: IS_INPUT ? Input.INPUT_COLOR : new _Color2.default(style.color),
26215            display: display$$1,
26216            float: (0, float_1.parseCSSFloat)(style.float),
26217            font: (0, font.parseFont)(style),
26218            letterSpacing: (0, letterSpacing.parseLetterSpacing)(style.letterSpacing),
26219            listStyle: display$$1 === display.DISPLAY.LIST_ITEM ? (0, listStyle.parseListStyle)(style) : null,
26220            lineBreak: (0, lineBreak.parseLineBreak)(style.lineBreak),
26221            margin: (0, margin.parseMargin)(style),
26222            opacity: parseFloat(style.opacity),
26223            overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, overflow.parseOverflow)(style.overflow) : overflow.OVERFLOW.HIDDEN,
26224            overflowWrap: (0, overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
26225            padding: (0, padding.parsePadding)(style),
26226            position: position$$1,
26227            textDecoration: (0, textDecoration.parseTextDecoration)(style),
26228            textShadow: (0, textShadow.parseTextShadow)(style.textShadow),
26229            textTransform: (0, textTransform.parseTextTransform)(style.textTransform),
26230            transform: (0, transform.parseTransform)(style),
26231            visibility: (0, visibility.parseVisibility)(style.visibility),
26232            wordBreak: (0, wordBreak.parseWordBreak)(style.wordBreak),
26233            zIndex: (0, zIndex.parseZIndex)(position$$1 !== position.POSITION.STATIC ? style.zIndex : 'auto')
26234        };
26235
26236        if (this.isTransformed()) {
26237            // getBoundingClientRect provides values post-transform, we want them without the transformation
26238            node.style.transform = 'matrix(1,0,0,1,0,0)';
26239        }
26240
26241        if (display$$1 === display.DISPLAY.LIST_ITEM) {
26242            var listOwner = (0, ListItem.getListOwner)(this);
26243            if (listOwner) {
26244                var listIndex = listOwner.listItems.length;
26245                listOwner.listItems.push(this);
26246                this.listIndex = node.hasAttribute('value') && typeof node.value === 'number' ? node.value : listIndex === 0 ? typeof listOwner.listStart === 'number' ? listOwner.listStart : 1 : listOwner.listItems[listIndex - 1].listIndex + 1;
26247            }
26248        }
26249
26250        // TODO move bound retrieval for all nodes to a later stage?
26251        if (node.tagName === 'IMG') {
26252            node.addEventListener('load', function () {
26253                _this.bounds = (0, Bounds_1.parseBounds)(node, scrollX, scrollY);
26254                _this.curvedBounds = (0, Bounds_1.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
26255            });
26256        }
26257        this.image = getImage(node, resourceLoader);
26258        this.bounds = IS_INPUT ? (0, Input.reformatInputBounds)((0, Bounds_1.parseBounds)(node, scrollX, scrollY)) : (0, Bounds_1.parseBounds)(node, scrollX, scrollY);
26259        this.curvedBounds = (0, Bounds_1.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
26260
26261        
26262    }
26263
26264    _createClass(NodeContainer, [{
26265        key: 'getClipPaths',
26266        value: function getClipPaths() {
26267            var parentClips = this.parent ? this.parent.getClipPaths() : [];
26268            var isClipped = this.style.overflow !== overflow.OVERFLOW.VISIBLE;
26269
26270            return isClipped ? parentClips.concat([(0, Bounds_1.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
26271        }
26272    }, {
26273        key: 'isInFlow',
26274        value: function isInFlow() {
26275            return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
26276        }
26277    }, {
26278        key: 'isVisible',
26279        value: function isVisible() {
26280            return !(0, Util.contains)(this.style.display, display.DISPLAY.NONE) && this.style.opacity >
26280 0 && this.style.visibility === visibility.VISIBILITY.VISIBLE;
26281        }
26282    }, {
26283        key: 'isAbsolutelyPositioned',
26284        value: function isAbsolutelyPositioned() {
26285            return this.style.position !== position.POSITION.STATIC && this.style.position !== position.POSITION.RELATIVE;
26286        }
26287    }, {
26288        key: 'isPositioned',
26289        value: function isPositioned() {
26290            return this.style.position !== position.POSITION.STATIC;
26291        }
26292    }, {
26293        key: 'isFloating',
26294        value: function isFloating() {
26295            return this.style.float !== float_1.FLOAT.NONE;
26296        }
26297    }, {
26298        key: 'isRootElement',
26299        value: function isRootElement() {
26300            return this.parent === null;
26301        }
26302    }, {
26303        key: 'isTransformed',
26304        value: function isTransformed() {
26305            return this.style.transform !== null;
26306        }
26307    }, {
26308        key: 'isPositionedWithZIndex',
26309        value: function isPositionedWithZIndex() {
26310            return this.isPositioned() && !this.style.zIndex.auto;
26311        }
26312    }, {
26313        key: 'isInlineLevel',
26314        value: function isInlineLevel() {
26315            return (0, Util.contains)(this.style.display, display.DISPLAY.INLINE) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_BLOCK) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_FLEX) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_GRID) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_LIST_ITEM) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_TABLE);
26316        }
26317    }, {
26318        key: 'isInlineBlockOrInlineTable',
26319        value: function isInlineBlockOrInlineTable() {
26320            return (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_BLOCK) || (0, Util.contains)(this.style.display, display.DISPLAY.INLINE_TABLE);
26321        }
26322    }]);
26323
26324    return NodeContainer;
26325}();
26326
26327exports.default = NodeContainer;
26328
26329
26330var getImage = function getImage(node, resourceLoader) {
26331    if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
26332        var s = new XMLSerializer();
26333        return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
26334    }
26335    switch (node.tagName) {
26336        case 'IMG':
26337            // $FlowFixMe
26338            var img = node;
26339            return resourceLoader.loadImage(img.currentSrc || img.src);
26340        case 'CANVAS':
26341            // $FlowFixMe
26342            var canvas = node;
26343            return resourceLoader.loadCanvas(canvas);
26344        case 'IFRAME':
26345            var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
26346            if (iframeKey) {
26347                return iframeKey;
26348            }
26349            break;
26350    }
26351
26352    return null;
26353};
26354});
26355
26356unwrapExports(NodeContainer_1);
26357
26358var StackingContext_1 = createCommonjsModule(function (module, exports) {
26359Object.defineProperty(exports, "__esModule", {
26360    value: true
26361});
26362
26363var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
26364
26365
26366
26367var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
26368
26369
26370
26371function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26372
26373function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26374
26375var StackingContext = function () {
26376    function StackingContext(container, parent, treatAsRealStackingContext) {
26377        _classCallCheck(this, StackingContext);
26378
26379        this.container = container;
26380        this.parent = parent;
26381        this.contexts = [];
26382        this.children = [];
26383        this.treatAsRealStackingContext = treatAsRealStackingContext;
26384    }
26385
26386    _createClass(StackingContext, [{
26387        key: 'getOpacity',
26388        value: function getOpacity() {
26389            return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
26390        }
26391    }, {
26392        key: 'getRealParentStackingContext',
26393        value: function getRealParentStackingContext() {
26394            return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
26395        }
26396    }]);
26397
26398    return StackingContext;
26399}();
26400
26401exports.default = StackingContext;
26402});
26403
26404unwrapExports(StackingContext_1);
26405
26406var NodeParser_1 = createCommonjsModule(function (module, exports) {
26407Object.defineProperty(exports, "__esModule", {
26408    value: true
26409});
26410exports.NodeParser = undefined;
26411
26412
26413
26414var _StackingContext2 = _interopRequireDefault(StackingContext_1);
26415
26416
26417
26418var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
26419
26420
26421
26422var _TextContainer2 = _interopRequireDefault(TextContainer_1);
26423
26424
26425
26426
26427
26428
26429
26430function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26431
26432var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
26433    var index = 0;
26434
26435    var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
26436    var stack = new _StackingContext2.default(container, null, true);
26437
26438    parseNodeTree(node, container, stack, resourceLoader, index);
26439
26440    return stack;
26441};
26442
26443var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
26444
26445var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
26446    for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
26447        nextNode = childNode.nextSibling;
26448        var defaultView = childNode.ownerDocument.defaultView;
26449        if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
26450            if (childNode.data.trim().length > 0) {
26451                parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
26452            }
26453        } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
26454            if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
26455                var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
26456                if (container.isVisible()) {
26457                    if (childNode.tagName === 'INPUT') {
26458                        // $FlowFixMe
26459                        (0, Input.inlineInputElement)(childNode, container);
26460                    } else if (childNode.tagName === 'TEXTAREA') {
26461                        // $FlowFixMe
26462                        (0, Input.inlineTextAreaElement)(childNode, container);
26463                    } else if (childNode.tagName === 'SELECT') {
26464                        // $FlowFixMe
26465                        (0, Input.inlineSelectElement)(childNode, container);
26466                    } else if (container.style.listStyle && container.style.listStyle.listStyleType !== listStyle.LIST_STYLE_TYPE.NONE) {
26467                        (0, ListItem.inlineListItemElement)(childNode, container, resourceLoader);
26468                    }
26469
26470                    var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
26471                    var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
26472                    if (treatAsRealStackingContext || createsStackingContext(container)) {
26473                        // for treatAsRealStackingContext:false, any positioned descendants and descendants
26474                        // which actually create a new stacking context should be considered part of the parent stacking context
26475                        var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
26476                        var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
26477                        parentStack.contexts.push(childStack);
26478                        if (SHOULD_TRAVERSE_CHILDREN) {
26479                            parseNodeTree(childNode, container, childStack, resourceLoader, index);
26480                        }
26481                    } else {
26482                        stack.children.push(container);
26483                        if (SHOULD_TRAVERSE_CHILDREN) {
26484                            parseNodeTree(childNode, container, stack, resourceLoader, index);
26485                        }
26486                    }
26487                }
26488            }
26489        } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
26490            var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
26491            var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
26492            if (_treatAsRealStackingContext || createsStackingContext(_container)) {
26493                // for treatAsRealStackingContext:false, any positioned descendants and desce
26493ndants
26494                // which actually create a new stacking context should be considered part of the parent stacking context
26495                var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
26496                var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
26497                _parentStack.contexts.push(_childStack);
26498            } else {
26499                stack.children.push(_container);
26500            }
26501        }
26502    }
26503};
26504
26505var createsRealStackingContext = function createsRealStackingContext(container, node) {
26506    return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
26507};
26508
26509var createsStackingContext = function createsStackingContext(container) {
26510    return container.isPositioned() || container.isFloating();
26511};
26512
26513var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
26514    return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
26515};
26516});
26517
26518unwrapExports(NodeParser_1);
26519var NodeParser_2 = NodeParser_1.NodeParser;
26520
26521var Font = createCommonjsModule(function (module, exports) {
26522Object.defineProperty(exports, "__esModule", {
26523    value: true
26524});
26525exports.FontMetrics = undefined;
26526
26527var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
26528
26529
26530
26531function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26532
26533var SAMPLE_TEXT = 'Hidden Text';
26534
26535var FontMetrics = exports.FontMetrics = function () {
26536    function FontMetrics(document) {
26537        _classCallCheck(this, FontMetrics);
26538
26539        this._data = {};
26540        this._document = document;
26541    }
26542
26543    _createClass(FontMetrics, [{
26544        key: '_parseMetrics',
26545        value: function _parseMetrics(font) {
26546            var container = this._document.createElement('div');
26547            var img = this._document.createElement('img');
26548            var span = this._document.createElement('span');
26549
26550            var body = this._document.body;
26551            if (!body) {
26552                throw new Error('');
26553            }
26554
26555            container.style.visibility = 'hidden';
26556            container.style.fontFamily = font.fontFamily;
26557            container.style.fontSize = font.fontSize;
26558            container.style.margin = '0';
26559            container.style.padding = '0';
26560
26561            body.appendChild(container);
26562
26563            img.src = Util.SMALL_IMAGE;
26564            img.width = 1;
26565            img.height = 1;
26566
26567            img.style.margin = '0';
26568            img.style.padding = '0';
26569            img.style.verticalAlign = 'baseline';
26570
26571            span.style.fontFamily = font.fontFamily;
26572            span.style.fontSize = font.fontSize;
26573            span.style.margin = '0';
26574            span.style.padding = '0';
26575
26576            span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
26577            container.appendChild(span);
26578            container.appendChild(img);
26579            var baseline = img.offsetTop - span.offsetTop + 2;
26580
26581            container.removeChild(span);
26582            container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
26583
26584            container.style.lineHeight = 'normal';
26585            img.style.verticalAlign = 'super';
26586
26587            var middle = img.offsetTop - container.offsetTop + 2;
26588
26589            body.removeChild(container);
26590
26591            return { baseline: baseline, middle: middle };
26592        }
26593    }, {
26594        key: 'getMetrics',
26595        value: function getMetrics(font) {
26596            var key = font.fontFamily + ' ' + font.fontSize;
26597            if (this._data[key] === undefined) {
26598                this._data[key] = this._parseMetrics(font);
26599            }
26600
26601            return this._data[key];
26602        }
26603    }]);
26604
26605    return FontMetrics;
26606}();
26607});
26608
26609unwrapExports(Font);
26610var Font_1 = Font.FontMetrics;
26611
26612var Angle = createCommonjsModule(function (module, exports) {
26613Object.defineProperty(exports, "__esModule", {
26614    value: true
26615});
26616var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;
26617
26618var parseAngle = exports.parseAngle = function parseAngle(angle) {
26619    var match = angle.match(ANGLE);
26620
26621    if (match) {
26622        var value = parseFloat(match[1]);
26623        switch (match[2].toLowerCase()) {
26624            case 'deg':
26625                return Math.PI * value / 180;
26626            case 'grad':
26627                return Math.PI / 200 * value;
26628            case 'rad':
26629                return value;
26630            case 'turn':
26631                return Math.PI * 2 * value;
26632        }
26633    }
26634
26635    return null;
26636};
26637});
26638
26639unwrapExports(Angle);
26640var Angle_1 = Angle.parseAngle;
26641
26642var Gradient = createCommonjsModule(function (module, exports) {
26643Object.defineProperty(exports, "__esModule", {
26644    value: true
26645});
26646exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined;
26647
26648var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
26649
26650
26651
26652var _NodeContainer2 = _interopRequireDefault(NodeContainer_1);
26653
26654
26655
26656
26657
26658var _Color2 = _interopRequireDefault(Color_1);
26659
26660
26661
26662var _Length2 = _interopRequireDefault(Length_1);
26663
26664
26665
26666function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26667
26668function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26669
26670var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i;
26671var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i;
26672var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i;
26673var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i;
26674var RADIAL_SHAPE_DEFINITION = /^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i;
26675
26676var GRADIENT_TYPE = exports.GRADIENT_TYPE = {
26677    LINEAR_GRADIENT: 0,
26678    RADIAL_GRADIENT: 1
26679};
26680
26681var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = {
26682    CIRCLE: 0,
26683    ELLIPSE: 1
26684};
26685
26686var LENGTH_FOR_POSITION = {
26687    left: new _Length2.default('0%'),
26688    top: new _Length2.default('0%'),
26689    center: new _Length2.default('50%'),
26690    right: new _Length2.default('100%'),
26691    bottom: new _Length2.default('100%')
26692};
26693
26694var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) {
26695    _classCallCheck(this, LinearGradient);
26696
26697    this.type = GRADIENT_TYPE.LINEAR_GRADIENT;
26698    this.colorStops = colorStops;
26699    this.direction = direction;
26700};
26701
26702var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) {
26703    _classCallCheck(this, RadialGradient);
26704
26705    this.type = GRADIENT_TYPE.RADIAL_GRADIENT;
26706    this.colorStops = colorStops;
26707    this.shape = shape;
26708    this.center = center;
26709    this.radius = radius;
26710};
26711
26712var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) {
26713    var args = _ref.args,
26714        method = _ref.method,
26715        prefix = _ref.prefix;
26716
26717    if (method === 'linear-gradient') {
26718        return parseLinearGradient(args, bounds, !!prefix);
26719    } else if (method === 'gradient' && args[0] === 'linear') {
26720        // TODO handle correct angle
26721        return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix);
26722    } else if (method === 'radial-gradient') {
26723        return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds);
26724    } else if (method === 'gradient' && args[0] === 'radial') {
26725        return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds);
26726    }
26727};
26728
26729var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) {
26730    var colorStops = [];
26731
26732    for (var i = firstColorStopIndex; i < args.length; i++) {
26733        var value = args[i];
26734        var HAS_LENGTH = ENDS_WITH_LENGTH.test(value);
26735        var lastSpaceIndex = value.lastIndexOf(' ');
26736        var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value);
26737        var _stop = HAS_LENGTH ? new _Length2.default(value.substring(lastSpaceIndex + 1)) : i === firstColorStopIndex ? new _Length2.default('0%') : i === args.length - 1 ? new _Length2.default('100%') : null;
26738        colorStops.push({ color: _color, stop: _stop });
26739    }
26740
26741    var absoluteValuedColorStops = colorStops.map(function (_ref2) {
26742        var color = _ref2.color,
26743            stop = _ref2.stop;
26744
26745        var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null;
26746
26747        return {
26748            color: color,
26749            // $FlowFixMe
26750            stop: absoluteStop
26751        };
26752    });
26753
26754    var previousColorStop = absoluteValuedColorStops[0].stop;
26755    for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) {
26756        if (previousColorStop !== null) {
26757            var _stop2 = absoluteValuedColorStops[_i].stop;
26758            if (_stop2 === null) {
26759                var n = _i;
26760                while (absoluteValuedColorStops[n].stop === null) {
26761                    n++;
26762                }
26763                var steps = n - _i + 1;
26764                var nextColorStep = absoluteValuedColorStops[n].stop;
26765                var stepSize = (nextColorStep - previousColorStop) / steps;
26766                for (; _i < n; _i++) {
26767                    previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize;
26768                }
26769            } else {
26770                previousColorStop = _stop2;
26771            }
26772        }
26773    }
26774
26775    return absoluteValuedColorStops;
26776};
26777
26778var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) {
26779    var angle = (0, Angle.parseAngle)(args[0]);
26780    var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]);
26781    var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]);
26782    var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection(
26783    // if there is a prefix, the 0° angle points due East (instead of North per W3C)
26784    hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds);
26785    var firstColorStopIndex = HAS_DIRECTION ? 1 : 0;
26786
26787    // TODO: Fix some inaccuracy with color stops with px values
26788    var lineLength = Math.min((0, Util.distance)(Math.abs(direction.x0) + Math.abs(direction.x1), Math.abs(direction.y0) + Math.abs(direction.y1)), bounds.width * 2, bounds.height * 2);
26789
26790    return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction);
26791};
26792
26793var parseRadialGradient = function parseRadialGradient(container, args, bounds) {
26794    var m = args[0].match(RADIAL_SHAPE_DEFINITION);
26795    var shape = m && (m[1] === 'circle' || // explicit shape specification
26796    m[3] !== undefined && m[5] === undefined) // only one radius coordinate
26797    ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE;
26798    var radius = {};
26799    var center = {};
26800
26801    if (m) {
26802        // Radius
26803        if (m[3] !== undefined) {
26804            radius.x = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width);
26805        }
26806
26807        if (m[5] !== undefined) {
26808            radius.y = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height);
26809        }
26810
26811        // Position
26812        if (m[7]) {
26813            center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()];
26814        } else if (m[8] !== undefined) {
26815            center.x = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[8], m[9]);
26816        }
26817
26818        if (m[10]) {
26819            center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()];
26820        } else if (m[11] !== undefined) {
26821            center.y = (0, Length_1.calculateLengthFromValueWithUnit)(container, m[11], m[12]);
26822        }
26823    }
26824
26825    var gradientCenter = {
26826        x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width),
26827        y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height)
26828    };
26829    var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds);
26830
26831    return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius);
26832};
26833
26834var calculateGradientDirection = function calculateGradientDirection(radian, bounds) {
26835    var width = bounds.width;
26836    var height = bounds.height;
26837    var HALF_WIDTH = width * 0.5;
26838    var HALF_HEIGHT = height * 0.5;
26839    var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
26840    var HALF_LINE_LENGTH = lineLength / 2;
26841
26842    var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH;
26843    var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH;
26844    var x1 = width - x0;
26845    var y1 = height - y0;
26846
26847    return { x0: x0, x1: x1, y0: y0, y1: y1 };
26848};
26849
26850var parseTopRight = function parseTopRight(bounds) {
26851    return Math.acos(bounds.width / 2 / ((0, Util.distance)(bounds.width, bounds.height) / 2));
26852};
26853
26854var parseSideOrCorner = function parseSideOrCorner(side, bounds) {
26855    switch (side) {
26856        case 'bottom':
26857        case 'to top':
26858            return calculateGradientDirection(0, bounds);
26859        case 'left':
26860        case 'to right':
26861            return calculateGradientDirection(Math.PI / 2, bounds);
26862        case 'right':
26863        case 'to left':
26864            return calculateGradientDirection(3 * Math.PI / 2, bounds);
26865        case 'top right':
26866        case 'right top':
26867        case 'to bottom left':
26868        case 'to left bottom':
26869            return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds);
26870        case 'top left':
26871        case 'left top':
26872        case 'to bottom right':
26873        case 'to right bottom':
26874            return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds);
26875        case 'bottom left':
26876        case 'left bottom':
26877        case 'to top right':
26878        case 'to right top':
26879            return calculateGradientDirection(parseTopRight(bounds), bounds);
26880        case 'bottom right':
26881        case 'right bottom':
26882        case 'to top left':
26883        case 'to left top':
26884            return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds);
26885        case 'top':
26886        case 'to bottom':
26887        default:
26888            return calculateGradientDirection(Math.PI, bounds);
26889    }
26890};
26891
26892var parsePercentageAngle = function parsePercentageAngle(angle, bounds) {
26893    var _angle$split$map = angle.split(' ').map(parseFloat),
26894        _angle$split$map2 = _slicedToArray(_angle$split$map, 2),
26895        left = _angle$split$map2[0],
26896        top = _angle$split$map2[1];
26897
26898    var ratio = left / 100 * bounds.width / (top / 100 * bounds.height);
26899
26900    return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds);
26901};
26902
26903var findCorner = function findCorner(bounds, x, y, closest) {
26904    var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }];
26905
26906    // $FlowFixMe
26907    return corners.reduce(function (stat, corner) {
26908        var d = (0, Util.distance)(x - corner.x, y - corner.y);
26909        if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
26910            return {
26911                optimumCorner: corner,
26912                optimumDistance: d
26913            };
26914        }
26915
26916        return stat;
26917    }, {
26918        optimumDistance: closest ? Infinity : -Infinity,
26919        optimumCorner: null
26920    }).optimumCorner;
26921};
26922
26923var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) {
26924    var x = center.x;
26925    var y = center.y;
26926    var rx = 0;
26927    var ry = 0;
26928
26929    switch (extent) {
26930        case 'closest-side':
26931            // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
26932            // If the shape is an ellipse, it exactly meets the closest side in each dimension.
26933            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
26934                rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
26935            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
26936                rx = Math.min(Math.abs(x), Math.abs(x - bounds.width));
26937                ry = Math.min(Math.abs(y), Math.abs(y - bounds.height));
26938            }
26939            break;
26940
26941        case 'closest-corner':
26942            // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
26943            // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
26944            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
26945                rx = ry = Math.min((0, Util.distance)(x, y), (0, Util.distance)(x, y - bounds.height), (0, Util.distance)(x - bounds.width, y), (0, Util.distance)(x - bounds.width, y - bounds.height));
26946            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
26947                // Compute the ratio ry/rx (which is to be the same as for "closest-side")
26948                var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width));
26949                var corner = findCorner(bounds, x, y, true);
26950                rx = (0, Util.distance)(corner.x - x, (corner.y - y) / c);
26951                ry = c * rx;
26952            }
26953            break;
26954
26955        case 'farthest-side':
26956            // Same as closest-side, except the ending shape is sized based on the farthest side(s)
26957            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
26958                rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
26959            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
26960                rx = Math.max(Math.abs(x), Math.abs(x - bounds.width));
26961                ry = Math.max(Math.abs(y), Math.abs(y - bounds.height));
26962            }
26963            break;
26964
26965        case 'farthest-corner':
26966            // Same as closest-corner, except the ending shape is sized based on the farthest corner.
26967            // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
26968            if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
26969                rx = ry = Math.max((0, Util.distance)(x, y), (0, Util.distance)(x, y - bounds.height), (0, Util.distance)(x - bounds.width, y), (0, Util.distance)(x - bounds.width, y - bounds.height));
26970            } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
26971                // Compute the ratio ry/rx (which is to be the same as for "farthest-side")
26972                var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width));
26973                var _corner = findCorner(bounds, x, y, false);
26974                rx = (0, Util.distance)(_corner.x - x, (_corner.y - y) / _c);
26975                ry = _c * rx;
26976            }
26977            break;
26978
26979        default:
26980            // pixel or percentage values
26981            rx = radius.x || 0;
26982            ry = radius.y !== undefined ? radius.y : rx;
26983            break;
26984    }
26985
26986    return {
26987        x: rx,
26988        y: ry
26989    };
26990};
26991
26992var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) {
26993    var shape = '';
26994    var radius = '';
26995    var extent = '';
26996    var position = '';
26997    var idx = 0;
26998
26999    var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i;
27000    var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i;
27001    var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i;
27002
27003    var matchStartPosition = args[idx].match(POSITION);
27004    if (matchStartPosition) {
27005        idx++;
27006    }
27007
27008    var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT);
27009    if (matchShapeExtent) {
27010        shape = matchShapeExtent[1] || '';
27011        extent = matchShapeExtent[2] || '';
27012        if (extent === 'contain') {
27013            extent = 'closest-side';
27014        } else if (extent === 'cover') {
27015            extent = 'farthest-corner';
27016        }
27017        idx++;
27018    }
27019
27020    var matchStartRadius = args[idx].match(RADIUS);
27021    if (matchStartRadius) {
27022        idx++;
27023    }
27024
27025    var matchEndPosition = args[idx].match(POSITION);
27026    if (matchEndPosition) {
27027        idx++;
27028    }
27029
27030    var matchEndRadius = args[idx].match(RADIUS);
27031    if (matchEndRadius) {
27032        idx++;
27033    }
27034
27035    var matchPosition = matchEndPosition || matchStartPosition;
27036    if (matchPosition && matchPosition[1]) {
27037        position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : '');
27038        if (matchPosition[2]) {
27039            position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : '');
27040        }
27041    }
27042
27043    var matchRadius = matchEndRadius || matchStartRadius;
27044    if (matchRadius) {
27045        radius = matchRadius[0];
27046        if (!matchRadius[1]) {
27047            radius += 'px';
27048        }
27049    }
27050
27051    if (position && !shape && !radius && !extent) {
27052        radius = position;
27053        position = '';
27054    }
27055
27056    if (position) {
27057        position = 'at ' + position;
27058    }
27059
27060    return [[shape, extent, radius, position].filter(function (s) {
27061        return !!s;
27062    }).join(' ')].concat(args.slice(idx));
27063};
27064
27065var transformObsoleteColorStops = function transformObsoleteColorStops(args) {
27066    return args.map(function (color) {
27067        return color.match(FROM_TO_COLORSTOP);
27068    })
27069    // $FlowFixMe
27070    .map(function (v, index) {
27071        if (!v) {
27072            return args[index];
27073        }
27074
27075        switch (v[1]) {
27076            case 'from':
27077                return v[4] + ' 0%';
27078            case 'to':
27079                return v[4] + ' 100%';
27080            case 'color-stop':
27081                if (v[3] === '%') {
27082                    return v[4] + ' ' + v[2];
27083                }
27084                return v[4] + ' ' + parseFloat(v[2]) * 100 + '%';
27085        }
27086    });
27087};
27088});
27089
27090unwrapExports(Gradient);
27091var Gradient_1 = Gradient.transformWebkitRadialGradientArgs;
27092var Gradient_2 = Gradient.parseGradient;
27093var Gradient_3 = Gradient.RadialGradient;
27094var Gradient_4 = Gradient.LinearGradient;
27095var Gradient_5 = Gradient.RADIAL_GRADIENT_SHAPE;
27096var Gradient_6 = Gradient.GRADIENT_TYPE;
27097
27098var Renderer_1 = createCommonjsModule(function (module, exports) {
27099Object.defineProperty(exports, "__esModule", {
27100    value: true
27101});
27102
27103var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
27104
27105var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115var _TextContainer2 = _interopRequireDefault(TextContainer_1);
27116
27117
27118
27119
27120
27121function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27122
27123function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27124
27125var Renderer = function () {
27126    function Renderer(target, options) {
27127        _classCallCheck(this, Renderer);
27128
27129        this.target = target;
27130        this.options = options;
27131        target.render(options);
27132    }
27133
27134    _createClass(Renderer, [{
27135        key: 'renderNode',
27136        value: function renderNode(container) {
27137            if (container.isVisible()) {
27138                this.renderNodeBackgroundAndBorders(container);
27139                this.renderNodeContent(container);
27140            }
27141        }
27142    }, {
27143        key: 'renderNodeContent',
27144        value: function renderNodeContent(container) {
27145            var _this = this;
27146
27147            var callback = function callback() {
27148                if (container.childNodes.length) {
27149                    container.childNodes.forEach(function (child) {
27150                        if (child instanceof _TextContainer2.default) {
27151                            var style = child.parent.style;
27152                            _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow);
27153                        } else {
27154                            _this.target.drawShape(child, container.style.color);
27155                        }
27156                    });
27157                }
27158
27159                if (container.image) {
27160                    var _image = _this.options.imageStore.get(container.image);
27161                    if (_image) {
27162                        var contentBox = (0, Bounds_1.calculateContentBox)(container.bounds, container.style.padding, container.style.border);
27163                        var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width;
27164                        var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height;
27165                        if (_width > 0 && _height > 0) {
27166                            _this.target.clip([(0, Bounds_1.calculatePaddingBoxPath)(container.curvedBounds)], function () {
27167                                _this.target.drawImage(_image, new Bounds_1.Bounds(0, 0, _width, _height), contentBox);
27168                            });
27169                        }
27170                    }
27171                }
27172            };
27173            var paths = container.getClipPaths();
27174            if (paths.length) {
27175                this.target.clip(paths, callback);
27176            } else {
27177                callback();
27178            }
27179        }
27180    }, {
27181        key: 'renderNodeBackgroundAndBorders',
27182        value: function renderNodeBackgroundAndBorders(container) {
27183            var _this2 = this;
27184
27185            var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length;
27186
27187            var hasRenderableBorders = container.style.border.some(function (border$$2) {
27188                return border$$2.borderStyle !== border.BORDER_STYLE.NONE && !border$$2.borderColor.isTransparent();
27189            });
27190
27191            var callback = function callback() {
27192                var backgroundPaintingArea = (0, background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip);
27193
27194                if (HAS_BACKGROUND) {
27195                    _this2.target.clip([backgroundPaintingArea], function () {
27196                        if (!container.style.background.backgroundColor.isTransparent()) {
27197                            _this2.target.fill(container.style.background.backgroundColor);
27198                        }
27199
27200                        _this2.renderBackgroundImage(container);
27201                    });
27202                }
27203
27204                container.style.border.forEach(function (border$$2, side) {
27205                    if (border$$2.borderStyle !== border.BORDER_STYLE.NONE && !border$$2.borderColor.isTransparent()) {
27206                        _this2.renderBorder(border$$2, side, container.curvedBounds);
27207                    }
27208                });
27209            };
27210
27211            if (HAS_BACKGROUND || hasRenderableBorders) {
27212                var paths = container.parent ? container.parent.getClipPaths() : [];
27213                if (paths.length) {
27214                    this.target.clip(paths, callback);
27215                } else {
27216                    callback();
27217                }
27218            }
27219        }
27220    }, {
27221        key: 'renderBackgroundImage',
27222        value: function renderBackgroundImage(container) {
27223            var _this3 = this;
27224
27225            container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) {
27226                if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) {
27227                    _this3.renderBackgroundRepeat(container, backgroundImage);
27228                } else if (/gradient/i.test(backgroundImage.source.method)) {
27229                    _this3.renderBackgroundGradient(container, backgroundImage);
27230                }
27231            });
27232        }
27233    }, {
27234        key: 'renderBackgroundRepeat',
27235        value: function renderBackgroundRepeat(container, background$$2) {
27236            var image = this.options.imageStore.get(background$$2.source.args[0]);
27237            if (image) {
27238                var backgroundPositioningArea = (0, background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
27239                var backgroundImageSize = (0, background.calculateBackgroundSize)(background$$2, image, backgroundPositioningArea);
27240                var position = (0, background.calculateBackgroundPosition)(background$$2.position, backgroundImageSize, backgroundPositioningArea);
27241                var _path = (0, background.calculateBackgroundRepeatPath)(background$$2, position, backgroundImageSize, backgroundPositioningArea, container.bounds);
27242
27243                var _offsetX = Math.round(backgroundPositioningArea.left + position.x);
27244                var _offsetY = Math.round(backgroundPositioningArea.top + position.y);
27245                this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY);
27246            }
27247        }
27248    }, {
27249        key: 'renderBackgroundGradient',
27250        value: function renderBackgroundGradient(container, background$$2) {
27251            var backgroundPositioningArea = (0, background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
27252            var backgroundImageSize = (0, background.calculateGradientBackgroundSize)(background$$2, backgroundPositioningArea);
27253            var position = (0, background.calculateBackgroundPosition)(background$$2.position, backgroundImageSize, backgroundPositioningArea);
27254            var gradientBounds = new Bounds_1.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height);
27255
27256            var gradient = (0, Gradient.parseGradient)(container, background$$2.source, gradientBounds);
27257            if (gradient) {
27258                switch (gradient.type) {
27259                    case Gradient.GRADIENT_TYPE.LINEAR_GRADIENT:
27260                        // $FlowFixMe
27261                        this.target.renderLinearGradient(gradientBounds, gradient);
27262                        break;
27263                    case Gradient.GRADIENT_TYPE.RADIAL_GRADIENT:
27264                        // $FlowFixMe
27265                        this.target.renderRadialGradient(gradientBounds, gradient);
27266                        break;
27267                }
27268            }
27269        }
27270    }, {
27271        key: 'renderBorder',
27272        value: function renderBorder(border$$2, side, curvePoints) {
27273            this.target.drawShape((0, Bounds_1.parsePathForBorder)(curvePoints, side), border$$2.borderColor);
27274        }
27275    }, {
27276        key: 'renderStack',
27277        value: function renderStack(stack) {
27278            var _this4 = this;
27279
27280            if (stack.container.isVisible()) {
27281                var _opacity = stack.getOpacity();
27282                if (_opacity !== this._opacity) {
27283                    this.target.setOpacity(stack.getOpacity());
27284                    this._opacity = _opacity;
27285                }
27286
27287                var _transform = stack.container.style.transform;
27288                if (_transform !== null) {
27289                    this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () {
27290                        return _this4.renderStackContent(stack);
27291                    });
27292                } else {
27293                    this.renderStackContent(stack);
27294                }
27295            }
27296        }
27297    }, {
27298        key: 'renderStackContent',
27299        value: function renderStackContent(stack) {
27300            var _splitStackingContext = splitStackingContexts(stack),
27301                _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5),
27302                negativeZIndex = _splitStackingContext2[0],
27303                zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1],
27304                positiveZIndex = _splitStackingContext2[2],
27305                nonPositionedFloats = _splitStackingContext2[3],
27306                nonPositionedInlineLevel = _splitStackingContext2[4];
27307
27308            var _splitDescendants = splitDescendants(stack),
27309                _splitDescendants2 = _slicedToArray(_splitDescendants, 2),
27310                inlineLevel = _splitDescendants2[0],
27311                nonInlineLevel = _splitDescendants2[1];
27312
27313            // https://www.w3.org/TR/css-position-3/#painting-order
27314            // 1. the background and borders of the element forming the stacking context.
27315
27316
27317            this.renderNodeBackgroundAndBorders(stack.container);
27318            // 2. the child stacking contexts with negative stack levels (most negative first).
27319            negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
27320            // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
27321            this.renderNodeContent(stack.container);
27322            nonInlineLevel.forEach(this.renderNode, this);
27323            // 4. All non-positioned floating descendants, in tree order. For each one of these,
27324            // treat the element as if it created a new stacking context, but any positioned descendants and descendants
27325            // which actually create a new stacking context should be considered part of the parent stacking context,
27326            // not this new one.
27327            nonPositionedFloats.forEach(this.renderStack, this);
27328            // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
27329            nonPositionedInlineLevel.forEach(this.renderStack, this);
27330            inlineLevel.forEach(this.renderNode, this);
27331            // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:
27332            //  All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.
27333            //  For those with 'z-index: auto', treat the element as if it created a new stacking context,
27334            //  but any positioned descendants and descendants which actually create a new stacking context should be
27335            //  considered part of the parent stacking context, not this new one. For those with 'z-index: 0',
27336            //  treat the stacking context generated atomically.
27337            //
27338            //  All opacity descendants with opacity less than 1
27339            //
27340            //  All transform descendants with transform other than none
27341            zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this);
27342            // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index
27343            // order (smallest first) then tree order.
27344            positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
27345        }
27346    }, {
27347        key: 'render',
27348        value: function render(stack) {
27349            if (this.options.backgroundColor) {
27350                this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor);
27351            }
27352            this.renderStack(stack);
27353            var target = this.target.getTarget();
27354            return target;
27355        }
27356    }]);
27357
27358    return Renderer;
27359}();
27360
27361exports.default = Renderer;
27362
27363
27364var splitDescendants = function splitDescendants(stack) {
27365    var inlineLevel = [];
27366    var nonInlineLevel = [];
27367
27368    var length = stack.children.length;
27369    for (var i = 0; i < length; i++) {
27370        var child = stack.children[i];
27371        if (child.isInlineLevel()) {
27372            inlineLevel.push(child);
27373        } else {
27374            nonInlineLevel.push(child);
27375        }
27376    }
27377    return [inlineLevel, nonInlineLevel];
27378};
27379
27380var splitStackingContexts = function splitStackingContexts(stack) {
27381    var negativeZIndex = [];
27382    var zeroOrAutoZIndexOrTransformedOrOpacity = [];
27383    var positiveZIndex = [];
27384    var nonPositionedFloats = [];
27385    var nonPositionedInlineLevel = [];
27386    var length = stack.contexts.length;
27387    for (var i = 0; i < length; i++) {
27388        var child = stack.contexts[i];
27389        if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) {
27390            if (child.container.style.zIndex.order < 0) {
27391                negativeZIndex.push(child);
27392            } else if (child.container.style.zIndex.order > 0) {
27393                positiveZIndex.push(child);
27394            } else {
27395                zeroOrAutoZIndexOrTransformedOrOpacity.push(child);
27396            }
27397        } else {
27398            if (child.container.isFloating()) {
27399                nonPositionedFloats.push(child);
27400            } else {
27401                nonPositionedInlineLevel.push(child);
27402            }
27403        }
27404    }
27405    return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel];
27406};
27407
27408var sortByZIndex = function sortByZIndex(a, b) {
27409    if (a.container.style.zIndex.order > b.container.style.zIndex.order) {
27410        return 1;
27411    } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) {
27412        return -1;
27413    }
27414
27415    return a.container.index > b.container.index ? 1 : -1;
27416};
27417});
27418
27419unwrapExports(Renderer_1);
27420
27421var _Proxy = createCommonjsModule(function (module, exports) {
27422Object.defineProperty(exports, "__esModule", {
27423    value: true
27424});
27425exports.Proxy = undefined;
27426
27427
27428
27429var _Feature2 = _interopRequireDefault(Feature);
27430
27431function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27432
27433var Proxy = exports.Proxy = function Proxy(src, options) {
27434    if (!options.proxy) {
27435        return Promise.reject(null);
27436    }
27437    var proxy = options.proxy;
27438
27439    return new Promise(function (resolve, reject) {
27440        var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
27441        var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
27442        xhr.onload = function () {
27443            if (xhr instanceof XMLHttpRequest) {
27444                if (xhr.status === 200) {
27445                    if (responseType === 'text') {
27446                        resolve(xhr.response);
27447                    } else {
27448                        var reader = new FileReader();
27449                        // $FlowFixMe
27450                        reader.addEventListener('load', function () {
27451                            return resolve(reader.result);
27452                        }, false);
27453                        // $FlowFixMe
27454                        reader.addEventListener('error', function (e) {
27455                            return reject(e);
27456                        }, false);
27457                        reader.readAsDataURL(xhr.response);
27458                    }
27459                } else {
27460                    reject('');
27461                }
27462            } else {
27463                resolve(xhr.responseText);
27464            }
27465        };
27466
27467        xhr.onerror = reject;
27468        xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
27469
27470        if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
27471            xhr.responseType = responseType;
27472        }
27473
27474        if (options.imageTimeout) {
27475            var timeout = options.imageTimeout;
27476            xhr.timeout = timeout;
27477            xhr.ontimeout = function () {
27478                return reject('');
27479            };
27480        }
27481
27482        xhr.send();
27483    });
27484};
27485});
27486
27487unwrapExports(_Proxy);
27488var _Proxy_1 = _Proxy.Proxy;
27489
27490var ResourceLoader_1 = createCommonjsModule(function (module, exports
27490) {
27491Object.defineProperty(exports, "__esModule", {
27492    value: true
27493});
27494exports.ResourceStore = undefined;
27495
27496var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
27497
27498
27499
27500var _Feature2 = _interopRequireDefault(Feature);
27501
27502
27503
27504function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27505
27506function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27507
27508var ResourceLoader = function () {
27509    function ResourceLoader(options, logger, window) {
27510        _classCallCheck(this, ResourceLoader);
27511
27512        this.options = options;
27513        this._window = window;
27514        this.origin = this.getOrigin(window.location.href);
27515        this.cache = {};
27516        this.logger = logger;
27517        this._index = 0;
27518    }
27519
27520    _createClass(ResourceLoader, [{
27521        key: 'loadImage',
27522        value: function loadImage(src) {
27523            var _this = this;
27524
27525            if (this.hasResourceInCache(src)) {
27526                return src;
27527            }
27528            if (isBlobImage(src)) {
27529                this.cache[src] = _loadImage(src, this.options.imageTimeout || 0);
27530                return src;
27531            }
27532
27533            if (!isSVG(src) || _Feature2.default.SUPPORT_SVG_DRAWING) {
27534                if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
27535                    return this.addImage(src, src, false);
27536                } else if (!this.isSameOrigin(src)) {
27537                    if (typeof this.options.proxy === 'string') {
27538                        this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
27539                            return _loadImage(src, _this.options.imageTimeout || 0);
27540                        });
27541                        return src;
27542                    } else if (this.options.useCORS === true && _Feature2.default.SUPPORT_CORS_IMAGES) {
27543                        return this.addImage(src, src, true);
27544                    }
27545                }
27546            }
27547        }
27548    }, {
27549        key: 'inlineImage',
27550        value: function inlineImage(src) {
27551            var _this2 = this;
27552
27553            if (isInlineImage(src)) {
27554                return _loadImage(src, this.options.imageTimeout || 0);
27555            }
27556            if (this.hasResourceInCache(src)) {
27557                return this.cache[src];
27558            }
27559            if (!this.isSameOrigin(src) && typeof this.options.proxy === 'string') {
27560                return this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
27561                    return _loadImage(src, _this2.options.imageTimeout || 0);
27562                });
27563            }
27564
27565            return this.xhrImage(src);
27566        }
27567    }, {
27568        key: 'xhrImage',
27569        value: function xhrImage(src) {
27570            var _this3 = this;
27571
27572            this.cache[src] = new Promise(function (resolve, reject) {
27573                var xhr = new XMLHttpRequest();
27574                xhr.onreadystatechange = function () {
27575                    if (xhr.readyState === 4) {
27576                        if (xhr.status !== 200) {
27577                            reject('Failed to fetch image ' + src.substring(0, 256) + ' with status code ' + xhr.status);
27578                        } else {
27579                            var reader = new FileReader();
27580                            reader.addEventListener('load', function () {
27581                                // $FlowFixMe
27582                                var result = reader.result;
27583                                resolve(result);
27584                            }, false);
27585                            reader.addEventListener('error', function (e) {
27586                                return reject(e);
27587                            }, false);
27588                            reader.readAsDataURL(xhr.response);
27589                        }
27590                    }
27591                };
27592                xhr.responseType = 'blob';
27593                if (_this3.options.imageTimeout) {
27594                    var timeout = _this3.options.imageTimeout;
27595                    xhr.timeout = timeout;
27596                    xhr.ontimeout = function () {
27597                        return reject('');
27598                    };
27599                }
27600                xhr.open('GET', src, true);
27601                xhr.send();
27602            }).then(function (src) {
27603                return _loadImage(src, _this3.options.imageTimeout || 0);
27604            });
27605
27606            return this.cache[src];
27607        }
27608    }, {
27609        key: 'loadCanvas',
27610        value: function loadCanvas(node) {
27611            var key = String(this._index++);
27612            this.cache[key] = Promise.resolve(node);
27613            return key;
27614        }
27615    }, {
27616        key: 'hasResourceInCache',
27617        value: function hasResourceInCache(key) {
27618            return typeof this.cache[key] !== 'undefined';
27619        }
27620    }, {
27621        key: 'addImage',
27622        value: function addImage(key, src, useCORS) {
27623            var _this4 = this;
27624
27625            var imageLoadHandler = function imageLoadHandler(supportsDataImages) {
27626                return new Promise(function (resolve, reject) {
27627                    var img = new Image();
27628                    img.onload = function () {
27629                        return resolve(img);
27630                    };
27631                    //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
27632                    if (!supportsDataImages || useCORS) {
27633                        img.crossOrigin = 'anonymous';
27634                    }
27635
27636                    img.onerror = reject;
27637                    img.src = src;
27638                    if (img.complete === true) {
27639                        // Inline XML images may fail to parse, throwing an Error later on
27640                        setTimeout(function () {
27641                            resolve(img);
27642                        }, 500);
27643                    }
27644                    if (_this4.options.imageTimeout) {
27645                        var timeout = _this4.options.imageTimeout;
27646                        setTimeout(function () {
27647                            return reject('');
27648                        }, timeout);
27649                    }
27650                });
27651            };
27652
27653            this.cache[key] = isInlineBase64Image(src) && !isSVG(src) ? // $FlowFixMe
27654            _Feature2.default.SUPPORT_BASE64_DRAWING(src).then(imageLoadHandler) : imageLoadHandler(true);
27655            return key;
27656        }
27657    }, {
27658        key: 'isSameOrigin',
27659        value: function isSameOrigin(url) {
27660            return this.getOrigin(url) === this.origin;
27661        }
27662    }, {
27663        key: 'getOrigin',
27664        value: function getOrigin(url) {
27665            var link = this._link || (this._link = this._window.document.createElement('a'));
27666            link.href = url;
27667            link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
27668            return link.protocol + link.hostname + link.port;
27669        }
27670    }, {
27671        key: 'ready',
27672        value: function ready() {
27673            var _this5 = this;
27674
27675            var keys = Object.keys(this.cache);
27676            var values = keys.map(function (str) {
27677                return _this5.cache[str].catch(function (e) {
27678                    return null;
27679                });
27680            });
27681            return Promise.all(values).then(function (images) {
27682                return new ResourceStore(keys, images);
27683            });
27684        }
27685    }]);
27686
27687    return ResourceLoader;
27688}();
27689
27690exports.default = ResourceLoader;
27691
27692var ResourceStore = exports.ResourceStore = function () {
27693    function ResourceStore(keys, resources) {
27694        _classCallCheck(this, ResourceStore);
27695
27696        this._keys = keys;
27697        this._resources = resources;
27698    }
27699
27700    _createClass(ResourceStore, [{
27701        key: 'get',
27702        value: function get(key) {
27703            var index = this._keys.indexOf(key);
27704            return index === -1 ? null : this._resources[index];
27705        }
27706    }]);
27707
27708    return ResourceStore;
27709}();
27710
27711var INLINE_SVG = /^data:image\/svg\+xml/i;
27712var INLINE_BASE64 = /^data:image\/.*;base64,/i;
27713var INLINE_IMG = /^data:image\/.*/i;
27714
27715var isInlineImage = function isInlineImage(src) {
27716    return INLINE_IMG.test(src);
27717};
27718var isInlineBase64Image = function isInlineBase64Image(src) {
27719    return INLINE_BASE64.test(src);
27720};
27721var isBlobImage = function isBlobImage(src) {
27722    return src.substr(0, 4) === 'blob';
27723};
27724
27725var isSVG = function isSVG(src) {
27726    return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
27727};
27728
27729var _loadImage = function _loadImage(src, timeout) {
27730    return new Promise(function (resolve, reject) {
27731        var img = new Image();
27732        img.onload = function () {
27733            return resolve(img);
27734        };
27735        img.onerror = reject;
27736        img.src = src;
27737        if (img.complete === true) {
27738            // Inline XML images may fail to parse, throwing an Error later on
27739            setTimeout(function () {
27740                resolve(img);
27741            }, 500);
27742        }
27743        if (timeout) {
27744            setTimeout(function () {
27745                return reject('');
27746            }, timeout);
27747        }
27748    });
27749};
27750});
27751
27752unwrapExports(ResourceLoader_1);
27753var ResourceLoader_2 = ResourceLoader_1.ResourceStore;
27754
27755var PseudoNodeContent = createCommonjsModule(function (module, exports
27755) {
27756Object.defineProperty(exports, "__esModule", {
27757    value: true
27758});
27759exports.parseContent = exports.resolvePseudoContent = exports.popCounters = exports.parseCounterReset = exports.TOKEN_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = undefined;
27760
27761var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
27762
27763
27764
27765
27766
27767var PSEUDO_CONTENT_ITEM_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = {
27768    TEXT: 0,
27769    IMAGE: 1
27770};
27771
27772var TOKEN_TYPE = exports.TOKEN_TYPE = {
27773    STRING: 0,
27774    ATTRIBUTE: 1,
27775    URL: 2,
27776    COUNTER: 3,
27777    COUNTERS: 4,
27778    OPENQUOTE: 5,
27779    CLOSEQUOTE: 6
27780};
27781
27782var parseCounterReset = exports.parseCounterReset = function parseCounterReset(style, data) {
27783    if (!style || !style.counterReset || style.counterReset === 'none') {
27784        return [];
27785    }
27786
27787    var counterNames = [];
27788    var counterResets = style.counterReset.split(/\s*,\s*/);
27789    var lenCounterResets = counterResets.length;
27790
27791    for (var i = 0; i < lenCounterResets; i++) {
27792        var _counterResets$i$spli = counterResets[i].split(/\s+/),
27793            _counterResets$i$spli2 = _slicedToArray(_counterResets$i$spli, 2),
27794            counterName = _counterResets$i$spli2[0],
27795            initialValue = _counterResets$i$spli2[1];
27796
27797        counterNames.push(counterName);
27798        var counter = data.counters[counterName];
27799        if (!counter) {
27800            counter = data.counters[counterName] = [];
27801        }
27802        counter.push(parseInt(initialValue || 0, 10));
27803    }
27804
27805    return counterNames;
27806};
27807
27808var popCounters = exports.popCounters = function popCounters(counterNames, data) {
27809    var lenCounters = counterNames.length;
27810    for (var i = 0; i < lenCounters; i++) {
27811        data.counters[counterNames[i]].pop();
27812    }
27813};
27814
27815var resolvePseudoContent = exports.resolvePseudoContent = function resolvePseudoContent(node, style, data) {
27816    if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
27817        return null;
27818    }
27819
27820    var tokens = parseContent(style.content);
27821
27822    var len = tokens.length;
27823    var contentItems = [];
27824    var s = '';
27825
27826    // increment the counter (if there is a "counter-increment" declaration)
27827    var counterIncrement = style.counterIncrement;
27828    if (counterIncrement && counterIncrement !== 'none') {
27829        var _counterIncrement$spl = counterIncrement.split(/\s+/),
27830            _counterIncrement$spl2 = _slicedToArray(_counterIncrement$spl, 2),
27831            counterName = _counterIncrement$spl2[0],
27832            incrementValue = _counterIncrement$spl2[1];
27833
27834        var counter = data.counters[counterName];
27835        if (counter) {
27836            counter[counter.length - 1] += incrementValue === undefined ? 1 : parseInt(incrementValue, 10);
27837        }
27838    }
27839
27840    // build the content string
27841    for (var i = 0; i < len; i++) {
27842        var token = tokens[i];
27843        switch (token.type) {
27844            case TOKEN_TYPE.STRING:
27845                s += token.value || '';
27846                break;
27847
27848            case TOKEN_TYPE.ATTRIBUTE:
27849                if (node instanceof HTMLElement && token.value) {
27850                    s += node.getAttribute(token.value) || '';
27851                }
27852                break;
27853
27854            case TOKEN_TYPE.COUNTER:
27855                var _counter = data.counters[token.name || ''];
27856                if (_counter) {
27857                    s += formatCounterValue([_counter[_counter.length - 1]], '', token.format);
27858                }
27859                break;
27860
27861            case TOKEN_TYPE.COUNTERS:
27862                var _counters = data.counters[token.name || ''];
27863                if (_counters) {
27864                    s += formatCounterValue(_counters, token.glue, token.format);
27865                }
27866                break;
27867
27868            case TOKEN_TYPE.OPENQUOTE:
27869                s += getQuote(style, true, data.quoteDepth);
27870                data.quoteDepth++;
27871                break;
27872
27873            case TOKEN_TYPE.CLOSEQUOTE:
27874                data.quoteDepth--;
27875                s += getQuote(style, false, data.quoteDepth);
27876                break;
27877
27878            case TOKEN_TYPE.URL:
27879                if (s) {
27880                    contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
27881                    s = '';
27882                }
27883                contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.IMAGE, value: token.value || '' });
27884                break;
27885        }
27886    }
27887
27888    if (s) {
27889        contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
27890    }
27891
27892    return contentItems;
27893};
27894
27895var parseContent = exports.parseContent = function parseContent(content, cache) {
27896    if (cache && cache[content]) {
27897        return cache[content];
27898    }
27899
27900    var tokens = [];
27901    var len = content.length;
27902
27903    var isString = false;
27904    var isEscaped = false;
27905    var isFunction = false;
27906    var str = '';
27907    var functionName = '';
27908    var args = [];
27909
27910    for (var i = 0; i < len; i++) {
27911        var c = content.charAt(i);
27912
27913        switch (c) {
27914            case "'":
27915            case '"':
27916                if (isEscaped) {
27917                    str += c;
27918                } else {
27919                    isString = !isString;
27920                    if (!isFunction && !isString) {
27921                        tokens.push({ type: TOKEN_TYPE.STRING, value: str });
27922                        str = '';
27923                    }
27924                }
27925                break;
27926
27927            case '\\':
27928                if (isEscaped) {
27929                    str += c;
27930                    isEscaped = false;
27931                } else {
27932                    isEscaped = true;
27933                }
27934                break;
27935
27936            case '(':
27937                if (isString) {
27938                    str += c;
27939                } else {
27940                    isFunction = true;
27941                    functionName = str;
27942                    str = '';
27943                    args = [];
27944                }
27945                break;
27946
27947            case ')':
27948                if (isString) {
27949                    str += c;
27950                } else if (isFunction) {
27951                    if (str) {
27952                        args.push(str);
27953                    }
27954
27955                    switch (functionName) {
27956                        case 'attr':
27957                            if (args.length > 0) {
27958                                tokens.push({ type: TOKEN_TYPE.ATTRIBUTE, value: args[0] });
27959                            }
27960                            break;
27961
27962                        case 'counter':
27963                            if (args.length > 0) {
27964                                var counter = {
27965                                    type: TOKEN_TYPE.COUNTER,
27966                                    name: args[0]
27967                                };
27968                                if (args.length > 1) {
27969                                    counter.format = args[1];
27970                                }
27971                                tokens.push(counter);
27972                            }
27973                            break;
27974
27975                        case 'counters':
27976                            if (args.length > 0) {
27977                                var _counters2 = {
27978                                    type: TOKEN_TYPE.COUNTERS,
27979                                    name: args[0]
27980                                };
27981                                if (args.length > 1) {
27982                                    _counters2.glue = args[1];
27983                                }
27984                                if (args.length > 2) {
27985                                    _counters2.format = args[2];
27986                                }
27987                                tokens.push(_counters2);
27988                            }
27989                            break;
27990
27991                        case 'url':
27992                            if (args.length > 0) {
27993                                tokens.push({ type: TOKEN_TYPE.URL, value: args[0] });
27994                            }
27995                            break;
27996                    }
27997
27998                    isFunction = false;
27999                    str = '';
28000                }
28001                break;
28002
28003            case ',':
28004                if (isString) {
28005                    str += c;
28006                } else if (isFunction) {
28007                    args.push(str);
28008                    str = '';
28009                }
28010                break;
28011
28012            case ' ':
28013            case '\t':
28014                if (isString) {
28015                    str += c;
28016                } else if (str) {
28017                    addOtherToken(tokens, str);
28018                    str = '';
28019                }
28020                break;
28021
28022            default:
28023                str += c;
28024        }
28025
28026        if (c !== '\\') {
28027            isEscaped = false;
28028        }
28029    }
28030
28031    if (str) {
28032        addOtherToken(tokens, str);
28033    }
28034
28035    if (cache) {
28036        cache[content] = tokens;
28037    }
28038
28039    return tokens;
28040};
28041
28042var addOtherToken = function addOtherToken(tokens, identifier) {
28043    switch (identifier) {
28044        case 'open-quote':
28045            tokens.push({ type: TOKEN_TYPE.OPENQUOTE });
28046            break;
28047        case 'close-quote':
28048            tokens.push({ type: TOKEN_TYPE.CLOSEQUOTE });
28049            break;
28050    }
28051};
28052
28053var getQuote = function getQuote(style, isOpening, quoteDepth) {
28054    var quotes = style.quotes ? style.quotes.split(/\s+/) : ["'\"'", "'\"'"];
28055    var idx = quoteDepth * 2;
28056    if (idx >= quotes.length) {
28057        idx = quotes.length - 2;
28058    }
28059    if (!isOpening) {
28060        ++idx;
28061    }
28062    return quotes[idx].replace(/^["']|["']$/g, '');
28063};
28064
28065var formatCounterValue = function formatCounterValue(counter, glue, format) {
28066    var len = counter.length;
28067    var result = '';
28068
28069    for (var i = 0; i < len; i++) {
28070        if (i > 0) {
28071            result += glue || '';
28072        }
28073        result += (0, ListItem.createCounterText)(counter[i], (0, listStyle.parseListStyleType)(format || 'decimal'), false);
28074    }
28075
28076    return result;
28077};
28078});
28079
28080unwrapExports(PseudoNodeContent);
28081var PseudoNodeContent_1 = PseudoNodeContent.parseContent;
28082var PseudoNodeContent_2 = PseudoNodeContent.resolvePseudoContent;
28083var PseudoNodeContent_3 = PseudoNodeContent.popCounters;
28084var PseudoNodeContent_4 = PseudoNodeContent.parseCounterReset;
28085var PseudoNodeContent_5 = PseudoNodeContent.TOKEN_TYPE;
28086var PseudoNodeContent_6 = PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE;
28087
28088var Clone = createCommonjsModule(function (module, exports) {
28089Object.defineProperty(exports, "__esModule", {
28090    value: true
28091});
28092exports.cloneWindow = exports.DocumentCloner = undefined;
28093
28094var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
28095
28096var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
28097
28098
28099
28100
28101
28102
28103
28104var _ResourceLoader2 = _interopRequireDefault(ResourceLoader_1);
28105
28106
28107
28108
28109
28110
28111
28112var _CanvasRenderer2 = _interopRequireDefault(CanvasRenderer_1);
28113
28114
28115
28116function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28117
28118function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28119
28120var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
28121
28122var DocumentCloner = exports.DocumentCloner = function () {
28123    function DocumentCloner(element, options, logger, copyInline, renderer) {
28124        _classCallCheck(this, DocumentCloner);
28125
28126        this.referenceElement = element;
28127        this.scrolledElements = [];
28128        this.copyStyles = copyInline;
28129        this.inlineImages = copyInline;
28130        this.logger = logger;
28131        this.options = options;
28132        this.renderer = renderer;
28133        this.resourceLoader = new _ResourceLoader2.default(options, logger, window);
28134        this.pseudoContentData = {
28135            counters: {},
28136            quoteDepth: 0
28137        };
28138        // $FlowFixMe
28139        this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
28140    }
28141
28142    _createClass(DocumentCloner, [{
28143        key: 'inlineAllImages',
28144        value: function inlineAllImages(node) {
28145            var _this = this;
28146
28147            if (this.inlineImages && node) {
28148                var style = node.style;
28149                Promise.all((0, background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) {
28150                    if (backgroundImage.method === 'url') {
28151                        return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) {
28152                            return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none';
28153                        }).catch(function (e) {
28154                            
28155                        });
28156                    }
28157                    return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')');
28158                })).then(function (backgroundImages) {
28159                    if (backgroundImages.length > 1) {
28160                        // TODO Multiple backgrounds somehow broken in Chrome
28161                        style.backgroundColor = '';
28162                    }
28163                    style.backgroundImage = backgroundImages.join(',');
28164                });
28165
28166                if (node instanceof HTMLImageElement) {
28167                    this.resourceLoader.inlineImage(node.src).then(function (img) {
28168                        if (img && node instanceof HTMLImageElement && node.parentNode) {
28169                            var parentNode = node.parentNode;
28170                            var clonedChild = (0, Util.copyCSSStyles)(node.style, img.cloneNode(false));
28171                            parentNode.replaceChild(clonedChild, node);
28172                        }
28173                    }).catch(function (e) {
28174                        
28175                    });
28176                }
28177            }
28178        }
28179    }, {
28180        key: 'inlineFonts',
28181        value: function inlineFonts(document) {
28182            var _this2 = this;
28183
28184            return Promise.all(Array.from(document.styleSheets).map(function (sheet) {
28185                if (sheet.href) {
28186                    return fetch(sheet.href).then(function (res) {
28187                        return res.text();
28188                    }).then(function (text) {
28189                        return createStyleSheetFontsFromText(text, sheet.href);
28190                    }).catch(function (e) {
28191                        return [];
28192                    });
28193                }
28194                return getSheetFonts(sheet, document);
28195            })).then(function (fonts) {
28196                return fonts.reduce(function (acc, font) {
28197                    return acc.concat(font);
28198                }, []);
28199            }).then(function (fonts) {
28200                return Promise.all(fonts.map(function (font) {
28201                    return fetch(font.formats[0].src).then(function (response) {
28202                        return response.blob();
28203                    }).then(function (blob) {
28204                        return new Promise(function (resolve, reject) {
28205                            var reader = new FileReader();
28206                            reader.onerror = reject;
28207                            reader.onload = function () {
28208                                // $FlowFixMe
28209                                var result = reader.result;
28210                                resolve(result);
28211                            };
28212                            reader.readAsDataURL(blob);
28213                        });
28214                    }).then(function (dataUri) {
28215                        font.fontFace.setProperty('src', 'url("' + dataUri + '")');
28216                        return '@font-face {' + font.fontFace.cssText + ' ';
28217                    });
28218                }));
28219            }).then(function (fontCss) {
28220                var style = document.createElement('style');
28221                style.textContent = fontCss.join('\n');
28222                _this2.documentElement.appendChild(style);
28223            });
28224        }
28225    }, {
28226        key: 'createElementClone',
28227        value: function createElementClone(node) {
28228            var _this3 = this;
28229
28230            if (this.copyStyles && node instanceof HTMLCanvasElement) {
28231                var img = node.ownerDocument.createElement('img');
28232                try {
28233                    img.src = node.toDataURL();
28234                    return img;
28235                } catch (e) {
28236                    
28237                }
28238            }
28239
28240            if (node instanceof HTMLIFrameElement) {
28241                var tempIframe = node.cloneNode(false);
28242                var iframeKey = generateIframeKey();
28243                tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);
28244
28245                var _parseBounds = (0, Bounds_1.parseBounds)(node, 0, 0),
28246                    width = _parseBounds.width,
28247                    height = _parseBounds.height;
28248
28249                this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {
28250                    return _this3.renderer(documentElement, {
28251                        async: _this3.options.async,
28252                        allowTaint: _this3.options.allowTaint,
28253                        backgroundColor: '#ffffff',
28254                        canvas: null,
28255                        imageTimeout: _this3.options.imageTimeout,
28256                        logging: _this3.options.logging,
28257                        proxy: _this3.options.proxy,
28258                        removeContainer: _this3.options.removeContainer,
28259                        scale: _this3.options.scale,
28260                        foreignObjectRendering: _this3.options.foreignObjectRendering,
28261                        useCORS: _this3.options.useCORS,
28262                        target: new _CanvasRenderer2.default(),
28263                        width: width,
28264                        height: height,
28265                        x: 0,
28266                        y: 0,
28267                        windowWidth: documentElement.ownerDocument.defaultView.innerWidth,
28268                        windowHeight: documentElement.ownerDocument.defaultView.innerHeight,
28269                        scrollX: documentElement.ownerDocument.defaultView.pageXOffset,
28270                        scrollY: documentElement.ownerDocument.defaultView.pageYOffset
28271                    }, _this3.logger.child(iframeKey));
28272                }).then(function (canvas) {
28273                    return new Promise(function (resolve, reject) {
28274                        var iframeCanvas = document.createElement('img');
28275                        iframeCanvas.onload = function () {
28276                            return resolve(canvas);
28277                        };
28278                        iframeCanvas.onerror = reject;
28279                        iframeCanvas.src = canvas.toDataURL();
28280                        if (tempIframe.parentNode) {
28281                            tempIframe.parentNode.replaceChild((0, Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe);
28282                        }
28283                    });
28284                });
28285                return tempIframe;
28286            }
28287
28288            if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
28289                var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) {
28290                    try {
28291                        if (rule && rule.cssText) {
28292                            return css + rule.cssText;
28293                        }
28294                        return css;
28295                    } catch (err) {
28296                        _this3.logger.log('Unable to access cssText property', rule.name);
28297                        return css;
28298                    }
28299                }, '');
28300                var style = node.cloneNode(false);
28301                style.textContent = css;
28302                return style;
28303            }
28304
28305            return node.cloneNode(false);
28306        }
28307    }, {
28308        key: 'cloneNode',
28309        value: function cloneNode(node) {
28310            var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node);
28311
28312            var window = node.ownerDocument.defaultView;
28313            var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null;
28314            var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null;
28315            var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null;
28316
28317            if (this.referenceElement === node && clone instanceof window.HTMLElement) {
28318                this.clonedReferenceElement = clone;
28319            }
28320
28321            if (clone instanceof window.HTMLBodyElement) {
28322                createPseudoHideStyles(clone);
28323            }
28324
28325            var counters = (0, PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData);
28326            var contentBefore = (0, PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData);
28327
28328            for (var child = node.firstChild; child; child = child.nextSibling) {
28329                if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' &&
28330                // $FlowFixMe
28331                !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' ||
28332                // $FlowFixMe
28333                !this.options.ignoreElements(child))) {
28334                    if (!this.copyStyles || child.nodeName !== 'STYLE') {
28335                        clone.appendChild(this.cloneNode(child));
28336                    }
28337                }
28338            }
28339
28340            var contentAfter = (0, PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData);
28341            (0, PseudoNodeContent.popCounters)(counters, this.pseudoContentData);
28342
28343            if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) {
28344                if (styleBefore) {
28345                    this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE));
28346                }
28347                if (styleAfter) {
28348                    this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER));
28349                }
28350                if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) {
28351                    (0, Util.copyCSSStyles)(style, clone);
28352                }
28353                this.inlineAllImages(clone);
28354                if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
28355                    this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
28356                }
28357                switch (node.nodeName) {
28358                    case 'CANVAS':
28359                        if (!this.copyStyles) {
28360                            cloneCanvasContents(node, clone);
28361                        }
28362                        break;
28363                    case 'TEXTAREA':
28364                    case 'SELECT':
28365                        clone.value = node.value;
28366                        break;
28367                }
28368            }
28369            return clone;
28370        }
28371    }]);
28372
28373    return DocumentCloner;
28374}();
28375
28376var getSheetFonts = function getSheetFonts(sheet, document) {
28377    // $FlowFixMe
28378    return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) {
28379        return rule.type === CSSRule.FONT_FACE_RULE;
28380    }).map(function (rule) {
28381        var src = (0, background.parseBackgroundImage)(rule.style.getPropertyValue('src'));
28382        var formats = [];
28383        for (var i = 0; i < src.length; i++) {
28384            if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') {
28385                var a = document.createElement('a');
28386                a.href = src[i].args[0];
28387                if (document.body) {
28388                    document.body.appendChild(a);
28389                }
28390
28391                var font = {
28392                    src: a.href,
28393                    format: src[i + 1].args[0]
28394                };
28395                formats.push(font);
28396            }
28397        }
28398
28399        return {
28400            // TODO select correct format for browser),
28401
28402            formats: formats.filter(function (font) {
28403                return (/^woff/i.test(font.format)
28404                );
28405            }),
28406            fontFace: rule.style
28407        };
28408    }).filter(function (font) {
28409        return font.formats.length;
28410    });
28411};
28412
28413var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) {
28414    var doc = document.implementation.createHTMLDocument('');
28415    var base = document.createElement('base');
28416    // $FlowFixMe
28417    base.href = baseHref;
28418    var style = document.createElement('style');
28419
28420    style.textContent = text;
28421    if (doc.head) {
28422        doc.head.appendChild(base);
28423    }
28424    if (doc.body) {
28425        doc.body.appendChild(style);
28426    }
28427
28428    return style.sheet ? getSheetFonts(style.sheet, doc) : [];
28429};
28430
28431var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) {
28432    if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
28433        ownerDocument.defaultView.scrollTo(x, y);
28434    }
28435};
28436
28437var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) {
28438    try {
28439        if (clonedCanvas) {
28440            clonedCanvas.width = canvas.width;
28441            clonedCanvas.height = canvas.height;
28442            var ctx = canvas.getContext('2d');
28443            var clonedCtx = clonedCanvas.getContext('2d');
28444            if (ctx) {
28445                clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
28446            } else {
28447                clonedCtx.drawImage(canvas, 0, 0);
28448            }
28449        }
28450    } catch (e) {}
28451};
28452
28453var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) {
28454    if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
28455        return;
28456    }
28457
28458    var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement');
28459    (0, Util.copyCSSStyles)(style, anonymousReplacedElement);
28460
28461    if (contentItems) {
28462        var len = contentItems.length;
28463        for (var i = 0; i < len; i++) {
28464            var item = contentItems[i];
28465            switch (item.type) {
28466                case PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:
28467                    var img = clone.ownerDocument.createElement('img');
28468                    img.src = (0, background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0];
28469                    img.style.opacity = '1';
28470                    anonymousReplacedElement.appendChild(img);
28471                    break;
28472                case PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT:
28473                    anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value));
28474                    break;
28475            }
28476        }
28477    }
28478
28479    anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
28480    clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
28481    if (pseudoElt === PSEUDO_BEFORE) {
28482        clone.insertBefore(anonymousReplacedElement, clone.firstChild);
28483    } else {
28484        clone.appendChild(anonymousReplacedElement);
28485    }
28486
28487    return anonymousReplacedElement;
28488};
28489
28490var PSEUDO_BEFORE = ':before';
28491var PSEUDO_AFTER = ':after';
28492var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
28493var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
28494
28495var PSEUDO_HIDE_ELEMENT_STYLE = '{\n    content: "" !important;\n    display: none !important;\n}';
28496
28497var createPseudoHideStyles = function createPseudoHideStyles(body) {
28498    createStyles(body, '.' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + '\n         .' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
28499};
28500
28501var createStyles = function createStyles(body, styles) {
28502    var style = body.ownerDocument.createElement('style');
28503    style.innerHTML = styles;
28504    body.appendChild(style);
28505};
28506
28507var initNode = function initNode(_ref) {
28508    var _ref2 = _slicedToArray(_ref, 3),
28509        element = _ref2[0],
28510        x = _ref2[1],
28511        y = _ref2[2];
28512
28513    element.scrollLeft = x;
28514    element.scrollTop = y;
28515};
28516
28517var generateIframeKey = function generateIframeKey() {
28518    return Math.ceil(Date.now() + Math.random() * 10000000).toString(16);
28519};
28520
28521var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i;
28522
28523var getIframeDocumentElement = function getIframeDocumentElement(node, options) {
28524    try {
28525        return Promise.resolve(node.contentWindow.document.documentElement);
28526    } catch (e) {
28527        return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) {
28528            var match = html.match(DATA_URI_REGEXP);
28529            if (!match) {
28530                return Promise.reject();
28531            }
28532
28533            return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]);
28534        }).then(function (html) {
28535            return createIframeContainer(node.ownerDocument, (0, Bounds_1.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) {
28536                var cloneWindow = cloneIframeContainer.contentWindow;
28537                var documentClone = cloneWindow.document;
28538
28539                documentClone.open();
28540                documentClone.write(html);
28541                var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
28542                    return documentClone.documentElement;
28543                });
28544
28545                documentClone.close();
28546                return iframeLoad;
28547            });
28548        }) : Promise.reject();
28549    }
28550};
28551
28552var createIframeContainer = function createIframeContainer(ownerDocument, bounds) {
28553    var cloneIframeContainer = ownerDocument.createElement('iframe');
28554
28555    cloneIframeContainer.className = 'html2canvas-container';
28556    cloneIframeContainer.style.visibility = 'hidden';
28557    cloneIframeContainer.style.position = 'fixed';
28558    cloneIframeContainer.style.left = '-10000px';
28559    cloneIframeContainer.style.top = '0px';
28560    cloneIframeContainer.style.border = '0';
28561    cloneIframeContainer.width = bounds.width.toString();
28562    cloneIframeContainer.height = bounds.height.toString();
28563    cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
28564    cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
28565    if (!ownerDocument.body) {
28566        return Promise.reject('');
28567    }
28568
28569    ownerDocument.body.appendChild(cloneIframeContainer);
28570
28571    return Promise.resolve(cloneIframeContainer);
28572};
28573
28574var iframeLoader = function iframeLoader(cloneIframeContainer) {
28575    var cloneWindow = cloneIframeContainer.contentWindow;
28576    var documentClone = cloneWindow.document;
28577
28578    return new Promise(function (resolve, reject) {
28579        cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () {
28580            var interval = setInterval(function () {
28581                if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
28582                    clearInterval(interval);
28583                    resolve(cloneIframeContainer);
28584                }
28585            }, 50);
28586        };
28587    });
28588};
28589
28590var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) {
28591    var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer);
28592    var scrollX = ownerDocument.defaultView.pageXOffset;
28593    var scrollY = ownerDocument.defaultView.pageYOffset;
28594
28595    return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) {
28596        var cloneWindow = cloneIframeContainer.contentWindow;
28597        var documentClone = cloneWindow.document;
28598
28599        /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
28600             if window url is about:blank, we can assign the url to current by writing onto the document
28601             */
28602
28603        var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
28604            cloner.scrolledElements.forEach(initNode);
28605            cloneWindow.scrollTo(bounds.left, bounds.top);
28606            if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== bounds.top || cloneWindow.scrollX !== bounds.left)) {
28607                documentClone.documentElement.style.top = -bounds.top + 'px';
28608                documentClone.documentElement.style.left = -bounds.left + 'px';
28609                documentClone.documentElement.style.position = 'absolute';
28610            }
28611
28612            var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]);
28613
28614            var onclone = options.onclone;
28615
28616            return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () {
28617                return onclone(documentClone);
28618            }).then(function () {
28619                return result;
28620            }) : result : Promise.reject('');
28621        });
28622
28623        documentClone.open();
28624        documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
28625        // Chrome scrolls the parent document for some reason after the write to the cloned window???
28626        restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY);
28627        documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);
28628        documentClone.close();
28629
28630        return iframeLoad;
28631    });
28632};
28633
28634var serializeDoctype = function serializeDoctype(doctype) {
28635    var str = '';
28636    if (doctype) {
28637        str += '<!DOCTYPE ';
28638        if (doctype.name) {
28639            str += doctype.name;
28640        }
28641
28642        if (doctype.internalSubset) {
28643            str += doctype.internalSubset;
28644        }
28645
28646        if (doctype.publicId) {
28647            str += '"' + doctype.publicId + '"';
28648        }
28649
28650        if (doctype.systemId) {
28651            str += '"' + doctype.systemId + '"';
28652        }
28653
28654        str += '>';
28655    }
28656
28657    return str;
28658};
28659});
28660
28661unwrapExports(Clone);
28662var Clone_1 = Clone.cloneWindow;
28663var Clone_2 = Clone.DocumentCloner;
28664
28665var Window = createCommonjsModule(function (module, exports) {
28666Object.defineProperty(exports, "__esModule", {
28667    value: true
28668});
28669exports.renderElement = undefined;
28670
28671var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
28672
28673
28674
28675var _Logger2 = _interopRequireDefault(Logger_1);
28676
28677
28678
28679
28680
28681var _Renderer2 = _interopRequireDefault(Renderer_1);
28682
28683
28684
28685var _ForeignObjectRenderer2 = _interopRequireDefault(ForeignObjectRenderer_1);
28686
28687
28688
28689var _Feature2 = _interopRequireDefault(Feature);
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699var _Color2 = _interopRequireDefault(Color_1);
28700
28701function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28702
28703var renderElement = exports.renderElement = function renderElement(element, options, logger) {
28704    var ownerDocument = element.ownerDocument;
28705
28706    var windowBounds = new Bounds_1.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
28707
28708    // http://www.w3.org/TR/css3-background/#special-backgrounds
28709    var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : Color_1.TRANSPARENT;
28710    var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : Color_1.TRANSPARENT;
28711
28712    var backgroundColor = element === ownerDocument.documentElement ? documentBackgroun
28712dColor.isTransparent() ? bodyBackgroundColor.isTransparent() ? options.backgroundColor ? new _Color2.default(options.backgroundColor) : null : bodyBackgroundColor : documentBackgroundColor : options.backgroundColor ? new _Color2.default(options.backgroundColor) : null;
28713
28714    return (options.foreignObjectRendering ? // $FlowFixMe
28715    _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
28716        return supportForeignObject ? function (cloner) {
28717            return cloner.inlineFonts(ownerDocument).then(function () {
28718                return cloner.resourceLoader.ready();
28719            }).then(function () {
28720                var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
28721
28722                var defaultView = ownerDocument.defaultView;
28723                var scrollX = defaultView.pageXOffset;
28724                var scrollY = defaultView.pageYOffset;
28725
28726                var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
28727
28728                var _ref = isDocument ? (0, Bounds_1.parseDocumentSize)(ownerDocument) : (0, Bounds_1.parseBounds)(element, scrollX, scrollY),
28729                    width = _ref.width,
28730                    height = _ref.height,
28731                    left = _ref.left,
28732                    top = _ref.top;
28733
28734                return renderer.render({
28735                    backgroundColor: backgroundColor,
28736                    logger: logger,
28737                    scale: options.scale,
28738                    x: typeof options.x === 'number' ? options.x : left,
28739                    y: typeof options.y === 'number' ? options.y : top,
28740                    width: typeof options.width === 'number' ? options.width : Math.ceil(width),
28741                    height: typeof options.height === 'number' ? options.height : Math.ceil(height),
28742                    windowWidth: options.windowWidth,
28743                    windowHeight: options.windowHeight,
28744                    scrollX: options.scrollX,
28745                    scrollY: options.scrollY
28746                });
28747            });
28748        }(new Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) {
28749            var _ref3 = _slicedToArray(_ref2, 3),
28750                container = _ref3[0],
28751                clonedElement = _ref3[1],
28752                resourceLoader = _ref3[2];
28753
28754            var stack = (0, NodeParser_1.NodeParser)(clonedElement, resourceLoader, logger);
28755            var clonedDocument = clonedElement.ownerDocument;
28756
28757            if (backgroundColor === stack.container.style.background.backgroundColor) {
28758                stack.container.style.background.backgroundColor = Color_1.TRANSPARENT;
28759            }
28760
28761            return resourceLoader.ready().then(function (imageStore) {
28762                var fontMetrics = new Font.FontMetrics(clonedDocument);
28763                var defaultView = clonedDocument.defaultView;
28764                var scrollX = defaultView.pageXOffset;
28765                var scrollY = defaultView.pageYOffset;
28766
28767                var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY';
28768
28769                var _ref4 = isDocument ? (0, Bounds_1.parseDocumentSize)(ownerDocument) : (0, Bounds_1.parseBounds)(clonedElement, scrollX, scrollY),
28770                    width = _ref4.width,
28771                    height = _ref4.height,
28772                    left = _ref4.left,
28773                    top = _ref4.top;
28774
28775                var renderOptions = {
28776                    backgroundColor: backgroundColor,
28777                    fontMetrics: fontMetrics,
28778                    imageStore: imageStore,
28779                    logger: logger,
28780                    scale: options.scale,
28781                    x: typeof options.x === 'number' ? options.x : left,
28782                    y: typeof options.y === 'number' ? options.y : top,
28783                    width: typeof options.width === 'number' ? options.width : Math.ceil(width),
28784                    height: typeof options.height === 'number' ? options.height : Math.
28784ceil(height)
28785                };
28786
28787                if (Array.isArray(options.target)) {
28788                    return Promise.all(options.target.map(function (target) {
28789                        var renderer = new _Renderer2.default(target, renderOptions);
28790                        return renderer.render(stack);
28791                    }));
28792                } else {
28793                    var renderer = new _Renderer2.default(options.target, renderOptions);
28794                    var canvas = renderer.render(stack);
28795                    if (options.removeContainer === true) {
28796                        if (container.parentNode) {
28797                            container.parentNode.removeChild(container);
28798                        } else {}
28799                    }
28800
28801                    return canvas;
28802                }
28803            });
28804        });
28805    });
28806};
28807});
28808
28809unwrapExports(Window);
28810var Window_1 = Window.renderElement;
28811
28812var npm = createCommonjsModule(function (module) {
28813var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
28814
28815
28816
28817var _CanvasRenderer2 = _interopRequireDefault(CanvasRenderer_1);
28818
28819
28820
28821var _Logger2 = _interopRequireDefault(Logger_1);
28822
28823
28824
28825function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28826
28827var html2canvas = function html2canvas(element, conf) {
28828    var config = conf || {};
28829    var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
28830    logger.log('html2canvas ' + "$npm_package_version");
28831
28832    var ownerDocument = element.ownerDocument;
28833    if (!ownerDocument) {
28834        return Promise.reject('Provided element is not within a Document');
28835    }
28836    var defaultView = ownerDocument.defaultView;
28837
28838    var defaultOptions = {
28839        async: true,
28840        allowTaint: false,
28841        backgroundColor: '#ffffff',
28842        imageTimeout: 15000,
28843        logging: true,
28844        proxy: null,
28845        removeContainer: true,
28846        foreignObjectRendering: false,
28847        scale: defaultView.devicePixelRatio || 1,
28848        target: new _CanvasRenderer2.default(config.canvas),
28849        useCORS: false,
28850        windowWidth: defaultView.innerWidth,
28851        windowHeight: defaultView.innerHeight,
28852        scrollX: defaultView.pageXOffset,
28853        scrollY: defaultView.pageYOffset
28854    };
28855
28856    var result = (0, Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
28857
28858    return result;
28859};
28860
28861html2canvas.CanvasRenderer = _CanvasRenderer2.default;
28862
28863module.exports = html2canvas;
28864});
28865
28866var html2canvas$1 = unwrapExports(npm);
28867
28868var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
28869  return typeof obj;
28870} : function (obj) {
28871  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
28872};
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894var _extends = Object.assign || function (target) {
28895  for (var i = 1; i < arguments.length; i++) {
28896    var source = arguments[i];
28897
28898    for (var key in source) {
28899      if (Object.prototype.hasOwnProperty.call(source, key)) {
28900        target[key] = source[key];
28901      }
28902    }
28903  }
28904
28905  return target;
28906};
28907
28908// Determine the type of a variable/object.
28909var objType = function objType(obj) {
28910  var type = typeof obj === 'undefined' ? 'undefined' : _typeof(obj);
28911  if (type === 'undefined') return 'undefined';else if (type === 'string' || obj instanceof String) return 'string';else if (type === 'number' || obj instanceof Number) return 'number';else if (type === 'function' || obj instanceof Function) return 'function';else if (!!obj && obj.constructor === Array) return 'array';else if (obj && obj.nodeType === 1) return 'element';else if (type === 'object') return 'object';else return 'unknown';
28912};
28913
28914// Create an HTML element with optional className, innerHTML, and style.
28915var createElement = function createElement(tagName, opt) {
28916  var el = document.createElement(tagName);
28917  if (opt.className) el.className = opt.className;
28918  if (opt.innerHTML) {
28919    el.innerHTML = opt.innerHTML;
28920    var scripts = el.getElementsByTagName('script');
28921    for (var i = scripts.length; i-- > 0; null) {
28922      scripts[i].parentNode.removeChild(scripts[i]);
28923    }
28924  }
28925  for (var key in opt.style) {
28926    el.style[key] = opt.style[key];
28927  }
28928  return el;
28929};
28930
28931// Deep-clone a node and preserve contents/properties.
28932var cloneNode = function cloneNode(node, javascriptEnabled) {
28933  // Recursively clone the node.
28934  var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);
28935  for (var child = node.firstChild; child; child = child.nextSibling) {
28936    if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') {
28937      clone.appendChild(cloneNode(child, javascriptEnabled));
28938    }
28939  }
28940
28941  if (node.nodeType === 1) {
28942    // Preserve contents/properties of special nodes.
28943    if (node.nodeName === 'CANVAS') {
28944      clone.width = node.width;
28945      clone.height = node.height;
28946      clone.getContext('2d').drawImage(node, 0, 0);
28947    } else if (node.nodeName === 'TEXTAREA' || node.nodeName === 'SELECT') {
28948      clone.value = node.value;
28949    }
28950
28951    // Preserve the node's scroll position when it loads.
28952    clone.addEventListener('load', function () {
28953      clone.scrollTop = node.scrollTop;
28954      clone.scrollLeft = node.scrollLeft;
28955    }, true);
28956  }
28957
28958  // Return the cloned node.
28959  return clone;
28960};
28961
28962// Convert units from px using the conversion value 'k' from jsPDF.
28963var unitConvert = function unitConvert(obj, k) {
28964  if (objType(obj) === 'number') {
28965    return obj * 72 / 96 / k;
28966  } else {
28967    var newObj = {};
28968    for (var key in obj) {
28969      newObj[key] = obj[key] * 72 / 96 / k;
28970    }
28971    return newObj;
28972  }
28973};
28974
28975// Convert units to px using the conversion value 'k' from jsPDF.
28976var toPx = function toPx(val, k) {
28977  return Math.floor(val * k / 72 * 96);
28978};
28979
28980var es6Promise = createCommonjsModule(function (module, exports) {
28981/*!
28982 * @overview es6-promise - a tiny implementation of Promises/A+.
28983 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
28984 * @license   Licensed under MIT license
28985 *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
28986 * @version   v4.2.5+7f2b526d
28987 */
28988
28989(function (global, factory) {
28990	module.exports = factory();
28991}(commonjsGlobal, (function () { function objectOrFunction(x) {
28992  var type = typeof x;
28993  return x !== null && (type === 'object' || type === 'function');
28994}
28995
28996function isFunction(x) {
28997  return typeof x === 'function';
28998}
28999
29000
29001
29002var _isArray = void 0;
29003if (Array.isArray) {
29004  _isArray = Array.isArray;
29005} else {
29006  _isArray = function (x) {
29007    return Object.prototype.toString.call(x) === '[object Array]';
29008  };
29009}
29010
29011var isArray = _isArray;
29012
29013var len = 0;
29014var vertxNext = void 0;
29015var customSchedulerFn = void 0;
29016
29017var asap = function asap(callback, arg) {
29018  queue[len] = callback;
29019  queue[len + 1] = arg;
29020  len += 2;
29021  if (len === 2) {
29022    // If len is 2, that means that we need to schedule an async flush.
29023    // If additional callbacks are queued before the queue is flushed, they
29024    // will be processed by this flush that we are scheduling.
29025    if (customSchedulerFn) {
29026      customSchedulerFn(flush);
29027    } else {
29028      scheduleFlush();
29029    }
29030  }
29031};
29032
29033function setScheduler(scheduleFn) {
29034  customSchedulerFn = scheduleFn;
29035}
29036
29037function setAsap(asapFn) {
29038  asap = asapFn;
29039}
29040
29041var browserWindow = typeof window !== 'undefined' ? window : undefined;
29042var browserGlobal = browserWindow || {};
29043var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
29044var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
29045
29046// test for web worker but not in IE10
29047var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
29048
29049// node
29050function useNextTick() {
29051  // node version 0.10.x displays a deprecation warning when nextTick is used recursively
29052  // see https://github.com/cujojs/when/issues/410 for details
29053  return function () {
29054    return process.nextTick(flush);
29055  };
29056}
29057
29058// vertx
29059function useVertxTimer() {
29060  if (typeof vertxNext !== 'undefined') {
29061    return function () {
29062      vertxNext(flush);
29063    };
29064  }
29065
29066  return useSetTimeout();
29067}
29068
29069function useMutationObserver() {
29070  var iterations = 0;
29071  var observer = new BrowserMutationObserver(flush);
29072  var node = document.createTextNode('');
29073  observer.observe(node, { characterData: true });
29074
29075  return function () {
29076    node.data = iterations = ++iterations % 2;
29077  };
29078}
29079
29080// web worker
29081function useMessageChannel() {
29082  var channel = new MessageChannel();
29083  channel.port1.onmessage = flush;
29084  return function () {
29085    return channel.port2.postMessage(0);
29086  };
29087}
29088
29089function useSetTimeout() {
29090  // Store setTimeout reference so es6-promise will be unaffected by
29091  // other code modifying setTimeout (like sinon.useFakeTimers())
29092  var globalSetTimeout = setTimeout;
29093  return function () {
29094    return globalSetTimeout(flush, 1);
29095  };
29096}
29097
29098var queue = new Array(1000);
29099function flush() {
29100  for (var i = 0; i < len; i += 2) {
29101    var callback = queue[i];
29102    var arg = queue[i + 1];
29103
29104    callback(arg);
29105
29106    queue[i] = undefined;
29107    queue[i + 1] = undefined;
29108  }
29109
29110  len = 0;
29111}
29112
29113function attemptVertx() {
29114  try {
29115    var vertx = Function('return this')().require('vertx');
29116    vertxNext = vertx.runOnLoop || vertx.runOnContext;
29117    return useVertxTimer();
29118  } catch (e) {
29119    return useSetTimeout();
29120  }
29121}
29122
29123var scheduleFlush = void 0;
29124// Decide what async method to use to triggering processing of queued callbacks:
29125if (isNode) {
29126  scheduleFlush = useNextTick();
29127} else if (BrowserMutationObserver) {
29128  scheduleFlush = useMutationObserver();
29129} else if (isWorker) {
29130  scheduleFlush = useMessageChannel();
29131} else if (browserWindow === undefined && typeof commonjsRequire
vendor: 8,702 bytes, lines 29131-29512
29131 === 'function') {
29132  scheduleFlush = attemptVertx();
29133} else {
29134  scheduleFlush = useSetTimeout();
29135}
29136
29137function then(onFulfillment, onRejection) {
29138  var parent = this;
29139
29140  var child = new this.constructor(noop);
29141
29142  if (child[PROMISE_ID] === undefined) {
29143    makePromise(child);
29144  }
29145
29146  var _state = parent._state;
29147
29148
29149  if (_state) {
29150    var callback = arguments[_state - 1];
29151    asap(function () {
29152      return invokeCallback(_state, child, callback, parent._result);
29153    });
29154  } else {
29155    subscribe(parent, child, onFulfillment, onRejection);
29156  }
29157
29158  return child;
29159}
29160
29161/**
29162  `Promise.resolve` returns a promise that will become resolved with the
29163  passed `value`. It is shorthand for the following:
29164
29165  ```javascript
29166  let promise = new Promise(function(resolve, reject){
29167    resolve(1);
29168  });
29169
29170  promise.then(function(value){
29171    // value === 1
29172  });
29173  ```
29174
29175  Instead of writing the above, your code now simply becomes the following:
29176
29177  ```javascript
29178  let promise = Promise.resolve(1);
29179
29180  promise.then(function(value){
29181    // value === 1
29182  });
29183  ```
29184
29185  @method resolve
29186  @static
29187  @param {Any} value value that the returned promise will be resolved with
29188  Useful for tooling.
29189  @return {Promise} a promise that will become fulfilled with the given
29190  `value`
29191*/
29192function resolve$1(object) {
29193  /*jshint validthis:true */
29194  var Constructor = this;
29195
29196  if (object && typeof object === 'object' && object.constructor === Constructor) {
29197    return object;
29198  }
29199
29200  var promise = new Constructor(noop);
29201  resolve(promise, object);
29202  return promise;
29203}
29204
29205var PROMISE_ID = Math.random().toString(36).substring(2);
29206
29207function noop() {}
29208
29209var PENDING = void 0;
29210var FULFILLED = 1;
29211var REJECTED = 2;
29212
29213var TRY_CATCH_ERROR = { error: null };
29214
29215function selfFulfillment() {
29216  return new TypeError("You cannot resolve a promise with itself");
29217}
29218
29219function cannotReturnOwn() {
29220  return new TypeError('A promises callback cannot return that same promise.');
29221}
29222
29223function getThen(promise) {
29224  try {
29225    return promise.then;
29226  } catch (error) {
29227    TRY_CATCH_ERROR.error = error;
29228    return TRY_CATCH_ERROR;
29229  }
29230}
29231
29232function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
29233  try {
29234    then$$1.call(value, fulfillmentHandler, rejectionHandler);
29235  } catch (e) {
29236    return e;
29237  }
29238}
29239
29240function handleForeignThenable(promise, thenable, then$$1) {
29241  asap(function (promise) {
29242    var sealed = false;
29243    var error = tryThen(then$$1, thenable, function (value) {
29244      if (sealed) {
29245        return;
29246      }
29247      sealed = true;
29248      if (thenable !== value) {
29249        resolve(promise, value);
29250      } else {
29251        fulfill(promise, value);
29252      }
29253    }, function (reason) {
29254      if (sealed) {
29255        return;
29256      }
29257      sealed = true;
29258
29259      reject(promise, reason);
29260    }, 'Settle: ' + (promise._label || ' unknown promise'));
29261
29262    if (!sealed && error) {
29263      sealed = true;
29264      reject(promise, error);
29265    }
29266  }, promise);
29267}
29268
29269function handleOwnThenable(promise, thenable) {
29270  if (thenable._state === FULFILLED) {
29271    fulfill(promise, thenable._result);
29272  } else if (thenable._state === REJECTED) {
29273    reject(promise, thenable._result);
29274  } else {
29275    subscribe(thenable, undefined, function (value) {
29276      return resolve(promise, value);
29277    }, function (reason) {
29278      return reject(promise, reason);
29279    });
29280  }
29281}
29282
29283function handleMaybeThenable(promise, maybeThenable, then$$1) {
29284  if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
29285    handleOwnThenable(promise, maybeThenable);
29286  } else {
29287    if (then$$1 === TRY_CATCH_ERROR) {
29288      reject(promise, TRY_CATCH_ERROR.error);
29289      TRY_CATCH_ERROR.error = null;
29290    } else if (then$$1 === undefined) {
29291      fulfill(promise, maybeThenable);
29292    } else if (isFunction(then$$1)) {
29293      handleForeignThenable(promise, maybeThenable, then$$1);
29294    } else {
29295      fulfill(promise, maybeThenable);
29296    }
29297  }
29298}
29299
29300function resolve(promise, value) {
29301  if (promise === value) {
29302    reject(promise, selfFulfillment());
29303  } else if (objectOrFunction(value)) {
29304    handleMaybeThenable(promise, value, getThen(value));
29305  } else {
29306    fulfill(promise, value);
29307  }
29308}
29309
29310function publishRejection(promise) {
29311  if (promise._onerror) {
29312    promise._onerror(promise._result);
29313  }
29314
29315  publish(promise);
29316}
29317
29318function fulfill(promise, value) {
29319  if (promise._state !== PENDING) {
29320    return;
29321  }
29322
29323  promise._result = value;
29324  promise._state = FULFILLED;
29325
29326  if (promise._subscribers.length !== 0) {
29327    asap(publish, promise);
29328  }
29329}
29330
29331function reject(promise, reason) {
29332  if (promise._state !== PENDING) {
29333    return;
29334  }
29335  promise._state = REJECTED;
29336  promise._result = reason;
29337
29338  asap(publishRejection, promise);
29339}
29340
29341function subscribe(parent, child, onFulfillment, onRejection) {
29342  var _subscribers = parent._subscribers;
29343  var length = _subscribers.length;
29344
29345
29346  parent._onerror = null;
29347
29348  _subscribers[length] = child;
29349  _subscribers[length + FULFILLED] = onFulfillment;
29350  _subscribers[length + REJECTED] = onRejection;
29351
29352  if (length === 0 && parent._state) {
29353    asap(publish, parent);
29354  }
29355}
29356
29357function publish(promise) {
29358  var subscribers = promise._subscribers;
29359  var settled = promise._state;
29360
29361  if (subscribers.length === 0) {
29362    return;
29363  }
29364
29365  var child = void 0,
29366      callback = void 0,
29367      detail = promise._result;
29368
29369  for (var i = 0; i < subscribers.length; i += 3) {
29370    child = subscribers[i];
29371    callback = subscribers[i + settled];
29372
29373    if (child) {
29374      invokeCallback(settled, child, callback, detail);
29375    } else {
29376      callback(detail);
29377    }
29378  }
29379
29380  promise._subscribers.length = 0;
29381}
29382
29383function tryCatch(callback, detail) {
29384  try {
29385    return callback(detail);
29386  } catch (e) {
29387    TRY_CATCH_ERROR.error = e;
29388    return TRY_CATCH_ERROR;
29389  }
29390}
29391
29392function invokeCallback(settled, promise, callback, detail) {
29393  var hasCallback = isFunction(callback),
29394      value = void 0,
29395      error = void 0,
29396      succeeded = void 0,
29397      failed = void 0;
29398
29399  if (hasCallback) {
29400    value = tryCatch(callback, detail);
29401
29402    if (value === TRY_CATCH_ERROR) {
29403      failed = true;
29404      error = value.error;
29405      value.error = null;
29406    } else {
29407      succeeded = true;
29408    }
29409
29410    if (promise === value) {
29411      reject(promise, cannotReturnOwn());
29412      return;
29413    }
29414  } else {
29415    value = detail;
29416    succeeded = true;
29417  }
29418
29419  if (promise._state !== PENDING) {
29420    // noop
29421  } else if (hasCallback && succeeded) {
29422    resolve(promise, value);
29423  } else if (failed) {
29424    reject(promise, error);
29425  } else if (settled === FULFILLED) {
29426    fulfill(promise, value);
29427  } else if (settled === REJECTED) {
29428    reject(promise, value);
29429  }
29430}
29431
29432function initializePromise(promise, resolver) {
29433  try {
29434    resolver(function resolvePromise(value) {
29435      resolve(promise, value);
29436    }, function rejectPromise(reason) {
29437      reject(promise, reason);
29438    });
29439  } catch (e) {
29440    reject(promise, e);
29441  }
29442}
29443
29444var id = 0;
29445function nextId() {
29446  return id++;
29447}
29448
29449function makePromise(promise) {
29450  promise[PROMISE_ID] = id++;
29451  promise._state = undefined;
29452  promise._result = undefined;
29453  promise._subscribers = [];
29454}
29455
29456function validationError() {
29457  return new Error('Array Methods must be provided an Array');
29458}
29459
29460var Enumerator = function () {
29461  function Enumerator(Constructor, input) {
29462    this._instanceConstructor = Constructor;
29463    this.promise = new Constructor(noop);
29464
29465    if (!this.promise[PROMISE_ID]) {
29466      makePromise(this.promise);
29467    }
29468
29469    if (isArray(input)) {
29470      this.length = input.length;
29471      this._remaining = input.length;
29472
29473      this._result = new Array(this.length);
29474
29475      if (this.length === 0) {
29476        fulfill(this.promise, this._result);
29477      } else {
29478        this.length = this.length || 0;
29479        this._enumerate(input);
29480        if (this._remaining === 0) {
29481          fulfill(this.promise, this._result);
29482        }
29483      }
29484    } else {
29485      reject(this.promise, validationError());
29486    }
29487  }
29488
29489  Enumerator.prototype._enumerate = function _enumerate(input) {
29490    for (var i = 0; this._state === PENDING && i < input.length; i++) {
29491      this._eachEntry(input[i], i);
29492    }
29493  };
29494
29495  Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
29496    var c = this._instanceConstructor;
29497    var resolve$$1 = c.resolve;
29498
29499
29500    if (resolve$$1 === resolve$1) {
29501      var _then = getThen(entry);
29502
29503      if (_then === then && entry._state !== PENDING) {
29504        this._settledAt(entry._state, i, entry._result);
29505      } else if (typeof _then !== 'function') {
29506        this._remaining--;
29507        this._result[i] = entry;
29508      } else if (c === Promise$1) {
29509        var promise = new c(noop);
29510        handleMaybeThenable(promise, entry, _then);
29511        this._willSettleAt(promise, i);
29512      } else {
vendor: 15,768 bytes, lines 29513-30119
29513        this._willSettleAt(new c(function (resolve$$1) {
29514          return resolve$$1(entry);
29515        }), i);
29516      }
29517    } else {
29518      this._willSettleAt(resolve$$1(entry), i);
29519    }
29520  };
29521
29522  Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
29523    var promise = this.promise;
29524
29525
29526    if (promise._state === PENDING) {
29527      this._remaining--;
29528
29529      if (state === REJECTED) {
29530        reject(promise, value);
29531      } else {
29532        this._result[i] = value;
29533      }
29534    }
29535
29536    if (this._remaining === 0) {
29537      fulfill(promise, this._result);
29538    }
29539  };
29540
29541  Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
29542    var enumerator = this;
29543
29544    subscribe(promise, undefined, function (value) {
29545      return enumerator._settledAt(FULFILLED, i, value);
29546    }, function (reason) {
29547      return enumerator._settledAt(REJECTED, i, reason);
29548    });
29549  };
29550
29551  return Enumerator;
29552}();
29553
29554/**
29555  `Promise.all` accepts an array of promises, and returns a new promise which
29556  is fulfilled with an array of fulfillment values for the passed promises, or
29557  rejected with the reason of the first passed promise to be rejected. It casts all
29558  elements of the passed iterable to promises as it runs this algorithm.
29559
29560  Example:
29561
29562  ```javascript
29563  let promise1 = resolve(1);
29564  let promise2 = resolve(2);
29565  let promise3 = resolve(3);
29566  let promises = [ promise1, promise2, promise3 ];
29567
29568  Promise.all(promises).then(function(array){
29569    // The array here would be [ 1, 2, 3 ];
29570  });
29571  ```
29572
29573  If any of the `promises` given to `all` are rejected, the first promise
29574  that is rejected will be given as an argument to the returned promises's
29575  rejection handler. For example:
29576
29577  Example:
29578
29579  ```javascript
29580  let promise1 = resolve(1);
29581  let promise2 = reject(new Error("2"));
29582  let promise3 = reject(new Error("3"));
29583  let promises = [ promise1, promise2, promise3 ];
29584
29585  Promise.all(promises).then(function(array){
29586    // Code here never runs because there are rejected promises!
29587  }, function(error) {
29588    // error.message === "2"
29589  });
29590  ```
29591
29592  @method all
29593  @static
29594  @param {Array} entries array of promises
29595  @param {String} label optional string for labeling the promise.
29596  Useful for tooling.
29597  @return {Promise} promise that is fulfilled when all `promises` have been
29598  fulfilled, or rejected if any of them become rejected.
29599  @static
29600*/
29601function all(entries) {
29602  return new Enumerator(this, entries).promise;
29603}
29604
29605/**
29606  `Promise.race` returns a new promise which is settled in the same way as the
29607  first passed promise to settle.
29608
29609  Example:
29610
29611  ```javascript
29612  let promise1 = new Promise(function(resolve, reject){
29613    setTimeout(function(){
29614      resolve('promise 1');
29615    }, 200);
29616  });
29617
29618  let promise2 = new Promise(function(resolve, reject){
29619    setTimeout(function(){
29620      resolve('promise 2');
29621    }, 100);
29622  });
29623
29624  Promise.race([promise1, promise2]).then(function(result){
29625    // result === 'promise 2' because it was resolved before promise1
29626    // was resolved.
29627  });
29628  ```
29629
29630  `Promise.race` is deterministic in that only the state of the first
29631  settled promise matters. For example, even if other promises given to the
29632  `promises` array argument are resolved, but the first settled promise has
29633  become rejected before the other promises became fulfilled, the returned
29634  promise will become rejected:
29635
29636  ```javascript
29637  let promise1 = new Promise(function(resolve, reject){
29638    setTimeout(function(){
29639      resolve('promise 1');
29640    }, 200);
29641  });
29642
29643  let promise2 = new Promise(function(resolve, reject){
29644    setTimeout(function(){
29645      reject(new Error('promise 2'));
29646    }, 100);
29647  });
29648
29649  Promise.race([promise1, promise2]).then(function(result){
29650    // Code here never runs
29651  }, function(reason){
29652    // reason.message === 'promise 2' because promise 2 became rejected before
29653    // promise 1 became fulfilled
29654  });
29655  ```
29656
29657  An example real-world use case is implementing timeouts:
29658
29659  ```javascript
29660  Promise.race([ajax('foo.json'), timeout(5000)])
29661  ```
29662
29663  @method race
29664  @static
29665  @param {Array} promises array of promises to observe
29666  Useful for tooling.
29667  @return {Promise} a promise which settles in the same way as the first passed
29668  promise to settle.
29669*/
29670function race(entries) {
29671  /*jshint validthis:true */
29672  var Constructor = this;
29673
29674  if (!isArray(entries)) {
29675    return new Constructor(function (_, reject) {
29676      return reject(new TypeError('You must pass an array to race.'));
29677    });
29678  } else {
29679    return new Constructor(function (resolve, reject) {
29680      var length = entries.length;
29681      for (var i = 0; i < length; i++) {
29682        Constructor.resolve(entries[i]).then(resolve, reject);
29683      }
29684    });
29685  }
29686}
29687
29688/**
29689  `Promise.reject` returns a promise rejected with the passed `reason`.
29690  It is shorthand for the following:
29691
29692  ```javascript
29693  let promise = new Promise(function(resolve, reject){
29694    reject(new Error('WHOOPS'));
29695  });
29696
29697  promise.then(function(value){
29698    // Code here doesn't run because the promise is rejected!
29699  }, function(reason){
29700    // reason.message === 'WHOOPS'
29701  });
29702  ```
29703
29704  Instead of writing the above, your code now simply becomes the following:
29705
29706  ```javascript
29707  let promise = Promise.reject(new Error('WHOOPS'));
29708
29709  promise.then(function(value){
29710    // Code here doesn't run because the promise is rejected!
29711  }, function(reason){
29712    // reason.message === 'WHOOPS'
29713  });
29714  ```
29715
29716  @method reject
29717  @static
29718  @param {Any} reason value that the returned promise will be rejected with.
29719  Useful for tooling.
29720  @return {Promise} a promise rejected with the given `reason`.
29721*/
29722function reject$1(reason) {
29723  /*jshint validthis:true */
29724  var Constructor = this;
29725  var promise = new Constructor(noop);
29726  reject(promise, reason);
29727  return promise;
29728}
29729
29730function needsResolver() {
29731  throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
29732}
29733
29734function needsNew() {
29735  throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
29736}
29737
29738/**
29739  Promise objects represent the eventual result of an asynchronous operation. The
29740  primary way of interacting with a promise is through its `then` method, which
29741  registers callbacks to receive either a promise's eventual value or the reason
29742  why the promise cannot be fulfilled.
29743
29744  Terminology
29745  -----------
29746
29747  - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
29748  - `thenable` is an object or function that defines a `then` method.
29749  - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
29750  - `exception` is a value that is thrown using the throw statement.
29751  - `reason` is a value that indicates why a promise was rejected.
29752  - `settled` the final resting state of a promise, fulfilled or rejected.
29753
29754  A promise can be in one of three states: pending, fulfilled, or rejected.
29755
29756  Promises that are fulfilled have a fulfillment value and are in the fulfilled
29757  state.  Promises that are rejected have a rejection reason and are in the
29758  rejected state.  A fulfillment value is never a thenable.
29759
29760  Promises can also be said to *resolve* a value.  If this value is also a
29761  promise, then the original promise's settled state will match the value's
29762  settled state.  So a promise that *resolves* a promise that rejects will
29763  itself reject, and a promise that *resolves* a promise that fulfills will
29764  itself fulfill.
29765
29766
29767  Basic Usage:
29768  ------------
29769
29770  ```js
29771  let promise = new Promise(function(resolve, reject) {
29772    // on success
29773    resolve(value);
29774
29775    // on failure
29776    reject(reason);
29777  });
29778
29779  promise.then(function(value) {
29780    // on fulfillment
29781  }, function(reason) {
29782    // on rejection
29783  });
29784  ```
29785
29786  Advanced Usage:
29787  ---------------
29788
29789  Promises shine when abstracting away asynchronous interactions such as
29790  `XMLHttpRequest`s.
29791
29792  ```js
29793  function getJSON(url) {
29794    return new Promise(function(resolve, reject){
29795      let xhr = new XMLHttpRequest();
29796
29797      xhr.open('GET', url);
29798      xhr.onreadystatechange = handler;
29799      xhr.responseType = 'json';
29800      xhr.setRequestHeader('Accept', 'application/json');
29801      xhr.send();
29802
29803      function handler() {
29804        if (this.readyState === this.DONE) {
29805          if (this.status === 200) {
29806            resolve(this.response);
29807          } else {
29808            reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
29809          }
29810        }
29811      };
29812    });
29813  }
29814
29815  getJSON('/posts.json').then(function(json) {
29816    // on fulfillment
29817  }, function(reason) {
29818    // on rejection
29819  });
29820  ```
29821
29822  Unlike callbacks, promises are great composable primitives.
29823
29824  ```js
29825  Promise.all([
29826    getJSON('/posts'),
29827    getJSON('/comments')
29828  ]).then(function(values){
29829    values[0] // => postsJSON
29830    values[1] // => commentsJSON
29831
29832    return values;
29833  });
29834  ```
29835
29836  @class Promise
29837  @param {Function} resolver
29838  Useful for tooling.
29839  @constructor
29840*/
29841
29842var Promise$1 = function () {
29843  function Promise(resolver) {
29844    this[PROMISE_ID] = nextId();
29845    this._result = this._state = undefined;
29846    this._subscribers = [];
29847
29848    if (noop !== resolver) {
29849      typeof resolver !== 'function' && needsResolver();
29850      this instanceof Promise ? initializePromise(this, resolver) : needsNew();
29851    }
29852  }
29853
29854  /**
29855  The primary way of interacting with a promise is through its `then` method,
29856  which registers callbacks to receive either a promise's eventual value or the
29857  reason why the promise cannot be fulfilled.
29858   ```js
29859  findUser().then(function(user){
29860    // user is available
29861  }, function(reason){
29862    // user is unavailable, and you are given the reason why
29863  });
29864  ```
29865   Chaining
29866  --------
29867   The return value of `then` is itself a promise.  This second, 'downstream'
29868  promise is resolved with the return value of the first promise's fulfillment
29869  or rejection handler, or rejected if the handler throws an exception.
29870   ```js
29871  findUser().then(function (user) {
29872    return user.name;
29873  }, function (reason) {
29874    return 'default name';
29875  }).then(function (userName) {
29876    // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
29877    // will be `'default name'`
29878  });
29879   findUser().then(function (user) {
29880    throw new Error('Found user, but still unhappy');
29881  }, function (reason) {
29882    throw new Error('`findUser` rejected and we're unhappy');
29883  }).then(function (value) {
29884    // never reached
29885  }, function (reason) {
29886    // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
29887    // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
29888  });
29889  ```
29890  If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
29891   ```js
29892  findUser().then(function (user) {
29893    throw new PedagogicalException('Upstream error');
29894  }).then(function (value) {
29895    // never reached
29896  }).then(function (value) {
29897    // never reached
29898  }, function (reason) {
29899    // The `PedgagocialException` is propagated all the way down to here
29900  });
29901  ```
29902   Assimilation
29903  ------------
29904   Sometimes the value you want to propagate to a downstream promise can only be
29905  retrieved asynchronously. This can be achieved by returning a promise in the
29906  fulfillment or rejection handler. The downstream promise will then be pending
29907  until the returned promise is settled. This is called *assimilation*.
29908   ```js
29909  findUser().then(function (user) {
29910    return findCommentsByAuthor(user);
29911  }).then(function (comments) {
29912    // The user's comments are now available
29913  });
29914  ```
29915   If the assimliated promise rejects, then the downstream promise will also reject.
29916   ```js
29917  findUser().then(function (user) {
29918    return findCommentsByAuthor(user);
29919  }).then(function (comments) {
29920    // If `findCommentsByAuthor` fulfills, we'll have the value here
29921  }, function (reason) {
29922    // If `findCommentsByAuthor` rejects, we'll have the reason here
29923  });
29924  ```
29925   Simple Example
29926  --------------
29927   Synchronous Example
29928   ```javascript
29929  let result;
29930   try {
29931    result = findResult();
29932    // success
29933  } catch(reason) {
29934    // failure
29935  }
29936  ```
29937   Errback Example
29938   ```js
29939  findResult(function(result, err){
29940    if (err) {
29941      // failure
29942    } else {
29943      // success
29944    }
29945  });
29946  ```
29947   Promise Example;
29948   ```javascript
29949  findResult().then(function(result){
29950    // success
29951  }, function(reason){
29952    // failure
29953  });
29954  ```
29955   Advanced Example
29956  --------------
29957   Synchronous Example
29958   ```javascript
29959  let author, books;
29960   try {
29961    author = findAuthor();
29962    books  = findBooksByAuthor(author);
29963    // success
29964  } catch(reason) {
29965    // failure
29966  }
29967  ```
29968   Errback Example
29969   ```js
29970   function foundBooks(books) {
29971   }
29972   function failure(reason) {
29973   }
29974   findAuthor(function(author, err){
29975    if (err) {
29976      failure(err);
29977      // failure
29978    } else {
29979      try {
29980        findBoooksByAuthor(author, function(books, err) {
29981          if (err) {
29982            failure(err);
29983          } else {
29984            try {
29985              foundBooks(books);
29986            } catch(reason) {
29987              failure(reason);
29988            }
29989          }
29990        });
29991      } catch(error) {
29992        failure(err);
29993      }
29994      // success
29995    }
29996  });
29997  ```
29998   Promise Example;
29999   ```javascript
30000  findAuthor().
30001    then(findBooksByAuthor).
30002    then(function(books){
30003      // found books
30004  }).catch(function(reason){
30005    // something went wrong
30006  });
30007  ```
30008   @method then
30009  @param {Function} onFulfilled
30010  @param {Function} onRejected
30011  Useful for tooling.
30012  @return {Promise}
30013  */
30014
30015  /**
30016  `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
30017  as the catch block of a try/catch statement.
30018  ```js
30019  function findAuthor(){
30020  throw new Error('couldn't find that author');
30021  }
30022  // synchronous
30023  try {
30024  findAuthor();
30025  } catch(reason) {
30026  // something went wrong
30027  }
30028  // async with promises
30029  findAuthor().catch(function(reason){
30030  // something went wrong
30031  });
30032  ```
30033  @method catch
30034  @param {Function} onRejection
30035  Useful for tooling.
30036  @return {Promise}
30037  */
30038
30039
30040  Promise.prototype.catch = function _catch(onRejection) {
30041    return this.then(null, onRejection);
30042  };
30043
30044  /**
30045    `finally` will be invoked regardless of the promise's fate just as native
30046    try/catch/finally behaves
30047  
30048    Synchronous example:
30049  
30050    ```js
30051    findAuthor() {
30052      if (Math.random() > 0.5) {
30053        throw new Error();
30054      }
30055      return new Author();
30056    }
30057  
30058    try {
30059      return findAuthor(); // succeed or fail
30060    } catch(error) {
30061      return findOtherAuther();
30062    } finally {
30063      // always runs
30064      // doesn't affect the return value
30065    }
30066    ```
30067  
30068    Asynchronous example:
30069  
30070    ```js
30071    findAuthor().catch(function(reason){
30072      return findOtherAuther();
30073    }).finally(function(){
30074      // author was either found, or not
30075    });
30076    ```
30077  
30078    @method finally
30079    @param {Function} callback
30080    @return {Promise}
30081  */
30082
30083
30084  Promise.prototype.finally = function _finally(callback) {
30085    var promise = this;
30086    var constructor = promise.constructor;
30087
30088    if (isFunction(callback)) {
30089      return promise.then(function (value) {
30090        return constructor.resolve(callback()).then(function () {
30091          return value;
30092        });
30093      }, function (reason) {
30094        return constructor.resolve(callback()).then(function () {
30095          throw reason;
30096        });
30097      });
30098    }
30099
30100    return promise.then(callback, callback);
30101  };
30102
30103  return Promise;
30104}();
30105
30106Promise$1.prototype.then = then;
30107Promise$1.all = all;
30108Promise$1.race = race;
30109Promise$1.resolve = resolve$1;
30110Promise$1.reject = reject$1;
30111Promise$1._setScheduler = setScheduler;
30112Promise$1._setAsap = setAsap;
30113Promise$1._asap = asap;
30114
30115/*global self*/
30116function polyfill() {
30117  var local = void 0;
30118
30119  if (typeof 
vendor: 748 bytes, lines 30119-30161
30119commonjsGlobal !== 'undefined') {
30120    local = commonjsGlobal;
30121  } else if (typeof self !== 'undefined') {
30122    local = self;
30123  } else {
30124    try {
30125      local = Function('return this')();
30126    } catch (e) {
30127      throw new Error('polyfill failed because global object is unavailable in this environment');
30128    }
30129  }
30130
30131  var P = local.Promise;
30132
30133  if (P) {
30134    var promiseToString = null;
30135    try {
30136      promiseToString = Object.prototype.toString.call(P.resolve());
30137    } catch (e) {
30138      // silently ignored
30139    }
30140
30141    if (promiseToString === '[object Promise]' && !P.cast) {
30142      return;
30143    }
30144  }
30145
30146  local.Promise = Promise$1;
30147}
30148
30149// Strange compat..
30150Promise$1.polyfill = polyfill;
30151Promise$1.Promise = Promise$1;
30152
30153return Promise$1;
30154
30155})));
30156
30157
30158
30159
30160});
30161
vendor: 10,711 bytes, lines 30162-30499
30162var Promise$1 = es6Promise.Promise;
30163
30164/* ----- CONSTRUCTOR ----- */
30165
30166var Worker = function Worker(opt) {
30167  // Create the root parent for the proto chain, and the starting Worker.
30168  var root = _extends(Worker.convert(Promise$1.resolve()), JSON.parse(JSON.stringify(Worker.template)));
30169  var self = Worker.convert(Promise$1.resolve(), root);
30170
30171  // Set progress, optional settings, and return.
30172  self = self.setProgress(1, Worker, 1, [Worker]);
30173  self = self.set(opt);
30174  return self;
30175};
30176
30177// Boilerplate for subclassing Promise.
30178Worker.prototype = Object.create(Promise$1.prototype);
30179Worker.prototype.constructor = Worker;
30180
30181// Converts/casts promises into Workers.
30182Worker.convert = function convert(promise, inherit) {
30183  // Uses prototypal inheritance to receive changes made to ancestors' properties.
30184  promise.__proto__ = inherit || Worker.prototype;
30185  return promise;
30186};
30187
30188Worker.template = {
30189  prop: {
30190    src: null,
30191    container: null,
30192    overlay: null,
30193    canvas: null,
30194    img: null,
30195    pdf: null,
30196    pageSize: null
30197  },
30198  progress: {
30199    val: 0,
30200    state: null,
30201    n: 0,
30202    stack: []
30203  },
30204  opt: {
30205    filename: 'file.pdf',
30206    margin: [0, 0, 0, 0],
30207    image: { type: 'jpeg', quality: 0.95 },
30208    enableLinks: true,
30209    html2canvas: {},
30210    jsPDF: {}
30211  }
30212};
30213
30214/* ----- FROM / TO ----- */
30215
30216Worker.prototype.from = function from(src, type) {
30217  function getType(src) {
30218    switch (objType(src)) {
30219      case 'string':
30220        return 'string';
30221      case 'element':
30222        return src.nodeName.toLowerCase === 'canvas' ? 'canvas' : 'element';
30223      default:
30224        return 'unknown';
30225    }
30226  }
30227
30228  return this.then(function from_main() {
30229    type = type || getType(src);
30230    switch (type) {
30231      case 'string':
30232        return this.set({ src: createElement('div', { innerHTML: src }) });
30233      case 'element':
30234        return this.set({ src: src });
30235      case 'canvas':
30236        return this.set({ canvas: src });
30237      case 'img':
30238        return this.set({ img: src });
30239      default:
30240        return this.error('Unknown source type.');
30241    }
30242  });
30243};
30244
30245Worker.prototype.to = function to(target) {
30246  // Route the 'to' request to the appropriate method.
30247  switch (target) {
30248    case 'container':
30249      return this.toContainer();
30250    case 'canvas':
30251      return this.toCanvas();
30252    case 'img':
30253      return this.toImg();
30254    case 'pdf':
30255      return this.toPdf();
30256    default:
30257      return this.error('Invalid target.');
30258  }
30259};
30260
30261Worker.prototype.toContainer = function toContainer() {
30262  // Set up function prerequisites.
30263  var prereqs = [function checkSrc() {
30264    return this.prop.src || this.error('Cannot duplicate - no source HTML.');
30265  }, function checkPageSize() {
30266    return this.prop.pageSize || this.setPageSize();
30267  }];
30268
30269  return this.thenList(prereqs).then(function toContainer_main() {
30270    // Define the CSS styles for the container and its overlay parent.
30271    var overlayCSS = {
30272      position: 'fixed', overflow: 'hidden', zIndex: 1000,
30273      left: 0, right: 0, bottom: 0, top: 0,
30274      backgroundColor: 'rgba(0,0,0,0.8)'
30275    };
30276    var containerCSS = {
30277      position: 'absolute', width: this.prop.pageSize.inner.width + this.prop.pageSize.unit,
30278      left: 0, right: 0, top: 0, height: 'auto', margin: 'auto',
30279      backgroundColor: 'white'
30280    };
30281
30282    // Set the overlay to hidden (could be changed in the future to provide a print preview).
30283    overlayCSS.opacity = 0;
30284
30285    // Create and attach the elements.
30286    var source = cloneNode(this.prop.src, this.opt.html2canvas.javascriptEnabled);
30287    this.prop.overlay = createElement('div', { className: 'html2pdf__overlay', style: overlayCSS });
30288    this.prop.container = createElement('div', { className: 'html2pdf__container', style: containerCSS });
30289    this.prop.container.appendChild(source);
30290    this.prop.overlay.appendChild(this.prop.container);
30291    document.body.appendChild(this.prop.overlay);
30292  });
30293};
30294
30295Worker.prototype.toCanvas = function toCanvas() {
30296  // Set up function prerequisites.
30297  var prereqs = [function checkContainer() {
30298    return document.body.contains(this.prop.container) || this.toContainer();
30299  }];
30300
30301  // Fulfill prereqs then create the canvas.
30302  return this.thenList(prereqs).then(function toCanvas_main() {
30303    // Handle old-fashioned 'onrendered' argument.
30304    var options = _extends({}, this.opt.html2canvas);
30305    delete options.onrendered;
30306
30307    return html2canvas$1(this.prop.container, options);
30308  }).then(function toCanvas_post(canvas) {
30309    // Handle old-fashioned 'onrendered' argument.
30310    var onRendered = this.opt.html2canvas.onrendered || function () {};
30311    onRendered(canvas);
30312
30313    this.prop.canvas = canvas;
30314    document.body.removeChild(this.prop.overlay);
30315  });
30316};
30317
30318Worker.prototype.toImg = function toImg() {
30319  // Set up function prerequisites.
30320  var prereqs = [function checkCanvas() {
30321    return this.prop.canvas || this.toCanvas();
30322  }];
30323
30324  // Fulfill prereqs then create the image.
30325  return this.thenList(prereqs).then(function toImg_main() {
30326    var imgData = this.prop.canvas.toDataURL('image/' + this.opt.image.type, this.opt.image.quality);
30327    this.prop.img = document.createElement('img');
30328    this.prop.img.src = imgData;
30329  });
30330};
30331
30332Worker.prototype.toPdf = function toPdf() {
30333  // Set up function prerequisites.
30334  var prereqs = [function checkCanvas() {
30335    return this.prop.canvas || this.toCanvas();
30336  }];
30337
30338  // Fulfill prereqs then create the image.
30339  return this.thenList(prereqs).then(function toPdf_main() {
30340    // Create local copies of frequently used properties.
30341    var canvas = this.prop.canvas;
30342    var opt = this.opt;
30343
30344    // Calculate the number of pages.
30345    var pxFullHeight = canvas.height;
30346    var pxPageHeight = Math.floor(canvas.width * this.prop.pageSize.inner.ratio);
30347    var nPages = Math.ceil(pxFullHeight / pxPageHeight);
30348
30349    // Define pageHeight separately so it can be trimmed on the final page.
30350    var pageHeight = this.prop.pageSize.inner.height;
30351
30352    // Create a one-page canvas to split up the full image.
30353    var pageCanvas = document.createElement('canvas');
30354    var pageCtx = pageCanvas.getContext('2d');
30355    pageCanvas.width = canvas.width;
30356    pageCanvas.height = pxPageHeight;
30357
30358    // Initialize the PDF.
30359    this.prop.pdf = this.prop.pdf || new jspdf_min(opt.jsPDF);
30360
30361    for (var page = 0; page < nPages; page++) {
30362      // Trim the final page to reduce file size.
30363      if (page === nPages - 1 && pxFullHeight % pxPageHeight !== 0) {
30364        pageCanvas.height = pxFullHeight % pxPageHeight;
30365        pageHeight = pageCanvas.height * this.prop.pageSize.inner.width / pageCanvas.width;
30366      }
30367
30368      // Display the page.
30369      var w = pageCanvas.width;
30370      var h = pageCanvas.height;
30371      pageCtx.fillStyle = 'white';
30372      pageCtx.fillRect(0, 0, w, h);
30373      pageCtx.drawImage(canvas, 0, page * pxPageHeight, w, h, 0, 0, w, h);
30374
30375      // Add the page to the PDF.
30376      if (page) this.prop.pdf.addPage();
30377      var imgData = pageCanvas.toDataURL('image/' + opt.image.type, opt.image.quality);
30378      this.prop.pdf.addImage(imgData, opt.image.type, opt.margin[1], opt.margin[0], this.prop.pageSize.inner.width, pageHeight);
30379    }
30380  });
30381};
30382
30383/* ----- OUTPUT / SAVE ----- */
30384
30385Worker.prototype.output = function output(type, options, src) {
30386  // Redirect requests to the correct function (outputPdf / outputImg).
30387  src = src || 'pdf';
30388  if (src.toLowerCase() === 'img' || src.toLowerCase() === 'image') {
30389    return this.outputImg(type, options);
30390  } else {
30391    return this.outputPdf(type, options);
30392  }
30393};
30394
30395Worker.prototype.outputPdf = function outputPdf(type, options) {
30396  // Set up function prerequisites.
30397  var prereqs = [function checkPdf() {
30398    return this.prop.pdf || this.toPdf();
30399  }];
30400
30401  // Fulfill prereqs then perform the appropriate output.
30402  return this.thenList(prereqs).then(function outputPdf_main() {
30403    /* Currently implemented output types:
30404     *    https://rawgit.com/MrRio/jsPDF/master/docs/jspdf.js.html#line992
30405     *  save(options), arraybuffer, blob, bloburi/bloburl,
30406     *  datauristring/dataurlstring, dataurlnewwindow, datauri/dataurl
30407     */
30408    return this.prop.pdf.output(type, options);
30409  });
30410};
30411
30412Worker.prototype.outputImg = function outputImg(type, options) {
30413  // Set up function prerequisites.
30414  var prereqs = [function checkImg() {
30415    return this.prop.img || this.toImg();
30416  }];
30417
30418  // Fulfill prereqs then perform the appropriate output.
30419  return this.thenList(prereqs).then(function outputImg_main() {
30420    switch (type) {
30421      case undefined:
30422      case 'img':
30423        return this.prop.img;
30424      case 'datauristring':
30425      case 'dataurlstring':
30426        return this.prop.img.src;
30427      case 'datauri':
30428      case 'dataurl':
30429        return document.location.href = this.prop.img.src;
30430      default:
30431        throw 'Image output type "' + type + '" is not supported.';
30432    }
30433  });
30434};
30435
30436Worker.prototype.save = function save(filename) {
30437  // Set up function prerequisites.
30438  var prereqs = [function checkPdf() {
30439    return this.prop.pdf || this.toPdf();
30440  }];
30441
30442  // Fulfill prereqs, update the filename (if provided), and save the PDF.
30443  return this.thenList(prereqs).set(filename ? { filename: filename } : null).then(function save_main() {
30444    this.prop.pdf.save(this.opt.filename);
30445  });
30446};
30447
30448/* ----- SET / GET ----- */
30449
30450Worker.prototype.set = function set$$1(opt) {
30451  // TODO: Implement ordered pairs?
30452
30453  // Silently ignore invalid or empty input.
30454  if (objType(opt) !== 'object') {
30455    return this;
30456  }
30457
30458  // Build an array of setter functions to queue.
30459  var fns = Object.keys(opt || {}).map(function (key) {
30460    if (key in Worker.template.prop) {
30461      // Set pre-defined properties.
30462      return function set_prop() {
30463        this.prop[key] = opt[key];
30464      };
30465    } else {
30466      switch (key) {
30467        case 'margin':
30468          return this.setMargin.bind(this, opt.margin);
30469        case 'jsPDF':
30470          return function set_jsPDF() {
30471            this.opt.jsPDF = opt.jsPDF;return this.setPageSize();
30472          };
30473        case 'pageSize':
30474          return this.setPageSize.bind(this, opt.pageSize);
30475        default:
30476          // Set any other properties in opt.
30477          return function set_opt() {
30478            this.opt[key] = opt[key];
30479          };
30480      }
30481    }
30482  }, this);
30483
30484  // Set properties within the promise chain.
30485  return this.then(function set_main() {
30486    return this.thenList(fns);
30487  });
30488};
30489
30490Worker.prototype.get = function get$$1(key, cbk) {
30491  return this.then(function get_main() {
30492    // Fetch the requested property, either as a predefined prop or in opt.
30493    var val = key in Worker.template.prop ? this.prop[key] : this.opt[key];
30494    return cbk ? cbk(val) : val;
30495  });
30496};
30497
30498Worker.prototype.setMargin = function setMargin(margin) {
30499  return this.then(function setMargin_main() {
vendor: 1,750 bytes, lines 30500-30550
30500    // Parse the margin property: [top, left, bottom, right].
30501    switch (objType(margin)) {
30502      case 'number':
30503        margin = [margin, margin, margin, margin];
30504      case 'array':
30505        if (margin.length === 2) {
30506          margin = [margin[0], margin[1], margin[0], margin[1]];
30507        }
30508        if (margin.length === 4) {
30509          break;
30510        }
30511      default:
30512        return this.error('Invalid margin array.');
30513    }
30514
30515    // Set the margin property, then update pageSize.
30516    this.opt.margin = margin;
30517  }).then(this.setPageSize);
30518};
30519
30520Worker.prototype.setPageSize = function setPageSize(pageSize) {
30521  return this.then(function setPageSize_main() {
30522    // Retrieve page-size based on jsPDF settings, if not explicitly provided.
30523    pageSize = pageSize || jspdf_min.getPageSize(this.opt.jsPDF);
30524
30525    // Add 'inner' field if not present.
30526    if (!pageSize.hasOwnProperty('inner')) {
30527      pageSize.inner = {
30528        width: pageSize.width - this.opt.margin[1] - this.opt.margin[3],
30529        height: pageSize.height - this.opt.margin[0] - this.opt.margin[2]
30530      };
30531      pageSize.inner.px = {
30532        width: toPx(pageSize.inner.width, pageSize.k),
30533        height: toPx(pageSize.inner.height, pageSize.k)
30534      };
30535      pageSize.inner.ratio = pageSize.inner.height / pageSize.inner.width;
30536    }
30537
30538    // Attach pageSize to this.
30539    this.prop.pageSize = pageSize;
30540  });
30541};
30542
30543Worker.prototype.setProgress = function setProgress(val, state, n, stack) {
30544  // Immediately update all progress values.
30545  if (val != null) this.progress.val = val;
30546  if (state != null) this.progress.state = state;
30547  if (n != null) this.progress.n = n;
30548  if (stack != null) this.progress.stack = stack;
30549  this.progress.ratio = this.progress.val / this.progress.state;
30550
vendor: 8,736 bytes, lines 30551-30807
30551  // Return this for command chaining.
30552  return this;
30553};
30554
30555Worker.prototype.updateProgress = function updateProgress(val, state, n, stack) {
30556  // Immediately update all progress values, using setProgress.
30557  return this.setProgress(val ? this.progress.val + val : null, state ? state : null, n ? this.progress.n + n : null, stack ? this.progress.stack.concat(stack) : null);
30558};
30559
30560/* ----- PROMISE MAPPING ----- */
30561
30562Worker.prototype.then = function then(onFulfilled, onRejected) {
30563  // Wrap `this` for encapsulation.
30564  var self = this;
30565
30566  return this.thenCore(onFulfilled, onRejected, function then_main(onFulfilled, onRejected) {
30567    // Update progress while queuing, calling, and resolving `then`.
30568    self.updateProgress(null, null, 1, [onFulfilled]);
30569    return Promise$1.prototype.then.call(this, function then_pre(val) {
30570      self.updateProgress(null, onFulfilled);
30571      return val;
30572    }).then(onFulfilled, onRejected).then(function then_post(val) {
30573      self.updateProgress(1);
30574      return val;
30575    });
30576  });
30577};
30578
30579Worker.prototype.thenCore = function thenCore(onFulfilled, onRejected, thenBase) {
30580  // Handle optional thenBase parameter.
30581  thenBase = thenBase || Promise$1.prototype.then;
30582
30583  // Wrap `this` for encapsulation and bind it to the promise handlers.
30584  var self = this;
30585  if (onFulfilled) {
30586    onFulfilled = onFulfilled.bind(self);
30587  }
30588  if (onRejected) {
30589    onRejected = onRejected.bind(self);
30590  }
30591
30592  // Cast self into a Promise to avoid polyfills recursively defining `then`.
30593  var isNative = Promise$1.toString().indexOf('[native code]') !== -1 && Promise$1.name === 'Promise';
30594  var selfPromise = isNative ? self : Worker.convert(_extends({}, self), Promise$1.prototype);
30595
30596  // Return the promise, after casting it into a Worker and preserving props.
30597  var returnVal = thenBase.call(selfPromise, onFulfilled, onRejected);
30598  return Worker.convert(returnVal, self.__proto__);
30599};
30600
30601Worker.prototype.thenExternal = function thenExternal(onFulfilled, onRejected) {
30602  // Call `then` and return a standard promise (exits the Worker chain).
30603  return Promise$1.prototype.then.call(this, onFulfilled, onRejected);
30604};
30605
30606Worker.prototype.thenList = function thenList(fns) {
30607  // Queue a series of promise 'factories' into the promise chain.
30608  var self = this;
30609  fns.forEach(function thenList_forEach(fn) {
30610    self = self.thenCore(fn);
30611  });
30612  return self;
30613};
30614
30615Worker.prototype['catch'] = function (onRejected) {
30616  // Bind `this` to the promise handler, call `catch`, and return a Worker.
30617  if (onRejected) {
30618    onRejected = onRejected.bind(this);
30619  }
30620  var returnVal = Promise$1.prototype['catch'].call(this, onRejected);
30621  return Worker.convert(returnVal, this);
30622};
30623
30624Worker.prototype.catchExternal = function catchExternal(onRejected) {
30625  // Call `catch` and return a standard promise (exits the Worker chain).
30626  return Promise$1.prototype['catch'].call(this, onRejected);
30627};
30628
30629Worker.prototype.error = function error(msg) {
30630  // Throw the error in the Promise chain.
30631  return this.then(function error_main() {
30632    throw new Error(msg);
30633  });
30634};
30635
30636/* ----- ALIASES ----- */
30637
30638Worker.prototype.using = Worker.prototype.set;
30639Worker.prototype.saveAs = Worker.prototype.save;
30640Worker.prototype.export = Worker.prototype.output;
30641Worker.prototype.run = Worker.prototype.then;
30642
30643// Import dependencies.
30644// Get dimensions of a PDF page, as determined by jsPDF.
30645jspdf_min.getPageSize = function (orientation, unit, format) {
30646  // Decode options object
30647  if ((typeof orientation === 'undefined' ? 'undefined' : _typeof(orientation)) === 'object') {
30648    var options = orientation;
30649    orientation = options.orientation;
30650    unit = options.unit || unit;
30651    format = options.format || format;
30652  }
30653
30654  // Default options
30655  unit = unit || 'mm';
30656  format = format || 'a4';
30657  orientation = ('' + (orientation || 'P')).toLowerCase();
30658  var format_as_string = ('' + format).toLowerCase();
30659
30660  // Size in pt of various paper formats
30661  var pageFormats = {
30662    'a0': [2383.94, 3370.39], 'a1': [1683.78, 2383.94],
30663    'a2': [1190.55, 1683.78], 'a3': [841.89, 1190.55],
30664    'a4': [595.28, 841.89], 'a5': [419.53, 595.28],
30665    'a6': [297.64, 419.53], 'a7': [209.76, 297.64],
30666    'a8': [147.40, 209.76], 'a9': [104.88, 147.40],
30667    'a10': [73.70, 104.88], 'b0': [2834.65, 4008.19],
30668    'b1': [2004.09, 2834.65], 'b2': [1417.32, 2004.09],
30669    'b3': [1000.63, 1417.32], 'b4': [708.66, 1000.63],
30670    'b5': [498.90, 708.66], 'b6': [354.33, 498.90],
30671    'b7': [249.45, 354.33], 'b8': [175.75, 249.45],
30672    'b9': [124.72, 175.75], 'b10': [87.87, 124.72],
30673    'c0': [2599.37, 3676.54], 'c1': [1836.85, 2599.37],
30674    'c2': [1298.27, 1836.85], 'c3': [918.43, 1298.27],
30675    'c4': [649.13, 918.43], 'c5': [459.21, 649.13],
30676    'c6': [323.15, 459.21], 'c7': [229.61, 323.15],
30677    'c8': [161.57, 229.61], 'c9': [113.39, 161.57],
30678    'c10': [79.37, 113.39], 'dl': [311.81, 623.62],
30679    'letter': [612, 792],
30680    'government-letter': [576, 756],
30681    'legal': [612, 1008],
30682    'junior-legal': [576, 360],
30683    'ledger': [1224, 792],
30684    'tabloid': [792, 1224],
30685    'credit-card': [153, 243]
30686  };
30687
30688  // Unit conversion
30689  switch (unit) {
30690    case 'pt':
30691      var k = 1;break;
30692    case 'mm':
30693      var k = 72 / 25.4;break;
30694    case 'cm':
30695      var k = 72 / 2.54;break;
30696    case 'in':
30697      var k = 72;break;
30698    case 'px':
30699      var k = 72 / 96;break;
30700    case 'pc':
30701      var k = 12;break;
30702    case 'em':
30703      var k = 12;break;
30704    case 'ex':
30705      var k = 6;break;
30706    default:
30707      throw 'Invalid unit: ' + unit;
30708  }
30709
30710  // Dimensions are stored as user units and converted to points on output
30711  if (pageFormats.hasOwnProperty(format_as_string)) {
30712    var pageHeight = pageFormats[format_as_string][1] / k;
30713    var pageWidth = pageFormats[format_as_string][0] / k;
30714  } else {
30715    try {
30716      var pageHeight = format[1];
30717      var pageWidth = format[0];
30718    } catch (err) {
30719      throw new Error('Invalid format: ' + format);
30720    }
30721  }
30722
30723  // Handle page orientation
30724  if (orientation === 'p' || orientation === 'portrait') {
30725    orientation = 'p';
30726    if (pageWidth > pageHeight) {
30727      var tmp = pageWidth;
30728      pageWidth = pageHeight;
30729      pageHeight = tmp;
30730    }
30731  } else if (orientation === 'l' || orientation === 'landscape') {
30732    orientation = 'l';
30733    if (pageHeight > pageWidth) {
30734      var tmp = pageWidth;
30735      pageWidth = pageHeight;
30736      pageHeight = tmp;
30737    }
30738  } else {
30739    throw 'Invalid orientation: ' + orientation;
30740  }
30741
30742  // Return information (k is the unit conversion ratio from pts)
30743  var info = { 'width': pageWidth, 'height': pageHeight, 'unit': unit, 'k': k };
30744  return info;
30745};
30746
30747/* Pagebreak plugin:
30748
30749    Adds page-break functionality to the html2pdf library. Page-breaks can be
30750    enabled by CSS styles, set on individual elements using selectors, or
30751    avoided from breaking inside all elements.
30752
30753    Options on the `opt.pagebreak` object:
30754
30755    mode:   String or array of strings: 'avoid-all', 'css', and/or 'legacy'
30756            Default: ['css', 'legacy']
30757
30758    before: String or array of CSS selectors for which to add page-breaks
30759            before each element. Can be a specific element with an ID
30760            ('#myID'), all elements of a type (e.g. 'img'), all of a class
30761            ('.myClass'), or even '*' to match every element.
30762
30763    after:  Like 'before', but adds a page-break immediately after the element.
30764
30765    avoid:  Like 'before', but avoids page-breaks on these elements. You can
30766            enable this feature on every element using the 'avoid-all' mode.
30767*/
30768
30769// Refs to original functions.
30770var orig = {
30771  toContainer: Worker.prototype.toContainer
30772};
30773
30774// Add pagebreak default options to the Worker template.
30775Worker.template.opt.pagebreak = {
30776  mode: ['css', 'legacy'],
30777  before: [],
30778  after: [],
30779  avoid: []
30780};
30781
30782Worker.prototype.toContainer = function toContainer() {
30783  return orig.toContainer.call(this).then(function toContainer_pagebreak() {
30784    // Setup root element and inner page height.
30785    var root = this.prop.container;
30786    var pxPageHeight = this.prop.pageSize.inner.px.height;
30787
30788    // Check all requested modes.
30789    var modeSrc = [].concat(this.opt.pagebreak.mode);
30790    var mode = {
30791      avoidAll: modeSrc.indexOf('avoid-all') !== -1,
30792      css: modeSrc.indexOf('css') !== -1,
30793      legacy: modeSrc.indexOf('legacy') !== -1
30794    };
30795
30796    // Get arrays of all explicitly requested elements.
30797    var select = {};
30798    var self = this;
30799    ['before', 'after', 'avoid'].forEach(function (key) {
30800      var all = mode.avoidAll && key === 'avoid';
30801      select[key] = all ? [] : [].concat(self.opt.pagebreak[key] || []);
30802      if (select[key].length > 0) {
30803        select[key] = Array.prototype.slice.call(root.querySelectorAll(select[key].join(', ')));
30804      }
30805    });
30806
30807    // Get all legacy page-break elements.
30808    var legacyEls = root.querySelectorAll('.html2pdf__page-break');
30809    legacyEls = Array.prototype.slice.call(legacyEls);
30810
30811    // Loop through all elements.
30812    var els = root.querySelectorAll('*');
30813    Array.prototype.forEach.call(els, function pagebreak_loop(el) {
30814      // Setup pagebreak rules based on legacy and avoidAll modes.
30815      var rules = {
30816        before: false,
30817        after: mode.legacy && legacyEls.indexOf(el) !== -1,
30818        avoid: mode.avoidAll
30819      };
30820
30821      // Add rules for css mode.
30822      if (mode.css) {
30823        // TODO: Check if this is valid with iFrames.
30824        var style = window.getComputedStyle(el);
30825        // TODO: Handle 'left' and 'right' correctly.
30826        // TODO: Add support for 'avoid' on breakBefore/After.
30827        var breakOpt = ['always', 'page', 'left', 'right'];
30828        var avoidOpt = ['avoid', 'avoid-page'];
30829        rules = {
30830          before: rules.before || breakOpt.indexOf(style.breakBefore || style.pageBreakBefore) !== -1,
30831          after: rules.after || breakOpt.indexOf(style.breakAfter || style.pageBreakAfter) !== -1,
30832          avoid: rules.avoid || avoidOpt.indexOf(style.breakInside || style.pageBreakInside) !== -1
30833        };
30834      }
30835
30836      // Add rules for explicit requests.
30837      Object.keys(rules).forEach(function (key) {
30838        rules[key] = rules[key] || select[key].indexOf(el) !== -1;
30839      });
30840
30841      // Get element position on the screen.
30842      // TODO: Subtract the top of the container from clientRect.top/bottom?
30843      var clientRect = el.getBoundingClientRect();
30844
30845      // Avoid: Check if a break happens mid-element.
30846      if (rules.avoid && !rules.before) {
30847        var startPage = Math.floor(clientRect.top / pxPageHeight);
30848        var endPage = Math.floor(clientRect.bottom / pxPageHeight);
30849        var nPages = Math.abs(clientRect.bottom - clientRect.top) / pxPageHeight;
30850
30851        // Turn on rules.before if the el is broken and is at most one page long.
30852        if (endPage !== startPage && nPages <= 1) {
30853          rules.before = true;
30854        }
30855      }
30856
30857      // Before: Create a padding div to push the element to the next page.
30858      if (rules.before) {
30859        var pad = createElement('div', { style: {
30860            display: 'block',
30861            height: pxPageHeight - clientRect.top % pxPageHeight + 'px'
30862          } });
30863        el.parentNode.insertBefore(pad, el);
30864      }
30865
30866      // After: Create a padding div to fill the remaining page.
30867      if (rules.after) {
30868        var pad = createElement('div', { style: {
30869            display: 'block',
30870            height: pxPageHeight - clientRect.bottom % pxPageHeight + 'px'
30871          } });
30872        el.parentNode.insertBefore(pad, el.nextSibling);
30873      }
30874    });
30875  });
30876};
30877
30878// Add hyperlink functionality to the PDF creation.
30879
30880// Main link array, and refs to original functions.
30881var linkInfo = [];
30882var orig$1 = {
30883  toContainer: Worker.prototype.toContainer,
30884  toPdf: Worker.prototype.toPdf
30885};
30886
30887Worker.prototype.toContainer = function toContainer() {
30888  return orig$1.toContainer.call(this).then(function toContainer_hyperlink() {
30889    // Retrieve hyperlink info if the option is enabled.
30890    if (this.opt.enableLinks) {
30891      // Find all anchor tags and get the container's bounds for reference.
30892      var container = this.prop.container;
30893      var links = container.querySelectorAll('a');
30894      var containerRect = unitConvert(container.getBoundingClientRect(), this.prop.pageSize.k);
30895      linkInfo = [];
30896
30897      // Loop through each anchor tag.
30898      Array.prototype.forEach.call(links, function (link) {
30899        // Treat each client rect as a separate link (for text-wrapping).
30900        var clientRects = link.getClientRects();
30901        for (var i = 0; i < clientRects.length; i++) {
30902          var clientRect = unitConvert(clientRects[i], this.prop.pageSize.k);
30903          clientRect.left -= containerRect.left;
30904          clientRect.top -= containerRect.top;
30905
30906          var page = Math.floor(clientRect.top / this.prop.pageSize.inner.height) + 1;
30907          var top = this.opt.margin[0] + clientRect.top % this.prop.pageSize.inner.height;
30908          var left = this.opt.margin[1] + clientRect.left;
30909
30910          linkInfo.push({ page: page, top: top, left: left, clientRect: clientRect, link: link });
30911        }
30912      }, this);
30913    }
30914  });
30915};
30916
30917Worker.prototype.toPdf = function toPdf() {
30918  return orig$1.toPdf.call(this).then(function toPdf_hyperlink() {
30919    // Add hyperlinks if the option is enabled.
30920    if (this.opt.enableLinks) {
30921      // Attach each anchor tag based on info from toContainer().
30922      linkInfo.forEach(function (l) {
30923        this.prop.pdf.setPage(l.page);
30924        this.prop.pdf.link(l.left, l.top, l.clientRect.width, l.clientRect.height, { url: l.link.href });
30925      }, this);
30926
30927      // Reset the active page of the PDF to the final page.
30928      var nPages = this.prop.pdf.internal.getNumberOfPages();
30929      this.prop.pdf.setPage(nPages);
30930    }
30931  });
30932};
30933
30934/**
30935 * Generate a PDF from an HTML element or string using html2canvas and jsPDF.
30936 *
30937 * @param {Element|string} source The source element or HTML string.
30938 * @param {Object=} opt An object of optional settings: 'margin', 'filename',
30939 *    'image' ('type' and 'quality'), and 'html2canvas' / 'jspdf', which are
30940 *    sent as settings to their corresponding functions.
30941 */
30942var html2pdf = function html2pdf(src, opt) {
30943  // Create a new worker with the given options.
30944  var worker = new html2pdf.Worker(opt);
30945
30946  if (src) {
30947    // If src is specified, perform the traditional 'simple' operation.
30948    return worker.from(src).save();
30949  } else {
30950    // Otherwise, return the worker for new Promise-based operation.
30951    return worker;
30952  }
30953};
30954html2pdf.Worker = Worker;
30955
30956return html2pdf;
30957
30958})));
30959
30960/*  search-fixheight  */
30961/**
30962 * Component searchEqualHeight
30963 * makes height of search results elements the same
30964 * @deprecated Latest Theme version use flexboxes.
30965 * @module searchEqualHeight
30966 * @param  {jQuery} $ Instance of jQuery
30967 * @return {Object} List of searchEqualHeight methods
30968 */
30969XA.component.searchEqualHeight = (function ($) {
30970    /**
30971    * List of selectors for calculating height functionality
30972    * @type {Object.<Methods>}
30973    * @memberOf module:searchEqualHeight
30974    */
30975    var settings = {
30976        parentSelector: '.search-results.components',
30977        selector: 'li'
30978    };
30979    /**
30980    * This object stores all public api methods
30981    * @type {Object.<Methods>}
30982    * @memberOf module:searchEqualHeight
30983    */
30984    var api = {};
30985    /**
30986    * fixHeight method calculates height of bigger element 
30987    * and sets up the same size for other elements
30988    * @memberOf module:searchEqualHeight
30989    * @alias module:searchEqualHeight.fixHeight
30990    */
30991    function fixHeight() {
30992
30993        $(settings.parentSelector).each(function () {
30994            var $elements = $(this).find(settings.selector),
30995                maxHeight = 0,
30996                maxPadding = 0;
30997
30998            $elements.each(function () {
30999                $(this).css('min-height', 'inherit');
31000
31001                if ($(this).height() > maxHeight) {
31002                    maxHeight = $(this).outerHeight(true);
31003                }
31004
31005            });
31006
31007            if (maxHeight > 0) {
31008                $elements.css({
31009                    'padding-bottom': maxPadding,
31010                    'min-height': maxHeight
31011                });
31012            }
31013        });
31014    }
31015    /**
31016    * init method binds call of 
31017    * ["fixHeight"]{@link module:searchEqualHeight.fixHeight} method
31018    * for window load and resize events
31019    * @memberOf module:searchEqualHeight
31020    * @alias module:searchEqualHeight.init
31021     */
31022    api.init = function () {
31023        //Latest Theme version use flexboxes.
31024        //If you don`t want use flex, you must 
31025        //uncomment code below
31026
31027        /* $(document).ready(function() {
31028             setTimeout(fixHeight, 0);
31029         });
31030 
31031         $(window).bind('resize', function() {
31032             fixHeight();
31033         });
31034         */
31035    };
31036    return api;
31037}(jQuery, document));
31038
31039XA.register("searchEqualHeight", XA.component.searchEqualHeight);
31040

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.